@kubit-ui-web/react-charts 1.5.1 → 1.6.0

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 (156) hide show
  1. package/dist/cjs/components/focusRing/components/FocusRingInline.d.ts +25 -0
  2. package/dist/cjs/components/focusRing/components/FocusRingInline.d.ts.map +1 -0
  3. package/dist/cjs/components/focusRing/components/FocusRingInline.js +37 -0
  4. package/dist/cjs/components/focusRing/components/FocusRingRenderer.d.ts +13 -0
  5. package/dist/cjs/components/focusRing/components/FocusRingRenderer.d.ts.map +1 -0
  6. package/dist/cjs/components/focusRing/components/FocusRingRenderer.js +25 -0
  7. package/dist/cjs/components/focusRing/components/FocusRingSeparate.d.ts +40 -0
  8. package/dist/cjs/components/focusRing/components/FocusRingSeparate.d.ts.map +1 -0
  9. package/dist/cjs/components/focusRing/components/FocusRingSeparate.js +45 -0
  10. package/dist/cjs/components/focusRing/focusRing.css +14 -0
  11. package/dist/cjs/components/focusRing/focusRing.d.ts +35 -0
  12. package/dist/cjs/components/focusRing/focusRing.d.ts.map +1 -0
  13. package/dist/cjs/components/focusRing/focusRing.js +44 -0
  14. package/dist/cjs/components/focusRing/focusRing.types.d.ts +40 -0
  15. package/dist/cjs/components/focusRing/focusRing.types.d.ts.map +1 -0
  16. package/dist/cjs/components/focusRing/focusRing.types.js +1 -0
  17. package/dist/cjs/components/focusRing/hooks/useFocusRingData.d.ts +27 -0
  18. package/dist/cjs/components/focusRing/hooks/useFocusRingData.d.ts.map +1 -0
  19. package/dist/cjs/components/focusRing/hooks/useFocusRingData.js +67 -0
  20. package/dist/cjs/components/focusRing/index.d.ts +3 -0
  21. package/dist/cjs/components/focusRing/index.d.ts.map +1 -0
  22. package/dist/cjs/components/focusRing/index.js +1 -0
  23. package/dist/cjs/components/focusRing/utils/composeRefs.d.ts +7 -0
  24. package/dist/cjs/components/focusRing/utils/composeRefs.d.ts.map +1 -0
  25. package/dist/cjs/components/focusRing/utils/composeRefs.js +16 -0
  26. package/dist/cjs/components/focusRing/utils/createAdaptiveFocusRings.d.ts +24 -0
  27. package/dist/cjs/components/focusRing/utils/createAdaptiveFocusRings.d.ts.map +1 -0
  28. package/dist/cjs/components/focusRing/utils/createAdaptiveFocusRings.js +141 -0
  29. package/dist/cjs/components/focusRing/utils/createBoundingBoxFocusRings.d.ts +33 -0
  30. package/dist/cjs/components/focusRing/utils/createBoundingBoxFocusRings.d.ts.map +1 -0
  31. package/dist/cjs/components/focusRing/utils/createBoundingBoxFocusRings.js +126 -0
  32. package/dist/cjs/components/focusRing/utils/utils.types.d.ts +52 -0
  33. package/dist/cjs/components/focusRing/utils/utils.types.d.ts.map +1 -0
  34. package/dist/cjs/components/focusRing/utils/utils.types.js +1 -0
  35. package/dist/cjs/components/index.d.ts +1 -0
  36. package/dist/cjs/components/index.d.ts.map +1 -1
  37. package/dist/cjs/components/index.js +1 -0
  38. package/dist/cjs/components/plot/plot.d.ts.map +1 -1
  39. package/dist/cjs/components/plot/plot.js +7 -19
  40. package/dist/cjs/components/zoomArea/components/SelectionArea.d.ts +3 -23
  41. package/dist/cjs/components/zoomArea/components/SelectionArea.d.ts.map +1 -1
  42. package/dist/cjs/components/zoomArea/components/SelectionArea.js +7 -39
  43. package/dist/cjs/components/zoomArea/components/ZoomHandler.d.ts +3 -3
  44. package/dist/cjs/components/zoomArea/components/ZoomHandler.d.ts.map +1 -1
  45. package/dist/cjs/components/zoomArea/components/ZoomHandler.js +2 -15
  46. package/dist/cjs/components/zoomArea/components/index.d.ts +1 -1
  47. package/dist/cjs/components/zoomArea/components/index.d.ts.map +1 -1
  48. package/dist/cjs/components/zoomArea/components/index.js +1 -1
  49. package/dist/cjs/components/zoomArea/zoomArea.js +6 -6
  50. package/dist/cjs/components/zoomArea/zoomArea.type.d.ts +1 -1
  51. package/dist/cjs/components/zoomArea/zoomArea.type.d.ts.map +1 -1
  52. package/dist/cjs/types/focusConfig.type.d.ts +15 -3
  53. package/dist/cjs/types/focusConfig.type.d.ts.map +1 -1
  54. package/dist/cjs/types/focusConfig.type.js +14 -1
  55. package/dist/esm/components/focusRing/components/FocusRingInline.d.ts +25 -0
  56. package/dist/esm/components/focusRing/components/FocusRingInline.d.ts.map +1 -0
  57. package/dist/esm/components/focusRing/components/FocusRingInline.js +37 -0
  58. package/dist/esm/components/focusRing/components/FocusRingRenderer.d.ts +13 -0
  59. package/dist/esm/components/focusRing/components/FocusRingRenderer.d.ts.map +1 -0
  60. package/dist/esm/components/focusRing/components/FocusRingRenderer.js +25 -0
  61. package/dist/esm/components/focusRing/components/FocusRingSeparate.d.ts +40 -0
  62. package/dist/esm/components/focusRing/components/FocusRingSeparate.d.ts.map +1 -0
  63. package/dist/esm/components/focusRing/components/FocusRingSeparate.js +45 -0
  64. package/dist/esm/components/focusRing/focusRing.css +14 -0
  65. package/dist/esm/components/focusRing/focusRing.d.ts +35 -0
  66. package/dist/esm/components/focusRing/focusRing.d.ts.map +1 -0
  67. package/dist/esm/components/focusRing/focusRing.js +44 -0
  68. package/dist/esm/components/focusRing/focusRing.types.d.ts +40 -0
  69. package/dist/esm/components/focusRing/focusRing.types.d.ts.map +1 -0
  70. package/dist/esm/components/focusRing/focusRing.types.js +1 -0
  71. package/dist/esm/components/focusRing/hooks/useFocusRingData.d.ts +27 -0
  72. package/dist/esm/components/focusRing/hooks/useFocusRingData.d.ts.map +1 -0
  73. package/dist/esm/components/focusRing/hooks/useFocusRingData.js +67 -0
  74. package/dist/esm/components/focusRing/index.d.ts +3 -0
  75. package/dist/esm/components/focusRing/index.d.ts.map +1 -0
  76. package/dist/esm/components/focusRing/index.js +1 -0
  77. package/dist/esm/components/focusRing/utils/composeRefs.d.ts +7 -0
  78. package/dist/esm/components/focusRing/utils/composeRefs.d.ts.map +1 -0
  79. package/dist/esm/components/focusRing/utils/composeRefs.js +16 -0
  80. package/dist/esm/components/focusRing/utils/createAdaptiveFocusRings.d.ts +24 -0
  81. package/dist/esm/components/focusRing/utils/createAdaptiveFocusRings.d.ts.map +1 -0
  82. package/dist/esm/components/focusRing/utils/createAdaptiveFocusRings.js +141 -0
  83. package/dist/esm/components/focusRing/utils/createBoundingBoxFocusRings.d.ts +33 -0
  84. package/dist/esm/components/focusRing/utils/createBoundingBoxFocusRings.d.ts.map +1 -0
  85. package/dist/esm/components/focusRing/utils/createBoundingBoxFocusRings.js +126 -0
  86. package/dist/esm/components/focusRing/utils/utils.types.d.ts +52 -0
  87. package/dist/esm/components/focusRing/utils/utils.types.d.ts.map +1 -0
  88. package/dist/esm/components/focusRing/utils/utils.types.js +1 -0
  89. package/dist/esm/components/index.d.ts +1 -0
  90. package/dist/esm/components/index.d.ts.map +1 -1
  91. package/dist/esm/components/index.js +1 -0
  92. package/dist/esm/components/plot/plot.d.ts.map +1 -1
  93. package/dist/esm/components/plot/plot.js +7 -19
  94. package/dist/esm/components/zoomArea/components/SelectionArea.d.ts +3 -23
  95. package/dist/esm/components/zoomArea/components/SelectionArea.d.ts.map +1 -1
  96. package/dist/esm/components/zoomArea/components/SelectionArea.js +7 -39
  97. package/dist/esm/components/zoomArea/components/ZoomHandler.d.ts +3 -3
  98. package/dist/esm/components/zoomArea/components/ZoomHandler.d.ts.map +1 -1
  99. package/dist/esm/components/zoomArea/components/ZoomHandler.js +2 -15
  100. package/dist/esm/components/zoomArea/components/index.d.ts +1 -1
  101. package/dist/esm/components/zoomArea/components/index.d.ts.map +1 -1
  102. package/dist/esm/components/zoomArea/components/index.js +1 -1
  103. package/dist/esm/components/zoomArea/zoomArea.js +6 -6
  104. package/dist/esm/components/zoomArea/zoomArea.type.d.ts +1 -1
  105. package/dist/esm/components/zoomArea/zoomArea.type.d.ts.map +1 -1
  106. package/dist/esm/types/focusConfig.type.d.ts +15 -3
  107. package/dist/esm/types/focusConfig.type.d.ts.map +1 -1
  108. package/dist/esm/types/focusConfig.type.js +14 -1
  109. package/dist/kubit-ui-web-react-charts.cjs.js +1 -1
  110. package/dist/kubit-ui-web-react-charts.es.js +1 -1
  111. package/dist/kubit-ui-web-react-charts.umd.js +1 -1
  112. package/dist/react-charts.css +1 -1
  113. package/dist/types/components/focusRing/components/FocusRingInline.d.ts +25 -0
  114. package/dist/types/components/focusRing/components/FocusRingInline.d.ts.map +1 -0
  115. package/dist/types/components/focusRing/components/FocusRingRenderer.d.ts +13 -0
  116. package/dist/types/components/focusRing/components/FocusRingRenderer.d.ts.map +1 -0
  117. package/dist/types/components/focusRing/components/FocusRingSeparate.d.ts +40 -0
  118. package/dist/types/components/focusRing/components/FocusRingSeparate.d.ts.map +1 -0
  119. package/dist/types/components/focusRing/focusRing.d.ts +34 -0
  120. package/dist/types/components/focusRing/focusRing.d.ts.map +1 -0
  121. package/dist/types/components/focusRing/focusRing.types.d.ts +40 -0
  122. package/dist/types/components/focusRing/focusRing.types.d.ts.map +1 -0
  123. package/dist/types/components/focusRing/hooks/useFocusRingData.d.ts +27 -0
  124. package/dist/types/components/focusRing/hooks/useFocusRingData.d.ts.map +1 -0
  125. package/dist/types/components/focusRing/index.d.ts +3 -0
  126. package/dist/types/components/focusRing/index.d.ts.map +1 -0
  127. package/dist/types/components/focusRing/utils/composeRefs.d.ts +7 -0
  128. package/dist/types/components/focusRing/utils/composeRefs.d.ts.map +1 -0
  129. package/dist/types/components/focusRing/utils/createAdaptiveFocusRings.d.ts +24 -0
  130. package/dist/types/components/focusRing/utils/createAdaptiveFocusRings.d.ts.map +1 -0
  131. package/dist/types/components/focusRing/utils/createBoundingBoxFocusRings.d.ts +33 -0
  132. package/dist/types/components/focusRing/utils/createBoundingBoxFocusRings.d.ts.map +1 -0
  133. package/dist/types/components/focusRing/utils/utils.types.d.ts +52 -0
  134. package/dist/types/components/focusRing/utils/utils.types.d.ts.map +1 -0
  135. package/dist/types/components/index.d.ts +1 -0
  136. package/dist/types/components/index.d.ts.map +1 -1
  137. package/dist/types/components/plot/plot.d.ts.map +1 -1
  138. package/dist/types/components/zoomArea/components/SelectionArea.d.ts +3 -23
  139. package/dist/types/components/zoomArea/components/SelectionArea.d.ts.map +1 -1
  140. package/dist/types/components/zoomArea/components/ZoomHandler.d.ts +3 -3
  141. package/dist/types/components/zoomArea/components/ZoomHandler.d.ts.map +1 -1
  142. package/dist/types/components/zoomArea/components/index.d.ts +1 -1
  143. package/dist/types/components/zoomArea/components/index.d.ts.map +1 -1
  144. package/dist/types/components/zoomArea/zoomArea.type.d.ts +1 -1
  145. package/dist/types/components/zoomArea/zoomArea.type.d.ts.map +1 -1
  146. package/dist/types/types/focusConfig.type.d.ts +15 -3
  147. package/dist/types/types/focusConfig.type.d.ts.map +1 -1
  148. package/package.json +1 -1
  149. package/dist/cjs/utils/calculateFocusOutline/calculateFocusOutline.d.ts +0 -73
  150. package/dist/cjs/utils/calculateFocusOutline/calculateFocusOutline.d.ts.map +0 -1
  151. package/dist/cjs/utils/calculateFocusOutline/calculateFocusOutline.js +0 -80
  152. package/dist/esm/utils/calculateFocusOutline/calculateFocusOutline.d.ts +0 -73
  153. package/dist/esm/utils/calculateFocusOutline/calculateFocusOutline.d.ts.map +0 -1
  154. package/dist/esm/utils/calculateFocusOutline/calculateFocusOutline.js +0 -80
  155. package/dist/types/utils/calculateFocusOutline/calculateFocusOutline.d.ts +0 -73
  156. package/dist/types/utils/calculateFocusOutline/calculateFocusOutline.d.ts.map +0 -1
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KubitCharts={})}(this,function(e){"use strict";var t,r,a,n,i={exports:{}},o={},s={exports:{}},c={};function d(){return r||(r=1,s.exports=function(){if(t)return c;t=1;var e=Symbol.for("react.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.iterator,p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,x={};function _(e,t,r){this.props=e,this.context=t,this.refs=x,this.updater=r||p}function g(){}function A(e,t,r){this.props=e,this.context=t,this.refs=x,this.updater=r||p}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},g.prototype=_.prototype;var E=A.prototype=new g;E.constructor=A,R(E,_.prototype),E.isPureReactComponent=!0;var T=Array.isArray,v=Object.prototype.hasOwnProperty,y={current:null},m={key:!0,ref:!0,__self:!0,__source:!0};function C(t,r,a){var n,i={},o=null,s=null;if(null!=r)for(n in void 0!==r.ref&&(s=r.ref),void 0!==r.key&&(o=""+r.key),r)v.call(r,n)&&!m.hasOwnProperty(n)&&(i[n]=r[n]);var c=arguments.length-2;if(1===c)i.children=a;else if(1<c){for(var d=Array(c),l=0;l<c;l++)d[l]=arguments[l+2];i.children=d}if(t&&t.defaultProps)for(n in c=t.defaultProps)void 0===i[n]&&(i[n]=c[n]);return{$$typeof:e,type:t,key:o,ref:s,props:i,_owner:y.current}}function S(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var I=/\/+/g;function N(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function $(t,a,n,i,o){var s=typeof t;"undefined"!==s&&"boolean"!==s||(t=null);var c=!1;if(null===t)c=!0;else switch(s){case"string":case"number":c=!0;break;case"object":switch(t.$$typeof){case e:case r:c=!0}}if(c)return o=o(c=t),t=""===i?"."+N(c,0):i,T(o)?(n="",null!=t&&(n=t.replace(I,"$&/")+"/"),$(o,a,n,"",function(e){return e})):null!=o&&(S(o)&&(o=function(t,r){return{$$typeof:e,type:t.type,key:r,ref:t.ref,props:t.props,_owner:t._owner}}(o,n+(!o.key||c&&c.key===o.key?"":(""+o.key).replace(I,"$&/")+"/")+t)),a.push(o)),1;if(c=0,i=""===i?".":i+":",T(t))for(var d=0;d<t.length;d++){var l=i+N(s=t[d],d);c+=$(s,a,n,l,o)}else if(l=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=f&&e[f]||e["@@iterator"])?e:null}(t),"function"==typeof l)for(t=l.call(t),d=0;!(s=t.next()).done;)c+=$(s=s.value,a,n,l=i+N(s,d++),o);else if("object"===s)throw a=String(t),Error("Objects are not valid as a React child (found: "+("[object Object]"===a?"object with keys {"+Object.keys(t).join(", ")+"}":a)+"). If you meant to render a collection of children, use an array instead.");return c}function b(e,t,r){if(null==e)return e;var a=[],n=0;return $(e,a,"","",function(e){return t.call(r,e,n++)}),a}function L(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var k={current:null},O={transition:null},H={ReactCurrentDispatcher:k,ReactCurrentBatchConfig:O,ReactCurrentOwner:y};function w(){throw Error("act(...) is not supported in production builds of React.")}return c.Children={map:b,forEach:function(e,t,r){b(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return b(e,function(){t++}),t},toArray:function(e){return b(e,function(e){return e})||[]},only:function(e){if(!S(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},c.Component=_,c.Fragment=a,c.Profiler=i,c.PureComponent=A,c.StrictMode=n,c.Suspense=l,c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=H,c.act=w,c.cloneElement=function(t,r,a){if(null==t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var n=R({},t.props),i=t.key,o=t.ref,s=t._owner;if(null!=r){if(void 0!==r.ref&&(o=r.ref,s=y.current),void 0!==r.key&&(i=""+r.key),t.type&&t.type.defaultProps)var c=t.type.defaultProps;for(d in r)v.call(r,d)&&!m.hasOwnProperty(d)&&(n[d]=void 0===r[d]&&void 0!==c?c[d]:r[d])}var d=arguments.length-2;if(1===d)n.children=a;else if(1<d){c=Array(d);for(var l=0;l<d;l++)c[l]=arguments[l+2];n.children=c}return{$$typeof:e,type:t.type,key:i,ref:o,props:n,_owner:s}},c.createContext=function(e){return(e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:o,_context:e},e.Consumer=e},c.createElement=C,c.createFactory=function(e){var t=C.bind(null,e);return t.type=e,t},c.createRef=function(){return{current:null}},c.forwardRef=function(e){return{$$typeof:d,render:e}},c.isValidElement=S,c.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:L}},c.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},c.startTransition=function(e){var t=O.transition;O.transition={};try{e()}finally{O.transition=t}},c.unstable_act=w,c.useCallback=function(e,t){return k.current.useCallback(e,t)},c.useContext=function(e){return k.current.useContext(e)},c.useDebugValue=function(){},c.useDeferredValue=function(e){return k.current.useDeferredValue(e)},c.useEffect=function(e,t){return k.current.useEffect(e,t)},c.useId=function(){return k.current.useId()},c.useImperativeHandle=function(e,t,r){return k.current.useImperativeHandle(e,t,r)},c.useInsertionEffect=function(e,t){return k.current.useInsertionEffect(e,t)},c.useLayoutEffect=function(e,t){return k.current.useLayoutEffect(e,t)},c.useMemo=function(e,t){return k.current.useMemo(e,t)},c.useReducer=function(e,t,r){return k.current.useReducer(e,t,r)},c.useRef=function(e){return k.current.useRef(e)},c.useState=function(e){return k.current.useState(e)},c.useSyncExternalStore=function(e,t,r){return k.current.useSyncExternalStore(e,t,r)},c.useTransition=function(){return k.current.useTransition()},c.version="18.3.1",c}()),s.exports}var l=(n||(n=1,i.exports=function(){if(a)return o;a=1;var e=d(),t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function c(e,r,a){var o,c={},d=null,l=null;for(o in void 0!==a&&(d=""+a),void 0!==r.key&&(d=""+r.key),void 0!==r.ref&&(l=r.ref),r)n.call(r,o)&&!s.hasOwnProperty(o)&&(c[o]=r[o]);if(e&&e.defaultProps)for(o in r=e.defaultProps)void 0===c[o]&&(c[o]=r[o]);return{$$typeof:t,type:e,key:d,ref:l,props:c,_owner:i.current}}return o.Fragment=r,o.jsx=c,o.jsxs=c,o}()),i.exports),u=d();const h=u.forwardRef(({ariaHidden:e,ariaLabel:t,backgroundColor:r,caption:a,children:n,className:i,dataTestId:o,height:s,imageSrc:c,overflow:d,radius:u="0px",role:h,tabIndex:f,viewBox:p,width:R,...x},_)=>l.jsxs("svg",{ref:_,"aria-hidden":e,"aria-label":t,className:i,"data-testid":o,height:s,role:h,style:{backgroundColor:r,borderRadius:u,overflow:d},tabIndex:f,viewBox:p,width:R,onMouseDown:e=>e.preventDefault(),...x,children:[a&&l.jsx("title",{children:a}),c&&l.jsx("image",{height:s,href:c,width:R,x:"0",y:"0"}),n]})),f=(e,t,r=0)=>`${-r} ${-r} ${e} ${t}`,p={extraSpace:0,height:80,width:100},R=e=>{const t=new Map,r=()=>{const e={};return t.forEach((t,r)=>{e[r]=t}),e};return{addError:(a,n)=>{if(!n)return;const i={...n,type:a},o=t.get(a)||[];if(o.push(i),t.set(a,o),e){const t=r(),a={};Object.entries(t).forEach(([e,t])=>{const r=e;Array.isArray(t)&&t.length,a[r]=t}),e(a)}},clearErrors:()=>{t.clear(),e&&e({})},getAccumulatedErrors:r}},x=e=>JSON.stringify(e),_="%",g="rem",A=/^(\d+(\.\d+)?)(px|rem|%)?$/,E=e=>{if("number"==typeof e)return e;const t=e.match(A);if(!t)throw new Error(`Invalid string format: "${e}"`);const r=t[1];return t[3]===g?16*parseFloat(r):parseFloat(r)},T=u.createContext({}),v={HORIZONTAL:"HORIZONTAL",VERTICAL:"VERTICAL"},y={BAR_CHART_CONTEXT_ERROR:"BAR_CHART_CONTEXT_ERROR",BAR_CHART_PATH_ERROR:"BAR_CHART_PATH_ERROR",BAR_CHART_SEPARATOR_ERROR:"BAR_CHART_SEPARATOR_ERROR",BAR_CHART_X_AXIS_ERROR:"BAR_CHART_X_AXIS_ERROR",BAR_CHART_Y_AXIS_ERROR:"BAR_CHART_Y_AXIS_ERROR",GENERIC:"GENERIC",LINE_CHART_CONTEXT_ERROR:"LINE_CHART_CONTEXT_ERROR",LINE_CHART_PATH_ERROR:"LINE_CHART_PATH_ERROR",LINE_CHART_PROJECTION_ERROR:"LINE_CHART_PROJECTION_ERROR",LINE_CHART_SEPARATOR_ERROR:"LINE_CHART_SEPARATOR_ERROR",LINE_CHART_X_AXIS_ERROR:"LINE_CHART_X_AXIS_ERROR",LINE_CHART_Y_AXIS_ERROR:"LINE_CHART_Y_AXIS_ERROR",PIE_CHART_CONTEXT_ERROR:"PIE_CHART_CONTEXT_ERROR",PIE_CHART_PATH_ERROR:"PIE_CHART_PATH_ERROR",PIE_CHART_SEGMENT_ERROR:"PIE_CHART_SEGMENT_ERROR"},m={BOTTOM:"BOTTOM",CENTER:"CENTER",CUSTOM:"CUSTOM",LEFT:"LEFT",RIGHT:"RIGHT",TOP:"TOP"},C=Object.entries({BAR_CHART_AXIS_INSUFFICIENT_TICKS:"Axis requires at least two ticks for proper bar scaling",BAR_CHART_AXIS_INVALID_SCALE:"Invalid axis scale for current bar values",BAR_CHART_DISTRIBUTION_INSUFFICIENT_SPACE:"Insufficient space for bar distribution with current configuration",BAR_CHART_DISTRIBUTION_INVALID_GAP:"Invalid gap between bars - must be >= 0 and allow bar rendering",BAR_CHART_DISTRIBUTION_OVERLAP:"Bar distribution results in overlapping bars",BAR_CHART_EMPTY_DATA:"No valid data entries found for bar chart rendering",BAR_CHART_INSUFFICIENT_SPACE_HEIGHT:"Insufficient height to render bars. Consider reducing bar count or increasing chart height",BAR_CHART_INSUFFICIENT_SPACE_WIDTH:"Insufficient width to render bars. Consider reducing bar width or increasing chart width",BAR_CHART_INVALID_VALUE:"Bar value must be a valid number for rendering",BAR_CHART_NEGATIVE_VALUE:"Negative values are not supported in this bar configuration",BAR_CHART_NO_DATA:"Data validation failed: no data provided for bar chart rendering",BAR_CHART_OVERLAP:"Bars are overlapping due to insufficient spacing",BAR_CHART_SEPARATOR_X_OUT_OF_RANGE:"Separator X position is outside valid bar range",BAR_CHART_SEPARATOR_Y_OUT_OF_RANGE:"Separator Y position is outside valid bar range",BAR_CHART_STACK_INVALID:"Invalid stacking configuration - all bars in stack must have consistent configuration",BAR_CHART_STACK_MISSING_VALUES:"Stack is incomplete - all bars in stack must have valid values"}).reduce((e,[t,r])=>(e[t]=new Error(r),e),{}),S=Object.entries({LINE_CHART_INVALID_CANVAS:"Canvas dimensions validation failed: both width and height must be > 0",LINE_CHART_NO_DATA:"Data validation failed: no data provided for chart rendering",LINE_CHART_PATH_ALL_VALUES_NULL:"Path data cannot be generated - all Y values are null or undefined",LINE_CHART_PATH_INSUFFICIENT_POINTS:"Unable to calculate curved path with insufficient points (minimum 2 required)",LINE_CHART_PATH_INVALID_DATAKEY:"DataKey must be a valid string",LINE_CHART_PROJECTION_INVALID_BOUNDS:"Invalid projection bounds - upper projection must be below lower projection",LINE_CHART_PROJECTION_LOWER_X_OUT_OF_RANGE:"Lower projection X coordinate is outside valid range (0-100)",LINE_CHART_PROJECTION_LOWER_Y_OUT_OF_RANGE:"Lower projection Y coordinate is outside chart area",LINE_CHART_PROJECTION_UPPER_X_OUT_OF_RANGE:"Upper projection X coordinate is outside valid range (0-100)",LINE_CHART_PROJECTION_UPPER_Y_OUT_OF_RANGE:"Upper projection Y coordinate is outside chart area",LINE_CHART_SEPARATOR_INVALID_COORDINATES:"Invalid separator position - coordinates overlap, cannot render separator",LINE_CHART_SEPARATOR_INVALID_X_BREAK_AXIS:"Invalid xBreakAxis value: cannot be parsed as number",LINE_CHART_SEPARATOR_INVALID_Y_BREAK_AXIS:"Invalid yBreakAxis value: cannot be parsed as number",LINE_CHART_SEPARATOR_X_OUT_OF_RANGE:"xBreakAxis value is outside data range",LINE_CHART_SEPARATOR_Y_OUT_OF_RANGE:"yBreakAxis value is outside data range",LINE_CHART_SINGLE_POINT:"Data validation failed: single data point provided, minimum 2 required for line chart",LINE_CHART_X_AXIS_IDENTICAL_VALUES:"X-axis range validation failed: minimum and maximum values are identical, cannot render chart line",LINE_CHART_X_AXIS_INSUFFICIENT_TICKS:"X-axis tick calculation: insufficient data points (1/2 minimum required)",LINE_CHART_X_AXIS_ZERO_LENGTH:"X-axis geometry validation failed: start and end X coordinates are identical (x1=x2), axis has zero length",LINE_CHART_Y_AXIS_IDENTICAL_VALUES:"Y-axis range validation failed: minimum and maximum values are identical, cannot render chart line",LINE_CHART_Y_AXIS_INSUFFICIENT_TICKS:"Y-axis tick calculation: insufficient data points (1/2 minimum required)",LINE_CHART_Y_AXIS_ZERO_LENGTH:"Y-axis geometry validation failed: start and end Y coordinates are identical (y1=y2), axis has zero length"}).reduce((e,[t,r])=>(e[t]=new Error(r),e),{}),I=Object.entries({PIE_CHART_EMPTY_DATA:"PieChart data is empty or undefined",PIE_CHART_INNER_RADIUS_OUT_OF_RANGE:"Inner radius must be less than radius",PIE_CHART_INVALID_CANVAS_DIMENSIONS:"Invalid canvas dimensions for PieChart",PIE_CHART_INVALID_DATA_KEY:"Invalid or missing dataKey in PieChart data",PIE_CHART_INVALID_INNER_RADIUS:"Invalid innerRadius value",PIE_CHART_INVALID_RADIUS:"Invalid radius value",PIE_CHART_INVALID_SEGMENT_VALUE:"Invalid segment value (non-numeric)",PIE_CHART_INVALID_TOTAL:"PieChart total value is zero or invalid",PIE_CHART_MISSING_SEGMENT_NAME:"Segment is missing required name property",PIE_CHART_NEGATIVE_SEGMENT_VALUE:"Segment value cannot be negative"}).reduce((e,[t,r])=>(e[t]=new Error(r),e),{}),N=(e,t)=>new Error(`Invalid value "${e}" for bar with dataKey "${t}". Must be a valid number.`),$=(e,t)=>new Error(`Negative value ${e} not allowed for bar with dataKey "${t}" in current configuration`),b=(e,t)=>new Error(`Invalid segment value for "${t}": "${e}" is not a valid number`),L=(e,t)=>new Error(`Negative segment value for "${t}": ${e} (values must be >= 0)`),k=e=>new Error(`DataKey "${e}" not found in PieChart dataset`),O=e=>new Error(`Data array for key "${e}" is empty`),H=(e,t)=>new Error(`Invalid total value for "${e}": ${t} (must be > 0)`),w=(e,t,r)=>new Error(`Invalid group at index ${t} in "${e}": missing required property "${r}"`),P=e=>new Error(`Invalid radius value: "${e}" (must be a positive number)`),j=e=>new Error(`Invalid innerRadius value: "${e}" (must be a positive number or zero)`),D=(e,t)=>new Error(`innerRadius (${e}) must be less than radius (${t}) for donut chart rendering`),B="INVALID_X_TICK",M="BAR_CHART_NO_DATA",X="LINE_CHART_NO_DATA",F="LINE_CHART_PATH_ALL_VALUES_NULL",V="LINE_CHART_PATH_INSUFFICIENT_POINTS",W="LINE_CHART_PATH_INVALID_DATAKEY",Y="LINE_CHART_SEPARATOR_INVALID_COORDINATES",K="LINE_CHART_SINGLE_POINT",U="LINE_CHART_X_AXIS_IDENTICAL_VALUES",G="LINE_CHART_X_AXIS_INSUFFICIENT_TICKS",z="LINE_CHART_X_AXIS_ZERO_LENGTH",Z="LINE_CHART_Y_AXIS_IDENTICAL_VALUES",q="LINE_CHART_Y_AXIS_INSUFFICIENT_TICKS",J="LINE_CHART_Y_AXIS_ZERO_LENGTH",Q={...C,...S,...I,INVALID_X_TICK:new Error("[getXTicks] Invalid X tick values calculated")},ee=e=>Q[e],te=e=>new Error(`DataKey "${e}" not found in dataset`),re=(e,t)=>new Error(`Canvas dimensions validation failed: width=${e}, height=${t} (both must be > 0)`),ae=e=>new Error(`Invalid xBreakAxis value: '${e}' cannot be parsed as number`),ne=e=>new Error(`Invalid yBreakAxis value: '${e}' cannot be parsed as number`),ie=(e,t,r)=>new Error(`xBreakAxis value ${e} is outside data range (${t} - ${r})`),oe=(e,t,r)=>new Error(`yBreakAxis value ${e} is outside data range (${t} - ${r})`),se=({canvasHeight:e,canvasWidth:t,customBreakAxis:r,extraSpaceBottomY:a,extraSpaceLeftX:n,extraSpaceRightX:i,extraSpaceTopY:o,position:s})=>s===m.TOP?{x1:n,x2:t-i,y1:o,y2:o}:s===m.CENTER?{x1:n,x2:t-i,y1:e/2,y2:e/2}:s===m.CUSTOM?{x1:n,x2:t-i,y1:r,y2:r}:{x1:n,x2:t-i,y1:e-a,y2:e-a},ce=({canvasHeight:e,canvasWidth:t,customBreakAxis:r,extraSpaceBottomY:a,extraSpaceLeftX:n,extraSpaceRightX:i,extraSpaceTopY:o,position:s})=>s===m.RIGHT?{x1:t-i,x2:t-i,y1:o,y2:e-a}:s===m.CENTER?{x1:t/2,x2:t/2,y1:o,y2:e-a}:s===m.CUSTOM?{x1:r,x2:r,y1:o,y2:e-a}:{x1:n,x2:n,y1:o,y2:e-a},de=(e,t,r)=>t.map(t=>{if(isNaN(Number(t))){const r=e.find(e=>String(e.value)===String(t));return r?r.position:0}const{index:a,tick:n}=e.reduce((e,r,a)=>Math.abs(Number(r.value)-Number(t))<=Math.abs(Number(e.tick.value)-Number(t))?{index:a,tick:r}:e,{index:0,tick:e[0]}),i=Number(t),o=Number(n.value);if(i!==o){const t=e.map(e=>Number(e.value)),s=Math.min(...t),c=Math.max(...t);if(i<s)return e.at(0)?.position;if(i>c)return e.at(-1)?.position;const d=Math.abs(o-i),l=i>o,u=l?e[a+1]:e[a-1],h=100*d/Math.abs(Number(u.value)-o),f=Math.abs(n.position-u.position)*h/100;return r?l?n.position+f:n.position-f:l?n.position-f:n.position+f}return n.position}),le=({initPos:e,maxSpaceAvailable:t,otherAxisSpace:r,securitySpace:a,tickValues:n})=>{const i=n.length-1,o=(t-r-a)/i;return n.map((t,r)=>({position:e+r*o+a/2,value:t}))},ue=({initPos:e,maxSpaceAvailable:t,needAjusted:r,otherAxisSpace:a,securitySpace:n,tickValues:i})=>{const o=(t-a-n)/(i.length-1),s=r?n/2:0;return i.map((t,r)=>({position:e-r*o-s,value:t}))},he="0",fe="1",pe="fallbackData";(()=>{if("undefined"!=typeof globalThis&&"process"in globalThis){const e=globalThis.process;return"production"===e?.env?.NODE_ENV}})();const Re=e=>e?Object.entries(e).reduce((e,[t,r])=>((t.startsWith("aria-")||t.startsWith("data-"))&&null!=r&&(e[t]=String(r)),e),{}):{},xe=({height:e="140%",width:t="140%",x:r="-20%",y:a="-20%",...n})=>l.jsx("defs",{children:l.jsx("filter",{height:e,id:n.id,width:t,x:r,y:a,children:l.jsx("feDropShadow",{...n.shadowSvgConfig})})}),_e=-1/0,ge=u.forwardRef(({dataTestId:e,position:t,size:r=1,...a},n)=>l.jsx("circle",{...a,ref:n,cx:t?.x,cy:t?.y,"data-testid":`${e}-circle`,r:r/2})),Ae=(e,t,r,a,n)=>{let i="";const o=a===n,s=o?r:2*r;for(let r=0;r<s;r++){const c=o||r%2==0?a:n,d=2*Math.PI/s*r-Math.PI/2;i+=`${e+Math.cos(d)*c},${t+Math.sin(d)*c} `}return i.trim()},Ee=u.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=Ae(t.x,t.y,6,r/2,r/2);return l.jsx("polygon",{...a,ref:n,"data-testid":`${e}-hexagon`,points:i})}),Te=u.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=Ae(t.x,t.y,5,r/2,r/2);return l.jsx("polygon",{...a,ref:n,"data-testid":`${e}-pentagon`,points:i})}),ve=u.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>l.jsx("rect",{...a,ref:n,"data-testid":`${e}-square`,height:r,width:r,x:t.x-r/2,y:t.y-r/2})),ye=u.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=r/2,o=i/2,s=Ae(t.x,t.y,5,i,o);return l.jsx("polygon",{...a,ref:n,"data-testid":`${e}-star`,points:s})}),me=u.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=`M ${t.x-r/2} ${t.y} H ${t.x+r/2} M ${t.x} ${t.y-r/2} V ${t.y+r/2}`;return l.jsx("path",{...a,ref:n,d:i,"data-testid":`${e}-straight`,strokeWidth:2})}),Ce=u.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=[`${t.x},${t.y-r/2}`,`${t.x-r/2},${t.y+r/2}`,`${t.x+r/2},${t.y+r/2}`].join(" ");return l.jsx("polygon",{...a,ref:n,"data-testid":`${e}-triangle`,points:i})}),Se={Circle:"circle",Hexagon:"hexagon",Pentagon:"pentagon",Square:"square",Star:"star",Straight:"straight",Triangle:"triangle"},Ie={[Se.Circle]:ge,[Se.Hexagon]:Ee,[Se.Pentagon]:Te,[Se.Square]:ve,[Se.Star]:ye,[Se.Straight]:me,[Se.Triangle]:Ce},Ne=u.forwardRef(({dataTestId:e="node",haloConfig:t,hasHalo:r=!1,onBlur:a,onClick:n,onDoubleClick:i,onFocus:o,onKeyDown:s,onMouseEnter:c,onMouseLeave:d,position:h={x:0,y:0},size:f=1,type:p=Se.Circle,...R},x)=>{const[_,g]=(e=>{const t=u.useRef(!1),r=u.useRef(null);u.useImperativeHandle(e,()=>r.current,[]);const a=e=>{t.current=!!e.autoClick};return u.useEffect(()=>{if(!r.current)return;const e=r.current;return e.addEventListener("click",a),()=>e.removeEventListener("click",a)},[]),[r,t]})(x),A={...R,className:`node ${R.className}`,onBlur:e=>{a?.(e)},onClick:e=>{n?.(e,{...R.data,nodePosition:h},g.current)},onDoubleClick:e=>{i?.(e,R.data)},onFocus:e=>{o?.(e,R.data)},onKeyDown:e=>{"Enter"===e.key&&s?.(e,R.data)},onMouseEnter:e=>{c?.(e,R.data)},onMouseLeave:e=>{d?.(e)}},E={className:R.className,fill:t?.fill||R.fill,fillOpacity:t?.fillOpacity||.25,opacity:t?.opacity||.3,stroke:t?.stroke||R.stroke,strokeWidth:t?.strokeWidth||R.strokeWidth},T=Ie[p];return l.jsxs(l.Fragment,{children:[r&&l.jsx(T,{...E,"aria-hidden":"true",dataTestId:`${e}-halo`,position:h,size:f+f/2,tabIndex:-1}),l.jsx(T,{...A,ref:_,dataTestId:e,position:h,size:f})]})}),$e=u.forwardRef(({data:e,nodeConfig:t,tabIndex:r=0,x:a,y:n},i)=>{const o=t?Re(t):{};if(o["aria-label"]&&e&&"string"==typeof o["aria-label"]){const t=o["aria-label"];if(t.includes("{{")){const r=((e,t,r)=>{if(!e)return;const a=r??t.dataValue,n=Array.isArray(a)?a[t.index]:void 0,{xValue:i,yValue:o}=((e,t)=>({xValue:e&&t.xKey?e[t.xKey]?.toString()??"":"",yValue:e&&t.dataKey?e[t.dataKey]?.toString()??"":""}))(n,t);return((e,t,r,a)=>{let n=e;return void 0!==t.dataKey&&(n=n.replace(new RegExp("{{dataKey}}","g"),t.dataKey)),n=n.replace(new RegExp("{{xValue}}","g"),r),n=n.replace(new RegExp("{{yValue}}","g"),a),void 0!==t.index&&(n=n.replace(new RegExp("{{index}}","g"),(t.index+1).toString())),n})(e,t,i,o)})(t,{dataKey:e.dataKey,dataValue:e.dataValue,index:e.index??0,xKey:e.xKey},e.dataValue);r&&(o["aria-label"]=r)}}return l.jsx(l.Fragment,{children:t&&l.jsx(Ne,{...t,ref:i,...o,className:"node-path-focus-border",data:e,hasHalo:t.hasHalo,position:{x:a,y:n},tabIndex:r})})}),be=u.forwardRef(({classNames:e="",fill:t="transparent",stroke:r="#0000FF",strokeWidth:a="1",focusConfig:n={stroke:"#0000FF",strokeWidth:"0.5"},hoverConfig:i={stroke:"#0000FF",strokeWidth:"0.5"},role:o="img",...s},c)=>{const{handleBlur:d,handleFocus:h,isFocused:f}=((e,t)=>{const[r,a]=u.useState(!1),n=u.useCallback(t=>{a(!0),e?.(t)},[e]);return{handleBlur:u.useCallback(e=>{a(!1),t?.(e)},[t]),handleFocus:n,isFocused:r}})(s.onFocus,s.onBlur),{handleMouseEnter:p,handleMouseLeave:R,isHovered:x}=((e,t)=>{const[r,a]=u.useState(!1);return{handleMouseEnter:u.useCallback(t=>{a(!0),e?.(t)},[e]),handleMouseLeave:u.useCallback(e=>{a(!1),t?.(e)},[t]),isHovered:r}})(s.onMouseEnter,s.onMouseLeave),_=u.useRef(null),g=u.useRef([]),A=u.useRef(null);u.useImperativeHandle(c,()=>({get main(){return A.current},get node(){return g.current},get path(){return _.current}}));const E=s.gradient&&((e,t="gradientePath")=>{const r=e.split(",").map(e=>e.trim()),a=parseInt(r[0],10),n=r.slice(1).map(e=>{const[t,r]=e.split(" ");return{color:t,offset:r}});let i="0%",o="0%",s="0%";switch(a){case 180:s="100%";break;case 90:o="100%";break;case 270:i="100%";break;default:return l.jsx(l.Fragment,{})}return l.jsx("defs",{children:l.jsx("linearGradient",{id:t,x1:i,x2:o,y1:"0%",y2:s,children:n.map((e,t)=>l.jsx("stop",{offset:e.offset,stopColor:e.color},`${t}-${e.offset}`.toString()))})})})(s.gradient),T=Re(s),v={...{...s,classNames:`path ${e}`,fill:E?"url(#gradientePath)":t,filter:"url(#shadow)",role:o,stroke:r,strokeWidth:a},...f&&n,...x&&i};return l.jsxs("g",{ref:A,tabIndex:-1,children:[E&&E,v.shadowSvgConfig&&l.jsx(xe,{id:"shadow",shadowSvgConfig:v.shadowSvgConfig}),l.jsxs("g",{"aria-label":v.ariaLabel,className:v.classNames,"data-draw":!0,filter:v.shadowSvgConfig&&v.filter,opacity:v.opacity,orientation:v.orientation,role:v.role,rotate:v.rotate,tabIndex:v.tabIndex,transform:v.transform,visibility:v.visibility,...T,onBlur:d,onClick:()=>{s.onClick?.(s.dataValue)},onDoubleClick:e=>{s.onDoubleClick?.(e,s.dataValue)},onFocus:h,onKeyDown:e=>{"Enter"===e.key&&s.onKeyDown?.(s.dataValue)},onMouseDown:e=>{e.preventDefault()},onMouseEnter:p,onMouseLeave:R,children:[l.jsx("path",{ref:_,d:v.d,"data-testid":v.dataTestId,fill:v.dFill?"transparent":v.fill,fillOpacity:v.fillOpacity,fillRule:v.fillRule,stroke:v.stroke,strokeDasharray:v.strokeDasharray,strokeDashoffset:v.strokeDashoffset,strokeLinecap:v.strokeLinecap,strokeLinejoin:v.strokeLinejoin,strokeMiterlimit:v.strokeMiterlimit,strokeOpacity:v.strokeOpacity,strokeWidth:v.strokeWidth,children:v.title&&l.jsx("title",{children:v.title})}),v.dFill&&l.jsx("path",{d:v.dFill,fill:v.fill,fillOpacity:v.fillOpacity,fillRule:v.fillRule})]}),v.points&&v.nodeConfig&&v.points.map(([e,t],r)=>{const a={dataKey:v.dataKey,dataValue:v.dataValue,index:r,xKey:v?.xKey};return l.jsx($e,{ref:e=>g.current[r]=e,data:a,nodeConfig:v.nodeConfig,tabIndex:-1,x:e,y:t},`${r.toString()}`)})]})}),Le=(e,t,r)=>e?t+r/2:t-r/2,ke=({barConfig:e,currentBars:t,endRounded:r,extraSpacing:a=0,order:n=1,orientation:i,startRounded:o,x1:s,x2:c,y1:d,y2:u})=>{const{barWidth:h,singleConfig:f}=e,p=(({barConfig:e,orientation:t,x1:r,x2:a,y1:n,y2:i})=>{const{gap:o=0,singleConfig:s}=e,c=t===v.HORIZONTAL,d=c?r:n,l=c?a:i,u={end:l<d,start:l>d};return s.reduce((e,t,r)=>{const{coverage:a}=t,n=((e,t)=>e/100*t)(a,l-d),i=0===r?d:Le(u.start,e[r-1][1],o),c=r+1===s.length?l:Le(u.end,i+n,o);return e.push([i,c]),e},[])})({barConfig:e,orientation:i,x1:s,x2:c,y1:d,y2:u});return l.jsx("g",{children:f.map((e,R)=>{const[x,_]="HORIZONTAL"===i?p[R]:[s,c],[g,A]="VERTICAL"===i?p[R]:[d,u],E=(({barWidth:e,currentBars:t,endRounded:r=0,extraSpacing:a,order:n,orientation:i,startRounded:o=0,x1:s,x2:c,y1:d,y2:l})=>{let u,h,f,p,R="Z";const x=(({barWidth:e,currentBars:t,extraSpacing:r,order:a,orientation:n})=>{const i=e/2,o=r/2,s=t%2==0,c=s?o:o+i,d=a-Math.ceil(t/2);let l=0;return 0===d?l=s?-o:i:d<0?l=n===v.HORIZONTAL?d*-c+e:d*c:d>0&&(l=n===v.HORIZONTAL?d*-c:d*c+e),l})({barWidth:e,currentBars:t,extraSpacing:a,order:n,orientation:i});if(i===v.HORIZONTAL){const t=s+o,a=c-r;o&&r?(u=`M ${t},${d+x}`,h=`L${a},${l+x}`,f=`Q${c+r} ${l+x-e/2}, ${a} ${l+x-e}`,p=`L${t},${d+x-e}`,R=`Q${s-o} ${d+x-e/2}, ${t} ${d+x}`):o?(u=`M ${t},${d+x}`,h=`L${c},${l+x}`,f=`L${c},${l+x-e}`,p=`L${t},${d+x-e}`,R=`Q${s-o} ${d+x-e/2}, ${t} ${d+x}`):r?(u=`M${s},${d+x}`,h=`L${a},${l+x}`,f=`Q${c+r} ${l+x-e/2}, ${a} ${l+x-e}`,p=`L${s},${d+x-e}`):(u=`M${s},${d+x}`,h=`L${c},${l+x}`,f=`L${c},${l+x-e}`,p=`L${s},${d+x-e}`)}else{const t=d-o,a=l+r;o&&r?(u=`M${s+x}, ${t}`,h=`L${c+x},${a}`,f=`Q${c+x-e/2} ${l-r}, ${c+x-e} ${a}`,p=`L${s+x-e},${t}`,R=`Q${s+x-e/2} ${d+o}, ${s+x} ${t}`):o?(u=`M${s+x}, ${t}`,h=`L${c+x},${l}`,f=`L${c+x-e},${l}`,p=`L${s+x-e},${t}`,R=`Q${s+x-e/2} ${d+o}, ${s+x} ${t}`):r?(u=`M${s+x},${d}`,h=`L${c+x},${a}`,f=`Q${c+x-e/2} ${l-r}, ${c+x-e} ${a}`,p=`L${c+x-e},${d}`):(u=`M${s+x},${d}`,h=`L${c+x},${l}`,f=`L${c+x-e},${l}`,p=`L${s+x-e},${d}`)}return`${u} ${h} ${f} ${p} ${R}`})({barWidth:h,currentBars:t,endRounded:R===f.length-1&&r?r:void 0,extraSpacing:a,order:n,orientation:i,startRounded:0===R&&o?o:void 0,x1:x,x2:_,y1:g,y2:A});return l.jsx(be,{d:E,fill:e.color,hoverConfig:{stroke:"transparent",strokeWidth:"0"},stroke:"transparent",tabIndex:0,title:e.title},`${e.title}-${R.toString()}`)})})},Oe=({barConfig:e,dataIdx:t,dataKey:r,order:a,...n})=>{const{addError:i,xAxisCoordinates:o,yAxisCoordinates:s,...c}=u.useContext(T),{coordinates:d,tickValues:h}=o,{coordinates:f,tickValues:p}=s,R=c.orientation===v.VERTICAL,x=R?c.pKey:r,_=R?r:c.pKey,g=c.data[t],A=g?.[x],E=g?.[_],y=c.data[0],m=!!y&&Object.prototype.hasOwnProperty.call(y,r),C=c.data.length>0,S=Number(E);u.useEffect(()=>{!C||m?isNaN(S)?i?.("BAR_CHART_PATH_ERROR",{error:N(E,r)}):S<0&&i?.("BAR_CHART_PATH_ERROR",{error:$(S,r)}):i?.("BAR_CHART_PATH_ERROR",{error:te(r)})},[r,C,m,S,E]);const I=de(h,[String(A)],!0)[0],b=de(p,[String(E)])[0],L=R?{x1:I,x2:I,y1:d.y1,y2:b}:{x1:f.x1,x2:I,y1:b,y2:b};return l.jsx(ke,{barConfig:e,currentBars:c.barChildrenCount,extraSpacing:c.gapBetweenBars,order:a,orientation:c.orientation,...L,...n})},He=e=>{let t=0;return u.Children.toArray(e).forEach(e=>{u.isValidElement(e)&&e.type===Oe&&e.props.order>t&&(t=e.props.order)}),t},we=e=>{if(0===e.length)return{numeric:{max:2,min:0,step:1}};const t=Math.min(...e.map(e=>parseFloat(e))),r=Math.max(...e.map(e=>parseFloat(e)));return{numeric:{max:r,min:t,step:Math.abs(r-t)/2}}},Pe=()=>"undefined"!=typeof window&&"undefined"!=typeof document,je=()=>Pe()?document:void 0,De=e=>{const t=je();if(t)return t.createElementNS("http://www.w3.org/2000/svg",e)},Be=({bound:e,data:t,fontSize:r,svgHeight:a,svgWidth:n,viewBox:i})=>{if(!Pe()||!t.length)return 0;const o=je();if(!o)return 0;const s=De("svg");if(!s)return 0;s.setAttribute("style","position: absolute; visibility: hidden; top: -9999px; left: -9999px;"),s.setAttribute("viewBox",i),s.setAttribute("width",n),s.setAttribute("height",a),o.body.appendChild(s);const c=t.map(t=>{const a=De("text");if(!a)return 0;a.setAttribute("font-size",r),a.textContent=t,s.appendChild(a);const n=a.getBBox()[e];return a.remove(),n});return s.remove(),Math.max(...c,0)},Me=({ariaLabel:e="",className:t="line",dataTestId:r,tabIndex:a=-1,...n})=>l.jsx("line",{...n,"aria-label":e,className:t,"data-testid":r,tabIndex:a}),Xe=({children:e,className:t="circle",tabIndex:r=-1,...a})=>l.jsx("text",{className:t,tabIndex:r,...a,children:e}),Fe=({showTickLines:e,tick:t,tickLine:r,tickText:a})=>l.jsxs("g",{children:[e&&l.jsx(Me,{...r}),a&&l.jsx(Xe,{...a,children:t.value})]}),Ve=(e,t,r=1)=>e>=t-r&&e<=t+r,We=e=>{const{ariaLabel:t,className:r,dataTestId:a,opacity:n,stroke:i,strokeDasharray:o,strokeDashoffset:s,strokeLinecap:c,strokeLinejoin:d,strokeOpacity:l,strokeWidth:u,style:h,tabIndex:f,transform:p,x1:R,x2:x,y1:_,y2:g}=e;return{ariaLabel:t,className:r,dataTestId:a,opacity:n,stroke:i,strokeDasharray:o,strokeDashoffset:s,strokeLinecap:c,strokeLinejoin:d,strokeOpacity:l,strokeWidth:u,style:h,tabIndex:f,transform:p,x1:R,x2:x,y1:_,y2:g}},Ye=({canvasHeight:e=p.height,canvasWidth:t=p.width,cursor:r=0,extraSpace:a={bottom:0,left:0,right:0,top:0},position:n=m.BOTTOM,showTickLines:i=!1,tickLine:o,tickLineHover:s,tickText:c,tickValues:d=[],...u})=>{const h=Re(u);return l.jsxs("g",{...h,children:[l.jsx(Me,{...We(u)}),d&&d.length>0&&d.map((e,t)=>{const a=Ve(r,e.position)&&s?{...o,...s}:o,n="rotate"===c?.transform?`rotate(-30, ${e.position}, ${c.y})`:void 0;return l.jsx(Fe,{showTickLines:i,tick:e,tickLine:{...a,x1:e.position,x2:e.position},tickText:{...c,transform:n,x:e.position}},`${t.toString()}`)})]})},Ke=(e,t,r)=>e===m.RIGHT?t+r:t-r,Ue=(e,t,r,a)=>e===m.TOP?r:t+r+a,Ge=({position:e=m.BOTTOM,tickLine:t,tickText:r,...a})=>{const{xAxisCoordinates:{coordinates:n,tickValues:i},...o}=u.useContext(T),s=Ue(e,n.y1,Number(r?.fontSize),r?.top??0),c=o.extraSpaceTopY,d=Number(o.canvasHeight)-o.extraSpaceBottomY;return l.jsx(Ye,{...n,...a,canvasHeight:Number(o.canvasHeight),canvasWidth:Number(o.canvasWidth),dataTestId:`${o.dataTestId}xAxis`,extraSpace:{left:o.extraSpaceLeftX,right:o.extraSpaceRightX},tickLine:{...t,y1:c,y2:d},tickText:{...r,y:s},tickValues:r?i:void 0})},ze=({canvasWidth:e,cursor:t=0,extraSpace:r={bottom:0,left:0,right:0,top:0},position:a=m.LEFT,showTickLines:n=!0,tickLine:i,tickLineHover:o,tickText:s,tickValues:c=[],...d})=>{const u=Re(d);return l.jsxs("g",{...u,children:[l.jsx(Me,{...We(d)}),c&&c.length>0&&c.map((e,r)=>{const a=Ve(t,e.position)&&o?{...i,...o}:i,c="rotate"===s?.transform?`rotate(-30, ${s.x}, ${e.position})`:void 0;return l.jsx(Fe,{showTickLines:n,tick:e,tickLine:{...a,y1:e.position,y2:e.position},tickText:{...s,transform:c,y:e.position}},`${r.toString()}`)})]})},Ze=(e,t,r)=>{let a=0;switch(e){case"middle":a=t/2+r;break;case"end":a=t+r;break;default:a=0}return a},qe=({position:e=m.LEFT,tickLine:t,tickText:r,...a})=>{const{yAxisCoordinates:{coordinates:n,tickValues:i},...o}=u.useContext(T),s=r?.textAnchor||"middle",c=(e===m.RIGHT?r?.right:r?.left)??0,d=Ze(s,o.yAxisText,c),h=Ke(e,n.x1,d);return l.jsx(ze,{...n,...a,canvasHeight:Number(o.canvasHeight),canvasWidth:Number(o.canvasWidth),dataTestId:`${o.dataTestId}yAxis`,tickLine:{...t,x1:o.extraSpaceLeftX,x2:Number(o.canvasWidth)-o.extraSpaceRightX},tickText:{...r,x:h},tickValues:r?i:void 0})},Je=e=>{if(e.custom)return e.custom?.values;if(e.numeric){const{max:t,min:r=0,step:a}=e.numeric;if(a>=Math.abs(t-r)||a<=0)return[r.toString()];const n=[];for(let e=r;e<=t;e+=a)n.push(e.toString());return n}},Qe=(e,t)=>e.flatMap(e=>Object.keys(e).filter(r=>r!==t&&"number"==typeof e[r]).map(t=>Number(e[t]))),et=(e,t,r,a,n,i,o,s)=>{const{position:c,tickText:d,tickValues:l}=e.props,u=d?.fontSize??0,h=u*a,f=l?Je(l):t.map(e=>e[r]),p=Be({bound:"width",data:f,fontSize:u,svgHeight:`${o}`,svgWidth:`${s}`,viewBox:i}),R=n>p?n:p;return{barChartXPosition:c||m.BOTTOM,extraSpaceBottomY:c===m.BOTTOM?h+(d?.top??0):0,extraSpaceTopY:c===m.TOP?h+(d?.bottom??0):0,securityXSpace:R,xBreakAxis:l?.numeric?l.numeric.breakAxis??0:d?.custom?.breakAxis??0,xData:f}},tt=(e,t,r,a,n,i,o,s)=>{const{position:c,tickText:d,tickValues:l}=e.props,u=d?.fontSize??0,h=u*a,f=l||we([...new Set(Qe(t,r))]),p=Je(f),R=n>h?n:h,x=Be({bound:"width",data:p,fontSize:u,svgHeight:`${o}`,svgWidth:`${s}`,viewBox:i});return{barChartYPosition:c||m.LEFT,extraSpaceLeftX:c===m.LEFT?x+(d?.right??0):0,extraSpaceRightX:c===m.RIGHT?x+(d?.left??0):0,securityYSpace:R,yAxisText:x,yBreakAxis:l?.numeric?l.numeric.breakAxis??0:d?.custom?.breakAxis??0,yData:p}},rt=({addError:e,ajustedX:t,ajustedY:r,canvasHeight:a,canvasWidth:n,children:i,data:o,gapBetweenBars:s,orientation:c,pKey:d,viewBox:l})=>{let h;if(!o||0===o.length){const t={error:ee(M)};e?.("BAR_CHART_CONTEXT_ERROR",t),h=t}if(n<=0||a<=0){const t={error:re(n,a)};e?.("BAR_CHART_CONTEXT_ERROR",t),h=t}const f=He(i),p=20*f,R=(f-1)*s,x=c===v.VERTICAL?n:a;if(p+R>x){const t={error:(_=`Insufficient space: requires ${p+R}px but only ${x}px available`,new Error(`Invalid bar distribution for "all": ${_}`))};e?.("BAR_CHART_CONTEXT_ERROR",t),h=t}var _;const g=o&&o.length>0?o:[{[pe]:0,[d]:he},{[pe]:0,[d]:fe}],A=n>0?n:100,E=a>0?a:100,{barChartXPosition:T,barChartYPosition:C,extraSpaceBottomY:S,extraSpaceLeftX:I,extraSpaceRightX:N,extraSpaceTopY:$,securityXSpace:b,securityYSpace:L,xAxisText:k,xBreakAxis:O,xData:H,yAxisText:w,yBreakAxis:P,yData:j}=(({ajustedX:e,ajustedY:t,canvasHeight:r,canvasWidth:a,children:n,data:i,gapBetweenBars:o,orientation:s,pKey:c,viewBox:d})=>{let l={barChartXPosition:m.BOTTOM,barChartYPosition:m.LEFT,extraSpaceBottomY:0,extraSpaceLeftX:0,extraSpaceRightX:0,extraSpaceTopY:0,securityXSpace:0,securityYSpace:0,xAxisText:0,xBreakAxis:0,xData:[],yAxisText:0,yBreakAxis:0,yData:[]},h=o;const f=[];return u.Children.forEach(n,n=>{if(u.isValidElement(n))if(n.type!==Oe||f.includes(n.props.order)||(f.push(n.props.order),h+=n.props.barConfig.barWidth??0),n.type===Ge){const t=s===v.VERTICAL?h:0;l={...l,...et(n,i,c,e,t,d,r,a)}}else if(n.type===qe){const e=s===v.HORIZONTAL?h:0;l={...l,...tt(n,i,c,t,e,d,r,a)}}}),l})({ajustedX:t,ajustedY:r,canvasHeight:E,canvasWidth:A,children:i,data:g,gapBetweenBars:s,orientation:c,pKey:d,viewBox:l}),D=T!==m.TOP&&T!==m.BOTTOM,X=le({initPos:I,maxSpaceAvailable:A,otherAxisSpace:I+N,securitySpace:b,tickValues:H});if((X??[]).some(({position:e})=>isNaN(e))){const t={error:ee(B)};e?.("BAR_CHART_CONTEXT_ERROR",t),h=t}if(X){const t=X.length<2,r=X.length>=2&&1===new Set(X.map(e=>e.value)).size;if(t){const t={error:ee(G)};e?.("BAR_CHART_X_AXIS_ERROR",t),h||(h=t)}if(r){const t={error:ee(U)};e?.("BAR_CHART_X_AXIS_ERROR",t),h||(h=t)}}const F=C!==m.LEFT&&C!==m.RIGHT,V=ue({initPos:E-S,maxSpaceAvailable:E,needAjusted:c===v.HORIZONTAL,otherAxisSpace:$+S,securitySpace:L,tickValues:j});if(V){const t=V.length<2,r=V.length>=2&&1===new Set(V.map(e=>e.value)).size;if(t){const t={error:ee(q)};e?.("BAR_CHART_Y_AXIS_ERROR",t),h||(h=t)}if(r){const t={error:ee(Z)};e?.("BAR_CHART_Y_AXIS_ERROR",t),h||(h=t)}}const W=D?de(V||[],[String(O)])[0]:0,Y=F?de(X||[],[String(P)])[0]:0,K=se({canvasHeight:E,canvasWidth:A,customBreakAxis:Number(W),extraSpaceBottomY:S,extraSpaceLeftX:I,extraSpaceRightX:N,extraSpaceTopY:$,position:T}),Q=ce({canvasHeight:E,canvasWidth:A,customBreakAxis:Number(Y),extraSpaceBottomY:S,extraSpaceLeftX:I,extraSpaceRightX:N,extraSpaceTopY:$,position:C});if(K.x1===K.x2){const t={error:ee(z)};e?.("BAR_CHART_X_AXIS_ERROR",t),h||(h=t)}if(Q.y1===Q.y2){const t={error:ee(J)};e?.("BAR_CHART_Y_AXIS_ERROR",t),h||(h=t)}const te={addError:e,crossXAxis:D,crossYAxis:F,data:g,extraSpaceBottomY:S,extraSpaceLeftX:I,extraSpaceRightX:N,extraSpaceTopY:$,securityXSpace:b,securityYSpace:L,xAxisCoordinates:{coordinates:K,tickValues:X||(h?[{position:0,value:he},{position:A,value:fe}]:[])},xAxisText:k,yAxisCoordinates:{coordinates:Q,tickValues:V||(h?[{position:E,value:he},{position:0,value:fe}]:[])},yAxisText:w};return h?{...te,error:{...h,type:y.BAR_CHART_CONTEXT_ERROR}}:te},at=Object.assign(({canvasConfig:e=p,caption:t,children:r,classNames:a,data:n,dataTestId:i,gapBetweenBars:o=0,height:s="100%",onErrors:c,orientation:d,pKey:_,role:g,tabIndex:A,width:v="100%",...y})=>{const{extraSpace:m,height:C,width:S}=e,I=E(S),N=E(C),$=m?E(m):void 0,b=f(I,N,$),L=He(r),k=2*o,O=[l.jsx(Ge,{},"default-x-axis"),l.jsx(qe,{},"default-y-axis")],H=u.Children.toArray(r)||[],w=O.concat(H),P=Math.max(I,N,$??0),j=I/P,D=N/P,B=u.useMemo(()=>R(c),[c]),M=x(n),X=u.useMemo(()=>(B.clearErrors(),rt({addError:(e,t)=>{B.addError(e,t)},ajustedX:j,ajustedY:D,canvasHeight:N,canvasWidth:I,children:w,data:n,gapBetweenBars:k,orientation:d,pKey:_,viewBox:b})),[C,S,M,_,d,B.addError]);return l.jsx(h,{caption:t,className:a,dataTestId:i,height:s,role:g,tabIndex:A,viewBox:b,width:v,...y,children:l.jsx(T.Provider,{value:{...X,barChildrenCount:L,canvasExtraSpace:$,canvasHeight:N,canvasWidth:I,data:n,dataTestId:i,gapBetweenBars:o,orientation:d,pKey:_},children:r})})},{Path:Oe,Separator:({areaSeparator:e,dataTestId:t,rightSeparator:r,topSeparator:a,xBreakAxis:n,yBreakAxis:i})=>{const{addError:o,crossXAxis:s,crossYAxis:c,xAxisCoordinates:d,yAxisCoordinates:h}=u.useContext(T),f=d.tickValues,p=h.tickValues,R=void 0!==n?"string"==typeof n?parseFloat(n):n:void 0,x=void 0!==i?"string"==typeof i?parseFloat(i):i:void 0;if(u.useEffect(()=>{if(void 0!==n){const e=f.map(e=>e.value);if(void 0===R||isNaN(R))o?.("BAR_CHART_SEPARATOR_ERROR",{error:ae(n)});else{const t=Math.min(...e.map(e=>"string"==typeof e?parseFloat(e):e)),r=Math.max(...e.map(e=>"string"==typeof e?parseFloat(e):e));(R<t||R>r)&&o?.("BAR_CHART_SEPARATOR_ERROR",{error:ie(R,t,r)})}}if(void 0!==i){const e=p.map(e=>e.value);if(void 0===x||isNaN(x))o?.("BAR_CHART_SEPARATOR_ERROR",{error:ne(i)});else{const t=Math.min(...e.map(e=>"string"==typeof e?parseFloat(e):e)),r=Math.max(...e.map(e=>"string"==typeof e?parseFloat(e):e));(x<t||x>r)&&o?.("BAR_CHART_SEPARATOR_ERROR",{error:oe(x,t,r)})}}},[n,R,f,i,x,p]),!a&&!r&&!e)return l.jsx(l.Fragment,{});const _=n&&de(d.tickValues,[n],!0)[0],g=i&&de(h.tickValues,[i])[0],A=c?h.coordinates.x1:d.coordinates.x2,E=s?d.coordinates.y1:h.coordinates.y1,v=d.coordinates.x1,y=_??A,m=h.coordinates.y2,C=g??E;u.useEffect(()=>{v===y&&m===C&&o?.("BAR_CHART_SEPARATOR_ERROR",{error:ee(Y)})},[v,y,m,C]);const S=`M${v} ${m} H ${y} V ${C} H ${v} Z`,I=`M${v} ${C} H ${y}`,N=`M${y} ${m} V ${C}`;return l.jsxs("g",{children:[l.jsx("path",{d:S,"data-testid":`${t}Area`,...e}),l.jsx("path",{d:I,"data-testid":`${t}Top`,...a}),l.jsx("path",{d:N,"data-testid":`${t}Right`,...r})]})},XAxis:Ge,YAxis:qe}),nt=u.createContext({}),it=({curved:e=!1,extendToBottom:t=!1,points:r,svgHeight:a})=>{if(0===r.length)return"";const[n,...i]=r;let o=`M ${n[0]} ${n[1]}`;return o+=e?i.reduce((e,t,a)=>{const[n,i]=r[a],[o,s]=t,c=.3*(o-n),d=[n+c,i],l=[o-c,s];return`${e} C ${d[0]} ${d[1]}, ${l[0]} ${l[1]}, ${o} ${s}`},""):i.reduce((e,t)=>`${e} L ${t[0]} ${t[1]}`,""),t&&(o+=` L ${i[i.length-1][0]} ${a} L ${n[0]} ${a} Z`),o},ot=(e,t)=>new Error(`Invalid projection bounds - upper projection (${e}) must be below lower projection (${t})`),st=(e,t)=>new Error(`${t?"Upper":"Lower"} projection X coordinate (${e}) is outside valid range (0-100)`),ct=(e,t,r)=>new Error(`${r?"Upper":"Lower"} projection Y coordinate (${e}) is outside chart area (0-${t})`),dt=(e,t)=>{if(!t)return e;const r=t<0,a=e*Math.abs(t)/100;return r?e-a:e+a},lt=(e,t,r)=>{if(!r)return e;const a=r<0,n=(0===e?t:e)*Math.abs(r)/100;return a?e+n:e-n},ut=({curved:e,lineProjection:t,points:r,svgHeight:a})=>{const{addError:n}=u.useContext(nt),{lower:i,shapeColor:o,upper:s}=t,{xProjection:c,yProjection:d,...h}=s||{},{xProjection:f,yProjection:p,...R}=i||{},x=c||d?{x:c,y:d}:void 0,_=f||p?{x:f,y:p}:void 0,g=x?.y,A=_?.y,E=x?.x,T=_?.x;u.useEffect(()=>{if(x&&_){const e=g||0,t=A||0;e>=t&&n?.("LINE_CHART_PROJECTION_ERROR",{error:ot(e,t)})}x&&(void 0!==E&&(E<0||E>100)&&n?.("LINE_CHART_PROJECTION_ERROR",{error:st(E,!0)}),void 0!==g&&(g<0||g>a)&&n?.("LINE_CHART_PROJECTION_ERROR",{error:ct(g,a,!0)})),_&&(void 0!==T&&(T<0||T>100)&&n?.("LINE_CHART_PROJECTION_ERROR",{error:st(T,!1)}),void 0!==A&&(A<0||A>a)&&n?.("LINE_CHART_PROJECTION_ERROR",{error:ct(A,a,!1)}))},[_,T,A,a,x,E,g]);const{downPath:v,shapePath:y,upPath:m}=(({curved:e,lowerProjection:t,points:r,svgHeight:a,upperProjection:n})=>{const i=n||t;if(0===r.length&&!i)return{shapePath:""};const[o,...s]=r,c=`M ${o[0]} ${o[1]}`;let d=c,l=n?c:void 0,u=t?c:void 0;const h=[],f=[];s.forEach(([e,r])=>{const i=n?[dt(e,n.x),lt(r,a,n.y)]:[e,r],o=t?[dt(e,-(t.x??0)),lt(r,a,-(t.y??0))]:[e,r];h.push(i),f.push(o)});const p=n&&t?[...h,s.at(-1),...f.reverse(),o]:[...h,...f.reverse(),o];return e?(d+=p.reduce((e,t,r)=>{const a=0===r?o:p[r-1],[n,i]=a,[s,c]=t,d=.3*(s-n),l=[n+d,i],u=[s-d,c];return`${e} C ${l[0]} ${l[1]}, ${u[0]} ${u[1]}, ${s} ${c}`},""),l&&(l+=h.reduce((e,t,r)=>{const a=0===r?o:h[r-1],[n,i]=a,[s,c]=t,d=.3*(s-n),l=[n+d,i],u=[s-d,c];return`${e} C ${l[0]} ${l[1]}, ${u[0]} ${u[1]}, ${s} ${c}`},"")),u&&(u+=f.reverse().reduce((e,t,r)=>{const a=0===r?o:f[r-1],[n,i]=a,[s,c]=t,d=.3*(s-n),l=[n+d,i],u=[s-d,c];return`${e} C ${l[0]} ${l[1]}, ${u[0]} ${u[1]}, ${s} ${c}`},""))):(d+=p.reduce((e,t)=>`${e} L ${t?.[0]} ${t?.[1]}`,""),l&&(l+=h.reduce((e,t)=>`${e} L ${t[0]} ${t[1]}`,"")),u&&(u+=f.reverse().reduce((e,t)=>`${e} L ${t[0]} ${t[1]}`,""))),{downPath:u,shapePath:d,upPath:l}})({curved:e,lowerProjection:_,points:r,svgHeight:a,upperProjection:x});return l.jsxs("g",{className:"pointer-events-none",children:[l.jsx("path",{d:y,fill:o,stroke:"transparent",strokeWidth:"0.1"}),";",m&&l.jsx("path",{d:m,...h}),v&&l.jsx("path",{d:v,...R})]})},ht=(e,t)=>e.map(e=>e[t]),ft={formatTicksValues:(e,t)=>e.map(e=>({...e,value:t(e.value)}))},pt=({ariaLabel:e,position:t=m.BOTTOM,tickLine:r,tickText:a,valueFormatter:n=e=>e,...i})=>{const{xAxisCoordinates:{coordinates:o,tickValues:s},xCursor:c,...d}=u.useContext(nt),h=Ue(t,o.y1,Number(a?.fontSize),a?.top??0),f=d.extraSpaceTopY,p=Number(d.canvasHeight)-d.extraSpaceBottomY,R=a?ft.formatTicksValues(s,n):void 0,x=Re(i),_=e||i["aria-label"],g={...i,...x,..._&&{"aria-label":_}};return l.jsx(Ye,{...o,...g,canvasHeight:Number(d.canvasHeight),canvasWidth:Number(d.canvasWidth),cursor:c,dataTestId:`${d.dataTestId}xAxis`,extraSpace:{left:d.extraSpaceLeftX,right:d.extraSpaceRightX},tickLine:{...r,y1:f,y2:p},tickText:{...a,y:h},tickValues:R})},Rt=({ariaLabel:e,position:t=m.LEFT,tickLine:r,tickText:a,valueFormatter:n=e=>e,...i})=>{const{yAxisCoordinates:{coordinates:o,tickValues:s},yCursor:c,...d}=u.useContext(nt),h=a?.textAnchor||"middle",f=(t===m.RIGHT?a?.right:a?.left)??0,p=Ze(h,d.yAxisText,f),R=Ke(t,o.x1,p),x=a?ft.formatTicksValues(s,n):void 0,_=Re(i),g=e||i["aria-label"],A={...i,..._,...g&&{"aria-label":g}};return l.jsx(ze,{...o,...A,canvasHeight:Number(d.canvasHeight),canvasWidth:Number(d.canvasWidth),cursor:c,dataTestId:`${d.dataTestId}yAxis`,tickLine:{...r,x1:d.extraSpaceLeftX,x2:Number(d.canvasWidth)-d.extraSpaceRightX},tickText:{...a,x:R},tickValues:x})},xt={[_]:_,[g]:g},_t="WIDTH",gt=/^(\d+(\.\d+)?)(px|rem|%)?$/,At=e=>{if("number"==typeof e)return{unit:void 0,value:e};const t=e.match(gt);if(!t)throw new Error(`Invalid string format: "${e}"`);const r=parseFloat(t[1]),a=t[3];return{unit:xt[a],value:r}},Et=(e,t,r)=>{const a=r.parentElement;return a?e/100*(t===_t?a.clientWidth:a.clientHeight):0},Tt=e=>{const t=je();if(!t)return 16*e;const r=(e=>{const t=Pe()?window:void 0;if(t)return t.getComputedStyle(e)})(t.documentElement);return r?e*(parseFloat(r.fontSize)||16):16*e},vt=({canvasHeight:e,canvasWidth:t,svgElement:r})=>{const{unit:a,value:n}=At(t),i=a===_?Et(n,_t,r):a===g?Tt(n):n,{unit:o,value:s}=At(e);return{parsedCanvasHeight:o===_?Et(s,"HEIGHT",r):o===g?Tt(s):s,parsedCanvasWidth:i}},yt=e=>{if(e.custom)return e.custom?.values;if(e.numeric){const{max:t,min:r=0,step:a}=e.numeric;if(a>=Math.abs(t-r)||a<=0)return[r.toString(),t.toString()];const n=[];for(let e=r;e<=t;e+=a)n.push(e.toString());return n}},mt=(e,t)=>e.flatMap(e=>Object.keys(e).filter(r=>r!==t&&"number"==typeof e[r]).map(t=>e[t])),Ct=(e,t,r,a,n,i,o)=>{const{position:s,tickText:c,tickValues:d,valueFormatter:l}=e.props,u=c?.fontSize??0,h=u*a,f=d?yt(d):t.map(e=>e[r]),p=l?f.map(l):f,R=Be({bound:"width",data:p,fontSize:u,svgHeight:`${i}`,svgWidth:`${o}`,viewBox:n}),x=s===m.TOP;return{extraSpaceBottomY:s===m.BOTTOM?h+(c?.top??0):0,extraSpaceTopY:x?h+(c?.bottom??0):0,lineChartXPosition:s||m.BOTTOM,securityXSpace:R,xBreakAxis:d?.numeric?d.numeric.breakAxis??0:c?.custom?.breakAxis??0,xData:f}},St=(e,t,r,a,n,i,o)=>{const{position:s,tickText:c,tickValues:d,valueFormatter:l}=e.props,u=c?.fontSize??"0",h=u*a,f=d||we([...new Set(mt(t,r))]),p=yt(f),R=l?p.map(l):p,x=Be({bound:"width",data:R,fontSize:u,svgHeight:`${i}`,svgWidth:`${o}`,viewBox:n}),_=h,g=s===m.RIGHT;return{extraSpaceLeftX:s===m.LEFT?x+(c?.right??0):0,extraSpaceRightX:g?x+(c?.left??0):0,lineChartYPosition:s||m.LEFT,securityYSpace:_,yAxisText:x,yBreakAxis:d?.numeric?d.numeric.breakAxis??0:c?.custom?.breakAxis??0,yData:p}},It=({addError:e,ajustedX:t,ajustedY:r,canvasHeight:a,canvasWidth:n,children:i,data:o,viewBox:s,xKey:c})=>{let d;if(!o||0===o.length){const t={error:ee(X)};e?.("LINE_CHART_CONTEXT_ERROR",t),d=t}if(o&&1===o.length){const t={error:ee(K)};e?.("LINE_CHART_CONTEXT_ERROR",t),d=t}if(n<=0||a<=0){const t={error:re(n,a)};e?.("LINE_CHART_CONTEXT_ERROR",t),d=t}const l=o&&o.length>0?o:[{[c]:"0",y:0},{[c]:"1",y:1}],h=n>0?n:100,f=a>0?a:100,{extraSpaceBottomY:p,extraSpaceLeftX:R,extraSpaceRightX:x,extraSpaceTopY:_,lineChartXPosition:g,lineChartYPosition:A,securityXSpace:E,securityYSpace:T,xAxisText:v,xBreakAxis:C,xData:S,yAxisText:I,yBreakAxis:N,yData:$}=(({ajustedX:e,ajustedY:t,canvasHeight:r,canvasWidth:a,children:n,data:i,viewBox:o,xKey:s})=>{let c={extraSpaceBottomY:0,extraSpaceLeftX:0,extraSpaceRightX:0,extraSpaceTopY:0,lineChartXPosition:m.BOTTOM,lineChartYPosition:m.LEFT,securityXSpace:0,securityYSpace:0,xAxisText:0,xBreakAxis:0,xData:[],yAxisText:0,yBreakAxis:0,yData:[]};return u.Children.forEach(n,n=>{u.isValidElement(n)&&(n.type===pt?c={...c,...Ct(n,i,s,e,o,r,a)}:n.type===Rt&&(c={...c,...St(n,i,s,t,o,r,a)}))}),c})({ajustedX:t,ajustedY:r,canvasHeight:f,canvasWidth:h,children:i,data:l,viewBox:s,xKey:c}),b=g!==m.TOP&&g!==m.BOTTOM,L=le({initPos:R,maxSpaceAvailable:h,otherAxisSpace:R+x,securitySpace:E,tickValues:S});if((L??[]).some(({position:e})=>isNaN(e))){const t={error:ee(B)};e?.("LINE_CHART_CONTEXT_ERROR",t),d=t}if(L){const t=L.length<2,r=L.length>=2&&1===new Set(L.map(e=>e.value)).size;if(t){const t={error:ee(G)};e?.("LINE_CHART_X_AXIS_ERROR",t),d||(d=t)}if(r){const t={error:ee(U)};e?.("LINE_CHART_X_AXIS_ERROR",t),d||(d=t)}}const k=A!==m.LEFT&&A!==m.RIGHT,O=ue({initPos:f-p,maxSpaceAvailable:f,otherAxisSpace:_+p,securitySpace:T,tickValues:$});if(O){const t=O.length<2,r=O.length>=2&&1===new Set(O.map(e=>e.value)).size;if(t){const t={error:ee(q)};e?.("LINE_CHART_Y_AXIS_ERROR",t),d||(d=t)}if(r){const t={error:ee(Z)};e?.("LINE_CHART_Y_AXIS_ERROR",t),d||(d=t)}}const H=b?de(O||[],[String(C)])[0]:0,w=k?de(L||[],[String(N)])[0]:0,P=se({canvasHeight:f,canvasWidth:h,customBreakAxis:Number(H),extraSpaceBottomY:p,extraSpaceLeftX:R,extraSpaceRightX:x,extraSpaceTopY:_,position:g}),j=ce({canvasHeight:f,canvasWidth:h,customBreakAxis:Number(w),extraSpaceBottomY:p,extraSpaceLeftX:R,extraSpaceRightX:x,extraSpaceTopY:_,position:A});if(P.x1===P.x2){const t={error:ee(z)};e?.("LINE_CHART_X_AXIS_ERROR",t),d||(d=t)}if(j.y1===j.y2){const t={error:ee(J)};e?.("LINE_CHART_Y_AXIS_ERROR",t),d||(d=t)}const D={addError:e,crossXAxis:b,crossYAxis:k,extraSpaceBottomY:p,extraSpaceLeftX:R,extraSpaceRightX:x,extraSpaceTopY:_,securityXSpace:E,securityYSpace:T,xAxisCoordinates:{coordinates:P,tickValues:L||(d?[{position:0,value:"0"},{position:h,value:"1"}]:[])},xAxisText:v,yAxisCoordinates:{coordinates:j,tickValues:O||(d?[{position:f,value:he},{position:0,value:fe}]:[])},yAxisText:I};return d?{...D,error:{...d,type:y.LINE_CHART_CONTEXT_ERROR}}:D},Nt=Object.assign(({ariaHidden:e,ariaLabel:t,canvasConfig:r=p,caption:a,children:n,classNames:i,data:o,dataTestId:s="line-chart",getPathArea:c,height:d="100%",onErrors:_,role:g,tabIndex:A,width:T="100%",xKey:v,...y})=>{const{extraSpace:m,height:C,width:S}=r,[I,N]=u.useState(""),[$,b]=u.useState({height:0,width:0}),L=m?E(m):void 0,k=f($.width,$.height,L),O=[l.jsx(pt,{},"default-x-axis"),l.jsx(Rt,{},"default-y-axis")],H=u.Children.toArray(n)||[],w=O.concat(H),P=Math.max($.width,$.height,L??0),j=isNaN($.width/P)?0:$.width/P,D=isNaN($.height/P)?0:$.height/P;(({attrName:e,children:t,originalValue:r,updateValue:a})=>{let n="";u.Children.toArray(t).forEach(t=>{if(u.isValidElement(t)){const r=t.props[e];r&&(n+=r)}}),n!==r&&a(n)})({attrName:"dataKey",children:w,originalValue:I,updateValue:N});const B=u.useMemo(()=>R(_),[_]),M=x(o),X=u.useMemo(()=>(B.clearErrors(),It({addError:(e,t)=>{B.addError(e,t)},ajustedX:j,ajustedY:D,canvasHeight:$.height,canvasWidth:$.width,children:w,data:o,viewBox:k,xKey:v})),[$.width,$.height,M,v,I,B.addError]),{svgRef:F,xCursor:V,yCursor:W}=(({canvasHeight:e,canvasWidth:t})=>{const[[r,a],n]=u.useState([_e,_e]),i=u.useCallback((r,a)=>{const{height:i,left:o,top:s,width:c}=a.getBoundingClientRect(),d=r.clientX-o,l=r.clientY-s;n([d*t/c,l*e/i])},[t,e]),o=e=>{e.preventDefault()};return{svgRef:u.useCallback(e=>{e&&(e.addEventListener("touchstart",o),e.addEventListener("touchmove",t=>i(t.touches[0],e)),e.addEventListener("mousemove",t=>i(t,e))),e?.removeEventListener("touchstart",o),e?.removeEventListener("touchmove",t=>i(t.touches[0],e)),e?.removeEventListener("mousemove",t=>i(t,e))},[e,t]),xCursor:r,yCursor:a}})({canvasHeight:$.height,canvasWidth:$.width});return u.useEffect(()=>{const e=document.querySelector("[data-kbt-svg]");if(!e)return;const{parsedCanvasHeight:t,parsedCanvasWidth:r}=vt({canvasHeight:C,canvasWidth:S,svgElement:e});b({height:t,width:r})},[S,C]),u.useEffect(()=>{c?.({x1:X.extraSpaceLeftX,x2:$.width-X.extraSpaceRightX,y1:X.extraSpaceTopY,y2:$.height-X.extraSpaceBottomY})},[$.width,$.height]),l.jsx(h,{ref:F,ariaHidden:e,ariaLabel:t,caption:a,className:i,"data-kbt-svg":!0,dataTestId:s,height:d,role:g,tabIndex:A,viewBox:k,width:T,...y,children:l.jsx(nt.Provider,{value:{...X,canvasExtraSpace:L,canvasHeight:$.height,canvasWidth:$.width,data:o,dataTestId:s,xCursor:V,xKey:v,yCursor:W},children:n})})},{Path:({ariaLabel:e,closestClick:t,curved:r,getNodeFocusInfo:a,getNodesCoords:n,indicatorConfig:i,lineProjection:o,onClick:s,...c})=>{const{addError:d,xAxisCoordinates:h,yAxisCoordinates:f,...p}=u.useContext(nt),R=c.dataKey,x=p.data.length>0,_=p.data[0],g=!!_&&Object.prototype.hasOwnProperty.call(_,R),A=p.data.length;u.useEffect(()=>{if(!R||"string"!=typeof R)return void d?.("LINE_CHART_PATH_ERROR",{error:ee(W)});if(x&&!g)return void d?.("LINE_CHART_PATH_ERROR",{error:te(R)});if(r&&A<2)return void d?.("LINE_CHART_PATH_ERROR",{error:ee(V)});const e=ht(p.data,R);e.length>0&&e.every(e=>null==e)&&d?.("LINE_CHART_PATH_ERROR",{error:ee(F)})},[d,r,R,A,x,g,p.data]);const{indicatorRef:E,pathRef:T}=((e,t)=>{const r=u.useRef(null),a=u.useRef(null);return u.useEffect(()=>{if(!t||!r.current||!a.current)return;const n=r.current,i=a.current;let o,s,c=0,d=n.getTotalLength();for(;d-c>.01;)o=(c+d)/2,s=n.getPointAtLength(o),s.x<e?c=o:d=o;const l=n.getPointAtLength(d);i.setAttribute("transform",`translate(${l.x}, ${l.y})`),i.setAttribute("pointer-events","none")},[e]),{indicatorRef:a,pathRef:r}})(p.xCursor,!!i),v=!!i&&p.xCursor!==-1/0,y=u.useRef(null),m=u.useRef(null),{autoClick:C,lineIndicator:S,...I}=i||{},{y1:N,y2:$}=f.coordinates,{x1:b,x2:L}=h.coordinates,k=p.xCursor>=b&&p.xCursor<=L,{tickValues:O}=h,{tickValues:H}=f,w=ht(p.data,p.xKey),P=ht(p.data,R),j=de(O,w,!0),D=de(H,P),B=j.map((e,t)=>[e,D[t]]),M=it({curved:r,extendToBottom:!1,points:B,svgHeight:Number(p.canvasHeight)-p.extraSpaceBottomY}),X=it({curved:r,extendToBottom:!!c.fill||!!c.gradient,points:B,svgHeight:Number(p.canvasHeight)-p.extraSpaceBottomY});u.useEffect(()=>{if(!y.current?.path)return;T.current=y.current.path;const e=y.current.main,t=y.current.node,r=w.map((e,t)=>({x:e,y:P[t]})),{mount:n,unmount:i}=(({data:e,getNodeFocusInfo:t,nodes:r,ref:a})=>{let n,i=!1;const o=a.querySelector("[data-draw]"),s=a=>{i&&("ArrowRight"===a.key?(n=void 0===n||n===r.length-1?0:n+1,r[n].focus(),t?.(e[n])):"ArrowLeft"===a.key&&(n=void 0===n||0===n?r.length-1:n-1,r[n].focus(),t?.(e[n])))},c=()=>{i=!0},d=()=>{i=!1},l=()=>{n=void 0};return{mount:()=>{a.addEventListener("focusin",c),a.addEventListener("focusout",d),o?.addEventListener("focus",l),window.addEventListener("keydown",e=>s(e))},unmount:()=>{a.removeEventListener("focusin",c),a.removeEventListener("focusout",d),o?.removeEventListener("focus",l),window.removeEventListener("keydown",e=>s(e))}}})({data:r,getNodeFocusInfo:a,nodes:t,ref:e});return n(),()=>i()},[]),u.useEffect(()=>{if(c.nodeConfig&&v&&C){const{idx:e,match:t}=((e,t)=>{let r=0,a=!1;for(let n=0;n<e.length;n++)if(Math.round(e[n])===Math.round(t)){a=!0,r=n;break}return{idx:r,match:a}})(j,p.xCursor);if(t&&e!==m.current){m.current=e;const t=new MouseEvent("click",{bubbles:!0});t.autoClick=!0,y.current?.node?.[e]?.dispatchEvent(t),navigator?.vibrate?.(200)}else m.current=null}},[p.xCursor]),u.useEffect(()=>{n?.(B)},[B]);const Y=Re(c),K={...c,...Y,...e&&{"aria-label":e}};return l.jsxs(l.Fragment,{children:[l.jsx(be,{ref:y,d:M,dFill:X,dataTestId:`${p.dataTestId}path`,dataValue:p.data,points:B,xKey:p.xKey,onClick:e=>{if(s?.(e),t){const e=((e,t)=>{let r=0,a=Math.abs(e[0]-t);for(let n=1;n<e.length;n++){const i=Math.abs(e[n]-t);i<a&&(r=n,a=i)}return r})(j,p.xCursor),t=new MouseEvent("click",{bubbles:!0});t.autoClick=!1,y.current?.node?.[e]?.dispatchEvent(t)}},...K}),o&&l.jsx(ut,{curved:r,dataKey:c.dataKey,lineProjection:o,points:B,svgHeight:Number(p.canvasHeight)-p.extraSpaceBottomY}),v&&l.jsxs(l.Fragment,{children:[!!S&&k&&l.jsx(Me,{...S,className:"pointer-events-none",x1:p.xCursor,x2:p.xCursor,y1:N,y2:$}),l.jsx("g",{ref:E,className:"pointer-events-none",children:l.jsx(Ne,{...I})})]})]})},Separator:({areaSeparator:e,dataTestId:t,rightSeparator:r,topSeparator:a,xBreakAxis:n,yBreakAxis:i})=>{const{addError:o,crossXAxis:s,crossYAxis:c,xAxisCoordinates:d,yAxisCoordinates:h}=u.useContext(nt),f=d.tickValues,p=h.tickValues,R=void 0!==n?"string"==typeof n?parseFloat(n):n:void 0,x=void 0!==i?"string"==typeof i?parseFloat(i):i:void 0;if(u.useEffect(()=>{if(void 0!==n){const e=f.map(e=>e.value);if(void 0===R||isNaN(R))o?.("LINE_CHART_SEPARATOR_ERROR",{error:ae(n)});else{const t=Math.min(...e.map(e=>"string"==typeof e?parseFloat(e):e)),r=Math.max(...e.map(e=>"string"==typeof e?parseFloat(e):e));(R<t||R>r)&&o?.("LINE_CHART_SEPARATOR_ERROR",{error:ie(R,t,r)})}}if(void 0!==i){const e=p.map(e=>e.value);if(void 0===x||isNaN(x))o?.("LINE_CHART_SEPARATOR_ERROR",{error:ne(i)});else{const t=Math.min(...e.map(e=>"string"==typeof e?parseFloat(e):e)),r=Math.max(...e.map(e=>"string"==typeof e?parseFloat(e):e));(x<t||x>r)&&o?.("LINE_CHART_SEPARATOR_ERROR",{error:oe(x,t,r)})}}},[n,R,f,i,x,p]),!a&&!r&&!e)return l.jsx(l.Fragment,{});const _=n&&de(d.tickValues,[n],!0)[0],g=i&&de(h.tickValues,[i])[0],A=c?h.coordinates.x1:d.coordinates.x2,E=s?d.coordinates.y1:h.coordinates.y1,T=d.coordinates.x1,v=_??A,y=h.coordinates.y2,m=g??E;u.useEffect(()=>{T===v&&y===m&&o?.("LINE_CHART_SEPARATOR_ERROR",{error:ee(Y)})},[T,v,y,m]);const C=`M${T} ${y} H ${v} V ${m} H ${T} Z`,S=`M${T} ${m} H ${v}`,I=`M${v} ${y} V ${m}`;return l.jsxs("g",{children:[l.jsx("path",{d:C,"data-testid":`${t}Area`,...e}),l.jsx("path",{d:S,"data-testid":`${t}Top`,...a}),l.jsx("path",{d:I,"data-testid":`${t}Right`,...r})]})},XAxis:pt,YAxis:Rt}),$t=({children:e,dataTestId:t,height:r,width:a,x:n,y:i})=>l.jsx("foreignObject",{"data-testid":t,height:r,width:a,x:n,y:i,children:e}),bt=u.createContext({}),Lt=(e,t,r)=>({x:e.x+t*Math.cos(r),y:e.y+t*Math.sin(r)}),kt=({center:e,innerEnd:t,innerRadius:r,singleStroke:a})=>{if(!a)return r>0?`L ${t.x},${t.y}`:`L ${e.x},${e.y}`},Ot="CLOCKWISE",Ht=({canvasHeight:e,canvasWidth:t,color:r="blue",dataKey:a,gap:n,halfChart:i,index:o,innerRadius:s,name:c,radius:d,singleStroke:h,startAngle:f,total:p,value:R,...x})=>{const{addError:_}=u.useContext(bt),g=Number(R),A=void 0!==d?Number(d):void 0,E=void 0!==s?Number(s):void 0,T=c?.trim()||"";u.useEffect(()=>{T||_?.("PIE_CHART_SEGMENT_ERROR",{error:w(a||"unknown",o||0,"name")}),isNaN(g)?_?.("PIE_CHART_SEGMENT_ERROR",{error:b(R,T||`segment-${o}`)}):(g<0&&_?.("PIE_CHART_SEGMENT_ERROR",{error:L(g,T||`segment-${o}`)}),void 0!==A&&(isNaN(A)||A<=0)&&_?.("PIE_CHART_SEGMENT_ERROR",{error:P(d)}),void 0!==E&&((isNaN(E)||E<0)&&_?.("PIE_CHART_SEGMENT_ERROR",{error:j(s)}),void 0!==A&&(isNaN(A)||isNaN(E)||E>=A&&_?.("PIE_CHART_SEGMENT_ERROR",{error:D(E,A)}))))},[a,o,E,A,g,T]);const v=(({canvasHeight:e,canvasWidth:t,customRadius:r,gap:a,halfChart:n,innerRadius:i,rotateDirection:o,singleStroke:s,startAngle:c,total:d,value:l})=>{const u=n?2*e:e,h=Math.min(t,u)/2,f=r&&r<h?r:h,p=n?Math.PI:2*Math.PI,R={x:t/2,y:n?e:e/2},x=s?2*d:d,_=100*l/x*p/100,g=a/f,{carryAngle:A,finalAngle:E,initialAngle:T}=(({angleEquivalent:e,direction:t,gapAngle:r,startAngle:a})=>{const n=t===Ot;return{carryAngle:n?a+e:a-e,finalAngle:n?a+e-r/2:a-e+r/2,initialAngle:n?a+r/2:a-r/2}})({angleEquivalent:_,direction:o,gapAngle:g,startAngle:c.current});c.current=A;const v=p*l/x-g<=Math.PI?"0":"1",y=Lt(R,i,T),m=Lt(R,i,E),C=Lt(R,f,T);return(({center:e,innerEnd:t,innerRadius:r,innerStart:a,largeArcFlag:n,outerEnd:i,outerStart:o,radius:s,rotateDirection:c,singleStroke:d})=>{let l,u,h,f,p,R,x,_,g,A;return c===Ot?(l=`M ${o.x},${o.y}`,u=`A ${s},${s} 0 ${n} 1 ${i.x}, ${i.y}`,h=kt({center:e,innerEnd:t,innerRadius:r,singleStroke:d}),f=d?`M ${t.x},${t.y}`:void 0,p=r>0?`A ${r},${r} 0 ${n} 0 ${a.x},${a.y}`:void 0,R=`M ${o.x},${o.y}`,_=`M ${t.x},${t.y}`,x=`A ${s},${s} 0 ${n} 0 ${i.x},${i.y}`,g=`A ${r},${r} 0 ${n} 1 ${a.x},${a.y}`,A=d?void 0:"Z"):(l=`M ${o.x} ${o.y}`,u=`A ${s},${s} 0 ${n},0 ${i.x}, ${i.y}`,h=kt({center:e,innerEnd:t,innerRadius:r,singleStroke:d}),f=d?`M ${t.x},${t.y}`:void 0,p=r>0?`A ${r}, ${r} 0 ${n},1 ${a.x},${a.y}`:void 0,R=`M ${o.x},${o.y}`,_=`M ${t.x},${t.y}`,x=`A ${s},${s} 0 ${n} 1 ${i.x},${i.y}`,g=`A ${r},${r} 0 ${n} 0 ${a.x},${a.y}`,A=d?void 0:"Z"),[l,u,h,f,p,A].concat(d?[R,x,_,g]:[]).filter(Boolean).join(" ")})({center:R,innerEnd:m,innerRadius:i,innerStart:y,largeArcFlag:v,outerEnd:Lt(R,f,E),outerStart:C,radius:f,rotateDirection:o,singleStroke:s})})({canvasHeight:e,canvasWidth:t,customRadius:d,gap:n,halfChart:i,innerRadius:s,singleStroke:h,startAngle:f,total:p,value:R});return l.jsx(be,{...x,d:v,dataValue:R,fill:r})},wt=({dataKey:e,fill:t,gap:r,innerRadius:a,radius:n,...i})=>{const o=String(e),{addError:s,canvasHeight:c,canvasWidth:d,data:h,dataTestId:f,halfChart:p}=u.useContext(bt),R=p?0:-Math.PI/2,x=u.useRef(R),_=h[o],g=Object.prototype.hasOwnProperty.call(h,o);u.useEffect(()=>{if(!g)return void s?.("PIE_CHART_PATH_ERROR",{error:k(o)});if(!_||0===_.length)return void s?.("PIE_CHART_PATH_ERROR",{error:O(o)});const e=_.reduce((e,t)=>e+t.value,0);(e<=0||isNaN(e))&&s?.("PIE_CHART_PATH_ERROR",{error:H(o,e)})},[_,g,o]);const A=h[o]?.reduce((e,t)=>e+t.value,0),T=1===h[o]?.length,v=a?E(a):void 0,y=n?E(n):void 0;return h[o]?.length?l.jsx("g",{children:h[o].map((e,a)=>u.createElement(Ht,{...i,...e,key:`${a.toString()}`,canvasHeight:c,canvasWidth:d,color:e.color||t,dataKey:o,dataTestId:`${f}path-${a}`,gap:r,halfChart:p,index:a,innerRadius:v,radius:y,singleStroke:T,startAngle:x,total:A}))}):l.jsx(l.Fragment,{})},Pt=Object.assign(({ariaHidden:e,ariaLabel:t,canvasConfig:r=p,caption:a,children:n,classNames:i,data:o,dataTestId:s="pie-chart",halfChart:c,height:d="100%",onErrors:_,radius:g="50%",role:A,tabIndex:T,width:v="100%",...y})=>{const{extraSpace:m,height:C,width:S}=r,I=E(S),N=E(C),$=m?E(m):void 0,b=f(I,N,$),L=u.useMemo(()=>R(_),[_]),k=x(o),O=u.useMemo(()=>(L.clearErrors(),(({addError:e,canvasHeight:t,canvasWidth:r,children:a,halfChart:n})=>{(r<=0||t<=0)&&e?.("PIE_CHART_CONTEXT_ERROR",{error:re(r,t)});const i=r>0?r:100,o=t>0?t:100;let s,c;u.Children.forEach(a,e=>{if(u.isValidElement(e)&&e.type===wt){const{innerRadius:t}=e.props;if(!t)return;const r=E(t);(!s||r<s)&&(s=r)}}),s&&(c=2*s);const d=c??0,l=n?d/2:d,h=n?o:o/2;return{addError:e,foreignObject:{height:l,width:d,x:i/2-d/2,y:n?h-l:h-l/2}}})({addError:(e,t)=>{L.addError(e,t)},canvasHeight:N,canvasWidth:I,children:n,halfChart:c})),[C,S,c,k,L]);return l.jsx(h,{ariaHidden:e,ariaLabel:t,caption:a,className:i,dataTestId:s,height:d,radius:g,role:A,tabIndex:T,viewBox:b,width:v,...y,children:l.jsx(bt.Provider,{value:{...O,canvasHeight:N,canvasWidth:I,data:o,dataTestId:s,halfChart:c},children:n})})},{Foreign:({children:e,dataTestId:t,height:r,width:a,x:n,y:i,...o})=>{const{dataTestId:s,foreignObject:c}=u.useContext(bt),d=!a&&c?.width?c.width:a,h=!r&&c?.height?c.height:r,f=!n&&c?.x?c.x:n,p=!i&&c?.y?c.y:i,R=!t&&s?`${s}-foreign-object`:t;return l.jsx($t,{...o,dataTestId:R,height:h,width:d,x:f,y:p,children:e})},Path:wt}),jt=({fill:e="#8f8f8f",x:t,y:r})=>l.jsxs("g",{fill:e,pointerEvents:"none",transform:`translate(${t-5}, ${r-5})`,children:[l.jsx("path",{d:"M4.99948 9.99802C4.47168 9.99802 4.04419 9.64335 4.04419 9.20547V0.79255C4.04419 0.354666 4.47168 0 4.99948 0C5.52728 0 5.95477 0.354666 5.95477 0.79255V9.20745C5.95477 9.64533 5.52728 10 4.99948 10V9.99802Z"}),l.jsx("path",{d:"M0.955289 8.78839C0.427492 8.78839 0 8.43372 0 7.99584V2.00416C0 1.56628 0.427492 1.21161 0.955289 1.21161C1.48309 1.21161 1.91058 1.56628 1.91058 2.00416V7.99584C1.91058 8.43372 1.48309 8.78839 0.955289 8.78839Z"}),l.jsx("path",{d:"M8.08936 7.99584C8.08936 8.43372 8.51685 8.78839 9.04464 8.78839C9.57244 8.78839 9.99993 8.43372 9.99993 7.99584V2.00416C9.99993 1.56628 9.57244 1.21161 9.04464 1.21161C8.51685 1.21161 8.08936 1.56628 8.08936 2.00416V7.99584Z"})]}),Dt=({linesData:e})=>l.jsx(l.Fragment,{children:e.map((e,t)=>l.jsxs("g",{children:[e.config.fill&&e.fillPath&&l.jsx("path",{d:e.fillPath,fill:e.config.fill,fillOpacity:e.config.fillOpacity||.2,stroke:"none"}),l.jsx("path",{d:e.linePath,fill:"none",stroke:e.config.stroke||"#0078D4",strokeWidth:e.config.strokeWidth||1})]},e.config.dataKey||e.config.yKey||t))}),Bt={FOCUS_COLOR:"#0078D4",FOCUS_INNER:"#ffffff",INNER_FOCUS_STROKE_WIDTH:2,OUTER_FOCUS_STROKE_WIDTH:2,OUTLINES_GAP:0},Mt=({elementHeight:e,elementPosition:t,elementStrokeWidth:r=0,elementType:a,elementWidth:n,gap:i=0,innerStrokeWidth:o=2,outlineStrokeWidth:s=2})=>{if("circle"===a){const e=n/2+r/2+o/2+i,a=e+o/2+s/2;return{inner:{cx:t.x,cy:t.y,r:e},outer:{cx:t.x,cy:t.y,r:a},type:"circle"}}const c=n+r+o+2*i,d=e+r+o+2*i,l=c+o+s,u=d+o+s;return{inner:{height:d,width:c,x:t.x-c/2,y:t.y-d/2},outer:{height:u,width:l,x:t.x-l/2,y:t.y-u/2},type:"rectangle"}},Xt=(e,t,r)=>{const a=e.start/Math.max(1,t-1)*r;return{endX:e.end/Math.max(1,t-1)*r,startX:a}},Ft=(e,t,r)=>{const a=Math.max(0,Math.min(t,e))/t;return Math.round(a*(r-1))},Vt=(e,t,r=.1)=>{const a=Math.max(0,Math.min(e.start,t-1-r));return{end:Math.min(t-1,Math.max(e.end,a+r)),start:a}},Wt=e=>({end:Math.max(0,e-1),start:0}),Yt=(e,t)=>0===e.start&&e.end===t-1,Kt=({endX:e,focusConfig:t,height:r,isFocused:a,startX:n})=>{if(!a)return null;const i=e-n,o=Mt({elementHeight:r,elementPosition:{x:n+i/2,y:r/2},elementStrokeWidth:0,elementType:"rectangle",elementWidth:i,gap:t.gap,innerStrokeWidth:t.innerStrokeWidth,outlineStrokeWidth:t.outlineStrokeWidth}),s=t.outlineColor,c=t.innerColor,d=t.outlineStrokeWidth,u=t.innerStrokeWidth;return"rectangle"!==o.type?null:l.jsxs("g",{pointerEvents:"none",children:[l.jsx("rect",{fill:"none",height:o.outer.height,stroke:s,strokeWidth:d,width:o.outer.width,x:o.outer.x,y:o.outer.y}),l.jsx("rect",{fill:"none",height:o.inner.height,stroke:c,strokeWidth:u,width:o.inner.width,x:o.inner.x,y:o.inner.y})]})},Ut=({currentRange:e,dataLength:t,dataTestId:r,endX:a,height:n,onBlur:i,onFocus:o,onKeyDown:s,onMouseDown:c,onTouchStart:d,screenReaderText:u,selectionConfig:h,startX:f})=>{const p=h.hideOverlayOnFullRange&&Yt(e,t);return l.jsx(l.Fragment,{children:l.jsx("rect",{"aria-label":u,"aria-valuemax":t-1,"aria-valuemin":0,"aria-valuetext":u,cursor:"grab","data-testid":r,fill:h.fill,fillOpacity:h.fillOpacity,height:n,role:"slider",stroke:h.stroke,strokeWidth:h.strokeWidth,style:{outline:"none",visibility:p?"hidden":"visible"},tabIndex:0,width:a-f,x:f,y:0,onBlur:i,onFocus:o,onKeyDown:s,onMouseDown:c,onTouchStart:d})})},Gt="#8f8f8f",zt=({dataTestId:e,focusConfig:t,handlerConfig:r,height:a,isFocused:n,max:i,min:o,onBlur:s,onFocus:c,onKeyDown:d,onMouseDown:u,onTouchStart:h,screenReaderText:f,x:p})=>{const R=a/2,x=(e=>({fill:e?.fill||"#ffffff",iconColor:e?.iconColor||Gt,radius:e?.radius||17,stroke:e?.stroke||Gt,strokeWidth:e?.strokeWidth||1,verticalLineStroke:e?.verticalLineStroke||Gt,verticalLineStrokeWidth:e?.verticalLineStrokeWidth||2}))(r),_=Mt({elementHeight:2*x.radius,elementPosition:{x:p,y:R},elementStrokeWidth:"number"==typeof x.strokeWidth?x.strokeWidth:parseFloat(x.strokeWidth.toString()),elementType:"circle",elementWidth:2*x.radius,gap:t.gap,innerStrokeWidth:t.innerStrokeWidth,outlineStrokeWidth:t.outlineStrokeWidth});return l.jsxs("g",{"data-testid":`${e}-group`,children:[l.jsx("line",{pointerEvents:"none",stroke:x.verticalLineStroke,strokeWidth:x.verticalLineStrokeWidth,x1:p,x2:p,y1:0,y2:a}),l.jsx("circle",{"aria-label":f,"aria-valuemax":i,"aria-valuemin":o,"aria-valuetext":f,cursor:"ew-resize",cx:p,cy:R,"data-testid":e,fill:x.fill,r:x.radius,role:"slider",stroke:x.stroke,strokeWidth:x.strokeWidth,style:{outline:"none"},tabIndex:0,onBlur:s,onFocus:c,onKeyDown:d,onMouseDown:u,onTouchStart:h}),l.jsx(jt,{fill:x.iconColor,x:p,y:R}),n&&"circle"===_.type&&l.jsxs("g",{pointerEvents:"none",children:[l.jsx("circle",{cx:_.outer.cx,cy:_.outer.cy,fill:"none",r:_.outer.r,stroke:t.outlineColor,strokeWidth:t.outlineStrokeWidth}),l.jsx("circle",{cx:_.inner.cx,cy:_.inner.cy,fill:"none",r:_.inner.r,stroke:t.innerColor,strokeWidth:t.innerStrokeWidth})]})]})},Zt={END_HANDLER:"END_HANDLER",SELECTION_AREA:"SELECTION_AREA",START_HANDLER:"START_HANDLER"},qt=e=>{const{currentRange:t,dataLength:r,interactionConfig:a,onRangeChange:n,width:i}=e,o=u.useRef(null),[s,c]=u.useState(null),d=u.useCallback(e=>()=>{c(e)},[]),l=u.useCallback(e=>()=>{c(e)},[]),h=u.useCallback(e=>{if(!s||!o.current)return;const c=o.current;if(!c)return;const d=e-c.getBoundingClientRect().left,l=Ft(d,i,r),u=((e,t,r,a,n)=>{const i={...t};if(e===Zt.START_HANDLER)i.start=Math.max(0,Math.min(r,t.end-n.minHandlerDistance));else if(e===Zt.END_HANDLER)i.end=Math.min(a-1,Math.max(r,t.start+n.minHandlerDistance));else if(e===Zt.SELECTION_AREA){const e=t.end-t.start,n=Math.max(0,Math.min(a-1-e,r-e/2));i.start=n,i.end=n+e}return i})(s,t,l,r,a),h=Vt(u,r,a.minHandlerDistance);n(h)},[s,i,r,t,n,a]),f=u.useCallback(e=>{h(e.clientX)},[h]),p=u.useCallback(e=>{0!==e.touches.length&&(e.preventDefault(),h(e.touches[0].clientX))},[h]),R=u.useCallback(()=>{c(null)},[]),x=u.useCallback(()=>{c(null)},[]);return u.useEffect(()=>{if(s)return document.addEventListener("mousemove",f),document.addEventListener("mouseup",R),document.addEventListener("touchmove",p,{passive:!1}),document.addEventListener("touchend",x),()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",R),document.removeEventListener("touchmove",p),document.removeEventListener("touchend",x)}},[s,f,R,p,x]),{groupRef:o,handleMouseDown:d,handleTouchStart:l,isDragging:s}},Jt=e=>{const{currentRange:t,dataLength:r,interactionConfig:a,onRangeChange:n}=e;return{handleKeyDown:u.useCallback(e=>i=>{const o=i.shiftKey?a.keyboardFastStep:a.keyboardStep;let s={...t};switch(i.key){case"ArrowLeft":case"ArrowDown":i.preventDefault(),s=((e,t,r,a)=>{const n={...t};if(e===Zt.START_HANDLER)n.start=Math.max(0,t.start-r);else if(e===Zt.END_HANDLER)n.end=Math.max(t.start+a.minHandlerDistance,t.end-r);else if(e===Zt.SELECTION_AREA){const e=t.end-t.start,a=Math.max(0,t.start-r);n.start=a,n.end=a+e}return n})(e,t,o,a);break;case"ArrowRight":case"ArrowUp":i.preventDefault(),s=((e,t,r,a,n)=>{const i={...t};if(e===Zt.START_HANDLER)i.start=Math.min(t.end-n.minHandlerDistance,t.start+r);else if(e===Zt.END_HANDLER)i.end=Math.min(a-1,t.end+r);else if(e===Zt.SELECTION_AREA){const e=t.end-t.start,n=Math.min(a-1-e,t.start+r);i.start=n,i.end=n+e}return i})(e,t,o,r,a);break;case"Home":i.preventDefault(),s=((e,t,r)=>{const a={...t};if(e===Zt.START_HANDLER)a.start=0;else if(e===Zt.END_HANDLER)a.end=r-1;else if(e===Zt.SELECTION_AREA){const e=t.end-t.start;a.start=0,a.end=e}return a})(e,t,r);break;case"End":i.preventDefault(),s=((e,t,r,a)=>{const n={...t};if(e===Zt.START_HANDLER)n.start=t.end-a.minHandlerDistance;else if(e===Zt.END_HANDLER)n.end=r-1;else if(e===Zt.SELECTION_AREA){const e=t.end-t.start;n.start=r-1-e,n.end=r-1}return n})(e,t,r,a);break;default:return}const c=Vt(s,r,a.minHandlerDistance);n(c)},[t,r,n,a])}},Qt=({canvasConfig:e,dataTestId:t,extraSpace:r=0,height:a,width:n})=>{const[i,o]=u.useState({height:0,width:0}),s=u.useMemo(()=>e||{extraSpace:r,height:a,width:n},[e,n,a,r]),{extraSpace:c,height:d,width:l}=s,h=c?E(c):void 0;u.useEffect(()=>{if(!Pe())return;const e=(e=>{const t=je();return t?t.querySelector(e):null})(`[data-testid="${t}"]`);if(!e)return;const r=()=>{const{parsedCanvasHeight:t,parsedCanvasWidth:r}=vt({canvasHeight:d,canvasWidth:l,svgElement:e});o({height:t,width:r})};r();const a=new ResizeObserver(()=>{r()});return a.observe(e),()=>{a.disconnect()}},[l,d,t]);const p=u.useMemo(()=>f(i.width,i.height,h),[i.width,i.height,h]);return{parsedCanvas:i,viewBox:p}},er=()=>{const[e,t]=u.useState(null),r=u.useCallback(e=>()=>t(e),[]);return{handleBlur:u.useCallback(()=>{t(null)},[]),handleFocus:r,isFocused:u.useCallback(t=>e===t,[e])}},tr=(e,t)=>{const r=Math.floor(e);return Math.max(0,Math.min(t,r))},rr=(e,t)=>{const r=Math.ceil(e);return Math.max(0,Math.min(t,r))},ar=(e,t)=>{const r=Math.max(0,t-1);return{endIndex:rr(e.end,r),startIndex:tr(e.start,r)}},nr=({data:e,initialRange:t,onDataChange:r})=>{const a=t||Wt(e.length),[n,i]=u.useState(a),o=t=>{if(!r||0===e.length)return;const{endIndex:a,startIndex:n}=ar(t,e.length),i=e.slice(n,a+1);r(i)};return u.useEffect(()=>{o(n)},[]),{currentRange:n,handleRangeChange:e=>{i(e),o(e)}}},ir=e=>({keyboardFastStep:e?.keyboardFastStep??2,keyboardStep:e?.keyboardStep??1,minHandlerDistance:e?.minHandlerDistance??1}),or=e=>{if(0===e.length)return"";if(1===e.length)return`M ${e[0][0]} ${e[0][1]}`;const[t,...r]=e;let a=`M ${t[0]} ${t[1]}`;return r.forEach((e,n)=>{const i=0===n?t:r[n-1],[o,s]=i,[c,d]=e,l=.3*(c-o),u=[o+l,s],h=[c-l,d];a+=` C ${u[0]} ${u[1]}, ${h[0]} ${h[1]}, ${c} ${d}`}),a},sr=(e,t,r,a)=>{if(0===e.length||0===t.length)return[];const n=.05*a,i=a-2*n,o=t.flatMap(t=>e.map(e=>Number(e[t.yKey]))),s=Math.min(...o),c=Math.max(...o)-s||1;return t.map(t=>{const o=e.map((a,o)=>[o/Math.max(1,e.length-1)*r,n+i-(Number(a[t.yKey])-s)/c*i]),d=t.curved?or(o):`M ${o.map(([e,t])=>`${e},${t}`).join(" L ")}`;let l="";return t.fill&&(l=t.curved?`${or(o)} L ${r} ${a} L 0 ${a} Z`:`${d} L ${r},${a} L 0,${a} Z`),{config:t,fillPath:l,linePath:d}})},cr=(e,t,r)=>e[r]?.[t]?.toString()||`${r}`,dr=(e,t,r)=>{if(!e)return e;const a=new RegExp("{{startValue}}","g"),n=new RegExp("{{endValue}}","g");return e.replace(a,t).replace(n,r)};e.Bar=ke,e.BarChart=at,e.BarOrientation=v,e.ChartText=Xe,e.DefaultCanvasConfig=p,e.ErrorType=y,e.FOCUS_DEFAULT=Bt,e.ForeignObject=$t,e.HandlerIcon=jt,e.Line=Me,e.LineChart=Nt,e.LineRenderer=Dt,e.Node=Ne,e.NodeType=Se,e.Path=be,e.PieChart=Pt,e.Positions=m,e.SelectionArea=Ut,e.SelectionAreaFocusRing=Kt,e.SvgContainer=h,e.Tick=Fe,e.TickDataUtils=ft,e.XAxis=Ye,e.YAxis=ze,e.ZoomArea=({ariaHidden:e,ariaLabel:t,backgroundColor:r,canvasConfig:a,caption:n,classNames:i,data:o,focusConfig:s,handlerConfig:c,height:d="40px",initialRange:f,interactionConfig:p,lines:R,onDataChange:_,role:g,screenReaderTextConfig:A,selectionConfig:E,width:T="100%",xKey:v,...y})=>{const m="zoom-area",C=ir(p),S=(I=E,{fill:I?.fill??"#0078d4",fillOpacity:I?.fillOpacity??.5,hideOverlayOnFullRange:I?.hideOverlayOnFullRange??true,stroke:I?.stroke??"#0078d4",strokeWidth:I?.strokeWidth??0});var I;const N=(e=>({gap:e?.gap??Bt.OUTLINES_GAP,innerColor:e?.innerColor??Bt.FOCUS_INNER,innerStrokeWidth:e?.innerStrokeWidth??Bt.INNER_FOCUS_STROKE_WIDTH,outlineColor:e?.outlineColor??Bt.FOCUS_COLOR,outlineStrokeWidth:e?.outlineStrokeWidth??Bt.OUTER_FOCUS_STROKE_WIDTH}))(s),{currentRange:$,handleRangeChange:b}=nr({data:o,initialRange:f,onDataChange:_}),{parsedCanvas:L,viewBox:k}=Qt({canvasConfig:a,dataTestId:m,height:d,width:T}),O=x(o),H=JSON.stringify(R),w=((e,t,r,a)=>{const{endIndex:n,startIndex:i}=ar(r,e.length),o=cr(e,t,i),s=cr(e,t,n),c=dr(a?.startHandler,o,s)??o;return{endHandler:dr(a?.endHandler,o,s)??s,selectionArea:dr(a?.selectionArea,o,s)??`${o} - ${s}`,startHandler:c}})(o,v,$,A),P=u.useMemo(()=>sr(o,R,L.width,L.height),[O,H,L.width,L.height]),{endX:j,startX:D}=u.useMemo(()=>Xt($,o.length,L.width),[$,O,L.width]),{handleBlur:B,handleFocus:M,isFocused:X}=er(),{handleKeyDown:F}=Jt({currentRange:$,dataLength:o.length,interactionConfig:C,onRangeChange:b}),{groupRef:V,handleMouseDown:W,handleTouchStart:Y}=qt({currentRange:$,dataLength:o.length,interactionConfig:C,onRangeChange:b,width:L.width});return l.jsxs(h,{ref:V,ariaHidden:e,ariaLabel:t,backgroundColor:r,caption:n,className:i,"data-testid":m,height:d,overflow:"visible",role:g,viewBox:k,width:T,...y,children:[l.jsx(Dt,{linesData:P}),l.jsx(Ut,{currentRange:$,dataLength:o.length,dataTestId:`${m}-selection-area`,endX:j,height:L.height,screenReaderText:w.selectionArea,selectionConfig:S,startX:D,onBlur:B,onFocus:M(Zt.SELECTION_AREA),onKeyDown:F(Zt.SELECTION_AREA),onMouseDown:W(Zt.SELECTION_AREA),onTouchStart:Y(Zt.SELECTION_AREA)}),l.jsx(zt,{dataTestId:`${m}-start-handler`,focusConfig:N,handlerConfig:c,height:L.height,isFocused:X(Zt.START_HANDLER),max:$.end-C.minHandlerDistance,min:0,screenReaderText:w.startHandler,type:Zt.START_HANDLER,value:$.start,x:D,onBlur:B,onFocus:M(Zt.START_HANDLER),onKeyDown:F(Zt.START_HANDLER),onMouseDown:W(Zt.START_HANDLER),onTouchStart:Y(Zt.START_HANDLER)}),l.jsx(zt,{dataTestId:`${m}-end-handler`,focusConfig:N,handlerConfig:c,height:L.height,isFocused:X(Zt.END_HANDLER),max:o.length-1,min:$.start+C.minHandlerDistance,screenReaderText:w.endHandler,type:Zt.END_HANDLER,value:$.end,x:j,onBlur:B,onFocus:M(Zt.END_HANDLER),onKeyDown:F(Zt.END_HANDLER),onMouseDown:W(Zt.END_HANDLER),onTouchStart:Y(Zt.END_HANDLER)}),l.jsx(Kt,{endX:j,focusConfig:N,height:L.height,isFocused:X(Zt.SELECTION_AREA),startX:D})]})},e.ZoomAreaElements=Zt,e.ZoomHandler=zt,e.calculateHandlerPositions=Xt,e.calculateLinesPathData=sr,e.clampRange=Vt,e.createDefaultRange=Wt,e.generateCurvedPath=or,e.getInteractionConfig=ir,e.isFullRange=Yt,e.mouseToDataIndex=Ft,e.normalizeToArray=e=>Array.isArray(e)?e:[e],e.useDragInteraction=qt,e.useKeyboardNavigation=Jt,e.useResponsiveCanvas=Qt,e.useZoomAreaFocus=er,e.useZoomData=nr,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KubitCharts={})}(this,function(e){"use strict";var t,r,a,n,i={exports:{}},o={},s={exports:{}},c={};function d(){return r||(r=1,s.exports=function(){if(t)return c;t=1;var e=Symbol.for("react.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.iterator,p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,x={};function g(e,t,r){this.props=e,this.context=t,this.refs=x,this.updater=r||p}function _(){}function A(e,t,r){this.props=e,this.context=t,this.refs=x,this.updater=r||p}g.prototype.isReactComponent={},g.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},g.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},_.prototype=g.prototype;var E=A.prototype=new _;E.constructor=A,R(E,g.prototype),E.isPureReactComponent=!0;var T=Array.isArray,v=Object.prototype.hasOwnProperty,y={current:null},m={key:!0,ref:!0,__self:!0,__source:!0};function C(t,r,a){var n,i={},o=null,s=null;if(null!=r)for(n in void 0!==r.ref&&(s=r.ref),void 0!==r.key&&(o=""+r.key),r)v.call(r,n)&&!m.hasOwnProperty(n)&&(i[n]=r[n]);var c=arguments.length-2;if(1===c)i.children=a;else if(1<c){for(var d=Array(c),u=0;u<c;u++)d[u]=arguments[u+2];i.children=d}if(t&&t.defaultProps)for(n in c=t.defaultProps)void 0===i[n]&&(i[n]=c[n]);return{$$typeof:e,type:t,key:o,ref:s,props:i,_owner:y.current}}function S(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var I=/\/+/g;function N(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function $(t,a,n,i,o){var s=typeof t;"undefined"!==s&&"boolean"!==s||(t=null);var c=!1;if(null===t)c=!0;else switch(s){case"string":case"number":c=!0;break;case"object":switch(t.$$typeof){case e:case r:c=!0}}if(c)return o=o(c=t),t=""===i?"."+N(c,0):i,T(o)?(n="",null!=t&&(n=t.replace(I,"$&/")+"/"),$(o,a,n,"",function(e){return e})):null!=o&&(S(o)&&(o=function(t,r){return{$$typeof:e,type:t.type,key:r,ref:t.ref,props:t.props,_owner:t._owner}}(o,n+(!o.key||c&&c.key===o.key?"":(""+o.key).replace(I,"$&/")+"/")+t)),a.push(o)),1;if(c=0,i=""===i?".":i+":",T(t))for(var d=0;d<t.length;d++){var u=i+N(s=t[d],d);c+=$(s,a,n,u,o)}else if(u=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=f&&e[f]||e["@@iterator"])?e:null}(t),"function"==typeof u)for(t=u.call(t),d=0;!(s=t.next()).done;)c+=$(s=s.value,a,n,u=i+N(s,d++),o);else if("object"===s)throw a=String(t),Error("Objects are not valid as a React child (found: "+("[object Object]"===a?"object with keys {"+Object.keys(t).join(", ")+"}":a)+"). If you meant to render a collection of children, use an array instead.");return c}function b(e,t,r){if(null==e)return e;var a=[],n=0;return $(e,a,"","",function(e){return t.call(r,e,n++)}),a}function L(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var k={current:null},O={transition:null},H={ReactCurrentDispatcher:k,ReactCurrentBatchConfig:O,ReactCurrentOwner:y};function w(){throw Error("act(...) is not supported in production builds of React.")}return c.Children={map:b,forEach:function(e,t,r){b(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return b(e,function(){t++}),t},toArray:function(e){return b(e,function(e){return e})||[]},only:function(e){if(!S(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},c.Component=g,c.Fragment=a,c.Profiler=i,c.PureComponent=A,c.StrictMode=n,c.Suspense=u,c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=H,c.act=w,c.cloneElement=function(t,r,a){if(null==t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var n=R({},t.props),i=t.key,o=t.ref,s=t._owner;if(null!=r){if(void 0!==r.ref&&(o=r.ref,s=y.current),void 0!==r.key&&(i=""+r.key),t.type&&t.type.defaultProps)var c=t.type.defaultProps;for(d in r)v.call(r,d)&&!m.hasOwnProperty(d)&&(n[d]=void 0===r[d]&&void 0!==c?c[d]:r[d])}var d=arguments.length-2;if(1===d)n.children=a;else if(1<d){c=Array(d);for(var u=0;u<d;u++)c[u]=arguments[u+2];n.children=c}return{$$typeof:e,type:t.type,key:i,ref:o,props:n,_owner:s}},c.createContext=function(e){return(e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:o,_context:e},e.Consumer=e},c.createElement=C,c.createFactory=function(e){var t=C.bind(null,e);return t.type=e,t},c.createRef=function(){return{current:null}},c.forwardRef=function(e){return{$$typeof:d,render:e}},c.isValidElement=S,c.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:L}},c.memo=function(e,t){return{$$typeof:l,type:e,compare:void 0===t?null:t}},c.startTransition=function(e){var t=O.transition;O.transition={};try{e()}finally{O.transition=t}},c.unstable_act=w,c.useCallback=function(e,t){return k.current.useCallback(e,t)},c.useContext=function(e){return k.current.useContext(e)},c.useDebugValue=function(){},c.useDeferredValue=function(e){return k.current.useDeferredValue(e)},c.useEffect=function(e,t){return k.current.useEffect(e,t)},c.useId=function(){return k.current.useId()},c.useImperativeHandle=function(e,t,r){return k.current.useImperativeHandle(e,t,r)},c.useInsertionEffect=function(e,t){return k.current.useInsertionEffect(e,t)},c.useLayoutEffect=function(e,t){return k.current.useLayoutEffect(e,t)},c.useMemo=function(e,t){return k.current.useMemo(e,t)},c.useReducer=function(e,t,r){return k.current.useReducer(e,t,r)},c.useRef=function(e){return k.current.useRef(e)},c.useState=function(e){return k.current.useState(e)},c.useSyncExternalStore=function(e,t,r){return k.current.useSyncExternalStore(e,t,r)},c.useTransition=function(){return k.current.useTransition()},c.version="18.3.1",c}()),s.exports}var u=(n||(n=1,i.exports=function(){if(a)return o;a=1;var e=d(),t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function c(e,r,a){var o,c={},d=null,u=null;for(o in void 0!==a&&(d=""+a),void 0!==r.key&&(d=""+r.key),void 0!==r.ref&&(u=r.ref),r)n.call(r,o)&&!s.hasOwnProperty(o)&&(c[o]=r[o]);if(e&&e.defaultProps)for(o in r=e.defaultProps)void 0===c[o]&&(c[o]=r[o]);return{$$typeof:t,type:e,key:d,ref:u,props:c,_owner:i.current}}return o.Fragment=r,o.jsx=c,o.jsxs=c,o}()),i.exports),l=d();const h=l.forwardRef(({ariaHidden:e,ariaLabel:t,backgroundColor:r,caption:a,children:n,className:i,dataTestId:o,height:s,imageSrc:c,overflow:d,radius:l="0px",role:h,tabIndex:f,viewBox:p,width:R,...x},g)=>u.jsxs("svg",{ref:g,"aria-hidden":e,"aria-label":t,className:i,"data-testid":o,height:s,role:h,style:{backgroundColor:r,borderRadius:l,overflow:d},tabIndex:f,viewBox:p,width:R,onMouseDown:e=>e.preventDefault(),...x,children:[a&&u.jsx("title",{children:a}),c&&u.jsx("image",{height:s,href:c,width:R,x:"0",y:"0"}),n]})),f=(e,t,r=0)=>`${-r} ${-r} ${e} ${t}`,p={extraSpace:0,height:80,width:100},R=e=>{const t=new Map,r=()=>{const e={};return t.forEach((t,r)=>{e[r]=t}),e};return{addError:(a,n)=>{if(!n)return;const i={...n,type:a},o=t.get(a)||[];if(o.push(i),t.set(a,o),e){const t=r(),a={};Object.entries(t).forEach(([e,t])=>{const r=e;Array.isArray(t)&&t.length,a[r]=t}),e(a)}},clearErrors:()=>{t.clear(),e&&e({})},getAccumulatedErrors:r}},x=e=>JSON.stringify(e),g="%",_="rem",A=/^(\d+(\.\d+)?)(px|rem|%)?$/,E=e=>{if("number"==typeof e)return e;const t=e.match(A);if(!t)throw new Error(`Invalid string format: "${e}"`);const r=t[1];return t[3]===_?16*parseFloat(r):parseFloat(r)},T=l.createContext({}),v={HORIZONTAL:"HORIZONTAL",VERTICAL:"VERTICAL"},y={BAR_CHART_CONTEXT_ERROR:"BAR_CHART_CONTEXT_ERROR",BAR_CHART_PATH_ERROR:"BAR_CHART_PATH_ERROR",BAR_CHART_SEPARATOR_ERROR:"BAR_CHART_SEPARATOR_ERROR",BAR_CHART_X_AXIS_ERROR:"BAR_CHART_X_AXIS_ERROR",BAR_CHART_Y_AXIS_ERROR:"BAR_CHART_Y_AXIS_ERROR",GENERIC:"GENERIC",LINE_CHART_CONTEXT_ERROR:"LINE_CHART_CONTEXT_ERROR",LINE_CHART_PATH_ERROR:"LINE_CHART_PATH_ERROR",LINE_CHART_PROJECTION_ERROR:"LINE_CHART_PROJECTION_ERROR",LINE_CHART_SEPARATOR_ERROR:"LINE_CHART_SEPARATOR_ERROR",LINE_CHART_X_AXIS_ERROR:"LINE_CHART_X_AXIS_ERROR",LINE_CHART_Y_AXIS_ERROR:"LINE_CHART_Y_AXIS_ERROR",PIE_CHART_CONTEXT_ERROR:"PIE_CHART_CONTEXT_ERROR",PIE_CHART_PATH_ERROR:"PIE_CHART_PATH_ERROR",PIE_CHART_SEGMENT_ERROR:"PIE_CHART_SEGMENT_ERROR"},m={BOTTOM:"BOTTOM",CENTER:"CENTER",CUSTOM:"CUSTOM",LEFT:"LEFT",RIGHT:"RIGHT",TOP:"TOP"},C=Object.entries({BAR_CHART_AXIS_INSUFFICIENT_TICKS:"Axis requires at least two ticks for proper bar scaling",BAR_CHART_AXIS_INVALID_SCALE:"Invalid axis scale for current bar values",BAR_CHART_DISTRIBUTION_INSUFFICIENT_SPACE:"Insufficient space for bar distribution with current configuration",BAR_CHART_DISTRIBUTION_INVALID_GAP:"Invalid gap between bars - must be >= 0 and allow bar rendering",BAR_CHART_DISTRIBUTION_OVERLAP:"Bar distribution results in overlapping bars",BAR_CHART_EMPTY_DATA:"No valid data entries found for bar chart rendering",BAR_CHART_INSUFFICIENT_SPACE_HEIGHT:"Insufficient height to render bars. Consider reducing bar count or increasing chart height",BAR_CHART_INSUFFICIENT_SPACE_WIDTH:"Insufficient width to render bars. Consider reducing bar width or increasing chart width",BAR_CHART_INVALID_VALUE:"Bar value must be a valid number for rendering",BAR_CHART_NEGATIVE_VALUE:"Negative values are not supported in this bar configuration",BAR_CHART_NO_DATA:"Data validation failed: no data provided for bar chart rendering",BAR_CHART_OVERLAP:"Bars are overlapping due to insufficient spacing",BAR_CHART_SEPARATOR_X_OUT_OF_RANGE:"Separator X position is outside valid bar range",BAR_CHART_SEPARATOR_Y_OUT_OF_RANGE:"Separator Y position is outside valid bar range",BAR_CHART_STACK_INVALID:"Invalid stacking configuration - all bars in stack must have consistent configuration",BAR_CHART_STACK_MISSING_VALUES:"Stack is incomplete - all bars in stack must have valid values"}).reduce((e,[t,r])=>(e[t]=new Error(r),e),{}),S=Object.entries({LINE_CHART_INVALID_CANVAS:"Canvas dimensions validation failed: both width and height must be > 0",LINE_CHART_NO_DATA:"Data validation failed: no data provided for chart rendering",LINE_CHART_PATH_ALL_VALUES_NULL:"Path data cannot be generated - all Y values are null or undefined",LINE_CHART_PATH_INSUFFICIENT_POINTS:"Unable to calculate curved path with insufficient points (minimum 2 required)",LINE_CHART_PATH_INVALID_DATAKEY:"DataKey must be a valid string",LINE_CHART_PROJECTION_INVALID_BOUNDS:"Invalid projection bounds - upper projection must be below lower projection",LINE_CHART_PROJECTION_LOWER_X_OUT_OF_RANGE:"Lower projection X coordinate is outside valid range (0-100)",LINE_CHART_PROJECTION_LOWER_Y_OUT_OF_RANGE:"Lower projection Y coordinate is outside chart area",LINE_CHART_PROJECTION_UPPER_X_OUT_OF_RANGE:"Upper projection X coordinate is outside valid range (0-100)",LINE_CHART_PROJECTION_UPPER_Y_OUT_OF_RANGE:"Upper projection Y coordinate is outside chart area",LINE_CHART_SEPARATOR_INVALID_COORDINATES:"Invalid separator position - coordinates overlap, cannot render separator",LINE_CHART_SEPARATOR_INVALID_X_BREAK_AXIS:"Invalid xBreakAxis value: cannot be parsed as number",LINE_CHART_SEPARATOR_INVALID_Y_BREAK_AXIS:"Invalid yBreakAxis value: cannot be parsed as number",LINE_CHART_SEPARATOR_X_OUT_OF_RANGE:"xBreakAxis value is outside data range",LINE_CHART_SEPARATOR_Y_OUT_OF_RANGE:"yBreakAxis value is outside data range",LINE_CHART_SINGLE_POINT:"Data validation failed: single data point provided, minimum 2 required for line chart",LINE_CHART_X_AXIS_IDENTICAL_VALUES:"X-axis range validation failed: minimum and maximum values are identical, cannot render chart line",LINE_CHART_X_AXIS_INSUFFICIENT_TICKS:"X-axis tick calculation: insufficient data points (1/2 minimum required)",LINE_CHART_X_AXIS_ZERO_LENGTH:"X-axis geometry validation failed: start and end X coordinates are identical (x1=x2), axis has zero length",LINE_CHART_Y_AXIS_IDENTICAL_VALUES:"Y-axis range validation failed: minimum and maximum values are identical, cannot render chart line",LINE_CHART_Y_AXIS_INSUFFICIENT_TICKS:"Y-axis tick calculation: insufficient data points (1/2 minimum required)",LINE_CHART_Y_AXIS_ZERO_LENGTH:"Y-axis geometry validation failed: start and end Y coordinates are identical (y1=y2), axis has zero length"}).reduce((e,[t,r])=>(e[t]=new Error(r),e),{}),I=Object.entries({PIE_CHART_EMPTY_DATA:"PieChart data is empty or undefined",PIE_CHART_INNER_RADIUS_OUT_OF_RANGE:"Inner radius must be less than radius",PIE_CHART_INVALID_CANVAS_DIMENSIONS:"Invalid canvas dimensions for PieChart",PIE_CHART_INVALID_DATA_KEY:"Invalid or missing dataKey in PieChart data",PIE_CHART_INVALID_INNER_RADIUS:"Invalid innerRadius value",PIE_CHART_INVALID_RADIUS:"Invalid radius value",PIE_CHART_INVALID_SEGMENT_VALUE:"Invalid segment value (non-numeric)",PIE_CHART_INVALID_TOTAL:"PieChart total value is zero or invalid",PIE_CHART_MISSING_SEGMENT_NAME:"Segment is missing required name property",PIE_CHART_NEGATIVE_SEGMENT_VALUE:"Segment value cannot be negative"}).reduce((e,[t,r])=>(e[t]=new Error(r),e),{}),N=(e,t)=>new Error(`Invalid value "${e}" for bar with dataKey "${t}". Must be a valid number.`),$=(e,t)=>new Error(`Negative value ${e} not allowed for bar with dataKey "${t}" in current configuration`),b=(e,t)=>new Error(`Invalid segment value for "${t}": "${e}" is not a valid number`),L=(e,t)=>new Error(`Negative segment value for "${t}": ${e} (values must be >= 0)`),k=e=>new Error(`DataKey "${e}" not found in PieChart dataset`),O=e=>new Error(`Data array for key "${e}" is empty`),H=(e,t)=>new Error(`Invalid total value for "${e}": ${t} (must be > 0)`),w=(e,t,r)=>new Error(`Invalid group at index ${t} in "${e}": missing required property "${r}"`),P=e=>new Error(`Invalid radius value: "${e}" (must be a positive number)`),j=e=>new Error(`Invalid innerRadius value: "${e}" (must be a positive number or zero)`),D=(e,t)=>new Error(`innerRadius (${e}) must be less than radius (${t}) for donut chart rendering`),B="INVALID_X_TICK",M="BAR_CHART_NO_DATA",X="LINE_CHART_NO_DATA",F="LINE_CHART_PATH_ALL_VALUES_NULL",V="LINE_CHART_PATH_INSUFFICIENT_POINTS",W="LINE_CHART_PATH_INVALID_DATAKEY",Y="LINE_CHART_SEPARATOR_INVALID_COORDINATES",K="LINE_CHART_SINGLE_POINT",U="LINE_CHART_X_AXIS_IDENTICAL_VALUES",G="LINE_CHART_X_AXIS_INSUFFICIENT_TICKS",z="LINE_CHART_X_AXIS_ZERO_LENGTH",Z="LINE_CHART_Y_AXIS_IDENTICAL_VALUES",q="LINE_CHART_Y_AXIS_INSUFFICIENT_TICKS",J="LINE_CHART_Y_AXIS_ZERO_LENGTH",Q={...C,...S,...I,INVALID_X_TICK:new Error("[getXTicks] Invalid X tick values calculated")},ee=e=>Q[e],te=e=>new Error(`DataKey "${e}" not found in dataset`),re=(e,t)=>new Error(`Canvas dimensions validation failed: width=${e}, height=${t} (both must be > 0)`),ae=e=>new Error(`Invalid xBreakAxis value: '${e}' cannot be parsed as number`),ne=e=>new Error(`Invalid yBreakAxis value: '${e}' cannot be parsed as number`),ie=(e,t,r)=>new Error(`xBreakAxis value ${e} is outside data range (${t} - ${r})`),oe=(e,t,r)=>new Error(`yBreakAxis value ${e} is outside data range (${t} - ${r})`),se=({canvasHeight:e,canvasWidth:t,customBreakAxis:r,extraSpaceBottomY:a,extraSpaceLeftX:n,extraSpaceRightX:i,extraSpaceTopY:o,position:s})=>s===m.TOP?{x1:n,x2:t-i,y1:o,y2:o}:s===m.CENTER?{x1:n,x2:t-i,y1:e/2,y2:e/2}:s===m.CUSTOM?{x1:n,x2:t-i,y1:r,y2:r}:{x1:n,x2:t-i,y1:e-a,y2:e-a},ce=({canvasHeight:e,canvasWidth:t,customBreakAxis:r,extraSpaceBottomY:a,extraSpaceLeftX:n,extraSpaceRightX:i,extraSpaceTopY:o,position:s})=>s===m.RIGHT?{x1:t-i,x2:t-i,y1:o,y2:e-a}:s===m.CENTER?{x1:t/2,x2:t/2,y1:o,y2:e-a}:s===m.CUSTOM?{x1:r,x2:r,y1:o,y2:e-a}:{x1:n,x2:n,y1:o,y2:e-a},de=(e,t,r)=>t.map(t=>{if(isNaN(Number(t))){const r=e.find(e=>String(e.value)===String(t));return r?r.position:0}const{index:a,tick:n}=e.reduce((e,r,a)=>Math.abs(Number(r.value)-Number(t))<=Math.abs(Number(e.tick.value)-Number(t))?{index:a,tick:r}:e,{index:0,tick:e[0]}),i=Number(t),o=Number(n.value);if(i!==o){const t=e.map(e=>Number(e.value)),s=Math.min(...t),c=Math.max(...t);if(i<s)return e.at(0)?.position;if(i>c)return e.at(-1)?.position;const d=Math.abs(o-i),u=i>o,l=u?e[a+1]:e[a-1],h=100*d/Math.abs(Number(l.value)-o),f=Math.abs(n.position-l.position)*h/100;return r?u?n.position+f:n.position-f:u?n.position-f:n.position+f}return n.position}),ue=({initPos:e,maxSpaceAvailable:t,otherAxisSpace:r,securitySpace:a,tickValues:n})=>{const i=n.length-1,o=(t-r-a)/i;return n.map((t,r)=>({position:e+r*o+a/2,value:t}))},le=({initPos:e,maxSpaceAvailable:t,needAjusted:r,otherAxisSpace:a,securitySpace:n,tickValues:i})=>{const o=(t-a-n)/(i.length-1),s=r?n/2:0;return i.map((t,r)=>({position:e-r*o-s,value:t}))},he="0",fe="1",pe="fallbackData";(()=>{if("undefined"!=typeof globalThis&&"process"in globalThis){const e=globalThis.process;return"production"===e?.env?.NODE_ENV}})();const Re=e=>e?Object.entries(e).reduce((e,[t,r])=>((t.startsWith("aria-")||t.startsWith("data-"))&&null!=r&&(e[t]=String(r)),e),{}):{},xe=({height:e="140%",width:t="140%",x:r="-20%",y:a="-20%",...n})=>u.jsx("defs",{children:u.jsx("filter",{height:e,id:n.id,width:t,x:r,y:a,children:u.jsx("feDropShadow",{...n.shadowSvgConfig})})}),ge=-1/0,_e=l.forwardRef(({dataTestId:e,position:t,size:r=1,...a},n)=>u.jsx("circle",{...a,ref:n,cx:t?.x,cy:t?.y,"data-testid":`${e}-circle`,r:r/2})),Ae=(e,t,r,a,n)=>{let i="";const o=a===n,s=o?r:2*r;for(let r=0;r<s;r++){const c=o||r%2==0?a:n,d=2*Math.PI/s*r-Math.PI/2;i+=`${e+Math.cos(d)*c},${t+Math.sin(d)*c} `}return i.trim()},Ee=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=Ae(t.x,t.y,6,r/2,r/2);return u.jsx("polygon",{...a,ref:n,"data-testid":`${e}-hexagon`,points:i})}),Te=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=Ae(t.x,t.y,5,r/2,r/2);return u.jsx("polygon",{...a,ref:n,"data-testid":`${e}-pentagon`,points:i})}),ve=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>u.jsx("rect",{...a,ref:n,"data-testid":`${e}-square`,height:r,width:r,x:t.x-r/2,y:t.y-r/2})),ye=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=r/2,o=i/2,s=Ae(t.x,t.y,5,i,o);return u.jsx("polygon",{...a,ref:n,"data-testid":`${e}-star`,points:s})}),me=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=`M ${t.x-r/2} ${t.y} H ${t.x+r/2} M ${t.x} ${t.y-r/2} V ${t.y+r/2}`;return u.jsx("path",{...a,ref:n,d:i,"data-testid":`${e}-straight`,strokeWidth:2})}),Ce=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=[`${t.x},${t.y-r/2}`,`${t.x-r/2},${t.y+r/2}`,`${t.x+r/2},${t.y+r/2}`].join(" ");return u.jsx("polygon",{...a,ref:n,"data-testid":`${e}-triangle`,points:i})}),Se={Circle:"circle",Hexagon:"hexagon",Pentagon:"pentagon",Square:"square",Star:"star",Straight:"straight",Triangle:"triangle"},Ie={[Se.Circle]:_e,[Se.Hexagon]:Ee,[Se.Pentagon]:Te,[Se.Square]:ve,[Se.Star]:ye,[Se.Straight]:me,[Se.Triangle]:Ce},Ne=l.forwardRef(({dataTestId:e="node",haloConfig:t,hasHalo:r=!1,onBlur:a,onClick:n,onDoubleClick:i,onFocus:o,onKeyDown:s,onMouseEnter:c,onMouseLeave:d,position:h={x:0,y:0},size:f=1,type:p=Se.Circle,...R},x)=>{const[g,_]=(e=>{const t=l.useRef(!1),r=l.useRef(null);l.useImperativeHandle(e,()=>r.current,[]);const a=e=>{t.current=!!e.autoClick};return l.useEffect(()=>{if(!r.current)return;const e=r.current;return e.addEventListener("click",a),()=>e.removeEventListener("click",a)},[]),[r,t]})(x),A={...R,className:`node ${R.className}`,onBlur:e=>{a?.(e)},onClick:e=>{n?.(e,{...R.data,nodePosition:h},_.current)},onDoubleClick:e=>{i?.(e,R.data)},onFocus:e=>{o?.(e,R.data)},onKeyDown:e=>{"Enter"===e.key&&s?.(e,R.data)},onMouseEnter:e=>{c?.(e,R.data)},onMouseLeave:e=>{d?.(e)}},E={className:R.className,fill:t?.fill||R.fill,fillOpacity:t?.fillOpacity||.25,opacity:t?.opacity||.3,stroke:t?.stroke||R.stroke,strokeWidth:t?.strokeWidth||R.strokeWidth},T=Ie[p];return u.jsxs(u.Fragment,{children:[r&&u.jsx(T,{...E,"aria-hidden":"true",dataTestId:`${e}-halo`,position:h,size:f+f/2,tabIndex:-1}),u.jsx(T,{...A,ref:g,dataTestId:e,position:h,size:f})]})}),$e=l.forwardRef(({data:e,nodeConfig:t,tabIndex:r=0,x:a,y:n},i)=>{const o=t?Re(t):{};if(o["aria-label"]&&e&&"string"==typeof o["aria-label"]){const t=o["aria-label"];if(t.includes("{{")){const r=((e,t,r)=>{if(!e)return;const a=r??t.dataValue,n=Array.isArray(a)?a[t.index]:void 0,{xValue:i,yValue:o}=((e,t)=>({xValue:e&&t.xKey?e[t.xKey]?.toString()??"":"",yValue:e&&t.dataKey?e[t.dataKey]?.toString()??"":""}))(n,t);return((e,t,r,a)=>{let n=e;return void 0!==t.dataKey&&(n=n.replace(new RegExp("{{dataKey}}","g"),t.dataKey)),n=n.replace(new RegExp("{{xValue}}","g"),r),n=n.replace(new RegExp("{{yValue}}","g"),a),void 0!==t.index&&(n=n.replace(new RegExp("{{index}}","g"),(t.index+1).toString())),n})(e,t,i,o)})(t,{dataKey:e.dataKey,dataValue:e.dataValue,index:e.index??0,xKey:e.xKey},e.dataValue);r&&(o["aria-label"]=r)}}return u.jsx(u.Fragment,{children:t&&u.jsx(Ne,{...t,ref:i,...o,className:"node-path-focus-border",data:e,hasHalo:t.hasHalo,position:{x:a,y:n},tabIndex:r})})}),be=l.forwardRef(({classNames:e="",fill:t="transparent",stroke:r="#0000FF",strokeWidth:a="1",focusConfig:n={stroke:"#0000FF",strokeWidth:"0.5"},hoverConfig:i={stroke:"#0000FF",strokeWidth:"0.5"},role:o="img",...s},c)=>{const{handleBlur:d,handleFocus:h,isFocused:f}=((e,t)=>{const[r,a]=l.useState(!1),n=l.useCallback(t=>{a(!0),e?.(t)},[e]);return{handleBlur:l.useCallback(e=>{a(!1),t?.(e)},[t]),handleFocus:n,isFocused:r}})(s.onFocus,s.onBlur),{handleMouseEnter:p,handleMouseLeave:R,isHovered:x}=((e,t)=>{const[r,a]=l.useState(!1);return{handleMouseEnter:l.useCallback(t=>{a(!0),e?.(t)},[e]),handleMouseLeave:l.useCallback(e=>{a(!1),t?.(e)},[t]),isHovered:r}})(s.onMouseEnter,s.onMouseLeave),g=l.useRef(null),_=l.useRef([]),A=l.useRef(null);l.useImperativeHandle(c,()=>({get main(){return A.current},get node(){return _.current},get path(){return g.current}}));const E=s.gradient&&((e,t="gradientePath")=>{const r=e.split(",").map(e=>e.trim()),a=parseInt(r[0],10),n=r.slice(1).map(e=>{const[t,r]=e.split(" ");return{color:t,offset:r}});let i="0%",o="0%",s="0%";switch(a){case 180:s="100%";break;case 90:o="100%";break;case 270:i="100%";break;default:return u.jsx(u.Fragment,{})}return u.jsx("defs",{children:u.jsx("linearGradient",{id:t,x1:i,x2:o,y1:"0%",y2:s,children:n.map((e,t)=>u.jsx("stop",{offset:e.offset,stopColor:e.color},`${t}-${e.offset}`.toString()))})})})(s.gradient),T=Re(s),v={...{...s,classNames:`path ${e}`,fill:E?"url(#gradientePath)":t,filter:"url(#shadow)",role:o,stroke:r,strokeWidth:a},...f&&n,...x&&i};return u.jsxs("g",{ref:A,tabIndex:-1,children:[E&&E,v.shadowSvgConfig&&u.jsx(xe,{id:"shadow",shadowSvgConfig:v.shadowSvgConfig}),u.jsxs("g",{"aria-label":v.ariaLabel,className:v.classNames,"data-draw":!0,filter:v.shadowSvgConfig&&v.filter,opacity:v.opacity,orientation:v.orientation,role:v.role,rotate:v.rotate,tabIndex:v.tabIndex,transform:v.transform,visibility:v.visibility,...T,onBlur:d,onClick:()=>{s.onClick?.(s.dataValue)},onDoubleClick:e=>{s.onDoubleClick?.(e,s.dataValue)},onFocus:h,onKeyDown:e=>{"Enter"===e.key&&s.onKeyDown?.(s.dataValue)},onMouseDown:e=>{e.preventDefault()},onMouseEnter:p,onMouseLeave:R,children:[u.jsx("path",{ref:g,d:v.d,"data-testid":v.dataTestId,fill:v.dFill?"transparent":v.fill,fillOpacity:v.fillOpacity,fillRule:v.fillRule,stroke:v.stroke,strokeDasharray:v.strokeDasharray,strokeDashoffset:v.strokeDashoffset,strokeLinecap:v.strokeLinecap,strokeLinejoin:v.strokeLinejoin,strokeMiterlimit:v.strokeMiterlimit,strokeOpacity:v.strokeOpacity,strokeWidth:v.strokeWidth,children:v.title&&u.jsx("title",{children:v.title})}),v.dFill&&u.jsx("path",{d:v.dFill,fill:v.fill,fillOpacity:v.fillOpacity,fillRule:v.fillRule})]}),v.points&&v.nodeConfig&&v.points.map(([e,t],r)=>{const a={dataKey:v.dataKey,dataValue:v.dataValue,index:r,xKey:v?.xKey};return u.jsx($e,{ref:e=>_.current[r]=e,data:a,nodeConfig:v.nodeConfig,tabIndex:-1,x:e,y:t},`${r.toString()}`)})]})}),Le=(e,t,r)=>e?t+r/2:t-r/2,ke=({barConfig:e,currentBars:t,endRounded:r,extraSpacing:a=0,order:n=1,orientation:i,startRounded:o,x1:s,x2:c,y1:d,y2:l})=>{const{barWidth:h,singleConfig:f}=e,p=(({barConfig:e,orientation:t,x1:r,x2:a,y1:n,y2:i})=>{const{gap:o=0,singleConfig:s}=e,c=t===v.HORIZONTAL,d=c?r:n,u=c?a:i,l={end:u<d,start:u>d};return s.reduce((e,t,r)=>{const{coverage:a}=t,n=((e,t)=>e/100*t)(a,u-d),i=0===r?d:Le(l.start,e[r-1][1],o),c=r+1===s.length?u:Le(l.end,i+n,o);return e.push([i,c]),e},[])})({barConfig:e,orientation:i,x1:s,x2:c,y1:d,y2:l});return u.jsx("g",{children:f.map((e,R)=>{const[x,g]="HORIZONTAL"===i?p[R]:[s,c],[_,A]="VERTICAL"===i?p[R]:[d,l],E=(({barWidth:e,currentBars:t,endRounded:r=0,extraSpacing:a,order:n,orientation:i,startRounded:o=0,x1:s,x2:c,y1:d,y2:u})=>{let l,h,f,p,R="Z";const x=(({barWidth:e,currentBars:t,extraSpacing:r,order:a,orientation:n})=>{const i=e/2,o=r/2,s=t%2==0,c=s?o:o+i,d=a-Math.ceil(t/2);let u=0;return 0===d?u=s?-o:i:d<0?u=n===v.HORIZONTAL?d*-c+e:d*c:d>0&&(u=n===v.HORIZONTAL?d*-c:d*c+e),u})({barWidth:e,currentBars:t,extraSpacing:a,order:n,orientation:i});if(i===v.HORIZONTAL){const t=s+o,a=c-r;o&&r?(l=`M ${t},${d+x}`,h=`L${a},${u+x}`,f=`Q${c+r} ${u+x-e/2}, ${a} ${u+x-e}`,p=`L${t},${d+x-e}`,R=`Q${s-o} ${d+x-e/2}, ${t} ${d+x}`):o?(l=`M ${t},${d+x}`,h=`L${c},${u+x}`,f=`L${c},${u+x-e}`,p=`L${t},${d+x-e}`,R=`Q${s-o} ${d+x-e/2}, ${t} ${d+x}`):r?(l=`M${s},${d+x}`,h=`L${a},${u+x}`,f=`Q${c+r} ${u+x-e/2}, ${a} ${u+x-e}`,p=`L${s},${d+x-e}`):(l=`M${s},${d+x}`,h=`L${c},${u+x}`,f=`L${c},${u+x-e}`,p=`L${s},${d+x-e}`)}else{const t=d-o,a=u+r;o&&r?(l=`M${s+x}, ${t}`,h=`L${c+x},${a}`,f=`Q${c+x-e/2} ${u-r}, ${c+x-e} ${a}`,p=`L${s+x-e},${t}`,R=`Q${s+x-e/2} ${d+o}, ${s+x} ${t}`):o?(l=`M${s+x}, ${t}`,h=`L${c+x},${u}`,f=`L${c+x-e},${u}`,p=`L${s+x-e},${t}`,R=`Q${s+x-e/2} ${d+o}, ${s+x} ${t}`):r?(l=`M${s+x},${d}`,h=`L${c+x},${a}`,f=`Q${c+x-e/2} ${u-r}, ${c+x-e} ${a}`,p=`L${c+x-e},${d}`):(l=`M${s+x},${d}`,h=`L${c+x},${u}`,f=`L${c+x-e},${u}`,p=`L${s+x-e},${d}`)}return`${l} ${h} ${f} ${p} ${R}`})({barWidth:h,currentBars:t,endRounded:R===f.length-1&&r?r:void 0,extraSpacing:a,order:n,orientation:i,startRounded:0===R&&o?o:void 0,x1:x,x2:g,y1:_,y2:A});return u.jsx(be,{d:E,fill:e.color,hoverConfig:{stroke:"transparent",strokeWidth:"0"},stroke:"transparent",tabIndex:0,title:e.title},`${e.title}-${R.toString()}`)})})},Oe=({barConfig:e,dataIdx:t,dataKey:r,order:a,...n})=>{const{addError:i,xAxisCoordinates:o,yAxisCoordinates:s,...c}=l.useContext(T),{coordinates:d,tickValues:h}=o,{coordinates:f,tickValues:p}=s,R=c.orientation===v.VERTICAL,x=R?c.pKey:r,g=R?r:c.pKey,_=c.data[t],A=_?.[x],E=_?.[g],y=c.data[0],m=!!y&&Object.prototype.hasOwnProperty.call(y,r),C=c.data.length>0,S=Number(E);l.useEffect(()=>{!C||m?isNaN(S)?i?.("BAR_CHART_PATH_ERROR",{error:N(E,r)}):S<0&&i?.("BAR_CHART_PATH_ERROR",{error:$(S,r)}):i?.("BAR_CHART_PATH_ERROR",{error:te(r)})},[r,C,m,S,E]);const I=de(h,[String(A)],!0)[0],b=de(p,[String(E)])[0],L=R?{x1:I,x2:I,y1:d.y1,y2:b}:{x1:f.x1,x2:I,y1:b,y2:b};return u.jsx(ke,{barConfig:e,currentBars:c.barChildrenCount,extraSpacing:c.gapBetweenBars,order:a,orientation:c.orientation,...L,...n})},He=e=>{let t=0;return l.Children.toArray(e).forEach(e=>{l.isValidElement(e)&&e.type===Oe&&e.props.order>t&&(t=e.props.order)}),t},we=e=>{if(0===e.length)return{numeric:{max:2,min:0,step:1}};const t=Math.min(...e.map(e=>parseFloat(e))),r=Math.max(...e.map(e=>parseFloat(e)));return{numeric:{max:r,min:t,step:Math.abs(r-t)/2}}},Pe=()=>"undefined"!=typeof window&&"undefined"!=typeof document,je=()=>Pe()?document:void 0,De=e=>{const t=je();if(t)return t.createElementNS("http://www.w3.org/2000/svg",e)},Be=({bound:e,data:t,fontSize:r,svgHeight:a,svgWidth:n,viewBox:i})=>{if(!Pe()||!t.length)return 0;const o=je();if(!o)return 0;const s=De("svg");if(!s)return 0;s.setAttribute("style","position: absolute; visibility: hidden; top: -9999px; left: -9999px;"),s.setAttribute("viewBox",i),s.setAttribute("width",n),s.setAttribute("height",a),o.body.appendChild(s);const c=t.map(t=>{const a=De("text");if(!a)return 0;a.setAttribute("font-size",r),a.textContent=t,s.appendChild(a);const n=a.getBBox()[e];return a.remove(),n});return s.remove(),Math.max(...c,0)},Me=({ariaLabel:e="",className:t="line",dataTestId:r,tabIndex:a=-1,...n})=>u.jsx("line",{...n,"aria-label":e,className:t,"data-testid":r,tabIndex:a}),Xe=({children:e,className:t="circle",tabIndex:r=-1,...a})=>u.jsx("text",{className:t,tabIndex:r,...a,children:e}),Fe=({showTickLines:e,tick:t,tickLine:r,tickText:a})=>u.jsxs("g",{children:[e&&u.jsx(Me,{...r}),a&&u.jsx(Xe,{...a,children:t.value})]}),Ve=(e,t,r=1)=>e>=t-r&&e<=t+r,We=e=>{const{ariaLabel:t,className:r,dataTestId:a,opacity:n,stroke:i,strokeDasharray:o,strokeDashoffset:s,strokeLinecap:c,strokeLinejoin:d,strokeOpacity:u,strokeWidth:l,style:h,tabIndex:f,transform:p,x1:R,x2:x,y1:g,y2:_}=e;return{ariaLabel:t,className:r,dataTestId:a,opacity:n,stroke:i,strokeDasharray:o,strokeDashoffset:s,strokeLinecap:c,strokeLinejoin:d,strokeOpacity:u,strokeWidth:l,style:h,tabIndex:f,transform:p,x1:R,x2:x,y1:g,y2:_}},Ye=({canvasHeight:e=p.height,canvasWidth:t=p.width,cursor:r=0,extraSpace:a={bottom:0,left:0,right:0,top:0},position:n=m.BOTTOM,showTickLines:i=!1,tickLine:o,tickLineHover:s,tickText:c,tickValues:d=[],...l})=>{const h=Re(l);return u.jsxs("g",{...h,children:[u.jsx(Me,{...We(l)}),d&&d.length>0&&d.map((e,t)=>{const a=Ve(r,e.position)&&s?{...o,...s}:o,n="rotate"===c?.transform?`rotate(-30, ${e.position}, ${c.y})`:void 0;return u.jsx(Fe,{showTickLines:i,tick:e,tickLine:{...a,x1:e.position,x2:e.position},tickText:{...c,transform:n,x:e.position}},`${t.toString()}`)})]})},Ke=(e,t,r)=>e===m.RIGHT?t+r:t-r,Ue=(e,t,r,a)=>e===m.TOP?r:t+r+a,Ge=({position:e=m.BOTTOM,tickLine:t,tickText:r,...a})=>{const{xAxisCoordinates:{coordinates:n,tickValues:i},...o}=l.useContext(T),s=Ue(e,n.y1,Number(r?.fontSize),r?.top??0),c=o.extraSpaceTopY,d=Number(o.canvasHeight)-o.extraSpaceBottomY;return u.jsx(Ye,{...n,...a,canvasHeight:Number(o.canvasHeight),canvasWidth:Number(o.canvasWidth),dataTestId:`${o.dataTestId}xAxis`,extraSpace:{left:o.extraSpaceLeftX,right:o.extraSpaceRightX},tickLine:{...t,y1:c,y2:d},tickText:{...r,y:s},tickValues:r?i:void 0})},ze=({canvasWidth:e,cursor:t=0,extraSpace:r={bottom:0,left:0,right:0,top:0},position:a=m.LEFT,showTickLines:n=!0,tickLine:i,tickLineHover:o,tickText:s,tickValues:c=[],...d})=>{const l=Re(d);return u.jsxs("g",{...l,children:[u.jsx(Me,{...We(d)}),c&&c.length>0&&c.map((e,r)=>{const a=Ve(t,e.position)&&o?{...i,...o}:i,c="rotate"===s?.transform?`rotate(-30, ${s.x}, ${e.position})`:void 0;return u.jsx(Fe,{showTickLines:n,tick:e,tickLine:{...a,y1:e.position,y2:e.position},tickText:{...s,transform:c,y:e.position}},`${r.toString()}`)})]})},Ze=(e,t,r)=>{let a=0;switch(e){case"middle":a=t/2+r;break;case"end":a=t+r;break;default:a=0}return a},qe=({position:e=m.LEFT,tickLine:t,tickText:r,...a})=>{const{yAxisCoordinates:{coordinates:n,tickValues:i},...o}=l.useContext(T),s=r?.textAnchor||"middle",c=(e===m.RIGHT?r?.right:r?.left)??0,d=Ze(s,o.yAxisText,c),h=Ke(e,n.x1,d);return u.jsx(ze,{...n,...a,canvasHeight:Number(o.canvasHeight),canvasWidth:Number(o.canvasWidth),dataTestId:`${o.dataTestId}yAxis`,tickLine:{...t,x1:o.extraSpaceLeftX,x2:Number(o.canvasWidth)-o.extraSpaceRightX},tickText:{...r,x:h},tickValues:r?i:void 0})},Je=e=>{if(e.custom)return e.custom?.values;if(e.numeric){const{max:t,min:r=0,step:a}=e.numeric;if(a>=Math.abs(t-r)||a<=0)return[r.toString()];const n=[];for(let e=r;e<=t;e+=a)n.push(e.toString());return n}},Qe=(e,t)=>e.flatMap(e=>Object.keys(e).filter(r=>r!==t&&"number"==typeof e[r]).map(t=>Number(e[t]))),et=(e,t,r,a,n,i,o,s)=>{const{position:c,tickText:d,tickValues:u}=e.props,l=d?.fontSize??0,h=l*a,f=u?Je(u):t.map(e=>e[r]),p=Be({bound:"width",data:f,fontSize:l,svgHeight:`${o}`,svgWidth:`${s}`,viewBox:i}),R=n>p?n:p;return{barChartXPosition:c||m.BOTTOM,extraSpaceBottomY:c===m.BOTTOM?h+(d?.top??0):0,extraSpaceTopY:c===m.TOP?h+(d?.bottom??0):0,securityXSpace:R,xBreakAxis:u?.numeric?u.numeric.breakAxis??0:d?.custom?.breakAxis??0,xData:f}},tt=(e,t,r,a,n,i,o,s)=>{const{position:c,tickText:d,tickValues:u}=e.props,l=d?.fontSize??0,h=l*a,f=u||we([...new Set(Qe(t,r))]),p=Je(f),R=n>h?n:h,x=Be({bound:"width",data:p,fontSize:l,svgHeight:`${o}`,svgWidth:`${s}`,viewBox:i});return{barChartYPosition:c||m.LEFT,extraSpaceLeftX:c===m.LEFT?x+(d?.right??0):0,extraSpaceRightX:c===m.RIGHT?x+(d?.left??0):0,securityYSpace:R,yAxisText:x,yBreakAxis:u?.numeric?u.numeric.breakAxis??0:d?.custom?.breakAxis??0,yData:p}},rt=({addError:e,ajustedX:t,ajustedY:r,canvasHeight:a,canvasWidth:n,children:i,data:o,gapBetweenBars:s,orientation:c,pKey:d,viewBox:u})=>{let h;if(!o||0===o.length){const t={error:ee(M)};e?.("BAR_CHART_CONTEXT_ERROR",t),h=t}if(n<=0||a<=0){const t={error:re(n,a)};e?.("BAR_CHART_CONTEXT_ERROR",t),h=t}const f=He(i),p=20*f,R=(f-1)*s,x=c===v.VERTICAL?n:a;if(p+R>x){const t={error:(g=`Insufficient space: requires ${p+R}px but only ${x}px available`,new Error(`Invalid bar distribution for "all": ${g}`))};e?.("BAR_CHART_CONTEXT_ERROR",t),h=t}var g;const _=o&&o.length>0?o:[{[pe]:0,[d]:he},{[pe]:0,[d]:fe}],A=n>0?n:100,E=a>0?a:100,{barChartXPosition:T,barChartYPosition:C,extraSpaceBottomY:S,extraSpaceLeftX:I,extraSpaceRightX:N,extraSpaceTopY:$,securityXSpace:b,securityYSpace:L,xAxisText:k,xBreakAxis:O,xData:H,yAxisText:w,yBreakAxis:P,yData:j}=(({ajustedX:e,ajustedY:t,canvasHeight:r,canvasWidth:a,children:n,data:i,gapBetweenBars:o,orientation:s,pKey:c,viewBox:d})=>{let u={barChartXPosition:m.BOTTOM,barChartYPosition:m.LEFT,extraSpaceBottomY:0,extraSpaceLeftX:0,extraSpaceRightX:0,extraSpaceTopY:0,securityXSpace:0,securityYSpace:0,xAxisText:0,xBreakAxis:0,xData:[],yAxisText:0,yBreakAxis:0,yData:[]},h=o;const f=[];return l.Children.forEach(n,n=>{if(l.isValidElement(n))if(n.type!==Oe||f.includes(n.props.order)||(f.push(n.props.order),h+=n.props.barConfig.barWidth??0),n.type===Ge){const t=s===v.VERTICAL?h:0;u={...u,...et(n,i,c,e,t,d,r,a)}}else if(n.type===qe){const e=s===v.HORIZONTAL?h:0;u={...u,...tt(n,i,c,t,e,d,r,a)}}}),u})({ajustedX:t,ajustedY:r,canvasHeight:E,canvasWidth:A,children:i,data:_,gapBetweenBars:s,orientation:c,pKey:d,viewBox:u}),D=T!==m.TOP&&T!==m.BOTTOM,X=ue({initPos:I,maxSpaceAvailable:A,otherAxisSpace:I+N,securitySpace:b,tickValues:H});if((X??[]).some(({position:e})=>isNaN(e))){const t={error:ee(B)};e?.("BAR_CHART_CONTEXT_ERROR",t),h=t}if(X){const t=X.length<2,r=X.length>=2&&1===new Set(X.map(e=>e.value)).size;if(t){const t={error:ee(G)};e?.("BAR_CHART_X_AXIS_ERROR",t),h||(h=t)}if(r){const t={error:ee(U)};e?.("BAR_CHART_X_AXIS_ERROR",t),h||(h=t)}}const F=C!==m.LEFT&&C!==m.RIGHT,V=le({initPos:E-S,maxSpaceAvailable:E,needAjusted:c===v.HORIZONTAL,otherAxisSpace:$+S,securitySpace:L,tickValues:j});if(V){const t=V.length<2,r=V.length>=2&&1===new Set(V.map(e=>e.value)).size;if(t){const t={error:ee(q)};e?.("BAR_CHART_Y_AXIS_ERROR",t),h||(h=t)}if(r){const t={error:ee(Z)};e?.("BAR_CHART_Y_AXIS_ERROR",t),h||(h=t)}}const W=D?de(V||[],[String(O)])[0]:0,Y=F?de(X||[],[String(P)])[0]:0,K=se({canvasHeight:E,canvasWidth:A,customBreakAxis:Number(W),extraSpaceBottomY:S,extraSpaceLeftX:I,extraSpaceRightX:N,extraSpaceTopY:$,position:T}),Q=ce({canvasHeight:E,canvasWidth:A,customBreakAxis:Number(Y),extraSpaceBottomY:S,extraSpaceLeftX:I,extraSpaceRightX:N,extraSpaceTopY:$,position:C});if(K.x1===K.x2){const t={error:ee(z)};e?.("BAR_CHART_X_AXIS_ERROR",t),h||(h=t)}if(Q.y1===Q.y2){const t={error:ee(J)};e?.("BAR_CHART_Y_AXIS_ERROR",t),h||(h=t)}const te={addError:e,crossXAxis:D,crossYAxis:F,data:_,extraSpaceBottomY:S,extraSpaceLeftX:I,extraSpaceRightX:N,extraSpaceTopY:$,securityXSpace:b,securityYSpace:L,xAxisCoordinates:{coordinates:K,tickValues:X||(h?[{position:0,value:he},{position:A,value:fe}]:[])},xAxisText:k,yAxisCoordinates:{coordinates:Q,tickValues:V||(h?[{position:E,value:he},{position:0,value:fe}]:[])},yAxisText:w};return h?{...te,error:{...h,type:y.BAR_CHART_CONTEXT_ERROR}}:te},at=Object.assign(({canvasConfig:e=p,caption:t,children:r,classNames:a,data:n,dataTestId:i,gapBetweenBars:o=0,height:s="100%",onErrors:c,orientation:d,pKey:g,role:_,tabIndex:A,width:v="100%",...y})=>{const{extraSpace:m,height:C,width:S}=e,I=E(S),N=E(C),$=m?E(m):void 0,b=f(I,N,$),L=He(r),k=2*o,O=[u.jsx(Ge,{},"default-x-axis"),u.jsx(qe,{},"default-y-axis")],H=l.Children.toArray(r)||[],w=O.concat(H),P=Math.max(I,N,$??0),j=I/P,D=N/P,B=l.useMemo(()=>R(c),[c]),M=x(n),X=l.useMemo(()=>(B.clearErrors(),rt({addError:(e,t)=>{B.addError(e,t)},ajustedX:j,ajustedY:D,canvasHeight:N,canvasWidth:I,children:w,data:n,gapBetweenBars:k,orientation:d,pKey:g,viewBox:b})),[C,S,M,g,d,B.addError]);return u.jsx(h,{caption:t,className:a,dataTestId:i,height:s,role:_,tabIndex:A,viewBox:b,width:v,...y,children:u.jsx(T.Provider,{value:{...X,barChildrenCount:L,canvasExtraSpace:$,canvasHeight:N,canvasWidth:I,data:n,dataTestId:i,gapBetweenBars:o,orientation:d,pKey:g},children:r})})},{Path:Oe,Separator:({areaSeparator:e,dataTestId:t,rightSeparator:r,topSeparator:a,xBreakAxis:n,yBreakAxis:i})=>{const{addError:o,crossXAxis:s,crossYAxis:c,xAxisCoordinates:d,yAxisCoordinates:h}=l.useContext(T),f=d.tickValues,p=h.tickValues,R=void 0!==n?"string"==typeof n?parseFloat(n):n:void 0,x=void 0!==i?"string"==typeof i?parseFloat(i):i:void 0;if(l.useEffect(()=>{if(void 0!==n){const e=f.map(e=>e.value);if(void 0===R||isNaN(R))o?.("BAR_CHART_SEPARATOR_ERROR",{error:ae(n)});else{const t=Math.min(...e.map(e=>"string"==typeof e?parseFloat(e):e)),r=Math.max(...e.map(e=>"string"==typeof e?parseFloat(e):e));(R<t||R>r)&&o?.("BAR_CHART_SEPARATOR_ERROR",{error:ie(R,t,r)})}}if(void 0!==i){const e=p.map(e=>e.value);if(void 0===x||isNaN(x))o?.("BAR_CHART_SEPARATOR_ERROR",{error:ne(i)});else{const t=Math.min(...e.map(e=>"string"==typeof e?parseFloat(e):e)),r=Math.max(...e.map(e=>"string"==typeof e?parseFloat(e):e));(x<t||x>r)&&o?.("BAR_CHART_SEPARATOR_ERROR",{error:oe(x,t,r)})}}},[n,R,f,i,x,p]),!a&&!r&&!e)return u.jsx(u.Fragment,{});const g=n&&de(d.tickValues,[n],!0)[0],_=i&&de(h.tickValues,[i])[0],A=c?h.coordinates.x1:d.coordinates.x2,E=s?d.coordinates.y1:h.coordinates.y1,v=d.coordinates.x1,y=g??A,m=h.coordinates.y2,C=_??E;l.useEffect(()=>{v===y&&m===C&&o?.("BAR_CHART_SEPARATOR_ERROR",{error:ee(Y)})},[v,y,m,C]);const S=`M${v} ${m} H ${y} V ${C} H ${v} Z`,I=`M${v} ${C} H ${y}`,N=`M${y} ${m} V ${C}`;return u.jsxs("g",{children:[u.jsx("path",{d:S,"data-testid":`${t}Area`,...e}),u.jsx("path",{d:I,"data-testid":`${t}Top`,...a}),u.jsx("path",{d:N,"data-testid":`${t}Right`,...r})]})},XAxis:Ge,YAxis:qe}),nt=l.createContext({}),it=({curved:e=!1,extendToBottom:t=!1,points:r,svgHeight:a})=>{if(0===r.length)return"";const[n,...i]=r;let o=`M ${n[0]} ${n[1]}`;return o+=e?i.reduce((e,t,a)=>{const[n,i]=r[a],[o,s]=t,c=.3*(o-n),d=[n+c,i],u=[o-c,s];return`${e} C ${d[0]} ${d[1]}, ${u[0]} ${u[1]}, ${o} ${s}`},""):i.reduce((e,t)=>`${e} L ${t[0]} ${t[1]}`,""),t&&(o+=` L ${i[i.length-1][0]} ${a} L ${n[0]} ${a} Z`),o},ot=(e,t)=>new Error(`Invalid projection bounds - upper projection (${e}) must be below lower projection (${t})`),st=(e,t)=>new Error(`${t?"Upper":"Lower"} projection X coordinate (${e}) is outside valid range (0-100)`),ct=(e,t,r)=>new Error(`${r?"Upper":"Lower"} projection Y coordinate (${e}) is outside chart area (0-${t})`),dt=(e,t)=>{if(!t)return e;const r=t<0,a=e*Math.abs(t)/100;return r?e-a:e+a},ut=(e,t,r)=>{if(!r)return e;const a=r<0,n=(0===e?t:e)*Math.abs(r)/100;return a?e+n:e-n},lt=({curved:e,lineProjection:t,points:r,svgHeight:a})=>{const{addError:n}=l.useContext(nt),{lower:i,shapeColor:o,upper:s}=t,{xProjection:c,yProjection:d,...h}=s||{},{xProjection:f,yProjection:p,...R}=i||{},x=c||d?{x:c,y:d}:void 0,g=f||p?{x:f,y:p}:void 0,_=x?.y,A=g?.y,E=x?.x,T=g?.x;l.useEffect(()=>{if(x&&g){const e=_||0,t=A||0;e>=t&&n?.("LINE_CHART_PROJECTION_ERROR",{error:ot(e,t)})}x&&(void 0!==E&&(E<0||E>100)&&n?.("LINE_CHART_PROJECTION_ERROR",{error:st(E,!0)}),void 0!==_&&(_<0||_>a)&&n?.("LINE_CHART_PROJECTION_ERROR",{error:ct(_,a,!0)})),g&&(void 0!==T&&(T<0||T>100)&&n?.("LINE_CHART_PROJECTION_ERROR",{error:st(T,!1)}),void 0!==A&&(A<0||A>a)&&n?.("LINE_CHART_PROJECTION_ERROR",{error:ct(A,a,!1)}))},[g,T,A,a,x,E,_]);const{downPath:v,shapePath:y,upPath:m}=(({curved:e,lowerProjection:t,points:r,svgHeight:a,upperProjection:n})=>{const i=n||t;if(0===r.length&&!i)return{shapePath:""};const[o,...s]=r,c=`M ${o[0]} ${o[1]}`;let d=c,u=n?c:void 0,l=t?c:void 0;const h=[],f=[];s.forEach(([e,r])=>{const i=n?[dt(e,n.x),ut(r,a,n.y)]:[e,r],o=t?[dt(e,-(t.x??0)),ut(r,a,-(t.y??0))]:[e,r];h.push(i),f.push(o)});const p=n&&t?[...h,s.at(-1),...f.reverse(),o]:[...h,...f.reverse(),o];return e?(d+=p.reduce((e,t,r)=>{const a=0===r?o:p[r-1],[n,i]=a,[s,c]=t,d=.3*(s-n),u=[n+d,i],l=[s-d,c];return`${e} C ${u[0]} ${u[1]}, ${l[0]} ${l[1]}, ${s} ${c}`},""),u&&(u+=h.reduce((e,t,r)=>{const a=0===r?o:h[r-1],[n,i]=a,[s,c]=t,d=.3*(s-n),u=[n+d,i],l=[s-d,c];return`${e} C ${u[0]} ${u[1]}, ${l[0]} ${l[1]}, ${s} ${c}`},"")),l&&(l+=f.reverse().reduce((e,t,r)=>{const a=0===r?o:f[r-1],[n,i]=a,[s,c]=t,d=.3*(s-n),u=[n+d,i],l=[s-d,c];return`${e} C ${u[0]} ${u[1]}, ${l[0]} ${l[1]}, ${s} ${c}`},""))):(d+=p.reduce((e,t)=>`${e} L ${t?.[0]} ${t?.[1]}`,""),u&&(u+=h.reduce((e,t)=>`${e} L ${t[0]} ${t[1]}`,"")),l&&(l+=f.reverse().reduce((e,t)=>`${e} L ${t[0]} ${t[1]}`,""))),{downPath:l,shapePath:d,upPath:u}})({curved:e,lowerProjection:g,points:r,svgHeight:a,upperProjection:x});return u.jsxs("g",{className:"pointer-events-none",children:[u.jsx("path",{d:y,fill:o,stroke:"transparent",strokeWidth:"0.1"}),";",m&&u.jsx("path",{d:m,...h}),v&&u.jsx("path",{d:v,...R})]})},ht=(e,t)=>e.map(e=>e[t]),ft={formatTicksValues:(e,t)=>e.map(e=>({...e,value:t(e.value)}))},pt=({ariaLabel:e,position:t=m.BOTTOM,tickLine:r,tickText:a,valueFormatter:n=e=>e,...i})=>{const{xAxisCoordinates:{coordinates:o,tickValues:s},xCursor:c,...d}=l.useContext(nt),h=Ue(t,o.y1,Number(a?.fontSize),a?.top??0),f=d.extraSpaceTopY,p=Number(d.canvasHeight)-d.extraSpaceBottomY,R=a?ft.formatTicksValues(s,n):void 0,x=Re(i),g=e||i["aria-label"],_={...i,...x,...g&&{"aria-label":g}};return u.jsx(Ye,{...o,..._,canvasHeight:Number(d.canvasHeight),canvasWidth:Number(d.canvasWidth),cursor:c,dataTestId:`${d.dataTestId}xAxis`,extraSpace:{left:d.extraSpaceLeftX,right:d.extraSpaceRightX},tickLine:{...r,y1:f,y2:p},tickText:{...a,y:h},tickValues:R})},Rt=({ariaLabel:e,position:t=m.LEFT,tickLine:r,tickText:a,valueFormatter:n=e=>e,...i})=>{const{yAxisCoordinates:{coordinates:o,tickValues:s},yCursor:c,...d}=l.useContext(nt),h=a?.textAnchor||"middle",f=(t===m.RIGHT?a?.right:a?.left)??0,p=Ze(h,d.yAxisText,f),R=Ke(t,o.x1,p),x=a?ft.formatTicksValues(s,n):void 0,g=Re(i),_=e||i["aria-label"],A={...i,...g,..._&&{"aria-label":_}};return u.jsx(ze,{...o,...A,canvasHeight:Number(d.canvasHeight),canvasWidth:Number(d.canvasWidth),cursor:c,dataTestId:`${d.dataTestId}yAxis`,tickLine:{...r,x1:d.extraSpaceLeftX,x2:Number(d.canvasWidth)-d.extraSpaceRightX},tickText:{...a,x:R},tickValues:x})},xt={[g]:g,[_]:_},gt="WIDTH",_t=/^(\d+(\.\d+)?)(px|rem|%)?$/,At=e=>{if("number"==typeof e)return{unit:void 0,value:e};const t=e.match(_t);if(!t)throw new Error(`Invalid string format: "${e}"`);const r=parseFloat(t[1]),a=t[3];return{unit:xt[a],value:r}},Et=(e,t,r)=>{const a=r.parentElement;return a?e/100*(t===gt?a.clientWidth:a.clientHeight):0},Tt=e=>{const t=je();if(!t)return 16*e;const r=(e=>{const t=Pe()?window:void 0;if(t)return t.getComputedStyle(e)})(t.documentElement);return r?e*(parseFloat(r.fontSize)||16):16*e},vt=({canvasHeight:e,canvasWidth:t,svgElement:r})=>{const{unit:a,value:n}=At(t),i=a===g?Et(n,gt,r):a===_?Tt(n):n,{unit:o,value:s}=At(e);return{parsedCanvasHeight:o===g?Et(s,"HEIGHT",r):o===_?Tt(s):s,parsedCanvasWidth:i}},yt=e=>{if(e.custom)return e.custom?.values;if(e.numeric){const{max:t,min:r=0,step:a}=e.numeric;if(a>=Math.abs(t-r)||a<=0)return[r.toString(),t.toString()];const n=[];for(let e=r;e<=t;e+=a)n.push(e.toString());return n}},mt=(e,t)=>e.flatMap(e=>Object.keys(e).filter(r=>r!==t&&"number"==typeof e[r]).map(t=>e[t])),Ct=(e,t,r,a,n,i,o)=>{const{position:s,tickText:c,tickValues:d,valueFormatter:u}=e.props,l=c?.fontSize??0,h=l*a,f=d?yt(d):t.map(e=>e[r]),p=u?f.map(u):f,R=Be({bound:"width",data:p,fontSize:l,svgHeight:`${i}`,svgWidth:`${o}`,viewBox:n}),x=s===m.TOP;return{extraSpaceBottomY:s===m.BOTTOM?h+(c?.top??0):0,extraSpaceTopY:x?h+(c?.bottom??0):0,lineChartXPosition:s||m.BOTTOM,securityXSpace:R,xBreakAxis:d?.numeric?d.numeric.breakAxis??0:c?.custom?.breakAxis??0,xData:f}},St=(e,t,r,a,n,i,o)=>{const{position:s,tickText:c,tickValues:d,valueFormatter:u}=e.props,l=c?.fontSize??"0",h=l*a,f=d||we([...new Set(mt(t,r))]),p=yt(f),R=u?p.map(u):p,x=Be({bound:"width",data:R,fontSize:l,svgHeight:`${i}`,svgWidth:`${o}`,viewBox:n}),g=h,_=s===m.RIGHT;return{extraSpaceLeftX:s===m.LEFT?x+(c?.right??0):0,extraSpaceRightX:_?x+(c?.left??0):0,lineChartYPosition:s||m.LEFT,securityYSpace:g,yAxisText:x,yBreakAxis:d?.numeric?d.numeric.breakAxis??0:c?.custom?.breakAxis??0,yData:p}},It=({addError:e,ajustedX:t,ajustedY:r,canvasHeight:a,canvasWidth:n,children:i,data:o,viewBox:s,xKey:c})=>{let d;if(!o||0===o.length){const t={error:ee(X)};e?.("LINE_CHART_CONTEXT_ERROR",t),d=t}if(o&&1===o.length){const t={error:ee(K)};e?.("LINE_CHART_CONTEXT_ERROR",t),d=t}if(n<=0||a<=0){const t={error:re(n,a)};e?.("LINE_CHART_CONTEXT_ERROR",t),d=t}const u=o&&o.length>0?o:[{[c]:"0",y:0},{[c]:"1",y:1}],h=n>0?n:100,f=a>0?a:100,{extraSpaceBottomY:p,extraSpaceLeftX:R,extraSpaceRightX:x,extraSpaceTopY:g,lineChartXPosition:_,lineChartYPosition:A,securityXSpace:E,securityYSpace:T,xAxisText:v,xBreakAxis:C,xData:S,yAxisText:I,yBreakAxis:N,yData:$}=(({ajustedX:e,ajustedY:t,canvasHeight:r,canvasWidth:a,children:n,data:i,viewBox:o,xKey:s})=>{let c={extraSpaceBottomY:0,extraSpaceLeftX:0,extraSpaceRightX:0,extraSpaceTopY:0,lineChartXPosition:m.BOTTOM,lineChartYPosition:m.LEFT,securityXSpace:0,securityYSpace:0,xAxisText:0,xBreakAxis:0,xData:[],yAxisText:0,yBreakAxis:0,yData:[]};return l.Children.forEach(n,n=>{l.isValidElement(n)&&(n.type===pt?c={...c,...Ct(n,i,s,e,o,r,a)}:n.type===Rt&&(c={...c,...St(n,i,s,t,o,r,a)}))}),c})({ajustedX:t,ajustedY:r,canvasHeight:f,canvasWidth:h,children:i,data:u,viewBox:s,xKey:c}),b=_!==m.TOP&&_!==m.BOTTOM,L=ue({initPos:R,maxSpaceAvailable:h,otherAxisSpace:R+x,securitySpace:E,tickValues:S});if((L??[]).some(({position:e})=>isNaN(e))){const t={error:ee(B)};e?.("LINE_CHART_CONTEXT_ERROR",t),d=t}if(L){const t=L.length<2,r=L.length>=2&&1===new Set(L.map(e=>e.value)).size;if(t){const t={error:ee(G)};e?.("LINE_CHART_X_AXIS_ERROR",t),d||(d=t)}if(r){const t={error:ee(U)};e?.("LINE_CHART_X_AXIS_ERROR",t),d||(d=t)}}const k=A!==m.LEFT&&A!==m.RIGHT,O=le({initPos:f-p,maxSpaceAvailable:f,otherAxisSpace:g+p,securitySpace:T,tickValues:$});if(O){const t=O.length<2,r=O.length>=2&&1===new Set(O.map(e=>e.value)).size;if(t){const t={error:ee(q)};e?.("LINE_CHART_Y_AXIS_ERROR",t),d||(d=t)}if(r){const t={error:ee(Z)};e?.("LINE_CHART_Y_AXIS_ERROR",t),d||(d=t)}}const H=b?de(O||[],[String(C)])[0]:0,w=k?de(L||[],[String(N)])[0]:0,P=se({canvasHeight:f,canvasWidth:h,customBreakAxis:Number(H),extraSpaceBottomY:p,extraSpaceLeftX:R,extraSpaceRightX:x,extraSpaceTopY:g,position:_}),j=ce({canvasHeight:f,canvasWidth:h,customBreakAxis:Number(w),extraSpaceBottomY:p,extraSpaceLeftX:R,extraSpaceRightX:x,extraSpaceTopY:g,position:A});if(P.x1===P.x2){const t={error:ee(z)};e?.("LINE_CHART_X_AXIS_ERROR",t),d||(d=t)}if(j.y1===j.y2){const t={error:ee(J)};e?.("LINE_CHART_Y_AXIS_ERROR",t),d||(d=t)}const D={addError:e,crossXAxis:b,crossYAxis:k,extraSpaceBottomY:p,extraSpaceLeftX:R,extraSpaceRightX:x,extraSpaceTopY:g,securityXSpace:E,securityYSpace:T,xAxisCoordinates:{coordinates:P,tickValues:L||(d?[{position:0,value:"0"},{position:h,value:"1"}]:[])},xAxisText:v,yAxisCoordinates:{coordinates:j,tickValues:O||(d?[{position:f,value:he},{position:0,value:fe}]:[])},yAxisText:I};return d?{...D,error:{...d,type:y.LINE_CHART_CONTEXT_ERROR}}:D},Nt=Object.assign(({ariaHidden:e,ariaLabel:t,canvasConfig:r=p,caption:a,children:n,classNames:i,data:o,dataTestId:s="line-chart",getPathArea:c,height:d="100%",onErrors:g,role:_,tabIndex:A,width:T="100%",xKey:v,...y})=>{const{extraSpace:m,height:C,width:S}=r,[I,N]=l.useState(""),[$,b]=l.useState({height:0,width:0}),L=m?E(m):void 0,k=f($.width,$.height,L),O=[u.jsx(pt,{},"default-x-axis"),u.jsx(Rt,{},"default-y-axis")],H=l.Children.toArray(n)||[],w=O.concat(H),P=Math.max($.width,$.height,L??0),j=isNaN($.width/P)?0:$.width/P,D=isNaN($.height/P)?0:$.height/P;(({attrName:e,children:t,originalValue:r,updateValue:a})=>{let n="";l.Children.toArray(t).forEach(t=>{if(l.isValidElement(t)){const r=t.props[e];r&&(n+=r)}}),n!==r&&a(n)})({attrName:"dataKey",children:w,originalValue:I,updateValue:N});const B=l.useMemo(()=>R(g),[g]),M=x(o),X=l.useMemo(()=>(B.clearErrors(),It({addError:(e,t)=>{B.addError(e,t)},ajustedX:j,ajustedY:D,canvasHeight:$.height,canvasWidth:$.width,children:w,data:o,viewBox:k,xKey:v})),[$.width,$.height,M,v,I,B.addError]),{svgRef:F,xCursor:V,yCursor:W}=(({canvasHeight:e,canvasWidth:t})=>{const[[r,a],n]=l.useState([ge,ge]),i=l.useCallback((r,a)=>{const{height:i,left:o,top:s,width:c}=a.getBoundingClientRect(),d=r.clientX-o,u=r.clientY-s;n([d*t/c,u*e/i])},[t,e]),o=e=>{e.preventDefault()};return{svgRef:l.useCallback(e=>{e&&(e.addEventListener("touchstart",o),e.addEventListener("touchmove",t=>i(t.touches[0],e)),e.addEventListener("mousemove",t=>i(t,e))),e?.removeEventListener("touchstart",o),e?.removeEventListener("touchmove",t=>i(t.touches[0],e)),e?.removeEventListener("mousemove",t=>i(t,e))},[e,t]),xCursor:r,yCursor:a}})({canvasHeight:$.height,canvasWidth:$.width});return l.useEffect(()=>{const e=document.querySelector("[data-kbt-svg]");if(!e)return;const{parsedCanvasHeight:t,parsedCanvasWidth:r}=vt({canvasHeight:C,canvasWidth:S,svgElement:e});b({height:t,width:r})},[S,C]),l.useEffect(()=>{c?.({x1:X.extraSpaceLeftX,x2:$.width-X.extraSpaceRightX,y1:X.extraSpaceTopY,y2:$.height-X.extraSpaceBottomY})},[$.width,$.height]),u.jsx(h,{ref:F,ariaHidden:e,ariaLabel:t,caption:a,className:i,"data-kbt-svg":!0,dataTestId:s,height:d,role:_,tabIndex:A,viewBox:k,width:T,...y,children:u.jsx(nt.Provider,{value:{...X,canvasExtraSpace:L,canvasHeight:$.height,canvasWidth:$.width,data:o,dataTestId:s,xCursor:V,xKey:v,yCursor:W},children:n})})},{Path:({ariaLabel:e,closestClick:t,curved:r,getNodeFocusInfo:a,getNodesCoords:n,indicatorConfig:i,lineProjection:o,onClick:s,...c})=>{const{addError:d,xAxisCoordinates:h,yAxisCoordinates:f,...p}=l.useContext(nt),R=c.dataKey,x=p.data.length>0,g=p.data[0],_=!!g&&Object.prototype.hasOwnProperty.call(g,R),A=p.data.length;l.useEffect(()=>{if(!R||"string"!=typeof R)return void d?.("LINE_CHART_PATH_ERROR",{error:ee(W)});if(x&&!_)return void d?.("LINE_CHART_PATH_ERROR",{error:te(R)});if(r&&A<2)return void d?.("LINE_CHART_PATH_ERROR",{error:ee(V)});const e=ht(p.data,R);e.length>0&&e.every(e=>null==e)&&d?.("LINE_CHART_PATH_ERROR",{error:ee(F)})},[d,r,R,A,x,_,p.data]);const{indicatorRef:E,pathRef:T}=((e,t)=>{const r=l.useRef(null),a=l.useRef(null);return l.useEffect(()=>{if(!t||!r.current||!a.current)return;const n=r.current,i=a.current;let o,s,c=0,d=n.getTotalLength();for(;d-c>.01;)o=(c+d)/2,s=n.getPointAtLength(o),s.x<e?c=o:d=o;const u=n.getPointAtLength(d);i.setAttribute("transform",`translate(${u.x}, ${u.y})`),i.setAttribute("pointer-events","none")},[e]),{indicatorRef:a,pathRef:r}})(p.xCursor,!!i),v=!!i&&p.xCursor!==-1/0,y=l.useRef(null),m=l.useRef(null),{autoClick:C,lineIndicator:S,...I}=i||{},{y1:N,y2:$}=f.coordinates,{x1:b,x2:L}=h.coordinates,k=p.xCursor>=b&&p.xCursor<=L,{tickValues:O}=h,{tickValues:H}=f,w=ht(p.data,p.xKey),P=ht(p.data,R),j=de(O,w,!0),D=de(H,P),B=j.map((e,t)=>[e,D[t]]),M=it({curved:r,extendToBottom:!1,points:B,svgHeight:Number(p.canvasHeight)-p.extraSpaceBottomY}),X=it({curved:r,extendToBottom:!!c.fill||!!c.gradient,points:B,svgHeight:Number(p.canvasHeight)-p.extraSpaceBottomY});l.useEffect(()=>{if(!y.current?.path)return;T.current=y.current.path;const e=y.current.main,t=y.current.node,r=w.map((e,t)=>({x:e,y:P[t]})),{mount:n,unmount:i}=(({data:e,getNodeFocusInfo:t,nodes:r,ref:a})=>{let n,i=!1;const o=a.querySelector("[data-draw]"),s=a=>{i&&("ArrowRight"===a.key?(n=void 0===n||n===r.length-1?0:n+1,r[n].focus(),t?.(e[n])):"ArrowLeft"===a.key&&(n=void 0===n||0===n?r.length-1:n-1,r[n].focus(),t?.(e[n])))},c=()=>{i=!0},d=()=>{i=!1},u=()=>{n=void 0};return{mount:()=>{a.addEventListener("focusin",c),a.addEventListener("focusout",d),o?.addEventListener("focus",u),window.addEventListener("keydown",e=>s(e))},unmount:()=>{a.removeEventListener("focusin",c),a.removeEventListener("focusout",d),o?.removeEventListener("focus",u),window.removeEventListener("keydown",e=>s(e))}}})({data:r,getNodeFocusInfo:a,nodes:t,ref:e});return n(),()=>i()},[]),l.useEffect(()=>{if(c.nodeConfig&&v&&C){const{idx:e,match:t}=((e,t)=>{let r=0,a=!1;for(let n=0;n<e.length;n++)if(Math.round(e[n])===Math.round(t)){a=!0,r=n;break}return{idx:r,match:a}})(j,p.xCursor);if(t&&e!==m.current){m.current=e;const t=new MouseEvent("click",{bubbles:!0});t.autoClick=!0,y.current?.node?.[e]?.dispatchEvent(t),navigator?.vibrate?.(200)}else m.current=null}},[p.xCursor]),l.useEffect(()=>{n?.(B)},[B]);const Y=Re(c),K={...c,...Y,...e&&{"aria-label":e}};return u.jsxs(u.Fragment,{children:[u.jsx(be,{ref:y,d:M,dFill:X,dataTestId:`${p.dataTestId}path`,dataValue:p.data,points:B,xKey:p.xKey,onClick:e=>{if(s?.(e),t){const e=((e,t)=>{let r=0,a=Math.abs(e[0]-t);for(let n=1;n<e.length;n++){const i=Math.abs(e[n]-t);i<a&&(r=n,a=i)}return r})(j,p.xCursor),t=new MouseEvent("click",{bubbles:!0});t.autoClick=!1,y.current?.node?.[e]?.dispatchEvent(t)}},...K}),o&&u.jsx(lt,{curved:r,dataKey:c.dataKey,lineProjection:o,points:B,svgHeight:Number(p.canvasHeight)-p.extraSpaceBottomY}),v&&u.jsxs(u.Fragment,{children:[!!S&&k&&u.jsx(Me,{...S,className:"pointer-events-none",x1:p.xCursor,x2:p.xCursor,y1:N,y2:$}),u.jsx("g",{ref:E,className:"pointer-events-none",children:u.jsx(Ne,{...I})})]})]})},Separator:({areaSeparator:e,dataTestId:t,rightSeparator:r,topSeparator:a,xBreakAxis:n,yBreakAxis:i})=>{const{addError:o,crossXAxis:s,crossYAxis:c,xAxisCoordinates:d,yAxisCoordinates:h}=l.useContext(nt),f=d.tickValues,p=h.tickValues,R=void 0!==n?"string"==typeof n?parseFloat(n):n:void 0,x=void 0!==i?"string"==typeof i?parseFloat(i):i:void 0;if(l.useEffect(()=>{if(void 0!==n){const e=f.map(e=>e.value);if(void 0===R||isNaN(R))o?.("LINE_CHART_SEPARATOR_ERROR",{error:ae(n)});else{const t=Math.min(...e.map(e=>"string"==typeof e?parseFloat(e):e)),r=Math.max(...e.map(e=>"string"==typeof e?parseFloat(e):e));(R<t||R>r)&&o?.("LINE_CHART_SEPARATOR_ERROR",{error:ie(R,t,r)})}}if(void 0!==i){const e=p.map(e=>e.value);if(void 0===x||isNaN(x))o?.("LINE_CHART_SEPARATOR_ERROR",{error:ne(i)});else{const t=Math.min(...e.map(e=>"string"==typeof e?parseFloat(e):e)),r=Math.max(...e.map(e=>"string"==typeof e?parseFloat(e):e));(x<t||x>r)&&o?.("LINE_CHART_SEPARATOR_ERROR",{error:oe(x,t,r)})}}},[n,R,f,i,x,p]),!a&&!r&&!e)return u.jsx(u.Fragment,{});const g=n&&de(d.tickValues,[n],!0)[0],_=i&&de(h.tickValues,[i])[0],A=c?h.coordinates.x1:d.coordinates.x2,E=s?d.coordinates.y1:h.coordinates.y1,T=d.coordinates.x1,v=g??A,y=h.coordinates.y2,m=_??E;l.useEffect(()=>{T===v&&y===m&&o?.("LINE_CHART_SEPARATOR_ERROR",{error:ee(Y)})},[T,v,y,m]);const C=`M${T} ${y} H ${v} V ${m} H ${T} Z`,S=`M${T} ${m} H ${v}`,I=`M${v} ${y} V ${m}`;return u.jsxs("g",{children:[u.jsx("path",{d:C,"data-testid":`${t}Area`,...e}),u.jsx("path",{d:S,"data-testid":`${t}Top`,...a}),u.jsx("path",{d:I,"data-testid":`${t}Right`,...r})]})},XAxis:pt,YAxis:Rt}),$t=({children:e,dataTestId:t,height:r,width:a,x:n,y:i})=>u.jsx("foreignObject",{"data-testid":t,height:r,width:a,x:n,y:i,children:e}),bt=l.createContext({}),Lt=(e,t,r)=>({x:e.x+t*Math.cos(r),y:e.y+t*Math.sin(r)}),kt=({center:e,innerEnd:t,innerRadius:r,singleStroke:a})=>{if(!a)return r>0?`L ${t.x},${t.y}`:`L ${e.x},${e.y}`},Ot="CLOCKWISE",Ht=({canvasHeight:e,canvasWidth:t,color:r="blue",dataKey:a,gap:n,halfChart:i,index:o,innerRadius:s,name:c,radius:d,singleStroke:h,startAngle:f,total:p,value:R,...x})=>{const{addError:g}=l.useContext(bt),_=Number(R),A=void 0!==d?Number(d):void 0,E=void 0!==s?Number(s):void 0,T=c?.trim()||"";l.useEffect(()=>{T||g?.("PIE_CHART_SEGMENT_ERROR",{error:w(a||"unknown",o||0,"name")}),isNaN(_)?g?.("PIE_CHART_SEGMENT_ERROR",{error:b(R,T||`segment-${o}`)}):(_<0&&g?.("PIE_CHART_SEGMENT_ERROR",{error:L(_,T||`segment-${o}`)}),void 0!==A&&(isNaN(A)||A<=0)&&g?.("PIE_CHART_SEGMENT_ERROR",{error:P(d)}),void 0!==E&&((isNaN(E)||E<0)&&g?.("PIE_CHART_SEGMENT_ERROR",{error:j(s)}),void 0!==A&&(isNaN(A)||isNaN(E)||E>=A&&g?.("PIE_CHART_SEGMENT_ERROR",{error:D(E,A)}))))},[a,o,E,A,_,T]);const v=(({canvasHeight:e,canvasWidth:t,customRadius:r,gap:a,halfChart:n,innerRadius:i,rotateDirection:o,singleStroke:s,startAngle:c,total:d,value:u})=>{const l=n?2*e:e,h=Math.min(t,l)/2,f=r&&r<h?r:h,p=n?Math.PI:2*Math.PI,R={x:t/2,y:n?e:e/2},x=s?2*d:d,g=100*u/x*p/100,_=a/f,{carryAngle:A,finalAngle:E,initialAngle:T}=(({angleEquivalent:e,direction:t,gapAngle:r,startAngle:a})=>{const n=t===Ot;return{carryAngle:n?a+e:a-e,finalAngle:n?a+e-r/2:a-e+r/2,initialAngle:n?a+r/2:a-r/2}})({angleEquivalent:g,direction:o,gapAngle:_,startAngle:c.current});c.current=A;const v=p*u/x-_<=Math.PI?"0":"1",y=Lt(R,i,T),m=Lt(R,i,E),C=Lt(R,f,T);return(({center:e,innerEnd:t,innerRadius:r,innerStart:a,largeArcFlag:n,outerEnd:i,outerStart:o,radius:s,rotateDirection:c,singleStroke:d})=>{let u,l,h,f,p,R,x,g,_,A;return c===Ot?(u=`M ${o.x},${o.y}`,l=`A ${s},${s} 0 ${n} 1 ${i.x}, ${i.y}`,h=kt({center:e,innerEnd:t,innerRadius:r,singleStroke:d}),f=d?`M ${t.x},${t.y}`:void 0,p=r>0?`A ${r},${r} 0 ${n} 0 ${a.x},${a.y}`:void 0,R=`M ${o.x},${o.y}`,g=`M ${t.x},${t.y}`,x=`A ${s},${s} 0 ${n} 0 ${i.x},${i.y}`,_=`A ${r},${r} 0 ${n} 1 ${a.x},${a.y}`,A=d?void 0:"Z"):(u=`M ${o.x} ${o.y}`,l=`A ${s},${s} 0 ${n},0 ${i.x}, ${i.y}`,h=kt({center:e,innerEnd:t,innerRadius:r,singleStroke:d}),f=d?`M ${t.x},${t.y}`:void 0,p=r>0?`A ${r}, ${r} 0 ${n},1 ${a.x},${a.y}`:void 0,R=`M ${o.x},${o.y}`,g=`M ${t.x},${t.y}`,x=`A ${s},${s} 0 ${n} 1 ${i.x},${i.y}`,_=`A ${r},${r} 0 ${n} 0 ${a.x},${a.y}`,A=d?void 0:"Z"),[u,l,h,f,p,A].concat(d?[R,x,g,_]:[]).filter(Boolean).join(" ")})({center:R,innerEnd:m,innerRadius:i,innerStart:y,largeArcFlag:v,outerEnd:Lt(R,f,E),outerStart:C,radius:f,rotateDirection:o,singleStroke:s})})({canvasHeight:e,canvasWidth:t,customRadius:d,gap:n,halfChart:i,innerRadius:s,singleStroke:h,startAngle:f,total:p,value:R});return u.jsx(be,{...x,d:v,dataValue:R,fill:r})},wt=({dataKey:e,fill:t,gap:r,innerRadius:a,radius:n,...i})=>{const o=String(e),{addError:s,canvasHeight:c,canvasWidth:d,data:h,dataTestId:f,halfChart:p}=l.useContext(bt),R=p?0:-Math.PI/2,x=l.useRef(R),g=h[o],_=Object.prototype.hasOwnProperty.call(h,o);l.useEffect(()=>{if(!_)return void s?.("PIE_CHART_PATH_ERROR",{error:k(o)});if(!g||0===g.length)return void s?.("PIE_CHART_PATH_ERROR",{error:O(o)});const e=g.reduce((e,t)=>e+t.value,0);(e<=0||isNaN(e))&&s?.("PIE_CHART_PATH_ERROR",{error:H(o,e)})},[g,_,o]);const A=h[o]?.reduce((e,t)=>e+t.value,0),T=1===h[o]?.length,v=a?E(a):void 0,y=n?E(n):void 0;return h[o]?.length?u.jsx("g",{children:h[o].map((e,a)=>l.createElement(Ht,{...i,...e,key:`${a.toString()}`,canvasHeight:c,canvasWidth:d,color:e.color||t,dataKey:o,dataTestId:`${f}path-${a}`,gap:r,halfChart:p,index:a,innerRadius:v,radius:y,singleStroke:T,startAngle:x,total:A}))}):u.jsx(u.Fragment,{})},Pt=Object.assign(({ariaHidden:e,ariaLabel:t,canvasConfig:r=p,caption:a,children:n,classNames:i,data:o,dataTestId:s="pie-chart",halfChart:c,height:d="100%",onErrors:g,radius:_="50%",role:A,tabIndex:T,width:v="100%",...y})=>{const{extraSpace:m,height:C,width:S}=r,I=E(S),N=E(C),$=m?E(m):void 0,b=f(I,N,$),L=l.useMemo(()=>R(g),[g]),k=x(o),O=l.useMemo(()=>(L.clearErrors(),(({addError:e,canvasHeight:t,canvasWidth:r,children:a,halfChart:n})=>{(r<=0||t<=0)&&e?.("PIE_CHART_CONTEXT_ERROR",{error:re(r,t)});const i=r>0?r:100,o=t>0?t:100;let s,c;l.Children.forEach(a,e=>{if(l.isValidElement(e)&&e.type===wt){const{innerRadius:t}=e.props;if(!t)return;const r=E(t);(!s||r<s)&&(s=r)}}),s&&(c=2*s);const d=c??0,u=n?d/2:d,h=n?o:o/2;return{addError:e,foreignObject:{height:u,width:d,x:i/2-d/2,y:n?h-u:h-u/2}}})({addError:(e,t)=>{L.addError(e,t)},canvasHeight:N,canvasWidth:I,children:n,halfChart:c})),[C,S,c,k,L]);return u.jsx(h,{ariaHidden:e,ariaLabel:t,caption:a,className:i,dataTestId:s,height:d,radius:_,role:A,tabIndex:T,viewBox:b,width:v,...y,children:u.jsx(bt.Provider,{value:{...O,canvasHeight:N,canvasWidth:I,data:o,dataTestId:s,halfChart:c},children:n})})},{Foreign:({children:e,dataTestId:t,height:r,width:a,x:n,y:i,...o})=>{const{dataTestId:s,foreignObject:c}=l.useContext(bt),d=!a&&c?.width?c.width:a,h=!r&&c?.height?c.height:r,f=!n&&c?.x?c.x:n,p=!i&&c?.y?c.y:i,R=!t&&s?`${s}-foreign-object`:t;return u.jsx($t,{...o,dataTestId:R,height:h,width:d,x:f,y:p,children:e})},Path:wt}),jt={FOCUS_COLOR:"#0078D4",FOCUS_INNER:"#ffffff",INNER_FOCUS_STROKE_WIDTH:2,OUTER_FOCUS_STROKE_WIDTH:2,OUTLINES_GAP:0,VARIANT:"adaptive"},Dt=e=>({gap:e?.gap??jt.OUTLINES_GAP,innerColor:e?.innerColor??jt.FOCUS_INNER,innerStrokeWidth:e?.innerStrokeWidth??jt.INNER_FOCUS_STROKE_WIDTH,outlineColor:e?.outlineColor??jt.FOCUS_COLOR,outlineStrokeWidth:e?.outlineStrokeWidth??jt.OUTER_FOCUS_STROKE_WIDTH,variant:e?.variant??jt.VARIANT}),Bt=["cx","cy","r","x","y","width","height","rx","ry","d","points","x1","y1","x2","y2"],Mt=["stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity"],Xt=["circle","rect","ellipse","path","polygon","polyline","line"];function Ft({elementRef:e,focusConfig:t,isFocused:r}){const a=l.useMemo(()=>Dt(t),[t]),[n,i]=l.useState(void 0);return l.useEffect(()=>{if(!e?.current||!r)return void i(void 0);const t=e.current,n=()=>{if("adaptive"===a.variant){const e=function(e,t){const r=e.tagName.toLowerCase();if(!Xt.includes(r))return;const a=e.getAttribute("stroke-width")||e.getAttribute("strokeWidth"),n=parseFloat(a||"0"),i=e.getAttribute("fill"),o="line"===r||"polyline"===r||"path"===r&&"none"===i,s=n+2*(t.outlineStrokeWidth+t.innerStrokeWidth),c=n+2*t.innerStrokeWidth,d=o?e.getAttribute("stroke-linecap")||"round":void 0,u=o?e.getAttribute("stroke-linejoin")||"round":"miter",l=o?void 0:"10",h=function(e){const t={},r=new Set([...Bt,...Mt]);for(let a=0;a<e.attributes.length;a++){const n=e.attributes[a];r.has(n.name)&&(t[n.name]=n.value)}return t}(e);return{innerRing:{props:{...h,className:"focus-ring-inner",fill:"none",stroke:t.innerColor,strokeLinecap:d,strokeLinejoin:u,strokeMiterlimit:l,strokeWidth:c},type:r},outerRing:{props:{...h,className:"focus-ring-outer",fill:"none",stroke:t.outlineColor,strokeLinecap:d,strokeLinejoin:u,strokeMiterlimit:l,strokeWidth:s},type:r}}}(t,a);i(e)}if("bounding-box"===a.variant){const e=function(e,t){const r=function(e){try{const t=e.getBBox();if(t.width<=0||t.height<=0)return null;const r=window.getComputedStyle(e),a=parseFloat(r.strokeWidth||"0");return{elementHeight:t.height,elementPosition:{x:t.x+t.width/2,y:t.y+t.height/2},elementStrokeWidth:a,elementWidth:t.width}}catch{return null}}(e);if(!r)return;const a=((e,t)=>{const{elementHeight:r,elementPosition:a,elementStrokeWidth:n,elementWidth:i}=e,{gap:o,innerStrokeWidth:s,outlineStrokeWidth:c}=t,d=i+n+s+2*o,u=r+n+s+2*o,l=d+s+c,h=u+s+c;return{inner:{height:u,width:d,x:a.x-d/2,y:a.y-u/2},outer:{height:h,width:l,x:a.x-l/2,y:a.y-h/2}}})(r,{gap:t.gap,innerStrokeWidth:t.innerStrokeWidth,outlineStrokeWidth:t.outlineStrokeWidth});return{innerRing:{props:{className:"focus-ring-inner",fill:"none",height:a.inner.height,stroke:t.innerColor,strokeWidth:t.innerStrokeWidth,width:a.inner.width,x:a.inner.x,y:a.inner.y},type:"rect"},outerRing:{props:{className:"focus-ring-outer",fill:"none",height:a.outer.height,stroke:t.outlineColor,strokeWidth:t.outlineStrokeWidth,width:a.outer.width,x:a.outer.x,y:a.outer.y},type:"rect"}}}(t,a);i(e)}};n();const o=new MutationObserver(e=>{e.some(e=>"attributes"===e.type&&Bt.includes(e.attributeName??""))&&n()});return o.observe(t,{attributeFilter:[...Bt],attributes:!0}),()=>o.disconnect()},[r,a]),{layers:n,resolvedConfig:a}}const Vt=({dataTestId:e,layers:t})=>t?u.jsxs("g",{className:"focus-ring-container",pointerEvents:"none",children:[l.createElement(t.outerRing.type,{...t.outerRing.props,"data-testid":`${e}-focus-outer`}),l.createElement(t.innerRing.type,{...t.innerRing.props,"data-testid":`${e}-focus-inner`})]}):null,Wt=({children:e,dataTestId:t="focus-ring",disabled:r=!1,focusConfig:a,isFocused:n})=>{const i=l.useRef(null),{layers:o}=Ft({elementRef:i,focusConfig:a,isFocused:n}),s=function(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):e&&(e.current=t)})}}(i,e.ref),c=l.cloneElement(e,{ref:s});return u.jsxs(u.Fragment,{children:[n&&!r&&u.jsx(Vt,{dataTestId:t,layers:o??void 0}),c]})},Yt=({dataTestId:e="focus-ring",disabled:t=!1,focusConfig:r,isFocused:a,targetRef:n})=>{const{layers:i}=Ft({elementRef:n,focusConfig:r,isFocused:a});return!a||t?null:u.jsx(Vt,{dataTestId:e,layers:i})},Kt=({children:e,dataTestId:t="focus-ring",disabled:r=!1,focusConfig:a,isFocused:n,targetRef:i})=>e?u.jsx(Wt,{dataTestId:t,disabled:r,focusConfig:a,isFocused:n,children:e}):i?u.jsx(Yt,{dataTestId:t,disabled:r,focusConfig:a,isFocused:n,targetRef:i}):null,Ut=({fill:e="#8f8f8f",x:t,y:r})=>u.jsxs("g",{fill:e,pointerEvents:"none",transform:`translate(${t-5}, ${r-5})`,children:[u.jsx("path",{d:"M4.99948 9.99802C4.47168 9.99802 4.04419 9.64335 4.04419 9.20547V0.79255C4.04419 0.354666 4.47168 0 4.99948 0C5.52728 0 5.95477 0.354666 5.95477 0.79255V9.20745C5.95477 9.64533 5.52728 10 4.99948 10V9.99802Z"}),u.jsx("path",{d:"M0.955289 8.78839C0.427492 8.78839 0 8.43372 0 7.99584V2.00416C0 1.56628 0.427492 1.21161 0.955289 1.21161C1.48309 1.21161 1.91058 1.56628 1.91058 2.00416V7.99584C1.91058 8.43372 1.48309 8.78839 0.955289 8.78839Z"}),u.jsx("path",{d:"M8.08936 7.99584C8.08936 8.43372 8.51685 8.78839 9.04464 8.78839C9.57244 8.78839 9.99993 8.43372 9.99993 7.99584V2.00416C9.99993 1.56628 9.57244 1.21161 9.04464 1.21161C8.51685 1.21161 8.08936 1.56628 8.08936 2.00416V7.99584Z"})]}),Gt=({linesData:e})=>u.jsx(u.Fragment,{children:e.map((e,t)=>u.jsxs("g",{children:[e.config.fill&&e.fillPath&&u.jsx("path",{d:e.fillPath,fill:e.config.fill,fillOpacity:e.config.fillOpacity||.2,stroke:"none"}),u.jsx("path",{d:e.linePath,fill:"none",stroke:e.config.stroke||"#0078D4",strokeWidth:e.config.strokeWidth||1})]},e.config.dataKey||e.config.yKey||t))}),zt=(e,t,r)=>{const a=e.start/Math.max(1,t-1)*r;return{endX:e.end/Math.max(1,t-1)*r,startX:a}},Zt=(e,t,r)=>{const a=Math.max(0,Math.min(t,e))/t;return Math.round(a*(r-1))},qt=(e,t,r=.1)=>{const a=Math.max(0,Math.min(e.start,t-1-r));return{end:Math.min(t-1,Math.max(e.end,a+r)),start:a}},Jt=e=>({end:Math.max(0,e-1),start:0}),Qt=(e,t)=>0===e.start&&e.end===t-1,er=l.forwardRef(({currentRange:e,dataLength:t,dataTestId:r,endX:a,height:n,onBlur:i,onFocus:o,onKeyDown:s,onMouseDown:c,onTouchStart:d,screenReaderText:l,selectionConfig:h,startX:f},p)=>{const R=h.hideOverlayOnFullRange&&Qt(e,t);return u.jsx(u.Fragment,{children:u.jsx("rect",{ref:p,"aria-label":l,"aria-valuemax":t-1,"aria-valuemin":0,"aria-valuetext":l,cursor:"grab","data-testid":r,fill:h.fill,fillOpacity:h.fillOpacity,height:n,role:"slider",stroke:h.stroke,strokeWidth:h.strokeWidth,style:{outline:"none",visibility:R?"hidden":"visible"},tabIndex:0,width:a-f,x:f,y:0,onBlur:i,onFocus:o,onKeyDown:s,onMouseDown:c,onTouchStart:d})})});er.displayName="SelectionArea";const tr="#8f8f8f",rr=({dataTestId:e,focusConfig:t,handlerConfig:r,height:a,isFocused:n,max:i,min:o,onBlur:s,onFocus:c,onKeyDown:d,onMouseDown:l,onTouchStart:h,screenReaderText:f,x:p})=>{const R=a/2,x=(e=>({fill:e?.fill||"#ffffff",iconColor:e?.iconColor||tr,radius:e?.radius||17,stroke:e?.stroke||tr,strokeWidth:e?.strokeWidth||1,verticalLineStroke:e?.verticalLineStroke||tr,verticalLineStrokeWidth:e?.verticalLineStrokeWidth||2}))(r);return u.jsxs("g",{"data-testid":`${e}-group`,children:[u.jsx("line",{pointerEvents:"none",stroke:x.verticalLineStroke,strokeWidth:x.verticalLineStrokeWidth,x1:p,x2:p,y1:0,y2:a}),u.jsx(Kt,{dataTestId:e,focusConfig:t,isFocused:n,children:u.jsx("circle",{"aria-label":f,"aria-valuemax":i,"aria-valuemin":o,"aria-valuetext":f,cursor:"ew-resize",cx:p,cy:R,"data-testid":e,fill:x.fill,r:x.radius,role:"slider",stroke:x.stroke,strokeWidth:x.strokeWidth,style:{outline:"none"},tabIndex:0,onBlur:s,onFocus:c,onKeyDown:d,onMouseDown:l,onTouchStart:h})}),u.jsx(Ut,{fill:x.iconColor,x:p,y:R})]})},ar={END_HANDLER:"END_HANDLER",SELECTION_AREA:"SELECTION_AREA",START_HANDLER:"START_HANDLER"},nr=e=>{const{currentRange:t,dataLength:r,interactionConfig:a,onRangeChange:n,width:i}=e,o=l.useRef(null),[s,c]=l.useState(null),d=l.useCallback(e=>()=>{c(e)},[]),u=l.useCallback(e=>()=>{c(e)},[]),h=l.useCallback(e=>{if(!s||!o.current)return;const c=o.current;if(!c)return;const d=e-c.getBoundingClientRect().left,u=Zt(d,i,r),l=((e,t,r,a,n)=>{const i={...t};if(e===ar.START_HANDLER)i.start=Math.max(0,Math.min(r,t.end-n.minHandlerDistance));else if(e===ar.END_HANDLER)i.end=Math.min(a-1,Math.max(r,t.start+n.minHandlerDistance));else if(e===ar.SELECTION_AREA){const e=t.end-t.start,n=Math.max(0,Math.min(a-1-e,r-e/2));i.start=n,i.end=n+e}return i})(s,t,u,r,a),h=qt(l,r,a.minHandlerDistance);n(h)},[s,i,r,t,n,a]),f=l.useCallback(e=>{h(e.clientX)},[h]),p=l.useCallback(e=>{0!==e.touches.length&&(e.preventDefault(),h(e.touches[0].clientX))},[h]),R=l.useCallback(()=>{c(null)},[]),x=l.useCallback(()=>{c(null)},[]);return l.useEffect(()=>{if(s)return document.addEventListener("mousemove",f),document.addEventListener("mouseup",R),document.addEventListener("touchmove",p,{passive:!1}),document.addEventListener("touchend",x),()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",R),document.removeEventListener("touchmove",p),document.removeEventListener("touchend",x)}},[s,f,R,p,x]),{groupRef:o,handleMouseDown:d,handleTouchStart:u,isDragging:s}},ir=e=>{const{currentRange:t,dataLength:r,interactionConfig:a,onRangeChange:n}=e;return{handleKeyDown:l.useCallback(e=>i=>{const o=i.shiftKey?a.keyboardFastStep:a.keyboardStep;let s={...t};switch(i.key){case"ArrowLeft":case"ArrowDown":i.preventDefault(),s=((e,t,r,a)=>{const n={...t};if(e===ar.START_HANDLER)n.start=Math.max(0,t.start-r);else if(e===ar.END_HANDLER)n.end=Math.max(t.start+a.minHandlerDistance,t.end-r);else if(e===ar.SELECTION_AREA){const e=t.end-t.start,a=Math.max(0,t.start-r);n.start=a,n.end=a+e}return n})(e,t,o,a);break;case"ArrowRight":case"ArrowUp":i.preventDefault(),s=((e,t,r,a,n)=>{const i={...t};if(e===ar.START_HANDLER)i.start=Math.min(t.end-n.minHandlerDistance,t.start+r);else if(e===ar.END_HANDLER)i.end=Math.min(a-1,t.end+r);else if(e===ar.SELECTION_AREA){const e=t.end-t.start,n=Math.min(a-1-e,t.start+r);i.start=n,i.end=n+e}return i})(e,t,o,r,a);break;case"Home":i.preventDefault(),s=((e,t,r)=>{const a={...t};if(e===ar.START_HANDLER)a.start=0;else if(e===ar.END_HANDLER)a.end=r-1;else if(e===ar.SELECTION_AREA){const e=t.end-t.start;a.start=0,a.end=e}return a})(e,t,r);break;case"End":i.preventDefault(),s=((e,t,r,a)=>{const n={...t};if(e===ar.START_HANDLER)n.start=t.end-a.minHandlerDistance;else if(e===ar.END_HANDLER)n.end=r-1;else if(e===ar.SELECTION_AREA){const e=t.end-t.start;n.start=r-1-e,n.end=r-1}return n})(e,t,r,a);break;default:return}const c=qt(s,r,a.minHandlerDistance);n(c)},[t,r,n,a])}},or=({canvasConfig:e,dataTestId:t,extraSpace:r=0,height:a,width:n})=>{const[i,o]=l.useState({height:0,width:0}),s=l.useMemo(()=>e||{extraSpace:r,height:a,width:n},[e,n,a,r]),{extraSpace:c,height:d,width:u}=s,h=c?E(c):void 0;l.useEffect(()=>{if(!Pe())return;const e=(e=>{const t=je();return t?t.querySelector(e):null})(`[data-testid="${t}"]`);if(!e)return;const r=()=>{const{parsedCanvasHeight:t,parsedCanvasWidth:r}=vt({canvasHeight:d,canvasWidth:u,svgElement:e});o({height:t,width:r})};r();const a=new ResizeObserver(()=>{r()});return a.observe(e),()=>{a.disconnect()}},[u,d,t]);const p=l.useMemo(()=>f(i.width,i.height,h),[i.width,i.height,h]);return{parsedCanvas:i,viewBox:p}},sr=()=>{const[e,t]=l.useState(null),r=l.useCallback(e=>()=>t(e),[]);return{handleBlur:l.useCallback(()=>{t(null)},[]),handleFocus:r,isFocused:l.useCallback(t=>e===t,[e])}},cr=(e,t)=>{const r=Math.floor(e);return Math.max(0,Math.min(t,r))},dr=(e,t)=>{const r=Math.ceil(e);return Math.max(0,Math.min(t,r))},ur=(e,t)=>{const r=Math.max(0,t-1);return{endIndex:dr(e.end,r),startIndex:cr(e.start,r)}},lr=({data:e,initialRange:t,onDataChange:r})=>{const a=t||Jt(e.length),[n,i]=l.useState(a),o=t=>{if(!r||0===e.length)return;const{endIndex:a,startIndex:n}=ur(t,e.length),i=e.slice(n,a+1);r(i)};return l.useEffect(()=>{o(n)},[]),{currentRange:n,handleRangeChange:e=>{i(e),o(e)}}},hr=e=>({keyboardFastStep:e?.keyboardFastStep??2,keyboardStep:e?.keyboardStep??1,minHandlerDistance:e?.minHandlerDistance??1}),fr=e=>{if(0===e.length)return"";if(1===e.length)return`M ${e[0][0]} ${e[0][1]}`;const[t,...r]=e;let a=`M ${t[0]} ${t[1]}`;return r.forEach((e,n)=>{const i=0===n?t:r[n-1],[o,s]=i,[c,d]=e,u=.3*(c-o),l=[o+u,s],h=[c-u,d];a+=` C ${l[0]} ${l[1]}, ${h[0]} ${h[1]}, ${c} ${d}`}),a},pr=(e,t,r,a)=>{if(0===e.length||0===t.length)return[];const n=.05*a,i=a-2*n,o=t.flatMap(t=>e.map(e=>Number(e[t.yKey]))),s=Math.min(...o),c=Math.max(...o)-s||1;return t.map(t=>{const o=e.map((a,o)=>[o/Math.max(1,e.length-1)*r,n+i-(Number(a[t.yKey])-s)/c*i]),d=t.curved?fr(o):`M ${o.map(([e,t])=>`${e},${t}`).join(" L ")}`;let u="";return t.fill&&(u=t.curved?`${fr(o)} L ${r} ${a} L 0 ${a} Z`:`${d} L ${r},${a} L 0,${a} Z`),{config:t,fillPath:u,linePath:d}})},Rr=(e,t,r)=>e[r]?.[t]?.toString()||`${r}`,xr=(e,t,r)=>{if(!e)return e;const a=new RegExp("{{startValue}}","g"),n=new RegExp("{{endValue}}","g");return e.replace(a,t).replace(n,r)};e.Bar=ke,e.BarChart=at,e.BarOrientation=v,e.ChartText=Xe,e.DefaultCanvasConfig=p,e.ErrorType=y,e.FOCUS_DEFAULT=jt,e.FocusRing=Kt,e.ForeignObject=$t,e.HandlerIcon=Ut,e.Line=Me,e.LineChart=Nt,e.LineRenderer=Gt,e.Node=Ne,e.NodeType=Se,e.Path=be,e.PieChart=Pt,e.Positions=m,e.SelectionArea=er,e.SvgContainer=h,e.Tick=Fe,e.TickDataUtils=ft,e.XAxis=Ye,e.YAxis=ze,e.ZoomArea=({ariaHidden:e,ariaLabel:t,backgroundColor:r,canvasConfig:a,caption:n,classNames:i,data:o,focusConfig:s,handlerConfig:c,height:d="40px",initialRange:f,interactionConfig:p,lines:R,onDataChange:g,role:_,screenReaderTextConfig:A,selectionConfig:E,width:T="100%",xKey:v,...y})=>{const m="zoom-area",C=hr(p),S=(I=E,{fill:I?.fill??"#0078d4",fillOpacity:I?.fillOpacity??.5,hideOverlayOnFullRange:I?.hideOverlayOnFullRange??true,stroke:I?.stroke??"#0078d4",strokeWidth:I?.strokeWidth??0});var I;const{currentRange:N,handleRangeChange:$}=lr({data:o,initialRange:f,onDataChange:g}),{parsedCanvas:b,viewBox:L}=or({canvasConfig:a,dataTestId:m,height:d,width:T}),k=x(o),O=JSON.stringify(R),H=l.useRef(null),w=((e,t,r,a)=>{const{endIndex:n,startIndex:i}=ur(r,e.length),o=Rr(e,t,i),s=Rr(e,t,n),c=xr(a?.startHandler,o,s)??o;return{endHandler:xr(a?.endHandler,o,s)??s,selectionArea:xr(a?.selectionArea,o,s)??`${o} - ${s}`,startHandler:c}})(o,v,N,A),P=l.useMemo(()=>pr(o,R,b.width,b.height),[k,O,b.width,b.height]),{endX:j,startX:D}=l.useMemo(()=>zt(N,o.length,b.width),[N,k,b.width]),{handleBlur:B,handleFocus:M,isFocused:X}=sr(),{handleKeyDown:F}=ir({currentRange:N,dataLength:o.length,interactionConfig:C,onRangeChange:$}),{groupRef:V,handleMouseDown:W,handleTouchStart:Y}=nr({currentRange:N,dataLength:o.length,interactionConfig:C,onRangeChange:$,width:b.width});return u.jsxs(h,{ref:V,ariaHidden:e,ariaLabel:t,backgroundColor:r,caption:n,className:i,"data-testid":m,height:d,overflow:"visible",role:_,viewBox:L,width:T,...y,children:[u.jsx(Gt,{linesData:P}),u.jsx(er,{ref:H,currentRange:N,dataLength:o.length,dataTestId:`${m}-selection-area`,endX:j,height:b.height,screenReaderText:w.selectionArea,selectionConfig:S,startX:D,onBlur:B,onFocus:M(ar.SELECTION_AREA),onKeyDown:F(ar.SELECTION_AREA),onMouseDown:W(ar.SELECTION_AREA),onTouchStart:Y(ar.SELECTION_AREA)}),u.jsx(rr,{dataTestId:`${m}-start-handler`,focusConfig:s,handlerConfig:c,height:b.height,isFocused:X(ar.START_HANDLER),max:N.end-C.minHandlerDistance,min:0,screenReaderText:w.startHandler,type:ar.START_HANDLER,value:N.start,x:D,onBlur:B,onFocus:M(ar.START_HANDLER),onKeyDown:F(ar.START_HANDLER),onMouseDown:W(ar.START_HANDLER),onTouchStart:Y(ar.START_HANDLER)}),u.jsx(rr,{dataTestId:`${m}-end-handler`,focusConfig:s,handlerConfig:c,height:b.height,isFocused:X(ar.END_HANDLER),max:o.length-1,min:N.start+C.minHandlerDistance,screenReaderText:w.endHandler,type:ar.END_HANDLER,value:N.end,x:j,onBlur:B,onFocus:M(ar.END_HANDLER),onKeyDown:F(ar.END_HANDLER),onMouseDown:W(ar.END_HANDLER),onTouchStart:Y(ar.END_HANDLER)}),u.jsx(Kt,{dataTestId:"selection-area-focus",focusConfig:{...s,variant:"bounding-box"},isFocused:X(ar.SELECTION_AREA),targetRef:H})]})},e.ZoomAreaElements=ar,e.ZoomHandler=rr,e.calculateHandlerPositions=zt,e.calculateLinesPathData=pr,e.clampRange=qt,e.createDefaultRange=Jt,e.generateCurvedPath=fr,e.getFocusConfig=Dt,e.getInteractionConfig=hr,e.isFullRange=Qt,e.mouseToDataIndex=Zt,e.normalizeToArray=e=>Array.isArray(e)?e:[e],e.useDragInteraction=nr,e.useKeyboardNavigation=ir,e.useResponsiveCanvas=or,e.useZoomAreaFocus=sr,e.useZoomData=lr,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
@@ -1 +1 @@
1
- .path{&:focus{outline:none}}.node-focus-border{outline:none;&:focus-visible{outline-style:solid;outline-offset:2px;outline-width:2px;outline-color:#2c71db}}.node-path-focus-border{outline:none;&:focus-visible{outline-style:solid;outline-offset:1px;outline-width:1px;outline-color:#2c71db}}.pointer-events-none{pointer-events:none}
1
+ .path{&:focus{outline:none}}.node-focus-border{outline:none;&:focus-visible{outline-style:solid;outline-offset:2px;outline-width:2px;outline-color:#2c71db}}.node-path-focus-border{outline:none;&:focus-visible{outline-style:solid;outline-offset:1px;outline-width:1px;outline-color:#2c71db}}.pointer-events-none,.focus-ring-outer,.focus-ring-inner,.focus-ring-container{pointer-events:none}
@@ -0,0 +1,25 @@
1
+ import { ReactElement } from '../../../../node_modules/react';
2
+ import { FocusConfig } from '../../../types/focusConfig.type';
3
+ export interface FocusRingInlineProps {
4
+ children: ReactElement;
5
+ isFocused: boolean;
6
+ disabled?: boolean;
7
+ dataTestId?: string;
8
+ focusConfig?: FocusConfig;
9
+ }
10
+ /**
11
+ * FocusRing component for inline mode (children).
12
+ * Wraps the element and renders focus ring inline with automatic z-order.
13
+ *
14
+ * This component:
15
+ * - Clones the children element and attaches a ref to it
16
+ * - Detects element bounds on mount and when focus state changes
17
+ * - Renders the focus ring BEFORE the element (proper z-order)
18
+ * - Handles both adaptive and bounding-box variants
19
+ * - Preserves any existing ref the children might have
20
+ *
21
+ * @param props - FocusRingInlineProps
22
+ * @returns JSX element with focus ring + wrapped children
23
+ */
24
+ export declare const FocusRingInline: React.FC<FocusRingInlineProps>;
25
+ //# sourceMappingURL=FocusRingInline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FocusRingInline.d.ts","sourceRoot":"","sources":["../../../../../src/components/focusRing/components/FocusRingInline.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAwB,MAAM,OAAO,CAAC;AAEhE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAM5D,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAoC1D,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { FocusRingRendererProps } from '../focusRing.types';
2
+ /**
3
+ * Internal component that renders the actual focus ring elements.
4
+ * Supports both adaptive and bounding-box strategies with a unified rendering approach.
5
+ *
6
+ * This is a pure presentational component that receives pre-calculated FocusRingLayers
7
+ * and renders the appropriate SVG elements using React.createElement.
8
+ *
9
+ * @param props - FocusRingRendererProps
10
+ * @returns JSX element with focus ring SVG elements, or null if no valid data
11
+ */
12
+ export declare const FocusRingRenderer: React.FC<FocusRingRendererProps>;
13
+ //# sourceMappingURL=FocusRingRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FocusRingRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/components/focusRing/components/FocusRingRenderer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAkB9D,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { RefObject } from '../../../../node_modules/react';
2
+ import { FocusConfig } from '../../../types/focusConfig.type';
3
+ export interface FocusRingSeparateProps {
4
+ targetRef: RefObject<SVGGraphicsElement>;
5
+ isFocused: boolean;
6
+ disabled?: boolean;
7
+ dataTestId?: string;
8
+ focusConfig?: FocusConfig;
9
+ }
10
+ /**
11
+ * FocusRing component for separate mode (targetRef).
12
+ * Renders only the focus ring, allowing precise z-order control.
13
+ *
14
+ * This component:
15
+ * - Uses a ref to the target element (does not wrap it)
16
+ * - Only renders the focus ring (no children cloning)
17
+ * - Allows precise z-order control by controlling where FocusRing is placed in JSX
18
+ * - Handles both adaptive and bounding-box variants
19
+ *
20
+ * **IMPORTANT NOTE: Z-Order with Adaptive Variant**
21
+ *
22
+ * When using `variant: 'adaptive'` (default), the FocusRing **MUST be rendered BEFORE**
23
+ * the target element in SVG document order. Otherwise, focus ring strokes will cover the element.
24
+ *
25
+ * @param props - FocusRingSeparateProps
26
+ * @returns JSX element with only focus ring, or null if not focused/disabled
27
+ *
28
+ * @example
29
+ * ```tsx
30
+ * const ref = useRef<SVGCircleElement>(null);
31
+ *
32
+ * // CORRECT: FocusRing before element
33
+ * <>
34
+ * <FocusRingSeparate targetRef={ref} isFocused={true} />
35
+ * <circle ref={ref} cx={50} cy={50} r={30} />
36
+ * </>
37
+ * ```
38
+ */
39
+ export declare const FocusRingSeparate: React.FC<FocusRingSeparateProps>;
40
+ //# sourceMappingURL=FocusRingSeparate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FocusRingSeparate.d.ts","sourceRoot":"","sources":["../../../../../src/components/focusRing/components/FocusRingSeparate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAK5D,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,SAAS,CAAC,kBAAkB,CAAC,CAAC;IACzC,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAoB9D,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { FC } from '../../../node_modules/react';
2
+ import { FocusRingProps } from './focusRing.types';
3
+ /**
4
+ * FocusRing - Controlled, purely decorative component for rendering focus rings around SVG elements.
5
+ *
6
+ * **Key Characteristics:**
7
+ * - **Controlled Component**: Parent manages `isFocused` state
8
+ * - **Purely Decorative**: Does not intercept or manage events
9
+ * - **Two Modes**: Inline (children) or Separate (targetRef) rendering
10
+ * - **Zero Configuration**: Automatic element detection
11
+ *
12
+ * **Two Modes:**
13
+ *
14
+ * 1. **Inline (children)** - Wraps element, focus ring rendered inline, z-order handled automatically
15
+ * 2. **Separate (targetRef)** - Only renders focus ring, allows precise z-order control
16
+ *
17
+ * **IMPORTANT NOTE: Z-Order with Adaptive Variant**
18
+ *
19
+ * When using `variant: 'adaptive'` (default) with `targetRef` mode, the FocusRing **MUST be rendered BEFORE**
20
+ * the target element in SVG document order. Otherwise, focus ring strokes will cover the element.
21
+ *
22
+ * ```tsx
23
+ * // CORRECT: FocusRing before element
24
+ * <>
25
+ * <FocusRing targetRef={ref} isFocused={focused} />
26
+ * <circle ref={ref} cx={50} cy={50} r={30} />
27
+ * </>
28
+ * ```
29
+ *
30
+ * @param props - FocusRingProps
31
+ * @returns JSX element with focus ring or null
32
+ */
33
+ export declare const FocusRing: FC<FocusRingProps>;
34
+ //# sourceMappingURL=focusRing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focusRing.d.ts","sourceRoot":"","sources":["../../../../src/components/focusRing/focusRing.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,OAAO,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAsCxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,SAAS,oBAAqB,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { ReactElement, RefObject } from '../../../node_modules/react';
2
+ import { FocusConfig } from '../../types/focusConfig.type';
3
+ import { FocusRingLayers } from './utils/utils.types';
4
+ export interface FocusRingProps {
5
+ /**
6
+ * The SVG graphics element to wrap with focus ring (Mode 1: inline rendering).
7
+ * Must be a renderable SVG element (path, circle, rect, g, etc.).
8
+ * Mutually exclusive with targetRef - provide either children OR targetRef, not both.
9
+ */
10
+ children?: ReactElement;
11
+ /**
12
+ * Reference to external SVG graphics element (Mode 2: separate rendering).
13
+ * Must be a renderable SVG element (path, circle, rect, g, etc.).
14
+ * When provided, only the focus ring is rendered (not the element itself).
15
+ * Mutually exclusive with children - provide either children OR targetRef, not both.
16
+ */
17
+ targetRef?: RefObject<SVGGraphicsElement>;
18
+ /**
19
+ * Controlled focus state (REQUIRED).
20
+ * The parent component must manage this state and update it based on focus/blur events.
21
+ * FocusRing is purely decorative and does not manage state internally.
22
+ */
23
+ isFocused: boolean;
24
+ /** Test identifier for the focus ring elements */
25
+ dataTestId?: string;
26
+ /** Whether the focus ring is disabled */
27
+ disabled?: boolean;
28
+ /** Configuration for focus ring appearance */
29
+ focusConfig?: FocusConfig;
30
+ }
31
+ /**
32
+ * Props for the internal FocusRingRenderer component
33
+ */
34
+ export interface FocusRingRendererProps {
35
+ /** Test identifier for the focus ring elements */
36
+ dataTestId: string;
37
+ /** Pre-computed layers (unified structure for both adaptive and bounding-box modes) */
38
+ layers?: FocusRingLayers;
39
+ }
40
+ //# sourceMappingURL=focusRing.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focusRing.types.d.ts","sourceRoot":"","sources":["../../../../src/components/focusRing/focusRing.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAC;IAExB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC,kBAAkB,CAAC,CAAC;IAE1C;;;;OAIG;IACH,SAAS,EAAE,OAAO,CAAC;IAEnB,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,8CAA8C;IAC9C,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,kDAAkD;IAClD,UAAU,EAAE,MAAM,CAAC;IAEnB,uFAAuF;IACvF,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B"}
@@ -0,0 +1,27 @@
1
+ import { RefObject } from '../../../../node_modules/react';
2
+ import { FocusConfig } from '../../../types/focusConfig.type';
3
+ import { FocusRingLayers } from '../utils/utils.types';
4
+ export interface UseFocusRingDataOptions {
5
+ elementRef: RefObject<SVGGraphicsElement>;
6
+ isFocused: boolean;
7
+ focusConfig?: FocusConfig;
8
+ }
9
+ export interface FocusRingData {
10
+ resolvedConfig: Required<FocusConfig>;
11
+ layers: FocusRingLayers | undefined;
12
+ }
13
+ /**
14
+ * Hook that handles all focus ring data calculation logic.
15
+ * Separated from rendering concerns for better testability and reusability.
16
+ *
17
+ * This hook:
18
+ * - Generates layers for both adaptive and bounding-box variants
19
+ * - Both variants return the same FocusRingLayers structure
20
+ * - Only calculates what's needed based on the variant
21
+ * - Manages all the state and effects related to focus ring data
22
+ *
23
+ * @param options - Configuration options for the hook
24
+ * @returns Focus ring data including resolved config and calculated layers
25
+ */
26
+ export declare function useFocusRingData({ elementRef, focusConfig, isFocused, }: UseFocusRingDataOptions): FocusRingData;
27
+ //# sourceMappingURL=useFocusRingData.d.ts.map