victory-brush-container 36.9.2 → 37.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.VictoryBrushContainer=e(require("react")):t.VictoryBrushContainer=e(t.React)}(self,(t=>(()=>{var e={2596:(t,e,r)=>{var n=r(2373).Symbol;t.exports=n},6082:t=>{t.exports=function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}},8644:t=>{t.exports=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}},9559:t=>{t.exports=function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}},4132:(t,e,r)=>{var n=r(8347),o=r(788),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){var a=t[e];i.call(t,e)&&o(a,r)&&(void 0!==r||e in t)||n(t,e,r)}},8347:(t,e,r)=>{var n=r(5525);t.exports=function(t,e,r){"__proto__"==e&&n?n(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}},6457:(t,e,r)=>{var n=r(9559),o=r(3608);t.exports=function t(e,r,i,a,u){var c=-1,l=e.length;for(i||(i=o),u||(u=[]);++c<l;){var s=e[c];r>0&&i(s)?r>1?t(s,r-1,i,a,u):n(u,s):a||(u[u.length]=s)}return u}},4432:(t,e,r)=>{var n=r(9026),o=r(3110);t.exports=function(t,e){for(var r=0,i=(e=n(e,t)).length;null!=t&&r<i;)t=t[o(e[r++])];return r&&r==i?t:void 0}},6776:t=>{t.exports=function(t,e){return null!=t&&e in Object(t)}},5436:(t,e,r)=>{var n=r(6371),o=r(5066);t.exports=function(t,e){return n(t,e,(function(e,r){return o(t,r)}))}},6371:(t,e,r)=>{var n=r(4432),o=r(6539),i=r(9026);t.exports=function(t,e,r){for(var a=-1,u=e.length,c={};++a<u;){var l=e[a],s=n(t,l);r(s,l)&&o(c,i(l,t),s)}return c}},1600:t=>{t.exports=function(t){return function(e){return null==e?void 0:e[t]}}},3301:(t,e,r)=>{var n=r(4432);t.exports=function(t){return function(e){return n(e,t)}}},6317:(t,e,r)=>{var n=r(5346),o=r(4280),i=r(201);t.exports=function(t,e){return i(o(t,e,n),t+"")}},6539:(t,e,r)=>{var n=r(4132),o=r(9026),i=r(9099),a=r(7709),u=r(3110);t.exports=function(t,e,r,c){if(!a(t))return t;for(var l=-1,s=(e=o(e,t)).length,f=s-1,p=t;null!=p&&++l<s;){var y=u(e[l]),h=r;if("__proto__"===y||"constructor"===y||"prototype"===y)return t;if(l!=f){var v=p[y];void 0===(h=c?c(v,y,p):void 0)&&(h=a(v)?v:i(e[l+1])?[]:{})}n(p,y,h),p=p[y]}return t}},6316:(t,e,r)=>{var n=r(2596),o=r(8644),i=r(163),a=r(1995),u=n?n.prototype:void 0,c=u?u.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(i(e))return o(e,t)+"";if(a(e))return c?c.call(e):"";var r=e+"";return"0"==r&&1/e==-1/0?"-0":r}},9026:(t,e,r)=>{var n=r(163),o=r(726),i=r(7801),a=r(7010);t.exports=function(t,e){return n(t)?t:o(t,e)?[t]:i(a(t))}},5525:(t,e,r)=>{var n=r(3743),o=function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},5557:(t,e,r)=>{var n=r(2645),o=r(4280),i=r(201);t.exports=function(t){return i(o(t,void 0,n),t+"")}},2117:(t,e,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;t.exports=n},3743:t=>{t.exports=function(t,e){return null==t?void 0:t[e]}},3096:(t,e,r)=>{var n=r(9026),o=r(5075),i=r(163),a=r(9099),u=r(8454),c=r(3110);t.exports=function(t,e,r){for(var l=-1,s=(e=n(e,t)).length,f=!1;++l<s;){var p=c(e[l]);if(!(f=null!=t&&r(t,p)))break;t=t[p]}return f||++l!=s?f:!!(s=null==t?0:t.length)&&u(s)&&a(p,s)&&(i(t)||o(t))}},3608:(t,e,r)=>{var n=r(2596),o=r(5075),i=r(163),a=n?n.isConcatSpreadable:void 0;t.exports=function(t){return i(t)||o(t)||!!(a&&t&&t[a])}},9099:t=>{var e=/^(?:0|[1-9]\d*)$/;t.exports=function(t,r){var n=typeof t;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&e.test(t))&&t>-1&&t%1==0&&t<r}},8286:t=>{t.exports=function(){return!1}},726:(t,e,r)=>{var n=r(163),o=r(1995),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(t,e){if(n(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!o(t))||a.test(t)||!i.test(t)||null!=e&&t in Object(e)}},2453:t=>{t.exports=function(t){return t}},4280:(t,e,r)=>{var n=r(6082),o=Math.max;t.exports=function(t,e,r){return e=o(void 0===e?t.length-1:e,0),function(){for(var i=arguments,a=-1,u=o(i.length-e,0),c=Array(u);++a<u;)c[a]=i[e+a];a=-1;for(var l=Array(e+1);++a<e;)l[a]=i[a];return l[e]=r(c),n(t,this,l)}}},2373:(t,e,r)=>{var n=r(2117),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();t.exports=i},201:t=>{t.exports=function(t){return t}},7801:(t,e,r)=>{var n=r(2453),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=n((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(o,(function(t,r,n,o){e.push(n?o.replace(i,"$1"):r||t)})),e}));t.exports=a},3110:(t,e,r)=>{var n=r(1995);t.exports=function(t){if("string"==typeof t||n(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},5034:(t,e,r)=>{var n=r(7709),o=r(6987),i=r(5812),a=Math.max,u=Math.min;t.exports=function(t,e,r){var c,l,s,f,p,y,h=0,v=!1,b=!1,d=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function m(e){var r=c,n=l;return c=l=void 0,h=e,f=t.apply(n,r)}function x(t){return h=t,p=setTimeout(O,e),v?m(t):f}function g(t){var r=t-y;return void 0===y||r>=e||r<0||b&&t-h>=s}function O(){var t=o();if(g(t))return w(t);p=setTimeout(O,function(t){var r=e-(t-y);return b?u(r,s-(t-h)):r}(t))}function w(t){return p=void 0,d&&c?m(t):(c=l=void 0,f)}function j(){var t=o(),r=g(t);if(c=arguments,l=this,y=t,r){if(void 0===p)return x(y);if(b)return clearTimeout(p),p=setTimeout(O,e),m(y)}return void 0===p&&(p=setTimeout(O,e)),f}return e=i(e)||0,n(r)&&(v=!!r.leading,s=(b="maxWait"in r)?a(i(r.maxWait)||0,e):s,d="trailing"in r?!!r.trailing:d),j.cancel=function(){void 0!==p&&clearTimeout(p),h=0,c=y=l=p=void 0},j.flush=function(){return void 0===p?f:w(o())},j}},1893:(t,e,r)=>{var n=r(6317),o=r(788),i=r(8286),a=r(8855),u=Object.prototype,c=u.hasOwnProperty,l=n((function(t,e){t=Object(t);var r=-1,n=e.length,l=n>2?e[2]:void 0;for(l&&i(e[0],e[1],l)&&(n=1);++r<n;)for(var s=e[r],f=a(s),p=-1,y=f.length;++p<y;){var h=f[p],v=t[h];(void 0===v||o(v,u[h])&&!c.call(t,h))&&(t[h]=s[h])}return t}));t.exports=l},788:t=>{t.exports=function(t,e){return t===e||t!=t&&e!=e}},2645:(t,e,r)=>{var n=r(6457);t.exports=function(t){return null!=t&&t.length?n(t,1):[]}},5066:(t,e,r)=>{var n=r(6776),o=r(3096);t.exports=function(t,e){return null!=t&&o(t,e,n)}},5346:t=>{t.exports=function(t){return t}},5075:t=>{t.exports=function(){return!1}},163:t=>{var e=Array.isArray;t.exports=e},8454:t=>{t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},7709:t=>{t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},1995:t=>{t.exports=function(){return!1}},8855:t=>{t.exports=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}},6987:(t,e,r)=>{var n=r(2373);t.exports=function(){return n.Date.now()}},9082:(t,e,r)=>{var n=r(5436),o=r(5557)((function(t,e){return null==t?{}:n(t,e)}));t.exports=o},8532:(t,e,r)=>{var n=r(1600),o=r(3301),i=r(726),a=r(3110);t.exports=function(t){return i(t)?n(a(t)):o(t)}},8163:(t,e,r)=>{var n=r(5034),o=r(7709);t.exports=function(t,e,r){var i=!0,a=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return o(r)&&(i="leading"in r?!!r.leading:i,a="trailing"in r?!!r.trailing:a),n(t,e,{leading:i,maxWait:e,trailing:a})}},5812:t=>{t.exports=function(t){return t}},7010:(t,e,r)=>{var n=r(6316);t.exports=function(t){return null==t?"":n(t)}},660:(t,e,r)=>{var n=r(7010),o=0;t.exports=function(t){var e=++o;return n(t)+e}},7491:t=>{var e="undefined"!=typeof Element,r="function"==typeof Map,n="function"==typeof Set,o="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function i(t,a){if(t===a)return!0;if(t&&a&&"object"==typeof t&&"object"==typeof a){if(t.constructor!==a.constructor)return!1;var u,c,l,s;if(Array.isArray(t)){if((u=t.length)!=a.length)return!1;for(c=u;0!=c--;)if(!i(t[c],a[c]))return!1;return!0}if(r&&t instanceof Map&&a instanceof Map){if(t.size!==a.size)return!1;for(s=t.entries();!(c=s.next()).done;)if(!a.has(c.value[0]))return!1;for(s=t.entries();!(c=s.next()).done;)if(!i(c.value[1],a.get(c.value[0])))return!1;return!0}if(n&&t instanceof Set&&a instanceof Set){if(t.size!==a.size)return!1;for(s=t.entries();!(c=s.next()).done;)if(!a.has(c.value[0]))return!1;return!0}if(o&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(a)){if((u=t.length)!=a.length)return!1;for(c=u;0!=c--;)if(t[c]!==a[c])return!1;return!0}if(t.constructor===RegExp)return t.source===a.source&&t.flags===a.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===a.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===a.toString();if((u=(l=Object.keys(t)).length)!==Object.keys(a).length)return!1;for(c=u;0!=c--;)if(!Object.prototype.hasOwnProperty.call(a,l[c]))return!1;if(e&&t instanceof Element)return!1;for(c=u;0!=c--;)if(("_owner"!==l[c]&&"__v"!==l[c]&&"__o"!==l[c]||!t.$$typeof)&&!i(t[l[c]],a[l[c]]))return!1;return!0}return t!=t&&a!=a}t.exports=function(t,e){try{return i(t,e)}catch(t){if((t.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw t}}},9787:e=>{"use strict";e.exports=t}},r={};function n(t){var o=r[t];if(void 0!==o)return o.exports;var i=r[t]={exports:{}};return e[t](i,i.exports,n),i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{"use strict";n.r(o),n.d(o,{BrushHelpers:()=>Et,VictoryBrushContainer:()=>Nt,brushContainerMixin:()=>Ut});var t=n(1893),e=n.n(t),r=n(9787),i=n.n(r);function a(t){return function(t){if(Array.isArray(t))return u(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return u(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function c(t){return Array.isArray(t)&&t.some((function(t){return t instanceof Date}))}function l(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];var o=t.concat(r);return c(o)?new Date(Math.max.apply(Math,a(o))):Math.max.apply(Math,a(o))}function s(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];var o=t.concat(r);return c(o)?new Date(Math.min.apply(Math,a(o))):Math.min.apply(Math,a(o))}function f(t,e,r){var n=e.a,o=e.d,i=e.e,a=e.f;return"y"===r?o*t+a:n*t+i}function p(t){return!(!t||void 0===t.identifier)}function y(t){if(!p(t.nativeEvent)){var e=function(t){return"svg"===t.nodeName?t:t.parentNode?e(t.parentNode):t};return e(t.target)}}function h(t,e){if(p(t.nativeEvent))return{x:t.nativeEvent.locationX,y:t.nativeEvent.locationY};var r=function(t){return t.changedTouches&&t.changedTouches.length>0}(t)?t.changedTouches[0]:t,n=function(t){return t.getScreenCTM().inverse()}(e||y(r));return{x:f(r.clientX,n,"x"),y:f(r.clientY,n,"y")}}function v(t,e){var r=t.horizontal,n=t.scale,o=e||{x:n.x.domain(),y:n.y.domain()};return{x:r?[n.y(o.y[0]),n.y(o.y[1])]:[n.x(o.x[0]),n.x(o.x[1])],y:r?[n.x(o.x[0]),n.x(o.x[1])]:[n.y(o.y[0]),n.y(o.y[1])]}}function b(t,e,r,n){var o=t.polar,i=t.horizontal;if(!o)return{x:i?e.x.invert(n):e.x.invert(r),y:i?e.y.invert(r):e.y.invert(n)};var a=t.origin||{x:0,y:0},u=r-a.x,c=n-a.y,l=Math.abs(u*Math.sqrt(1+Math.pow(-c/u,2))),s=(-Math.atan2(c,u)+2*Math.PI)%(2*Math.PI);return{x:e.x.invert(s),y:e.y.invert(l)}}function d(t){var e=t.x1,r=t.x2,n=t.y1,o=t.y2,i=t.scale,a=b(t,i,e,n),u=b(t,i,r,o),c=function(t,e){return[s([t,e]),l([t,e])]};return{x:c(a.x,u.x),y:c(a.y,u.y)}}var m=n(7709),x=n.n(m),g=n(660),O=n.n(g);function w(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function j(t,e){return j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},j(t,e)}function M(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function P(t){return P=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},P(t)}var D=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&j(t,e)}(u,t);var e,r,n,o,a=(n=u,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=P(n);if(o){var r=P(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return M(this,t)});function u(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),(e=a.call(this,t)).map=void 0,e.index=void 0,e.portalRegister=function(){return++e.index},e.portalUpdate=function(t,r){e.map[t]=r,e.forceUpdate()},e.portalDeregister=function(t){delete e.map[t],e.forceUpdate()},e.map={},e.index=1,e}return e=u,(r=[{key:"getChildren",value:function(){var t=this;return Object.keys(this.map).map((function(e){var r=t.map[e];return r?i().cloneElement(r,{key:e}):r}))}},{key:"render",value:function(){return i().createElement("svg",this.props,this.getChildren())}}])&&w(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),u}(i().Component);D.displayName="Portal";var S=i().createContext({});S.displayName="PortalContext";var E,A,B=0,_=0,R=0,T=0,C=0,k=0,I="object"==typeof performance&&performance.now?performance:Date,G="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function z(){return C||(G(U),C=I.now()+k)}function U(){C=0}function N(){this._call=this._time=this._next=null}function W(t,e,r){var n=new N;return n.restart(t,e,r),n}function V(){C=(T=I.now())+k,B=_=0;try{!function(){z(),++B;for(var t,e=E;e;)(t=C-e._time)>=0&&e._call.call(void 0,t),e=e._next;--B}()}finally{B=0,function(){for(var t,e,r=E,n=1/0;r;)r._call?(n>r._time&&(n=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:E=e);A=t,F(n)}(),C=0}}function H(){var t=I.now(),e=t-T;e>1e3&&(k-=e,T=t)}function F(t){B||(_&&(_=clearTimeout(_)),t-C>24?(t<1/0&&(_=setTimeout(V,t-I.now()-k)),R&&(R=clearInterval(R))):(R||(T=I.now(),R=setInterval(H,1e3)),B=1,G(V)))}function $(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}N.prototype=W.prototype={constructor:N,restart:function(t,e,r){if("function"!=typeof t)throw new TypeError("callback is not a function");r=(null==r?z():+r)+(null==e?0:+e),this._next||A===this||(A?A._next=this:E=this,A=this),this._call=t,this._time=r,F()},stop:function(){this._call&&(this._call=null,this._time=1/0,F())}};var X=function(){function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.shouldAnimate=void 0,this.subscribers=void 0,this.activeSubscriptions=void 0,this.timer=void 0,this.loop=function(){e.subscribers.forEach((function(t){t.callback(z()-t.startTime,t.duration)}))},this.shouldAnimate=!0,this.subscribers=[],this.timer=null,this.activeSubscriptions=0}var e,r;return e=t,(r=[{key:"bypassAnimation",value:function(){this.shouldAnimate=!1}},{key:"resumeAnimation",value:function(){this.shouldAnimate=!0}},{key:"start",value:function(){this.timer||(this.timer=W(this.loop))}},{key:"stop",value:function(){this.timer&&(this.timer.stop(),this.timer=null)}},{key:"subscribe",value:function(t,e){var r=this.subscribers.push({startTime:z(),callback:t,duration:this.shouldAnimate?e:0});return this.activeSubscriptions++,this.start(),r}},{key:"unsubscribe",value:function(t){null!==t&&this.subscribers[t-1]&&(delete this.subscribers[t-1],this.activeSubscriptions--),0===this.activeSubscriptions&&this.stop()}}])&&$(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Y=i().createContext({transitionTimer:new X,animationTimer:new X});Y.displayName="TimerContext";const q=Y;function L(t,e){return Z(t)?t(e):t}function Z(t){return"function"==typeof t}function J(t,e){if(t)return Object.keys(t).reduce((function(r,n){return r[n]=e(t[n]),r}),{})}function K(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i=[],a=!0,u=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==r.return||r.return()}finally{if(u)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Q(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Q(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Q(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function tt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function et(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}n(9082),n(8532);var rt={startsWith:["data-","aria-"],exactMatch:[]},nt=function(t){var e=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?tt(Object(r),!0).forEach((function(e){et(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):tt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},t);return Object.fromEntries(Object.entries(e).filter((function(t){return function(t){return!(!function(t){var e=!1;return rt.startsWith.forEach((function(r){new RegExp("\\b(".concat(r,")(\\w|-)+"),"g").test(t)&&(e=!0)})),e}(t)&&!function(t){return rt.exactMatch.includes(t)}(t))}(K(t,1)[0])})).map((function(e){var r=K(e,2);return[r[0],L(r[1],t)]})))};function ot(){return ot=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ot.apply(this,arguments)}function it(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function at(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?it(Object(r),!0).forEach((function(e){ut(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):it(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ut(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ct(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function lt(t,e){return lt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},lt(t,e)}function st(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function ft(t){return ft=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ft(t)}var pt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&lt(t,e)}(c,t);var r,n,o,a,u=(o=c,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=ft(o);if(a){var r=ft(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return st(this,t)});function c(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),(e=u.call(this,t)).containerId=void 0,e.portalRef=void 0,e.containerRef=void 0,e.shouldHandleWheel=void 0,e.savePortalRef=function(t){return e.portalRef=t,t},e.portalUpdate=function(t,r){return e.portalRef.portalUpdate(t,r)},e.portalRegister=function(){return e.portalRef.portalRegister()},e.portalDeregister=function(t){return e.portalRef.portalDeregister(t)},e.saveContainerRef=function(t){return Z(e.props.containerRef)&&e.props.containerRef(t),e.containerRef=t,t},e.handleWheel=function(t){return t.preventDefault()},e.containerId=x()(t)&&void 0!==t.containerId?t.containerId:O()("victory-container-"),e.shouldHandleWheel=!!(t&&t.events&&t.events.onWheel),e}return r=c,(n=[{key:"componentDidMount",value:function(){this.shouldHandleWheel&&this.containerRef&&this.containerRef.addEventListener("wheel",this.handleWheel)}},{key:"componentWillUnmount",value:function(){this.shouldHandleWheel&&this.containerRef&&this.containerRef.removeEventListener("wheel",this.handleWheel)}},{key:"getIdForElement",value:function(t){return"".concat(this.containerId,"-").concat(t)}},{key:"getChildren",value:function(t){return t.children}},{key:"getOUIAProps",value:function(t){var e=t.ouiaId,r=t.ouiaSafe,n=t.ouiaType;return at(at(at({},e&&{"data-ouia-component-id":e}),n&&{"data-ouia-component-type":n}),void 0!==r&&{"data-ouia-safe":r})}},{key:"renderContainer",value:function(t,r,n){var o=t.title,a=t.desc,u=t.portalComponent,c=t.className,l=t.width,s=t.height,f=t.portalZIndex,p=t.responsive,y=this.getChildren(t),h=p?{width:"100%",height:"100%"}:{width:l,height:s},v=Object.assign({pointerEvents:"none",touchAction:"none",position:"relative"},h),b=Object.assign({zIndex:f,position:"absolute",top:0,left:0},h),d=Object.assign({pointerEvents:"all"},h),m=Object.assign({overflow:"visible"},h),x={width:l,height:s,viewBox:r.viewBox,preserveAspectRatio:r.preserveAspectRatio,style:m};return i().createElement(S.Provider,{value:{portalUpdate:this.portalUpdate,portalRegister:this.portalRegister,portalDeregister:this.portalDeregister}},i().createElement("div",ot({style:e()({},n,v),className:c,ref:this.saveContainerRef},this.getOUIAProps(t)),i().createElement("svg",ot({},r,{style:d}),o?i().createElement("title",{id:this.getIdForElement("title")},o):null,a?i().createElement("desc",{id:this.getIdForElement("desc")},a):null,y),i().createElement("div",{style:b},i().cloneElement(u,at(at({},x),{},{ref:this.savePortalRef})))))}},{key:"render",value:function(){var t=this.props,e=t.width,r=t.height,n=t.responsive,o=t.events,i=t.title,a=t.desc,u=t.tabIndex,c=t.preserveAspectRatio,l=t.role,s=n?this.props.style:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r={};for(var n in t)e.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r}(this.props.style,["height","width"]),f=nt(this.props),p=Object.assign(at({width:e,height:r,tabIndex:u,role:l,"aria-labelledby":[i&&this.getIdForElement("title"),this.props["aria-labelledby"]].filter(Boolean).join(" ")||void 0,"aria-describedby":[a&&this.getIdForElement("desc"),this.props["aria-describedby"]].filter(Boolean).join(" ")||void 0,viewBox:n?"0 0 ".concat(e," ").concat(r):void 0,preserveAspectRatio:n?c:void 0},f),o);return this.renderContainer(this.props,p,s)}}])&&ct(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),c}(i().Component);pt.displayName="VictoryContainer",pt.role="container",pt.defaultProps={className:"VictoryContainer",portalComponent:i().createElement(D,null),portalZIndex:99,responsive:!0,role:"img"},pt.contextType=q;var yt=["desc","id","tabIndex","origin"];function ht(){return ht=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ht.apply(this,arguments)}function vt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function bt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var dt=(0,r.forwardRef)((function(t,e){var r,n=t.desc,o=t.id,a=t.tabIndex,u=(t.origin,function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,yt)),c=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?vt(Object(r),!0).forEach((function(e){bt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):vt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({vectorEffect:"non-scaling-stroke",id:null===(r=L(o,t))||void 0===r?void 0:r.toString(),tabIndex:L(a,t)},u);return n?i().createElement("rect",ht({},c,{ref:e}),i().createElement("desc",null,n)):i().createElement("rect",ht({},c,{ref:e}))})),mt=n(8163),xt=n.n(mt),gt=n(7491),Ot=n.n(gt);function wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function jt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?wt(Object(r),!0).forEach((function(e){Mt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Mt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Pt(t){return function(t){if(Array.isArray(t))return Dt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return Dt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Dt(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var St={getDimension:function(t){var e=t.horizontal,r=t.brushDimension;return e&&r?"x"===r?"y":"x":r},withinBounds:function(t,e,r){var n=J(e,Number),o=n.x1,i=n.x2,a=n.y1,u=n.y2,c=J(t,Number),l=c.x,s=c.y,f=r?r/2:0;return l+f>=Math.min(o,i)&&l-f<=Math.max(o,i)&&s+f>=Math.min(a,u)&&s-f<=Math.max(a,u)},getDomainBox:function(t,r,n){var o=this.getDimension(t),i=e()({},r,t.domain),a=e()({},n,i),u=v(t,i),c=v(t,a);return{x1:"y"!==o?Math.min.apply(Math,Pt(c.x)):Math.min.apply(Math,Pt(u.x)),x2:"y"!==o?Math.max.apply(Math,Pt(c.x)):Math.max.apply(Math,Pt(u.x)),y1:"x"!==o?Math.min.apply(Math,Pt(c.y)):Math.min.apply(Math,Pt(u.y)),y2:"x"!==o?Math.max.apply(Math,Pt(c.y)):Math.max.apply(Math,Pt(u.y))}},getHandles:function(t,e){var r=this.getDimension(t),n=e.x1,o=e.x2,i=e.y1,a=e.y2,u=Math.min(n,o),c=Math.max(n,o),l=Math.min(i,a),s=Math.max(i,a),f=t.handleWidth/2;return{left:"y"!==r&&{x1:u-f,x2:u+f,y1:i,y2:a},right:"y"!==r&&{x1:c-f,x2:c+f,y1:i,y2:a},top:"x"!==r&&{x1:n,x2:o,y1:l-f,y2:l+f},bottom:"x"!==r&&{x1:n,x2:o,y1:s-f,y2:s+f}}},getActiveHandles:function(t,e,r){var n=this,o=this.getHandles(e,r),i=["top","bottom","left","right"].reduce((function(e,r){return o[r]&&n.withinBounds(t,o[r])?e.concat(r):e}),[]);return i.length&&i},getResizeMutation:function(t,e){var r=t.x1,n=t.y1,o=t.x2,i=t.y2,a={left:{x1:Math.max(r,o),x2:Math.min(r,o),y1:n,y2:i},right:{x1:Math.min(r,o),x2:Math.max(r,o),y1:n,y2:i},top:{y1:Math.max(n,i),y2:Math.min(n,i),x1:r,x2:o},bottom:{y1:Math.min(n,i),y2:Math.max(n,i),x1:r,x2:o}};return e.reduce((function(t,e){return Object.assign(t,a[e])}),{})},getMinimumDomain:function(){return{x:[0,1/Number.MAX_SAFE_INTEGER],y:[0,1/Number.MAX_SAFE_INTEGER]}},getDefaultBrushArea:function(t,e,r){var n=t.domain,o=t.fullDomain,i=t.scale,a=t.horizontal,u=t.allowResize||t.defaultBrushArea?t.defaultBrushArea:"move";if("none"===u)return this.getMinimumDomain();if("disable"===u)return e;if("move"===u){var c=this.getDomainBox(t,o,e),l=t.parentSVG||y(r),s=this.panBox(jt(jt(jt({},t),c),{},{brushDomain:e,startX:(c.x1+c.x2)/2,startY:(c.y1+c.y2)/2}),h(r,l)),f=t.fullDomainBox||this.getDomainBox(t,o);return d(jt(jt({},this.constrainBox(s,f)),{},{scale:i,horizontal:a}))}return n},getSelectionMutation:function(t,e,r){var n=t.x,o=t.y,i=e.x1,a=e.x2,u=e.y1,c=e.y2;return{x1:"y"!==r?n:i,y1:"x"!==r?o:u,x2:"y"!==r?n:a,y2:"x"!==r?o:c}},panBox:function(t,r){var n=t.domain,o=t.startX,i=t.startY,a=this.getDimension(t),u=e()({},t.brushDomain,n),c=e()({},t.fullDomain,n),l=t.x1?t:this.getDomainBox(t,c,u),s=l.x1,f=l.x2,p=l.y1,y=l.y2,h=r.x,v=r.y,b=o?o-h:0,d=i?i-v:0;return{x1:"y"!==a?Math.min(s,f)-b:Math.min(s,f),x2:"y"!==a?Math.max(s,f)-b:Math.max(s,f),y1:"x"!==a?Math.min(p,y)-d:Math.min(p,y),y2:"x"!==a?Math.max(p,y)-d:Math.max(p,y)}},constrainBox:function(t,e){var r=J(e,Number),n=r.x1,o=r.y1,i=r.x2,a=r.y2;return{x1:t.x2>i?i-Math.abs(t.x2-t.x1):Math.max(t.x1,n),y1:t.y2>a?a-Math.abs(t.y2-t.y1):Math.max(t.y1,o),x2:t.x1<n?n+Math.abs(t.x2-t.x1):Math.min(t.x2,i),y2:t.y1<o?o+Math.abs(t.y2-t.y1):Math.min(t.y2,a)}},constrainPoint:function(t,e){var r=J(e,Number),n=r.x1,o=r.y1,i=r.x2,a=r.y2;return{x:Math.min(Math.max(t.x,n),i),y:Math.min(Math.max(t.y,o),a)}},hasMoved:function(t){var e=t.x1,r=t.x2,n=t.y1,o=t.y2,i=t.mouseMoveThreshold,a=this.getDimension(t),u=Math.abs(e-r)>=i,c=Math.abs(n-o)>=i;switch(a){case"x":return u;case"y":return c;default:return u||c}},onMouseDown:function(t,r){var n=this;t.preventDefault();var o=r.handleWidth,i=r.cachedBrushDomain,a=r.domain,u=r.allowResize,c=r.allowDrag,l=r.allowDraw,s=this.getDimension(r),f=u||r.defaultBrushArea?r.defaultBrushArea:"move";if(!u&&!c)return{};var p=r.fullDomainBox||this.getDomainBox(r,a),v=r.parentSVG||y(t),b=h(t,v),d=b.x,m=b.y;if(!this.withinBounds({x:d,y:m},p,o))return{};var x=e()({},r.brushDomain,a),g=Ot()(x,i)?r.currentDomain||x||a:x||a,O=this.getDomainBox(r,a,g),w=u&&this.getActiveHandles({x:d,y:m},r,O);return w?[{target:"parent",mutation:function(){return jt({isSelecting:!0,domainBox:O,fullDomainBox:p,cachedBrushDomain:x,currentDomain:g,parentSVG:v},n.getResizeMutation(O,w))}}]:this.withinBounds({x:d,y:m},O)&&!Ot()(a,g)?[{target:"parent",mutation:function(){return jt({isPanning:c,startX:d,startY:m,domainBox:O,fullDomainBox:p,currentDomain:g,cachedBrushDomain:x,parentSVG:v},O)}}]:l?[{target:"parent",mutation:function(){return jt({isSelecting:u||"move"===f,domainBox:O,fullDomainBox:p,parentSVG:v,cachedBrushDomain:x,cachedCurrentDomain:g,currentDomain:n.getMinimumDomain()},n.getSelectionMutation({x:d,y:m},O,s))}}]:{}},onGlobalMouseMove:function(t,r){var n=r.scale,o=r.isPanning,i=r.isSelecting,a=r.fullDomainBox,u=r.onBrushDomainChange,c=r.allowResize,l=r.allowDrag,s=r.horizontal,f=r.mouseMoveThreshold,p=r.parentSVG,y=this.getDimension(r),v=h(t,p),b=v.x,m=v.y;if(!c&&!l||f>0&&!this.hasMoved(jt(jt({},r),{},{x2:b,y2:m})))return{};if(l&&o){var x=r.startX,g=r.startY,O=this.panBox(r,{x:b,y:m}),w=this.constrainBox(O,a),j=d(jt(jt({},w),{},{scale:n,horizontal:s})),M=jt({currentDomain:j,parentSVG:p,startX:O.x2>=a.x2||O.x1<=a.x1?x:b,startY:O.y2>=a.y2||O.y1<=a.y1?g:m},w);return Z(u)&&u(j,e()({},M,r)),[{target:"parent",mutation:function(){return M}}]}if(c&&i){var P=this.constrainPoint({x:"y"!==y?b:r.x2,y:"x"!==y?m:r.y2},a),D=P.x,S=P.y,E=d({x2:D,y2:S,x1:r.x1,y1:r.y1,scale:n,horizontal:s}),A={x2:D,y2:S,currentDomain:E,parentSVG:p};return Z(u)&&u(E,e()({},A,r)),[{target:"parent",mutation:function(){return A}}]}return{}},onGlobalMouseUp:function(t,r){if(!r.isPanning&&!r.isSelecting)return{};var n=r.x1,o=r.y1,i=r.x2,a=r.y2,u=r.isPanning,c=r.isSelecting,l=r.onBrushDomainChange,s=r.onBrushDomainChangeEnd,f=r.onBrushCleared,p=r.currentDomain,y=r.allowResize,h=r.allowDrag,v=y||r.defaultBrushArea?r.defaultBrushArea:"move",b={isPanning:!1,isSelecting:!1};if(!y&&(void 0===v||"none"===v)||n!==i&&o!==a)(h&&u||y&&c)&&Z(s)&&s(p,e()({},b,r));else{var d=r.cachedCurrentDomain||p,m=this.getDefaultBrushArea(r,d,t);b.currentDomain=m,Z(l)&&l(m,e()({},b,r)),Z(s)&&s(m,e()({},b,r)),Z(f)&&f(m,e()({},b,r))}return[{target:"parent",mutation:function(){return b}}]}},Et=jt(jt({},St),{},{onMouseDown:St.onMouseDown.bind(St),onGlobalMouseUp:St.onGlobalMouseUp.bind(St),onGlobalMouseMove:xt()(St.onGlobalMouseMove.bind(St),16,{leading:!0,trailing:!1})});function At(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Bt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?At(Object(r),!0).forEach((function(e){_t(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):At(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function _t(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Rt(t){return function(t){if(Array.isArray(t))return Tt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return Tt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Tt(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Tt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ct(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function It(t,e){return It=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},It(t,e)}function Gt(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function zt(t){return zt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},zt(t)}function Ut(t){var r;return r=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&It(t,e)}(c,t);var r,n,o,a,u=(o=c,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=zt(o);if(a){var r=zt(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return Gt(this,t)});function c(){return Ct(this,c),u.apply(this,arguments)}return r=c,(n=[{key:"getSelectBox",value:function(t,r){var n=r.x,o=r.y,a=t.brushStyle,u=t.brushComponent,c=t.name,l=u.props&&u.props.style,s=t.allowDrag||t.allowResize?"move":"auto";return n[0]!==n[1]&&o[0]!==o[1]?i().cloneElement(u,{key:"".concat(c,"-brush"),width:Math.abs(n[1]-n[0])||1,height:Math.abs(o[1]-o[0])||1,x:Math.min(n[0],n[1]),y:Math.min(o[0],o[1]),cursor:s,style:e()({},l,a)}):null}},{key:"getCursorPointers",value:function(t){var e={yProps:"ns-resize",xProps:"ew-resize"};return!t.allowResize&&t.allowDrag?(e.xProps="move",e.yProps="move"):t.allowResize||t.allowDrag||(e.xProps="auto",e.yProps="auto"),e}},{key:"getHandles",value:function(t,r){var n=t.handleWidth,o=t.handleStyle,a=t.handleComponent,u=t.name,c=Et.getDomainBox(t,r),l=c.x1,s=c.x2,f=c.y1,p=c.y2,y=Et.getHandles(t,c),h=y.top,v=y.bottom,b=y.left,d=y.right,m=Math.abs(s-l)||1,x=Math.abs(p-f)||1,g=a.props&&a.props.style||{},O=e()({},g,o),w=this.getCursorPointers(t),j={style:O,width:m,height:n,cursor:w.yProps},M={style:O,width:n,height:x,cursor:w.xProps},P={top:h&&Object.assign({x:h.x1,y:h.y1},j),bottom:v&&Object.assign({x:v.x1,y:v.y1},j),left:b&&Object.assign({y:b.y1,x:b.x1},M),right:d&&Object.assign({y:d.y1,x:d.x1},M)},D=["top","bottom","left","right"].reduce((function(t,e){return P[e]?t.concat(i().cloneElement(a,Object.assign({key:"".concat(u,"-handle-").concat(e)},P[e]))):t}),[]);return D.length?D:null}},{key:"getRect",value:function(t){var r=t.currentDomain,n=t.cachedBrushDomain,o=e()({},t.brushDomain,t.domain),i=Ot()(o,n)?e()({},r,o):o,a=v(t,i),u=this.getSelectBox(t,a);return u?[u,this.getHandles(t,i)]:[]}},{key:"getChildren",value:function(t){return[].concat(Rt(i().Children.toArray(t.children)),Rt(this.getRect(t)))}}])&&kt(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),c}(t),r.displayName="VictoryBrushContainer",r.defaultProps=Bt(Bt({},pt.defaultProps),{},{allowDrag:!0,allowDraw:!0,allowResize:!0,brushComponent:i().createElement(dt,null),brushStyle:{stroke:"transparent",fill:"black",fillOpacity:.1},handleComponent:i().createElement(dt,null),handleStyle:{stroke:"transparent",fill:"transparent"},handleWidth:8,mouseMoveThreshold:0}),r.defaultEvents=function(t){return[{target:"parent",eventHandlers:{onMouseDown:function(e,r){return t.disable?{}:Et.onMouseDown(e,r)},onTouchStart:function(e,r){return t.disable?{}:Et.onMouseDown(e,r)},onGlobalMouseMove:function(e,r){return t.disable||!r.isPanning&&!r.isSelecting?{}:Et.onGlobalMouseMove(e,r)},onGlobalTouchMove:function(e,r){return t.disable||!r.isPanning&&!r.isSelecting?{}:Et.onGlobalMouseMove(e,r)},onGlobalMouseUp:function(e,r){return t.disable?{}:Et.onGlobalMouseUp(e,r)},onGlobalTouchEnd:function(e,r){return t.disable?{}:Et.onGlobalMouseUp(e,r)},onGlobalTouchCancel:function(e,r){return t.disable?{}:Et.onGlobalMouseUp(e,r)}}}]},r}var Nt=Ut(pt)})(),o})()));
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.VictoryBrushContainer=e(require("react")):t.VictoryBrushContainer=e(t.React)}(self,(function(t){return function(){var e={2596:function(t,e,n){var r=n(2373).Symbol;t.exports=r},6082:function(t){t.exports=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}},8644:function(t){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}},9559:function(t){t.exports=function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}},4132:function(t,e,n){var r=n(8347),o=n(788),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var a=t[e];i.call(t,e)&&o(a,n)&&(void 0!==n||e in t)||r(t,e,n)}},8347:function(t,e,n){var r=n(5525);t.exports=function(t,e,n){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},6457:function(t,e,n){var r=n(9559),o=n(3608);t.exports=function t(e,n,i,a,s){var u=-1,c=e.length;for(i||(i=o),s||(s=[]);++u<c;){var l=e[u];n>0&&i(l)?n>1?t(l,n-1,i,a,s):r(s,l):a||(s[s.length]=l)}return s}},4432:function(t,e,n){var r=n(9026),o=n(3110);t.exports=function(t,e){for(var n=0,i=(e=r(e,t)).length;null!=t&&n<i;)t=t[o(e[n++])];return n&&n==i?t:void 0}},6776:function(t){t.exports=function(t,e){return null!=t&&e in Object(t)}},5436:function(t,e,n){var r=n(6371),o=n(5066);t.exports=function(t,e){return r(t,e,(function(e,n){return o(t,n)}))}},6371:function(t,e,n){var r=n(4432),o=n(6539),i=n(9026);t.exports=function(t,e,n){for(var a=-1,s=e.length,u={};++a<s;){var c=e[a],l=r(t,c);n(l,c)&&o(u,i(c,t),l)}return u}},1600:function(t){t.exports=function(t){return function(e){return null==e?void 0:e[t]}}},3301:function(t,e,n){var r=n(4432);t.exports=function(t){return function(e){return r(e,t)}}},6317:function(t,e,n){var r=n(5346),o=n(4280),i=n(201);t.exports=function(t,e){return i(o(t,e,r),t+"")}},6539:function(t,e,n){var r=n(4132),o=n(9026),i=n(9099),a=n(7709),s=n(3110);t.exports=function(t,e,n,u){if(!a(t))return t;for(var c=-1,l=(e=o(e,t)).length,f=l-1,h=t;null!=h&&++c<l;){var p=s(e[c]),x=n;if("__proto__"===p||"constructor"===p||"prototype"===p)return t;if(c!=f){var d=h[p];void 0===(x=u?u(d,p,h):void 0)&&(x=a(d)?d:i(e[c+1])?[]:{})}r(h,p,x),h=h[p]}return t}},6316:function(t,e,n){var r=n(2596),o=n(8644),i=n(163),a=n(1995),s=r?r.prototype:void 0,u=s?s.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(i(e))return o(e,t)+"";if(a(e))return u?u.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}},9026:function(t,e,n){var r=n(163),o=n(726),i=n(7801),a=n(7010);t.exports=function(t,e){return r(t)?t:o(t,e)?[t]:i(a(t))}},5525:function(t,e,n){var r=n(3743),o=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},5557:function(t,e,n){var r=n(2645),o=n(4280),i=n(201);t.exports=function(t){return i(o(t,void 0,r),t+"")}},2117:function(t,e,n){var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},3743:function(t){t.exports=function(t,e){return null==t?void 0:t[e]}},3096:function(t,e,n){var r=n(9026),o=n(5075),i=n(163),a=n(9099),s=n(8454),u=n(3110);t.exports=function(t,e,n){for(var c=-1,l=(e=r(e,t)).length,f=!1;++c<l;){var h=u(e[c]);if(!(f=null!=t&&n(t,h)))break;t=t[h]}return f||++c!=l?f:!!(l=null==t?0:t.length)&&s(l)&&a(h,l)&&(i(t)||o(t))}},3608:function(t,e,n){var r=n(2596),o=n(5075),i=n(163),a=r?r.isConcatSpreadable:void 0;t.exports=function(t){return i(t)||o(t)||!!(a&&t&&t[a])}},9099:function(t){var e=/^(?:0|[1-9]\d*)$/;t.exports=function(t,n){var r=typeof t;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&e.test(t))&&t>-1&&t%1==0&&t<n}},8286:function(t){t.exports=function(){return!1}},726:function(t,e,n){var r=n(163),o=n(1995),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(t,e){if(r(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!o(t))||a.test(t)||!i.test(t)||null!=e&&t in Object(e)}},2453:function(t){t.exports=function(t){return t}},4280:function(t,e,n){var r=n(6082),o=Math.max;t.exports=function(t,e,n){return e=o(void 0===e?t.length-1:e,0),function(){for(var i=arguments,a=-1,s=o(i.length-e,0),u=Array(s);++a<s;)u[a]=i[e+a];a=-1;for(var c=Array(e+1);++a<e;)c[a]=i[a];return c[e]=n(u),r(t,this,c)}}},2373:function(t,e,n){var r=n(2117),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},201:function(t){t.exports=function(t){return t}},7801:function(t,e,n){var r=n(2453),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=r((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(o,(function(t,n,r,o){e.push(r?o.replace(i,"$1"):n||t)})),e}));t.exports=a},3110:function(t,e,n){var r=n(1995);t.exports=function(t){if("string"==typeof t||r(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},5034:function(t,e,n){var r=n(7709),o=n(6987),i=n(5812),a=Math.max,s=Math.min;t.exports=function(t,e,n){var u,c,l,f,h,p,x=0,d=!1,y=!1,m=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function v(e){var n=u,r=c;return u=c=void 0,x=e,f=t.apply(r,n)}function g(t){return x=t,h=setTimeout(M,e),d?v(t):f}function b(t){var n=t-p;return void 0===p||n>=e||n<0||y&&t-x>=l}function M(){var t=o();if(b(t))return w(t);h=setTimeout(M,function(t){var n=e-(t-p);return y?s(n,l-(t-x)):n}(t))}function w(t){return h=void 0,m&&u?v(t):(u=c=void 0,f)}function D(){var t=o(),n=b(t);if(u=arguments,c=this,p=t,n){if(void 0===h)return g(p);if(y)return clearTimeout(h),h=setTimeout(M,e),v(p)}return void 0===h&&(h=setTimeout(M,e)),f}return e=i(e)||0,r(n)&&(d=!!n.leading,l=(y="maxWait"in n)?a(i(n.maxWait)||0,e):l,m="trailing"in n?!!n.trailing:m),D.cancel=function(){void 0!==h&&clearTimeout(h),x=0,u=p=c=h=void 0},D.flush=function(){return void 0===h?f:w(o())},D}},1893:function(t,e,n){var r=n(6317),o=n(788),i=n(8286),a=n(8855),s=Object.prototype,u=s.hasOwnProperty,c=r((function(t,e){t=Object(t);var n=-1,r=e.length,c=r>2?e[2]:void 0;for(c&&i(e[0],e[1],c)&&(r=1);++n<r;)for(var l=e[n],f=a(l),h=-1,p=f.length;++h<p;){var x=f[h],d=t[x];(void 0===d||o(d,s[x])&&!u.call(t,x))&&(t[x]=l[x])}return t}));t.exports=c},788:function(t){t.exports=function(t,e){return t===e||t!=t&&e!=e}},2645:function(t,e,n){var r=n(6457);t.exports=function(t){return null!=t&&t.length?r(t,1):[]}},5066:function(t,e,n){var r=n(6776),o=n(3096);t.exports=function(t,e){return null!=t&&o(t,e,r)}},5346:function(t){t.exports=function(t){return t}},5075:function(t){t.exports=function(){return!1}},163:function(t){var e=Array.isArray;t.exports=e},8454:function(t){t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},7709:function(t){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},1995:function(t){t.exports=function(){return!1}},8855:function(t){t.exports=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}},6987:function(t,e,n){var r=n(2373);t.exports=function(){return r.Date.now()}},9082:function(t,e,n){var r=n(5436),o=n(5557)((function(t,e){return null==t?{}:r(t,e)}));t.exports=o},8532:function(t,e,n){var r=n(1600),o=n(3301),i=n(726),a=n(3110);t.exports=function(t){return i(t)?r(a(t)):o(t)}},8163:function(t,e,n){var r=n(5034),o=n(7709);t.exports=function(t,e,n){var i=!0,a=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return o(n)&&(i="leading"in n?!!n.leading:i,a="trailing"in n?!!n.trailing:a),r(t,e,{leading:i,maxWait:e,trailing:a})}},5812:function(t){t.exports=function(t){return t}},7010:function(t,e,n){var r=n(6316);t.exports=function(t){return null==t?"":r(t)}},660:function(t,e,n){var r=n(7010),o=0;t.exports=function(t){var e=++o;return r(t)+e}},7491:function(t){var e="undefined"!=typeof Element,n="function"==typeof Map,r="function"==typeof Set,o="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function i(t,a){if(t===a)return!0;if(t&&a&&"object"==typeof t&&"object"==typeof a){if(t.constructor!==a.constructor)return!1;var s,u,c,l;if(Array.isArray(t)){if((s=t.length)!=a.length)return!1;for(u=s;0!=u--;)if(!i(t[u],a[u]))return!1;return!0}if(n&&t instanceof Map&&a instanceof Map){if(t.size!==a.size)return!1;for(l=t.entries();!(u=l.next()).done;)if(!a.has(u.value[0]))return!1;for(l=t.entries();!(u=l.next()).done;)if(!i(u.value[1],a.get(u.value[0])))return!1;return!0}if(r&&t instanceof Set&&a instanceof Set){if(t.size!==a.size)return!1;for(l=t.entries();!(u=l.next()).done;)if(!a.has(u.value[0]))return!1;return!0}if(o&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(a)){if((s=t.length)!=a.length)return!1;for(u=s;0!=u--;)if(t[u]!==a[u])return!1;return!0}if(t.constructor===RegExp)return t.source===a.source&&t.flags===a.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===a.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===a.toString();if((s=(c=Object.keys(t)).length)!==Object.keys(a).length)return!1;for(u=s;0!=u--;)if(!Object.prototype.hasOwnProperty.call(a,c[u]))return!1;if(e&&t instanceof Element)return!1;for(u=s;0!=u--;)if(("_owner"!==c[u]&&"__v"!==c[u]&&"__o"!==c[u]||!t.$$typeof)&&!i(t[c[u]],a[c[u]]))return!1;return!0}return t!=t&&a!=a}t.exports=function(t,e){try{return i(t,e)}catch(t){if((t.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw t}}},9787:function(e){"use strict";e.exports=t}},n={};function r(t){var o=n[t];if(void 0!==o)return o.exports;var i=n[t]={exports:{}};return e[t](i,i.exports,r),i.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return function(){"use strict";r.r(o),r.d(o,{BrushHelpers:function(){return nt},VictoryBrushContainer:function(){return ot},brushContainerMixin:function(){return rt}});var t=r(1893),e=r.n(t),n=r(9787),i=r.n(n),a=r(7709),s=r.n(a),u=r(660),c=r.n(u);class l extends i().Component{static displayName="Portal";constructor(t){super(t),this.map={},this.index=1}portalRegister=()=>++this.index;portalUpdate=(t,e)=>{this.map[t]=e,this.forceUpdate()};portalDeregister=t=>{delete this.map[t],this.forceUpdate()};getChildren(){return Object.keys(this.map).map((t=>{const e=this.map[t];return e?i().cloneElement(e,{key:t}):e}))}render(){return i().createElement("svg",this.props,this.getChildren())}}const f=i().createContext({});f.displayName="PortalContext";var h,p,x=0,d=0,y=0,m=0,v=0,g=0,b="object"==typeof performance&&performance.now?performance:Date,M="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function w(){return v||(M(D),v=b.now()+g)}function D(){v=0}function B(){this._call=this._time=this._next=null}function O(t,e,n){var r=new B;return r.restart(t,e,n),r}function j(){v=(m=b.now())+g,x=d=0;try{!function(){w(),++x;for(var t,e=h;e;)(t=v-e._time)>=0&&e._call.call(void 0,t),e=e._next;--x}()}finally{x=0,function(){for(var t,e,n=h,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:h=e);p=t,S(r)}(),v=0}}function E(){var t=b.now(),e=t-m;e>1e3&&(g-=e,m=t)}function S(t){x||(d&&(d=clearTimeout(d)),t-v>24?(t<1/0&&(d=setTimeout(j,t-b.now()-g)),y&&(y=clearInterval(y))):(y||(m=b.now(),y=setInterval(E,1e3)),x=1,M(j)))}B.prototype=O.prototype={constructor:B,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?w():+n)+(null==e?0:+e),this._next||p===this||(p?p._next=this:h=this,p=this),this._call=t,this._time=n,S()},stop:function(){this._call&&(this._call=null,this._time=1/0,S())}};class A{constructor(){this.shouldAnimate=!0,this.subscribers=[],this.timer=null,this.activeSubscriptions=0}bypassAnimation(){this.shouldAnimate=!1}resumeAnimation(){this.shouldAnimate=!0}loop=()=>{this.subscribers.forEach((t=>{t.callback(w()-t.startTime,t.duration)}))};start(){this.timer||(this.timer=O(this.loop))}stop(){this.timer&&(this.timer.stop(),this.timer=null)}subscribe(t,e){const n=this.subscribers.push({startTime:w(),callback:t,duration:this.shouldAnimate?e:0});return this.activeSubscriptions++,this.start(),n}unsubscribe(t){null!==t&&this.subscribers[t-1]&&(delete this.subscribers[t-1],this.activeSubscriptions--),0===this.activeSubscriptions&&this.stop()}}const P=i().createContext({transitionTimer:new A,animationTimer:new A});P.displayName="TimerContext";var R=P;function C(t,e){return _(t)?t(e):t}function _(t){return"function"==typeof t}function T(t,e){if(t)return Object.keys(t).reduce(((n,r)=>(n[r]=e(t[r]),n)),{})}r(9082),r(8532);const G={startsWith:["data-","aria-"],exactMatch:[]},z=t=>{const e={...t};return Object.fromEntries(Object.entries(e).filter((t=>{let[e]=t;return(t=>!(!(t=>{let e=!1;return G.startsWith.forEach((n=>{new RegExp(`\\b(${n})(\\w|-)+`,"g").test(t)&&(e=!0)})),e})(t)&&!(t=>G.exactMatch.includes(t))(t)))(e)})).map((e=>{let[n,r]=e;return[n,C(r,t)]})))};function I(){return I=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},I.apply(this,arguments)}class N extends i().Component{static displayName="VictoryContainer";static role="container";static defaultProps={className:"VictoryContainer",portalComponent:i().createElement(l,null),portalZIndex:99,responsive:!0,role:"img"};static contextType=R;constructor(t){super(t),this.containerId=s()(t)&&void 0!==t.containerId?t.containerId:c()("victory-container-"),this.shouldHandleWheel=!!(t&&t.events&&t.events.onWheel)}savePortalRef=t=>(this.portalRef=t,t);portalUpdate=(t,e)=>this.portalRef.portalUpdate(t,e);portalRegister=()=>this.portalRef.portalRegister();portalDeregister=t=>this.portalRef.portalDeregister(t);saveContainerRef=t=>(_(this.props.containerRef)&&this.props.containerRef(t),this.containerRef=t,t);handleWheel=t=>t.preventDefault();componentDidMount(){this.shouldHandleWheel&&this.containerRef&&this.containerRef.addEventListener("wheel",this.handleWheel)}componentWillUnmount(){this.shouldHandleWheel&&this.containerRef&&this.containerRef.removeEventListener("wheel",this.handleWheel)}getIdForElement(t){return`${this.containerId}-${t}`}getChildren(t){return t.children}getOUIAProps(t){const{ouiaId:e,ouiaSafe:n,ouiaType:r}=t;return{...e&&{"data-ouia-component-id":e},...r&&{"data-ouia-component-type":r},...void 0!==n&&{"data-ouia-safe":n}}}renderContainer(t,n,r){const{title:o,desc:a,portalComponent:s,className:u,width:c,height:l,portalZIndex:h,responsive:p}=t,x=this.getChildren(t),d=p?{width:"100%",height:"100%"}:{width:c,height:l},y=Object.assign({pointerEvents:"none",touchAction:"none",position:"relative"},d),m=Object.assign({zIndex:h,position:"absolute",top:0,left:0},d),v=Object.assign({pointerEvents:"all"},d),g=Object.assign({overflow:"visible"},d),b={width:c,height:l,viewBox:n.viewBox,preserveAspectRatio:n.preserveAspectRatio,style:g};return i().createElement(f.Provider,{value:{portalUpdate:this.portalUpdate,portalRegister:this.portalRegister,portalDeregister:this.portalDeregister}},i().createElement("div",I({style:e()({},r,y),className:u,ref:this.saveContainerRef},this.getOUIAProps(t)),i().createElement("svg",I({},n,{style:v}),o?i().createElement("title",{id:this.getIdForElement("title")},o):null,a?i().createElement("desc",{id:this.getIdForElement("desc")},a):null,x),i().createElement("div",{style:m},i().cloneElement(s,{...b,ref:this.savePortalRef}))))}render(){const{width:t,height:e,responsive:n,events:r,title:o,desc:i,tabIndex:a,preserveAspectRatio:s,role:u}=this.props,c=n?this.props.style:function(t,e){void 0===e&&(e=[]);const n={};for(const r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}(this.props.style,["height","width"]),l=z(this.props),f=Object.assign({width:t,height:e,tabIndex:a,role:u,"aria-labelledby":[o&&this.getIdForElement("title"),this.props["aria-labelledby"]].filter(Boolean).join(" ")||void 0,"aria-describedby":[i&&this.getIdForElement("desc"),this.props["aria-describedby"]].filter(Boolean).join(" ")||void 0,viewBox:n?`0 0 ${t} ${e}`:void 0,preserveAspectRatio:n?s:void 0,...l},r);return this.renderContainer(this.props,f,c)}}function U(){return U=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},U.apply(this,arguments)}const V=(0,n.forwardRef)(((t,e)=>{const{desc:n,id:r,tabIndex:o,origin:a,...s}=t,u={vectorEffect:"non-scaling-stroke",id:C(r,t)?.toString(),tabIndex:C(o,t),...s};return n?i().createElement("rect",U({},u,{ref:e}),i().createElement("desc",null,n)):i().createElement("rect",U({},u,{ref:e}))}));function W(t){return Array.isArray(t)&&t.some((t=>t instanceof Date))}function k(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];const o=t.concat(n);return W(o)?new Date(Math.max(...o)):Math.max(...o)}function $(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];const o=t.concat(n);return W(o)?new Date(Math.min(...o)):Math.min(...o)}function H(t,e,n){const{a:r,d:o,e:i,f:a}=e;return"y"===n?o*t+a:r*t+i}function F(t){return!(!t||void 0===t.identifier)}function X(t){if(F(t.nativeEvent))return;const e=t=>"svg"===t.nodeName?t:t.parentNode?e(t.parentNode):t;return e(t.target)}function Y(t,e){if(F(t.nativeEvent))return{x:t.nativeEvent.locationX,y:t.nativeEvent.locationY};const n=function(t){return t.changedTouches&&t.changedTouches.length>0}(t)?t.changedTouches[0]:t,r=function(t){return t.getScreenCTM().inverse()}(e||X(n));return{x:H(n.clientX,r,"x"),y:H(n.clientY,r,"y")}}function q(t,e){const{horizontal:n}=t,r=t.scale,o=e||{x:r.x.domain(),y:r.y.domain()};return{x:n?[r.y(o.y[0]),r.y(o.y[1])]:[r.x(o.x[0]),r.x(o.x[1])],y:n?[r.x(o.x[0]),r.x(o.x[1])]:[r.y(o.y[0]),r.y(o.y[1])]}}function L(t,e,n,r){const{polar:o,horizontal:i}=t;if(!o)return{x:i?e.x.invert(r):e.x.invert(n),y:i?e.y.invert(n):e.y.invert(r)};const a=t.origin||{x:0,y:0},s=n-a.x,u=r-a.y,c=Math.abs(s*Math.sqrt(1+Math.pow(-u/s,2))),l=(-Math.atan2(u,s)+2*Math.PI)%(2*Math.PI);return{x:e.x.invert(l),y:e.y.invert(c)}}function Z(t){const{x1:e,x2:n,y1:r,y2:o,scale:i}=t,a=L(t,i,e,r),s=L(t,i,n,o),u=(t,e)=>[$([t,e]),k([t,e])];return{x:u(a.x,s.x),y:u(a.y,s.y)}}var J=r(8163),K=r.n(J),Q=r(7491),tt=r.n(Q);const et={getDimension(t){const{horizontal:e,brushDimension:n}=t;return e&&n?"x"===n?"y":"x":n},withinBounds(t,e,n){const{x1:r,x2:o,y1:i,y2:a}=T(e,Number),{x:s,y:u}=T(t,Number),c=n?n/2:0;return s+c>=Math.min(r,o)&&s-c<=Math.max(r,o)&&u+c>=Math.min(i,a)&&u-c<=Math.max(i,a)},getDomainBox(t,n,r){const o=this.getDimension(t),i=e()({},n,t.domain),a=e()({},r,i),s=q(t,i),u=q(t,a);return{x1:"y"!==o?Math.min(...u.x):Math.min(...s.x),x2:"y"!==o?Math.max(...u.x):Math.max(...s.x),y1:"x"!==o?Math.min(...u.y):Math.min(...s.y),y2:"x"!==o?Math.max(...u.y):Math.max(...s.y)}},getHandles(t,e){const n=this.getDimension(t),{x1:r,x2:o,y1:i,y2:a}=e,s=Math.min(r,o),u=Math.max(r,o),c=Math.min(i,a),l=Math.max(i,a),f=t.handleWidth/2;return{left:"y"!==n&&{x1:s-f,x2:s+f,y1:i,y2:a},right:"y"!==n&&{x1:u-f,x2:u+f,y1:i,y2:a},top:"x"!==n&&{x1:r,x2:o,y1:c-f,y2:c+f},bottom:"x"!==n&&{x1:r,x2:o,y1:l-f,y2:l+f}}},getActiveHandles(t,e,n){const r=this.getHandles(e,n),o=["top","bottom","left","right"].reduce(((e,n)=>r[n]&&this.withinBounds(t,r[n])?e.concat(n):e),[]);return o.length&&o},getResizeMutation(t,e){const{x1:n,y1:r,x2:o,y2:i}=t,a={left:{x1:Math.max(n,o),x2:Math.min(n,o),y1:r,y2:i},right:{x1:Math.min(n,o),x2:Math.max(n,o),y1:r,y2:i},top:{y1:Math.max(r,i),y2:Math.min(r,i),x1:n,x2:o},bottom:{y1:Math.min(r,i),y2:Math.max(r,i),x1:n,x2:o}};return e.reduce(((t,e)=>Object.assign(t,a[e])),{})},getMinimumDomain:()=>({x:[0,1/Number.MAX_SAFE_INTEGER],y:[0,1/Number.MAX_SAFE_INTEGER]}),getDefaultBrushArea(t,e,n){const{domain:r,fullDomain:o,scale:i,horizontal:a,allowResize:s}=t,u=s||t.defaultBrushArea?t.defaultBrushArea:"move";if("none"===u)return this.getMinimumDomain();if("disable"===u)return e;if("move"===u){const r=this.getDomainBox(t,o,e),s=t.parentSVG||X(n),u=this.panBox({...t,...r,brushDomain:e,startX:(r.x1+r.x2)/2,startY:(r.y1+r.y2)/2},Y(n,s)),c=t.fullDomainBox||this.getDomainBox(t,o);return Z({...this.constrainBox(u,c),scale:i,horizontal:a})}return r},getSelectionMutation(t,e,n){const{x:r,y:o}=t,{x1:i,x2:a,y1:s,y2:u}=e;return{x1:"y"!==n?r:i,y1:"x"!==n?o:s,x2:"y"!==n?r:a,y2:"x"!==n?o:u}},panBox(t,n){const{domain:r,startX:o,startY:i}=t,a=this.getDimension(t),s=e()({},t.brushDomain,r),u=e()({},t.fullDomain,r),{x1:c,x2:l,y1:f,y2:h}=t.x1?t:this.getDomainBox(t,u,s),{x:p,y:x}=n,d=o?o-p:0,y=i?i-x:0;return{x1:"y"!==a?Math.min(c,l)-d:Math.min(c,l),x2:"y"!==a?Math.max(c,l)-d:Math.max(c,l),y1:"x"!==a?Math.min(f,h)-y:Math.min(f,h),y2:"x"!==a?Math.max(f,h)-y:Math.max(f,h)}},constrainBox(t,e){const{x1:n,y1:r,x2:o,y2:i}=T(e,Number);return{x1:t.x2>o?o-Math.abs(t.x2-t.x1):Math.max(t.x1,n),y1:t.y2>i?i-Math.abs(t.y2-t.y1):Math.max(t.y1,r),x2:t.x1<n?n+Math.abs(t.x2-t.x1):Math.min(t.x2,o),y2:t.y1<r?r+Math.abs(t.y2-t.y1):Math.min(t.y2,i)}},constrainPoint(t,e){const{x1:n,y1:r,x2:o,y2:i}=T(e,Number);return{x:Math.min(Math.max(t.x,n),o),y:Math.min(Math.max(t.y,r),i)}},hasMoved(t){const{x1:e,x2:n,y1:r,y2:o,mouseMoveThreshold:i}=t,a=this.getDimension(t),s=Math.abs(e-n)>=i,u=Math.abs(r-o)>=i;switch(a){case"x":return s;case"y":return u;default:return s||u}},onMouseDown(t,n){t.preventDefault();const{handleWidth:r,cachedBrushDomain:o,domain:i,allowResize:a,allowDrag:s,allowDraw:u}=n,c=this.getDimension(n),l=a||n.defaultBrushArea?n.defaultBrushArea:"move";if(!a&&!s)return{};const f=n.fullDomainBox||this.getDomainBox(n,i),h=n.parentSVG||X(t),{x:p,y:x}=Y(t,h);if(!this.withinBounds({x:p,y:x},f,r))return{};const d=e()({},n.brushDomain,i),y=tt()(d,o)?n.currentDomain||d||i:d||i,m=this.getDomainBox(n,i,y),v=a&&this.getActiveHandles({x:p,y:x},n,m);return v?[{target:"parent",mutation:()=>({isSelecting:!0,domainBox:m,fullDomainBox:f,cachedBrushDomain:d,currentDomain:y,parentSVG:h,...this.getResizeMutation(m,v)})}]:this.withinBounds({x:p,y:x},m)&&!tt()(i,y)?[{target:"parent",mutation:()=>({isPanning:s,startX:p,startY:x,domainBox:m,fullDomainBox:f,currentDomain:y,cachedBrushDomain:d,parentSVG:h,...m})}]:u?[{target:"parent",mutation:()=>({isSelecting:a||"move"===l,domainBox:m,fullDomainBox:f,parentSVG:h,cachedBrushDomain:d,cachedCurrentDomain:y,currentDomain:this.getMinimumDomain(),...this.getSelectionMutation({x:p,y:x},m,c)})}]:{}},onGlobalMouseMove(t,n){const{scale:r,isPanning:o,isSelecting:i,fullDomainBox:a,onBrushDomainChange:s,allowResize:u,allowDrag:c,horizontal:l,mouseMoveThreshold:f,parentSVG:h}=n,p=this.getDimension(n),{x:x,y:d}=Y(t,h);if(!u&&!c||f>0&&!this.hasMoved({...n,x2:x,y2:d}))return{};if(c&&o){const{startX:t,startY:o}=n,i=this.panBox(n,{x:x,y:d}),u=this.constrainBox(i,a),c=Z({...u,scale:r,horizontal:l}),f={currentDomain:c,parentSVG:h,startX:i.x2>=a.x2||i.x1<=a.x1?t:x,startY:i.y2>=a.y2||i.y1<=a.y1?o:d,...u};return _(s)&&s(c,e()({},f,n)),[{target:"parent",mutation:()=>f}]}if(u&&i){const{x:t,y:o}=this.constrainPoint({x:"y"!==p?x:n.x2,y:"x"!==p?d:n.y2},a),i=Z({x2:t,y2:o,x1:n.x1,y1:n.y1,scale:r,horizontal:l}),u={x2:t,y2:o,currentDomain:i,parentSVG:h};return _(s)&&s(i,e()({},u,n)),[{target:"parent",mutation:()=>u}]}return{}},onGlobalMouseUp(t,n){if(!n.isPanning&&!n.isSelecting)return{};const{x1:r,y1:o,x2:i,y2:a,isPanning:s,isSelecting:u,onBrushDomainChange:c,onBrushDomainChangeEnd:l,onBrushCleared:f,currentDomain:h,allowResize:p,allowDrag:x}=n,d=p||n.defaultBrushArea?n.defaultBrushArea:"move",y={isPanning:!1,isSelecting:!1};if(!p&&(void 0===d||"none"===d)||r!==i&&o!==a)(x&&s||p&&u)&&_(l)&&l(h,e()({},y,n));else{const r=n.cachedCurrentDomain||h,o=this.getDefaultBrushArea(n,r,t);y.currentDomain=o,_(c)&&c(o,e()({},y,n)),_(l)&&l(o,e()({},y,n)),_(f)&&f(o,e()({},y,n))}return[{target:"parent",mutation:()=>y}]}},nt={...et,onMouseDown:et.onMouseDown.bind(et),onGlobalMouseUp:et.onGlobalMouseUp.bind(et),onGlobalMouseMove:K()(et.onGlobalMouseMove.bind(et),16,{leading:!0,trailing:!1})};function rt(t){return class extends t{static displayName="VictoryBrushContainer";static defaultProps={...N.defaultProps,allowDrag:!0,allowDraw:!0,allowResize:!0,brushComponent:i().createElement(V,null),brushStyle:{stroke:"transparent",fill:"black",fillOpacity:.1},handleComponent:i().createElement(V,null),handleStyle:{stroke:"transparent",fill:"transparent"},handleWidth:8,mouseMoveThreshold:0};static defaultEvents=t=>[{target:"parent",eventHandlers:{onMouseDown:(e,n)=>t.disable?{}:nt.onMouseDown(e,n),onTouchStart:(e,n)=>t.disable?{}:nt.onMouseDown(e,n),onGlobalMouseMove:(e,n)=>t.disable||!n.isPanning&&!n.isSelecting?{}:nt.onGlobalMouseMove(e,n),onGlobalTouchMove:(e,n)=>t.disable||!n.isPanning&&!n.isSelecting?{}:nt.onGlobalMouseMove(e,n),onGlobalMouseUp:(e,n)=>t.disable?{}:nt.onGlobalMouseUp(e,n),onGlobalTouchEnd:(e,n)=>t.disable?{}:nt.onGlobalMouseUp(e,n),onGlobalTouchCancel:(e,n)=>t.disable?{}:nt.onGlobalMouseUp(e,n)}}];getSelectBox(t,n){const{x:r,y:o}=n,{brushStyle:a,brushComponent:s,name:u}=t,c=s.props&&s.props.style,l=t.allowDrag||t.allowResize?"move":"auto";return r[0]!==r[1]&&o[0]!==o[1]?i().cloneElement(s,{key:`${u}-brush`,width:Math.abs(r[1]-r[0])||1,height:Math.abs(o[1]-o[0])||1,x:Math.min(r[0],r[1]),y:Math.min(o[0],o[1]),cursor:l,style:e()({},c,a)}):null}getCursorPointers(t){const e={yProps:"ns-resize",xProps:"ew-resize"};return!t.allowResize&&t.allowDrag?(e.xProps="move",e.yProps="move"):t.allowResize||t.allowDrag||(e.xProps="auto",e.yProps="auto"),e}getHandles(t,n){const{handleWidth:r,handleStyle:o,handleComponent:a,name:s}=t,u=nt.getDomainBox(t,n),{x1:c,x2:l,y1:f,y2:h}=u,{top:p,bottom:x,left:d,right:y}=nt.getHandles(t,u),m=Math.abs(l-c)||1,v=Math.abs(h-f)||1,g=a.props&&a.props.style||{},b=e()({},g,o),M=this.getCursorPointers(t),w={style:b,width:m,height:r,cursor:M.yProps},D={style:b,width:r,height:v,cursor:M.xProps},B={top:p&&Object.assign({x:p.x1,y:p.y1},w),bottom:x&&Object.assign({x:x.x1,y:x.y1},w),left:d&&Object.assign({y:d.y1,x:d.x1},D),right:y&&Object.assign({y:y.y1,x:y.x1},D)},O=["top","bottom","left","right"].reduce(((t,e)=>B[e]?t.concat(i().cloneElement(a,Object.assign({key:`${s}-handle-${e}`},B[e]))):t),[]);return O.length?O:null}getRect(t){const{currentDomain:n,cachedBrushDomain:r}=t,o=e()({},t.brushDomain,t.domain),i=tt()(o,r)?e()({},n,o):o,a=q(t,i),s=this.getSelectBox(t,a);return s?[s,this.getHandles(t,i)]:[]}getChildren(t){return[...i().Children.toArray(t.children),...this.getRect(t)]}}}const ot=rt(N)}(),o}()}));
2
2
  //# sourceMappingURL=victory-brush-container.min.js.map