1&&($=!0),M.subtract(a,e),P.subtract(a,e),{rawValue:n,wholeValue:a,decimalValue:r?l:0,isSmallest:r,isLargest:i,type:e,tokenLength:u.length}}));var Se=B?Math.floor:Math.round,Te=function(e,t){var n=Math.pow(10,t);return Se(e*n)/n},Oe=!1,_e=!1,xe=function(e,t){var n={useGrouping:A,groupingSeparator:ne,decimalSeparator:re,grouping:oe,useToLocaleString:te};return K&&(Y<=0?(e.rawValue=0,e.wholeValue=0,e.decimalValue=0):(n.maximumSignificantDigits=Y,e.significantDigits=Y)),ee&&!_e&&(e.isLargest?(e.wholeValue=Z,e.decimalValue=0):(e.wholeValue=0,e.decimalValue=0)),X&&!_e&&(e.isSmallest?(e.wholeValue=Q,e.decimalValue=0):(e.wholeValue=0,e.decimalValue=0)),e.isSmallest||e.significantDigits&&e.significantDigits-e.wholeValue.toString().length<=0?W<0?e.value=Te(e.wholeValue,W):0===W?e.value=Se(e.wholeValue+e.decimalValue):K?(e.value=B?Te(e.rawValue,Y-e.wholeValue.toString().length):e.rawValue,e.wholeValue&&(Y-=e.wholeValue.toString().length)):(n.fractionDigits=W,e.value=B?e.wholeValue+Te(e.decimalValue,W):e.wholeValue+e.decimalValue):K&&e.wholeValue?(e.value=Math.round(Te(e.wholeValue,e.significantDigits-e.wholeValue.toString().length)),Y-=e.wholeValue.toString().length):e.value=e.wholeValue,e.tokenLength>1&&($||Oe)&&(n.minimumIntegerDigits=e.tokenLength,_e&&n.maximumSignificantDigits0||\"\"===ie||h(G,e.type)||h(N,e.type))&&(Oe=!0),e.formattedValue=c(e.value,n,q),n.useGrouping=!1,n.decimalSeparator=\".\",e.formattedValueEn=c(e.value,n,\"en\"),2===e.tokenLength&&\"milliseconds\"===e.type&&(e.formattedValueMS=c(e.value,{minimumIntegerDigits:3,useGrouping:!1},\"en\").slice(0,2)),e};if((we=w(we=v(we,xe))).length>1){var Ve=function(e){return h(we,(function(t){return t.type===e}))},De=function(e){var t=Ve(e.type);t&&d(e.targets,(function(e){var n=Ve(e.type);n&&parseInt(t.formattedValueEn,10)===e.value&&(t.rawValue=0,t.wholeValue=0,t.decimalValue=0,n.rawValue+=1,n.wholeValue+=1,n.decimalValue=0,n.formattedValueEn=n.wholeValue.toString(),_e=!0)}))};d(a,De)}return _e&&(Oe=!1,Y=J,we=w(we=v(we,xe))),!N||ee&&!o.trim?(pe&&(we=O(we,(function(e){return!e.isSmallest&&!e.wholeValue&&!h(G,e.type)}))),R&&we.length&&(we=we.slice(0,R)),ge&&we.length>1&&(we=_(we,(function(e){return!e.wholeValue&&!h(G,e.type)&&!e.isLargest}))),ye&&(we=w(we=v(we,(function(e,t){return t>0&&t \",ee=!1,X=!1),j&&(t.value>0||\"\"===ie||h(G,t.type)||h(N,t.type))&&(n+=\"-\",j=!1),\"milliseconds\"===e.type&&t.formattedValueMS?n+=t.formattedValueMS:n+=t.formattedValue,z||(n+=e.text),n}))).join(\"\").replace(/(,| |:|\\.)*$/,\"\").replace(/^(,| |:|\\.)*/,\"\"))}function L(){var e=this.duration,t=function(t){return e._data[t]},n=h(this.types,t),r=function(e,t){for(var n=e.length;n-=1;)if(t(e[n]))return e[n]}(this.types,t);switch(n){case\"milliseconds\":return\"S __\";case\"seconds\":case\"minutes\":return\"*_MS_\";case\"hours\":return\"_HMS_\";case\"days\":if(n===r)return\"d __\";case\"weeks\":return n===r?\"w __\":(null===this.trim&&(this.trim=\"both\"),\"w __, d __, h __\");case\"months\":if(n===r)return\"M __\";case\"years\":return n===r?\"y __\":(null===this.trim&&(this.trim=\"both\"),\"y __, M __, d __\");default:return null===this.trim&&(this.trim=\"both\"),\"y __, d __, h __, m __, s __\"}}function F(e){if(!e)throw\"Moment Duration Format init cannot find moment instance.\";e.duration.format=k,e.duration.fn.format=E,e.duration.fn.format.defaults={trim:null,stopTrim:null,largest:null,maxValue:null,minValue:null,precision:0,trunc:!1,forceLength:null,userLocale:null,usePlural:!0,useLeftUnits:!1,useGrouping:!0,useSignificantDigits:!1,template:L,useToLocaleString:!0,groupingSeparator:\",\",decimalSeparator:\".\",grouping:[3]},e.updateLocale(\"en\",p)}var I=function(e,t,n){return e.toLocaleString(t,n)};t=function(){try{(0).toLocaleString(\"i\")}catch(e){return\"RangeError\"===e.name}return!1}()&&P(I),n=t&&M(I);var N=function(e,t,n){if(\"undefined\"!=typeof window&&window&&window.Intl&&window.Intl.NumberFormat)return window.Intl.NumberFormat(t,n).format(e)};return r=P(N),o=r&&M(N),F(e),F},o=[n(1)],void 0===(i=\"function\"==typeof(r=l)?r.apply(t,o):r)||(e.exports=i),a&&(a.momentDurationFormatSetup=a.moment?l(a.moment):l)},function(e,t,n){\"use strict\";n.r(t),n.d(t,\"default\",(function(){return _}));var r=n(2),o=n.n(r),i=n(0),a=n.n(i),l=n(1),u=n.n(l);n(5);function s(e){return(s=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e})(e)}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r =0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r =0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function m(e,t){for(var n=0;n 0&&void 0!==arguments[0]?arguments[0]:6e4;n.clearPooledTimer(),n.pooledTimer=setInterval((function(){n.pooledElements.forEach((function(e){0!==e.props.interval&&e.update()}))}),e)}},{key:\"clearPooledTimer\",value:function(){n.pooledTimer&&(clearInterval(n.pooledTimer),n.pooledTimer=null,n.pooledElements=[])}},{key:\"pushPooledElement\",value:function(e){e instanceof n?-1===n.pooledElements.indexOf(e)&&n.pooledElements.push(e):console.error(\"Element not an instance of Moment.\")}},{key:\"removePooledElement\",value:function(e){var t=n.pooledElements.indexOf(e);-1!==t&&n.pooledElements.splice(t,1)}},{key:\"getDatetime\",value:function(e){var t=e.utc,r=e.unix,o=e.date,i=e.locale,a=e.parse,l=e.tz,u=e.local;o=o||e.children,a=a||n.globalParse,u=u||n.globalLocal,l=l||n.globalTimezone,i=n.globalLocale?n.globalLocale:i||n.globalMoment.locale();var s=null;return s=t?n.globalMoment.utc(o,a,i):r?n.globalMoment(1e3*o,a,i):n.globalMoment(o,a,i),l?s=s.tz(l):u&&(s=s.local()),s}},{key:\"getContent\",value:function(e){var t=e.fromNow,r=e.fromNowDuring,o=e.from,i=e.add,a=e.subtract,l=e.toNow,s=e.to,c=e.ago,f=e.calendar,m=e.diff,p=e.duration,g=e.durationFromNow,y=e.unit,h=e.decimal,d=e.trim,v=e.format;v=v||n.globalFormat;var b=n.getDatetime(e);i&&b.add(i),a&&b.subtract(a);var w=Boolean(r)&&-b.diff(u()()) \"u\")return;let t=document.head||document.getElementsByTagName(\"head\")[0],r=document.createElement(\"style\");r.type=\"text/css\",n===\"top\"&&t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}V(`.rmsc{--rmsc-main: #4285f4;--rmsc-hover: #f1f3f5;--rmsc-selected: #e2e6ea;--rmsc-border: #ccc;--rmsc-gray: #aaa;--rmsc-bg: #fff;--rmsc-p: 10px;--rmsc-radius: 4px;--rmsc-h: 38px}.rmsc *{box-sizing:border-box;transition:all .2s ease}.rmsc .gray{color:var(--rmsc-gray)}.rmsc .dropdown-content{position:absolute;z-index:1;top:100%;width:100%;padding-top:8px}.rmsc .dropdown-content .panel-content{overflow:hidden;border-radius:var(--rmsc-radius);background:var(--rmsc-bg);box-shadow:0 0 0 1px #0000001a,0 4px 11px #0000001a}.rmsc .dropdown-container{position:relative;outline:0;background-color:var(--rmsc-bg);border:1px solid var(--rmsc-border);border-radius:var(--rmsc-radius)}.rmsc .dropdown-container[aria-disabled=true]:focus-within{box-shadow:var(--rmsc-gray) 0 0 0 1px;border-color:var(--rmsc-gray)}.rmsc .dropdown-container:focus-within{box-shadow:var(--rmsc-main) 0 0 0 1px;border-color:var(--rmsc-main)}.rmsc .dropdown-heading{position:relative;padding:0 var(--rmsc-p);display:flex;align-items:center;width:100%;height:var(--rmsc-h);cursor:default;outline:0}.rmsc .dropdown-heading .dropdown-heading-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1}.rmsc .clear-selected-button{cursor:pointer;background:none;border:0;padding:0;display:flex}.rmsc .options{max-height:260px;overflow-y:auto;margin:0;padding-left:0}.rmsc .options li{list-style:none;margin:0}.rmsc .select-item{box-sizing:border-box;cursor:pointer;display:block;padding:var(--rmsc-p);outline-offset:-1px;outline-color:var(--rmsc-primary)}.rmsc .select-item:hover{background:var(--rmsc-hover)}.rmsc .select-item.selected{background:var(--rmsc-selected)}.rmsc .no-options{padding:var(--rmsc-p);text-align:center;color:var(--rmsc-gray)}.rmsc .search{width:100%;position:relative;border-bottom:1px solid var(--rmsc-border)}.rmsc .search input{background:none;height:var(--rmsc-h);padding:0 var(--rmsc-p);width:100%;outline:0;border:0;font-size:1em}.rmsc .search input:focus{background:var(--rmsc-hover)}.rmsc .search-clear-button{cursor:pointer;position:absolute;top:0;right:0;bottom:0;background:none;border:0;padding:0 calc(var(--rmsc-p) / 2)}.rmsc .search-clear-button [hidden]{display:none}.rmsc .item-renderer{display:flex;align-items:baseline}.rmsc .item-renderer input{margin:0 5px 0 0}.rmsc .item-renderer.disabled{opacity:.5}.rmsc .spinner{animation:rotate 2s linear infinite}.rmsc .spinner .path{stroke:var(--rmsc-border);stroke-width:4px;stroke-linecap:round;animation:dash 1.5s ease-in-out infinite}@keyframes rotate{to{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}\n`);import oe,{useEffect as Pe,useState as Ne}from\"react\";import{jsx as Te}from\"react/jsx-runtime\";var Me={allItemsAreSelected:\"All items are selected.\",clearSearch:\"Clear Search\",clearSelected:\"Clear Selected\",noOptions:\"No options\",search:\"Search\",selectAll:\"Select All\",selectAllFiltered:\"Select All (Filtered)\",selectSomeItems:\"Select...\",create:\"Create\"},De={value:[],hasSelectAll:!0,className:\"multi-select\",debounceDuration:200,options:[]},re=oe.createContext({}),ne=({props:e,children:n})=>{let[t,r]=Ne(e.options),a=c=>{var u;return((u=e.overrideStrings)==null?void 0:u[c])||Me[c]};return Pe(()=>{r(e.options)},[e.options]),Te(re.Provider,{value:{t:a,...De,...e,options:t,setOptions:r},children:n})},w=()=>oe.useContext(re);import{useEffect as ye,useRef as Qe,useState as J}from\"react\";import{useEffect as Fe,useRef as Le}from\"react\";function se(e,n){let t=Le(!1);Fe(()=>{t.current?e():t.current=!0},n)}import{useCallback as Ke,useEffect as ae,useMemo as We,useRef as _e}from\"react\";var He={when:!0,eventTypes:[\"keydown\"]};function R(e,n,t){let r=We(()=>Array.isArray(e)?e:[e],[e]),a=Object.assign({},He,t),{when:c,eventTypes:u}=a,b=_e(n),{target:s}=a;ae(()=>{b.current=n});let p=Ke(i=>{r.some(l=>i.key===l||i.code===l)&&b.current(i)},[r]);ae(()=>{if(c&&typeof window<\"u\"){let i=s?s.current:window;return u.forEach(l=>{i&&i.addEventListener(l,p)}),()=>{u.forEach(l=>{i&&i.removeEventListener(l,p)})}}},[c,u,r,s,n])}var f={ARROW_DOWN:\"ArrowDown\",ARROW_UP:\"ArrowUp\",ENTER:\"Enter\",ESCAPE:\"Escape\",SPACE:\"Space\"};import{useCallback as Ge,useEffect as fe,useMemo as he,useRef as Y,useState as F}from\"react\";var le=(e,n)=>{let t;return function(...r){clearTimeout(t),t=setTimeout(()=>{e.apply(null,r)},n)}};function ie(e,n){return n?e.filter(({label:t,value:r})=>t!=null&&r!=null&&t.toLowerCase().includes(n.toLowerCase())):e}import{jsx as ce,jsxs as Be}from\"react/jsx-runtime\";var T=()=>Be(\"svg\",{width:\"24\",height:\"24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"2\",className:\"dropdown-search-clear-icon gray\",children:[ce(\"line\",{x1:\"18\",y1:\"6\",x2:\"6\",y2:\"18\"}),ce(\"line\",{x1:\"6\",y1:\"6\",x2:\"18\",y2:\"18\"})]});import{useRef as $e}from\"react\";import{jsx as de,jsxs as Ve}from\"react/jsx-runtime\";var Ue=({checked:e,option:n,onClick:t,disabled:r})=>Ve(\"div\",{className:`item-renderer ${r?\"disabled\":\"\"}`,children:[de(\"input\",{type:\"checkbox\",onChange:t,checked:e,tabIndex:-1,disabled:r}),de(\"span\",{children:n.label})]}),pe=Ue;import{jsx as me}from\"react/jsx-runtime\";var Ye=({itemRenderer:e=pe,option:n,checked:t,tabIndex:r,disabled:a,onSelectionChanged:c,onClick:u})=>{let b=$e(),s=l=>{p(),l.preventDefault()},p=()=>{a||c(!t)},i=l=>{p(),u(l)};return R([f.ENTER,f.SPACE],s,{target:b}),me(\"label\",{className:`select-item ${t?\"selected\":\"\"}`,role:\"option\",\"aria-selected\":t,tabIndex:r,ref:b,children:me(e,{option:n,checked:t,onClick:i,disabled:a})})},N=Ye;import{Fragment as qe,jsx as $}from\"react/jsx-runtime\";var ze=({options:e,onClick:n,skipIndex:t})=>{let{disabled:r,value:a,onChange:c,ItemRenderer:u}=w(),b=(s,p)=>{r||c(p?[...a,s]:a.filter(i=>i.value!==s.value))};return $(qe,{children:e.map((s,p)=>{let i=p+t;return $(\"li\",{children:$(N,{tabIndex:i,option:s,onSelectionChanged:l=>b(s,l),checked:!!a.find(l=>l.value===s.value),onClick:l=>n(l,i),itemRenderer:u,disabled:s.disabled||r})},(s==null?void 0:s.key)||p)})})},ue=ze;import{jsx as k,jsxs as z}from\"react/jsx-runtime\";var Je=()=>{let{t:e,onChange:n,options:t,setOptions:r,value:a,filterOptions:c,ItemRenderer:u,disabled:b,disableSearch:s,hasSelectAll:p,ClearIcon:i,debounceDuration:l,isCreatable:L,onCreateOption:y}=w(),O=Y(),g=Y(),[m,M]=F(\"\"),[v,K]=F(t),[x,D]=F(\"\"),[E,I]=F(0),W=Ge(le(o=>D(o),l),[]),A=he(()=>{let o=0;return s||(o+=1),p&&(o+=1),o},[s,p]),_={label:e(m?\"selectAllFiltered\":\"selectAll\"),value:\"\"},H=o=>{let d=v.filter(C=>!C.disabled).map(C=>C.value);if(o){let Ae=[...a.map(U=>U.value),...d];return(c?v:t).filter(U=>Ae.includes(U.value))}return a.filter(C=>!d.includes(C.value))},B=o=>{let d=H(o);n(d)},h=o=>{W(o.target.value),M(o.target.value),I(0)},P=()=>{var o;D(\"\"),M(\"\"),(o=g==null?void 0:g.current)==null||o.focus()},Z=o=>I(o),we=o=>{switch(o.code){case f.ARROW_UP:ee(-1);break;case f.ARROW_DOWN:ee(1);break;default:return}o.stopPropagation(),o.preventDefault()};R([f.ARROW_DOWN,f.ARROW_UP],we,{target:O});let Oe=()=>{I(0)},j=async()=>{let o={label:m,value:m,__isNew__:!0};y&&(o=await y(m)),r([o,...t]),P(),n([...a,o])},Re=async()=>c?await c(t,x):ie(t,x),ee=o=>{let d=E+o;d=Math.max(0,d),d=Math.min(d,t.length+Math.max(A-1,0)),I(d)};fe(()=>{var o,d;(d=(o=O==null?void 0:O.current)==null?void 0:o.querySelector(`[tabIndex='${E}']`))==null||d.focus()},[E]);let[ke,Ee]=he(()=>{let o=v.filter(d=>!d.disabled);return[o.every(d=>a.findIndex(C=>C.value===d.value)!==-1),o.length!==0]},[v,a]);fe(()=>{Re().then(K)},[x,t]);let te=Y();R([f.ENTER],j,{target:te});let Ie=L&&m&&!v.some(o=>(o==null?void 0:o.value)===m);return z(\"div\",{className:\"select-panel\",role:\"listbox\",ref:O,children:[!s&&z(\"div\",{className:\"search\",children:[k(\"input\",{placeholder:e(\"search\"),type:\"text\",\"aria-describedby\":e(\"search\"),onChange:h,onFocus:Oe,value:m,ref:g,tabIndex:0}),k(\"button\",{type:\"button\",className:\"search-clear-button\",hidden:!m,onClick:P,\"aria-label\":e(\"clearSearch\"),children:i||k(T,{})})]}),z(\"ul\",{className:\"options\",children:[p&&Ee&&k(N,{tabIndex:A===1?0:1,checked:ke,option:_,onSelectionChanged:B,onClick:()=>Z(1),itemRenderer:u,disabled:b}),v.length?k(ue,{skipIndex:A,options:v,onClick:(o,d)=>Z(d)}):Ie?k(\"li\",{onClick:j,className:\"select-item creatable\",tabIndex:1,ref:te,children:`${e(\"create\")} \"${m}\"`}):k(\"li\",{className:\"no-options\",children:e(\"noOptions\")})]})]})},q=Je;import{jsx as be}from\"react/jsx-runtime\";var ge=({expanded:e})=>be(\"svg\",{width:\"24\",height:\"24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"2\",className:\"dropdown-heading-dropdown-arrow gray\",children:be(\"path\",{d:e?\"M18 15 12 9 6 15\":\"M6 9L12 15 18 9\"})});import{jsx as ve}from\"react/jsx-runtime\";var xe=()=>{let{t:e,value:n,options:t,valueRenderer:r}=w(),a=n.length===0,c=n.length===t.length,u=r&&r(n,t);return a?ve(\"span\",{className:\"gray\",children:u||e(\"selectSomeItems\")}):ve(\"span\",{children:u||(c?e(\"allItemsAreSelected\"):(()=>n.map(s=>s.label).join(\", \"))())})};import{jsx as G}from\"react/jsx-runtime\";var Se=({size:e=24})=>G(\"span\",{style:{width:e,marginRight:\"0.2rem\"},children:G(\"svg\",{width:e,height:e,className:\"spinner\",viewBox:\"0 0 50 50\",style:{display:\"inline\",verticalAlign:\"middle\"},children:G(\"circle\",{cx:\"25\",cy:\"25\",r:\"20\",fill:\"none\",className:\"path\"})})});import{jsx as S,jsxs as Ce}from\"react/jsx-runtime\";var Xe=()=>{let{t:e,onMenuToggle:n,ArrowRenderer:t,shouldToggleOnHover:r,isLoading:a,disabled:c,onChange:u,labelledBy:b,value:s,isOpen:p,defaultIsOpen:i,ClearSelectedIcon:l,closeOnChangedValue:L}=w();ye(()=>{L&&m(!1)},[s]);let[y,O]=J(!0),[g,m]=J(i),[M,v]=J(!1),K=t||ge,x=Qe();se(()=>{n&&n(g)},[g]),ye(()=>{i===void 0&&typeof p==\"boolean\"&&(O(!1),m(p))},[p]);let D=h=>{var P;[\"text\",\"button\"].includes(h.target.type)&&[f.SPACE,f.ENTER].includes(h.code)||(y&&(h.code===f.ESCAPE?(m(!1),(P=x==null?void 0:x.current)==null||P.focus()):m(!0)),h.preventDefault())};R([f.ENTER,f.ARROW_DOWN,f.SPACE,f.ESCAPE],D,{target:x});let E=h=>{y&&r&&m(h)},I=()=>!M&&v(!0),W=h=>{!h.currentTarget.contains(h.relatedTarget)&&y&&(v(!1),m(!1))},A=()=>E(!0),_=()=>E(!1),H=()=>{y&&m(a||c?!1:!g)},B=h=>{h.stopPropagation(),u([]),y&&m(!1)};return Ce(\"div\",{tabIndex:0,className:\"dropdown-container\",\"aria-labelledby\":b,\"aria-expanded\":g,\"aria-readonly\":!0,\"aria-disabled\":c,ref:x,onFocus:I,onBlur:W,onMouseEnter:A,onMouseLeave:_,children:[Ce(\"div\",{className:\"dropdown-heading\",onClick:H,children:[S(\"div\",{className:\"dropdown-heading-value\",children:S(xe,{})}),a&&S(Se,{}),s.length>0&&l!==null&&S(\"button\",{type:\"button\",className:\"clear-selected-button\",onClick:B,disabled:c,\"aria-label\":e(\"clearSelected\"),children:l||S(T,{})}),S(K,{expanded:g})]}),g&&S(\"div\",{className:\"dropdown-content\",children:S(\"div\",{className:\"panel-content\",children:S(q,{})})})]})},Q=Xe;import{jsx as X}from\"react/jsx-runtime\";var Ze=e=>X(ne,{props:e,children:X(\"div\",{className:`rmsc ${e.className||\"multi-select\"}`,children:X(Q,{})})}),je=Ze;export{Q as Dropdown,je as MultiSelect,N as SelectItem,q as SelectPanel};\n","/**\n * react-number-format - 4.9.4\n * Author : Sudhanshu Yadav\n * Copyright (c) 2016, 2022 to Sudhanshu Yadav, released under the MIT license.\n * https://github.com/s-yadav/react-number-format\n */\n\nimport React from 'react';\n\n// \n\n \n\n// basic noop function\nfunction noop() {}\nfunction returnTrue() {\n return true;\n}\n\nfunction charIsNumber(char ) {\n return !!(char || '').match(/\\d/);\n}\n\nfunction isNil(val ) {\n return val === null || val === undefined;\n}\n\nfunction escapeRegExp(str ) {\n return str.replace(/[-[\\]/{}()*+?.\\\\^$|]/g, '\\\\$&');\n}\n\nfunction getThousandsGroupRegex(thousandsGroupStyle ) {\n switch (thousandsGroupStyle) {\n case 'lakh':\n return /(\\d+?)(?=(\\d\\d)+(\\d)(?!\\d))(\\.\\d+)?/g;\n case 'wan':\n return /(\\d)(?=(\\d{4})+(?!\\d))/g;\n case 'thousand':\n default:\n return /(\\d)(?=(\\d{3})+(?!\\d))/g;\n }\n}\n\nfunction applyThousandSeparator(\n str ,\n thousandSeparator ,\n thousandsGroupStyle \n) {\n var thousandsGroupRegex = getThousandsGroupRegex(thousandsGroupStyle);\n var index = str.search(/[1-9]/);\n index = index === -1 ? str.length : index;\n return (\n str.substring(0, index) +\n str.substring(index, str.length).replace(thousandsGroupRegex, '$1' + thousandSeparator)\n );\n}\n\n//spilt a float number into different parts beforeDecimal, afterDecimal, and negation\nfunction splitDecimal(numStr , allowNegative) {\n if ( allowNegative === void 0 ) allowNegative = true;\n\n var hasNagation = numStr[0] === '-';\n var addNegation = hasNagation && allowNegative;\n numStr = numStr.replace('-', '');\n\n var parts = numStr.split('.');\n var beforeDecimal = parts[0];\n var afterDecimal = parts[1] || '';\n\n return {\n beforeDecimal: beforeDecimal,\n afterDecimal: afterDecimal,\n hasNagation: hasNagation,\n addNegation: addNegation,\n };\n}\n\nfunction fixLeadingZero(numStr ) {\n if (!numStr) { return numStr; }\n var isNegative = numStr[0] === '-';\n if (isNegative) { numStr = numStr.substring(1, numStr.length); }\n var parts = numStr.split('.');\n var beforeDecimal = parts[0].replace(/^0+/, '') || '0';\n var afterDecimal = parts[1] || '';\n\n return (\"\" + (isNegative ? '-' : '') + beforeDecimal + (afterDecimal ? (\".\" + afterDecimal) : ''));\n}\n\n/**\n * limit decimal numbers to given scale\n * Not used .fixedTo because that will break with big numbers\n */\nfunction limitToScale(numStr , scale , fixedDecimalScale ) {\n var str = '';\n var filler = fixedDecimalScale ? '0' : '';\n for (var i = 0; i <= scale - 1; i++) {\n str += numStr[i] || filler;\n }\n return str;\n}\n\nfunction repeat(str, count) {\n return Array(count + 1).join(str);\n}\n\nfunction toNumericString(num) {\n num += ''; // typecast number to string\n\n // store the sign and remove it from the number.\n var sign = num[0] === '-' ? '-' : '';\n if (sign) { num = num.substring(1); }\n\n // split the number into cofficient and exponent\n var ref = num.split(/[eE]/g);\n var coefficient = ref[0];\n var exponent = ref[1];\n\n // covert exponent to number;\n exponent = Number(exponent);\n\n // if there is no exponent part or its 0, return the coffiecient with sign\n if (!exponent) { return sign + coefficient; }\n\n coefficient = coefficient.replace('.', '');\n\n /**\n * for scientific notation the current decimal index will be after first number (index 0)\n * So effective decimal index will always be 1 + exponent value\n */\n var decimalIndex = 1 + exponent;\n\n var coffiecientLn = coefficient.length;\n\n if (decimalIndex < 0) {\n // if decimal index is less then 0 add preceding 0s\n // add 1 as join will have\n coefficient = '0.' + repeat('0', Math.abs(decimalIndex)) + coefficient;\n } else if (decimalIndex >= coffiecientLn) {\n // if decimal index is less then 0 add leading 0s\n coefficient = coefficient + repeat('0', decimalIndex - coffiecientLn);\n } else {\n // else add decimal point at proper index\n coefficient =\n (coefficient.substring(0, decimalIndex) || '0') + '.' + coefficient.substring(decimalIndex);\n }\n\n return sign + coefficient;\n}\n\n/**\n * This method is required to round prop value to given scale.\n * Not used .round or .fixedTo because that will break with big numbers\n */\nfunction roundToPrecision(numStr , scale , fixedDecimalScale ) {\n //if number is empty don't do anything return empty string\n if (['', '-'].indexOf(numStr) !== -1) { return numStr; }\n\n var shoudHaveDecimalSeparator = numStr.indexOf('.') !== -1 && scale;\n var ref = splitDecimal(numStr);\n var beforeDecimal = ref.beforeDecimal;\n var afterDecimal = ref.afterDecimal;\n var hasNagation = ref.hasNagation;\n var floatValue = parseFloat((\"0.\" + (afterDecimal || '0')));\n var floatValueStr =\n afterDecimal.length <= scale ? (\"0.\" + afterDecimal) : floatValue.toFixed(scale);\n var roundedDecimalParts = floatValueStr.split('.');\n var intPart = beforeDecimal\n .split('')\n .reverse()\n .reduce(function (roundedStr, current, idx) {\n if (roundedStr.length > idx) {\n return (\n (Number(roundedStr[0]) + Number(current)).toString() +\n roundedStr.substring(1, roundedStr.length)\n );\n }\n return current + roundedStr;\n }, roundedDecimalParts[0]);\n\n var decimalPart = limitToScale(\n roundedDecimalParts[1] || '',\n Math.min(scale, afterDecimal.length),\n fixedDecimalScale\n );\n var negation = hasNagation ? '-' : '';\n var decimalSeparator = shoudHaveDecimalSeparator ? '.' : '';\n return (\"\" + negation + intPart + decimalSeparator + decimalPart);\n}\n\n/** set the caret positon in an input field **/\nfunction setCaretPosition(el , caretPos ) {\n el.value = el.value;\n // ^ this is used to not only get 'focus', but\n // to make sure we don't have it everything -selected-\n // (it causes an issue in chrome, and having it doesn't hurt any other browser)\n if (el !== null) {\n if (el.createTextRange) {\n var range = el.createTextRange();\n range.move('character', caretPos);\n range.select();\n return true;\n }\n // (el.selectionStart === 0 added for Firefox bug)\n if (el.selectionStart || el.selectionStart === 0) {\n el.focus();\n el.setSelectionRange(caretPos, caretPos);\n return true;\n }\n\n // fail city, fortunately this never happens (as far as I've tested) :)\n el.focus();\n return false;\n }\n}\n\n/**\n Given previous value and newValue it returns the index\n start - end to which values have changed.\n This function makes assumption about only consecutive\n characters are changed which is correct assumption for caret input.\n*/\nfunction findChangedIndex(prevValue , newValue ) {\n var i = 0,\n j = 0;\n var prevLength = prevValue.length;\n var newLength = newValue.length;\n while (prevValue[i] === newValue[i] && i < prevLength) { i++; }\n\n //check what has been changed from last\n while (\n prevValue[prevLength - 1 - j] === newValue[newLength - 1 - j] &&\n newLength - j > i &&\n prevLength - j > i\n ) {\n j++;\n }\n\n return { start: i, end: prevLength - j };\n}\n\n/*\n Returns a number whose value is limited to the given range\n*/\nfunction clamp(num , min , max ) {\n return Math.min(Math.max(num, min), max);\n}\n\nfunction getCurrentCaretPosition(el ) {\n /*Max of selectionStart and selectionEnd is taken for the patch of pixel and other mobile device caret bug*/\n return Math.max(el.selectionStart, el.selectionEnd);\n}\n\nfunction addInputMode(format ) {\n return (\n format ||\n (typeof navigator !== 'undefined' &&\n !(navigator.platform && /iPhone|iPod/.test(navigator.platform)))\n );\n}\n\n// \nfunction objectWithoutProperties (obj, exclude) { var target = {}; for (var k in obj) if (Object.prototype.hasOwnProperty.call(obj, k) && exclude.indexOf(k) === -1) target[k] = obj[k]; return target; }\n\nvar defaultProps = {\n displayType: 'input',\n decimalSeparator: '.',\n thousandsGroupStyle: 'thousand',\n fixedDecimalScale: false,\n prefix: '',\n suffix: '',\n allowNegative: true,\n allowEmptyFormatting: false,\n allowLeadingZeros: false,\n isNumericString: false,\n type: 'text',\n onValueChange: noop,\n onChange: noop,\n onKeyDown: noop,\n onMouseUp: noop,\n onFocus: noop,\n onBlur: noop,\n isAllowed: returnTrue,\n};\nvar NumberFormat = /*@__PURE__*/(function (superclass) {\n function NumberFormat(props ) {\n superclass.call(this, props);\n var defaultValue = props.defaultValue;\n\n //validate props\n this.validateProps();\n\n var formattedValue = this.formatValueProp(defaultValue);\n\n this.state = {\n value: formattedValue,\n numAsString: this.removeFormatting(formattedValue),\n mounted: false,\n };\n\n this.selectionBeforeInput = {\n selectionStart: 0,\n selectionEnd: 0,\n };\n\n this.onChange = this.onChange.bind(this);\n this.onKeyDown = this.onKeyDown.bind(this);\n this.onMouseUp = this.onMouseUp.bind(this);\n this.onFocus = this.onFocus.bind(this);\n this.onBlur = this.onBlur.bind(this);\n }\n\n if ( superclass ) NumberFormat.__proto__ = superclass;\n NumberFormat.prototype = Object.create( superclass && superclass.prototype );\n NumberFormat.prototype.constructor = NumberFormat;\n\n NumberFormat.prototype.componentDidMount = function componentDidMount () {\n // set mounted state\n // eslint-disable-next-line react/no-did-mount-set-state\n this.setState({\n mounted: true,\n });\n };\n\n NumberFormat.prototype.componentDidUpdate = function componentDidUpdate (prevProps ) {\n this.updateValueIfRequired(prevProps);\n };\n\n NumberFormat.prototype.componentWillUnmount = function componentWillUnmount () {\n clearTimeout(this.focusTimeout);\n clearTimeout(this.caretPositionTimeout);\n };\n\n NumberFormat.prototype.updateValueIfRequired = function updateValueIfRequired (prevProps ) {\n var ref = this;\n var props = ref.props;\n var state = ref.state;\n var focusedElm = ref.focusedElm;\n var stateValue = state.value;\n var lastNumStr = state.numAsString; if ( lastNumStr === void 0 ) lastNumStr = '';\n\n // If only state changed no need to do any thing\n if (prevProps !== props) {\n //validate props\n this.validateProps();\n\n var lastValueWithNewFormat = this.formatNumString(lastNumStr);\n\n var formattedValue = isNil(props.value) ? lastValueWithNewFormat : this.formatValueProp();\n var numAsString = this.removeFormatting(formattedValue);\n\n var floatValue = parseFloat(numAsString);\n var lastFloatValue = parseFloat(lastNumStr);\n\n if (\n //while typing set state only when float value changes\n ((!isNaN(floatValue) || !isNaN(lastFloatValue)) && floatValue !== lastFloatValue) ||\n //can also set state when float value is same and the format props changes\n lastValueWithNewFormat !== stateValue ||\n //set state always when not in focus and formatted value is changed\n (focusedElm === null && formattedValue !== stateValue)\n ) {\n this.updateValue({\n formattedValue: formattedValue,\n numAsString: numAsString,\n input: focusedElm,\n source: 'prop',\n event: null,\n });\n }\n }\n };\n\n /** Misc methods **/\n NumberFormat.prototype.getFloatString = function getFloatString (num) {\n if ( num === void 0 ) num = '';\n\n var ref = this.props;\n var decimalScale = ref.decimalScale;\n var ref$1 = this.getSeparators();\n var decimalSeparator = ref$1.decimalSeparator;\n var numRegex = this.getNumberRegex(true);\n\n //remove negation for regex check\n var hasNegation = num[0] === '-';\n if (hasNegation) { num = num.replace('-', ''); }\n\n //if decimal scale is zero remove decimal and number after decimalSeparator\n if (decimalSeparator && decimalScale === 0) {\n num = num.split(decimalSeparator)[0];\n }\n\n num = (num.match(numRegex) || []).join('').replace(decimalSeparator, '.');\n\n //remove extra decimals\n var firstDecimalIndex = num.indexOf('.');\n\n if (firstDecimalIndex !== -1) {\n num = (num.substring(0, firstDecimalIndex)) + \".\" + (num\n .substring(firstDecimalIndex + 1, num.length)\n .replace(new RegExp(escapeRegExp(decimalSeparator), 'g'), ''));\n }\n\n //add negation back\n if (hasNegation) { num = '-' + num; }\n\n return num;\n };\n\n //returned regex assumes decimalSeparator is as per prop\n NumberFormat.prototype.getNumberRegex = function getNumberRegex (g , ignoreDecimalSeparator ) {\n var ref = this.props;\n var format = ref.format;\n var decimalScale = ref.decimalScale;\n var customNumerals = ref.customNumerals;\n var ref$1 = this.getSeparators();\n var decimalSeparator = ref$1.decimalSeparator;\n return new RegExp(\n '[0-9' +\n (customNumerals ? customNumerals.join('') : '') +\n ']' +\n (decimalSeparator && decimalScale !== 0 && !ignoreDecimalSeparator && !format\n ? '|' + escapeRegExp(decimalSeparator)\n : ''),\n g ? 'g' : undefined\n );\n };\n\n NumberFormat.prototype.getSeparators = function getSeparators () {\n var ref = this.props;\n var decimalSeparator = ref.decimalSeparator;\n var ref$1 = this.props;\n var thousandSeparator = ref$1.thousandSeparator;\n var allowedDecimalSeparators = ref$1.allowedDecimalSeparators;\n\n if (thousandSeparator === true) {\n thousandSeparator = ',';\n }\n if (!allowedDecimalSeparators) {\n allowedDecimalSeparators = [decimalSeparator, '.'];\n }\n\n return {\n decimalSeparator: decimalSeparator,\n thousandSeparator: thousandSeparator,\n allowedDecimalSeparators: allowedDecimalSeparators,\n };\n };\n\n NumberFormat.prototype.getMaskAtIndex = function getMaskAtIndex (index ) {\n var ref = this.props;\n var mask = ref.mask; if ( mask === void 0 ) mask = ' ';\n if (typeof mask === 'string') {\n return mask;\n }\n\n return mask[index] || ' ';\n };\n\n NumberFormat.prototype.getValueObject = function getValueObject (formattedValue , numAsString ) {\n var floatValue = parseFloat(numAsString);\n\n return {\n formattedValue: formattedValue,\n value: numAsString,\n floatValue: isNaN(floatValue) ? undefined : floatValue,\n };\n };\n\n NumberFormat.prototype.validateProps = function validateProps () {\n var ref = this.props;\n var mask = ref.mask;\n\n //validate decimalSeparator and thousandSeparator\n var ref$1 = this.getSeparators();\n var decimalSeparator = ref$1.decimalSeparator;\n var thousandSeparator = ref$1.thousandSeparator;\n\n if (decimalSeparator === thousandSeparator) {\n throw new Error((\"\\n Decimal separator can't be same as thousand separator.\\n thousandSeparator: \" + thousandSeparator + \" (thousandSeparator = {true} is same as thousandSeparator = \\\",\\\")\\n decimalSeparator: \" + decimalSeparator + \" (default value for decimalSeparator is .)\\n \"));\n }\n\n //validate mask\n if (mask) {\n var maskAsStr = mask === 'string' ? mask : mask.toString();\n if (maskAsStr.match(/\\d/g)) {\n throw new Error((\"\\n Mask \" + mask + \" should not contain numeric character;\\n \"));\n }\n }\n };\n /** Misc methods end **/\n\n /** caret specific methods **/\n NumberFormat.prototype.setPatchedCaretPosition = function setPatchedCaretPosition (el , caretPos , currentValue ) {\n /* setting caret position within timeout of 0ms is required for mobile chrome,\n otherwise browser resets the caret position after we set it\n We are also setting it without timeout so that in normal browser we don't see the flickering */\n setCaretPosition(el, caretPos);\n this.caretPositionTimeout = setTimeout(function () {\n if (el.value === currentValue) { setCaretPosition(el, caretPos); }\n }, 0);\n };\n\n /* This keeps the caret within typing area so people can't type in between prefix or suffix */\n NumberFormat.prototype.correctCaretPosition = function correctCaretPosition (value , caretPos , direction ) {\n var ref = this.props;\n var prefix = ref.prefix;\n var suffix = ref.suffix;\n var format = ref.format;\n\n //if value is empty return 0\n if (value === '') { return 0; }\n\n //caret position should be between 0 and value length\n caretPos = clamp(caretPos, 0, value.length);\n\n //in case of format as number limit between prefix and suffix\n if (!format) {\n var hasNegation = value[0] === '-';\n return clamp(caretPos, prefix.length + (hasNegation ? 1 : 0), value.length - suffix.length);\n }\n\n //in case if custom format method don't do anything\n if (typeof format === 'function') { return caretPos; }\n\n /* in case format is string find the closest # position from the caret position */\n\n //in case the caretPos have input value on it don't do anything\n if (format[caretPos] === '#' && charIsNumber(value[caretPos])) {\n return caretPos;\n }\n\n //if caretPos is just after input value don't do anything\n if (format[caretPos - 1] === '#' && charIsNumber(value[caretPos - 1])) {\n return caretPos;\n }\n\n //find the nearest caret position\n var firstHashPosition = format.indexOf('#');\n var lastHashPosition = format.lastIndexOf('#');\n\n //limit the cursor between the first # position and the last # position\n caretPos = clamp(caretPos, firstHashPosition, lastHashPosition + 1);\n\n var nextPos = format.substring(caretPos, format.length).indexOf('#');\n var caretLeftBound = caretPos;\n var caretRightBound = caretPos + (nextPos === -1 ? 0 : nextPos);\n\n //get the position where the last number is present\n while (\n caretLeftBound > firstHashPosition &&\n (format[caretLeftBound] !== '#' || !charIsNumber(value[caretLeftBound]))\n ) {\n caretLeftBound -= 1;\n }\n\n var goToLeft =\n !charIsNumber(value[caretRightBound]) ||\n (direction === 'left' && caretPos !== firstHashPosition) ||\n caretPos - caretLeftBound < caretRightBound - caretPos;\n\n if (goToLeft) {\n //check if number should be taken after the bound or after it\n //if number preceding a valid number keep it after\n return charIsNumber(value[caretLeftBound]) ? caretLeftBound + 1 : caretLeftBound;\n }\n\n return caretRightBound;\n };\n\n NumberFormat.prototype.getCaretPosition = function getCaretPosition (inputValue , formattedValue , caretPos ) {\n var ref = this.props;\n var format = ref.format;\n var stateValue = this.state.value;\n var numRegex = this.getNumberRegex(true);\n var inputNumber = (inputValue.match(numRegex) || []).join('');\n var formattedNumber = (formattedValue.match(numRegex) || []).join('');\n var j, i;\n\n j = 0;\n\n for (i = 0; i < caretPos; i++) {\n var currentInputChar = inputValue[i] || '';\n var currentFormatChar = formattedValue[j] || '';\n //no need to increase new cursor position if formatted value does not have those characters\n //case inputValue = 1a23 and formattedValue = 123\n if (!currentInputChar.match(numRegex) && currentInputChar !== currentFormatChar) {\n continue;\n }\n\n //When we are striping out leading zeros maintain the new cursor position\n //Case inputValue = 00023 and formattedValue = 23;\n if (\n currentInputChar === '0' &&\n currentFormatChar.match(numRegex) &&\n currentFormatChar !== '0' &&\n inputNumber.length !== formattedNumber.length\n ) {\n continue;\n }\n\n //we are not using currentFormatChar because j can change here\n while (currentInputChar !== formattedValue[j] && j < formattedValue.length) {\n j++;\n }\n j++;\n }\n\n if (typeof format === 'string' && !stateValue) {\n //set it to the maximum value so it goes after the last number\n j = formattedValue.length;\n }\n\n //correct caret position if its outside of editable area\n j = this.correctCaretPosition(formattedValue, j);\n\n return j;\n };\n /** caret specific methods ends **/\n\n /** methods to remove formattting **/\n NumberFormat.prototype.removePrefixAndSuffix = function removePrefixAndSuffix (val ) {\n var ref = this.props;\n var format = ref.format;\n var prefix = ref.prefix;\n var suffix = ref.suffix;\n\n //remove prefix and suffix\n if (!format && val) {\n var isNegative = val[0] === '-';\n\n //remove negation sign\n if (isNegative) { val = val.substring(1, val.length); }\n\n //remove prefix\n val = prefix && val.indexOf(prefix) === 0 ? val.substring(prefix.length, val.length) : val;\n\n //remove suffix\n var suffixLastIndex = val.lastIndexOf(suffix);\n val =\n suffix && suffixLastIndex !== -1 && suffixLastIndex === val.length - suffix.length\n ? val.substring(0, suffixLastIndex)\n : val;\n\n //add negation sign back\n if (isNegative) { val = '-' + val; }\n }\n\n return val;\n };\n\n NumberFormat.prototype.removePatternFormatting = function removePatternFormatting (val ) {\n var ref = this.props;\n var format = ref.format;\n var formatArray = format.split('#').filter(function (str) { return str !== ''; });\n var start = 0;\n var numStr = '';\n\n for (var i = 0, ln = formatArray.length; i <= ln; i++) {\n var part = formatArray[i] || '';\n\n //if i is the last fragment take the index of end of the value\n //For case like +1 (911) 911 91 91 having pattern +1 (###) ### ## ##\n var index = i === ln ? val.length : val.indexOf(part, start);\n\n /* in any case if we don't find the pattern part in the value assume the val as numeric string\n This will be also in case if user has started typing, in any other case it will not be -1\n unless wrong prop value is provided */\n if (index === -1) {\n numStr = val;\n break;\n } else {\n numStr += val.substring(start, index);\n start = index + part.length;\n }\n }\n\n return (numStr.match(this.getNumberRegex(true)) || []).join('');\n };\n\n NumberFormat.prototype.removeFormatting = function removeFormatting (val ) {\n var ref = this.props;\n var format = ref.format;\n var removeFormatting = ref.removeFormatting;\n if (!val) { return val; }\n\n if (!format) {\n val = this.removePrefixAndSuffix(val);\n val = this.getFloatString(val);\n } else if (typeof format === 'string') {\n val = this.removePatternFormatting(val);\n } else if (typeof removeFormatting === 'function') {\n //condition need to be handled if format method is provide,\n val = removeFormatting(val);\n } else {\n val = (val.match(this.getNumberRegex(true)) || []).join('');\n }\n return val;\n };\n /** methods to remove formattting end **/\n\n /*** format specific methods start ***/\n /**\n * Format when # based string is provided\n * @param {string} numStr Numeric String\n * @return {string} formatted Value\n */\n NumberFormat.prototype.formatWithPattern = function formatWithPattern (numStr ) {\n var ref = this.props;\n var format = ref.format;\n var hashCount = 0;\n var formattedNumberAry = format.split('');\n for (var i = 0, ln = format.length; i < ln; i++) {\n if (format[i] === '#') {\n formattedNumberAry[i] = numStr[hashCount] || this.getMaskAtIndex(hashCount);\n hashCount += 1;\n }\n }\n return formattedNumberAry.join('');\n };\n /**\n * @param {string} numStr Numeric string/floatString] It always have decimalSeparator as .\n * @return {string} formatted Value\n */\n NumberFormat.prototype.formatAsNumber = function formatAsNumber (numStr ) {\n var ref = this.props;\n var decimalScale = ref.decimalScale;\n var fixedDecimalScale = ref.fixedDecimalScale;\n var prefix = ref.prefix;\n var suffix = ref.suffix;\n var allowNegative = ref.allowNegative;\n var thousandsGroupStyle = ref.thousandsGroupStyle;\n var ref$1 = this.getSeparators();\n var thousandSeparator = ref$1.thousandSeparator;\n var decimalSeparator = ref$1.decimalSeparator;\n\n var hasDecimalSeparator = numStr.indexOf('.') !== -1 || (decimalScale && fixedDecimalScale);\n var ref$2 = splitDecimal(numStr, allowNegative);\n var beforeDecimal = ref$2.beforeDecimal;\n var afterDecimal = ref$2.afterDecimal;\n var addNegation = ref$2.addNegation; // eslint-disable-line prefer-const\n\n //apply decimal precision if its defined\n if (decimalScale !== undefined) {\n afterDecimal = limitToScale(afterDecimal, decimalScale, fixedDecimalScale);\n }\n\n if (thousandSeparator) {\n beforeDecimal = applyThousandSeparator(beforeDecimal, thousandSeparator, thousandsGroupStyle);\n }\n\n //add prefix and suffix\n if (prefix) { beforeDecimal = prefix + beforeDecimal; }\n if (suffix) { afterDecimal = afterDecimal + suffix; }\n\n //restore negation sign\n if (addNegation) { beforeDecimal = '-' + beforeDecimal; }\n\n numStr = beforeDecimal + ((hasDecimalSeparator && decimalSeparator) || '') + afterDecimal;\n\n return numStr;\n };\n\n NumberFormat.prototype.formatNumString = function formatNumString (numStr) {\n if ( numStr === void 0 ) numStr = '';\n\n var ref = this.props;\n var format = ref.format;\n var allowEmptyFormatting = ref.allowEmptyFormatting;\n var customNumerals = ref.customNumerals;\n var formattedValue = numStr;\n\n if (customNumerals && customNumerals.length === 10) {\n var customNumeralRegex = new RegExp('[' + customNumerals.join('') + ']', 'g');\n formattedValue = numStr.replace(customNumeralRegex, function (digit) { return customNumerals.indexOf(digit).toString(); }\n );\n }\n\n if (numStr === '' && !allowEmptyFormatting) {\n formattedValue = '';\n } else if (numStr === '-' && !format) {\n formattedValue = '-';\n } else if (typeof format === 'string') {\n formattedValue = this.formatWithPattern(formattedValue);\n } else if (typeof format === 'function') {\n formattedValue = format(formattedValue);\n } else {\n formattedValue = this.formatAsNumber(formattedValue);\n }\n\n return formattedValue;\n };\n\n NumberFormat.prototype.formatValueProp = function formatValueProp (defaultValue ) {\n var ref = this.props;\n var format = ref.format;\n var decimalScale = ref.decimalScale;\n var fixedDecimalScale = ref.fixedDecimalScale;\n var allowEmptyFormatting = ref.allowEmptyFormatting;\n var ref$1 = this.props;\n var value = ref$1.value;\n var isNumericString = ref$1.isNumericString;\n\n // if value is undefined or null, use defaultValue instead\n value = isNil(value) ? defaultValue : value;\n\n var isNonNumericFalsy = !value && value !== 0;\n\n if (isNonNumericFalsy && allowEmptyFormatting) {\n value = '';\n }\n\n // if value is not defined return empty string\n if (isNonNumericFalsy && !allowEmptyFormatting) { return ''; }\n\n if (typeof value === 'number') {\n value = toNumericString(value);\n isNumericString = true;\n }\n\n //change infinity value to empty string\n if (value === 'Infinity' && isNumericString) {\n value = '';\n }\n\n //round the number based on decimalScale\n //format only if non formatted value is provided\n if (isNumericString && !format && typeof decimalScale === 'number') {\n value = roundToPrecision(value, decimalScale, fixedDecimalScale);\n }\n\n var formattedValue = isNumericString ? this.formatNumString(value) : this.formatInput(value);\n\n return formattedValue;\n };\n\n NumberFormat.prototype.formatNegation = function formatNegation (value) {\n if ( value === void 0 ) value = '';\n\n var ref = this.props;\n var allowNegative = ref.allowNegative;\n var negationRegex = new RegExp('(-)');\n var doubleNegationRegex = new RegExp('(-)(.)*(-)');\n\n // Check number has '-' value\n var hasNegation = negationRegex.test(value);\n\n // Check number has 2 or more '-' values\n var removeNegation = doubleNegationRegex.test(value);\n\n //remove negation\n value = value.replace(/-/g, '');\n\n if (hasNegation && !removeNegation && allowNegative) {\n value = '-' + value;\n }\n\n return value;\n };\n\n NumberFormat.prototype.formatInput = function formatInput (value) {\n if ( value === void 0 ) value = '';\n\n var ref = this.props;\n var format = ref.format;\n\n //format negation only if we are formatting as number\n if (!format) {\n value = this.removePrefixAndSuffix(value);\n value = this.formatNegation(value);\n }\n\n //remove formatting from number\n value = this.removeFormatting(value);\n\n return this.formatNumString(value);\n };\n\n /*** format specific methods end ***/\n NumberFormat.prototype.isCharacterAFormat = function isCharacterAFormat (caretPos , value ) {\n var ref = this.props;\n var format = ref.format;\n var prefix = ref.prefix;\n var suffix = ref.suffix;\n var decimalScale = ref.decimalScale;\n var fixedDecimalScale = ref.fixedDecimalScale;\n var ref$1 = this.getSeparators();\n var decimalSeparator = ref$1.decimalSeparator;\n\n //check within format pattern\n if (typeof format === 'string' && format[caretPos] !== '#') { return true; }\n\n //check in number format\n if (\n !format &&\n (caretPos < prefix.length ||\n caretPos >= value.length - suffix.length ||\n (decimalScale && fixedDecimalScale && value[caretPos] === decimalSeparator))\n ) {\n return true;\n }\n\n return false;\n };\n\n /**\n * This will check if any formatting got removed by the delete or backspace and reset the value\n * It will also work as fallback if android chome keyDown handler does not work\n **/\n NumberFormat.prototype.correctInputValue = function correctInputValue (caretPos , lastValue , value ) {\n var this$1 = this;\n\n var ref = this.props;\n var format = ref.format;\n var allowNegative = ref.allowNegative;\n var prefix = ref.prefix;\n var suffix = ref.suffix;\n var decimalScale = ref.decimalScale;\n var ref$1 = this.getSeparators();\n var allowedDecimalSeparators = ref$1.allowedDecimalSeparators;\n var decimalSeparator = ref$1.decimalSeparator;\n var lastNumStr = this.state.numAsString || '';\n var ref$2 = this.selectionBeforeInput;\n var selectionStart = ref$2.selectionStart;\n var selectionEnd = ref$2.selectionEnd;\n var ref$3 = findChangedIndex(lastValue, value);\n var start = ref$3.start;\n var end = ref$3.end;\n\n /** Check for any allowed decimal separator is added in the numeric format and replace it with decimal separator */\n if (\n !format &&\n start === end &&\n allowedDecimalSeparators.indexOf(value[selectionStart]) !== -1\n ) {\n var separator = decimalScale === 0 ? '' : decimalSeparator;\n return (\n value.substr(0, selectionStart) + separator + value.substr(selectionStart + 1, value.length)\n );\n }\n\n var leftBound = !!format ? 0 : prefix.length;\n var rightBound = lastValue.length - (!!format ? 0 : suffix.length);\n\n if (\n // don't do anything if something got added\n value.length > lastValue.length ||\n // or if the new value is an empty string\n !value.length ||\n // or if nothing has changed, in which case start will be same as end\n start === end ||\n // or in case if whole input is selected and new value is typed\n (selectionStart === 0 && selectionEnd === lastValue.length) ||\n // or in case if the whole content is replaced by browser, example (autocomplete)\n (start === 0 && end === lastValue.length) ||\n // or if charcters between prefix and suffix is selected.\n // For numeric inputs we apply the format so, prefix and suffix can be ignored\n (selectionStart === leftBound && selectionEnd === rightBound)\n ) {\n return value;\n }\n\n // check whether the deleted portion has a character that is part of a format\n var deletedValues = lastValue.substr(start, end - start);\n var formatGotDeleted = !![].concat( deletedValues ).find(function (deletedVal, idx) { return this$1.isCharacterAFormat(idx + start, lastValue); }\n );\n\n // if it has, only remove characters that are not part of the format\n if (formatGotDeleted) {\n var deletedValuePortion = lastValue.substr(start);\n var recordIndexOfFormatCharacters = {};\n var resolvedPortion = [];\n [].concat( deletedValuePortion ).forEach(function (currentPortion, idx) {\n if (this$1.isCharacterAFormat(idx + start, lastValue)) {\n recordIndexOfFormatCharacters[idx] = currentPortion;\n } else if (idx > deletedValues.length - 1) {\n resolvedPortion.push(currentPortion);\n }\n });\n\n Object.keys(recordIndexOfFormatCharacters).forEach(function (idx) {\n if (resolvedPortion.length > idx) {\n resolvedPortion.splice(idx, 0, recordIndexOfFormatCharacters[idx]);\n } else {\n resolvedPortion.push(recordIndexOfFormatCharacters[idx]);\n }\n });\n\n value = lastValue.substr(0, start) + resolvedPortion.join('');\n }\n\n //for numbers check if beforeDecimal got deleted and there is nothing after decimal,\n //clear all numbers in such case while keeping the - sign\n if (!format) {\n var numericString = this.removeFormatting(value);\n var ref$4 = splitDecimal(\n numericString,\n allowNegative\n );\n var beforeDecimal = ref$4.beforeDecimal;\n var afterDecimal = ref$4.afterDecimal;\n var addNegation = ref$4.addNegation; // eslint-disable-line prefer-const\n\n //clear only if something got deleted\n var isBeforeDecimalPoint = caretPos < value.indexOf(decimalSeparator) + 1;\n if (\n numericString.length < lastNumStr.length &&\n isBeforeDecimalPoint &&\n beforeDecimal === '' &&\n !parseFloat(afterDecimal)\n ) {\n return addNegation ? '-' : '';\n }\n }\n\n return value;\n };\n\n /** Update value and caret position */\n NumberFormat.prototype.updateValue = function updateValue (params \n \n \n \n \n \n \n \n \n ) {\n var formattedValue = params.formattedValue;\n var input = params.input;\n var setCaretPosition = params.setCaretPosition; if ( setCaretPosition === void 0 ) setCaretPosition = true;\n var source = params.source;\n var event = params.event;\n var numAsString = params.numAsString;\n var caretPos = params.caretPos;\n var ref = this.props;\n var onValueChange = ref.onValueChange;\n var ref$1 = this.state;\n var lastValue = ref$1.value;\n\n if (input) {\n //calculate caret position if not defined\n if (caretPos === undefined && setCaretPosition) {\n var inputValue = params.inputValue || input.value;\n\n var currentCaretPosition = getCurrentCaretPosition(input);\n\n /**\n * set the value imperatively, this is required for IE fix\n * This is also required as if new caret position is beyond the previous value.\n * Caret position will not be set correctly\n */\n input.value = formattedValue;\n\n //get the caret position\n caretPos = this.getCaretPosition(inputValue, formattedValue, currentCaretPosition);\n }\n\n /**\n * set the value imperatively, as we set the caret position as well imperatively.\n * This is to keep value and caret position in sync\n */\n input.value = formattedValue;\n\n //set caret position, and value imperatively when element is provided\n if (setCaretPosition) {\n //set caret position\n this.setPatchedCaretPosition(input, caretPos, formattedValue);\n }\n }\n\n //calculate numeric string if not passed\n if (numAsString === undefined) {\n numAsString = this.removeFormatting(formattedValue);\n }\n\n //update state if value is changed\n if (formattedValue !== lastValue) {\n this.setState({ value: formattedValue, numAsString: numAsString });\n\n // trigger onValueChange synchronously, so parent is updated along with the number format. Fix for #277, #287\n onValueChange(this.getValueObject(formattedValue, numAsString), { event: event, source: source });\n }\n };\n\n NumberFormat.prototype.onChange = function onChange (e ) {\n var el = e.target;\n var inputValue = el.value;\n var ref = this;\n var state = ref.state;\n var props = ref.props;\n var isAllowed = props.isAllowed;\n var lastValue = state.value || '';\n\n var currentCaretPosition = getCurrentCaretPosition(el);\n\n inputValue = this.correctInputValue(currentCaretPosition, lastValue, inputValue);\n\n var formattedValue = this.formatInput(inputValue) || '';\n var numAsString = this.removeFormatting(formattedValue);\n\n var valueObj = this.getValueObject(formattedValue, numAsString);\n var isChangeAllowed = isAllowed(valueObj);\n\n if (!isChangeAllowed) {\n formattedValue = lastValue;\n }\n\n this.updateValue({\n formattedValue: formattedValue,\n numAsString: numAsString,\n inputValue: inputValue,\n input: el,\n event: e,\n source: 'event',\n });\n\n if (isChangeAllowed) {\n props.onChange(e);\n }\n };\n\n NumberFormat.prototype.onBlur = function onBlur (e ) {\n var ref = this;\n var props = ref.props;\n var state = ref.state;\n var format = props.format;\n var onBlur = props.onBlur;\n var allowLeadingZeros = props.allowLeadingZeros;\n var numAsString = state.numAsString;\n var lastValue = state.value;\n this.focusedElm = null;\n\n clearTimeout(this.focusTimeout);\n clearTimeout(this.caretPositionTimeout);\n\n if (!format) {\n // if the numAsString is not a valid number reset it to empty\n if (isNaN(parseFloat(numAsString))) {\n numAsString = '';\n }\n\n if (!allowLeadingZeros) {\n numAsString = fixLeadingZero(numAsString);\n }\n\n var formattedValue = this.formatNumString(numAsString);\n\n //change the state\n if (formattedValue !== lastValue) {\n // the event needs to be persisted because its properties can be accessed in an asynchronous way\n this.updateValue({\n formattedValue: formattedValue,\n numAsString: numAsString,\n input: e.target,\n setCaretPosition: false,\n event: e,\n source: 'event',\n });\n onBlur(e);\n return;\n }\n }\n onBlur(e);\n };\n\n NumberFormat.prototype.onKeyDown = function onKeyDown (e ) {\n var el = e.target;\n var key = e.key;\n var selectionStart = el.selectionStart;\n var selectionEnd = el.selectionEnd;\n var value = el.value; if ( value === void 0 ) value = '';\n var expectedCaretPosition;\n var ref = this.props;\n var decimalScale = ref.decimalScale;\n var fixedDecimalScale = ref.fixedDecimalScale;\n var prefix = ref.prefix;\n var suffix = ref.suffix;\n var format = ref.format;\n var onKeyDown = ref.onKeyDown;\n var ignoreDecimalSeparator = decimalScale !== undefined && fixedDecimalScale;\n var numRegex = this.getNumberRegex(false, ignoreDecimalSeparator);\n var negativeRegex = new RegExp('-');\n var isPatternFormat = typeof format === 'string';\n\n this.selectionBeforeInput = {\n selectionStart: selectionStart,\n selectionEnd: selectionEnd,\n };\n\n //Handle backspace and delete against non numerical/decimal characters or arrow keys\n if (key === 'ArrowLeft' || key === 'Backspace') {\n expectedCaretPosition = selectionStart - 1;\n } else if (key === 'ArrowRight') {\n expectedCaretPosition = selectionStart + 1;\n } else if (key === 'Delete') {\n expectedCaretPosition = selectionStart;\n }\n\n //if expectedCaretPosition is not set it means we don't want to Handle keyDown\n //also if multiple characters are selected don't handle\n if (expectedCaretPosition === undefined || selectionStart !== selectionEnd) {\n onKeyDown(e);\n return;\n }\n\n var newCaretPosition = expectedCaretPosition;\n var leftBound = isPatternFormat ? format.indexOf('#') : prefix.length;\n var rightBound = isPatternFormat ? format.lastIndexOf('#') + 1 : value.length - suffix.length;\n\n if (key === 'ArrowLeft' || key === 'ArrowRight') {\n var direction = key === 'ArrowLeft' ? 'left' : 'right';\n newCaretPosition = this.correctCaretPosition(value, expectedCaretPosition, direction);\n } else if (\n key === 'Delete' &&\n !numRegex.test(value[expectedCaretPosition]) &&\n !negativeRegex.test(value[expectedCaretPosition])\n ) {\n while (!numRegex.test(value[newCaretPosition]) && newCaretPosition < rightBound) {\n newCaretPosition++;\n }\n } else if (key === 'Backspace' && !numRegex.test(value[expectedCaretPosition])) {\n /* NOTE: This is special case when backspace is pressed on a\n negative value while the cursor position is after prefix. We can't handle it on onChange because\n we will not have any information of keyPress\n */\n if (selectionStart <= leftBound + 1 && value[0] === '-' && typeof format === 'undefined') {\n var newValue = value.substring(1);\n this.updateValue({\n formattedValue: newValue,\n caretPos: newCaretPosition,\n input: el,\n event: e,\n source: 'event',\n });\n } else if (!negativeRegex.test(value[expectedCaretPosition])) {\n while (!numRegex.test(value[newCaretPosition - 1]) && newCaretPosition > leftBound) {\n newCaretPosition--;\n }\n newCaretPosition = this.correctCaretPosition(value, newCaretPosition, 'left');\n }\n }\n\n if (\n newCaretPosition !== expectedCaretPosition ||\n expectedCaretPosition < leftBound ||\n expectedCaretPosition > rightBound\n ) {\n e.preventDefault();\n this.setPatchedCaretPosition(el, newCaretPosition, value);\n }\n\n /* NOTE: this is just required for unit test as we need to get the newCaretPosition,\n Remove this when you find different solution */\n if (e.isUnitTestRun) {\n this.setPatchedCaretPosition(el, newCaretPosition, value);\n }\n\n onKeyDown(e);\n };\n\n /** required to handle the caret position when click anywhere within the input **/\n NumberFormat.prototype.onMouseUp = function onMouseUp (e ) {\n var el = e.target;\n\n /**\n * NOTE: we have to give default value for value as in case when custom input is provided\n * value can come as undefined when nothing is provided on value prop.\n */\n var selectionStart = el.selectionStart;\n var selectionEnd = el.selectionEnd;\n var value = el.value; if ( value === void 0 ) value = '';\n\n if (selectionStart === selectionEnd) {\n var caretPosition = this.correctCaretPosition(value, selectionStart);\n if (caretPosition !== selectionStart) {\n this.setPatchedCaretPosition(el, caretPosition, value);\n }\n }\n\n this.props.onMouseUp(e);\n };\n\n NumberFormat.prototype.onFocus = function onFocus (e ) {\n var this$1 = this;\n\n // Workaround Chrome and Safari bug https://bugs.chromium.org/p/chromium/issues/detail?id=779328\n // (onFocus event target selectionStart is always 0 before setTimeout)\n e.persist();\n\n this.focusedElm = e.target;\n this.focusTimeout = setTimeout(function () {\n var el = e.target;\n var selectionStart = el.selectionStart;\n var selectionEnd = el.selectionEnd;\n var value = el.value; if ( value === void 0 ) value = '';\n\n var caretPosition = this$1.correctCaretPosition(value, selectionStart);\n\n //setPatchedCaretPosition only when everything is not selected on focus (while tabbing into the field)\n if (\n caretPosition !== selectionStart &&\n !(selectionStart === 0 && selectionEnd === value.length)\n ) {\n this$1.setPatchedCaretPosition(el, caretPosition, value);\n }\n\n this$1.props.onFocus(e);\n }, 0);\n };\n\n NumberFormat.prototype.render = function render () {\n var ref = this.props;\n var type = ref.type;\n var displayType = ref.displayType;\n var customInput = ref.customInput;\n var renderText = ref.renderText;\n var getInputRef = ref.getInputRef;\n var format = ref.format;\n var thousandSeparator = ref.thousandSeparator;\n var decimalSeparator = ref.decimalSeparator;\n var allowedDecimalSeparators = ref.allowedDecimalSeparators;\n var thousandsGroupStyle = ref.thousandsGroupStyle;\n var decimalScale = ref.decimalScale;\n var fixedDecimalScale = ref.fixedDecimalScale;\n var prefix = ref.prefix;\n var suffix = ref.suffix;\n var removeFormatting = ref.removeFormatting;\n var mask = ref.mask;\n var defaultValue = ref.defaultValue;\n var isNumericString = ref.isNumericString;\n var allowNegative = ref.allowNegative;\n var allowEmptyFormatting = ref.allowEmptyFormatting;\n var allowLeadingZeros = ref.allowLeadingZeros;\n var onValueChange = ref.onValueChange;\n var isAllowed = ref.isAllowed;\n var customNumerals = ref.customNumerals;\n var onChange = ref.onChange;\n var onKeyDown = ref.onKeyDown;\n var onMouseUp = ref.onMouseUp;\n var onFocus = ref.onFocus;\n var onBlur = ref.onBlur;\n var propValue = ref.value;\n var rest = objectWithoutProperties( ref, [\"type\", \"displayType\", \"customInput\", \"renderText\", \"getInputRef\", \"format\", \"thousandSeparator\", \"decimalSeparator\", \"allowedDecimalSeparators\", \"thousandsGroupStyle\", \"decimalScale\", \"fixedDecimalScale\", \"prefix\", \"suffix\", \"removeFormatting\", \"mask\", \"defaultValue\", \"isNumericString\", \"allowNegative\", \"allowEmptyFormatting\", \"allowLeadingZeros\", \"onValueChange\", \"isAllowed\", \"customNumerals\", \"onChange\", \"onKeyDown\", \"onMouseUp\", \"onFocus\", \"onBlur\", \"value\"] );\n var otherProps = rest;\n var ref$1 = this.state;\n var value = ref$1.value;\n var mounted = ref$1.mounted;\n\n // add input mode on element based on format prop and device once the component is mounted\n var inputMode = mounted && addInputMode(format) ? 'numeric' : undefined;\n\n var inputProps = Object.assign({ inputMode: inputMode }, otherProps, {\n type: type,\n value: value,\n onChange: this.onChange,\n onKeyDown: this.onKeyDown,\n onMouseUp: this.onMouseUp,\n onFocus: this.onFocus,\n onBlur: this.onBlur,\n });\n\n if (displayType === 'text') {\n return renderText ? (\n renderText(value, otherProps) || null\n ) : (\n React.createElement( 'span', Object.assign({}, otherProps, { ref: getInputRef }),\n value\n )\n );\n } else if (customInput) {\n var CustomInput = customInput;\n return React.createElement( CustomInput, Object.assign({}, inputProps, { ref: getInputRef }));\n }\n\n return React.createElement( 'input', Object.assign({}, inputProps, { ref: getInputRef }));\n };\n\n return NumberFormat;\n}(React.Component));\n\nNumberFormat.defaultProps = defaultProps;\n\nexport default NumberFormat;\n","var getOwnPropertyNames = Object.getOwnPropertyNames, getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n/**\n * Combine two comparators into a single comparators.\n */\nfunction combineComparators(comparatorA, comparatorB) {\n return function isEqual(a, b, state) {\n return comparatorA(a, b, state) && comparatorB(a, b, state);\n };\n}\n/**\n * Wrap the provided `areItemsEqual` method to manage the circular state, allowing\n * for circular references to be safely included in the comparison without creating\n * stack overflows.\n */\nfunction createIsCircular(areItemsEqual) {\n return function isCircular(a, b, state) {\n if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {\n return areItemsEqual(a, b, state);\n }\n var cache = state.cache;\n var cachedA = cache.get(a);\n var cachedB = cache.get(b);\n if (cachedA && cachedB) {\n return cachedA === b && cachedB === a;\n }\n cache.set(a, b);\n cache.set(b, a);\n var result = areItemsEqual(a, b, state);\n cache.delete(a);\n cache.delete(b);\n return result;\n };\n}\n/**\n * Get the properties to strictly examine, which include both own properties that are\n * not enumerable and symbol properties.\n */\nfunction getStrictProperties(object) {\n return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));\n}\n/**\n * Whether the object contains the property passed as an own property.\n */\nvar hasOwn = Object.hasOwn ||\n (function (object, property) {\n return hasOwnProperty.call(object, property);\n });\n/**\n * Whether the values passed are strictly equal or both NaN.\n */\nfunction sameValueZeroEqual(a, b) {\n return a || b ? a === b : a === b || (a !== a && b !== b);\n}\n\nvar OWNER = '_owner';\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor, keys = Object.keys;\n/**\n * Whether the arrays are equal in value.\n */\nfunction areArraysEqual(a, b, state) {\n var index = a.length;\n if (b.length !== index) {\n return false;\n }\n while (index-- > 0) {\n if (!state.equals(a[index], b[index], index, index, a, b, state)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Whether the dates passed are equal in value.\n */\nfunction areDatesEqual(a, b) {\n return sameValueZeroEqual(a.getTime(), b.getTime());\n}\n/**\n * Whether the `Map`s are equal in value.\n */\nfunction areMapsEqual(a, b, state) {\n if (a.size !== b.size) {\n return false;\n }\n var matchedIndices = {};\n var aIterable = a.entries();\n var index = 0;\n var aResult;\n var bResult;\n while ((aResult = aIterable.next())) {\n if (aResult.done) {\n break;\n }\n var bIterable = b.entries();\n var hasMatch = false;\n var matchIndex = 0;\n while ((bResult = bIterable.next())) {\n if (bResult.done) {\n break;\n }\n var _a = aResult.value, aKey = _a[0], aValue = _a[1];\n var _b = bResult.value, bKey = _b[0], bValue = _b[1];\n if (!hasMatch &&\n !matchedIndices[matchIndex] &&\n (hasMatch =\n state.equals(aKey, bKey, index, matchIndex, a, b, state) &&\n state.equals(aValue, bValue, aKey, bKey, a, b, state))) {\n matchedIndices[matchIndex] = true;\n }\n matchIndex++;\n }\n if (!hasMatch) {\n return false;\n }\n index++;\n }\n return true;\n}\n/**\n * Whether the objects are equal in value.\n */\nfunction areObjectsEqual(a, b, state) {\n var properties = keys(a);\n var index = properties.length;\n if (keys(b).length !== index) {\n return false;\n }\n var property;\n // Decrementing `while` showed faster results than either incrementing or\n // decrementing `for` loop and than an incrementing `while` loop. Declarative\n // methods like `some` / `every` were not used to avoid incurring the garbage\n // cost of anonymous callbacks.\n while (index-- > 0) {\n property = properties[index];\n if (property === OWNER &&\n (a.$$typeof || b.$$typeof) &&\n a.$$typeof !== b.$$typeof) {\n return false;\n }\n if (!hasOwn(b, property) ||\n !state.equals(a[property], b[property], property, property, a, b, state)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Whether the objects are equal in value with strict property checking.\n */\nfunction areObjectsEqualStrict(a, b, state) {\n var properties = getStrictProperties(a);\n var index = properties.length;\n if (getStrictProperties(b).length !== index) {\n return false;\n }\n var property;\n var descriptorA;\n var descriptorB;\n // Decrementing `while` showed faster results than either incrementing or\n // decrementing `for` loop and than an incrementing `while` loop. Declarative\n // methods like `some` / `every` were not used to avoid incurring the garbage\n // cost of anonymous callbacks.\n while (index-- > 0) {\n property = properties[index];\n if (property === OWNER &&\n (a.$$typeof || b.$$typeof) &&\n a.$$typeof !== b.$$typeof) {\n return false;\n }\n if (!hasOwn(b, property)) {\n return false;\n }\n if (!state.equals(a[property], b[property], property, property, a, b, state)) {\n return false;\n }\n descriptorA = getOwnPropertyDescriptor(a, property);\n descriptorB = getOwnPropertyDescriptor(b, property);\n if ((descriptorA || descriptorB) &&\n (!descriptorA ||\n !descriptorB ||\n descriptorA.configurable !== descriptorB.configurable ||\n descriptorA.enumerable !== descriptorB.enumerable ||\n descriptorA.writable !== descriptorB.writable)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Whether the primitive wrappers passed are equal in value.\n */\nfunction arePrimitiveWrappersEqual(a, b) {\n return sameValueZeroEqual(a.valueOf(), b.valueOf());\n}\n/**\n * Whether the regexps passed are equal in value.\n */\nfunction areRegExpsEqual(a, b) {\n return a.source === b.source && a.flags === b.flags;\n}\n/**\n * Whether the `Set`s are equal in value.\n */\nfunction areSetsEqual(a, b, state) {\n if (a.size !== b.size) {\n return false;\n }\n var matchedIndices = {};\n var aIterable = a.values();\n var aResult;\n var bResult;\n while ((aResult = aIterable.next())) {\n if (aResult.done) {\n break;\n }\n var bIterable = b.values();\n var hasMatch = false;\n var matchIndex = 0;\n while ((bResult = bIterable.next())) {\n if (bResult.done) {\n break;\n }\n if (!hasMatch &&\n !matchedIndices[matchIndex] &&\n (hasMatch = state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state))) {\n matchedIndices[matchIndex] = true;\n }\n matchIndex++;\n }\n if (!hasMatch) {\n return false;\n }\n }\n return true;\n}\n/**\n * Whether the TypedArray instances are equal in value.\n */\nfunction areTypedArraysEqual(a, b) {\n var index = a.length;\n if (b.length !== index) {\n return false;\n }\n while (index-- > 0) {\n if (a[index] !== b[index]) {\n return false;\n }\n }\n return true;\n}\n\nvar ARGUMENTS_TAG = '[object Arguments]';\nvar BOOLEAN_TAG = '[object Boolean]';\nvar DATE_TAG = '[object Date]';\nvar MAP_TAG = '[object Map]';\nvar NUMBER_TAG = '[object Number]';\nvar OBJECT_TAG = '[object Object]';\nvar REG_EXP_TAG = '[object RegExp]';\nvar SET_TAG = '[object Set]';\nvar STRING_TAG = '[object String]';\nvar isArray = Array.isArray;\nvar isTypedArray = typeof ArrayBuffer === 'function' && ArrayBuffer.isView\n ? ArrayBuffer.isView\n : null;\nvar assign = Object.assign;\nvar getTag = Object.prototype.toString.call.bind(Object.prototype.toString);\n/**\n * Create a comparator method based on the type-specific equality comparators passed.\n */\nfunction createEqualityComparator(_a) {\n var areArraysEqual = _a.areArraysEqual, areDatesEqual = _a.areDatesEqual, areMapsEqual = _a.areMapsEqual, areObjectsEqual = _a.areObjectsEqual, arePrimitiveWrappersEqual = _a.arePrimitiveWrappersEqual, areRegExpsEqual = _a.areRegExpsEqual, areSetsEqual = _a.areSetsEqual, areTypedArraysEqual = _a.areTypedArraysEqual;\n /**\n * compare the value of the two objects and return true if they are equivalent in values\n */\n return function comparator(a, b, state) {\n // If the items are strictly equal, no need to do a value comparison.\n if (a === b) {\n return true;\n }\n // If the items are not non-nullish objects, then the only possibility\n // of them being equal but not strictly is if they are both `NaN`. Since\n // `NaN` is uniquely not equal to itself, we can use self-comparison of\n // both objects, which is faster than `isNaN()`.\n if (a == null ||\n b == null ||\n typeof a !== 'object' ||\n typeof b !== 'object') {\n return a !== a && b !== b;\n }\n var constructor = a.constructor;\n // Checks are listed in order of commonality of use-case:\n // 1. Common complex object types (plain object, array)\n // 2. Common data values (date, regexp)\n // 3. Less-common complex object types (map, set)\n // 4. Less-common data values (promise, primitive wrappers)\n // Inherently this is both subjective and assumptive, however\n // when reviewing comparable libraries in the wild this order\n // appears to be generally consistent.\n // Constructors should match, otherwise there is potential for false positives\n // between class and subclass or custom object and POJO.\n if (constructor !== b.constructor) {\n return false;\n }\n // `isPlainObject` only checks against the object's own realm. Cross-realm\n // comparisons are rare, and will be handled in the ultimate fallback, so\n // we can avoid capturing the string tag.\n if (constructor === Object) {\n return areObjectsEqual(a, b, state);\n }\n // `isArray()` works on subclasses and is cross-realm, so we can avoid capturing\n // the string tag or doing an `instanceof` check.\n if (isArray(a)) {\n return areArraysEqual(a, b, state);\n }\n // `isTypedArray()` works on all possible TypedArray classes, so we can avoid\n // capturing the string tag or comparing against all possible constructors.\n if (isTypedArray != null && isTypedArray(a)) {\n return areTypedArraysEqual(a, b, state);\n }\n // Try to fast-path equality checks for other complex object types in the\n // same realm to avoid capturing the string tag. Strict equality is used\n // instead of `instanceof` because it is more performant for the common\n // use-case. If someone is subclassing a native class, it will be handled\n // with the string tag comparison.\n if (constructor === Date) {\n return areDatesEqual(a, b, state);\n }\n if (constructor === RegExp) {\n return areRegExpsEqual(a, b, state);\n }\n if (constructor === Map) {\n return areMapsEqual(a, b, state);\n }\n if (constructor === Set) {\n return areSetsEqual(a, b, state);\n }\n // Since this is a custom object, capture the string tag to determing its type.\n // This is reasonably performant in modern environments like v8 and SpiderMonkey.\n var tag = getTag(a);\n if (tag === DATE_TAG) {\n return areDatesEqual(a, b, state);\n }\n if (tag === REG_EXP_TAG) {\n return areRegExpsEqual(a, b, state);\n }\n if (tag === MAP_TAG) {\n return areMapsEqual(a, b, state);\n }\n if (tag === SET_TAG) {\n return areSetsEqual(a, b, state);\n }\n if (tag === OBJECT_TAG) {\n // The exception for value comparison is custom `Promise`-like class instances. These should\n // be treated the same as standard `Promise` objects, which means strict equality, and if\n // it reaches this point then that strict equality comparison has already failed.\n return (typeof a.then !== 'function' &&\n typeof b.then !== 'function' &&\n areObjectsEqual(a, b, state));\n }\n // If an arguments tag, it should be treated as a standard object.\n if (tag === ARGUMENTS_TAG) {\n return areObjectsEqual(a, b, state);\n }\n // As the penultimate fallback, check if the values passed are primitive wrappers. This\n // is very rare in modern JS, which is why it is deprioritized compared to all other object\n // types.\n if (tag === BOOLEAN_TAG || tag === NUMBER_TAG || tag === STRING_TAG) {\n return arePrimitiveWrappersEqual(a, b, state);\n }\n // If not matching any tags that require a specific type of comparison, then we hard-code false because\n // the only thing remaining is strict equality, which has already been compared. This is for a few reasons:\n // - Certain types that cannot be introspected (e.g., `WeakMap`). For these types, this is the only\n // comparison that can be made.\n // - For types that can be introspected, but rarely have requirements to be compared\n // (`ArrayBuffer`, `DataView`, etc.), the cost is avoided to prioritize the common\n // use-cases (may be included in a future release, if requested enough).\n // - For types that can be introspected but do not have an objective definition of what\n // equality is (`Error`, etc.), the subjective decision is to be conservative and strictly compare.\n // In all cases, these decisions should be reevaluated based on changes to the language and\n // common development practices.\n return false;\n };\n}\n/**\n * Create the configuration object used for building comparators.\n */\nfunction createEqualityComparatorConfig(_a) {\n var circular = _a.circular, createCustomConfig = _a.createCustomConfig, strict = _a.strict;\n var config = {\n areArraysEqual: strict\n ? areObjectsEqualStrict\n : areArraysEqual,\n areDatesEqual: areDatesEqual,\n areMapsEqual: strict\n ? combineComparators(areMapsEqual, areObjectsEqualStrict)\n : areMapsEqual,\n areObjectsEqual: strict\n ? areObjectsEqualStrict\n : areObjectsEqual,\n arePrimitiveWrappersEqual: arePrimitiveWrappersEqual,\n areRegExpsEqual: areRegExpsEqual,\n areSetsEqual: strict\n ? combineComparators(areSetsEqual, areObjectsEqualStrict)\n : areSetsEqual,\n areTypedArraysEqual: strict\n ? areObjectsEqualStrict\n : areTypedArraysEqual,\n };\n if (createCustomConfig) {\n config = assign({}, config, createCustomConfig(config));\n }\n if (circular) {\n var areArraysEqual$1 = createIsCircular(config.areArraysEqual);\n var areMapsEqual$1 = createIsCircular(config.areMapsEqual);\n var areObjectsEqual$1 = createIsCircular(config.areObjectsEqual);\n var areSetsEqual$1 = createIsCircular(config.areSetsEqual);\n config = assign({}, config, {\n areArraysEqual: areArraysEqual$1,\n areMapsEqual: areMapsEqual$1,\n areObjectsEqual: areObjectsEqual$1,\n areSetsEqual: areSetsEqual$1,\n });\n }\n return config;\n}\n/**\n * Default equality comparator pass-through, used as the standard `isEqual` creator for\n * use inside the built comparator.\n */\nfunction createInternalEqualityComparator(compare) {\n return function (a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, state) {\n return compare(a, b, state);\n };\n}\n/**\n * Create the `isEqual` function used by the consuming application.\n */\nfunction createIsEqual(_a) {\n var circular = _a.circular, comparator = _a.comparator, createState = _a.createState, equals = _a.equals, strict = _a.strict;\n if (createState) {\n return function isEqual(a, b) {\n var _a = createState(), _b = _a.cache, cache = _b === void 0 ? circular ? new WeakMap() : undefined : _b, meta = _a.meta;\n return comparator(a, b, {\n cache: cache,\n equals: equals,\n meta: meta,\n strict: strict,\n });\n };\n }\n if (circular) {\n return function isEqual(a, b) {\n return comparator(a, b, {\n cache: new WeakMap(),\n equals: equals,\n meta: undefined,\n strict: strict,\n });\n };\n }\n var state = {\n cache: undefined,\n equals: equals,\n meta: undefined,\n strict: strict,\n };\n return function isEqual(a, b) {\n return comparator(a, b, state);\n };\n}\n\n/**\n * Whether the items passed are deeply-equal in value.\n */\nvar deepEqual = createCustomEqual();\n/**\n * Whether the items passed are deeply-equal in value based on strict comparison.\n */\nvar strictDeepEqual = createCustomEqual({ strict: true });\n/**\n * Whether the items passed are deeply-equal in value, including circular references.\n */\nvar circularDeepEqual = createCustomEqual({ circular: true });\n/**\n * Whether the items passed are deeply-equal in value, including circular references,\n * based on strict comparison.\n */\nvar strictCircularDeepEqual = createCustomEqual({\n circular: true,\n strict: true,\n});\n/**\n * Whether the items passed are shallowly-equal in value.\n */\nvar shallowEqual = createCustomEqual({\n createInternalComparator: function () { return sameValueZeroEqual; },\n});\n/**\n * Whether the items passed are shallowly-equal in value based on strict comparison\n */\nvar strictShallowEqual = createCustomEqual({\n strict: true,\n createInternalComparator: function () { return sameValueZeroEqual; },\n});\n/**\n * Whether the items passed are shallowly-equal in value, including circular references.\n */\nvar circularShallowEqual = createCustomEqual({\n circular: true,\n createInternalComparator: function () { return sameValueZeroEqual; },\n});\n/**\n * Whether the items passed are shallowly-equal in value, including circular references,\n * based on strict comparison.\n */\nvar strictCircularShallowEqual = createCustomEqual({\n circular: true,\n createInternalComparator: function () { return sameValueZeroEqual; },\n strict: true,\n});\n/**\n * Create a custom equality comparison method.\n *\n * This can be done to create very targeted comparisons in extreme hot-path scenarios\n * where the standard methods are not performant enough, but can also be used to provide\n * support for legacy environments that do not support expected features like\n * `RegExp.prototype.flags` out of the box.\n */\nfunction createCustomEqual(options) {\n if (options === void 0) { options = {}; }\n var _a = options.circular, circular = _a === void 0 ? false : _a, createCustomInternalComparator = options.createInternalComparator, createState = options.createState, _b = options.strict, strict = _b === void 0 ? false : _b;\n var config = createEqualityComparatorConfig(options);\n var comparator = createEqualityComparator(config);\n var equals = createCustomInternalComparator\n ? createCustomInternalComparator(comparator)\n : createInternalEqualityComparator(comparator);\n return createIsEqual({ circular: circular, comparator: comparator, createState: createState, equals: equals, strict: strict });\n}\n\nexport { circularDeepEqual, circularShallowEqual, createCustomEqual, deepEqual, sameValueZeroEqual, shallowEqual, strictCircularDeepEqual, strictCircularShallowEqual, strictDeepEqual, strictShallowEqual };\n//# sourceMappingURL=index.mjs.map\n","function safeRequestAnimationFrame(callback) {\n if (typeof requestAnimationFrame !== 'undefined') requestAnimationFrame(callback);\n}\nexport default function setRafTimeout(callback) {\n var timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var currTime = -1;\n var shouldUpdate = function shouldUpdate(now) {\n if (currTime < 0) {\n currTime = now;\n }\n if (now - currTime > timeout) {\n callback(now);\n currTime = -1;\n } else {\n safeRequestAnimationFrame(shouldUpdate);\n }\n };\n requestAnimationFrame(shouldUpdate);\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nimport setRafTimeout from './setRafTimeout';\nexport default function createAnimateManager() {\n var currStyle = {};\n var handleChange = function handleChange() {\n return null;\n };\n var shouldStop = false;\n var setStyle = function setStyle(_style) {\n if (shouldStop) {\n return;\n }\n if (Array.isArray(_style)) {\n if (!_style.length) {\n return;\n }\n var styles = _style;\n var _styles = _toArray(styles),\n curr = _styles[0],\n restStyles = _styles.slice(1);\n if (typeof curr === 'number') {\n setRafTimeout(setStyle.bind(null, restStyles), curr);\n return;\n }\n setStyle(curr);\n setRafTimeout(setStyle.bind(null, restStyles));\n return;\n }\n if (_typeof(_style) === 'object') {\n currStyle = _style;\n handleChange(currStyle);\n }\n if (typeof _style === 'function') {\n _style();\n }\n };\n return {\n stop: function stop() {\n shouldStop = true;\n },\n start: function start(style) {\n shouldStop = false;\n setStyle(style);\n },\n subscribe: function subscribe(_handleChange) {\n handleChange = _handleChange;\n return function () {\n handleChange = function handleChange() {\n return null;\n };\n };\n }\n };\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n/* eslint no-console: 0 */\nvar PREFIX_LIST = ['Webkit', 'Moz', 'O', 'ms'];\nvar IN_LINE_PREFIX_LIST = ['-webkit-', '-moz-', '-o-', '-ms-'];\nvar IN_COMPATIBLE_PROPERTY = ['transform', 'transformOrigin', 'transition'];\nexport var getIntersectionKeys = function getIntersectionKeys(preObj, nextObj) {\n return [Object.keys(preObj), Object.keys(nextObj)].reduce(function (a, b) {\n return a.filter(function (c) {\n return b.includes(c);\n });\n });\n};\nexport var identity = function identity(param) {\n return param;\n};\n\n/*\n * @description: convert camel case to dash case\n * string => string\n */\nexport var getDashCase = function getDashCase(name) {\n return name.replace(/([A-Z])/g, function (v) {\n return \"-\".concat(v.toLowerCase());\n });\n};\n\n/*\n * @description: add compatible style prefix\n * (string, string) => object\n */\nexport var generatePrefixStyle = function generatePrefixStyle(name, value) {\n if (IN_COMPATIBLE_PROPERTY.indexOf(name) === -1) {\n return _defineProperty({}, name, Number.isNaN(value) ? 0 : value);\n }\n var isTransition = name === 'transition';\n var camelName = name.replace(/(\\w)/, function (v) {\n return v.toUpperCase();\n });\n var styleVal = value;\n return PREFIX_LIST.reduce(function (result, property, i) {\n if (isTransition) {\n styleVal = value.replace(/(transform|transform-origin)/gim, \"\".concat(IN_LINE_PREFIX_LIST[i], \"$1\"));\n }\n return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, property + camelName, styleVal));\n }, {});\n};\nexport var log = function log() {\n var _console;\n (_console = console).log.apply(_console, arguments);\n};\n\n/*\n * @description: log the value of a varible\n * string => any => any\n */\nexport var debug = function debug(name) {\n return function (item) {\n log(name, item);\n return item;\n };\n};\n\n/*\n * @description: log name, args, return value of a function\n * function => function\n */\nexport var debugf = function debugf(tag, f) {\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n var res = f.apply(void 0, args);\n var name = tag || f.name || 'anonymous function';\n var argNames = \"(\".concat(args.map(JSON.stringify).join(', '), \")\");\n log(\"\".concat(name, \": \").concat(argNames, \" => \").concat(JSON.stringify(res)));\n return res;\n };\n};\n\n/*\n * @description: map object on every element in this object.\n * (function, object) => object\n */\nexport var mapObject = function mapObject(fn, obj) {\n return Object.keys(obj).reduce(function (res, key) {\n return _objectSpread(_objectSpread({}, res), {}, _defineProperty({}, key, fn(key, obj[key])));\n }, {});\n};\n\n/*\n * @description: add compatible prefix to style\n * object => object\n */\nexport var translateStyle = function translateStyle(style) {\n return Object.keys(style).reduce(function (res, key) {\n return _objectSpread(_objectSpread({}, res), generatePrefixStyle(key, res[key]));\n }, style);\n};\nexport var compose = function compose() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n if (!args.length) {\n return identity;\n }\n var fns = args.reverse();\n // first function can receive multiply arguments\n var firstFn = fns[0];\n var tailsFn = fns.slice(1);\n return function () {\n return tailsFn.reduce(function (res, fn) {\n return fn(res);\n }, firstFn.apply(void 0, arguments));\n };\n};\nexport var getTransitionVal = function getTransitionVal(props, duration, easing) {\n return props.map(function (prop) {\n return \"\".concat(getDashCase(prop), \" \").concat(duration, \"ms \").concat(easing);\n }).join(',');\n};\nvar isDev = process.env.NODE_ENV !== 'production';\nexport var warn = function warn(condition, format, a, b, c, d, e, f) {\n if (isDev && typeof console !== 'undefined' && console.warn) {\n if (format === undefined) {\n console.warn('LogUtils requires an error message argument');\n }\n if (!condition) {\n if (format === undefined) {\n console.warn('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n console.warn(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n }\n }\n }\n};","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nimport { warn } from './util';\nvar ACCURACY = 1e-4;\nvar cubicBezierFactor = function cubicBezierFactor(c1, c2) {\n return [0, 3 * c1, 3 * c2 - 6 * c1, 3 * c1 - 3 * c2 + 1];\n};\nvar multyTime = function multyTime(params, t) {\n return params.map(function (param, i) {\n return param * Math.pow(t, i);\n }).reduce(function (pre, curr) {\n return pre + curr;\n });\n};\nvar cubicBezier = function cubicBezier(c1, c2) {\n return function (t) {\n var params = cubicBezierFactor(c1, c2);\n return multyTime(params, t);\n };\n};\nvar derivativeCubicBezier = function derivativeCubicBezier(c1, c2) {\n return function (t) {\n var params = cubicBezierFactor(c1, c2);\n var newParams = [].concat(_toConsumableArray(params.map(function (param, i) {\n return param * i;\n }).slice(1)), [0]);\n return multyTime(newParams, t);\n };\n};\n\n// calculate cubic-bezier using Newton's method\nexport var configBezier = function configBezier() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n var x1 = args[0],\n y1 = args[1],\n x2 = args[2],\n y2 = args[3];\n if (args.length === 1) {\n switch (args[0]) {\n case 'linear':\n x1 = 0.0;\n y1 = 0.0;\n x2 = 1.0;\n y2 = 1.0;\n break;\n case 'ease':\n x1 = 0.25;\n y1 = 0.1;\n x2 = 0.25;\n y2 = 1.0;\n break;\n case 'ease-in':\n x1 = 0.42;\n y1 = 0.0;\n x2 = 1.0;\n y2 = 1.0;\n break;\n case 'ease-out':\n x1 = 0.42;\n y1 = 0.0;\n x2 = 0.58;\n y2 = 1.0;\n break;\n case 'ease-in-out':\n x1 = 0.0;\n y1 = 0.0;\n x2 = 0.58;\n y2 = 1.0;\n break;\n default:\n {\n var easing = args[0].split('(');\n if (easing[0] === 'cubic-bezier' && easing[1].split(')')[0].split(',').length === 4) {\n var _easing$1$split$0$spl = easing[1].split(')')[0].split(',').map(function (x) {\n return parseFloat(x);\n });\n var _easing$1$split$0$spl2 = _slicedToArray(_easing$1$split$0$spl, 4);\n x1 = _easing$1$split$0$spl2[0];\n y1 = _easing$1$split$0$spl2[1];\n x2 = _easing$1$split$0$spl2[2];\n y2 = _easing$1$split$0$spl2[3];\n } else {\n warn(false, '[configBezier]: arguments should be one of ' + \"oneOf 'linear', 'ease', 'ease-in', 'ease-out', \" + \"'ease-in-out','cubic-bezier(x1,y1,x2,y2)', instead received %s\", args);\n }\n }\n }\n }\n warn([x1, x2, y1, y2].every(function (num) {\n return typeof num === 'number' && num >= 0 && num <= 1;\n }), '[configBezier]: arguments should be x1, y1, x2, y2 of [0, 1] instead received %s', args);\n var curveX = cubicBezier(x1, x2);\n var curveY = cubicBezier(y1, y2);\n var derCurveX = derivativeCubicBezier(x1, x2);\n var rangeValue = function rangeValue(value) {\n if (value > 1) {\n return 1;\n }\n if (value < 0) {\n return 0;\n }\n return value;\n };\n var bezier = function bezier(_t) {\n var t = _t > 1 ? 1 : _t;\n var x = t;\n for (var i = 0; i < 8; ++i) {\n var evalT = curveX(x) - t;\n var derVal = derCurveX(x);\n if (Math.abs(evalT - t) < ACCURACY || derVal < ACCURACY) {\n return curveY(x);\n }\n x = rangeValue(x - evalT / derVal);\n }\n return curveY(x);\n };\n bezier.isStepper = false;\n return bezier;\n};\nexport var configSpring = function configSpring() {\n var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _config$stiff = config.stiff,\n stiff = _config$stiff === void 0 ? 100 : _config$stiff,\n _config$damping = config.damping,\n damping = _config$damping === void 0 ? 8 : _config$damping,\n _config$dt = config.dt,\n dt = _config$dt === void 0 ? 17 : _config$dt;\n var stepper = function stepper(currX, destX, currV) {\n var FSpring = -(currX - destX) * stiff;\n var FDamping = currV * damping;\n var newV = currV + (FSpring - FDamping) * dt / 1000;\n var newX = currV * dt / 1000 + currX;\n if (Math.abs(newX - destX) < ACCURACY && Math.abs(newV) < ACCURACY) {\n return [destX, 0];\n }\n return [newX, newV];\n };\n stepper.isStepper = true;\n stepper.dt = dt;\n return stepper;\n};\nexport var configEasing = function configEasing() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n var easing = args[0];\n if (typeof easing === 'string') {\n switch (easing) {\n case 'ease':\n case 'ease-in-out':\n case 'ease-out':\n case 'ease-in':\n case 'linear':\n return configBezier(easing);\n case 'spring':\n return configSpring();\n default:\n if (easing.split('(')[0] === 'cubic-bezier') {\n return configBezier(easing);\n }\n warn(false, \"[configEasing]: first argument should be one of 'ease', 'ease-in', \" + \"'ease-out', 'ease-in-out','cubic-bezier(x1,y1,x2,y2)', 'linear' and 'spring', instead received %s\", args);\n }\n }\n if (typeof easing === 'function') {\n return easing;\n }\n warn(false, '[configEasing]: first argument type should be function or string, instead received %s', args);\n return null;\n};","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nimport { getIntersectionKeys, mapObject } from './util';\nvar alpha = function alpha(begin, end, k) {\n return begin + (end - begin) * k;\n};\nvar needContinue = function needContinue(_ref) {\n var from = _ref.from,\n to = _ref.to;\n return from !== to;\n};\n\n/*\n * @description: cal new from value and velocity in each stepper\n * @return: { [styleProperty]: { from, to, velocity } }\n */\nvar calStepperVals = function calStepperVals(easing, preVals, steps) {\n var nextStepVals = mapObject(function (key, val) {\n if (needContinue(val)) {\n var _easing = easing(val.from, val.to, val.velocity),\n _easing2 = _slicedToArray(_easing, 2),\n newX = _easing2[0],\n newV = _easing2[1];\n return _objectSpread(_objectSpread({}, val), {}, {\n from: newX,\n velocity: newV\n });\n }\n return val;\n }, preVals);\n if (steps < 1) {\n return mapObject(function (key, val) {\n if (needContinue(val)) {\n return _objectSpread(_objectSpread({}, val), {}, {\n velocity: alpha(val.velocity, nextStepVals[key].velocity, steps),\n from: alpha(val.from, nextStepVals[key].from, steps)\n });\n }\n return val;\n }, preVals);\n }\n return calStepperVals(easing, nextStepVals, steps - 1);\n};\n\n// configure update function\nexport default (function (from, to, easing, duration, render) {\n var interKeys = getIntersectionKeys(from, to);\n var timingStyle = interKeys.reduce(function (res, key) {\n return _objectSpread(_objectSpread({}, res), {}, _defineProperty({}, key, [from[key], to[key]]));\n }, {});\n var stepperStyle = interKeys.reduce(function (res, key) {\n return _objectSpread(_objectSpread({}, res), {}, _defineProperty({}, key, {\n from: from[key],\n velocity: 0,\n to: to[key]\n }));\n }, {});\n var cafId = -1;\n var preTime;\n var beginTime;\n var update = function update() {\n return null;\n };\n var getCurrStyle = function getCurrStyle() {\n return mapObject(function (key, val) {\n return val.from;\n }, stepperStyle);\n };\n var shouldStopAnimation = function shouldStopAnimation() {\n return !Object.values(stepperStyle).filter(needContinue).length;\n };\n\n // stepper timing function like spring\n var stepperUpdate = function stepperUpdate(now) {\n if (!preTime) {\n preTime = now;\n }\n var deltaTime = now - preTime;\n var steps = deltaTime / easing.dt;\n stepperStyle = calStepperVals(easing, stepperStyle, steps);\n // get union set and add compatible prefix\n render(_objectSpread(_objectSpread(_objectSpread({}, from), to), getCurrStyle(stepperStyle)));\n preTime = now;\n if (!shouldStopAnimation()) {\n cafId = requestAnimationFrame(update);\n }\n };\n\n // t => val timing function like cubic-bezier\n var timingUpdate = function timingUpdate(now) {\n if (!beginTime) {\n beginTime = now;\n }\n var t = (now - beginTime) / duration;\n var currStyle = mapObject(function (key, val) {\n return alpha.apply(void 0, _toConsumableArray(val).concat([easing(t)]));\n }, timingStyle);\n\n // get union set and add compatible prefix\n render(_objectSpread(_objectSpread(_objectSpread({}, from), to), currStyle));\n if (t < 1) {\n cafId = requestAnimationFrame(update);\n } else {\n var finalStyle = mapObject(function (key, val) {\n return alpha.apply(void 0, _toConsumableArray(val).concat([easing(1)]));\n }, timingStyle);\n render(_objectSpread(_objectSpread(_objectSpread({}, from), to), finalStyle));\n }\n };\n update = easing.isStepper ? stepperUpdate : timingUpdate;\n\n // return start animation method\n return function () {\n requestAnimationFrame(update);\n\n // return stop animation method\n return function () {\n cancelAnimationFrame(cafId);\n };\n };\n});","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nvar _excluded = [\"children\", \"begin\", \"duration\", \"attributeName\", \"easing\", \"isActive\", \"steps\", \"from\", \"to\", \"canBegin\", \"onAnimationEnd\", \"shouldReAnimate\", \"onAnimationReStart\"];\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nimport React, { PureComponent, cloneElement, Children } from 'react';\nimport PropTypes from 'prop-types';\nimport { deepEqual } from 'fast-equals';\nimport createAnimateManager from './AnimateManager';\nimport { configEasing } from './easing';\nimport configUpdate from './configUpdate';\nimport { getTransitionVal, identity, translateStyle } from './util';\nvar Animate = /*#__PURE__*/function (_PureComponent) {\n _inherits(Animate, _PureComponent);\n var _super = _createSuper(Animate);\n function Animate(props, context) {\n var _this;\n _classCallCheck(this, Animate);\n _this = _super.call(this, props, context);\n var _this$props = _this.props,\n isActive = _this$props.isActive,\n attributeName = _this$props.attributeName,\n from = _this$props.from,\n to = _this$props.to,\n steps = _this$props.steps,\n children = _this$props.children,\n duration = _this$props.duration;\n _this.handleStyleChange = _this.handleStyleChange.bind(_assertThisInitialized(_this));\n _this.changeStyle = _this.changeStyle.bind(_assertThisInitialized(_this));\n if (!isActive || duration <= 0) {\n _this.state = {\n style: {}\n };\n\n // if children is a function and animation is not active, set style to 'to'\n if (typeof children === 'function') {\n _this.state = {\n style: to\n };\n }\n return _possibleConstructorReturn(_this);\n }\n if (steps && steps.length) {\n _this.state = {\n style: steps[0].style\n };\n } else if (from) {\n if (typeof children === 'function') {\n _this.state = {\n style: from\n };\n return _possibleConstructorReturn(_this);\n }\n _this.state = {\n style: attributeName ? _defineProperty({}, attributeName, from) : from\n };\n } else {\n _this.state = {\n style: {}\n };\n }\n return _this;\n }\n _createClass(Animate, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this$props2 = this.props,\n isActive = _this$props2.isActive,\n canBegin = _this$props2.canBegin;\n this.mounted = true;\n if (!isActive || !canBegin) {\n return;\n }\n this.runAnimation(this.props);\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n var _this$props3 = this.props,\n isActive = _this$props3.isActive,\n canBegin = _this$props3.canBegin,\n attributeName = _this$props3.attributeName,\n shouldReAnimate = _this$props3.shouldReAnimate,\n to = _this$props3.to,\n currentFrom = _this$props3.from;\n var style = this.state.style;\n if (!canBegin) {\n return;\n }\n if (!isActive) {\n var newState = {\n style: attributeName ? _defineProperty({}, attributeName, to) : to\n };\n if (this.state && style) {\n if (attributeName && style[attributeName] !== to || !attributeName && style !== to) {\n // eslint-disable-next-line react/no-did-update-set-state\n this.setState(newState);\n }\n }\n return;\n }\n if (deepEqual(prevProps.to, to) && prevProps.canBegin && prevProps.isActive) {\n return;\n }\n var isTriggered = !prevProps.canBegin || !prevProps.isActive;\n if (this.manager) {\n this.manager.stop();\n }\n if (this.stopJSAnimation) {\n this.stopJSAnimation();\n }\n var from = isTriggered || shouldReAnimate ? currentFrom : prevProps.to;\n if (this.state && style) {\n var _newState = {\n style: attributeName ? _defineProperty({}, attributeName, from) : from\n };\n if (attributeName && [attributeName] !== from || !attributeName && style !== from) {\n // eslint-disable-next-line react/no-did-update-set-state\n this.setState(_newState);\n }\n }\n this.runAnimation(_objectSpread(_objectSpread({}, this.props), {}, {\n from: from,\n begin: 0\n }));\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.mounted = false;\n var onAnimationEnd = this.props.onAnimationEnd;\n if (this.unSubscribe) {\n this.unSubscribe();\n }\n if (this.manager) {\n this.manager.stop();\n this.manager = null;\n }\n if (this.stopJSAnimation) {\n this.stopJSAnimation();\n }\n if (onAnimationEnd) {\n onAnimationEnd();\n }\n }\n }, {\n key: \"handleStyleChange\",\n value: function handleStyleChange(style) {\n this.changeStyle(style);\n }\n }, {\n key: \"changeStyle\",\n value: function changeStyle(style) {\n if (this.mounted) {\n this.setState({\n style: style\n });\n }\n }\n }, {\n key: \"runJSAnimation\",\n value: function runJSAnimation(props) {\n var _this2 = this;\n var from = props.from,\n to = props.to,\n duration = props.duration,\n easing = props.easing,\n begin = props.begin,\n onAnimationEnd = props.onAnimationEnd,\n onAnimationStart = props.onAnimationStart;\n var startAnimation = configUpdate(from, to, configEasing(easing), duration, this.changeStyle);\n var finalStartAnimation = function finalStartAnimation() {\n _this2.stopJSAnimation = startAnimation();\n };\n this.manager.start([onAnimationStart, begin, finalStartAnimation, duration, onAnimationEnd]);\n }\n }, {\n key: \"runStepAnimation\",\n value: function runStepAnimation(props) {\n var _this3 = this;\n var steps = props.steps,\n begin = props.begin,\n onAnimationStart = props.onAnimationStart;\n var _steps$ = steps[0],\n initialStyle = _steps$.style,\n _steps$$duration = _steps$.duration,\n initialTime = _steps$$duration === void 0 ? 0 : _steps$$duration;\n var addStyle = function addStyle(sequence, nextItem, index) {\n if (index === 0) {\n return sequence;\n }\n var duration = nextItem.duration,\n _nextItem$easing = nextItem.easing,\n easing = _nextItem$easing === void 0 ? 'ease' : _nextItem$easing,\n style = nextItem.style,\n nextProperties = nextItem.properties,\n onAnimationEnd = nextItem.onAnimationEnd;\n var preItem = index > 0 ? steps[index - 1] : nextItem;\n var properties = nextProperties || Object.keys(style);\n if (typeof easing === 'function' || easing === 'spring') {\n return [].concat(_toConsumableArray(sequence), [_this3.runJSAnimation.bind(_this3, {\n from: preItem.style,\n to: style,\n duration: duration,\n easing: easing\n }), duration]);\n }\n var transition = getTransitionVal(properties, duration, easing);\n var newStyle = _objectSpread(_objectSpread(_objectSpread({}, preItem.style), style), {}, {\n transition: transition\n });\n return [].concat(_toConsumableArray(sequence), [newStyle, duration, onAnimationEnd]).filter(identity);\n };\n return this.manager.start([onAnimationStart].concat(_toConsumableArray(steps.reduce(addStyle, [initialStyle, Math.max(initialTime, begin)])), [props.onAnimationEnd]));\n }\n }, {\n key: \"runAnimation\",\n value: function runAnimation(props) {\n if (!this.manager) {\n this.manager = createAnimateManager();\n }\n var begin = props.begin,\n duration = props.duration,\n attributeName = props.attributeName,\n propsTo = props.to,\n easing = props.easing,\n onAnimationStart = props.onAnimationStart,\n onAnimationEnd = props.onAnimationEnd,\n steps = props.steps,\n children = props.children;\n var manager = this.manager;\n this.unSubscribe = manager.subscribe(this.handleStyleChange);\n if (typeof easing === 'function' || typeof children === 'function' || easing === 'spring') {\n this.runJSAnimation(props);\n return;\n }\n if (steps.length > 1) {\n this.runStepAnimation(props);\n return;\n }\n var to = attributeName ? _defineProperty({}, attributeName, propsTo) : propsTo;\n var transition = getTransitionVal(Object.keys(to), duration, easing);\n manager.start([onAnimationStart, begin, _objectSpread(_objectSpread({}, to), {}, {\n transition: transition\n }), duration, onAnimationEnd]);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props4 = this.props,\n children = _this$props4.children,\n begin = _this$props4.begin,\n duration = _this$props4.duration,\n attributeName = _this$props4.attributeName,\n easing = _this$props4.easing,\n isActive = _this$props4.isActive,\n steps = _this$props4.steps,\n from = _this$props4.from,\n to = _this$props4.to,\n canBegin = _this$props4.canBegin,\n onAnimationEnd = _this$props4.onAnimationEnd,\n shouldReAnimate = _this$props4.shouldReAnimate,\n onAnimationReStart = _this$props4.onAnimationReStart,\n others = _objectWithoutProperties(_this$props4, _excluded);\n var count = Children.count(children);\n // eslint-disable-next-line react/destructuring-assignment\n var stateStyle = translateStyle(this.state.style);\n if (typeof children === 'function') {\n return children(stateStyle);\n }\n if (!isActive || count === 0 || duration <= 0) {\n return children;\n }\n var cloneContainer = function cloneContainer(container) {\n var _container$props = container.props,\n _container$props$styl = _container$props.style,\n style = _container$props$styl === void 0 ? {} : _container$props$styl,\n className = _container$props.className;\n var res = /*#__PURE__*/cloneElement(container, _objectSpread(_objectSpread({}, others), {}, {\n style: _objectSpread(_objectSpread({}, style), stateStyle),\n className: className\n }));\n return res;\n };\n if (count === 1) {\n return cloneContainer(Children.only(children));\n }\n return /*#__PURE__*/React.createElement(\"div\", null, Children.map(children, function (child) {\n return cloneContainer(child);\n }));\n }\n }]);\n return Animate;\n}(PureComponent);\nAnimate.displayName = 'Animate';\nAnimate.defaultProps = {\n begin: 0,\n duration: 1000,\n from: '',\n to: '',\n attributeName: '',\n easing: 'ease',\n isActive: true,\n canBegin: true,\n steps: [],\n onAnimationEnd: function onAnimationEnd() {},\n onAnimationStart: function onAnimationStart() {}\n};\nAnimate.propTypes = {\n from: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n to: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n attributeName: PropTypes.string,\n // animation duration\n duration: PropTypes.number,\n begin: PropTypes.number,\n easing: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),\n steps: PropTypes.arrayOf(PropTypes.shape({\n duration: PropTypes.number.isRequired,\n style: PropTypes.object.isRequired,\n easing: PropTypes.oneOfType([PropTypes.oneOf(['ease', 'ease-in', 'ease-out', 'ease-in-out', 'linear']), PropTypes.func]),\n // transition css properties(dash case), optional\n properties: PropTypes.arrayOf('string'),\n onAnimationEnd: PropTypes.func\n })),\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n isActive: PropTypes.bool,\n canBegin: PropTypes.bool,\n onAnimationEnd: PropTypes.func,\n // decide if it should reanimate with initial from style when props change\n shouldReAnimate: PropTypes.bool,\n onAnimationStart: PropTypes.func,\n onAnimationReStart: PropTypes.func\n};\nexport default Animate;","var _excluded = [\"children\", \"appearOptions\", \"enterOptions\", \"leaveOptions\"];\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport React, { Component, Children } from 'react';\nimport { Transition } from 'react-transition-group';\nimport PropTypes from 'prop-types';\nimport Animate from './Animate';\nif (Number.isFinite === undefined) {\n Number.isFinite = function (value) {\n return typeof value === 'number' && isFinite(value);\n };\n}\nvar parseDurationOfSingleTransition = function parseDurationOfSingleTransition() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var steps = options.steps,\n duration = options.duration;\n if (steps && steps.length) {\n return steps.reduce(function (result, entry) {\n return result + (Number.isFinite(entry.duration) && entry.duration > 0 ? entry.duration : 0);\n }, 0);\n }\n if (Number.isFinite(duration)) {\n return duration;\n }\n return 0;\n};\nvar AnimateGroupChild = /*#__PURE__*/function (_Component) {\n _inherits(AnimateGroupChild, _Component);\n var _super = _createSuper(AnimateGroupChild);\n function AnimateGroupChild() {\n var _this;\n _classCallCheck(this, AnimateGroupChild);\n _this = _super.call(this);\n _defineProperty(_assertThisInitialized(_this), \"handleEnter\", function (node, isAppearing) {\n var _this$props = _this.props,\n appearOptions = _this$props.appearOptions,\n enterOptions = _this$props.enterOptions;\n _this.handleStyleActive(isAppearing ? appearOptions : enterOptions);\n });\n _defineProperty(_assertThisInitialized(_this), \"handleExit\", function () {\n var leaveOptions = _this.props.leaveOptions;\n _this.handleStyleActive(leaveOptions);\n });\n _this.state = {\n isActive: false\n };\n return _this;\n }\n _createClass(AnimateGroupChild, [{\n key: \"handleStyleActive\",\n value: function handleStyleActive(style) {\n if (style) {\n var onAnimationEnd = style.onAnimationEnd ? function () {\n style.onAnimationEnd();\n } : null;\n this.setState(_objectSpread(_objectSpread({}, style), {}, {\n onAnimationEnd: onAnimationEnd,\n isActive: true\n }));\n }\n }\n }, {\n key: \"parseTimeout\",\n value: function parseTimeout() {\n var _this$props2 = this.props,\n appearOptions = _this$props2.appearOptions,\n enterOptions = _this$props2.enterOptions,\n leaveOptions = _this$props2.leaveOptions;\n return parseDurationOfSingleTransition(appearOptions) + parseDurationOfSingleTransition(enterOptions) + parseDurationOfSingleTransition(leaveOptions);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n var _this$props3 = this.props,\n children = _this$props3.children,\n appearOptions = _this$props3.appearOptions,\n enterOptions = _this$props3.enterOptions,\n leaveOptions = _this$props3.leaveOptions,\n props = _objectWithoutProperties(_this$props3, _excluded);\n return /*#__PURE__*/React.createElement(Transition, _extends({}, props, {\n onEnter: this.handleEnter,\n onExit: this.handleExit,\n timeout: this.parseTimeout()\n }), function () {\n return /*#__PURE__*/React.createElement(Animate, _this2.state, Children.only(children));\n });\n }\n }]);\n return AnimateGroupChild;\n}(Component);\nAnimateGroupChild.propTypes = {\n appearOptions: PropTypes.object,\n enterOptions: PropTypes.object,\n leaveOptions: PropTypes.object,\n children: PropTypes.element\n};\nexport default AnimateGroupChild;","import React, { Children } from 'react';\nimport { TransitionGroup } from 'react-transition-group';\nimport PropTypes from 'prop-types';\nimport AnimateGroupChild from './AnimateGroupChild';\nfunction AnimateGroup(props) {\n var component = props.component,\n children = props.children,\n appear = props.appear,\n enter = props.enter,\n leave = props.leave;\n return /*#__PURE__*/React.createElement(TransitionGroup, {\n component: component\n }, Children.map(children, function (child, index) {\n return /*#__PURE__*/React.createElement(AnimateGroupChild, {\n appearOptions: appear,\n enterOptions: enter,\n leaveOptions: leave,\n key: \"child-\".concat(index) // eslint-disable-line\n }, child);\n }));\n}\nAnimateGroup.propTypes = {\n appear: PropTypes.object,\n enter: PropTypes.object,\n leave: PropTypes.object,\n children: PropTypes.oneOfType([PropTypes.array, PropTypes.element]),\n component: PropTypes.any\n};\nAnimateGroup.defaultProps = {\n component: 'span'\n};\nexport default AnimateGroup;","import Animate from './Animate';\nimport { configBezier, configSpring } from './easing';\nimport { translateStyle } from './util';\nimport AnimateGroup from './AnimateGroup';\nexport { configSpring, configBezier, AnimateGroup, translateStyle };\nexport default Animate;","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar PropTypes = _interopRequireWildcard(require(\"prop-types\"));\n\nvar _addClass = _interopRequireDefault(require(\"dom-helpers/class/addClass\"));\n\nvar _removeClass = _interopRequireDefault(require(\"dom-helpers/class/removeClass\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _Transition = _interopRequireDefault(require(\"./Transition\"));\n\nvar _PropTypes = require(\"./utils/PropTypes\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar addClass = function addClass(node, classes) {\n return node && classes && classes.split(' ').forEach(function (c) {\n return (0, _addClass.default)(node, c);\n });\n};\n\nvar removeClass = function removeClass(node, classes) {\n return node && classes && classes.split(' ').forEach(function (c) {\n return (0, _removeClass.default)(node, c);\n });\n};\n/**\n * A transition component inspired by the excellent\n * [ng-animate](http://www.nganimate.org/) library, you should use it if you're\n * using CSS transitions or animations. It's built upon the\n * [`Transition`](https://reactcommunity.org/react-transition-group/transition)\n * component, so it inherits all of its props.\n *\n * `CSSTransition` applies a pair of class names during the `appear`, `enter`,\n * and `exit` states of the transition. The first class is applied and then a\n * second `*-active` class in order to activate the CSSS transition. After the\n * transition, matching `*-done` class names are applied to persist the\n * transition state.\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n * \n *\n * );\n * }\n * ```\n *\n * When the `in` prop is set to `true`, the child component will first receive\n * the class `example-enter`, then the `example-enter-active` will be added in\n * the next tick. `CSSTransition` [forces a\n * reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)\n * between before adding the `example-enter-active`. This is an important trick\n * because it allows us to transition between `example-enter` and\n * `example-enter-active` even though they were added immediately one after\n * another. Most notably, this is what makes it possible for us to animate\n * _appearance_.\n *\n * ```css\n * .my-node-enter {\n * opacity: 0;\n * }\n * .my-node-enter-active {\n * opacity: 1;\n * transition: opacity 200ms;\n * }\n * .my-node-exit {\n * opacity: 1;\n * }\n * .my-node-exit-active {\n * opacity: 0;\n * transition: opacity: 200ms;\n * }\n * ```\n *\n * `*-active` classes represent which styles you want to animate **to**.\n */\n\n\nvar CSSTransition =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(CSSTransition, _React$Component);\n\n function CSSTransition() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n\n _this.onEnter = function (node, appearing) {\n var _this$getClassNames = _this.getClassNames(appearing ? 'appear' : 'enter'),\n className = _this$getClassNames.className;\n\n _this.removeClasses(node, 'exit');\n\n addClass(node, className);\n\n if (_this.props.onEnter) {\n _this.props.onEnter(node, appearing);\n }\n };\n\n _this.onEntering = function (node, appearing) {\n var _this$getClassNames2 = _this.getClassNames(appearing ? 'appear' : 'enter'),\n activeClassName = _this$getClassNames2.activeClassName;\n\n _this.reflowAndAddClass(node, activeClassName);\n\n if (_this.props.onEntering) {\n _this.props.onEntering(node, appearing);\n }\n };\n\n _this.onEntered = function (node, appearing) {\n var appearClassName = _this.getClassNames('appear').doneClassName;\n\n var enterClassName = _this.getClassNames('enter').doneClassName;\n\n var doneClassName = appearing ? appearClassName + \" \" + enterClassName : enterClassName;\n\n _this.removeClasses(node, appearing ? 'appear' : 'enter');\n\n addClass(node, doneClassName);\n\n if (_this.props.onEntered) {\n _this.props.onEntered(node, appearing);\n }\n };\n\n _this.onExit = function (node) {\n var _this$getClassNames3 = _this.getClassNames('exit'),\n className = _this$getClassNames3.className;\n\n _this.removeClasses(node, 'appear');\n\n _this.removeClasses(node, 'enter');\n\n addClass(node, className);\n\n if (_this.props.onExit) {\n _this.props.onExit(node);\n }\n };\n\n _this.onExiting = function (node) {\n var _this$getClassNames4 = _this.getClassNames('exit'),\n activeClassName = _this$getClassNames4.activeClassName;\n\n _this.reflowAndAddClass(node, activeClassName);\n\n if (_this.props.onExiting) {\n _this.props.onExiting(node);\n }\n };\n\n _this.onExited = function (node) {\n var _this$getClassNames5 = _this.getClassNames('exit'),\n doneClassName = _this$getClassNames5.doneClassName;\n\n _this.removeClasses(node, 'exit');\n\n addClass(node, doneClassName);\n\n if (_this.props.onExited) {\n _this.props.onExited(node);\n }\n };\n\n _this.getClassNames = function (type) {\n var classNames = _this.props.classNames;\n var isStringClassNames = typeof classNames === 'string';\n var prefix = isStringClassNames && classNames ? classNames + '-' : '';\n var className = isStringClassNames ? prefix + type : classNames[type];\n var activeClassName = isStringClassNames ? className + '-active' : classNames[type + 'Active'];\n var doneClassName = isStringClassNames ? className + '-done' : classNames[type + 'Done'];\n return {\n className: className,\n activeClassName: activeClassName,\n doneClassName: doneClassName\n };\n };\n\n return _this;\n }\n\n var _proto = CSSTransition.prototype;\n\n _proto.removeClasses = function removeClasses(node, type) {\n var _this$getClassNames6 = this.getClassNames(type),\n className = _this$getClassNames6.className,\n activeClassName = _this$getClassNames6.activeClassName,\n doneClassName = _this$getClassNames6.doneClassName;\n\n className && removeClass(node, className);\n activeClassName && removeClass(node, activeClassName);\n doneClassName && removeClass(node, doneClassName);\n };\n\n _proto.reflowAndAddClass = function reflowAndAddClass(node, className) {\n // This is for to force a repaint,\n // which is necessary in order to transition styles when adding a class name.\n if (className) {\n /* eslint-disable no-unused-expressions */\n node && node.scrollTop;\n /* eslint-enable no-unused-expressions */\n\n addClass(node, className);\n }\n };\n\n _proto.render = function render() {\n var props = _extends({}, this.props);\n\n delete props.classNames;\n return _react.default.createElement(_Transition.default, _extends({}, props, {\n onEnter: this.onEnter,\n onEntered: this.onEntered,\n onEntering: this.onEntering,\n onExit: this.onExit,\n onExiting: this.onExiting,\n onExited: this.onExited\n }));\n };\n\n return CSSTransition;\n}(_react.default.Component);\n\nCSSTransition.defaultProps = {\n classNames: ''\n};\nCSSTransition.propTypes = process.env.NODE_ENV !== \"production\" ? _extends({}, _Transition.default.propTypes, {\n /**\n * The animation classNames applied to the component as it enters, exits or\n * has finished the transition. A single name can be provided and it will be\n * suffixed for each stage: e.g.\n *\n * `classNames=\"fade\"` applies `fade-enter`, `fade-enter-active`,\n * `fade-enter-done`, `fade-exit`, `fade-exit-active`, `fade-exit-done`,\n * `fade-appear`, `fade-appear-active`, and `fade-appear-done`.\n *\n * **Note**: `fade-appear-done` and `fade-enter-done` will _both_ be applied.\n * This allows you to define different behavior for when appearing is done and\n * when regular entering is done, using selectors like\n * `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply an\n * epic entrance animation when element first appears in the DOM using\n * [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can\n * simply use `fade-enter-done` for defining both cases.\n *\n * Each individual classNames can also be specified independently like:\n *\n * ```js\n * classNames={{\n * appear: 'my-appear',\n * appearActive: 'my-active-appear',\n * appearDone: 'my-done-appear',\n * enter: 'my-enter',\n * enterActive: 'my-active-enter',\n * enterDone: 'my-done-enter',\n * exit: 'my-exit',\n * exitActive: 'my-active-exit',\n * exitDone: 'my-done-exit',\n * }}\n * ```\n *\n * If you want to set these classes using CSS Modules:\n *\n * ```js\n * import styles from './styles.css';\n * ```\n *\n * you might want to use camelCase in your CSS file, that way could simply\n * spread them instead of listing them one by one:\n *\n * ```js\n * classNames={{ ...styles }}\n * ```\n *\n * @type {string | {\n * appear?: string,\n * appearActive?: string,\n * appearDone?: string,\n * enter?: string,\n * enterActive?: string,\n * enterDone?: string,\n * exit?: string,\n * exitActive?: string,\n * exitDone?: string,\n * }}\n */\n classNames: _PropTypes.classNamesShape,\n\n /**\n * A `\n * \n * \n *\n * {\"I'll receive my-node-* classes\"}\n *\n *` callback fired immediately after the 'enter' or 'appear' class is\n * applied.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEnter: PropTypes.func,\n\n /**\n * A ` ` callback fired immediately after the 'enter-active' or\n * 'appear-active' class is applied.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: PropTypes.func,\n\n /**\n * A ` ` callback fired immediately after the 'enter' or\n * 'appear' classes are **removed** and the `done` class is added to the DOM node.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntered: PropTypes.func,\n\n /**\n * A ` ` callback fired immediately after the 'exit' class is\n * applied.\n *\n * @type Function(node: HtmlElement)\n */\n onExit: PropTypes.func,\n\n /**\n * A ` ` callback fired immediately after the 'exit-active' is applied.\n *\n * @type Function(node: HtmlElement)\n */\n onExiting: PropTypes.func,\n\n /**\n * A ` ` callback fired immediately after the 'exit' classes\n * are **removed** and the `exit-done` class is added to the DOM node.\n *\n * @type Function(node: HtmlElement)\n */\n onExited: PropTypes.func\n}) : {};\nvar _default = CSSTransition;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _reactDom = require(\"react-dom\");\n\nvar _TransitionGroup = _interopRequireDefault(require(\"./TransitionGroup\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\n/**\n * The ` ` component is a specialized `Transition` component\n * that animates between two children.\n *\n * ```jsx\n * \n * \n * ```\n */\nvar ReplaceTransition =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(ReplaceTransition, _React$Component);\n\n function ReplaceTransition() {\n var _this;\n\n for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {\n _args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;\n\n _this.handleEnter = function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return _this.handleLifecycle('onEnter', 0, args);\n };\n\n _this.handleEntering = function () {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n return _this.handleLifecycle('onEntering', 0, args);\n };\n\n _this.handleEntered = function () {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n\n return _this.handleLifecycle('onEntered', 0, args);\n };\n\n _this.handleExit = function () {\n for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n args[_key5] = arguments[_key5];\n }\n\n return _this.handleLifecycle('onExit', 1, args);\n };\n\n _this.handleExiting = function () {\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n args[_key6] = arguments[_key6];\n }\n\n return _this.handleLifecycle('onExiting', 1, args);\n };\n\n _this.handleExited = function () {\n for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {\n args[_key7] = arguments[_key7];\n }\n\n return _this.handleLifecycle('onExited', 1, args);\n };\n\n return _this;\n }\n\n var _proto = ReplaceTransition.prototype;\n\n _proto.handleLifecycle = function handleLifecycle(handler, idx, originalArgs) {\n var _child$props;\n\n var children = this.props.children;\n\n var child = _react.default.Children.toArray(children)[idx];\n\n if (child.props[handler]) (_child$props = child.props)[handler].apply(_child$props, originalArgs);\n if (this.props[handler]) this.props[handler]((0, _reactDom.findDOMNode)(this));\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n children = _this$props.children,\n inProp = _this$props.in,\n props = _objectWithoutPropertiesLoose(_this$props, [\"children\", \"in\"]);\n\n var _React$Children$toArr = _react.default.Children.toArray(children),\n first = _React$Children$toArr[0],\n second = _React$Children$toArr[1];\n\n delete props.onEnter;\n delete props.onEntering;\n delete props.onEntered;\n delete props.onExit;\n delete props.onExiting;\n delete props.onExited;\n return _react.default.createElement(_TransitionGroup.default, props, inProp ? _react.default.cloneElement(first, {\n key: 'first',\n onEnter: this.handleEnter,\n onEntering: this.handleEntering,\n onEntered: this.handleEntered\n }) : _react.default.cloneElement(second, {\n key: 'second',\n onEnter: this.handleExit,\n onEntering: this.handleExiting,\n onEntered: this.handleExited\n }));\n };\n\n return ReplaceTransition;\n}(_react.default.Component);\n\nReplaceTransition.propTypes = process.env.NODE_ENV !== \"production\" ? {\n in: _propTypes.default.bool.isRequired,\n children: function children(props, propName) {\n if (_react.default.Children.count(props[propName]) !== 2) return new Error(\"\\\"\" + propName + \"\\\" must be exactly two transition components.\");\n return null;\n }\n} : {};\nvar _default = ReplaceTransition;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.default = exports.EXITING = exports.ENTERED = exports.ENTERING = exports.EXITED = exports.UNMOUNTED = void 0;\n\nvar PropTypes = _interopRequireWildcard(require(\"prop-types\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _reactDom = _interopRequireDefault(require(\"react-dom\"));\n\nvar _reactLifecyclesCompat = require(\"react-lifecycles-compat\");\n\nvar _PropTypes = require(\"./utils/PropTypes\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar UNMOUNTED = 'unmounted';\nexports.UNMOUNTED = UNMOUNTED;\nvar EXITED = 'exited';\nexports.EXITED = EXITED;\nvar ENTERING = 'entering';\nexports.ENTERING = ENTERING;\nvar ENTERED = 'entered';\nexports.ENTERED = ENTERED;\nvar EXITING = 'exiting';\n/**\n * The Transition component lets you describe a transition from one component\n * state to another _over time_ with a simple declarative API. Most commonly\n * it's used to animate the mounting and unmounting of a component, but can also\n * be used to describe in-place transition states as well.\n *\n * ---\n *\n * **Note**: `Transition` is a platform-agnostic base component. If you're using\n * transitions in CSS, you'll probably want to use\n * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)\n * instead. It inherits all the features of `Transition`, but contains\n * additional features necessary to play nice with CSS transitions (hence the\n * name of the component).\n *\n * ---\n *\n * By default the `Transition` component does not alter the behavior of the\n * component it renders, it only tracks \"enter\" and \"exit\" states for the\n * components. It's up to you to give meaning and effect to those states. For\n * example we can add styles to a component when it enters or exits:\n *\n * ```jsx\n * import { Transition } from 'react-transition-group';\n *\n * const duration = 300;\n *\n * const defaultStyle = {\n * transition: `opacity ${duration}ms ease-in-out`,\n * opacity: 0,\n * }\n *\n * const transitionStyles = {\n * entering: { opacity: 0 },\n * entered: { opacity: 1 },\n * };\n *\n * const Fade = ({ in: inProp }) => (\n *\n * I appear first\n * I replace the above\n * {state => (\n * \n * );\n * ```\n *\n * There are 4 main states a Transition can be in:\n * - `'entering'`\n * - `'entered'`\n * - `'exiting'`\n * - `'exited'`\n *\n * Transition state is toggled via the `in` prop. When `true` the component\n * begins the \"Enter\" stage. During this stage, the component will shift from\n * its current transition state, to `'entering'` for the duration of the\n * transition and then to the `'entered'` stage once it's complete. Let's take\n * the following example (we'll use the\n * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n *\n * I'm a fade Transition!\n *\n * )}\n *\n *\n * );\n * }\n * ```\n *\n * When the button is clicked the component will shift to the `'entering'` state\n * and stay there for 500ms (the value of `timeout`) before it finally switches\n * to `'entered'`.\n *\n * When `in` is `false` the same thing happens except the state moves from\n * `'exiting'` to `'exited'`.\n */\n\nexports.EXITING = EXITING;\n\nvar Transition =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(Transition, _React$Component);\n\n function Transition(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n var parentGroup = context.transitionGroup; // In the context of a TransitionGroup all enters are really appears\n\n var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;\n var initialStatus;\n _this.appearStatus = null;\n\n if (props.in) {\n if (appear) {\n initialStatus = EXITED;\n _this.appearStatus = ENTERING;\n } else {\n initialStatus = ENTERED;\n }\n } else {\n if (props.unmountOnExit || props.mountOnEnter) {\n initialStatus = UNMOUNTED;\n } else {\n initialStatus = EXITED;\n }\n }\n\n _this.state = {\n status: initialStatus\n };\n _this.nextCallback = null;\n return _this;\n }\n\n var _proto = Transition.prototype;\n\n _proto.getChildContext = function getChildContext() {\n return {\n transitionGroup: null // allows for nested Transitions\n\n };\n };\n\n Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {\n var nextIn = _ref.in;\n\n if (nextIn && prevState.status === UNMOUNTED) {\n return {\n status: EXITED\n };\n }\n\n return null;\n }; // getSnapshotBeforeUpdate(prevProps) {\n // let nextStatus = null\n // if (prevProps !== this.props) {\n // const { status } = this.state\n // if (this.props.in) {\n // if (status !== ENTERING && status !== ENTERED) {\n // nextStatus = ENTERING\n // }\n // } else {\n // if (status === ENTERING || status === ENTERED) {\n // nextStatus = EXITING\n // }\n // }\n // }\n // return { nextStatus }\n // }\n\n\n _proto.componentDidMount = function componentDidMount() {\n this.updateStatus(true, this.appearStatus);\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var nextStatus = null;\n\n if (prevProps !== this.props) {\n var status = this.state.status;\n\n if (this.props.in) {\n if (status !== ENTERING && status !== ENTERED) {\n nextStatus = ENTERING;\n }\n } else {\n if (status === ENTERING || status === ENTERED) {\n nextStatus = EXITING;\n }\n }\n }\n\n this.updateStatus(false, nextStatus);\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.cancelNextCallback();\n };\n\n _proto.getTimeouts = function getTimeouts() {\n var timeout = this.props.timeout;\n var exit, enter, appear;\n exit = enter = appear = timeout;\n\n if (timeout != null && typeof timeout !== 'number') {\n exit = timeout.exit;\n enter = timeout.enter; // TODO: remove fallback for next major\n\n appear = timeout.appear !== undefined ? timeout.appear : enter;\n }\n\n return {\n exit: exit,\n enter: enter,\n appear: appear\n };\n };\n\n _proto.updateStatus = function updateStatus(mounting, nextStatus) {\n if (mounting === void 0) {\n mounting = false;\n }\n\n if (nextStatus !== null) {\n // nextStatus will always be ENTERING or EXITING.\n this.cancelNextCallback();\n\n var node = _reactDom.default.findDOMNode(this);\n\n if (nextStatus === ENTERING) {\n this.performEnter(node, mounting);\n } else {\n this.performExit(node);\n }\n } else if (this.props.unmountOnExit && this.state.status === EXITED) {\n this.setState({\n status: UNMOUNTED\n });\n }\n };\n\n _proto.performEnter = function performEnter(node, mounting) {\n var _this2 = this;\n\n var enter = this.props.enter;\n var appearing = this.context.transitionGroup ? this.context.transitionGroup.isMounting : mounting;\n var timeouts = this.getTimeouts();\n var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED\n // if we are mounting and running this it means appear _must_ be set\n\n if (!mounting && !enter) {\n this.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(node);\n });\n return;\n }\n\n this.props.onEnter(node, appearing);\n this.safeSetState({\n status: ENTERING\n }, function () {\n _this2.props.onEntering(node, appearing);\n\n _this2.onTransitionEnd(node, enterTimeout, function () {\n _this2.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(node, appearing);\n });\n });\n });\n };\n\n _proto.performExit = function performExit(node) {\n var _this3 = this;\n\n var exit = this.props.exit;\n var timeouts = this.getTimeouts(); // no exit animation skip right to EXITED\n\n if (!exit) {\n this.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(node);\n });\n return;\n }\n\n this.props.onExit(node);\n this.safeSetState({\n status: EXITING\n }, function () {\n _this3.props.onExiting(node);\n\n _this3.onTransitionEnd(node, timeouts.exit, function () {\n _this3.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(node);\n });\n });\n });\n };\n\n _proto.cancelNextCallback = function cancelNextCallback() {\n if (this.nextCallback !== null) {\n this.nextCallback.cancel();\n this.nextCallback = null;\n }\n };\n\n _proto.safeSetState = function safeSetState(nextState, callback) {\n // This shouldn't be necessary, but there are weird race conditions with\n // setState callbacks and unmounting in testing, so always make sure that\n // we can cancel any pending setState callbacks after we unmount.\n callback = this.setNextCallback(callback);\n this.setState(nextState, callback);\n };\n\n _proto.setNextCallback = function setNextCallback(callback) {\n var _this4 = this;\n\n var active = true;\n\n this.nextCallback = function (event) {\n if (active) {\n active = false;\n _this4.nextCallback = null;\n callback(event);\n }\n };\n\n this.nextCallback.cancel = function () {\n active = false;\n };\n\n return this.nextCallback;\n };\n\n _proto.onTransitionEnd = function onTransitionEnd(node, timeout, handler) {\n this.setNextCallback(handler);\n var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;\n\n if (!node || doesNotHaveTimeoutOrListener) {\n setTimeout(this.nextCallback, 0);\n return;\n }\n\n if (this.props.addEndListener) {\n this.props.addEndListener(node, this.nextCallback);\n }\n\n if (timeout != null) {\n setTimeout(this.nextCallback, timeout);\n }\n };\n\n _proto.render = function render() {\n var status = this.state.status;\n\n if (status === UNMOUNTED) {\n return null;\n }\n\n var _this$props = this.props,\n children = _this$props.children,\n childProps = _objectWithoutPropertiesLoose(_this$props, [\"children\"]); // filter props for Transtition\n\n\n delete childProps.in;\n delete childProps.mountOnEnter;\n delete childProps.unmountOnExit;\n delete childProps.appear;\n delete childProps.enter;\n delete childProps.exit;\n delete childProps.timeout;\n delete childProps.addEndListener;\n delete childProps.onEnter;\n delete childProps.onEntering;\n delete childProps.onEntered;\n delete childProps.onExit;\n delete childProps.onExiting;\n delete childProps.onExited;\n\n if (typeof children === 'function') {\n return children(status, childProps);\n }\n\n var child = _react.default.Children.only(children);\n\n return _react.default.cloneElement(child, childProps);\n };\n\n return Transition;\n}(_react.default.Component);\n\nTransition.contextTypes = {\n transitionGroup: PropTypes.object\n};\nTransition.childContextTypes = {\n transitionGroup: function transitionGroup() {}\n};\nTransition.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * A `function` child can be used instead of a React element. This function is\n * called with the current transition status (`'entering'`, `'entered'`,\n * `'exiting'`, `'exited'`, `'unmounted'`), which can be used to apply context\n * specific props to a component.\n *\n * ```jsx\n *\n * {state => (\n * // ...\n * )}\n * \n * \n *\n * {state => (\n * \n * ```\n */\n children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,\n\n /**\n * Show the component; triggers the enter or exit states\n */\n in: PropTypes.bool,\n\n /**\n * By default the child component is mounted immediately along with\n * the parent `Transition` component. If you want to \"lazy mount\" the component on the\n * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay\n * mounted, even on \"exited\", unless you also specify `unmountOnExit`.\n */\n mountOnEnter: PropTypes.bool,\n\n /**\n * By default the child component stays mounted after it reaches the `'exited'` state.\n * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.\n */\n unmountOnExit: PropTypes.bool,\n\n /**\n * Normally a component is not transitioned if it is shown when the `\n * )}\n * ` component mounts.\n * If you want to transition on the first mount set `appear` to `true`, and the\n * component will transition in as soon as the ` ` mounts.\n *\n * > Note: there are no specific \"appear\" states. `appear` only adds an additional `enter` transition.\n */\n appear: PropTypes.bool,\n\n /**\n * Enable or disable enter transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * Enable or disable exit transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * The duration of the transition, in milliseconds.\n * Required unless `addEndListener` is provided.\n *\n * You may specify a single timeout for all transitions:\n *\n * ```jsx\n * timeout={500}\n * ```\n *\n * or individually:\n *\n * ```jsx\n * timeout={{\n * appear: 500,\n * enter: 300,\n * exit: 500,\n * }}\n * ```\n *\n * - `appear` defaults to the value of `enter`\n * - `enter` defaults to `0`\n * - `exit` defaults to `0`\n *\n * @type {number | { enter?: number, exit?: number, appear?: number }}\n */\n timeout: function timeout(props) {\n var pt = _PropTypes.timeoutsShape;\n if (!props.addEndListener) pt = pt.isRequired;\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return pt.apply(void 0, [props].concat(args));\n },\n\n /**\n * Add a custom transition end trigger. Called with the transitioning\n * DOM node and a `done` callback. Allows for more fine grained transition end\n * logic. **Note:** Timeouts are still used as a fallback if provided.\n *\n * ```jsx\n * addEndListener={(node, done) => {\n * // use the css transitionend event to mark the finish of a transition\n * node.addEventListener('transitionend', done, false);\n * }}\n * ```\n */\n addEndListener: PropTypes.func,\n\n /**\n * Callback fired before the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEnter: PropTypes.func,\n\n /**\n * Callback fired after the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: PropTypes.func,\n\n /**\n * Callback fired after the \"entered\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEntered: PropTypes.func,\n\n /**\n * Callback fired before the \"exiting\" status is applied.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExit: PropTypes.func,\n\n /**\n * Callback fired after the \"exiting\" status is applied.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExiting: PropTypes.func,\n\n /**\n * Callback fired after the \"exited\" status is applied.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExited: PropTypes.func // Name the function so it is clearer in the documentation\n\n} : {};\n\nfunction noop() {}\n\nTransition.defaultProps = {\n in: false,\n mountOnEnter: false,\n unmountOnExit: false,\n appear: false,\n enter: true,\n exit: true,\n onEnter: noop,\n onEntering: noop,\n onEntered: noop,\n onExit: noop,\n onExiting: noop,\n onExited: noop\n};\nTransition.UNMOUNTED = 0;\nTransition.EXITED = 1;\nTransition.ENTERING = 2;\nTransition.ENTERED = 3;\nTransition.EXITING = 4;\n\nvar _default = (0, _reactLifecyclesCompat.polyfill)(Transition);\n\nexports.default = _default;","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _reactLifecyclesCompat = require(\"react-lifecycles-compat\");\n\nvar _ChildMapping = require(\"./utils/ChildMapping\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nvar values = Object.values || function (obj) {\n return Object.keys(obj).map(function (k) {\n return obj[k];\n });\n};\n\nvar defaultProps = {\n component: 'div',\n childFactory: function childFactory(child) {\n return child;\n }\n /**\n * The ` ` component manages a set of transition components\n * (` ` and ` `) in a list. Like with the transition\n * components, ` ` is a state machine for managing the mounting\n * and unmounting of components over time.\n *\n * Consider the example below. As items are removed or added to the TodoList the\n * `in` prop is toggled automatically by the ` `.\n *\n * Note that ` ` does not define any animation behavior!\n * Exactly _how_ a list item animates is up to the individual transition\n * component. This means you can mix and match animations across different list\n * items.\n */\n\n};\n\nvar TransitionGroup =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(TransitionGroup, _React$Component);\n\n function TransitionGroup(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n\n var handleExited = _this.handleExited.bind(_assertThisInitialized(_assertThisInitialized(_this))); // Initial children should all be entering, dependent on appear\n\n\n _this.state = {\n handleExited: handleExited,\n firstRender: true\n };\n return _this;\n }\n\n var _proto = TransitionGroup.prototype;\n\n _proto.getChildContext = function getChildContext() {\n return {\n transitionGroup: {\n isMounting: !this.appeared\n }\n };\n };\n\n _proto.componentDidMount = function componentDidMount() {\n this.appeared = true;\n this.mounted = true;\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.mounted = false;\n };\n\n TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {\n var prevChildMapping = _ref.children,\n handleExited = _ref.handleExited,\n firstRender = _ref.firstRender;\n return {\n children: firstRender ? (0, _ChildMapping.getInitialChildMapping)(nextProps, handleExited) : (0, _ChildMapping.getNextChildMapping)(nextProps, prevChildMapping, handleExited),\n firstRender: false\n };\n };\n\n _proto.handleExited = function handleExited(child, node) {\n var currentChildMapping = (0, _ChildMapping.getChildMapping)(this.props.children);\n if (child.key in currentChildMapping) return;\n\n if (child.props.onExited) {\n child.props.onExited(node);\n }\n\n if (this.mounted) {\n this.setState(function (state) {\n var children = _extends({}, state.children);\n\n delete children[child.key];\n return {\n children: children\n };\n });\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n Component = _this$props.component,\n childFactory = _this$props.childFactory,\n props = _objectWithoutPropertiesLoose(_this$props, [\"component\", \"childFactory\"]);\n\n var children = values(this.state.children).map(childFactory);\n delete props.appear;\n delete props.enter;\n delete props.exit;\n\n if (Component === null) {\n return children;\n }\n\n return _react.default.createElement(Component, props, children);\n };\n\n return TransitionGroup;\n}(_react.default.Component);\n\nTransitionGroup.childContextTypes = {\n transitionGroup: _propTypes.default.object.isRequired\n};\nTransitionGroup.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * ` ` renders a ` ` by default. You can change this\n * behavior by providing a `component` prop.\n * If you use React v16+ and would like to avoid a wrapping `` element\n * you can pass in `component={null}`. This is useful if the wrapping div\n * borks your css styles.\n */\n component: _propTypes.default.any,\n\n /**\n * A set of `` components, that are toggled `in` and out as they\n * leave. the ` ` will inject specific transition props, so\n * remember to spread them through if you are wrapping the ` ` as\n * with our ` ` example.\n *\n * While this component is meant for multiple `Transition` or `CSSTransition`\n * children, sometimes you may want to have a single transition child with\n * content that you want to be transitioned out and in when you change it\n * (e.g. routes, images etc.) In that case you can change the `key` prop of\n * the transition child as you change its content, this will cause\n * `TransitionGroup` to transition the child out and back in.\n */\n children: _propTypes.default.node,\n\n /**\n * A convenience prop that enables or disables appear animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n appear: _propTypes.default.bool,\n\n /**\n * A convenience prop that enables or disables enter animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n enter: _propTypes.default.bool,\n\n /**\n * A convenience prop that enables or disables exit animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n exit: _propTypes.default.bool,\n\n /**\n * You may need to apply reactive updates to a child as it is exiting.\n * This is generally done by using `cloneElement` however in the case of an exiting\n * child the element has already been removed and not accessible to the consumer.\n *\n * If you do need to update a child as it leaves you can provide a `childFactory`\n * to wrap every child, even the ones that are leaving.\n *\n * @type Function(child: ReactElement) -> ReactElement\n */\n childFactory: _propTypes.default.func\n} : {};\nTransitionGroup.defaultProps = defaultProps;\n\nvar _default = (0, _reactLifecyclesCompat.polyfill)(TransitionGroup);\n\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nvar _CSSTransition = _interopRequireDefault(require(\"./CSSTransition\"));\n\nvar _ReplaceTransition = _interopRequireDefault(require(\"./ReplaceTransition\"));\n\nvar _TransitionGroup = _interopRequireDefault(require(\"./TransitionGroup\"));\n\nvar _Transition = _interopRequireDefault(require(\"./Transition\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nmodule.exports = {\n Transition: _Transition.default,\n TransitionGroup: _TransitionGroup.default,\n ReplaceTransition: _ReplaceTransition.default,\n CSSTransition: _CSSTransition.default\n};","\"use strict\";\n\nexports.__esModule = true;\nexports.getChildMapping = getChildMapping;\nexports.mergeChildMappings = mergeChildMappings;\nexports.getInitialChildMapping = getInitialChildMapping;\nexports.getNextChildMapping = getNextChildMapping;\n\nvar _react = require(\"react\");\n\n/**\n * Given `this.props.children`, return an object mapping key to child.\n *\n * @param {*} children `this.props.children`\n * @return {object} Mapping of key to child\n */\nfunction getChildMapping(children, mapFn) {\n var mapper = function mapper(child) {\n return mapFn && (0, _react.isValidElement)(child) ? mapFn(child) : child;\n };\n\n var result = Object.create(null);\n if (children) _react.Children.map(children, function (c) {\n return c;\n }).forEach(function (child) {\n // run the map function here instead so that the key is the computed one\n result[child.key] = mapper(child);\n });\n return result;\n}\n/**\n * When you're adding or removing children some may be added or removed in the\n * same render pass. We want to show *both* since we want to simultaneously\n * animate elements in and out. This function takes a previous set of keys\n * and a new set of keys and merges them with its best guess of the correct\n * ordering. In the future we may expose some of the utilities in\n * ReactMultiChild to make this easy, but for now React itself does not\n * directly have this concept of the union of prevChildren and nextChildren\n * so we implement it here.\n *\n * @param {object} prev prev children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @param {object} next next children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @return {object} a key set that contains all keys in `prev` and all keys\n * in `next` in a reasonable order.\n */\n\n\nfunction mergeChildMappings(prev, next) {\n prev = prev || {};\n next = next || {};\n\n function getValueForKey(key) {\n return key in next ? next[key] : prev[key];\n } // For each key of `next`, the list of keys to insert before that key in\n // the combined list\n\n\n var nextKeysPending = Object.create(null);\n var pendingKeys = [];\n\n for (var prevKey in prev) {\n if (prevKey in next) {\n if (pendingKeys.length) {\n nextKeysPending[prevKey] = pendingKeys;\n pendingKeys = [];\n }\n } else {\n pendingKeys.push(prevKey);\n }\n }\n\n var i;\n var childMapping = {};\n\n for (var nextKey in next) {\n if (nextKeysPending[nextKey]) {\n for (i = 0; i < nextKeysPending[nextKey].length; i++) {\n var pendingNextKey = nextKeysPending[nextKey][i];\n childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);\n }\n }\n\n childMapping[nextKey] = getValueForKey(nextKey);\n } // Finally, add the keys which didn't appear before any key in `next`\n\n\n for (i = 0; i < pendingKeys.length; i++) {\n childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);\n }\n\n return childMapping;\n}\n\nfunction getProp(child, prop, props) {\n return props[prop] != null ? props[prop] : child.props[prop];\n}\n\nfunction getInitialChildMapping(props, onExited) {\n return getChildMapping(props.children, function (child) {\n return (0, _react.cloneElement)(child, {\n onExited: onExited.bind(null, child),\n in: true,\n appear: getProp(child, 'appear', props),\n enter: getProp(child, 'enter', props),\n exit: getProp(child, 'exit', props)\n });\n });\n}\n\nfunction getNextChildMapping(nextProps, prevChildMapping, onExited) {\n var nextChildMapping = getChildMapping(nextProps.children);\n var children = mergeChildMappings(prevChildMapping, nextChildMapping);\n Object.keys(children).forEach(function (key) {\n var child = children[key];\n if (!(0, _react.isValidElement)(child)) return;\n var hasPrev = key in prevChildMapping;\n var hasNext = key in nextChildMapping;\n var prevChild = prevChildMapping[key];\n var isLeaving = (0, _react.isValidElement)(prevChild) && !prevChild.props.in; // item is new (entering)\n\n if (hasNext && (!hasPrev || isLeaving)) {\n // console.log('entering', key)\n children[key] = (0, _react.cloneElement)(child, {\n onExited: onExited.bind(null, child),\n in: true,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n } else if (!hasNext && hasPrev && !isLeaving) {\n // item is old (exiting)\n // console.log('leaving', key)\n children[key] = (0, _react.cloneElement)(child, {\n in: false\n });\n } else if (hasNext && hasPrev && (0, _react.isValidElement)(prevChild)) {\n // item hasn't changed transition states\n // copy over the last transition props;\n // console.log('unchanged', key)\n children[key] = (0, _react.cloneElement)(child, {\n onExited: onExited.bind(null, child),\n in: prevChild.props.in,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n }\n });\n return children;\n}","\"use strict\";\n\nexports.__esModule = true;\nexports.classNamesShape = exports.timeoutsShape = void 0;\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar timeoutsShape = process.env.NODE_ENV !== 'production' ? _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({\n enter: _propTypes.default.number,\n exit: _propTypes.default.number,\n appear: _propTypes.default.number\n}).isRequired]) : null;\nexports.timeoutsShape = timeoutsShape;\nvar classNamesShape = process.env.NODE_ENV !== 'production' ? _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.shape({\n enter: _propTypes.default.string,\n exit: _propTypes.default.string,\n active: _propTypes.default.string\n}), _propTypes.default.shape({\n enter: _propTypes.default.string,\n enterDone: _propTypes.default.string,\n enterActive: _propTypes.default.string,\n exit: _propTypes.default.string,\n exitDone: _propTypes.default.string,\n exitActive: _propTypes.default.string\n})]) : null;\nexports.classNamesShape = classNamesShape;","/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","/**\n * @license React\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var l=Symbol.for(\"react.element\"),n=Symbol.for(\"react.portal\"),p=Symbol.for(\"react.fragment\"),q=Symbol.for(\"react.strict_mode\"),r=Symbol.for(\"react.profiler\"),t=Symbol.for(\"react.provider\"),u=Symbol.for(\"react.context\"),v=Symbol.for(\"react.forward_ref\"),w=Symbol.for(\"react.suspense\"),x=Symbol.for(\"react.memo\"),y=Symbol.for(\"react.lazy\"),z=Symbol.iterator;function A(a){if(null===a||\"object\"!==typeof a)return null;a=z&&a[z]||a[\"@@iterator\"];return\"function\"===typeof a?a:null}\nvar B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}E.prototype.isReactComponent={};\nE.prototype.setState=function(a,b){if(\"object\"!==typeof a&&\"function\"!==typeof a&&null!=a)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,a,b,\"setState\")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,\"forceUpdate\")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}var H=G.prototype=new F;\nH.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};\nfunction M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=\"\"+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1 `require(\"components/pages/index\")`\n// - \"pages/show.Header\" -> `require(\"components/pages/show\").Header`\n// - \"pages/show.Body.Content\" -> `require(\"components/pages/show\").Body.Content`\n//\nmodule.exports = function(reqctx) {\n return function(className) {\n var parts = className.split(\".\")\n var filename = parts.shift()\n var keys = parts\n // Load the module:\n var component = reqctx(\"./\" + filename)\n // Then access each key:\n keys.forEach(function(k) {\n component = component[k]\n })\n // support `export default`\n if (component.__esModule) {\n component = component[\"default\"]\n }\n return component\n }\n}\n","// Make a function which:\n// - First tries to require the name\n// - Then falls back to global lookup\nvar fromGlobal = require(\"./fromGlobal\")\nvar fromRequireContext = require(\"./fromRequireContext\")\n\nmodule.exports = function(reqctx) {\n var fromCtx = fromRequireContext(reqctx)\n return function(className) {\n var component;\n try {\n // `require` will raise an error if this className isn't found:\n component = fromCtx(className)\n } catch (firstErr) {\n // fallback to global:\n try {\n component = fromGlobal(className)\n } catch (secondErr) {\n console.error(firstErr)\n console.error(secondErr)\n }\n }\n return component\n }\n}\n","// Make a function which:\n// - First tries to require the name\n// - Then falls back to global lookup\nvar fromGlobal = require(\"./fromGlobal\")\nvar fromRequireContext = require(\"./fromRequireContext\")\n\nmodule.exports = function(reqctxs) {\n var fromCtxs = reqctxs.map((reqctx) => fromRequireContext(reqctx))\n return function(className) {\n var component;\n try {\n var index = 0, fromCtx, firstErr;\n do {\n fromCtx = fromCtxs[index];\n\n try {\n // `require` will raise an error if this className isn't found:\n component = fromCtx(className)\n } catch (fromCtxErr) {\n if (!firstErr) {\n firstErr = fromCtxErr;\n }\n }\n\n index += 1;\n } while (index < fromCtxs.length);\n if (!component) throw firstErr;\n } catch (firstErr) {\n // fallback to global:\n try {\n component = fromGlobal(className)\n } catch (secondErr) {\n console.error(firstErr)\n console.error(secondErr)\n }\n }\n return component\n }\n}\n","import ReactDOM from \"react-dom\"\nimport supportsRootApi from \"./supportsRootApi\"\n\nlet reactDomClient = ReactDOM\n\nif (supportsRootApi) {\n // This will never throw an exception, but it's the way to tell Webpack the dependency is optional\n // https://github.com/webpack/webpack/issues/339#issuecomment-47739112\n // Unfortunately, it only converts the error to a warning.\n try {\n // eslint-disable-next-line global-require,import/no-unresolved\n reactDomClient = require('react-dom/client');\n } catch (e) {\n // We should never get here, but if we do, we'll just use the default ReactDOM\n // and live with the warning.\n reactDomClient = ReactDOM;\n }\n}\n\nexport default reactDomClient\n","import ReactDOM from \"./reactDomClient\"\nimport supportsRootApi from \"./supportsRootApi\"\n\nexport function supportsHydration() {\n return typeof ReactDOM.hydrate === \"function\" || typeof ReactDOM.hydrateRoot === \"function\"\n}\n\nexport function reactHydrate(node, component) {\n if (typeof ReactDOM.hydrateRoot === \"function\") {\n return ReactDOM.hydrateRoot(node, component)\n } else {\n return ReactDOM.hydrate(component, node)\n }\n}\n\nexport function createReactRootLike(node) {\n if(supportsRootApi) {\n return ReactDOM.createRoot(node)\n }\n return legacyReactRootLike(node)\n}\n\nfunction legacyReactRootLike(node) {\n const root = {\n render(component) {\n return ReactDOM.render(component, node)\n }\n }\n return root\n}\n","var ReactDOM = require(\"react-dom\")\n\nvar reactMajorVersion, supportsRootApi;\nif (typeof ReactDOM != \"undefined\") {\n reactMajorVersion = ReactDOM.version.split('.')[0] || 16\n\n // TODO: once we require React 18, we can remove this and inline everything guarded by it.\n supportsRootApi = reactMajorVersion >= 18\n} else {\n supportsRootApi = false\n}\n\nmodule.exports = supportsRootApi\n","/**\n * @fileOverview Cross\n */\n\nexport var Cell = function Cell(_props) {\n return null;\n};\nCell.displayName = 'Cell';","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nimport _isObject from \"lodash/isObject\";\nimport _isFunction from \"lodash/isFunction\";\nimport _isNil from \"lodash/isNil\";\nimport _last from \"lodash/last\";\nimport _isArray from \"lodash/isArray\";\nvar _excluded = [\"valueAccessor\"],\n _excluded2 = [\"data\", \"dataKey\", \"clockWise\", \"id\", \"textBreakAll\"];\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nimport React, { cloneElement } from 'react';\nimport { Label } from './Label';\nimport { Layer } from '../container/Layer';\nimport { findAllByType, filterProps } from '../util/ReactUtils';\nimport { getValueByDataKey } from '../util/ChartUtils';\nvar defaultAccessor = function defaultAccessor(entry) {\n return _isArray(entry.value) ? _last(entry.value) : entry.value;\n};\nexport function LabelList(_ref) {\n var _ref$valueAccessor = _ref.valueAccessor,\n valueAccessor = _ref$valueAccessor === void 0 ? defaultAccessor : _ref$valueAccessor,\n restProps = _objectWithoutProperties(_ref, _excluded);\n var data = restProps.data,\n dataKey = restProps.dataKey,\n clockWise = restProps.clockWise,\n id = restProps.id,\n textBreakAll = restProps.textBreakAll,\n others = _objectWithoutProperties(restProps, _excluded2);\n if (!data || !data.length) {\n return null;\n }\n return /*#__PURE__*/React.createElement(Layer, {\n className: \"recharts-label-list\"\n }, data.map(function (entry, index) {\n var value = _isNil(dataKey) ? valueAccessor(entry, index) : getValueByDataKey(entry && entry.payload, dataKey);\n var idProps = _isNil(id) ? {} : {\n id: \"\".concat(id, \"-\").concat(index)\n };\n return /*#__PURE__*/React.createElement(Label, _extends({}, filterProps(entry, true), others, idProps, {\n parentViewBox: entry.parentViewBox,\n index: index,\n value: value,\n textBreakAll: textBreakAll,\n viewBox: Label.parseViewBox(_isNil(clockWise) ? entry : _objectSpread(_objectSpread({}, entry), {}, {\n clockWise: clockWise\n })),\n key: \"label-\".concat(index) // eslint-disable-line react/no-array-index-key\n }));\n }));\n}\n\nLabelList.displayName = 'LabelList';\nfunction parseLabelList(label, data) {\n if (!label) {\n return null;\n }\n if (label === true) {\n return /*#__PURE__*/React.createElement(LabelList, {\n key: \"labelList-implicit\",\n data: data\n });\n }\n if ( /*#__PURE__*/React.isValidElement(label) || _isFunction(label)) {\n return /*#__PURE__*/React.createElement(LabelList, {\n key: \"labelList-implicit\",\n data: data,\n content: label\n });\n }\n if (_isObject(label)) {\n return /*#__PURE__*/React.createElement(LabelList, _extends({\n data: data\n }, label, {\n key: \"labelList-implicit\"\n }));\n }\n return null;\n}\nfunction renderCallByParent(parentProps, data) {\n var checkPropsLabel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n if (!parentProps || !parentProps.children && checkPropsLabel && !parentProps.label) {\n return null;\n }\n var children = parentProps.children;\n var explicitChildren = findAllByType(children, LabelList).map(function (child, index) {\n return /*#__PURE__*/cloneElement(child, {\n data: data,\n // eslint-disable-next-line react/no-array-index-key\n key: \"labelList-\".concat(index)\n });\n });\n if (!checkPropsLabel) {\n return explicitChildren;\n }\n var implicitLabelList = parseLabelList(parentProps.label, data);\n return [implicitLabelList].concat(_toConsumableArray(explicitChildren));\n}\nLabelList.renderCallByParent = renderCallByParent;","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _excluded = [\"x\", \"y\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nimport React from 'react';\nimport { Shape } from './ActiveShapeUtils';\n\n// Rectangle props is expecting x, y, height, width as numbers, name as a string, and radius as a custom type\n// When props are being spread in from a user defined component in Bar,\n// the prop types of an SVGElement have these typed as something else.\n// This function will return the passed in props\n// along with x, y, height as numbers, name as a string, and radius as number | [number, numbe, number, number]\nfunction typeguardBarRectangleProps(_ref, props) {\n var xProp = _ref.x,\n yProp = _ref.y,\n option = _objectWithoutProperties(_ref, _excluded);\n var xValue = \"\".concat(xProp);\n var x = parseInt(xValue, 10);\n var yValue = \"\".concat(yProp);\n var y = parseInt(yValue, 10);\n var heightValue = \"\".concat(props.height || option.height);\n var height = parseInt(heightValue, 10);\n var widthValue = \"\".concat(props.width || option.width);\n var width = parseInt(widthValue, 10);\n return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, props), option), x ? {\n x: x\n } : {}), y ? {\n y: y\n } : {}), {}, {\n height: height,\n width: width,\n name: props.name,\n radius: props.radius\n });\n}\nexport function BarRectangle(props) {\n return /*#__PURE__*/React.createElement(Shape, _extends({\n shapeType: \"rectangle\",\n propTransformer: typeguardBarRectangleProps,\n activeClassName: \"recharts-active-bar\"\n }, props));\n}","import _isNil from \"lodash/isNil\";\nimport _isEqual from \"lodash/isEqual\";\nimport _isArray from \"lodash/isArray\";\nvar _excluded = [\"value\", \"background\"];\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n/**\n * @fileOverview Render a group of bar\n */\nimport React, { PureComponent } from 'react';\nimport classNames from 'classnames';\nimport Animate from 'react-smooth';\nimport { Layer } from '../container/Layer';\nimport { ErrorBar } from './ErrorBar';\nimport { Cell } from '../component/Cell';\nimport { LabelList } from '../component/LabelList';\nimport { uniqueId, mathSign, interpolateNumber } from '../util/DataUtils';\nimport { filterProps, findAllByType } from '../util/ReactUtils';\nimport { Global } from '../util/Global';\nimport { getCateCoordinateOfBar, getValueByDataKey, truncateByDomain, getBaseValueOfBar, findPositionOfBar, getTooltipItem } from '../util/ChartUtils';\nimport { adaptEventsOfChild } from '../util/types';\nimport { BarRectangle } from '../util/BarUtils';\nexport var Bar = /*#__PURE__*/function (_PureComponent) {\n _inherits(Bar, _PureComponent);\n var _super = _createSuper(Bar);\n function Bar() {\n var _this;\n _classCallCheck(this, Bar);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n isAnimationFinished: false\n });\n _defineProperty(_assertThisInitialized(_this), \"id\", uniqueId('recharts-bar-'));\n _defineProperty(_assertThisInitialized(_this), \"handleAnimationEnd\", function () {\n var onAnimationEnd = _this.props.onAnimationEnd;\n _this.setState({\n isAnimationFinished: true\n });\n if (onAnimationEnd) {\n onAnimationEnd();\n }\n });\n _defineProperty(_assertThisInitialized(_this), \"handleAnimationStart\", function () {\n var onAnimationStart = _this.props.onAnimationStart;\n _this.setState({\n isAnimationFinished: false\n });\n if (onAnimationStart) {\n onAnimationStart();\n }\n });\n return _this;\n }\n _createClass(Bar, [{\n key: \"renderRectanglesStatically\",\n value: function renderRectanglesStatically(data) {\n var _this2 = this;\n var _this$props = this.props,\n shape = _this$props.shape,\n dataKey = _this$props.dataKey,\n activeIndex = _this$props.activeIndex,\n activeBar = _this$props.activeBar;\n var baseProps = filterProps(this.props);\n return data && data.map(function (entry, i) {\n var isActive = i === activeIndex;\n var option = isActive ? activeBar : shape;\n var props = _objectSpread(_objectSpread(_objectSpread({}, baseProps), entry), {}, {\n isActive: isActive,\n option: option,\n index: i,\n dataKey: dataKey,\n onAnimationStart: _this2.handleAnimationStart,\n onAnimationEnd: _this2.handleAnimationEnd\n });\n return /*#__PURE__*/React.createElement(Layer, _extends({\n className: \"recharts-bar-rectangle\"\n }, adaptEventsOfChild(_this2.props, entry, i), {\n key: \"rectangle-\".concat(i) // eslint-disable-line react/no-array-index-key\n }), /*#__PURE__*/React.createElement(BarRectangle, props));\n });\n }\n }, {\n key: \"renderRectanglesWithAnimation\",\n value: function renderRectanglesWithAnimation() {\n var _this3 = this;\n var _this$props2 = this.props,\n data = _this$props2.data,\n layout = _this$props2.layout,\n isAnimationActive = _this$props2.isAnimationActive,\n animationBegin = _this$props2.animationBegin,\n animationDuration = _this$props2.animationDuration,\n animationEasing = _this$props2.animationEasing,\n animationId = _this$props2.animationId;\n var prevData = this.state.prevData;\n return /*#__PURE__*/React.createElement(Animate, {\n begin: animationBegin,\n duration: animationDuration,\n isActive: isAnimationActive,\n easing: animationEasing,\n from: {\n t: 0\n },\n to: {\n t: 1\n },\n key: \"bar-\".concat(animationId),\n onAnimationEnd: this.handleAnimationEnd,\n onAnimationStart: this.handleAnimationStart\n }, function (_ref) {\n var t = _ref.t;\n var stepData = data.map(function (entry, index) {\n var prev = prevData && prevData[index];\n if (prev) {\n var interpolatorX = interpolateNumber(prev.x, entry.x);\n var interpolatorY = interpolateNumber(prev.y, entry.y);\n var interpolatorWidth = interpolateNumber(prev.width, entry.width);\n var interpolatorHeight = interpolateNumber(prev.height, entry.height);\n return _objectSpread(_objectSpread({}, entry), {}, {\n x: interpolatorX(t),\n y: interpolatorY(t),\n width: interpolatorWidth(t),\n height: interpolatorHeight(t)\n });\n }\n if (layout === 'horizontal') {\n var _interpolatorHeight = interpolateNumber(0, entry.height);\n var h = _interpolatorHeight(t);\n return _objectSpread(_objectSpread({}, entry), {}, {\n y: entry.y + entry.height - h,\n height: h\n });\n }\n var interpolator = interpolateNumber(0, entry.width);\n var w = interpolator(t);\n return _objectSpread(_objectSpread({}, entry), {}, {\n width: w\n });\n });\n return /*#__PURE__*/React.createElement(Layer, null, _this3.renderRectanglesStatically(stepData));\n });\n }\n }, {\n key: \"renderRectangles\",\n value: function renderRectangles() {\n var _this$props3 = this.props,\n data = _this$props3.data,\n isAnimationActive = _this$props3.isAnimationActive;\n var prevData = this.state.prevData;\n if (isAnimationActive && data && data.length && (!prevData || !_isEqual(prevData, data))) {\n return this.renderRectanglesWithAnimation();\n }\n return this.renderRectanglesStatically(data);\n }\n }, {\n key: \"renderBackground\",\n value: function renderBackground() {\n var _this4 = this;\n var _this$props4 = this.props,\n data = _this$props4.data,\n dataKey = _this$props4.dataKey,\n activeIndex = _this$props4.activeIndex;\n var backgroundProps = filterProps(this.props.background);\n return data.map(function (entry, i) {\n var value = entry.value,\n background = entry.background,\n rest = _objectWithoutProperties(entry, _excluded);\n if (!background) {\n return null;\n }\n var props = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, rest), {}, {\n fill: '#eee'\n }, background), backgroundProps), adaptEventsOfChild(_this4.props, entry, i)), {}, {\n onAnimationStart: _this4.handleAnimationStart,\n onAnimationEnd: _this4.handleAnimationEnd,\n dataKey: dataKey,\n index: i,\n key: \"background-bar-\".concat(i),\n className: 'recharts-bar-background-rectangle'\n });\n return /*#__PURE__*/React.createElement(BarRectangle, _extends({\n option: _this4.props.background,\n isActive: i === activeIndex\n }, props));\n });\n }\n }, {\n key: \"renderErrorBar\",\n value: function renderErrorBar(needClip, clipPathId) {\n if (this.props.isAnimationActive && !this.state.isAnimationFinished) {\n return null;\n }\n var _this$props5 = this.props,\n data = _this$props5.data,\n xAxis = _this$props5.xAxis,\n yAxis = _this$props5.yAxis,\n layout = _this$props5.layout,\n children = _this$props5.children;\n var errorBarItems = findAllByType(children, ErrorBar);\n if (!errorBarItems) {\n return null;\n }\n var offset = layout === 'vertical' ? data[0].height / 2 : data[0].width / 2;\n var dataPointFormatter = function dataPointFormatter(dataPoint, dataKey) {\n /**\n * if the value coming from `getComposedData` is an array then this is a stacked bar chart.\n * arr[1] represents end value of the bar since the data is in the form of [startValue, endValue].\n * */\n var value = Array.isArray(dataPoint.value) ? dataPoint.value[1] : dataPoint.value;\n return {\n x: dataPoint.x,\n y: dataPoint.y,\n value: value,\n errorVal: getValueByDataKey(dataPoint, dataKey)\n };\n };\n var errorBarProps = {\n clipPath: needClip ? \"url(#clipPath-\".concat(clipPathId, \")\") : null\n };\n return /*#__PURE__*/React.createElement(Layer, errorBarProps, errorBarItems.map(function (item, i) {\n return /*#__PURE__*/React.cloneElement(item, {\n key: \"error-bar-\".concat(i),\n // eslint-disable-line react/no-array-index-key\n data: data,\n xAxis: xAxis,\n yAxis: yAxis,\n layout: layout,\n offset: offset,\n dataPointFormatter: dataPointFormatter\n });\n }));\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props6 = this.props,\n hide = _this$props6.hide,\n data = _this$props6.data,\n className = _this$props6.className,\n xAxis = _this$props6.xAxis,\n yAxis = _this$props6.yAxis,\n left = _this$props6.left,\n top = _this$props6.top,\n width = _this$props6.width,\n height = _this$props6.height,\n isAnimationActive = _this$props6.isAnimationActive,\n background = _this$props6.background,\n id = _this$props6.id;\n if (hide || !data || !data.length) {\n return null;\n }\n var isAnimationFinished = this.state.isAnimationFinished;\n var layerClass = classNames('recharts-bar', className);\n var needClipX = xAxis && xAxis.allowDataOverflow;\n var needClipY = yAxis && yAxis.allowDataOverflow;\n var needClip = needClipX || needClipY;\n var clipPathId = _isNil(id) ? this.id : id;\n return /*#__PURE__*/React.createElement(Layer, {\n className: layerClass\n }, needClipX || needClipY ? /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"clipPath\", {\n id: \"clipPath-\".concat(clipPathId)\n }, /*#__PURE__*/React.createElement(\"rect\", {\n x: needClipX ? left : left - width / 2,\n y: needClipY ? top : top - height / 2,\n width: needClipX ? width : width * 2,\n height: needClipY ? height : height * 2\n }))) : null, /*#__PURE__*/React.createElement(Layer, {\n className: \"recharts-bar-rectangles\",\n clipPath: needClip ? \"url(#clipPath-\".concat(clipPathId, \")\") : null\n }, background ? this.renderBackground() : null, this.renderRectangles()), this.renderErrorBar(needClip, clipPathId), (!isAnimationActive || isAnimationFinished) && LabelList.renderCallByParent(this.props, data));\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps, prevState) {\n if (nextProps.animationId !== prevState.prevAnimationId) {\n return {\n prevAnimationId: nextProps.animationId,\n curData: nextProps.data,\n prevData: prevState.curData\n };\n }\n if (nextProps.data !== prevState.curData) {\n return {\n curData: nextProps.data\n };\n }\n return null;\n }\n }]);\n return Bar;\n}(PureComponent);\n_defineProperty(Bar, \"displayName\", 'Bar');\n_defineProperty(Bar, \"defaultProps\", {\n xAxisId: 0,\n yAxisId: 0,\n legendType: 'rect',\n minPointSize: 0,\n hide: false,\n data: [],\n layout: 'vertical',\n activeBar: true,\n isAnimationActive: !Global.isSsr,\n animationBegin: 0,\n animationDuration: 400,\n animationEasing: 'ease'\n});\n/**\n * Compose the data of each group\n * @param {Object} props Props for the component\n * @param {Object} item An instance of Bar\n * @param {Array} barPosition The offset and size of each bar\n * @param {Object} xAxis The configuration of x-axis\n * @param {Object} yAxis The configuration of y-axis\n * @param {Array} stackedData The stacked data of a bar item\n * @return{Array} Composed data\n */\n_defineProperty(Bar, \"getComposedData\", function (_ref2) {\n var props = _ref2.props,\n item = _ref2.item,\n barPosition = _ref2.barPosition,\n bandSize = _ref2.bandSize,\n xAxis = _ref2.xAxis,\n yAxis = _ref2.yAxis,\n xAxisTicks = _ref2.xAxisTicks,\n yAxisTicks = _ref2.yAxisTicks,\n stackedData = _ref2.stackedData,\n dataStartIndex = _ref2.dataStartIndex,\n displayedData = _ref2.displayedData,\n offset = _ref2.offset;\n var pos = findPositionOfBar(barPosition, item);\n if (!pos) {\n return null;\n }\n var layout = props.layout;\n var _item$props = item.props,\n dataKey = _item$props.dataKey,\n children = _item$props.children,\n minPointSize = _item$props.minPointSize;\n var numericAxis = layout === 'horizontal' ? yAxis : xAxis;\n var stackedDomain = stackedData ? numericAxis.scale.domain() : null;\n var baseValue = getBaseValueOfBar({\n numericAxis: numericAxis\n });\n var cells = findAllByType(children, Cell);\n var rects = displayedData.map(function (entry, index) {\n var value, x, y, width, height, background;\n if (stackedData) {\n value = truncateByDomain(stackedData[dataStartIndex + index], stackedDomain);\n } else {\n value = getValueByDataKey(entry, dataKey);\n if (!_isArray(value)) {\n value = [baseValue, value];\n }\n }\n if (layout === 'horizontal') {\n var _ref4;\n var _ref3 = [yAxis.scale(value[0]), yAxis.scale(value[1])],\n baseValueScale = _ref3[0],\n currentValueScale = _ref3[1];\n x = getCateCoordinateOfBar({\n axis: xAxis,\n ticks: xAxisTicks,\n bandSize: bandSize,\n offset: pos.offset,\n entry: entry,\n index: index\n });\n y = (_ref4 = currentValueScale !== null && currentValueScale !== void 0 ? currentValueScale : baseValueScale) !== null && _ref4 !== void 0 ? _ref4 : undefined;\n width = pos.size;\n var computedHeight = baseValueScale - currentValueScale;\n height = Number.isNaN(computedHeight) ? 0 : computedHeight;\n background = {\n x: x,\n y: yAxis.y,\n width: width,\n height: yAxis.height\n };\n if (Math.abs(minPointSize) > 0 && Math.abs(height) < Math.abs(minPointSize)) {\n var delta = mathSign(height || minPointSize) * (Math.abs(minPointSize) - Math.abs(height));\n y -= delta;\n height += delta;\n }\n } else {\n var _ref5 = [xAxis.scale(value[0]), xAxis.scale(value[1])],\n _baseValueScale = _ref5[0],\n _currentValueScale = _ref5[1];\n x = _baseValueScale;\n y = getCateCoordinateOfBar({\n axis: yAxis,\n ticks: yAxisTicks,\n bandSize: bandSize,\n offset: pos.offset,\n entry: entry,\n index: index\n });\n width = _currentValueScale - _baseValueScale;\n height = pos.size;\n background = {\n x: xAxis.x,\n y: y,\n width: xAxis.width,\n height: height\n };\n if (Math.abs(minPointSize) > 0 && Math.abs(width) < Math.abs(minPointSize)) {\n var _delta = mathSign(width || minPointSize) * (Math.abs(minPointSize) - Math.abs(width));\n width += _delta;\n }\n }\n return _objectSpread(_objectSpread(_objectSpread({}, entry), {}, {\n x: x,\n y: y,\n width: width,\n height: height,\n value: stackedData ? value : value[1],\n payload: entry,\n background: background\n }, cells && cells[index] && cells[index].props), {}, {\n tooltipPayload: [getTooltipItem(item, entry)],\n tooltipPosition: {\n x: x + width / 2,\n y: y + height / 2\n }\n });\n });\n return _objectSpread({\n data: rects,\n layout: layout\n }, offset);\n});","import _isFunction from \"lodash/isFunction\";\nvar _excluded = [\"x1\", \"y1\", \"x2\", \"y2\", \"key\"],\n _excluded2 = [\"offset\"];\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n/**\n * @fileOverview Cartesian Grid\n */\nimport React, { PureComponent } from 'react';\nimport { isNumber } from '../util/DataUtils';\nimport { filterProps } from '../util/ReactUtils';\nexport var CartesianGrid = /*#__PURE__*/function (_PureComponent) {\n _inherits(CartesianGrid, _PureComponent);\n var _super = _createSuper(CartesianGrid);\n function CartesianGrid() {\n _classCallCheck(this, CartesianGrid);\n return _super.apply(this, arguments);\n }\n _createClass(CartesianGrid, [{\n key: \"renderHorizontal\",\n value:\n /**\n * Draw the horizontal grid lines\n * @param {Array} horizontalPoints either passed in as props or generated from function\n * @return {Group} Horizontal lines\n */\n function renderHorizontal(horizontalPoints) {\n var _this = this;\n var _this$props = this.props,\n x = _this$props.x,\n width = _this$props.width,\n horizontal = _this$props.horizontal;\n if (!horizontalPoints || !horizontalPoints.length) {\n return null;\n }\n var items = horizontalPoints.map(function (entry, i) {\n var props = _objectSpread(_objectSpread({}, _this.props), {}, {\n x1: x,\n y1: entry,\n x2: x + width,\n y2: entry,\n key: \"line-\".concat(i),\n index: i\n });\n return CartesianGrid.renderLineItem(horizontal, props);\n });\n return /*#__PURE__*/React.createElement(\"g\", {\n className: \"recharts-cartesian-grid-horizontal\"\n }, items);\n }\n\n /**\n * Draw vertical grid lines\n * @param {Array} verticalPoints either passed in as props or generated from function\n * @return {Group} Vertical lines\n */\n }, {\n key: \"renderVertical\",\n value: function renderVertical(verticalPoints) {\n var _this2 = this;\n var _this$props2 = this.props,\n y = _this$props2.y,\n height = _this$props2.height,\n vertical = _this$props2.vertical;\n if (!verticalPoints || !verticalPoints.length) {\n return null;\n }\n var items = verticalPoints.map(function (entry, i) {\n var props = _objectSpread(_objectSpread({}, _this2.props), {}, {\n x1: entry,\n y1: y,\n x2: entry,\n y2: y + height,\n key: \"line-\".concat(i),\n index: i\n });\n return CartesianGrid.renderLineItem(vertical, props);\n });\n return /*#__PURE__*/React.createElement(\"g\", {\n className: \"recharts-cartesian-grid-vertical\"\n }, items);\n }\n\n /**\n * Draw vertical grid stripes filled by colors\n * @param {Array} verticalPoints either passed in as props or generated from function\n * @return {Group} Vertical stripes\n */\n }, {\n key: \"renderVerticalStripes\",\n value: function renderVerticalStripes(verticalPoints) {\n var verticalFill = this.props.verticalFill;\n if (!verticalFill || !verticalFill.length) {\n return null;\n }\n var _this$props3 = this.props,\n fillOpacity = _this$props3.fillOpacity,\n x = _this$props3.x,\n y = _this$props3.y,\n width = _this$props3.width,\n height = _this$props3.height;\n var roundedSortedVerticalPoints = verticalPoints.map(function (e) {\n return Math.round(e + x - x);\n }).sort(function (a, b) {\n return a - b;\n });\n if (x !== roundedSortedVerticalPoints[0]) {\n roundedSortedVerticalPoints.unshift(0);\n }\n var items = roundedSortedVerticalPoints.map(function (entry, i) {\n var lastStripe = !roundedSortedVerticalPoints[i + 1];\n var lineWidth = lastStripe ? x + width - entry : roundedSortedVerticalPoints[i + 1] - entry;\n if (lineWidth <= 0) {\n return null;\n }\n var colorIndex = i % verticalFill.length;\n return /*#__PURE__*/React.createElement(\"rect\", {\n key: \"react-\".concat(i) // eslint-disable-line react/no-array-index-key\n ,\n x: entry,\n y: y,\n width: lineWidth,\n height: height,\n stroke: \"none\",\n fill: verticalFill[colorIndex],\n fillOpacity: fillOpacity,\n className: \"recharts-cartesian-grid-bg\"\n });\n });\n return /*#__PURE__*/React.createElement(\"g\", {\n className: \"recharts-cartesian-gridstripes-vertical\"\n }, items);\n }\n\n /**\n * Draw horizontal grid stripes filled by colors\n * @param {Array} horizontalPoints either passed in as props or generated from function\n * @return {Group} Horizontal stripes\n */\n }, {\n key: \"renderHorizontalStripes\",\n value: function renderHorizontalStripes(horizontalPoints) {\n var horizontalFill = this.props.horizontalFill;\n if (!horizontalFill || !horizontalFill.length) {\n return null;\n }\n var _this$props4 = this.props,\n fillOpacity = _this$props4.fillOpacity,\n x = _this$props4.x,\n y = _this$props4.y,\n width = _this$props4.width,\n height = _this$props4.height;\n var roundedSortedHorizontalPoints = horizontalPoints.map(function (e) {\n return Math.round(e + y - y);\n }).sort(function (a, b) {\n return a - b;\n });\n if (y !== roundedSortedHorizontalPoints[0]) {\n roundedSortedHorizontalPoints.unshift(0);\n }\n var items = roundedSortedHorizontalPoints.map(function (entry, i) {\n var lastStripe = !roundedSortedHorizontalPoints[i + 1];\n var lineHeight = lastStripe ? y + height - entry : roundedSortedHorizontalPoints[i + 1] - entry;\n if (lineHeight <= 0) {\n return null;\n }\n var colorIndex = i % horizontalFill.length;\n return /*#__PURE__*/React.createElement(\"rect\", {\n key: \"react-\".concat(i) // eslint-disable-line react/no-array-index-key\n ,\n y: entry,\n x: x,\n height: lineHeight,\n width: width,\n stroke: \"none\",\n fill: horizontalFill[colorIndex],\n fillOpacity: fillOpacity,\n className: \"recharts-cartesian-grid-bg\"\n });\n });\n return /*#__PURE__*/React.createElement(\"g\", {\n className: \"recharts-cartesian-gridstripes-horizontal\"\n }, items);\n }\n }, {\n key: \"renderBackground\",\n value: function renderBackground() {\n var fill = this.props.fill;\n if (!fill || fill === 'none') {\n return null;\n }\n var _this$props5 = this.props,\n fillOpacity = _this$props5.fillOpacity,\n x = _this$props5.x,\n y = _this$props5.y,\n width = _this$props5.width,\n height = _this$props5.height;\n return /*#__PURE__*/React.createElement(\"rect\", {\n x: x,\n y: y,\n width: width,\n height: height,\n stroke: \"none\",\n fill: fill,\n fillOpacity: fillOpacity,\n className: \"recharts-cartesian-grid-bg\"\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props6 = this.props,\n x = _this$props6.x,\n y = _this$props6.y,\n width = _this$props6.width,\n height = _this$props6.height,\n horizontal = _this$props6.horizontal,\n vertical = _this$props6.vertical,\n horizontalCoordinatesGenerator = _this$props6.horizontalCoordinatesGenerator,\n verticalCoordinatesGenerator = _this$props6.verticalCoordinatesGenerator,\n xAxis = _this$props6.xAxis,\n yAxis = _this$props6.yAxis,\n offset = _this$props6.offset,\n chartWidth = _this$props6.chartWidth,\n chartHeight = _this$props6.chartHeight,\n syncWithTicks = _this$props6.syncWithTicks,\n horizontalValues = _this$props6.horizontalValues,\n verticalValues = _this$props6.verticalValues;\n if (!isNumber(width) || width <= 0 || !isNumber(height) || height <= 0 || !isNumber(x) || x !== +x || !isNumber(y) || y !== +y) {\n return null;\n }\n var _this$props7 = this.props,\n horizontalPoints = _this$props7.horizontalPoints,\n verticalPoints = _this$props7.verticalPoints;\n\n // No horizontal points are specified\n if ((!horizontalPoints || !horizontalPoints.length) && _isFunction(horizontalCoordinatesGenerator)) {\n var isHorizontalValues = horizontalValues && horizontalValues.length;\n horizontalPoints = horizontalCoordinatesGenerator({\n yAxis: yAxis ? _objectSpread(_objectSpread({}, yAxis), {}, {\n ticks: isHorizontalValues ? horizontalValues : yAxis.ticks\n }) : undefined,\n width: chartWidth,\n height: chartHeight,\n offset: offset\n }, isHorizontalValues ? true : syncWithTicks);\n }\n\n // No vertical points are specified\n if ((!verticalPoints || !verticalPoints.length) && _isFunction(verticalCoordinatesGenerator)) {\n var isVerticalValues = verticalValues && verticalValues.length;\n verticalPoints = verticalCoordinatesGenerator({\n xAxis: xAxis ? _objectSpread(_objectSpread({}, xAxis), {}, {\n ticks: isVerticalValues ? verticalValues : xAxis.ticks\n }) : undefined,\n width: chartWidth,\n height: chartHeight,\n offset: offset\n }, isVerticalValues ? true : syncWithTicks);\n }\n return /*#__PURE__*/React.createElement(\"g\", {\n className: \"recharts-cartesian-grid\"\n }, this.renderBackground(), horizontal && this.renderHorizontal(horizontalPoints), vertical && this.renderVertical(verticalPoints), horizontal && this.renderHorizontalStripes(horizontalPoints), vertical && this.renderVerticalStripes(verticalPoints));\n }\n }], [{\n key: \"renderLineItem\",\n value: function renderLineItem(option, props) {\n var lineItem;\n if ( /*#__PURE__*/React.isValidElement(option)) {\n lineItem = /*#__PURE__*/React.cloneElement(option, props);\n } else if (_isFunction(option)) {\n lineItem = option(props);\n } else {\n var x1 = props.x1,\n y1 = props.y1,\n x2 = props.x2,\n y2 = props.y2,\n key = props.key,\n others = _objectWithoutProperties(props, _excluded);\n var _filterProps = filterProps(others),\n __ = _filterProps.offset,\n restOfFilteredProps = _objectWithoutProperties(_filterProps, _excluded2);\n lineItem = /*#__PURE__*/React.createElement(\"line\", _extends({}, restOfFilteredProps, {\n x1: x1,\n y1: y1,\n x2: x2,\n y2: y2,\n fill: \"none\",\n key: key\n }));\n }\n return lineItem;\n }\n }]);\n return CartesianGrid;\n}(PureComponent);\n_defineProperty(CartesianGrid, \"displayName\", 'CartesianGrid');\n_defineProperty(CartesianGrid, \"defaultProps\", {\n horizontal: true,\n vertical: true,\n // The ordinates of horizontal grid lines\n horizontalPoints: [],\n // The abscissas of vertical grid lines\n verticalPoints: [],\n stroke: '#ccc',\n fill: 'none',\n // The fill of colors of grid lines\n verticalFill: [],\n horizontalFill: []\n});","var _excluded = [\"offset\", \"layout\", \"width\", \"dataKey\", \"data\", \"dataPointFormatter\", \"xAxis\", \"yAxis\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n/**\n * @fileOverview Render a group of error bar\n */\nimport React from 'react';\nimport { Layer } from '../container/Layer';\nimport { filterProps } from '../util/ReactUtils';\nexport function ErrorBar(props) {\n var offset = props.offset,\n layout = props.layout,\n width = props.width,\n dataKey = props.dataKey,\n data = props.data,\n dataPointFormatter = props.dataPointFormatter,\n xAxis = props.xAxis,\n yAxis = props.yAxis,\n others = _objectWithoutProperties(props, _excluded);\n var svgProps = filterProps(others);\n var errorBars = data.map(function (entry, i) {\n var _dataPointFormatter = dataPointFormatter(entry, dataKey),\n x = _dataPointFormatter.x,\n y = _dataPointFormatter.y,\n value = _dataPointFormatter.value,\n errorVal = _dataPointFormatter.errorVal;\n if (!errorVal) {\n return null;\n }\n var lineCoordinates = [];\n var lowBound, highBound;\n if (Array.isArray(errorVal)) {\n var _errorVal = _slicedToArray(errorVal, 2);\n lowBound = _errorVal[0];\n highBound = _errorVal[1];\n } else {\n lowBound = highBound = errorVal;\n }\n if (layout === 'vertical') {\n // error bar for horizontal charts, the y is fixed, x is a range value\n var scale = xAxis.scale;\n var yMid = y + offset;\n var yMin = yMid + width;\n var yMax = yMid - width;\n var xMin = scale(value - lowBound);\n var xMax = scale(value + highBound);\n\n // the right line of |--|\n lineCoordinates.push({\n x1: xMax,\n y1: yMin,\n x2: xMax,\n y2: yMax\n });\n // the middle line of |--|\n lineCoordinates.push({\n x1: xMin,\n y1: yMid,\n x2: xMax,\n y2: yMid\n });\n // the left line of |--|\n lineCoordinates.push({\n x1: xMin,\n y1: yMin,\n x2: xMin,\n y2: yMax\n });\n } else if (layout === 'horizontal') {\n // error bar for horizontal charts, the x is fixed, y is a range value\n var _scale = yAxis.scale;\n var xMid = x + offset;\n var _xMin = xMid - width;\n var _xMax = xMid + width;\n var _yMin = _scale(value - lowBound);\n var _yMax = _scale(value + highBound);\n\n // the top line\n lineCoordinates.push({\n x1: _xMin,\n y1: _yMax,\n x2: _xMax,\n y2: _yMax\n });\n // the middle line\n lineCoordinates.push({\n x1: xMid,\n y1: _yMin,\n x2: xMid,\n y2: _yMax\n });\n // the bottom line\n lineCoordinates.push({\n x1: _xMin,\n y1: _yMin,\n x2: _xMax,\n y2: _yMin\n });\n }\n return (\n /*#__PURE__*/\n // eslint-disable-next-line react/no-array-index-key\n React.createElement(Layer, _extends({\n className: \"recharts-errorBar\",\n key: \"bar-\".concat(i)\n }, svgProps), lineCoordinates.map(function (coordinates, index) {\n return (\n /*#__PURE__*/\n // eslint-disable-next-line react/no-array-index-key\n React.createElement(\"line\", _extends({}, coordinates, {\n key: \"line-\".concat(index)\n }))\n );\n }))\n );\n });\n return /*#__PURE__*/React.createElement(Layer, {\n className: \"recharts-errorBars\"\n }, errorBars);\n}\nErrorBar.defaultProps = {\n stroke: 'black',\n strokeWidth: 1.5,\n width: 5,\n offset: 0,\n layout: 'horizontal'\n};\nErrorBar.displayName = 'ErrorBar';","/**\n * @fileOverview X Axis\n */\n\n/** Define of XAxis props */\n\nexport var XAxis = function XAxis() {\n return null;\n};\nXAxis.displayName = 'XAxis';\nXAxis.defaultProps = {\n allowDecimals: true,\n hide: false,\n orientation: 'bottom',\n width: 0,\n height: 30,\n mirror: false,\n xAxisId: 0,\n tickCount: 5,\n type: 'category',\n padding: {\n left: 0,\n right: 0\n },\n allowDataOverflow: false,\n scale: 'auto',\n reversed: false,\n allowDuplicatedCategory: true\n};","/**\n * @fileOverview Y Axis\n */\n\nexport var YAxis = function YAxis() {\n return null;\n};\nYAxis.displayName = 'YAxis';\nYAxis.defaultProps = {\n allowDuplicatedCategory: true,\n allowDecimals: true,\n hide: false,\n orientation: 'left',\n width: 60,\n height: 0,\n mirror: false,\n yAxisId: 0,\n tickCount: 5,\n type: 'number',\n padding: {\n top: 0,\n bottom: 0\n },\n allowDataOverflow: false,\n scale: 'auto',\n reversed: false\n};","var isProduction = process.env.NODE_ENV === 'production';\nvar prefix = 'Invariant failed';\nfunction invariant(condition, message) {\n if (condition) {\n return;\n }\n if (isProduction) {\n throw new Error(prefix);\n }\n var provided = typeof message === 'function' ? message() : message;\n var value = provided ? \"\".concat(prefix, \": \").concat(provided) : prefix;\n throw new Error(value);\n}\n\nexport { invariant as default };\n","import { polarToCartesian } from '../PolarUtils';\n/**\n * Only applicable for radial layouts\n * @param {Object} activeCoordinate ChartCoordinate\n * @returns {Object} RadialCursorPoints\n */\nexport function getRadialCursorPoints(activeCoordinate) {\n var cx = activeCoordinate.cx,\n cy = activeCoordinate.cy,\n radius = activeCoordinate.radius,\n startAngle = activeCoordinate.startAngle,\n endAngle = activeCoordinate.endAngle;\n var startPoint = polarToCartesian(cx, cy, radius, startAngle);\n var endPoint = polarToCartesian(cx, cy, radius, endAngle);\n return {\n points: [startPoint, endPoint],\n cx: cx,\n cy: cy,\n radius: radius,\n startAngle: startAngle,\n endAngle: endAngle\n };\n}","import _every from \"lodash/every\";\nimport _mapValues from \"lodash/mapValues\";\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport { getTicksOfScale, parseScale, checkDomainOfScale, getBandSizeOfAxis } from './ChartUtils';\nimport { findChildByType } from './ReactUtils';\nimport { getPercentValue } from './DataUtils';\nimport { Bar } from '../cartesian/Bar';\n\n/**\n * Calculate the scale function, position, width, height of axes\n * @param {Object} props Latest props\n * @param {Object} axisMap The configuration of axes\n * @param {Object} offset The offset of main part in the svg element\n * @param {String} axisType The type of axes, x-axis or y-axis\n * @param {String} chartName The name of chart\n * @return {Object} Configuration\n */\nexport var formatAxisMap = function formatAxisMap(props, axisMap, offset, axisType, chartName) {\n var width = props.width,\n height = props.height,\n layout = props.layout,\n children = props.children;\n var ids = Object.keys(axisMap);\n var steps = {\n left: offset.left,\n leftMirror: offset.left,\n right: width - offset.right,\n rightMirror: width - offset.right,\n top: offset.top,\n topMirror: offset.top,\n bottom: height - offset.bottom,\n bottomMirror: height - offset.bottom\n };\n var hasBar = !!findChildByType(children, Bar);\n return ids.reduce(function (result, id) {\n var axis = axisMap[id];\n var orientation = axis.orientation,\n domain = axis.domain,\n _axis$padding = axis.padding,\n padding = _axis$padding === void 0 ? {} : _axis$padding,\n mirror = axis.mirror,\n reversed = axis.reversed;\n var offsetKey = \"\".concat(orientation).concat(mirror ? 'Mirror' : '');\n var calculatedPadding, range, x, y, needSpace;\n if (axis.type === 'number' && (axis.padding === 'gap' || axis.padding === 'no-gap')) {\n var diff = domain[1] - domain[0];\n var smallestDistanceBetweenValues = Infinity;\n var sortedValues = axis.categoricalDomain.sort();\n sortedValues.forEach(function (value, index) {\n if (index > 0) {\n smallestDistanceBetweenValues = Math.min((value || 0) - (sortedValues[index - 1] || 0), smallestDistanceBetweenValues);\n }\n });\n var smallestDistanceInPercent = smallestDistanceBetweenValues / diff;\n var rangeWidth = axis.layout === 'vertical' ? offset.height : offset.width;\n if (axis.padding === 'gap') {\n calculatedPadding = smallestDistanceInPercent * rangeWidth / 2;\n }\n if (axis.padding === 'no-gap') {\n var gap = getPercentValue(props.barCategoryGap, smallestDistanceInPercent * rangeWidth);\n var halfBand = smallestDistanceInPercent * rangeWidth / 2;\n calculatedPadding = halfBand - gap - (halfBand - gap) / rangeWidth * gap;\n }\n }\n if (axisType === 'xAxis') {\n range = [offset.left + (padding.left || 0) + (calculatedPadding || 0), offset.left + offset.width - (padding.right || 0) - (calculatedPadding || 0)];\n } else if (axisType === 'yAxis') {\n range = layout === 'horizontal' ? [offset.top + offset.height - (padding.bottom || 0), offset.top + (padding.top || 0)] : [offset.top + (padding.top || 0) + (calculatedPadding || 0), offset.top + offset.height - (padding.bottom || 0) - (calculatedPadding || 0)];\n } else {\n range = axis.range;\n }\n if (reversed) {\n range = [range[1], range[0]];\n }\n var _parseScale = parseScale(axis, chartName, hasBar),\n scale = _parseScale.scale,\n realScaleType = _parseScale.realScaleType;\n scale.domain(domain).range(range);\n checkDomainOfScale(scale);\n var ticks = getTicksOfScale(scale, _objectSpread(_objectSpread({}, axis), {}, {\n realScaleType: realScaleType\n }));\n if (axisType === 'xAxis') {\n needSpace = orientation === 'top' && !mirror || orientation === 'bottom' && mirror;\n x = offset.left;\n y = steps[offsetKey] - needSpace * axis.height;\n } else if (axisType === 'yAxis') {\n needSpace = orientation === 'left' && !mirror || orientation === 'right' && mirror;\n x = steps[offsetKey] - needSpace * axis.width;\n y = offset.top;\n }\n var finalAxis = _objectSpread(_objectSpread(_objectSpread({}, axis), ticks), {}, {\n realScaleType: realScaleType,\n x: x,\n y: y,\n scale: scale,\n width: axisType === 'xAxis' ? offset.width : axis.width,\n height: axisType === 'yAxis' ? offset.height : axis.height\n });\n finalAxis.bandSize = getBandSizeOfAxis(finalAxis, ticks);\n if (!axis.hide && axisType === 'xAxis') {\n steps[offsetKey] += (needSpace ? -1 : 1) * finalAxis.height;\n } else if (!axis.hide) {\n steps[offsetKey] += (needSpace ? -1 : 1) * finalAxis.width;\n }\n return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, id, finalAxis));\n }, {});\n};\nexport var rectWithPoints = function rectWithPoints(_ref, _ref2) {\n var x1 = _ref.x,\n y1 = _ref.y;\n var x2 = _ref2.x,\n y2 = _ref2.y;\n return {\n x: Math.min(x1, x2),\n y: Math.min(y1, y2),\n width: Math.abs(x2 - x1),\n height: Math.abs(y2 - y1)\n };\n};\n\n/**\n * Compute the x, y, width, and height of a box from two reference points.\n * @param {Object} coords x1, x2, y1, and y2\n * @return {Object} object\n */\nexport var rectWithCoords = function rectWithCoords(_ref3) {\n var x1 = _ref3.x1,\n y1 = _ref3.y1,\n x2 = _ref3.x2,\n y2 = _ref3.y2;\n return rectWithPoints({\n x: x1,\n y: y1\n }, {\n x: x2,\n y: y2\n });\n};\nexport var ScaleHelper = /*#__PURE__*/function () {\n function ScaleHelper(scale) {\n _classCallCheck(this, ScaleHelper);\n this.scale = scale;\n }\n _createClass(ScaleHelper, [{\n key: \"domain\",\n get: function get() {\n return this.scale.domain;\n }\n }, {\n key: \"range\",\n get: function get() {\n return this.scale.range;\n }\n }, {\n key: \"rangeMin\",\n get: function get() {\n return this.range()[0];\n }\n }, {\n key: \"rangeMax\",\n get: function get() {\n return this.range()[1];\n }\n }, {\n key: \"bandwidth\",\n get: function get() {\n return this.scale.bandwidth;\n }\n }, {\n key: \"apply\",\n value: function apply(value) {\n var _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n bandAware = _ref4.bandAware,\n position = _ref4.position;\n if (value === undefined) {\n return undefined;\n }\n if (position) {\n switch (position) {\n case 'start':\n {\n return this.scale(value);\n }\n case 'middle':\n {\n var offset = this.bandwidth ? this.bandwidth() / 2 : 0;\n return this.scale(value) + offset;\n }\n case 'end':\n {\n var _offset = this.bandwidth ? this.bandwidth() : 0;\n return this.scale(value) + _offset;\n }\n default:\n {\n return this.scale(value);\n }\n }\n }\n if (bandAware) {\n var _offset2 = this.bandwidth ? this.bandwidth() / 2 : 0;\n return this.scale(value) + _offset2;\n }\n return this.scale(value);\n }\n }, {\n key: \"isInRange\",\n value: function isInRange(value) {\n var range = this.range();\n var first = range[0];\n var last = range[range.length - 1];\n return first <= last ? value >= first && value <= last : value >= last && value <= first;\n }\n }], [{\n key: \"create\",\n value: function create(obj) {\n return new ScaleHelper(obj);\n }\n }]);\n return ScaleHelper;\n}();\n_defineProperty(ScaleHelper, \"EPS\", 1e-4);\nexport var createLabeledScales = function createLabeledScales(options) {\n var scales = Object.keys(options).reduce(function (res, key) {\n return _objectSpread(_objectSpread({}, res), {}, _defineProperty({}, key, ScaleHelper.create(options[key])));\n }, {});\n return _objectSpread(_objectSpread({}, scales), {}, {\n apply: function apply(coord) {\n var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n bandAware = _ref5.bandAware,\n position = _ref5.position;\n return _mapValues(coord, function (value, label) {\n return scales[label].apply(value, {\n bandAware: bandAware,\n position: position\n });\n });\n },\n isInRange: function isInRange(coord) {\n return _every(coord, function (value, label) {\n return scales[label].isInRange(value);\n });\n }\n });\n};\n\n/** Normalizes the angle so that 0 <= angle < 180.\n * @param {number} angle Angle in degrees.\n * @return {number} the normalized angle with a value of at least 0 and never greater or equal to 180. */\nexport function normalizeAngle(angle) {\n return (angle % 180 + 180) % 180;\n}\n\n/** Calculates the width of the largest horizontal line that fits inside a rectangle that is displayed at an angle.\n * @param {Object} size Width and height of the text in a horizontal position.\n * @param {number} angle Angle in degrees in which the text is displayed.\n * @return {number} The width of the largest horizontal line that fits inside a rectangle that is displayed at an angle.\n */\nexport var getAngledRectangleWidth = function getAngledRectangleWidth(_ref6) {\n var width = _ref6.width,\n height = _ref6.height;\n var angle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n // Ensure angle is >= 0 && < 180\n var normalizedAngle = normalizeAngle(angle);\n var angleRadians = normalizedAngle * Math.PI / 180;\n\n /* Depending on the height and width of the rectangle, we may need to use different formulas to calculate the angled\n * width. This threshold defines when each formula should kick in. */\n var angleThreshold = Math.atan(height / width);\n var angledWidth = angleRadians > angleThreshold && angleRadians < Math.PI - angleThreshold ? height / Math.sin(angleRadians) : width / Math.cos(angleRadians);\n return Math.abs(angledWidth);\n};","/**\n * Given an array and a number N, return a new array which contains every nTh\n * element of the input array. For n below 1, an empty array is returned.\n * If isValid is provided, all candidates must suffice the condition, else undefined is returned.\n * @param {T[]} array An input array.\n * @param {integer} n A number\n * @param {Function} isValid A function to evaluate a candidate form the array\n * @returns {T[]} The result array of the same type as the input array.\n */\nexport function getEveryNthWithCondition(array, n, isValid) {\n if (n < 1) {\n return [];\n }\n if (n === 1 && isValid === undefined) {\n return array;\n }\n var result = [];\n for (var i = 0; i < array.length; i += n) {\n if (isValid === undefined || isValid(array[i]) === true) {\n result.push(array[i]);\n } else {\n return undefined;\n }\n }\n return result;\n}","import { getAngledRectangleWidth } from './CartesianUtils';\nimport { getEveryNthWithCondition } from './getEveryNthWithCondition';\nexport function getAngledTickWidth(contentSize, unitSize, angle) {\n var size = {\n width: contentSize.width + unitSize.width,\n height: contentSize.height + unitSize.height\n };\n return getAngledRectangleWidth(size, angle);\n}\nexport function getTickBoundaries(viewBox, sign, sizeKey) {\n var isWidth = sizeKey === 'width';\n var x = viewBox.x,\n y = viewBox.y,\n width = viewBox.width,\n height = viewBox.height;\n if (sign === 1) {\n return {\n start: isWidth ? x : y,\n end: isWidth ? x + width : y + height\n };\n }\n return {\n start: isWidth ? x + width : y + height,\n end: isWidth ? x : y\n };\n}\nexport function isVisible(sign, tickPosition, size, start, end) {\n return sign * (tickPosition - sign * size / 2 - start) >= 0 && sign * (tickPosition + sign * size / 2 - end) <= 0;\n}\nexport function getNumberIntervalTicks(ticks, interval) {\n return getEveryNthWithCondition(ticks, interval + 1);\n}","import _isFunction from \"lodash/isFunction\";\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport { mathSign, isNumber } from '../util/DataUtils';\nimport { getStringSize } from '../util/DOMUtils';\nimport { Global } from '../util/Global';\nimport { isVisible, getTickBoundaries, getNumberIntervalTicks, getAngledTickWidth } from '../util/TickUtils';\nimport { getEquidistantTicks } from './getEquidistantTicks';\nfunction getTicksEnd(sign, boundaries, getTickSize, ticks, minTickGap) {\n var result = (ticks || []).slice();\n var len = result.length;\n var start = boundaries.start;\n var end = boundaries.end;\n for (var i = len - 1; i >= 0; i--) {\n var entry = result[i];\n var size = getTickSize(entry, i);\n if (i === len - 1) {\n var gap = sign * (entry.coordinate + sign * size / 2 - end);\n result[i] = entry = _objectSpread(_objectSpread({}, entry), {}, {\n tickCoord: gap > 0 ? entry.coordinate - gap * sign : entry.coordinate\n });\n } else {\n result[i] = entry = _objectSpread(_objectSpread({}, entry), {}, {\n tickCoord: entry.coordinate\n });\n }\n var isShow = isVisible(sign, entry.tickCoord, size, start, end);\n if (isShow) {\n end = entry.tickCoord - sign * (size / 2 + minTickGap);\n result[i] = _objectSpread(_objectSpread({}, entry), {}, {\n isShow: true\n });\n }\n }\n return result;\n}\nfunction getTicksStart(sign, boundaries, getTickSize, ticks, minTickGap, preserveEnd) {\n var result = (ticks || []).slice();\n var len = result.length;\n var start = boundaries.start,\n end = boundaries.end;\n if (preserveEnd) {\n // Try to guarantee the tail to be displayed\n var tail = ticks[len - 1];\n var tailSize = getTickSize(tail, len - 1);\n var tailGap = sign * (tail.coordinate + sign * tailSize / 2 - end);\n result[len - 1] = tail = _objectSpread(_objectSpread({}, tail), {}, {\n tickCoord: tailGap > 0 ? tail.coordinate - tailGap * sign : tail.coordinate\n });\n var isTailShow = isVisible(sign, tail.tickCoord, tailSize, start, end);\n if (isTailShow) {\n end = tail.tickCoord - sign * (tailSize / 2 + minTickGap);\n result[len - 1] = _objectSpread(_objectSpread({}, tail), {}, {\n isShow: true\n });\n }\n }\n var count = preserveEnd ? len - 1 : len;\n for (var i = 0; i < count; i++) {\n var entry = result[i];\n var size = getTickSize(entry, i);\n if (i === 0) {\n var gap = sign * (entry.coordinate - sign * size / 2 - start);\n result[i] = entry = _objectSpread(_objectSpread({}, entry), {}, {\n tickCoord: gap < 0 ? entry.coordinate - gap * sign : entry.coordinate\n });\n } else {\n result[i] = entry = _objectSpread(_objectSpread({}, entry), {}, {\n tickCoord: entry.coordinate\n });\n }\n var isShow = isVisible(sign, entry.tickCoord, size, start, end);\n if (isShow) {\n start = entry.tickCoord + sign * (size / 2 + minTickGap);\n result[i] = _objectSpread(_objectSpread({}, entry), {}, {\n isShow: true\n });\n }\n }\n return result;\n}\nexport function getTicks(props, fontSize, letterSpacing) {\n var tick = props.tick,\n ticks = props.ticks,\n viewBox = props.viewBox,\n minTickGap = props.minTickGap,\n orientation = props.orientation,\n interval = props.interval,\n tickFormatter = props.tickFormatter,\n unit = props.unit,\n angle = props.angle;\n if (!ticks || !ticks.length || !tick) {\n return [];\n }\n if (isNumber(interval) || Global.isSsr) {\n return getNumberIntervalTicks(ticks, typeof interval === 'number' && isNumber(interval) ? interval : 0);\n }\n var candidates = [];\n var sizeKey = orientation === 'top' || orientation === 'bottom' ? 'width' : 'height';\n var unitSize = unit && sizeKey === 'width' ? getStringSize(unit, {\n fontSize: fontSize,\n letterSpacing: letterSpacing\n }) : {\n width: 0,\n height: 0\n };\n var getTickSize = function getTickSize(content, index) {\n var value = _isFunction(tickFormatter) ? tickFormatter(content.value, index) : content.value;\n // Recharts only supports angles when sizeKey === 'width'\n return sizeKey === 'width' ? getAngledTickWidth(getStringSize(value, {\n fontSize: fontSize,\n letterSpacing: letterSpacing\n }), unitSize, angle) : getStringSize(value, {\n fontSize: fontSize,\n letterSpacing: letterSpacing\n })[sizeKey];\n };\n var sign = ticks.length >= 2 ? mathSign(ticks[1].coordinate - ticks[0].coordinate) : 1;\n var boundaries = getTickBoundaries(viewBox, sign, sizeKey);\n if (interval === 'equidistantPreserveStart') {\n return getEquidistantTicks(sign, boundaries, getTickSize, ticks, minTickGap);\n }\n if (interval === 'preserveStart' || interval === 'preserveStartEnd') {\n candidates = getTicksStart(sign, boundaries, getTickSize, ticks, minTickGap, interval === 'preserveStartEnd');\n } else {\n candidates = getTicksEnd(sign, boundaries, getTickSize, ticks, minTickGap);\n }\n return candidates.filter(function (entry) {\n return entry.isShow;\n });\n}","import { isVisible } from '../util/TickUtils';\nimport { getEveryNthWithCondition } from '../util/getEveryNthWithCondition';\nexport function getEquidistantTicks(sign, boundaries, getTickSize, ticks, minTickGap) {\n var result = (ticks || []).slice();\n var initialStart = boundaries.start,\n end = boundaries.end;\n var index = 0;\n // Premature optimisation idea 1: Estimate a lower bound, and start from there.\n // For now, start from every tick\n var stepsize = 1;\n var start = initialStart;\n while (stepsize <= result.length) {\n // Given stepsize, evaluate whether every stepsize-th tick can be shown.\n // If it can not, then increase the stepsize by 1, and try again.\n\n var entry = ticks === null || ticks === void 0 ? void 0 : ticks[index];\n\n // Break condition - If we have evaluate all the ticks, then we are done.\n if (entry === undefined) {\n return getEveryNthWithCondition(ticks, stepsize);\n }\n\n // Check if the element collides with the next element\n var size = getTickSize(entry, index);\n var tickCoord = entry.coordinate;\n // We will always show the first tick.\n var isShow = index === 0 || isVisible(sign, tickCoord, size, start, end);\n if (!isShow) {\n // Start all over with a larger stepsize\n index = 0;\n start = initialStart;\n stepsize += 1;\n }\n if (isShow) {\n // If it can be shown, update the start\n start = tickCoord + sign * (size / 2 + minTickGap);\n index += stepsize;\n }\n }\n return [];\n}","export default function() {}\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n (2 * that._x0 + that._x1) / 3,\n (2 * that._y0 + that._y1) / 3,\n (that._x0 + 2 * that._x1) / 3,\n (that._y0 + 2 * that._y1) / 3,\n (that._x0 + 4 * that._x1 + x) / 6,\n (that._y0 + 4 * that._y1 + y) / 6\n );\n}\n\nexport function Basis(context) {\n this._context = context;\n}\n\nBasis.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 3: point(this, this._x1, this._y1); // falls through\n case 2: this._context.lineTo(this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new Basis(context);\n}\n","import noop from \"../noop.js\";\nimport {point} from \"./basis.js\";\n\nfunction BasisClosed(context) {\n this._context = context;\n}\n\nBasisClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x2, this._y2);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);\n this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x2, this._y2);\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x2 = x, this._y2 = y; break;\n case 1: this._point = 2; this._x3 = x, this._y3 = y; break;\n case 2: this._point = 3; this._x4 = x, this._y4 = y; this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisClosed(context);\n}\n","import {point} from \"./basis.js\";\n\nfunction BasisOpen(context) {\n this._context = context;\n}\n\nBasisOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisOpen(context);\n}\n","import pointRadial from \"../pointRadial.js\";\n\nclass Bump {\n constructor(context, x) {\n this._context = context;\n this._x = x;\n }\n areaStart() {\n this._line = 0;\n }\n areaEnd() {\n this._line = NaN;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n }\n point(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: {\n this._point = 1;\n if (this._line) this._context.lineTo(x, y);\n else this._context.moveTo(x, y);\n break;\n }\n case 1: this._point = 2; // falls through\n default: {\n if (this._x) this._context.bezierCurveTo(this._x0 = (this._x0 + x) / 2, this._y0, this._x0, y, x, y);\n else this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + y) / 2, x, this._y0, x, y);\n break;\n }\n }\n this._x0 = x, this._y0 = y;\n }\n}\n\nclass BumpRadial {\n constructor(context) {\n this._context = context;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {}\n point(x, y) {\n x = +x, y = +y;\n if (this._point === 0) {\n this._point = 1;\n } else {\n const p0 = pointRadial(this._x0, this._y0);\n const p1 = pointRadial(this._x0, this._y0 = (this._y0 + y) / 2);\n const p2 = pointRadial(x, this._y0);\n const p3 = pointRadial(x, y);\n this._context.moveTo(...p0);\n this._context.bezierCurveTo(...p1, ...p2, ...p3);\n }\n this._x0 = x, this._y0 = y;\n }\n}\n\nexport function bumpX(context) {\n return new Bump(context, true);\n}\n\nexport function bumpY(context) {\n return new Bump(context, false);\n}\n\nexport function bumpRadial(context) {\n return new BumpRadial(context);\n}\n","import noop from \"../noop.js\";\n\nfunction LinearClosed(context) {\n this._context = context;\n}\n\nLinearClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._point) this._context.closePath();\n },\n point: function(x, y) {\n x = +x, y = +y;\n if (this._point) this._context.lineTo(x, y);\n else this._point = 1, this._context.moveTo(x, y);\n }\n};\n\nexport default function(context) {\n return new LinearClosed(context);\n}\n","function Linear(context) {\n this._context = context;\n}\n\nLinear.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: this._context.lineTo(x, y); break;\n }\n }\n};\n\nexport default function(context) {\n return new Linear(context);\n}\n","function sign(x) {\n return x < 0 ? -1 : 1;\n}\n\n// Calculate the slopes of the tangents (Hermite-type interpolation) based on\n// the following paper: Steffen, M. 1990. A Simple Method for Monotonic\n// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.\n// NOV(II), P. 443, 1990.\nfunction slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0,\n h1 = x2 - that._x1,\n s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n}\n\n// Calculate a one-sided slope.\nfunction slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}\n\n// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\n// \"you can express cubic Hermite interpolation in terms of cubic Bézier curves\n// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\nfunction point(that, t0, t1) {\n var x0 = that._x0,\n y0 = that._y0,\n x1 = that._x1,\n y1 = that._y1,\n dx = (x1 - x0) / 3;\n that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);\n}\n\nfunction MonotoneX(context) {\n this._context = context;\n}\n\nMonotoneX.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 =\n this._t0 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x1, this._y1); break;\n case 3: point(this, this._t0, slope2(this, this._t0)); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n var t1 = NaN;\n\n x = +x, y = +y;\n if (x === this._x1 && y === this._y1) return; // Ignore coincident points.\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; point(this, slope2(this, t1 = slope3(this, x, y)), t1); break;\n default: point(this, this._t0, t1 = slope3(this, x, y)); break;\n }\n\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n this._t0 = t1;\n }\n}\n\nfunction MonotoneY(context) {\n this._context = new ReflectContext(context);\n}\n\n(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {\n MonotoneX.prototype.point.call(this, y, x);\n};\n\nfunction ReflectContext(context) {\n this._context = context;\n}\n\nReflectContext.prototype = {\n moveTo: function(x, y) { this._context.moveTo(y, x); },\n closePath: function() { this._context.closePath(); },\n lineTo: function(x, y) { this._context.lineTo(y, x); },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }\n};\n\nexport function monotoneX(context) {\n return new MonotoneX(context);\n}\n\nexport function monotoneY(context) {\n return new MonotoneY(context);\n}\n","function Natural(context) {\n this._context = context;\n}\n\nNatural.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = [];\n this._y = [];\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n n = x.length;\n\n if (n) {\n this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);\n if (n === 2) {\n this._context.lineTo(x[1], y[1]);\n } else {\n var px = controlPoints(x),\n py = controlPoints(y);\n for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {\n this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);\n }\n }\n }\n\n if (this._line || (this._line !== 0 && n === 1)) this._context.closePath();\n this._line = 1 - this._line;\n this._x = this._y = null;\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\n// See https://www.particleincell.com/2012/bezier-splines/ for derivation.\nfunction controlPoints(x) {\n var i,\n n = x.length - 1,\n m,\n a = new Array(n),\n b = new Array(n),\n r = new Array(n);\n a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];\n for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];\n a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];\n for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];\n a[n - 1] = r[n - 1] / b[n - 1];\n for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];\n b[n - 1] = (x[n] + a[n - 1]) / 2;\n for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1];\n return [a, b];\n}\n\nexport default function(context) {\n return new Natural(context);\n}\n","function Step(context, t) {\n this._context = context;\n this._t = t;\n}\n\nStep.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = this._y = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: {\n if (this._t <= 0) {\n this._context.lineTo(this._x, y);\n this._context.lineTo(x, y);\n } else {\n var x1 = this._x * (1 - this._t) + x * this._t;\n this._context.lineTo(x1, this._y);\n this._context.lineTo(x1, y);\n }\n break;\n }\n }\n this._x = x, this._y = y;\n }\n};\n\nexport default function(context) {\n return new Step(context, 0.5);\n}\n\nexport function stepBefore(context) {\n return new Step(context, 0);\n}\n\nexport function stepAfter(context) {\n return new Step(context, 1);\n}\n","export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function(x, y) {\n var defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null,\n path = withPath(line);\n\n x = typeof x === \"function\" ? x : (x === undefined) ? pointX : constant(x);\n y = typeof y === \"function\" ? y : (y === undefined) ? pointY : constant(y);\n\n function line(data) {\n var i,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer;\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) output.lineStart();\n else output.lineEnd();\n }\n if (defined0) output.point(+x(d, i, data), +y(d, i, data));\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n line.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), line) : x;\n };\n\n line.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), line) : y;\n };\n\n line.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), line) : defined;\n };\n\n line.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;\n };\n\n line.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;\n };\n\n return line;\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport line from \"./line.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function(x0, y0, y1) {\n var x1 = null,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null,\n path = withPath(area);\n\n x0 = typeof x0 === \"function\" ? x0 : (x0 === undefined) ? pointX : constant(+x0);\n y0 = typeof y0 === \"function\" ? y0 : (y0 === undefined) ? constant(0) : constant(+y0);\n y1 = typeof y1 === \"function\" ? y1 : (y1 === undefined) ? pointY : constant(+y1);\n\n function area(data) {\n var i,\n j,\n k,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer,\n x0z = new Array(n),\n y0z = new Array(n);\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) {\n j = i;\n output.areaStart();\n output.lineStart();\n } else {\n output.lineEnd();\n output.lineStart();\n for (k = i - 1; k >= j; --k) {\n output.point(x0z[k], y0z[k]);\n }\n output.lineEnd();\n output.areaEnd();\n }\n }\n if (defined0) {\n x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);\n output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);\n }\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n function arealine() {\n return line().defined(defined).curve(curve).context(context);\n }\n\n area.x = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), x1 = null, area) : x0;\n };\n\n area.x0 = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), area) : x0;\n };\n\n area.x1 = function(_) {\n return arguments.length ? (x1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : x1;\n };\n\n area.y = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), y1 = null, area) : y0;\n };\n\n area.y0 = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), area) : y0;\n };\n\n area.y1 = function(_) {\n return arguments.length ? (y1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : y1;\n };\n\n area.lineX0 =\n area.lineY0 = function() {\n return arealine().x(x0).y(y0);\n };\n\n area.lineY1 = function() {\n return arealine().x(x0).y(y1);\n };\n\n area.lineX1 = function() {\n return arealine().x(x1).y(y0);\n };\n\n area.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), area) : defined;\n };\n\n area.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;\n };\n\n area.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;\n };\n\n return area;\n}\n","import _isArray from \"lodash/isArray\";\nimport _upperFirst from \"lodash/upperFirst\";\nimport _isFunction from \"lodash/isFunction\";\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n/**\n * @fileOverview Curve\n */\nimport React from 'react';\nimport { line as shapeLine, area as shapeArea, curveBasisClosed, curveBasisOpen, curveBasis, curveBumpX, curveBumpY, curveLinearClosed, curveLinear, curveMonotoneX, curveMonotoneY, curveNatural, curveStep, curveStepAfter, curveStepBefore } from 'victory-vendor/d3-shape';\nimport classNames from 'classnames';\nimport { adaptEventHandlers } from '../util/types';\nimport { filterProps } from '../util/ReactUtils';\nimport { isNumber } from '../util/DataUtils';\nvar CURVE_FACTORIES = {\n curveBasisClosed: curveBasisClosed,\n curveBasisOpen: curveBasisOpen,\n curveBasis: curveBasis,\n curveBumpX: curveBumpX,\n curveBumpY: curveBumpY,\n curveLinearClosed: curveLinearClosed,\n curveLinear: curveLinear,\n curveMonotoneX: curveMonotoneX,\n curveMonotoneY: curveMonotoneY,\n curveNatural: curveNatural,\n curveStep: curveStep,\n curveStepAfter: curveStepAfter,\n curveStepBefore: curveStepBefore\n};\nvar defined = function defined(p) {\n return p.x === +p.x && p.y === +p.y;\n};\nvar getX = function getX(p) {\n return p.x;\n};\nvar getY = function getY(p) {\n return p.y;\n};\nvar getCurveFactory = function getCurveFactory(type, layout) {\n if (_isFunction(type)) {\n return type;\n }\n var name = \"curve\".concat(_upperFirst(type));\n if ((name === 'curveMonotone' || name === 'curveBump') && layout) {\n return CURVE_FACTORIES[\"\".concat(name).concat(layout === 'vertical' ? 'Y' : 'X')];\n }\n return CURVE_FACTORIES[name] || curveLinear;\n};\n/**\n * Calculate the path of curve\n * @return {String} path\n */\nvar getPath = function getPath(_ref) {\n var _ref$type = _ref.type,\n type = _ref$type === void 0 ? 'linear' : _ref$type,\n _ref$points = _ref.points,\n points = _ref$points === void 0 ? [] : _ref$points,\n baseLine = _ref.baseLine,\n layout = _ref.layout,\n _ref$connectNulls = _ref.connectNulls,\n connectNulls = _ref$connectNulls === void 0 ? false : _ref$connectNulls;\n var curveFactory = getCurveFactory(type, layout);\n var formatPoints = connectNulls ? points.filter(function (entry) {\n return defined(entry);\n }) : points;\n var lineFunction;\n if (_isArray(baseLine)) {\n var formatBaseLine = connectNulls ? baseLine.filter(function (base) {\n return defined(base);\n }) : baseLine;\n var areaPoints = formatPoints.map(function (entry, index) {\n return _objectSpread(_objectSpread({}, entry), {}, {\n base: formatBaseLine[index]\n });\n });\n if (layout === 'vertical') {\n lineFunction = shapeArea().y(getY).x1(getX).x0(function (d) {\n return d.base.x;\n });\n } else {\n lineFunction = shapeArea().x(getX).y1(getY).y0(function (d) {\n return d.base.y;\n });\n }\n lineFunction.defined(defined).curve(curveFactory);\n return lineFunction(areaPoints);\n }\n if (layout === 'vertical' && isNumber(baseLine)) {\n lineFunction = shapeArea().y(getY).x1(getX).x0(baseLine);\n } else if (isNumber(baseLine)) {\n lineFunction = shapeArea().x(getX).y1(getY).y0(baseLine);\n } else {\n lineFunction = shapeLine().x(getX).y(getY);\n }\n lineFunction.defined(defined).curve(curveFactory);\n return lineFunction(formatPoints);\n};\nexport var Curve = function Curve(props) {\n var className = props.className,\n points = props.points,\n path = props.path,\n pathRef = props.pathRef;\n if ((!points || !points.length) && !path) {\n return null;\n }\n var realPath = points && points.length ? getPath(props) : path;\n return /*#__PURE__*/React.createElement(\"path\", _extends({}, filterProps(props), adaptEventHandlers(props), {\n className: classNames('recharts-curve', className),\n d: realPath,\n ref: pathRef\n }));\n};","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar _excluded = [\"x\", \"y\", \"top\", \"left\", \"width\", \"height\", \"className\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n/**\n * @fileOverview Cross\n */\nimport React from 'react';\nimport classNames from 'classnames';\nimport { isNumber } from '../util/DataUtils';\nimport { filterProps } from '../util/ReactUtils';\nvar getPath = function getPath(x, y, width, height, top, left) {\n return \"M\".concat(x, \",\").concat(top, \"v\").concat(height, \"M\").concat(left, \",\").concat(y, \"h\").concat(width);\n};\nexport var Cross = function Cross(_ref) {\n var _ref$x = _ref.x,\n x = _ref$x === void 0 ? 0 : _ref$x,\n _ref$y = _ref.y,\n y = _ref$y === void 0 ? 0 : _ref$y,\n _ref$top = _ref.top,\n top = _ref$top === void 0 ? 0 : _ref$top,\n _ref$left = _ref.left,\n left = _ref$left === void 0 ? 0 : _ref$left,\n _ref$width = _ref.width,\n width = _ref$width === void 0 ? 0 : _ref$width,\n _ref$height = _ref.height,\n height = _ref$height === void 0 ? 0 : _ref$height,\n className = _ref.className,\n rest = _objectWithoutProperties(_ref, _excluded);\n var props = _objectSpread({\n x: x,\n y: y,\n top: top,\n left: left,\n width: width,\n height: height\n }, rest);\n if (!isNumber(x) || !isNumber(y) || !isNumber(width) || !isNumber(height) || !isNumber(top) || !isNumber(left)) {\n return null;\n }\n return /*#__PURE__*/React.createElement(\"path\", _extends({}, filterProps(props, true), {\n className: classNames('recharts-cross', className),\n d: getPath(x, y, width, height, top, left)\n }));\n};","function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n/**\n * @fileOverview Dot\n */\nimport React from 'react';\nimport classNames from 'classnames';\nimport { adaptEventHandlers } from '../util/types';\nimport { filterProps } from '../util/ReactUtils';\nexport var Dot = function Dot(props) {\n var cx = props.cx,\n cy = props.cy,\n r = props.r,\n className = props.className;\n var layerClass = classNames('recharts-dot', className);\n if (cx === +cx && cy === +cy && r === +r) {\n return /*#__PURE__*/React.createElement(\"circle\", _extends({}, filterProps(props), adaptEventHandlers(props), {\n className: layerClass,\n cx: cx,\n cy: cy,\n r: r\n }));\n }\n return null;\n};","import _isFunction from \"lodash/isFunction\";\nimport _get from \"lodash/get\";\nvar _excluded = [\"viewBox\"],\n _excluded2 = [\"viewBox\"],\n _excluded3 = [\"ticks\"];\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n/**\n * @fileOverview Cartesian Axis\n */\nimport React, { Component } from 'react';\nimport classNames from 'classnames';\nimport { shallowEqual } from '../util/ShallowEqual';\nimport { Layer } from '../container/Layer';\nimport { Text } from '../component/Text';\nimport { Label } from '../component/Label';\nimport { isNumber } from '../util/DataUtils';\nimport { adaptEventsOfChild } from '../util/types';\nimport { filterProps } from '../util/ReactUtils';\nimport { getTicks } from './getTicks';\n\n/** The orientation of the axis in correspondence to the chart */\n\n/** A unit to be appended to a value */\n\n/** The formatter function of tick */\n\nexport var CartesianAxis = /*#__PURE__*/function (_Component) {\n _inherits(CartesianAxis, _Component);\n var _super = _createSuper(CartesianAxis);\n function CartesianAxis(props) {\n var _this;\n _classCallCheck(this, CartesianAxis);\n _this = _super.call(this, props);\n _this.state = {\n fontSize: '',\n letterSpacing: ''\n };\n return _this;\n }\n _createClass(CartesianAxis, [{\n key: \"shouldComponentUpdate\",\n value: function shouldComponentUpdate(_ref, nextState) {\n var viewBox = _ref.viewBox,\n restProps = _objectWithoutProperties(_ref, _excluded);\n // props.viewBox is sometimes generated every time -\n // check that specially as object equality is likely to fail\n var _this$props = this.props,\n viewBoxOld = _this$props.viewBox,\n restPropsOld = _objectWithoutProperties(_this$props, _excluded2);\n return !shallowEqual(viewBox, viewBoxOld) || !shallowEqual(restProps, restPropsOld) || !shallowEqual(nextState, this.state);\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var htmlLayer = this.layerReference;\n if (!htmlLayer) return;\n var tick = htmlLayer.getElementsByClassName('recharts-cartesian-axis-tick-value')[0];\n if (tick) {\n this.setState({\n fontSize: window.getComputedStyle(tick).fontSize,\n letterSpacing: window.getComputedStyle(tick).letterSpacing\n });\n }\n }\n\n /**\n * Calculate the coordinates of endpoints in ticks\n * @param {Object} data The data of a simple tick\n * @return {Object} (x1, y1): The coordinate of endpoint close to tick text\n * (x2, y2): The coordinate of endpoint close to axis\n */\n }, {\n key: \"getTickLineCoord\",\n value: function getTickLineCoord(data) {\n var _this$props2 = this.props,\n x = _this$props2.x,\n y = _this$props2.y,\n width = _this$props2.width,\n height = _this$props2.height,\n orientation = _this$props2.orientation,\n tickSize = _this$props2.tickSize,\n mirror = _this$props2.mirror,\n tickMargin = _this$props2.tickMargin;\n var x1, x2, y1, y2, tx, ty;\n var sign = mirror ? -1 : 1;\n var finalTickSize = data.tickSize || tickSize;\n var tickCoord = isNumber(data.tickCoord) ? data.tickCoord : data.coordinate;\n switch (orientation) {\n case 'top':\n x1 = x2 = data.coordinate;\n y2 = y + +!mirror * height;\n y1 = y2 - sign * finalTickSize;\n ty = y1 - sign * tickMargin;\n tx = tickCoord;\n break;\n case 'left':\n y1 = y2 = data.coordinate;\n x2 = x + +!mirror * width;\n x1 = x2 - sign * finalTickSize;\n tx = x1 - sign * tickMargin;\n ty = tickCoord;\n break;\n case 'right':\n y1 = y2 = data.coordinate;\n x2 = x + +mirror * width;\n x1 = x2 + sign * finalTickSize;\n tx = x1 + sign * tickMargin;\n ty = tickCoord;\n break;\n default:\n x1 = x2 = data.coordinate;\n y2 = y + +mirror * height;\n y1 = y2 + sign * finalTickSize;\n ty = y1 + sign * tickMargin;\n tx = tickCoord;\n break;\n }\n return {\n line: {\n x1: x1,\n y1: y1,\n x2: x2,\n y2: y2\n },\n tick: {\n x: tx,\n y: ty\n }\n };\n }\n }, {\n key: \"getTickTextAnchor\",\n value: function getTickTextAnchor() {\n var _this$props3 = this.props,\n orientation = _this$props3.orientation,\n mirror = _this$props3.mirror;\n var textAnchor;\n switch (orientation) {\n case 'left':\n textAnchor = mirror ? 'start' : 'end';\n break;\n case 'right':\n textAnchor = mirror ? 'end' : 'start';\n break;\n default:\n textAnchor = 'middle';\n break;\n }\n return textAnchor;\n }\n }, {\n key: \"getTickVerticalAnchor\",\n value: function getTickVerticalAnchor() {\n var _this$props4 = this.props,\n orientation = _this$props4.orientation,\n mirror = _this$props4.mirror;\n var verticalAnchor = 'end';\n switch (orientation) {\n case 'left':\n case 'right':\n verticalAnchor = 'middle';\n break;\n case 'top':\n verticalAnchor = mirror ? 'start' : 'end';\n break;\n default:\n verticalAnchor = mirror ? 'end' : 'start';\n break;\n }\n return verticalAnchor;\n }\n }, {\n key: \"renderAxisLine\",\n value: function renderAxisLine() {\n var _this$props5 = this.props,\n x = _this$props5.x,\n y = _this$props5.y,\n width = _this$props5.width,\n height = _this$props5.height,\n orientation = _this$props5.orientation,\n mirror = _this$props5.mirror,\n axisLine = _this$props5.axisLine;\n var props = _objectSpread(_objectSpread(_objectSpread({}, filterProps(this.props)), filterProps(axisLine)), {}, {\n fill: 'none'\n });\n if (orientation === 'top' || orientation === 'bottom') {\n var needHeight = +(orientation === 'top' && !mirror || orientation === 'bottom' && mirror);\n props = _objectSpread(_objectSpread({}, props), {}, {\n x1: x,\n y1: y + needHeight * height,\n x2: x + width,\n y2: y + needHeight * height\n });\n } else {\n var needWidth = +(orientation === 'left' && !mirror || orientation === 'right' && mirror);\n props = _objectSpread(_objectSpread({}, props), {}, {\n x1: x + needWidth * width,\n y1: y,\n x2: x + needWidth * width,\n y2: y + height\n });\n }\n return /*#__PURE__*/React.createElement(\"line\", _extends({}, props, {\n className: classNames('recharts-cartesian-axis-line', _get(axisLine, 'className'))\n }));\n }\n }, {\n key: \"renderTicks\",\n value:\n /**\n * render the ticks\n * @param {Array} ticks The ticks to actually render (overrides what was passed in props)\n * @param {string} fontSize Fontsize to consider for tick spacing\n * @param {string} letterSpacing Letterspacing to consider for tick spacing\n * @return {ReactComponent} renderedTicks\n */\n function renderTicks(ticks, fontSize, letterSpacing) {\n var _this2 = this;\n var _this$props6 = this.props,\n tickLine = _this$props6.tickLine,\n stroke = _this$props6.stroke,\n tick = _this$props6.tick,\n tickFormatter = _this$props6.tickFormatter,\n unit = _this$props6.unit;\n var finalTicks = getTicks(_objectSpread(_objectSpread({}, this.props), {}, {\n ticks: ticks\n }), fontSize, letterSpacing);\n var textAnchor = this.getTickTextAnchor();\n var verticalAnchor = this.getTickVerticalAnchor();\n var axisProps = filterProps(this.props);\n var customTickProps = filterProps(tick);\n var tickLineProps = _objectSpread(_objectSpread({}, axisProps), {}, {\n fill: 'none'\n }, filterProps(tickLine));\n var items = finalTicks.map(function (entry, i) {\n var _this2$getTickLineCoo = _this2.getTickLineCoord(entry),\n lineCoord = _this2$getTickLineCoo.line,\n tickCoord = _this2$getTickLineCoo.tick;\n var tickProps = _objectSpread(_objectSpread(_objectSpread(_objectSpread({\n textAnchor: textAnchor,\n verticalAnchor: verticalAnchor\n }, axisProps), {}, {\n stroke: 'none',\n fill: stroke\n }, customTickProps), tickCoord), {}, {\n index: i,\n payload: entry,\n visibleTicksCount: finalTicks.length,\n tickFormatter: tickFormatter\n });\n return /*#__PURE__*/React.createElement(Layer, _extends({\n className: \"recharts-cartesian-axis-tick\",\n key: \"tick-\".concat(i) // eslint-disable-line react/no-array-index-key\n }, adaptEventsOfChild(_this2.props, entry, i)), tickLine && /*#__PURE__*/React.createElement(\"line\", _extends({}, tickLineProps, lineCoord, {\n className: classNames('recharts-cartesian-axis-tick-line', _get(tickLine, 'className'))\n })), tick && CartesianAxis.renderTickItem(tick, tickProps, \"\".concat(_isFunction(tickFormatter) ? tickFormatter(entry.value, i) : entry.value).concat(unit || '')));\n });\n return /*#__PURE__*/React.createElement(\"g\", {\n className: \"recharts-cartesian-axis-ticks\"\n }, items);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this3 = this;\n var _this$props7 = this.props,\n axisLine = _this$props7.axisLine,\n width = _this$props7.width,\n height = _this$props7.height,\n ticksGenerator = _this$props7.ticksGenerator,\n className = _this$props7.className,\n hide = _this$props7.hide;\n if (hide) {\n return null;\n }\n var _this$props8 = this.props,\n ticks = _this$props8.ticks,\n noTicksProps = _objectWithoutProperties(_this$props8, _excluded3);\n var finalTicks = ticks;\n if (_isFunction(ticksGenerator)) {\n finalTicks = ticks && ticks.length > 0 ? ticksGenerator(this.props) : ticksGenerator(noTicksProps);\n }\n if (width <= 0 || height <= 0 || !finalTicks || !finalTicks.length) {\n return null;\n }\n return /*#__PURE__*/React.createElement(Layer, {\n className: classNames('recharts-cartesian-axis', className),\n ref: function ref(_ref2) {\n _this3.layerReference = _ref2;\n }\n }, axisLine && this.renderAxisLine(), this.renderTicks(finalTicks, this.state.fontSize, this.state.letterSpacing), Label.renderCallByParent(this.props));\n }\n }], [{\n key: \"renderTickItem\",\n value: function renderTickItem(option, props, value) {\n var tickItem;\n if ( /*#__PURE__*/React.isValidElement(option)) {\n tickItem = /*#__PURE__*/React.cloneElement(option, props);\n } else if (_isFunction(option)) {\n tickItem = option(props);\n } else {\n tickItem = /*#__PURE__*/React.createElement(Text, _extends({}, props, {\n className: \"recharts-cartesian-axis-tick-value\"\n }), value);\n }\n return tickItem;\n }\n }]);\n return CartesianAxis;\n}(Component);\n_defineProperty(CartesianAxis, \"displayName\", 'CartesianAxis');\n_defineProperty(CartesianAxis, \"defaultProps\", {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n viewBox: {\n x: 0,\n y: 0,\n width: 0,\n height: 0\n },\n // The orientation of axis\n orientation: 'bottom',\n // The ticks\n ticks: [],\n stroke: '#666',\n tickLine: true,\n axisLine: true,\n tick: true,\n mirror: false,\n minTickGap: 5,\n // The width or height of tick\n tickSize: 6,\n tickMargin: 2,\n interval: 'preserveEnd'\n});","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar PREFIX_LIST = ['Webkit', 'Moz', 'O', 'ms'];\nexport var generatePrefixStyle = function generatePrefixStyle(name, value) {\n if (!name) {\n return null;\n }\n var camelName = name.replace(/(\\w)/, function (v) {\n return v.toUpperCase();\n });\n var result = PREFIX_LIST.reduce(function (res, entry) {\n return _objectSpread(_objectSpread({}, res), {}, _defineProperty({}, entry + camelName, value));\n }, {});\n result[name] = value;\n return result;\n};","import _isFunction from \"lodash/isFunction\";\nimport _range from \"lodash/range\";\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n/**\n * @fileOverview Brush\n */\nimport React, { PureComponent, Children } from 'react';\nimport classNames from 'classnames';\nimport { scalePoint } from 'victory-vendor/d3-scale';\nimport { Layer } from '../container/Layer';\nimport { Text } from '../component/Text';\nimport { getValueByDataKey } from '../util/ChartUtils';\nimport { isNumber } from '../util/DataUtils';\nimport { generatePrefixStyle } from '../util/CssPrefixUtils';\nimport { filterProps } from '../util/ReactUtils';\nvar createScale = function createScale(_ref) {\n var data = _ref.data,\n startIndex = _ref.startIndex,\n endIndex = _ref.endIndex,\n x = _ref.x,\n width = _ref.width,\n travellerWidth = _ref.travellerWidth;\n if (!data || !data.length) {\n return {};\n }\n var len = data.length;\n var scale = scalePoint().domain(_range(0, len)).range([x, x + width - travellerWidth]);\n var scaleValues = scale.domain().map(function (entry) {\n return scale(entry);\n });\n return {\n isTextActive: false,\n isSlideMoving: false,\n isTravellerMoving: false,\n isTravellerFocused: false,\n startX: scale(startIndex),\n endX: scale(endIndex),\n scale: scale,\n scaleValues: scaleValues\n };\n};\nvar isTouch = function isTouch(e) {\n return e.changedTouches && !!e.changedTouches.length;\n};\nexport var Brush = /*#__PURE__*/function (_PureComponent) {\n _inherits(Brush, _PureComponent);\n var _super = _createSuper(Brush);\n function Brush(props) {\n var _this;\n _classCallCheck(this, Brush);\n _this = _super.call(this, props);\n _defineProperty(_assertThisInitialized(_this), \"handleDrag\", function (e) {\n if (_this.leaveTimer) {\n clearTimeout(_this.leaveTimer);\n _this.leaveTimer = null;\n }\n if (_this.state.isTravellerMoving) {\n _this.handleTravellerMove(e);\n } else if (_this.state.isSlideMoving) {\n _this.handleSlideDrag(e);\n }\n });\n _defineProperty(_assertThisInitialized(_this), \"handleTouchMove\", function (e) {\n if (e.changedTouches != null && e.changedTouches.length > 0) {\n _this.handleDrag(e.changedTouches[0]);\n }\n });\n _defineProperty(_assertThisInitialized(_this), \"handleDragEnd\", function () {\n _this.setState({\n isTravellerMoving: false,\n isSlideMoving: false\n }, function () {\n var _this$props = _this.props,\n endIndex = _this$props.endIndex,\n onDragEnd = _this$props.onDragEnd,\n startIndex = _this$props.startIndex;\n onDragEnd === null || onDragEnd === void 0 || onDragEnd({\n endIndex: endIndex,\n startIndex: startIndex\n });\n });\n _this.detachDragEndListener();\n });\n _defineProperty(_assertThisInitialized(_this), \"handleLeaveWrapper\", function () {\n if (_this.state.isTravellerMoving || _this.state.isSlideMoving) {\n _this.leaveTimer = window.setTimeout(_this.handleDragEnd, _this.props.leaveTimeOut);\n }\n });\n _defineProperty(_assertThisInitialized(_this), \"handleEnterSlideOrTraveller\", function () {\n _this.setState({\n isTextActive: true\n });\n });\n _defineProperty(_assertThisInitialized(_this), \"handleLeaveSlideOrTraveller\", function () {\n _this.setState({\n isTextActive: false\n });\n });\n _defineProperty(_assertThisInitialized(_this), \"handleSlideDragStart\", function (e) {\n var event = isTouch(e) ? e.changedTouches[0] : e;\n _this.setState({\n isTravellerMoving: false,\n isSlideMoving: true,\n slideMoveStartX: event.pageX\n });\n _this.attachDragEndListener();\n });\n _this.travellerDragStartHandlers = {\n startX: _this.handleTravellerDragStart.bind(_assertThisInitialized(_this), 'startX'),\n endX: _this.handleTravellerDragStart.bind(_assertThisInitialized(_this), 'endX')\n };\n _this.state = {};\n return _this;\n }\n _createClass(Brush, [{\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (this.leaveTimer) {\n clearTimeout(this.leaveTimer);\n this.leaveTimer = null;\n }\n this.detachDragEndListener();\n }\n }, {\n key: \"getIndex\",\n value: function getIndex(_ref2) {\n var startX = _ref2.startX,\n endX = _ref2.endX;\n var scaleValues = this.state.scaleValues;\n var _this$props2 = this.props,\n gap = _this$props2.gap,\n data = _this$props2.data;\n var lastIndex = data.length - 1;\n var min = Math.min(startX, endX);\n var max = Math.max(startX, endX);\n var minIndex = Brush.getIndexInRange(scaleValues, min);\n var maxIndex = Brush.getIndexInRange(scaleValues, max);\n return {\n startIndex: minIndex - minIndex % gap,\n endIndex: maxIndex === lastIndex ? lastIndex : maxIndex - maxIndex % gap\n };\n }\n }, {\n key: \"getTextOfTick\",\n value: function getTextOfTick(index) {\n var _this$props3 = this.props,\n data = _this$props3.data,\n tickFormatter = _this$props3.tickFormatter,\n dataKey = _this$props3.dataKey;\n var text = getValueByDataKey(data[index], dataKey, index);\n return _isFunction(tickFormatter) ? tickFormatter(text, index) : text;\n }\n }, {\n key: \"attachDragEndListener\",\n value: function attachDragEndListener() {\n window.addEventListener('mouseup', this.handleDragEnd, true);\n window.addEventListener('touchend', this.handleDragEnd, true);\n window.addEventListener('mousemove', this.handleDrag, true);\n }\n }, {\n key: \"detachDragEndListener\",\n value: function detachDragEndListener() {\n window.removeEventListener('mouseup', this.handleDragEnd, true);\n window.removeEventListener('touchend', this.handleDragEnd, true);\n window.removeEventListener('mousemove', this.handleDrag, true);\n }\n }, {\n key: \"handleSlideDrag\",\n value: function handleSlideDrag(e) {\n var _this$state = this.state,\n slideMoveStartX = _this$state.slideMoveStartX,\n startX = _this$state.startX,\n endX = _this$state.endX;\n var _this$props4 = this.props,\n x = _this$props4.x,\n width = _this$props4.width,\n travellerWidth = _this$props4.travellerWidth,\n startIndex = _this$props4.startIndex,\n endIndex = _this$props4.endIndex,\n onChange = _this$props4.onChange;\n var delta = e.pageX - slideMoveStartX;\n if (delta > 0) {\n delta = Math.min(delta, x + width - travellerWidth - endX, x + width - travellerWidth - startX);\n } else if (delta < 0) {\n delta = Math.max(delta, x - startX, x - endX);\n }\n var newIndex = this.getIndex({\n startX: startX + delta,\n endX: endX + delta\n });\n if ((newIndex.startIndex !== startIndex || newIndex.endIndex !== endIndex) && onChange) {\n onChange(newIndex);\n }\n this.setState({\n startX: startX + delta,\n endX: endX + delta,\n slideMoveStartX: e.pageX\n });\n }\n }, {\n key: \"handleTravellerDragStart\",\n value: function handleTravellerDragStart(id, e) {\n var event = isTouch(e) ? e.changedTouches[0] : e;\n this.setState({\n isSlideMoving: false,\n isTravellerMoving: true,\n movingTravellerId: id,\n brushMoveStartX: event.pageX\n });\n this.attachDragEndListener();\n }\n }, {\n key: \"handleTravellerMove\",\n value: function handleTravellerMove(e) {\n var _this$setState;\n var _this$state2 = this.state,\n brushMoveStartX = _this$state2.brushMoveStartX,\n movingTravellerId = _this$state2.movingTravellerId,\n endX = _this$state2.endX,\n startX = _this$state2.startX;\n var prevValue = this.state[movingTravellerId];\n var _this$props5 = this.props,\n x = _this$props5.x,\n width = _this$props5.width,\n travellerWidth = _this$props5.travellerWidth,\n onChange = _this$props5.onChange,\n gap = _this$props5.gap,\n data = _this$props5.data;\n var params = {\n startX: this.state.startX,\n endX: this.state.endX\n };\n var delta = e.pageX - brushMoveStartX;\n if (delta > 0) {\n delta = Math.min(delta, x + width - travellerWidth - prevValue);\n } else if (delta < 0) {\n delta = Math.max(delta, x - prevValue);\n }\n params[movingTravellerId] = prevValue + delta;\n var newIndex = this.getIndex(params);\n var startIndex = newIndex.startIndex,\n endIndex = newIndex.endIndex;\n var isFullGap = function isFullGap() {\n var lastIndex = data.length - 1;\n if (movingTravellerId === 'startX' && (endX > startX ? startIndex % gap === 0 : endIndex % gap === 0) || endX < startX && endIndex === lastIndex || movingTravellerId === 'endX' && (endX > startX ? endIndex % gap === 0 : startIndex % gap === 0) || endX > startX && endIndex === lastIndex) {\n return true;\n }\n return false;\n };\n this.setState((_this$setState = {}, _defineProperty(_this$setState, movingTravellerId, prevValue + delta), _defineProperty(_this$setState, \"brushMoveStartX\", e.pageX), _this$setState), function () {\n if (onChange) {\n if (isFullGap()) {\n onChange(newIndex);\n }\n }\n });\n }\n }, {\n key: \"handleTravellerMoveKeyboard\",\n value: function handleTravellerMoveKeyboard(direction, id) {\n var _this2 = this;\n // scaleValues are a list of coordinates. For example: [65, 250, 435, 620, 805, 990].\n var _this$state3 = this.state,\n scaleValues = _this$state3.scaleValues,\n startX = _this$state3.startX,\n endX = _this$state3.endX;\n // currentScaleValue refers to which coordinate the current traveller should be placed at.\n var currentScaleValue = this.state[id];\n var currentIndex = scaleValues.indexOf(currentScaleValue);\n if (currentIndex === -1) {\n return;\n }\n var newIndex = currentIndex + direction;\n if (newIndex === -1 || newIndex >= scaleValues.length) {\n return;\n }\n var newScaleValue = scaleValues[newIndex];\n\n // Prevent travellers from being on top of each other or overlapping\n if (id === 'startX' && newScaleValue >= endX || id === 'endX' && newScaleValue <= startX) {\n return;\n }\n this.setState(_defineProperty({}, id, newScaleValue), function () {\n _this2.props.onChange(_this2.getIndex({\n startX: _this2.state.startX,\n endX: _this2.state.endX\n }));\n });\n }\n }, {\n key: \"renderBackground\",\n value: function renderBackground() {\n var _this$props6 = this.props,\n x = _this$props6.x,\n y = _this$props6.y,\n width = _this$props6.width,\n height = _this$props6.height,\n fill = _this$props6.fill,\n stroke = _this$props6.stroke;\n return /*#__PURE__*/React.createElement(\"rect\", {\n stroke: stroke,\n fill: fill,\n x: x,\n y: y,\n width: width,\n height: height\n });\n }\n }, {\n key: \"renderPanorama\",\n value: function renderPanorama() {\n var _this$props7 = this.props,\n x = _this$props7.x,\n y = _this$props7.y,\n width = _this$props7.width,\n height = _this$props7.height,\n data = _this$props7.data,\n children = _this$props7.children,\n padding = _this$props7.padding;\n var chartElement = Children.only(children);\n if (!chartElement) {\n return null;\n }\n return /*#__PURE__*/React.cloneElement(chartElement, {\n x: x,\n y: y,\n width: width,\n height: height,\n margin: padding,\n compact: true,\n data: data\n });\n }\n }, {\n key: \"renderTravellerLayer\",\n value: function renderTravellerLayer(travellerX, id) {\n var _this3 = this;\n var _this$props8 = this.props,\n y = _this$props8.y,\n travellerWidth = _this$props8.travellerWidth,\n height = _this$props8.height,\n traveller = _this$props8.traveller;\n var x = Math.max(travellerX, this.props.x);\n var travellerProps = _objectSpread(_objectSpread({}, filterProps(this.props)), {}, {\n x: x,\n y: y,\n width: travellerWidth,\n height: height\n });\n return /*#__PURE__*/React.createElement(Layer, {\n tabIndex: 0,\n role: \"slider\",\n className: \"recharts-brush-traveller\",\n onMouseEnter: this.handleEnterSlideOrTraveller,\n onMouseLeave: this.handleLeaveSlideOrTraveller,\n onMouseDown: this.travellerDragStartHandlers[id],\n onTouchStart: this.travellerDragStartHandlers[id],\n onKeyDown: function onKeyDown(e) {\n if (!['ArrowLeft', 'ArrowRight'].includes(e.key)) {\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n _this3.handleTravellerMoveKeyboard(e.key === 'ArrowRight' ? 1 : -1, id);\n },\n onFocus: function onFocus() {\n _this3.setState({\n isTravellerFocused: true\n });\n },\n onBlur: function onBlur() {\n _this3.setState({\n isTravellerFocused: false\n });\n },\n style: {\n cursor: 'col-resize'\n }\n }, Brush.renderTraveller(traveller, travellerProps));\n }\n }, {\n key: \"renderSlide\",\n value: function renderSlide(startX, endX) {\n var _this$props9 = this.props,\n y = _this$props9.y,\n height = _this$props9.height,\n stroke = _this$props9.stroke,\n travellerWidth = _this$props9.travellerWidth;\n var x = Math.min(startX, endX) + travellerWidth;\n var width = Math.max(Math.abs(endX - startX) - travellerWidth, 0);\n return /*#__PURE__*/React.createElement(\"rect\", {\n className: \"recharts-brush-slide\",\n onMouseEnter: this.handleEnterSlideOrTraveller,\n onMouseLeave: this.handleLeaveSlideOrTraveller,\n onMouseDown: this.handleSlideDragStart,\n onTouchStart: this.handleSlideDragStart,\n style: {\n cursor: 'move'\n },\n stroke: \"none\",\n fill: stroke,\n fillOpacity: 0.2,\n x: x,\n y: y,\n width: width,\n height: height\n });\n }\n }, {\n key: \"renderText\",\n value: function renderText() {\n var _this$props10 = this.props,\n startIndex = _this$props10.startIndex,\n endIndex = _this$props10.endIndex,\n y = _this$props10.y,\n height = _this$props10.height,\n travellerWidth = _this$props10.travellerWidth,\n stroke = _this$props10.stroke;\n var _this$state4 = this.state,\n startX = _this$state4.startX,\n endX = _this$state4.endX;\n var offset = 5;\n var attrs = {\n pointerEvents: 'none',\n fill: stroke\n };\n return /*#__PURE__*/React.createElement(Layer, {\n className: \"recharts-brush-texts\"\n }, /*#__PURE__*/React.createElement(Text, _extends({\n textAnchor: \"end\",\n verticalAnchor: \"middle\",\n x: Math.min(startX, endX) - offset,\n y: y + height / 2\n }, attrs), this.getTextOfTick(startIndex)), /*#__PURE__*/React.createElement(Text, _extends({\n textAnchor: \"start\",\n verticalAnchor: \"middle\",\n x: Math.max(startX, endX) + travellerWidth + offset,\n y: y + height / 2\n }, attrs), this.getTextOfTick(endIndex)));\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props11 = this.props,\n data = _this$props11.data,\n className = _this$props11.className,\n children = _this$props11.children,\n x = _this$props11.x,\n y = _this$props11.y,\n width = _this$props11.width,\n height = _this$props11.height,\n alwaysShowText = _this$props11.alwaysShowText;\n var _this$state5 = this.state,\n startX = _this$state5.startX,\n endX = _this$state5.endX,\n isTextActive = _this$state5.isTextActive,\n isSlideMoving = _this$state5.isSlideMoving,\n isTravellerMoving = _this$state5.isTravellerMoving,\n isTravellerFocused = _this$state5.isTravellerFocused;\n if (!data || !data.length || !isNumber(x) || !isNumber(y) || !isNumber(width) || !isNumber(height) || width <= 0 || height <= 0) {\n return null;\n }\n var layerClass = classNames('recharts-brush', className);\n var isPanoramic = React.Children.count(children) === 1;\n var style = generatePrefixStyle('userSelect', 'none');\n return /*#__PURE__*/React.createElement(Layer, {\n className: layerClass,\n onMouseLeave: this.handleLeaveWrapper,\n onTouchMove: this.handleTouchMove,\n style: style\n }, this.renderBackground(), isPanoramic && this.renderPanorama(), this.renderSlide(startX, endX), this.renderTravellerLayer(startX, 'startX'), this.renderTravellerLayer(endX, 'endX'), (isTextActive || isSlideMoving || isTravellerMoving || isTravellerFocused || alwaysShowText) && this.renderText());\n }\n }], [{\n key: \"renderDefaultTraveller\",\n value: function renderDefaultTraveller(props) {\n var x = props.x,\n y = props.y,\n width = props.width,\n height = props.height,\n stroke = props.stroke;\n var lineY = Math.floor(y + height / 2) - 1;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"rect\", {\n x: x,\n y: y,\n width: width,\n height: height,\n fill: stroke,\n stroke: \"none\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n x1: x + 1,\n y1: lineY,\n x2: x + width - 1,\n y2: lineY,\n fill: \"none\",\n stroke: \"#fff\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n x1: x + 1,\n y1: lineY + 2,\n x2: x + width - 1,\n y2: lineY + 2,\n fill: \"none\",\n stroke: \"#fff\"\n }));\n }\n }, {\n key: \"renderTraveller\",\n value: function renderTraveller(option, props) {\n var rectangle;\n if ( /*#__PURE__*/React.isValidElement(option)) {\n rectangle = /*#__PURE__*/React.cloneElement(option, props);\n } else if (_isFunction(option)) {\n rectangle = option(props);\n } else {\n rectangle = Brush.renderDefaultTraveller(props);\n }\n return rectangle;\n }\n }, {\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps, prevState) {\n var data = nextProps.data,\n width = nextProps.width,\n x = nextProps.x,\n travellerWidth = nextProps.travellerWidth,\n updateId = nextProps.updateId,\n startIndex = nextProps.startIndex,\n endIndex = nextProps.endIndex;\n if (data !== prevState.prevData || updateId !== prevState.prevUpdateId) {\n return _objectSpread({\n prevData: data,\n prevTravellerWidth: travellerWidth,\n prevUpdateId: updateId,\n prevX: x,\n prevWidth: width\n }, data && data.length ? createScale({\n data: data,\n width: width,\n x: x,\n travellerWidth: travellerWidth,\n startIndex: startIndex,\n endIndex: endIndex\n }) : {\n scale: null,\n scaleValues: null\n });\n }\n if (prevState.scale && (width !== prevState.prevWidth || x !== prevState.prevX || travellerWidth !== prevState.prevTravellerWidth)) {\n prevState.scale.range([x, x + width - travellerWidth]);\n var scaleValues = prevState.scale.domain().map(function (entry) {\n return prevState.scale(entry);\n });\n return {\n prevData: data,\n prevTravellerWidth: travellerWidth,\n prevUpdateId: updateId,\n prevX: x,\n prevWidth: width,\n startX: prevState.scale(nextProps.startIndex),\n endX: prevState.scale(nextProps.endIndex),\n scaleValues: scaleValues\n };\n }\n return null;\n }\n }, {\n key: \"getIndexInRange\",\n value: function getIndexInRange(range, x) {\n var len = range.length;\n var start = 0;\n var end = len - 1;\n while (end - start > 1) {\n var middle = Math.floor((start + end) / 2);\n if (range[middle] > x) {\n end = middle;\n } else {\n start = middle;\n }\n }\n return x >= range[end] ? end : start;\n }\n }]);\n return Brush;\n}(PureComponent);\n_defineProperty(Brush, \"displayName\", 'Brush');\n_defineProperty(Brush, \"defaultProps\", {\n height: 40,\n travellerWidth: 5,\n gap: 1,\n fill: '#fff',\n stroke: '#666',\n padding: {\n top: 1,\n right: 1,\n bottom: 1,\n left: 1\n },\n leaveTimeOut: 1000,\n alwaysShowText: false\n});","export var ifOverflowMatches = function ifOverflowMatches(props, value) {\n var alwaysShow = props.alwaysShow;\n var ifOverflow = props.ifOverflow;\n if (alwaysShow) {\n ifOverflow = 'extendDomain';\n }\n return ifOverflow === value;\n};","import _isFunction from \"lodash/isFunction\";\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n/**\n * @fileOverview Reference Dot\n */\nimport React from 'react';\nimport classNames from 'classnames';\nimport { Layer } from '../container/Layer';\nimport { Dot } from '../shape/Dot';\nimport { Label } from '../component/Label';\nimport { isNumOrStr } from '../util/DataUtils';\nimport { ifOverflowMatches } from '../util/IfOverflowMatches';\nimport { createLabeledScales } from '../util/CartesianUtils';\nimport { warn } from '../util/LogUtils';\nimport { filterProps } from '../util/ReactUtils';\nvar getCoordinate = function getCoordinate(props) {\n var x = props.x,\n y = props.y,\n xAxis = props.xAxis,\n yAxis = props.yAxis;\n var scales = createLabeledScales({\n x: xAxis.scale,\n y: yAxis.scale\n });\n var result = scales.apply({\n x: x,\n y: y\n }, {\n bandAware: true\n });\n if (ifOverflowMatches(props, 'discard') && !scales.isInRange(result)) {\n return null;\n }\n return result;\n};\nexport function ReferenceDot(props) {\n var x = props.x,\n y = props.y,\n r = props.r,\n alwaysShow = props.alwaysShow,\n clipPathId = props.clipPathId;\n var isX = isNumOrStr(x);\n var isY = isNumOrStr(y);\n warn(alwaysShow === undefined, 'The alwaysShow prop is deprecated. Please use ifOverflow=\"extendDomain\" instead.');\n if (!isX || !isY) {\n return null;\n }\n var coordinate = getCoordinate(props);\n if (!coordinate) {\n return null;\n }\n var cx = coordinate.x,\n cy = coordinate.y;\n var shape = props.shape,\n className = props.className;\n var clipPath = ifOverflowMatches(props, 'hidden') ? \"url(#\".concat(clipPathId, \")\") : undefined;\n var dotProps = _objectSpread(_objectSpread({\n clipPath: clipPath\n }, filterProps(props, true)), {}, {\n cx: cx,\n cy: cy\n });\n return /*#__PURE__*/React.createElement(Layer, {\n className: classNames('recharts-reference-dot', className)\n }, ReferenceDot.renderDot(shape, dotProps), Label.renderCallByParent(props, {\n x: cx - r,\n y: cy - r,\n width: 2 * r,\n height: 2 * r\n }));\n}\nReferenceDot.displayName = 'ReferenceDot';\nReferenceDot.defaultProps = {\n isFront: false,\n ifOverflow: 'discard',\n xAxisId: 0,\n yAxisId: 0,\n r: 10,\n fill: '#fff',\n stroke: '#ccc',\n fillOpacity: 1,\n strokeWidth: 1\n};\nReferenceDot.renderDot = function (option, props) {\n var dot;\n if ( /*#__PURE__*/React.isValidElement(option)) {\n dot = /*#__PURE__*/React.cloneElement(option, props);\n } else if (_isFunction(option)) {\n dot = option(props);\n } else {\n dot = /*#__PURE__*/React.createElement(Dot, _extends({}, props, {\n cx: props.cx,\n cy: props.cy,\n className: \"recharts-reference-dot-dot\"\n }));\n }\n return dot;\n};","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nimport _some from \"lodash/some\";\nimport _isFunction from \"lodash/isFunction\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n/**\n * @fileOverview Reference Line\n */\nimport React from 'react';\nimport classNames from 'classnames';\nimport { Layer } from '../container/Layer';\nimport { Label } from '../component/Label';\nimport { ifOverflowMatches } from '../util/IfOverflowMatches';\nimport { isNumOrStr } from '../util/DataUtils';\nimport { createLabeledScales, rectWithCoords } from '../util/CartesianUtils';\nimport { warn } from '../util/LogUtils';\nimport { filterProps } from '../util/ReactUtils';\nvar renderLine = function renderLine(option, props) {\n var line;\n if ( /*#__PURE__*/React.isValidElement(option)) {\n line = /*#__PURE__*/React.cloneElement(option, props);\n } else if (_isFunction(option)) {\n line = option(props);\n } else {\n line = /*#__PURE__*/React.createElement(\"line\", _extends({}, props, {\n className: \"recharts-reference-line-line\"\n }));\n }\n return line;\n};\n\n// TODO: ScaleHelper\nvar getEndPoints = function getEndPoints(scales, isFixedX, isFixedY, isSegment, props) {\n var _props$viewBox = props.viewBox,\n x = _props$viewBox.x,\n y = _props$viewBox.y,\n width = _props$viewBox.width,\n height = _props$viewBox.height,\n position = props.position;\n if (isFixedY) {\n var yCoord = props.y,\n orientation = props.yAxis.orientation;\n var coord = scales.y.apply(yCoord, {\n position: position\n });\n if (ifOverflowMatches(props, 'discard') && !scales.y.isInRange(coord)) {\n return null;\n }\n var points = [{\n x: x + width,\n y: coord\n }, {\n x: x,\n y: coord\n }];\n return orientation === 'left' ? points.reverse() : points;\n }\n if (isFixedX) {\n var xCoord = props.x,\n _orientation = props.xAxis.orientation;\n var _coord = scales.x.apply(xCoord, {\n position: position\n });\n if (ifOverflowMatches(props, 'discard') && !scales.x.isInRange(_coord)) {\n return null;\n }\n var _points = [{\n x: _coord,\n y: y + height\n }, {\n x: _coord,\n y: y\n }];\n return _orientation === 'top' ? _points.reverse() : _points;\n }\n if (isSegment) {\n var segment = props.segment;\n var _points2 = segment.map(function (p) {\n return scales.apply(p, {\n position: position\n });\n });\n if (ifOverflowMatches(props, 'discard') && _some(_points2, function (p) {\n return !scales.isInRange(p);\n })) {\n return null;\n }\n return _points2;\n }\n return null;\n};\nexport function ReferenceLine(props) {\n var fixedX = props.x,\n fixedY = props.y,\n segment = props.segment,\n xAxis = props.xAxis,\n yAxis = props.yAxis,\n shape = props.shape,\n className = props.className,\n alwaysShow = props.alwaysShow,\n clipPathId = props.clipPathId;\n warn(alwaysShow === undefined, 'The alwaysShow prop is deprecated. Please use ifOverflow=\"extendDomain\" instead.');\n var scales = createLabeledScales({\n x: xAxis.scale,\n y: yAxis.scale\n });\n var isX = isNumOrStr(fixedX);\n var isY = isNumOrStr(fixedY);\n var isSegment = segment && segment.length === 2;\n var endPoints = getEndPoints(scales, isX, isY, isSegment, props);\n if (!endPoints) {\n return null;\n }\n var _endPoints = _slicedToArray(endPoints, 2),\n _endPoints$ = _endPoints[0],\n x1 = _endPoints$.x,\n y1 = _endPoints$.y,\n _endPoints$2 = _endPoints[1],\n x2 = _endPoints$2.x,\n y2 = _endPoints$2.y;\n var clipPath = ifOverflowMatches(props, 'hidden') ? \"url(#\".concat(clipPathId, \")\") : undefined;\n var lineProps = _objectSpread(_objectSpread({\n clipPath: clipPath\n }, filterProps(props, true)), {}, {\n x1: x1,\n y1: y1,\n x2: x2,\n y2: y2\n });\n return /*#__PURE__*/React.createElement(Layer, {\n className: classNames('recharts-reference-line', className)\n }, renderLine(shape, lineProps), Label.renderCallByParent(props, rectWithCoords({\n x1: x1,\n y1: y1,\n x2: x2,\n y2: y2\n })));\n}\nReferenceLine.displayName = 'ReferenceLine';\nReferenceLine.defaultProps = {\n isFront: false,\n ifOverflow: 'discard',\n xAxisId: 0,\n yAxisId: 0,\n fill: 'none',\n stroke: '#ccc',\n fillOpacity: 1,\n strokeWidth: 1,\n position: 'middle'\n};","import _isFunction from \"lodash/isFunction\";\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n/**\n * @fileOverview Reference Line\n */\nimport React from 'react';\nimport classNames from 'classnames';\nimport { Layer } from '../container/Layer';\nimport { Label } from '../component/Label';\nimport { createLabeledScales, rectWithPoints } from '../util/CartesianUtils';\nimport { ifOverflowMatches } from '../util/IfOverflowMatches';\nimport { isNumOrStr } from '../util/DataUtils';\nimport { warn } from '../util/LogUtils';\nimport { Rectangle } from '../shape/Rectangle';\nimport { filterProps } from '../util/ReactUtils';\nvar getRect = function getRect(hasX1, hasX2, hasY1, hasY2, props) {\n var xValue1 = props.x1,\n xValue2 = props.x2,\n yValue1 = props.y1,\n yValue2 = props.y2,\n xAxis = props.xAxis,\n yAxis = props.yAxis;\n if (!xAxis || !yAxis) return null;\n var scales = createLabeledScales({\n x: xAxis.scale,\n y: yAxis.scale\n });\n var p1 = {\n x: hasX1 ? scales.x.apply(xValue1, {\n position: 'start'\n }) : scales.x.rangeMin,\n y: hasY1 ? scales.y.apply(yValue1, {\n position: 'start'\n }) : scales.y.rangeMin\n };\n var p2 = {\n x: hasX2 ? scales.x.apply(xValue2, {\n position: 'end'\n }) : scales.x.rangeMax,\n y: hasY2 ? scales.y.apply(yValue2, {\n position: 'end'\n }) : scales.y.rangeMax\n };\n if (ifOverflowMatches(props, 'discard') && (!scales.isInRange(p1) || !scales.isInRange(p2))) {\n return null;\n }\n return rectWithPoints(p1, p2);\n};\nexport function ReferenceArea(props) {\n var x1 = props.x1,\n x2 = props.x2,\n y1 = props.y1,\n y2 = props.y2,\n className = props.className,\n alwaysShow = props.alwaysShow,\n clipPathId = props.clipPathId;\n warn(alwaysShow === undefined, 'The alwaysShow prop is deprecated. Please use ifOverflow=\"extendDomain\" instead.');\n var hasX1 = isNumOrStr(x1);\n var hasX2 = isNumOrStr(x2);\n var hasY1 = isNumOrStr(y1);\n var hasY2 = isNumOrStr(y2);\n var shape = props.shape;\n if (!hasX1 && !hasX2 && !hasY1 && !hasY2 && !shape) {\n return null;\n }\n var rect = getRect(hasX1, hasX2, hasY1, hasY2, props);\n if (!rect && !shape) {\n return null;\n }\n var clipPath = ifOverflowMatches(props, 'hidden') ? \"url(#\".concat(clipPathId, \")\") : undefined;\n return /*#__PURE__*/React.createElement(Layer, {\n className: classNames('recharts-reference-area', className)\n }, ReferenceArea.renderRect(shape, _objectSpread(_objectSpread({\n clipPath: clipPath\n }, filterProps(props, true)), rect)), Label.renderCallByParent(props, rect));\n}\nReferenceArea.displayName = 'ReferenceArea';\nReferenceArea.defaultProps = {\n isFront: false,\n ifOverflow: 'discard',\n xAxisId: 0,\n yAxisId: 0,\n r: 10,\n fill: '#ccc',\n fillOpacity: 0.5,\n stroke: 'none',\n strokeWidth: 1\n};\nReferenceArea.renderRect = function (option, props) {\n var rect;\n if ( /*#__PURE__*/React.isValidElement(option)) {\n rect = /*#__PURE__*/React.cloneElement(option, props);\n } else if (_isFunction(option)) {\n rect = option(props);\n } else {\n rect = /*#__PURE__*/React.createElement(Rectangle, _extends({}, props, {\n className: \"recharts-reference-area-rect\"\n }));\n }\n return rect;\n};","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nimport { ReferenceDot } from '../cartesian/ReferenceDot';\nimport { ReferenceLine } from '../cartesian/ReferenceLine';\nimport { ReferenceArea } from '../cartesian/ReferenceArea';\nimport { ifOverflowMatches } from './IfOverflowMatches';\nimport { findAllByType } from './ReactUtils';\nimport { isNumber } from './DataUtils';\nexport var detectReferenceElementsDomain = function detectReferenceElementsDomain(children, domain, axisId, axisType, specifiedTicks) {\n var lines = findAllByType(children, ReferenceLine);\n var dots = findAllByType(children, ReferenceDot);\n var elements = [].concat(_toConsumableArray(lines), _toConsumableArray(dots));\n var areas = findAllByType(children, ReferenceArea);\n var idKey = \"\".concat(axisType, \"Id\");\n var valueKey = axisType[0];\n var finalDomain = domain;\n if (elements.length) {\n finalDomain = elements.reduce(function (result, el) {\n if (el.props[idKey] === axisId && ifOverflowMatches(el.props, 'extendDomain') && isNumber(el.props[valueKey])) {\n var value = el.props[valueKey];\n return [Math.min(result[0], value), Math.max(result[1], value)];\n }\n return result;\n }, finalDomain);\n }\n if (areas.length) {\n var key1 = \"\".concat(valueKey, \"1\");\n var key2 = \"\".concat(valueKey, \"2\");\n finalDomain = areas.reduce(function (result, el) {\n if (el.props[idKey] === axisId && ifOverflowMatches(el.props, 'extendDomain') && isNumber(el.props[key1]) && isNumber(el.props[key2])) {\n var value1 = el.props[key1];\n var value2 = el.props[key2];\n return [Math.min(result[0], value1, value2), Math.max(result[1], value1, value2)];\n }\n return result;\n }, finalDomain);\n }\n if (specifiedTicks && specifiedTicks.length) {\n finalDomain = specifiedTicks.reduce(function (result, tick) {\n if (isNumber(tick)) {\n return [Math.min(result[0], tick), Math.max(result[1], tick)];\n }\n return result;\n }, finalDomain);\n }\n return finalDomain;\n};","import EventEmitter from 'eventemitter3';\nvar eventCenter = new EventEmitter();\nif (eventCenter.setMaxListeners) {\n eventCenter.setMaxListeners(10);\n}\nexport { eventCenter };\nexport var SYNC_EVENT = 'recharts.syncMouseEvents';","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nexport var AccessibilityManager = /*#__PURE__*/function () {\n function AccessibilityManager() {\n _classCallCheck(this, AccessibilityManager);\n _defineProperty(this, \"activeIndex\", 0);\n _defineProperty(this, \"coordinateList\", []);\n _defineProperty(this, \"layout\", 'horizontal');\n }\n _createClass(AccessibilityManager, [{\n key: \"setDetails\",\n value: function setDetails(_ref) {\n var _ref$coordinateList = _ref.coordinateList,\n coordinateList = _ref$coordinateList === void 0 ? [] : _ref$coordinateList,\n _ref$container = _ref.container,\n container = _ref$container === void 0 ? null : _ref$container,\n _ref$layout = _ref.layout,\n layout = _ref$layout === void 0 ? null : _ref$layout,\n _ref$offset = _ref.offset,\n offset = _ref$offset === void 0 ? null : _ref$offset,\n _ref$mouseHandlerCall = _ref.mouseHandlerCallback,\n mouseHandlerCallback = _ref$mouseHandlerCall === void 0 ? null : _ref$mouseHandlerCall;\n this.coordinateList = coordinateList !== null && coordinateList !== void 0 ? coordinateList : this.coordinateList;\n this.container = container !== null && container !== void 0 ? container : this.container;\n this.layout = layout !== null && layout !== void 0 ? layout : this.layout;\n this.offset = offset !== null && offset !== void 0 ? offset : this.offset;\n this.mouseHandlerCallback = mouseHandlerCallback !== null && mouseHandlerCallback !== void 0 ? mouseHandlerCallback : this.mouseHandlerCallback;\n\n // Keep activeIndex in the bounds between 0 and the last coordinate index\n this.activeIndex = Math.min(Math.max(this.activeIndex, 0), this.coordinateList.length - 1);\n }\n }, {\n key: \"focus\",\n value: function focus() {\n this.spoofMouse();\n }\n }, {\n key: \"keyboardEvent\",\n value: function keyboardEvent(e) {\n // The AccessibilityManager relies on the Tooltip component. When tooltips suddenly stop existing,\n // it can cause errors. We use this function to check. We don't want arrow keys to be processed\n // if there are no tooltips, since that will cause unexpected behavior of users.\n if (this.coordinateList.length === 0) {\n return;\n }\n switch (e.key) {\n case 'ArrowRight':\n {\n if (this.layout !== 'horizontal') {\n return;\n }\n this.activeIndex = Math.min(this.activeIndex + 1, this.coordinateList.length - 1);\n this.spoofMouse();\n break;\n }\n case 'ArrowLeft':\n {\n if (this.layout !== 'horizontal') {\n return;\n }\n this.activeIndex = Math.max(this.activeIndex - 1, 0);\n this.spoofMouse();\n break;\n }\n default:\n {\n break;\n }\n }\n }\n }, {\n key: \"spoofMouse\",\n value: function spoofMouse() {\n if (this.layout !== 'horizontal') {\n return;\n }\n\n // This can happen when the tooltips suddenly stop existing as children of the component\n // That update doesn't otherwise fire events, so we have to double check here.\n if (this.coordinateList.length === 0) {\n return;\n }\n var _this$container$getBo = this.container.getBoundingClientRect(),\n x = _this$container$getBo.x,\n y = _this$container$getBo.y,\n height = _this$container$getBo.height;\n var coordinate = this.coordinateList[this.activeIndex].coordinate;\n var pageX = x + coordinate;\n var pageY = y + this.offset.top + height / 2;\n this.mouseHandlerCallback({\n pageX: pageX,\n pageY: pageY\n });\n }\n }]);\n return AccessibilityManager;\n}();","import { polarToCartesian } from '../PolarUtils';\nimport { getRadialCursorPoints } from './getRadialCursorPoints';\nexport function getCursorPoints(layout, activeCoordinate, offset) {\n var x1, y1, x2, y2;\n if (layout === 'horizontal') {\n x1 = activeCoordinate.x;\n x2 = x1;\n y1 = offset.top;\n y2 = offset.top + offset.height;\n } else if (layout === 'vertical') {\n y1 = activeCoordinate.y;\n y2 = y1;\n x1 = offset.left;\n x2 = offset.left + offset.width;\n } else if (activeCoordinate.cx != null && activeCoordinate.cy != null) {\n if (layout === 'centric') {\n var cx = activeCoordinate.cx,\n cy = activeCoordinate.cy,\n innerRadius = activeCoordinate.innerRadius,\n outerRadius = activeCoordinate.outerRadius,\n angle = activeCoordinate.angle;\n var innerPoint = polarToCartesian(cx, cy, innerRadius, angle);\n var outerPoint = polarToCartesian(cx, cy, outerRadius, angle);\n x1 = innerPoint.x;\n y1 = innerPoint.y;\n x2 = outerPoint.x;\n y2 = outerPoint.y;\n } else {\n return getRadialCursorPoints(activeCoordinate);\n }\n }\n return [{\n x: x1,\n y: y1\n }, {\n x: x2,\n y: y2\n }];\n}","import _every from \"lodash/every\";\nimport _find from \"lodash/find\";\nimport _isFunction from \"lodash/isFunction\";\nimport _throttle from \"lodash/throttle\";\nimport _sortBy from \"lodash/sortBy\";\nimport _get from \"lodash/get\";\nimport _isNil from \"lodash/isNil\";\nimport _range from \"lodash/range\";\nimport _isBoolean from \"lodash/isBoolean\";\nimport _isArray from \"lodash/isArray\";\nvar _excluded = [\"item\"],\n _excluded2 = [\"children\", \"className\", \"width\", \"height\", \"style\", \"compact\", \"title\", \"desc\"];\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport React, { Component, cloneElement, isValidElement, createElement } from 'react';\nimport classNames from 'classnames';\nimport invariant from 'tiny-invariant';\nimport { getRadialCursorPoints } from '../util/cursor/getRadialCursorPoints';\nimport { getTicks } from '../cartesian/getTicks';\nimport { Surface } from '../container/Surface';\nimport { Layer } from '../container/Layer';\nimport { Tooltip } from '../component/Tooltip';\nimport { Legend } from '../component/Legend';\nimport { Curve } from '../shape/Curve';\nimport { Cross } from '../shape/Cross';\nimport { Sector } from '../shape/Sector';\nimport { Dot } from '../shape/Dot';\nimport { isInRectangle, Rectangle } from '../shape/Rectangle';\nimport { findAllByType, findChildByType, getDisplayName, parseChildIndex, validateWidthHeight, isChildrenEqual, renderByOrder, getReactEventByType, filterProps } from '../util/ReactUtils';\nimport { CartesianAxis } from '../cartesian/CartesianAxis';\nimport { Brush } from '../cartesian/Brush';\nimport { getOffset, calculateChartCoordinate } from '../util/DOMUtils';\nimport { getAnyElementOfObject, hasDuplicate, uniqueId, isNumber, findEntryInArray } from '../util/DataUtils';\nimport { calculateActiveTickIndex, getMainColorOfGraphicItem, getBarSizeList, getBarPosition, appendOffsetOfLegend, getLegendProps, combineEventHandlers, getTicksOfAxis, getCoordinatesOfGrid, getStackedDataOfItem, parseErrorBarsOfAxis, getBandSizeOfAxis, getStackGroupsByAxisId, isCategoricalAxis, getDomainOfItemsWithSameAxis, getDomainOfStackGroups, getDomainOfDataByKey, parseSpecifiedDomain, parseDomainOfCategoryAxis, getTooltipItem } from '../util/ChartUtils';\nimport { detectReferenceElementsDomain } from '../util/DetectReferenceElementsDomain';\nimport { inRangeOfSector, polarToCartesian } from '../util/PolarUtils';\nimport { shallowEqual } from '../util/ShallowEqual';\nimport { eventCenter, SYNC_EVENT } from '../util/Events';\nimport { adaptEventHandlers } from '../util/types';\nimport { AccessibilityManager } from './AccessibilityManager';\nimport { isDomainSpecifiedByUser } from '../util/isDomainSpecifiedByUser';\nimport { deferer } from '../util/deferer';\nimport { getActiveShapeIndexForTooltip, isFunnel, isPie, isScatter } from '../util/ActiveShapeUtils';\nimport { getCursorPoints } from '../util/cursor/getCursorPoints';\nimport { getCursorRectangle } from '../util/cursor/getCursorRectangle';\nvar ORIENT_MAP = {\n xAxis: ['bottom', 'top'],\n yAxis: ['left', 'right']\n};\nvar originCoordinate = {\n x: 0,\n y: 0\n};\n\n// use legacy isFinite only if there is a problem (aka IE)\n// eslint-disable-next-line no-restricted-globals\nvar isFinit = Number.isFinite ? Number.isFinite : isFinite;\nvar calculateTooltipPos = function calculateTooltipPos(rangeObj, layout) {\n if (layout === 'horizontal') {\n return rangeObj.x;\n }\n if (layout === 'vertical') {\n return rangeObj.y;\n }\n if (layout === 'centric') {\n return rangeObj.angle;\n }\n return rangeObj.radius;\n};\nvar getActiveCoordinate = function getActiveCoordinate(layout, tooltipTicks, activeIndex, rangeObj) {\n var entry = tooltipTicks.find(function (tick) {\n return tick && tick.index === activeIndex;\n });\n if (entry) {\n if (layout === 'horizontal') {\n return {\n x: entry.coordinate,\n y: rangeObj.y\n };\n }\n if (layout === 'vertical') {\n return {\n x: rangeObj.x,\n y: entry.coordinate\n };\n }\n if (layout === 'centric') {\n var _angle = entry.coordinate;\n var _radius = rangeObj.radius;\n return _objectSpread(_objectSpread(_objectSpread({}, rangeObj), polarToCartesian(rangeObj.cx, rangeObj.cy, _radius, _angle)), {}, {\n angle: _angle,\n radius: _radius\n });\n }\n var radius = entry.coordinate;\n var angle = rangeObj.angle;\n return _objectSpread(_objectSpread(_objectSpread({}, rangeObj), polarToCartesian(rangeObj.cx, rangeObj.cy, radius, angle)), {}, {\n angle: angle,\n radius: radius\n });\n }\n return originCoordinate;\n};\nvar getDisplayedData = function getDisplayedData(data, _ref, item) {\n var graphicalItems = _ref.graphicalItems,\n dataStartIndex = _ref.dataStartIndex,\n dataEndIndex = _ref.dataEndIndex;\n var itemsData = (graphicalItems || []).reduce(function (result, child) {\n var itemData = child.props.data;\n if (itemData && itemData.length) {\n return [].concat(_toConsumableArray(result), _toConsumableArray(itemData));\n }\n return result;\n }, []);\n if (itemsData && itemsData.length > 0) {\n return itemsData;\n }\n if (item && item.props && item.props.data && item.props.data.length > 0) {\n return item.props.data;\n }\n if (data && data.length && isNumber(dataStartIndex) && isNumber(dataEndIndex)) {\n return data.slice(dataStartIndex, dataEndIndex + 1);\n }\n return [];\n};\nfunction getDefaultDomainByAxisType(axisType) {\n return axisType === 'number' ? [0, 'auto'] : undefined;\n}\n\n/**\n * Get the content to be displayed in the tooltip\n * @param {Object} state Current state\n * @param {Array} chartData The data defined in chart\n * @param {Number} activeIndex Active index of data\n * @param {String} activeLabel Active label of data\n * @return {Array} The content of tooltip\n */\nvar getTooltipContent = function getTooltipContent(state, chartData, activeIndex, activeLabel) {\n var graphicalItems = state.graphicalItems,\n tooltipAxis = state.tooltipAxis;\n var displayedData = getDisplayedData(chartData, state);\n if (activeIndex < 0 || !graphicalItems || !graphicalItems.length || activeIndex >= displayedData.length) {\n return null;\n }\n // get data by activeIndex when the axis don't allow duplicated category\n return graphicalItems.reduce(function (result, child) {\n var hide = child.props.hide;\n if (hide) {\n return result;\n }\n\n /**\n * Fixes: https://github.com/recharts/recharts/issues/3669\n * Defaulting to chartData below to fix an edge case where the tooltip does not include data from all charts\n * when a separate dataset is passed to chart prop data and specified on Line/Area/etc prop data\n */\n var _child$props$data = child.props.data,\n data = _child$props$data === void 0 ? chartData : _child$props$data;\n var payload;\n if (tooltipAxis.dataKey && !tooltipAxis.allowDuplicatedCategory) {\n // graphic child has data props\n var entries = data === undefined ? displayedData : data;\n payload = findEntryInArray(entries, tooltipAxis.dataKey, activeLabel);\n } else {\n payload = data && data[activeIndex] || displayedData[activeIndex];\n }\n if (!payload) {\n return result;\n }\n return [].concat(_toConsumableArray(result), [getTooltipItem(child, payload)]);\n }, []);\n};\n\n/**\n * Returns tooltip data based on a mouse position (as a parameter or in state)\n * @param {Object} state current state\n * @param {Array} chartData the data defined in chart\n * @param {String} layout The layout type of chart\n * @param {Object} rangeObj { x, y } coordinates\n * @return {Object} Tooltip data data\n */\nvar getTooltipData = function getTooltipData(state, chartData, layout, rangeObj) {\n var rangeData = rangeObj || {\n x: state.chartX,\n y: state.chartY\n };\n var pos = calculateTooltipPos(rangeData, layout);\n var ticks = state.orderedTooltipTicks,\n axis = state.tooltipAxis,\n tooltipTicks = state.tooltipTicks;\n var activeIndex = calculateActiveTickIndex(pos, ticks, tooltipTicks, axis);\n if (activeIndex >= 0 && tooltipTicks) {\n var activeLabel = tooltipTicks[activeIndex] && tooltipTicks[activeIndex].value;\n var activePayload = getTooltipContent(state, chartData, activeIndex, activeLabel);\n var activeCoordinate = getActiveCoordinate(layout, ticks, activeIndex, rangeData);\n return {\n activeTooltipIndex: activeIndex,\n activeLabel: activeLabel,\n activePayload: activePayload,\n activeCoordinate: activeCoordinate\n };\n }\n return null;\n};\n\n/**\n * Get the configuration of axis by the options of axis instance\n * @param {Object} props Latest props\n * @param {Array} axes The instance of axes\n * @param {Array} graphicalItems The instances of item\n * @param {String} axisType The type of axis, xAxis - x-axis, yAxis - y-axis\n * @param {String} axisIdKey The unique id of an axis\n * @param {Object} stackGroups The items grouped by axisId and stackId\n * @param {Number} dataStartIndex The start index of the data series when a brush is applied\n * @param {Number} dataEndIndex The end index of the data series when a brush is applied\n * @return {Object} Configuration\n */\nexport var getAxisMapByAxes = function getAxisMapByAxes(props, _ref2) {\n var axes = _ref2.axes,\n graphicalItems = _ref2.graphicalItems,\n axisType = _ref2.axisType,\n axisIdKey = _ref2.axisIdKey,\n stackGroups = _ref2.stackGroups,\n dataStartIndex = _ref2.dataStartIndex,\n dataEndIndex = _ref2.dataEndIndex;\n var layout = props.layout,\n children = props.children,\n stackOffset = props.stackOffset;\n var isCategorical = isCategoricalAxis(layout, axisType);\n\n // Eliminate duplicated axes\n var axisMap = axes.reduce(function (result, child) {\n var _child$props$domain2;\n var _child$props = child.props,\n type = _child$props.type,\n dataKey = _child$props.dataKey,\n allowDataOverflow = _child$props.allowDataOverflow,\n allowDuplicatedCategory = _child$props.allowDuplicatedCategory,\n scale = _child$props.scale,\n ticks = _child$props.ticks,\n includeHidden = _child$props.includeHidden;\n var axisId = child.props[axisIdKey];\n if (result[axisId]) {\n return result;\n }\n var displayedData = getDisplayedData(props.data, {\n graphicalItems: graphicalItems.filter(function (item) {\n return item.props[axisIdKey] === axisId;\n }),\n dataStartIndex: dataStartIndex,\n dataEndIndex: dataEndIndex\n });\n var len = displayedData.length;\n var domain, duplicateDomain, categoricalDomain;\n\n /*\n * This is a hack to short-circuit the domain creation here to enhance performance.\n * Usually, the data is used to determine the domain, but when the user specifies\n * a domain upfront (via props), there is no need to calculate the domain start and end,\n * which is very expensive for a larger amount of data.\n * The only thing that would prohibit short-circuiting is when the user doesn't allow data overflow,\n * because the axis is supposed to ignore the specified domain that way.\n */\n if (isDomainSpecifiedByUser(child.props.domain, allowDataOverflow, type)) {\n domain = parseSpecifiedDomain(child.props.domain, null, allowDataOverflow);\n /* The chart can be categorical and have the domain specified in numbers\n * we still need to calculate the categorical domain\n * TODO: refactor this more\n */\n if (isCategorical && (type === 'number' || scale !== 'auto')) {\n categoricalDomain = getDomainOfDataByKey(displayedData, dataKey, 'category');\n }\n }\n\n // if the domain is defaulted we need this for `originalDomain` as well\n var defaultDomain = getDefaultDomainByAxisType(type);\n\n // we didn't create the domain from user's props above, so we need to calculate it\n if (!domain || domain.length === 0) {\n var _child$props$domain;\n var childDomain = (_child$props$domain = child.props.domain) !== null && _child$props$domain !== void 0 ? _child$props$domain : defaultDomain;\n if (dataKey) {\n // has dataKey in \n domain = getDomainOfDataByKey(displayedData, dataKey, type);\n if (type === 'category' && isCategorical) {\n // the field type is category data and this axis is categorical axis\n var duplicate = hasDuplicate(domain);\n if (allowDuplicatedCategory && duplicate) {\n duplicateDomain = domain;\n // When category axis has duplicated text, serial numbers are used to generate scale\n domain = _range(0, len);\n } else if (!allowDuplicatedCategory) {\n // remove duplicated category\n domain = parseDomainOfCategoryAxis(childDomain, domain, child).reduce(function (finalDomain, entry) {\n return finalDomain.indexOf(entry) >= 0 ? finalDomain : [].concat(_toConsumableArray(finalDomain), [entry]);\n }, []);\n }\n } else if (type === 'category') {\n // the field type is category data and this axis is numerical axis\n if (!allowDuplicatedCategory) {\n domain = parseDomainOfCategoryAxis(childDomain, domain, child).reduce(function (finalDomain, entry) {\n return finalDomain.indexOf(entry) >= 0 || entry === '' || _isNil(entry) ? finalDomain : [].concat(_toConsumableArray(finalDomain), [entry]);\n }, []);\n } else {\n // eliminate undefined or null or empty string\n domain = domain.filter(function (entry) {\n return entry !== '' && !_isNil(entry);\n });\n }\n } else if (type === 'number') {\n // the field type is numerical\n var errorBarsDomain = parseErrorBarsOfAxis(displayedData, graphicalItems.filter(function (item) {\n return item.props[axisIdKey] === axisId && (includeHidden || !item.props.hide);\n }), dataKey, axisType, layout);\n if (errorBarsDomain) {\n domain = errorBarsDomain;\n }\n }\n if (isCategorical && (type === 'number' || scale !== 'auto')) {\n categoricalDomain = getDomainOfDataByKey(displayedData, dataKey, 'category');\n }\n } else if (isCategorical) {\n // the axis is a categorical axis\n domain = _range(0, len);\n } else if (stackGroups && stackGroups[axisId] && stackGroups[axisId].hasStack && type === 'number') {\n // when stackOffset is 'expand', the domain may be calculated as [0, 1.000000000002]\n domain = stackOffset === 'expand' ? [0, 1] : getDomainOfStackGroups(stackGroups[axisId].stackGroups, dataStartIndex, dataEndIndex);\n } else {\n domain = getDomainOfItemsWithSameAxis(displayedData, graphicalItems.filter(function (item) {\n return item.props[axisIdKey] === axisId && (includeHidden || !item.props.hide);\n }), type, layout, true);\n }\n if (type === 'number') {\n // To detect wether there is any reference lines whose props alwaysShow is true\n domain = detectReferenceElementsDomain(children, domain, axisId, axisType, ticks);\n if (childDomain) {\n domain = parseSpecifiedDomain(childDomain, domain, allowDataOverflow);\n }\n } else if (type === 'category' && childDomain) {\n var axisDomain = childDomain;\n var isDomainValid = domain.every(function (entry) {\n return axisDomain.indexOf(entry) >= 0;\n });\n if (isDomainValid) {\n domain = axisDomain;\n }\n }\n }\n return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, axisId, _objectSpread(_objectSpread({}, child.props), {}, {\n axisType: axisType,\n domain: domain,\n categoricalDomain: categoricalDomain,\n duplicateDomain: duplicateDomain,\n originalDomain: (_child$props$domain2 = child.props.domain) !== null && _child$props$domain2 !== void 0 ? _child$props$domain2 : defaultDomain,\n isCategorical: isCategorical,\n layout: layout\n })));\n }, {});\n return axisMap;\n};\n\n/**\n * Get the configuration of axis by the options of item,\n * this kind of axis does not display in chart\n * @param {Object} props Latest props\n * @param {Array} graphicalItems The instances of item\n * @param {ReactElement} Axis Axis Component\n * @param {String} axisType The type of axis, xAxis - x-axis, yAxis - y-axis\n * @param {String} axisIdKey The unique id of an axis\n * @param {Object} stackGroups The items grouped by axisId and stackId\n * @param {Number} dataStartIndex The start index of the data series when a brush is applied\n * @param {Number} dataEndIndex The end index of the data series when a brush is applied\n * @return {Object} Configuration\n */\nvar getAxisMapByItems = function getAxisMapByItems(props, _ref3) {\n var graphicalItems = _ref3.graphicalItems,\n Axis = _ref3.Axis,\n axisType = _ref3.axisType,\n axisIdKey = _ref3.axisIdKey,\n stackGroups = _ref3.stackGroups,\n dataStartIndex = _ref3.dataStartIndex,\n dataEndIndex = _ref3.dataEndIndex;\n var layout = props.layout,\n children = props.children;\n var displayedData = getDisplayedData(props.data, {\n graphicalItems: graphicalItems,\n dataStartIndex: dataStartIndex,\n dataEndIndex: dataEndIndex\n });\n var len = displayedData.length;\n var isCategorical = isCategoricalAxis(layout, axisType);\n var index = -1;\n\n // The default type of x-axis is category axis,\n // The default contents of x-axis is the serial numbers of data\n // The default type of y-axis is number axis\n // The default contents of y-axis is the domain of data\n var axisMap = graphicalItems.reduce(function (result, child) {\n var axisId = child.props[axisIdKey];\n var originalDomain = getDefaultDomainByAxisType('number');\n if (!result[axisId]) {\n index++;\n var domain;\n if (isCategorical) {\n domain = _range(0, len);\n } else if (stackGroups && stackGroups[axisId] && stackGroups[axisId].hasStack) {\n domain = getDomainOfStackGroups(stackGroups[axisId].stackGroups, dataStartIndex, dataEndIndex);\n domain = detectReferenceElementsDomain(children, domain, axisId, axisType);\n } else {\n domain = parseSpecifiedDomain(originalDomain, getDomainOfItemsWithSameAxis(displayedData, graphicalItems.filter(function (item) {\n return item.props[axisIdKey] === axisId && !item.props.hide;\n }), 'number', layout), Axis.defaultProps.allowDataOverflow);\n domain = detectReferenceElementsDomain(children, domain, axisId, axisType);\n }\n return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, axisId, _objectSpread(_objectSpread({\n axisType: axisType\n }, Axis.defaultProps), {}, {\n hide: true,\n orientation: _get(ORIENT_MAP, \"\".concat(axisType, \".\").concat(index % 2), null),\n domain: domain,\n originalDomain: originalDomain,\n isCategorical: isCategorical,\n layout: layout\n // specify scale when no Axis\n // scale: isCategorical ? 'band' : 'linear',\n })));\n }\n\n return result;\n }, {});\n return axisMap;\n};\n\n/**\n * Get the configuration of all x-axis or y-axis\n * @param {Object} props Latest props\n * @param {String} axisType The type of axis\n * @param {Array} graphicalItems The instances of item\n * @param {Object} stackGroups The items grouped by axisId and stackId\n * @param {Number} dataStartIndex The start index of the data series when a brush is applied\n * @param {Number} dataEndIndex The end index of the data series when a brush is applied\n * @return {Object} Configuration\n */\nvar getAxisMap = function getAxisMap(props, _ref4) {\n var _ref4$axisType = _ref4.axisType,\n axisType = _ref4$axisType === void 0 ? 'xAxis' : _ref4$axisType,\n AxisComp = _ref4.AxisComp,\n graphicalItems = _ref4.graphicalItems,\n stackGroups = _ref4.stackGroups,\n dataStartIndex = _ref4.dataStartIndex,\n dataEndIndex = _ref4.dataEndIndex;\n var children = props.children;\n var axisIdKey = \"\".concat(axisType, \"Id\");\n // Get all the instance of Axis\n var axes = findAllByType(children, AxisComp);\n var axisMap = {};\n if (axes && axes.length) {\n axisMap = getAxisMapByAxes(props, {\n axes: axes,\n graphicalItems: graphicalItems,\n axisType: axisType,\n axisIdKey: axisIdKey,\n stackGroups: stackGroups,\n dataStartIndex: dataStartIndex,\n dataEndIndex: dataEndIndex\n });\n } else if (graphicalItems && graphicalItems.length) {\n axisMap = getAxisMapByItems(props, {\n Axis: AxisComp,\n graphicalItems: graphicalItems,\n axisType: axisType,\n axisIdKey: axisIdKey,\n stackGroups: stackGroups,\n dataStartIndex: dataStartIndex,\n dataEndIndex: dataEndIndex\n });\n }\n return axisMap;\n};\nvar tooltipTicksGenerator = function tooltipTicksGenerator(axisMap) {\n var axis = getAnyElementOfObject(axisMap);\n var tooltipTicks = getTicksOfAxis(axis, false, true);\n return {\n tooltipTicks: tooltipTicks,\n orderedTooltipTicks: _sortBy(tooltipTicks, function (o) {\n return o.coordinate;\n }),\n tooltipAxis: axis,\n tooltipAxisBandSize: getBandSizeOfAxis(axis, tooltipTicks)\n };\n};\n\n/**\n * Returns default, reset state for the categorical chart.\n * @param {Object} props Props object to use when creating the default state\n * @return {Object} Whole new state\n */\nvar createDefaultState = function createDefaultState(props) {\n var _brushItem$props, _brushItem$props2;\n var children = props.children,\n defaultShowTooltip = props.defaultShowTooltip;\n var brushItem = findChildByType(children, Brush);\n var startIndex = brushItem && brushItem.props && brushItem.props.startIndex || 0;\n var endIndex = (brushItem === null || brushItem === void 0 || (_brushItem$props = brushItem.props) === null || _brushItem$props === void 0 ? void 0 : _brushItem$props.endIndex) !== undefined ? brushItem === null || brushItem === void 0 || (_brushItem$props2 = brushItem.props) === null || _brushItem$props2 === void 0 ? void 0 : _brushItem$props2.endIndex : props.data && props.data.length - 1 || 0;\n return {\n chartX: 0,\n chartY: 0,\n dataStartIndex: startIndex,\n dataEndIndex: endIndex,\n activeTooltipIndex: -1,\n isTooltipActive: !_isNil(defaultShowTooltip) ? defaultShowTooltip : false\n };\n};\nvar hasGraphicalBarItem = function hasGraphicalBarItem(graphicalItems) {\n if (!graphicalItems || !graphicalItems.length) {\n return false;\n }\n return graphicalItems.some(function (item) {\n var name = getDisplayName(item && item.type);\n return name && name.indexOf('Bar') >= 0;\n });\n};\nvar getAxisNameByLayout = function getAxisNameByLayout(layout) {\n if (layout === 'horizontal') {\n return {\n numericAxisName: 'yAxis',\n cateAxisName: 'xAxis'\n };\n }\n if (layout === 'vertical') {\n return {\n numericAxisName: 'xAxis',\n cateAxisName: 'yAxis'\n };\n }\n if (layout === 'centric') {\n return {\n numericAxisName: 'radiusAxis',\n cateAxisName: 'angleAxis'\n };\n }\n return {\n numericAxisName: 'angleAxis',\n cateAxisName: 'radiusAxis'\n };\n};\n\n/**\n * Calculate the offset of main part in the svg element\n * @param {Object} params.props Latest props\n * @param {Array} params.graphicalItems The instances of item\n * @param {Object} params.xAxisMap The configuration of x-axis\n * @param {Object} params.yAxisMap The configuration of y-axis\n * @param {Object} prevLegendBBox The boundary box of legend\n * @return {Object} The offset of main part in the svg element\n */\nvar calculateOffset = function calculateOffset(_ref5, prevLegendBBox) {\n var props = _ref5.props,\n graphicalItems = _ref5.graphicalItems,\n _ref5$xAxisMap = _ref5.xAxisMap,\n xAxisMap = _ref5$xAxisMap === void 0 ? {} : _ref5$xAxisMap,\n _ref5$yAxisMap = _ref5.yAxisMap,\n yAxisMap = _ref5$yAxisMap === void 0 ? {} : _ref5$yAxisMap;\n var width = props.width,\n height = props.height,\n children = props.children;\n var margin = props.margin || {};\n var brushItem = findChildByType(children, Brush);\n var legendItem = findChildByType(children, Legend);\n var offsetH = Object.keys(yAxisMap).reduce(function (result, id) {\n var entry = yAxisMap[id];\n var orientation = entry.orientation;\n if (!entry.mirror && !entry.hide) {\n return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, orientation, result[orientation] + entry.width));\n }\n return result;\n }, {\n left: margin.left || 0,\n right: margin.right || 0\n });\n var offsetV = Object.keys(xAxisMap).reduce(function (result, id) {\n var entry = xAxisMap[id];\n var orientation = entry.orientation;\n if (!entry.mirror && !entry.hide) {\n return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, orientation, _get(result, \"\".concat(orientation)) + entry.height));\n }\n return result;\n }, {\n top: margin.top || 0,\n bottom: margin.bottom || 0\n });\n var offset = _objectSpread(_objectSpread({}, offsetV), offsetH);\n var brushBottom = offset.bottom;\n if (brushItem) {\n offset.bottom += brushItem.props.height || Brush.defaultProps.height;\n }\n if (legendItem && prevLegendBBox) {\n // @ts-expect-error margin is optional in props but required in appendOffsetOfLegend\n offset = appendOffsetOfLegend(offset, graphicalItems, props, prevLegendBBox);\n }\n return _objectSpread(_objectSpread({\n brushBottom: brushBottom\n }, offset), {}, {\n width: width - offset.left - offset.right,\n height: height - offset.top - offset.bottom\n });\n};\nexport var generateCategoricalChart = function generateCategoricalChart(_ref6) {\n var _class;\n var chartName = _ref6.chartName,\n GraphicalChild = _ref6.GraphicalChild,\n _ref6$defaultTooltipE = _ref6.defaultTooltipEventType,\n defaultTooltipEventType = _ref6$defaultTooltipE === void 0 ? 'axis' : _ref6$defaultTooltipE,\n _ref6$validateTooltip = _ref6.validateTooltipEventTypes,\n validateTooltipEventTypes = _ref6$validateTooltip === void 0 ? ['axis'] : _ref6$validateTooltip,\n axisComponents = _ref6.axisComponents,\n legendContent = _ref6.legendContent,\n formatAxisMap = _ref6.formatAxisMap,\n defaultProps = _ref6.defaultProps;\n var getFormatItems = function getFormatItems(props, currentState) {\n var graphicalItems = currentState.graphicalItems,\n stackGroups = currentState.stackGroups,\n offset = currentState.offset,\n updateId = currentState.updateId,\n dataStartIndex = currentState.dataStartIndex,\n dataEndIndex = currentState.dataEndIndex;\n var barSize = props.barSize,\n layout = props.layout,\n barGap = props.barGap,\n barCategoryGap = props.barCategoryGap,\n globalMaxBarSize = props.maxBarSize;\n var _getAxisNameByLayout = getAxisNameByLayout(layout),\n numericAxisName = _getAxisNameByLayout.numericAxisName,\n cateAxisName = _getAxisNameByLayout.cateAxisName;\n var hasBar = hasGraphicalBarItem(graphicalItems);\n var sizeList = hasBar && getBarSizeList({\n barSize: barSize,\n stackGroups: stackGroups\n });\n var formattedItems = [];\n graphicalItems.forEach(function (item, index) {\n var displayedData = getDisplayedData(props.data, {\n dataStartIndex: dataStartIndex,\n dataEndIndex: dataEndIndex\n }, item);\n var _item$props = item.props,\n dataKey = _item$props.dataKey,\n childMaxBarSize = _item$props.maxBarSize;\n // axisId of the numerical axis\n var numericAxisId = item.props[\"\".concat(numericAxisName, \"Id\")];\n // axisId of the categorical axis\n var cateAxisId = item.props[\"\".concat(cateAxisName, \"Id\")];\n var axisObjInitialValue = {};\n var axisObj = axisComponents.reduce(function (result, entry) {\n var _item$type$displayNam, _item$type, _objectSpread6;\n // map of axisId to axis for a specific axis type\n var axisMap = currentState[\"\".concat(entry.axisType, \"Map\")];\n // axisId of axis we are currently computing\n var id = item.props[\"\".concat(entry.axisType, \"Id\")];\n\n /**\n * tell the user in dev mode that their configuration is incorrect if we cannot find a match between\n * axisId on the chart and axisId on the axis. zAxis does not get passed in the map for ComposedChart,\n * leave it out of the check for now.\n */\n !(axisMap && axisMap[id] || entry.axisType === 'zAxis') ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Specifying a(n) \".concat(entry.axisType, \"Id requires a corresponding \").concat(entry.axisType\n // @ts-expect-error we should stop reading data from ReactElements\n , \"Id on the targeted graphical component \").concat((_item$type$displayNam = item === null || item === void 0 || (_item$type = item.type) === null || _item$type === void 0 ? void 0 : _item$type.displayName) !== null && _item$type$displayNam !== void 0 ? _item$type$displayNam : '')) : invariant(false) : void 0;\n\n // the axis we are currently formatting\n var axis = axisMap[id];\n return _objectSpread(_objectSpread({}, result), {}, (_objectSpread6 = {}, _defineProperty(_objectSpread6, entry.axisType, axis), _defineProperty(_objectSpread6, \"\".concat(entry.axisType, \"Ticks\"), getTicksOfAxis(axis)), _objectSpread6));\n }, axisObjInitialValue);\n var cateAxis = axisObj[cateAxisName];\n var cateTicks = axisObj[\"\".concat(cateAxisName, \"Ticks\")];\n var stackedData = stackGroups && stackGroups[numericAxisId] && stackGroups[numericAxisId].hasStack && getStackedDataOfItem(item, stackGroups[numericAxisId].stackGroups);\n var itemIsBar = getDisplayName(item.type).indexOf('Bar') >= 0;\n var bandSize = getBandSizeOfAxis(cateAxis, cateTicks);\n var barPosition = [];\n if (itemIsBar) {\n var _ref7, _getBandSizeOfAxis;\n // 如果是bar,计算bar的位置\n var maxBarSize = _isNil(childMaxBarSize) ? globalMaxBarSize : childMaxBarSize;\n var barBandSize = (_ref7 = (_getBandSizeOfAxis = getBandSizeOfAxis(cateAxis, cateTicks, true)) !== null && _getBandSizeOfAxis !== void 0 ? _getBandSizeOfAxis : maxBarSize) !== null && _ref7 !== void 0 ? _ref7 : 0;\n barPosition = getBarPosition({\n barGap: barGap,\n barCategoryGap: barCategoryGap,\n bandSize: barBandSize !== bandSize ? barBandSize : bandSize,\n sizeList: sizeList[cateAxisId],\n maxBarSize: maxBarSize\n });\n if (barBandSize !== bandSize) {\n barPosition = barPosition.map(function (pos) {\n return _objectSpread(_objectSpread({}, pos), {}, {\n position: _objectSpread(_objectSpread({}, pos.position), {}, {\n offset: pos.position.offset - barBandSize / 2\n })\n });\n });\n }\n }\n // @ts-expect-error we should stop reading data from ReactElements\n var composedFn = item && item.type && item.type.getComposedData;\n if (composedFn) {\n var _objectSpread7;\n formattedItems.push({\n props: _objectSpread(_objectSpread({}, composedFn(_objectSpread(_objectSpread({}, axisObj), {}, {\n displayedData: displayedData,\n props: props,\n dataKey: dataKey,\n item: item,\n bandSize: bandSize,\n barPosition: barPosition,\n offset: offset,\n stackedData: stackedData,\n layout: layout,\n dataStartIndex: dataStartIndex,\n dataEndIndex: dataEndIndex\n }))), {}, (_objectSpread7 = {\n key: item.key || \"item-\".concat(index)\n }, _defineProperty(_objectSpread7, numericAxisName, axisObj[numericAxisName]), _defineProperty(_objectSpread7, cateAxisName, axisObj[cateAxisName]), _defineProperty(_objectSpread7, \"animationId\", updateId), _objectSpread7)),\n childIndex: parseChildIndex(item, props.children),\n item: item\n });\n }\n });\n return formattedItems;\n };\n\n /**\n * The AxisMaps are expensive to render on large data sets\n * so provide the ability to store them in state and only update them when necessary\n * they are dependent upon the start and end index of\n * the brush so it's important that this method is called _after_\n * the state is updated with any new start/end indices\n *\n * @param {Object} props The props object to be used for updating the axismaps\n * dataStartIndex: The start index of the data series when a brush is applied\n * dataEndIndex: The end index of the data series when a brush is applied\n * updateId: The update id\n * @param {Object} prevState Prev state\n * @return {Object} state New state to set\n */\n var updateStateOfAxisMapsOffsetAndStackGroups = function updateStateOfAxisMapsOffsetAndStackGroups(_ref8, prevState) {\n var props = _ref8.props,\n dataStartIndex = _ref8.dataStartIndex,\n dataEndIndex = _ref8.dataEndIndex,\n updateId = _ref8.updateId;\n if (!validateWidthHeight({\n props: props\n })) {\n return null;\n }\n var children = props.children,\n layout = props.layout,\n stackOffset = props.stackOffset,\n data = props.data,\n reverseStackOrder = props.reverseStackOrder;\n var _getAxisNameByLayout2 = getAxisNameByLayout(layout),\n numericAxisName = _getAxisNameByLayout2.numericAxisName,\n cateAxisName = _getAxisNameByLayout2.cateAxisName;\n var graphicalItems = findAllByType(children, GraphicalChild);\n var stackGroups = getStackGroupsByAxisId(data, graphicalItems, \"\".concat(numericAxisName, \"Id\"), \"\".concat(cateAxisName, \"Id\"), stackOffset, reverseStackOrder);\n var axisObj = axisComponents.reduce(function (result, entry) {\n var name = \"\".concat(entry.axisType, \"Map\");\n return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, name, getAxisMap(props, _objectSpread(_objectSpread({}, entry), {}, {\n graphicalItems: graphicalItems,\n stackGroups: entry.axisType === numericAxisName && stackGroups,\n dataStartIndex: dataStartIndex,\n dataEndIndex: dataEndIndex\n }))));\n }, {});\n var offset = calculateOffset(_objectSpread(_objectSpread({}, axisObj), {}, {\n props: props,\n graphicalItems: graphicalItems\n }), prevState === null || prevState === void 0 ? void 0 : prevState.legendBBox);\n Object.keys(axisObj).forEach(function (key) {\n axisObj[key] = formatAxisMap(props, axisObj[key], offset, key.replace('Map', ''), chartName);\n });\n var cateAxisMap = axisObj[\"\".concat(cateAxisName, \"Map\")];\n var ticksObj = tooltipTicksGenerator(cateAxisMap);\n var formattedGraphicalItems = getFormatItems(props, _objectSpread(_objectSpread({}, axisObj), {}, {\n dataStartIndex: dataStartIndex,\n dataEndIndex: dataEndIndex,\n updateId: updateId,\n graphicalItems: graphicalItems,\n stackGroups: stackGroups,\n offset: offset\n }));\n return _objectSpread(_objectSpread({\n formattedGraphicalItems: formattedGraphicalItems,\n graphicalItems: graphicalItems,\n offset: offset,\n stackGroups: stackGroups\n }, ticksObj), axisObj);\n };\n return _class = /*#__PURE__*/function (_Component) {\n _inherits(CategoricalChartWrapper, _Component);\n var _super = _createSuper(CategoricalChartWrapper);\n function CategoricalChartWrapper(_props) {\n var _this;\n _classCallCheck(this, CategoricalChartWrapper);\n _this = _super.call(this, _props);\n _defineProperty(_assertThisInitialized(_this), \"accessibilityManager\", new AccessibilityManager());\n _defineProperty(_assertThisInitialized(_this), \"clearDefer\", function () {\n if (_this.cancelDefer) {\n _this.cancelDefer();\n _this.cancelDefer = null;\n }\n });\n _defineProperty(_assertThisInitialized(_this), \"handleLegendBBoxUpdate\", function (box) {\n if (box) {\n var _this$state = _this.state,\n dataStartIndex = _this$state.dataStartIndex,\n dataEndIndex = _this$state.dataEndIndex,\n updateId = _this$state.updateId;\n _this.setState(_objectSpread({\n legendBBox: box\n }, updateStateOfAxisMapsOffsetAndStackGroups({\n props: _this.props,\n dataStartIndex: dataStartIndex,\n dataEndIndex: dataEndIndex,\n updateId: updateId\n }, _objectSpread(_objectSpread({}, _this.state), {}, {\n legendBBox: box\n }))));\n }\n });\n _defineProperty(_assertThisInitialized(_this), \"handleReceiveSyncEvent\", function (cId, chartId, data) {\n var syncId = _this.props.syncId;\n if (syncId === cId && chartId !== _this.uniqueChartId) {\n _this.clearDefer();\n _this.cancelDefer = deferer(_this.applySyncEvent.bind(_assertThisInitialized(_this), data));\n }\n });\n _defineProperty(_assertThisInitialized(_this), \"handleBrushChange\", function (_ref9) {\n var startIndex = _ref9.startIndex,\n endIndex = _ref9.endIndex;\n // Only trigger changes if the extents of the brush have actually changed\n if (startIndex !== _this.state.dataStartIndex || endIndex !== _this.state.dataEndIndex) {\n var updateId = _this.state.updateId;\n _this.setState(function () {\n return _objectSpread({\n dataStartIndex: startIndex,\n dataEndIndex: endIndex\n }, updateStateOfAxisMapsOffsetAndStackGroups({\n props: _this.props,\n dataStartIndex: startIndex,\n dataEndIndex: endIndex,\n updateId: updateId\n }, _this.state));\n });\n _this.triggerSyncEvent({\n dataStartIndex: startIndex,\n dataEndIndex: endIndex\n });\n }\n });\n /**\n * The handler of mouse entering chart\n * @param {Object} e Event object\n * @return {Null} null\n */\n _defineProperty(_assertThisInitialized(_this), \"handleMouseEnter\", function (e) {\n var onMouseEnter = _this.props.onMouseEnter;\n var mouse = _this.getMouseInfo(e);\n if (mouse) {\n var _nextState = _objectSpread(_objectSpread({}, mouse), {}, {\n isTooltipActive: true\n });\n _this.setState(_nextState);\n _this.triggerSyncEvent(_nextState);\n if (_isFunction(onMouseEnter)) {\n onMouseEnter(_nextState, e);\n }\n }\n });\n _defineProperty(_assertThisInitialized(_this), \"triggeredAfterMouseMove\", function (e) {\n var onMouseMove = _this.props.onMouseMove;\n var mouse = _this.getMouseInfo(e);\n var nextState = mouse ? _objectSpread(_objectSpread({}, mouse), {}, {\n isTooltipActive: true\n }) : {\n isTooltipActive: false\n };\n _this.setState(nextState);\n _this.triggerSyncEvent(nextState);\n if (_isFunction(onMouseMove)) {\n onMouseMove(nextState, e);\n }\n });\n /**\n * The handler of mouse entering a scatter\n * @param {Object} el The active scatter\n * @return {Object} no return\n */\n _defineProperty(_assertThisInitialized(_this), \"handleItemMouseEnter\", function (el) {\n _this.setState(function () {\n return {\n isTooltipActive: true,\n activeItem: el,\n activePayload: el.tooltipPayload,\n activeCoordinate: el.tooltipPosition || {\n x: el.cx,\n y: el.cy\n }\n };\n });\n });\n /**\n * The handler of mouse leaving a scatter\n * @return {Object} no return\n */\n _defineProperty(_assertThisInitialized(_this), \"handleItemMouseLeave\", function () {\n _this.setState(function () {\n return {\n isTooltipActive: false\n };\n });\n });\n /**\n * The handler of mouse moving in chart\n * @param {Object} e Event object\n * @return {Null} no return\n */\n _defineProperty(_assertThisInitialized(_this), \"handleMouseMove\", function (e) {\n if (e && _isFunction(e.persist)) {\n e.persist();\n }\n _this.triggeredAfterMouseMove(e);\n });\n /**\n * The handler if mouse leaving chart\n * @param {Object} e Event object\n * @return {Null} no return\n */\n _defineProperty(_assertThisInitialized(_this), \"handleMouseLeave\", function (e) {\n var onMouseLeave = _this.props.onMouseLeave;\n var nextState = {\n isTooltipActive: false\n };\n _this.setState(nextState);\n _this.triggerSyncEvent(nextState);\n if (_isFunction(onMouseLeave)) {\n onMouseLeave(nextState, e);\n }\n _this.cancelThrottledTriggerAfterMouseMove();\n });\n _defineProperty(_assertThisInitialized(_this), \"handleOuterEvent\", function (e) {\n var eventName = getReactEventByType(e);\n var event = _get(_this.props, \"\".concat(eventName));\n if (eventName && _isFunction(event)) {\n var mouse;\n if (/.*touch.*/i.test(eventName)) {\n mouse = _this.getMouseInfo(e.changedTouches[0]);\n } else {\n mouse = _this.getMouseInfo(e);\n }\n var handler = event;\n handler(mouse, e);\n }\n });\n _defineProperty(_assertThisInitialized(_this), \"handleClick\", function (e) {\n var onClick = _this.props.onClick;\n var mouse = _this.getMouseInfo(e);\n if (mouse) {\n var _nextState2 = _objectSpread(_objectSpread({}, mouse), {}, {\n isTooltipActive: true\n });\n _this.setState(_nextState2);\n _this.triggerSyncEvent(_nextState2);\n if (_isFunction(onClick)) {\n onClick(_nextState2, e);\n }\n }\n });\n _defineProperty(_assertThisInitialized(_this), \"handleMouseDown\", function (e) {\n var onMouseDown = _this.props.onMouseDown;\n if (_isFunction(onMouseDown)) {\n var _nextState3 = _this.getMouseInfo(e);\n onMouseDown(_nextState3, e);\n }\n });\n _defineProperty(_assertThisInitialized(_this), \"handleMouseUp\", function (e) {\n var onMouseUp = _this.props.onMouseUp;\n if (_isFunction(onMouseUp)) {\n var _nextState4 = _this.getMouseInfo(e);\n onMouseUp(_nextState4, e);\n }\n });\n _defineProperty(_assertThisInitialized(_this), \"handleTouchMove\", function (e) {\n if (e.changedTouches != null && e.changedTouches.length > 0) {\n _this.handleMouseMove(e.changedTouches[0]);\n }\n });\n _defineProperty(_assertThisInitialized(_this), \"handleTouchStart\", function (e) {\n if (e.changedTouches != null && e.changedTouches.length > 0) {\n _this.handleMouseDown(e.changedTouches[0]);\n }\n });\n _defineProperty(_assertThisInitialized(_this), \"handleTouchEnd\", function (e) {\n if (e.changedTouches != null && e.changedTouches.length > 0) {\n _this.handleMouseUp(e.changedTouches[0]);\n }\n });\n _defineProperty(_assertThisInitialized(_this), \"verticalCoordinatesGenerator\", function (_ref10, syncWithTicks) {\n var xAxis = _ref10.xAxis,\n width = _ref10.width,\n height = _ref10.height,\n offset = _ref10.offset;\n return getCoordinatesOfGrid(getTicks(_objectSpread(_objectSpread(_objectSpread({}, CartesianAxis.defaultProps), xAxis), {}, {\n ticks: getTicksOfAxis(xAxis, true),\n viewBox: {\n x: 0,\n y: 0,\n width: width,\n height: height\n }\n })), offset.left, offset.left + offset.width, syncWithTicks);\n });\n _defineProperty(_assertThisInitialized(_this), \"horizontalCoordinatesGenerator\", function (_ref11, syncWithTicks) {\n var yAxis = _ref11.yAxis,\n width = _ref11.width,\n height = _ref11.height,\n offset = _ref11.offset;\n return getCoordinatesOfGrid(getTicks(_objectSpread(_objectSpread(_objectSpread({}, CartesianAxis.defaultProps), yAxis), {}, {\n ticks: getTicksOfAxis(yAxis, true),\n viewBox: {\n x: 0,\n y: 0,\n width: width,\n height: height\n }\n })), offset.top, offset.top + offset.height, syncWithTicks);\n });\n _defineProperty(_assertThisInitialized(_this), \"axesTicksGenerator\", function (axis) {\n return getTicksOfAxis(axis, true);\n });\n _defineProperty(_assertThisInitialized(_this), \"renderCursor\", function (element) {\n var _this$state2 = _this.state,\n isTooltipActive = _this$state2.isTooltipActive,\n activeCoordinate = _this$state2.activeCoordinate,\n activePayload = _this$state2.activePayload,\n offset = _this$state2.offset,\n activeTooltipIndex = _this$state2.activeTooltipIndex,\n tooltipAxisBandSize = _this$state2.tooltipAxisBandSize;\n var tooltipEventType = _this.getTooltipEventType();\n if (!element || !element.props.cursor || !isTooltipActive || !activeCoordinate || chartName !== 'ScatterChart' && tooltipEventType !== 'axis') {\n return null;\n }\n var layout = _this.props.layout;\n var restProps;\n var cursorComp = Curve;\n if (chartName === 'ScatterChart') {\n restProps = activeCoordinate;\n cursorComp = Cross;\n } else if (chartName === 'BarChart') {\n restProps = getCursorRectangle(layout, activeCoordinate, offset, tooltipAxisBandSize);\n cursorComp = Rectangle;\n } else if (layout === 'radial') {\n var _getRadialCursorPoint = getRadialCursorPoints(activeCoordinate),\n cx = _getRadialCursorPoint.cx,\n cy = _getRadialCursorPoint.cy,\n radius = _getRadialCursorPoint.radius,\n startAngle = _getRadialCursorPoint.startAngle,\n endAngle = _getRadialCursorPoint.endAngle;\n restProps = {\n cx: cx,\n cy: cy,\n startAngle: startAngle,\n endAngle: endAngle,\n innerRadius: radius,\n outerRadius: radius\n };\n cursorComp = Sector;\n } else {\n restProps = {\n points: getCursorPoints(layout, activeCoordinate, offset)\n };\n cursorComp = Curve;\n }\n var key = element.key || '_recharts-cursor';\n var cursorProps = _objectSpread(_objectSpread(_objectSpread(_objectSpread({\n stroke: '#ccc',\n pointerEvents: 'none'\n }, offset), restProps), filterProps(element.props.cursor)), {}, {\n payload: activePayload,\n payloadIndex: activeTooltipIndex,\n key: key,\n className: 'recharts-tooltip-cursor'\n });\n return /*#__PURE__*/isValidElement(element.props.cursor) ? /*#__PURE__*/cloneElement(element.props.cursor, cursorProps) : /*#__PURE__*/createElement(cursorComp, cursorProps);\n });\n _defineProperty(_assertThisInitialized(_this), \"renderPolarAxis\", function (element, displayName, index) {\n var axisType = _get(element, 'type.axisType');\n var axisMap = _get(_this.state, \"\".concat(axisType, \"Map\"));\n var axisOption = axisMap && axisMap[element.props[\"\".concat(axisType, \"Id\")]];\n return /*#__PURE__*/cloneElement(element, _objectSpread(_objectSpread({}, axisOption), {}, {\n className: axisType,\n key: element.key || \"\".concat(displayName, \"-\").concat(index),\n ticks: getTicksOfAxis(axisOption, true)\n }));\n });\n _defineProperty(_assertThisInitialized(_this), \"renderXAxis\", function (element, displayName, index) {\n var xAxisMap = _this.state.xAxisMap;\n var axisObj = xAxisMap[element.props.xAxisId];\n return _this.renderAxis(axisObj, element, displayName, index);\n });\n _defineProperty(_assertThisInitialized(_this), \"renderYAxis\", function (element, displayName, index) {\n var yAxisMap = _this.state.yAxisMap;\n var axisObj = yAxisMap[element.props.yAxisId];\n return _this.renderAxis(axisObj, element, displayName, index);\n });\n /**\n * Draw grid\n * @param {ReactElement} element the grid item\n * @return {ReactElement} The instance of grid\n */\n _defineProperty(_assertThisInitialized(_this), \"renderGrid\", function (element) {\n var _this$state3 = _this.state,\n xAxisMap = _this$state3.xAxisMap,\n yAxisMap = _this$state3.yAxisMap,\n offset = _this$state3.offset;\n var _this$props = _this.props,\n width = _this$props.width,\n height = _this$props.height;\n var xAxis = getAnyElementOfObject(xAxisMap);\n var yAxisWithFiniteDomain = _find(yAxisMap, function (axis) {\n return _every(axis.domain, isFinit);\n });\n var yAxis = yAxisWithFiniteDomain || getAnyElementOfObject(yAxisMap);\n var props = element.props || {};\n return /*#__PURE__*/cloneElement(element, {\n key: element.key || 'grid',\n x: isNumber(props.x) ? props.x : offset.left,\n y: isNumber(props.y) ? props.y : offset.top,\n width: isNumber(props.width) ? props.width : offset.width,\n height: isNumber(props.height) ? props.height : offset.height,\n xAxis: xAxis,\n yAxis: yAxis,\n offset: offset,\n chartWidth: width,\n chartHeight: height,\n verticalCoordinatesGenerator: props.verticalCoordinatesGenerator || _this.verticalCoordinatesGenerator,\n horizontalCoordinatesGenerator: props.horizontalCoordinatesGenerator || _this.horizontalCoordinatesGenerator\n });\n });\n _defineProperty(_assertThisInitialized(_this), \"renderPolarGrid\", function (element) {\n var _element$props = element.props,\n radialLines = _element$props.radialLines,\n polarAngles = _element$props.polarAngles,\n polarRadius = _element$props.polarRadius;\n var _this$state4 = _this.state,\n radiusAxisMap = _this$state4.radiusAxisMap,\n angleAxisMap = _this$state4.angleAxisMap;\n var radiusAxis = getAnyElementOfObject(radiusAxisMap);\n var angleAxis = getAnyElementOfObject(angleAxisMap);\n var cx = angleAxis.cx,\n cy = angleAxis.cy,\n innerRadius = angleAxis.innerRadius,\n outerRadius = angleAxis.outerRadius;\n return /*#__PURE__*/cloneElement(element, {\n polarAngles: _isArray(polarAngles) ? polarAngles : getTicksOfAxis(angleAxis, true).map(function (entry) {\n return entry.coordinate;\n }),\n polarRadius: _isArray(polarRadius) ? polarRadius : getTicksOfAxis(radiusAxis, true).map(function (entry) {\n return entry.coordinate;\n }),\n cx: cx,\n cy: cy,\n innerRadius: innerRadius,\n outerRadius: outerRadius,\n key: element.key || 'polar-grid',\n radialLines: radialLines\n });\n });\n /**\n * Draw legend\n * @return {ReactElement} The instance of Legend\n */\n _defineProperty(_assertThisInitialized(_this), \"renderLegend\", function () {\n var formattedGraphicalItems = _this.state.formattedGraphicalItems;\n var _this$props2 = _this.props,\n children = _this$props2.children,\n width = _this$props2.width,\n height = _this$props2.height;\n var margin = _this.props.margin || {};\n var legendWidth = width - (margin.left || 0) - (margin.right || 0);\n var props = getLegendProps({\n children: children,\n formattedGraphicalItems: formattedGraphicalItems,\n legendWidth: legendWidth,\n legendContent: legendContent\n });\n if (!props) {\n return null;\n }\n var item = props.item,\n otherProps = _objectWithoutProperties(props, _excluded);\n return /*#__PURE__*/cloneElement(item, _objectSpread(_objectSpread({}, otherProps), {}, {\n chartWidth: width,\n chartHeight: height,\n margin: margin,\n onBBoxUpdate: _this.handleLegendBBoxUpdate\n }));\n });\n /**\n * Draw Tooltip\n * @return {ReactElement} The instance of Tooltip\n */\n _defineProperty(_assertThisInitialized(_this), \"renderTooltip\", function () {\n var children = _this.props.children;\n var tooltipItem = findChildByType(children, Tooltip);\n if (!tooltipItem) {\n return null;\n }\n var _this$state5 = _this.state,\n isTooltipActive = _this$state5.isTooltipActive,\n activeCoordinate = _this$state5.activeCoordinate,\n activePayload = _this$state5.activePayload,\n activeLabel = _this$state5.activeLabel,\n offset = _this$state5.offset;\n return /*#__PURE__*/cloneElement(tooltipItem, {\n viewBox: _objectSpread(_objectSpread({}, offset), {}, {\n x: offset.left,\n y: offset.top\n }),\n active: isTooltipActive,\n label: activeLabel,\n payload: isTooltipActive ? activePayload : [],\n coordinate: activeCoordinate\n });\n });\n _defineProperty(_assertThisInitialized(_this), \"renderBrush\", function (element) {\n var _this$props3 = _this.props,\n margin = _this$props3.margin,\n data = _this$props3.data;\n var _this$state6 = _this.state,\n offset = _this$state6.offset,\n dataStartIndex = _this$state6.dataStartIndex,\n dataEndIndex = _this$state6.dataEndIndex,\n updateId = _this$state6.updateId;\n\n // TODO: update brush when children update\n return /*#__PURE__*/cloneElement(element, {\n key: element.key || '_recharts-brush',\n onChange: combineEventHandlers(_this.handleBrushChange, null, element.props.onChange),\n data: data,\n x: isNumber(element.props.x) ? element.props.x : offset.left,\n y: isNumber(element.props.y) ? element.props.y : offset.top + offset.height + offset.brushBottom - (margin.bottom || 0),\n width: isNumber(element.props.width) ? element.props.width : offset.width,\n startIndex: dataStartIndex,\n endIndex: dataEndIndex,\n updateId: \"brush-\".concat(updateId)\n });\n });\n _defineProperty(_assertThisInitialized(_this), \"renderReferenceElement\", function (element, displayName, index) {\n if (!element) {\n return null;\n }\n var _assertThisInitialize = _assertThisInitialized(_this),\n clipPathId = _assertThisInitialize.clipPathId;\n var _this$state7 = _this.state,\n xAxisMap = _this$state7.xAxisMap,\n yAxisMap = _this$state7.yAxisMap,\n offset = _this$state7.offset;\n var _element$props2 = element.props,\n xAxisId = _element$props2.xAxisId,\n yAxisId = _element$props2.yAxisId;\n return /*#__PURE__*/cloneElement(element, {\n key: element.key || \"\".concat(displayName, \"-\").concat(index),\n xAxis: xAxisMap[xAxisId],\n yAxis: yAxisMap[yAxisId],\n viewBox: {\n x: offset.left,\n y: offset.top,\n width: offset.width,\n height: offset.height\n },\n clipPathId: clipPathId\n });\n });\n _defineProperty(_assertThisInitialized(_this), \"renderActivePoints\", function (_ref12) {\n var item = _ref12.item,\n activePoint = _ref12.activePoint,\n basePoint = _ref12.basePoint,\n childIndex = _ref12.childIndex,\n isRange = _ref12.isRange;\n var result = [];\n var key = item.props.key;\n var _item$item$props = item.item.props,\n activeDot = _item$item$props.activeDot,\n dataKey = _item$item$props.dataKey;\n var dotProps = _objectSpread(_objectSpread({\n index: childIndex,\n dataKey: dataKey,\n cx: activePoint.x,\n cy: activePoint.y,\n r: 4,\n fill: getMainColorOfGraphicItem(item.item),\n strokeWidth: 2,\n stroke: '#fff',\n payload: activePoint.payload,\n value: activePoint.value,\n key: \"\".concat(key, \"-activePoint-\").concat(childIndex)\n }, filterProps(activeDot)), adaptEventHandlers(activeDot));\n result.push(CategoricalChartWrapper.renderActiveDot(activeDot, dotProps));\n if (basePoint) {\n result.push(CategoricalChartWrapper.renderActiveDot(activeDot, _objectSpread(_objectSpread({}, dotProps), {}, {\n cx: basePoint.x,\n cy: basePoint.y,\n key: \"\".concat(key, \"-basePoint-\").concat(childIndex)\n })));\n } else if (isRange) {\n result.push(null);\n }\n return result;\n });\n _defineProperty(_assertThisInitialized(_this), \"renderGraphicChild\", function (element, displayName, index) {\n var item = _this.filterFormatItem(element, displayName, index);\n if (!item) {\n return null;\n }\n var tooltipEventType = _this.getTooltipEventType();\n var _this$state8 = _this.state,\n isTooltipActive = _this$state8.isTooltipActive,\n tooltipAxis = _this$state8.tooltipAxis,\n activeTooltipIndex = _this$state8.activeTooltipIndex,\n activeLabel = _this$state8.activeLabel;\n var children = _this.props.children;\n var tooltipItem = findChildByType(children, Tooltip);\n var _item$props2 = item.props,\n points = _item$props2.points,\n isRange = _item$props2.isRange,\n baseLine = _item$props2.baseLine;\n var _item$item$props2 = item.item.props,\n activeDot = _item$item$props2.activeDot,\n hide = _item$item$props2.hide,\n activeBar = _item$item$props2.activeBar,\n activeShape = _item$item$props2.activeShape;\n var hasActive = Boolean(!hide && isTooltipActive && tooltipItem && (activeDot || activeBar || activeShape));\n var itemEvents = {};\n if (tooltipEventType !== 'axis' && tooltipItem && tooltipItem.props.trigger === 'click') {\n itemEvents = {\n onClick: combineEventHandlers(_this.handleItemMouseEnter, null, element.props.onCLick)\n };\n } else if (tooltipEventType !== 'axis') {\n itemEvents = {\n onMouseLeave: combineEventHandlers(_this.handleItemMouseLeave, null, element.props.onMouseLeave),\n onMouseEnter: combineEventHandlers(_this.handleItemMouseEnter, null, element.props.onMouseEnter)\n };\n }\n var graphicalItem = /*#__PURE__*/cloneElement(element, _objectSpread(_objectSpread({}, item.props), itemEvents));\n function findWithPayload(entry) {\n // TODO needs to verify dataKey is Function\n return typeof tooltipAxis.dataKey === 'function' ? tooltipAxis.dataKey(entry.payload) : null;\n }\n if (hasActive) {\n if (activeTooltipIndex >= 0) {\n var activePoint, basePoint;\n if (tooltipAxis.dataKey && !tooltipAxis.allowDuplicatedCategory) {\n // number transform to string\n var specifiedKey = typeof tooltipAxis.dataKey === 'function' ? findWithPayload : 'payload.'.concat(tooltipAxis.dataKey.toString());\n activePoint = findEntryInArray(points, specifiedKey, activeLabel);\n basePoint = isRange && baseLine && findEntryInArray(baseLine, specifiedKey, activeLabel);\n } else {\n activePoint = points === null || points === void 0 ? void 0 : points[activeTooltipIndex];\n basePoint = isRange && baseLine && baseLine[activeTooltipIndex];\n }\n if (activeShape || activeBar) {\n var activeIndex = element.props.activeIndex !== undefined ? element.props.activeIndex : activeTooltipIndex;\n return [/*#__PURE__*/cloneElement(element, _objectSpread(_objectSpread(_objectSpread({}, item.props), itemEvents), {}, {\n activeIndex: activeIndex\n })), null, null];\n }\n if (!_isNil(activePoint)) {\n return [graphicalItem].concat(_toConsumableArray(_this.renderActivePoints({\n item: item,\n activePoint: activePoint,\n basePoint: basePoint,\n childIndex: activeTooltipIndex,\n isRange: isRange\n })));\n }\n } else {\n var _this$getItemByXY;\n /**\n * We hit this block if consumer uses a Tooltip without XAxis and/or YAxis.\n * In which case, this.state.activeTooltipIndex never gets set\n * because the mouse events that trigger that value getting set never get trigged without the axis components.\n *\n * An example usage case is a FunnelChart\n */\n var _ref13 = (_this$getItemByXY = _this.getItemByXY(_this.state.activeCoordinate)) !== null && _this$getItemByXY !== void 0 ? _this$getItemByXY : {\n graphicalItem: graphicalItem\n },\n _ref13$graphicalItem = _ref13.graphicalItem,\n _ref13$graphicalItem$ = _ref13$graphicalItem.item,\n xyItem = _ref13$graphicalItem$ === void 0 ? element : _ref13$graphicalItem$,\n childIndex = _ref13$graphicalItem.childIndex;\n var elementProps = _objectSpread(_objectSpread(_objectSpread({}, item.props), itemEvents), {}, {\n activeIndex: childIndex\n });\n return [/*#__PURE__*/cloneElement(xyItem, elementProps), null, null];\n }\n }\n if (isRange) {\n return [graphicalItem, null, null];\n }\n return [graphicalItem, null];\n });\n _defineProperty(_assertThisInitialized(_this), \"renderCustomized\", function (element, displayName, index) {\n return /*#__PURE__*/cloneElement(element, _objectSpread(_objectSpread({\n key: \"recharts-customized-\".concat(index)\n }, _this.props), _this.state));\n });\n _this.uniqueChartId = _isNil(_props.id) ? uniqueId('recharts') : _props.id;\n _this.clipPathId = \"\".concat(_this.uniqueChartId, \"-clip\");\n if (_props.throttleDelay) {\n _this.triggeredAfterMouseMove = _throttle(_this.triggeredAfterMouseMove, _props.throttleDelay);\n }\n _this.state = {};\n return _this;\n }\n _createClass(CategoricalChartWrapper, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this$props$margin$le, _this$props$margin$to;\n if (!_isNil(this.props.syncId)) {\n this.addListener();\n }\n this.accessibilityManager.setDetails({\n container: this.container,\n offset: {\n left: (_this$props$margin$le = this.props.margin.left) !== null && _this$props$margin$le !== void 0 ? _this$props$margin$le : 0,\n top: (_this$props$margin$to = this.props.margin.top) !== null && _this$props$margin$to !== void 0 ? _this$props$margin$to : 0\n },\n coordinateList: this.state.tooltipTicks,\n mouseHandlerCallback: this.handleMouseMove,\n layout: this.props.layout\n });\n }\n }, {\n key: \"getSnapshotBeforeUpdate\",\n value: function getSnapshotBeforeUpdate(prevProps, prevState) {\n if (!this.props.accessibilityLayer) {\n return null;\n }\n if (this.state.tooltipTicks !== prevState.tooltipTicks) {\n this.accessibilityManager.setDetails({\n coordinateList: this.state.tooltipTicks\n });\n }\n if (this.props.layout !== prevProps.layout) {\n this.accessibilityManager.setDetails({\n layout: this.props.layout\n });\n }\n if (this.props.margin !== prevProps.margin) {\n var _this$props$margin$le2, _this$props$margin$to2;\n this.accessibilityManager.setDetails({\n offset: {\n left: (_this$props$margin$le2 = this.props.margin.left) !== null && _this$props$margin$le2 !== void 0 ? _this$props$margin$le2 : 0,\n top: (_this$props$margin$to2 = this.props.margin.top) !== null && _this$props$margin$to2 !== void 0 ? _this$props$margin$to2 : 0\n }\n });\n }\n\n // Something has to be returned for getSnapshotBeforeUpdate\n return null;\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n // add syncId\n if (_isNil(prevProps.syncId) && !_isNil(this.props.syncId)) {\n this.addListener();\n }\n // remove syncId\n if (!_isNil(prevProps.syncId) && _isNil(this.props.syncId)) {\n this.removeListener();\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.clearDefer();\n if (!_isNil(this.props.syncId)) {\n this.removeListener();\n }\n this.cancelThrottledTriggerAfterMouseMove();\n }\n }, {\n key: \"cancelThrottledTriggerAfterMouseMove\",\n value: function cancelThrottledTriggerAfterMouseMove() {\n if (typeof this.triggeredAfterMouseMove.cancel === 'function') {\n this.triggeredAfterMouseMove.cancel();\n }\n }\n }, {\n key: \"getTooltipEventType\",\n value: function getTooltipEventType() {\n var tooltipItem = findChildByType(this.props.children, Tooltip);\n if (tooltipItem && _isBoolean(tooltipItem.props.shared)) {\n var eventType = tooltipItem.props.shared ? 'axis' : 'item';\n return validateTooltipEventTypes.indexOf(eventType) >= 0 ? eventType : defaultTooltipEventType;\n }\n return defaultTooltipEventType;\n }\n\n /**\n * Get the information of mouse in chart, return null when the mouse is not in the chart\n * @param {Object} event The event object\n * @return {Object} Mouse data\n */\n }, {\n key: \"getMouseInfo\",\n value: function getMouseInfo(event) {\n var _element$getBoundingC;\n if (!this.container) {\n return null;\n }\n var containerOffset = getOffset(this.container);\n var e = calculateChartCoordinate(event, containerOffset);\n var element = this.container;\n var boundingRectWidth = element === null || element === void 0 || (_element$getBoundingC = element.getBoundingClientRect()) === null || _element$getBoundingC === void 0 ? void 0 : _element$getBoundingC.width;\n var offsetWidth = element.offsetWidth;\n var scale = boundingRectWidth / offsetWidth || 1;\n var rangeObj = this.inRange(e.chartX, e.chartY, scale);\n if (!rangeObj) {\n return null;\n }\n var _this$state9 = this.state,\n xAxisMap = _this$state9.xAxisMap,\n yAxisMap = _this$state9.yAxisMap;\n var tooltipEventType = this.getTooltipEventType();\n if (tooltipEventType !== 'axis' && xAxisMap && yAxisMap) {\n var xScale = getAnyElementOfObject(xAxisMap).scale;\n var yScale = getAnyElementOfObject(yAxisMap).scale;\n var xValue = xScale && xScale.invert ? xScale.invert(e.chartX) : null;\n var yValue = yScale && yScale.invert ? yScale.invert(e.chartY) : null;\n return _objectSpread(_objectSpread({}, e), {}, {\n xValue: xValue,\n yValue: yValue\n });\n }\n var toolTipData = getTooltipData(this.state, this.props.data, this.props.layout, rangeObj);\n if (toolTipData) {\n return _objectSpread(_objectSpread({}, e), toolTipData);\n }\n return null;\n }\n }, {\n key: \"inRange\",\n value: function inRange(x, y) {\n var scale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var layout = this.props.layout;\n var scaledX = x / scale,\n scaledY = y / scale;\n if (layout === 'horizontal' || layout === 'vertical') {\n var offset = this.state.offset;\n var isInRange = scaledX >= offset.left && scaledX <= offset.left + offset.width && scaledY >= offset.top && scaledY <= offset.top + offset.height;\n return isInRange ? {\n x: scaledX,\n y: scaledY\n } : null;\n }\n var _this$state10 = this.state,\n angleAxisMap = _this$state10.angleAxisMap,\n radiusAxisMap = _this$state10.radiusAxisMap;\n if (angleAxisMap && radiusAxisMap) {\n var angleAxis = getAnyElementOfObject(angleAxisMap);\n return inRangeOfSector({\n x: scaledX,\n y: scaledY\n }, angleAxis);\n }\n return null;\n }\n }, {\n key: \"parseEventsOfWrapper\",\n value: function parseEventsOfWrapper() {\n var children = this.props.children;\n var tooltipEventType = this.getTooltipEventType();\n var tooltipItem = findChildByType(children, Tooltip);\n var tooltipEvents = {};\n if (tooltipItem && tooltipEventType === 'axis') {\n if (tooltipItem.props.trigger === 'click') {\n tooltipEvents = {\n onClick: this.handleClick\n };\n } else {\n tooltipEvents = {\n onMouseEnter: this.handleMouseEnter,\n onMouseMove: this.handleMouseMove,\n onMouseLeave: this.handleMouseLeave,\n onTouchMove: this.handleTouchMove,\n onTouchStart: this.handleTouchStart,\n onTouchEnd: this.handleTouchEnd\n };\n }\n }\n\n // @ts-expect-error adaptEventHandlers expects DOM Event but generateCategoricalChart works with React UIEvents\n var outerEvents = adaptEventHandlers(this.props, this.handleOuterEvent);\n return _objectSpread(_objectSpread({}, outerEvents), tooltipEvents);\n }\n\n /* eslint-disable no-underscore-dangle */\n }, {\n key: \"addListener\",\n value: function addListener() {\n eventCenter.on(SYNC_EVENT, this.handleReceiveSyncEvent);\n if (eventCenter.setMaxListeners && eventCenter._maxListeners) {\n eventCenter.setMaxListeners(eventCenter._maxListeners + 1);\n }\n }\n }, {\n key: \"removeListener\",\n value: function removeListener() {\n eventCenter.removeListener(SYNC_EVENT, this.handleReceiveSyncEvent);\n if (eventCenter.setMaxListeners && eventCenter._maxListeners) {\n eventCenter.setMaxListeners(eventCenter._maxListeners - 1);\n }\n }\n }, {\n key: \"triggerSyncEvent\",\n value: function triggerSyncEvent(data) {\n var syncId = this.props.syncId;\n if (!_isNil(syncId)) {\n eventCenter.emit(SYNC_EVENT, syncId, this.uniqueChartId, data);\n }\n }\n }, {\n key: \"applySyncEvent\",\n value: function applySyncEvent(data) {\n var _this$props4 = this.props,\n layout = _this$props4.layout,\n syncMethod = _this$props4.syncMethod;\n var updateId = this.state.updateId;\n var dataStartIndex = data.dataStartIndex,\n dataEndIndex = data.dataEndIndex;\n if (!_isNil(data.dataStartIndex) || !_isNil(data.dataEndIndex)) {\n this.setState(_objectSpread({\n dataStartIndex: dataStartIndex,\n dataEndIndex: dataEndIndex\n }, updateStateOfAxisMapsOffsetAndStackGroups({\n props: this.props,\n dataStartIndex: dataStartIndex,\n dataEndIndex: dataEndIndex,\n updateId: updateId\n }, this.state)));\n } else if (!_isNil(data.activeTooltipIndex)) {\n var chartX = data.chartX,\n chartY = data.chartY;\n var activeTooltipIndex = data.activeTooltipIndex;\n var _this$state11 = this.state,\n offset = _this$state11.offset,\n tooltipTicks = _this$state11.tooltipTicks;\n if (!offset) {\n return;\n }\n if (typeof syncMethod === 'function') {\n // Call a callback function. If there is an application specific algorithm\n activeTooltipIndex = syncMethod(tooltipTicks, data);\n } else if (syncMethod === 'value') {\n // Set activeTooltipIndex to the index with the same value as data.activeLabel\n // For loop instead of findIndex because the latter is very slow in some browsers\n activeTooltipIndex = -1; // in case we cannot find the element\n for (var i = 0; i < tooltipTicks.length; i++) {\n if (tooltipTicks[i].value === data.activeLabel) {\n activeTooltipIndex = i;\n break;\n }\n }\n }\n var viewBox = _objectSpread(_objectSpread({}, offset), {}, {\n x: offset.left,\n y: offset.top\n });\n // When a categorical chart is combined with another chart, the value of chartX\n // and chartY may beyond the boundaries.\n var validateChartX = Math.min(chartX, viewBox.x + viewBox.width);\n var validateChartY = Math.min(chartY, viewBox.y + viewBox.height);\n var activeLabel = tooltipTicks[activeTooltipIndex] && tooltipTicks[activeTooltipIndex].value;\n var activePayload = getTooltipContent(this.state, this.props.data, activeTooltipIndex);\n var activeCoordinate = tooltipTicks[activeTooltipIndex] ? {\n x: layout === 'horizontal' ? tooltipTicks[activeTooltipIndex].coordinate : validateChartX,\n y: layout === 'horizontal' ? validateChartY : tooltipTicks[activeTooltipIndex].coordinate\n } : originCoordinate;\n this.setState(_objectSpread(_objectSpread({}, data), {}, {\n activeLabel: activeLabel,\n activeCoordinate: activeCoordinate,\n activePayload: activePayload,\n activeTooltipIndex: activeTooltipIndex\n }));\n } else {\n this.setState(data);\n }\n }\n }, {\n key: \"filterFormatItem\",\n value: function filterFormatItem(item, displayName, childIndex) {\n var formattedGraphicalItems = this.state.formattedGraphicalItems;\n for (var i = 0, len = formattedGraphicalItems.length; i < len; i++) {\n var entry = formattedGraphicalItems[i];\n if (entry.item === item || entry.props.key === item.key || displayName === getDisplayName(entry.item.type) && childIndex === entry.childIndex) {\n return entry;\n }\n }\n return null;\n }\n }, {\n key: \"renderAxis\",\n value:\n /**\n * Draw axis\n * @param {Object} axisOptions The options of axis\n * @param {Object} element The axis element\n * @param {String} displayName The display name of axis\n * @param {Number} index The index of element\n * @return {ReactElement} The instance of x-axes\n */\n function renderAxis(axisOptions, element, displayName, index) {\n var _this$props5 = this.props,\n width = _this$props5.width,\n height = _this$props5.height;\n return /*#__PURE__*/React.createElement(CartesianAxis, _extends({}, axisOptions, {\n className: classNames(\"recharts-\".concat(axisOptions.axisType, \" \").concat(axisOptions.axisType), axisOptions.className),\n key: element.key || \"\".concat(displayName, \"-\").concat(index),\n viewBox: {\n x: 0,\n y: 0,\n width: width,\n height: height\n },\n ticksGenerator: this.axesTicksGenerator\n }));\n }\n }, {\n key: \"renderClipPath\",\n value: function renderClipPath() {\n var clipPathId = this.clipPathId;\n var _this$state$offset = this.state.offset,\n left = _this$state$offset.left,\n top = _this$state$offset.top,\n height = _this$state$offset.height,\n width = _this$state$offset.width;\n return /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"clipPath\", {\n id: clipPathId\n }, /*#__PURE__*/React.createElement(\"rect\", {\n x: left,\n y: top,\n height: height,\n width: width\n })));\n }\n }, {\n key: \"getXScales\",\n value: function getXScales() {\n var xAxisMap = this.state.xAxisMap;\n return xAxisMap ? Object.entries(xAxisMap).reduce(function (res, _ref14) {\n var _ref15 = _slicedToArray(_ref14, 2),\n axisId = _ref15[0],\n axisProps = _ref15[1];\n return _objectSpread(_objectSpread({}, res), {}, _defineProperty({}, axisId, axisProps.scale));\n }, {}) : null;\n }\n }, {\n key: \"getYScales\",\n value: function getYScales() {\n var yAxisMap = this.state.yAxisMap;\n return yAxisMap ? Object.entries(yAxisMap).reduce(function (res, _ref16) {\n var _ref17 = _slicedToArray(_ref16, 2),\n axisId = _ref17[0],\n axisProps = _ref17[1];\n return _objectSpread(_objectSpread({}, res), {}, _defineProperty({}, axisId, axisProps.scale));\n }, {}) : null;\n }\n }, {\n key: \"getXScaleByAxisId\",\n value: function getXScaleByAxisId(axisId) {\n var _this$state$xAxisMap;\n return (_this$state$xAxisMap = this.state.xAxisMap) === null || _this$state$xAxisMap === void 0 || (_this$state$xAxisMap = _this$state$xAxisMap[axisId]) === null || _this$state$xAxisMap === void 0 ? void 0 : _this$state$xAxisMap.scale;\n }\n }, {\n key: \"getYScaleByAxisId\",\n value: function getYScaleByAxisId(axisId) {\n var _this$state$yAxisMap;\n return (_this$state$yAxisMap = this.state.yAxisMap) === null || _this$state$yAxisMap === void 0 || (_this$state$yAxisMap = _this$state$yAxisMap[axisId]) === null || _this$state$yAxisMap === void 0 ? void 0 : _this$state$yAxisMap.scale;\n }\n }, {\n key: \"getItemByXY\",\n value: function getItemByXY(chartXY) {\n var _this$state12 = this.state,\n formattedGraphicalItems = _this$state12.formattedGraphicalItems,\n activeItem = _this$state12.activeItem;\n if (formattedGraphicalItems && formattedGraphicalItems.length) {\n for (var i = 0, len = formattedGraphicalItems.length; i < len; i++) {\n var graphicalItem = formattedGraphicalItems[i];\n var props = graphicalItem.props,\n item = graphicalItem.item;\n var itemDisplayName = getDisplayName(item.type);\n if (itemDisplayName === 'Bar') {\n var activeBarItem = (props.data || []).find(function (entry) {\n return isInRectangle(chartXY, entry);\n });\n if (activeBarItem) {\n return {\n graphicalItem: graphicalItem,\n payload: activeBarItem\n };\n }\n } else if (itemDisplayName === 'RadialBar') {\n var _activeBarItem = (props.data || []).find(function (entry) {\n return inRangeOfSector(chartXY, entry);\n });\n if (_activeBarItem) {\n return {\n graphicalItem: graphicalItem,\n payload: _activeBarItem\n };\n }\n } else if (isFunnel(graphicalItem, activeItem) || isPie(graphicalItem, activeItem) || isScatter(graphicalItem, activeItem)) {\n var activeIndex = getActiveShapeIndexForTooltip({\n graphicalItem: graphicalItem,\n activeTooltipItem: activeItem,\n itemData: item.props.data\n });\n var childIndex = item.props.activeIndex === undefined ? activeIndex : item.props.activeIndex;\n return {\n graphicalItem: _objectSpread(_objectSpread({}, graphicalItem), {}, {\n childIndex: childIndex\n }),\n payload: isScatter(graphicalItem, activeItem) ? item.props.data[activeIndex] : graphicalItem.props.data[activeIndex]\n };\n }\n }\n }\n return null;\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n if (!validateWidthHeight(this)) {\n return null;\n }\n var _this$props6 = this.props,\n children = _this$props6.children,\n className = _this$props6.className,\n width = _this$props6.width,\n height = _this$props6.height,\n style = _this$props6.style,\n compact = _this$props6.compact,\n title = _this$props6.title,\n desc = _this$props6.desc,\n others = _objectWithoutProperties(_this$props6, _excluded2);\n var attrs = filterProps(others);\n var map = {\n CartesianGrid: {\n handler: this.renderGrid,\n once: true\n },\n ReferenceArea: {\n handler: this.renderReferenceElement\n },\n ReferenceLine: {\n handler: this.renderReferenceElement\n },\n ReferenceDot: {\n handler: this.renderReferenceElement\n },\n XAxis: {\n handler: this.renderXAxis\n },\n YAxis: {\n handler: this.renderYAxis\n },\n Brush: {\n handler: this.renderBrush,\n once: true\n },\n Bar: {\n handler: this.renderGraphicChild\n },\n Line: {\n handler: this.renderGraphicChild\n },\n Area: {\n handler: this.renderGraphicChild\n },\n Radar: {\n handler: this.renderGraphicChild\n },\n RadialBar: {\n handler: this.renderGraphicChild\n },\n Scatter: {\n handler: this.renderGraphicChild\n },\n Pie: {\n handler: this.renderGraphicChild\n },\n Funnel: {\n handler: this.renderGraphicChild\n },\n Tooltip: {\n handler: this.renderCursor,\n once: true\n },\n PolarGrid: {\n handler: this.renderPolarGrid,\n once: true\n },\n PolarAngleAxis: {\n handler: this.renderPolarAxis\n },\n PolarRadiusAxis: {\n handler: this.renderPolarAxis\n },\n Customized: {\n handler: this.renderCustomized\n }\n };\n\n // The \"compact\" mode is mainly used as the panorama within Brush\n if (compact) {\n return /*#__PURE__*/React.createElement(Surface, _extends({}, attrs, {\n width: width,\n height: height,\n title: title,\n desc: desc\n }), this.renderClipPath(), renderByOrder(children, map));\n }\n if (this.props.accessibilityLayer) {\n var _2, _img;\n // Set tabIndex to 0 by default (can be overwritten)\n attrs.tabIndex = (_2 = 0) !== null && _2 !== void 0 ? _2 : this.props.tabIndex;\n // Set role to img by default (can be overwritten)\n attrs.role = (_img = 'img') !== null && _img !== void 0 ? _img : this.props.role;\n attrs.onKeyDown = function (e) {\n _this2.accessibilityManager.keyboardEvent(e);\n // 'onKeyDown' is not currently a supported prop that can be passed through\n // if it's added, this should be added: this.props.onKeyDown(e);\n };\n\n attrs.onFocus = function () {\n _this2.accessibilityManager.focus();\n // 'onFocus' is not currently a supported prop that can be passed through\n // if it's added, the focus event should be forwarded to the prop\n };\n }\n\n var events = this.parseEventsOfWrapper();\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n className: classNames('recharts-wrapper', className),\n style: _objectSpread({\n position: 'relative',\n cursor: 'default',\n width: width,\n height: height\n }, style)\n }, events, {\n ref: function ref(node) {\n _this2.container = node;\n },\n role: \"region\"\n }), /*#__PURE__*/React.createElement(Surface, _extends({}, attrs, {\n width: width,\n height: height,\n title: title,\n desc: desc\n }), this.renderClipPath(), renderByOrder(children, map)), this.renderLegend(), this.renderTooltip());\n }\n }]);\n return CategoricalChartWrapper;\n }(Component), _defineProperty(_class, \"displayName\", chartName), _defineProperty(_class, \"defaultProps\", _objectSpread({\n layout: 'horizontal',\n stackOffset: 'none',\n barCategoryGap: '10%',\n barGap: 4,\n margin: {\n top: 5,\n right: 5,\n bottom: 5,\n left: 5\n },\n reverseStackOrder: false,\n syncMethod: 'index'\n }, defaultProps)), _defineProperty(_class, \"getDerivedStateFromProps\", function (nextProps, prevState) {\n var data = nextProps.data,\n children = nextProps.children,\n width = nextProps.width,\n height = nextProps.height,\n layout = nextProps.layout,\n stackOffset = nextProps.stackOffset,\n margin = nextProps.margin;\n if (_isNil(prevState.updateId)) {\n var defaultState = createDefaultState(nextProps);\n return _objectSpread(_objectSpread(_objectSpread({}, defaultState), {}, {\n updateId: 0\n }, updateStateOfAxisMapsOffsetAndStackGroups(_objectSpread(_objectSpread({\n props: nextProps\n }, defaultState), {}, {\n updateId: 0\n }), prevState)), {}, {\n prevData: data,\n prevWidth: width,\n prevHeight: height,\n prevLayout: layout,\n prevStackOffset: stackOffset,\n prevMargin: margin,\n prevChildren: children\n });\n }\n if (data !== prevState.prevData || width !== prevState.prevWidth || height !== prevState.prevHeight || layout !== prevState.prevLayout || stackOffset !== prevState.prevStackOffset || !shallowEqual(margin, prevState.prevMargin)) {\n var _defaultState = createDefaultState(nextProps);\n\n // Fixes https://github.com/recharts/recharts/issues/2143\n var keepFromPrevState = {\n // (chartX, chartY) are (0,0) in default state, but we want to keep the last mouse position to avoid\n // any flickering\n chartX: prevState.chartX,\n chartY: prevState.chartY,\n // The tooltip should stay active when it was active in the previous render. If this is not\n // the case, the tooltip disappears and immediately re-appears, causing a flickering effect\n isTooltipActive: prevState.isTooltipActive\n };\n var updatesToState = _objectSpread(_objectSpread({}, getTooltipData(prevState, data, layout)), {}, {\n updateId: prevState.updateId + 1\n });\n var newState = _objectSpread(_objectSpread(_objectSpread({}, _defaultState), keepFromPrevState), updatesToState);\n return _objectSpread(_objectSpread(_objectSpread({}, newState), updateStateOfAxisMapsOffsetAndStackGroups(_objectSpread({\n props: nextProps\n }, newState), prevState)), {}, {\n prevData: data,\n prevWidth: width,\n prevHeight: height,\n prevLayout: layout,\n prevStackOffset: stackOffset,\n prevMargin: margin,\n prevChildren: children\n });\n }\n if (!isChildrenEqual(children, prevState.prevChildren)) {\n // update configuration in children\n var hasGlobalData = !_isNil(data);\n var newUpdateId = hasGlobalData ? prevState.updateId : prevState.updateId + 1;\n return _objectSpread(_objectSpread({\n updateId: newUpdateId\n }, updateStateOfAxisMapsOffsetAndStackGroups(_objectSpread(_objectSpread({\n props: nextProps\n }, prevState), {}, {\n updateId: newUpdateId\n }), prevState)), {}, {\n prevChildren: children\n });\n }\n return null;\n }), _defineProperty(_class, \"renderActiveDot\", function (option, props) {\n var dot;\n if ( /*#__PURE__*/isValidElement(option)) {\n dot = /*#__PURE__*/cloneElement(option, props);\n } else if (_isFunction(option)) {\n dot = option(props);\n } else {\n dot = /*#__PURE__*/React.createElement(Dot, props);\n }\n return /*#__PURE__*/React.createElement(Layer, {\n className: \"recharts-active-dot\",\n key: props.key\n }, dot);\n }), _class;\n};","import { isNumber } from './DataUtils';\n/**\n * Takes a domain and user props to determine whether he provided the domain via props or if we need to calculate it.\n * @param {AxisDomain} domain The potential domain from props\n * @param {Boolean} allowDataOverflow from props\n * @param {String} axisType from props\n * @returns {Boolean} `true` if domain is specified by user\n */\nexport function isDomainSpecifiedByUser(domain, allowDataOverflow, axisType) {\n if (axisType === 'number' && allowDataOverflow === true && Array.isArray(domain)) {\n var domainStart = domain === null || domain === void 0 ? void 0 : domain[0];\n var domainEnd = domain === null || domain === void 0 ? void 0 : domain[1];\n\n /*\n * The `isNumber` check is needed because the user could also provide strings like \"dataMin\" via the domain props.\n * In such case, we have to compute the domain from the data.\n */\n if (!!domainStart && !!domainEnd && isNumber(domainStart) && isNumber(domainEnd)) {\n return true;\n }\n }\n return false;\n}","/**\n * @fileOverview Bar Chart\n */\nimport { generateCategoricalChart } from './generateCategoricalChart';\nimport { Bar } from '../cartesian/Bar';\nimport { XAxis } from '../cartesian/XAxis';\nimport { YAxis } from '../cartesian/YAxis';\nimport { formatAxisMap } from '../util/CartesianUtils';\nexport var BarChart = generateCategoricalChart({\n chartName: 'BarChart',\n GraphicalChild: Bar,\n defaultTooltipEventType: 'axis',\n validateTooltipEventTypes: ['axis', 'item'],\n axisComponents: [{\n axisType: 'xAxis',\n AxisComp: XAxis\n }, {\n axisType: 'yAxis',\n AxisComp: YAxis\n }],\n formatAxisMap: formatAxisMap\n});","/**\n * Will execute callback fn asynchronously.\n * It will detect the appropriate function to use.\n *\n * Named after the famous Swiss tennis player, Roger Deferer.\n *\n * @param {Function} callback will be executed asynchronously, with no arguments\n * @returns {Function} a cancel function.\n */\nexport function deferer(callback) {\n if (typeof requestAnimationFrame === 'function') {\n var frame = requestAnimationFrame(callback);\n return function () {\n return cancelAnimationFrame(frame);\n };\n }\n if (typeof setImmediate === 'function') {\n var handle = setImmediate(callback);\n return function () {\n return clearImmediate(handle);\n };\n }\n var timer = setTimeout(callback);\n return function () {\n return clearTimeout(timer);\n };\n}","export function getCursorRectangle(layout, activeCoordinate, offset, tooltipAxisBandSize) {\n var halfSize = tooltipAxisBandSize / 2;\n return {\n stroke: 'none',\n fill: '#ccc',\n x: layout === 'horizontal' ? activeCoordinate.x - halfSize : offset.left + 0.5,\n y: layout === 'horizontal' ? offset.top + 0.5 : activeCoordinate.y - halfSize,\n width: layout === 'horizontal' ? tooltipAxisBandSize : offset.width - 1,\n height: layout === 'horizontal' ? offset.height - 1 : tooltipAxisBandSize\n };\n}","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nimport _isObject from \"lodash/isObject\";\nimport _isFunction from \"lodash/isFunction\";\nimport _isNil from \"lodash/isNil\";\nvar _excluded = [\"offset\"];\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport React, { cloneElement, isValidElement, createElement } from 'react';\nimport classNames from 'classnames';\nimport { Text } from './Text';\nimport { findAllByType, filterProps } from '../util/ReactUtils';\nimport { isNumOrStr, isNumber, isPercent, getPercentValue, uniqueId, mathSign } from '../util/DataUtils';\nimport { polarToCartesian } from '../util/PolarUtils';\nvar getLabel = function getLabel(props) {\n var value = props.value,\n formatter = props.formatter;\n var label = _isNil(props.children) ? value : props.children;\n if (_isFunction(formatter)) {\n return formatter(label);\n }\n return label;\n};\nvar getDeltaAngle = function getDeltaAngle(startAngle, endAngle) {\n var sign = mathSign(endAngle - startAngle);\n var deltaAngle = Math.min(Math.abs(endAngle - startAngle), 360);\n return sign * deltaAngle;\n};\nvar renderRadialLabel = function renderRadialLabel(labelProps, label, attrs) {\n var position = labelProps.position,\n viewBox = labelProps.viewBox,\n offset = labelProps.offset,\n className = labelProps.className;\n var _ref = viewBox,\n cx = _ref.cx,\n cy = _ref.cy,\n innerRadius = _ref.innerRadius,\n outerRadius = _ref.outerRadius,\n startAngle = _ref.startAngle,\n endAngle = _ref.endAngle,\n clockWise = _ref.clockWise;\n var radius = (innerRadius + outerRadius) / 2;\n var deltaAngle = getDeltaAngle(startAngle, endAngle);\n var sign = deltaAngle >= 0 ? 1 : -1;\n var labelAngle, direction;\n if (position === 'insideStart') {\n labelAngle = startAngle + sign * offset;\n direction = clockWise;\n } else if (position === 'insideEnd') {\n labelAngle = endAngle - sign * offset;\n direction = !clockWise;\n } else if (position === 'end') {\n labelAngle = endAngle + sign * offset;\n direction = clockWise;\n }\n direction = deltaAngle <= 0 ? direction : !direction;\n var startPoint = polarToCartesian(cx, cy, radius, labelAngle);\n var endPoint = polarToCartesian(cx, cy, radius, labelAngle + (direction ? 1 : -1) * 359);\n var path = \"M\".concat(startPoint.x, \",\").concat(startPoint.y, \"\\n A\").concat(radius, \",\").concat(radius, \",0,1,\").concat(direction ? 0 : 1, \",\\n \").concat(endPoint.x, \",\").concat(endPoint.y);\n var id = _isNil(labelProps.id) ? uniqueId('recharts-radial-line-') : labelProps.id;\n return /*#__PURE__*/React.createElement(\"text\", _extends({}, attrs, {\n dominantBaseline: \"central\",\n className: classNames('recharts-radial-bar-label', className)\n }), /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"path\", {\n id: id,\n d: path\n })), /*#__PURE__*/React.createElement(\"textPath\", {\n xlinkHref: \"#\".concat(id)\n }, label));\n};\nvar getAttrsOfPolarLabel = function getAttrsOfPolarLabel(props) {\n var viewBox = props.viewBox,\n offset = props.offset,\n position = props.position;\n var _ref2 = viewBox,\n cx = _ref2.cx,\n cy = _ref2.cy,\n innerRadius = _ref2.innerRadius,\n outerRadius = _ref2.outerRadius,\n startAngle = _ref2.startAngle,\n endAngle = _ref2.endAngle;\n var midAngle = (startAngle + endAngle) / 2;\n if (position === 'outside') {\n var _polarToCartesian = polarToCartesian(cx, cy, outerRadius + offset, midAngle),\n _x = _polarToCartesian.x,\n _y = _polarToCartesian.y;\n return {\n x: _x,\n y: _y,\n textAnchor: _x >= cx ? 'start' : 'end',\n verticalAnchor: 'middle'\n };\n }\n if (position === 'center') {\n return {\n x: cx,\n y: cy,\n textAnchor: 'middle',\n verticalAnchor: 'middle'\n };\n }\n if (position === 'centerTop') {\n return {\n x: cx,\n y: cy,\n textAnchor: 'middle',\n verticalAnchor: 'start'\n };\n }\n if (position === 'centerBottom') {\n return {\n x: cx,\n y: cy,\n textAnchor: 'middle',\n verticalAnchor: 'end'\n };\n }\n var r = (innerRadius + outerRadius) / 2;\n var _polarToCartesian2 = polarToCartesian(cx, cy, r, midAngle),\n x = _polarToCartesian2.x,\n y = _polarToCartesian2.y;\n return {\n x: x,\n y: y,\n textAnchor: 'middle',\n verticalAnchor: 'middle'\n };\n};\nvar getAttrsOfCartesianLabel = function getAttrsOfCartesianLabel(props) {\n var viewBox = props.viewBox,\n parentViewBox = props.parentViewBox,\n offset = props.offset,\n position = props.position;\n var _ref3 = viewBox,\n x = _ref3.x,\n y = _ref3.y,\n width = _ref3.width,\n height = _ref3.height;\n\n // Define vertical offsets and position inverts based on the value being positive or negative\n var verticalSign = height >= 0 ? 1 : -1;\n var verticalOffset = verticalSign * offset;\n var verticalEnd = verticalSign > 0 ? 'end' : 'start';\n var verticalStart = verticalSign > 0 ? 'start' : 'end';\n\n // Define horizontal offsets and position inverts based on the value being positive or negative\n var horizontalSign = width >= 0 ? 1 : -1;\n var horizontalOffset = horizontalSign * offset;\n var horizontalEnd = horizontalSign > 0 ? 'end' : 'start';\n var horizontalStart = horizontalSign > 0 ? 'start' : 'end';\n if (position === 'top') {\n var attrs = {\n x: x + width / 2,\n y: y - verticalSign * offset,\n textAnchor: 'middle',\n verticalAnchor: verticalEnd\n };\n return _objectSpread(_objectSpread({}, attrs), parentViewBox ? {\n height: Math.max(y - parentViewBox.y, 0),\n width: width\n } : {});\n }\n if (position === 'bottom') {\n var _attrs = {\n x: x + width / 2,\n y: y + height + verticalOffset,\n textAnchor: 'middle',\n verticalAnchor: verticalStart\n };\n return _objectSpread(_objectSpread({}, _attrs), parentViewBox ? {\n height: Math.max(parentViewBox.y + parentViewBox.height - (y + height), 0),\n width: width\n } : {});\n }\n if (position === 'left') {\n var _attrs2 = {\n x: x - horizontalOffset,\n y: y + height / 2,\n textAnchor: horizontalEnd,\n verticalAnchor: 'middle'\n };\n return _objectSpread(_objectSpread({}, _attrs2), parentViewBox ? {\n width: Math.max(_attrs2.x - parentViewBox.x, 0),\n height: height\n } : {});\n }\n if (position === 'right') {\n var _attrs3 = {\n x: x + width + horizontalOffset,\n y: y + height / 2,\n textAnchor: horizontalStart,\n verticalAnchor: 'middle'\n };\n return _objectSpread(_objectSpread({}, _attrs3), parentViewBox ? {\n width: Math.max(parentViewBox.x + parentViewBox.width - _attrs3.x, 0),\n height: height\n } : {});\n }\n var sizeAttrs = parentViewBox ? {\n width: width,\n height: height\n } : {};\n if (position === 'insideLeft') {\n return _objectSpread({\n x: x + horizontalOffset,\n y: y + height / 2,\n textAnchor: horizontalStart,\n verticalAnchor: 'middle'\n }, sizeAttrs);\n }\n if (position === 'insideRight') {\n return _objectSpread({\n x: x + width - horizontalOffset,\n y: y + height / 2,\n textAnchor: horizontalEnd,\n verticalAnchor: 'middle'\n }, sizeAttrs);\n }\n if (position === 'insideTop') {\n return _objectSpread({\n x: x + width / 2,\n y: y + verticalOffset,\n textAnchor: 'middle',\n verticalAnchor: verticalStart\n }, sizeAttrs);\n }\n if (position === 'insideBottom') {\n return _objectSpread({\n x: x + width / 2,\n y: y + height - verticalOffset,\n textAnchor: 'middle',\n verticalAnchor: verticalEnd\n }, sizeAttrs);\n }\n if (position === 'insideTopLeft') {\n return _objectSpread({\n x: x + horizontalOffset,\n y: y + verticalOffset,\n textAnchor: horizontalStart,\n verticalAnchor: verticalStart\n }, sizeAttrs);\n }\n if (position === 'insideTopRight') {\n return _objectSpread({\n x: x + width - horizontalOffset,\n y: y + verticalOffset,\n textAnchor: horizontalEnd,\n verticalAnchor: verticalStart\n }, sizeAttrs);\n }\n if (position === 'insideBottomLeft') {\n return _objectSpread({\n x: x + horizontalOffset,\n y: y + height - verticalOffset,\n textAnchor: horizontalStart,\n verticalAnchor: verticalEnd\n }, sizeAttrs);\n }\n if (position === 'insideBottomRight') {\n return _objectSpread({\n x: x + width - horizontalOffset,\n y: y + height - verticalOffset,\n textAnchor: horizontalEnd,\n verticalAnchor: verticalEnd\n }, sizeAttrs);\n }\n if (_isObject(position) && (isNumber(position.x) || isPercent(position.x)) && (isNumber(position.y) || isPercent(position.y))) {\n return _objectSpread({\n x: x + getPercentValue(position.x, width),\n y: y + getPercentValue(position.y, height),\n textAnchor: 'end',\n verticalAnchor: 'end'\n }, sizeAttrs);\n }\n return _objectSpread({\n x: x + width / 2,\n y: y + height / 2,\n textAnchor: 'middle',\n verticalAnchor: 'middle'\n }, sizeAttrs);\n};\nvar isPolar = function isPolar(viewBox) {\n return 'cx' in viewBox && isNumber(viewBox.cx);\n};\nexport function Label(_ref4) {\n var _ref4$offset = _ref4.offset,\n offset = _ref4$offset === void 0 ? 5 : _ref4$offset,\n restProps = _objectWithoutProperties(_ref4, _excluded);\n var props = _objectSpread({\n offset: offset\n }, restProps);\n var viewBox = props.viewBox,\n position = props.position,\n value = props.value,\n children = props.children,\n content = props.content,\n _props$className = props.className,\n className = _props$className === void 0 ? '' : _props$className,\n textBreakAll = props.textBreakAll;\n if (!viewBox || _isNil(value) && _isNil(children) && ! /*#__PURE__*/isValidElement(content) && !_isFunction(content)) {\n return null;\n }\n if ( /*#__PURE__*/isValidElement(content)) {\n return /*#__PURE__*/cloneElement(content, props);\n }\n var label;\n if (_isFunction(content)) {\n label = /*#__PURE__*/createElement(content, props);\n if ( /*#__PURE__*/isValidElement(label)) {\n return label;\n }\n } else {\n label = getLabel(props);\n }\n var isPolarLabel = isPolar(viewBox);\n var attrs = filterProps(props, true);\n if (isPolarLabel && (position === 'insideStart' || position === 'insideEnd' || position === 'end')) {\n return renderRadialLabel(props, label, attrs);\n }\n var positionAttrs = isPolarLabel ? getAttrsOfPolarLabel(props) : getAttrsOfCartesianLabel(props);\n return /*#__PURE__*/React.createElement(Text, _extends({\n className: classNames('recharts-label', className)\n }, attrs, positionAttrs, {\n breakAll: textBreakAll\n }), label);\n}\nLabel.displayName = 'Label';\nvar parseViewBox = function parseViewBox(props) {\n var cx = props.cx,\n cy = props.cy,\n angle = props.angle,\n startAngle = props.startAngle,\n endAngle = props.endAngle,\n r = props.r,\n radius = props.radius,\n innerRadius = props.innerRadius,\n outerRadius = props.outerRadius,\n x = props.x,\n y = props.y,\n top = props.top,\n left = props.left,\n width = props.width,\n height = props.height,\n clockWise = props.clockWise,\n labelViewBox = props.labelViewBox;\n if (labelViewBox) {\n return labelViewBox;\n }\n if (isNumber(width) && isNumber(height)) {\n if (isNumber(x) && isNumber(y)) {\n return {\n x: x,\n y: y,\n width: width,\n height: height\n };\n }\n if (isNumber(top) && isNumber(left)) {\n return {\n x: top,\n y: left,\n width: width,\n height: height\n };\n }\n }\n if (isNumber(x) && isNumber(y)) {\n return {\n x: x,\n y: y,\n width: 0,\n height: 0\n };\n }\n if (isNumber(cx) && isNumber(cy)) {\n return {\n cx: cx,\n cy: cy,\n startAngle: startAngle || angle || 0,\n endAngle: endAngle || angle || 0,\n innerRadius: innerRadius || 0,\n outerRadius: outerRadius || radius || r || 0,\n clockWise: clockWise\n };\n }\n if (props.viewBox) {\n return props.viewBox;\n }\n return {};\n};\nvar parseLabel = function parseLabel(label, viewBox) {\n if (!label) {\n return null;\n }\n if (label === true) {\n return /*#__PURE__*/React.createElement(Label, {\n key: \"label-implicit\",\n viewBox: viewBox\n });\n }\n if (isNumOrStr(label)) {\n return /*#__PURE__*/React.createElement(Label, {\n key: \"label-implicit\",\n viewBox: viewBox,\n value: label\n });\n }\n if ( /*#__PURE__*/isValidElement(label)) {\n if (label.type === Label) {\n return /*#__PURE__*/cloneElement(label, {\n key: 'label-implicit',\n viewBox: viewBox\n });\n }\n return /*#__PURE__*/React.createElement(Label, {\n key: \"label-implicit\",\n content: label,\n viewBox: viewBox\n });\n }\n if (_isFunction(label)) {\n return /*#__PURE__*/React.createElement(Label, {\n key: \"label-implicit\",\n content: label,\n viewBox: viewBox\n });\n }\n if (_isObject(label)) {\n return /*#__PURE__*/React.createElement(Label, _extends({\n viewBox: viewBox\n }, label, {\n key: \"label-implicit\"\n }));\n }\n return null;\n};\nvar renderCallByParent = function renderCallByParent(parentProps, viewBox) {\n var checkPropsLabel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n if (!parentProps || !parentProps.children && checkPropsLabel && !parentProps.label) {\n return null;\n }\n var children = parentProps.children;\n var parentViewBox = parseViewBox(parentProps);\n var explicitChildren = findAllByType(children, Label).map(function (child, index) {\n return /*#__PURE__*/cloneElement(child, {\n viewBox: viewBox || parentViewBox,\n // eslint-disable-next-line react/no-array-index-key\n key: \"label-\".concat(index)\n });\n });\n if (!checkPropsLabel) {\n return explicitChildren;\n }\n var implicitLabel = parseLabel(parentProps.label, viewBox || parentViewBox);\n return [implicitLabel].concat(_toConsumableArray(explicitChildren));\n};\nLabel.parseViewBox = parseViewBox;\nLabel.renderCallByParent = renderCallByParent;","import _isFunction from \"lodash/isFunction\";\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n/**\n * @fileOverview Default Legend Content\n */\nimport React, { PureComponent } from 'react';\nimport classNames from 'classnames';\nimport { warn } from '../util/LogUtils';\nimport { Surface } from '../container/Surface';\nimport { Symbols } from '../shape/Symbols';\nimport { adaptEventsOfChild } from '../util/types';\nvar SIZE = 32;\nexport var DefaultLegendContent = /*#__PURE__*/function (_PureComponent) {\n _inherits(DefaultLegendContent, _PureComponent);\n var _super = _createSuper(DefaultLegendContent);\n function DefaultLegendContent() {\n _classCallCheck(this, DefaultLegendContent);\n return _super.apply(this, arguments);\n }\n _createClass(DefaultLegendContent, [{\n key: \"renderIcon\",\n value:\n /**\n * Render the path of icon\n * @param {Object} data Data of each legend item\n * @return {String} Path element\n */\n function renderIcon(data) {\n var inactiveColor = this.props.inactiveColor;\n var halfSize = SIZE / 2;\n var sixthSize = SIZE / 6;\n var thirdSize = SIZE / 3;\n var color = data.inactive ? inactiveColor : data.color;\n if (data.type === 'plainline') {\n return /*#__PURE__*/React.createElement(\"line\", {\n strokeWidth: 4,\n fill: \"none\",\n stroke: color,\n strokeDasharray: data.payload.strokeDasharray,\n x1: 0,\n y1: halfSize,\n x2: SIZE,\n y2: halfSize,\n className: \"recharts-legend-icon\"\n });\n }\n if (data.type === 'line') {\n return /*#__PURE__*/React.createElement(\"path\", {\n strokeWidth: 4,\n fill: \"none\",\n stroke: color,\n d: \"M0,\".concat(halfSize, \"h\").concat(thirdSize, \"\\n A\").concat(sixthSize, \",\").concat(sixthSize, \",0,1,1,\").concat(2 * thirdSize, \",\").concat(halfSize, \"\\n H\").concat(SIZE, \"M\").concat(2 * thirdSize, \",\").concat(halfSize, \"\\n A\").concat(sixthSize, \",\").concat(sixthSize, \",0,1,1,\").concat(thirdSize, \",\").concat(halfSize),\n className: \"recharts-legend-icon\"\n });\n }\n if (data.type === 'rect') {\n return /*#__PURE__*/React.createElement(\"path\", {\n stroke: \"none\",\n fill: color,\n d: \"M0,\".concat(SIZE / 8, \"h\").concat(SIZE, \"v\").concat(SIZE * 3 / 4, \"h\").concat(-SIZE, \"z\"),\n className: \"recharts-legend-icon\"\n });\n }\n if ( /*#__PURE__*/React.isValidElement(data.legendIcon)) {\n var iconProps = _objectSpread({}, data);\n delete iconProps.legendIcon;\n return /*#__PURE__*/React.cloneElement(data.legendIcon, iconProps);\n }\n return /*#__PURE__*/React.createElement(Symbols, {\n fill: color,\n cx: halfSize,\n cy: halfSize,\n size: SIZE,\n sizeType: \"diameter\",\n type: data.type\n });\n }\n\n /**\n * Draw items of legend\n * @return {ReactElement} Items\n */\n }, {\n key: \"renderItems\",\n value: function renderItems() {\n var _this = this;\n var _this$props = this.props,\n payload = _this$props.payload,\n iconSize = _this$props.iconSize,\n layout = _this$props.layout,\n formatter = _this$props.formatter,\n inactiveColor = _this$props.inactiveColor;\n var viewBox = {\n x: 0,\n y: 0,\n width: SIZE,\n height: SIZE\n };\n var itemStyle = {\n display: layout === 'horizontal' ? 'inline-block' : 'block',\n marginRight: 10\n };\n var svgStyle = {\n display: 'inline-block',\n verticalAlign: 'middle',\n marginRight: 4\n };\n return payload.map(function (entry, i) {\n var _classNames;\n var finalFormatter = entry.formatter || formatter;\n var className = classNames((_classNames = {\n 'recharts-legend-item': true\n }, _defineProperty(_classNames, \"legend-item-\".concat(i), true), _defineProperty(_classNames, \"inactive\", entry.inactive), _classNames));\n if (entry.type === 'none') {\n return null;\n }\n\n // Do not render entry.value as functions. Always require static string properties.\n var entryValue = !_isFunction(entry.value) ? entry.value : null;\n warn(!_isFunction(entry.value), \"The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: \" // eslint-disable-line max-len\n );\n var color = entry.inactive ? inactiveColor : entry.color;\n return /*#__PURE__*/React.createElement(\"li\", _extends({\n className: className,\n style: itemStyle,\n key: \"legend-item-\".concat(i) // eslint-disable-line react/no-array-index-key\n }, adaptEventsOfChild(_this.props, entry, i)), /*#__PURE__*/React.createElement(Surface, {\n width: iconSize,\n height: iconSize,\n viewBox: viewBox,\n style: svgStyle\n }, _this.renderIcon(entry)), /*#__PURE__*/React.createElement(\"span\", {\n className: \"recharts-legend-item-text\",\n style: {\n color: color\n }\n }, finalFormatter ? finalFormatter(entryValue, entry, i) : entryValue));\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n payload = _this$props2.payload,\n layout = _this$props2.layout,\n align = _this$props2.align;\n if (!payload || !payload.length) {\n return null;\n }\n var finalStyle = {\n padding: 0,\n margin: 0,\n textAlign: layout === 'horizontal' ? align : 'left'\n };\n return /*#__PURE__*/React.createElement(\"ul\", {\n className: \"recharts-default-legend\",\n style: finalStyle\n }, this.renderItems());\n }\n }]);\n return DefaultLegendContent;\n}(PureComponent);\n_defineProperty(DefaultLegendContent, \"displayName\", 'Legend');\n_defineProperty(DefaultLegendContent, \"defaultProps\", {\n iconSize: 14,\n layout: 'horizontal',\n align: 'center',\n verticalAlign: 'middle',\n inactiveColor: '#ccc'\n});","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nimport _isFunction from \"lodash/isFunction\";\nimport _uniqBy from \"lodash/uniqBy\";\nvar _excluded = [\"ref\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n/**\n * @fileOverview Legend\n */\nimport React, { PureComponent } from 'react';\nimport { DefaultLegendContent } from './DefaultLegendContent';\nimport { isNumber } from '../util/DataUtils';\nfunction defaultUniqBy(entry) {\n return entry.value;\n}\nfunction getUniqPayload(option, payload) {\n if (option === true) {\n return _uniqBy(payload, defaultUniqBy);\n }\n if (_isFunction(option)) {\n return _uniqBy(payload, option);\n }\n return payload;\n}\nfunction renderContent(content, props) {\n if ( /*#__PURE__*/React.isValidElement(content)) {\n return /*#__PURE__*/React.cloneElement(content, props);\n }\n if (_isFunction(content)) {\n return /*#__PURE__*/React.createElement(content, props);\n }\n var ref = props.ref,\n otherProps = _objectWithoutProperties(props, _excluded);\n return /*#__PURE__*/React.createElement(DefaultLegendContent, otherProps);\n}\nvar EPS = 1;\nexport var Legend = /*#__PURE__*/function (_PureComponent) {\n _inherits(Legend, _PureComponent);\n var _super = _createSuper(Legend);\n function Legend() {\n var _this;\n _classCallCheck(this, Legend);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n boxWidth: -1,\n boxHeight: -1\n });\n return _this;\n }\n _createClass(Legend, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.updateBBox();\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n this.updateBBox();\n }\n }, {\n key: \"getBBox\",\n value: function getBBox() {\n if (this.wrapperNode && this.wrapperNode.getBoundingClientRect) {\n return this.wrapperNode.getBoundingClientRect();\n }\n return null;\n }\n }, {\n key: \"getBBoxSnapshot\",\n value: function getBBoxSnapshot() {\n var _this$state = this.state,\n boxWidth = _this$state.boxWidth,\n boxHeight = _this$state.boxHeight;\n if (boxWidth >= 0 && boxHeight >= 0) {\n return {\n width: boxWidth,\n height: boxHeight\n };\n }\n return null;\n }\n }, {\n key: \"getDefaultPosition\",\n value: function getDefaultPosition(style) {\n var _this$props = this.props,\n layout = _this$props.layout,\n align = _this$props.align,\n verticalAlign = _this$props.verticalAlign,\n margin = _this$props.margin,\n chartWidth = _this$props.chartWidth,\n chartHeight = _this$props.chartHeight;\n var hPos, vPos;\n if (!style || (style.left === undefined || style.left === null) && (style.right === undefined || style.right === null)) {\n if (align === 'center' && layout === 'vertical') {\n var _box = this.getBBoxSnapshot() || {\n width: 0\n };\n hPos = {\n left: ((chartWidth || 0) - _box.width) / 2\n };\n } else {\n hPos = align === 'right' ? {\n right: margin && margin.right || 0\n } : {\n left: margin && margin.left || 0\n };\n }\n }\n if (!style || (style.top === undefined || style.top === null) && (style.bottom === undefined || style.bottom === null)) {\n if (verticalAlign === 'middle') {\n var _box2 = this.getBBoxSnapshot() || {\n height: 0\n };\n vPos = {\n top: ((chartHeight || 0) - _box2.height) / 2\n };\n } else {\n vPos = verticalAlign === 'bottom' ? {\n bottom: margin && margin.bottom || 0\n } : {\n top: margin && margin.top || 0\n };\n }\n }\n return _objectSpread(_objectSpread({}, hPos), vPos);\n }\n }, {\n key: \"updateBBox\",\n value: function updateBBox() {\n var _this$state2 = this.state,\n boxWidth = _this$state2.boxWidth,\n boxHeight = _this$state2.boxHeight;\n var onBBoxUpdate = this.props.onBBoxUpdate;\n if (this.wrapperNode && this.wrapperNode.getBoundingClientRect) {\n var _box3 = this.wrapperNode.getBoundingClientRect();\n if (Math.abs(_box3.width - boxWidth) > EPS || Math.abs(_box3.height - boxHeight) > EPS) {\n this.setState({\n boxWidth: _box3.width,\n boxHeight: _box3.height\n }, function () {\n if (onBBoxUpdate) {\n onBBoxUpdate(_box3);\n }\n });\n }\n } else if (boxWidth !== -1 || boxHeight !== -1) {\n this.setState({\n boxWidth: -1,\n boxHeight: -1\n }, function () {\n if (onBBoxUpdate) {\n onBBoxUpdate(null);\n }\n });\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n var _this$props2 = this.props,\n content = _this$props2.content,\n width = _this$props2.width,\n height = _this$props2.height,\n wrapperStyle = _this$props2.wrapperStyle,\n payloadUniqBy = _this$props2.payloadUniqBy,\n payload = _this$props2.payload;\n var outerStyle = _objectSpread(_objectSpread({\n position: 'absolute',\n width: width || 'auto',\n height: height || 'auto'\n }, this.getDefaultPosition(wrapperStyle)), wrapperStyle);\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"recharts-legend-wrapper\",\n style: outerStyle,\n ref: function ref(node) {\n _this2.wrapperNode = node;\n }\n }, renderContent(content, _objectSpread(_objectSpread({}, this.props), {}, {\n payload: getUniqPayload(payloadUniqBy, payload)\n })));\n }\n }], [{\n key: \"getWithHeight\",\n value: function getWithHeight(item, chartWidth) {\n var layout = item.props.layout;\n if (layout === 'vertical' && isNumber(item.props.height)) {\n return {\n height: item.props.height\n };\n }\n if (layout === 'horizontal') {\n return {\n width: item.props.width || chartWidth\n };\n }\n return null;\n }\n }]);\n return Legend;\n}(PureComponent);\n_defineProperty(Legend, \"displayName\", 'Legend');\n_defineProperty(Legend, \"defaultProps\", {\n iconSize: 14,\n layout: 'horizontal',\n align: 'center',\n verticalAlign: 'bottom'\n});","import React,{cloneElement,isValidElement,createRef,PureComponent,Component,forwardRef,useRef,useState,useEffect,useLayoutEffect}from'react';import {findDOMNode}from'react-dom';import debounce from'lodash/debounce';import throttle from'lodash/throttle';/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}var patchResizeHandler = function (resizeCallback, refreshMode, refreshRate, refreshOptions) {\n switch (refreshMode) {\n case 'debounce':\n return debounce(resizeCallback, refreshRate, refreshOptions);\n case 'throttle':\n return throttle(resizeCallback, refreshRate, refreshOptions);\n default:\n return resizeCallback;\n }\n};\nvar isFunction = function (fn) { return typeof fn === 'function'; };\nvar isSSR = function () { return typeof window === 'undefined'; };\nvar isDOMElement = function (element) {\n return element instanceof Element || element instanceof HTMLDocument;\n};\nvar createNotifier = function (setSize, handleWidth, handleHeight) {\n return function (_a) {\n var width = _a.width, height = _a.height;\n setSize(function (prev) {\n if (prev.width === width && prev.height === height) {\n // skip if dimensions haven't changed\n return prev;\n }\n if ((prev.width === width && !handleHeight) || (prev.height === height && !handleWidth)) {\n // process `handleHeight/handleWidth` props\n return prev;\n }\n return { width: width, height: height };\n });\n };\n};var ResizeDetector = /** @class */ (function (_super) {\n __extends(ResizeDetector, _super);\n function ResizeDetector(props) {\n var _this = _super.call(this, props) || this;\n _this.cancelHandler = function () {\n if (_this.resizeHandler && _this.resizeHandler.cancel) {\n // cancel debounced handler\n _this.resizeHandler.cancel();\n _this.resizeHandler = null;\n }\n };\n _this.attachObserver = function () {\n var _a = _this.props, targetRef = _a.targetRef, observerOptions = _a.observerOptions;\n if (isSSR()) {\n return;\n }\n if (targetRef && targetRef.current) {\n _this.targetRef.current = targetRef.current;\n }\n var element = _this.getElement();\n if (!element) {\n // can't find element to observe\n return;\n }\n if (_this.observableElement && _this.observableElement === element) {\n // element is already observed\n return;\n }\n _this.observableElement = element;\n _this.resizeObserver.observe(element, observerOptions);\n };\n _this.getElement = function () {\n var _a = _this.props, querySelector = _a.querySelector, targetDomEl = _a.targetDomEl;\n if (isSSR())\n return null;\n // in case we pass a querySelector\n if (querySelector)\n return document.querySelector(querySelector);\n // in case we pass a DOM element\n if (targetDomEl && isDOMElement(targetDomEl))\n return targetDomEl;\n // in case we pass a React ref using React.createRef()\n if (_this.targetRef && isDOMElement(_this.targetRef.current))\n return _this.targetRef.current;\n // the worse case when we don't receive any information from the parent and the library doesn't add any wrappers\n // we have to use a deprecated `findDOMNode` method in order to find a DOM element to attach to\n var currentElement = findDOMNode(_this);\n if (!currentElement)\n return null;\n var renderType = _this.getRenderType();\n switch (renderType) {\n case 'renderProp':\n return currentElement;\n case 'childFunction':\n return currentElement;\n case 'child':\n return currentElement;\n case 'childArray':\n return currentElement;\n default:\n return currentElement.parentElement;\n }\n };\n _this.createResizeHandler = function (entries) {\n var _a = _this.props, _b = _a.handleWidth, handleWidth = _b === void 0 ? true : _b, _c = _a.handleHeight, handleHeight = _c === void 0 ? true : _c, onResize = _a.onResize;\n if (!handleWidth && !handleHeight)\n return;\n var notifyResize = createNotifier(function (setStateFunc) { return _this.setState(setStateFunc, function () { return onResize === null || onResize === void 0 ? void 0 : onResize(_this.state.width, _this.state.height); }); }, handleWidth, handleHeight);\n entries.forEach(function (entry) {\n var _a = (entry && entry.contentRect) || {}, width = _a.width, height = _a.height;\n var shouldSetSize = !_this.skipOnMount && !isSSR();\n if (shouldSetSize) {\n notifyResize({ width: width, height: height });\n }\n _this.skipOnMount = false;\n });\n };\n _this.getRenderType = function () {\n var _a = _this.props, render = _a.render, children = _a.children;\n if (isFunction(render)) {\n // DEPRECATED. Use `Child Function Pattern` instead\n return 'renderProp';\n }\n if (isFunction(children)) {\n return 'childFunction';\n }\n if (isValidElement(children)) {\n return 'child';\n }\n if (Array.isArray(children)) {\n // DEPRECATED. Wrap children with a single parent\n return 'childArray';\n }\n // DEPRECATED. Use `Child Function Pattern` instead\n return 'parent';\n };\n var skipOnMount = props.skipOnMount, refreshMode = props.refreshMode, _a = props.refreshRate, refreshRate = _a === void 0 ? 1000 : _a, refreshOptions = props.refreshOptions;\n _this.state = {\n width: undefined,\n height: undefined\n };\n _this.skipOnMount = skipOnMount;\n _this.targetRef = createRef();\n _this.observableElement = null;\n if (isSSR()) {\n return _this;\n }\n _this.resizeHandler = patchResizeHandler(_this.createResizeHandler, refreshMode, refreshRate, refreshOptions);\n _this.resizeObserver = new window.ResizeObserver(_this.resizeHandler);\n return _this;\n }\n ResizeDetector.prototype.componentDidMount = function () {\n this.attachObserver();\n };\n ResizeDetector.prototype.componentDidUpdate = function () {\n this.attachObserver();\n };\n ResizeDetector.prototype.componentWillUnmount = function () {\n if (isSSR()) {\n return;\n }\n this.observableElement = null;\n this.resizeObserver.disconnect();\n this.cancelHandler();\n };\n ResizeDetector.prototype.render = function () {\n var _a = this.props, render = _a.render, children = _a.children, _b = _a.nodeType, WrapperTag = _b === void 0 ? 'div' : _b;\n var _c = this.state, width = _c.width, height = _c.height;\n var childProps = { width: width, height: height, targetRef: this.targetRef };\n var renderType = this.getRenderType();\n switch (renderType) {\n case 'renderProp':\n return render === null || render === void 0 ? void 0 : render(childProps);\n case 'childFunction': {\n var childFunction = children;\n return childFunction === null || childFunction === void 0 ? void 0 : childFunction(childProps);\n }\n case 'child': {\n // @TODO bug prone logic\n var child = children;\n if (child.type && typeof child.type === 'string') {\n // child is a native DOM elements such as div, span etc\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n childProps.targetRef; var nativeProps = __rest(childProps, [\"targetRef\"]);\n return cloneElement(child, nativeProps);\n }\n // class or functional component otherwise\n return cloneElement(child, childProps);\n }\n case 'childArray': {\n var childArray = children;\n return childArray.map(function (el) { return !!el && cloneElement(el, childProps); });\n }\n default:\n return React.createElement(WrapperTag, null);\n }\n };\n return ResizeDetector;\n}(PureComponent));function withResizeDetector(ComponentInner, options) {\n if (options === void 0) { options = {}; }\n var ResizeDetectorHOC = /** @class */ (function (_super) {\n __extends(ResizeDetectorHOC, _super);\n function ResizeDetectorHOC() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.ref = createRef();\n return _this;\n }\n ResizeDetectorHOC.prototype.render = function () {\n var _a = this.props, forwardedRef = _a.forwardedRef, rest = __rest(_a, [\"forwardedRef\"]);\n var targetRef = forwardedRef !== null && forwardedRef !== void 0 ? forwardedRef : this.ref;\n return (React.createElement(ResizeDetector, __assign({}, options, { targetRef: targetRef }),\n React.createElement(ComponentInner, __assign({ targetRef: targetRef }, rest))));\n };\n return ResizeDetectorHOC;\n }(Component));\n function forwardRefWrapper(props, ref) {\n return React.createElement(ResizeDetectorHOC, __assign({}, props, { forwardedRef: ref }));\n }\n var name = ComponentInner.displayName || ComponentInner.name;\n forwardRefWrapper.displayName = \"withResizeDetector(\".concat(name, \")\");\n return forwardRef(forwardRefWrapper);\n}var useEnhancedEffect = isSSR() ? useEffect : useLayoutEffect;\nfunction useResizeDetector(_a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.skipOnMount, skipOnMount = _c === void 0 ? false : _c, refreshMode = _b.refreshMode, _d = _b.refreshRate, refreshRate = _d === void 0 ? 1000 : _d, refreshOptions = _b.refreshOptions, _e = _b.handleWidth, handleWidth = _e === void 0 ? true : _e, _f = _b.handleHeight, handleHeight = _f === void 0 ? true : _f, targetRef = _b.targetRef, observerOptions = _b.observerOptions, onResize = _b.onResize;\n var skipResize = useRef(skipOnMount);\n var localRef = useRef(null);\n var resizeHandler = useRef();\n var ref = targetRef !== null && targetRef !== void 0 ? targetRef : localRef;\n var _g = useState({\n width: undefined,\n height: undefined\n }), size = _g[0], setSize = _g[1];\n useEnhancedEffect(function () {\n if (!handleWidth && !handleHeight)\n return;\n var notifyResize = createNotifier(setSize, handleWidth, handleHeight);\n var resizeCallback = function (entries) {\n if (!handleWidth && !handleHeight)\n return;\n entries.forEach(function (entry) {\n var _a = (entry && entry.contentRect) || {}, width = _a.width, height = _a.height;\n var shouldSetSize = !skipResize.current;\n if (shouldSetSize) {\n notifyResize({ width: width, height: height });\n }\n skipResize.current = false;\n });\n };\n resizeHandler.current = patchResizeHandler(resizeCallback, refreshMode, refreshRate, refreshOptions);\n var resizeObserver = new window.ResizeObserver(resizeHandler.current);\n if (ref.current) {\n resizeObserver.observe(ref.current, observerOptions);\n }\n return function () {\n var _a, _b;\n resizeObserver.disconnect();\n (_b = (_a = resizeHandler.current).cancel) === null || _b === void 0 ? void 0 : _b.call(_a);\n };\n }, [refreshMode, refreshRate, refreshOptions, handleWidth, handleHeight, observerOptions, ref.current]);\n useEffect(function () {\n onResize === null || onResize === void 0 ? void 0 : onResize(size.width, size.height);\n }, [size]);\n return __assign({ ref: ref }, size);\n}export{ResizeDetector as default,useResizeDetector,withResizeDetector};//# sourceMappingURL=index.esm.js.map\n","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n/**\n * @fileOverview Wrapper component to make charts adapt to the size of parent * DOM\n */\nimport classNames from 'classnames';\nimport React, { forwardRef, cloneElement, useState, useImperativeHandle, useRef, useEffect, useCallback, useMemo } from 'react';\nimport ReactResizeDetector from 'react-resize-detector';\nimport { isPercent } from '../util/DataUtils';\nimport { warn } from '../util/LogUtils';\nexport var ResponsiveContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {\n var aspect = _ref.aspect,\n _ref$initialDimension = _ref.initialDimension,\n initialDimension = _ref$initialDimension === void 0 ? {\n width: -1,\n height: -1\n } : _ref$initialDimension,\n _ref$width = _ref.width,\n width = _ref$width === void 0 ? '100%' : _ref$width,\n _ref$height = _ref.height,\n height = _ref$height === void 0 ? '100%' : _ref$height,\n _ref$minWidth = _ref.minWidth,\n minWidth = _ref$minWidth === void 0 ? 0 : _ref$minWidth,\n minHeight = _ref.minHeight,\n maxHeight = _ref.maxHeight,\n children = _ref.children,\n _ref$debounce = _ref.debounce,\n debounce = _ref$debounce === void 0 ? 0 : _ref$debounce,\n id = _ref.id,\n className = _ref.className,\n onResize = _ref.onResize,\n _ref$style = _ref.style,\n style = _ref$style === void 0 ? {} : _ref$style;\n var _useState = useState({\n containerWidth: initialDimension.width,\n containerHeight: initialDimension.height\n }),\n _useState2 = _slicedToArray(_useState, 2),\n sizes = _useState2[0],\n setSizes = _useState2[1];\n var containerRef = useRef(null);\n useImperativeHandle(ref, function () {\n return containerRef;\n }, [containerRef]);\n var getContainerSize = useCallback(function () {\n if (!containerRef.current) {\n return null;\n }\n return {\n containerWidth: containerRef.current.clientWidth,\n containerHeight: containerRef.current.clientHeight\n };\n }, []);\n var updateDimensionsImmediate = useCallback(function () {\n var newSize = getContainerSize();\n if (newSize) {\n var containerWidth = newSize.containerWidth,\n containerHeight = newSize.containerHeight;\n if (onResize) onResize(containerWidth, containerHeight);\n setSizes(function (currentSizes) {\n var oldWidth = currentSizes.containerWidth,\n oldHeight = currentSizes.containerHeight;\n if (containerWidth !== oldWidth || containerHeight !== oldHeight) {\n return {\n containerWidth: containerWidth,\n containerHeight: containerHeight\n };\n }\n return currentSizes;\n });\n }\n }, [getContainerSize, onResize]);\n var chartContent = useMemo(function () {\n var containerWidth = sizes.containerWidth,\n containerHeight = sizes.containerHeight;\n if (containerWidth < 0 || containerHeight < 0) {\n return null;\n }\n warn(isPercent(width) || isPercent(height), \"The width(%s) and height(%s) are both fixed numbers,\\n maybe you don't need to use a ResponsiveContainer.\", width, height);\n warn(!aspect || aspect > 0, 'The aspect(%s) must be greater than zero.', aspect);\n var calculatedWidth = isPercent(width) ? containerWidth : width;\n var calculatedHeight = isPercent(height) ? containerHeight : height;\n if (aspect && aspect > 0) {\n // Preserve the desired aspect ratio\n if (calculatedWidth) {\n // Will default to using width for aspect ratio\n calculatedHeight = calculatedWidth / aspect;\n } else if (calculatedHeight) {\n // But we should also take height into consideration\n calculatedWidth = calculatedHeight * aspect;\n }\n\n // if maxHeight is set, overwrite if calculatedHeight is greater than maxHeight\n if (maxHeight && calculatedHeight > maxHeight) {\n calculatedHeight = maxHeight;\n }\n }\n warn(calculatedWidth > 0 || calculatedHeight > 0, \"The width(%s) and height(%s) of chart should be greater than 0,\\n please check the style of container, or the props width(%s) and height(%s),\\n or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\\n height and width.\", calculatedWidth, calculatedHeight, width, height, minWidth, minHeight, aspect);\n return /*#__PURE__*/cloneElement(children, {\n width: calculatedWidth,\n height: calculatedHeight\n });\n }, [aspect, children, height, maxHeight, minHeight, minWidth, sizes, width]);\n useEffect(function () {\n var size = getContainerSize();\n if (size) {\n setSizes(size);\n }\n }, [getContainerSize]);\n var styles = _objectSpread(_objectSpread({}, style), {}, {\n width: width,\n height: height,\n minWidth: minWidth,\n minHeight: minHeight,\n maxHeight: maxHeight\n });\n return /*#__PURE__*/React.createElement(ReactResizeDetector, {\n handleWidth: true,\n handleHeight: true,\n onResize: updateDimensionsImmediate,\n targetRef: containerRef,\n refreshMode: debounce > 0 ? 'debounce' : undefined,\n refreshRate: debounce\n }, /*#__PURE__*/React.createElement(\"div\", _extends({}, id != null ? {\n id: \"\".concat(id)\n } : {}, {\n className: classNames('recharts-responsive-container', className),\n style: styles,\n ref: containerRef\n }), chartContent));\n});","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar MULTIPLY_OR_DIVIDE_REGEX = /(-?\\d+(?:\\.\\d+)?[a-zA-Z%]*)([*/])(-?\\d+(?:\\.\\d+)?[a-zA-Z%]*)/;\nvar ADD_OR_SUBTRACT_REGEX = /(-?\\d+(?:\\.\\d+)?[a-zA-Z%]*)([+-])(-?\\d+(?:\\.\\d+)?[a-zA-Z%]*)/;\nvar CSS_LENGTH_UNIT_REGEX = /^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/;\nvar NUM_SPLIT_REGEX = /(-?\\d+(?:\\.\\d+)?)([a-zA-Z%]+)?/;\nvar CONVERSION_RATES = {\n cm: 96 / 2.54,\n mm: 96 / 25.4,\n pt: 96 / 72,\n pc: 96 / 6,\n \"in\": 96,\n Q: 96 / (2.54 * 40),\n px: 1\n};\nvar FIXED_CSS_LENGTH_UNITS = Object.keys(CONVERSION_RATES);\nvar STR_NAN = 'NaN';\nfunction convertToPx(value, unit) {\n return value * CONVERSION_RATES[unit];\n}\nvar DecimalCSS = /*#__PURE__*/function () {\n function DecimalCSS(num, unit) {\n _classCallCheck(this, DecimalCSS);\n this.num = num;\n this.unit = unit;\n this.num = num;\n this.unit = unit;\n if (Number.isNaN(num)) {\n this.unit = '';\n }\n if (unit !== '' && !CSS_LENGTH_UNIT_REGEX.test(unit)) {\n this.num = NaN;\n this.unit = '';\n }\n if (FIXED_CSS_LENGTH_UNITS.includes(unit)) {\n this.num = convertToPx(num, unit);\n this.unit = 'px';\n }\n }\n _createClass(DecimalCSS, [{\n key: \"add\",\n value: function add(other) {\n if (this.unit !== other.unit) {\n return new DecimalCSS(NaN, '');\n }\n return new DecimalCSS(this.num + other.num, this.unit);\n }\n }, {\n key: \"subtract\",\n value: function subtract(other) {\n if (this.unit !== other.unit) {\n return new DecimalCSS(NaN, '');\n }\n return new DecimalCSS(this.num - other.num, this.unit);\n }\n }, {\n key: \"multiply\",\n value: function multiply(other) {\n if (this.unit !== '' && other.unit !== '' && this.unit !== other.unit) {\n return new DecimalCSS(NaN, '');\n }\n return new DecimalCSS(this.num * other.num, this.unit || other.unit);\n }\n }, {\n key: \"divide\",\n value: function divide(other) {\n if (this.unit !== '' && other.unit !== '' && this.unit !== other.unit) {\n return new DecimalCSS(NaN, '');\n }\n return new DecimalCSS(this.num / other.num, this.unit || other.unit);\n }\n }, {\n key: \"toString\",\n value: function toString() {\n return \"\".concat(this.num).concat(this.unit);\n }\n }, {\n key: \"isNaN\",\n value: function isNaN() {\n return Number.isNaN(this.num);\n }\n }], [{\n key: \"parse\",\n value: function parse(str) {\n var _NUM_SPLIT_REGEX$exec;\n var _ref = (_NUM_SPLIT_REGEX$exec = NUM_SPLIT_REGEX.exec(str)) !== null && _NUM_SPLIT_REGEX$exec !== void 0 ? _NUM_SPLIT_REGEX$exec : [],\n _ref2 = _slicedToArray(_ref, 3),\n numStr = _ref2[1],\n unit = _ref2[2];\n return new DecimalCSS(parseFloat(numStr), unit !== null && unit !== void 0 ? unit : '');\n }\n }]);\n return DecimalCSS;\n}();\nfunction calculateArithmetic(expr) {\n if (expr.includes(STR_NAN)) {\n return STR_NAN;\n }\n var newExpr = expr;\n while (newExpr.includes('*') || newExpr.includes('/')) {\n var _MULTIPLY_OR_DIVIDE_R;\n var _ref3 = (_MULTIPLY_OR_DIVIDE_R = MULTIPLY_OR_DIVIDE_REGEX.exec(newExpr)) !== null && _MULTIPLY_OR_DIVIDE_R !== void 0 ? _MULTIPLY_OR_DIVIDE_R : [],\n _ref4 = _slicedToArray(_ref3, 4),\n leftOperand = _ref4[1],\n operator = _ref4[2],\n rightOperand = _ref4[3];\n var lTs = DecimalCSS.parse(leftOperand !== null && leftOperand !== void 0 ? leftOperand : '');\n var rTs = DecimalCSS.parse(rightOperand !== null && rightOperand !== void 0 ? rightOperand : '');\n var result = operator === '*' ? lTs.multiply(rTs) : lTs.divide(rTs);\n if (result.isNaN()) {\n return STR_NAN;\n }\n newExpr = newExpr.replace(MULTIPLY_OR_DIVIDE_REGEX, result.toString());\n }\n while (newExpr.includes('+') || /.-\\d+(?:\\.\\d+)?/.test(newExpr)) {\n var _ADD_OR_SUBTRACT_REGE;\n var _ref5 = (_ADD_OR_SUBTRACT_REGE = ADD_OR_SUBTRACT_REGEX.exec(newExpr)) !== null && _ADD_OR_SUBTRACT_REGE !== void 0 ? _ADD_OR_SUBTRACT_REGE : [],\n _ref6 = _slicedToArray(_ref5, 4),\n _leftOperand = _ref6[1],\n _operator = _ref6[2],\n _rightOperand = _ref6[3];\n var _lTs = DecimalCSS.parse(_leftOperand !== null && _leftOperand !== void 0 ? _leftOperand : '');\n var _rTs = DecimalCSS.parse(_rightOperand !== null && _rightOperand !== void 0 ? _rightOperand : '');\n var _result = _operator === '+' ? _lTs.add(_rTs) : _lTs.subtract(_rTs);\n if (_result.isNaN()) {\n return STR_NAN;\n }\n newExpr = newExpr.replace(ADD_OR_SUBTRACT_REGEX, _result.toString());\n }\n return newExpr;\n}\nvar PARENTHESES_REGEX = /\\(([^()]*)\\)/;\nfunction calculateParentheses(expr) {\n var newExpr = expr;\n while (newExpr.includes('(')) {\n var _PARENTHESES_REGEX$ex = PARENTHESES_REGEX.exec(newExpr),\n _PARENTHESES_REGEX$ex2 = _slicedToArray(_PARENTHESES_REGEX$ex, 2),\n parentheticalExpression = _PARENTHESES_REGEX$ex2[1];\n newExpr = newExpr.replace(PARENTHESES_REGEX, calculateArithmetic(parentheticalExpression));\n }\n return newExpr;\n}\nfunction evaluateExpression(expression) {\n var newExpr = expression.replace(/\\s+/g, '');\n newExpr = calculateParentheses(newExpr);\n newExpr = calculateArithmetic(newExpr);\n return newExpr;\n}\nexport function safeEvaluateExpression(expression) {\n try {\n return evaluateExpression(expression);\n } catch (e) {\n /* istanbul ignore next */\n return STR_NAN;\n }\n}\nexport function reduceCSSCalc(expression) {\n var result = safeEvaluateExpression(expression.slice(5, -1));\n if (result === STR_NAN) {\n // notify the user\n return '';\n }\n return result;\n}","import _isNil from \"lodash/isNil\";\nvar _excluded = [\"x\", \"y\", \"lineHeight\", \"capHeight\", \"scaleToFit\", \"textAnchor\", \"verticalAnchor\", \"fill\"],\n _excluded2 = [\"dx\", \"dy\", \"angle\", \"className\", \"breakAll\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nimport React, { useMemo } from 'react';\nimport classNames from 'classnames';\nimport { isNumber, isNumOrStr } from '../util/DataUtils';\nimport { Global } from '../util/Global';\nimport { filterProps } from '../util/ReactUtils';\nimport { getStringSize } from '../util/DOMUtils';\nimport { reduceCSSCalc } from '../util/ReduceCSSCalc';\nvar BREAKING_SPACES = /[ \\f\\n\\r\\t\\v\\u2028\\u2029]+/;\nvar calculateWordWidths = function calculateWordWidths(_ref) {\n var children = _ref.children,\n breakAll = _ref.breakAll,\n style = _ref.style;\n try {\n var words = [];\n if (!_isNil(children)) {\n if (breakAll) {\n words = children.toString().split('');\n } else {\n words = children.toString().split(BREAKING_SPACES);\n }\n }\n var wordsWithComputedWidth = words.map(function (word) {\n return {\n word: word,\n width: getStringSize(word, style).width\n };\n });\n var spaceWidth = breakAll ? 0 : getStringSize(\"\\xA0\", style).width;\n return {\n wordsWithComputedWidth: wordsWithComputedWidth,\n spaceWidth: spaceWidth\n };\n } catch (e) {\n return null;\n }\n};\nvar calculateWordsByLines = function calculateWordsByLines(_ref2, initialWordsWithComputedWith, spaceWidth, lineWidth, scaleToFit) {\n var maxLines = _ref2.maxLines,\n children = _ref2.children,\n style = _ref2.style,\n breakAll = _ref2.breakAll;\n var shouldLimitLines = isNumber(maxLines);\n var text = children;\n var calculate = function calculate() {\n var words = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n return words.reduce(function (result, _ref3) {\n var word = _ref3.word,\n width = _ref3.width;\n var currentLine = result[result.length - 1];\n if (currentLine && (lineWidth == null || scaleToFit || currentLine.width + width + spaceWidth < Number(lineWidth))) {\n // Word can be added to an existing line\n currentLine.words.push(word);\n currentLine.width += width + spaceWidth;\n } else {\n // Add first word to line or word is too long to scaleToFit on existing line\n var newLine = {\n words: [word],\n width: width\n };\n result.push(newLine);\n }\n return result;\n }, []);\n };\n var originalResult = calculate(initialWordsWithComputedWith);\n var findLongestLine = function findLongestLine(words) {\n return words.reduce(function (a, b) {\n return a.width > b.width ? a : b;\n });\n };\n if (!shouldLimitLines) {\n return originalResult;\n }\n var suffix = '…';\n var checkOverflow = function checkOverflow(index) {\n var tempText = text.slice(0, index);\n var words = calculateWordWidths({\n breakAll: breakAll,\n style: style,\n children: tempText + suffix\n }).wordsWithComputedWidth;\n var result = calculate(words);\n var doesOverflow = result.length > maxLines || findLongestLine(result).width > Number(lineWidth);\n return [doesOverflow, result];\n };\n var start = 0;\n var end = text.length - 1;\n var iterations = 0;\n var trimmedResult;\n while (start <= end && iterations <= text.length - 1) {\n var middle = Math.floor((start + end) / 2);\n var prev = middle - 1;\n var _checkOverflow = checkOverflow(prev),\n _checkOverflow2 = _slicedToArray(_checkOverflow, 2),\n doesPrevOverflow = _checkOverflow2[0],\n result = _checkOverflow2[1];\n var _checkOverflow3 = checkOverflow(middle),\n _checkOverflow4 = _slicedToArray(_checkOverflow3, 1),\n doesMiddleOverflow = _checkOverflow4[0];\n if (!doesPrevOverflow && !doesMiddleOverflow) {\n start = middle + 1;\n }\n if (doesPrevOverflow && doesMiddleOverflow) {\n end = middle - 1;\n }\n if (!doesPrevOverflow && doesMiddleOverflow) {\n trimmedResult = result;\n break;\n }\n iterations++;\n }\n\n // Fallback to originalResult (result without trimming) if we cannot find the\n // where to trim. This should not happen :tm:\n return trimmedResult || originalResult;\n};\nvar getWordsWithoutCalculate = function getWordsWithoutCalculate(children) {\n var words = !_isNil(children) ? children.toString().split(BREAKING_SPACES) : [];\n return [{\n words: words\n }];\n};\nvar getWordsByLines = function getWordsByLines(_ref4) {\n var width = _ref4.width,\n scaleToFit = _ref4.scaleToFit,\n children = _ref4.children,\n style = _ref4.style,\n breakAll = _ref4.breakAll,\n maxLines = _ref4.maxLines;\n // Only perform calculations if using features that require them (multiline, scaleToFit)\n if ((width || scaleToFit) && !Global.isSsr) {\n var wordsWithComputedWidth, spaceWidth;\n var wordWidths = calculateWordWidths({\n breakAll: breakAll,\n children: children,\n style: style\n });\n if (wordWidths) {\n var wcw = wordWidths.wordsWithComputedWidth,\n sw = wordWidths.spaceWidth;\n wordsWithComputedWidth = wcw;\n spaceWidth = sw;\n } else {\n return getWordsWithoutCalculate(children);\n }\n return calculateWordsByLines({\n breakAll: breakAll,\n children: children,\n maxLines: maxLines,\n style: style\n }, wordsWithComputedWidth, spaceWidth, width, scaleToFit);\n }\n return getWordsWithoutCalculate(children);\n};\nvar DEFAULT_FILL = '#808080';\nexport var Text = function Text(_ref5) {\n var _ref5$x = _ref5.x,\n propsX = _ref5$x === void 0 ? 0 : _ref5$x,\n _ref5$y = _ref5.y,\n propsY = _ref5$y === void 0 ? 0 : _ref5$y,\n _ref5$lineHeight = _ref5.lineHeight,\n lineHeight = _ref5$lineHeight === void 0 ? '1em' : _ref5$lineHeight,\n _ref5$capHeight = _ref5.capHeight,\n capHeight = _ref5$capHeight === void 0 ? '0.71em' : _ref5$capHeight,\n _ref5$scaleToFit = _ref5.scaleToFit,\n scaleToFit = _ref5$scaleToFit === void 0 ? false : _ref5$scaleToFit,\n _ref5$textAnchor = _ref5.textAnchor,\n textAnchor = _ref5$textAnchor === void 0 ? 'start' : _ref5$textAnchor,\n _ref5$verticalAnchor = _ref5.verticalAnchor,\n verticalAnchor = _ref5$verticalAnchor === void 0 ? 'end' : _ref5$verticalAnchor,\n _ref5$fill = _ref5.fill,\n fill = _ref5$fill === void 0 ? DEFAULT_FILL : _ref5$fill,\n props = _objectWithoutProperties(_ref5, _excluded);\n var wordsByLines = useMemo(function () {\n return getWordsByLines({\n breakAll: props.breakAll,\n children: props.children,\n maxLines: props.maxLines,\n scaleToFit: scaleToFit,\n style: props.style,\n width: props.width\n });\n }, [props.breakAll, props.children, props.maxLines, scaleToFit, props.style, props.width]);\n var dx = props.dx,\n dy = props.dy,\n angle = props.angle,\n className = props.className,\n breakAll = props.breakAll,\n textProps = _objectWithoutProperties(props, _excluded2);\n if (!isNumOrStr(propsX) || !isNumOrStr(propsY)) {\n return null;\n }\n var x = propsX + (isNumber(dx) ? dx : 0);\n var y = propsY + (isNumber(dy) ? dy : 0);\n var startDy;\n switch (verticalAnchor) {\n case 'start':\n startDy = reduceCSSCalc(\"calc(\".concat(capHeight, \")\"));\n break;\n case 'middle':\n startDy = reduceCSSCalc(\"calc(\".concat((wordsByLines.length - 1) / 2, \" * -\").concat(lineHeight, \" + (\").concat(capHeight, \" / 2))\"));\n break;\n default:\n startDy = reduceCSSCalc(\"calc(\".concat(wordsByLines.length - 1, \" * -\").concat(lineHeight, \")\"));\n break;\n }\n var transforms = [];\n if (scaleToFit) {\n var lineWidth = wordsByLines[0].width;\n var width = props.width;\n transforms.push(\"scale(\".concat((isNumber(width) ? width / lineWidth : 1) / lineWidth, \")\"));\n }\n if (angle) {\n transforms.push(\"rotate(\".concat(angle, \", \").concat(x, \", \").concat(y, \")\"));\n }\n if (transforms.length) {\n textProps.transform = transforms.join(' ');\n }\n return /*#__PURE__*/React.createElement(\"text\", _extends({}, filterProps(textProps, true), {\n x: x,\n y: y,\n className: classNames('recharts-text', className),\n textAnchor: textAnchor,\n fill: fill.includes('url') ? DEFAULT_FILL : fill\n }), wordsByLines.map(function (line, index) {\n return (\n /*#__PURE__*/\n // eslint-disable-next-line react/no-array-index-key\n React.createElement(\"tspan\", {\n x: x,\n dy: index === 0 ? startDy : lineHeight,\n key: index\n }, line.words.join(breakAll ? '' : ' '))\n );\n }));\n};","import _isNil from \"lodash/isNil\";\nimport _sortBy from \"lodash/sortBy\";\nimport _isArray from \"lodash/isArray\";\n/**\n * @fileOverview Default Tooltip Content\n */\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport React from 'react';\nimport classNames from 'classnames';\nimport { isNumOrStr } from '../util/DataUtils';\nfunction defaultFormatter(value) {\n return _isArray(value) && isNumOrStr(value[0]) && isNumOrStr(value[1]) ? value.join(' ~ ') : value;\n}\nexport var DefaultTooltipContent = function DefaultTooltipContent(props) {\n var _props$separator = props.separator,\n separator = _props$separator === void 0 ? ' : ' : _props$separator,\n _props$contentStyle = props.contentStyle,\n contentStyle = _props$contentStyle === void 0 ? {} : _props$contentStyle,\n _props$itemStyle = props.itemStyle,\n itemStyle = _props$itemStyle === void 0 ? {} : _props$itemStyle,\n _props$labelStyle = props.labelStyle,\n labelStyle = _props$labelStyle === void 0 ? {} : _props$labelStyle,\n payload = props.payload,\n formatter = props.formatter,\n itemSorter = props.itemSorter,\n wrapperClassName = props.wrapperClassName,\n labelClassName = props.labelClassName,\n label = props.label,\n labelFormatter = props.labelFormatter;\n var renderContent = function renderContent() {\n if (payload && payload.length) {\n var listStyle = {\n padding: 0,\n margin: 0\n };\n var items = (itemSorter ? _sortBy(payload, itemSorter) : payload).map(function (entry, i) {\n if (entry.type === 'none') {\n return null;\n }\n var finalItemStyle = _objectSpread({\n display: 'block',\n paddingTop: 4,\n paddingBottom: 4,\n color: entry.color || '#000'\n }, itemStyle);\n var finalFormatter = entry.formatter || formatter || defaultFormatter;\n var value = entry.value,\n name = entry.name;\n var finalValue = value;\n var finalName = name;\n if (finalFormatter && finalValue != null && finalName != null) {\n var formatted = finalFormatter(value, name, entry, i, payload);\n if (Array.isArray(formatted)) {\n var _formatted = _slicedToArray(formatted, 2);\n finalValue = _formatted[0];\n finalName = _formatted[1];\n } else {\n finalValue = formatted;\n }\n }\n return (\n /*#__PURE__*/\n // eslint-disable-next-line react/no-array-index-key\n React.createElement(\"li\", {\n className: \"recharts-tooltip-item\",\n key: \"tooltip-item-\".concat(i),\n style: finalItemStyle\n }, isNumOrStr(finalName) ? /*#__PURE__*/React.createElement(\"span\", {\n className: \"recharts-tooltip-item-name\"\n }, finalName) : null, isNumOrStr(finalName) ? /*#__PURE__*/React.createElement(\"span\", {\n className: \"recharts-tooltip-item-separator\"\n }, separator) : null, /*#__PURE__*/React.createElement(\"span\", {\n className: \"recharts-tooltip-item-value\"\n }, finalValue), /*#__PURE__*/React.createElement(\"span\", {\n className: \"recharts-tooltip-item-unit\"\n }, entry.unit || ''))\n );\n });\n return /*#__PURE__*/React.createElement(\"ul\", {\n className: \"recharts-tooltip-item-list\",\n style: listStyle\n }, items);\n }\n return null;\n };\n var finalStyle = _objectSpread({\n margin: 0,\n padding: 10,\n backgroundColor: '#fff',\n border: '1px solid #ccc',\n whiteSpace: 'nowrap'\n }, contentStyle);\n var finalLabelStyle = _objectSpread({\n margin: 0\n }, labelStyle);\n var hasLabel = !_isNil(label);\n var finalLabel = hasLabel ? label : '';\n var wrapperCN = classNames('recharts-default-tooltip', wrapperClassName);\n var labelCN = classNames('recharts-tooltip-label', labelClassName);\n if (hasLabel && labelFormatter && payload !== undefined && payload !== null) {\n finalLabel = labelFormatter(label, payload);\n }\n return /*#__PURE__*/React.createElement(\"div\", {\n className: wrapperCN,\n style: finalStyle\n }, /*#__PURE__*/React.createElement(\"p\", {\n className: labelCN,\n style: finalLabelStyle\n }, /*#__PURE__*/React.isValidElement(finalLabel) ? finalLabel : \"\".concat(finalLabel)), renderContent());\n};","import _isNil from \"lodash/isNil\";\nimport _isFunction from \"lodash/isFunction\";\nimport _uniqBy from \"lodash/uniqBy\";\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n/**\n * @fileOverview Tooltip\n */\nimport React, { PureComponent } from 'react';\nimport { translateStyle } from 'react-smooth';\nimport classNames from 'classnames';\nimport { DefaultTooltipContent } from './DefaultTooltipContent';\nimport { Global } from '../util/Global';\nimport { isNumber } from '../util/DataUtils';\nvar CLS_PREFIX = 'recharts-tooltip-wrapper';\nvar EPS = 1;\nfunction defaultUniqBy(entry) {\n return entry.dataKey;\n}\nfunction getUniqPayload(option, payload) {\n if (option === true) {\n return _uniqBy(payload, defaultUniqBy);\n }\n if (_isFunction(option)) {\n return _uniqBy(payload, option);\n }\n return payload;\n}\nfunction renderContent(content, props) {\n if ( /*#__PURE__*/React.isValidElement(content)) {\n return /*#__PURE__*/React.cloneElement(content, props);\n }\n if (_isFunction(content)) {\n return /*#__PURE__*/React.createElement(content, props);\n }\n return /*#__PURE__*/React.createElement(DefaultTooltipContent, props);\n}\nexport var Tooltip = /*#__PURE__*/function (_PureComponent) {\n _inherits(Tooltip, _PureComponent);\n var _super = _createSuper(Tooltip);\n function Tooltip() {\n var _this;\n _classCallCheck(this, Tooltip);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n boxWidth: -1,\n boxHeight: -1,\n dismissed: false,\n dismissedAtCoordinate: {\n x: 0,\n y: 0\n }\n });\n _defineProperty(_assertThisInitialized(_this), \"handleKeyDown\", function (event) {\n if (event.key === 'Escape') {\n _this.setState({\n dismissed: true,\n dismissedAtCoordinate: _objectSpread(_objectSpread({}, _this.state.dismissedAtCoordinate), {}, {\n x: _this.props.coordinate.x,\n y: _this.props.coordinate.y\n })\n });\n }\n });\n _defineProperty(_assertThisInitialized(_this), \"getTranslate\", function (_ref) {\n var key = _ref.key,\n tooltipDimension = _ref.tooltipDimension,\n viewBoxDimension = _ref.viewBoxDimension;\n var _this$props = _this.props,\n allowEscapeViewBox = _this$props.allowEscapeViewBox,\n reverseDirection = _this$props.reverseDirection,\n coordinate = _this$props.coordinate,\n offset = _this$props.offset,\n position = _this$props.position,\n viewBox = _this$props.viewBox;\n if (position && isNumber(position[key])) {\n return position[key];\n }\n var negative = coordinate[key] - tooltipDimension - offset;\n var positive = coordinate[key] + offset;\n if (allowEscapeViewBox[key]) {\n return reverseDirection[key] ? negative : positive;\n }\n if (reverseDirection[key]) {\n var _tooltipBoundary = negative;\n var _viewBoxBoundary = viewBox[key];\n if (_tooltipBoundary < _viewBoxBoundary) {\n return Math.max(positive, viewBox[key]);\n }\n return Math.max(negative, viewBox[key]);\n }\n var tooltipBoundary = positive + tooltipDimension;\n var viewBoxBoundary = viewBox[key] + viewBoxDimension;\n if (tooltipBoundary > viewBoxBoundary) {\n return Math.max(negative, viewBox[key]);\n }\n return Math.max(positive, viewBox[key]);\n });\n return _this;\n }\n _createClass(Tooltip, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.updateBBox();\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n document.removeEventListener('keydown', this.handleKeyDown);\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n this.updateBBox();\n }\n }, {\n key: \"updateBBox\",\n value: function updateBBox() {\n var _this$state = this.state,\n boxWidth = _this$state.boxWidth,\n boxHeight = _this$state.boxHeight,\n dismissed = _this$state.dismissed;\n if (dismissed) {\n document.removeEventListener('keydown', this.handleKeyDown);\n if (this.props.coordinate.x !== this.state.dismissedAtCoordinate.x || this.props.coordinate.y !== this.state.dismissedAtCoordinate.y) {\n this.setState({\n dismissed: false\n });\n }\n } else {\n document.addEventListener('keydown', this.handleKeyDown);\n }\n if (this.wrapperNode && this.wrapperNode.getBoundingClientRect) {\n var box = this.wrapperNode.getBoundingClientRect();\n if (Math.abs(box.width - boxWidth) > EPS || Math.abs(box.height - boxHeight) > EPS) {\n this.setState({\n boxWidth: box.width,\n boxHeight: box.height\n });\n }\n } else if (boxWidth !== -1 || boxHeight !== -1) {\n this.setState({\n boxWidth: -1,\n boxHeight: -1\n });\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _classNames,\n _this2 = this;\n var _this$props2 = this.props,\n payload = _this$props2.payload,\n isAnimationActive = _this$props2.isAnimationActive,\n animationDuration = _this$props2.animationDuration,\n animationEasing = _this$props2.animationEasing,\n filterNull = _this$props2.filterNull,\n payloadUniqBy = _this$props2.payloadUniqBy;\n var finalPayload = getUniqPayload(payloadUniqBy, filterNull && payload && payload.length ? payload.filter(function (entry) {\n return !_isNil(entry.value);\n }) : payload);\n var hasPayload = finalPayload && finalPayload.length;\n var _this$props3 = this.props,\n content = _this$props3.content,\n viewBox = _this$props3.viewBox,\n coordinate = _this$props3.coordinate,\n position = _this$props3.position,\n active = _this$props3.active,\n wrapperStyle = _this$props3.wrapperStyle;\n var outerStyle = _objectSpread({\n pointerEvents: 'none',\n visibility: !this.state.dismissed && active && hasPayload ? 'visible' : 'hidden',\n position: 'absolute',\n top: 0,\n left: 0\n }, wrapperStyle);\n var translateX, translateY;\n if (position && isNumber(position.x) && isNumber(position.y)) {\n translateX = position.x;\n translateY = position.y;\n } else {\n var _this$state2 = this.state,\n boxWidth = _this$state2.boxWidth,\n boxHeight = _this$state2.boxHeight;\n if (boxWidth > 0 && boxHeight > 0 && coordinate) {\n translateX = this.getTranslate({\n key: 'x',\n tooltipDimension: boxWidth,\n viewBoxDimension: viewBox.width\n });\n translateY = this.getTranslate({\n key: 'y',\n tooltipDimension: boxHeight,\n viewBoxDimension: viewBox.height\n });\n } else {\n outerStyle.visibility = 'hidden';\n }\n }\n outerStyle = _objectSpread(_objectSpread({}, translateStyle({\n transform: this.props.useTranslate3d ? \"translate3d(\".concat(translateX, \"px, \").concat(translateY, \"px, 0)\") : \"translate(\".concat(translateX, \"px, \").concat(translateY, \"px)\")\n })), outerStyle);\n if (isAnimationActive && active) {\n outerStyle = _objectSpread(_objectSpread({}, translateStyle({\n transition: \"transform \".concat(animationDuration, \"ms \").concat(animationEasing)\n })), outerStyle);\n }\n var cls = classNames(CLS_PREFIX, (_classNames = {}, _defineProperty(_classNames, \"\".concat(CLS_PREFIX, \"-right\"), isNumber(translateX) && coordinate && isNumber(coordinate.x) && translateX >= coordinate.x), _defineProperty(_classNames, \"\".concat(CLS_PREFIX, \"-left\"), isNumber(translateX) && coordinate && isNumber(coordinate.x) && translateX < coordinate.x), _defineProperty(_classNames, \"\".concat(CLS_PREFIX, \"-bottom\"), isNumber(translateY) && coordinate && isNumber(coordinate.y) && translateY >= coordinate.y), _defineProperty(_classNames, \"\".concat(CLS_PREFIX, \"-top\"), isNumber(translateY) && coordinate && isNumber(coordinate.y) && translateY < coordinate.y), _classNames));\n return (\n /*#__PURE__*/\n // ESLint is disabled to allow listening to the `Escape` key. Refer to\n // https://github.com/recharts/recharts/pull/2925\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n React.createElement(\"div\", {\n tabIndex: -1,\n role: \"dialog\",\n className: cls,\n style: outerStyle,\n ref: function ref(node) {\n _this2.wrapperNode = node;\n }\n }, renderContent(content, _objectSpread(_objectSpread({}, this.props), {}, {\n payload: finalPayload\n })))\n );\n }\n }]);\n return Tooltip;\n}(PureComponent);\n_defineProperty(Tooltip, \"displayName\", 'Tooltip');\n_defineProperty(Tooltip, \"defaultProps\", {\n active: false,\n allowEscapeViewBox: {\n x: false,\n y: false\n },\n reverseDirection: {\n x: false,\n y: false\n },\n offset: 10,\n viewBox: {\n x: 0,\n y: 0,\n height: 0,\n width: 0\n },\n coordinate: {\n x: 0,\n y: 0\n },\n cursorStyle: {},\n separator: ' : ',\n wrapperStyle: {},\n contentStyle: {},\n itemStyle: {},\n labelStyle: {},\n cursor: true,\n trigger: 'hover',\n isAnimationActive: !Global.isSsr,\n animationEasing: 'ease',\n animationDuration: 400,\n filterNull: true,\n useTranslate3d: false\n});","var _excluded = [\"children\", \"className\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n/**\n * @fileOverview Layer\n */\nimport React from 'react';\nimport classNames from 'classnames';\nimport { filterProps } from '../util/ReactUtils';\nexport var Layer = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var children = props.children,\n className = props.className,\n others = _objectWithoutProperties(props, _excluded);\n var layerClass = classNames('recharts-layer', className);\n return /*#__PURE__*/React.createElement(\"g\", _extends({\n className: layerClass\n }, filterProps(others, true), {\n ref: ref\n }), children);\n});","var _excluded = [\"children\", \"width\", \"height\", \"viewBox\", \"className\", \"style\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n/**\n * @fileOverview Surface\n */\nimport React from 'react';\nimport classNames from 'classnames';\nimport { filterProps } from '../util/ReactUtils';\nexport function Surface(props) {\n var children = props.children,\n width = props.width,\n height = props.height,\n viewBox = props.viewBox,\n className = props.className,\n style = props.style,\n others = _objectWithoutProperties(props, _excluded);\n var svgView = viewBox || {\n width: width,\n height: height,\n x: 0,\n y: 0\n };\n var layerClass = classNames('recharts-surface', className);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({}, filterProps(others, true, 'svg'), {\n className: layerClass,\n width: width,\n height: height,\n style: style,\n viewBox: \"\".concat(svgView.x, \" \").concat(svgView.y, \" \").concat(svgView.width, \" \").concat(svgView.height)\n }), /*#__PURE__*/React.createElement(\"title\", null, props.title), /*#__PURE__*/React.createElement(\"desc\", null, props.desc), children);\n}","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n/**\n * @fileOverview Rectangle\n */\nimport React, { useEffect, useRef, useState } from 'react';\nimport classNames from 'classnames';\nimport Animate from 'react-smooth';\nimport { filterProps } from '../util/ReactUtils';\nvar getRectanglePath = function getRectanglePath(x, y, width, height, radius) {\n var maxRadius = Math.min(Math.abs(width) / 2, Math.abs(height) / 2);\n var ySign = height >= 0 ? 1 : -1;\n var xSign = width >= 0 ? 1 : -1;\n var clockWise = height >= 0 && width >= 0 || height < 0 && width < 0 ? 1 : 0;\n var path;\n if (maxRadius > 0 && radius instanceof Array) {\n var newRadius = [0, 0, 0, 0];\n for (var i = 0, len = 4; i < len; i++) {\n newRadius[i] = radius[i] > maxRadius ? maxRadius : radius[i];\n }\n path = \"M\".concat(x, \",\").concat(y + ySign * newRadius[0]);\n if (newRadius[0] > 0) {\n path += \"A \".concat(newRadius[0], \",\").concat(newRadius[0], \",0,0,\").concat(clockWise, \",\").concat(x + xSign * newRadius[0], \",\").concat(y);\n }\n path += \"L \".concat(x + width - xSign * newRadius[1], \",\").concat(y);\n if (newRadius[1] > 0) {\n path += \"A \".concat(newRadius[1], \",\").concat(newRadius[1], \",0,0,\").concat(clockWise, \",\\n \").concat(x + width, \",\").concat(y + ySign * newRadius[1]);\n }\n path += \"L \".concat(x + width, \",\").concat(y + height - ySign * newRadius[2]);\n if (newRadius[2] > 0) {\n path += \"A \".concat(newRadius[2], \",\").concat(newRadius[2], \",0,0,\").concat(clockWise, \",\\n \").concat(x + width - xSign * newRadius[2], \",\").concat(y + height);\n }\n path += \"L \".concat(x + xSign * newRadius[3], \",\").concat(y + height);\n if (newRadius[3] > 0) {\n path += \"A \".concat(newRadius[3], \",\").concat(newRadius[3], \",0,0,\").concat(clockWise, \",\\n \").concat(x, \",\").concat(y + height - ySign * newRadius[3]);\n }\n path += 'Z';\n } else if (maxRadius > 0 && radius === +radius && radius > 0) {\n var _newRadius = Math.min(maxRadius, radius);\n path = \"M \".concat(x, \",\").concat(y + ySign * _newRadius, \"\\n A \").concat(_newRadius, \",\").concat(_newRadius, \",0,0,\").concat(clockWise, \",\").concat(x + xSign * _newRadius, \",\").concat(y, \"\\n L \").concat(x + width - xSign * _newRadius, \",\").concat(y, \"\\n A \").concat(_newRadius, \",\").concat(_newRadius, \",0,0,\").concat(clockWise, \",\").concat(x + width, \",\").concat(y + ySign * _newRadius, \"\\n L \").concat(x + width, \",\").concat(y + height - ySign * _newRadius, \"\\n A \").concat(_newRadius, \",\").concat(_newRadius, \",0,0,\").concat(clockWise, \",\").concat(x + width - xSign * _newRadius, \",\").concat(y + height, \"\\n L \").concat(x + xSign * _newRadius, \",\").concat(y + height, \"\\n A \").concat(_newRadius, \",\").concat(_newRadius, \",0,0,\").concat(clockWise, \",\").concat(x, \",\").concat(y + height - ySign * _newRadius, \" Z\");\n } else {\n path = \"M \".concat(x, \",\").concat(y, \" h \").concat(width, \" v \").concat(height, \" h \").concat(-width, \" Z\");\n }\n return path;\n};\nexport var isInRectangle = function isInRectangle(point, rect) {\n if (!point || !rect) {\n return false;\n }\n var px = point.x,\n py = point.y;\n var x = rect.x,\n y = rect.y,\n width = rect.width,\n height = rect.height;\n if (Math.abs(width) > 0 && Math.abs(height) > 0) {\n var minX = Math.min(x, x + width);\n var maxX = Math.max(x, x + width);\n var minY = Math.min(y, y + height);\n var maxY = Math.max(y, y + height);\n return px >= minX && px <= maxX && py >= minY && py <= maxY;\n }\n return false;\n};\nvar defaultProps = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n // The radius of border\n // The radius of four corners when radius is a number\n // The radius of left-top, right-top, right-bottom, left-bottom when radius is an array\n radius: 0,\n isAnimationActive: false,\n isUpdateAnimationActive: false,\n animationBegin: 0,\n animationDuration: 1500,\n animationEasing: 'ease'\n};\nexport var Rectangle = function Rectangle(rectangleProps) {\n var props = _objectSpread(_objectSpread({}, defaultProps), rectangleProps);\n var pathRef = useRef();\n var _useState = useState(-1),\n _useState2 = _slicedToArray(_useState, 2),\n totalLength = _useState2[0],\n setTotalLength = _useState2[1];\n useEffect(function () {\n if (pathRef.current && pathRef.current.getTotalLength) {\n try {\n var pathTotalLength = pathRef.current.getTotalLength();\n if (pathTotalLength) {\n setTotalLength(pathTotalLength);\n }\n } catch (err) {\n // calculate total length error\n }\n }\n }, []);\n var x = props.x,\n y = props.y,\n width = props.width,\n height = props.height,\n radius = props.radius,\n className = props.className;\n var animationEasing = props.animationEasing,\n animationDuration = props.animationDuration,\n animationBegin = props.animationBegin,\n isAnimationActive = props.isAnimationActive,\n isUpdateAnimationActive = props.isUpdateAnimationActive;\n if (x !== +x || y !== +y || width !== +width || height !== +height || width === 0 || height === 0) {\n return null;\n }\n var layerClass = classNames('recharts-rectangle', className);\n if (!isUpdateAnimationActive) {\n return /*#__PURE__*/React.createElement(\"path\", _extends({}, filterProps(props, true), {\n className: layerClass,\n d: getRectanglePath(x, y, width, height, radius)\n }));\n }\n return /*#__PURE__*/React.createElement(Animate, {\n canBegin: totalLength > 0,\n from: {\n width: width,\n height: height,\n x: x,\n y: y\n },\n to: {\n width: width,\n height: height,\n x: x,\n y: y\n },\n duration: animationDuration,\n animationEasing: animationEasing,\n isActive: isUpdateAnimationActive\n }, function (_ref) {\n var currWidth = _ref.width,\n currHeight = _ref.height,\n currX = _ref.x,\n currY = _ref.y;\n return /*#__PURE__*/React.createElement(Animate, {\n canBegin: totalLength > 0,\n from: \"0px \".concat(totalLength === -1 ? 1 : totalLength, \"px\"),\n to: \"\".concat(totalLength, \"px 0px\"),\n attributeName: \"strokeDasharray\",\n begin: animationBegin,\n duration: animationDuration,\n isActive: isAnimationActive,\n easing: animationEasing\n }, /*#__PURE__*/React.createElement(\"path\", _extends({}, filterProps(props, true), {\n className: layerClass,\n d: getRectanglePath(currX, currY, currWidth, currHeight, radius),\n ref: pathRef\n })));\n });\n};","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n/**\n * @fileOverview Sector\n */\nimport React from 'react';\nimport classNames from 'classnames';\nimport { filterProps } from '../util/ReactUtils';\nimport { polarToCartesian, RADIAN } from '../util/PolarUtils';\nimport { getPercentValue, mathSign } from '../util/DataUtils';\nvar getDeltaAngle = function getDeltaAngle(startAngle, endAngle) {\n var sign = mathSign(endAngle - startAngle);\n var deltaAngle = Math.min(Math.abs(endAngle - startAngle), 359.999);\n return sign * deltaAngle;\n};\nvar getTangentCircle = function getTangentCircle(_ref) {\n var cx = _ref.cx,\n cy = _ref.cy,\n radius = _ref.radius,\n angle = _ref.angle,\n sign = _ref.sign,\n isExternal = _ref.isExternal,\n cornerRadius = _ref.cornerRadius,\n cornerIsExternal = _ref.cornerIsExternal;\n var centerRadius = cornerRadius * (isExternal ? 1 : -1) + radius;\n var theta = Math.asin(cornerRadius / centerRadius) / RADIAN;\n var centerAngle = cornerIsExternal ? angle : angle + sign * theta;\n var center = polarToCartesian(cx, cy, centerRadius, centerAngle);\n // The coordinate of point which is tangent to the circle\n var circleTangency = polarToCartesian(cx, cy, radius, centerAngle);\n // The coordinate of point which is tangent to the radius line\n var lineTangencyAngle = cornerIsExternal ? angle - sign * theta : angle;\n var lineTangency = polarToCartesian(cx, cy, centerRadius * Math.cos(theta * RADIAN), lineTangencyAngle);\n return {\n center: center,\n circleTangency: circleTangency,\n lineTangency: lineTangency,\n theta: theta\n };\n};\nvar getSectorPath = function getSectorPath(_ref2) {\n var cx = _ref2.cx,\n cy = _ref2.cy,\n innerRadius = _ref2.innerRadius,\n outerRadius = _ref2.outerRadius,\n startAngle = _ref2.startAngle,\n endAngle = _ref2.endAngle;\n var angle = getDeltaAngle(startAngle, endAngle);\n\n // When the angle of sector equals to 360, star point and end point coincide\n var tempEndAngle = startAngle + angle;\n var outerStartPoint = polarToCartesian(cx, cy, outerRadius, startAngle);\n var outerEndPoint = polarToCartesian(cx, cy, outerRadius, tempEndAngle);\n var path = \"M \".concat(outerStartPoint.x, \",\").concat(outerStartPoint.y, \"\\n A \").concat(outerRadius, \",\").concat(outerRadius, \",0,\\n \").concat(+(Math.abs(angle) > 180), \",\").concat(+(startAngle > tempEndAngle), \",\\n \").concat(outerEndPoint.x, \",\").concat(outerEndPoint.y, \"\\n \");\n if (innerRadius > 0) {\n var innerStartPoint = polarToCartesian(cx, cy, innerRadius, startAngle);\n var innerEndPoint = polarToCartesian(cx, cy, innerRadius, tempEndAngle);\n path += \"L \".concat(innerEndPoint.x, \",\").concat(innerEndPoint.y, \"\\n A \").concat(innerRadius, \",\").concat(innerRadius, \",0,\\n \").concat(+(Math.abs(angle) > 180), \",\").concat(+(startAngle <= tempEndAngle), \",\\n \").concat(innerStartPoint.x, \",\").concat(innerStartPoint.y, \" Z\");\n } else {\n path += \"L \".concat(cx, \",\").concat(cy, \" Z\");\n }\n return path;\n};\nvar getSectorWithCorner = function getSectorWithCorner(_ref3) {\n var cx = _ref3.cx,\n cy = _ref3.cy,\n innerRadius = _ref3.innerRadius,\n outerRadius = _ref3.outerRadius,\n cornerRadius = _ref3.cornerRadius,\n forceCornerRadius = _ref3.forceCornerRadius,\n cornerIsExternal = _ref3.cornerIsExternal,\n startAngle = _ref3.startAngle,\n endAngle = _ref3.endAngle;\n var sign = mathSign(endAngle - startAngle);\n var _getTangentCircle = getTangentCircle({\n cx: cx,\n cy: cy,\n radius: outerRadius,\n angle: startAngle,\n sign: sign,\n cornerRadius: cornerRadius,\n cornerIsExternal: cornerIsExternal\n }),\n soct = _getTangentCircle.circleTangency,\n solt = _getTangentCircle.lineTangency,\n sot = _getTangentCircle.theta;\n var _getTangentCircle2 = getTangentCircle({\n cx: cx,\n cy: cy,\n radius: outerRadius,\n angle: endAngle,\n sign: -sign,\n cornerRadius: cornerRadius,\n cornerIsExternal: cornerIsExternal\n }),\n eoct = _getTangentCircle2.circleTangency,\n eolt = _getTangentCircle2.lineTangency,\n eot = _getTangentCircle2.theta;\n var outerArcAngle = cornerIsExternal ? Math.abs(startAngle - endAngle) : Math.abs(startAngle - endAngle) - sot - eot;\n if (outerArcAngle < 0) {\n if (forceCornerRadius) {\n return \"M \".concat(solt.x, \",\").concat(solt.y, \"\\n a\").concat(cornerRadius, \",\").concat(cornerRadius, \",0,0,1,\").concat(cornerRadius * 2, \",0\\n a\").concat(cornerRadius, \",\").concat(cornerRadius, \",0,0,1,\").concat(-cornerRadius * 2, \",0\\n \");\n }\n return getSectorPath({\n cx: cx,\n cy: cy,\n innerRadius: innerRadius,\n outerRadius: outerRadius,\n startAngle: startAngle,\n endAngle: endAngle\n });\n }\n var path = \"M \".concat(solt.x, \",\").concat(solt.y, \"\\n A\").concat(cornerRadius, \",\").concat(cornerRadius, \",0,0,\").concat(+(sign < 0), \",\").concat(soct.x, \",\").concat(soct.y, \"\\n A\").concat(outerRadius, \",\").concat(outerRadius, \",0,\").concat(+(outerArcAngle > 180), \",\").concat(+(sign < 0), \",\").concat(eoct.x, \",\").concat(eoct.y, \"\\n A\").concat(cornerRadius, \",\").concat(cornerRadius, \",0,0,\").concat(+(sign < 0), \",\").concat(eolt.x, \",\").concat(eolt.y, \"\\n \");\n if (innerRadius > 0) {\n var _getTangentCircle3 = getTangentCircle({\n cx: cx,\n cy: cy,\n radius: innerRadius,\n angle: startAngle,\n sign: sign,\n isExternal: true,\n cornerRadius: cornerRadius,\n cornerIsExternal: cornerIsExternal\n }),\n sict = _getTangentCircle3.circleTangency,\n silt = _getTangentCircle3.lineTangency,\n sit = _getTangentCircle3.theta;\n var _getTangentCircle4 = getTangentCircle({\n cx: cx,\n cy: cy,\n radius: innerRadius,\n angle: endAngle,\n sign: -sign,\n isExternal: true,\n cornerRadius: cornerRadius,\n cornerIsExternal: cornerIsExternal\n }),\n eict = _getTangentCircle4.circleTangency,\n eilt = _getTangentCircle4.lineTangency,\n eit = _getTangentCircle4.theta;\n var innerArcAngle = cornerIsExternal ? Math.abs(startAngle - endAngle) : Math.abs(startAngle - endAngle) - sit - eit;\n if (innerArcAngle < 0 && cornerRadius === 0) {\n return \"\".concat(path, \"L\").concat(cx, \",\").concat(cy, \"Z\");\n }\n path += \"L\".concat(eilt.x, \",\").concat(eilt.y, \"\\n A\").concat(cornerRadius, \",\").concat(cornerRadius, \",0,0,\").concat(+(sign < 0), \",\").concat(eict.x, \",\").concat(eict.y, \"\\n A\").concat(innerRadius, \",\").concat(innerRadius, \",0,\").concat(+(innerArcAngle > 180), \",\").concat(+(sign > 0), \",\").concat(sict.x, \",\").concat(sict.y, \"\\n A\").concat(cornerRadius, \",\").concat(cornerRadius, \",0,0,\").concat(+(sign < 0), \",\").concat(silt.x, \",\").concat(silt.y, \"Z\");\n } else {\n path += \"L\".concat(cx, \",\").concat(cy, \"Z\");\n }\n return path;\n};\nvar defaultProps = {\n cx: 0,\n cy: 0,\n innerRadius: 0,\n outerRadius: 0,\n startAngle: 0,\n endAngle: 0,\n cornerRadius: 0,\n forceCornerRadius: false,\n cornerIsExternal: false\n};\nexport var Sector = function Sector(sectorProps) {\n var props = _objectSpread(_objectSpread({}, defaultProps), sectorProps);\n var cx = props.cx,\n cy = props.cy,\n innerRadius = props.innerRadius,\n outerRadius = props.outerRadius,\n cornerRadius = props.cornerRadius,\n forceCornerRadius = props.forceCornerRadius,\n cornerIsExternal = props.cornerIsExternal,\n startAngle = props.startAngle,\n endAngle = props.endAngle,\n className = props.className;\n if (outerRadius < innerRadius || startAngle === endAngle) {\n return null;\n }\n var layerClass = classNames('recharts-sector', className);\n var deltaRadius = outerRadius - innerRadius;\n var cr = getPercentValue(cornerRadius, deltaRadius, 0, true);\n var path;\n if (cr > 0 && Math.abs(startAngle - endAngle) < 360) {\n path = getSectorWithCorner({\n cx: cx,\n cy: cy,\n innerRadius: innerRadius,\n outerRadius: outerRadius,\n cornerRadius: Math.min(cr, deltaRadius / 2),\n forceCornerRadius: forceCornerRadius,\n cornerIsExternal: cornerIsExternal,\n startAngle: startAngle,\n endAngle: endAngle\n });\n } else {\n path = getSectorPath({\n cx: cx,\n cy: cy,\n innerRadius: innerRadius,\n outerRadius: outerRadius,\n startAngle: startAngle,\n endAngle: endAngle\n });\n }\n return /*#__PURE__*/React.createElement(\"path\", _extends({}, filterProps(props, true), {\n className: layerClass,\n d: path,\n role: \"img\"\n }));\n};","export const abs = Math.abs;\nexport const atan2 = Math.atan2;\nexport const cos = Math.cos;\nexport const max = Math.max;\nexport const min = Math.min;\nexport const sin = Math.sin;\nexport const sqrt = Math.sqrt;\n\nexport const epsilon = 1e-12;\nexport const pi = Math.PI;\nexport const halfPi = pi / 2;\nexport const tau = 2 * pi;\n\nexport function acos(x) {\n return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);\n}\n\nexport function asin(x) {\n return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);\n}\n","import {pi, sqrt, tau} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size / pi);\n context.moveTo(r, 0);\n context.arc(0, 0, r, 0, tau);\n }\n};\n","import {sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const r = sqrt(size / 5) / 2;\n context.moveTo(-3 * r, -r);\n context.lineTo(-r, -r);\n context.lineTo(-r, -3 * r);\n context.lineTo(r, -3 * r);\n context.lineTo(r, -r);\n context.lineTo(3 * r, -r);\n context.lineTo(3 * r, r);\n context.lineTo(r, r);\n context.lineTo(r, 3 * r);\n context.lineTo(-r, 3 * r);\n context.lineTo(-r, r);\n context.lineTo(-3 * r, r);\n context.closePath();\n }\n};\n","import {sqrt} from \"../math.js\";\n\nconst tan30 = sqrt(1 / 3);\nconst tan30_2 = tan30 * 2;\n\nexport default {\n draw(context, size) {\n const y = sqrt(size / tan30_2);\n const x = y * tan30;\n context.moveTo(0, -y);\n context.lineTo(x, 0);\n context.lineTo(0, y);\n context.lineTo(-x, 0);\n context.closePath();\n }\n};\n","import {sqrt} from \"../math.js\";\n\nexport default {\n draw(context, size) {\n const w = sqrt(size);\n const x = -w / 2;\n context.rect(x, x, w, w);\n }\n};\n","import {sin, cos, sqrt, pi, tau} from \"../math.js\";\n\nconst ka = 0.89081309152928522810;\nconst kr = sin(pi / 10) / sin(7 * pi / 10);\nconst kx = sin(tau / 10) * kr;\nconst ky = -cos(tau / 10) * kr;\n\nexport default {\n draw(context, size) {\n const r = sqrt(size * ka);\n const x = kx * r;\n const y = ky * r;\n context.moveTo(0, -r);\n context.lineTo(x, y);\n for (let i = 1; i < 5; ++i) {\n const a = tau * i / 5;\n const c = cos(a);\n const s = sin(a);\n context.lineTo(s * r, -c * r);\n context.lineTo(c * x - s * y, s * x + c * y);\n }\n context.closePath();\n }\n};\n","import {sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const y = -sqrt(size / (sqrt3 * 3));\n context.moveTo(0, y * 2);\n context.lineTo(-sqrt3 * y, -y);\n context.lineTo(sqrt3 * y, -y);\n context.closePath();\n }\n};\n","import {sqrt} from \"../math.js\";\n\nconst c = -0.5;\nconst s = sqrt(3) / 2;\nconst k = 1 / sqrt(12);\nconst a = (k / 2 + 1) * 3;\n\nexport default {\n draw(context, size) {\n const r = sqrt(size / a);\n const x0 = r / 2, y0 = r * k;\n const x1 = x0, y1 = r * k + r;\n const x2 = -x1, y2 = y1;\n context.moveTo(x0, y0);\n context.lineTo(x1, y1);\n context.lineTo(x2, y2);\n context.lineTo(c * x0 - s * y0, s * x0 + c * y0);\n context.lineTo(c * x1 - s * y1, s * x1 + c * y1);\n context.lineTo(c * x2 - s * y2, s * x2 + c * y2);\n context.lineTo(c * x0 + s * y0, c * y0 - s * x0);\n context.lineTo(c * x1 + s * y1, c * y1 - s * x1);\n context.lineTo(c * x2 + s * y2, c * y2 - s * x2);\n context.closePath();\n }\n};\n","import {min, sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const r = sqrt(size + min(size / 28, 0.75)) * 0.59436;\n const t = r / 2;\n const u = t * sqrt3;\n context.moveTo(0, r);\n context.lineTo(0, -r);\n context.moveTo(-u, -t);\n context.lineTo(u, t);\n context.moveTo(-u, t);\n context.lineTo(u, -t);\n }\n};\n","import {sqrt} from \"../math.js\";\n\nconst sqrt3 = sqrt(3);\n\nexport default {\n draw(context, size) {\n const s = sqrt(size) * 0.6824;\n const t = s / 2;\n const u = (s * sqrt3) / 2; // cos(Math.PI / 6)\n context.moveTo(0, -s);\n context.lineTo(u, t);\n context.lineTo(-u, t);\n context.closePath();\n }\n};\n","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nimport _upperFirst from \"lodash/upperFirst\";\nvar _excluded = [\"type\", \"size\", \"sizeType\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n/**\n * @fileOverview Curve\n */\nimport React from 'react';\nimport { symbol as shapeSymbol, symbolCircle, symbolCross, symbolDiamond, symbolSquare, symbolStar, symbolTriangle, symbolWye } from 'victory-vendor/d3-shape';\nimport classNames from 'classnames';\nimport { filterProps } from '../util/ReactUtils';\nvar symbolFactories = {\n symbolCircle: symbolCircle,\n symbolCross: symbolCross,\n symbolDiamond: symbolDiamond,\n symbolSquare: symbolSquare,\n symbolStar: symbolStar,\n symbolTriangle: symbolTriangle,\n symbolWye: symbolWye\n};\nvar RADIAN = Math.PI / 180;\nvar getSymbolFactory = function getSymbolFactory(type) {\n var name = \"symbol\".concat(_upperFirst(type));\n return symbolFactories[name] || symbolCircle;\n};\nvar calculateAreaSize = function calculateAreaSize(size, sizeType, type) {\n if (sizeType === 'area') {\n return size;\n }\n switch (type) {\n case 'cross':\n return 5 * size * size / 9;\n case 'diamond':\n return 0.5 * size * size / Math.sqrt(3);\n case 'square':\n return size * size;\n case 'star':\n {\n var angle = 18 * RADIAN;\n return 1.25 * size * size * (Math.tan(angle) - Math.tan(angle * 2) * Math.pow(Math.tan(angle), 2));\n }\n case 'triangle':\n return Math.sqrt(3) * size * size / 4;\n case 'wye':\n return (21 - 10 * Math.sqrt(3)) * size * size / 8;\n default:\n return Math.PI * size * size / 4;\n }\n};\nvar registerSymbol = function registerSymbol(key, factory) {\n symbolFactories[\"symbol\".concat(_upperFirst(key))] = factory;\n};\nexport var Symbols = function Symbols(_ref) {\n var _ref$type = _ref.type,\n type = _ref$type === void 0 ? 'circle' : _ref$type,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? 64 : _ref$size,\n _ref$sizeType = _ref.sizeType,\n sizeType = _ref$sizeType === void 0 ? 'area' : _ref$sizeType,\n rest = _objectWithoutProperties(_ref, _excluded);\n var props = _objectSpread(_objectSpread({}, rest), {}, {\n type: type,\n size: size,\n sizeType: sizeType\n });\n\n /**\n * Calculate the path of curve\n * @return {String} path\n */\n var getPath = function getPath() {\n var symbolFactory = getSymbolFactory(type);\n var symbol = shapeSymbol().type(symbolFactory).size(calculateAreaSize(size, sizeType, type));\n return symbol();\n };\n var className = props.className,\n cx = props.cx,\n cy = props.cy;\n var filteredProps = filterProps(props, true);\n if (cx === +cx && cy === +cy && size === +size) {\n return /*#__PURE__*/React.createElement(\"path\", _extends({}, filteredProps, {\n className: classNames('recharts-symbols', className),\n transform: \"translate(\".concat(cx, \", \").concat(cy, \")\"),\n d: getPath()\n }));\n }\n return null;\n};\nSymbols.registerSymbol = registerSymbol;","import constant from \"./constant.js\";\nimport {withPath} from \"./path.js\";\nimport asterisk from \"./symbol/asterisk.js\";\nimport circle from \"./symbol/circle.js\";\nimport cross from \"./symbol/cross.js\";\nimport diamond from \"./symbol/diamond.js\";\nimport diamond2 from \"./symbol/diamond2.js\";\nimport plus from \"./symbol/plus.js\";\nimport square from \"./symbol/square.js\";\nimport square2 from \"./symbol/square2.js\";\nimport star from \"./symbol/star.js\";\nimport triangle from \"./symbol/triangle.js\";\nimport triangle2 from \"./symbol/triangle2.js\";\nimport wye from \"./symbol/wye.js\";\nimport times from \"./symbol/times.js\";\n\n// These symbols are designed to be filled.\nexport const symbolsFill = [\n circle,\n cross,\n diamond,\n square,\n star,\n triangle,\n wye\n];\n\n// These symbols are designed to be stroked (with a width of 1.5px and round caps).\nexport const symbolsStroke = [\n circle,\n plus,\n times,\n triangle2,\n asterisk,\n square2,\n diamond2\n];\n\nexport default function Symbol(type, size) {\n let context = null,\n path = withPath(symbol);\n\n type = typeof type === \"function\" ? type : constant(type || circle);\n size = typeof size === \"function\" ? size : constant(size === undefined ? 64 : +size);\n\n function symbol() {\n let buffer;\n if (!context) context = buffer = path();\n type.apply(this, arguments).draw(context, +size.apply(this, arguments));\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n symbol.type = function(_) {\n return arguments.length ? (type = typeof _ === \"function\" ? _ : constant(_), symbol) : type;\n };\n\n symbol.size = function(_) {\n return arguments.length ? (size = typeof _ === \"function\" ? _ : constant(+_), symbol) : size;\n };\n\n symbol.context = function(_) {\n return arguments.length ? (context = _ == null ? null : _, symbol) : context;\n };\n\n return symbol;\n}\n","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n/**\n * @fileOverview Rectangle\n */\nimport React, { useEffect, useRef, useState } from 'react';\nimport classNames from 'classnames';\nimport Animate from 'react-smooth';\nimport { filterProps } from '../util/ReactUtils';\nvar getTrapezoidPath = function getTrapezoidPath(x, y, upperWidth, lowerWidth, height) {\n var widthGap = upperWidth - lowerWidth;\n var path;\n path = \"M \".concat(x, \",\").concat(y);\n path += \"L \".concat(x + upperWidth, \",\").concat(y);\n path += \"L \".concat(x + upperWidth - widthGap / 2, \",\").concat(y + height);\n path += \"L \".concat(x + upperWidth - widthGap / 2 - lowerWidth, \",\").concat(y + height);\n path += \"L \".concat(x, \",\").concat(y, \" Z\");\n return path;\n};\nvar defaultProps = {\n x: 0,\n y: 0,\n upperWidth: 0,\n lowerWidth: 0,\n height: 0,\n isUpdateAnimationActive: false,\n animationBegin: 0,\n animationDuration: 1500,\n animationEasing: 'ease'\n};\nexport var Trapezoid = function Trapezoid(props) {\n var trapezoidProps = _objectSpread(_objectSpread({}, defaultProps), props);\n var pathRef = useRef();\n var _useState = useState(-1),\n _useState2 = _slicedToArray(_useState, 2),\n totalLength = _useState2[0],\n setTotalLength = _useState2[1];\n useEffect(function () {\n if (pathRef.current && pathRef.current.getTotalLength) {\n try {\n var pathTotalLength = pathRef.current.getTotalLength();\n if (pathTotalLength) {\n setTotalLength(pathTotalLength);\n }\n } catch (err) {\n // calculate total length error\n }\n }\n }, []);\n var x = trapezoidProps.x,\n y = trapezoidProps.y,\n upperWidth = trapezoidProps.upperWidth,\n lowerWidth = trapezoidProps.lowerWidth,\n height = trapezoidProps.height,\n className = trapezoidProps.className;\n var animationEasing = trapezoidProps.animationEasing,\n animationDuration = trapezoidProps.animationDuration,\n animationBegin = trapezoidProps.animationBegin,\n isUpdateAnimationActive = trapezoidProps.isUpdateAnimationActive;\n if (x !== +x || y !== +y || upperWidth !== +upperWidth || lowerWidth !== +lowerWidth || height !== +height || upperWidth === 0 && lowerWidth === 0 || height === 0) {\n return null;\n }\n var layerClass = classNames('recharts-trapezoid', className);\n if (!isUpdateAnimationActive) {\n return /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", _extends({}, filterProps(trapezoidProps, true), {\n className: layerClass,\n d: getTrapezoidPath(x, y, upperWidth, lowerWidth, height)\n })));\n }\n return /*#__PURE__*/React.createElement(Animate, {\n canBegin: totalLength > 0,\n from: {\n upperWidth: 0,\n lowerWidth: 0,\n height: height,\n x: x,\n y: y\n },\n to: {\n upperWidth: upperWidth,\n lowerWidth: lowerWidth,\n height: height,\n x: x,\n y: y\n },\n duration: animationDuration,\n animationEasing: animationEasing,\n isActive: isUpdateAnimationActive\n }, function (_ref) {\n var currUpperWidth = _ref.upperWidth,\n currLowerWidth = _ref.lowerWidth,\n currHeight = _ref.height,\n currX = _ref.x,\n currY = _ref.y;\n return /*#__PURE__*/React.createElement(Animate, {\n canBegin: totalLength > 0,\n from: \"0px \".concat(totalLength === -1 ? 1 : totalLength, \"px\"),\n to: \"\".concat(totalLength, \"px 0px\"),\n attributeName: \"strokeDasharray\",\n begin: animationBegin,\n duration: animationDuration,\n easing: animationEasing\n }, /*#__PURE__*/React.createElement(\"path\", _extends({}, filterProps(trapezoidProps, true), {\n className: layerClass,\n d: getTrapezoidPath(currX, currY, currUpperWidth, currLowerWidth, currHeight),\n ref: pathRef\n })));\n });\n};","import _isEqual from \"lodash/isEqual\";\nimport _isBoolean from \"lodash/isBoolean\";\nimport _isPlainObject from \"lodash/isPlainObject\";\nimport _isFunction from \"lodash/isFunction\";\nvar _excluded = [\"option\", \"shapeType\", \"propTransformer\", \"activeClassName\", \"isActive\"];\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport React, { isValidElement, cloneElement } from 'react';\nimport { Rectangle } from '../shape/Rectangle';\nimport { Trapezoid } from '../shape/Trapezoid';\nimport { Sector } from '../shape/Sector';\nimport { Layer } from '../container/Layer';\nimport { Symbols } from '../shape/Symbols';\n\n/**\n * This is an abstraction for rendering a user defined prop for a customized shape in several forms.\n *\n * is the root and will handle taking in:\n * - an object of svg properties\n * - a boolean\n * - a render prop(inline function that returns jsx)\n * - a react element\n *\n * is a subcomponent of and used to match a component\n * to the value of props.shapeType that is passed to the root.\n *\n */\n\nfunction defaultPropTransformer(option, props) {\n return _objectSpread(_objectSpread({}, props), option);\n}\nfunction isSymbolsProps(shapeType, _elementProps) {\n return shapeType === 'symbols';\n}\nfunction ShapeSelector(_ref) {\n var shapeType = _ref.shapeType,\n elementProps = _ref.elementProps;\n switch (shapeType) {\n case 'rectangle':\n return /*#__PURE__*/React.createElement(Rectangle, elementProps);\n case 'trapezoid':\n return /*#__PURE__*/React.createElement(Trapezoid, elementProps);\n case 'sector':\n return /*#__PURE__*/React.createElement(Sector, elementProps);\n case 'symbols':\n if (isSymbolsProps(shapeType, elementProps)) {\n return /*#__PURE__*/React.createElement(Symbols, elementProps);\n }\n break;\n default:\n return null;\n }\n}\nexport function Shape(_ref2) {\n var option = _ref2.option,\n shapeType = _ref2.shapeType,\n _ref2$propTransformer = _ref2.propTransformer,\n propTransformer = _ref2$propTransformer === void 0 ? defaultPropTransformer : _ref2$propTransformer,\n _ref2$activeClassName = _ref2.activeClassName,\n activeClassName = _ref2$activeClassName === void 0 ? 'recharts-active-shape' : _ref2$activeClassName,\n isActive = _ref2.isActive,\n props = _objectWithoutProperties(_ref2, _excluded);\n var shape;\n if ( /*#__PURE__*/isValidElement(option)) {\n shape = /*#__PURE__*/cloneElement(option, props);\n } else if (_isFunction(option)) {\n shape = option(props);\n } else if (_isPlainObject(option) && !_isBoolean(option)) {\n var shapeProps = props;\n var elementProps = propTransformer(option, shapeProps);\n shape = /*#__PURE__*/React.createElement(ShapeSelector, {\n shapeType: shapeType,\n elementProps: elementProps\n });\n } else {\n var _elementProps2 = props;\n shape = /*#__PURE__*/React.createElement(ShapeSelector, {\n shapeType: shapeType,\n elementProps: _elementProps2\n });\n }\n if (isActive) {\n return /*#__PURE__*/React.createElement(Layer, {\n className: activeClassName\n }, shape);\n }\n return shape;\n}\n\n/**\n * This is an abstraction to handle identifying the active index from a tooltip mouse interaction\n */\n\nexport function isFunnel(graphicalItem, _item) {\n return 'trapezoids' in graphicalItem.props;\n}\nexport function isPie(graphicalItem, _item) {\n return 'sectors' in graphicalItem.props;\n}\nexport function isScatter(graphicalItem, _item) {\n return 'points' in graphicalItem.props;\n}\nexport function compareFunnel(shapeData, activeTooltipItem) {\n var _activeTooltipItem$la, _activeTooltipItem$la2;\n var xMatches = shapeData.x === (activeTooltipItem === null || activeTooltipItem === void 0 || (_activeTooltipItem$la = activeTooltipItem.labelViewBox) === null || _activeTooltipItem$la === void 0 ? void 0 : _activeTooltipItem$la.x) || shapeData.x === activeTooltipItem.x;\n var yMatches = shapeData.y === (activeTooltipItem === null || activeTooltipItem === void 0 || (_activeTooltipItem$la2 = activeTooltipItem.labelViewBox) === null || _activeTooltipItem$la2 === void 0 ? void 0 : _activeTooltipItem$la2.y) || shapeData.y === activeTooltipItem.y;\n return xMatches && yMatches;\n}\nexport function comparePie(shapeData, activeTooltipItem) {\n var startAngleMatches = shapeData.endAngle === activeTooltipItem.endAngle;\n var endAngleMatches = shapeData.startAngle === activeTooltipItem.startAngle;\n return startAngleMatches && endAngleMatches;\n}\nexport function compareScatter(shapeData, activeTooltipItem) {\n var xMatches = shapeData.x === activeTooltipItem.x;\n var yMatches = shapeData.y === activeTooltipItem.y;\n var zMatches = shapeData.z === activeTooltipItem.z;\n return xMatches && yMatches && zMatches;\n}\nfunction getComparisonFn(graphicalItem, activeItem) {\n var comparison;\n if (isFunnel(graphicalItem, activeItem)) {\n comparison = compareFunnel;\n } else if (isPie(graphicalItem, activeItem)) {\n comparison = comparePie;\n } else if (isScatter(graphicalItem, activeItem)) {\n comparison = compareScatter;\n }\n return comparison;\n}\nfunction getShapeDataKey(graphicalItem, activeItem) {\n var shapeKey;\n if (isFunnel(graphicalItem, activeItem)) {\n shapeKey = 'trapezoids';\n } else if (isPie(graphicalItem, activeItem)) {\n shapeKey = 'sectors';\n } else if (isScatter(graphicalItem, activeItem)) {\n shapeKey = 'points';\n }\n return shapeKey;\n}\nfunction getActiveShapeTooltipPayload(graphicalItem, activeItem) {\n if (isFunnel(graphicalItem, activeItem)) {\n var _activeItem$tooltipPa;\n return (_activeItem$tooltipPa = activeItem.tooltipPayload) === null || _activeItem$tooltipPa === void 0 || (_activeItem$tooltipPa = _activeItem$tooltipPa[0]) === null || _activeItem$tooltipPa === void 0 || (_activeItem$tooltipPa = _activeItem$tooltipPa.payload) === null || _activeItem$tooltipPa === void 0 ? void 0 : _activeItem$tooltipPa.payload;\n }\n if (isPie(graphicalItem, activeItem)) {\n var _activeItem$tooltipPa2;\n return (_activeItem$tooltipPa2 = activeItem.tooltipPayload) === null || _activeItem$tooltipPa2 === void 0 || (_activeItem$tooltipPa2 = _activeItem$tooltipPa2[0]) === null || _activeItem$tooltipPa2 === void 0 || (_activeItem$tooltipPa2 = _activeItem$tooltipPa2.payload) === null || _activeItem$tooltipPa2 === void 0 ? void 0 : _activeItem$tooltipPa2.payload;\n }\n if (isScatter(graphicalItem, activeItem)) {\n return activeItem.payload;\n }\n return {};\n}\n/**\n *\n * @param {GetActiveShapeIndexForTooltip} arg an object of incoming attributes from Tooltip\n * @returns {number}\n *\n * To handle possible duplicates in the data set,\n * match both the data value of the active item to a data value on a graph item,\n * and match the mouse coordinates of the active item to the coordinates of in a particular components shape data.\n * This assumes equal lengths of shape objects to data items.\n */\nexport function getActiveShapeIndexForTooltip(_ref3) {\n var activeTooltipItem = _ref3.activeTooltipItem,\n graphicalItem = _ref3.graphicalItem,\n itemData = _ref3.itemData;\n var shapeKey = getShapeDataKey(graphicalItem, activeTooltipItem);\n var tooltipPayload = getActiveShapeTooltipPayload(graphicalItem, activeTooltipItem);\n var activeItemMatches = itemData.filter(function (datum, dataIndex) {\n var valuesMatch = _isEqual(tooltipPayload, datum);\n var mouseCoordinateMatches = graphicalItem.props[shapeKey].filter(function (shapeData) {\n var comparison = getComparisonFn(graphicalItem, activeTooltipItem);\n return comparison(shapeData, activeTooltipItem);\n });\n\n // get the last index in case of multiple matches\n var indexOfMouseCoordinates = graphicalItem.props[shapeKey].indexOf(mouseCoordinateMatches[mouseCoordinateMatches.length - 1]);\n var coordinatesMatch = dataIndex === indexOfMouseCoordinates;\n return valuesMatch && coordinatesMatch;\n });\n\n // get the last index in case of multiple matches\n var activeIndex = itemData.indexOf(activeItemMatches[activeItemMatches.length - 1]);\n return activeIndex;\n}","const e10 = Math.sqrt(50),\n e5 = Math.sqrt(10),\n e2 = Math.sqrt(2);\n\nfunction tickSpec(start, stop, count) {\n const step = (stop - start) / Math.max(0, count),\n power = Math.floor(Math.log10(step)),\n error = step / Math.pow(10, power),\n factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;\n let i1, i2, inc;\n if (power < 0) {\n inc = Math.pow(10, -power) / factor;\n i1 = Math.round(start * inc);\n i2 = Math.round(stop * inc);\n if (i1 / inc < start) ++i1;\n if (i2 / inc > stop) --i2;\n inc = -inc;\n } else {\n inc = Math.pow(10, power) * factor;\n i1 = Math.round(start / inc);\n i2 = Math.round(stop / inc);\n if (i1 * inc < start) ++i1;\n if (i2 * inc > stop) --i2;\n }\n if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start, stop, count * 2);\n return [i1, i2, inc];\n}\n\nexport default function ticks(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n if (!(count > 0)) return [];\n if (start === stop) return [start];\n const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);\n if (!(i2 >= i1)) return [];\n const n = i2 - i1 + 1, ticks = new Array(n);\n if (reverse) {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) * inc;\n } else {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) * inc;\n }\n return ticks;\n}\n\nexport function tickIncrement(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n return tickSpec(start, stop, count)[2];\n}\n\nexport function tickStep(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);\n return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);\n}\n","export default function ascending(a, b) {\n return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","export default function descending(a, b) {\n return a == null || b == null ? NaN\n : b < a ? -1\n : b > a ? 1\n : b >= a ? 0\n : NaN;\n}\n","import ascending from \"./ascending.js\";\nimport descending from \"./descending.js\";\n\nexport default function bisector(f) {\n let compare1, compare2, delta;\n\n // If an accessor is specified, promote it to a comparator. In this case we\n // can test whether the search value is (self-) comparable. We can’t do this\n // for a comparator (except for specific, known comparators) because we can’t\n // tell if the comparator is symmetric, and an asymmetric comparator can’t be\n // used to test whether a single value is comparable.\n if (f.length !== 2) {\n compare1 = ascending;\n compare2 = (d, x) => ascending(f(d), x);\n delta = (d, x) => f(d) - x;\n } else {\n compare1 = f === ascending || f === descending ? f : zero;\n compare2 = f;\n delta = f;\n }\n\n function left(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function right(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) <= 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function center(a, x, lo = 0, hi = a.length) {\n const i = left(a, x, lo, hi - 1);\n return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;\n }\n\n return {left, center, right};\n}\n\nfunction zero() {\n return 0;\n}\n","export default function number(x) {\n return x === null ? NaN : +x;\n}\n\nexport function* numbers(values, valueof) {\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n yield value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n yield value;\n }\n }\n }\n}\n","import ascending from \"./ascending.js\";\nimport bisector from \"./bisector.js\";\nimport number from \"./number.js\";\n\nconst ascendingBisect = bisector(ascending);\nexport const bisectRight = ascendingBisect.right;\nexport const bisectLeft = ascendingBisect.left;\nexport const bisectCenter = bisector(number).center;\nexport default bisectRight;\n","export default function(constructor, factory, prototype) {\n constructor.prototype = factory.prototype = prototype;\n prototype.constructor = constructor;\n}\n\nexport function extend(parent, definition) {\n var prototype = Object.create(parent.prototype);\n for (var key in definition) prototype[key] = definition[key];\n return prototype;\n}\n","import define, {extend} from \"./define.js\";\n\nexport function Color() {}\n\nexport var darker = 0.7;\nexport var brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n reN = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n reP = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n reHex = /^#([0-9a-f]{3,8})$/,\n reRgbInteger = new RegExp(`^rgb\\\\(${reI},${reI},${reI}\\\\)$`),\n reRgbPercent = new RegExp(`^rgb\\\\(${reP},${reP},${reP}\\\\)$`),\n reRgbaInteger = new RegExp(`^rgba\\\\(${reI},${reI},${reI},${reN}\\\\)$`),\n reRgbaPercent = new RegExp(`^rgba\\\\(${reP},${reP},${reP},${reN}\\\\)$`),\n reHslPercent = new RegExp(`^hsl\\\\(${reN},${reP},${reP}\\\\)$`),\n reHslaPercent = new RegExp(`^hsla\\\\(${reN},${reP},${reP},${reN}\\\\)$`);\n\nvar named = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n\ndefine(Color, color, {\n copy(channels) {\n return Object.assign(new this.constructor, this, channels);\n },\n displayable() {\n return this.rgb().displayable();\n },\n hex: color_formatHex, // Deprecated! Use color.formatHex.\n formatHex: color_formatHex,\n formatHex8: color_formatHex8,\n formatHsl: color_formatHsl,\n formatRgb: color_formatRgb,\n toString: color_formatRgb\n});\n\nfunction color_formatHex() {\n return this.rgb().formatHex();\n}\n\nfunction color_formatHex8() {\n return this.rgb().formatHex8();\n}\n\nfunction color_formatHsl() {\n return hslConvert(this).formatHsl();\n}\n\nfunction color_formatRgb() {\n return this.rgb().formatRgb();\n}\n\nexport default function color(format) {\n var m, l;\n format = (format + \"\").trim().toLowerCase();\n return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000\n : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00\n : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000\n : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000\n : null) // invalid hex\n : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins\n : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n : null;\n}\n\nfunction rgbn(n) {\n return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n if (a <= 0) r = g = b = NaN;\n return new Rgb(r, g, b, a);\n}\n\nexport function rgbConvert(o) {\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Rgb;\n o = o.rgb();\n return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nexport function rgb(r, g, b, opacity) {\n return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nexport function Rgb(r, g, b, opacity) {\n this.r = +r;\n this.g = +g;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Rgb, rgb, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n rgb() {\n return this;\n },\n clamp() {\n return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));\n },\n displayable() {\n return (-0.5 <= this.r && this.r < 255.5)\n && (-0.5 <= this.g && this.g < 255.5)\n && (-0.5 <= this.b && this.b < 255.5)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n hex: rgb_formatHex, // Deprecated! Use color.formatHex.\n formatHex: rgb_formatHex,\n formatHex8: rgb_formatHex8,\n formatRgb: rgb_formatRgb,\n toString: rgb_formatRgb\n}));\n\nfunction rgb_formatHex() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;\n}\n\nfunction rgb_formatHex8() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;\n}\n\nfunction rgb_formatRgb() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"rgb(\" : \"rgba(\"}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? \")\" : `, ${a})`}`;\n}\n\nfunction clampa(opacity) {\n return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));\n}\n\nfunction clampi(value) {\n return Math.max(0, Math.min(255, Math.round(value) || 0));\n}\n\nfunction hex(value) {\n value = clampi(value);\n return (value < 16 ? \"0\" : \"\") + value.toString(16);\n}\n\nfunction hsla(h, s, l, a) {\n if (a <= 0) h = s = l = NaN;\n else if (l <= 0 || l >= 1) h = s = NaN;\n else if (s <= 0) h = NaN;\n return new Hsl(h, s, l, a);\n}\n\nexport function hslConvert(o) {\n if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Hsl;\n if (o instanceof Hsl) return o;\n o = o.rgb();\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n h = NaN,\n s = max - min,\n l = (max + min) / 2;\n if (s) {\n if (r === max) h = (g - b) / s + (g < b) * 6;\n else if (g === max) h = (b - r) / s + 2;\n else h = (r - g) / s + 4;\n s /= l < 0.5 ? max + min : 2 - max - min;\n h *= 60;\n } else {\n s = l > 0 && l < 1 ? 0 : h;\n }\n return new Hsl(h, s, l, o.opacity);\n}\n\nexport function hsl(h, s, l, opacity) {\n return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Hsl, hsl, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n rgb() {\n var h = this.h % 360 + (this.h < 0) * 360,\n s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n l = this.l,\n m2 = l + (l < 0.5 ? l : 1 - l) * s,\n m1 = 2 * l - m2;\n return new Rgb(\n hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n hsl2rgb(h, m1, m2),\n hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n this.opacity\n );\n },\n clamp() {\n return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));\n },\n displayable() {\n return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n && (0 <= this.l && this.l <= 1)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n formatHsl() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"hsl(\" : \"hsla(\"}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? \")\" : `, ${a})`}`;\n }\n}));\n\nfunction clamph(value) {\n value = (value || 0) % 360;\n return value < 0 ? value + 360 : value;\n}\n\nfunction clampt(value) {\n return Math.max(0, Math.min(1, value || 0));\n}\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n return (h < 60 ? m1 + (m2 - m1) * h / 60\n : h < 180 ? m2\n : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n : m1) * 255;\n}\n","export function basis(t1, v0, v1, v2, v3) {\n var t2 = t1 * t1, t3 = t2 * t1;\n return ((1 - 3 * t1 + 3 * t2 - t3) * v0\n + (4 - 6 * t2 + 3 * t3) * v1\n + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2\n + t3 * v3) / 6;\n}\n\nexport default function(values) {\n var n = values.length - 1;\n return function(t) {\n var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),\n v1 = values[i],\n v2 = values[i + 1],\n v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,\n v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n","export default x => () => x;\n","import constant from \"./constant.js\";\n\nfunction linear(a, d) {\n return function(t) {\n return a + t * d;\n };\n}\n\nfunction exponential(a, b, y) {\n return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n return Math.pow(a + t * b, y);\n };\n}\n\nexport function hue(a, b) {\n var d = b - a;\n return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);\n}\n\nexport function gamma(y) {\n return (y = +y) === 1 ? nogamma : function(a, b) {\n return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);\n };\n}\n\nexport default function nogamma(a, b) {\n var d = b - a;\n return d ? linear(a, d) : constant(isNaN(a) ? b : a);\n}\n","import {rgb as colorRgb} from \"d3-color\";\nimport basis from \"./basis.js\";\nimport basisClosed from \"./basisClosed.js\";\nimport nogamma, {gamma} from \"./color.js\";\n\nexport default (function rgbGamma(y) {\n var color = gamma(y);\n\n function rgb(start, end) {\n var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r),\n g = color(start.g, end.g),\n b = color(start.b, end.b),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.r = r(t);\n start.g = g(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n rgb.gamma = rgbGamma;\n\n return rgb;\n})(1);\n\nfunction rgbSpline(spline) {\n return function(colors) {\n var n = colors.length,\n r = new Array(n),\n g = new Array(n),\n b = new Array(n),\n i, color;\n for (i = 0; i < n; ++i) {\n color = colorRgb(colors[i]);\n r[i] = color.r || 0;\n g[i] = color.g || 0;\n b[i] = color.b || 0;\n }\n r = spline(r);\n g = spline(g);\n b = spline(b);\n color.opacity = 1;\n return function(t) {\n color.r = r(t);\n color.g = g(t);\n color.b = b(t);\n return color + \"\";\n };\n };\n}\n\nexport var rgbBasis = rgbSpline(basis);\nexport var rgbBasisClosed = rgbSpline(basisClosed);\n","import {basis} from \"./basis.js\";\n\nexport default function(values) {\n var n = values.length;\n return function(t) {\n var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),\n v0 = values[(i + n - 1) % n],\n v1 = values[i % n],\n v2 = values[(i + 1) % n],\n v3 = values[(i + 2) % n];\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n}\n","import value from \"./value.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n return (isNumberArray(b) ? numberArray : genericArray)(a, b);\n}\n\nexport function genericArray(a, b) {\n var nb = b ? b.length : 0,\n na = a ? Math.min(nb, a.length) : 0,\n x = new Array(na),\n c = new Array(nb),\n i;\n\n for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);\n for (; i < nb; ++i) c[i] = b[i];\n\n return function(t) {\n for (i = 0; i < na; ++i) c[i] = x[i](t);\n return c;\n };\n}\n","export default function(a, b) {\n var d = new Date;\n return a = +a, b = +b, function(t) {\n return d.setTime(a * (1 - t) + b * t), d;\n };\n}\n","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return a * (1 - t) + b * t;\n };\n}\n","import value from \"./value.js\";\n\nexport default function(a, b) {\n var i = {},\n c = {},\n k;\n\n if (a === null || typeof a !== \"object\") a = {};\n if (b === null || typeof b !== \"object\") b = {};\n\n for (k in b) {\n if (k in a) {\n i[k] = value(a[k], b[k]);\n } else {\n c[k] = b[k];\n }\n }\n\n return function(t) {\n for (k in i) c[k] = i[k](t);\n return c;\n };\n}\n","import number from \"./number.js\";\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n return function() {\n return b;\n };\n}\n\nfunction one(b) {\n return function(t) {\n return b(t) + \"\";\n };\n}\n\nexport default function(a, b) {\n var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n am, // current match in a\n bm, // current match in b\n bs, // string preceding current number in b, if any\n i = -1, // index in s\n s = [], // string constants and placeholders\n q = []; // number interpolators\n\n // Coerce inputs to strings.\n a = a + \"\", b = b + \"\";\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a))\n && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) { // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n if (s[i]) s[i] += bm; // coalesce with previous string\n else s[++i] = bm;\n } else { // interpolate non-matching numbers\n s[++i] = null;\n q.push({i: i, x: number(am, bm)});\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2 ? (q[0]\n ? one(q[0].x)\n : zero(b))\n : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n });\n}\n","export default function(a, b) {\n if (!b) b = [];\n var n = a ? Math.min(b.length, a.length) : 0,\n c = b.slice(),\n i;\n return function(t) {\n for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;\n return c;\n };\n}\n\nexport function isNumberArray(x) {\n return ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n","import {color} from \"d3-color\";\nimport rgb from \"./rgb.js\";\nimport {genericArray} from \"./array.js\";\nimport date from \"./date.js\";\nimport number from \"./number.js\";\nimport object from \"./object.js\";\nimport string from \"./string.js\";\nimport constant from \"./constant.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n var t = typeof b, c;\n return b == null || t === \"boolean\" ? constant(b)\n : (t === \"number\" ? number\n : t === \"string\" ? ((c = color(b)) ? (b = c, rgb) : string)\n : b instanceof color ? rgb\n : b instanceof Date ? date\n : isNumberArray(b) ? numberArray\n : Array.isArray(b) ? genericArray\n : typeof b.valueOf !== \"function\" && typeof b.toString !== \"function\" || isNaN(b) ? object\n : number)(a, b);\n}\n","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return Math.round(a * (1 - t) + b * t);\n };\n}\n","export default function number(x) {\n return +x;\n}\n","import {bisect} from \"d3-array\";\nimport {interpolate as interpolateValue, interpolateNumber, interpolateRound} from \"d3-interpolate\";\nimport constant from \"./constant.js\";\nimport number from \"./number.js\";\n\nvar unit = [0, 1];\n\nexport function identity(x) {\n return x;\n}\n\nfunction normalize(a, b) {\n return (b -= (a = +a))\n ? function(x) { return (x - a) / b; }\n : constant(isNaN(b) ? NaN : 0.5);\n}\n\nfunction clamper(a, b) {\n var t;\n if (a > b) t = a, a = b, b = t;\n return function(x) { return Math.max(a, Math.min(b, x)); };\n}\n\n// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].\n// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].\nfunction bimap(domain, range, interpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);\n else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n}\n\nfunction polymap(domain, range, interpolate) {\n var j = Math.min(domain.length, range.length) - 1,\n d = new Array(j),\n r = new Array(j),\n i = -1;\n\n // Reverse descending domains.\n if (domain[j] < domain[0]) {\n domain = domain.slice().reverse();\n range = range.slice().reverse();\n }\n\n while (++i < j) {\n d[i] = normalize(domain[i], domain[i + 1]);\n r[i] = interpolate(range[i], range[i + 1]);\n }\n\n return function(x) {\n var i = bisect(domain, x, 1, j) - 1;\n return r[i](d[i](x));\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .range(source.range())\n .interpolate(source.interpolate())\n .clamp(source.clamp())\n .unknown(source.unknown());\n}\n\nexport function transformer() {\n var domain = unit,\n range = unit,\n interpolate = interpolateValue,\n transform,\n untransform,\n unknown,\n clamp = identity,\n piecewise,\n output,\n input;\n\n function rescale() {\n var n = Math.min(domain.length, range.length);\n if (clamp !== identity) clamp = clamper(domain[0], domain[n - 1]);\n piecewise = n > 2 ? polymap : bimap;\n output = input = null;\n return scale;\n }\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate)))(transform(clamp(x)));\n }\n\n scale.invert = function(y) {\n return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return range = Array.from(_), interpolate = interpolateRound, rescale();\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = _ ? true : identity, rescale()) : clamp !== identity;\n };\n\n scale.interpolate = function(_) {\n return arguments.length ? (interpolate = _, rescale()) : interpolate;\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t, u) {\n transform = t, untransform = u;\n return rescale();\n };\n}\n\nexport default function continuous() {\n return transformer()(identity, identity);\n}\n","export default function constants(x) {\n return function() {\n return x;\n };\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport var prefixExponent;\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1],\n i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,\n n = coefficient.length;\n return i === n ? coefficient\n : i > n ? coefficient + new Array(i - n + 1).join(\"0\")\n : i > 0 ? coefficient.slice(0, i) + \".\" + coefficient.slice(i)\n : \"0.\" + new Array(1 - i).join(\"0\") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!\n}\n","// [[fill]align][sign][symbol][0][width][,][.precision][~][type]\nvar re = /^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;\n\nexport default function formatSpecifier(specifier) {\n if (!(match = re.exec(specifier))) throw new Error(\"invalid format: \" + specifier);\n var match;\n return new FormatSpecifier({\n fill: match[1],\n align: match[2],\n sign: match[3],\n symbol: match[4],\n zero: match[5],\n width: match[6],\n comma: match[7],\n precision: match[8] && match[8].slice(1),\n trim: match[9],\n type: match[10]\n });\n}\n\nformatSpecifier.prototype = FormatSpecifier.prototype; // instanceof\n\nexport function FormatSpecifier(specifier) {\n this.fill = specifier.fill === undefined ? \" \" : specifier.fill + \"\";\n this.align = specifier.align === undefined ? \">\" : specifier.align + \"\";\n this.sign = specifier.sign === undefined ? \"-\" : specifier.sign + \"\";\n this.symbol = specifier.symbol === undefined ? \"\" : specifier.symbol + \"\";\n this.zero = !!specifier.zero;\n this.width = specifier.width === undefined ? undefined : +specifier.width;\n this.comma = !!specifier.comma;\n this.precision = specifier.precision === undefined ? undefined : +specifier.precision;\n this.trim = !!specifier.trim;\n this.type = specifier.type === undefined ? \"\" : specifier.type + \"\";\n}\n\nFormatSpecifier.prototype.toString = function() {\n return this.fill\n + this.align\n + this.sign\n + this.symbol\n + (this.zero ? \"0\" : \"\")\n + (this.width === undefined ? \"\" : Math.max(1, this.width | 0))\n + (this.comma ? \",\" : \"\")\n + (this.precision === undefined ? \"\" : \".\" + Math.max(0, this.precision | 0))\n + (this.trim ? \"~\" : \"\")\n + this.type;\n};\n","export default function(x) {\n return Math.abs(x = Math.round(x)) >= 1e21\n ? x.toLocaleString(\"en\").replace(/,/g, \"\")\n : x.toString(10);\n}\n\n// Computes the decimal coefficient and exponent of the specified number x with\n// significant digits p, where x is positive and p is in [1, 21] or undefined.\n// For example, formatDecimalParts(1.23) returns [\"123\", 0].\nexport function formatDecimalParts(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x) {\n return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1];\n return exponent < 0 ? \"0.\" + new Array(-exponent).join(\"0\") + coefficient\n : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + \".\" + coefficient.slice(exponent + 1)\n : coefficient + new Array(exponent - coefficient.length + 2).join(\"0\");\n}\n","import formatDecimal from \"./formatDecimal.js\";\nimport formatPrefixAuto from \"./formatPrefixAuto.js\";\nimport formatRounded from \"./formatRounded.js\";\n\nexport default {\n \"%\": (x, p) => (x * 100).toFixed(p),\n \"b\": (x) => Math.round(x).toString(2),\n \"c\": (x) => x + \"\",\n \"d\": formatDecimal,\n \"e\": (x, p) => x.toExponential(p),\n \"f\": (x, p) => x.toFixed(p),\n \"g\": (x, p) => x.toPrecision(p),\n \"o\": (x) => Math.round(x).toString(8),\n \"p\": (x, p) => formatRounded(x * 100, p),\n \"r\": formatRounded,\n \"s\": formatPrefixAuto,\n \"X\": (x) => Math.round(x).toString(16).toUpperCase(),\n \"x\": (x) => Math.round(x).toString(16)\n};\n","export default function(x) {\n return x;\n}\n","import exponent from \"./exponent.js\";\nimport formatGroup from \"./formatGroup.js\";\nimport formatNumerals from \"./formatNumerals.js\";\nimport formatSpecifier from \"./formatSpecifier.js\";\nimport formatTrim from \"./formatTrim.js\";\nimport formatTypes from \"./formatTypes.js\";\nimport {prefixExponent} from \"./formatPrefixAuto.js\";\nimport identity from \"./identity.js\";\n\nvar map = Array.prototype.map,\n prefixes = [\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"µ\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];\n\nexport default function(locale) {\n var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + \"\"),\n currencyPrefix = locale.currency === undefined ? \"\" : locale.currency[0] + \"\",\n currencySuffix = locale.currency === undefined ? \"\" : locale.currency[1] + \"\",\n decimal = locale.decimal === undefined ? \".\" : locale.decimal + \"\",\n numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),\n percent = locale.percent === undefined ? \"%\" : locale.percent + \"\",\n minus = locale.minus === undefined ? \"−\" : locale.minus + \"\",\n nan = locale.nan === undefined ? \"NaN\" : locale.nan + \"\";\n\n function newFormat(specifier) {\n specifier = formatSpecifier(specifier);\n\n var fill = specifier.fill,\n align = specifier.align,\n sign = specifier.sign,\n symbol = specifier.symbol,\n zero = specifier.zero,\n width = specifier.width,\n comma = specifier.comma,\n precision = specifier.precision,\n trim = specifier.trim,\n type = specifier.type;\n\n // The \"n\" type is an alias for \",g\".\n if (type === \"n\") comma = true, type = \"g\";\n\n // The \"\" type, and any invalid type, is an alias for \".12~g\".\n else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = \"g\";\n\n // If zero fill is specified, padding goes after sign and before digits.\n if (zero || (fill === \"0\" && align === \"=\")) zero = true, fill = \"0\", align = \"=\";\n\n // Compute the prefix and suffix.\n // For SI-prefix, the suffix is lazily computed.\n var prefix = symbol === \"$\" ? currencyPrefix : symbol === \"#\" && /[boxX]/.test(type) ? \"0\" + type.toLowerCase() : \"\",\n suffix = symbol === \"$\" ? currencySuffix : /[%p]/.test(type) ? percent : \"\";\n\n // What format function should we use?\n // Is this an integer type?\n // Can this type generate exponential notation?\n var formatType = formatTypes[type],\n maybeSuffix = /[defgprs%]/.test(type);\n\n // Set the default precision if not specified,\n // or clamp the specified precision to the supported range.\n // For significant precision, it must be in [1, 21].\n // For fixed precision, it must be in [0, 20].\n precision = precision === undefined ? 6\n : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))\n : Math.max(0, Math.min(20, precision));\n\n function format(value) {\n var valuePrefix = prefix,\n valueSuffix = suffix,\n i, n, c;\n\n if (type === \"c\") {\n valueSuffix = formatType(value) + valueSuffix;\n value = \"\";\n } else {\n value = +value;\n\n // Determine the sign. -0 is not less than 0, but 1 / -0 is!\n var valueNegative = value < 0 || 1 / value < 0;\n\n // Perform the initial formatting.\n value = isNaN(value) ? nan : formatType(Math.abs(value), precision);\n\n // Trim insignificant zeros.\n if (trim) value = formatTrim(value);\n\n // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.\n if (valueNegative && +value === 0 && sign !== \"+\") valueNegative = false;\n\n // Compute the prefix and suffix.\n valuePrefix = (valueNegative ? (sign === \"(\" ? sign : minus) : sign === \"-\" || sign === \"(\" ? \"\" : sign) + valuePrefix;\n valueSuffix = (type === \"s\" ? prefixes[8 + prefixExponent / 3] : \"\") + valueSuffix + (valueNegative && sign === \"(\" ? \")\" : \"\");\n\n // Break the formatted value into the integer “value” part that can be\n // grouped, and fractional or exponential “suffix” part that is not.\n if (maybeSuffix) {\n i = -1, n = value.length;\n while (++i < n) {\n if (c = value.charCodeAt(i), 48 > c || c > 57) {\n valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;\n value = value.slice(0, i);\n break;\n }\n }\n }\n }\n\n // If the fill character is not \"0\", grouping is applied before padding.\n if (comma && !zero) value = group(value, Infinity);\n\n // Compute the padding.\n var length = valuePrefix.length + value.length + valueSuffix.length,\n padding = length < width ? new Array(width - length + 1).join(fill) : \"\";\n\n // If the fill character is \"0\", grouping is applied after padding.\n if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = \"\";\n\n // Reconstruct the final output based on the desired alignment.\n switch (align) {\n case \"<\": value = valuePrefix + value + valueSuffix + padding; break;\n case \"=\": value = valuePrefix + padding + value + valueSuffix; break;\n case \"^\": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;\n default: value = padding + valuePrefix + value + valueSuffix; break;\n }\n\n return numerals(value);\n }\n\n format.toString = function() {\n return specifier + \"\";\n };\n\n return format;\n }\n\n function formatPrefix(specifier, value) {\n var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = \"f\", specifier)),\n e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,\n k = Math.pow(10, -e),\n prefix = prefixes[8 + e / 3];\n return function(value) {\n return f(k * value) + prefix;\n };\n }\n\n return {\n format: newFormat,\n formatPrefix: formatPrefix\n };\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var format;\nexport var formatPrefix;\n\ndefaultLocale({\n thousands: \",\",\n grouping: [3],\n currency: [\"$\", \"\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n format = locale.format;\n formatPrefix = locale.formatPrefix;\n return locale;\n}\n","export default function(grouping, thousands) {\n return function(value, width) {\n var i = value.length,\n t = [],\n j = 0,\n g = grouping[0],\n length = 0;\n\n while (i > 0 && g > 0) {\n if (length + g + 1 > width) g = Math.max(1, width - length);\n t.push(value.substring(i -= g, i + g));\n if ((length += g + 1) > width) break;\n g = grouping[j = (j + 1) % grouping.length];\n }\n\n return t.reverse().join(thousands);\n };\n}\n","export default function(numerals) {\n return function(value) {\n return value.replace(/[0-9]/g, function(i) {\n return numerals[+i];\n });\n };\n}\n","// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.\nexport default function(s) {\n out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {\n switch (s[i]) {\n case \".\": i0 = i1 = i; break;\n case \"0\": if (i0 === 0) i0 = i; i1 = i; break;\n default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break;\n }\n }\n return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;\n}\n","import {tickStep} from \"d3-array\";\nimport {format, formatPrefix, formatSpecifier, precisionFixed, precisionPrefix, precisionRound} from \"d3-format\";\n\nexport default function tickFormat(start, stop, count, specifier) {\n var step = tickStep(start, stop, count),\n precision;\n specifier = formatSpecifier(specifier == null ? \",f\" : specifier);\n switch (specifier.type) {\n case \"s\": {\n var value = Math.max(Math.abs(start), Math.abs(stop));\n if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;\n return formatPrefix(specifier, value);\n }\n case \"\":\n case \"e\":\n case \"g\":\n case \"p\":\n case \"r\": {\n if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === \"e\");\n break;\n }\n case \"f\":\n case \"%\": {\n if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === \"%\") * 2;\n break;\n }\n }\n return format(specifier);\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, value) {\n return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, max) {\n step = Math.abs(step), max = Math.abs(max) - step;\n return Math.max(0, exponent(max) - exponent(step)) + 1;\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step) {\n return Math.max(0, -exponent(Math.abs(step)));\n}\n","import {ticks, tickIncrement} from \"d3-array\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport tickFormat from \"./tickFormat.js\";\n\nexport function linearish(scale) {\n var domain = scale.domain;\n\n scale.ticks = function(count) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], count == null ? 10 : count);\n };\n\n scale.tickFormat = function(count, specifier) {\n var d = domain();\n return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);\n };\n\n scale.nice = function(count) {\n if (count == null) count = 10;\n\n var d = domain();\n var i0 = 0;\n var i1 = d.length - 1;\n var start = d[i0];\n var stop = d[i1];\n var prestep;\n var step;\n var maxIter = 10;\n\n if (stop < start) {\n step = start, start = stop, stop = step;\n step = i0, i0 = i1, i1 = step;\n }\n \n while (maxIter-- > 0) {\n step = tickIncrement(start, stop, count);\n if (step === prestep) {\n d[i0] = start\n d[i1] = stop\n return domain(d);\n } else if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n } else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n } else {\n break;\n }\n prestep = step;\n }\n\n return scale;\n };\n\n return scale;\n}\n\nexport default function linear() {\n var scale = continuous();\n\n scale.copy = function() {\n return copy(scale, linear());\n };\n\n initRange.apply(scale, arguments);\n\n return linearish(scale);\n}\n","import {linearish} from \"./linear.js\";\nimport number from \"./number.js\";\n\nexport default function identity(domain) {\n var unknown;\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : x;\n }\n\n scale.invert = scale;\n\n scale.domain = scale.range = function(_) {\n return arguments.length ? (domain = Array.from(_, number), scale) : domain.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return identity(domain).unknown(unknown);\n };\n\n domain = arguments.length ? Array.from(domain, number) : [0, 1];\n\n return linearish(scale);\n}\n","export default function nice(domain, interval) {\n domain = domain.slice();\n\n var i0 = 0,\n i1 = domain.length - 1,\n x0 = domain[i0],\n x1 = domain[i1],\n t;\n\n if (x1 < x0) {\n t = i0, i0 = i1, i1 = t;\n t = x0, x0 = x1, x1 = t;\n }\n\n domain[i0] = interval.floor(x0);\n domain[i1] = interval.ceil(x1);\n return domain;\n}\n","import {ticks} from \"d3-array\";\nimport {format, formatSpecifier} from \"d3-format\";\nimport nice from \"./nice.js\";\nimport {copy, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformLog(x) {\n return Math.log(x);\n}\n\nfunction transformExp(x) {\n return Math.exp(x);\n}\n\nfunction transformLogn(x) {\n return -Math.log(-x);\n}\n\nfunction transformExpn(x) {\n return -Math.exp(-x);\n}\n\nfunction pow10(x) {\n return isFinite(x) ? +(\"1e\" + x) : x < 0 ? 0 : x;\n}\n\nfunction powp(base) {\n return base === 10 ? pow10\n : base === Math.E ? Math.exp\n : x => Math.pow(base, x);\n}\n\nfunction logp(base) {\n return base === Math.E ? Math.log\n : base === 10 && Math.log10\n || base === 2 && Math.log2\n || (base = Math.log(base), x => Math.log(x) / base);\n}\n\nfunction reflect(f) {\n return (x, k) => -f(-x, k);\n}\n\nexport function loggish(transform) {\n const scale = transform(transformLog, transformExp);\n const domain = scale.domain;\n let base = 10;\n let logs;\n let pows;\n\n function rescale() {\n logs = logp(base), pows = powp(base);\n if (domain()[0] < 0) {\n logs = reflect(logs), pows = reflect(pows);\n transform(transformLogn, transformExpn);\n } else {\n transform(transformLog, transformExp);\n }\n return scale;\n }\n\n scale.base = function(_) {\n return arguments.length ? (base = +_, rescale()) : base;\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.ticks = count => {\n const d = domain();\n let u = d[0];\n let v = d[d.length - 1];\n const r = v < u;\n\n if (r) ([u, v] = [v, u]);\n\n let i = logs(u);\n let j = logs(v);\n let k;\n let t;\n const n = count == null ? 10 : +count;\n let z = [];\n\n if (!(base % 1) && j - i < n) {\n i = Math.floor(i), j = Math.ceil(j);\n if (u > 0) for (; i <= j; ++i) {\n for (k = 1; k < base; ++k) {\n t = i < 0 ? k / pows(-i) : k * pows(i);\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n } else for (; i <= j; ++i) {\n for (k = base - 1; k >= 1; --k) {\n t = i > 0 ? k / pows(-i) : k * pows(i);\n if (t < u) continue;\n if (t > v) break;\n z.push(t);\n }\n }\n if (z.length * 2 < n) z = ticks(u, v, n);\n } else {\n z = ticks(i, j, Math.min(j - i, n)).map(pows);\n }\n return r ? z.reverse() : z;\n };\n\n scale.tickFormat = (count, specifier) => {\n if (count == null) count = 10;\n if (specifier == null) specifier = base === 10 ? \"s\" : \",\";\n if (typeof specifier !== \"function\") {\n if (!(base % 1) && (specifier = formatSpecifier(specifier)).precision == null) specifier.trim = true;\n specifier = format(specifier);\n }\n if (count === Infinity) return specifier;\n const k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?\n return d => {\n let i = d / pows(Math.round(logs(d)));\n if (i * base < base - 0.5) i *= base;\n return i <= k ? specifier(d) : \"\";\n };\n };\n\n scale.nice = () => {\n return domain(nice(domain(), {\n floor: x => pows(Math.floor(logs(x))),\n ceil: x => pows(Math.ceil(logs(x)))\n }));\n };\n\n return scale;\n}\n\nexport default function log() {\n const scale = loggish(transformer()).domain([1, 10]);\n scale.copy = () => copy(scale, log()).base(scale.base());\n initRange.apply(scale, arguments);\n return scale;\n}\n","import {linearish} from \"./linear.js\";\nimport {copy, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformSymlog(c) {\n return function(x) {\n return Math.sign(x) * Math.log1p(Math.abs(x / c));\n };\n}\n\nfunction transformSymexp(c) {\n return function(x) {\n return Math.sign(x) * Math.expm1(Math.abs(x)) * c;\n };\n}\n\nexport function symlogish(transform) {\n var c = 1, scale = transform(transformSymlog(c), transformSymexp(c));\n\n scale.constant = function(_) {\n return arguments.length ? transform(transformSymlog(c = +_), transformSymexp(c)) : c;\n };\n\n return linearish(scale);\n}\n\nexport default function symlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, symlog()).constant(scale.constant());\n };\n\n return initRange.apply(scale, arguments);\n}\n","import {linearish} from \"./linear.js\";\nimport {copy, identity, transformer} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\n\nfunction transformPow(exponent) {\n return function(x) {\n return x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\n };\n}\n\nfunction transformSqrt(x) {\n return x < 0 ? -Math.sqrt(-x) : Math.sqrt(x);\n}\n\nfunction transformSquare(x) {\n return x < 0 ? -x * x : x * x;\n}\n\nexport function powish(transform) {\n var scale = transform(identity, identity),\n exponent = 1;\n\n function rescale() {\n return exponent === 1 ? transform(identity, identity)\n : exponent === 0.5 ? transform(transformSqrt, transformSquare)\n : transform(transformPow(exponent), transformPow(1 / exponent));\n }\n\n scale.exponent = function(_) {\n return arguments.length ? (exponent = +_, rescale()) : exponent;\n };\n\n return linearish(scale);\n}\n\nexport default function pow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, pow()).exponent(scale.exponent());\n };\n\n initRange.apply(scale, arguments);\n\n return scale;\n}\n\nexport function sqrt() {\n return pow.apply(null, arguments).exponent(0.5);\n}\n","import continuous from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport {linearish} from \"./linear.js\";\nimport number from \"./number.js\";\n\nfunction square(x) {\n return Math.sign(x) * x * x;\n}\n\nfunction unsquare(x) {\n return Math.sign(x) * Math.sqrt(Math.abs(x));\n}\n\nexport default function radial() {\n var squared = continuous(),\n range = [0, 1],\n round = false,\n unknown;\n\n function scale(x) {\n var y = unsquare(squared(x));\n return isNaN(y) ? unknown : round ? Math.round(y) : y;\n }\n\n scale.invert = function(y) {\n return squared.invert(square(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? (squared.domain(_), scale) : squared.domain();\n };\n\n scale.range = function(_) {\n return arguments.length ? (squared.range((range = Array.from(_, number)).map(square)), scale) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return scale.range(_).round(true);\n };\n\n scale.round = function(_) {\n return arguments.length ? (round = !!_, scale) : round;\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (squared.clamp(_), scale) : squared.clamp();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return radial(squared.domain(), range)\n .round(round)\n .clamp(squared.clamp())\n .unknown(unknown);\n };\n\n initRange.apply(scale, arguments);\n\n return linearish(scale);\n}\n","export default function max(values, valueof) {\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n }\n return max;\n}\n","export default function min(values, valueof) {\n let min;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n }\n return min;\n}\n","import ascending from \"./ascending.js\";\nimport permute from \"./permute.js\";\n\nexport default function sort(values, ...F) {\n if (typeof values[Symbol.iterator] !== \"function\") throw new TypeError(\"values is not iterable\");\n values = Array.from(values);\n let [f] = F;\n if ((f && f.length !== 2) || F.length > 1) {\n const index = Uint32Array.from(values, (d, i) => i);\n if (F.length > 1) {\n F = F.map(f => values.map(f));\n index.sort((i, j) => {\n for (const f of F) {\n const c = ascendingDefined(f[i], f[j]);\n if (c) return c;\n }\n });\n } else {\n f = values.map(f);\n index.sort((i, j) => ascendingDefined(f[i], f[j]));\n }\n return permute(values, index);\n }\n return values.sort(compareDefined(f));\n}\n\nexport function compareDefined(compare = ascending) {\n if (compare === ascending) return ascendingDefined;\n if (typeof compare !== \"function\") throw new TypeError(\"compare is not a function\");\n return (a, b) => {\n const x = compare(a, b);\n if (x || x === 0) return x;\n return (compare(b, b) === 0) - (compare(a, a) === 0);\n };\n}\n\nexport function ascendingDefined(a, b) {\n return (a == null || !(a >= a)) - (b == null || !(b >= b)) || (a < b ? -1 : a > b ? 1 : 0);\n}\n","import {ascendingDefined, compareDefined} from \"./sort.js\";\n\n// Based on https://github.com/mourner/quickselect\n// ISC license, Copyright 2018 Vladimir Agafonkin.\nexport default function quickselect(array, k, left = 0, right = Infinity, compare) {\n k = Math.floor(k);\n left = Math.floor(Math.max(0, left));\n right = Math.floor(Math.min(array.length - 1, right));\n\n if (!(left <= k && k <= right)) return array;\n\n compare = compare === undefined ? ascendingDefined : compareDefined(compare);\n\n while (right > left) {\n if (right - left > 600) {\n const n = right - left + 1;\n const m = k - left + 1;\n const z = Math.log(n);\n const s = 0.5 * Math.exp(2 * z / 3);\n const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n quickselect(array, k, newLeft, newRight, compare);\n }\n\n const t = array[k];\n let i = left;\n let j = right;\n\n swap(array, left, k);\n if (compare(array[right], t) > 0) swap(array, left, right);\n\n while (i < j) {\n swap(array, i, j), ++i, --j;\n while (compare(array[i], t) < 0) ++i;\n while (compare(array[j], t) > 0) --j;\n }\n\n if (compare(array[left], t) === 0) swap(array, left, j);\n else ++j, swap(array, j, right);\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n\n return array;\n}\n\nfunction swap(array, i, j) {\n const t = array[i];\n array[i] = array[j];\n array[j] = t;\n}\n","import max from \"./max.js\";\nimport maxIndex from \"./maxIndex.js\";\nimport min from \"./min.js\";\nimport minIndex from \"./minIndex.js\";\nimport quickselect from \"./quickselect.js\";\nimport number, {numbers} from \"./number.js\";\nimport {ascendingDefined} from \"./sort.js\";\nimport greatest from \"./greatest.js\";\n\nexport default function quantile(values, p, valueof) {\n values = Float64Array.from(numbers(values, valueof));\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return min(values);\n if (p >= 1) return max(values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = max(quickselect(values, i0).subarray(0, i0 + 1)),\n value1 = min(values.subarray(i0 + 1));\n return value0 + (value1 - value0) * (i - i0);\n}\n\nexport function quantileSorted(values, p, valueof = number) {\n if (!(n = values.length) || isNaN(p = +p)) return;\n if (p <= 0 || n < 2) return +valueof(values[0], 0, values);\n if (p >= 1) return +valueof(values[n - 1], n - 1, values);\n var n,\n i = (n - 1) * p,\n i0 = Math.floor(i),\n value0 = +valueof(values[i0], i0, values),\n value1 = +valueof(values[i0 + 1], i0 + 1, values);\n return value0 + (value1 - value0) * (i - i0);\n}\n\nexport function quantileIndex(values, p, valueof = number) {\n if (isNaN(p = +p)) return;\n numbers = Float64Array.from(values, (_, i) => number(valueof(values[i], i, values)));\n if (p <= 0) return minIndex(numbers);\n if (p >= 1) return maxIndex(numbers);\n var numbers,\n index = Uint32Array.from(values, (_, i) => i),\n j = numbers.length - 1,\n i = Math.floor(j * p);\n quickselect(index, i, 0, j, (i, j) => ascendingDefined(numbers[i], numbers[j]));\n i = greatest(index.subarray(0, i + 1), (i) => numbers[i]);\n return i >= 0 ? i : -1;\n}\n","import {ascending, bisect, quantileSorted as threshold} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport default function quantile() {\n var domain = [],\n range = [],\n thresholds = [],\n unknown;\n\n function rescale() {\n var i = 0, n = Math.max(1, range.length);\n thresholds = new Array(n - 1);\n while (++i < n) thresholds[i - 1] = threshold(domain, i / n);\n return scale;\n }\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : range[bisect(thresholds, x)];\n }\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN] : [\n i > 0 ? thresholds[i - 1] : domain[0],\n i < thresholds.length ? thresholds[i] : domain[domain.length - 1]\n ];\n };\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [];\n for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d);\n domain.sort(ascending);\n return rescale();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.quantiles = function() {\n return thresholds.slice();\n };\n\n scale.copy = function() {\n return quantile()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(scale, arguments);\n}\n","import {bisect} from \"d3-array\";\nimport {linearish} from \"./linear.js\";\nimport {initRange} from \"./init.js\";\n\nexport default function quantize() {\n var x0 = 0,\n x1 = 1,\n n = 1,\n domain = [0.5],\n range = [0, 1],\n unknown;\n\n function scale(x) {\n return x != null && x <= x ? range[bisect(domain, x, 0, n)] : unknown;\n }\n\n function rescale() {\n var i = -1;\n domain = new Array(n);\n while (++i < n) domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1);\n return scale;\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1] = _, x0 = +x0, x1 = +x1, rescale()) : [x0, x1];\n };\n\n scale.range = function(_) {\n return arguments.length ? (n = (range = Array.from(_)).length - 1, rescale()) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return i < 0 ? [NaN, NaN]\n : i < 1 ? [x0, domain[0]]\n : i >= n ? [domain[n - 1], x1]\n : [domain[i - 1], domain[i]];\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : scale;\n };\n\n scale.thresholds = function() {\n return domain.slice();\n };\n\n scale.copy = function() {\n return quantize()\n .domain([x0, x1])\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(linearish(scale), arguments);\n}\n","import {bisect} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport default function threshold() {\n var domain = [0.5],\n range = [0, 1],\n unknown,\n n = 1;\n\n function scale(x) {\n return x != null && x <= x ? range[bisect(domain, x, 0, n)] : unknown;\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice();\n };\n\n scale.invertExtent = function(y) {\n var i = range.indexOf(y);\n return [domain[i - 1], domain[i]];\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return threshold()\n .domain(domain)\n .range(range)\n .unknown(unknown);\n };\n\n return initRange.apply(scale, arguments);\n}\n","export const durationSecond = 1000;\nexport const durationMinute = durationSecond * 60;\nexport const durationHour = durationMinute * 60;\nexport const durationDay = durationHour * 24;\nexport const durationWeek = durationDay * 7;\nexport const durationMonth = durationDay * 30;\nexport const durationYear = durationDay * 365;\n","const t0 = new Date, t1 = new Date;\n\nexport function timeInterval(floori, offseti, count, field) {\n\n function interval(date) {\n return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;\n }\n\n interval.floor = (date) => {\n return floori(date = new Date(+date)), date;\n };\n\n interval.ceil = (date) => {\n return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n };\n\n interval.round = (date) => {\n const d0 = interval(date), d1 = interval.ceil(date);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.offset = (date, step) => {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = (start, stop, step) => {\n const range = [];\n start = interval.ceil(start);\n step = step == null ? 1 : Math.floor(step);\n if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n let previous;\n do range.push(previous = new Date(+start)), offseti(start, step), floori(start);\n while (previous < start && start < stop);\n return range;\n };\n\n interval.filter = (test) => {\n return timeInterval((date) => {\n if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n }, (date, step) => {\n if (date >= date) {\n if (step < 0) while (++step <= 0) {\n while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty\n } else while (--step >= 0) {\n while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty\n }\n }\n });\n };\n\n if (count) {\n interval.count = (start, end) => {\n t0.setTime(+start), t1.setTime(+end);\n floori(t0), floori(t1);\n return Math.floor(count(t0, t1));\n };\n\n interval.every = (step) => {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? (d) => field(d) % step === 0\n : (d) => interval.count(0, d) % step === 0);\n };\n }\n\n return interval;\n}\n","import {timeInterval} from \"./interval.js\";\n\nexport const millisecond = timeInterval(() => {\n // noop\n}, (date, step) => {\n date.setTime(+date + step);\n}, (start, end) => {\n return end - start;\n});\n\n// An optimized implementation for this simple case.\nmillisecond.every = (k) => {\n k = Math.floor(k);\n if (!isFinite(k) || !(k > 0)) return null;\n if (!(k > 1)) return millisecond;\n return timeInterval((date) => {\n date.setTime(Math.floor(date / k) * k);\n }, (date, step) => {\n date.setTime(+date + step * k);\n }, (start, end) => {\n return (end - start) / k;\n });\n};\n\nexport const milliseconds = millisecond.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationSecond} from \"./duration.js\";\n\nexport const second = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds());\n}, (date, step) => {\n date.setTime(+date + step * durationSecond);\n}, (start, end) => {\n return (end - start) / durationSecond;\n}, (date) => {\n return date.getUTCSeconds();\n});\n\nexport const seconds = second.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeMinute = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getMinutes();\n});\n\nexport const timeMinutes = timeMinute.range;\n\nexport const utcMinute = timeInterval((date) => {\n date.setUTCSeconds(0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getUTCMinutes();\n});\n\nexport const utcMinutes = utcMinute.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationHour, durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeHour = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getHours();\n});\n\nexport const timeHours = timeHour.range;\n\nexport const utcHour = timeInterval((date) => {\n date.setUTCMinutes(0, 0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getUTCHours();\n});\n\nexport const utcHours = utcHour.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationDay, durationMinute} from \"./duration.js\";\n\nexport const timeDay = timeInterval(\n date => date.setHours(0, 0, 0, 0),\n (date, step) => date.setDate(date.getDate() + step),\n (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,\n date => date.getDate() - 1\n);\n\nexport const timeDays = timeDay.range;\n\nexport const utcDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return date.getUTCDate() - 1;\n});\n\nexport const utcDays = utcDay.range;\n\nexport const unixDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return Math.floor(date / durationDay);\n});\n\nexport const unixDays = unixDay.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationWeek} from \"./duration.js\";\n\nfunction timeWeekday(i) {\n return timeInterval((date) => {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setDate(date.getDate() + step * 7);\n }, (start, end) => {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n });\n}\n\nexport const timeSunday = timeWeekday(0);\nexport const timeMonday = timeWeekday(1);\nexport const timeTuesday = timeWeekday(2);\nexport const timeWednesday = timeWeekday(3);\nexport const timeThursday = timeWeekday(4);\nexport const timeFriday = timeWeekday(5);\nexport const timeSaturday = timeWeekday(6);\n\nexport const timeSundays = timeSunday.range;\nexport const timeMondays = timeMonday.range;\nexport const timeTuesdays = timeTuesday.range;\nexport const timeWednesdays = timeWednesday.range;\nexport const timeThursdays = timeThursday.range;\nexport const timeFridays = timeFriday.range;\nexport const timeSaturdays = timeSaturday.range;\n\nfunction utcWeekday(i) {\n return timeInterval((date) => {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, (start, end) => {\n return (end - start) / durationWeek;\n });\n}\n\nexport const utcSunday = utcWeekday(0);\nexport const utcMonday = utcWeekday(1);\nexport const utcTuesday = utcWeekday(2);\nexport const utcWednesday = utcWeekday(3);\nexport const utcThursday = utcWeekday(4);\nexport const utcFriday = utcWeekday(5);\nexport const utcSaturday = utcWeekday(6);\n\nexport const utcSundays = utcSunday.range;\nexport const utcMondays = utcMonday.range;\nexport const utcTuesdays = utcTuesday.range;\nexport const utcWednesdays = utcWednesday.range;\nexport const utcThursdays = utcThursday.range;\nexport const utcFridays = utcFriday.range;\nexport const utcSaturdays = utcSaturday.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const timeMonth = timeInterval((date) => {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setMonth(date.getMonth() + step);\n}, (start, end) => {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}, (date) => {\n return date.getMonth();\n});\n\nexport const timeMonths = timeMonth.range;\n\nexport const utcMonth = timeInterval((date) => {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCMonth(date.getUTCMonth() + step);\n}, (start, end) => {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}, (date) => {\n return date.getUTCMonth();\n});\n\nexport const utcMonths = utcMonth.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const timeYear = timeInterval((date) => {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setFullYear(date.getFullYear() + step);\n}, (start, end) => {\n return end.getFullYear() - start.getFullYear();\n}, (date) => {\n return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\ntimeYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setFullYear(date.getFullYear() + step * k);\n });\n};\n\nexport const timeYears = timeYear.range;\n\nexport const utcYear = timeInterval((date) => {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n}, (start, end) => {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}, (date) => {\n return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step * k);\n });\n};\n\nexport const utcYears = utcYear.range;\n","import {bisector, tickStep} from \"d3-array\";\nimport {durationDay, durationHour, durationMinute, durationMonth, durationSecond, durationWeek, durationYear} from \"./duration.js\";\nimport {millisecond} from \"./millisecond.js\";\nimport {second} from \"./second.js\";\nimport {timeMinute, utcMinute} from \"./minute.js\";\nimport {timeHour, utcHour} from \"./hour.js\";\nimport {timeDay, unixDay} from \"./day.js\";\nimport {timeSunday, utcSunday} from \"./week.js\";\nimport {timeMonth, utcMonth} from \"./month.js\";\nimport {timeYear, utcYear} from \"./year.js\";\n\nfunction ticker(year, month, week, day, hour, minute) {\n\n const tickIntervals = [\n [second, 1, durationSecond],\n [second, 5, 5 * durationSecond],\n [second, 15, 15 * durationSecond],\n [second, 30, 30 * durationSecond],\n [minute, 1, durationMinute],\n [minute, 5, 5 * durationMinute],\n [minute, 15, 15 * durationMinute],\n [minute, 30, 30 * durationMinute],\n [ hour, 1, durationHour ],\n [ hour, 3, 3 * durationHour ],\n [ hour, 6, 6 * durationHour ],\n [ hour, 12, 12 * durationHour ],\n [ day, 1, durationDay ],\n [ day, 2, 2 * durationDay ],\n [ week, 1, durationWeek ],\n [ month, 1, durationMonth ],\n [ month, 3, 3 * durationMonth ],\n [ year, 1, durationYear ]\n ];\n\n function ticks(start, stop, count) {\n const reverse = stop < start;\n if (reverse) [start, stop] = [stop, start];\n const interval = count && typeof count.range === \"function\" ? count : tickInterval(start, stop, count);\n const ticks = interval ? interval.range(start, +stop + 1) : []; // inclusive stop\n return reverse ? ticks.reverse() : ticks;\n }\n\n function tickInterval(start, stop, count) {\n const target = Math.abs(stop - start) / count;\n const i = bisector(([,, step]) => step).right(tickIntervals, target);\n if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count));\n if (i === 0) return millisecond.every(Math.max(tickStep(start, stop, count), 1));\n const [t, step] = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];\n return t.every(step);\n }\n\n return [ticks, tickInterval];\n}\n\nconst [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute);\nconst [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute);\n\nexport {utcTicks, utcTickInterval, timeTicks, timeTickInterval};\n","import {\n timeDay,\n timeSunday,\n timeMonday,\n timeThursday,\n timeYear,\n utcDay,\n utcSunday,\n utcMonday,\n utcThursday,\n utcYear\n} from \"d3-time\";\n\nfunction localDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);\n date.setFullYear(d.y);\n return date;\n }\n return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);\n}\n\nfunction utcDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));\n}\n\nfunction newDate(y, m, d) {\n return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0};\n}\n\nexport default function formatLocale(locale) {\n var locale_dateTime = locale.dateTime,\n locale_date = locale.date,\n locale_time = locale.time,\n locale_periods = locale.periods,\n locale_weekdays = locale.days,\n locale_shortWeekdays = locale.shortDays,\n locale_months = locale.months,\n locale_shortMonths = locale.shortMonths;\n\n var periodRe = formatRe(locale_periods),\n periodLookup = formatLookup(locale_periods),\n weekdayRe = formatRe(locale_weekdays),\n weekdayLookup = formatLookup(locale_weekdays),\n shortWeekdayRe = formatRe(locale_shortWeekdays),\n shortWeekdayLookup = formatLookup(locale_shortWeekdays),\n monthRe = formatRe(locale_months),\n monthLookup = formatLookup(locale_months),\n shortMonthRe = formatRe(locale_shortMonths),\n shortMonthLookup = formatLookup(locale_shortMonths);\n\n var formats = {\n \"a\": formatShortWeekday,\n \"A\": formatWeekday,\n \"b\": formatShortMonth,\n \"B\": formatMonth,\n \"c\": null,\n \"d\": formatDayOfMonth,\n \"e\": formatDayOfMonth,\n \"f\": formatMicroseconds,\n \"g\": formatYearISO,\n \"G\": formatFullYearISO,\n \"H\": formatHour24,\n \"I\": formatHour12,\n \"j\": formatDayOfYear,\n \"L\": formatMilliseconds,\n \"m\": formatMonthNumber,\n \"M\": formatMinutes,\n \"p\": formatPeriod,\n \"q\": formatQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatSeconds,\n \"u\": formatWeekdayNumberMonday,\n \"U\": formatWeekNumberSunday,\n \"V\": formatWeekNumberISO,\n \"w\": formatWeekdayNumberSunday,\n \"W\": formatWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatYear,\n \"Y\": formatFullYear,\n \"Z\": formatZone,\n \"%\": formatLiteralPercent\n };\n\n var utcFormats = {\n \"a\": formatUTCShortWeekday,\n \"A\": formatUTCWeekday,\n \"b\": formatUTCShortMonth,\n \"B\": formatUTCMonth,\n \"c\": null,\n \"d\": formatUTCDayOfMonth,\n \"e\": formatUTCDayOfMonth,\n \"f\": formatUTCMicroseconds,\n \"g\": formatUTCYearISO,\n \"G\": formatUTCFullYearISO,\n \"H\": formatUTCHour24,\n \"I\": formatUTCHour12,\n \"j\": formatUTCDayOfYear,\n \"L\": formatUTCMilliseconds,\n \"m\": formatUTCMonthNumber,\n \"M\": formatUTCMinutes,\n \"p\": formatUTCPeriod,\n \"q\": formatUTCQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatUTCSeconds,\n \"u\": formatUTCWeekdayNumberMonday,\n \"U\": formatUTCWeekNumberSunday,\n \"V\": formatUTCWeekNumberISO,\n \"w\": formatUTCWeekdayNumberSunday,\n \"W\": formatUTCWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatUTCYear,\n \"Y\": formatUTCFullYear,\n \"Z\": formatUTCZone,\n \"%\": formatLiteralPercent\n };\n\n var parses = {\n \"a\": parseShortWeekday,\n \"A\": parseWeekday,\n \"b\": parseShortMonth,\n \"B\": parseMonth,\n \"c\": parseLocaleDateTime,\n \"d\": parseDayOfMonth,\n \"e\": parseDayOfMonth,\n \"f\": parseMicroseconds,\n \"g\": parseYear,\n \"G\": parseFullYear,\n \"H\": parseHour24,\n \"I\": parseHour24,\n \"j\": parseDayOfYear,\n \"L\": parseMilliseconds,\n \"m\": parseMonthNumber,\n \"M\": parseMinutes,\n \"p\": parsePeriod,\n \"q\": parseQuarter,\n \"Q\": parseUnixTimestamp,\n \"s\": parseUnixTimestampSeconds,\n \"S\": parseSeconds,\n \"u\": parseWeekdayNumberMonday,\n \"U\": parseWeekNumberSunday,\n \"V\": parseWeekNumberISO,\n \"w\": parseWeekdayNumberSunday,\n \"W\": parseWeekNumberMonday,\n \"x\": parseLocaleDate,\n \"X\": parseLocaleTime,\n \"y\": parseYear,\n \"Y\": parseFullYear,\n \"Z\": parseZone,\n \"%\": parseLiteralPercent\n };\n\n // These recursive directive definitions must be deferred.\n formats.x = newFormat(locale_date, formats);\n formats.X = newFormat(locale_time, formats);\n formats.c = newFormat(locale_dateTime, formats);\n utcFormats.x = newFormat(locale_date, utcFormats);\n utcFormats.X = newFormat(locale_time, utcFormats);\n utcFormats.c = newFormat(locale_dateTime, utcFormats);\n\n function newFormat(specifier, formats) {\n return function(date) {\n var string = [],\n i = -1,\n j = 0,\n n = specifier.length,\n c,\n pad,\n format;\n\n if (!(date instanceof Date)) date = new Date(+date);\n\n while (++i < n) {\n if (specifier.charCodeAt(i) === 37) {\n string.push(specifier.slice(j, i));\n if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);\n else pad = c === \"e\" ? \" \" : \"0\";\n if (format = formats[c]) c = format(date, pad);\n string.push(c);\n j = i + 1;\n }\n }\n\n string.push(specifier.slice(j, i));\n return string.join(\"\");\n };\n }\n\n function newParse(specifier, Z) {\n return function(string) {\n var d = newDate(1900, undefined, 1),\n i = parseSpecifier(d, specifier, string += \"\", 0),\n week, day;\n if (i != string.length) return null;\n\n // If a UNIX timestamp is specified, return it.\n if (\"Q\" in d) return new Date(d.Q);\n if (\"s\" in d) return new Date(d.s * 1000 + (\"L\" in d ? d.L : 0));\n\n // If this is utcParse, never use the local timezone.\n if (Z && !(\"Z\" in d)) d.Z = 0;\n\n // The am-pm flag is 0 for AM, and 1 for PM.\n if (\"p\" in d) d.H = d.H % 12 + d.p * 12;\n\n // If the month was not specified, inherit from the quarter.\n if (d.m === undefined) d.m = \"q\" in d ? d.q : 0;\n\n // Convert day-of-week and week-of-year to day-of-year.\n if (\"V\" in d) {\n if (d.V < 1 || d.V > 53) return null;\n if (!(\"w\" in d)) d.w = 1;\n if (\"Z\" in d) {\n week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();\n week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);\n week = utcDay.offset(week, (d.V - 1) * 7);\n d.y = week.getUTCFullYear();\n d.m = week.getUTCMonth();\n d.d = week.getUTCDate() + (d.w + 6) % 7;\n } else {\n week = localDate(newDate(d.y, 0, 1)), day = week.getDay();\n week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);\n week = timeDay.offset(week, (d.V - 1) * 7);\n d.y = week.getFullYear();\n d.m = week.getMonth();\n d.d = week.getDate() + (d.w + 6) % 7;\n }\n } else if (\"W\" in d || \"U\" in d) {\n if (!(\"w\" in d)) d.w = \"u\" in d ? d.u % 7 : \"W\" in d ? 1 : 0;\n day = \"Z\" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();\n d.m = 0;\n d.d = \"W\" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;\n }\n\n // If a time zone is specified, all fields are interpreted as UTC and then\n // offset according to the specified time zone.\n if (\"Z\" in d) {\n d.H += d.Z / 100 | 0;\n d.M += d.Z % 100;\n return utcDate(d);\n }\n\n // Otherwise, all fields are in local time.\n return localDate(d);\n };\n }\n\n function parseSpecifier(d, specifier, string, j) {\n var i = 0,\n n = specifier.length,\n m = string.length,\n c,\n parse;\n\n while (i < n) {\n if (j >= m) return -1;\n c = specifier.charCodeAt(i++);\n if (c === 37) {\n c = specifier.charAt(i++);\n parse = parses[c in pads ? specifier.charAt(i++) : c];\n if (!parse || ((j = parse(d, string, j)) < 0)) return -1;\n } else if (c != string.charCodeAt(j++)) {\n return -1;\n }\n }\n\n return j;\n }\n\n function parsePeriod(d, string, i) {\n var n = periodRe.exec(string.slice(i));\n return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortWeekday(d, string, i) {\n var n = shortWeekdayRe.exec(string.slice(i));\n return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseWeekday(d, string, i) {\n var n = weekdayRe.exec(string.slice(i));\n return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseShortMonth(d, string, i) {\n var n = shortMonthRe.exec(string.slice(i));\n return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseMonth(d, string, i) {\n var n = monthRe.exec(string.slice(i));\n return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;\n }\n\n function parseLocaleDateTime(d, string, i) {\n return parseSpecifier(d, locale_dateTime, string, i);\n }\n\n function parseLocaleDate(d, string, i) {\n return parseSpecifier(d, locale_date, string, i);\n }\n\n function parseLocaleTime(d, string, i) {\n return parseSpecifier(d, locale_time, string, i);\n }\n\n function formatShortWeekday(d) {\n return locale_shortWeekdays[d.getDay()];\n }\n\n function formatWeekday(d) {\n return locale_weekdays[d.getDay()];\n }\n\n function formatShortMonth(d) {\n return locale_shortMonths[d.getMonth()];\n }\n\n function formatMonth(d) {\n return locale_months[d.getMonth()];\n }\n\n function formatPeriod(d) {\n return locale_periods[+(d.getHours() >= 12)];\n }\n\n function formatQuarter(d) {\n return 1 + ~~(d.getMonth() / 3);\n }\n\n function formatUTCShortWeekday(d) {\n return locale_shortWeekdays[d.getUTCDay()];\n }\n\n function formatUTCWeekday(d) {\n return locale_weekdays[d.getUTCDay()];\n }\n\n function formatUTCShortMonth(d) {\n return locale_shortMonths[d.getUTCMonth()];\n }\n\n function formatUTCMonth(d) {\n return locale_months[d.getUTCMonth()];\n }\n\n function formatUTCPeriod(d) {\n return locale_periods[+(d.getUTCHours() >= 12)];\n }\n\n function formatUTCQuarter(d) {\n return 1 + ~~(d.getUTCMonth() / 3);\n }\n\n return {\n format: function(specifier) {\n var f = newFormat(specifier += \"\", formats);\n f.toString = function() { return specifier; };\n return f;\n },\n parse: function(specifier) {\n var p = newParse(specifier += \"\", false);\n p.toString = function() { return specifier; };\n return p;\n },\n utcFormat: function(specifier) {\n var f = newFormat(specifier += \"\", utcFormats);\n f.toString = function() { return specifier; };\n return f;\n },\n utcParse: function(specifier) {\n var p = newParse(specifier += \"\", true);\n p.toString = function() { return specifier; };\n return p;\n }\n };\n}\n\nvar pads = {\"-\": \"\", \"_\": \" \", \"0\": \"0\"},\n numberRe = /^\\s*\\d+/, // note: ignores next directive\n percentRe = /^%/,\n requoteRe = /[\\\\^$*+?|[\\]().{}]/g;\n\nfunction pad(value, fill, width) {\n var sign = value < 0 ? \"-\" : \"\",\n string = (sign ? -value : value) + \"\",\n length = string.length;\n return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);\n}\n\nfunction requote(s) {\n return s.replace(requoteRe, \"\\\\$&\");\n}\n\nfunction formatRe(names) {\n return new RegExp(\"^(?:\" + names.map(requote).join(\"|\") + \")\", \"i\");\n}\n\nfunction formatLookup(names) {\n return new Map(names.map((name, i) => [name.toLowerCase(), i]));\n}\n\nfunction parseWeekdayNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.w = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekdayNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.u = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.U = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberISO(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.V = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.W = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseFullYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 4));\n return n ? (d.y = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;\n}\n\nfunction parseZone(d, string, i) {\n var n = /^(Z)|([+-]\\d\\d)(?::?(\\d\\d))?/.exec(string.slice(i, i + 6));\n return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || \"00\")), i + n[0].length) : -1;\n}\n\nfunction parseQuarter(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;\n}\n\nfunction parseMonthNumber(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.m = n[0] - 1, i + n[0].length) : -1;\n}\n\nfunction parseDayOfMonth(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseDayOfYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseHour24(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.H = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMinutes(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.M = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.S = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMilliseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.L = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMicroseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 6));\n return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;\n}\n\nfunction parseLiteralPercent(d, string, i) {\n var n = percentRe.exec(string.slice(i, i + 1));\n return n ? i + n[0].length : -1;\n}\n\nfunction parseUnixTimestamp(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.Q = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseUnixTimestampSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.s = +n[0], i + n[0].length) : -1;\n}\n\nfunction formatDayOfMonth(d, p) {\n return pad(d.getDate(), p, 2);\n}\n\nfunction formatHour24(d, p) {\n return pad(d.getHours(), p, 2);\n}\n\nfunction formatHour12(d, p) {\n return pad(d.getHours() % 12 || 12, p, 2);\n}\n\nfunction formatDayOfYear(d, p) {\n return pad(1 + timeDay.count(timeYear(d), d), p, 3);\n}\n\nfunction formatMilliseconds(d, p) {\n return pad(d.getMilliseconds(), p, 3);\n}\n\nfunction formatMicroseconds(d, p) {\n return formatMilliseconds(d, p) + \"000\";\n}\n\nfunction formatMonthNumber(d, p) {\n return pad(d.getMonth() + 1, p, 2);\n}\n\nfunction formatMinutes(d, p) {\n return pad(d.getMinutes(), p, 2);\n}\n\nfunction formatSeconds(d, p) {\n return pad(d.getSeconds(), p, 2);\n}\n\nfunction formatWeekdayNumberMonday(d) {\n var day = d.getDay();\n return day === 0 ? 7 : day;\n}\n\nfunction formatWeekNumberSunday(d, p) {\n return pad(timeSunday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction dISO(d) {\n var day = d.getDay();\n return (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n}\n\nfunction formatWeekNumberISO(d, p) {\n d = dISO(d);\n return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);\n}\n\nfunction formatWeekdayNumberSunday(d) {\n return d.getDay();\n}\n\nfunction formatWeekNumberMonday(d, p) {\n return pad(timeMonday.count(timeYear(d) - 1, d), p, 2);\n}\n\nfunction formatYear(d, p) {\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatYearISO(d, p) {\n d = dISO(d);\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatFullYear(d, p) {\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatFullYearISO(d, p) {\n var day = d.getDay();\n d = (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatZone(d) {\n var z = d.getTimezoneOffset();\n return (z > 0 ? \"-\" : (z *= -1, \"+\"))\n + pad(z / 60 | 0, \"0\", 2)\n + pad(z % 60, \"0\", 2);\n}\n\nfunction formatUTCDayOfMonth(d, p) {\n return pad(d.getUTCDate(), p, 2);\n}\n\nfunction formatUTCHour24(d, p) {\n return pad(d.getUTCHours(), p, 2);\n}\n\nfunction formatUTCHour12(d, p) {\n return pad(d.getUTCHours() % 12 || 12, p, 2);\n}\n\nfunction formatUTCDayOfYear(d, p) {\n return pad(1 + utcDay.count(utcYear(d), d), p, 3);\n}\n\nfunction formatUTCMilliseconds(d, p) {\n return pad(d.getUTCMilliseconds(), p, 3);\n}\n\nfunction formatUTCMicroseconds(d, p) {\n return formatUTCMilliseconds(d, p) + \"000\";\n}\n\nfunction formatUTCMonthNumber(d, p) {\n return pad(d.getUTCMonth() + 1, p, 2);\n}\n\nfunction formatUTCMinutes(d, p) {\n return pad(d.getUTCMinutes(), p, 2);\n}\n\nfunction formatUTCSeconds(d, p) {\n return pad(d.getUTCSeconds(), p, 2);\n}\n\nfunction formatUTCWeekdayNumberMonday(d) {\n var dow = d.getUTCDay();\n return dow === 0 ? 7 : dow;\n}\n\nfunction formatUTCWeekNumberSunday(d, p) {\n return pad(utcSunday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction UTCdISO(d) {\n var day = d.getUTCDay();\n return (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n}\n\nfunction formatUTCWeekNumberISO(d, p) {\n d = UTCdISO(d);\n return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);\n}\n\nfunction formatUTCWeekdayNumberSunday(d) {\n return d.getUTCDay();\n}\n\nfunction formatUTCWeekNumberMonday(d, p) {\n return pad(utcMonday.count(utcYear(d) - 1, d), p, 2);\n}\n\nfunction formatUTCYear(d, p) {\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCYearISO(d, p) {\n d = UTCdISO(d);\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCFullYear(d, p) {\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCFullYearISO(d, p) {\n var day = d.getUTCDay();\n d = (day >= 4 || day === 0) ? utcThursday(d) : utcThursday.ceil(d);\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCZone() {\n return \"+0000\";\n}\n\nfunction formatLiteralPercent() {\n return \"%\";\n}\n\nfunction formatUnixTimestamp(d) {\n return +d;\n}\n\nfunction formatUnixTimestampSeconds(d) {\n return Math.floor(+d / 1000);\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var timeFormat;\nexport var timeParse;\nexport var utcFormat;\nexport var utcParse;\n\ndefaultLocale({\n dateTime: \"%x, %X\",\n date: \"%-m/%-d/%Y\",\n time: \"%-I:%M:%S %p\",\n periods: [\"AM\", \"PM\"],\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n shortDays: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n shortMonths: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n timeFormat = locale.format;\n timeParse = locale.parse;\n utcFormat = locale.utcFormat;\n utcParse = locale.utcParse;\n return locale;\n}\n","import {timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeTicks, timeTickInterval} from \"d3-time\";\nimport {timeFormat} from \"d3-time-format\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport nice from \"./nice.js\";\n\nfunction date(t) {\n return new Date(t);\n}\n\nfunction number(t) {\n return t instanceof Date ? +t : +new Date(+t);\n}\n\nexport function calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format) {\n var scale = continuous(),\n invert = scale.invert,\n domain = scale.domain;\n\n var formatMillisecond = format(\".%L\"),\n formatSecond = format(\":%S\"),\n formatMinute = format(\"%I:%M\"),\n formatHour = format(\"%I %p\"),\n formatDay = format(\"%a %d\"),\n formatWeek = format(\"%b %d\"),\n formatMonth = format(\"%B\"),\n formatYear = format(\"%Y\");\n\n function tickFormat(date) {\n return (second(date) < date ? formatMillisecond\n : minute(date) < date ? formatSecond\n : hour(date) < date ? formatMinute\n : day(date) < date ? formatHour\n : month(date) < date ? (week(date) < date ? formatDay : formatWeek)\n : year(date) < date ? formatMonth\n : formatYear)(date);\n }\n\n scale.invert = function(y) {\n return new Date(invert(y));\n };\n\n scale.domain = function(_) {\n return arguments.length ? domain(Array.from(_, number)) : domain().map(date);\n };\n\n scale.ticks = function(interval) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], interval == null ? 10 : interval);\n };\n\n scale.tickFormat = function(count, specifier) {\n return specifier == null ? tickFormat : format(specifier);\n };\n\n scale.nice = function(interval) {\n var d = domain();\n if (!interval || typeof interval.range !== \"function\") interval = tickInterval(d[0], d[d.length - 1], interval == null ? 10 : interval);\n return interval ? domain(nice(d, interval)) : scale;\n };\n\n scale.copy = function() {\n return copy(scale, calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format));\n };\n\n return scale;\n}\n\nexport default function time() {\n return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]), arguments);\n}\n","import {utcYear, utcMonth, utcWeek, utcDay, utcHour, utcMinute, utcSecond, utcTicks, utcTickInterval} from \"d3-time\";\nimport {utcFormat} from \"d3-time-format\";\nimport {calendar} from \"./time.js\";\nimport {initRange} from \"./init.js\";\n\nexport default function utcTime() {\n return initRange.apply(calendar(utcTicks, utcTickInterval, utcYear, utcMonth, utcWeek, utcDay, utcHour, utcMinute, utcSecond, utcFormat).domain([Date.UTC(2000, 0, 1), Date.UTC(2000, 0, 2)]), arguments);\n}\n","import {interpolate, interpolateRound} from \"d3-interpolate\";\nimport {identity} from \"./continuous.js\";\nimport {initInterpolator} from \"./init.js\";\nimport {linearish} from \"./linear.js\";\nimport {loggish} from \"./log.js\";\nimport {symlogish} from \"./symlog.js\";\nimport {powish} from \"./pow.js\";\n\nfunction transformer() {\n var x0 = 0,\n x1 = 1,\n t0,\n t1,\n k10,\n transform,\n interpolator = identity,\n clamp = false,\n unknown;\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : interpolator(k10 === 0 ? 0.5 : (x = (transform(x) - t0) * k10, clamp ? Math.max(0, Math.min(1, x)) : x));\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0), scale) : [x0, x1];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n function range(interpolate) {\n return function(_) {\n var r0, r1;\n return arguments.length ? ([r0, r1] = _, interpolator = interpolate(r0, r1), scale) : [interpolator(0), interpolator(1)];\n };\n }\n\n scale.range = range(interpolate);\n\n scale.rangeRound = range(interpolateRound);\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t) {\n transform = t, t0 = t(x0), t1 = t(x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0);\n return scale;\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .interpolator(source.interpolator())\n .clamp(source.clamp())\n .unknown(source.unknown());\n}\n\nexport default function sequential() {\n var scale = linearish(transformer()(identity));\n\n scale.copy = function() {\n return copy(scale, sequential());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialLog() {\n var scale = loggish(transformer()).domain([1, 10]);\n\n scale.copy = function() {\n return copy(scale, sequentialLog()).base(scale.base());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialSymlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, sequentialSymlog()).constant(scale.constant());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialPow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, sequentialPow()).exponent(scale.exponent());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function sequentialSqrt() {\n return sequentialPow.apply(null, arguments).exponent(0.5);\n}\n","import {ascending, bisect, quantile} from \"d3-array\";\nimport {identity} from \"./continuous.js\";\nimport {initInterpolator} from \"./init.js\";\n\nexport default function sequentialQuantile() {\n var domain = [],\n interpolator = identity;\n\n function scale(x) {\n if (x != null && !isNaN(x = +x)) return interpolator((bisect(domain, x, 1) - 1) / (domain.length - 1));\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [];\n for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d);\n domain.sort(ascending);\n return scale;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n scale.range = function() {\n return domain.map((d, i) => interpolator(i / (domain.length - 1)));\n };\n\n scale.quantiles = function(n) {\n return Array.from({length: n + 1}, (_, i) => quantile(domain, i / n));\n };\n\n scale.copy = function() {\n return sequentialQuantile(interpolator).domain(domain);\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n","import {interpolate, interpolateRound, piecewise} from \"d3-interpolate\";\nimport {identity} from \"./continuous.js\";\nimport {initInterpolator} from \"./init.js\";\nimport {linearish} from \"./linear.js\";\nimport {loggish} from \"./log.js\";\nimport {copy} from \"./sequential.js\";\nimport {symlogish} from \"./symlog.js\";\nimport {powish} from \"./pow.js\";\n\nfunction transformer() {\n var x0 = 0,\n x1 = 0.5,\n x2 = 1,\n s = 1,\n t0,\n t1,\n t2,\n k10,\n k21,\n interpolator = identity,\n transform,\n clamp = false,\n unknown;\n\n function scale(x) {\n return isNaN(x = +x) ? unknown : (x = 0.5 + ((x = +transform(x)) - t1) * (s * x < s * t1 ? k10 : k21), interpolator(clamp ? Math.max(0, Math.min(1, x)) : x));\n }\n\n scale.domain = function(_) {\n return arguments.length ? ([x0, x1, x2] = _, t0 = transform(x0 = +x0), t1 = transform(x1 = +x1), t2 = transform(x2 = +x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1, scale) : [x0, x1, x2];\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = !!_, scale) : clamp;\n };\n\n scale.interpolator = function(_) {\n return arguments.length ? (interpolator = _, scale) : interpolator;\n };\n\n function range(interpolate) {\n return function(_) {\n var r0, r1, r2;\n return arguments.length ? ([r0, r1, r2] = _, interpolator = piecewise(interpolate, [r0, r1, r2]), scale) : [interpolator(0), interpolator(0.5), interpolator(1)];\n };\n }\n\n scale.range = range(interpolate);\n\n scale.rangeRound = range(interpolateRound);\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t) {\n transform = t, t0 = t(x0), t1 = t(x1), t2 = t(x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), s = t1 < t0 ? -1 : 1;\n return scale;\n };\n}\n\nexport default function diverging() {\n var scale = linearish(transformer()(identity));\n\n scale.copy = function() {\n return copy(scale, diverging());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingLog() {\n var scale = loggish(transformer()).domain([0.1, 1, 10]);\n\n scale.copy = function() {\n return copy(scale, divergingLog()).base(scale.base());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingSymlog() {\n var scale = symlogish(transformer());\n\n scale.copy = function() {\n return copy(scale, divergingSymlog()).constant(scale.constant());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingPow() {\n var scale = powish(transformer());\n\n scale.copy = function() {\n return copy(scale, divergingPow()).exponent(scale.exponent());\n };\n\n return initInterpolator.apply(scale, arguments);\n}\n\nexport function divergingSqrt() {\n return divergingPow.apply(null, arguments).exponent(0.5);\n}\n","import {default as value} from \"./value.js\";\n\nexport default function piecewise(interpolate, values) {\n if (values === undefined) values = interpolate, interpolate = value;\n var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n);\n while (i < n) I[i] = interpolate(v, v = values[++i]);\n return function(t) {\n var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n)));\n return I[i](t - i);\n };\n}\n","export default function(series, order) {\n if (!((n = series.length) > 1)) return;\n for (var i = 1, j, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) {\n s0 = s1, s1 = series[order[i]];\n for (j = 0; j < m; ++j) {\n s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1];\n }\n }\n}\n","export default function(series) {\n var n = series.length, o = new Array(n);\n while (--n >= 0) o[n] = n;\n return o;\n}\n","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport offsetNone from \"./offset/none.js\";\nimport orderNone from \"./order/none.js\";\n\nfunction stackValue(d, key) {\n return d[key];\n}\n\nfunction stackSeries(key) {\n const series = [];\n series.key = key;\n return series;\n}\n\nexport default function() {\n var keys = constant([]),\n order = orderNone,\n offset = offsetNone,\n value = stackValue;\n\n function stack(data) {\n var sz = Array.from(keys.apply(this, arguments), stackSeries),\n i, n = sz.length, j = -1,\n oz;\n\n for (const d of data) {\n for (i = 0, ++j; i < n; ++i) {\n (sz[i][j] = [0, +value(d, sz[i].key, j, data)]).data = d;\n }\n }\n\n for (i = 0, oz = array(order(sz)); i < n; ++i) {\n sz[oz[i]].index = i;\n }\n\n offset(sz, oz);\n return sz;\n }\n\n stack.keys = function(_) {\n return arguments.length ? (keys = typeof _ === \"function\" ? _ : constant(Array.from(_)), stack) : keys;\n };\n\n stack.value = function(_) {\n return arguments.length ? (value = typeof _ === \"function\" ? _ : constant(+_), stack) : value;\n };\n\n stack.order = function(_) {\n return arguments.length ? (order = _ == null ? orderNone : typeof _ === \"function\" ? _ : constant(Array.from(_)), stack) : order;\n };\n\n stack.offset = function(_) {\n return arguments.length ? (offset = _ == null ? offsetNone : _, stack) : offset;\n };\n\n return stack;\n}\n","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nvar identity = function identity(i) {\n return i;\n};\n\nexport var PLACE_HOLDER = {\n '@@functional/placeholder': true\n};\n\nvar isPlaceHolder = function isPlaceHolder(val) {\n return val === PLACE_HOLDER;\n};\n\nvar curry0 = function curry0(fn) {\n return function _curried() {\n if (arguments.length === 0 || arguments.length === 1 && isPlaceHolder(arguments.length <= 0 ? undefined : arguments[0])) {\n return _curried;\n }\n\n return fn.apply(void 0, arguments);\n };\n};\n\nvar curryN = function curryN(n, fn) {\n if (n === 1) {\n return fn;\n }\n\n return curry0(function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var argsLength = args.filter(function (arg) {\n return arg !== PLACE_HOLDER;\n }).length;\n\n if (argsLength >= n) {\n return fn.apply(void 0, args);\n }\n\n return curryN(n - argsLength, curry0(function () {\n for (var _len2 = arguments.length, restArgs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n restArgs[_key2] = arguments[_key2];\n }\n\n var newArgs = args.map(function (arg) {\n return isPlaceHolder(arg) ? restArgs.shift() : arg;\n });\n return fn.apply(void 0, _toConsumableArray(newArgs).concat(restArgs));\n }));\n });\n};\n\nexport var curry = function curry(fn) {\n return curryN(fn.length, fn);\n};\nexport var range = function range(begin, end) {\n var arr = [];\n\n for (var i = begin; i < end; ++i) {\n arr[i - begin] = i;\n }\n\n return arr;\n};\nexport var map = curry(function (fn, arr) {\n if (Array.isArray(arr)) {\n return arr.map(fn);\n }\n\n return Object.keys(arr).map(function (key) {\n return arr[key];\n }).map(fn);\n});\nexport var compose = function compose() {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n if (!args.length) {\n return identity;\n }\n\n var fns = args.reverse(); // first function can receive multiply arguments\n\n var firstFn = fns[0];\n var tailsFn = fns.slice(1);\n return function () {\n return tailsFn.reduce(function (res, fn) {\n return fn(res);\n }, firstFn.apply(void 0, arguments));\n };\n};\nexport var reverse = function reverse(arr) {\n if (Array.isArray(arr)) {\n return arr.reverse();\n } // can be string\n\n\n return arr.split('').reverse.join('');\n};\nexport var memoize = function memoize(fn) {\n var lastArgs = null;\n var lastResult = null;\n return function () {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n\n if (lastArgs && args.every(function (val, i) {\n return val === lastArgs[i];\n })) {\n return lastResult;\n }\n\n lastArgs = args;\n lastResult = fn.apply(void 0, args);\n return lastResult;\n };\n};","/**\n * @fileOverview 一些公用的运算方法\n * @author xile611\n * @date 2015-09-17\n */\nimport Decimal from 'decimal.js-light';\nimport { curry } from './utils';\n/**\n * 获取数值的位数\n * 其中绝对值属于区间[0.1, 1), 得到的值为0\n * 绝对值属于区间[0.01, 0.1),得到的位数为 -1\n * 绝对值属于区间[0.001, 0.01),得到的位数为 -2\n *\n * @param {Number} value 数值\n * @return {Integer} 位数\n */\n\nfunction getDigitCount(value) {\n var result;\n\n if (value === 0) {\n result = 1;\n } else {\n result = Math.floor(new Decimal(value).abs().log(10).toNumber()) + 1;\n }\n\n return result;\n}\n/**\n * 按照固定的步长获取[start, end)这个区间的数据\n * 并且需要处理js计算精度的问题\n *\n * @param {Decimal} start 起点\n * @param {Decimal} end 终点,不包含该值\n * @param {Decimal} step 步长\n * @return {Array} 若干数值\n */\n\n\nfunction rangeStep(start, end, step) {\n var num = new Decimal(start);\n var i = 0;\n var result = []; // magic number to prevent infinite loop\n\n while (num.lt(end) && i < 100000) {\n result.push(num.toNumber());\n num = num.add(step);\n i++;\n }\n\n return result;\n}\n/**\n * 对数值进行线性插值\n *\n * @param {Number} a 定义域的极点\n * @param {Number} b 定义域的极点\n * @param {Number} t [0, 1]内的某个值\n * @return {Number} 定义域内的某个值\n */\n\n\nvar interpolateNumber = curry(function (a, b, t) {\n var newA = +a;\n var newB = +b;\n return newA + t * (newB - newA);\n});\n/**\n * 线性插值的逆运算\n *\n * @param {Number} a 定义域的极点\n * @param {Number} b 定义域的极点\n * @param {Number} x 可以认为是插值后的一个输出值\n * @return {Number} 当x在 a ~ b这个范围内时,返回值属于[0, 1]\n */\n\nvar uninterpolateNumber = curry(function (a, b, x) {\n var diff = b - +a;\n diff = diff || Infinity;\n return (x - a) / diff;\n});\n/**\n * 线性插值的逆运算,并且有截断的操作\n *\n * @param {Number} a 定义域的极点\n * @param {Number} b 定义域的极点\n * @param {Number} x 可以认为是插值后的一个输出值\n * @return {Number} 当x在 a ~ b这个区间内时,返回值属于[0, 1],\n * 当x不在 a ~ b这个区间时,会截断到 a ~ b 这个区间\n */\n\nvar uninterpolateTruncation = curry(function (a, b, x) {\n var diff = b - +a;\n diff = diff || Infinity;\n return Math.max(0, Math.min(1, (x - a) / diff));\n});\nexport default {\n rangeStep: rangeStep,\n getDigitCount: getDigitCount,\n interpolateNumber: interpolateNumber,\n uninterpolateNumber: uninterpolateNumber,\n uninterpolateTruncation: uninterpolateTruncation\n};","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n/**\n * @fileOverview calculate tick values of scale\n * @author xile611, arcthur\n * @date 2015-09-17\n */\nimport Decimal from 'decimal.js-light';\nimport { compose, range, memoize, map, reverse } from './util/utils';\nimport Arithmetic from './util/arithmetic';\n/**\n * Calculate a interval of a minimum value and a maximum value\n *\n * @param {Number} min The minimum value\n * @param {Number} max The maximum value\n * @return {Array} An interval\n */\n\nfunction getValidInterval(_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n min = _ref2[0],\n max = _ref2[1];\n\n var validMin = min,\n validMax = max; // exchange\n\n if (min > max) {\n validMin = max;\n validMax = min;\n }\n\n return [validMin, validMax];\n}\n/**\n * Calculate the step which is easy to understand between ticks, like 10, 20, 25\n *\n * @param {Decimal} roughStep The rough step calculated by deviding the\n * difference by the tickCount\n * @param {Boolean} allowDecimals Allow the ticks to be decimals or not\n * @param {Integer} correctionFactor A correction factor\n * @return {Decimal} The step which is easy to understand between two ticks\n */\n\n\nfunction getFormatStep(roughStep, allowDecimals, correctionFactor) {\n if (roughStep.lte(0)) {\n return new Decimal(0);\n }\n\n var digitCount = Arithmetic.getDigitCount(roughStep.toNumber()); // The ratio between the rough step and the smallest number which has a bigger\n // order of magnitudes than the rough step\n\n var digitCountValue = new Decimal(10).pow(digitCount);\n var stepRatio = roughStep.div(digitCountValue); // When an integer and a float multiplied, the accuracy of result may be wrong\n\n var stepRatioScale = digitCount !== 1 ? 0.05 : 0.1;\n var amendStepRatio = new Decimal(Math.ceil(stepRatio.div(stepRatioScale).toNumber())).add(correctionFactor).mul(stepRatioScale);\n var formatStep = amendStepRatio.mul(digitCountValue);\n return allowDecimals ? formatStep : new Decimal(Math.ceil(formatStep));\n}\n/**\n * calculate the ticks when the minimum value equals to the maximum value\n *\n * @param {Number} value The minimum valuue which is also the maximum value\n * @param {Integer} tickCount The count of ticks\n * @param {Boolean} allowDecimals Allow the ticks to be decimals or not\n * @return {Array} ticks\n */\n\n\nfunction getTickOfSingleValue(value, tickCount, allowDecimals) {\n var step = 1; // calculate the middle value of ticks\n\n var middle = new Decimal(value);\n\n if (!middle.isint() && allowDecimals) {\n var absVal = Math.abs(value);\n\n if (absVal < 1) {\n // The step should be a float number when the difference is smaller than 1\n step = new Decimal(10).pow(Arithmetic.getDigitCount(value) - 1);\n middle = new Decimal(Math.floor(middle.div(step).toNumber())).mul(step);\n } else if (absVal > 1) {\n // Return the maximum integer which is smaller than 'value' when 'value' is greater than 1\n middle = new Decimal(Math.floor(value));\n }\n } else if (value === 0) {\n middle = new Decimal(Math.floor((tickCount - 1) / 2));\n } else if (!allowDecimals) {\n middle = new Decimal(Math.floor(value));\n }\n\n var middleIndex = Math.floor((tickCount - 1) / 2);\n var fn = compose(map(function (n) {\n return middle.add(new Decimal(n - middleIndex).mul(step)).toNumber();\n }), range);\n return fn(0, tickCount);\n}\n/**\n * Calculate the step\n *\n * @param {Number} min The minimum value of an interval\n * @param {Number} max The maximum value of an interval\n * @param {Integer} tickCount The count of ticks\n * @param {Boolean} allowDecimals Allow the ticks to be decimals or not\n * @param {Number} correctionFactor A correction factor\n * @return {Object} The step, minimum value of ticks, maximum value of ticks\n */\n\n\nfunction calculateStep(min, max, tickCount, allowDecimals) {\n var correctionFactor = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;\n\n // dirty hack (for recharts' test)\n if (!Number.isFinite((max - min) / (tickCount - 1))) {\n return {\n step: new Decimal(0),\n tickMin: new Decimal(0),\n tickMax: new Decimal(0)\n };\n } // The step which is easy to understand between two ticks\n\n\n var step = getFormatStep(new Decimal(max).sub(min).div(tickCount - 1), allowDecimals, correctionFactor); // A medial value of ticks\n\n var middle; // When 0 is inside the interval, 0 should be a tick\n\n if (min <= 0 && max >= 0) {\n middle = new Decimal(0);\n } else {\n // calculate the middle value\n middle = new Decimal(min).add(max).div(2); // minus modulo value\n\n middle = middle.sub(new Decimal(middle).mod(step));\n }\n\n var belowCount = Math.ceil(middle.sub(min).div(step).toNumber());\n var upCount = Math.ceil(new Decimal(max).sub(middle).div(step).toNumber());\n var scaleCount = belowCount + upCount + 1;\n\n if (scaleCount > tickCount) {\n // When more ticks need to cover the interval, step should be bigger.\n return calculateStep(min, max, tickCount, allowDecimals, correctionFactor + 1);\n }\n\n if (scaleCount < tickCount) {\n // When less ticks can cover the interval, we should add some additional ticks\n upCount = max > 0 ? upCount + (tickCount - scaleCount) : upCount;\n belowCount = max > 0 ? belowCount : belowCount + (tickCount - scaleCount);\n }\n\n return {\n step: step,\n tickMin: middle.sub(new Decimal(belowCount).mul(step)),\n tickMax: middle.add(new Decimal(upCount).mul(step))\n };\n}\n/**\n * Calculate the ticks of an interval, the count of ticks will be guraranteed\n *\n * @param {Number} min, max min: The minimum value, max: The maximum value\n * @param {Integer} tickCount The count of ticks\n * @param {Boolean} allowDecimals Allow the ticks to be decimals or not\n * @return {Array} ticks\n */\n\n\nfunction getNiceTickValuesFn(_ref3) {\n var _ref4 = _slicedToArray(_ref3, 2),\n min = _ref4[0],\n max = _ref4[1];\n\n var tickCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;\n var allowDecimals = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n // More than two ticks should be return\n var count = Math.max(tickCount, 2);\n\n var _getValidInterval = getValidInterval([min, max]),\n _getValidInterval2 = _slicedToArray(_getValidInterval, 2),\n cormin = _getValidInterval2[0],\n cormax = _getValidInterval2[1];\n\n if (cormin === -Infinity || cormax === Infinity) {\n var _values = cormax === Infinity ? [cormin].concat(_toConsumableArray(range(0, tickCount - 1).map(function () {\n return Infinity;\n }))) : [].concat(_toConsumableArray(range(0, tickCount - 1).map(function () {\n return -Infinity;\n })), [cormax]);\n\n return min > max ? reverse(_values) : _values;\n }\n\n if (cormin === cormax) {\n return getTickOfSingleValue(cormin, tickCount, allowDecimals);\n } // Get the step between two ticks\n\n\n var _calculateStep = calculateStep(cormin, cormax, count, allowDecimals),\n step = _calculateStep.step,\n tickMin = _calculateStep.tickMin,\n tickMax = _calculateStep.tickMax;\n\n var values = Arithmetic.rangeStep(tickMin, tickMax.add(new Decimal(0.1).mul(step)), step);\n return min > max ? reverse(values) : values;\n}\n/**\n * Calculate the ticks of an interval, the count of ticks won't be guraranteed\n *\n * @param {Number} min, max min: The minimum value, max: The maximum value\n * @param {Integer} tickCount The count of ticks\n * @param {Boolean} allowDecimals Allow the ticks to be decimals or not\n * @return {Array} ticks\n */\n\n\nfunction getTickValuesFn(_ref5) {\n var _ref6 = _slicedToArray(_ref5, 2),\n min = _ref6[0],\n max = _ref6[1];\n\n var tickCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;\n var allowDecimals = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n // More than two ticks should be return\n var count = Math.max(tickCount, 2);\n\n var _getValidInterval3 = getValidInterval([min, max]),\n _getValidInterval4 = _slicedToArray(_getValidInterval3, 2),\n cormin = _getValidInterval4[0],\n cormax = _getValidInterval4[1];\n\n if (cormin === -Infinity || cormax === Infinity) {\n return [min, max];\n }\n\n if (cormin === cormax) {\n return getTickOfSingleValue(cormin, tickCount, allowDecimals);\n }\n\n var step = getFormatStep(new Decimal(cormax).sub(cormin).div(count - 1), allowDecimals, 0);\n var fn = compose(map(function (n) {\n return new Decimal(cormin).add(new Decimal(n).mul(step)).toNumber();\n }), range);\n var values = fn(0, count).filter(function (entry) {\n return entry >= cormin && entry <= cormax;\n });\n return min > max ? reverse(values) : values;\n}\n/**\n * Calculate the ticks of an interval, the count of ticks won't be guraranteed,\n * but the domain will be guaranteed\n *\n * @param {Number} min, max min: The minimum value, max: The maximum value\n * @param {Integer} tickCount The count of ticks\n * @param {Boolean} allowDecimals Allow the ticks to be decimals or not\n * @return {Array} ticks\n */\n\n\nfunction getTickValuesFixedDomainFn(_ref7, tickCount) {\n var _ref8 = _slicedToArray(_ref7, 2),\n min = _ref8[0],\n max = _ref8[1];\n\n var allowDecimals = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n\n // More than two ticks should be return\n var _getValidInterval5 = getValidInterval([min, max]),\n _getValidInterval6 = _slicedToArray(_getValidInterval5, 2),\n cormin = _getValidInterval6[0],\n cormax = _getValidInterval6[1];\n\n if (cormin === -Infinity || cormax === Infinity) {\n return [min, max];\n }\n\n if (cormin === cormax) {\n return [cormin];\n }\n\n var count = Math.max(tickCount, 2);\n var step = getFormatStep(new Decimal(cormax).sub(cormin).div(count - 1), allowDecimals, 0);\n var values = [].concat(_toConsumableArray(Arithmetic.rangeStep(new Decimal(cormin), new Decimal(cormax).sub(new Decimal(0.99).mul(step)), step)), [cormax]);\n return min > max ? reverse(values) : values;\n}\n\nexport var getNiceTickValues = memoize(getNiceTickValuesFn);\nexport var getTickValues = memoize(getTickValuesFn);\nexport var getTickValuesFixedDomain = memoize(getTickValuesFixedDomainFn);","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nimport _isEqual from \"lodash/isEqual\";\nimport _sortBy from \"lodash/sortBy\";\nimport _upperFirst from \"lodash/upperFirst\";\nimport _isString from \"lodash/isString\";\nimport _isNaN from \"lodash/isNaN\";\nimport _isArray from \"lodash/isArray\";\nimport _max from \"lodash/max\";\nimport _min from \"lodash/min\";\nimport _flatMap from \"lodash/flatMap\";\nimport _isFunction from \"lodash/isFunction\";\nimport _get from \"lodash/get\";\nimport _isNil from \"lodash/isNil\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nimport * as d3Scales from 'victory-vendor/d3-scale';\nimport { stack as shapeStack, stackOffsetExpand, stackOffsetNone, stackOffsetSilhouette, stackOffsetWiggle, stackOrderNone } from 'victory-vendor/d3-shape';\nimport { getNiceTickValues, getTickValuesFixedDomain } from 'recharts-scale';\nimport { ErrorBar } from '../cartesian/ErrorBar';\nimport { findEntryInArray, getPercentValue, isNumber, isNumOrStr, mathSign, uniqueId } from './DataUtils';\nimport { filterProps, findAllByType, getDisplayName } from './ReactUtils';\n// TODO: Cause of circular dependency. Needs refactor.\n// import { RadiusAxisProps, AngleAxisProps } from '../polar/types';\nimport { getLegendProps } from './getLegendProps';\n\n// Exported for backwards compatibility\nexport { getLegendProps };\nexport function getValueByDataKey(obj, dataKey, defaultValue) {\n if (_isNil(obj) || _isNil(dataKey)) {\n return defaultValue;\n }\n if (isNumOrStr(dataKey)) {\n return _get(obj, dataKey, defaultValue);\n }\n if (_isFunction(dataKey)) {\n return dataKey(obj);\n }\n return defaultValue;\n}\n/**\n * Get domain of data by key.\n * @param {Array} data The data displayed in the chart\n * @param {String} key The unique key of a group of data\n * @param {String} type The type of axis\n * @param {Boolean} filterNil Whether or not filter nil values\n * @return {Array} Domain of data\n */\nexport function getDomainOfDataByKey(data, key, type, filterNil) {\n var flattenData = _flatMap(data, function (entry) {\n return getValueByDataKey(entry, key);\n });\n if (type === 'number') {\n // @ts-expect-error parseFloat type only accepts strings\n var domain = flattenData.filter(function (entry) {\n return isNumber(entry) || parseFloat(entry);\n });\n return domain.length ? [_min(domain), _max(domain)] : [Infinity, -Infinity];\n }\n var validateData = filterNil ? flattenData.filter(function (entry) {\n return !_isNil(entry);\n }) : flattenData;\n\n // Supports x-axis of Date type\n return validateData.map(function (entry) {\n return isNumOrStr(entry) || entry instanceof Date ? entry : '';\n });\n}\nexport var calculateActiveTickIndex = function calculateActiveTickIndex(coordinate) {\n var _ticks$length;\n var ticks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n var unsortedTicks = arguments.length > 2 ? arguments[2] : undefined;\n var axis = arguments.length > 3 ? arguments[3] : undefined;\n var index = -1;\n var len = (_ticks$length = ticks === null || ticks === void 0 ? void 0 : ticks.length) !== null && _ticks$length !== void 0 ? _ticks$length : 0;\n\n // if there are 1 or less ticks ticks then the active tick is at index 0\n if (len <= 1) {\n return 0;\n }\n if (axis && axis.axisType === 'angleAxis' && Math.abs(Math.abs(axis.range[1] - axis.range[0]) - 360) <= 1e-6) {\n var range = axis.range;\n // ticks are distributed in a circle\n for (var i = 0; i < len; i++) {\n var before = i > 0 ? unsortedTicks[i - 1].coordinate : unsortedTicks[len - 1].coordinate;\n var cur = unsortedTicks[i].coordinate;\n var after = i >= len - 1 ? unsortedTicks[0].coordinate : unsortedTicks[i + 1].coordinate;\n var sameDirectionCoord = void 0;\n if (mathSign(cur - before) !== mathSign(after - cur)) {\n var diffInterval = [];\n if (mathSign(after - cur) === mathSign(range[1] - range[0])) {\n sameDirectionCoord = after;\n var curInRange = cur + range[1] - range[0];\n diffInterval[0] = Math.min(curInRange, (curInRange + before) / 2);\n diffInterval[1] = Math.max(curInRange, (curInRange + before) / 2);\n } else {\n sameDirectionCoord = before;\n var afterInRange = after + range[1] - range[0];\n diffInterval[0] = Math.min(cur, (afterInRange + cur) / 2);\n diffInterval[1] = Math.max(cur, (afterInRange + cur) / 2);\n }\n var sameInterval = [Math.min(cur, (sameDirectionCoord + cur) / 2), Math.max(cur, (sameDirectionCoord + cur) / 2)];\n if (coordinate > sameInterval[0] && coordinate <= sameInterval[1] || coordinate >= diffInterval[0] && coordinate <= diffInterval[1]) {\n index = unsortedTicks[i].index;\n break;\n }\n } else {\n var min = Math.min(before, after);\n var max = Math.max(before, after);\n if (coordinate > (min + cur) / 2 && coordinate <= (max + cur) / 2) {\n index = unsortedTicks[i].index;\n break;\n }\n }\n }\n } else {\n // ticks are distributed in a single direction\n for (var _i = 0; _i < len; _i++) {\n if (_i === 0 && coordinate <= (ticks[_i].coordinate + ticks[_i + 1].coordinate) / 2 || _i > 0 && _i < len - 1 && coordinate > (ticks[_i].coordinate + ticks[_i - 1].coordinate) / 2 && coordinate <= (ticks[_i].coordinate + ticks[_i + 1].coordinate) / 2 || _i === len - 1 && coordinate > (ticks[_i].coordinate + ticks[_i - 1].coordinate) / 2) {\n index = ticks[_i].index;\n break;\n }\n }\n }\n return index;\n};\n\n/**\n * Get the main color of each graphic item\n * @param {ReactElement} item A graphic item\n * @return {String} Color\n */\nexport var getMainColorOfGraphicItem = function getMainColorOfGraphicItem(item) {\n var _ref = item,\n displayName = _ref.type.displayName; // TODO: check if displayName is valid.\n var _item$props = item.props,\n stroke = _item$props.stroke,\n fill = _item$props.fill;\n var result;\n switch (displayName) {\n case 'Line':\n result = stroke;\n break;\n case 'Area':\n case 'Radar':\n result = stroke && stroke !== 'none' ? stroke : fill;\n break;\n default:\n result = fill;\n break;\n }\n return result;\n};\n/**\n * Calculate the size of all groups for stacked bar graph\n * @param {Object} stackGroups The items grouped by axisId and stackId\n * @return {Object} The size of all groups\n */\nexport var getBarSizeList = function getBarSizeList(_ref2) {\n var globalSize = _ref2.barSize,\n _ref2$stackGroups = _ref2.stackGroups,\n stackGroups = _ref2$stackGroups === void 0 ? {} : _ref2$stackGroups;\n if (!stackGroups) {\n return {};\n }\n var result = {};\n var numericAxisIds = Object.keys(stackGroups);\n for (var i = 0, len = numericAxisIds.length; i < len; i++) {\n var sgs = stackGroups[numericAxisIds[i]].stackGroups;\n var stackIds = Object.keys(sgs);\n for (var j = 0, sLen = stackIds.length; j < sLen; j++) {\n var _sgs$stackIds$j = sgs[stackIds[j]],\n items = _sgs$stackIds$j.items,\n cateAxisId = _sgs$stackIds$j.cateAxisId;\n var barItems = items.filter(function (item) {\n return getDisplayName(item.type).indexOf('Bar') >= 0;\n });\n if (barItems && barItems.length) {\n var selfSize = barItems[0].props.barSize;\n var cateId = barItems[0].props[cateAxisId];\n if (!result[cateId]) {\n result[cateId] = [];\n }\n result[cateId].push({\n item: barItems[0],\n stackList: barItems.slice(1),\n barSize: _isNil(selfSize) ? globalSize : selfSize\n });\n }\n }\n }\n return result;\n};\n/**\n * Calculate the size of each bar and offset between start of band and the bar\n *\n * @param {number} bandSize is the size of area where bars can render\n * @param {number | string} barGap is the gap size, as a percentage of `bandSize`.\n * Can be defined as number or percent string\n * @param {number | string} barCategoryGap is the gap size, as a percentage of `bandSize`.\n * Can be defined as number or percent string\n * @param {Array