eurostat-barcode-generator
Version:
a simplified barcode generator tool with options
10 lines • 64.8 kB
JavaScript
/*!
* Copyright (c) 2020 ~ present Alexander Hepp <alexander.hepp@sword-group.com>
* eurostat-barcode-generator project is licensed under the ISC license
*
* eurostat-barcode-generator, JavaScript chart library
*
*
* @version 1.0.2
*/
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("eurostatBarcodeGenerator",[],n):"object"==typeof exports?exports.eurostatBarcodeGenerator=n():t.eurostatBarcodeGenerator=n()}(this,(function(){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var i in t)e.d(r,i,function(n){return t[n]}.bind(null,i));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=8)}({10:function(t,n,e){"use strict";function r(){}e.r(n),e.d(n,"generateBarcode",(function(){return Yr})),e.d(n,"version",(function(){return Fr})),e.d(n,"instance",(function(){return Dr}));var i=function(t){return null==t?r:function(){return this.querySelector(t)}};function o(){return[]}var a=function(t){return null==t?o:function(){return this.querySelectorAll(t)}},u=function(t){return function(){return this.matches(t)}},s=function(t){return new Array(t.length)};function l(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}l.prototype={constructor:l,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 c(t,n,e,r,i,o){for(var a,u=0,s=n.length,c=o.length;u<c;++u)(a=n[u])?(a.__data__=o[u],r[u]=a):e[u]=new l(t,o[u]);for(;u<s;++u)(a=n[u])&&(i[u]=a)}function f(t,n,e,r,i,o,a){var u,s,c,f={},h=n.length,p=o.length,d=new Array(h);for(u=0;u<h;++u)(s=n[u])&&(d[u]=c="$"+a.call(s,s.__data__,u,n),c in f?i[u]=s:f[c]=s);for(u=0;u<p;++u)(s=f[c="$"+a.call(t,o[u],u,o)])?(r[u]=s,s.__data__=o[u],f[c]=null):e[u]=new l(t,o[u]);for(u=0;u<h;++u)(s=n[u])&&f[d[u]]===s&&(i[u]=s)}function h(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}var p="http://www.w3.org/1999/xhtml",d={svg:"http://www.w3.org/2000/svg",xhtml:p,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},v=function(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),d.hasOwnProperty(n)?{space:d[n],local:t}:t};function g(t){return function(){this.removeAttribute(t)}}function y(t){return function(){this.removeAttributeNS(t.space,t.local)}}function m(t,n){return function(){this.setAttribute(t,n)}}function _(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function w(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function b(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)}}var x=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function M(t){return function(){this.style.removeProperty(t)}}function k(t,n,e){return function(){this.style.setProperty(t,n,e)}}function A(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function N(t,n){return t.style.getPropertyValue(n)||x(t).getComputedStyle(t,null).getPropertyValue(n)}function S(t){return function(){delete this[t]}}function E(t,n){return function(){this[t]=n}}function j(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function C(t){return t.trim().split(/^|\s+/)}function O(t){return t.classList||new P(t)}function P(t){this._node=t,this._names=C(t.getAttribute("class")||"")}function q(t,n){for(var e=O(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function z(t,n){for(var e=O(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function T(t){return function(){q(this,t)}}function I(t){return function(){z(this,t)}}function R(t,n){return function(){(n.apply(this,arguments)?q:z)(this,t)}}P.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}};function X(){this.textContent=""}function $(t){return function(){this.textContent=t}}function B(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function H(){this.innerHTML=""}function V(t){return function(){this.innerHTML=t}}function L(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function D(){this.nextSibling&&this.parentNode.appendChild(this)}function F(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Y(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===p&&n.documentElement.namespaceURI===p?n.createElement(t):n.createElementNS(e,t)}}function U(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}var G=function(t){var n=v(t);return(n.local?U:Y)(n)};function W(){return null}function Z(){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 K(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}var Q={},tt=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(Q={mouseenter:"mouseover",mouseleave:"mouseout"}));function nt(t,n,e){return t=et(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function et(t,n,e){return function(r){var i=tt;tt=r;try{t.call(this,this.__data__,n,e)}finally{tt=i}}}function rt(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 it(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 ot(t,n,e){var r=Q.hasOwnProperty(t.type)?nt:et;return function(i,o,a){var u,s=this.__on,l=r(n,o,a);if(s)for(var c=0,f=s.length;c<f;++c)if((u=s[c]).type===t.type&&u.name===t.name)return this.removeEventListener(u.type,u.listener,u.capture),this.addEventListener(u.type,u.listener=l,u.capture=e),void(u.value=n);this.addEventListener(t.type,l,e),u={type:t.type,name:t.name,value:n,listener:l,capture:e},s?s.push(u):this.__on=[u]}}function at(t,n,e){var r=x(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 ut(t,n){return function(){return at(this,t,n)}}function st(t,n){return function(){return at(this,t,n.apply(this,arguments))}}var lt=[null];function ct(t,n){this._groups=t,this._parents=n}function ft(){return new ct([[document.documentElement]],lt)}ct.prototype=ft.prototype={constructor:ct,select:function(t){"function"!=typeof t&&(t=i(t));for(var n=this._groups,e=n.length,r=new Array(e),o=0;o<e;++o)for(var a,u,s=n[o],l=s.length,c=r[o]=new Array(l),f=0;f<l;++f)(a=s[f])&&(u=t.call(a,a.__data__,f,s))&&("__data__"in a&&(u.__data__=a.__data__),c[f]=u);return new ct(r,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=a(t));for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var u,s=n[o],l=s.length,c=0;c<l;++c)(u=s[c])&&(r.push(t.call(u,u.__data__,c,s)),i.push(u));return new ct(r,i)},filter:function(t){"function"!=typeof t&&(t=u(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a=n[i],s=a.length,l=r[i]=[],c=0;c<s;++c)(o=a[c])&&t.call(o,o.__data__,c,a)&&l.push(o);return new ct(r,this._parents)},data:function(t,n){if(!t)return g=new Array(this.size()),h=-1,this.each((function(t){g[++h]=t})),g;var e,r=n?f:c,i=this._parents,o=this._groups;"function"!=typeof t&&(e=t,t=function(){return e});for(var a=o.length,u=new Array(a),s=new Array(a),l=new Array(a),h=0;h<a;++h){var p=i[h],d=o[h],v=d.length,g=t.call(p,p&&p.__data__,h,i),y=g.length,m=s[h]=new Array(y),_=u[h]=new Array(y);r(p,d,m,_,l[h]=new Array(v),g,n);for(var w,b,x=0,M=0;x<y;++x)if(w=m[x]){for(x>=M&&(M=x+1);!(b=_[M])&&++M<y;);w._next=b||null}}return(u=new ct(u,i))._enter=s,u._exit=l,u},enter:function(){return new ct(this._enter||this._groups.map(s),this._parents)},exit:function(){return new ct(this._exit||this._groups.map(s),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),a=new Array(r),u=0;u<o;++u)for(var s,l=n[u],c=e[u],f=l.length,h=a[u]=new Array(f),p=0;p<f;++p)(s=l[p]||c[p])&&(h[p]=s);for(;u<r;++u)a[u]=n[u];return new ct(a,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,a=i[o];--o>=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=h);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var a,u=e[o],s=u.length,l=i[o]=new Array(s),c=0;c<s;++c)(a=u[c])&&(l[c]=a);l.sort(n)}return new ct(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 a=r[i];if(a)return a}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],a=0,u=o.length;a<u;++a)(i=o[a])&&t.call(i,i.__data__,a,o);return this},attr:function(t,n){var e=v(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?y:g:"function"==typeof n?e.local?b:w:e.local?_:m)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?M:"function"==typeof n?A:k)(t,n,null==e?"":e)):N(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?S:"function"==typeof n?j:E)(t,n)):this.node()[t]},classed:function(t,n){var e=C(t+"");if(arguments.length<2){for(var r=O(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?R:n?T:I)(e,n))},text:function(t){return arguments.length?this.each(null==t?X:("function"==typeof t?B:$)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?H:("function"==typeof t?L:V)(t)):this.node().innerHTML},raise:function(){return this.each(D)},lower:function(){return this.each(F)},append:function(t){var n="function"==typeof t?t:G(t);return this.select((function(){return this.appendChild(n.apply(this,arguments))}))},insert:function(t,n){var e="function"==typeof t?t:G(t),r=null==n?W:"function"==typeof n?n:i(n);return this.select((function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(Z)},clone:function(t){return this.select(t?K:J)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=rt(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?ot:it,null==e&&(e=!1),r=0;r<a;++r)this.each(u(o[r],n,e));return this}var u=this.node().__on;if(u)for(var s,l=0,c=u.length;l<c;++l)for(r=0,s=u[l];r<a;++r)if((i=o[r]).type===s.type&&i.name===s.name)return s.value},dispatch:function(t,n){return this.each(("function"==typeof n?st:ut)(t,n))}};var ht=ft,pt=function(t){return"string"==typeof t?new ct([[document.querySelector(t)]],[document.documentElement]):new ct([[t]],lt)},dt=function(t){return"string"==typeof t?new ct([document.querySelectorAll(t)],[document.documentElement]):new ct([null==t?[]:t],lt)},vt={value:function(){}};function gt(){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 yt(r)}function yt(t){this._=t}function mt(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 _t(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function wt(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=vt,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}yt.prototype=gt.prototype={constructor:yt,on:function(t,n){var e,r=this._,i=mt(t+"",r),o=-1,a=i.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++o<a;)if(e=(t=i[o]).type)r[e]=wt(r[e],t.name,n);else if(null==n)for(e in r)r[e]=wt(r[e],t.name,null);return this}for(;++o<a;)if((e=(t=i[o]).type)&&(e=_t(r[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new yt(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 bt=gt;function xt(t){return(xt="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})(t)}var Mt,kt,At=0,Nt=0,St=0,Et=0,jt=0,Ct=0,Ot="object"===("undefined"==typeof performance?"undefined":xt(performance))&&performance.now?performance:Date,Pt="object"===("undefined"==typeof window?"undefined":xt(window))&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function qt(){return jt||(Pt(zt),jt=Ot.now()+Ct)}function zt(){jt=0}function Tt(){this._call=this._time=this._next=null}function It(t,n,e){var r=new Tt;return r.restart(t,n,e),r}function Rt(){jt=(Et=Ot.now())+Ct,At=Nt=0;try{!function(){qt(),++At;for(var t,n=Mt;n;)(t=jt-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);kt=t,$t(r)}(),jt=0}}function Xt(){var t=Ot.now(),n=t-Et;n>1e3&&(Ct-=n,Et=t)}function $t(t){At||(Nt&&(Nt=clearTimeout(Nt)),t-jt>24?(t<1/0&&(Nt=setTimeout(Rt,t-Ot.now()-Ct)),St&&(St=clearInterval(St))):(St||(Et=Ot.now(),St=setInterval(Xt,1e3)),At=1,Pt(Rt)))}Tt.prototype=It.prototype={constructor:Tt,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?qt():+e)+(null==n?0:+n),this._next||kt===this||(kt?kt._next=this:Mt=this,kt=this),this._call=t,this._time=e,$t()},stop:function(){this._call&&(this._call=null,this._time=1/0,$t())}};var Bt=function(t,n,e){var r=new Tt;return n=null==n?0:+n,r.restart((function(e){r.stop(),t(e+n)}),n,e),r},Ht=bt("start","end","cancel","interrupt"),Vt=[],Lt=function(t,n,e,r,i,o){var a=t.__transition;if(a){if(e in a)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(s){var l,c,f,h;if(1!==e.state)return u();for(l in i)if((h=i[l]).name===e.name){if(3===h.state)return Bt(o);4===h.state?(h.state=6,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[l]):+l<n&&(h.state=6,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete i[l])}if(Bt((function(){3===e.state&&(e.state=4,e.timer.restart(a,e.delay,e.time),a(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(f=e.tween.length),l=0,c=-1;l<f;++l)(h=e.tween[l].value.call(t,t.__data__,e.index,e.group))&&(r[++c]=h);r.length=c+1}}function a(n){for(var i=n<e.duration?e.ease.call(null,n/e.duration):(e.timer.restart(u),e.state=5,1),o=-1,a=r.length;++o<a;)r[o].call(t,i);5===e.state&&(e.on.call("end",t,t.__data__,e.index,e.group),u())}function u(){for(var r in e.state=6,e.timer.stop(),delete i[n],i)return;delete t.__transition}i[n]=e,e.timer=It((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:Ht,tween:Vt,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})};function Dt(t,n){var e=Yt(t,n);if(e.state>0)throw new Error("too late; already scheduled");return e}function Ft(t,n){var e=Yt(t,n);if(e.state>3)throw new Error("too late; already running");return e}function Yt(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}var Ut,Gt,Wt,Zt,Jt=function(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}},Kt=180/Math.PI,Qt={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},tn=function(t,n,e,r,i,o){var a,u,s;return(a=Math.sqrt(t*t+n*n))&&(t/=a,n/=a),(s=t*e+n*r)&&(e-=t*s,r-=n*s),(u=Math.sqrt(e*e+r*r))&&(e/=u,r/=u,s/=u),t*r<n*e&&(t=-t,n=-n,s=-s,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(n,t)*Kt,skewX:Math.atan(s)*Kt,scaleX:a,scaleY:u}};function nn(t,n,e,r){function i(t){return t.length?t.pop()+" ":""}return function(o,a){var u=[],s=[];return o=t(o),a=t(a),function(t,r,i,o,a,u){if(t!==i||r!==o){var s=a.push("translate(",null,n,null,e);u.push({i:s-4,x:Jt(t,i)},{i:s-2,x:Jt(r,o)})}else(i||o)&&a.push("translate("+i+n+o+e)}(o.translateX,o.translateY,a.translateX,a.translateY,u,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:Jt(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,a.rotate,u,s),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:Jt(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,a.skewX,u,s),function(t,n,e,r,o,a){if(t!==e||n!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:Jt(t,e)},{i:u-2,x:Jt(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,s),o=a=null,function(t){for(var n,e=-1,r=s.length;++e<r;)u[(n=s[e]).i]=n.x(t);return u.join("")}}}var en=nn((function(t){return"none"===t?Qt:(Ut||(Ut=document.createElement("DIV"),Gt=document.documentElement,Wt=document.defaultView),Ut.style.transform=t,t=Wt.getComputedStyle(Gt.appendChild(Ut),null).getPropertyValue("transform"),Gt.removeChild(Ut),t=t.slice(7,-1).split(","),tn(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),"px, ","px)","deg)"),rn=nn((function(t){return null==t?Qt:(Zt||(Zt=document.createElementNS("http://www.w3.org/2000/svg","g")),Zt.setAttribute("transform",t),(t=Zt.transform.baseVal.consolidate())?(t=t.matrix,tn(t.a,t.b,t.c,t.d,t.e,t.f)):Qt)}),", ",")",")");function on(t,n){var e,r;return function(){var i=Ft(this,t),o=i.tween;if(o!==e)for(var a=0,u=(r=e=o).length;a<u;++a)if(r[a].name===n){(r=r.slice()).splice(a,1);break}i.tween=r}}function an(t,n,e){var r,i;if("function"!=typeof e)throw new Error;return function(){var o=Ft(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var u={name:n,value:e},s=0,l=i.length;s<l;++s)if(i[s].name===n){i[s]=u;break}s===l&&i.push(u)}o.tween=i}}function un(t,n,e){var r=t._id;return t.each((function(){var t=Ft(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)})),function(t){return Yt(t,r).value[n]}}var sn=function(t,n,e){t.prototype=n.prototype=e,e.constructor=t};function ln(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function cn(){}var fn="\\s*([+-]?\\d+)\\s*",hn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",pn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",dn=/^#([0-9a-f]{3,8})$/,vn=new RegExp("^rgb\\("+[fn,fn,fn]+"\\)$"),gn=new RegExp("^rgb\\("+[pn,pn,pn]+"\\)$"),yn=new RegExp("^rgba\\("+[fn,fn,fn,hn]+"\\)$"),mn=new RegExp("^rgba\\("+[pn,pn,pn,hn]+"\\)$"),_n=new RegExp("^hsl\\("+[hn,pn,pn]+"\\)$"),wn=new RegExp("^hsla\\("+[hn,pn,pn,hn]+"\\)$"),bn={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 xn(){return this.rgb().formatHex()}function Mn(){return this.rgb().formatRgb()}function kn(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=dn.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?An(n):3===e?new jn(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?Nn(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?Nn(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=vn.exec(t))?new jn(n[1],n[2],n[3],1):(n=gn.exec(t))?new jn(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=yn.exec(t))?Nn(n[1],n[2],n[3],n[4]):(n=mn.exec(t))?Nn(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=_n.exec(t))?qn(n[1],n[2]/100,n[3]/100,1):(n=wn.exec(t))?qn(n[1],n[2]/100,n[3]/100,n[4]):bn.hasOwnProperty(t)?An(bn[t]):"transparent"===t?new jn(NaN,NaN,NaN,0):null}function An(t){return new jn(t>>16&255,t>>8&255,255&t,1)}function Nn(t,n,e,r){return r<=0&&(t=n=e=NaN),new jn(t,n,e,r)}function Sn(t){return t instanceof cn||(t=kn(t)),t?new jn((t=t.rgb()).r,t.g,t.b,t.opacity):new jn}function En(t,n,e,r){return 1===arguments.length?Sn(t):new jn(t,n,e,null==r?1:r)}function jn(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function Cn(){return"#"+Pn(this.r)+Pn(this.g)+Pn(this.b)}function On(){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 Pn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function qn(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new Tn(t,n,e,r)}function zn(t){if(t instanceof Tn)return new Tn(t.h,t.s,t.l,t.opacity);if(t instanceof cn||(t=kn(t)),!t)return new Tn;if(t instanceof Tn)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),a=NaN,u=o-i,s=(o+i)/2;return u?(a=n===o?(e-r)/u+6*(e<r):e===o?(r-n)/u+2:(n-e)/u+4,u/=s<.5?o+i:2-o-i,a*=60):u=s>0&&s<1?0:a,new Tn(a,u,s,t.opacity)}function Tn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function In(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 Rn(t,n,e,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*n+(4-6*o+3*a)*e+(1+3*t+3*o-3*a)*r+a*i)/6}sn(cn,kn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:xn,formatHex:xn,formatHsl:function(){return zn(this).formatHsl()},formatRgb:Mn,toString:Mn}),sn(jn,En,ln(cn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new jn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new jn(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:Cn,formatHex:Cn,formatRgb:On,toString:On})),sn(Tn,(function(t,n,e,r){return 1===arguments.length?zn(t):new Tn(t,n,e,null==r?1:r)}),ln(cn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Tn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Tn(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 jn(In(t>=240?t-240:t+120,i,r),In(t,i,r),In(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 Xn=function(t){return function(){return t}};function $n(t,n){return function(e){return t+e*n}}function Bn(t){return 1==(t=+t)?Hn: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):Xn(isNaN(n)?e:n)}}function Hn(t,n){var e=n-t;return e?$n(t,e):Xn(isNaN(t)?n:t)}var Vn=function t(n){var e=Bn(n);function r(t,n){var r=e((t=En(t)).r,(n=En(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),a=Hn(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=o(n),t.opacity=a(n),t+""}}return r.gamma=t,r}(1);function Ln(t){return function(n){var e,r,i=n.length,o=new Array(i),a=new Array(i),u=new Array(i);for(e=0;e<i;++e)r=En(n[e]),o[e]=r.r||0,a[e]=r.g||0,u[e]=r.b||0;return o=t(o),a=t(a),u=t(u),r.opacity=1,function(t){return r.r=o(t),r.g=a(t),r.b=u(t),r+""}}}Ln((function(t){var n=t.length-1;return function(e){var r=e<=0?e=0:e>=1?(e=1,n-1):Math.floor(e*n),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,u=r<n-1?t[r+2]:2*o-i;return Rn((e-r/n)*n,a,i,o,u)}})),Ln((function(t){var n=t.length;return function(e){var r=Math.floor(((e%=1)<0?++e:e)*n),i=t[(r+n-1)%n],o=t[r%n],a=t[(r+1)%n],u=t[(r+2)%n];return Rn((e-r/n)*n,i,o,a,u)}}));var Dn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Fn=new RegExp(Dn.source,"g");var Yn=function(t,n){var e,r,i,o=Dn.lastIndex=Fn.lastIndex=0,a=-1,u=[],s=[];for(t+="",n+="";(e=Dn.exec(t))&&(r=Fn.exec(n));)(i=r.index)>o&&(i=n.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(e=e[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,s.push({i:a,x:Jt(e,r)})),o=Fn.lastIndex;return o<n.length&&(i=n.slice(o),u[a]?u[a]+=i:u[++a]=i),u.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)u[(e=s[r]).i]=e.x(t);return u.join("")})},Un=function(t,n){var e;return("number"==typeof n?Jt:n instanceof kn?Vn:(e=kn(n))?(n=e,Vn):Yn)(t,n)};function Gn(t){return function(){this.removeAttribute(t)}}function Wn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Zn(t,n,e){var r,i,o=e+"";return function(){var a=this.getAttribute(t);return a===o?null:a===r?i:i=n(r=a,e)}}function Jn(t,n,e){var r,i,o=e+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===o?null:a===r?i:i=n(r=a,e)}}function Kn(t,n,e){var r,i,o;return function(){var a,u,s=e(this);if(null!=s)return(a=this.getAttribute(t))===(u=s+"")?null:a===r&&u===i?o:(i=u,o=n(r=a,s));this.removeAttribute(t)}}function Qn(t,n,e){var r,i,o;return function(){var a,u,s=e(this);if(null!=s)return(a=this.getAttributeNS(t.space,t.local))===(u=s+"")?null:a===r&&u===i?o:(i=u,o=n(r=a,s));this.removeAttributeNS(t.space,t.local)}}function te(t,n){return function(e){this.setAttribute(t,n.call(this,e))}}function ne(t,n){return function(e){this.setAttributeNS(t.space,t.local,n.call(this,e))}}function ee(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 re(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&te(t,i)),e}return i._value=n,i}function ie(t,n){return function(){Dt(this,t).delay=+n.apply(this,arguments)}}function oe(t,n){return n=+n,function(){Dt(this,t).delay=n}}function ae(t,n){return function(){Ft(this,t).duration=+n.apply(this,arguments)}}function ue(t,n){return n=+n,function(){Ft(this,t).duration=n}}function se(t,n){if("function"!=typeof n)throw new Error;return function(){Ft(this,t).ease=n}}function le(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)?Dt:Ft;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(n,e),a.on=i}}var ce=ht.prototype.constructor;function fe(t){return function(){this.style.removeProperty(t)}}function he(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}function pe(t,n,e){var r,i;function o(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&he(t,o,e)),r}return o._value=n,o}function de(t){return function(n){this.textContent=t.call(this,n)}}function ve(t){var n,e;function r(){var r=t.apply(this,arguments);return r!==e&&(n=(e=r)&&de(r)),n}return r._value=t,r}var ge=0;function ye(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function me(){return++ge}var _e=ht.prototype;ye.prototype=function(t){return ht().transition(t)}.prototype={constructor:ye,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=i(t));for(var r=this._groups,o=r.length,a=new Array(o),u=0;u<o;++u)for(var s,l,c=r[u],f=c.length,h=a[u]=new Array(f),p=0;p<f;++p)(s=c[p])&&(l=t.call(s,s.__data__,p,c))&&("__data__"in s&&(l.__data__=s.__data__),h[p]=l,Lt(h[p],n,e,p,h,Yt(s,e)));return new ye(a,this._parents,n,e)},selectAll:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=a(t));for(var r=this._groups,i=r.length,o=[],u=[],s=0;s<i;++s)for(var l,c=r[s],f=c.length,h=0;h<f;++h)if(l=c[h]){for(var p,d=t.call(l,l.__data__,h,c),v=Yt(l,e),g=0,y=d.length;g<y;++g)(p=d[g])&&Lt(p,n,e,g,d,v);o.push(d),u.push(l)}return new ye(o,u,n,e)},filter:function(t){"function"!=typeof t&&(t=u(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,a=n[i],s=a.length,l=r[i]=[],c=0;c<s;++c)(o=a[c])&&t.call(o,o.__data__,c,a)&&l.push(o);return new ye(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),a=new Array(r),u=0;u<o;++u)for(var s,l=n[u],c=e[u],f=l.length,h=a[u]=new Array(f),p=0;p<f;++p)(s=l[p]||c[p])&&(h[p]=s);for(;u<r;++u)a[u]=n[u];return new ye(a,this._parents,this._name,this._id)},selection:function(){return new ce(this._groups,this._parents)},transition:function(){for(var t=this._name,n=this._id,e=me(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a,u=r[o],s=u.length,l=0;l<s;++l)if(a=u[l]){var c=Yt(a,n);Lt(a,t,e,l,u,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new ye(r,this._parents,t,e)},call:_e.call,nodes:_e.nodes,node:_e.node,size:_e.size,empty:_e.empty,each:_e.each,on:function(t,n){var e=this._id;return arguments.length<2?Yt(this.node(),e).on.on(t):this.each(le(e,t,n))},attr:function(t,n){var e=v(t),r="transform"===e?rn:Un;return this.attrTween(t,"function"==typeof n?(e.local?Qn:Kn)(e,r,un(this,"attr."+t,n)):null==n?(e.local?Wn:Gn)(e):(e.local?Jn:Zn)(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=v(t);return this.tween(e,(r.local?ee:re)(r,n))},style:function(t,n,e){var r="transform"==(t+="")?en:Un;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var o=N(this,t),a=(this.style.removeProperty(t),N(this,t));return o===a?null:o===e&&a===r?i:i=n(e=o,r=a)}}(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 a=N(this,t),u=e(this),s=u+"";return null==u&&(this.style.removeProperty(t),s=u=N(this,t)),a===s?null:a===r&&s===i?o:(i=s,o=n(r=a,u))}}(t,r,un(this,"style."+t,n))).each(function(t,n){var e,r,i,o,a="style."+n,u="end."+a;return function(){var s=Ft(this,t),l=s.on,c=null==s.value[a]?o||(o=fe(n)):void 0;l===e&&i===c||(r=(e=l).copy()).on(u,i=c),s.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,i,o=e+"";return function(){var a=N(this,t);return a===o?null:a===r?i:i=n(r=a,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,pe(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}}(un(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,ve(t))},remove:function(){return this.on("end.remove",(t=this._id,function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}));var t},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=Yt(this.node(),e).tween,o=0,a=i.length;o<a;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==n?on:an)(e,t,n))},delay:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?ie:oe)(n,t)):Yt(this.node(),n).delay},duration:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?ae:ue)(n,t)):Yt(this.node(),n).duration},ease:function(t){var n=this._id;return arguments.length?this.each(se(n,t)):Yt(this.node(),n).ease},end:function(){var t,n,e=this,r=e._id,i=e.size();return new Promise((function(o,a){var u={value:a},s={value:function(){0==--i&&o()}};e.each((function(){var e=Ft(this,r),i=e.on;i!==t&&((n=(t=i).copy())._.cancel.push(u),n._.interrupt.push(u),n._.end.push(s)),e.on=n}))}))}};var we={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function be(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))return we.time=qt(),we;return e}ht.prototype.interrupt=function(t){return this.each((function(){!function(t,n){var e,r,i,o=t.__transition,a=!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]):a=!1;a&&delete t.__transition}}(this,t)}))},ht.prototype.transition=function(t){var n,e;t instanceof ye?(n=t._id,t=t._name):(n=me(),(e=we).time=qt(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a,u=r[o],s=u.length,l=0;l<s;++l)(a=u[l])&&Lt(a,t,n,l,u,e||be(a,n));return new ye(r,this._parents,t,n)};function xe(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(!t)return;if("string"==typeof t)return Me(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Me(t,n)}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==e.return||e.return()}finally{if(u)throw o}}}}function Me(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e<n;e++)r[e]=t[e];return r}function ke(t,n){var e;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(e=function(t,n){if(!t)return;if("string"==typeof t)return Ae(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Ae(t,n)}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){e=t[Symbol.iterator]()},n:function(){var t=e.next();return a=t.done,t},e:function(t){u=!0,o=t},f:function(){try{a||null==e.return||e.return()}finally{if(u)throw o}}}}function Ae(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e<n;e++)r[e]=t[e];return r}function Ne(t,n,e,r){if(isNaN(n)||isNaN(e))return t;var i,o,a,u,s,l,c,f,h,p=t._root,d={data:r},v=t._x0,g=t._y0,y=t._x1,m=t._y1;if(!p)return t._root=d,t;for(;p.length;)if((l=n>=(o=(v+y)/2))?v=o:y=o,(c=e>=(a=(g+m)/2))?g=a:m=a,i=p,!(p=p[f=c<<1|l]))return i[f]=d,t;if(u=+t._x.call(null,p.data),s=+t._y.call(null,p.data),n===u&&e===s)return d.next=p,i?i[f]=d:t._root=d,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(l=n>=(o=(v+y)/2))?v=o:y=o,(c=e>=(a=(g+m)/2))?g=a:m=a}while((f=c<<1|l)==(h=(s>=a)<<1|u>=o));return i[h]=p,i[f]=d,t}var Se=function(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i};function Ee(t){return t[0]}function je(t){return t[1]}function Ce(t,n,e){var r=new Oe(null==n?Ee:n,null==e?je:e,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Oe(t,n,e,r,i,o){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function Pe(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}var qe=Ce.prototype=Oe.prototype;qe.copy=function(){var t,n,e=new Oe(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=Pe(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=Pe(n));return e},qe.add=function(t){var n=+this._x.call(null,t),e=+this._y.call(null,t);return Ne(this.cover(n,e),n,e,t)},qe.addAll=function(t){var n,e,r,i,o=t.length,a=new Array(o),u=new Array(o),s=1/0,l=1/0,c=-1/0,f=-1/0;for(e=0;e<o;++e)isNaN(r=+this._x.call(null,n=t[e]))||isNaN(i=+this._y.call(null,n))||(a[e]=r,u[e]=i,r<s&&(s=r),r>c&&(c=r),i<l&&(l=i),i>f&&(f=i));if(s>c||l>f)return this;for(this.cover(s,l).cover(c,f),e=0;e<o;++e)Ne(this,a[e],u[e],t[e]);return this},qe.cover=function(t,n){if(isNaN(t=+t)||isNaN(n=+n))return this;var e=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(e))i=(e=Math.floor(t))+1,o=(r=Math.floor(n))+1;else{for(var a,u,s=i-e,l=this._root;e>t||t>=i||r>n||n>=o;)switch(u=(n<r)<<1|t<e,(a=new Array(4))[u]=l,l=a,s*=2,u){case 0:i=e+s,o=r+s;break;case 1:e=i-s,o=r+s;break;case 2:i=e+s,r=o-s;break;case 3:e=i-s,r=o-s}this._root&&this._root.length&&(this._root=l)}return this._x0=e,this._y0=r,this._x1=i,this._y1=o,this},qe.data=function(){var t=[];return this.visit((function(n){if(!n.length)do{t.push(n.data)}while(n=n.next)})),t},qe.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},qe.find=function(t,n,e){var r,i,o,a,u,s,l,c=this._x0,f=this._y0,h=this._x1,p=this._y1,d=[],v=this._root;for(v&&d.push(new Se(v,c,f,h,p)),null==e?e=1/0:(c=t-e,f=n-e,h=t+e,p=n+e,e*=e);s=d.pop();)if(!(!(v=s.node)||(i=s.x0)>h||(o=s.y0)>p||(a=s.x1)<c||(u=s.y1)<f))if(v.length){var g=(i+a)/2,y=(o+u)/2;d.push(new Se(v[3],g,y,a,u),new Se(v[2],i,y,g,u),new Se(v[1],g,o,a,y),new Se(v[0],i,o,g,y)),(l=(n>=y)<<1|t>=g)&&(s=d[d.length-1],d[d.length-1]=d[d.length-1-l],d[d.length-1-l]=s)}else{var m=t-+this._x.call(null,v.data),_=n-+this._y.call(null,v.data),w=m*m+_*_;if(w<e){var b=Math.sqrt(e=w);c=t-b,f=n-b,h=t+b,p=n+b,r=v.data}}return r},qe.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var n,e,r,i,o,a,u,s,l,c,f,h,p=this._root,d=this._x0,v=this._y0,g=this._x1,y=this._y1;if(!p)return this;if(p.length)for(;;){if((l=o>=(u=(d+g)/2))?d=u:g=u,(c=a>=(s=(v+y)/2))?v=s:y=s,n=p,!(p=p[f=c<<1|l]))return this;if(!p.length)break;(n[f+1&3]||n[f+2&3]||n[f+3&3])&&(e=n,h=f)}for(;p.data!==t;)if(r=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,r?(i?r.next=i:delete r.next,this):n?(i?n[f]=i:delete n[f],(p=n[0]||n[1]||n[2]||n[3])&&p===(n[3]||n[2]||n[1]||n[0])&&!p.length&&(e?e[h]=p:this._root=p),this):(this._root=i,this)},qe.removeAll=function(t){for(var n=0,e=t.length;n<e;++n)this.remove(t[n]);return this},qe.root=function(){return this._root},qe.size=function(){var t=0;return this.visit((function(n){if(!n.length)do{++t}while(n=n.next)})),t},qe.visit=function(t){var n,e,r,i,o,a,u=[],s=this._root;for(s&&u.push(new Se(s,this._x0,this._y0,this._x1,this._y1));n=u.pop();)if(!t(s=n.node,r=n.x0,i=n.y0,o=n.x1,a=n.y1)&&s.length){var l=(r+o)/2,c=(i+a)/2;(e=s[3])&&u.push(new Se(e,l,c,o,a)),(e=s[2])&&u.push(new Se(e,r,c,l,a)),(e=s[1])&&u.push(new Se(e,l,i,o,c)),(e=s[0])&&u.push(new Se(e,r,i,l,c))}return this},qe.visitAfter=function(t){var n,e=[],r=[];for(this._root&&e.push(new Se(this._root,this._x0,this._y0,this._x1,this._y1));n=e.pop();){var i=n.node;if(i.length){var o,a=n.x0,u=n.y0,s=n.x1,l=n.y1,c=(a+s)/2,f=(u+l)/2;(o=i[0])&&e.push(new Se(o,a,u,c,f)),(o=i[1])&&e.push(new Se(o,c,u,s,f)),(o=i[2])&&e.push(new Se(o,a,f,c,l)),(o=i[3])&&e.push(new Se(o,c,f,s,l))}r.push(n)}for(;n=r.pop();)t(n.node,n.x0,n.y0,n.x1,n.y1);return this},qe.x=function(t){return arguments.length?(this._x=t,this):this._x},qe.y=function(t){return arguments.length?(this._y=t,this):this._y};Math.PI,Math.sqrt(5);var ze=Math.sqrt(50),Te=Math.sqrt(10),Ie=Math.sqrt(2);function Re(t,n,e){var r=(n-t)/Math.max(0,e),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=ze?10:o>=Te?5:o>=Ie?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=ze?10:o>=Te?5:o>=Ie?2:1)}var Xe=function(t,n){return t<n?-1:t>n?1:t>=n?0:NaN};var $e,Be,He=(1===($e=Xe).length&&(Be=$e,$e=function(t,n){return Xe(Be(t),n)}),{left:function(t,n,e,r){for(null==e&&(e=0),null==r&&(r=t.length);e<r;){var i=e+r>>>1;$e(t[i],n)<0?e=i+1:r=i}return e},right:function(t,n,e,r){for(null==e&&(e=0),null==r&&(r=t.length);e<r;){var i=e+r>>>1;$e(t[i],n)>0?r=i:e=i+1}return e}}),Ve=He.right,Le=function(t,n){n||(n=[]);var e,r=t?Math.min(n.length,t.length):0,i=n.slice();return function(o){for(e=0;e<r;++e)i[e]=t[e]*(1-o)+n[e]*o;return i}};function De(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Fe(t,n){var e,r=n?n.length:0,i=t?Math.min(r,t.length):0,o=new Array(i),a=new Array(r);for(e=0;e<i;++e)o[e]=Ze(t[e],n[e]);for(;e<r;++e)a[e]=n[e];return function(t){for(e=0;e<i;++e)a[e]=o[e](t);return a}}var Ye=function(t,n){var e=new Date;return t=+t,n=+n,function(r){return e.setTime(t*(1-r)+n*r),e}};function Ue(t){return(Ue="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})(t)}var Ge=function(t,n){var e,r={},i={};for(e in null!==t&&"object"===Ue(t)||(t={}),null!==n&&"object"===Ue(n)||(n={}),n)e in t?r[e]=Ze(t[e],n[e]):i[e]=n[e];return function(t){for(e in r)i[e]=r[e](t);return i}};function We(t){return(We="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})(t)}var Ze=function(t,n){var e,r=We(n);return null==n||"boolean"===r?Xn(n):("number"===r?Jt:"string"===r?(e=kn(n))?(n=e,Vn):Yn:n instanceof kn?Vn:n instanceof Date?Ye:De(n)?Le:Array.isArray(n)?Fe:"function"!=typeof n.valueOf&&"function"!=typeof n.toString||isNaN(n)?Ge:Jt)(t,n)},Je=function(t,n){return t=+t,n=+n,function(e){return Math.round(t*(1-e)+n*e)}},Ke=function(t){return+t},Qe=[0,1];function tr(t){return t}function nr(t,n){return(n-=t=+t)?function(e){return(e-t)/n}:(e=isNaN(n)?NaN:.5,function(){return e});var e}function er(t,n,e){var r=t[0],i=t[1],o=n[0],a=n[1];return i<r?(r=nr(i,r),o=e(a,o)):(r=nr(r,i),o=e(o,a)),function(t){return o(r(t))}}function rr(t,n,e){var r=Math.min(t.length,n.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());++a<r;)i[a]=nr(t[a],t[a+1]),o[a]=e(n[a],n[a+1]);return function(n){var e=Ve(t,n,1,r)-1;return o[e](i[e](n))}}function ir(t,n){return n.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function or(){var t,n,e,r,i,o,a=Qe,u=Qe,s=Ze,l=tr;function c(){var t,n,e,s=Math.min(a.length,u.length);return l!==tr&&(t=a[0],n=a[s-1],t>n&&(e=t,t=n,n=e),l=function(e){return Math.max(t,Math.min(n,e))}),r=s>2?rr:er,i=o=null,f}function f(n){return isNaN(n=+n)?e:(i||(i=r(a.map(t),u,s)))(t(l(n)))}return f.invert=function(e){return l(n((o||(o=r(u,a.map(t),Jt)))(e)))},f.domain=function(t){return arguments.length?(a=Array.from(t,Ke),c()):a.slice()},f.range=function(t){return arguments.length?(u=Array.from(t),c()):u.slice()},f.rangeRound=function(t){return u=Array.from(t),s=Je,c()},f.clamp=function(t){return arguments.length?(l=!!t||tr,c()):l!==tr},f.interpolate=function(t){return arguments.length?(s=t,c()):s},f.unknown=function(t){return arguments.length?(e=t,f):e},function(e,r){return t=e,n=r,c()}}function ar(){return or()(tr,tr)}function ur(t,n){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(n).domain(t)}return this}var sr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function lr(t){if(!(n=sr.exec(t)))throw new Error("invalid format: "+t);var n;return new cr({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}function cr(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}lr.prototype=cr.prototype,cr.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var fr,hr,pr,dr,vr=function(t,n){if((e=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"))<0)return null;var e,r=t.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+t.slice(e+1)]},gr=function(t){return(t=vr(Math.abs(t)))?t[1]:NaN},yr=function(t,n){var e=vr(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},mr={"%":function(t,n){return(100*t)