cl-react-graph
Version:
2 lines • 36.1 kB
JavaScript
(self.webpackChunkdocs2=self.webpackChunkdocs2||[]).push([[209],{9662:function(t,e,n){var r=n(7854),o=n(614),i=n(6330),a=r.TypeError;t.exports=function(t){if(o(t))return t;throw a(i(t)+" is not a function")}},9670:function(t,e,n){var r=n(7854),o=n(111),i=r.String,a=r.TypeError;t.exports=function(t){if(o(t))return t;throw a(i(t)+" is not an object")}},1318:function(t,e,n){var r=n(5656),o=n(1400),i=n(6244),a=function(t){return function(e,n,a){var u,c=r(e),s=i(c),f=o(a,s);if(t&&n!=n){for(;s>f;)if((u=c[f++])!=u)return!0}else for(;s>f;f++)if((t||f in c)&&c[f]===n)return t||f||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},4326:function(t,e,n){var r=n(1702),o=r({}.toString),i=r("".slice);t.exports=function(t){return i(o(t),8,-1)}},9920:function(t,e,n){var r=n(2597),o=n(3887),i=n(1236),a=n(3070);t.exports=function(t,e,n){for(var u=o(e),c=a.f,s=i.f,f=0;f<u.length;f++){var l=u[f];r(t,l)||n&&r(n,l)||c(t,l,s(e,l))}}},8880:function(t,e,n){var r=n(9781),o=n(3070),i=n(9114);t.exports=r?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},9114:function(t){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},9781:function(t,e,n){var r=n(7293);t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},317:function(t,e,n){var r=n(7854),o=n(111),i=r.document,a=o(i)&&o(i.createElement);t.exports=function(t){return a?i.createElement(t):{}}},8113:function(t,e,n){var r=n(5005);t.exports=r("navigator","userAgent")||""},7392:function(t,e,n){var r,o,i=n(7854),a=n(8113),u=i.process,c=i.Deno,s=u&&u.versions||c&&c.version,f=s&&s.v8;f&&(o=(r=f.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(o=+r[1]),t.exports=o},3281:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:function(t,e,n){var r=n(7854),o=n(1236).f,i=n(8880),a=n(1320),u=n(3505),c=n(9920),s=n(4705);t.exports=function(t,e){var n,f,l,d,v,p=t.target,h=t.global,g=t.stat;if(n=h?r:g?r[p]||u(p,{}):(r[p]||{}).prototype)for(f in e){if(d=e[f],l=t.noTargetGet?(v=o(n,f))&&v.value:n[f],!s(h?f:p+(g?".":"#")+f,t.forced)&&void 0!==l){if(typeof d==typeof l)continue;c(d,l)}(t.sham||l&&l.sham)&&i(d,"sham",!0),a(n,f,d,t)}}},7293:function(t){t.exports=function(t){try{return!!t()}catch(e){return!0}}},4374:function(t,e,n){var r=n(7293);t.exports=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},6916:function(t,e,n){var r=n(4374),o=Function.prototype.call;t.exports=r?o.bind(o):function(){return o.apply(o,arguments)}},6530:function(t,e,n){var r=n(9781),o=n(2597),i=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,u=o(i,"name"),c=u&&"something"===function(){}.name,s=u&&(!r||r&&a(i,"name").configurable);t.exports={EXISTS:u,PROPER:c,CONFIGURABLE:s}},1702:function(t,e,n){var r=n(4374),o=Function.prototype,i=o.bind,a=o.call,u=r&&i.bind(a,a);t.exports=r?function(t){return t&&u(t)}:function(t){return t&&function(){return a.apply(t,arguments)}}},5005:function(t,e,n){var r=n(7854),o=n(614),i=function(t){return o(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?i(r[t]):r[t]&&r[t][e]}},8173:function(t,e,n){var r=n(9662);t.exports=function(t,e){var n=t[e];return null==n?void 0:r(n)}},7854:function(t,e,n){var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},2597:function(t,e,n){var r=n(1702),o=n(7908),i=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return i(o(t),e)}},3501:function(t){t.exports={}},4664:function(t,e,n){var r=n(9781),o=n(7293),i=n(317);t.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},8361:function(t,e,n){var r=n(7854),o=n(1702),i=n(7293),a=n(4326),u=r.Object,c=o("".split);t.exports=i((function(){return!u("z").propertyIsEnumerable(0)}))?function(t){return"String"==a(t)?c(t,""):u(t)}:u},2788:function(t,e,n){var r=n(1702),o=n(614),i=n(5465),a=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return a(t)}),t.exports=i.inspectSource},9909:function(t,e,n){var r,o,i,a=n(8536),u=n(7854),c=n(1702),s=n(111),f=n(8880),l=n(2597),d=n(5465),v=n(6200),p=n(3501),h="Object already initialized",g=u.TypeError,m=u.WeakMap;if(a||d.state){var y=d.state||(d.state=new m),b=c(y.get),w=c(y.has),x=c(y.set);r=function(t,e){if(w(y,t))throw new g(h);return e.facade=t,x(y,t,e),e},o=function(t){return b(y,t)||{}},i=function(t){return w(y,t)}}else{var S=v("state");p[S]=!0,r=function(t,e){if(l(t,S))throw new g(h);return e.facade=t,f(t,S,e),e},o=function(t){return l(t,S)?t[S]:{}},i=function(t){return l(t,S)}}t.exports={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!s(e)||(n=o(e)).type!==t)throw g("Incompatible receiver, "+t+" required");return n}}}},614:function(t){t.exports=function(t){return"function"==typeof t}},4705:function(t,e,n){var r=n(7293),o=n(614),i=/#|\.prototype\./,a=function(t,e){var n=c[u(t)];return n==f||n!=s&&(o(e)?r(e):!!e)},u=a.normalize=function(t){return String(t).replace(i,".").toLowerCase()},c=a.data={},s=a.NATIVE="N",f=a.POLYFILL="P";t.exports=a},111:function(t,e,n){var r=n(614);t.exports=function(t){return"object"==typeof t?null!==t:r(t)}},1913:function(t){t.exports=!1},2190:function(t,e,n){var r=n(7854),o=n(5005),i=n(614),a=n(7976),u=n(3307),c=r.Object;t.exports=u?function(t){return"symbol"==typeof t}:function(t){var e=o("Symbol");return i(e)&&a(e.prototype,c(t))}},6244:function(t,e,n){var r=n(7466);t.exports=function(t){return r(t.length)}},133:function(t,e,n){var r=n(7392),o=n(7293);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},8536:function(t,e,n){var r=n(7854),o=n(614),i=n(2788),a=r.WeakMap;t.exports=o(a)&&/native code/.test(i(a))},3070:function(t,e,n){var r=n(7854),o=n(9781),i=n(4664),a=n(3353),u=n(9670),c=n(4948),s=r.TypeError,f=Object.defineProperty,l=Object.getOwnPropertyDescriptor,d="enumerable",v="configurable",p="writable";e.f=o?a?function(t,e,n){if(u(t),e=c(e),u(n),"function"==typeof t&&"prototype"===e&&"value"in n&&p in n&&!n.writable){var r=l(t,e);r&&r.writable&&(t[e]=n.value,n={configurable:v in n?n.configurable:r.configurable,enumerable:d in n?n.enumerable:r.enumerable,writable:!1})}return f(t,e,n)}:f:function(t,e,n){if(u(t),e=c(e),u(n),i)try{return f(t,e,n)}catch(r){}if("get"in n||"set"in n)throw s("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},1236:function(t,e,n){var r=n(9781),o=n(6916),i=n(5296),a=n(9114),u=n(5656),c=n(4948),s=n(2597),f=n(4664),l=Object.getOwnPropertyDescriptor;e.f=r?l:function(t,e){if(t=u(t),e=c(e),f)try{return l(t,e)}catch(n){}if(s(t,e))return a(!o(i.f,t,e),t[e])}},8006:function(t,e,n){var r=n(6324),o=n(3281).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},5181:function(t,e){e.f=Object.getOwnPropertySymbols},7976:function(t,e,n){var r=n(1702);t.exports=r({}.isPrototypeOf)},6324:function(t,e,n){var r=n(1702),o=n(2597),i=n(5656),a=n(1318).indexOf,u=n(3501),c=r([].push);t.exports=function(t,e){var n,r=i(t),s=0,f=[];for(n in r)!o(u,n)&&o(r,n)&&c(f,n);for(;e.length>s;)o(r,n=e[s++])&&(~a(f,n)||c(f,n));return f}},5296:function(t,e){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!n.call({1:2},1);e.f=o?function(t){var e=r(this,t);return!!e&&e.enumerable}:n},2140:function(t,e,n){var r=n(7854),o=n(6916),i=n(614),a=n(111),u=r.TypeError;t.exports=function(t,e){var n,r;if("string"===e&&i(n=t.toString)&&!a(r=o(n,t)))return r;if(i(n=t.valueOf)&&!a(r=o(n,t)))return r;if("string"!==e&&i(n=t.toString)&&!a(r=o(n,t)))return r;throw u("Can't convert object to primitive value")}},3887:function(t,e,n){var r=n(5005),o=n(1702),i=n(8006),a=n(5181),u=n(9670),c=o([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=i.f(u(t)),n=a.f;return n?c(e,n(t)):e}},1320:function(t,e,n){var r=n(7854),o=n(614),i=n(2597),a=n(8880),u=n(3505),c=n(2788),s=n(9909),f=n(6530).CONFIGURABLE,l=s.get,d=s.enforce,v=String(String).split("String");(t.exports=function(t,e,n,c){var s,l=!!c&&!!c.unsafe,p=!!c&&!!c.enumerable,h=!!c&&!!c.noTargetGet,g=c&&void 0!==c.name?c.name:e;o(n)&&("Symbol("===String(g).slice(0,7)&&(g="["+String(g).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!i(n,"name")||f&&n.name!==g)&&a(n,"name",g),(s=d(n)).source||(s.source=v.join("string"==typeof g?g:""))),t!==r?(l?!h&&t[e]&&(p=!0):delete t[e],p?t[e]=n:a(t,e,n)):p?t[e]=n:u(e,n)})(Function.prototype,"toString",(function(){return o(this)&&l(this).source||c(this)}))},4488:function(t,e,n){var r=n(7854).TypeError;t.exports=function(t){if(null==t)throw r("Can't call method on "+t);return t}},3505:function(t,e,n){var r=n(7854),o=Object.defineProperty;t.exports=function(t,e){try{o(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},6200:function(t,e,n){var r=n(2309),o=n(9711),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},5465:function(t,e,n){var r=n(7854),o=n(3505),i="__core-js_shared__",a=r[i]||o(i,{});t.exports=a},2309:function(t,e,n){var r=n(1913),o=n(5465);(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.21.1",mode:r?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE",source:"https://github.com/zloirock/core-js"})},1400:function(t,e,n){var r=n(9303),o=Math.max,i=Math.min;t.exports=function(t,e){var n=r(t);return n<0?o(n+e,0):i(n,e)}},5656:function(t,e,n){var r=n(8361),o=n(4488);t.exports=function(t){return r(o(t))}},9303:function(t){var e=Math.ceil,n=Math.floor;t.exports=function(t){var r=+t;return r!=r||0===r?0:(r>0?n:e)(r)}},7466:function(t,e,n){var r=n(9303),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},7908:function(t,e,n){var r=n(7854),o=n(4488),i=r.Object;t.exports=function(t){return i(o(t))}},7593:function(t,e,n){var r=n(7854),o=n(6916),i=n(111),a=n(2190),u=n(8173),c=n(2140),s=n(5112),f=r.TypeError,l=s("toPrimitive");t.exports=function(t,e){if(!i(t)||a(t))return t;var n,r=u(t,l);if(r){if(void 0===e&&(e="default"),n=o(r,t,e),!i(n)||a(n))return n;throw f("Can't convert object to primitive value")}return void 0===e&&(e="number"),c(t,e)}},4948:function(t,e,n){var r=n(7593),o=n(2190);t.exports=function(t){var e=r(t,"string");return o(e)?e:e+""}},6330:function(t,e,n){var r=n(7854).String;t.exports=function(t){try{return r(t)}catch(e){return"Object"}}},9711:function(t,e,n){var r=n(1702),o=0,i=Math.random(),a=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++o+i,36)}},3307:function(t,e,n){var r=n(133);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3353:function(t,e,n){var r=n(9781),o=n(7293);t.exports=r&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},5112:function(t,e,n){var r=n(7854),o=n(2309),i=n(2597),a=n(9711),u=n(133),c=n(3307),s=o("wks"),f=r.Symbol,l=f&&f.for,d=c?f:f&&f.withoutSetter||a;t.exports=function(t){if(!i(s,t)||!u&&"string"!=typeof s[t]){var e="Symbol."+t;u&&i(f,t)?s[t]=f[t]:s[t]=c&&l?l(e):d(e)}return s[t]}},5438:function(t,e,n){var r=n(2109),o=Math.hypot,i=Math.abs,a=Math.sqrt;r({target:"Math",stat:!0,forced:!!o&&o(1/0,NaN)!==1/0},{hypot:function(t,e){for(var n,r,o=0,u=0,c=arguments.length,s=0;u<c;)s<(n=i(arguments[u++]))?(o=o*(r=s/n)*r+1,s=n):o+=n>0?(r=n/s)*r:n;return s===1/0?1/0:s*a(o)}})},7039:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return Pt}});var r=n(6629),o=n(1634),i=n(7294),a=n(7345),u=n(141);n(5438);function c(t,e){return t.map((function(t,n){return t+e[n]}))}function s(t,e){return t.map((function(t,n){return t-e[n]}))}function f(t){return Math.hypot.apply(Math,t)}function l(t,e,n){var r=f(e),o=0===r?0:1/r,i=0===n?0:1/n,a=i*r,u=e.map((function(t){return i*t})),c=e.map((function(t){return o*t}));return{velocities:u,velocity:a,distance:f(t),direction:c}}function d(t){return Math.sign?Math.sign(t):Number(t>0)-Number(t<0)||+t}function v(t,e,n){return 0===e||Math.abs(e)===1/0?function(t,e){return Math.pow(t,5*e)}(t,n):t*e*n/(e+n*t)}function p(t,e,n,r){return void 0===r&&(r=.15),0===r?function(t,e,n){return Math.max(e,Math.min(t,n))}(t,e,n):t<e?-v(e-t,n-e,r)+e:t>n?+v(t-n,n-e,r)+n:t}function h(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function g(){return g=Object.assign||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},g.apply(this,arguments)}function m(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function y(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}function b(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function x(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return w(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=t[Symbol.iterator]()).next.bind(n)}function S(){}function _(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return 0===e.length?S:1===e.length?e[0]:function(){for(var t,n,r=x(e);!(n=r()).done;){var o=n.value;t=o.apply(this,arguments)||t}return t}}function O(t,e){if(void 0===t){if(void 0===e)throw new Error("Must define fallback value if undefined is expected");t=e}return Array.isArray(t)?t:[t,t]}function E(t){if("function"==typeof t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return t.apply(void 0,n)}return t}function T(t,e){void 0===t&&(t={});for(var n={},r=0,o=Object.entries(e);r<o.length;r++){var i=o[r],a=i[0],u=i[1];switch(typeof u){case"function":n[a]=u.call(n,t[a],a,t);break;case"object":n[a]=T(t[a],u);break;case"boolean":u&&(n[a]=t[a])}}return n}function D(){return"undefined"!=typeof window&&"ontouchstart"in window}function P(t){return"pointerId"in t?null:"touchend"===t.type?t.changedTouches:t.targetTouches}function k(t){return Array.from(P(t)).map((function(t){return t.identifier}))}function j(t){return{buttons:"buttons"in t?t.buttons:0,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey,ctrlKey:t.ctrlKey}}var I=function(t){return t};function M(t,e){void 0===e&&(e=I);var n=P(t),r=n?n[0]:t;return e([r.clientX,r.clientY])}var C={threshold:function(t){return void 0===t&&(t=0),O(t)},rubberband:function(t){switch(void 0===t&&(t=0),t){case!0:return O(.15);case!1:return O(0);default:return O(t)}},enabled:function(t){return void 0===t&&(t=!0),t},triggerAllEvents:function(t){return void 0===t&&(t=!1),t},initial:function(t){return void 0===t&&(t=0),"function"==typeof t?t:O(t)},transform:!0},A=g({},C,{axis:!0,lockDirection:function(t){return void 0===t&&(t=!1),t},bounds:function(t){if(void 0===t&&(t={}),"function"==typeof t)return function(e){return A.bounds(t(e))};var e=t,n=e.left,r=void 0===n?-1/0:n,o=e.right,i=void 0===o?1/0:o,a=e.top,u=void 0===a?-1/0:a,c=e.bottom;return[[r,i],[u,void 0===c?1/0:c]]}}),K="undefined"!=typeof window&&window.document&&window.document.createElement,L={enabled:function(t){return void 0===t&&(t=!0),t},domTarget:!0,window:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){return void 0===t&&(t=K?window:void 0),t})),eventOptions:function(t){var e=void 0===t?{}:t,n=e.passive,r=void 0===n||n,o=e.capture;return{passive:r,capture:void 0!==o&&o}},transform:!0},B=g({},A,{useTouch:function(t){void 0===t&&(t=!1);var e=D(),n="undefined"!=typeof window&&"onpointerdown"in window;return!(!t||!e)||!(!e||n)},experimental_preventWindowScrollY:function(t){return void 0===t&&(t=!1),t},threshold:function(t,e,n){var r=n.filterTaps,o=void 0!==r&&r,i=n.lockDirection,a=void 0!==i&&i,u=n.axis,c=O(t,o?3:a||(void 0===u?void 0:u)?1:0);return this.filterTaps=o,c},swipeVelocity:function(t){return void 0===t&&(t=.5),O(t)},swipeDistance:function(t){return void 0===t&&(t=50),O(t)},swipeDuration:function(t){return void 0===t&&(t=250),t},delay:function(t){switch(void 0===t&&(t=0),t){case!0:return 180;case!1:return 0;default:return t}}});function G(t){return void 0===t&&(t={}),T(t,L)}function F(t){return void 0===t&&(t={}),T(t,B)}function z(t){var e=t.domTarget,n=t.eventOptions,r=t.window,o=t.enabled,i=y(t,["domTarget","eventOptions","window","enabled"]),a=G({domTarget:e,eventOptions:n,window:r,enabled:o});return a.drag=F(i),a}function W(t){return g({_active:!1,_blocked:!1,_intentional:[!1,!1],_movement:[0,0],_initial:[0,0],_bounds:[[-1/0,1/0],[-1/0,1/0]],_threshold:[0,0],_lastEventType:void 0,_dragStarted:!1,_dragPreventScroll:!1,_dragIsTap:!0,_dragDelayed:!1,event:void 0,intentional:!1,values:[0,0],velocities:[0,0],delta:[0,0],movement:[0,0],offset:[0,0],lastOffset:[0,0],direction:[0,0],initial:[0,0],previous:[0,0],first:!1,last:!1,active:!1,timeStamp:0,startTime:0,elapsedTime:0,cancel:S,canceled:!1,memo:void 0,args:void 0},t)}function R(){return{shared:{hovering:!1,scrolling:!1,wheeling:!1,dragging:!1,moving:!1,pinching:!1,touches:0,buttons:0,down:!1,shiftKey:!1,altKey:!1,metaKey:!1,ctrlKey:!1,locked:!1},drag:W({_pointerId:void 0,axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0,tap:!1,swipe:[0,0]}),pinch:W({_pointerIds:[],da:[0,0],vdva:[0,0],origin:void 0,turns:0}),wheel:W({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),move:W({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),scroll:W({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0})}}var N=new Map,U=function(t){return t},V=function(){function t(t,e){var n=this;void 0===e&&(e=[]),this.controller=t,this.args=e,this.debounced=!0,this.setTimeout=function(t,e){var r;void 0===e&&(e=140),clearTimeout(n.controller.timeouts[n.stateKey]);for(var o=arguments.length,i=new Array(o>2?o-2:0),a=2;a<o;a++)i[a-2]=arguments[a];n.controller.timeouts[n.stateKey]=(r=window).setTimeout.apply(r,[t,e].concat(i))},this.clearTimeout=function(){clearTimeout(n.controller.timeouts[n.stateKey])},this.fireGestureHandler=function(t){if(void 0===t&&(t=!1),n.state._blocked)return n.debounced||(n.state._active=!1,n.clean()),null;if(!t&&!n.state.intentional&&!n.config.triggerAllEvents)return null;if(n.state.intentional){var e=n.state.active,r=n.state._active;n.state.active=r,n.state.first=r&&!e,n.state.last=e&&!r,n.controller.state.shared[n.ingKey]=r}var o=n.controller.pointerIds.size||n.controller.touchIds.size,i=n.controller.state.shared.buttons>0||o>0,a=g({},n.controller.state.shared,n.state,n.mapStateValues(n.state),{locked:!!document.pointerLockElement,touches:o,down:i}),u=n.handler(a);return n.state.memo=void 0!==u?u:n.state.memo,a},this.controller=t,this.args=e}var e,n,r,o=t.prototype;return o.updateSharedState=function(t){Object.assign(this.controller.state.shared,t)},o.updateGestureState=function(t){Object.assign(this.state,t)},o.checkIntentionality=function(t,e){return{_intentional:t,_blocked:!1}},o.getMovement=function(t){var e=this.config.rubberband,n=this.state,r=n._bounds,o=n._initial,i=n._active,a=n._intentional,u=n.lastOffset,f=n.movement,l=n._threshold,d=this.getInternalMovement(t,this.state),v=!1===a[0]?Y(d[0],l[0]):a[0],p=!1===a[1]?Y(d[1],l[1]):a[1],h=this.checkIntentionality([v,p],d);if(h._blocked)return g({},h,{_movement:d,delta:[0,0]});var m=h._intentional,y=d,b=[!1!==m[0]?d[0]-m[0]:0,!1!==m[1]?d[1]-m[1]:0],w=c(b,u),x=i?e:[0,0];return b=q(r,c(b,o),x),g({},h,{intentional:!1!==m[0]||!1!==m[1],_initial:o,_movement:y,movement:b,values:t,offset:q(r,w,x),delta:s(b,f)})},o.clean=function(){this.clearTimeout()},e=t,(n=[{key:"config",get:function(){return this.controller.config[this.stateKey]}},{key:"enabled",get:function(){return this.controller.config.enabled&&this.config.enabled}},{key:"state",get:function(){return this.controller.state[this.stateKey]}},{key:"handler",get:function(){return this.controller.handlers[this.stateKey]}},{key:"transform",get:function(){return this.config.transform||this.controller.config.transform||U}}])&&h(e.prototype,n),r&&h(e,r),t}();function Y(t,e){return Math.abs(t)>=e&&d(t)*e}function q(t,e,n){var r=e[0],o=e[1],i=n[0],a=n[1],u=t[0],c=u[0],s=u[1],f=t[1],l=f[0],d=f[1];return[p(r,c,s,i),p(o,l,d,a)]}function H(t,e,n){var r=t.state,o=e.timeStamp,i=e.type,a=r.values;return{_lastEventType:i,event:e,timeStamp:o,elapsedTime:n?0:o-r.startTime,previous:a}}function X(t,e,n,r){var o=t.state,i=t.config,a=t.stateKey,u=t.args,c=t.transform,f=o.offset,l=n.timeStamp,d=i.initial,v=i.bounds,p=s(c(i.threshold),c([0,0])).map(Math.abs),h=g({},R()[a],{_active:!0,args:u,values:e,initial:null!=r?r:e,_threshold:p,offset:f,lastOffset:f,startTime:l});return g({},h,{_initial:E(d,h),_bounds:E(v,h)})}var Z=function(t){var e=this;this.classes=t,this.pointerIds=new Set,this.touchIds=new Set,this.supportsTouchEvents=D(),this.supportsGestureEvents=function(){try{return"constructor"in GestureEvent}catch(t){return!1}}(),this.bind=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(var o,i={},a=x(e.classes);!(o=a()).done;){var u=o.value;new u(e,n).addBindings(i)}var c=function(t){it(i,t,(function(r){return e.nativeRefs[t](g({},e.state.shared,{event:r,args:n}))}))};for(var s in e.nativeRefs)c(s);return e.config.domTarget?et(e,i):nt(e,i)},this.effect=function(){return e.config.domTarget&&e.bind(),e.clean},this.clean=function(){var t=ot(e.config),n=e.config.eventOptions;t&&ut(t,rt(e.domListeners),n),Object.values(e.timeouts).forEach(clearTimeout),function(t){var e=t.config,n=e.window,r=e.eventOptions,o=t.windowListeners;if(!n)return;for(var i in o){ut(n,o[i],r)}t.windowListeners={}}(e)},this.classes=t,this.state=R(),this.timeouts={},this.domListeners=[],this.windowListeners={}};function $(t,e){"pointerId"in e?t.pointerIds.add(e.pointerId):t.touchIds=new Set(k(e))}function J(t,e){"pointerId"in e?t.pointerIds.delete(e.pointerId):k(e).forEach((function(e){return t.touchIds.delete(e)}))}function Q(t,e,n){var r=t.config,o=t.windowListeners;void 0===n&&(n=r.eventOptions),r.window&&(ut(r.window,o[e],n),delete o[e])}function tt(t,e,n,r){var o=t.config,i=t.windowListeners;void 0===n&&(n=[]),void 0===r&&(r=o.eventOptions),o.window&&(ut(o.window,i[e],r),at(o.window,i[e]=n,r))}function et(t,e){var n=t.config,r=t.domListeners,o=ot(n);if(!o)throw new Error("domTarget must be defined");var i=n.eventOptions;ut(o,rt(r),i);for(var a=0,u=Object.entries(e);a<u.length;a++){var c=u[a],s=c[0],f=c[1],l=s.slice(2).toLowerCase();r.push([l,_.apply(void 0,f)])}at(o,r,i)}function nt(t,e){for(var n={},r=t.config.eventOptions.capture?"Capture":"",o=0,i=Object.entries(e);o<i.length;o++){var a=i[o],u=a[0],c=a[1],s=Array.isArray(c)?c:[c];n[u+r]=_.apply(void 0,s)}return n}function rt(t){return void 0===t&&(t=[]),t.splice(0,t.length)}function ot(t){var e=t.domTarget;return e&&"current"in e?e.current:e}function it(t,e,n){t[e]||(t[e]=[]),t[e].push(n)}function at(t,e,n){void 0===e&&(e=[]),void 0===n&&(n={});for(var r,o=x(e);!(r=o()).done;){var i=r.value,a=i[0],u=i[1];t.addEventListener(a,u,n)}}function ut(t,e,n){void 0===e&&(e=[]),void 0===n&&(n={});for(var r,o=x(e);!(r=o()).done;){var i=r.value,a=i[0],u=i[1];t.removeEventListener(a,u,n)}}function ct(t,e,n){void 0===n&&(n={});var r=function(t){var e=new Set;t.drag&&e.add(N.get("drag"));t.wheel&&e.add(N.get("wheel"));t.scroll&&e.add(N.get("scroll"));t.move&&e.add(N.get("move"));t.pinch&&e.add(N.get("pinch"));t.hover&&e.add(N.get("hover"));return e}(t),o=i.useMemo((function(){return new Z(r)}),[]);return o.config=e,o.handlers=t,o.nativeRefs=n,i.useEffect(o.effect,[]),o.config.domTarget?st:o.bind}function st(){0}var ft=function(t){function e(){return t.apply(this,arguments)||this}m(e,t);var n=e.prototype;return n.getInternalMovement=function(t,e){return s(t,e.initial)},n.checkIntentionality=function(t,e){if(!1===t[0]&&!1===t[1])return{_intentional:t,axis:this.state.axis};var n=e.map(Math.abs),r=n[0],o=n[1],i=this.state.axis||(r>o?"x":r<o?"y":void 0);return this.config.axis||this.config.lockDirection?i?this.config.axis&&i!==this.config.axis?{_intentional:t,_blocked:!0,axis:i}:(t["x"===i?1:0]=!1,{_intentional:t,_blocked:!1,axis:i}):{_intentional:[!1,!1],_blocked:!1,axis:i}:{_intentional:t,_blocked:!1,axis:i}},n.getKinematics=function(t,e){var n=this.getMovement(t);if(!n._blocked){var r=e.timeStamp-this.state.timeStamp;Object.assign(n,l(n.movement,n.delta,r))}return n},n.mapStateValues=function(t){return{xy:t.values,vxvy:t.velocities}},e}(V);function lt(t){"persist"in t&&"function"==typeof t.persist&&t.persist()}var dt=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).ingKey="dragging",e.stateKey="drag",e.setPointerCapture=function(t){if(!e.config.useTouch&&!document.pointerLockElement){var n=t.target,r=t.pointerId;n&&"setPointerCapture"in n&&n.setPointerCapture(r),e.updateGestureState({_dragTarget:n,_dragPointerId:r})}},e.releasePointerCapture=function(){if(!e.config.useTouch&&!document.pointerLockElement){var t=e.state,n=t._dragTarget,r=t._dragPointerId;if(r&&n&&"releasePointerCapture"in n&&(!("hasPointerCapture"in n)||n.hasPointerCapture(r)))try{n.releasePointerCapture(r)}catch(o){}}},e.preventScroll=function(t){e.state._dragPreventScroll&&t.cancelable&&t.preventDefault()},e.getEventId=function(t){return e.config.useTouch?t.changedTouches[0].identifier:t.pointerId},e.isValidEvent=function(t){return e.state._pointerId===e.getEventId(t)},e.shouldPreventWindowScrollY=e.config.experimental_preventWindowScrollY&&e.controller.supportsTouchEvents,e.setUpWindowScrollDetection=function(t){lt(t),tt(e.controller,e.stateKey,[["touchmove",e.preventScroll],["touchend",e.clean.bind(b(e))],["touchcancel",e.clean.bind(b(e))]],{passive:!1}),e.setTimeout(e.startDrag.bind(b(e)),250,t)},e.setUpDelayedDragTrigger=function(t){e.state._dragDelayed=!0,lt(t),e.setTimeout(e.startDrag.bind(b(e)),e.config.delay,t)},e.setStartState=function(t){var n=M(t,e.transform);e.updateSharedState(j(t)),e.updateGestureState(g({},X(b(e),n,t),H(b(e),t,!0),{_pointerId:e.getEventId(t)})),e.updateGestureState(e.getMovement(n))},e.onDragStart=function(t){$(e.controller,t),e.enabled&&!e.state._active&&(e.setStartState(t),e.setPointerCapture(t),e.shouldPreventWindowScrollY?e.setUpWindowScrollDetection(t):e.config.delay>0?e.setUpDelayedDragTrigger(t):e.startDrag(t,!0))},e.onDragChange=function(t){if(!e.state.canceled&&e.state._active&&e.isValidEvent(t)&&(e.state._lastEventType!==t.type||t.timeStamp!==e.state.timeStamp)){var n;if(document.pointerLockElement){var r=t.movementX,o=t.movementY;n=c(e.transform([r,o]),e.state.values)}else n=M(t,e.transform);var i=e.getKinematics(n,t);if(!e.state._dragStarted){if(e.state._dragDelayed)return void e.startDrag(t);if(!e.shouldPreventWindowScrollY)return;if(e.state._dragPreventScroll||!i.axis)return;if("x"!==i.axis)return void(e.state._active=!1);e.startDrag(t)}var a=j(t);e.updateSharedState(a);var u=H(b(e),t),s=f(i._movement),l=e.state._dragIsTap;l&&s>=3&&(l=!1),e.updateGestureState(g({},u,i,{_dragIsTap:l})),e.fireGestureHandler()}},e.onDragEnd=function(t){if(J(e.controller,t),e.isValidEvent(t)&&(e.clean(),e.state._active)){e.state._active=!1;var n=e.state._dragIsTap,r=e.state.velocities,o=r[0],i=r[1],a=e.state.movement,u=a[0],c=a[1],s=e.state._intentional,f=s[0],l=s[1],v=e.config.swipeVelocity,p=v[0],h=v[1],m=e.config.swipeDistance,y=m[0],w=m[1],x=e.config.swipeDuration,S=g({},H(b(e),t),e.getMovement(e.state.values)),_=[0,0];S.elapsedTime<x&&(!1!==f&&Math.abs(o)>p&&Math.abs(u)>y&&(_[0]=d(o)),!1!==l&&Math.abs(i)>h&&Math.abs(c)>w&&(_[1]=d(i))),e.updateSharedState({buttons:0}),e.updateGestureState(g({},S,{tap:n,swipe:_})),e.fireGestureHandler(e.config.filterTaps&&!0===n)}},e.clean=function(){t.prototype.clean.call(b(e)),e.state._dragStarted=!1,e.releasePointerCapture(),Q(e.controller,e.stateKey)},e.onCancel=function(){e.state.canceled||(e.updateGestureState({canceled:!0,_active:!1}),e.updateSharedState({buttons:0}),setTimeout((function(){return e.fireGestureHandler()}),0))},e.onClick=function(t){e.state._dragIsTap||t.stopPropagation()},e}m(e,t);var n=e.prototype;return n.startDrag=function(t,e){void 0===e&&(e=!1),this.state._active&&!this.state._dragStarted&&(e||this.setStartState(t),this.updateGestureState({_dragStarted:!0,_dragPreventScroll:!0,cancel:this.onCancel}),this.clearTimeout(),this.fireGestureHandler())},n.addBindings=function(t){(this.config.useTouch?(it(t,"onTouchStart",this.onDragStart),it(t,"onTouchMove",this.onDragChange),it(t,"onTouchEnd",this.onDragEnd),it(t,"onTouchCancel",this.onDragEnd)):(it(t,"onPointerDown",this.onDragStart),it(t,"onPointerMove",this.onDragChange),it(t,"onPointerUp",this.onDragEnd),it(t,"onPointerCancel",this.onDragEnd)),this.config.filterTaps)&&it(t,this.controller.config.eventOptions.capture?"onClick":"onClickCapture",this.onClick)},e}(ft);function vt(t,e){var n,r,o=[],i=!1;return function(){for(var a=arguments.length,u=new Array(a),c=0;c<a;c++)u[c]=arguments[c];return i&&n===this&&e(u,o)||(r=t.apply(this,u),i=!0,n=this,o=u),r}}function pt(t,e){if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){if(t.constructor!==e.constructor)return!1;var n,r,o,i;if(Array.isArray(t)){if((n=t.length)!==e.length)return!1;for(r=n;0!=r--;)if(!pt(t[r],e[r]))return!1;return!0}if("function"==typeof Map&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(i=t.entries();!(r=i.next()).done;)if(!e.has(r.value[0]))return!1;for(i=t.entries();!(r=i.next()).done;)if(!pt(r.value[1],e.get(r.value[0])))return!1;return!0}if("function"==typeof Set&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(i=t.entries();!(r=i.next()).done;)if(!e.has(r.value[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if((n=(o=Object.keys(t)).length)!==Object.keys(e).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(e,o[r]))return!1;if("undefined"!=typeof Element&&t instanceof Element)return!1;for(r=n;0!=r--;)if(!("_owner"===o[r]&&t.$$typeof||pt(t[o[r]],e[o[r]])))return!1;return!0}return t!=t&&e!=e}function ht(t,e){try{return pt(t,e)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}}function gt(t,e){void 0===e&&(e={}),N.set("drag",dt);var n=(0,i.useRef)();return n.current||(n.current=vt(z,ht)),ct({drag:t},n.current(e))}var mt=function(t){var e=t.children,n=t.height,r=t.width;return i.createElement("rect",{width:r,height:n,fill:"#eee"},e)},yt=function(t){var e=t.onChange,n=t.brushWidth,r=t.width,o=t.height,a=t.top,c=void 0===a?0:a,s=t.left,f=void 0===s?0:s,l=t.chart,d=t.initialPosition,v=d?{x:d.start,y:0,w:n}:{x:0,y:0,w:n},p=(0,i.useState)(v),h=p[0],g=h.x,m=h.y,y=h.w,b=p[1],w={top:0,bottom:o,left:0,right:r-y},x=gt((function(t){var n=t.movement,r=n[0];n[1];e&&e({start:r,end:r+y}),b({x:r,y:0,w:y})}),{initial:function(){return[g,m]},bounds:w}),S=gt((function(t){var n="mousemove"===t._lastEventType?y-t.delta[0]:y;b({x:t.movement[0],y:m,w:n}),e&&e({start:t.movement[0],end:m+n})}),{initial:function(){return[g,m]},bounds:w}),_=gt((function(t){var n="mousemove"===t._lastEventType?y+t.delta[0]:y;b({x:g,y:m,w:n}),e&&e({start:g,end:m+n})}),{initial:function(){return[g,m]},bounds:w});return i.createElement("g",{transform:"translate("+f+", "+c+")"},i.createElement(mt,{width:r,height:o}),l(),i.createElement(u.q.rect,Object.assign({width:y,height:o,fill:"#aaeeff"},x(),{style:{cursor:"move",opacity:.5,x:g,y:m}})),i.createElement(u.q.rect,Object.assign({},S(),{width:10,height:o,style:{x:g,opacity:0,cursor:"w-resize",y:m}})),i.createElement(u.q.rect,Object.assign({},_(),{width:10,height:o,style:{x:g+y,opacity:0,cursor:"e-resize",y:m}})))},bt=n(8643),wt=n(912),xt=n(6759),St=n(1358),_t=n(953),Ot={x:{dateFormat:"%d-%b-%y",scale:"time",width:800,height:20},y:{label:"Count",numberFormat:"d",scale:"log",height:200,width:20}},Et=new Date,Tt=new Array(100).fill("").map((function(t,e){return new Date((new Date).setDate(Et.getDate()+e))})).map((function(t,e){return{x:t,y:e*Math.random()*1e3}})),Dt={curveType:o.Z,fill:{fill:_t.r.brightBlue800,show:!0},show:!0,stroke:_t.r.brightBlue800,strokeDashArray:"0",strokeDashOffset:0},Pt=function(){var t=(0,a.z8)("90%"),e=t[0],n=t[1],o={start:100,end:200},u=(0,a.DX)({initialPosition:o,data:Tt,scaleFunction:r.Z,width:n}),c=u.brushedData,s=u.makeBrushedData;return i.createElement(xt.A,null,i.createElement("h2",null,"Brush"),i.createElement(St.V,null,i.createElement("div",{ref:e},i.createElement(a.XY,{width:n,height:400},i.createElement(bt.Z,{axis:Ot,label:"brushed data",line:Dt,width:n,left:0,animate:!1,height:200,data:c}),i.createElement(yt,{width:n,top:250,initialPosition:o,brushWidth:100,chart:function(){return i.createElement(bt.Z,{axis:Ot,label:"brushed data",line:Dt,width:n,left:0,height:50,data:Tt})},onChange:function(t){return s(t)},height:50}))),i.createElement(wt.U,{exampleCode:"\nimport {\n Base,\n IAxes,\n ILineProps,\n useBrush,\n Brush,\n useWidth,\n} from 'cl-react-graph';\nimport { scaleTime } from 'd3-scale';\nimport { curveCatmullRom } from 'd3-shape';\n\nconst axis: IAxes = {\n x: {\n dateFormat: '%d-%b-%y',\n scale: 'time',\n width: 800,\n height: 20,\n },\n y: {\n label: 'Count',\n numberFormat: 'd',\n scale: 'log',\n height: 200,\n width: 20,\n },\n};\n\nconst now = new Date();\nconst xs = new Array(100).fill('').map((_, i) => new Date(new Date().setDate(now.getDate() + i)))\nconst data: IAnyChartPoint[] = xs.map((v, i) => ({\n x: v,\n y: i * Math.random() * 1000,\n}));\n\nconst line: ILineProps = {\n curveType: curveCatmullRom,\n fill: {\n fill: theme.brightBlue800,\n show: true,\n },\n show: true,\n stroke: theme.brightBlue800,\n strokeDashArray: '0',\n strokeDashOffset: 0,\n}\n\nconst BrushExample = () => {\n const [ref, width] = useWidth('90%');\n const initialPosition = { start: 100, end: 200 };\n\n const { brushedData, makeBrushedData } = useBrush({\n initialPosition,\n data,\n scaleFunction: scaleTime,\n width,\n })\n return (\n <div ref={ref}>\n <Base\n width={width}\n height={400}>\n\n <Line\n axis={axis}\n label=\"brushed data\"\n line={line}\n width={width}\n left={0}\n animate={false}\n height={200}\n data={brushedData} />\n\n <Brush width={width}\n top={250}\n initialPosition={initialPosition}\n brushWidth={100}\n chart={() => <Line\n axis={axis}\n label=\"brushed data\"\n line={line}\n width={width}\n left={0}\n height={50}\n data={data} />}\n onChange={(pos) => makeBrushedData(pos)}\n height={50} />\n </Base>\n </div>\n )\n}\n"})))}}}]);
//# sourceMappingURL=component---src-pages-brush-tsx-9caaaa0b0372a37b2571.js.map