=0?1:-1,s=r>=0?1:-1,u=a>=0&&r>=0||a<0&&r<0?1:0,d;if(l>0&&i instanceof Array){for(var f=[0,0,0,0],h=0,p=4;hl?l:i[h];d="M".concat(t,",").concat(n+o*f[0]),f[0]>0&&(d+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(t+s*f[0],",").concat(n)),d+="L ".concat(t+r-s*f[1],",").concat(n),f[1]>0&&(d+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`,
+ `).concat(t+r,",").concat(n+o*f[1])),d+="L ".concat(t+r,",").concat(n+a-o*f[2]),f[2]>0&&(d+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`,
+ `).concat(t+r-s*f[2],",").concat(n+a)),d+="L ".concat(t+s*f[3],",").concat(n+a),f[3]>0&&(d+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`,
+ `).concat(t,",").concat(n+a-o*f[3])),d+="Z"}else if(l>0&&i===+i&&i>0){var S=Math.min(l,i);d="M ".concat(t,",").concat(n+o*S,`
+ A `).concat(S,",").concat(S,",0,0,").concat(u,",").concat(t+s*S,",").concat(n,`
+ L `).concat(t+r-s*S,",").concat(n,`
+ A `).concat(S,",").concat(S,",0,0,").concat(u,",").concat(t+r,",").concat(n+o*S,`
+ L `).concat(t+r,",").concat(n+a-o*S,`
+ A `).concat(S,",").concat(S,",0,0,").concat(u,",").concat(t+r-s*S,",").concat(n+a,`
+ L `).concat(t+s*S,",").concat(n+a,`
+ A `).concat(S,",").concat(S,",0,0,").concat(u,",").concat(t,",").concat(n+a-o*S," Z")}else d="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(a," h ").concat(-r," Z");return d},EJ=function(t,n){if(!t||!n)return!1;var r=t.x,a=t.y,i=n.x,l=n.y,o=n.width,s=n.height;if(Math.abs(o)>0&&Math.abs(s)>0){var u=Math.min(i,i+o),d=Math.max(i,i+o),f=Math.min(l,l+s),h=Math.max(l,l+s);return r>=u&&r<=d&&a>=f&&a<=h}return!1},TJ={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},s0=function(t){var n=fj(fj({},TJ),t),r=O.useRef(),a=O.useState(-1),i=bJ(a,2),l=i[0],o=i[1];O.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var w=r.current.getTotalLength();w&&o(w)}catch{}},[]);var s=n.x,u=n.y,d=n.width,f=n.height,h=n.radius,p=n.className,S=n.animationEasing,g=n.animationDuration,v=n.animationBegin,m=n.isAnimationActive,y=n.isUpdateAnimationActive;if(s!==+s||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var b=he("recharts-rectangle",p);return y?M.createElement(Ir,{canBegin:l>0,from:{width:d,height:f,x:s,y:u},to:{width:d,height:f,x:s,y:u},duration:g,animationEasing:S,isActive:y},function(w){var x=w.width,j=w.height,A=w.x,_=w.y;return M.createElement(Ir,{canBegin:l>0,from:"0px ".concat(l===-1?1:l,"px"),to:"".concat(l,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:g,isActive:m,easing:S},M.createElement("path",Jf({},re(n,!0),{className:b,d:dj(A,_,x,j,h),ref:r})))}):M.createElement("path",Jf({},re(n,!0),{className:b,d:dj(s,u,d,f,h)}))},NJ=["points","className","baseLinePoints","connectNulls"];function Wi(){return Wi=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function MJ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function hj(e){return DJ(e)||PJ(e)||RJ(e)||$J()}function $J(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RJ(e,t){if(e){if(typeof e=="string")return gv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gv(e,t)}}function PJ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function DJ(e){if(Array.isArray(e))return gv(e)}function gv(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){pj(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),pj(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},us=function(t,n){var r=kJ(t);n&&(r=[r.reduce(function(i,l){return[].concat(hj(i),hj(l))},[])]);var a=r.map(function(i){return i.reduce(function(l,o,s){return"".concat(l).concat(s===0?"M":"L").concat(o.x,",").concat(o.y)},"")}).join("");return r.length===1?"".concat(a,"Z"):a},LJ=function(t,n,r){var a=us(t,r);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(us(n.reverse(),r).slice(1))},BJ=function(t){var n=t.points,r=t.className,a=t.baseLinePoints,i=t.connectNulls,l=CJ(t,NJ);if(!n||!n.length)return null;var o=he("recharts-polygon",r);if(a&&a.length){var s=l.stroke&&l.stroke!=="none",u=LJ(n,a,i);return M.createElement("g",{className:o},M.createElement("path",Wi({},re(l,!0),{fill:u.slice(-1)==="Z"?l.fill:"none",stroke:"none",d:u})),s?M.createElement("path",Wi({},re(l,!0),{fill:"none",d:us(n,i)})):null,s?M.createElement("path",Wi({},re(l,!0),{fill:"none",d:us(a,i)})):null)}var d=us(n,i);return M.createElement("path",Wi({},re(l,!0),{fill:d.slice(-1)==="Z"?l.fill:"none",className:o,d}))};function bv(){return bv=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function YJ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var FJ=function(t,n,r,a,i,l){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(l,",").concat(n,"h").concat(r)},VJ=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,i=a===void 0?0:a,l=t.top,o=l===void 0?0:l,s=t.left,u=s===void 0?0:s,d=t.width,f=d===void 0?0:d,h=t.height,p=h===void 0?0:h,S=t.className,g=GJ(t,zJ),v=IJ({x:r,y:i,top:o,left:u,width:f,height:p},g);return!F(r)||!F(i)||!F(f)||!F(p)||!F(o)||!F(u)?null:M.createElement("path",xv({},re(v,!0),{className:he("recharts-cross",S),d:FJ(r,i,f,p,o,u)}))},KJ=bh,XJ=aN,WJ=_a;function ZJ(e,t){return e&&e.length?KJ(e,WJ(t),XJ):void 0}var QJ=ZJ;const JJ=Te(QJ);var eee=bh,tee=_a,nee=iN;function ree(e,t){return e&&e.length?eee(e,tee(t),nee):void 0}var aee=ree;const iee=Te(aee);var lee=["cx","cy","angle","ticks","axisLine"],oee=["ticks","tick","angle","tickFormatter","stroke"];function Pl(e){"@babel/helpers - typeof";return Pl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pl(e)}function cs(){return cs=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function see(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function uee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gj(e,t){for(var n=0;nSj?l=a==="outer"?"start":"end":i<-Sj?l=a==="outer"?"end":"start":l="middle",l}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.cx,i=r.cy,l=r.radius,o=r.axisLine,s=r.axisLineType,u=Da(Da({},re(this.props,!1)),{},{fill:"none"},re(o,!1));if(s==="circle")return M.createElement(u0,qa({className:"recharts-polar-angle-axis-line"},u,{cx:a,cy:i,r:l}));var d=this.props.ticks,f=d.map(function(h){return Ie(a,i,l,h.coordinate)});return M.createElement(BJ,qa({className:"recharts-polar-angle-axis-line"},u,{points:f}))}},{key:"renderTicks",value:function(){var r=this,a=this.props,i=a.ticks,l=a.tick,o=a.tickLine,s=a.tickFormatter,u=a.stroke,d=re(this.props,!1),f=re(l,!1),h=Da(Da({},d),{},{fill:"none"},re(o,!1)),p=i.map(function(S,g){var v=r.getTickLineCoord(S),m=r.getTickTextAnchor(S),y=Da(Da(Da({textAnchor:m},d),{},{stroke:"none",fill:u},f),{},{index:g,payload:S,x:v.x2,y:v.y2});return M.createElement(Ee,qa({className:he("recharts-polar-angle-axis-tick",$N(l)),key:"tick-".concat(S.coordinate)},di(r.props,S,g)),o&&M.createElement("line",qa({className:"recharts-polar-angle-axis-tick-line"},h,v)),l&&t.renderTickItem(l,y,s?s(S.value,g):S.value))});return M.createElement(Ee,{className:"recharts-polar-angle-axis-ticks"},p)}},{key:"render",value:function(){var r=this.props,a=r.ticks,i=r.radius,l=r.axisLine;return i<=0||!a||!a.length?null:M.createElement(Ee,{className:he("recharts-polar-angle-axis",this.props.className)},l&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,a,i){var l;return M.isValidElement(r)?l=M.cloneElement(r,a):ie(r)?l=r(a):l=M.createElement(hi,qa({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),l}}])}(O.PureComponent);Th(Nh,"displayName","PolarAngleAxis");Th(Nh,"axisType","angleAxis");Th(Nh,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var Oee=nT,Aee=Oee(Object.getPrototypeOf,Object),_ee=Aee,Eee=Hr,Tee=_ee,Nee=qr,Cee="[object Object]",Mee=Function.prototype,$ee=Object.prototype,WN=Mee.toString,Ree=$ee.hasOwnProperty,Pee=WN.call(Object);function Dee(e){if(!Nee(e)||Eee(e)!=Cee)return!1;var t=Tee(e);if(t===null)return!0;var n=Ree.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&WN.call(n)==Pee}var kee=Dee;const Lee=Te(kee);var Bee=Hr,zee=qr,Iee="[object Boolean]";function Uee(e){return e===!0||e===!1||zee(e)&&Bee(e)==Iee}var Hee=Uee;const qee=Te(Hee);function eu(e){"@babel/helpers - typeof";return eu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eu(e)}function nd(){return nd=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0,from:{upperWidth:0,lowerWidth:0,height:h,x:s,y:u},to:{upperWidth:d,lowerWidth:f,height:h,x:s,y:u},duration:g,animationEasing:S,isActive:m},function(b){var w=b.upperWidth,x=b.lowerWidth,j=b.height,A=b.x,_=b.y;return M.createElement(Ir,{canBegin:l>0,from:"0px ".concat(l===-1?1:l,"px"),to:"".concat(l,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:g,easing:S},M.createElement("path",nd({},re(n,!0),{className:y,d:Aj(A,_,w,x,j),ref:r})))}):M.createElement("g",null,M.createElement("path",nd({},re(n,!0),{className:y,d:Aj(s,u,d,f,h)})))},ete=["option","shapeType","propTransformer","activeClassName","isActive"];function tu(e){"@babel/helpers - typeof";return tu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tu(e)}function tte(e,t){if(e==null)return{};var n=nte(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function nte(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function _j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function rd(e){for(var t=1;t0?pn(b,"paddingAngle",0):0;if(x){var A=Wr(x.endAngle-x.startAngle,b.endAngle-b.startAngle),_=Le(Le({},b),{},{startAngle:y+j,endAngle:y+A(g)+j});v.push(_),y=_.endAngle}else{var E=b.endAngle,T=b.startAngle,R=Wr(0,E-T),N=R(g),L=Le(Le({},b),{},{startAngle:y+j,endAngle:y+N+j});v.push(L),y=L.endAngle}}),M.createElement(Ee,null,r.renderSectorsStatically(v))})}},{key:"attachKeyboardHandlers",value:function(r){var a=this;r.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var l=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[l].focus(),a.setState({sectorToFocus:l});break}case"ArrowRight":{var o=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[o].focus(),a.setState({sectorToFocus:o});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,a=r.sectors,i=r.isAnimationActive,l=this.state.prevSectors;return i&&a&&a.length&&(!l||!wh(l,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,a=this.props,i=a.hide,l=a.sectors,o=a.className,s=a.label,u=a.cx,d=a.cy,f=a.innerRadius,h=a.outerRadius,p=a.isAnimationActive,S=this.state.isAnimationFinished;if(i||!l||!l.length||!F(u)||!F(d)||!F(f)||!F(h))return null;var g=he("recharts-pie",o);return M.createElement(Ee,{tabIndex:this.props.rootTabIndex,className:g,ref:function(m){r.pieRef=m}},this.renderSectors(),s&&this.renderLabels(l),St.renderCallByParent(this.props,null,!1),(!p||S)&&ga.renderCallByParent(this.props,l,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return a.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:r.sectors!==a.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,a){return r>a?"start":r=360?y:y-1)*s,w=v-y*p-b,x=a.reduce(function(_,E){var T=kt(E,m,0);return _+(F(T)?T:0)},0),j;if(x>0){var A;j=a.map(function(_,E){var T=kt(_,m,0),R=kt(_,d,E),N=(F(T)?T:0)/x,L;E?L=A.endAngle+It(g)*s*(T!==0?1:0):L=l;var k=L+It(g)*((T!==0?p:0)+N*w),D=(L+k)/2,$=(S.innerRadius+S.outerRadius)/2,P=[{name:R,value:T,payload:_,dataKey:m,type:h}],B=Ie(S.cx,S.cy,$,D);return A=Le(Le(Le({percent:N,cornerRadius:i,name:R,tooltipPayload:P,midAngle:D,middleRadius:$,tooltipPosition:B},_),S),{},{value:kt(_,m),startAngle:L,endAngle:k,payload:_,paddingAngle:It(g)*s}),A})}return Le(Le({},S),{},{sectors:j,data:a})});var jte=Math.ceil,Ote=Math.max;function Ate(e,t,n,r){for(var a=-1,i=Ote(jte((t-e)/(n||1)),0),l=Array(i);i--;)l[r?i:++a]=e,e+=n;return l}var _te=Ate,Ete=xT,Cj=1/0,Tte=17976931348623157e292;function Nte(e){if(!e)return e===0?e:0;if(e=Ete(e),e===Cj||e===-Cj){var t=e<0?-1:1;return t*Tte}return e===e?e:0}var Cte=Nte,Mte=_te,$te=fh,nm=Cte;function Rte(e){return function(t,n,r){return r&&typeof r!="number"&&$te(t,n,r)&&(n=r=void 0),t=nm(t),n===void 0?(n=t,t=0):n=nm(n),r=r===void 0?t0&&r.handleDrag(a.changedTouches[0])}),nn(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=r.props,i=a.endIndex,l=a.onDragEnd,o=a.startIndex;l==null||l({endIndex:i,startIndex:o})}),r.detachDragEndListener()}),nn(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),nn(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),nn(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),nn(r,"handleSlideDragStart",function(a){var i=Dj(a)?a.changedTouches[0]:a;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return Vte(t,e),qte(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var a=r.startX,i=r.endX,l=this.state.scaleValues,o=this.props,s=o.gap,u=o.data,d=u.length-1,f=Math.min(a,i),h=Math.max(a,i),p=t.getIndexInRange(l,f),S=t.getIndexInRange(l,h);return{startIndex:p-p%s,endIndex:S===d?d:S-S%s}}},{key:"getTextOfTick",value:function(r){var a=this.props,i=a.data,l=a.tickFormatter,o=a.dataKey,s=kt(i[r],o,r);return ie(l)?l(s,r):s}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var a=this.state,i=a.slideMoveStartX,l=a.startX,o=a.endX,s=this.props,u=s.x,d=s.width,f=s.travellerWidth,h=s.startIndex,p=s.endIndex,S=s.onChange,g=r.pageX-i;g>0?g=Math.min(g,u+d-f-o,u+d-f-l):g<0&&(g=Math.max(g,u-l,u-o));var v=this.getIndex({startX:l+g,endX:o+g});(v.startIndex!==h||v.endIndex!==p)&&S&&S(v),this.setState({startX:l+g,endX:o+g,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,a){var i=Dj(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var a=this.state,i=a.brushMoveStartX,l=a.movingTravellerId,o=a.endX,s=a.startX,u=this.state[l],d=this.props,f=d.x,h=d.width,p=d.travellerWidth,S=d.onChange,g=d.gap,v=d.data,m={startX:this.state.startX,endX:this.state.endX},y=r.pageX-i;y>0?y=Math.min(y,f+h-p-u):y<0&&(y=Math.max(y,f-u)),m[l]=u+y;var b=this.getIndex(m),w=b.startIndex,x=b.endIndex,j=function(){var _=v.length-1;return l==="startX"&&(o>s?w%g===0:x%g===0)||os?x%g===0:w%g===0)||o>s&&x===_};this.setState(nn(nn({},l,u+y),"brushMoveStartX",r.pageX),function(){S&&j()&&S(b)})}},{key:"handleTravellerMoveKeyboard",value:function(r,a){var i=this,l=this.state,o=l.scaleValues,s=l.startX,u=l.endX,d=this.state[a],f=o.indexOf(d);if(f!==-1){var h=f+r;if(!(h===-1||h>=o.length)){var p=o[h];a==="startX"&&p>=u||a==="endX"&&p<=s||this.setState(nn({},a,p),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,a=r.x,i=r.y,l=r.width,o=r.height,s=r.fill,u=r.stroke;return M.createElement("rect",{stroke:u,fill:s,x:a,y:i,width:l,height:o})}},{key:"renderPanorama",value:function(){var r=this.props,a=r.x,i=r.y,l=r.width,o=r.height,s=r.data,u=r.children,d=r.padding,f=O.Children.only(u);return f?M.cloneElement(f,{x:a,y:i,width:l,height:o,margin:d,compact:!0,data:s}):null}},{key:"renderTravellerLayer",value:function(r,a){var i,l,o=this,s=this.props,u=s.y,d=s.travellerWidth,f=s.height,h=s.traveller,p=s.ariaLabel,S=s.data,g=s.startIndex,v=s.endIndex,m=Math.max(r,this.props.x),y=rm(rm({},re(this.props,!1)),{},{x:m,y:u,width:d,height:f}),b=p||"Min value: ".concat((i=S[g])===null||i===void 0?void 0:i.name,", Max value: ").concat((l=S[v])===null||l===void 0?void 0:l.name);return M.createElement(Ee,{tabIndex:0,role:"slider","aria-label":b,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(x){["ArrowLeft","ArrowRight"].includes(x.key)&&(x.preventDefault(),x.stopPropagation(),o.handleTravellerMoveKeyboard(x.key==="ArrowRight"?1:-1,a))},onFocus:function(){o.setState({isTravellerFocused:!0})},onBlur:function(){o.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,y))}},{key:"renderSlide",value:function(r,a){var i=this.props,l=i.y,o=i.height,s=i.stroke,u=i.travellerWidth,d=Math.min(r,a)+u,f=Math.max(Math.abs(a-r)-u,0);return M.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:s,fillOpacity:.2,x:d,y:l,width:f,height:o})}},{key:"renderText",value:function(){var r=this.props,a=r.startIndex,i=r.endIndex,l=r.y,o=r.height,s=r.travellerWidth,u=r.stroke,d=this.state,f=d.startX,h=d.endX,p=5,S={pointerEvents:"none",fill:u};return M.createElement(Ee,{className:"recharts-brush-texts"},M.createElement(hi,ld({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-p,y:l+o/2},S),this.getTextOfTick(a)),M.createElement(hi,ld({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+s+p,y:l+o/2},S),this.getTextOfTick(i)))}},{key:"render",value:function(){var r=this.props,a=r.data,i=r.className,l=r.children,o=r.x,s=r.y,u=r.width,d=r.height,f=r.alwaysShowText,h=this.state,p=h.startX,S=h.endX,g=h.isTextActive,v=h.isSlideMoving,m=h.isTravellerMoving,y=h.isTravellerFocused;if(!a||!a.length||!F(o)||!F(s)||!F(u)||!F(d)||u<=0||d<=0)return null;var b=he("recharts-brush",i),w=M.Children.count(l)===1,x=Ute("userSelect","none");return M.createElement(Ee,{className:b,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:x},this.renderBackground(),w&&this.renderPanorama(),this.renderSlide(p,S),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(S,"endX"),(g||v||m||y||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var a=r.x,i=r.y,l=r.width,o=r.height,s=r.stroke,u=Math.floor(i+o/2)-1;return M.createElement(M.Fragment,null,M.createElement("rect",{x:a,y:i,width:l,height:o,fill:s,stroke:"none"}),M.createElement("line",{x1:a+1,y1:u,x2:a+l-1,y2:u,fill:"none",stroke:"#fff"}),M.createElement("line",{x1:a+1,y1:u+2,x2:a+l-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,a){var i;return M.isValidElement(r)?i=M.cloneElement(r,a):ie(r)?i=r(a):i=t.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(r,a){var i=r.data,l=r.width,o=r.x,s=r.travellerWidth,u=r.updateId,d=r.startIndex,f=r.endIndex;if(i!==a.prevData||u!==a.prevUpdateId)return rm({prevData:i,prevTravellerWidth:s,prevUpdateId:u,prevX:o,prevWidth:l},i&&i.length?Xte({data:i,width:l,x:o,travellerWidth:s,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(a.scale&&(l!==a.prevWidth||o!==a.prevX||s!==a.prevTravellerWidth)){a.scale.range([o,o+l-s]);var h=a.scale.domain().map(function(p){return a.scale(p)});return{prevData:i,prevTravellerWidth:s,prevUpdateId:u,prevX:o,prevWidth:l,startX:a.scale(r.startIndex),endX:a.scale(r.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(r,a){for(var i=r.length,l=0,o=i-1;o-l>1;){var s=Math.floor((l+o)/2);r[s]>a?o=s:l=s}return a>=r[o]?o:l}}])}(O.PureComponent);nn(Bl,"displayName","Brush");nn(Bl,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var Wte=Pb;function Zte(e,t){var n;return Wte(e,function(r,a,i){return n=t(r,a,i),!n}),!!n}var Qte=Zte,Jte=K2,ene=_a,tne=Qte,nne=en,rne=fh;function ane(e,t,n){var r=nne(e)?Jte:tne;return n&&rne(e,t,n)&&(t=void 0),r(e,ene(t))}var ine=ane;const lne=Te(ine);var nr=function(t,n){var r=t.alwaysShow,a=t.ifOverflow;return r&&(a="extendDomain"),a===n},kj=mT;function one(e,t,n){t=="__proto__"&&kj?kj(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var sne=one,une=sne,cne=hT,fne=_a;function dne(e,t){var n={};return t=fne(t),cne(e,function(r,a,i){une(n,a,t(r,a,i))}),n}var hne=dne;const pne=Te(hne);function mne(e,t){for(var n=-1,r=e==null?0:e.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Rne(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Pne(e,t){var n=e.x,r=e.y,a=$ne(e,Tne),i="".concat(n),l=parseInt(i,10),o="".concat(r),s=parseInt(o,10),u="".concat(t.height||a.height),d=parseInt(u,10),f="".concat(t.width||a.width),h=parseInt(f,10);return Bo(Bo(Bo(Bo(Bo({},t),a),l?{x:l}:{}),s?{y:s}:{}),{},{height:d,width:h,name:t.name,radius:t.radius})}function Bj(e){return M.createElement(ZN,Av({shapeType:"rectangle",propTransformer:Pne,activeClassName:"recharts-active-bar"},e))}var Dne=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,a){if(typeof t=="number")return t;var i=F(r)||eB(r);return i?t(r,a):(i||mi(),n)}},kne=["value","background"],rC;function zl(e){"@babel/helpers - typeof";return zl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zl(e)}function Lne(e,t){if(e==null)return{};var n=Bne(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Bne(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function sd(){return sd=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(D)0&&Math.abs(k)0&&(L=Math.min((oe||0)-(k[Ce-1]||0),L))}),Number.isFinite(L)){var D=L/N,$=g.layout==="vertical"?r.height:r.width;if(g.padding==="gap"&&(A=D*$/2),g.padding==="no-gap"){var P=Ut(t.barCategoryGap,D*$),B=D*$/2;A=B-P-(B-P)/$*P}}}a==="xAxis"?_=[r.left+(b.left||0)+(A||0),r.left+r.width-(b.right||0)-(A||0)]:a==="yAxis"?_=s==="horizontal"?[r.top+r.height-(b.bottom||0),r.top+(b.top||0)]:[r.top+(b.top||0)+(A||0),r.top+r.height-(b.bottom||0)-(A||0)]:_=g.range,x&&(_=[_[1],_[0]]);var H=AN(g,i,h),G=H.scale,q=H.realScaleType;G.domain(m).range(_),_N(G);var Y=EN(G,qn(qn({},g),{},{realScaleType:q}));a==="xAxis"?(R=v==="top"&&!w||v==="bottom"&&w,E=r.left,T=f[j]-R*g.height):a==="yAxis"&&(R=v==="left"&&!w||v==="right"&&w,E=f[j]-R*g.width,T=r.top);var W=qn(qn(qn({},g),Y),{},{realScaleType:q,x:E,y:T,scale:G,width:a==="xAxis"?r.width:g.width,height:a==="yAxis"?r.height:g.height});return W.bandSize=Ff(W,Y),!g.hide&&a==="xAxis"?f[j]+=(R?-1:1)*W.height:g.hide||(f[j]+=(R?-1:1)*W.width),qn(qn({},p),{},$h({},S,W))},{})},oC=function(t,n){var r=t.x,a=t.y,i=n.x,l=n.y;return{x:Math.min(r,i),y:Math.min(a,l),width:Math.abs(i-r),height:Math.abs(l-a)}},Wne=function(t){var n=t.x1,r=t.y1,a=t.x2,i=t.y2;return oC({x:n,y:r},{x:a,y:i})},sC=function(){function e(t){Fne(this,e),this.scale=t}return Vne(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.bandAware,i=r.position;if(n!==void 0){if(i)switch(i){case"start":return this.scale(n);case"middle":{var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}case"end":{var o=this.bandwidth?this.bandwidth():0;return this.scale(n)+o}default:return this.scale(n)}if(a){var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+s}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),a=r[0],i=r[r.length-1];return a<=i?n>=a&&n<=i:n>=i&&n<=a}}],[{key:"create",value:function(n){return new e(n)}}])}();$h(sC,"EPS",1e-4);var c0=function(t){var n=Object.keys(t).reduce(function(r,a){return qn(qn({},r),{},$h({},a,sC.create(t[a])))},{});return qn(qn({},n),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=i.bandAware,o=i.position;return pne(a,function(s,u){return n[u].apply(s,{bandAware:l,position:o})})},isInRange:function(a){return Ene(a,function(i,l){return n[l].isInRange(i)})}})};function Zne(e){return(e%180+180)%180}var Qne=function(t){var n=t.width,r=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=Zne(a),l=i*Math.PI/180,o=Math.atan(r/n),s=l>o&&le.length)&&(t=e.length);for(var n=0,r=new Array(t);ne*a)return!1;var i=n();return e*(t-e*i/2-r)>=0&&e*(t+e*i/2-a)<=0}function zre(e,t){return AC(e,t+1)}function Ire(e,t,n,r,a){for(var i=(r||[]).slice(),l=t.start,o=t.end,s=0,u=1,d=l,f=function(){var S=r==null?void 0:r[s];if(S===void 0)return{v:AC(r,u)};var g=s,v,m=function(){return v===void 0&&(v=n(S,g)),v},y=S.coordinate,b=s===0||hd(e,y,m,d,o);b||(s=0,d=l,u+=1),b&&(d=y+e*(m()/2+a),s+=u)},h;u<=i.length;)if(h=f(),h)return h.v;return[]}function lu(e){"@babel/helpers - typeof";return lu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lu(e)}function Zj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Dt(e){for(var t=1;t0?p.coordinate-v*e:p.coordinate})}else i[h]=p=Dt(Dt({},p),{},{tickCoord:p.coordinate});var m=hd(e,p.tickCoord,g,o,s);m&&(s=p.tickCoord-e*(g()/2+a),i[h]=Dt(Dt({},p),{},{isShow:!0}))},d=l-1;d>=0;d--)u(d);return i}function Yre(e,t,n,r,a,i){var l=(r||[]).slice(),o=l.length,s=t.start,u=t.end;if(i){var d=r[o-1],f=n(d,o-1),h=e*(d.coordinate+e*f/2-u);l[o-1]=d=Dt(Dt({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate});var p=hd(e,d.tickCoord,function(){return f},s,u);p&&(u=d.tickCoord-e*(f/2+a),l[o-1]=Dt(Dt({},d),{},{isShow:!0}))}for(var S=i?o-1:o,g=function(y){var b=l[y],w,x=function(){return w===void 0&&(w=n(b,y)),w};if(y===0){var j=e*(b.coordinate-e*x()/2-s);l[y]=b=Dt(Dt({},b),{},{tickCoord:j<0?b.coordinate-j*e:b.coordinate})}else l[y]=b=Dt(Dt({},b),{},{tickCoord:b.coordinate});var A=hd(e,b.tickCoord,x,s,u);A&&(s=b.tickCoord+e*(x()/2+a),l[y]=Dt(Dt({},b),{},{isShow:!0}))},v=0;v=2?It(a[1].coordinate-a[0].coordinate):1,m=Bre(i,v,p);return s==="equidistantPreserveStart"?Ire(v,m,g,a,l):(s==="preserveStart"||s==="preserveStartEnd"?h=Yre(v,m,g,a,l,s==="preserveStartEnd"):h=Gre(v,m,g,a,l),h.filter(function(y){return y.isShow}))}var Vre=["viewBox"],Kre=["viewBox"],Xre=["ticks"];function ql(e){"@babel/helpers - typeof";return ql=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ql(e)}function Qi(){return Qi=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Wre(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Zre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jj(e,t){for(var n=0;n0?s(this.props):s(p)),l<=0||o<=0||!S||!S.length?null:M.createElement(Ee,{className:he("recharts-cartesian-axis",u),ref:function(v){r.layerReference=v}},i&&this.renderAxisLine(),this.renderTicks(S,this.state.fontSize,this.state.letterSpacing),St.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,a,i){var l,o=he(a.className,"recharts-cartesian-axis-tick-value");return M.isValidElement(r)?l=M.cloneElement(r,ft(ft({},a),{},{className:o})):ie(r)?l=r(ft(ft({},a),{},{className:o})):l=M.createElement(hi,Qi({},a,{className:"recharts-cartesian-axis-tick-value"}),i),l}}])}(O.Component);h0(Lh,"displayName","CartesianAxis");h0(Lh,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});function Gl(e){"@babel/helpers - typeof";return Gl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gl(e)}function aae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iae(e,t){for(var n=0;n