d3-zoomable
Advanced tools
Comparing version 1.1.3 to 1.1.4
'use strict'; | ||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
var d3Selection = require('d3-selection'); | ||
@@ -9,4 +7,8 @@ var d3Transition = require('d3-transition'); | ||
var d3Zoom = require('d3-zoom'); | ||
var Kapsule = _interopDefault(require('kapsule')); | ||
var Kapsule = require('kapsule'); | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var Kapsule__default = /*#__PURE__*/_interopDefaultLegacy(Kapsule); | ||
function _typeof(obj) { | ||
@@ -77,3 +79,3 @@ "@babel/helpers - typeof"; | ||
var zoomable = Kapsule({ | ||
var zoomable = Kapsule__default['default']({ | ||
props: { | ||
@@ -175,4 +177,4 @@ htmlEl: { | ||
return { | ||
zoom: d3Zoom.zoom().filter(function () { | ||
return !d3Selection.event.button && !d3Selection.event.dblclick; | ||
zoom: d3Zoom.zoom().filter(function (ev) { | ||
return !ev.button && !ev.dblclick; | ||
}), | ||
@@ -189,4 +191,4 @@ zoomTransform: { | ||
state.el = d3Selection.select(isD3Selection ? el.node() : el); | ||
state.el.call(state.zoom.on('zoom', function () { | ||
var tr = _objectSpread2({}, d3Selection.event.transform); | ||
state.el.call(state.zoom.on('zoom', function (ev) { | ||
var tr = _objectSpread2({}, ev.transform); | ||
@@ -193,0 +195,0 @@ !state.enableX && (tr.x = 0); |
@@ -1,2 +0,2 @@ | ||
// Version 1.1.3 d3-zoomable - https://github.com/vasturiano/d3-zoomable | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t=t||self).zoomable=n()}(this,(function(){"use strict";function t(n){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(n)}function n(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function e(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function r(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?e(Object(i),!0).forEach((function(e){n(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))}))}return t}var i="http://www.w3.org/1999/xhtml",o={svg:"http://www.w3.org/2000/svg",xhtml:i,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function u(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),o.hasOwnProperty(n)?{space:o[n],local:t}:t}function a(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===i&&n.documentElement.namespaceURI===i?n.createElement(t):n.createElementNS(e,t)}}function s(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function l(t){var n=u(t);return(n.local?s:a)(n)}function c(){}function h(t){return null==t?c:function(){return this.querySelector(t)}}function f(){return[]}function p(t){return null==t?f:function(){return this.querySelectorAll(t)}}function d(t){return function(){return this.matches(t)}}function m(t){return new Array(t.length)}function v(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}v.prototype={constructor:v,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)}};function y(t,n,e,r,i,o){for(var u,a=0,s=n.length,l=o.length;a<l;++a)(u=n[a])?(u.__data__=o[a],r[a]=u):e[a]=new v(t,o[a]);for(;a<s;++a)(u=n[a])&&(i[a]=u)}function g(t,n,e,r,i,o,u){var a,s,l,c={},h=n.length,f=o.length,p=new Array(h);for(a=0;a<h;++a)(s=n[a])&&(p[a]=l="$"+u.call(s,s.__data__,a,n),l in c?i[a]=s:c[l]=s);for(a=0;a<f;++a)(s=c[l="$"+u.call(t,o[a],a,o)])?(r[a]=s,s.__data__=o[a],c[l]=null):e[a]=new v(t,o[a]);for(a=0;a<h;++a)(s=n[a])&&c[p[a]]===s&&(i[a]=s)}function _(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function w(t){return function(){this.removeAttribute(t)}}function b(t){return function(){this.removeAttributeNS(t.space,t.local)}}function x(t,n){return function(){this.setAttribute(t,n)}}function k(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function E(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function z(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 M(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function A(t){return function(){this.style.removeProperty(t)}}function N(t,n,e){return function(){this.style.setProperty(t,n,e)}}function S(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function T(t,n){return t.style.getPropertyValue(n)||M(t).getComputedStyle(t,null).getPropertyValue(n)}function O(t){return function(){delete this[t]}}function P(t,n){return function(){this[t]=n}}function C(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function j(t){return t.trim().split(/^|\s+/)}function X(t){return t.classList||new Y(t)}function Y(t){this._node=t,this._names=j(t.getAttribute("class")||"")}function q(t,n){for(var e=X(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function D(t,n){for(var e=X(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function V(t){return function(){q(this,t)}}function I(t){return function(){D(this,t)}}function U(t,n){return function(){(n.apply(this,arguments)?q:D)(this,t)}}function R(){this.textContent=""}function B(t){return function(){this.textContent=t}}function L(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function H(){this.innerHTML=""}function $(t){return function(){this.innerHTML=t}}function G(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function F(){this.nextSibling&&this.parentNode.appendChild(this)}function K(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Q(){return null}function W(){var t=this.parentNode;t&&t.removeChild(this)}function J(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function Z(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}Y.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 tt={},nt=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(tt={mouseenter:"mouseover",mouseleave:"mouseout"}));function et(t,n,e){return t=rt(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function rt(t,n,e){return function(r){var i=nt;nt=r;try{t.call(this,this.__data__,n,e)}finally{nt=i}}}function it(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 ot(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.capture);++i?n.length=i:delete this.__on}}}function ut(t,n,e){var r=tt.hasOwnProperty(t.type)?et:rt;return function(i,o,u){var a,s=this.__on,l=r(n,o,u);if(s)for(var c=0,h=s.length;c<h;++c)if((a=s[c]).type===t.type&&a.name===t.name)return this.removeEventListener(a.type,a.listener,a.capture),this.addEventListener(a.type,a.listener=l,a.capture=e),void(a.value=n);this.addEventListener(t.type,l,e),a={type:t.type,name:t.name,value:n,listener:l,capture:e},s?s.push(a):this.__on=[a]}}function at(t,n,e){var r=M(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 st(t,n){return function(){return at(this,t,n)}}function lt(t,n){return function(){return at(this,t,n.apply(this,arguments))}}var ct=[null];function ht(t,n){this._groups=t,this._parents=n}function ft(){return new ht([[document.documentElement]],ct)}function pt(t){return"string"==typeof t?new ht([[document.querySelector(t)]],[document.documentElement]):new ht([[t]],ct)}function dt(){for(var t,n=nt;t=n.sourceEvent;)n=t;return n}function mt(t,n){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=n.clientX,r.y=n.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}var i=t.getBoundingClientRect();return[n.clientX-i.left-t.clientLeft,n.clientY-i.top-t.clientTop]}function vt(t){var n=dt();return n.changedTouches&&(n=n.changedTouches[0]),mt(t,n)}function yt(t,n,e){arguments.length<3&&(e=n,n=dt().changedTouches);for(var r,i=0,o=n?n.length:0;i<o;++i)if((r=n[i]).identifier===e)return mt(t,r);return null}ht.prototype=ft.prototype={constructor:ht,select:function(t){"function"!=typeof t&&(t=h(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u,a=n[i],s=a.length,l=r[i]=new Array(s),c=0;c<s;++c)(o=a[c])&&(u=t.call(o,o.__data__,c,a))&&("__data__"in o&&(u.__data__=o.__data__),l[c]=u);return new ht(r,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=p(t));for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var u,a=n[o],s=a.length,l=0;l<s;++l)(u=a[l])&&(r.push(t.call(u,u.__data__,l,a)),i.push(u));return new ht(r,i)},filter: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,u=n[i],a=u.length,s=r[i]=[],l=0;l<a;++l)(o=u[l])&&t.call(o,o.__data__,l,u)&&s.push(o);return new ht(r,this._parents)},data:function(t,n){if(!t)return d=new Array(this.size()),c=-1,this.each((function(t){d[++c]=t})),d;var e,r=n?g:y,i=this._parents,o=this._groups;"function"!=typeof t&&(e=t,t=function(){return e});for(var u=o.length,a=new Array(u),s=new Array(u),l=new Array(u),c=0;c<u;++c){var h=i[c],f=o[c],p=f.length,d=t.call(h,h&&h.__data__,c,i),m=d.length,v=s[c]=new Array(m),_=a[c]=new Array(m);r(h,f,v,_,l[c]=new Array(p),d,n);for(var w,b,x=0,k=0;x<m;++x)if(w=v[x]){for(x>=k&&(k=x+1);!(b=_[k])&&++k<m;);w._next=b||null}}return(a=new ht(a,i))._enter=s,a._exit=l,a},enter:function(){return new ht(this._enter||this._groups.map(m),this._parents)},exit:function(){return new ht(this._exit||this._groups.map(m),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,o=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=n&&(i=n(i)),null==e?o.remove():e(o),r&&i?r.merge(i).order():i},merge:function(t){for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),u=new Array(r),a=0;a<o;++a)for(var s,l=n[a],c=e[a],h=l.length,f=u[a]=new Array(h),p=0;p<h;++p)(s=l[p]||c[p])&&(f[p]=s);for(;a<r;++a)u[a]=n[a];return new ht(u,this._parents)},order:function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],o=i.length-1,u=i[o];--o>=0;)(r=i[o])&&(u&&4^r.compareDocumentPosition(u)&&u.parentNode.insertBefore(r,u),u=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=_);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var u,a=e[o],s=a.length,l=i[o]=new Array(s),c=0;c<s;++c)(u=a[c])&&(l[c]=u);l.sort(n)}return new ht(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),n=-1;return this.each((function(){t[++n]=this})),t},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 u=r[i];if(u)return u}return null},size:function(){var t=0;return this.each((function(){++t})),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],u=0,a=o.length;u<a;++u)(i=o[u])&&t.call(i,i.__data__,u,o);return this},attr:function(t,n){var e=u(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:w:"function"==typeof n?e.local?z:E:e.local?k:x)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?A:"function"==typeof n?S:N)(t,n,null==e?"":e)):T(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?O:"function"==typeof n?C:P)(t,n)):this.node()[t]},classed:function(t,n){var e=j(t+"");if(arguments.length<2){for(var r=X(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?U:n?V:I)(e,n))},text:function(t){return arguments.length?this.each(null==t?R:("function"==typeof t?L:B)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?H:("function"==typeof t?G:$)(t)):this.node().innerHTML},raise:function(){return this.each(F)},lower:function(){return this.each(K)},append:function(t){var n="function"==typeof t?t:l(t);return this.select((function(){return this.appendChild(n.apply(this,arguments))}))},insert:function(t,n){var e="function"==typeof t?t:l(t),r=null==n?Q:"function"==typeof n?n:h(n);return this.select((function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(W)},clone:function(t){return this.select(t?Z:J)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=it(t+""),u=o.length;if(!(arguments.length<2)){for(a=n?ut:ot,null==e&&(e=!1),r=0;r<u;++r)this.each(a(o[r],n,e));return this}var a=this.node().__on;if(a)for(var s,l=0,c=a.length;l<c;++l)for(r=0,s=a[l];r<u;++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?lt:st)(t,n))}};var gt={value:function(){}};function _t(){for(var t,n=0,e=arguments.length,r={};n<e;++n){if(!(t=arguments[n]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new wt(r)}function wt(t){this._=t}function bt(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 xt(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function kt(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=gt,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}wt.prototype=_t.prototype={constructor:wt,on:function(t,n){var e,r=this._,i=bt(t+"",r),o=-1,u=i.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++o<u;)if(e=(t=i[o]).type)r[e]=kt(r[e],t.name,n);else if(null==n)for(e in r)r[e]=kt(r[e],t.name,null);return this}for(;++o<u;)if((e=(t=i[o]).type)&&(e=xt(r[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new wt(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 Et,zt,Mt=0,At=0,Nt=0,St=0,Tt=0,Ot=0,Pt="object"==typeof performance&&performance.now?performance:Date,Ct="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function jt(){return Tt||(Ct(Xt),Tt=Pt.now()+Ot)}function Xt(){Tt=0}function Yt(){this._call=this._time=this._next=null}function qt(t,n,e){var r=new Yt;return r.restart(t,n,e),r}function Dt(){Tt=(St=Pt.now())+Ot,Mt=At=0;try{!function(){jt(),++Mt;for(var t,n=Et;n;)(t=Tt-n._time)>=0&&n._call.call(null,t),n=n._next;--Mt}()}finally{Mt=0,function(){var t,n,e=Et,r=1/0;for(;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Et=n);zt=t,It(r)}(),Tt=0}}function Vt(){var t=Pt.now(),n=t-St;n>1e3&&(Ot-=n,St=t)}function It(t){Mt||(At&&(At=clearTimeout(At)),t-Tt>24?(t<1/0&&(At=setTimeout(Dt,t-Pt.now()-Ot)),Nt&&(Nt=clearInterval(Nt))):(Nt||(St=Pt.now(),Nt=setInterval(Vt,1e3)),Mt=1,Ct(Dt)))}function Ut(t,n,e){var r=new Yt;return n=null==n?0:+n,r.restart((function(e){r.stop(),t(e+n)}),n,e),r}Yt.prototype=qt.prototype={constructor:Yt,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?jt():+e)+(null==n?0:+n),this._next||zt===this||(zt?zt._next=this:Et=this,zt=this),this._call=t,this._time=e,It()},stop:function(){this._call&&(this._call=null,this._time=1/0,It())}};var Rt=_t("start","end","cancel","interrupt"),Bt=[];function Lt(t,n,e,r,i,o){var u=t.__transition;if(u){if(e in u)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(s){var l,c,h,f;if(1!==e.state)return a();for(l in i)if((f=i[l]).name===e.name){if(3===f.state)return Ut(o);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[l]):+l<n&&(f.state=6,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete i[l])}if(Ut((function(){3===e.state&&(e.state=4,e.timer.restart(u,e.delay,e.time),u(s))})),e.state=2,e.on.call("start",t,t.__data__,e.index,e.group),2===e.state){for(e.state=3,r=new Array(h=e.tween.length),l=0,c=-1;l<h;++l)(f=e.tween[l].value.call(t,t.__data__,e.index,e.group))&&(r[++c]=f);r.length=c+1}}function u(n){for(var i=n<e.duration?e.ease.call(null,n/e.duration):(e.timer.restart(a),e.state=5,1),o=-1,u=r.length;++o<u;)r[o].call(t,i);5===e.state&&(e.on.call("end",t,t.__data__,e.index,e.group),a())}function a(){for(var r in e.state=6,e.timer.stop(),delete i[n],i)return;delete t.__transition}i[n]=e,e.timer=qt((function(t){e.state=1,e.timer.restart(o,e.delay,e.time),e.delay<=t&&o(t-e.delay)}),0,e.time)}(t,e,{name:n,index:r,group:i,on:Rt,tween:Bt,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})}function Ht(t,n){var e=Gt(t,n);if(e.state>0)throw new Error("too late; already scheduled");return e}function $t(t,n){var e=Gt(t,n);if(e.state>3)throw new Error("too late; already running");return e}function Gt(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function Ft(t,n){var e,r,i,o=t.__transition,u=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>2&&e.state<5,e.state=6,e.timer.stop(),e.on.call(r?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete o[i]):u=!1;u&&delete t.__transition}}function Kt(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function Qt(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function Wt(){}var Jt="\\s*([+-]?\\d+)\\s*",Zt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",tn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",nn=/^#([0-9a-f]{3,8})$/,en=new RegExp("^rgb\\("+[Jt,Jt,Jt]+"\\)$"),rn=new RegExp("^rgb\\("+[tn,tn,tn]+"\\)$"),on=new RegExp("^rgba\\("+[Jt,Jt,Jt,Zt]+"\\)$"),un=new RegExp("^rgba\\("+[tn,tn,tn,Zt]+"\\)$"),an=new RegExp("^hsl\\("+[Zt,tn,tn]+"\\)$"),sn=new RegExp("^hsla\\("+[Zt,tn,tn,Zt]+"\\)$"),ln={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function cn(){return this.rgb().formatHex()}function hn(){return this.rgb().formatRgb()}function fn(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=nn.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?pn(n):3===e?new yn(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?new yn(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?new yn(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=en.exec(t))?new yn(n[1],n[2],n[3],1):(n=rn.exec(t))?new yn(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=on.exec(t))?dn(n[1],n[2],n[3],n[4]):(n=un.exec(t))?dn(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=an.exec(t))?bn(n[1],n[2]/100,n[3]/100,1):(n=sn.exec(t))?bn(n[1],n[2]/100,n[3]/100,n[4]):ln.hasOwnProperty(t)?pn(ln[t]):"transparent"===t?new yn(NaN,NaN,NaN,0):null}function pn(t){return new yn(t>>16&255,t>>8&255,255&t,1)}function dn(t,n,e,r){return r<=0&&(t=n=e=NaN),new yn(t,n,e,r)}function mn(t){return t instanceof Wt||(t=fn(t)),t?new yn((t=t.rgb()).r,t.g,t.b,t.opacity):new yn}function vn(t,n,e,r){return 1===arguments.length?mn(t):new yn(t,n,e,null==r?1:r)}function yn(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function gn(){return"#"+wn(this.r)+wn(this.g)+wn(this.b)}function _n(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function wn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function bn(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new kn(t,n,e,r)}function xn(t){if(t instanceof kn)return new kn(t.h,t.s,t.l,t.opacity);if(t instanceof Wt||(t=fn(t)),!t)return new kn;if(t instanceof kn)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),u=NaN,a=o-i,s=(o+i)/2;return a?(u=n===o?(e-r)/a+6*(e<r):e===o?(r-n)/a+2:(n-e)/a+4,a/=s<.5?o+i:2-o-i,u*=60):a=s>0&&s<1?0:u,new kn(u,a,s,t.opacity)}function kn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function En(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}function zn(t){return function(){return t}}function Mn(t){return 1==(t=+t)?An:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):zn(isNaN(n)?e:n)}}function An(t,n){var e=n-t;return e?function(t,n){return function(e){return t+e*n}}(t,e):zn(isNaN(t)?n:t)}Kt(Wt,fn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:cn,formatHex:cn,formatHsl:function(){return xn(this).formatHsl()},formatRgb:hn,toString:hn}),Kt(yn,vn,Qt(Wt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new yn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new yn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:gn,formatHex:gn,formatRgb:_n,toString:_n})),Kt(kn,(function(t,n,e,r){return 1===arguments.length?xn(t):new kn(t,n,e,null==r?1:r)}),Qt(Wt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new kn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new kn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new yn(En(t>=240?t-240:t+120,i,r),En(t,i,r),En(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var Nn=function t(n){var e=Mn(n);function r(t,n){var r=e((t=vn(t)).r,(n=vn(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),u=An(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=o(n),t.opacity=u(n),t+""}}return r.gamma=t,r}(1);function Sn(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}var Tn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,On=new RegExp(Tn.source,"g");function Pn(t,n){var e,r,i,o=Tn.lastIndex=On.lastIndex=0,u=-1,a=[],s=[];for(t+="",n+="";(e=Tn.exec(t))&&(r=On.exec(n));)(i=r.index)>o&&(i=n.slice(o,i),a[u]?a[u]+=i:a[++u]=i),(e=e[0])===(r=r[0])?a[u]?a[u]+=r:a[++u]=r:(a[++u]=null,s.push({i:u,x:Sn(e,r)})),o=On.lastIndex;return o<n.length&&(i=n.slice(o),a[u]?a[u]+=i:a[++u]=i),a.length<2?s[0]?function(t){return function(n){return t(n)+""}}(s[0].x):function(t){return function(){return t}}(n):(n=s.length,function(t){for(var e,r=0;r<n;++r)a[(e=s[r]).i]=e.x(t);return a.join("")})}var Cn,jn,Xn,Yn,qn=180/Math.PI,Dn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Vn(t,n,e,r,i,o){var u,a,s;return(u=Math.sqrt(t*t+n*n))&&(t/=u,n/=u),(s=t*e+n*r)&&(e-=t*s,r-=n*s),(a=Math.sqrt(e*e+r*r))&&(e/=a,r/=a,s/=a),t*r<n*e&&(t=-t,n=-n,s=-s,u=-u),{translateX:i,translateY:o,rotate:Math.atan2(n,t)*qn,skewX:Math.atan(s)*qn,scaleX:u,scaleY:a}}function In(t,n,e,r){function i(t){return t.length?t.pop()+" ":""}return function(o,u){var a=[],s=[];return o=t(o),u=t(u),function(t,r,i,o,u,a){if(t!==i||r!==o){var s=u.push("translate(",null,n,null,e);a.push({i:s-4,x:Sn(t,i)},{i:s-2,x:Sn(r,o)})}else(i||o)&&u.push("translate("+i+n+o+e)}(o.translateX,o.translateY,u.translateX,u.translateY,a,s),function(t,n,e,o){t!==n?(t-n>180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:Sn(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,u.rotate,a,s),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:Sn(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,u.skewX,a,s),function(t,n,e,r,o,u){if(t!==e||n!==r){var a=o.push(i(o)+"scale(",null,",",null,")");u.push({i:a-4,x:Sn(t,e)},{i:a-2,x:Sn(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,u.scaleX,u.scaleY,a,s),o=u=null,function(t){for(var n,e=-1,r=s.length;++e<r;)a[(n=s[e]).i]=n.x(t);return a.join("")}}}var Un=In((function(t){return"none"===t?Dn:(Cn||(Cn=document.createElement("DIV"),jn=document.documentElement,Xn=document.defaultView),Cn.style.transform=t,t=Xn.getComputedStyle(jn.appendChild(Cn),null).getPropertyValue("transform"),jn.removeChild(Cn),Vn(+(t=t.slice(7,-1).split(","))[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),"px, ","px)","deg)"),Rn=In((function(t){return null==t?Dn:(Yn||(Yn=document.createElementNS("http://www.w3.org/2000/svg","g")),Yn.setAttribute("transform",t),(t=Yn.transform.baseVal.consolidate())?Vn((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):Dn)}),", ",")",")"),Bn=Math.SQRT2;function Ln(t){return((t=Math.exp(t))+1/t)/2}function Hn(t,n){var e,r,i=t[0],o=t[1],u=t[2],a=n[0],s=n[1],l=n[2],c=a-i,h=s-o,f=c*c+h*h;if(f<1e-12)r=Math.log(l/u)/Bn,e=function(t){return[i+t*c,o+t*h,u*Math.exp(Bn*t*r)]};else{var p=Math.sqrt(f),d=(l*l-u*u+4*f)/(2*u*2*p),m=(l*l-u*u-4*f)/(2*l*2*p),v=Math.log(Math.sqrt(d*d+1)-d),y=Math.log(Math.sqrt(m*m+1)-m);r=(y-v)/Bn,e=function(t){var n,e=t*r,a=Ln(v),s=u/(2*p)*(a*(n=Bn*e+v,((n=Math.exp(2*n))-1)/(n+1))-function(t){return((t=Math.exp(t))-1/t)/2}(v));return[i+s*c,o+s*h,u*a/Ln(Bn*e+v)]}}return e.duration=1e3*r,e}function $n(t,n){var e,r;return function(){var i=$t(this,t),o=i.tween;if(o!==e)for(var u=0,a=(r=e=o).length;u<a;++u)if(r[u].name===n){(r=r.slice()).splice(u,1);break}i.tween=r}}function Gn(t,n,e){var r,i;if("function"!=typeof e)throw new Error;return function(){var o=$t(this,t),u=o.tween;if(u!==r){i=(r=u).slice();for(var a={name:n,value:e},s=0,l=i.length;s<l;++s)if(i[s].name===n){i[s]=a;break}s===l&&i.push(a)}o.tween=i}}function Fn(t,n,e){var r=t._id;return t.each((function(){var t=$t(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)})),function(t){return Gt(t,r).value[n]}}function Kn(t,n){var e;return("number"==typeof n?Sn:n instanceof fn?Nn:(e=fn(n))?(n=e,Nn):Pn)(t,n)}function Qn(t){return function(){this.removeAttribute(t)}}function Wn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Jn(t,n,e){var r,i,o=e+"";return function(){var u=this.getAttribute(t);return u===o?null:u===r?i:i=n(r=u,e)}}function Zn(t,n,e){var r,i,o=e+"";return function(){var u=this.getAttributeNS(t.space,t.local);return u===o?null:u===r?i:i=n(r=u,e)}}function te(t,n,e){var r,i,o;return function(){var u,a,s=e(this);if(null!=s)return(u=this.getAttribute(t))===(a=s+"")?null:u===r&&a===i?o:(i=a,o=n(r=u,s));this.removeAttribute(t)}}function ne(t,n,e){var r,i,o;return function(){var u,a,s=e(this);if(null!=s)return(u=this.getAttributeNS(t.space,t.local))===(a=s+"")?null:u===r&&a===i?o:(i=a,o=n(r=u,s));this.removeAttributeNS(t.space,t.local)}}function ee(t,n){return function(e){this.setAttribute(t,n.call(this,e))}}function re(t,n){return function(e){this.setAttributeNS(t.space,t.local,n.call(this,e))}}function ie(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&re(t,i)),e}return i._value=n,i}function oe(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&ee(t,i)),e}return i._value=n,i}function ue(t,n){return function(){Ht(this,t).delay=+n.apply(this,arguments)}}function ae(t,n){return n=+n,function(){Ht(this,t).delay=n}}function se(t,n){return function(){$t(this,t).duration=+n.apply(this,arguments)}}function le(t,n){return n=+n,function(){$t(this,t).duration=n}}function ce(t,n){if("function"!=typeof n)throw new Error;return function(){$t(this,t).ease=n}}function he(t,n,e){var r,i,o=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?Ht:$t;return function(){var u=o(this,t),a=u.on;a!==r&&(i=(r=a).copy()).on(n,e),u.on=i}}var fe=ft.prototype.constructor;function pe(t){return function(){this.style.removeProperty(t)}}function de(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}function me(t,n,e){var r,i;function o(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&de(t,o,e)),r}return o._value=n,o}function ve(t){return function(n){this.textContent=t.call(this,n)}}function ye(t){var n,e;function r(){var r=t.apply(this,arguments);return r!==e&&(n=(e=r)&&ve(r)),n}return r._value=t,r}var ge=0;function _e(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function we(t){return ft().transition(t)}function be(){return++ge}var xe=ft.prototype;_e.prototype=we.prototype={constructor:_e,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=h(t));for(var r=this._groups,i=r.length,o=new Array(i),u=0;u<i;++u)for(var a,s,l=r[u],c=l.length,f=o[u]=new Array(c),p=0;p<c;++p)(a=l[p])&&(s=t.call(a,a.__data__,p,l))&&("__data__"in a&&(s.__data__=a.__data__),f[p]=s,Lt(f[p],n,e,p,f,Gt(a,e)));return new _e(o,this._parents,n,e)},selectAll:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=p(t));for(var r=this._groups,i=r.length,o=[],u=[],a=0;a<i;++a)for(var s,l=r[a],c=l.length,h=0;h<c;++h)if(s=l[h]){for(var f,d=t.call(s,s.__data__,h,l),m=Gt(s,e),v=0,y=d.length;v<y;++v)(f=d[v])&&Lt(f,n,e,v,d,m);o.push(d),u.push(s)}return new _e(o,u,n,e)},filter: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,u=n[i],a=u.length,s=r[i]=[],l=0;l<a;++l)(o=u[l])&&t.call(o,o.__data__,l,u)&&s.push(o);return new _e(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),u=new Array(r),a=0;a<o;++a)for(var s,l=n[a],c=e[a],h=l.length,f=u[a]=new Array(h),p=0;p<h;++p)(s=l[p]||c[p])&&(f[p]=s);for(;a<r;++a)u[a]=n[a];return new _e(u,this._parents,this._name,this._id)},selection:function(){return new fe(this._groups,this._parents)},transition:function(){for(var t=this._name,n=this._id,e=be(),r=this._groups,i=r.length,o=0;o<i;++o)for(var u,a=r[o],s=a.length,l=0;l<s;++l)if(u=a[l]){var c=Gt(u,n);Lt(u,t,e,l,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new _e(r,this._parents,t,e)},call:xe.call,nodes:xe.nodes,node:xe.node,size:xe.size,empty:xe.empty,each:xe.each,on:function(t,n){var e=this._id;return arguments.length<2?Gt(this.node(),e).on.on(t):this.each(he(e,t,n))},attr:function(t,n){var e=u(t),r="transform"===e?Rn:Kn;return this.attrTween(t,"function"==typeof n?(e.local?ne:te)(e,r,Fn(this,"attr."+t,n)):null==n?(e.local?Wn:Qn)(e):(e.local?Zn:Jn)(e,r,n))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=u(t);return this.tween(e,(r.local?ie:oe)(r,n))},style:function(t,n,e){var r="transform"==(t+="")?Un:Kn;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var o=T(this,t),u=(this.style.removeProperty(t),T(this,t));return o===u?null:o===e&&u===r?i:i=n(e=o,r=u)}}(t,r)).on("end.style."+t,pe(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var r,i,o;return function(){var u=T(this,t),a=e(this),s=a+"";return null==a&&(this.style.removeProperty(t),s=a=T(this,t)),u===s?null:u===r&&s===i?o:(i=s,o=n(r=u,a))}}(t,r,Fn(this,"style."+t,n))).each(function(t,n){var e,r,i,o,u="style."+n,a="end."+u;return function(){var s=$t(this,t),l=s.on,c=null==s.value[u]?o||(o=pe(n)):void 0;l===e&&i===c||(r=(e=l).copy()).on(a,i=c),s.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,i,o=e+"";return function(){var u=T(this,t);return u===o?null:u===r?i:i=n(r=u,e)}}(t,r,n),e).on("end.style."+t,null)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,me(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(Fn(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;return this.tween(n,ye(t))},remove:function(){return this.on("end.remove",function(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}(this._id))},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=Gt(this.node(),e).tween,o=0,u=i.length;o<u;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==n?$n:Gn)(e,t,n))},delay:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?ue:ae)(n,t)):Gt(this.node(),n).delay},duration:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?se:le)(n,t)):Gt(this.node(),n).duration},ease:function(t){var n=this._id;return arguments.length?this.each(ce(n,t)):Gt(this.node(),n).ease},end:function(){var t,n,e=this,r=e._id,i=e.size();return new Promise((function(o,u){var a={value:u},s={value:function(){0==--i&&o()}};e.each((function(){var e=$t(this,r),i=e.on;i!==t&&((n=(t=i).copy())._.cancel.push(a),n._.interrupt.push(a),n._.end.push(s)),e.on=n}))}))}};var ke={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Ee(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))return ke.time=jt(),ke;return e}function ze(){nt.preventDefault(),nt.stopImmediatePropagation()}function Me(t){var n=t.document.documentElement,e=pt(t).on("dragstart.drag",ze,!0);"onselectstart"in n?e.on("selectstart.drag",ze,!0):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function Ae(t,n){var e=t.document.documentElement,r=pt(t).on("dragstart.drag",null);n&&(r.on("click.drag",ze,!0),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in e?r.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}function Ne(t){return function(){return t}}function Se(t,n,e){this.target=t,this.type=n,this.transform=e}function Te(t,n,e){this.k=t,this.x=n,this.y=e}ft.prototype.interrupt=function(t){return this.each((function(){Ft(this,t)}))},ft.prototype.transition=function(t){var n,e;t instanceof _e?(n=t._id,t=t._name):(n=be(),(e=ke).time=jt(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var u,a=r[o],s=a.length,l=0;l<s;++l)(u=a[l])&&Lt(u,t,n,l,a,e||Ee(u,n));return new _e(r,this._parents,t,n)},Te.prototype={constructor:Te,scale:function(t){return 1===t?this:new Te(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new Te(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Oe=new Te(1,0,0);function Pe(){nt.stopImmediatePropagation()}function Ce(){nt.preventDefault(),nt.stopImmediatePropagation()}function je(){return!nt.ctrlKey&&!nt.button}function Xe(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function Ye(){return this.__zoom||Oe}function qe(){return-nt.deltaY*(1===nt.deltaMode?.05:nt.deltaMode?1:.002)}function De(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ve(t,n,e){var r=t.invertX(n[0][0])-e[0][0],i=t.invertX(n[1][0])-e[1][0],o=t.invertY(n[0][1])-e[0][1],u=t.invertY(n[1][1])-e[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),u>o?(o+u)/2:Math.min(0,o)||Math.max(0,u))}function Ie(){var t,n,e=je,r=Xe,i=Ve,o=qe,u=De,a=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,c=Hn,h=_t("start","zoom","end"),f=0;function p(t){t.property("__zoom",Ye).on("wheel.zoom",w).on("mousedown.zoom",b).on("dblclick.zoom",x).filter(u).on("touchstart.zoom",k).on("touchmove.zoom",E).on("touchend.zoom touchcancel.zoom",z).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(t,n){return(n=Math.max(a[0],Math.min(a[1],n)))===t.k?t:new Te(n,t.x,t.y)}function m(t,n,e){var r=n[0]-e[0]*t.k,i=n[1]-e[1]*t.k;return r===t.x&&i===t.y?t:new Te(t.k,r,i)}function v(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function y(t,n,e){t.on("start.zoom",(function(){g(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){g(this,arguments).end()})).tween("zoom",(function(){var t=this,i=arguments,o=g(t,i),u=r.apply(t,i),a=null==e?v(u):"function"==typeof e?e.apply(t,i):e,s=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),l=t.__zoom,h="function"==typeof n?n.apply(t,i):n,f=c(l.invert(a).concat(s/l.k),h.invert(a).concat(s/h.k));return function(t){if(1===t)t=h;else{var n=f(t),e=s/n[2];t=new Te(e,a[0]-n[0]*e,a[1]-n[1]*e)}o.zoom(null,t)}}))}function g(t,n,e){return!e&&t.__zooming||new _(t,n)}function _(t,n){this.that=t,this.args=n,this.active=0,this.extent=r.apply(t,n),this.taps=0}function w(){if(e.apply(this,arguments)){var t=g(this,arguments),n=this.__zoom,r=Math.max(a[0],Math.min(a[1],n.k*Math.pow(2,o.apply(this,arguments)))),u=vt(this);if(t.wheel)t.mouse[0][0]===u[0]&&t.mouse[0][1]===u[1]||(t.mouse[1]=n.invert(t.mouse[0]=u)),clearTimeout(t.wheel);else{if(n.k===r)return;t.mouse=[u,n.invert(u)],Ft(this),t.start()}Ce(),t.wheel=setTimeout(l,150),t.zoom("mouse",i(m(d(n,r),t.mouse[0],t.mouse[1]),t.extent,s))}function l(){t.wheel=null,t.end()}}function b(){if(!n&&e.apply(this,arguments)){var t=g(this,arguments,!0),r=pt(nt.view).on("mousemove.zoom",l,!0).on("mouseup.zoom",c,!0),o=vt(this),u=nt.clientX,a=nt.clientY;Me(nt.view),Pe(),t.mouse=[o,this.__zoom.invert(o)],Ft(this),t.start()}function l(){if(Ce(),!t.moved){var n=nt.clientX-u,e=nt.clientY-a;t.moved=n*n+e*e>f}t.zoom("mouse",i(m(t.that.__zoom,t.mouse[0]=vt(t.that),t.mouse[1]),t.extent,s))}function c(){r.on("mousemove.zoom mouseup.zoom",null),Ae(nt.view,t.moved),Ce(),t.end()}}function x(){if(e.apply(this,arguments)){var t=this.__zoom,n=vt(this),o=t.invert(n),u=t.k*(nt.shiftKey?.5:2),a=i(m(d(t,u),n,o),r.apply(this,arguments),s);Ce(),l>0?pt(this).transition().duration(l).call(y,a,n):pt(this).call(p.transform,a)}}function k(){if(e.apply(this,arguments)){var n,r,i,o,u=nt.touches,a=u.length,s=g(this,arguments,nt.changedTouches.length===a);for(Pe(),r=0;r<a;++r)o=[o=yt(this,u,(i=u[r]).identifier),this.__zoom.invert(o),i.identifier],s.touch0?s.touch1||s.touch0[2]===o[2]||(s.touch1=o,s.taps=0):(s.touch0=o,n=!0,s.taps=1+!!t);t&&(t=clearTimeout(t)),n&&(s.taps<2&&(t=setTimeout((function(){t=null}),500)),Ft(this),s.start())}}function E(){if(this.__zooming){var n,e,r,o,u=g(this,arguments),a=nt.changedTouches,l=a.length;for(Ce(),t&&(t=clearTimeout(t)),u.taps=0,n=0;n<l;++n)r=yt(this,a,(e=a[n]).identifier),u.touch0&&u.touch0[2]===e.identifier?u.touch0[0]=r:u.touch1&&u.touch1[2]===e.identifier&&(u.touch1[0]=r);if(e=u.that.__zoom,u.touch1){var c=u.touch0[0],h=u.touch0[1],f=u.touch1[0],p=u.touch1[1],v=(v=f[0]-c[0])*v+(v=f[1]-c[1])*v,y=(y=p[0]-h[0])*y+(y=p[1]-h[1])*y;e=d(e,Math.sqrt(v/y)),r=[(c[0]+f[0])/2,(c[1]+f[1])/2],o=[(h[0]+p[0])/2,(h[1]+p[1])/2]}else{if(!u.touch0)return;r=u.touch0[0],o=u.touch0[1]}u.zoom("touch",i(m(e,r,o),u.extent,s))}}function z(){if(this.__zooming){var t,e,r=g(this,arguments),i=nt.changedTouches,o=i.length;for(Pe(),n&&clearTimeout(n),n=setTimeout((function(){n=null}),500),t=0;t<o;++t)e=i[t],r.touch0&&r.touch0[2]===e.identifier?delete r.touch0:r.touch1&&r.touch1[2]===e.identifier&&delete r.touch1;if(r.touch1&&!r.touch0&&(r.touch0=r.touch1,delete r.touch1),r.touch0)r.touch0[1]=this.__zoom.invert(r.touch0[0]);else if(r.end(),2===r.taps){var u=pt(this).on("dblclick.zoom");u&&u.apply(this,arguments)}}}return p.transform=function(t,n,e){var r=t.selection?t.selection():t;r.property("__zoom",Ye),t!==r?y(t,n,e):r.interrupt().each((function(){g(this,arguments).start().zoom(null,"function"==typeof n?n.apply(this,arguments):n).end()}))},p.scaleBy=function(t,n,e){p.scaleTo(t,(function(){var t=this.__zoom.k,e="function"==typeof n?n.apply(this,arguments):n;return t*e}),e)},p.scaleTo=function(t,n,e){p.transform(t,(function(){var t=r.apply(this,arguments),o=this.__zoom,u=null==e?v(t):"function"==typeof e?e.apply(this,arguments):e,a=o.invert(u),l="function"==typeof n?n.apply(this,arguments):n;return i(m(d(o,l),u,a),t,s)}),e)},p.translateBy=function(t,n,e){p.transform(t,(function(){return i(this.__zoom.translate("function"==typeof n?n.apply(this,arguments):n,"function"==typeof e?e.apply(this,arguments):e),r.apply(this,arguments),s)}))},p.translateTo=function(t,n,e,o){p.transform(t,(function(){var t=r.apply(this,arguments),u=this.__zoom,a=null==o?v(t):"function"==typeof o?o.apply(this,arguments):o;return i(Oe.translate(a[0],a[1]).scale(u.k).translate("function"==typeof n?-n.apply(this,arguments):-n,"function"==typeof e?-e.apply(this,arguments):-e),t,s)}),o)},_.prototype={start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,n){return this.mouse&&"mouse"!==t&&(this.mouse[1]=n.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=n.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=n.invert(this.touch1[0])),this.that.__zoom=n,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){!function(t,n,e,r){var i=nt;t.sourceEvent=nt,nt=t;try{n.apply(e,r)}finally{nt=i}}(new Se(p,t,this.that.__zoom),h.apply,h,[t,this.that,this.args])}},p.wheelDelta=function(t){return arguments.length?(o="function"==typeof t?t:Ne(+t),p):o},p.filter=function(t){return arguments.length?(e="function"==typeof t?t:Ne(!!t),p):e},p.touchable=function(t){return arguments.length?(u="function"==typeof t?t:Ne(!!t),p):u},p.extent=function(t){return arguments.length?(r="function"==typeof t?t:Ne([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),p):r},p.scaleExtent=function(t){return arguments.length?(a[0]=+t[0],a[1]=+t[1],p):[a[0],a[1]]},p.translateExtent=function(t){return arguments.length?(s[0][0]=+t[0][0],s[1][0]=+t[1][0],s[0][1]=+t[0][1],s[1][1]=+t[1][1],p):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},p.constrain=function(t){return arguments.length?(i=t,p):i},p.duration=function(t){return arguments.length?(l=+t,p):l},p.interpolate=function(t){return arguments.length?(c=t,p):c},p.on=function(){var t=h.on.apply(h,arguments);return t===h?p:t},p.clickDistance=function(t){return arguments.length?(f=(t=+t)*t,p):Math.sqrt(f)},p}function Ue(t,n,e){var r,i,o,u,a;function s(){var l=Date.now()-u;l<n&&l>=0?r=setTimeout(s,n-l):(r=null,e||(a=t.apply(o,i),o=i=null))}null==n&&(n=100);var l=function(){o=this,i=arguments,u=Date.now();var l=e&&!r;return r||(r=setTimeout(s,n)),l&&(a=t.apply(o,i),o=i=null),a};return l.clear=function(){r&&(clearTimeout(r),r=null)},l.flush=function(){r&&(a=t.apply(o,i),o=i=null,clearTimeout(r),r=null)},l}Ue.debounce=Ue;var Re=Ue;function Be(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var e=[],r=!0,i=!1,o=void 0;try{for(var u,a=t[Symbol.iterator]();!(r=(u=a.next()).done)&&(e.push(u.value),!n||e.length!==n);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==a.return||a.return()}finally{if(i)throw o}}return e}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Le,He,$e,Ge,Fe,Ke,Qe,We,Je,Ze,tr,nr,er,rr,ir=function t(n,e){var r=e.default,i=void 0===r?null:r,o=e.triggerUpdate,u=void 0===o||o,a=e.onChange,s=void 0===a?function(t,n){}:a;!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.name=n,this.defaultVal=i,this.triggerUpdate=u,this.onChange=s};return He=(Le={props:{htmlEl:{onChange:function(n,e){e.htmlEls=(n?n instanceof Array?n:[n]:[]).map((function(n){return"object"===t(n)&&n.node&&"function"==typeof n.node?n:pt(n)}))},triggerUpdate:!1},svgEl:{onChange:function(n,e){e.svgEls=(n?n instanceof Array?n:[n]:[]).map((function(n){return"object"===t(n)&&n.node&&"function"==typeof n.node?n:pt(n)}))},triggerUpdate:!1},canvasEl:{onChange:function(n,e){e.canvasCtxs=(n?n instanceof Array?n:[n]:[]).map((function(n){return"object"===t(n)&&n.node&&"function"==typeof n.node?n.node().getContext("2d"):n.getContext("2d")}))},triggerUpdate:!1},enableX:{default:!0,triggerUpdate:!1},enableY:{default:!0,triggerUpdate:!1},scaleExtent:{default:[1,1/0],onChange:function(t,n){t&&n.zoom.scaleExtent(t)},triggerUpdate:!1},translateExtent:{onChange:function(t,n){t&&n.zoom.translateExtent(t)},triggerUpdate:!1},onChange:{triggerUpdate:!1}},methods:{current:function(t){return r({},t.zoomTransform)},zoomBy:function(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return t.initialised&&(t.transitionDuration=e,t.el.call(t.zoom.scaleBy,n)),this},zoomReset:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.initialised&&(t.transitionDuration=n,t.el.call(t.zoom.transform,Oe)),this},zoomTo:function(t,n){var e=n.x,r=void 0===e?0:e,i=n.y,o=void 0===i?0:i,u=n.k,a=void 0===u?1:u,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return t.initialised&&(t.transitionDuration=s,t.el.call(t.zoom.transform,Oe.scale(a).translate(r,o))),this}},stateInit:function(){return{zoom:Ie().filter((function(){return!nt.button&&!nt.dblclick})),zoomTransform:{x:0,y:0,k:1}}},init:function(n,e){var i=!!n&&"object"===t(n)&&!!n.node&&"function"==typeof n.node;e.el=pt(i?n.node():n),e.el.call(e.zoom.on("zoom",(function(){var t=r({},nt.transform);!e.enableX&&(t.x=0),!e.enableY&&(t.y=0);var n=e.zoomTransform;e.zoomTransform=t;var i=e.transitionDuration||0;e.transitionDuration=0;var o=e.enableX?t.k:1,u=e.enableY?t.k:1;e.htmlEls.forEach((function(n){(i?n.transition().duration(i):n).style("transform","translate(".concat(t.x,"px, ").concat(t.y,"px) scale(").concat(o,", ").concat(u,")"))})),e.svgEls.forEach((function(n){(i?n.transition().duration(i):n).attr("transform","translate(".concat(t.x,", ").concat(t.y,") scale(").concat(o,", ").concat(u,")"))})),e.canvasCtxs.forEach((function(a,s){var l=function(t){var n=t.x,e=t.y,r=t.scX,i=t.scY;a.setTransform(r,0,0,i,n,e)};i?we().duration(i).tween("animate-ctx-".concat(s),(function(){var r=Sn(n.x,t.x),i=Sn(n.y,t.y),o=e.enableX?Sn(n.k,t.k):function(){return 1},u=e.enableY?Sn(n.k,t.k):function(){return 1};return function(t){return l({x:r(t),y:i(t),scX:o(t),scY:u(t)})}})):l(r({scX:o,scY:u},t))})),e.onChange&&e.onChange(t,n,i)}))),e.el.on("dblclick.zoom",null)}}).stateInit,$e=void 0===He?function(){return{}}:He,Ge=Le.props,Fe=void 0===Ge?{}:Ge,Ke=Le.methods,Qe=void 0===Ke?{}:Ke,We=Le.aliases,Je=void 0===We?{}:We,Ze=Le.init,tr=void 0===Ze?function(){}:Ze,nr=Le.update,er=void 0===nr?function(){}:nr,rr=Object.keys(Fe).map((function(t){return new ir(t,Fe[t])})),function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Object.assign({},$e instanceof Function?$e(t):$e,{initialised:!1}),e={};function r(n){return i(n,t),o(),r}var i=function(t,e){tr.call(r,t,n,e),n.initialised=!0},o=Re((function(){n.initialised&&(er.call(r,n,e),e={})}),1);return rr.forEach((function(t){r[t.name]=function(t){var i=t.name,u=t.triggerUpdate,a=void 0!==u&&u,s=t.onChange,l=void 0===s?function(t,n){}:s,c=t.defaultVal,h=void 0===c?null:c;return function(t){var u=n[i];if(!arguments.length)return u;var s=void 0===t?h:t;return n[i]=s,l.call(r,s,n,u),!e.hasOwnProperty(i)&&(e[i]=u),a&&o(),r}}(t)})),Object.keys(Qe).forEach((function(t){r[t]=function(){for(var e,i=arguments.length,o=new Array(i),u=0;u<i;u++)o[u]=arguments[u];return(e=Qe[t]).call.apply(e,[r,n].concat(o))}})),Object.entries(Je).forEach((function(t){var n=Be(t,2),e=n[0],i=n[1];return r[e]=r[i]})),r.resetProps=function(){return rr.forEach((function(t){r[t.name](t.defaultVal)})),r},r.resetProps(),n._rerender=o,r}})); | ||
// Version 1.1.4 d3-zoomable - https://github.com/vasturiano/d3-zoomable | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t="undefined"!=typeof globalThis?globalThis:t||self).zoomable=n()}(this,(function(){"use strict";function t(n){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(n)}function n(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function e(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function r(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?e(Object(i),!0).forEach((function(e){n(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))}))}return t}var i="http://www.w3.org/1999/xhtml",o={svg:"http://www.w3.org/2000/svg",xhtml:i,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function u(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),o.hasOwnProperty(n)?{space:o[n],local:t}:t}function a(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===i&&n.documentElement.namespaceURI===i?n.createElement(t):n.createElementNS(e,t)}}function s(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function l(t){var n=u(t);return(n.local?s:a)(n)}function c(){}function h(t){return null==t?c:function(){return this.querySelector(t)}}function f(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function p(){return[]}function d(t){return null==t?p:function(){return this.querySelectorAll(t)}}function v(t){return function(){return this.matches(t)}}function m(t){return function(n){return n.matches(t)}}var y=Array.prototype.find;function g(){return this.firstElementChild}var _=Array.prototype.filter;function w(){return this.children}function b(t){return new Array(t.length)}function x(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function k(t){return function(){return t}}function E(t,n,e,r,i,o){for(var u,a=0,s=n.length,l=o.length;a<l;++a)(u=n[a])?(u.__data__=o[a],r[a]=u):e[a]=new x(t,o[a]);for(;a<s;++a)(u=n[a])&&(i[a]=u)}function M(t,n,e,r,i,o,u){var a,s,l,c=new Map,h=n.length,f=o.length,p=new Array(h);for(a=0;a<h;++a)(s=n[a])&&(p[a]=l=u.call(s,s.__data__,a,n)+"",c.has(l)?i[a]=s:c.set(l,s));for(a=0;a<f;++a)l=u.call(t,o[a],a,o)+"",(s=c.get(l))?(r[a]=s,s.__data__=o[a],c.delete(l)):e[a]=new x(t,o[a]);for(a=0;a<h;++a)(s=n[a])&&c.get(p[a])===s&&(i[a]=s)}function z(t){return t.__data__}function A(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function N(t){return function(){this.removeAttribute(t)}}function S(t){return function(){this.removeAttributeNS(t.space,t.local)}}function T(t,n){return function(){this.setAttribute(t,n)}}function O(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function C(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function P(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 X(t){return function(){this.style.removeProperty(t)}}function Y(t,n,e){return function(){this.style.setProperty(t,n,e)}}function D(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function q(t,n){return t.style.getPropertyValue(n)||j(t).getComputedStyle(t,null).getPropertyValue(n)}function R(t){return function(){delete this[t]}}function I(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 V(t){return t.trim().split(/^|\s+/)}function B(t){return t.classList||new L(t)}function L(t){this._node=t,this._names=V(t.getAttribute("class")||"")}function H(t,n){for(var e=B(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function $(t,n){for(var e=B(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function G(t){return function(){H(this,t)}}function K(t){return function(){$(this,t)}}function F(t,n){return function(){(n.apply(this,arguments)?H:$)(this,t)}}function Q(){this.textContent=""}function W(t){return function(){this.textContent=t}}function J(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function Z(){this.innerHTML=""}function tt(t){return function(){this.innerHTML=t}}function nt(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function et(){this.nextSibling&&this.parentNode.appendChild(this)}function rt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function it(){return null}function ot(){var t=this.parentNode;t&&t.removeChild(this)}function ut(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function at(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function st(t){return t.trim().split(/^|\s+/).map((function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}function lt(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r<o;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.options);++i?n.length=i:delete this.__on}}}function ct(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 u=0,a=i.length;u<a;++u)if((r=i[u]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=e),void(r.value=n);this.addEventListener(t.type,o,e),r={type:t.type,name:t.name,value:n,listener:o,options:e},i?i.push(r):this.__on=[r]}}function ht(t,n,e){var r=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 ft(t,n){return function(){return ht(this,t,n)}}function pt(t,n){return function(){return ht(this,t,n.apply(this,arguments))}}x.prototype={constructor:x,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)}},L.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 dt=[null];function vt(t,n){this._groups=t,this._parents=n}function mt(){return new vt([[document.documentElement]],dt)}function yt(t){return"string"==typeof t?new vt([[document.querySelector(t)]],[document.documentElement]):new vt([[t]],dt)}function gt(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]}vt.prototype=mt.prototype={constructor:vt,select:function(t){"function"!=typeof t&&(t=h(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u,a=n[i],s=a.length,l=r[i]=new Array(s),c=0;c<s;++c)(o=a[c])&&(u=t.call(o,o.__data__,c,a))&&("__data__"in o&&(u.__data__=o.__data__),l[c]=u);return new vt(r,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){var n=t.apply(this,arguments);return null==n?[]:f(n)}}(t):d(t);for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var u,a=n[o],s=a.length,l=0;l<s;++l)(u=a[l])&&(r.push(t.call(u,u.__data__,l,a)),i.push(u));return new vt(r,i)},selectChild:function(t){return this.select(null==t?g:function(t){return function(){return y.call(this.children,t)}}("function"==typeof t?t:m(t)))},selectChildren:function(t){return this.selectAll(null==t?w:function(t){return function(){return _.call(this.children,t)}}("function"==typeof t?t:m(t)))},filter:function(t){"function"!=typeof t&&(t=v(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u=n[i],a=u.length,s=r[i]=[],l=0;l<a;++l)(o=u[l])&&t.call(o,o.__data__,l,u)&&s.push(o);return new vt(r,this._parents)},data:function(t,n){if(!arguments.length)return Array.from(this,z);var e=n?M:E,r=this._parents,i=this._groups;"function"!=typeof t&&(t=k(t));for(var o=i.length,u=new Array(o),a=new Array(o),s=new Array(o),l=0;l<o;++l){var c=r[l],h=i[l],p=h.length,d=f(t.call(c,c&&c.__data__,l,r)),v=d.length,m=a[l]=new Array(v),y=u[l]=new Array(v),g=s[l]=new Array(p);e(c,h,m,y,g,d,n);for(var _,w,b=0,x=0;b<v;++b)if(_=m[b]){for(b>=x&&(x=b+1);!(w=y[x])&&++x<v;);_._next=w||null}}return(u=new vt(u,r))._enter=a,u._exit=s,u},enter:function(){return new vt(this._enter||this._groups.map(b),this._parents)},exit:function(){return new vt(this._exit||this._groups.map(b),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,o=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=n&&(i=n(i)),null==e?o.remove():e(o),r&&i?r.merge(i).order():i},merge:function(t){if(!(t instanceof vt))throw new Error("invalid merge");for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),u=new Array(r),a=0;a<o;++a)for(var s,l=n[a],c=e[a],h=l.length,f=u[a]=new Array(h),p=0;p<h;++p)(s=l[p]||c[p])&&(f[p]=s);for(;a<r;++a)u[a]=n[a];return new vt(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,u=i[o];--o>=0;)(r=i[o])&&(u&&4^r.compareDocumentPosition(u)&&u.parentNode.insertBefore(r,u),u=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=A);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var u,a=e[o],s=a.length,l=i[o]=new Array(s),c=0;c<s;++c)(u=a[c])&&(l[c]=u);l.sort(n)}return new vt(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var u=r[i];if(u)return u}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],u=0,a=o.length;u<a;++u)(i=o[u])&&t.call(i,i.__data__,u,o);return this},attr:function(t,n){var e=u(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?S:N:"function"==typeof n?e.local?P:C:e.local?O:T)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?X:"function"==typeof n?D:Y)(t,n,null==e?"":e)):q(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?R:"function"==typeof n?U:I)(t,n)):this.node()[t]},classed:function(t,n){var e=V(t+"");if(arguments.length<2){for(var r=B(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?F:n?G:K)(e,n))},text:function(t){return arguments.length?this.each(null==t?Q:("function"==typeof t?J:W)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?Z:("function"==typeof t?nt:tt)(t)):this.node().innerHTML},raise:function(){return this.each(et)},lower:function(){return this.each(rt)},append:function(t){var n="function"==typeof t?t:l(t);return this.select((function(){return this.appendChild(n.apply(this,arguments))}))},insert:function(t,n){var e="function"==typeof t?t:l(t),r=null==n?it:"function"==typeof n?n:h(n);return this.select((function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(ot)},clone:function(t){return this.select(t?at:ut)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=st(t+""),u=o.length;if(!(arguments.length<2)){for(a=n?ct:lt,r=0;r<u;++r)this.each(a(o[r],n,e));return this}var a=this.node().__on;if(a)for(var s,l=0,c=a.length;l<c;++l)for(r=0,s=a[l];r<u;++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?pt:ft)(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,u=i.length;o<u;++o)(r=i[o])&&(yield r)}};var _t={value:()=>{}};function wt(){for(var t,n=0,e=arguments.length,r={};n<e;++n){if(!(t=arguments[n]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new bt(r)}function bt(t){this._=t}function xt(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 kt(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function Et(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=_t,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}bt.prototype=wt.prototype={constructor:bt,on:function(t,n){var e,r=this._,i=xt(t+"",r),o=-1,u=i.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++o<u;)if(e=(t=i[o]).type)r[e]=Et(r[e],t.name,n);else if(null==n)for(e in r)r[e]=Et(r[e],t.name,null);return this}for(;++o<u;)if((e=(t=i[o]).type)&&(e=kt(r[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new bt(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 Mt,zt,At=0,Nt=0,St=0,Tt=0,Ot=0,Ct=0,Pt="object"==typeof performance&&performance.now?performance:Date,jt="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Xt(){return Ot||(jt(Yt),Ot=Pt.now()+Ct)}function Yt(){Ot=0}function Dt(){this._call=this._time=this._next=null}function qt(t,n,e){var r=new Dt;return r.restart(t,n,e),r}function Rt(){Ot=(Tt=Pt.now())+Ct,At=Nt=0;try{!function(){Xt(),++At;for(var t,n=Mt;n;)(t=Ot-n._time)>=0&&n._call.call(null,t),n=n._next;--At}()}finally{At=0,function(){var t,n,e=Mt,r=1/0;for(;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Mt=n);zt=t,Ut(r)}(),Ot=0}}function It(){var t=Pt.now(),n=t-Tt;n>1e3&&(Ct-=n,Tt=t)}function Ut(t){At||(Nt&&(Nt=clearTimeout(Nt)),t-Ot>24?(t<1/0&&(Nt=setTimeout(Rt,t-Pt.now()-Ct)),St&&(St=clearInterval(St))):(St||(Tt=Pt.now(),St=setInterval(It,1e3)),At=1,jt(Rt)))}function Vt(t,n,e){var r=new Dt;return n=null==n?0:+n,r.restart((e=>{r.stop(),t(e+n)}),n,e),r}Dt.prototype=qt.prototype={constructor:Dt,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?Xt():+e)+(null==n?0:+n),this._next||zt===this||(zt?zt._next=this:Mt=this,zt=this),this._call=t,this._time=e,Ut()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ut())}};var Bt=wt("start","end","cancel","interrupt"),Lt=[];function Ht(t,n,e,r,i,o){var u=t.__transition;if(u){if(e in u)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(t){e.state=1,e.timer.restart(u,e.delay,e.time),e.delay<=t&&u(t-e.delay)}function u(o){var l,c,h,f;if(1!==e.state)return s();for(l in i)if((f=i[l]).name===e.name){if(3===f.state)return Vt(u);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[l]):+l<n&&(f.state=6,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete i[l])}if(Vt((function(){3===e.state&&(e.state=4,e.timer.restart(a,e.delay,e.time),a(o))})),e.state=2,e.on.call("start",t,t.__data__,e.index,e.group),2===e.state){for(e.state=3,r=new Array(h=e.tween.length),l=0,c=-1;l<h;++l)(f=e.tween[l].value.call(t,t.__data__,e.index,e.group))&&(r[++c]=f);r.length=c+1}}function a(n){for(var i=n<e.duration?e.ease.call(null,n/e.duration):(e.timer.restart(s),e.state=5,1),o=-1,u=r.length;++o<u;)r[o].call(t,i);5===e.state&&(e.on.call("end",t,t.__data__,e.index,e.group),s())}function s(){for(var r in e.state=6,e.timer.stop(),delete i[n],i)return;delete t.__transition}i[n]=e,e.timer=qt(o,0,e.time)}(t,e,{name:n,index:r,group:i,on:Bt,tween:Lt,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})}function $t(t,n){var e=Kt(t,n);if(e.state>0)throw new Error("too late; already scheduled");return e}function Gt(t,n){var e=Kt(t,n);if(e.state>3)throw new Error("too late; already running");return e}function Kt(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function Ft(t,n){var e,r,i,o=t.__transition,u=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>2&&e.state<5,e.state=6,e.timer.stop(),e.on.call(r?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete o[i]):u=!1;u&&delete t.__transition}}function Qt(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function Wt(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function Jt(){}var Zt=.7,tn=1/Zt,nn="\\s*([+-]?\\d+)\\s*",en="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",rn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",on=/^#([0-9a-f]{3,8})$/,un=new RegExp("^rgb\\("+[nn,nn,nn]+"\\)$"),an=new RegExp("^rgb\\("+[rn,rn,rn]+"\\)$"),sn=new RegExp("^rgba\\("+[nn,nn,nn,en]+"\\)$"),ln=new RegExp("^rgba\\("+[rn,rn,rn,en]+"\\)$"),cn=new RegExp("^hsl\\("+[en,rn,rn]+"\\)$"),hn=new RegExp("^hsla\\("+[en,rn,rn,en]+"\\)$"),fn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function pn(){return this.rgb().formatHex()}function dn(){return this.rgb().formatRgb()}function vn(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=on.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?mn(n):3===e?new wn(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?yn(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?yn(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=un.exec(t))?new wn(n[1],n[2],n[3],1):(n=an.exec(t))?new wn(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=sn.exec(t))?yn(n[1],n[2],n[3],n[4]):(n=ln.exec(t))?yn(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=cn.exec(t))?En(n[1],n[2]/100,n[3]/100,1):(n=hn.exec(t))?En(n[1],n[2]/100,n[3]/100,n[4]):fn.hasOwnProperty(t)?mn(fn[t]):"transparent"===t?new wn(NaN,NaN,NaN,0):null}function mn(t){return new wn(t>>16&255,t>>8&255,255&t,1)}function yn(t,n,e,r){return r<=0&&(t=n=e=NaN),new wn(t,n,e,r)}function gn(t){return t instanceof Jt||(t=vn(t)),t?new wn((t=t.rgb()).r,t.g,t.b,t.opacity):new wn}function _n(t,n,e,r){return 1===arguments.length?gn(t):new wn(t,n,e,null==r?1:r)}function wn(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function bn(){return"#"+kn(this.r)+kn(this.g)+kn(this.b)}function xn(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function kn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function En(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new zn(t,n,e,r)}function Mn(t){if(t instanceof zn)return new zn(t.h,t.s,t.l,t.opacity);if(t instanceof Jt||(t=vn(t)),!t)return new zn;if(t instanceof zn)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),u=NaN,a=o-i,s=(o+i)/2;return a?(u=n===o?(e-r)/a+6*(e<r):e===o?(r-n)/a+2:(n-e)/a+4,a/=s<.5?o+i:2-o-i,u*=60):a=s>0&&s<1?0:u,new zn(u,a,s,t.opacity)}function zn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function An(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}Qt(Jt,vn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:pn,formatHex:pn,formatHsl:function(){return Mn(this).formatHsl()},formatRgb:dn,toString:dn}),Qt(wn,_n,Wt(Jt,{brighter:function(t){return t=null==t?tn:Math.pow(tn,t),new wn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?Zt:Math.pow(Zt,t),new wn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:bn,formatHex:bn,formatRgb:xn,toString:xn})),Qt(zn,(function(t,n,e,r){return 1===arguments.length?Mn(t):new zn(t,n,e,null==r?1:r)}),Wt(Jt,{brighter:function(t){return t=null==t?tn:Math.pow(tn,t),new zn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?Zt:Math.pow(Zt,t),new zn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new wn(An(t>=240?t-240:t+120,i,r),An(t,i,r),An(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var Nn=t=>()=>t;function Sn(t){return 1==(t=+t)?Tn:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):Nn(isNaN(n)?e:n)}}function Tn(t,n){var e=n-t;return e?function(t,n){return function(e){return t+e*n}}(t,e):Nn(isNaN(t)?n:t)}var On=function t(n){var e=Sn(n);function r(t,n){var r=e((t=_n(t)).r,(n=_n(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),u=Tn(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=o(n),t.opacity=u(n),t+""}}return r.gamma=t,r}(1);function Cn(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}var Pn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,jn=new RegExp(Pn.source,"g");function Xn(t,n){var e,r,i,o=Pn.lastIndex=jn.lastIndex=0,u=-1,a=[],s=[];for(t+="",n+="";(e=Pn.exec(t))&&(r=jn.exec(n));)(i=r.index)>o&&(i=n.slice(o,i),a[u]?a[u]+=i:a[++u]=i),(e=e[0])===(r=r[0])?a[u]?a[u]+=r:a[++u]=r:(a[++u]=null,s.push({i:u,x:Cn(e,r)})),o=jn.lastIndex;return o<n.length&&(i=n.slice(o),a[u]?a[u]+=i:a[++u]=i),a.length<2?s[0]?function(t){return function(n){return t(n)+""}}(s[0].x):function(t){return function(){return t}}(n):(n=s.length,function(t){for(var e,r=0;r<n;++r)a[(e=s[r]).i]=e.x(t);return a.join("")})}var Yn,Dn=180/Math.PI,qn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Rn(t,n,e,r,i,o){var u,a,s;return(u=Math.sqrt(t*t+n*n))&&(t/=u,n/=u),(s=t*e+n*r)&&(e-=t*s,r-=n*s),(a=Math.sqrt(e*e+r*r))&&(e/=a,r/=a,s/=a),t*r<n*e&&(t=-t,n=-n,s=-s,u=-u),{translateX:i,translateY:o,rotate:Math.atan2(n,t)*Dn,skewX:Math.atan(s)*Dn,scaleX:u,scaleY:a}}function In(t,n,e,r){function i(t){return t.length?t.pop()+" ":""}return function(o,u){var a=[],s=[];return o=t(o),u=t(u),function(t,r,i,o,u,a){if(t!==i||r!==o){var s=u.push("translate(",null,n,null,e);a.push({i:s-4,x:Cn(t,i)},{i:s-2,x:Cn(r,o)})}else(i||o)&&u.push("translate("+i+n+o+e)}(o.translateX,o.translateY,u.translateX,u.translateY,a,s),function(t,n,e,o){t!==n?(t-n>180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:Cn(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,u.rotate,a,s),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:Cn(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,u.skewX,a,s),function(t,n,e,r,o,u){if(t!==e||n!==r){var a=o.push(i(o)+"scale(",null,",",null,")");u.push({i:a-4,x:Cn(t,e)},{i:a-2,x:Cn(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,u.scaleX,u.scaleY,a,s),o=u=null,function(t){for(var n,e=-1,r=s.length;++e<r;)a[(n=s[e]).i]=n.x(t);return a.join("")}}}var Un=In((function(t){const n=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return n.isIdentity?qn:Rn(n.a,n.b,n.c,n.d,n.e,n.f)}),"px, ","px)","deg)"),Vn=In((function(t){return null==t?qn:(Yn||(Yn=document.createElementNS("http://www.w3.org/2000/svg","g")),Yn.setAttribute("transform",t),(t=Yn.transform.baseVal.consolidate())?Rn((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):qn)}),", ",")",")");function Bn(t){return((t=Math.exp(t))+1/t)/2}var Ln=function t(n,e,r){function i(t,i){var o,u,a=t[0],s=t[1],l=t[2],c=i[0],h=i[1],f=i[2],p=c-a,d=h-s,v=p*p+d*d;if(v<1e-12)u=Math.log(f/l)/n,o=function(t){return[a+t*p,s+t*d,l*Math.exp(n*t*u)]};else{var m=Math.sqrt(v),y=(f*f-l*l+r*v)/(2*l*e*m),g=(f*f-l*l-r*v)/(2*f*e*m),_=Math.log(Math.sqrt(y*y+1)-y),w=Math.log(Math.sqrt(g*g+1)-g);u=(w-_)/n,o=function(t){var r,i=t*u,o=Bn(_),c=l/(e*m)*(o*(r=n*i+_,((r=Math.exp(2*r))-1)/(r+1))-function(t){return((t=Math.exp(t))-1/t)/2}(_));return[a+c*p,s+c*d,l*o/Bn(n*i+_)]}}return o.duration=1e3*u*n/Math.SQRT2,o}return i.rho=function(n){var e=Math.max(.001,+n),r=e*e;return t(e,r,r*r)},i}(Math.SQRT2,2,4);function Hn(t,n){var e,r;return function(){var i=Gt(this,t),o=i.tween;if(o!==e)for(var u=0,a=(r=e=o).length;u<a;++u)if(r[u].name===n){(r=r.slice()).splice(u,1);break}i.tween=r}}function $n(t,n,e){var r,i;if("function"!=typeof e)throw new Error;return function(){var o=Gt(this,t),u=o.tween;if(u!==r){i=(r=u).slice();for(var a={name:n,value:e},s=0,l=i.length;s<l;++s)if(i[s].name===n){i[s]=a;break}s===l&&i.push(a)}o.tween=i}}function Gn(t,n,e){var r=t._id;return t.each((function(){var t=Gt(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)})),function(t){return Kt(t,r).value[n]}}function Kn(t,n){var e;return("number"==typeof n?Cn:n instanceof vn?On:(e=vn(n))?(n=e,On):Xn)(t,n)}function Fn(t){return function(){this.removeAttribute(t)}}function Qn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Wn(t,n,e){var r,i,o=e+"";return function(){var u=this.getAttribute(t);return u===o?null:u===r?i:i=n(r=u,e)}}function Jn(t,n,e){var r,i,o=e+"";return function(){var u=this.getAttributeNS(t.space,t.local);return u===o?null:u===r?i:i=n(r=u,e)}}function Zn(t,n,e){var r,i,o;return function(){var u,a,s=e(this);if(null!=s)return(u=this.getAttribute(t))===(a=s+"")?null:u===r&&a===i?o:(i=a,o=n(r=u,s));this.removeAttribute(t)}}function te(t,n,e){var r,i,o;return function(){var u,a,s=e(this);if(null!=s)return(u=this.getAttributeNS(t.space,t.local))===(a=s+"")?null:u===r&&a===i?o:(i=a,o=n(r=u,s));this.removeAttributeNS(t.space,t.local)}}function ne(t,n){return function(e){this.setAttribute(t,n.call(this,e))}}function ee(t,n){return function(e){this.setAttributeNS(t.space,t.local,n.call(this,e))}}function re(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&ee(t,i)),e}return i._value=n,i}function ie(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&ne(t,i)),e}return i._value=n,i}function oe(t,n){return function(){$t(this,t).delay=+n.apply(this,arguments)}}function ue(t,n){return n=+n,function(){$t(this,t).delay=n}}function ae(t,n){return function(){Gt(this,t).duration=+n.apply(this,arguments)}}function se(t,n){return n=+n,function(){Gt(this,t).duration=n}}function le(t,n){if("function"!=typeof n)throw new Error;return function(){Gt(this,t).ease=n}}function ce(t,n,e){var r,i,o=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?$t:Gt;return function(){var u=o(this,t),a=u.on;a!==r&&(i=(r=a).copy()).on(n,e),u.on=i}}var he=mt.prototype.constructor;function fe(t){return function(){this.style.removeProperty(t)}}function pe(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}function de(t,n,e){var r,i;function o(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&pe(t,o,e)),r}return o._value=n,o}function ve(t){return function(n){this.textContent=t.call(this,n)}}function me(t){var n,e;function r(){var r=t.apply(this,arguments);return r!==e&&(n=(e=r)&&ve(r)),n}return r._value=t,r}var ye=0;function ge(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function _e(t){return mt().transition(t)}function we(){return++ye}var be=mt.prototype;ge.prototype=_e.prototype={constructor:ge,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=h(t));for(var r=this._groups,i=r.length,o=new Array(i),u=0;u<i;++u)for(var a,s,l=r[u],c=l.length,f=o[u]=new Array(c),p=0;p<c;++p)(a=l[p])&&(s=t.call(a,a.__data__,p,l))&&("__data__"in a&&(s.__data__=a.__data__),f[p]=s,Ht(f[p],n,e,p,f,Kt(a,e)));return new ge(o,this._parents,n,e)},selectAll:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=d(t));for(var r=this._groups,i=r.length,o=[],u=[],a=0;a<i;++a)for(var s,l=r[a],c=l.length,h=0;h<c;++h)if(s=l[h]){for(var f,p=t.call(s,s.__data__,h,l),v=Kt(s,e),m=0,y=p.length;m<y;++m)(f=p[m])&&Ht(f,n,e,m,p,v);o.push(p),u.push(s)}return new ge(o,u,n,e)},filter:function(t){"function"!=typeof t&&(t=v(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u=n[i],a=u.length,s=r[i]=[],l=0;l<a;++l)(o=u[l])&&t.call(o,o.__data__,l,u)&&s.push(o);return new ge(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),u=new Array(r),a=0;a<o;++a)for(var s,l=n[a],c=e[a],h=l.length,f=u[a]=new Array(h),p=0;p<h;++p)(s=l[p]||c[p])&&(f[p]=s);for(;a<r;++a)u[a]=n[a];return new ge(u,this._parents,this._name,this._id)},selection:function(){return new he(this._groups,this._parents)},transition:function(){for(var t=this._name,n=this._id,e=we(),r=this._groups,i=r.length,o=0;o<i;++o)for(var u,a=r[o],s=a.length,l=0;l<s;++l)if(u=a[l]){var c=Kt(u,n);Ht(u,t,e,l,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new ge(r,this._parents,t,e)},call:be.call,nodes:be.nodes,node:be.node,size:be.size,empty:be.empty,each:be.each,on:function(t,n){var e=this._id;return arguments.length<2?Kt(this.node(),e).on.on(t):this.each(ce(e,t,n))},attr:function(t,n){var e=u(t),r="transform"===e?Vn:Kn;return this.attrTween(t,"function"==typeof n?(e.local?te:Zn)(e,r,Gn(this,"attr."+t,n)):null==n?(e.local?Qn:Fn)(e):(e.local?Jn:Wn)(e,r,n))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=u(t);return this.tween(e,(r.local?re:ie)(r,n))},style:function(t,n,e){var r="transform"==(t+="")?Un:Kn;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var o=q(this,t),u=(this.style.removeProperty(t),q(this,t));return o===u?null:o===e&&u===r?i:i=n(e=o,r=u)}}(t,r)).on("end.style."+t,fe(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var r,i,o;return function(){var u=q(this,t),a=e(this),s=a+"";return null==a&&(this.style.removeProperty(t),s=a=q(this,t)),u===s?null:u===r&&s===i?o:(i=s,o=n(r=u,a))}}(t,r,Gn(this,"style."+t,n))).each(function(t,n){var e,r,i,o,u="style."+n,a="end."+u;return function(){var s=Gt(this,t),l=s.on,c=null==s.value[u]?o||(o=fe(n)):void 0;l===e&&i===c||(r=(e=l).copy()).on(a,i=c),s.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,i,o=e+"";return function(){var u=q(this,t);return u===o?null:u===r?i:i=n(r=u,e)}}(t,r,n),e).on("end.style."+t,null)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,de(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(Gn(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;return this.tween(n,me(t))},remove:function(){return this.on("end.remove",function(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}(this._id))},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=Kt(this.node(),e).tween,o=0,u=i.length;o<u;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==n?Hn:$n)(e,t,n))},delay:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?oe:ue)(n,t)):Kt(this.node(),n).delay},duration:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?ae:se)(n,t)):Kt(this.node(),n).duration},ease:function(t){var n=this._id;return arguments.length?this.each(le(n,t)):Kt(this.node(),n).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,n){return function(){var e=n.apply(this,arguments);if("function"!=typeof e)throw new Error;Gt(this,t).ease=e}}(this._id,t))},end:function(){var t,n,e=this,r=e._id,i=e.size();return new Promise((function(o,u){var a={value:u},s={value:function(){0==--i&&o()}};e.each((function(){var e=Gt(this,r),i=e.on;i!==t&&((n=(t=i).copy())._.cancel.push(a),n._.interrupt.push(a),n._.end.push(s)),e.on=n})),0===i&&o()}))},[Symbol.iterator]:be[Symbol.iterator]};var xe={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function ke(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))throw new Error(`transition ${n} not found`);return e}function Ee(t){t.preventDefault(),t.stopImmediatePropagation()}function Me(t){var n=t.document.documentElement,e=yt(t).on("dragstart.drag",Ee,!0);"onselectstart"in n?e.on("selectstart.drag",Ee,!0):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function ze(t,n){var e=t.document.documentElement,r=yt(t).on("dragstart.drag",null);n&&(r.on("click.drag",Ee,!0),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in e?r.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}mt.prototype.interrupt=function(t){return this.each((function(){Ft(this,t)}))},mt.prototype.transition=function(t){var n,e;t instanceof ge?(n=t._id,t=t._name):(n=we(),(e=xe).time=Xt(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var u,a=r[o],s=a.length,l=0;l<s;++l)(u=a[l])&&Ht(u,t,n,l,a,e||ke(u,n));return new ge(r,this._parents,t,n)};var Ae=t=>()=>t;function Ne(t,{sourceEvent:n,target:e,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Se(t,n,e){this.k=t,this.x=n,this.y=e}Se.prototype={constructor:Se,scale:function(t){return 1===t?this:new Se(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new Se(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Te=new Se(1,0,0);function Oe(t){t.stopImmediatePropagation()}function Ce(t){t.preventDefault(),t.stopImmediatePropagation()}function Pe(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function je(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function Xe(){return this.__zoom||Te}function Ye(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function De(){return navigator.maxTouchPoints||"ontouchstart"in this}function qe(t,n,e){var r=t.invertX(n[0][0])-e[0][0],i=t.invertX(n[1][0])-e[1][0],o=t.invertY(n[0][1])-e[0][1],u=t.invertY(n[1][1])-e[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),u>o?(o+u)/2:Math.min(0,o)||Math.max(0,u))}function Re(){var t,n,e,r=Pe,i=je,o=qe,u=Ye,a=De,s=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,h=Ln,f=wt("start","zoom","end"),p=500,d=0,v=10;function m(t){t.property("__zoom",Xe).on("wheel.zoom",k).on("mousedown.zoom",E).on("dblclick.zoom",M).filter(a).on("touchstart.zoom",z).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(t,n){return(n=Math.max(s[0],Math.min(s[1],n)))===t.k?t:new Se(n,t.x,t.y)}function g(t,n,e){var r=n[0]-e[0]*t.k,i=n[1]-e[1]*t.k;return r===t.x&&i===t.y?t:new Se(t.k,r,i)}function _(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function w(t,n,e,r){t.on("start.zoom",(function(){b(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){b(this,arguments).event(r).end()})).tween("zoom",(function(){var t=this,o=arguments,u=b(t,o).event(r),a=i.apply(t,o),s=null==e?_(a):"function"==typeof e?e.apply(t,o):e,l=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),c=t.__zoom,f="function"==typeof n?n.apply(t,o):n,p=h(c.invert(s).concat(l/c.k),f.invert(s).concat(l/f.k));return function(t){if(1===t)t=f;else{var n=p(t),e=l/n[2];t=new Se(e,s[0]-n[0]*e,s[1]-n[1]*e)}u.zoom(null,t)}}))}function b(t,n,e){return!e&&t.__zooming||new x(t,n)}function x(t,n){this.that=t,this.args=n,this.active=0,this.sourceEvent=null,this.extent=i.apply(t,n),this.taps=0}function k(t,...n){if(r.apply(this,arguments)){var e=b(this,n).event(t),i=this.__zoom,a=Math.max(s[0],Math.min(s[1],i.k*Math.pow(2,u.apply(this,arguments)))),c=gt(t);if(e.wheel)e.mouse[0][0]===c[0]&&e.mouse[0][1]===c[1]||(e.mouse[1]=i.invert(e.mouse[0]=c)),clearTimeout(e.wheel);else{if(i.k===a)return;e.mouse=[c,i.invert(c)],Ft(this),e.start()}Ce(t),e.wheel=setTimeout(h,150),e.zoom("mouse",o(g(y(i,a),e.mouse[0],e.mouse[1]),e.extent,l))}function h(){e.wheel=null,e.end()}}function E(t,...n){if(!e&&r.apply(this,arguments)){var i=b(this,n,!0).event(t),u=yt(t.view).on("mousemove.zoom",f,!0).on("mouseup.zoom",p,!0),a=gt(t,s),s=t.currentTarget,c=t.clientX,h=t.clientY;Me(t.view),Oe(t),i.mouse=[a,this.__zoom.invert(a)],Ft(this),i.start()}function f(t){if(Ce(t),!i.moved){var n=t.clientX-c,e=t.clientY-h;i.moved=n*n+e*e>d}i.event(t).zoom("mouse",o(g(i.that.__zoom,i.mouse[0]=gt(t,s),i.mouse[1]),i.extent,l))}function p(t){u.on("mousemove.zoom mouseup.zoom",null),ze(t.view,i.moved),Ce(t),i.event(t).end()}}function M(t,...n){if(r.apply(this,arguments)){var e=this.__zoom,u=gt(t.changedTouches?t.changedTouches[0]:t,this),a=e.invert(u),s=e.k*(t.shiftKey?.5:2),h=o(g(y(e,s),u,a),i.apply(this,n),l);Ce(t),c>0?yt(this).transition().duration(c).call(w,h,u,t):yt(this).call(m.transform,h,u,t)}}function z(e,...i){if(r.apply(this,arguments)){var o,u,a,s,l=e.touches,c=l.length,h=b(this,i,e.changedTouches.length===c).event(e);for(Oe(e),u=0;u<c;++u)s=[s=gt(a=l[u],this),this.__zoom.invert(s),a.identifier],h.touch0?h.touch1||h.touch0[2]===s[2]||(h.touch1=s,h.taps=0):(h.touch0=s,o=!0,h.taps=1+!!t);t&&(t=clearTimeout(t)),o&&(h.taps<2&&(n=s[0],t=setTimeout((function(){t=null}),p)),Ft(this),h.start())}}function A(t,...n){if(this.__zooming){var e,r,i,u,a=b(this,n).event(t),s=t.changedTouches,c=s.length;for(Ce(t),e=0;e<c;++e)i=gt(r=s[e],this),a.touch0&&a.touch0[2]===r.identifier?a.touch0[0]=i:a.touch1&&a.touch1[2]===r.identifier&&(a.touch1[0]=i);if(r=a.that.__zoom,a.touch1){var h=a.touch0[0],f=a.touch0[1],p=a.touch1[0],d=a.touch1[1],v=(v=p[0]-h[0])*v+(v=p[1]-h[1])*v,m=(m=d[0]-f[0])*m+(m=d[1]-f[1])*m;r=y(r,Math.sqrt(v/m)),i=[(h[0]+p[0])/2,(h[1]+p[1])/2],u=[(f[0]+d[0])/2,(f[1]+d[1])/2]}else{if(!a.touch0)return;i=a.touch0[0],u=a.touch0[1]}a.zoom("touch",o(g(r,i,u),a.extent,l))}}function N(t,...r){if(this.__zooming){var i,o,u=b(this,r).event(t),a=t.changedTouches,s=a.length;for(Oe(t),e&&clearTimeout(e),e=setTimeout((function(){e=null}),p),i=0;i<s;++i)o=a[i],u.touch0&&u.touch0[2]===o.identifier?delete u.touch0:u.touch1&&u.touch1[2]===o.identifier&&delete u.touch1;if(u.touch1&&!u.touch0&&(u.touch0=u.touch1,delete u.touch1),u.touch0)u.touch0[1]=this.__zoom.invert(u.touch0[0]);else if(u.end(),2===u.taps&&(o=gt(o,this),Math.hypot(n[0]-o[0],n[1]-o[1])<v)){var l=yt(this).on("dblclick.zoom");l&&l.apply(this,arguments)}}}return m.transform=function(t,n,e,r){var i=t.selection?t.selection():t;i.property("__zoom",Xe),t!==i?w(t,n,e,r):i.interrupt().each((function(){b(this,arguments).event(r).start().zoom(null,"function"==typeof n?n.apply(this,arguments):n).end()}))},m.scaleBy=function(t,n,e,r){m.scaleTo(t,(function(){var t=this.__zoom.k,e="function"==typeof n?n.apply(this,arguments):n;return t*e}),e,r)},m.scaleTo=function(t,n,e,r){m.transform(t,(function(){var t=i.apply(this,arguments),r=this.__zoom,u=null==e?_(t):"function"==typeof e?e.apply(this,arguments):e,a=r.invert(u),s="function"==typeof n?n.apply(this,arguments):n;return o(g(y(r,s),u,a),t,l)}),e,r)},m.translateBy=function(t,n,e,r){m.transform(t,(function(){return o(this.__zoom.translate("function"==typeof n?n.apply(this,arguments):n,"function"==typeof e?e.apply(this,arguments):e),i.apply(this,arguments),l)}),null,r)},m.translateTo=function(t,n,e,r,u){m.transform(t,(function(){var t=i.apply(this,arguments),u=this.__zoom,a=null==r?_(t):"function"==typeof r?r.apply(this,arguments):r;return o(Te.translate(a[0],a[1]).scale(u.k).translate("function"==typeof n?-n.apply(this,arguments):-n,"function"==typeof e?-e.apply(this,arguments):-e),t,l)}),r,u)},x.prototype={event:function(t){return t&&(this.sourceEvent=t),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,n){return this.mouse&&"mouse"!==t&&(this.mouse[1]=n.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=n.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=n.invert(this.touch1[0])),this.that.__zoom=n,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){var n=yt(this.that).datum();f.call(t,this.that,new Ne(t,{sourceEvent:this.sourceEvent,target:m,type:t,transform:this.that.__zoom,dispatch:f}),n)}},m.wheelDelta=function(t){return arguments.length?(u="function"==typeof t?t:Ae(+t),m):u},m.filter=function(t){return arguments.length?(r="function"==typeof t?t:Ae(!!t),m):r},m.touchable=function(t){return arguments.length?(a="function"==typeof t?t:Ae(!!t),m):a},m.extent=function(t){return arguments.length?(i="function"==typeof t?t:Ae([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),m):i},m.scaleExtent=function(t){return arguments.length?(s[0]=+t[0],s[1]=+t[1],m):[s[0],s[1]]},m.translateExtent=function(t){return arguments.length?(l[0][0]=+t[0][0],l[1][0]=+t[1][0],l[0][1]=+t[0][1],l[1][1]=+t[1][1],m):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},m.constrain=function(t){return arguments.length?(o=t,m):o},m.duration=function(t){return arguments.length?(c=+t,m):c},m.interpolate=function(t){return arguments.length?(h=t,m):h},m.on=function(){var t=f.on.apply(f,arguments);return t===f?m:t},m.clickDistance=function(t){return arguments.length?(d=(t=+t)*t,m):Math.sqrt(d)},m.tapDistance=function(t){return arguments.length?(v=+t,m):v},m}function Ie(t,n,e){var r,i,o,u,a;function s(){var l=Date.now()-u;l<n&&l>=0?r=setTimeout(s,n-l):(r=null,e||(a=t.apply(o,i),o=i=null))}null==n&&(n=100);var l=function(){o=this,i=arguments,u=Date.now();var l=e&&!r;return r||(r=setTimeout(s,n)),l&&(a=t.apply(o,i),o=i=null),a};return l.clear=function(){r&&(clearTimeout(r),r=null)},l.flush=function(){r&&(a=t.apply(o,i),o=i=null,clearTimeout(r),r=null)},l}Ie.debounce=Ie;var Ue=Ie;function Ve(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){if(!(Symbol.iterator in Object(t))&&"[object Arguments]"!==Object.prototype.toString.call(t))return;var e=[],r=!0,i=!1,o=void 0;try{for(var u,a=t[Symbol.iterator]();!(r=(u=a.next()).done)&&(e.push(u.value),!n||e.length!==n);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==a.return||a.return()}finally{if(i)throw o}}return e}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Be,Le,He,$e,Ge,Ke,Fe,Qe,We,Je,Ze,tr,nr,er,rr=function t(n,e){var r=e.default,i=void 0===r?null:r,o=e.triggerUpdate,u=void 0===o||o,a=e.onChange,s=void 0===a?function(t,n){}:a;!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.name=n,this.defaultVal=i,this.triggerUpdate=u,this.onChange=s};return Le=(Be={props:{htmlEl:{onChange:function(n,e){e.htmlEls=(n?n instanceof Array?n:[n]:[]).map((function(n){return"object"===t(n)&&n.node&&"function"==typeof n.node?n:yt(n)}))},triggerUpdate:!1},svgEl:{onChange:function(n,e){e.svgEls=(n?n instanceof Array?n:[n]:[]).map((function(n){return"object"===t(n)&&n.node&&"function"==typeof n.node?n:yt(n)}))},triggerUpdate:!1},canvasEl:{onChange:function(n,e){e.canvasCtxs=(n?n instanceof Array?n:[n]:[]).map((function(n){return"object"===t(n)&&n.node&&"function"==typeof n.node?n.node().getContext("2d"):n.getContext("2d")}))},triggerUpdate:!1},enableX:{default:!0,triggerUpdate:!1},enableY:{default:!0,triggerUpdate:!1},scaleExtent:{default:[1,1/0],onChange:function(t,n){t&&n.zoom.scaleExtent(t)},triggerUpdate:!1},translateExtent:{onChange:function(t,n){t&&n.zoom.translateExtent(t)},triggerUpdate:!1},onChange:{triggerUpdate:!1}},methods:{current:function(t){return r({},t.zoomTransform)},zoomBy:function(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return t.initialised&&(t.transitionDuration=e,t.el.call(t.zoom.scaleBy,n)),this},zoomReset:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.initialised&&(t.transitionDuration=n,t.el.call(t.zoom.transform,Te)),this},zoomTo:function(t,n){var e=n.x,r=void 0===e?0:e,i=n.y,o=void 0===i?0:i,u=n.k,a=void 0===u?1:u,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return t.initialised&&(t.transitionDuration=s,t.el.call(t.zoom.transform,Te.scale(a).translate(r,o))),this}},stateInit:function(){return{zoom:Re().filter((function(t){return!t.button&&!t.dblclick})),zoomTransform:{x:0,y:0,k:1}}},init:function(n,e){var i=!!n&&"object"===t(n)&&!!n.node&&"function"==typeof n.node;e.el=yt(i?n.node():n),e.el.call(e.zoom.on("zoom",(function(t){var n=r({},t.transform);!e.enableX&&(n.x=0),!e.enableY&&(n.y=0);var i=e.zoomTransform;e.zoomTransform=n;var o=e.transitionDuration||0;e.transitionDuration=0;var u=e.enableX?n.k:1,a=e.enableY?n.k:1;e.htmlEls.forEach((function(t){(o?t.transition().duration(o):t).style("transform","translate(".concat(n.x,"px, ").concat(n.y,"px) scale(").concat(u,", ").concat(a,")"))})),e.svgEls.forEach((function(t){(o?t.transition().duration(o):t).attr("transform","translate(".concat(n.x,", ").concat(n.y,") scale(").concat(u,", ").concat(a,")"))})),e.canvasCtxs.forEach((function(t,s){var l=function(n){var e=n.x,r=n.y,i=n.scX,o=n.scY;t.setTransform(i,0,0,o,e,r)};o?_e().duration(o).tween("animate-ctx-".concat(s),(function(){var t=Cn(i.x,n.x),r=Cn(i.y,n.y),o=e.enableX?Cn(i.k,n.k):function(){return 1},u=e.enableY?Cn(i.k,n.k):function(){return 1};return function(n){return l({x:t(n),y:r(n),scX:o(n),scY:u(n)})}})):l(r({scX:u,scY:a},n))})),e.onChange&&e.onChange(n,i,o)}))),e.el.on("dblclick.zoom",null)}}).stateInit,He=void 0===Le?function(){return{}}:Le,$e=Be.props,Ge=void 0===$e?{}:$e,Ke=Be.methods,Fe=void 0===Ke?{}:Ke,Qe=Be.aliases,We=void 0===Qe?{}:Qe,Je=Be.init,Ze=void 0===Je?function(){}:Je,tr=Be.update,nr=void 0===tr?function(){}:tr,er=Object.keys(Ge).map((function(t){return new rr(t,Ge[t])})),function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Object.assign({},He instanceof Function?He(t):He,{initialised:!1}),e={};function r(n){return i(n,t),o(),r}var i=function(t,e){Ze.call(r,t,n,e),n.initialised=!0},o=Ue((function(){n.initialised&&(nr.call(r,n,e),e={})}),1);return er.forEach((function(t){r[t.name]=function(t){var i=t.name,u=t.triggerUpdate,a=void 0!==u&&u,s=t.onChange,l=void 0===s?function(t,n){}:s,c=t.defaultVal,h=void 0===c?null:c;return function(t){var u=n[i];if(!arguments.length)return u;var s=void 0===t?h:t;return n[i]=s,l.call(r,s,n,u),!e.hasOwnProperty(i)&&(e[i]=u),a&&o(),r}}(t)})),Object.keys(Fe).forEach((function(t){r[t]=function(){for(var e,i=arguments.length,o=new Array(i),u=0;u<i;u++)o[u]=arguments[u];return(e=Fe[t]).call.apply(e,[r,n].concat(o))}})),Object.entries(We).forEach((function(t){var n=Ve(t,2),e=n[0],i=n[1];return r[e]=r[i]})),r.resetProps=function(){return er.forEach((function(t){r[t.name](t.defaultVal)})),r},r.resetProps(),n._rerender=o,r}})); |
@@ -1,2 +0,2 @@ | ||
import { select, event } from 'd3-selection'; | ||
import { select } from 'd3-selection'; | ||
import { transition } from 'd3-transition'; | ||
@@ -169,4 +169,4 @@ import { interpolateNumber } from 'd3-interpolate'; | ||
return { | ||
zoom: zoom().filter(function () { | ||
return !event.button && !event.dblclick; | ||
zoom: zoom().filter(function (ev) { | ||
return !ev.button && !ev.dblclick; | ||
}), | ||
@@ -183,4 +183,4 @@ zoomTransform: { | ||
state.el = select(isD3Selection ? el.node() : el); | ||
state.el.call(state.zoom.on('zoom', function () { | ||
var tr = _objectSpread2({}, event.transform); | ||
state.el.call(state.zoom.on('zoom', function (ev) { | ||
var tr = _objectSpread2({}, ev.transform); | ||
@@ -187,0 +187,0 @@ !state.enableX && (tr.x = 0); |
{ | ||
"name": "d3-zoomable", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "Easy way to apply d3-zoom functionality to DOM elements", | ||
@@ -33,29 +33,24 @@ "license": "MIT", | ||
"build": "rimraf dist && rollup -c", | ||
"dev": "rollup -c -w", | ||
"minify": "terser dist/d3-zoomable.js -o dist/d3-zoomable.min.js -c -m --comments '/Version/'", | ||
"build-module": "rollup -c rollup.config.module.js", | ||
"prepare": "npm run build && npm run minify && npm run build-module" | ||
"dev": "rollup -w -c", | ||
"prepare": "npm run build" | ||
}, | ||
"dependencies": { | ||
"d3-interpolate": "^1.4.0", | ||
"d3-selection": "^1.4.1", | ||
"d3-transition": "^1.3.2", | ||
"d3-zoom": "^1.8.3", | ||
"kapsule": "^1.12.2" | ||
"d3-interpolate": "^2.0.1", | ||
"d3-selection": "^2.0.0", | ||
"d3-transition": "^2.0.0", | ||
"d3-zoom": "^2.0.0", | ||
"kapsule": "^1.13.3" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.8.7", | ||
"@babel/plugin-proposal-class-properties": "^7.8.3", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.8.3", | ||
"@babel/preset-env": "^7.8.7", | ||
"@rollup/plugin-commonjs": "^11.0.2", | ||
"@rollup/plugin-node-resolve": "^7.1.1", | ||
"postcss-nested": "^4.2.1", | ||
"postcss-simple-vars": "^5.0.2", | ||
"@babel/core": "^7.13.10", | ||
"@babel/plugin-proposal-class-properties": "^7.13.0", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.13.8", | ||
"@babel/preset-env": "^7.13.10", | ||
"@rollup/plugin-babel": "^5.3.0", | ||
"@rollup/plugin-commonjs": "^17.1.0", | ||
"@rollup/plugin-node-resolve": "^11.2.0", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.0.6", | ||
"rollup-plugin-babel": "^4.4.0", | ||
"rollup-plugin-postcss": "^2.4.1", | ||
"terser": "^4.6.6" | ||
"rollup": "^2.41.2", | ||
"rollup-plugin-terser": "^7.0.2" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
457033
10
3837
+ Addedd3-color@2.0.0(transitive)
+ Addedd3-dispatch@2.0.0(transitive)
+ Addedd3-drag@2.0.0(transitive)
+ Addedd3-ease@2.0.0(transitive)
+ Addedd3-interpolate@2.0.1(transitive)
+ Addedd3-selection@2.0.0(transitive)
+ Addedd3-timer@2.0.0(transitive)
+ Addedd3-transition@2.0.0(transitive)
+ Addedd3-zoom@2.0.0(transitive)
- Removedd3-color@1.4.1(transitive)
- Removedd3-dispatch@1.0.6(transitive)
- Removedd3-drag@1.2.5(transitive)
- Removedd3-ease@1.0.7(transitive)
- Removedd3-interpolate@1.4.0(transitive)
- Removedd3-selection@1.4.2(transitive)
- Removedd3-timer@1.0.10(transitive)
- Removedd3-transition@1.3.2(transitive)
- Removedd3-zoom@1.8.3(transitive)
Updatedd3-interpolate@^2.0.1
Updatedd3-selection@^2.0.0
Updatedd3-transition@^2.0.0
Updatedd3-zoom@^2.0.0
Updatedkapsule@^1.13.3