New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

chartjs-plugin-dragdata

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chartjs-plugin-dragdata - npm Package Compare versions

Comparing version 2.0.2 to 2.1.0

docs/floatingBar.html

31

dist/chartjs-plugin-dragdata.js

@@ -1264,3 +1264,3 @@ (function (global, factory) {

let element, yAxisID, xAxisID, rAxisID, type, stacked, initValue, curDatasetIndex, curIndex;
let element, yAxisID, xAxisID, rAxisID, type, stacked, floatingBar, initValue, curDatasetIndex, curIndex;
let isDragging = false;

@@ -1299,2 +1299,6 @@

stacked = chartInstance.config.options.scales[xAxisID].stacked;
// if a bar has a data point that is an array of length 2, it's a floating bar
const samplePoint = chartInstance.data.datasets[0].data[0];
floatingBar = (samplePoint !== null) && Array.isArray(samplePoint) && samplePoint.length == 2;
let newPos = calcPosition(e, chartInstance, datasetIndex, index);

@@ -1367,2 +1371,25 @@ initValue = newPos - curValue;

if (floatingBar) {
// x contains the new value for one end of the floating bar
// dataPoint contains the old interval [left, right] of the floating bar
// calculate difference between the new value and both sides
// the side with the smallest difference from the new value was the one that was dragged
// return an interval with new value on the dragged side and old value on the other side
let newVal;
// choose the right variable based on the orientation of the graph(vertical, horizontal)
if (chartInstance.config.options.indexAxis === 'y') {
newVal = x;
} else {
newVal = y;
}
const diffFromLeft = Math.abs(newVal - dataPoint[0]);
const diffFromRight = Math.abs(newVal - dataPoint[1]);
if (diffFromLeft <= diffFromRight) {
return [newVal, dataPoint[1]]
} else {
return [dataPoint[0], newVal]
}
}
if (dataPoint.x !== undefined && chartInstance.config.options.plugins.dragData.dragX) {

@@ -1400,2 +1427,4 @@ dataPoint.x = x;

dataPoint = roundValue(cursorPos - initValue, pluginOptions.round);
} else if (floatingBar) {
dataPoint = calcPosition(e, chartInstance, curDatasetIndex, curIndex);
} else {

@@ -1402,0 +1431,0 @@ dataPoint = calcPosition(e, chartInstance, curDatasetIndex, curIndex);

2

dist/chartjs-plugin-dragdata.min.js

@@ -1,1 +0,1 @@

!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("chart.js")):"function"==typeof define&&define.amd?define(["chart.js"],n):(t="undefined"!=typeof globalThis?globalThis:t||self).index=n(t.Chart)}(this,(function(t){"use strict";var n={value:()=>{}};function e(){for(var t,n=0,e=arguments.length,i={};n<e;++n){if(!(t=arguments[n]+"")||t in i||/[\s.]/.test(t))throw new Error("illegal type: "+t);i[t]=[]}return new r(i)}function r(t){this._=t}function i(t,n){return t.trim().split(/^|\s+/).map((function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))}function o(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function a(t,e,r){for(var i=0,o=t.length;i<o;++i)if(t[i].name===e){t[i]=n,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=r&&t.push({name:e,value:r}),t}r.prototype=e.prototype={constructor:r,on:function(t,n){var e,r=this._,u=i(t+"",r),s=-1,c=u.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++s<c;)if(e=(t=u[s]).type)r[e]=a(r[e],t.name,n);else if(null==n)for(e in r)r[e]=a(r[e],t.name,null);return this}for(;++s<c;)if((e=(t=u[s]).type)&&(e=o(r[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new r(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),o=0;o<e;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,e=(r=this._[t]).length;o<e;++o)r[o].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};var u="http://www.w3.org/1999/xhtml",s={svg:"http://www.w3.org/2000/svg",xhtml:u,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function c(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),s.hasOwnProperty(n)?{space:s[n],local:t}:t}function l(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===u&&n.documentElement.namespaceURI===u?n.createElement(t):n.createElementNS(e,t)}}function f(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function h(t){var n=c(t);return(n.local?f:l)(n)}function p(){}function d(t){return null==t?p:function(){return this.querySelector(t)}}function g(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function v(){return[]}function y(t){return function(n){return n.matches(t)}}var m=Array.prototype.find;function _(){return this.firstElementChild}var w=Array.prototype.filter;function x(){return this.children}function b(t){return new Array(t.length)}function A(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function E(t){return function(){return t}}function D(t,n,e,r,i,o){for(var a,u=0,s=n.length,c=o.length;u<c;++u)(a=n[u])?(a.__data__=o[u],r[u]=a):e[u]=new A(t,o[u]);for(;u<s;++u)(a=n[u])&&(i[u]=a)}function C(t,n,e,r,i,o,a){var u,s,c,l=new Map,f=n.length,h=o.length,p=new Array(f);for(u=0;u<f;++u)(s=n[u])&&(p[u]=c=a.call(s,s.__data__,u,n)+"",l.has(c)?i[u]=s:l.set(c,s));for(u=0;u<h;++u)c=a.call(t,o[u],u,o)+"",(s=l.get(c))?(r[u]=s,s.__data__=o[u],l.delete(c)):e[u]=new A(t,o[u]);for(u=0;u<f;++u)(s=n[u])&&l.get(p[u])===s&&(i[u]=s)}function S(t){return t.__data__}function N(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function P(t){return function(){this.removeAttribute(t)}}function M(t){return function(){this.removeAttributeNS(t.space,t.local)}}function T(t,n){return function(){this.setAttribute(t,n)}}function B(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function k(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function I(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function R(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function j(t){return function(){this.style.removeProperty(t)}}function L(t,n,e){return function(){this.style.setProperty(t,n,e)}}function O(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function V(t,n){return t.style.getPropertyValue(n)||R(t).getComputedStyle(t,null).getPropertyValue(n)}function X(t){return function(){delete this[t]}}function q(t,n){return function(){this[t]=n}}function Y(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function U(t){return t.trim().split(/^|\s+/)}function F(t){return t.classList||new z(t)}function z(t){this._node=t,this._names=U(t.getAttribute("class")||"")}function H(t,n){for(var e=F(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function G(t,n){for(var e=F(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function K(t){return function(){H(this,t)}}function J(t){return function(){G(this,t)}}function Q(t,n){return function(){(n.apply(this,arguments)?H:G)(this,t)}}function W(){this.textContent=""}function Z(t){return function(){this.textContent=t}}function $(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function tt(){this.innerHTML=""}function nt(t){return function(){this.innerHTML=t}}function et(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function rt(){this.nextSibling&&this.parentNode.appendChild(this)}function it(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ot(){return null}function at(){var t=this.parentNode;t&&t.removeChild(this)}function ut(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function st(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function ct(t){return t.trim().split(/^|\s+/).map((function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}function lt(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r<o;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.options);++i?n.length=i:delete this.__on}}}function ft(t,n,e){return function(){var r,i=this.__on,o=function(t){return function(n){t.call(this,n,this.__data__)}}(n);if(i)for(var a=0,u=i.length;a<u;++a)if((r=i[a]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=e),void(r.value=n);this.addEventListener(t.type,o,e),r={type:t.type,name:t.name,value:n,listener:o,options:e},i?i.push(r):this.__on=[r]}}function ht(t,n,e){var r=R(t),i=r.CustomEvent;"function"==typeof i?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}function pt(t,n){return function(){return ht(this,t,n)}}function dt(t,n){return function(){return ht(this,t,n.apply(this,arguments))}}A.prototype={constructor:A,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}},z.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var gt=[null];function vt(t,n){this._groups=t,this._parents=n}function yt(t){return"string"==typeof t?new vt([[document.querySelector(t)]],[document.documentElement]):new vt([[t]],gt)}function mt(t,n){if(t=function(t){let n;for(;n=t.sourceEvent;)t=n;return t}(t),void 0===n&&(n=t.currentTarget),n){var e=n.ownerSVGElement||n;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(n.getScreenCTM().inverse())).x,r.y]}if(n.getBoundingClientRect){var i=n.getBoundingClientRect();return[t.clientX-i.left-n.clientLeft,t.clientY-i.top-n.clientTop]}}return[t.pageX,t.pageY]}function _t(t){t.stopImmediatePropagation()}function wt(t){t.preventDefault(),t.stopImmediatePropagation()}vt.prototype={constructor:vt,select:function(t){"function"!=typeof t&&(t=d(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a,u=n[i],s=u.length,c=r[i]=new Array(s),l=0;l<s;++l)(o=u[l])&&(a=t.call(o,o.__data__,l,u))&&("__data__"in o&&(a.__data__=o.__data__),c[l]=a);return new vt(r,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){var n=t.apply(this,arguments);return null==n?[]:g(n)}}(t):function(t){return null==t?v:function(){return this.querySelectorAll(t)}}(t);for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var a,u=n[o],s=u.length,c=0;c<s;++c)(a=u[c])&&(r.push(t.call(a,a.__data__,c,u)),i.push(a));return new vt(r,i)},selectChild:function(t){return this.select(null==t?_:function(t){return function(){return m.call(this.children,t)}}("function"==typeof t?t:y(t)))},selectChildren:function(t){return this.selectAll(null==t?x:function(t){return function(){return w.call(this.children,t)}}("function"==typeof t?t:y(t)))},filter:function(t){"function"!=typeof t&&(t=function(t){return function(){return this.matches(t)}}(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a=n[i],u=a.length,s=r[i]=[],c=0;c<u;++c)(o=a[c])&&t.call(o,o.__data__,c,a)&&s.push(o);return new vt(r,this._parents)},data:function(t,n){if(!arguments.length)return Array.from(this,S);var e=n?C:D,r=this._parents,i=this._groups;"function"!=typeof t&&(t=E(t));for(var o=i.length,a=new Array(o),u=new Array(o),s=new Array(o),c=0;c<o;++c){var l=r[c],f=i[c],h=f.length,p=g(t.call(l,l&&l.__data__,c,r)),d=p.length,v=u[c]=new Array(d),y=a[c]=new Array(d),m=s[c]=new Array(h);e(l,f,v,y,m,p,n);for(var _,w,x=0,b=0;x<d;++x)if(_=v[x]){for(x>=b&&(b=x+1);!(w=y[b])&&++b<d;);_._next=w||null}}return(a=new vt(a,r))._enter=u,a._exit=s,a},enter:function(){return new vt(this._enter||this._groups.map(b),this._parents)},exit:function(){return new vt(this._exit||this._groups.map(b),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,o=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=n&&(i=n(i)),null==e?o.remove():e(o),r&&i?r.merge(i).order():i},merge:function(t){if(!(t instanceof vt))throw new Error("invalid merge");for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),a=new Array(r),u=0;u<o;++u)for(var s,c=n[u],l=e[u],f=c.length,h=a[u]=new Array(f),p=0;p<f;++p)(s=c[p]||l[p])&&(h[p]=s);for(;u<r;++u)a[u]=n[u];return new vt(a,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],o=i.length-1,a=i[o];--o>=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=N);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var a,u=e[o],s=u.length,c=i[o]=new Array(s),l=0;l<s;++l)(a=u[l])&&(c[l]=a);c.sort(n)}return new vt(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null},size:function(){let t=0;for(const n of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,o=n[e],a=0,u=o.length;a<u;++a)(i=o[a])&&t.call(i,i.__data__,a,o);return this},attr:function(t,n){var e=c(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==n?e.local?M:P:"function"==typeof n?e.local?I:k:e.local?B:T)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?j:"function"==typeof n?O:L)(t,n,null==e?"":e)):V(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?X:"function"==typeof n?Y:q)(t,n)):this.node()[t]},classed:function(t,n){var e=U(t+"");if(arguments.length<2){for(var r=F(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?Q:n?K:J)(e,n))},text:function(t){return arguments.length?this.each(null==t?W:("function"==typeof t?$:Z)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?tt:("function"==typeof t?et:nt)(t)):this.node().innerHTML},raise:function(){return this.each(rt)},lower:function(){return this.each(it)},append:function(t){var n="function"==typeof t?t:h(t);return this.select((function(){return this.appendChild(n.apply(this,arguments))}))},insert:function(t,n){var e="function"==typeof t?t:h(t),r=null==n?ot:"function"==typeof n?n:d(n);return this.select((function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(at)},clone:function(t){return this.select(t?st:ut)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=ct(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?ft:lt,r=0;r<a;++r)this.each(u(o[r],n,e));return this}var u=this.node().__on;if(u)for(var s,c=0,l=u.length;c<l;++c)for(r=0,s=u[c];r<a;++r)if((i=o[r]).type===s.type&&i.name===s.name)return s.value},dispatch:function(t,n){return this.each(("function"==typeof n?dt:pt)(t,n))},[Symbol.iterator]:function*(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r,i=t[n],o=0,a=i.length;o<a;++o)(r=i[o])&&(yield r)}};var xt=t=>()=>t;function bt(t,{sourceEvent:n,subject:e,target:r,identifier:i,active:o,x:a,y:u,dx:s,dy:c,dispatch:l}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:s,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:l}})}function At(t){return!t.ctrlKey&&!t.button}function Et(){return this.parentNode}function Dt(t,n){return null==n?{x:t.x,y:t.y}:n}function Ct(){return navigator.maxTouchPoints||"ontouchstart"in this}function St(){var t,n,r,i,o=At,a=Et,u=Dt,s=Ct,c={},l=e("start","drag","end"),f=0,h=0;function p(t){t.on("mousedown.drag",d).filter(s).on("touchstart.drag",y).on("touchmove.drag",m).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(e,u){if(!i&&o.call(this,e,u)){var s=w(this,a.call(this,e,u),e,u,"mouse");s&&(yt(e.view).on("mousemove.drag",g,!0).on("mouseup.drag",v,!0),function(t){var n=t.document.documentElement,e=yt(t).on("dragstart.drag",wt,!0);"onselectstart"in n?e.on("selectstart.drag",wt,!0):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}(e.view),_t(e),r=!1,t=e.clientX,n=e.clientY,s("start",e))}}function g(e){if(wt(e),!r){var i=e.clientX-t,o=e.clientY-n;r=i*i+o*o>h}c.mouse("drag",e)}function v(t){yt(t.view).on("mousemove.drag mouseup.drag",null),function(t,n){var e=t.document.documentElement,r=yt(t).on("dragstart.drag",null);n&&(r.on("click.drag",wt,!0),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in e?r.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}(t.view,r),wt(t),c.mouse("end",t)}function y(t,n){if(o.call(this,t,n)){var e,r,i=t.changedTouches,u=a.call(this,t,n),s=i.length;for(e=0;e<s;++e)(r=w(this,u,t,n,i[e].identifier,i[e]))&&(_t(t),r("start",t,i[e]))}}function m(t){var n,e,r=t.changedTouches,i=r.length;for(n=0;n<i;++n)(e=c[r[n].identifier])&&(wt(t),e("drag",t,r[n]))}function _(t){var n,e,r=t.changedTouches,o=r.length;for(i&&clearTimeout(i),i=setTimeout((function(){i=null}),500),n=0;n<o;++n)(e=c[r[n].identifier])&&(_t(t),e("end",t,r[n]))}function w(t,n,e,r,i,o){var a,s,h,d=l.copy(),g=mt(o||e,n);if(null!=(h=u.call(t,new bt("beforestart",{sourceEvent:e,target:p,identifier:i,active:f,x:g[0],y:g[1],dx:0,dy:0,dispatch:d}),r)))return a=h.x-g[0]||0,s=h.y-g[1]||0,function e(o,u,l){var v,y=g;switch(o){case"start":c[i]=e,v=f++;break;case"end":delete c[i],--f;case"drag":g=mt(l||u,n),v=f}d.call(o,t,new bt(o,{sourceEvent:u,subject:h,target:p,identifier:i,active:v,x:g[0]+a,y:g[1]+s,dx:g[0]-y[0],dy:g[1]-y[1],dispatch:d}),r)}}return p.filter=function(t){return arguments.length?(o="function"==typeof t?t:xt(!!t),p):o},p.container=function(t){return arguments.length?(a="function"==typeof t?t:xt(t),p):a},p.subject=function(t){return arguments.length?(u="function"==typeof t?t:xt(t),p):u},p.touchable=function(t){return arguments.length?(s="function"==typeof t?t:xt(!!t),p):s},p.on=function(){var t=l.on.apply(l,arguments);return t===l?p:t},p.clickDistance=function(t){return arguments.length?(h=(t=+t)*t,p):Math.sqrt(h)},p}let Nt,Pt,Mt,Tt,Bt,kt,It,Rt,jt;bt.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};let Lt=!1;function Ot(t,n){return isNaN(n)?t:Math.round(t*Math.pow(10,n))/Math.pow(10,n)}function Vt(t,n,e,r,i){let o,a;const u=n.data.datasets[e].data[r];return t.touches?(o=n.scales[Mt].getValueForPixel(t.touches[0].clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Pt].getValueForPixel(t.touches[0].clientY-n.canvas.getBoundingClientRect().top)):(o=n.scales[Mt].getValueForPixel(t.clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Pt].getValueForPixel(t.clientY-n.canvas.getBoundingClientRect().top)),o=Ot(o,n.config.options.plugins.dragData.round),a=Ot(a,n.config.options.plugins.dragData.round),o=o>n.scales[Mt].max?n.scales[Mt].max:o,o=o<n.scales[Mt].min?n.scales[Mt].min:o,a=a>n.scales[Pt].max?n.scales[Pt].max:a,a=a<n.scales[Pt].min?n.scales[Pt].min:a,void 0!==u.x&&n.config.options.plugins.dragData.dragX&&(u.x=o),void 0!==u.y?(!1!==n.config.options.plugins.dragData.dragY&&(u.y=a),u):"y"===n.config.options.indexAxis?o:a}const Xt=(t,n,e,r)=>{if(Nt){Rt=Nt.datasetIndex,jt=Nt.index,Lt=!0;let i=n.data.datasets[Rt].data[jt];if("radar"===Bt)i=function(t,n){let e,r,i;t.touches?(e=t.touches[0].clientX-n.canvas.getBoundingClientRect().left,r=t.touches[0].clientY-n.canvas.getBoundingClientRect().top):(e=t.clientX-n.canvas.getBoundingClientRect().left,r=t.clientY-n.canvas.getBoundingClientRect().top);let o=n.scales[Tt],a=Math.sqrt(Math.pow(e-o.xCenter,2)+Math.pow(r-o.yCenter,2)),u=o.drawingArea/(o.max-o.min);return i=o.options.ticks.reverse?o.max-a/u:o.min+a/u,i=Ot(i,n.config.options.plugins.dragData.round),i=i>n.scales[Tt].max?n.scales[Tt].max:i,i=i<n.scales[Tt].min?n.scales[Tt].min:i,i}(t,n);else if(kt){i=Ot(Vt(t,n,Rt,jt)-It,e.round)}else i=Vt(t,n,Rt,jt);(void 0===e.showTooltip||e.showTooltip)&&n.tooltip.setActiveElements([Nt],{x:Nt.element.x,y:Nt.element.y}),(!r||"function"==typeof r&&!1!==r(t,Rt,jt,i))&&(n.data.datasets[Rt].data[jt]=i,n.update("none"))}};const qt={id:"dragdata",afterInit:function(t){if(t.config.options.plugins&&t.config.options.plugins.dragData){const n=t.config.options.plugins.dragData;yt(t.canvas).call(St().container(t.canvas).on("start",(e=>((t,n,e)=>{if(Nt=n.getElementsAtEventForMode(t,"nearest",{intersect:!0},!1)[0],Bt=n.config.type,Nt){let r=Nt.datasetIndex,i=Nt.index;const o=n.data.datasets[r],a=n.getDatasetMeta(r);let u=o.data[i];if(Mt=a.xAxisID,Pt=a.yAxisID,Tt=a.rAxisID,!1===o.dragData||n.config.options.scales[Mt]&&!1===n.config.options.scales[Mt].dragData||n.config.options.scales[Pt]&&!1===n.config.options.scales[Pt].dragData||n.config.options.scales[Tt]&&!1===n.config.options.scales[Tt].rAxisID||!1===o.data[Nt.index].dragData)return void(Nt=null);if("bar"===Bt){kt=n.config.options.scales[Mt].stacked;let e=Vt(t,n,r,i);It=e-u}"function"==typeof e&&Nt&&!1===e(t,r,i,u)&&(Nt=null)}})(e.sourceEvent,t,n.onDragStart))).on("drag",(e=>Xt(e.sourceEvent,t,n,n.onDrag))).on("end",(e=>((t,n,e)=>{if(jt=void 0,Lt=!1,"function"==typeof e&&Nt){const r=Nt.datasetIndex,i=Nt.index;return e(t,r,i,function(t,n,e){const r=t.config.options.plugins.dragData;if(!r.magnet)return t.data.datasets[n].data[e];{const i=r.magnet;if(i.to&&"function"==typeof i.to){let r=t.data.datasets[n].data[e];return r=i.to(r),t.data.datasets[n].data[e]=r,t.update("none"),r}}}(n,r,i))}})(e.sourceEvent,t,n.onDragEnd))))}},beforeEvent:function(t){if(t.config.options.plugins&&t.config.options.plugins.dragData&&t.config.options.plugins.dragData.showTooltip&&Lt)return!1}};return t.Chart.register(qt),qt}));
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("chart.js")):"function"==typeof define&&define.amd?define(["chart.js"],n):(t="undefined"!=typeof globalThis?globalThis:t||self).index=n(t.Chart)}(this,(function(t){"use strict";var n={value:()=>{}};function e(){for(var t,n=0,e=arguments.length,i={};n<e;++n){if(!(t=arguments[n]+"")||t in i||/[\s.]/.test(t))throw new Error("illegal type: "+t);i[t]=[]}return new r(i)}function r(t){this._=t}function i(t,n){return t.trim().split(/^|\s+/).map((function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))}function o(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function a(t,e,r){for(var i=0,o=t.length;i<o;++i)if(t[i].name===e){t[i]=n,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=r&&t.push({name:e,value:r}),t}r.prototype=e.prototype={constructor:r,on:function(t,n){var e,r=this._,u=i(t+"",r),s=-1,c=u.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++s<c;)if(e=(t=u[s]).type)r[e]=a(r[e],t.name,n);else if(null==n)for(e in r)r[e]=a(r[e],t.name,null);return this}for(;++s<c;)if((e=(t=u[s]).type)&&(e=o(r[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new r(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),o=0;o<e;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,e=(r=this._[t]).length;o<e;++o)r[o].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};var u="http://www.w3.org/1999/xhtml",s={svg:"http://www.w3.org/2000/svg",xhtml:u,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function c(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),s.hasOwnProperty(n)?{space:s[n],local:t}:t}function l(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===u&&n.documentElement.namespaceURI===u?n.createElement(t):n.createElementNS(e,t)}}function f(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function h(t){var n=c(t);return(n.local?f:l)(n)}function p(){}function d(t){return null==t?p:function(){return this.querySelector(t)}}function g(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function v(){return[]}function y(t){return function(n){return n.matches(t)}}var m=Array.prototype.find;function _(){return this.firstElementChild}var w=Array.prototype.filter;function x(){return this.children}function b(t){return new Array(t.length)}function A(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function E(t){return function(){return t}}function D(t,n,e,r,i,o){for(var a,u=0,s=n.length,c=o.length;u<c;++u)(a=n[u])?(a.__data__=o[u],r[u]=a):e[u]=new A(t,o[u]);for(;u<s;++u)(a=n[u])&&(i[u]=a)}function C(t,n,e,r,i,o,a){var u,s,c,l=new Map,f=n.length,h=o.length,p=new Array(f);for(u=0;u<f;++u)(s=n[u])&&(p[u]=c=a.call(s,s.__data__,u,n)+"",l.has(c)?i[u]=s:l.set(c,s));for(u=0;u<h;++u)c=a.call(t,o[u],u,o)+"",(s=l.get(c))?(r[u]=s,s.__data__=o[u],l.delete(c)):e[u]=new A(t,o[u]);for(u=0;u<f;++u)(s=n[u])&&l.get(p[u])===s&&(i[u]=s)}function S(t){return t.__data__}function M(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function N(t){return function(){this.removeAttribute(t)}}function P(t){return function(){this.removeAttributeNS(t.space,t.local)}}function T(t,n){return function(){this.setAttribute(t,n)}}function B(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function k(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function I(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function R(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function j(t){return function(){this.style.removeProperty(t)}}function L(t,n,e){return function(){this.style.setProperty(t,n,e)}}function O(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function V(t,n){return t.style.getPropertyValue(n)||R(t).getComputedStyle(t,null).getPropertyValue(n)}function X(t){return function(){delete this[t]}}function q(t,n){return function(){this[t]=n}}function Y(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function U(t){return t.trim().split(/^|\s+/)}function F(t){return t.classList||new z(t)}function z(t){this._node=t,this._names=U(t.getAttribute("class")||"")}function H(t,n){for(var e=F(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function G(t,n){for(var e=F(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function K(t){return function(){H(this,t)}}function J(t){return function(){G(this,t)}}function Q(t,n){return function(){(n.apply(this,arguments)?H:G)(this,t)}}function W(){this.textContent=""}function Z(t){return function(){this.textContent=t}}function $(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function tt(){this.innerHTML=""}function nt(t){return function(){this.innerHTML=t}}function et(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function rt(){this.nextSibling&&this.parentNode.appendChild(this)}function it(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ot(){return null}function at(){var t=this.parentNode;t&&t.removeChild(this)}function ut(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function st(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function ct(t){return t.trim().split(/^|\s+/).map((function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}function lt(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r<o;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.options);++i?n.length=i:delete this.__on}}}function ft(t,n,e){return function(){var r,i=this.__on,o=function(t){return function(n){t.call(this,n,this.__data__)}}(n);if(i)for(var a=0,u=i.length;a<u;++a)if((r=i[a]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=e),void(r.value=n);this.addEventListener(t.type,o,e),r={type:t.type,name:t.name,value:n,listener:o,options:e},i?i.push(r):this.__on=[r]}}function ht(t,n,e){var r=R(t),i=r.CustomEvent;"function"==typeof i?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}function pt(t,n){return function(){return ht(this,t,n)}}function dt(t,n){return function(){return ht(this,t,n.apply(this,arguments))}}A.prototype={constructor:A,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}},z.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var gt=[null];function vt(t,n){this._groups=t,this._parents=n}function yt(t){return"string"==typeof t?new vt([[document.querySelector(t)]],[document.documentElement]):new vt([[t]],gt)}function mt(t,n){if(t=function(t){let n;for(;n=t.sourceEvent;)t=n;return t}(t),void 0===n&&(n=t.currentTarget),n){var e=n.ownerSVGElement||n;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(n.getScreenCTM().inverse())).x,r.y]}if(n.getBoundingClientRect){var i=n.getBoundingClientRect();return[t.clientX-i.left-n.clientLeft,t.clientY-i.top-n.clientTop]}}return[t.pageX,t.pageY]}function _t(t){t.stopImmediatePropagation()}function wt(t){t.preventDefault(),t.stopImmediatePropagation()}vt.prototype={constructor:vt,select:function(t){"function"!=typeof t&&(t=d(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a,u=n[i],s=u.length,c=r[i]=new Array(s),l=0;l<s;++l)(o=u[l])&&(a=t.call(o,o.__data__,l,u))&&("__data__"in o&&(a.__data__=o.__data__),c[l]=a);return new vt(r,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){var n=t.apply(this,arguments);return null==n?[]:g(n)}}(t):function(t){return null==t?v:function(){return this.querySelectorAll(t)}}(t);for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var a,u=n[o],s=u.length,c=0;c<s;++c)(a=u[c])&&(r.push(t.call(a,a.__data__,c,u)),i.push(a));return new vt(r,i)},selectChild:function(t){return this.select(null==t?_:function(t){return function(){return m.call(this.children,t)}}("function"==typeof t?t:y(t)))},selectChildren:function(t){return this.selectAll(null==t?x:function(t){return function(){return w.call(this.children,t)}}("function"==typeof t?t:y(t)))},filter:function(t){"function"!=typeof t&&(t=function(t){return function(){return this.matches(t)}}(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a=n[i],u=a.length,s=r[i]=[],c=0;c<u;++c)(o=a[c])&&t.call(o,o.__data__,c,a)&&s.push(o);return new vt(r,this._parents)},data:function(t,n){if(!arguments.length)return Array.from(this,S);var e=n?C:D,r=this._parents,i=this._groups;"function"!=typeof t&&(t=E(t));for(var o=i.length,a=new Array(o),u=new Array(o),s=new Array(o),c=0;c<o;++c){var l=r[c],f=i[c],h=f.length,p=g(t.call(l,l&&l.__data__,c,r)),d=p.length,v=u[c]=new Array(d),y=a[c]=new Array(d),m=s[c]=new Array(h);e(l,f,v,y,m,p,n);for(var _,w,x=0,b=0;x<d;++x)if(_=v[x]){for(x>=b&&(b=x+1);!(w=y[b])&&++b<d;);_._next=w||null}}return(a=new vt(a,r))._enter=u,a._exit=s,a},enter:function(){return new vt(this._enter||this._groups.map(b),this._parents)},exit:function(){return new vt(this._exit||this._groups.map(b),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,o=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=n&&(i=n(i)),null==e?o.remove():e(o),r&&i?r.merge(i).order():i},merge:function(t){if(!(t instanceof vt))throw new Error("invalid merge");for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),a=new Array(r),u=0;u<o;++u)for(var s,c=n[u],l=e[u],f=c.length,h=a[u]=new Array(f),p=0;p<f;++p)(s=c[p]||l[p])&&(h[p]=s);for(;u<r;++u)a[u]=n[u];return new vt(a,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],o=i.length-1,a=i[o];--o>=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=M);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var a,u=e[o],s=u.length,c=i[o]=new Array(s),l=0;l<s;++l)(a=u[l])&&(c[l]=a);c.sort(n)}return new vt(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null},size:function(){let t=0;for(const n of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,o=n[e],a=0,u=o.length;a<u;++a)(i=o[a])&&t.call(i,i.__data__,a,o);return this},attr:function(t,n){var e=c(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==n?e.local?P:N:"function"==typeof n?e.local?I:k:e.local?B:T)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?j:"function"==typeof n?O:L)(t,n,null==e?"":e)):V(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?X:"function"==typeof n?Y:q)(t,n)):this.node()[t]},classed:function(t,n){var e=U(t+"");if(arguments.length<2){for(var r=F(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?Q:n?K:J)(e,n))},text:function(t){return arguments.length?this.each(null==t?W:("function"==typeof t?$:Z)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?tt:("function"==typeof t?et:nt)(t)):this.node().innerHTML},raise:function(){return this.each(rt)},lower:function(){return this.each(it)},append:function(t){var n="function"==typeof t?t:h(t);return this.select((function(){return this.appendChild(n.apply(this,arguments))}))},insert:function(t,n){var e="function"==typeof t?t:h(t),r=null==n?ot:"function"==typeof n?n:d(n);return this.select((function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(at)},clone:function(t){return this.select(t?st:ut)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=ct(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?ft:lt,r=0;r<a;++r)this.each(u(o[r],n,e));return this}var u=this.node().__on;if(u)for(var s,c=0,l=u.length;c<l;++c)for(r=0,s=u[c];r<a;++r)if((i=o[r]).type===s.type&&i.name===s.name)return s.value},dispatch:function(t,n){return this.each(("function"==typeof n?dt:pt)(t,n))},[Symbol.iterator]:function*(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r,i=t[n],o=0,a=i.length;o<a;++o)(r=i[o])&&(yield r)}};var xt=t=>()=>t;function bt(t,{sourceEvent:n,subject:e,target:r,identifier:i,active:o,x:a,y:u,dx:s,dy:c,dispatch:l}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:s,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:l}})}function At(t){return!t.ctrlKey&&!t.button}function Et(){return this.parentNode}function Dt(t,n){return null==n?{x:t.x,y:t.y}:n}function Ct(){return navigator.maxTouchPoints||"ontouchstart"in this}function St(){var t,n,r,i,o=At,a=Et,u=Dt,s=Ct,c={},l=e("start","drag","end"),f=0,h=0;function p(t){t.on("mousedown.drag",d).filter(s).on("touchstart.drag",y).on("touchmove.drag",m).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(e,u){if(!i&&o.call(this,e,u)){var s=w(this,a.call(this,e,u),e,u,"mouse");s&&(yt(e.view).on("mousemove.drag",g,!0).on("mouseup.drag",v,!0),function(t){var n=t.document.documentElement,e=yt(t).on("dragstart.drag",wt,!0);"onselectstart"in n?e.on("selectstart.drag",wt,!0):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}(e.view),_t(e),r=!1,t=e.clientX,n=e.clientY,s("start",e))}}function g(e){if(wt(e),!r){var i=e.clientX-t,o=e.clientY-n;r=i*i+o*o>h}c.mouse("drag",e)}function v(t){yt(t.view).on("mousemove.drag mouseup.drag",null),function(t,n){var e=t.document.documentElement,r=yt(t).on("dragstart.drag",null);n&&(r.on("click.drag",wt,!0),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in e?r.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}(t.view,r),wt(t),c.mouse("end",t)}function y(t,n){if(o.call(this,t,n)){var e,r,i=t.changedTouches,u=a.call(this,t,n),s=i.length;for(e=0;e<s;++e)(r=w(this,u,t,n,i[e].identifier,i[e]))&&(_t(t),r("start",t,i[e]))}}function m(t){var n,e,r=t.changedTouches,i=r.length;for(n=0;n<i;++n)(e=c[r[n].identifier])&&(wt(t),e("drag",t,r[n]))}function _(t){var n,e,r=t.changedTouches,o=r.length;for(i&&clearTimeout(i),i=setTimeout((function(){i=null}),500),n=0;n<o;++n)(e=c[r[n].identifier])&&(_t(t),e("end",t,r[n]))}function w(t,n,e,r,i,o){var a,s,h,d=l.copy(),g=mt(o||e,n);if(null!=(h=u.call(t,new bt("beforestart",{sourceEvent:e,target:p,identifier:i,active:f,x:g[0],y:g[1],dx:0,dy:0,dispatch:d}),r)))return a=h.x-g[0]||0,s=h.y-g[1]||0,function e(o,u,l){var v,y=g;switch(o){case"start":c[i]=e,v=f++;break;case"end":delete c[i],--f;case"drag":g=mt(l||u,n),v=f}d.call(o,t,new bt(o,{sourceEvent:u,subject:h,target:p,identifier:i,active:v,x:g[0]+a,y:g[1]+s,dx:g[0]-y[0],dy:g[1]-y[1],dispatch:d}),r)}}return p.filter=function(t){return arguments.length?(o="function"==typeof t?t:xt(!!t),p):o},p.container=function(t){return arguments.length?(a="function"==typeof t?t:xt(t),p):a},p.subject=function(t){return arguments.length?(u="function"==typeof t?t:xt(t),p):u},p.touchable=function(t){return arguments.length?(s="function"==typeof t?t:xt(!!t),p):s},p.on=function(){var t=l.on.apply(l,arguments);return t===l?p:t},p.clickDistance=function(t){return arguments.length?(h=(t=+t)*t,p):Math.sqrt(h)},p}let Mt,Nt,Pt,Tt,Bt,kt,It,Rt,jt,Lt;bt.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};let Ot=!1;function Vt(t,n){return isNaN(n)?t:Math.round(t*Math.pow(10,n))/Math.pow(10,n)}function Xt(t,n,e,r,i){let o,a;const u=n.data.datasets[e].data[r];if(t.touches?(o=n.scales[Pt].getValueForPixel(t.touches[0].clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Nt].getValueForPixel(t.touches[0].clientY-n.canvas.getBoundingClientRect().top)):(o=n.scales[Pt].getValueForPixel(t.clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Nt].getValueForPixel(t.clientY-n.canvas.getBoundingClientRect().top)),o=Vt(o,n.config.options.plugins.dragData.round),a=Vt(a,n.config.options.plugins.dragData.round),o=o>n.scales[Pt].max?n.scales[Pt].max:o,o=o<n.scales[Pt].min?n.scales[Pt].min:o,a=a>n.scales[Nt].max?n.scales[Nt].max:a,a=a<n.scales[Nt].min?n.scales[Nt].min:a,It){let t;t="y"===n.config.options.indexAxis?o:a;return Math.abs(t-u[0])<=Math.abs(t-u[1])?[t,u[1]]:[u[0],t]}return void 0!==u.x&&n.config.options.plugins.dragData.dragX&&(u.x=o),void 0!==u.y?(!1!==n.config.options.plugins.dragData.dragY&&(u.y=a),u):"y"===n.config.options.indexAxis?o:a}const qt=(t,n,e,r)=>{if(Mt){jt=Mt.datasetIndex,Lt=Mt.index,Ot=!0;let i=n.data.datasets[jt].data[Lt];if("radar"===Bt)i=function(t,n){let e,r,i;t.touches?(e=t.touches[0].clientX-n.canvas.getBoundingClientRect().left,r=t.touches[0].clientY-n.canvas.getBoundingClientRect().top):(e=t.clientX-n.canvas.getBoundingClientRect().left,r=t.clientY-n.canvas.getBoundingClientRect().top);let o=n.scales[Tt],a=Math.sqrt(Math.pow(e-o.xCenter,2)+Math.pow(r-o.yCenter,2)),u=o.drawingArea/(o.max-o.min);return i=o.options.ticks.reverse?o.max-a/u:o.min+a/u,i=Vt(i,n.config.options.plugins.dragData.round),i=i>n.scales[Tt].max?n.scales[Tt].max:i,i=i<n.scales[Tt].min?n.scales[Tt].min:i,i}(t,n);else if(kt){i=Vt(Xt(t,n,jt,Lt)-Rt,e.round)}else i=Xt(t,n,jt,Lt);(void 0===e.showTooltip||e.showTooltip)&&n.tooltip.setActiveElements([Mt],{x:Mt.element.x,y:Mt.element.y}),(!r||"function"==typeof r&&!1!==r(t,jt,Lt,i))&&(n.data.datasets[jt].data[Lt]=i,n.update("none"))}};const Yt={id:"dragdata",afterInit:function(t){if(t.config.options.plugins&&t.config.options.plugins.dragData){const n=t.config.options.plugins.dragData;yt(t.canvas).call(St().container(t.canvas).on("start",(e=>((t,n,e)=>{if(Mt=n.getElementsAtEventForMode(t,"nearest",{intersect:!0},!1)[0],Bt=n.config.type,Mt){let r=Mt.datasetIndex,i=Mt.index;const o=n.data.datasets[r],a=n.getDatasetMeta(r);let u=o.data[i];if(Pt=a.xAxisID,Nt=a.yAxisID,Tt=a.rAxisID,!1===o.dragData||n.config.options.scales[Pt]&&!1===n.config.options.scales[Pt].dragData||n.config.options.scales[Nt]&&!1===n.config.options.scales[Nt].dragData||n.config.options.scales[Tt]&&!1===n.config.options.scales[Tt].rAxisID||!1===o.data[Mt.index].dragData)return void(Mt=null);if("bar"===Bt){kt=n.config.options.scales[Pt].stacked;const e=n.data.datasets[0].data[0];It=null!==e&&Array.isArray(e)&&2==e.length;let o=Xt(t,n,r,i);Rt=o-u}"function"==typeof e&&Mt&&!1===e(t,r,i,u)&&(Mt=null)}})(e.sourceEvent,t,n.onDragStart))).on("drag",(e=>qt(e.sourceEvent,t,n,n.onDrag))).on("end",(e=>((t,n,e)=>{if(Lt=void 0,Ot=!1,"function"==typeof e&&Mt){const r=Mt.datasetIndex,i=Mt.index;return e(t,r,i,function(t,n,e){const r=t.config.options.plugins.dragData;if(!r.magnet)return t.data.datasets[n].data[e];{const i=r.magnet;if(i.to&&"function"==typeof i.to){let r=t.data.datasets[n].data[e];return r=i.to(r),t.data.datasets[n].data[e]=r,t.update("none"),r}}}(n,r,i))}})(e.sourceEvent,t,n.onDragEnd))))}},beforeEvent:function(t){if(t.config.options.plugins&&t.config.options.plugins.dragData&&t.config.options.plugins.dragData.showTooltip&&Ot)return!1}};return t.Chart.register(Yt),Yt}));

@@ -1,1 +0,1 @@

import{Chart as t}from"chart.js";var n={value:()=>{}};function e(){for(var t,n=0,e=arguments.length,i={};n<e;++n){if(!(t=arguments[n]+"")||t in i||/[\s.]/.test(t))throw new Error("illegal type: "+t);i[t]=[]}return new r(i)}function r(t){this._=t}function i(t,n){return t.trim().split(/^|\s+/).map((function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))}function o(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function a(t,e,r){for(var i=0,o=t.length;i<o;++i)if(t[i].name===e){t[i]=n,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=r&&t.push({name:e,value:r}),t}r.prototype=e.prototype={constructor:r,on:function(t,n){var e,r=this._,u=i(t+"",r),s=-1,c=u.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++s<c;)if(e=(t=u[s]).type)r[e]=a(r[e],t.name,n);else if(null==n)for(e in r)r[e]=a(r[e],t.name,null);return this}for(;++s<c;)if((e=(t=u[s]).type)&&(e=o(r[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new r(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),o=0;o<e;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,e=(r=this._[t]).length;o<e;++o)r[o].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};var u="http://www.w3.org/1999/xhtml",s={svg:"http://www.w3.org/2000/svg",xhtml:u,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function c(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),s.hasOwnProperty(n)?{space:s[n],local:t}:t}function l(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===u&&n.documentElement.namespaceURI===u?n.createElement(t):n.createElementNS(e,t)}}function f(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function h(t){var n=c(t);return(n.local?f:l)(n)}function p(){}function d(t){return null==t?p:function(){return this.querySelector(t)}}function g(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function v(){return[]}function y(t){return function(n){return n.matches(t)}}var m=Array.prototype.find;function _(){return this.firstElementChild}var w=Array.prototype.filter;function x(){return this.children}function b(t){return new Array(t.length)}function A(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function E(t){return function(){return t}}function D(t,n,e,r,i,o){for(var a,u=0,s=n.length,c=o.length;u<c;++u)(a=n[u])?(a.__data__=o[u],r[u]=a):e[u]=new A(t,o[u]);for(;u<s;++u)(a=n[u])&&(i[u]=a)}function S(t,n,e,r,i,o,a){var u,s,c,l=new Map,f=n.length,h=o.length,p=new Array(f);for(u=0;u<f;++u)(s=n[u])&&(p[u]=c=a.call(s,s.__data__,u,n)+"",l.has(c)?i[u]=s:l.set(c,s));for(u=0;u<h;++u)c=a.call(t,o[u],u,o)+"",(s=l.get(c))?(r[u]=s,s.__data__=o[u],l.delete(c)):e[u]=new A(t,o[u]);for(u=0;u<f;++u)(s=n[u])&&l.get(p[u])===s&&(i[u]=s)}function C(t){return t.__data__}function N(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function P(t){return function(){this.removeAttribute(t)}}function M(t){return function(){this.removeAttributeNS(t.space,t.local)}}function B(t,n){return function(){this.setAttribute(t,n)}}function T(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function k(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function I(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function R(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function L(t){return function(){this.style.removeProperty(t)}}function O(t,n,e){return function(){this.style.setProperty(t,n,e)}}function V(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function X(t,n){return t.style.getPropertyValue(n)||R(t).getComputedStyle(t,null).getPropertyValue(n)}function j(t){return function(){delete this[t]}}function Y(t,n){return function(){this[t]=n}}function q(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function U(t){return t.trim().split(/^|\s+/)}function F(t){return t.classList||new z(t)}function z(t){this._node=t,this._names=U(t.getAttribute("class")||"")}function H(t,n){for(var e=F(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function G(t,n){for(var e=F(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function K(t){return function(){H(this,t)}}function J(t){return function(){G(this,t)}}function Q(t,n){return function(){(n.apply(this,arguments)?H:G)(this,t)}}function W(){this.textContent=""}function Z(t){return function(){this.textContent=t}}function $(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function tt(){this.innerHTML=""}function nt(t){return function(){this.innerHTML=t}}function et(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function rt(){this.nextSibling&&this.parentNode.appendChild(this)}function it(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ot(){return null}function at(){var t=this.parentNode;t&&t.removeChild(this)}function ut(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function st(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function ct(t){return t.trim().split(/^|\s+/).map((function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}function lt(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r<o;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.options);++i?n.length=i:delete this.__on}}}function ft(t,n,e){return function(){var r,i=this.__on,o=function(t){return function(n){t.call(this,n,this.__data__)}}(n);if(i)for(var a=0,u=i.length;a<u;++a)if((r=i[a]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=e),void(r.value=n);this.addEventListener(t.type,o,e),r={type:t.type,name:t.name,value:n,listener:o,options:e},i?i.push(r):this.__on=[r]}}function ht(t,n,e){var r=R(t),i=r.CustomEvent;"function"==typeof i?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}function pt(t,n){return function(){return ht(this,t,n)}}function dt(t,n){return function(){return ht(this,t,n.apply(this,arguments))}}A.prototype={constructor:A,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}},z.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var gt=[null];function vt(t,n){this._groups=t,this._parents=n}function yt(t){return"string"==typeof t?new vt([[document.querySelector(t)]],[document.documentElement]):new vt([[t]],gt)}function mt(t,n){if(t=function(t){let n;for(;n=t.sourceEvent;)t=n;return t}(t),void 0===n&&(n=t.currentTarget),n){var e=n.ownerSVGElement||n;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(n.getScreenCTM().inverse())).x,r.y]}if(n.getBoundingClientRect){var i=n.getBoundingClientRect();return[t.clientX-i.left-n.clientLeft,t.clientY-i.top-n.clientTop]}}return[t.pageX,t.pageY]}function _t(t){t.stopImmediatePropagation()}function wt(t){t.preventDefault(),t.stopImmediatePropagation()}vt.prototype={constructor:vt,select:function(t){"function"!=typeof t&&(t=d(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a,u=n[i],s=u.length,c=r[i]=new Array(s),l=0;l<s;++l)(o=u[l])&&(a=t.call(o,o.__data__,l,u))&&("__data__"in o&&(a.__data__=o.__data__),c[l]=a);return new vt(r,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){var n=t.apply(this,arguments);return null==n?[]:g(n)}}(t):function(t){return null==t?v:function(){return this.querySelectorAll(t)}}(t);for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var a,u=n[o],s=u.length,c=0;c<s;++c)(a=u[c])&&(r.push(t.call(a,a.__data__,c,u)),i.push(a));return new vt(r,i)},selectChild:function(t){return this.select(null==t?_:function(t){return function(){return m.call(this.children,t)}}("function"==typeof t?t:y(t)))},selectChildren:function(t){return this.selectAll(null==t?x:function(t){return function(){return w.call(this.children,t)}}("function"==typeof t?t:y(t)))},filter:function(t){"function"!=typeof t&&(t=function(t){return function(){return this.matches(t)}}(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a=n[i],u=a.length,s=r[i]=[],c=0;c<u;++c)(o=a[c])&&t.call(o,o.__data__,c,a)&&s.push(o);return new vt(r,this._parents)},data:function(t,n){if(!arguments.length)return Array.from(this,C);var e=n?S:D,r=this._parents,i=this._groups;"function"!=typeof t&&(t=E(t));for(var o=i.length,a=new Array(o),u=new Array(o),s=new Array(o),c=0;c<o;++c){var l=r[c],f=i[c],h=f.length,p=g(t.call(l,l&&l.__data__,c,r)),d=p.length,v=u[c]=new Array(d),y=a[c]=new Array(d),m=s[c]=new Array(h);e(l,f,v,y,m,p,n);for(var _,w,x=0,b=0;x<d;++x)if(_=v[x]){for(x>=b&&(b=x+1);!(w=y[b])&&++b<d;);_._next=w||null}}return(a=new vt(a,r))._enter=u,a._exit=s,a},enter:function(){return new vt(this._enter||this._groups.map(b),this._parents)},exit:function(){return new vt(this._exit||this._groups.map(b),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,o=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=n&&(i=n(i)),null==e?o.remove():e(o),r&&i?r.merge(i).order():i},merge:function(t){if(!(t instanceof vt))throw new Error("invalid merge");for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),a=new Array(r),u=0;u<o;++u)for(var s,c=n[u],l=e[u],f=c.length,h=a[u]=new Array(f),p=0;p<f;++p)(s=c[p]||l[p])&&(h[p]=s);for(;u<r;++u)a[u]=n[u];return new vt(a,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],o=i.length-1,a=i[o];--o>=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=N);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var a,u=e[o],s=u.length,c=i[o]=new Array(s),l=0;l<s;++l)(a=u[l])&&(c[l]=a);c.sort(n)}return new vt(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null},size:function(){let t=0;for(const n of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,o=n[e],a=0,u=o.length;a<u;++a)(i=o[a])&&t.call(i,i.__data__,a,o);return this},attr:function(t,n){var e=c(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==n?e.local?M:P:"function"==typeof n?e.local?I:k:e.local?T:B)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?L:"function"==typeof n?V:O)(t,n,null==e?"":e)):X(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?j:"function"==typeof n?q:Y)(t,n)):this.node()[t]},classed:function(t,n){var e=U(t+"");if(arguments.length<2){for(var r=F(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?Q:n?K:J)(e,n))},text:function(t){return arguments.length?this.each(null==t?W:("function"==typeof t?$:Z)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?tt:("function"==typeof t?et:nt)(t)):this.node().innerHTML},raise:function(){return this.each(rt)},lower:function(){return this.each(it)},append:function(t){var n="function"==typeof t?t:h(t);return this.select((function(){return this.appendChild(n.apply(this,arguments))}))},insert:function(t,n){var e="function"==typeof t?t:h(t),r=null==n?ot:"function"==typeof n?n:d(n);return this.select((function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(at)},clone:function(t){return this.select(t?st:ut)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=ct(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?ft:lt,r=0;r<a;++r)this.each(u(o[r],n,e));return this}var u=this.node().__on;if(u)for(var s,c=0,l=u.length;c<l;++c)for(r=0,s=u[c];r<a;++r)if((i=o[r]).type===s.type&&i.name===s.name)return s.value},dispatch:function(t,n){return this.each(("function"==typeof n?dt:pt)(t,n))},[Symbol.iterator]:function*(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r,i=t[n],o=0,a=i.length;o<a;++o)(r=i[o])&&(yield r)}};var xt=t=>()=>t;function bt(t,{sourceEvent:n,subject:e,target:r,identifier:i,active:o,x:a,y:u,dx:s,dy:c,dispatch:l}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:s,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:l}})}function At(t){return!t.ctrlKey&&!t.button}function Et(){return this.parentNode}function Dt(t,n){return null==n?{x:t.x,y:t.y}:n}function St(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ct(){var t,n,r,i,o=At,a=Et,u=Dt,s=St,c={},l=e("start","drag","end"),f=0,h=0;function p(t){t.on("mousedown.drag",d).filter(s).on("touchstart.drag",y).on("touchmove.drag",m).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(e,u){if(!i&&o.call(this,e,u)){var s=w(this,a.call(this,e,u),e,u,"mouse");s&&(yt(e.view).on("mousemove.drag",g,!0).on("mouseup.drag",v,!0),function(t){var n=t.document.documentElement,e=yt(t).on("dragstart.drag",wt,!0);"onselectstart"in n?e.on("selectstart.drag",wt,!0):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}(e.view),_t(e),r=!1,t=e.clientX,n=e.clientY,s("start",e))}}function g(e){if(wt(e),!r){var i=e.clientX-t,o=e.clientY-n;r=i*i+o*o>h}c.mouse("drag",e)}function v(t){yt(t.view).on("mousemove.drag mouseup.drag",null),function(t,n){var e=t.document.documentElement,r=yt(t).on("dragstart.drag",null);n&&(r.on("click.drag",wt,!0),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in e?r.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}(t.view,r),wt(t),c.mouse("end",t)}function y(t,n){if(o.call(this,t,n)){var e,r,i=t.changedTouches,u=a.call(this,t,n),s=i.length;for(e=0;e<s;++e)(r=w(this,u,t,n,i[e].identifier,i[e]))&&(_t(t),r("start",t,i[e]))}}function m(t){var n,e,r=t.changedTouches,i=r.length;for(n=0;n<i;++n)(e=c[r[n].identifier])&&(wt(t),e("drag",t,r[n]))}function _(t){var n,e,r=t.changedTouches,o=r.length;for(i&&clearTimeout(i),i=setTimeout((function(){i=null}),500),n=0;n<o;++n)(e=c[r[n].identifier])&&(_t(t),e("end",t,r[n]))}function w(t,n,e,r,i,o){var a,s,h,d=l.copy(),g=mt(o||e,n);if(null!=(h=u.call(t,new bt("beforestart",{sourceEvent:e,target:p,identifier:i,active:f,x:g[0],y:g[1],dx:0,dy:0,dispatch:d}),r)))return a=h.x-g[0]||0,s=h.y-g[1]||0,function e(o,u,l){var v,y=g;switch(o){case"start":c[i]=e,v=f++;break;case"end":delete c[i],--f;case"drag":g=mt(l||u,n),v=f}d.call(o,t,new bt(o,{sourceEvent:u,subject:h,target:p,identifier:i,active:v,x:g[0]+a,y:g[1]+s,dx:g[0]-y[0],dy:g[1]-y[1],dispatch:d}),r)}}return p.filter=function(t){return arguments.length?(o="function"==typeof t?t:xt(!!t),p):o},p.container=function(t){return arguments.length?(a="function"==typeof t?t:xt(t),p):a},p.subject=function(t){return arguments.length?(u="function"==typeof t?t:xt(t),p):u},p.touchable=function(t){return arguments.length?(s="function"==typeof t?t:xt(!!t),p):s},p.on=function(){var t=l.on.apply(l,arguments);return t===l?p:t},p.clickDistance=function(t){return arguments.length?(h=(t=+t)*t,p):Math.sqrt(h)},p}let Nt,Pt,Mt,Bt,Tt,kt,It,Rt,Lt;bt.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};let Ot=!1;function Vt(t,n){return isNaN(n)?t:Math.round(t*Math.pow(10,n))/Math.pow(10,n)}function Xt(t,n,e,r,i){let o,a;const u=n.data.datasets[e].data[r];return t.touches?(o=n.scales[Mt].getValueForPixel(t.touches[0].clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Pt].getValueForPixel(t.touches[0].clientY-n.canvas.getBoundingClientRect().top)):(o=n.scales[Mt].getValueForPixel(t.clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Pt].getValueForPixel(t.clientY-n.canvas.getBoundingClientRect().top)),o=Vt(o,n.config.options.plugins.dragData.round),a=Vt(a,n.config.options.plugins.dragData.round),o=o>n.scales[Mt].max?n.scales[Mt].max:o,o=o<n.scales[Mt].min?n.scales[Mt].min:o,a=a>n.scales[Pt].max?n.scales[Pt].max:a,a=a<n.scales[Pt].min?n.scales[Pt].min:a,void 0!==u.x&&n.config.options.plugins.dragData.dragX&&(u.x=o),void 0!==u.y?(!1!==n.config.options.plugins.dragData.dragY&&(u.y=a),u):"y"===n.config.options.indexAxis?o:a}const jt=(t,n,e,r)=>{if(Nt){Rt=Nt.datasetIndex,Lt=Nt.index,Ot=!0;let i=n.data.datasets[Rt].data[Lt];if("radar"===Tt)i=function(t,n){let e,r,i;t.touches?(e=t.touches[0].clientX-n.canvas.getBoundingClientRect().left,r=t.touches[0].clientY-n.canvas.getBoundingClientRect().top):(e=t.clientX-n.canvas.getBoundingClientRect().left,r=t.clientY-n.canvas.getBoundingClientRect().top);let o=n.scales[Bt],a=Math.sqrt(Math.pow(e-o.xCenter,2)+Math.pow(r-o.yCenter,2)),u=o.drawingArea/(o.max-o.min);return i=o.options.ticks.reverse?o.max-a/u:o.min+a/u,i=Vt(i,n.config.options.plugins.dragData.round),i=i>n.scales[Bt].max?n.scales[Bt].max:i,i=i<n.scales[Bt].min?n.scales[Bt].min:i,i}(t,n);else if(kt){i=Vt(Xt(t,n,Rt,Lt)-It,e.round)}else i=Xt(t,n,Rt,Lt);(void 0===e.showTooltip||e.showTooltip)&&n.tooltip.setActiveElements([Nt],{x:Nt.element.x,y:Nt.element.y}),(!r||"function"==typeof r&&!1!==r(t,Rt,Lt,i))&&(n.data.datasets[Rt].data[Lt]=i,n.update("none"))}};const Yt={id:"dragdata",afterInit:function(t){if(t.config.options.plugins&&t.config.options.plugins.dragData){const n=t.config.options.plugins.dragData;yt(t.canvas).call(Ct().container(t.canvas).on("start",(e=>((t,n,e)=>{if(Nt=n.getElementsAtEventForMode(t,"nearest",{intersect:!0},!1)[0],Tt=n.config.type,Nt){let r=Nt.datasetIndex,i=Nt.index;const o=n.data.datasets[r],a=n.getDatasetMeta(r);let u=o.data[i];if(Mt=a.xAxisID,Pt=a.yAxisID,Bt=a.rAxisID,!1===o.dragData||n.config.options.scales[Mt]&&!1===n.config.options.scales[Mt].dragData||n.config.options.scales[Pt]&&!1===n.config.options.scales[Pt].dragData||n.config.options.scales[Bt]&&!1===n.config.options.scales[Bt].rAxisID||!1===o.data[Nt.index].dragData)return void(Nt=null);if("bar"===Tt){kt=n.config.options.scales[Mt].stacked;let e=Xt(t,n,r,i);It=e-u}"function"==typeof e&&Nt&&!1===e(t,r,i,u)&&(Nt=null)}})(e.sourceEvent,t,n.onDragStart))).on("drag",(e=>jt(e.sourceEvent,t,n,n.onDrag))).on("end",(e=>((t,n,e)=>{if(Lt=void 0,Ot=!1,"function"==typeof e&&Nt){const r=Nt.datasetIndex,i=Nt.index;return e(t,r,i,function(t,n,e){const r=t.config.options.plugins.dragData;if(!r.magnet)return t.data.datasets[n].data[e];{const i=r.magnet;if(i.to&&"function"==typeof i.to){let r=t.data.datasets[n].data[e];return r=i.to(r),t.data.datasets[n].data[e]=r,t.update("none"),r}}}(n,r,i))}})(e.sourceEvent,t,n.onDragEnd))))}},beforeEvent:function(t){if(t.config.options.plugins&&t.config.options.plugins.dragData&&t.config.options.plugins.dragData.showTooltip&&Ot)return!1}};t.register(Yt);export default Yt;
import{Chart as t}from"chart.js";var n={value:()=>{}};function e(){for(var t,n=0,e=arguments.length,i={};n<e;++n){if(!(t=arguments[n]+"")||t in i||/[\s.]/.test(t))throw new Error("illegal type: "+t);i[t]=[]}return new r(i)}function r(t){this._=t}function i(t,n){return t.trim().split(/^|\s+/).map((function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))}function o(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function a(t,e,r){for(var i=0,o=t.length;i<o;++i)if(t[i].name===e){t[i]=n,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=r&&t.push({name:e,value:r}),t}r.prototype=e.prototype={constructor:r,on:function(t,n){var e,r=this._,u=i(t+"",r),s=-1,c=u.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++s<c;)if(e=(t=u[s]).type)r[e]=a(r[e],t.name,n);else if(null==n)for(e in r)r[e]=a(r[e],t.name,null);return this}for(;++s<c;)if((e=(t=u[s]).type)&&(e=o(r[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new r(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),o=0;o<e;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,e=(r=this._[t]).length;o<e;++o)r[o].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};var u="http://www.w3.org/1999/xhtml",s={svg:"http://www.w3.org/2000/svg",xhtml:u,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function c(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),s.hasOwnProperty(n)?{space:s[n],local:t}:t}function l(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===u&&n.documentElement.namespaceURI===u?n.createElement(t):n.createElementNS(e,t)}}function f(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function h(t){var n=c(t);return(n.local?f:l)(n)}function p(){}function d(t){return null==t?p:function(){return this.querySelector(t)}}function g(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function v(){return[]}function y(t){return function(n){return n.matches(t)}}var m=Array.prototype.find;function _(){return this.firstElementChild}var w=Array.prototype.filter;function x(){return this.children}function b(t){return new Array(t.length)}function A(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function E(t){return function(){return t}}function D(t,n,e,r,i,o){for(var a,u=0,s=n.length,c=o.length;u<c;++u)(a=n[u])?(a.__data__=o[u],r[u]=a):e[u]=new A(t,o[u]);for(;u<s;++u)(a=n[u])&&(i[u]=a)}function S(t,n,e,r,i,o,a){var u,s,c,l=new Map,f=n.length,h=o.length,p=new Array(f);for(u=0;u<f;++u)(s=n[u])&&(p[u]=c=a.call(s,s.__data__,u,n)+"",l.has(c)?i[u]=s:l.set(c,s));for(u=0;u<h;++u)c=a.call(t,o[u],u,o)+"",(s=l.get(c))?(r[u]=s,s.__data__=o[u],l.delete(c)):e[u]=new A(t,o[u]);for(u=0;u<f;++u)(s=n[u])&&l.get(p[u])===s&&(i[u]=s)}function C(t){return t.__data__}function M(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function N(t){return function(){this.removeAttribute(t)}}function P(t){return function(){this.removeAttributeNS(t.space,t.local)}}function B(t,n){return function(){this.setAttribute(t,n)}}function T(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function k(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function I(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function R(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function L(t){return function(){this.style.removeProperty(t)}}function O(t,n,e){return function(){this.style.setProperty(t,n,e)}}function V(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function X(t,n){return t.style.getPropertyValue(n)||R(t).getComputedStyle(t,null).getPropertyValue(n)}function j(t){return function(){delete this[t]}}function Y(t,n){return function(){this[t]=n}}function q(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function U(t){return t.trim().split(/^|\s+/)}function F(t){return t.classList||new z(t)}function z(t){this._node=t,this._names=U(t.getAttribute("class")||"")}function H(t,n){for(var e=F(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function G(t,n){for(var e=F(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function K(t){return function(){H(this,t)}}function J(t){return function(){G(this,t)}}function Q(t,n){return function(){(n.apply(this,arguments)?H:G)(this,t)}}function W(){this.textContent=""}function Z(t){return function(){this.textContent=t}}function $(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function tt(){this.innerHTML=""}function nt(t){return function(){this.innerHTML=t}}function et(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function rt(){this.nextSibling&&this.parentNode.appendChild(this)}function it(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ot(){return null}function at(){var t=this.parentNode;t&&t.removeChild(this)}function ut(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function st(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function ct(t){return t.trim().split(/^|\s+/).map((function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}function lt(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r<o;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.options);++i?n.length=i:delete this.__on}}}function ft(t,n,e){return function(){var r,i=this.__on,o=function(t){return function(n){t.call(this,n,this.__data__)}}(n);if(i)for(var a=0,u=i.length;a<u;++a)if((r=i[a]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=e),void(r.value=n);this.addEventListener(t.type,o,e),r={type:t.type,name:t.name,value:n,listener:o,options:e},i?i.push(r):this.__on=[r]}}function ht(t,n,e){var r=R(t),i=r.CustomEvent;"function"==typeof i?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}function pt(t,n){return function(){return ht(this,t,n)}}function dt(t,n){return function(){return ht(this,t,n.apply(this,arguments))}}A.prototype={constructor:A,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}},z.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var gt=[null];function vt(t,n){this._groups=t,this._parents=n}function yt(t){return"string"==typeof t?new vt([[document.querySelector(t)]],[document.documentElement]):new vt([[t]],gt)}function mt(t,n){if(t=function(t){let n;for(;n=t.sourceEvent;)t=n;return t}(t),void 0===n&&(n=t.currentTarget),n){var e=n.ownerSVGElement||n;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(n.getScreenCTM().inverse())).x,r.y]}if(n.getBoundingClientRect){var i=n.getBoundingClientRect();return[t.clientX-i.left-n.clientLeft,t.clientY-i.top-n.clientTop]}}return[t.pageX,t.pageY]}function _t(t){t.stopImmediatePropagation()}function wt(t){t.preventDefault(),t.stopImmediatePropagation()}vt.prototype={constructor:vt,select:function(t){"function"!=typeof t&&(t=d(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a,u=n[i],s=u.length,c=r[i]=new Array(s),l=0;l<s;++l)(o=u[l])&&(a=t.call(o,o.__data__,l,u))&&("__data__"in o&&(a.__data__=o.__data__),c[l]=a);return new vt(r,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){var n=t.apply(this,arguments);return null==n?[]:g(n)}}(t):function(t){return null==t?v:function(){return this.querySelectorAll(t)}}(t);for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var a,u=n[o],s=u.length,c=0;c<s;++c)(a=u[c])&&(r.push(t.call(a,a.__data__,c,u)),i.push(a));return new vt(r,i)},selectChild:function(t){return this.select(null==t?_:function(t){return function(){return m.call(this.children,t)}}("function"==typeof t?t:y(t)))},selectChildren:function(t){return this.selectAll(null==t?x:function(t){return function(){return w.call(this.children,t)}}("function"==typeof t?t:y(t)))},filter:function(t){"function"!=typeof t&&(t=function(t){return function(){return this.matches(t)}}(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a=n[i],u=a.length,s=r[i]=[],c=0;c<u;++c)(o=a[c])&&t.call(o,o.__data__,c,a)&&s.push(o);return new vt(r,this._parents)},data:function(t,n){if(!arguments.length)return Array.from(this,C);var e=n?S:D,r=this._parents,i=this._groups;"function"!=typeof t&&(t=E(t));for(var o=i.length,a=new Array(o),u=new Array(o),s=new Array(o),c=0;c<o;++c){var l=r[c],f=i[c],h=f.length,p=g(t.call(l,l&&l.__data__,c,r)),d=p.length,v=u[c]=new Array(d),y=a[c]=new Array(d),m=s[c]=new Array(h);e(l,f,v,y,m,p,n);for(var _,w,x=0,b=0;x<d;++x)if(_=v[x]){for(x>=b&&(b=x+1);!(w=y[b])&&++b<d;);_._next=w||null}}return(a=new vt(a,r))._enter=u,a._exit=s,a},enter:function(){return new vt(this._enter||this._groups.map(b),this._parents)},exit:function(){return new vt(this._exit||this._groups.map(b),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,o=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=n&&(i=n(i)),null==e?o.remove():e(o),r&&i?r.merge(i).order():i},merge:function(t){if(!(t instanceof vt))throw new Error("invalid merge");for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),a=new Array(r),u=0;u<o;++u)for(var s,c=n[u],l=e[u],f=c.length,h=a[u]=new Array(f),p=0;p<f;++p)(s=c[p]||l[p])&&(h[p]=s);for(;u<r;++u)a[u]=n[u];return new vt(a,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],o=i.length-1,a=i[o];--o>=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=M);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var a,u=e[o],s=u.length,c=i[o]=new Array(s),l=0;l<s;++l)(a=u[l])&&(c[l]=a);c.sort(n)}return new vt(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null},size:function(){let t=0;for(const n of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,o=n[e],a=0,u=o.length;a<u;++a)(i=o[a])&&t.call(i,i.__data__,a,o);return this},attr:function(t,n){var e=c(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==n?e.local?P:N:"function"==typeof n?e.local?I:k:e.local?T:B)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?L:"function"==typeof n?V:O)(t,n,null==e?"":e)):X(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?j:"function"==typeof n?q:Y)(t,n)):this.node()[t]},classed:function(t,n){var e=U(t+"");if(arguments.length<2){for(var r=F(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?Q:n?K:J)(e,n))},text:function(t){return arguments.length?this.each(null==t?W:("function"==typeof t?$:Z)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?tt:("function"==typeof t?et:nt)(t)):this.node().innerHTML},raise:function(){return this.each(rt)},lower:function(){return this.each(it)},append:function(t){var n="function"==typeof t?t:h(t);return this.select((function(){return this.appendChild(n.apply(this,arguments))}))},insert:function(t,n){var e="function"==typeof t?t:h(t),r=null==n?ot:"function"==typeof n?n:d(n);return this.select((function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(at)},clone:function(t){return this.select(t?st:ut)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=ct(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?ft:lt,r=0;r<a;++r)this.each(u(o[r],n,e));return this}var u=this.node().__on;if(u)for(var s,c=0,l=u.length;c<l;++c)for(r=0,s=u[c];r<a;++r)if((i=o[r]).type===s.type&&i.name===s.name)return s.value},dispatch:function(t,n){return this.each(("function"==typeof n?dt:pt)(t,n))},[Symbol.iterator]:function*(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r,i=t[n],o=0,a=i.length;o<a;++o)(r=i[o])&&(yield r)}};var xt=t=>()=>t;function bt(t,{sourceEvent:n,subject:e,target:r,identifier:i,active:o,x:a,y:u,dx:s,dy:c,dispatch:l}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:s,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:l}})}function At(t){return!t.ctrlKey&&!t.button}function Et(){return this.parentNode}function Dt(t,n){return null==n?{x:t.x,y:t.y}:n}function St(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ct(){var t,n,r,i,o=At,a=Et,u=Dt,s=St,c={},l=e("start","drag","end"),f=0,h=0;function p(t){t.on("mousedown.drag",d).filter(s).on("touchstart.drag",y).on("touchmove.drag",m).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(e,u){if(!i&&o.call(this,e,u)){var s=w(this,a.call(this,e,u),e,u,"mouse");s&&(yt(e.view).on("mousemove.drag",g,!0).on("mouseup.drag",v,!0),function(t){var n=t.document.documentElement,e=yt(t).on("dragstart.drag",wt,!0);"onselectstart"in n?e.on("selectstart.drag",wt,!0):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}(e.view),_t(e),r=!1,t=e.clientX,n=e.clientY,s("start",e))}}function g(e){if(wt(e),!r){var i=e.clientX-t,o=e.clientY-n;r=i*i+o*o>h}c.mouse("drag",e)}function v(t){yt(t.view).on("mousemove.drag mouseup.drag",null),function(t,n){var e=t.document.documentElement,r=yt(t).on("dragstart.drag",null);n&&(r.on("click.drag",wt,!0),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in e?r.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}(t.view,r),wt(t),c.mouse("end",t)}function y(t,n){if(o.call(this,t,n)){var e,r,i=t.changedTouches,u=a.call(this,t,n),s=i.length;for(e=0;e<s;++e)(r=w(this,u,t,n,i[e].identifier,i[e]))&&(_t(t),r("start",t,i[e]))}}function m(t){var n,e,r=t.changedTouches,i=r.length;for(n=0;n<i;++n)(e=c[r[n].identifier])&&(wt(t),e("drag",t,r[n]))}function _(t){var n,e,r=t.changedTouches,o=r.length;for(i&&clearTimeout(i),i=setTimeout((function(){i=null}),500),n=0;n<o;++n)(e=c[r[n].identifier])&&(_t(t),e("end",t,r[n]))}function w(t,n,e,r,i,o){var a,s,h,d=l.copy(),g=mt(o||e,n);if(null!=(h=u.call(t,new bt("beforestart",{sourceEvent:e,target:p,identifier:i,active:f,x:g[0],y:g[1],dx:0,dy:0,dispatch:d}),r)))return a=h.x-g[0]||0,s=h.y-g[1]||0,function e(o,u,l){var v,y=g;switch(o){case"start":c[i]=e,v=f++;break;case"end":delete c[i],--f;case"drag":g=mt(l||u,n),v=f}d.call(o,t,new bt(o,{sourceEvent:u,subject:h,target:p,identifier:i,active:v,x:g[0]+a,y:g[1]+s,dx:g[0]-y[0],dy:g[1]-y[1],dispatch:d}),r)}}return p.filter=function(t){return arguments.length?(o="function"==typeof t?t:xt(!!t),p):o},p.container=function(t){return arguments.length?(a="function"==typeof t?t:xt(t),p):a},p.subject=function(t){return arguments.length?(u="function"==typeof t?t:xt(t),p):u},p.touchable=function(t){return arguments.length?(s="function"==typeof t?t:xt(!!t),p):s},p.on=function(){var t=l.on.apply(l,arguments);return t===l?p:t},p.clickDistance=function(t){return arguments.length?(h=(t=+t)*t,p):Math.sqrt(h)},p}let Mt,Nt,Pt,Bt,Tt,kt,It,Rt,Lt,Ot;bt.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};let Vt=!1;function Xt(t,n){return isNaN(n)?t:Math.round(t*Math.pow(10,n))/Math.pow(10,n)}function jt(t,n,e,r,i){let o,a;const u=n.data.datasets[e].data[r];if(t.touches?(o=n.scales[Pt].getValueForPixel(t.touches[0].clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Nt].getValueForPixel(t.touches[0].clientY-n.canvas.getBoundingClientRect().top)):(o=n.scales[Pt].getValueForPixel(t.clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Nt].getValueForPixel(t.clientY-n.canvas.getBoundingClientRect().top)),o=Xt(o,n.config.options.plugins.dragData.round),a=Xt(a,n.config.options.plugins.dragData.round),o=o>n.scales[Pt].max?n.scales[Pt].max:o,o=o<n.scales[Pt].min?n.scales[Pt].min:o,a=a>n.scales[Nt].max?n.scales[Nt].max:a,a=a<n.scales[Nt].min?n.scales[Nt].min:a,It){let t;t="y"===n.config.options.indexAxis?o:a;return Math.abs(t-u[0])<=Math.abs(t-u[1])?[t,u[1]]:[u[0],t]}return void 0!==u.x&&n.config.options.plugins.dragData.dragX&&(u.x=o),void 0!==u.y?(!1!==n.config.options.plugins.dragData.dragY&&(u.y=a),u):"y"===n.config.options.indexAxis?o:a}const Yt=(t,n,e,r)=>{if(Mt){Lt=Mt.datasetIndex,Ot=Mt.index,Vt=!0;let i=n.data.datasets[Lt].data[Ot];if("radar"===Tt)i=function(t,n){let e,r,i;t.touches?(e=t.touches[0].clientX-n.canvas.getBoundingClientRect().left,r=t.touches[0].clientY-n.canvas.getBoundingClientRect().top):(e=t.clientX-n.canvas.getBoundingClientRect().left,r=t.clientY-n.canvas.getBoundingClientRect().top);let o=n.scales[Bt],a=Math.sqrt(Math.pow(e-o.xCenter,2)+Math.pow(r-o.yCenter,2)),u=o.drawingArea/(o.max-o.min);return i=o.options.ticks.reverse?o.max-a/u:o.min+a/u,i=Xt(i,n.config.options.plugins.dragData.round),i=i>n.scales[Bt].max?n.scales[Bt].max:i,i=i<n.scales[Bt].min?n.scales[Bt].min:i,i}(t,n);else if(kt){i=Xt(jt(t,n,Lt,Ot)-Rt,e.round)}else i=jt(t,n,Lt,Ot);(void 0===e.showTooltip||e.showTooltip)&&n.tooltip.setActiveElements([Mt],{x:Mt.element.x,y:Mt.element.y}),(!r||"function"==typeof r&&!1!==r(t,Lt,Ot,i))&&(n.data.datasets[Lt].data[Ot]=i,n.update("none"))}};const qt={id:"dragdata",afterInit:function(t){if(t.config.options.plugins&&t.config.options.plugins.dragData){const n=t.config.options.plugins.dragData;yt(t.canvas).call(Ct().container(t.canvas).on("start",(e=>((t,n,e)=>{if(Mt=n.getElementsAtEventForMode(t,"nearest",{intersect:!0},!1)[0],Tt=n.config.type,Mt){let r=Mt.datasetIndex,i=Mt.index;const o=n.data.datasets[r],a=n.getDatasetMeta(r);let u=o.data[i];if(Pt=a.xAxisID,Nt=a.yAxisID,Bt=a.rAxisID,!1===o.dragData||n.config.options.scales[Pt]&&!1===n.config.options.scales[Pt].dragData||n.config.options.scales[Nt]&&!1===n.config.options.scales[Nt].dragData||n.config.options.scales[Bt]&&!1===n.config.options.scales[Bt].rAxisID||!1===o.data[Mt.index].dragData)return void(Mt=null);if("bar"===Tt){kt=n.config.options.scales[Pt].stacked;const e=n.data.datasets[0].data[0];It=null!==e&&Array.isArray(e)&&2==e.length;let o=jt(t,n,r,i);Rt=o-u}"function"==typeof e&&Mt&&!1===e(t,r,i,u)&&(Mt=null)}})(e.sourceEvent,t,n.onDragStart))).on("drag",(e=>Yt(e.sourceEvent,t,n,n.onDrag))).on("end",(e=>((t,n,e)=>{if(Ot=void 0,Vt=!1,"function"==typeof e&&Mt){const r=Mt.datasetIndex,i=Mt.index;return e(t,r,i,function(t,n,e){const r=t.config.options.plugins.dragData;if(!r.magnet)return t.data.datasets[n].data[e];{const i=r.magnet;if(i.to&&"function"==typeof i.to){let r=t.data.datasets[n].data[e];return r=i.to(r),t.data.datasets[n].data[e]=r,t.update("none"),r}}}(n,r,i))}})(e.sourceEvent,t,n.onDragEnd))))}},beforeEvent:function(t){if(t.config.options.plugins&&t.config.options.plugins.dragData&&t.config.options.plugins.dragData.showTooltip&&Vt)return!1}};t.register(qt);export default qt;

@@ -1,1 +0,1 @@

!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("chart.js")):"function"==typeof define&&define.amd?define(["chart.js"],n):(t="undefined"!=typeof globalThis?globalThis:t||self).index=n(t.Chart)}(this,(function(t){"use strict";var n={value:()=>{}};function e(){for(var t,n=0,e=arguments.length,i={};n<e;++n){if(!(t=arguments[n]+"")||t in i||/[\s.]/.test(t))throw new Error("illegal type: "+t);i[t]=[]}return new r(i)}function r(t){this._=t}function i(t,n){return t.trim().split(/^|\s+/).map((function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))}function o(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function a(t,e,r){for(var i=0,o=t.length;i<o;++i)if(t[i].name===e){t[i]=n,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=r&&t.push({name:e,value:r}),t}r.prototype=e.prototype={constructor:r,on:function(t,n){var e,r=this._,u=i(t+"",r),s=-1,c=u.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++s<c;)if(e=(t=u[s]).type)r[e]=a(r[e],t.name,n);else if(null==n)for(e in r)r[e]=a(r[e],t.name,null);return this}for(;++s<c;)if((e=(t=u[s]).type)&&(e=o(r[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new r(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),o=0;o<e;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,e=(r=this._[t]).length;o<e;++o)r[o].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};var u="http://www.w3.org/1999/xhtml",s={svg:"http://www.w3.org/2000/svg",xhtml:u,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function c(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),s.hasOwnProperty(n)?{space:s[n],local:t}:t}function l(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===u&&n.documentElement.namespaceURI===u?n.createElement(t):n.createElementNS(e,t)}}function f(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function h(t){var n=c(t);return(n.local?f:l)(n)}function p(){}function d(t){return null==t?p:function(){return this.querySelector(t)}}function g(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function v(){return[]}function y(t){return function(n){return n.matches(t)}}var m=Array.prototype.find;function _(){return this.firstElementChild}var w=Array.prototype.filter;function x(){return this.children}function b(t){return new Array(t.length)}function A(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function E(t){return function(){return t}}function D(t,n,e,r,i,o){for(var a,u=0,s=n.length,c=o.length;u<c;++u)(a=n[u])?(a.__data__=o[u],r[u]=a):e[u]=new A(t,o[u]);for(;u<s;++u)(a=n[u])&&(i[u]=a)}function C(t,n,e,r,i,o,a){var u,s,c,l=new Map,f=n.length,h=o.length,p=new Array(f);for(u=0;u<f;++u)(s=n[u])&&(p[u]=c=a.call(s,s.__data__,u,n)+"",l.has(c)?i[u]=s:l.set(c,s));for(u=0;u<h;++u)c=a.call(t,o[u],u,o)+"",(s=l.get(c))?(r[u]=s,s.__data__=o[u],l.delete(c)):e[u]=new A(t,o[u]);for(u=0;u<f;++u)(s=n[u])&&l.get(p[u])===s&&(i[u]=s)}function S(t){return t.__data__}function N(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function P(t){return function(){this.removeAttribute(t)}}function M(t){return function(){this.removeAttributeNS(t.space,t.local)}}function T(t,n){return function(){this.setAttribute(t,n)}}function B(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function k(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function I(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function R(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function j(t){return function(){this.style.removeProperty(t)}}function L(t,n,e){return function(){this.style.setProperty(t,n,e)}}function O(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function V(t,n){return t.style.getPropertyValue(n)||R(t).getComputedStyle(t,null).getPropertyValue(n)}function X(t){return function(){delete this[t]}}function q(t,n){return function(){this[t]=n}}function Y(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function U(t){return t.trim().split(/^|\s+/)}function F(t){return t.classList||new z(t)}function z(t){this._node=t,this._names=U(t.getAttribute("class")||"")}function H(t,n){for(var e=F(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function G(t,n){for(var e=F(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function K(t){return function(){H(this,t)}}function J(t){return function(){G(this,t)}}function Q(t,n){return function(){(n.apply(this,arguments)?H:G)(this,t)}}function W(){this.textContent=""}function Z(t){return function(){this.textContent=t}}function $(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function tt(){this.innerHTML=""}function nt(t){return function(){this.innerHTML=t}}function et(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function rt(){this.nextSibling&&this.parentNode.appendChild(this)}function it(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ot(){return null}function at(){var t=this.parentNode;t&&t.removeChild(this)}function ut(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function st(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function ct(t){return t.trim().split(/^|\s+/).map((function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}function lt(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r<o;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.options);++i?n.length=i:delete this.__on}}}function ft(t,n,e){return function(){var r,i=this.__on,o=function(t){return function(n){t.call(this,n,this.__data__)}}(n);if(i)for(var a=0,u=i.length;a<u;++a)if((r=i[a]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=e),void(r.value=n);this.addEventListener(t.type,o,e),r={type:t.type,name:t.name,value:n,listener:o,options:e},i?i.push(r):this.__on=[r]}}function ht(t,n,e){var r=R(t),i=r.CustomEvent;"function"==typeof i?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}function pt(t,n){return function(){return ht(this,t,n)}}function dt(t,n){return function(){return ht(this,t,n.apply(this,arguments))}}A.prototype={constructor:A,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}},z.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var gt=[null];function vt(t,n){this._groups=t,this._parents=n}function yt(t){return"string"==typeof t?new vt([[document.querySelector(t)]],[document.documentElement]):new vt([[t]],gt)}function mt(t,n){if(t=function(t){let n;for(;n=t.sourceEvent;)t=n;return t}(t),void 0===n&&(n=t.currentTarget),n){var e=n.ownerSVGElement||n;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(n.getScreenCTM().inverse())).x,r.y]}if(n.getBoundingClientRect){var i=n.getBoundingClientRect();return[t.clientX-i.left-n.clientLeft,t.clientY-i.top-n.clientTop]}}return[t.pageX,t.pageY]}function _t(t){t.stopImmediatePropagation()}function wt(t){t.preventDefault(),t.stopImmediatePropagation()}vt.prototype={constructor:vt,select:function(t){"function"!=typeof t&&(t=d(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a,u=n[i],s=u.length,c=r[i]=new Array(s),l=0;l<s;++l)(o=u[l])&&(a=t.call(o,o.__data__,l,u))&&("__data__"in o&&(a.__data__=o.__data__),c[l]=a);return new vt(r,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){var n=t.apply(this,arguments);return null==n?[]:g(n)}}(t):function(t){return null==t?v:function(){return this.querySelectorAll(t)}}(t);for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var a,u=n[o],s=u.length,c=0;c<s;++c)(a=u[c])&&(r.push(t.call(a,a.__data__,c,u)),i.push(a));return new vt(r,i)},selectChild:function(t){return this.select(null==t?_:function(t){return function(){return m.call(this.children,t)}}("function"==typeof t?t:y(t)))},selectChildren:function(t){return this.selectAll(null==t?x:function(t){return function(){return w.call(this.children,t)}}("function"==typeof t?t:y(t)))},filter:function(t){"function"!=typeof t&&(t=function(t){return function(){return this.matches(t)}}(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a=n[i],u=a.length,s=r[i]=[],c=0;c<u;++c)(o=a[c])&&t.call(o,o.__data__,c,a)&&s.push(o);return new vt(r,this._parents)},data:function(t,n){if(!arguments.length)return Array.from(this,S);var e=n?C:D,r=this._parents,i=this._groups;"function"!=typeof t&&(t=E(t));for(var o=i.length,a=new Array(o),u=new Array(o),s=new Array(o),c=0;c<o;++c){var l=r[c],f=i[c],h=f.length,p=g(t.call(l,l&&l.__data__,c,r)),d=p.length,v=u[c]=new Array(d),y=a[c]=new Array(d),m=s[c]=new Array(h);e(l,f,v,y,m,p,n);for(var _,w,x=0,b=0;x<d;++x)if(_=v[x]){for(x>=b&&(b=x+1);!(w=y[b])&&++b<d;);_._next=w||null}}return(a=new vt(a,r))._enter=u,a._exit=s,a},enter:function(){return new vt(this._enter||this._groups.map(b),this._parents)},exit:function(){return new vt(this._exit||this._groups.map(b),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,o=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=n&&(i=n(i)),null==e?o.remove():e(o),r&&i?r.merge(i).order():i},merge:function(t){if(!(t instanceof vt))throw new Error("invalid merge");for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),a=new Array(r),u=0;u<o;++u)for(var s,c=n[u],l=e[u],f=c.length,h=a[u]=new Array(f),p=0;p<f;++p)(s=c[p]||l[p])&&(h[p]=s);for(;u<r;++u)a[u]=n[u];return new vt(a,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],o=i.length-1,a=i[o];--o>=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=N);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var a,u=e[o],s=u.length,c=i[o]=new Array(s),l=0;l<s;++l)(a=u[l])&&(c[l]=a);c.sort(n)}return new vt(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null},size:function(){let t=0;for(const n of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,o=n[e],a=0,u=o.length;a<u;++a)(i=o[a])&&t.call(i,i.__data__,a,o);return this},attr:function(t,n){var e=c(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==n?e.local?M:P:"function"==typeof n?e.local?I:k:e.local?B:T)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?j:"function"==typeof n?O:L)(t,n,null==e?"":e)):V(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?X:"function"==typeof n?Y:q)(t,n)):this.node()[t]},classed:function(t,n){var e=U(t+"");if(arguments.length<2){for(var r=F(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?Q:n?K:J)(e,n))},text:function(t){return arguments.length?this.each(null==t?W:("function"==typeof t?$:Z)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?tt:("function"==typeof t?et:nt)(t)):this.node().innerHTML},raise:function(){return this.each(rt)},lower:function(){return this.each(it)},append:function(t){var n="function"==typeof t?t:h(t);return this.select((function(){return this.appendChild(n.apply(this,arguments))}))},insert:function(t,n){var e="function"==typeof t?t:h(t),r=null==n?ot:"function"==typeof n?n:d(n);return this.select((function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(at)},clone:function(t){return this.select(t?st:ut)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=ct(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?ft:lt,r=0;r<a;++r)this.each(u(o[r],n,e));return this}var u=this.node().__on;if(u)for(var s,c=0,l=u.length;c<l;++c)for(r=0,s=u[c];r<a;++r)if((i=o[r]).type===s.type&&i.name===s.name)return s.value},dispatch:function(t,n){return this.each(("function"==typeof n?dt:pt)(t,n))},[Symbol.iterator]:function*(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r,i=t[n],o=0,a=i.length;o<a;++o)(r=i[o])&&(yield r)}};var xt=t=>()=>t;function bt(t,{sourceEvent:n,subject:e,target:r,identifier:i,active:o,x:a,y:u,dx:s,dy:c,dispatch:l}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:s,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:l}})}function At(t){return!t.ctrlKey&&!t.button}function Et(){return this.parentNode}function Dt(t,n){return null==n?{x:t.x,y:t.y}:n}function Ct(){return navigator.maxTouchPoints||"ontouchstart"in this}function St(){var t,n,r,i,o=At,a=Et,u=Dt,s=Ct,c={},l=e("start","drag","end"),f=0,h=0;function p(t){t.on("mousedown.drag",d).filter(s).on("touchstart.drag",y).on("touchmove.drag",m).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(e,u){if(!i&&o.call(this,e,u)){var s=w(this,a.call(this,e,u),e,u,"mouse");s&&(yt(e.view).on("mousemove.drag",g,!0).on("mouseup.drag",v,!0),function(t){var n=t.document.documentElement,e=yt(t).on("dragstart.drag",wt,!0);"onselectstart"in n?e.on("selectstart.drag",wt,!0):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}(e.view),_t(e),r=!1,t=e.clientX,n=e.clientY,s("start",e))}}function g(e){if(wt(e),!r){var i=e.clientX-t,o=e.clientY-n;r=i*i+o*o>h}c.mouse("drag",e)}function v(t){yt(t.view).on("mousemove.drag mouseup.drag",null),function(t,n){var e=t.document.documentElement,r=yt(t).on("dragstart.drag",null);n&&(r.on("click.drag",wt,!0),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in e?r.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}(t.view,r),wt(t),c.mouse("end",t)}function y(t,n){if(o.call(this,t,n)){var e,r,i=t.changedTouches,u=a.call(this,t,n),s=i.length;for(e=0;e<s;++e)(r=w(this,u,t,n,i[e].identifier,i[e]))&&(_t(t),r("start",t,i[e]))}}function m(t){var n,e,r=t.changedTouches,i=r.length;for(n=0;n<i;++n)(e=c[r[n].identifier])&&(wt(t),e("drag",t,r[n]))}function _(t){var n,e,r=t.changedTouches,o=r.length;for(i&&clearTimeout(i),i=setTimeout((function(){i=null}),500),n=0;n<o;++n)(e=c[r[n].identifier])&&(_t(t),e("end",t,r[n]))}function w(t,n,e,r,i,o){var a,s,h,d=l.copy(),g=mt(o||e,n);if(null!=(h=u.call(t,new bt("beforestart",{sourceEvent:e,target:p,identifier:i,active:f,x:g[0],y:g[1],dx:0,dy:0,dispatch:d}),r)))return a=h.x-g[0]||0,s=h.y-g[1]||0,function e(o,u,l){var v,y=g;switch(o){case"start":c[i]=e,v=f++;break;case"end":delete c[i],--f;case"drag":g=mt(l||u,n),v=f}d.call(o,t,new bt(o,{sourceEvent:u,subject:h,target:p,identifier:i,active:v,x:g[0]+a,y:g[1]+s,dx:g[0]-y[0],dy:g[1]-y[1],dispatch:d}),r)}}return p.filter=function(t){return arguments.length?(o="function"==typeof t?t:xt(!!t),p):o},p.container=function(t){return arguments.length?(a="function"==typeof t?t:xt(t),p):a},p.subject=function(t){return arguments.length?(u="function"==typeof t?t:xt(t),p):u},p.touchable=function(t){return arguments.length?(s="function"==typeof t?t:xt(!!t),p):s},p.on=function(){var t=l.on.apply(l,arguments);return t===l?p:t},p.clickDistance=function(t){return arguments.length?(h=(t=+t)*t,p):Math.sqrt(h)},p}let Nt,Pt,Mt,Tt,Bt,kt,It,Rt,jt;bt.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};let Lt=!1;function Ot(t,n){return isNaN(n)?t:Math.round(t*Math.pow(10,n))/Math.pow(10,n)}function Vt(t,n,e,r,i){let o,a;const u=n.data.datasets[e].data[r];return t.touches?(o=n.scales[Mt].getValueForPixel(t.touches[0].clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Pt].getValueForPixel(t.touches[0].clientY-n.canvas.getBoundingClientRect().top)):(o=n.scales[Mt].getValueForPixel(t.clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Pt].getValueForPixel(t.clientY-n.canvas.getBoundingClientRect().top)),o=Ot(o,n.config.options.plugins.dragData.round),a=Ot(a,n.config.options.plugins.dragData.round),o=o>n.scales[Mt].max?n.scales[Mt].max:o,o=o<n.scales[Mt].min?n.scales[Mt].min:o,a=a>n.scales[Pt].max?n.scales[Pt].max:a,a=a<n.scales[Pt].min?n.scales[Pt].min:a,void 0!==u.x&&n.config.options.plugins.dragData.dragX&&(u.x=o),void 0!==u.y?(!1!==n.config.options.plugins.dragData.dragY&&(u.y=a),u):"y"===n.config.options.indexAxis?o:a}const Xt=(t,n,e,r)=>{if(Nt){Rt=Nt.datasetIndex,jt=Nt.index,Lt=!0;let i=n.data.datasets[Rt].data[jt];if("radar"===Bt)i=function(t,n){let e,r,i;t.touches?(e=t.touches[0].clientX-n.canvas.getBoundingClientRect().left,r=t.touches[0].clientY-n.canvas.getBoundingClientRect().top):(e=t.clientX-n.canvas.getBoundingClientRect().left,r=t.clientY-n.canvas.getBoundingClientRect().top);let o=n.scales[Tt],a=Math.sqrt(Math.pow(e-o.xCenter,2)+Math.pow(r-o.yCenter,2)),u=o.drawingArea/(o.max-o.min);return i=o.options.ticks.reverse?o.max-a/u:o.min+a/u,i=Ot(i,n.config.options.plugins.dragData.round),i=i>n.scales[Tt].max?n.scales[Tt].max:i,i=i<n.scales[Tt].min?n.scales[Tt].min:i,i}(t,n);else if(kt){i=Ot(Vt(t,n,Rt,jt)-It,e.round)}else i=Vt(t,n,Rt,jt);(void 0===e.showTooltip||e.showTooltip)&&n.tooltip.setActiveElements([Nt],{x:Nt.element.x,y:Nt.element.y}),(!r||"function"==typeof r&&!1!==r(t,Rt,jt,i))&&(n.data.datasets[Rt].data[jt]=i,n.update("none"))}};const qt={id:"dragdata",afterInit:function(t){if(t.config.options.plugins&&t.config.options.plugins.dragData){const n=t.config.options.plugins.dragData;yt(t.canvas).call(St().container(t.canvas).on("start",(e=>((t,n,e)=>{if(Nt=n.getElementsAtEventForMode(t,"nearest",{intersect:!0},!1)[0],Bt=n.config.type,Nt){let r=Nt.datasetIndex,i=Nt.index;const o=n.data.datasets[r],a=n.getDatasetMeta(r);let u=o.data[i];if(Mt=a.xAxisID,Pt=a.yAxisID,Tt=a.rAxisID,!1===o.dragData||n.config.options.scales[Mt]&&!1===n.config.options.scales[Mt].dragData||n.config.options.scales[Pt]&&!1===n.config.options.scales[Pt].dragData||n.config.options.scales[Tt]&&!1===n.config.options.scales[Tt].rAxisID||!1===o.data[Nt.index].dragData)return void(Nt=null);if("bar"===Bt){kt=n.config.options.scales[Mt].stacked;let e=Vt(t,n,r,i);It=e-u}"function"==typeof e&&Nt&&!1===e(t,r,i,u)&&(Nt=null)}})(e.sourceEvent,t,n.onDragStart))).on("drag",(e=>Xt(e.sourceEvent,t,n,n.onDrag))).on("end",(e=>((t,n,e)=>{if(jt=void 0,Lt=!1,"function"==typeof e&&Nt){const r=Nt.datasetIndex,i=Nt.index;return e(t,r,i,function(t,n,e){const r=t.config.options.plugins.dragData;if(!r.magnet)return t.data.datasets[n].data[e];{const i=r.magnet;if(i.to&&"function"==typeof i.to){let r=t.data.datasets[n].data[e];return r=i.to(r),t.data.datasets[n].data[e]=r,t.update("none"),r}}}(n,r,i))}})(e.sourceEvent,t,n.onDragEnd))))}},beforeEvent:function(t){if(t.config.options.plugins&&t.config.options.plugins.dragData&&t.config.options.plugins.dragData.showTooltip&&Lt)return!1}};return t.Chart.register(qt),qt}));
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("chart.js")):"function"==typeof define&&define.amd?define(["chart.js"],n):(t="undefined"!=typeof globalThis?globalThis:t||self).index=n(t.Chart)}(this,(function(t){"use strict";var n={value:()=>{}};function e(){for(var t,n=0,e=arguments.length,i={};n<e;++n){if(!(t=arguments[n]+"")||t in i||/[\s.]/.test(t))throw new Error("illegal type: "+t);i[t]=[]}return new r(i)}function r(t){this._=t}function i(t,n){return t.trim().split(/^|\s+/).map((function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))}function o(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function a(t,e,r){for(var i=0,o=t.length;i<o;++i)if(t[i].name===e){t[i]=n,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=r&&t.push({name:e,value:r}),t}r.prototype=e.prototype={constructor:r,on:function(t,n){var e,r=this._,u=i(t+"",r),s=-1,c=u.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++s<c;)if(e=(t=u[s]).type)r[e]=a(r[e],t.name,n);else if(null==n)for(e in r)r[e]=a(r[e],t.name,null);return this}for(;++s<c;)if((e=(t=u[s]).type)&&(e=o(r[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new r(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),o=0;o<e;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,e=(r=this._[t]).length;o<e;++o)r[o].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};var u="http://www.w3.org/1999/xhtml",s={svg:"http://www.w3.org/2000/svg",xhtml:u,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function c(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),s.hasOwnProperty(n)?{space:s[n],local:t}:t}function l(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===u&&n.documentElement.namespaceURI===u?n.createElement(t):n.createElementNS(e,t)}}function f(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function h(t){var n=c(t);return(n.local?f:l)(n)}function p(){}function d(t){return null==t?p:function(){return this.querySelector(t)}}function g(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function v(){return[]}function y(t){return function(n){return n.matches(t)}}var m=Array.prototype.find;function _(){return this.firstElementChild}var w=Array.prototype.filter;function x(){return this.children}function b(t){return new Array(t.length)}function A(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function E(t){return function(){return t}}function D(t,n,e,r,i,o){for(var a,u=0,s=n.length,c=o.length;u<c;++u)(a=n[u])?(a.__data__=o[u],r[u]=a):e[u]=new A(t,o[u]);for(;u<s;++u)(a=n[u])&&(i[u]=a)}function C(t,n,e,r,i,o,a){var u,s,c,l=new Map,f=n.length,h=o.length,p=new Array(f);for(u=0;u<f;++u)(s=n[u])&&(p[u]=c=a.call(s,s.__data__,u,n)+"",l.has(c)?i[u]=s:l.set(c,s));for(u=0;u<h;++u)c=a.call(t,o[u],u,o)+"",(s=l.get(c))?(r[u]=s,s.__data__=o[u],l.delete(c)):e[u]=new A(t,o[u]);for(u=0;u<f;++u)(s=n[u])&&l.get(p[u])===s&&(i[u]=s)}function S(t){return t.__data__}function M(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function N(t){return function(){this.removeAttribute(t)}}function P(t){return function(){this.removeAttributeNS(t.space,t.local)}}function T(t,n){return function(){this.setAttribute(t,n)}}function B(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function k(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function I(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function R(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function j(t){return function(){this.style.removeProperty(t)}}function L(t,n,e){return function(){this.style.setProperty(t,n,e)}}function O(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function V(t,n){return t.style.getPropertyValue(n)||R(t).getComputedStyle(t,null).getPropertyValue(n)}function X(t){return function(){delete this[t]}}function q(t,n){return function(){this[t]=n}}function Y(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function U(t){return t.trim().split(/^|\s+/)}function F(t){return t.classList||new z(t)}function z(t){this._node=t,this._names=U(t.getAttribute("class")||"")}function H(t,n){for(var e=F(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function G(t,n){for(var e=F(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function K(t){return function(){H(this,t)}}function J(t){return function(){G(this,t)}}function Q(t,n){return function(){(n.apply(this,arguments)?H:G)(this,t)}}function W(){this.textContent=""}function Z(t){return function(){this.textContent=t}}function $(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function tt(){this.innerHTML=""}function nt(t){return function(){this.innerHTML=t}}function et(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function rt(){this.nextSibling&&this.parentNode.appendChild(this)}function it(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ot(){return null}function at(){var t=this.parentNode;t&&t.removeChild(this)}function ut(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function st(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function ct(t){return t.trim().split(/^|\s+/).map((function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}function lt(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r<o;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.options);++i?n.length=i:delete this.__on}}}function ft(t,n,e){return function(){var r,i=this.__on,o=function(t){return function(n){t.call(this,n,this.__data__)}}(n);if(i)for(var a=0,u=i.length;a<u;++a)if((r=i[a]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=e),void(r.value=n);this.addEventListener(t.type,o,e),r={type:t.type,name:t.name,value:n,listener:o,options:e},i?i.push(r):this.__on=[r]}}function ht(t,n,e){var r=R(t),i=r.CustomEvent;"function"==typeof i?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}function pt(t,n){return function(){return ht(this,t,n)}}function dt(t,n){return function(){return ht(this,t,n.apply(this,arguments))}}A.prototype={constructor:A,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}},z.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var gt=[null];function vt(t,n){this._groups=t,this._parents=n}function yt(t){return"string"==typeof t?new vt([[document.querySelector(t)]],[document.documentElement]):new vt([[t]],gt)}function mt(t,n){if(t=function(t){let n;for(;n=t.sourceEvent;)t=n;return t}(t),void 0===n&&(n=t.currentTarget),n){var e=n.ownerSVGElement||n;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(n.getScreenCTM().inverse())).x,r.y]}if(n.getBoundingClientRect){var i=n.getBoundingClientRect();return[t.clientX-i.left-n.clientLeft,t.clientY-i.top-n.clientTop]}}return[t.pageX,t.pageY]}function _t(t){t.stopImmediatePropagation()}function wt(t){t.preventDefault(),t.stopImmediatePropagation()}vt.prototype={constructor:vt,select:function(t){"function"!=typeof t&&(t=d(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a,u=n[i],s=u.length,c=r[i]=new Array(s),l=0;l<s;++l)(o=u[l])&&(a=t.call(o,o.__data__,l,u))&&("__data__"in o&&(a.__data__=o.__data__),c[l]=a);return new vt(r,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){var n=t.apply(this,arguments);return null==n?[]:g(n)}}(t):function(t){return null==t?v:function(){return this.querySelectorAll(t)}}(t);for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var a,u=n[o],s=u.length,c=0;c<s;++c)(a=u[c])&&(r.push(t.call(a,a.__data__,c,u)),i.push(a));return new vt(r,i)},selectChild:function(t){return this.select(null==t?_:function(t){return function(){return m.call(this.children,t)}}("function"==typeof t?t:y(t)))},selectChildren:function(t){return this.selectAll(null==t?x:function(t){return function(){return w.call(this.children,t)}}("function"==typeof t?t:y(t)))},filter:function(t){"function"!=typeof t&&(t=function(t){return function(){return this.matches(t)}}(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a=n[i],u=a.length,s=r[i]=[],c=0;c<u;++c)(o=a[c])&&t.call(o,o.__data__,c,a)&&s.push(o);return new vt(r,this._parents)},data:function(t,n){if(!arguments.length)return Array.from(this,S);var e=n?C:D,r=this._parents,i=this._groups;"function"!=typeof t&&(t=E(t));for(var o=i.length,a=new Array(o),u=new Array(o),s=new Array(o),c=0;c<o;++c){var l=r[c],f=i[c],h=f.length,p=g(t.call(l,l&&l.__data__,c,r)),d=p.length,v=u[c]=new Array(d),y=a[c]=new Array(d),m=s[c]=new Array(h);e(l,f,v,y,m,p,n);for(var _,w,x=0,b=0;x<d;++x)if(_=v[x]){for(x>=b&&(b=x+1);!(w=y[b])&&++b<d;);_._next=w||null}}return(a=new vt(a,r))._enter=u,a._exit=s,a},enter:function(){return new vt(this._enter||this._groups.map(b),this._parents)},exit:function(){return new vt(this._exit||this._groups.map(b),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,o=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=n&&(i=n(i)),null==e?o.remove():e(o),r&&i?r.merge(i).order():i},merge:function(t){if(!(t instanceof vt))throw new Error("invalid merge");for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),a=new Array(r),u=0;u<o;++u)for(var s,c=n[u],l=e[u],f=c.length,h=a[u]=new Array(f),p=0;p<f;++p)(s=c[p]||l[p])&&(h[p]=s);for(;u<r;++u)a[u]=n[u];return new vt(a,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],o=i.length-1,a=i[o];--o>=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=M);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var a,u=e[o],s=u.length,c=i[o]=new Array(s),l=0;l<s;++l)(a=u[l])&&(c[l]=a);c.sort(n)}return new vt(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null},size:function(){let t=0;for(const n of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,o=n[e],a=0,u=o.length;a<u;++a)(i=o[a])&&t.call(i,i.__data__,a,o);return this},attr:function(t,n){var e=c(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==n?e.local?P:N:"function"==typeof n?e.local?I:k:e.local?B:T)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?j:"function"==typeof n?O:L)(t,n,null==e?"":e)):V(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?X:"function"==typeof n?Y:q)(t,n)):this.node()[t]},classed:function(t,n){var e=U(t+"");if(arguments.length<2){for(var r=F(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?Q:n?K:J)(e,n))},text:function(t){return arguments.length?this.each(null==t?W:("function"==typeof t?$:Z)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?tt:("function"==typeof t?et:nt)(t)):this.node().innerHTML},raise:function(){return this.each(rt)},lower:function(){return this.each(it)},append:function(t){var n="function"==typeof t?t:h(t);return this.select((function(){return this.appendChild(n.apply(this,arguments))}))},insert:function(t,n){var e="function"==typeof t?t:h(t),r=null==n?ot:"function"==typeof n?n:d(n);return this.select((function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(at)},clone:function(t){return this.select(t?st:ut)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=ct(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?ft:lt,r=0;r<a;++r)this.each(u(o[r],n,e));return this}var u=this.node().__on;if(u)for(var s,c=0,l=u.length;c<l;++c)for(r=0,s=u[c];r<a;++r)if((i=o[r]).type===s.type&&i.name===s.name)return s.value},dispatch:function(t,n){return this.each(("function"==typeof n?dt:pt)(t,n))},[Symbol.iterator]:function*(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r,i=t[n],o=0,a=i.length;o<a;++o)(r=i[o])&&(yield r)}};var xt=t=>()=>t;function bt(t,{sourceEvent:n,subject:e,target:r,identifier:i,active:o,x:a,y:u,dx:s,dy:c,dispatch:l}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:s,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:l}})}function At(t){return!t.ctrlKey&&!t.button}function Et(){return this.parentNode}function Dt(t,n){return null==n?{x:t.x,y:t.y}:n}function Ct(){return navigator.maxTouchPoints||"ontouchstart"in this}function St(){var t,n,r,i,o=At,a=Et,u=Dt,s=Ct,c={},l=e("start","drag","end"),f=0,h=0;function p(t){t.on("mousedown.drag",d).filter(s).on("touchstart.drag",y).on("touchmove.drag",m).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(e,u){if(!i&&o.call(this,e,u)){var s=w(this,a.call(this,e,u),e,u,"mouse");s&&(yt(e.view).on("mousemove.drag",g,!0).on("mouseup.drag",v,!0),function(t){var n=t.document.documentElement,e=yt(t).on("dragstart.drag",wt,!0);"onselectstart"in n?e.on("selectstart.drag",wt,!0):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}(e.view),_t(e),r=!1,t=e.clientX,n=e.clientY,s("start",e))}}function g(e){if(wt(e),!r){var i=e.clientX-t,o=e.clientY-n;r=i*i+o*o>h}c.mouse("drag",e)}function v(t){yt(t.view).on("mousemove.drag mouseup.drag",null),function(t,n){var e=t.document.documentElement,r=yt(t).on("dragstart.drag",null);n&&(r.on("click.drag",wt,!0),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in e?r.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}(t.view,r),wt(t),c.mouse("end",t)}function y(t,n){if(o.call(this,t,n)){var e,r,i=t.changedTouches,u=a.call(this,t,n),s=i.length;for(e=0;e<s;++e)(r=w(this,u,t,n,i[e].identifier,i[e]))&&(_t(t),r("start",t,i[e]))}}function m(t){var n,e,r=t.changedTouches,i=r.length;for(n=0;n<i;++n)(e=c[r[n].identifier])&&(wt(t),e("drag",t,r[n]))}function _(t){var n,e,r=t.changedTouches,o=r.length;for(i&&clearTimeout(i),i=setTimeout((function(){i=null}),500),n=0;n<o;++n)(e=c[r[n].identifier])&&(_t(t),e("end",t,r[n]))}function w(t,n,e,r,i,o){var a,s,h,d=l.copy(),g=mt(o||e,n);if(null!=(h=u.call(t,new bt("beforestart",{sourceEvent:e,target:p,identifier:i,active:f,x:g[0],y:g[1],dx:0,dy:0,dispatch:d}),r)))return a=h.x-g[0]||0,s=h.y-g[1]||0,function e(o,u,l){var v,y=g;switch(o){case"start":c[i]=e,v=f++;break;case"end":delete c[i],--f;case"drag":g=mt(l||u,n),v=f}d.call(o,t,new bt(o,{sourceEvent:u,subject:h,target:p,identifier:i,active:v,x:g[0]+a,y:g[1]+s,dx:g[0]-y[0],dy:g[1]-y[1],dispatch:d}),r)}}return p.filter=function(t){return arguments.length?(o="function"==typeof t?t:xt(!!t),p):o},p.container=function(t){return arguments.length?(a="function"==typeof t?t:xt(t),p):a},p.subject=function(t){return arguments.length?(u="function"==typeof t?t:xt(t),p):u},p.touchable=function(t){return arguments.length?(s="function"==typeof t?t:xt(!!t),p):s},p.on=function(){var t=l.on.apply(l,arguments);return t===l?p:t},p.clickDistance=function(t){return arguments.length?(h=(t=+t)*t,p):Math.sqrt(h)},p}let Mt,Nt,Pt,Tt,Bt,kt,It,Rt,jt,Lt;bt.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};let Ot=!1;function Vt(t,n){return isNaN(n)?t:Math.round(t*Math.pow(10,n))/Math.pow(10,n)}function Xt(t,n,e,r,i){let o,a;const u=n.data.datasets[e].data[r];if(t.touches?(o=n.scales[Pt].getValueForPixel(t.touches[0].clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Nt].getValueForPixel(t.touches[0].clientY-n.canvas.getBoundingClientRect().top)):(o=n.scales[Pt].getValueForPixel(t.clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Nt].getValueForPixel(t.clientY-n.canvas.getBoundingClientRect().top)),o=Vt(o,n.config.options.plugins.dragData.round),a=Vt(a,n.config.options.plugins.dragData.round),o=o>n.scales[Pt].max?n.scales[Pt].max:o,o=o<n.scales[Pt].min?n.scales[Pt].min:o,a=a>n.scales[Nt].max?n.scales[Nt].max:a,a=a<n.scales[Nt].min?n.scales[Nt].min:a,It){let t;t="y"===n.config.options.indexAxis?o:a;return Math.abs(t-u[0])<=Math.abs(t-u[1])?[t,u[1]]:[u[0],t]}return void 0!==u.x&&n.config.options.plugins.dragData.dragX&&(u.x=o),void 0!==u.y?(!1!==n.config.options.plugins.dragData.dragY&&(u.y=a),u):"y"===n.config.options.indexAxis?o:a}const qt=(t,n,e,r)=>{if(Mt){jt=Mt.datasetIndex,Lt=Mt.index,Ot=!0;let i=n.data.datasets[jt].data[Lt];if("radar"===Bt)i=function(t,n){let e,r,i;t.touches?(e=t.touches[0].clientX-n.canvas.getBoundingClientRect().left,r=t.touches[0].clientY-n.canvas.getBoundingClientRect().top):(e=t.clientX-n.canvas.getBoundingClientRect().left,r=t.clientY-n.canvas.getBoundingClientRect().top);let o=n.scales[Tt],a=Math.sqrt(Math.pow(e-o.xCenter,2)+Math.pow(r-o.yCenter,2)),u=o.drawingArea/(o.max-o.min);return i=o.options.ticks.reverse?o.max-a/u:o.min+a/u,i=Vt(i,n.config.options.plugins.dragData.round),i=i>n.scales[Tt].max?n.scales[Tt].max:i,i=i<n.scales[Tt].min?n.scales[Tt].min:i,i}(t,n);else if(kt){i=Vt(Xt(t,n,jt,Lt)-Rt,e.round)}else i=Xt(t,n,jt,Lt);(void 0===e.showTooltip||e.showTooltip)&&n.tooltip.setActiveElements([Mt],{x:Mt.element.x,y:Mt.element.y}),(!r||"function"==typeof r&&!1!==r(t,jt,Lt,i))&&(n.data.datasets[jt].data[Lt]=i,n.update("none"))}};const Yt={id:"dragdata",afterInit:function(t){if(t.config.options.plugins&&t.config.options.plugins.dragData){const n=t.config.options.plugins.dragData;yt(t.canvas).call(St().container(t.canvas).on("start",(e=>((t,n,e)=>{if(Mt=n.getElementsAtEventForMode(t,"nearest",{intersect:!0},!1)[0],Bt=n.config.type,Mt){let r=Mt.datasetIndex,i=Mt.index;const o=n.data.datasets[r],a=n.getDatasetMeta(r);let u=o.data[i];if(Pt=a.xAxisID,Nt=a.yAxisID,Tt=a.rAxisID,!1===o.dragData||n.config.options.scales[Pt]&&!1===n.config.options.scales[Pt].dragData||n.config.options.scales[Nt]&&!1===n.config.options.scales[Nt].dragData||n.config.options.scales[Tt]&&!1===n.config.options.scales[Tt].rAxisID||!1===o.data[Mt.index].dragData)return void(Mt=null);if("bar"===Bt){kt=n.config.options.scales[Pt].stacked;const e=n.data.datasets[0].data[0];It=null!==e&&Array.isArray(e)&&2==e.length;let o=Xt(t,n,r,i);Rt=o-u}"function"==typeof e&&Mt&&!1===e(t,r,i,u)&&(Mt=null)}})(e.sourceEvent,t,n.onDragStart))).on("drag",(e=>qt(e.sourceEvent,t,n,n.onDrag))).on("end",(e=>((t,n,e)=>{if(Lt=void 0,Ot=!1,"function"==typeof e&&Mt){const r=Mt.datasetIndex,i=Mt.index;return e(t,r,i,function(t,n,e){const r=t.config.options.plugins.dragData;if(!r.magnet)return t.data.datasets[n].data[e];{const i=r.magnet;if(i.to&&"function"==typeof i.to){let r=t.data.datasets[n].data[e];return r=i.to(r),t.data.datasets[n].data[e]=r,t.update("none"),r}}}(n,r,i))}})(e.sourceEvent,t,n.onDragEnd))))}},beforeEvent:function(t){if(t.config.options.plugins&&t.config.options.plugins.dragData&&t.config.options.plugins.dragData.showTooltip&&Ot)return!1}};return t.Chart.register(Yt),Yt}));
{
"name": "chartjs-plugin-dragdata",
"version": "2.0.2",
"version": "2.1.0",
"description": "Draggable data points for Chart.js",

@@ -5,0 +5,0 @@ "main": "dist/chartjs-plugin-dragdata.js",

@@ -16,2 +16,4 @@ # chartjs-plugin-dragdata.js

| Bubble - Simple Bubble | [demo](https://chrispahm.github.io/chartjs-plugin-dragdata/bubble.html) | [source](https://raw.githubusercontent.com/chrispahm/chartjs-plugin-dragdata/master/docs/bubble.html) |
| Floating bar - simple floating bars | [demo](https://chrispahm.github.io/chartjs-plugin-dragdata/floatingBar.html) | [source](https://raw.githubusercontent.com/chrispahm/chartjs-plugin-dragdata/master/docs/floatingBar.html) |
| Floating bar - simple floating bars, horizontal | [demo](https://chrispahm.github.io/chartjs-plugin-dragdata/horizontalFloatingBar.html) | [source](https://raw.githubusercontent.com/chrispahm/chartjs-plugin-dragdata/master/docs/horizontalFloatingBar.html) |
| Horizontal Bar - Simple Horizontal Bar | [demo](https://chrispahm.github.io/chartjs-plugin-dragdata/horizontalBar.html) | [source](https://raw.githubusercontent.com/chrispahm/chartjs-plugin-dragdata/master/docs/horizontalBar.html) |

@@ -22,3 +24,3 @@ | Line - Single Y-Axis | [demo](https://chrispahm.github.io/chartjs-plugin-dragdata/) | [source](https://raw.githubusercontent.com/chrispahm/chartjs-plugin-dragdata/master/docs/index.html) |

| Line - Small | [demo](https://chrispahm.github.io/chartjs-plugin-dragdata/smallChart.html) | [source](https://raw.githubusercontent.com/chrispahm/chartjs-plugin-dragdata/master/docs/smallChart.html) |
| Line - React Fiddle | [demo](https://jsfiddle.net/3v9kexbh/) | [source](https://jsfiddle.net/3v9kexbh/) |
| Line - React Fiddle | [demo](https://jsfiddle.net/16kvxd4u/3/) | [source](https://jsfiddle.net/16kvxd4u/3/) |
| Line - Drag x-, and y-axis (scatter chart) | [demo](https://chrispahm.github.io/chartjs-plugin-dragdata/scatter.html) | [source](https://chrispahm.github.io/chartjs-plugin-dragdata/scatter.html) |

@@ -25,0 +27,0 @@ | Line - Drag dates (x and y axis) | [demo](https://jsfiddle.net/f72kz348/9/) | [source](https://jsfiddle.net/f72kz348/9/) |

@@ -5,3 +5,3 @@ import {Chart} from 'chart.js'

let element, yAxisID, xAxisID, rAxisID, type, stacked, initValue, curDatasetIndex, curIndex, eventSettings
let element, yAxisID, xAxisID, rAxisID, type, stacked, floatingBar, initValue, curDatasetIndex, curIndex, eventSettings
let isDragging = false

@@ -40,2 +40,7 @@

stacked = chartInstance.config.options.scales[xAxisID].stacked
// if a bar has a data point that is an array of length 2, it's a floating bar
const samplePoint = chartInstance.data.datasets[0].data[0]
floatingBar = (samplePoint !== null) && Array.isArray(samplePoint) && samplePoint.length == 2
let data = {}

@@ -109,2 +114,25 @@ let newPos = calcPosition(e, chartInstance, datasetIndex, index, data)

if (floatingBar) {
// x contains the new value for one end of the floating bar
// dataPoint contains the old interval [left, right] of the floating bar
// calculate difference between the new value and both sides
// the side with the smallest difference from the new value was the one that was dragged
// return an interval with new value on the dragged side and old value on the other side
let newVal
// choose the right variable based on the orientation of the graph(vertical, horizontal)
if (chartInstance.config.options.indexAxis === 'y') {
newVal = x
} else {
newVal = y
}
const diffFromLeft = Math.abs(newVal - dataPoint[0])
const diffFromRight = Math.abs(newVal - dataPoint[1])
if (diffFromLeft <= diffFromRight) {
return [newVal, dataPoint[1]]
} else {
return [dataPoint[0], newVal]
}
}
if (dataPoint.x !== undefined && chartInstance.config.options.plugins.dragData.dragX) {

@@ -142,2 +170,4 @@ dataPoint.x = x

dataPoint = roundValue(cursorPos - initValue, pluginOptions.round)
} else if (floatingBar) {
dataPoint = calcPosition(e, chartInstance, curDatasetIndex, curIndex, dataPoint)
} else {

@@ -144,0 +174,0 @@ dataPoint = calcPosition(e, chartInstance, curDatasetIndex, curIndex, dataPoint)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc