Huge News!Announcing our $40M Series B led by Abstract Ventures.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.2.0 to 2.2.1

39

dist/chartjs-plugin-dragdata.js

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

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

@@ -1306,4 +1306,4 @@

// save element settings
// eventSettings = chartInstance.config.options.animation
// chartInstance.config.options.animation = false
eventSettings = chartInstance.config.options.plugins?.tooltip?.animation;
const dataset = chartInstance.data.datasets[datasetIndex];

@@ -1338,2 +1338,8 @@ const datasetMeta = chartInstance.getDatasetMeta(datasetIndex);

// disable the tooltip animation
if (chartInstance.config.options.plugins.dragData.showTooltip === undefined || chartInstance.config.options.plugins.dragData.showTooltip) {
if (!chartInstance.config.options.plugins.tooltip) chartInstance.config.options.plugins.tooltip = {};
chartInstance.config.options.plugins.tooltip.animation = false;
}
if (typeof callback === 'function' && element) {

@@ -1462,10 +1468,2 @@ if (callback(e, datasetIndex, index, curValue) === false) {

}
if (pluginOptions.showTooltip === undefined || pluginOptions.showTooltip) {
chartInstance.tooltip.setActiveElements([element],{
x: element.element.x,
y: element.element.y
});
}

@@ -1499,3 +1497,6 @@ if (!callback || (typeof callback === 'function' && callback(e, curDatasetIndex, curIndex, dataPoint) !== false)) {

isDragging = false;
// chartInstance.config.options.animation = eventSettings
// re-enable the tooltip animation
chartInstance.config.options.plugins.tooltip.animation = eventSettings;
chartInstance.update('none');
// chartInstance.update('none')

@@ -1523,9 +1524,9 @@ if (typeof callback === 'function' && element) {

},
beforeEvent: function (chart) {
if (chart.config.options.plugins &&
chart.config.options.plugins.dragData &&
chart.config.options.plugins.dragData.showTooltip &&
isDragging
) {
return false
afterEvent: function (chart) {
if (!element) return
if (isDragging) {
chart.tooltip.setActiveElements([element],{
x: element.element.x,
y: element.element.y
});
}

@@ -1532,0 +1533,0 @@ }

@@ -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 null==t?[]:Array.isArray(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 Array.from(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){return"object"==typeof t&&"length"in t?t:Array.from(t)}function N(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function P(t){return function(){this.removeAttribute(t)}}function T(t){return function(){this.removeAttributeNS(t.space,t.local)}}function B(t,n){return function(){this.setAttribute(t,n)}}function k(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function I(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function R(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 j(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)||j(t).getComputedStyle(t,null).getPropertyValue(n)}function q(t){return function(){delete this[t]}}function Y(t,n){return function(){this[t]=n}}function U(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function F(t){return t.trim().split(/^|\s+/)}function z(t){return t.classList||new H(t)}function H(t){this._node=t,this._names=F(t.getAttribute("class")||"")}function G(t,n){for(var e=z(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function K(t,n){for(var e=z(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function J(t){return function(){G(this,t)}}function Q(t){return function(){K(this,t)}}function W(t,n){return function(){(n.apply(this,arguments)?G:K)(this,t)}}function Z(){this.textContent=""}function $(t){return function(){this.textContent=t}}function tt(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function nt(){this.innerHTML=""}function et(t){return function(){this.innerHTML=t}}function rt(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function it(){this.nextSibling&&this.parentNode.appendChild(this)}function ot(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function at(){return null}function ut(){var t=this.parentNode;t&&t.removeChild(this)}function st(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function ct(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function lt(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 ft(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 ht(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 pt(t,n,e){var r=j(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 dt(t,n){return function(){return pt(this,t,n)}}function gt(t,n){return function(){return pt(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)}},H.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 vt=[null];function yt(t,n){this._groups=t,this._parents=n}function mt(t){return"string"==typeof t?new yt([[document.querySelector(t)]],[document.documentElement]):new yt([[t]],vt)}function _t(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]}yt.prototype={constructor:yt,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 yt(r,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){return g(t.apply(this,arguments))}}(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 yt(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 yt(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=M(t.call(l,l&&l.__data__,c,r)),d=p.length,g=u[c]=new Array(d),v=a[c]=new Array(d),y=s[c]=new Array(h);e(l,f,g,v,y,p,n);for(var m,_,w=0,x=0;w<d;++w)if(m=g[w]){for(w>=x&&(x=w+1);!(_=v[x])&&++x<d;);m._next=_||null}}return(a=new yt(a,r))._enter=u,a._exit=s,a},enter:function(){return new yt(this._enter||this._groups.map(b),this._parents)},exit:function(){return new yt(this._exit||this._groups.map(b),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,o=this.exit();return"function"==typeof t?(r=t(r))&&(r=r.selection()):r=r.append(t+""),null!=n&&(i=n(i))&&(i=i.selection()),null==e?o.remove():e(o),r&&i?r.merge(i).order():i},merge:function(t){for(var n=t.selection?t.selection():t,e=this._groups,r=n._groups,i=e.length,o=r.length,a=Math.min(i,o),u=new Array(i),s=0;s<a;++s)for(var c,l=e[s],f=r[s],h=l.length,p=u[s]=new Array(h),d=0;d<h;++d)(c=l[d]||f[d])&&(p[d]=c);for(;s<i;++s)u[s]=e[s];return new yt(u,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 yt(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?T:P:"function"==typeof n?e.local?R:I:e.local?k: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?q:"function"==typeof n?U:Y)(t,n)):this.node()[t]},classed:function(t,n){var e=F(t+"");if(arguments.length<2){for(var r=z(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?W:n?J:Q)(e,n))},text:function(t){return arguments.length?this.each(null==t?Z:("function"==typeof t?tt:$)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?nt:("function"==typeof t?rt:et)(t)):this.node().innerHTML},raise:function(){return this.each(it)},lower:function(){return this.each(ot)},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?at:"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(ut)},clone:function(t){return this.select(t?ct:st)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=lt(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?ht:ft,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?gt:dt)(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)}};const wt={passive:!1},xt={capture:!0,passive:!1};function bt(t){t.stopImmediatePropagation()}function At(t){t.preventDefault(),t.stopImmediatePropagation()}var Et=t=>()=>t;function Dt(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 Ct(t){return!t.ctrlKey&&!t.button}function St(){return this.parentNode}function Mt(t,n){return null==n?{x:t.x,y:t.y}:n}function Nt(){return navigator.maxTouchPoints||"ontouchstart"in this}function Pt(){var t,n,r,i,o=Ct,a=St,u=Mt,s=Nt,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,wt).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&&(mt(e.view).on("mousemove.drag",g,xt).on("mouseup.drag",v,xt),function(t){var n=t.document.documentElement,e=mt(t).on("dragstart.drag",At,xt);"onselectstart"in n?e.on("selectstart.drag",At,xt):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}(e.view),bt(e),r=!1,t=e.clientX,n=e.clientY,s("start",e))}}function g(e){if(At(e),!r){var i=e.clientX-t,o=e.clientY-n;r=i*i+o*o>h}c.mouse("drag",e)}function v(t){mt(t.view).on("mousemove.drag mouseup.drag",null),function(t,n){var e=t.document.documentElement,r=mt(t).on("dragstart.drag",null);n&&(r.on("click.drag",At,xt),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),At(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]))&&(bt(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])&&(At(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])&&(bt(t),e("end",t,r[n]))}function w(t,n,e,r,i,o){var a,s,h,d=l.copy(),g=_t(o||e,n);if(null!=(h=u.call(t,new Dt("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=_t(l||u,n),v=f}d.call(o,t,new Dt(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:Et(!!t),p):o},p.container=function(t){return arguments.length?(a="function"==typeof t?t:Et(t),p):a},p.subject=function(t){return arguments.length?(u="function"==typeof t?t:Et(t),p):u},p.touchable=function(t){return arguments.length?(s="function"==typeof t?t:Et(!!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 Tt,Bt,kt,It,Rt,jt,Lt,Ot,Vt,Xt;Dt.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};let qt=!1;function Yt(t,n){return isNaN(n)?t:Math.round(t*Math.pow(10,n))/Math.pow(10,n)}function Ut(t,n,e,r,i){let o,a;const u=n.data.datasets[e].data[r];if(t.touches?(o=n.scales[kt].getValueForPixel(t.touches[0].clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Bt].getValueForPixel(t.touches[0].clientY-n.canvas.getBoundingClientRect().top)):(o=n.scales[kt].getValueForPixel(t.clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Bt].getValueForPixel(t.clientY-n.canvas.getBoundingClientRect().top)),o=Yt(o,n.config.options.plugins.dragData.round),a=Yt(a,n.config.options.plugins.dragData.round),o=o>n.scales[kt].max?n.scales[kt].max:o,o=o<n.scales[kt].min?n.scales[kt].min:o,a=a>n.scales[Bt].max?n.scales[Bt].max:a,a=a<n.scales[Bt].min?n.scales[Bt].min:a,Lt){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 Ft=(t,n,e,r)=>{if(Tt){Vt=Tt.datasetIndex,Xt=Tt.index,qt=!0;let i=n.data.datasets[Vt].data[Xt];if("radar"===Rt||"polarArea"===Rt)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[It],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=Yt(i,n.config.options.plugins.dragData.round),i=i>n.scales[It].max?n.scales[It].max:i,i=i<n.scales[It].min?n.scales[It].min:i,i}(t,n);else if(jt){i=Yt(Ut(t,n,Vt,Xt)-Ot,e.round)}else i=Ut(t,n,Vt,Xt);(void 0===e.showTooltip||e.showTooltip)&&n.tooltip.setActiveElements([Tt],{x:Tt.element.x,y:Tt.element.y}),(!r||"function"==typeof r&&!1!==r(t,Vt,Xt,i))&&(n.data.datasets[Vt].data[Xt]=i,n.update("none"))}};const zt={id:"dragdata",afterInit:function(t){if(t.config.options.plugins&&t.config.options.plugins.dragData){const n=t.config.options.plugins.dragData;mt(t.canvas).call(Pt().container(t.canvas).on("start",(e=>((t,n,e)=>{if(Tt=n.getElementsAtEventForMode(t,"nearest",{intersect:!0},!1)[0],Rt=n.config.type,Tt){let r=Tt.datasetIndex,i=Tt.index;const o=n.data.datasets[r],a=n.getDatasetMeta(r);let u=o.data[i];if(kt=a.xAxisID,Bt=a.yAxisID,It=a.rAxisID,!1===o.dragData||n.config.options.scales[kt]&&!1===n.config.options.scales[kt].dragData||n.config.options.scales[Bt]&&!1===n.config.options.scales[Bt].dragData||n.config.options.scales[It]&&!1===n.config.options.scales[It].rAxisID||!1===o.data[Tt.index].dragData)return void(Tt=null);if("bar"===Rt){jt=n.config.options.scales[kt].stacked;const e=n.data.datasets[0].data[0];Lt=null!==e&&Array.isArray(e)&&2==e.length;let o=Ut(t,n,r,i);Ot=o-u}"function"==typeof e&&Tt&&!1===e(t,r,i,u)&&(Tt=null)}})(e.sourceEvent,t,n.onDragStart))).on("drag",(e=>Ft(e.sourceEvent,t,n,n.onDrag))).on("end",(e=>((t,n,e)=>{if(Xt=void 0,qt=!1,"function"==typeof e&&Tt){const r=Tt.datasetIndex,i=Tt.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&&qt)return!1}};return t.Chart.register(zt),zt}));
!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 null==t?[]:Array.isArray(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 Array.from(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){return"object"==typeof t&&"length"in t?t:Array.from(t)}function N(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function P(t){return function(){this.removeAttribute(t)}}function T(t){return function(){this.removeAttributeNS(t.space,t.local)}}function B(t,n){return function(){this.setAttribute(t,n)}}function k(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function I(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function R(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 j(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)||j(t).getComputedStyle(t,null).getPropertyValue(n)}function q(t){return function(){delete this[t]}}function Y(t,n){return function(){this[t]=n}}function U(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function F(t){return t.trim().split(/^|\s+/)}function z(t){return t.classList||new H(t)}function H(t){this._node=t,this._names=F(t.getAttribute("class")||"")}function G(t,n){for(var e=z(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function K(t,n){for(var e=z(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function J(t){return function(){G(this,t)}}function Q(t){return function(){K(this,t)}}function W(t,n){return function(){(n.apply(this,arguments)?G:K)(this,t)}}function Z(){this.textContent=""}function $(t){return function(){this.textContent=t}}function tt(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function nt(){this.innerHTML=""}function et(t){return function(){this.innerHTML=t}}function rt(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function it(){this.nextSibling&&this.parentNode.appendChild(this)}function ot(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function at(){return null}function ut(){var t=this.parentNode;t&&t.removeChild(this)}function st(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function ct(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function lt(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 ft(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 ht(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 pt(t,n,e){var r=j(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 dt(t,n){return function(){return pt(this,t,n)}}function gt(t,n){return function(){return pt(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)}},H.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 vt=[null];function yt(t,n){this._groups=t,this._parents=n}function mt(t){return"string"==typeof t?new yt([[document.querySelector(t)]],[document.documentElement]):new yt([[t]],vt)}function _t(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]}yt.prototype={constructor:yt,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 yt(r,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){return g(t.apply(this,arguments))}}(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 yt(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 yt(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=M(t.call(l,l&&l.__data__,c,r)),d=p.length,g=u[c]=new Array(d),v=a[c]=new Array(d),y=s[c]=new Array(h);e(l,f,g,v,y,p,n);for(var m,_,w=0,x=0;w<d;++w)if(m=g[w]){for(w>=x&&(x=w+1);!(_=v[x])&&++x<d;);m._next=_||null}}return(a=new yt(a,r))._enter=u,a._exit=s,a},enter:function(){return new yt(this._enter||this._groups.map(b),this._parents)},exit:function(){return new yt(this._exit||this._groups.map(b),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,o=this.exit();return"function"==typeof t?(r=t(r))&&(r=r.selection()):r=r.append(t+""),null!=n&&(i=n(i))&&(i=i.selection()),null==e?o.remove():e(o),r&&i?r.merge(i).order():i},merge:function(t){for(var n=t.selection?t.selection():t,e=this._groups,r=n._groups,i=e.length,o=r.length,a=Math.min(i,o),u=new Array(i),s=0;s<a;++s)for(var c,l=e[s],f=r[s],h=l.length,p=u[s]=new Array(h),d=0;d<h;++d)(c=l[d]||f[d])&&(p[d]=c);for(;s<i;++s)u[s]=e[s];return new yt(u,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 yt(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?T:P:"function"==typeof n?e.local?R:I:e.local?k: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?q:"function"==typeof n?U:Y)(t,n)):this.node()[t]},classed:function(t,n){var e=F(t+"");if(arguments.length<2){for(var r=z(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?W:n?J:Q)(e,n))},text:function(t){return arguments.length?this.each(null==t?Z:("function"==typeof t?tt:$)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?nt:("function"==typeof t?rt:et)(t)):this.node().innerHTML},raise:function(){return this.each(it)},lower:function(){return this.each(ot)},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?at:"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(ut)},clone:function(t){return this.select(t?ct:st)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=lt(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?ht:ft,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?gt:dt)(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)}};const wt={passive:!1},xt={capture:!0,passive:!1};function bt(t){t.stopImmediatePropagation()}function At(t){t.preventDefault(),t.stopImmediatePropagation()}var Et=t=>()=>t;function Dt(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 Ct(t){return!t.ctrlKey&&!t.button}function St(){return this.parentNode}function Mt(t,n){return null==n?{x:t.x,y:t.y}:n}function Nt(){return navigator.maxTouchPoints||"ontouchstart"in this}function Pt(){var t,n,r,i,o=Ct,a=St,u=Mt,s=Nt,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,wt).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&&(mt(e.view).on("mousemove.drag",g,xt).on("mouseup.drag",v,xt),function(t){var n=t.document.documentElement,e=mt(t).on("dragstart.drag",At,xt);"onselectstart"in n?e.on("selectstart.drag",At,xt):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}(e.view),bt(e),r=!1,t=e.clientX,n=e.clientY,s("start",e))}}function g(e){if(At(e),!r){var i=e.clientX-t,o=e.clientY-n;r=i*i+o*o>h}c.mouse("drag",e)}function v(t){mt(t.view).on("mousemove.drag mouseup.drag",null),function(t,n){var e=t.document.documentElement,r=mt(t).on("dragstart.drag",null);n&&(r.on("click.drag",At,xt),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),At(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]))&&(bt(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])&&(At(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])&&(bt(t),e("end",t,r[n]))}function w(t,n,e,r,i,o){var a,s,h,d=l.copy(),g=_t(o||e,n);if(null!=(h=u.call(t,new Dt("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=_t(l||u,n),v=f}d.call(o,t,new Dt(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:Et(!!t),p):o},p.container=function(t){return arguments.length?(a="function"==typeof t?t:Et(t),p):a},p.subject=function(t){return arguments.length?(u="function"==typeof t?t:Et(t),p):u},p.touchable=function(t){return arguments.length?(s="function"==typeof t?t:Et(!!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 Tt,Bt,kt,It,Rt,jt,Lt,Ot,Vt,Xt,qt;Dt.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};let Yt=!1;function Ut(t,n){return isNaN(n)?t:Math.round(t*Math.pow(10,n))/Math.pow(10,n)}function Ft(t,n,e,r,i){let o,a;const u=n.data.datasets[e].data[r];if(t.touches?(o=n.scales[kt].getValueForPixel(t.touches[0].clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Bt].getValueForPixel(t.touches[0].clientY-n.canvas.getBoundingClientRect().top)):(o=n.scales[kt].getValueForPixel(t.clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Bt].getValueForPixel(t.clientY-n.canvas.getBoundingClientRect().top)),o=Ut(o,n.config.options.plugins.dragData.round),a=Ut(a,n.config.options.plugins.dragData.round),o=o>n.scales[kt].max?n.scales[kt].max:o,o=o<n.scales[kt].min?n.scales[kt].min:o,a=a>n.scales[Bt].max?n.scales[Bt].max:a,a=a<n.scales[Bt].min?n.scales[Bt].min:a,Lt){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 zt=(t,n,e,r)=>{if(Tt){Vt=Tt.datasetIndex,Xt=Tt.index,Yt=!0;let i=n.data.datasets[Vt].data[Xt];if("radar"===Rt||"polarArea"===Rt)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[It],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=Ut(i,n.config.options.plugins.dragData.round),i=i>n.scales[It].max?n.scales[It].max:i,i=i<n.scales[It].min?n.scales[It].min:i,i}(t,n);else if(jt){i=Ut(Ft(t,n,Vt,Xt)-Ot,e.round)}else i=Ft(t,n,Vt,Xt);(!r||"function"==typeof r&&!1!==r(t,Vt,Xt,i))&&(n.data.datasets[Vt].data[Xt]=i,n.update("none"))}};const Ht={id:"dragdata",afterInit:function(t){if(t.config.options.plugins&&t.config.options.plugins.dragData){const n=t.config.options.plugins.dragData;mt(t.canvas).call(Pt().container(t.canvas).on("start",(e=>((t,n,e)=>{if(Tt=n.getElementsAtEventForMode(t,"nearest",{intersect:!0},!1)[0],Rt=n.config.type,Tt){let r=Tt.datasetIndex,i=Tt.index;qt=n.config.options.plugins?.tooltip?.animation;const o=n.data.datasets[r],a=n.getDatasetMeta(r);let u=o.data[i];if(kt=a.xAxisID,Bt=a.yAxisID,It=a.rAxisID,!1===o.dragData||n.config.options.scales[kt]&&!1===n.config.options.scales[kt].dragData||n.config.options.scales[Bt]&&!1===n.config.options.scales[Bt].dragData||n.config.options.scales[It]&&!1===n.config.options.scales[It].rAxisID||!1===o.data[Tt.index].dragData)return void(Tt=null);if("bar"===Rt){jt=n.config.options.scales[kt].stacked;const e=n.data.datasets[0].data[0];Lt=null!==e&&Array.isArray(e)&&2==e.length;let o=Ft(t,n,r,i);Ot=o-u}(void 0===n.config.options.plugins.dragData.showTooltip||n.config.options.plugins.dragData.showTooltip)&&(n.config.options.plugins.tooltip||(n.config.options.plugins.tooltip={}),n.config.options.plugins.tooltip.animation=!1),"function"==typeof e&&Tt&&!1===e(t,r,i,u)&&(Tt=null)}})(e.sourceEvent,t,n.onDragStart))).on("drag",(e=>zt(e.sourceEvent,t,n,n.onDrag))).on("end",(e=>((t,n,e)=>{if(Xt=void 0,Yt=!1,n.config.options.plugins.tooltip.animation=qt,n.update("none"),"function"==typeof e&&Tt){const r=Tt.datasetIndex,i=Tt.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))))}},afterEvent:function(t){Tt&&Yt&&t.tooltip.setActiveElements([Tt],{x:Tt.element.x,y:Tt.element.y})}};return t.Chart.register(Ht),Ht}));

@@ -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 null==t?[]:Array.isArray(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 Array.from(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){return"object"==typeof t&&"length"in t?t:Array.from(t)}function N(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function P(t){return function(){this.removeAttribute(t)}}function B(t){return function(){this.removeAttributeNS(t.space,t.local)}}function T(t,n){return function(){this.setAttribute(t,n)}}function k(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function I(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function R(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 L(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function O(t){return function(){this.style.removeProperty(t)}}function V(t,n,e){return function(){this.style.setProperty(t,n,e)}}function X(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function j(t,n){return t.style.getPropertyValue(n)||L(t).getComputedStyle(t,null).getPropertyValue(n)}function Y(t){return function(){delete this[t]}}function q(t,n){return function(){this[t]=n}}function U(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function F(t){return t.trim().split(/^|\s+/)}function z(t){return t.classList||new H(t)}function H(t){this._node=t,this._names=F(t.getAttribute("class")||"")}function G(t,n){for(var e=z(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function K(t,n){for(var e=z(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function J(t){return function(){G(this,t)}}function Q(t){return function(){K(this,t)}}function W(t,n){return function(){(n.apply(this,arguments)?G:K)(this,t)}}function Z(){this.textContent=""}function $(t){return function(){this.textContent=t}}function tt(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function nt(){this.innerHTML=""}function et(t){return function(){this.innerHTML=t}}function rt(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function it(){this.nextSibling&&this.parentNode.appendChild(this)}function ot(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function at(){return null}function ut(){var t=this.parentNode;t&&t.removeChild(this)}function st(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function ct(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function lt(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 ft(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 ht(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 pt(t,n,e){var r=L(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 dt(t,n){return function(){return pt(this,t,n)}}function gt(t,n){return function(){return pt(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)}},H.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 vt=[null];function yt(t,n){this._groups=t,this._parents=n}function mt(t){return"string"==typeof t?new yt([[document.querySelector(t)]],[document.documentElement]):new yt([[t]],vt)}function _t(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]}yt.prototype={constructor:yt,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 yt(r,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){return g(t.apply(this,arguments))}}(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 yt(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 yt(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=M(t.call(l,l&&l.__data__,c,r)),d=p.length,g=u[c]=new Array(d),v=a[c]=new Array(d),y=s[c]=new Array(h);e(l,f,g,v,y,p,n);for(var m,_,w=0,x=0;w<d;++w)if(m=g[w]){for(w>=x&&(x=w+1);!(_=v[x])&&++x<d;);m._next=_||null}}return(a=new yt(a,r))._enter=u,a._exit=s,a},enter:function(){return new yt(this._enter||this._groups.map(b),this._parents)},exit:function(){return new yt(this._exit||this._groups.map(b),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,o=this.exit();return"function"==typeof t?(r=t(r))&&(r=r.selection()):r=r.append(t+""),null!=n&&(i=n(i))&&(i=i.selection()),null==e?o.remove():e(o),r&&i?r.merge(i).order():i},merge:function(t){for(var n=t.selection?t.selection():t,e=this._groups,r=n._groups,i=e.length,o=r.length,a=Math.min(i,o),u=new Array(i),s=0;s<a;++s)for(var c,l=e[s],f=r[s],h=l.length,p=u[s]=new Array(h),d=0;d<h;++d)(c=l[d]||f[d])&&(p[d]=c);for(;s<i;++s)u[s]=e[s];return new yt(u,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 yt(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?B:P:"function"==typeof n?e.local?R:I:e.local?k:T)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?O:"function"==typeof n?X:V)(t,n,null==e?"":e)):j(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?Y:"function"==typeof n?U:q)(t,n)):this.node()[t]},classed:function(t,n){var e=F(t+"");if(arguments.length<2){for(var r=z(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?W:n?J:Q)(e,n))},text:function(t){return arguments.length?this.each(null==t?Z:("function"==typeof t?tt:$)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?nt:("function"==typeof t?rt:et)(t)):this.node().innerHTML},raise:function(){return this.each(it)},lower:function(){return this.each(ot)},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?at:"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(ut)},clone:function(t){return this.select(t?ct:st)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=lt(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?ht:ft,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?gt:dt)(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)}};const wt={passive:!1},xt={capture:!0,passive:!1};function bt(t){t.stopImmediatePropagation()}function At(t){t.preventDefault(),t.stopImmediatePropagation()}var Et=t=>()=>t;function Dt(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 St(t){return!t.ctrlKey&&!t.button}function Ct(){return this.parentNode}function Mt(t,n){return null==n?{x:t.x,y:t.y}:n}function Nt(){return navigator.maxTouchPoints||"ontouchstart"in this}function Pt(){var t,n,r,i,o=St,a=Ct,u=Mt,s=Nt,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,wt).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&&(mt(e.view).on("mousemove.drag",g,xt).on("mouseup.drag",v,xt),function(t){var n=t.document.documentElement,e=mt(t).on("dragstart.drag",At,xt);"onselectstart"in n?e.on("selectstart.drag",At,xt):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}(e.view),bt(e),r=!1,t=e.clientX,n=e.clientY,s("start",e))}}function g(e){if(At(e),!r){var i=e.clientX-t,o=e.clientY-n;r=i*i+o*o>h}c.mouse("drag",e)}function v(t){mt(t.view).on("mousemove.drag mouseup.drag",null),function(t,n){var e=t.document.documentElement,r=mt(t).on("dragstart.drag",null);n&&(r.on("click.drag",At,xt),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),At(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]))&&(bt(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])&&(At(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])&&(bt(t),e("end",t,r[n]))}function w(t,n,e,r,i,o){var a,s,h,d=l.copy(),g=_t(o||e,n);if(null!=(h=u.call(t,new Dt("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=_t(l||u,n),v=f}d.call(o,t,new Dt(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:Et(!!t),p):o},p.container=function(t){return arguments.length?(a="function"==typeof t?t:Et(t),p):a},p.subject=function(t){return arguments.length?(u="function"==typeof t?t:Et(t),p):u},p.touchable=function(t){return arguments.length?(s="function"==typeof t?t:Et(!!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 Bt,Tt,kt,It,Rt,Lt,Ot,Vt,Xt,jt;Dt.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};let Yt=!1;function qt(t,n){return isNaN(n)?t:Math.round(t*Math.pow(10,n))/Math.pow(10,n)}function Ut(t,n,e,r,i){let o,a;const u=n.data.datasets[e].data[r];if(t.touches?(o=n.scales[kt].getValueForPixel(t.touches[0].clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Tt].getValueForPixel(t.touches[0].clientY-n.canvas.getBoundingClientRect().top)):(o=n.scales[kt].getValueForPixel(t.clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Tt].getValueForPixel(t.clientY-n.canvas.getBoundingClientRect().top)),o=qt(o,n.config.options.plugins.dragData.round),a=qt(a,n.config.options.plugins.dragData.round),o=o>n.scales[kt].max?n.scales[kt].max:o,o=o<n.scales[kt].min?n.scales[kt].min:o,a=a>n.scales[Tt].max?n.scales[Tt].max:a,a=a<n.scales[Tt].min?n.scales[Tt].min:a,Ot){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 Ft=(t,n,e,r)=>{if(Bt){Xt=Bt.datasetIndex,jt=Bt.index,Yt=!0;let i=n.data.datasets[Xt].data[jt];if("radar"===Rt||"polarArea"===Rt)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[It],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=qt(i,n.config.options.plugins.dragData.round),i=i>n.scales[It].max?n.scales[It].max:i,i=i<n.scales[It].min?n.scales[It].min:i,i}(t,n);else if(Lt){i=qt(Ut(t,n,Xt,jt)-Vt,e.round)}else i=Ut(t,n,Xt,jt);(void 0===e.showTooltip||e.showTooltip)&&n.tooltip.setActiveElements([Bt],{x:Bt.element.x,y:Bt.element.y}),(!r||"function"==typeof r&&!1!==r(t,Xt,jt,i))&&(n.data.datasets[Xt].data[jt]=i,n.update("none"))}};const zt={id:"dragdata",afterInit:function(t){if(t.config.options.plugins&&t.config.options.plugins.dragData){const n=t.config.options.plugins.dragData;mt(t.canvas).call(Pt().container(t.canvas).on("start",(e=>((t,n,e)=>{if(Bt=n.getElementsAtEventForMode(t,"nearest",{intersect:!0},!1)[0],Rt=n.config.type,Bt){let r=Bt.datasetIndex,i=Bt.index;const o=n.data.datasets[r],a=n.getDatasetMeta(r);let u=o.data[i];if(kt=a.xAxisID,Tt=a.yAxisID,It=a.rAxisID,!1===o.dragData||n.config.options.scales[kt]&&!1===n.config.options.scales[kt].dragData||n.config.options.scales[Tt]&&!1===n.config.options.scales[Tt].dragData||n.config.options.scales[It]&&!1===n.config.options.scales[It].rAxisID||!1===o.data[Bt.index].dragData)return void(Bt=null);if("bar"===Rt){Lt=n.config.options.scales[kt].stacked;const e=n.data.datasets[0].data[0];Ot=null!==e&&Array.isArray(e)&&2==e.length;let o=Ut(t,n,r,i);Vt=o-u}"function"==typeof e&&Bt&&!1===e(t,r,i,u)&&(Bt=null)}})(e.sourceEvent,t,n.onDragStart))).on("drag",(e=>Ft(e.sourceEvent,t,n,n.onDrag))).on("end",(e=>((t,n,e)=>{if(jt=void 0,Yt=!1,"function"==typeof e&&Bt){const r=Bt.datasetIndex,i=Bt.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&&Yt)return!1}};t.register(zt);export{zt as default};
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 null==t?[]:Array.isArray(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 Array.from(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){return"object"==typeof t&&"length"in t?t:Array.from(t)}function N(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function P(t){return function(){this.removeAttribute(t)}}function B(t){return function(){this.removeAttributeNS(t.space,t.local)}}function T(t,n){return function(){this.setAttribute(t,n)}}function k(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function I(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function R(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 L(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function O(t){return function(){this.style.removeProperty(t)}}function V(t,n,e){return function(){this.style.setProperty(t,n,e)}}function X(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function j(t,n){return t.style.getPropertyValue(n)||L(t).getComputedStyle(t,null).getPropertyValue(n)}function Y(t){return function(){delete this[t]}}function q(t,n){return function(){this[t]=n}}function U(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function F(t){return t.trim().split(/^|\s+/)}function z(t){return t.classList||new H(t)}function H(t){this._node=t,this._names=F(t.getAttribute("class")||"")}function G(t,n){for(var e=z(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function K(t,n){for(var e=z(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function J(t){return function(){G(this,t)}}function Q(t){return function(){K(this,t)}}function W(t,n){return function(){(n.apply(this,arguments)?G:K)(this,t)}}function Z(){this.textContent=""}function $(t){return function(){this.textContent=t}}function tt(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function nt(){this.innerHTML=""}function et(t){return function(){this.innerHTML=t}}function rt(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function it(){this.nextSibling&&this.parentNode.appendChild(this)}function ot(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function at(){return null}function ut(){var t=this.parentNode;t&&t.removeChild(this)}function st(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function ct(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function lt(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 ft(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 ht(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 pt(t,n,e){var r=L(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 dt(t,n){return function(){return pt(this,t,n)}}function gt(t,n){return function(){return pt(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)}},H.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 vt=[null];function yt(t,n){this._groups=t,this._parents=n}function mt(t){return"string"==typeof t?new yt([[document.querySelector(t)]],[document.documentElement]):new yt([[t]],vt)}function _t(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]}yt.prototype={constructor:yt,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 yt(r,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){return g(t.apply(this,arguments))}}(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 yt(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 yt(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=M(t.call(l,l&&l.__data__,c,r)),d=p.length,g=u[c]=new Array(d),v=a[c]=new Array(d),y=s[c]=new Array(h);e(l,f,g,v,y,p,n);for(var m,_,w=0,x=0;w<d;++w)if(m=g[w]){for(w>=x&&(x=w+1);!(_=v[x])&&++x<d;);m._next=_||null}}return(a=new yt(a,r))._enter=u,a._exit=s,a},enter:function(){return new yt(this._enter||this._groups.map(b),this._parents)},exit:function(){return new yt(this._exit||this._groups.map(b),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,o=this.exit();return"function"==typeof t?(r=t(r))&&(r=r.selection()):r=r.append(t+""),null!=n&&(i=n(i))&&(i=i.selection()),null==e?o.remove():e(o),r&&i?r.merge(i).order():i},merge:function(t){for(var n=t.selection?t.selection():t,e=this._groups,r=n._groups,i=e.length,o=r.length,a=Math.min(i,o),u=new Array(i),s=0;s<a;++s)for(var c,l=e[s],f=r[s],h=l.length,p=u[s]=new Array(h),d=0;d<h;++d)(c=l[d]||f[d])&&(p[d]=c);for(;s<i;++s)u[s]=e[s];return new yt(u,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 yt(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?B:P:"function"==typeof n?e.local?R:I:e.local?k:T)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?O:"function"==typeof n?X:V)(t,n,null==e?"":e)):j(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?Y:"function"==typeof n?U:q)(t,n)):this.node()[t]},classed:function(t,n){var e=F(t+"");if(arguments.length<2){for(var r=z(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?W:n?J:Q)(e,n))},text:function(t){return arguments.length?this.each(null==t?Z:("function"==typeof t?tt:$)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?nt:("function"==typeof t?rt:et)(t)):this.node().innerHTML},raise:function(){return this.each(it)},lower:function(){return this.each(ot)},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?at:"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(ut)},clone:function(t){return this.select(t?ct:st)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=lt(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?ht:ft,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?gt:dt)(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)}};const wt={passive:!1},xt={capture:!0,passive:!1};function bt(t){t.stopImmediatePropagation()}function At(t){t.preventDefault(),t.stopImmediatePropagation()}var Et=t=>()=>t;function Dt(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 St(t){return!t.ctrlKey&&!t.button}function Ct(){return this.parentNode}function Mt(t,n){return null==n?{x:t.x,y:t.y}:n}function Nt(){return navigator.maxTouchPoints||"ontouchstart"in this}function Pt(){var t,n,r,i,o=St,a=Ct,u=Mt,s=Nt,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,wt).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&&(mt(e.view).on("mousemove.drag",g,xt).on("mouseup.drag",v,xt),function(t){var n=t.document.documentElement,e=mt(t).on("dragstart.drag",At,xt);"onselectstart"in n?e.on("selectstart.drag",At,xt):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}(e.view),bt(e),r=!1,t=e.clientX,n=e.clientY,s("start",e))}}function g(e){if(At(e),!r){var i=e.clientX-t,o=e.clientY-n;r=i*i+o*o>h}c.mouse("drag",e)}function v(t){mt(t.view).on("mousemove.drag mouseup.drag",null),function(t,n){var e=t.document.documentElement,r=mt(t).on("dragstart.drag",null);n&&(r.on("click.drag",At,xt),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),At(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]))&&(bt(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])&&(At(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])&&(bt(t),e("end",t,r[n]))}function w(t,n,e,r,i,o){var a,s,h,d=l.copy(),g=_t(o||e,n);if(null!=(h=u.call(t,new Dt("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=_t(l||u,n),v=f}d.call(o,t,new Dt(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:Et(!!t),p):o},p.container=function(t){return arguments.length?(a="function"==typeof t?t:Et(t),p):a},p.subject=function(t){return arguments.length?(u="function"==typeof t?t:Et(t),p):u},p.touchable=function(t){return arguments.length?(s="function"==typeof t?t:Et(!!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 Bt,Tt,kt,It,Rt,Lt,Ot,Vt,Xt,jt,Yt;Dt.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};let qt=!1;function Ut(t,n){return isNaN(n)?t:Math.round(t*Math.pow(10,n))/Math.pow(10,n)}function Ft(t,n,e,r,i){let o,a;const u=n.data.datasets[e].data[r];if(t.touches?(o=n.scales[kt].getValueForPixel(t.touches[0].clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Tt].getValueForPixel(t.touches[0].clientY-n.canvas.getBoundingClientRect().top)):(o=n.scales[kt].getValueForPixel(t.clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Tt].getValueForPixel(t.clientY-n.canvas.getBoundingClientRect().top)),o=Ut(o,n.config.options.plugins.dragData.round),a=Ut(a,n.config.options.plugins.dragData.round),o=o>n.scales[kt].max?n.scales[kt].max:o,o=o<n.scales[kt].min?n.scales[kt].min:o,a=a>n.scales[Tt].max?n.scales[Tt].max:a,a=a<n.scales[Tt].min?n.scales[Tt].min:a,Ot){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 zt=(t,n,e,r)=>{if(Bt){Xt=Bt.datasetIndex,jt=Bt.index,qt=!0;let i=n.data.datasets[Xt].data[jt];if("radar"===Rt||"polarArea"===Rt)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[It],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=Ut(i,n.config.options.plugins.dragData.round),i=i>n.scales[It].max?n.scales[It].max:i,i=i<n.scales[It].min?n.scales[It].min:i,i}(t,n);else if(Lt){i=Ut(Ft(t,n,Xt,jt)-Vt,e.round)}else i=Ft(t,n,Xt,jt);(!r||"function"==typeof r&&!1!==r(t,Xt,jt,i))&&(n.data.datasets[Xt].data[jt]=i,n.update("none"))}};const Ht={id:"dragdata",afterInit:function(t){if(t.config.options.plugins&&t.config.options.plugins.dragData){const n=t.config.options.plugins.dragData;mt(t.canvas).call(Pt().container(t.canvas).on("start",(e=>((t,n,e)=>{if(Bt=n.getElementsAtEventForMode(t,"nearest",{intersect:!0},!1)[0],Rt=n.config.type,Bt){let r=Bt.datasetIndex,i=Bt.index;Yt=n.config.options.plugins?.tooltip?.animation;const o=n.data.datasets[r],a=n.getDatasetMeta(r);let u=o.data[i];if(kt=a.xAxisID,Tt=a.yAxisID,It=a.rAxisID,!1===o.dragData||n.config.options.scales[kt]&&!1===n.config.options.scales[kt].dragData||n.config.options.scales[Tt]&&!1===n.config.options.scales[Tt].dragData||n.config.options.scales[It]&&!1===n.config.options.scales[It].rAxisID||!1===o.data[Bt.index].dragData)return void(Bt=null);if("bar"===Rt){Lt=n.config.options.scales[kt].stacked;const e=n.data.datasets[0].data[0];Ot=null!==e&&Array.isArray(e)&&2==e.length;let o=Ft(t,n,r,i);Vt=o-u}(void 0===n.config.options.plugins.dragData.showTooltip||n.config.options.plugins.dragData.showTooltip)&&(n.config.options.plugins.tooltip||(n.config.options.plugins.tooltip={}),n.config.options.plugins.tooltip.animation=!1),"function"==typeof e&&Bt&&!1===e(t,r,i,u)&&(Bt=null)}})(e.sourceEvent,t,n.onDragStart))).on("drag",(e=>zt(e.sourceEvent,t,n,n.onDrag))).on("end",(e=>((t,n,e)=>{if(jt=void 0,qt=!1,n.config.options.plugins.tooltip.animation=Yt,n.update("none"),"function"==typeof e&&Bt){const r=Bt.datasetIndex,i=Bt.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))))}},afterEvent:function(t){Bt&&qt&&t.tooltip.setActiveElements([Bt],{x:Bt.element.x,y:Bt.element.y})}};t.register(Ht);export{Ht as default};

@@ -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 null==t?[]:Array.isArray(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 Array.from(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){return"object"==typeof t&&"length"in t?t:Array.from(t)}function N(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function P(t){return function(){this.removeAttribute(t)}}function T(t){return function(){this.removeAttributeNS(t.space,t.local)}}function B(t,n){return function(){this.setAttribute(t,n)}}function k(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function I(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function R(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 j(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)||j(t).getComputedStyle(t,null).getPropertyValue(n)}function q(t){return function(){delete this[t]}}function Y(t,n){return function(){this[t]=n}}function U(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function F(t){return t.trim().split(/^|\s+/)}function z(t){return t.classList||new H(t)}function H(t){this._node=t,this._names=F(t.getAttribute("class")||"")}function G(t,n){for(var e=z(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function K(t,n){for(var e=z(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function J(t){return function(){G(this,t)}}function Q(t){return function(){K(this,t)}}function W(t,n){return function(){(n.apply(this,arguments)?G:K)(this,t)}}function Z(){this.textContent=""}function $(t){return function(){this.textContent=t}}function tt(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function nt(){this.innerHTML=""}function et(t){return function(){this.innerHTML=t}}function rt(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function it(){this.nextSibling&&this.parentNode.appendChild(this)}function ot(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function at(){return null}function ut(){var t=this.parentNode;t&&t.removeChild(this)}function st(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function ct(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function lt(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 ft(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 ht(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 pt(t,n,e){var r=j(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 dt(t,n){return function(){return pt(this,t,n)}}function gt(t,n){return function(){return pt(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)}},H.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 vt=[null];function yt(t,n){this._groups=t,this._parents=n}function mt(t){return"string"==typeof t?new yt([[document.querySelector(t)]],[document.documentElement]):new yt([[t]],vt)}function _t(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]}yt.prototype={constructor:yt,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 yt(r,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){return g(t.apply(this,arguments))}}(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 yt(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 yt(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=M(t.call(l,l&&l.__data__,c,r)),d=p.length,g=u[c]=new Array(d),v=a[c]=new Array(d),y=s[c]=new Array(h);e(l,f,g,v,y,p,n);for(var m,_,w=0,x=0;w<d;++w)if(m=g[w]){for(w>=x&&(x=w+1);!(_=v[x])&&++x<d;);m._next=_||null}}return(a=new yt(a,r))._enter=u,a._exit=s,a},enter:function(){return new yt(this._enter||this._groups.map(b),this._parents)},exit:function(){return new yt(this._exit||this._groups.map(b),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,o=this.exit();return"function"==typeof t?(r=t(r))&&(r=r.selection()):r=r.append(t+""),null!=n&&(i=n(i))&&(i=i.selection()),null==e?o.remove():e(o),r&&i?r.merge(i).order():i},merge:function(t){for(var n=t.selection?t.selection():t,e=this._groups,r=n._groups,i=e.length,o=r.length,a=Math.min(i,o),u=new Array(i),s=0;s<a;++s)for(var c,l=e[s],f=r[s],h=l.length,p=u[s]=new Array(h),d=0;d<h;++d)(c=l[d]||f[d])&&(p[d]=c);for(;s<i;++s)u[s]=e[s];return new yt(u,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 yt(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?T:P:"function"==typeof n?e.local?R:I:e.local?k: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?q:"function"==typeof n?U:Y)(t,n)):this.node()[t]},classed:function(t,n){var e=F(t+"");if(arguments.length<2){for(var r=z(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?W:n?J:Q)(e,n))},text:function(t){return arguments.length?this.each(null==t?Z:("function"==typeof t?tt:$)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?nt:("function"==typeof t?rt:et)(t)):this.node().innerHTML},raise:function(){return this.each(it)},lower:function(){return this.each(ot)},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?at:"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(ut)},clone:function(t){return this.select(t?ct:st)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=lt(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?ht:ft,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?gt:dt)(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)}};const wt={passive:!1},xt={capture:!0,passive:!1};function bt(t){t.stopImmediatePropagation()}function At(t){t.preventDefault(),t.stopImmediatePropagation()}var Et=t=>()=>t;function Dt(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 Ct(t){return!t.ctrlKey&&!t.button}function St(){return this.parentNode}function Mt(t,n){return null==n?{x:t.x,y:t.y}:n}function Nt(){return navigator.maxTouchPoints||"ontouchstart"in this}function Pt(){var t,n,r,i,o=Ct,a=St,u=Mt,s=Nt,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,wt).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&&(mt(e.view).on("mousemove.drag",g,xt).on("mouseup.drag",v,xt),function(t){var n=t.document.documentElement,e=mt(t).on("dragstart.drag",At,xt);"onselectstart"in n?e.on("selectstart.drag",At,xt):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}(e.view),bt(e),r=!1,t=e.clientX,n=e.clientY,s("start",e))}}function g(e){if(At(e),!r){var i=e.clientX-t,o=e.clientY-n;r=i*i+o*o>h}c.mouse("drag",e)}function v(t){mt(t.view).on("mousemove.drag mouseup.drag",null),function(t,n){var e=t.document.documentElement,r=mt(t).on("dragstart.drag",null);n&&(r.on("click.drag",At,xt),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),At(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]))&&(bt(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])&&(At(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])&&(bt(t),e("end",t,r[n]))}function w(t,n,e,r,i,o){var a,s,h,d=l.copy(),g=_t(o||e,n);if(null!=(h=u.call(t,new Dt("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=_t(l||u,n),v=f}d.call(o,t,new Dt(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:Et(!!t),p):o},p.container=function(t){return arguments.length?(a="function"==typeof t?t:Et(t),p):a},p.subject=function(t){return arguments.length?(u="function"==typeof t?t:Et(t),p):u},p.touchable=function(t){return arguments.length?(s="function"==typeof t?t:Et(!!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 Tt,Bt,kt,It,Rt,jt,Lt,Ot,Vt,Xt;Dt.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};let qt=!1;function Yt(t,n){return isNaN(n)?t:Math.round(t*Math.pow(10,n))/Math.pow(10,n)}function Ut(t,n,e,r,i){let o,a;const u=n.data.datasets[e].data[r];if(t.touches?(o=n.scales[kt].getValueForPixel(t.touches[0].clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Bt].getValueForPixel(t.touches[0].clientY-n.canvas.getBoundingClientRect().top)):(o=n.scales[kt].getValueForPixel(t.clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Bt].getValueForPixel(t.clientY-n.canvas.getBoundingClientRect().top)),o=Yt(o,n.config.options.plugins.dragData.round),a=Yt(a,n.config.options.plugins.dragData.round),o=o>n.scales[kt].max?n.scales[kt].max:o,o=o<n.scales[kt].min?n.scales[kt].min:o,a=a>n.scales[Bt].max?n.scales[Bt].max:a,a=a<n.scales[Bt].min?n.scales[Bt].min:a,Lt){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 Ft=(t,n,e,r)=>{if(Tt){Vt=Tt.datasetIndex,Xt=Tt.index,qt=!0;let i=n.data.datasets[Vt].data[Xt];if("radar"===Rt||"polarArea"===Rt)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[It],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=Yt(i,n.config.options.plugins.dragData.round),i=i>n.scales[It].max?n.scales[It].max:i,i=i<n.scales[It].min?n.scales[It].min:i,i}(t,n);else if(jt){i=Yt(Ut(t,n,Vt,Xt)-Ot,e.round)}else i=Ut(t,n,Vt,Xt);(void 0===e.showTooltip||e.showTooltip)&&n.tooltip.setActiveElements([Tt],{x:Tt.element.x,y:Tt.element.y}),(!r||"function"==typeof r&&!1!==r(t,Vt,Xt,i))&&(n.data.datasets[Vt].data[Xt]=i,n.update("none"))}};const zt={id:"dragdata",afterInit:function(t){if(t.config.options.plugins&&t.config.options.plugins.dragData){const n=t.config.options.plugins.dragData;mt(t.canvas).call(Pt().container(t.canvas).on("start",(e=>((t,n,e)=>{if(Tt=n.getElementsAtEventForMode(t,"nearest",{intersect:!0},!1)[0],Rt=n.config.type,Tt){let r=Tt.datasetIndex,i=Tt.index;const o=n.data.datasets[r],a=n.getDatasetMeta(r);let u=o.data[i];if(kt=a.xAxisID,Bt=a.yAxisID,It=a.rAxisID,!1===o.dragData||n.config.options.scales[kt]&&!1===n.config.options.scales[kt].dragData||n.config.options.scales[Bt]&&!1===n.config.options.scales[Bt].dragData||n.config.options.scales[It]&&!1===n.config.options.scales[It].rAxisID||!1===o.data[Tt.index].dragData)return void(Tt=null);if("bar"===Rt){jt=n.config.options.scales[kt].stacked;const e=n.data.datasets[0].data[0];Lt=null!==e&&Array.isArray(e)&&2==e.length;let o=Ut(t,n,r,i);Ot=o-u}"function"==typeof e&&Tt&&!1===e(t,r,i,u)&&(Tt=null)}})(e.sourceEvent,t,n.onDragStart))).on("drag",(e=>Ft(e.sourceEvent,t,n,n.onDrag))).on("end",(e=>((t,n,e)=>{if(Xt=void 0,qt=!1,"function"==typeof e&&Tt){const r=Tt.datasetIndex,i=Tt.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&&qt)return!1}};return t.Chart.register(zt),zt}));
!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 null==t?[]:Array.isArray(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 Array.from(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){return"object"==typeof t&&"length"in t?t:Array.from(t)}function N(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function P(t){return function(){this.removeAttribute(t)}}function T(t){return function(){this.removeAttributeNS(t.space,t.local)}}function B(t,n){return function(){this.setAttribute(t,n)}}function k(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function I(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function R(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 j(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)||j(t).getComputedStyle(t,null).getPropertyValue(n)}function q(t){return function(){delete this[t]}}function Y(t,n){return function(){this[t]=n}}function U(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function F(t){return t.trim().split(/^|\s+/)}function z(t){return t.classList||new H(t)}function H(t){this._node=t,this._names=F(t.getAttribute("class")||"")}function G(t,n){for(var e=z(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function K(t,n){for(var e=z(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function J(t){return function(){G(this,t)}}function Q(t){return function(){K(this,t)}}function W(t,n){return function(){(n.apply(this,arguments)?G:K)(this,t)}}function Z(){this.textContent=""}function $(t){return function(){this.textContent=t}}function tt(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function nt(){this.innerHTML=""}function et(t){return function(){this.innerHTML=t}}function rt(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function it(){this.nextSibling&&this.parentNode.appendChild(this)}function ot(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function at(){return null}function ut(){var t=this.parentNode;t&&t.removeChild(this)}function st(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function ct(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function lt(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 ft(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 ht(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 pt(t,n,e){var r=j(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 dt(t,n){return function(){return pt(this,t,n)}}function gt(t,n){return function(){return pt(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)}},H.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 vt=[null];function yt(t,n){this._groups=t,this._parents=n}function mt(t){return"string"==typeof t?new yt([[document.querySelector(t)]],[document.documentElement]):new yt([[t]],vt)}function _t(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]}yt.prototype={constructor:yt,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 yt(r,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){return g(t.apply(this,arguments))}}(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 yt(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 yt(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=M(t.call(l,l&&l.__data__,c,r)),d=p.length,g=u[c]=new Array(d),v=a[c]=new Array(d),y=s[c]=new Array(h);e(l,f,g,v,y,p,n);for(var m,_,w=0,x=0;w<d;++w)if(m=g[w]){for(w>=x&&(x=w+1);!(_=v[x])&&++x<d;);m._next=_||null}}return(a=new yt(a,r))._enter=u,a._exit=s,a},enter:function(){return new yt(this._enter||this._groups.map(b),this._parents)},exit:function(){return new yt(this._exit||this._groups.map(b),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,o=this.exit();return"function"==typeof t?(r=t(r))&&(r=r.selection()):r=r.append(t+""),null!=n&&(i=n(i))&&(i=i.selection()),null==e?o.remove():e(o),r&&i?r.merge(i).order():i},merge:function(t){for(var n=t.selection?t.selection():t,e=this._groups,r=n._groups,i=e.length,o=r.length,a=Math.min(i,o),u=new Array(i),s=0;s<a;++s)for(var c,l=e[s],f=r[s],h=l.length,p=u[s]=new Array(h),d=0;d<h;++d)(c=l[d]||f[d])&&(p[d]=c);for(;s<i;++s)u[s]=e[s];return new yt(u,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 yt(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?T:P:"function"==typeof n?e.local?R:I:e.local?k: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?q:"function"==typeof n?U:Y)(t,n)):this.node()[t]},classed:function(t,n){var e=F(t+"");if(arguments.length<2){for(var r=z(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?W:n?J:Q)(e,n))},text:function(t){return arguments.length?this.each(null==t?Z:("function"==typeof t?tt:$)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?nt:("function"==typeof t?rt:et)(t)):this.node().innerHTML},raise:function(){return this.each(it)},lower:function(){return this.each(ot)},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?at:"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(ut)},clone:function(t){return this.select(t?ct:st)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=lt(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?ht:ft,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?gt:dt)(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)}};const wt={passive:!1},xt={capture:!0,passive:!1};function bt(t){t.stopImmediatePropagation()}function At(t){t.preventDefault(),t.stopImmediatePropagation()}var Et=t=>()=>t;function Dt(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 Ct(t){return!t.ctrlKey&&!t.button}function St(){return this.parentNode}function Mt(t,n){return null==n?{x:t.x,y:t.y}:n}function Nt(){return navigator.maxTouchPoints||"ontouchstart"in this}function Pt(){var t,n,r,i,o=Ct,a=St,u=Mt,s=Nt,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,wt).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&&(mt(e.view).on("mousemove.drag",g,xt).on("mouseup.drag",v,xt),function(t){var n=t.document.documentElement,e=mt(t).on("dragstart.drag",At,xt);"onselectstart"in n?e.on("selectstart.drag",At,xt):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}(e.view),bt(e),r=!1,t=e.clientX,n=e.clientY,s("start",e))}}function g(e){if(At(e),!r){var i=e.clientX-t,o=e.clientY-n;r=i*i+o*o>h}c.mouse("drag",e)}function v(t){mt(t.view).on("mousemove.drag mouseup.drag",null),function(t,n){var e=t.document.documentElement,r=mt(t).on("dragstart.drag",null);n&&(r.on("click.drag",At,xt),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),At(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]))&&(bt(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])&&(At(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])&&(bt(t),e("end",t,r[n]))}function w(t,n,e,r,i,o){var a,s,h,d=l.copy(),g=_t(o||e,n);if(null!=(h=u.call(t,new Dt("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=_t(l||u,n),v=f}d.call(o,t,new Dt(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:Et(!!t),p):o},p.container=function(t){return arguments.length?(a="function"==typeof t?t:Et(t),p):a},p.subject=function(t){return arguments.length?(u="function"==typeof t?t:Et(t),p):u},p.touchable=function(t){return arguments.length?(s="function"==typeof t?t:Et(!!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 Tt,Bt,kt,It,Rt,jt,Lt,Ot,Vt,Xt,qt;Dt.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};let Yt=!1;function Ut(t,n){return isNaN(n)?t:Math.round(t*Math.pow(10,n))/Math.pow(10,n)}function Ft(t,n,e,r,i){let o,a;const u=n.data.datasets[e].data[r];if(t.touches?(o=n.scales[kt].getValueForPixel(t.touches[0].clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Bt].getValueForPixel(t.touches[0].clientY-n.canvas.getBoundingClientRect().top)):(o=n.scales[kt].getValueForPixel(t.clientX-n.canvas.getBoundingClientRect().left),a=n.scales[Bt].getValueForPixel(t.clientY-n.canvas.getBoundingClientRect().top)),o=Ut(o,n.config.options.plugins.dragData.round),a=Ut(a,n.config.options.plugins.dragData.round),o=o>n.scales[kt].max?n.scales[kt].max:o,o=o<n.scales[kt].min?n.scales[kt].min:o,a=a>n.scales[Bt].max?n.scales[Bt].max:a,a=a<n.scales[Bt].min?n.scales[Bt].min:a,Lt){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 zt=(t,n,e,r)=>{if(Tt){Vt=Tt.datasetIndex,Xt=Tt.index,Yt=!0;let i=n.data.datasets[Vt].data[Xt];if("radar"===Rt||"polarArea"===Rt)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[It],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=Ut(i,n.config.options.plugins.dragData.round),i=i>n.scales[It].max?n.scales[It].max:i,i=i<n.scales[It].min?n.scales[It].min:i,i}(t,n);else if(jt){i=Ut(Ft(t,n,Vt,Xt)-Ot,e.round)}else i=Ft(t,n,Vt,Xt);(!r||"function"==typeof r&&!1!==r(t,Vt,Xt,i))&&(n.data.datasets[Vt].data[Xt]=i,n.update("none"))}};const Ht={id:"dragdata",afterInit:function(t){if(t.config.options.plugins&&t.config.options.plugins.dragData){const n=t.config.options.plugins.dragData;mt(t.canvas).call(Pt().container(t.canvas).on("start",(e=>((t,n,e)=>{if(Tt=n.getElementsAtEventForMode(t,"nearest",{intersect:!0},!1)[0],Rt=n.config.type,Tt){let r=Tt.datasetIndex,i=Tt.index;qt=n.config.options.plugins?.tooltip?.animation;const o=n.data.datasets[r],a=n.getDatasetMeta(r);let u=o.data[i];if(kt=a.xAxisID,Bt=a.yAxisID,It=a.rAxisID,!1===o.dragData||n.config.options.scales[kt]&&!1===n.config.options.scales[kt].dragData||n.config.options.scales[Bt]&&!1===n.config.options.scales[Bt].dragData||n.config.options.scales[It]&&!1===n.config.options.scales[It].rAxisID||!1===o.data[Tt.index].dragData)return void(Tt=null);if("bar"===Rt){jt=n.config.options.scales[kt].stacked;const e=n.data.datasets[0].data[0];Lt=null!==e&&Array.isArray(e)&&2==e.length;let o=Ft(t,n,r,i);Ot=o-u}(void 0===n.config.options.plugins.dragData.showTooltip||n.config.options.plugins.dragData.showTooltip)&&(n.config.options.plugins.tooltip||(n.config.options.plugins.tooltip={}),n.config.options.plugins.tooltip.animation=!1),"function"==typeof e&&Tt&&!1===e(t,r,i,u)&&(Tt=null)}})(e.sourceEvent,t,n.onDragStart))).on("drag",(e=>zt(e.sourceEvent,t,n,n.onDrag))).on("end",(e=>((t,n,e)=>{if(Xt=void 0,Yt=!1,n.config.options.plugins.tooltip.animation=qt,n.update("none"),"function"==typeof e&&Tt){const r=Tt.datasetIndex,i=Tt.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))))}},afterEvent:function(t){Tt&&Yt&&t.tooltip.setActiveElements([Tt],{x:Tt.element.x,y:Tt.element.y})}};return t.Chart.register(Ht),Ht}));
{
"name": "chartjs-plugin-dragdata",
"version": "2.2.0",
"version": "2.2.1",
"description": "Draggable data points for Chart.js",

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

@@ -16,4 +16,4 @@ import {Chart} from 'chart.js'

// save element settings
// eventSettings = chartInstance.config.options.animation
// chartInstance.config.options.animation = false
eventSettings = chartInstance.config.options.plugins?.tooltip?.animation
const dataset = chartInstance.data.datasets[datasetIndex]

@@ -50,2 +50,8 @@ const datasetMeta = chartInstance.getDatasetMeta(datasetIndex)

// disable the tooltip animation
if (chartInstance.config.options.plugins.dragData.showTooltip === undefined || chartInstance.config.options.plugins.dragData.showTooltip) {
if (!chartInstance.config.options.plugins.tooltip) chartInstance.config.options.plugins.tooltip = {}
chartInstance.config.options.plugins.tooltip.animation = false
}
if (typeof callback === 'function' && element) {

@@ -174,10 +180,2 @@ if (callback(e, datasetIndex, index, curValue) === false) {

}
if (pluginOptions.showTooltip === undefined || pluginOptions.showTooltip) {
chartInstance.tooltip.setActiveElements([element],{
x: element.element.x,
y: element.element.y
})
}

@@ -211,3 +209,6 @@ if (!callback || (typeof callback === 'function' && callback(e, curDatasetIndex, curIndex, dataPoint) !== false)) {

isDragging = false
// chartInstance.config.options.animation = eventSettings
// re-enable the tooltip animation
chartInstance.config.options.plugins.tooltip.animation = eventSettings
chartInstance.update('none')
// chartInstance.update('none')

@@ -235,9 +236,9 @@ if (typeof callback === 'function' && element) {

},
beforeEvent: function (chart) {
if (chart.config.options.plugins &&
chart.config.options.plugins.dragData &&
chart.config.options.plugins.dragData.showTooltip &&
isDragging
) {
return false
afterEvent: function (chart) {
if (!element) return
if (isDragging) {
chart.tooltip.setActiveElements([element],{
x: element.element.x,
y: element.element.y
})
}

@@ -244,0 +245,0 @@ }

Sorry, the diff of this file is not supported yet

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