-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathterminusdb-react-graph.min.js
1 lines (1 loc) · 108 KB
/
terminusdb-react-graph.min.js
1
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.TerminusDBGraph=n():t.TerminusDBGraph=n()}(window,(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=20)}({20:function(t,n,e){"use strict";e.r(n);var r=function(t,n){return t<n?-1:t>n?1:t>=n?0:NaN},i=function(t){var n;return 1===t.length&&(n=t,t=function(t,e){return r(n(t),e)}),{left:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r<i;){var o=r+i>>>1;t(n[o],e)<0?r=o+1:i=o}return r},right:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r<i;){var o=r+i>>>1;t(n[o],e)>0?i=o:r=o+1}return r}}};var o=i(r);o.right,o.left;var u=Array.prototype;u.slice,u.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2);var a=function(t,n){var e,r,i=t.length,o=-1;if(null==n){for(;++o<i;)if(null!=(e=t[o])&&e>=e)for(r=e;++o<i;)null!=(e=t[o])&&e>r&&(r=e)}else for(;++o<i;)if(null!=(e=n(t[o],o,t))&&e>=e)for(r=e;++o<i;)null!=(e=n(t[o],o,t))&&e>r&&(r=e);return r},s=function(t,n){var e,r,i=t.length,o=-1;if(null==n){for(;++o<i;)if(null!=(e=t[o])&&e>=e)for(r=e;++o<i;)null!=(e=t[o])&&r>e&&(r=e)}else for(;++o<i;)if(null!=(e=n(t[o],o,t))&&e>=e)for(r=e;++o<i;)null!=(e=n(t[o],o,t))&&r>e&&(r=e);return r};Array.prototype.slice;var c={value:function(){}};function l(){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 h(r)}function h(t){this._=t}function f(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 d(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function p(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=c,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}h.prototype=l.prototype={constructor:h,on:function(t,n){var e,r=this._,i=f(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]=p(r[e],t.name,n);else if(null==n)for(e in r)r[e]=p(r[e],t.name,null);return this}for(;++o<u;)if((e=(t=i[o]).type)&&(e=d(r[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new h(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 g=l;function v(){}var y=function(t){return null==t?v:function(){return this.querySelector(t)}};function m(){return[]}var _=function(t){return null==t?m:function(){return this.querySelectorAll(t)}},w=function(t){return function(){return this.matches(t)}},x=function(t){return new Array(t.length)};function M(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}M.prototype={constructor:M,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)}};var b="$";function N(t,n,e,r,i,o){for(var u,a=0,s=n.length,c=o.length;a<c;++a)(u=n[a])?(u.__data__=o[a],r[a]=u):e[a]=new M(t,o[a]);for(;a<s;++a)(u=n[a])&&(i[a]=u)}function C(t,n,e,r,i,o,u){var a,s,c,l={},h=n.length,f=o.length,d=new Array(h);for(a=0;a<h;++a)(s=n[a])&&(d[a]=c=b+u.call(s,s.__data__,a,n),c in l?i[a]=s:l[c]=s);for(a=0;a<f;++a)(s=l[c=b+u.call(t,o[a],a,o)])?(r[a]=s,s.__data__=o[a],l[c]=null):e[a]=new M(t,o[a]);for(a=0;a<h;++a)(s=n[a])&&l[d[a]]===s&&(i[a]=s)}function k(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}var T="http://www.w3.org/1999/xhtml",A={svg:"http://www.w3.org/2000/svg",xhtml:T,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},U=function(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),A.hasOwnProperty(n)?{space:A[n],local:t}:t};function z(t){return function(){this.removeAttribute(t)}}function D(t){return function(){this.removeAttributeNS(t.space,t.local)}}function S(t,n){return function(){this.setAttribute(t,n)}}function L(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 R(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}var P=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function F(t){return function(){this.style.removeProperty(t)}}function q(t,n,e){return function(){this.style.setProperty(t,n,e)}}function Y(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function j(t,n){return t.style.getPropertyValue(n)||P(t).getComputedStyle(t,null).getPropertyValue(n)}function H(t){return function(){delete this[t]}}function O(t,n){return function(){this[t]=n}}function X(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function I(t){return t.trim().split(/^|\s+/)}function V(t){return t.classList||new W(t)}function W(t){this._node=t,this._names=I(t.getAttribute("class")||"")}function $(t,n){for(var e=V(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function B(t,n){for(var e=V(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function Z(t){return function(){$(this,t)}}function G(t){return function(){B(this,t)}}function Q(t,n){return function(){(n.apply(this,arguments)?$:B)(this,t)}}W.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 J(){this.textContent=""}function K(t){return function(){this.textContent=t}}function tt(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function nt(){this.innerHTML=""}function et(t){return function(){this.innerHTML=t}}function rt(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function it(){this.nextSibling&&this.parentNode.appendChild(this)}function ot(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ut(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===T&&n.documentElement.namespaceURI===T?n.createElement(t):n.createElementNS(e,t)}}function at(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}var st=function(t){var n=U(t);return(n.local?at:ut)(n)};function ct(){return null}function lt(){var t=this.parentNode;t&&t.removeChild(this)}function ht(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function ft(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}var dt={},pt=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(dt={mouseenter:"mouseover",mouseleave:"mouseout"}));function gt(t,n,e){return t=vt(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function vt(t,n,e){return function(r){var i=pt;pt=r;try{t.call(this,this.__data__,n,e)}finally{pt=i}}}function yt(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 mt(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 _t(t,n,e){var r=dt.hasOwnProperty(t.type)?gt:vt;return function(i,o,u){var a,s=this.__on,c=r(n,o,u);if(s)for(var l=0,h=s.length;l<h;++l)if((a=s[l]).type===t.type&&a.name===t.name)return this.removeEventListener(a.type,a.listener,a.capture),this.addEventListener(a.type,a.listener=c,a.capture=e),void(a.value=n);this.addEventListener(t.type,c,e),a={type:t.type,name:t.name,value:n,listener:c,capture:e},s?s.push(a):this.__on=[a]}}function wt(t,n,e,r){var i=pt;t.sourceEvent=pt,pt=t;try{return n.apply(e,r)}finally{pt=i}}function xt(t,n,e){var r=P(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 Mt(t,n){return function(){return xt(this,t,n)}}function bt(t,n){return function(){return xt(this,t,n.apply(this,arguments))}}var Nt=[null];function Ct(t,n){this._groups=t,this._parents=n}function kt(){return new Ct([[document.documentElement]],Nt)}Ct.prototype=kt.prototype={constructor:Ct,select:function(t){"function"!=typeof t&&(t=y(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,c=r[i]=new Array(s),l=0;l<s;++l)(o=a[l])&&(u=t.call(o,o.__data__,l,a))&&("__data__"in o&&(u.__data__=o.__data__),c[l]=u);return new Ct(r,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=_(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,c=0;c<s;++c)(u=a[c])&&(r.push(t.call(u,u.__data__,c,a)),i.push(u));return new Ct(r,i)},filter:function(t){"function"!=typeof t&&(t=w(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]=[],c=0;c<a;++c)(o=u[c])&&t.call(o,o.__data__,c,u)&&s.push(o);return new Ct(r,this._parents)},data:function(t,n){if(!t)return p=new Array(this.size()),l=-1,this.each((function(t){p[++l]=t})),p;var e,r=n?C:N,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),c=new Array(u),l=0;l<u;++l){var h=i[l],f=o[l],d=f.length,p=t.call(h,h&&h.__data__,l,i),g=p.length,v=s[l]=new Array(g),y=a[l]=new Array(g);r(h,f,v,y,c[l]=new Array(d),p,n);for(var m,_,w=0,x=0;w<g;++w)if(m=v[w]){for(w>=x&&(x=w+1);!(_=y[x])&&++x<g;);m._next=_||null}}return(a=new Ct(a,i))._enter=s,a._exit=c,a},enter:function(){return new Ct(this._enter||this._groups.map(x),this._parents)},exit:function(){return new Ct(this._exit||this._groups.map(x),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,c=n[a],l=e[a],h=c.length,f=u[a]=new Array(h),d=0;d<h;++d)(s=c[d]||l[d])&&(f[d]=s);for(;a<r;++a)u[a]=n[a];return new Ct(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=k);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,c=i[o]=new Array(s),l=0;l<s;++l)(u=a[l])&&(c[l]=u);c.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 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?D:z:"function"==typeof n?e.local?R:E:e.local?L:S)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?F:"function"==typeof n?Y:q)(t,n,null==e?"":e)):j(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?H:"function"==typeof n?X:O)(t,n)):this.node()[t]},classed:function(t,n){var e=I(t+"");if(arguments.length<2){for(var r=V(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?Q:n?Z:G)(e,n))},text:function(t){return arguments.length?this.each(null==t?J:("function"==typeof t?tt:K)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?nt:("function"==typeof t?rt:et)(t)):this.node().innerHTML},raise:function(){return this.each(it)},lower:function(){return this.each(ot)},append:function(t){var n="function"==typeof t?t:st(t);return this.select((function(){return this.appendChild(n.apply(this,arguments))}))},insert:function(t,n){var e="function"==typeof t?t:st(t),r=null==n?ct:"function"==typeof n?n:y(n);return this.select((function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(lt)},clone:function(t){return this.select(t?ft:ht)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=yt(t+""),u=o.length;if(!(arguments.length<2)){for(a=n?_t:mt,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,c=0,l=a.length;c<l;++c)for(r=0,s=a[c];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?bt:Mt)(t,n))}};var Tt=kt,At=function(t){return"string"==typeof t?new Ct([[document.querySelector(t)]],[document.documentElement]):new Ct([[t]],Nt)};function Ut(){pt.stopImmediatePropagation()}var zt=function(){pt.preventDefault(),pt.stopImmediatePropagation()},Dt=function(t){var n=t.document.documentElement,e=At(t).on("dragstart.drag",zt,!0);"onselectstart"in n?e.on("selectstart.drag",zt,!0):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")};function St(t,n){var e=t.document.documentElement,r=At(t).on("dragstart.drag",null);n&&(r.on("click.drag",zt,!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)}var Lt=function(t,n,e){t.prototype=n.prototype=e,e.constructor=t};function Et(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function Rt(){}var Pt="\\s*([+-]?\\d+)\\s*",Ft="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",qt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Yt=/^#([0-9a-f]{3,8})$/,jt=new RegExp("^rgb\\("+[Pt,Pt,Pt]+"\\)$"),Ht=new RegExp("^rgb\\("+[qt,qt,qt]+"\\)$"),Ot=new RegExp("^rgba\\("+[Pt,Pt,Pt,Ft]+"\\)$"),Xt=new RegExp("^rgba\\("+[qt,qt,qt,Ft]+"\\)$"),It=new RegExp("^hsl\\("+[Ft,qt,qt]+"\\)$"),Vt=new RegExp("^hsla\\("+[Ft,qt,qt,Ft]+"\\)$"),Wt={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 $t(){return this.rgb().formatHex()}function Bt(){return this.rgb().formatRgb()}function Zt(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=Yt.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?Gt(n):3===e?new Kt(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?new Kt(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?new Kt(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=jt.exec(t))?new Kt(n[1],n[2],n[3],1):(n=Ht.exec(t))?new Kt(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=Ot.exec(t))?Qt(n[1],n[2],n[3],n[4]):(n=Xt.exec(t))?Qt(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=It.exec(t))?rn(n[1],n[2]/100,n[3]/100,1):(n=Vt.exec(t))?rn(n[1],n[2]/100,n[3]/100,n[4]):Wt.hasOwnProperty(t)?Gt(Wt[t]):"transparent"===t?new Kt(NaN,NaN,NaN,0):null}function Gt(t){return new Kt(t>>16&255,t>>8&255,255&t,1)}function Qt(t,n,e,r){return r<=0&&(t=n=e=NaN),new Kt(t,n,e,r)}function Jt(t,n,e,r){return 1===arguments.length?((i=t)instanceof Rt||(i=Zt(i)),i?new Kt((i=i.rgb()).r,i.g,i.b,i.opacity):new Kt):new Kt(t,n,e,null==r?1:r);var i}function Kt(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function tn(){return"#"+en(this.r)+en(this.g)+en(this.b)}function nn(){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 en(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function rn(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new un(t,n,e,r)}function on(t){if(t instanceof un)return new un(t.h,t.s,t.l,t.opacity);if(t instanceof Rt||(t=Zt(t)),!t)return new un;if(t instanceof un)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 un(u,a,s,t.opacity)}function un(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)}function sn(t,n,e,r,i){var o=t*t,u=o*t;return((1-3*t+3*o-u)*n+(4-6*o+3*u)*e+(1+3*t+3*o-3*u)*r+u*i)/6}Lt(Rt,Zt,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:$t,formatHex:$t,formatHsl:function(){return on(this).formatHsl()},formatRgb:Bt,toString:Bt}),Lt(Kt,Jt,Et(Rt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Kt(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Kt(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:tn,formatHex:tn,formatRgb:nn,toString:nn})),Lt(un,(function(t,n,e,r){return 1===arguments.length?on(t):new un(t,n,e,null==r?1:r)}),Et(Rt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new un(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new un(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 Kt(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 cn=function(t){return function(){return t}};function ln(t,n){return function(e){return t+e*n}}function hn(t){return 1==(t=+t)?fn: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):cn(isNaN(n)?e:n)}}function fn(t,n){var e=n-t;return e?ln(t,e):cn(isNaN(t)?n:t)}var dn=function t(n){var e=hn(n);function r(t,n){var r=e((t=Jt(t)).r,(n=Jt(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),u=fn(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 pn(t){return function(n){var e,r,i=n.length,o=new Array(i),u=new Array(i),a=new Array(i);for(e=0;e<i;++e)r=Jt(n[e]),o[e]=r.r||0,u[e]=r.g||0,a[e]=r.b||0;return o=t(o),u=t(u),a=t(a),r.opacity=1,function(t){return r.r=o(t),r.g=u(t),r.b=a(t),r+""}}}pn((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],u=r>0?t[r-1]:2*i-o,a=r<n-1?t[r+2]:2*o-i;return sn((e-r/n)*n,u,i,o,a)}})),pn((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],u=t[(r+1)%n],a=t[(r+2)%n];return sn((e-r/n)*n,i,o,u,a)}}));var gn=function(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}},vn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,yn=new RegExp(vn.source,"g");var mn,_n,wn=function(t,n){var e,r,i,o=vn.lastIndex=yn.lastIndex=0,u=-1,a=[],s=[];for(t+="",n+="";(e=vn.exec(t))&&(r=yn.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:gn(e,r)})),o=yn.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("")})},xn=function(){for(var t,n=pt;t=n.sourceEvent;)n=t;return n},Mn=function(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]},bn=function(t,n,e){arguments.length<3&&(e=n,n=xn().changedTouches);for(var r,i=0,o=n?n.length:0;i<o;++i)if((r=n[i]).identifier===e)return Mn(t,r);return null},Nn=function(t){var n=xn();return n.changedTouches&&(n=n.changedTouches[0]),Mn(t,n)},Cn=0,kn=0,Tn=0,An=1e3,Un=0,zn=0,Dn=0,Sn="object"==typeof performance&&performance.now?performance:Date,Ln="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function En(){return zn||(Ln(Rn),zn=Sn.now()+Dn)}function Rn(){zn=0}function Pn(){this._call=this._time=this._next=null}function Fn(t,n,e){var r=new Pn;return r.restart(t,n,e),r}function qn(){zn=(Un=Sn.now())+Dn,Cn=kn=0;try{!function(){En(),++Cn;for(var t,n=mn;n;)(t=zn-n._time)>=0&&n._call.call(null,t),n=n._next;--Cn}()}finally{Cn=0,function(){var t,n,e=mn,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:mn=n);_n=t,jn(r)}(),zn=0}}function Yn(){var t=Sn.now(),n=t-Un;n>An&&(Dn-=n,Un=t)}function jn(t){Cn||(kn&&(kn=clearTimeout(kn)),t-zn>24?(t<1/0&&(kn=setTimeout(qn,t-Sn.now()-Dn)),Tn&&(Tn=clearInterval(Tn))):(Tn||(Un=Sn.now(),Tn=setInterval(Yn,An)),Cn=1,Ln(qn)))}Pn.prototype=Fn.prototype={constructor:Pn,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?En():+e)+(null==n?0:+n),this._next||_n===this||(_n?_n._next=this:mn=this,_n=this),this._call=t,this._time=e,jn()},stop:function(){this._call&&(this._call=null,this._time=1/0,jn())}};var Hn=function(t,n,e){var r=new Pn;return n=null==n?0:+n,r.restart((function(e){r.stop(),t(e+n)}),n,e),r},On=g("start","end","cancel","interrupt"),Xn=[],In=0,Vn=1,Wn=2,$n=3,Bn=4,Zn=5,Gn=6,Qn=function(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 c,l,h,f;if(e.state!==Vn)return a();for(c in i)if((f=i[c]).name===e.name){if(f.state===$n)return Hn(o);f.state===Bn?(f.state=Gn,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[c]):+c<n&&(f.state=Gn,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete i[c])}if(Hn((function(){e.state===$n&&(e.state=Bn,e.timer.restart(u,e.delay,e.time),u(s))})),e.state=Wn,e.on.call("start",t,t.__data__,e.index,e.group),e.state===Wn){for(e.state=$n,r=new Array(h=e.tween.length),c=0,l=-1;c<h;++c)(f=e.tween[c].value.call(t,t.__data__,e.index,e.group))&&(r[++l]=f);r.length=l+1}}function u(n){for(var i=n<e.duration?e.ease.call(null,n/e.duration):(e.timer.restart(a),e.state=Zn,1),o=-1,u=r.length;++o<u;)r[o].call(t,i);e.state===Zn&&(e.on.call("end",t,t.__data__,e.index,e.group),a())}function a(){for(var r in e.state=Gn,e.timer.stop(),delete i[n],i)return;delete t.__transition}i[n]=e,e.timer=Fn((function(t){e.state=Vn,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:On,tween:Xn,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:In})};function Jn(t,n){var e=te(t,n);if(e.state>In)throw new Error("too late; already scheduled");return e}function Kn(t,n){var e=te(t,n);if(e.state>$n)throw new Error("too late; already running");return e}function te(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}var ne,ee,re,ie,oe=function(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>Wn&&e.state<Zn,e.state=Gn,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}},ue=180/Math.PI,ae={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},se=function(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)*ue,skewX:Math.atan(s)*ue,scaleX:u,scaleY:a}};function ce(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:gn(t,i)},{i:s-2,x:gn(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:gn(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:gn(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:gn(t,e)},{i:a-2,x:gn(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 le=ce((function(t){return"none"===t?ae:(ne||(ne=document.createElement("DIV"),ee=document.documentElement,re=document.defaultView),ne.style.transform=t,t=re.getComputedStyle(ee.appendChild(ne),null).getPropertyValue("transform"),ee.removeChild(ne),t=t.slice(7,-1).split(","),se(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),"px, ","px)","deg)"),he=ce((function(t){return null==t?ae:(ie||(ie=document.createElementNS("http://www.w3.org/2000/svg","g")),ie.setAttribute("transform",t),(t=ie.transform.baseVal.consolidate())?(t=t.matrix,se(t.a,t.b,t.c,t.d,t.e,t.f)):ae)}),", ",")",")");function fe(t,n){var e,r;return function(){var i=Kn(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 de(t,n,e){var r,i;if("function"!=typeof e)throw new Error;return function(){var o=Kn(this,t),u=o.tween;if(u!==r){i=(r=u).slice();for(var a={name:n,value:e},s=0,c=i.length;s<c;++s)if(i[s].name===n){i[s]=a;break}s===c&&i.push(a)}o.tween=i}}function pe(t,n,e){var r=t._id;return t.each((function(){var t=Kn(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)})),function(t){return te(t,r).value[n]}}var ge=function(t,n){var e;return("number"==typeof n?gn:n instanceof Zt?dn:(e=Zt(n))?(n=e,dn):wn)(t,n)};function ve(t){return function(){this.removeAttribute(t)}}function ye(t){return function(){this.removeAttributeNS(t.space,t.local)}}function me(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 _e(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 we(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 xe(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 Me(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&function(t,n){return function(e){this.setAttributeNS(t.space,t.local,n.call(this,e))}}(t,i)),e}return i._value=n,i}function be(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&function(t,n){return function(e){this.setAttribute(t,n.call(this,e))}}(t,i)),e}return i._value=n,i}function Ne(t,n){return function(){Jn(this,t).delay=+n.apply(this,arguments)}}function Ce(t,n){return n=+n,function(){Jn(this,t).delay=n}}function ke(t,n){return function(){Kn(this,t).duration=+n.apply(this,arguments)}}function Te(t,n){return n=+n,function(){Kn(this,t).duration=n}}function Ae(t,n){if("function"!=typeof n)throw new Error;return function(){Kn(this,t).ease=n}}function Ue(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)?Jn:Kn;return function(){var u=o(this,t),a=u.on;a!==r&&(i=(r=a).copy()).on(n,e),u.on=i}}var ze=Tt.prototype.constructor;function De(t){return function(){this.style.removeProperty(t)}}function Se(t,n,e){var r,i;function o(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}(t,o,e)),r}return o._value=n,o}function Le(t){var n,e;function r(){var r=t.apply(this,arguments);return r!==e&&(n=(e=r)&&function(t){return function(n){this.textContent=t.call(this,n)}}(r)),n}return r._value=t,r}var Ee=0;function Re(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function Pe(){return++Ee}var Fe=Tt.prototype;Re.prototype=function(t){return Tt().transition(t)}.prototype={constructor:Re,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=y(t));for(var r=this._groups,i=r.length,o=new Array(i),u=0;u<i;++u)for(var a,s,c=r[u],l=c.length,h=o[u]=new Array(l),f=0;f<l;++f)(a=c[f])&&(s=t.call(a,a.__data__,f,c))&&("__data__"in a&&(s.__data__=a.__data__),h[f]=s,Qn(h[f],n,e,f,h,te(a,e)));return new Re(o,this._parents,n,e)},selectAll:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=_(t));for(var r=this._groups,i=r.length,o=[],u=[],a=0;a<i;++a)for(var s,c=r[a],l=c.length,h=0;h<l;++h)if(s=c[h]){for(var f,d=t.call(s,s.__data__,h,c),p=te(s,e),g=0,v=d.length;g<v;++g)(f=d[g])&&Qn(f,n,e,g,d,p);o.push(d),u.push(s)}return new Re(o,u,n,e)},filter:function(t){"function"!=typeof t&&(t=w(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]=[],c=0;c<a;++c)(o=u[c])&&t.call(o,o.__data__,c,u)&&s.push(o);return new Re(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,c=n[a],l=e[a],h=c.length,f=u[a]=new Array(h),d=0;d<h;++d)(s=c[d]||l[d])&&(f[d]=s);for(;a<r;++a)u[a]=n[a];return new Re(u,this._parents,this._name,this._id)},selection:function(){return new ze(this._groups,this._parents)},transition:function(){for(var t=this._name,n=this._id,e=Pe(),r=this._groups,i=r.length,o=0;o<i;++o)for(var u,a=r[o],s=a.length,c=0;c<s;++c)if(u=a[c]){var l=te(u,n);Qn(u,t,e,c,a,{time:l.time+l.delay+l.duration,delay:0,duration:l.duration,ease:l.ease})}return new Re(r,this._parents,t,e)},call:Fe.call,nodes:Fe.nodes,node:Fe.node,size:Fe.size,empty:Fe.empty,each:Fe.each,on:function(t,n){var e=this._id;return arguments.length<2?te(this.node(),e).on.on(t):this.each(Ue(e,t,n))},attr:function(t,n){var e=U(t),r="transform"===e?he:ge;return this.attrTween(t,"function"==typeof n?(e.local?xe:we)(e,r,pe(this,"attr."+t,n)):null==n?(e.local?ye:ve)(e):(e.local?_e:me)(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?Me:be)(r,n))},style:function(t,n,e){var r="transform"==(t+="")?le:ge;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var o=j(this,t),u=(this.style.removeProperty(t),j(this,t));return o===u?null:o===e&&u===r?i:i=n(e=o,r=u)}}(t,r)).on("end.style."+t,De(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var r,i,o;return function(){var u=j(this,t),a=e(this),s=a+"";return null==a&&(this.style.removeProperty(t),s=a=j(this,t)),u===s?null:u===r&&s===i?o:(i=s,o=n(r=u,a))}}(t,r,pe(this,"style."+t,n))).each(function(t,n){var e,r,i,o,u="style."+n,a="end."+u;return function(){var s=Kn(this,t),c=s.on,l=null==s.value[u]?o||(o=De(n)):void 0;c===e&&i===l||(r=(e=c).copy()).on(a,i=l),s.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,i,o=e+"";return function(){var u=j(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,Se(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}}(pe(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,Le(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=te(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?fe:de)(e,t,n))},delay:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?Ne:Ce)(n,t)):te(this.node(),n).delay},duration:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?ke:Te)(n,t)):te(this.node(),n).duration},ease:function(t){var n=this._id;return arguments.length?this.each(Ae(n,t)):te(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=Kn(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 qe={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Ye(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))return qe.time=En(),qe;return e}Tt.prototype.interrupt=function(t){return this.each((function(){oe(this,t)}))},Tt.prototype.transition=function(t){var n,e;t instanceof Re?(n=t._id,t=t._name):(n=Pe(),(e=qe).time=En(),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,c=0;c<s;++c)(u=a[c])&&Qn(u,t,n,c,a,e||Ye(u,n));return new Re(r,this._parents,t,n)};function je(t){return[+t[0],+t[1]]}function He(t){return[je(t[0]),je(t[1])]}["w","e"].map(Oe),["n","s"].map(Oe),["n","w","e","s","nw","ne","sw","se"].map(Oe);function Oe(t){return{type:t}}var Xe=function(t,n){return t<n?-1:t>n?1:t>=n?0:NaN};var Ie,Ve;1===(Ie=Xe).length&&(Ve=Ie,Ie=function(t,n){return Xe(Ve(t),n)});var We=Array.prototype;We.slice,We.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2);Math.cos,Math.sin,Math.PI,Math.max;Array.prototype.slice;var $e=Math.PI,Be=2*$e,Ze=Be-1e-6;function Ge(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Qe(){return new Ge}Ge.prototype=Qe.prototype={constructor:Ge,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,e,r){this._+="Q"+ +t+","+ +n+","+(this._x1=+e)+","+(this._y1=+r)},bezierCurveTo:function(t,n,e,r,i,o){this._+="C"+ +t+","+ +n+","+ +e+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(t,n,e,r,i){t=+t,n=+n,e=+e,r=+r,i=+i;var o=this._x1,u=this._y1,a=e-t,s=r-n,c=o-t,l=u-n,h=c*c+l*l;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(h>1e-6)if(Math.abs(l*a-s*c)>1e-6&&i){var f=e-o,d=r-u,p=a*a+s*s,g=f*f+d*d,v=Math.sqrt(p),y=Math.sqrt(h),m=i*Math.tan(($e-Math.acos((p+h-g)/(2*v*y)))/2),_=m/y,w=m/v;Math.abs(_-1)>1e-6&&(this._+="L"+(t+_*c)+","+(n+_*l)),this._+="A"+i+","+i+",0,0,"+ +(l*f>c*d)+","+(this._x1=t+w*a)+","+(this._y1=n+w*s)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,e,r,i,o){t=+t,n=+n,o=!!o;var u=(e=+e)*Math.cos(r),a=e*Math.sin(r),s=t+u,c=n+a,l=1^o,h=o?r-i:i-r;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+s+","+c:(Math.abs(this._x1-s)>1e-6||Math.abs(this._y1-c)>1e-6)&&(this._+="L"+s+","+c),e&&(h<0&&(h=h%Be+Be),h>Ze?this._+="A"+e+","+e+",0,1,"+l+","+(t-u)+","+(n-a)+"A"+e+","+e+",0,1,"+l+","+(this._x1=s)+","+(this._y1=c):h>1e-6&&(this._+="A"+e+","+e+",0,"+ +(h>=$e)+","+l+","+(this._x1=t+e*Math.cos(i))+","+(this._y1=n+e*Math.sin(i))))},rect:function(t,n,e,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +r+"h"+-e+"Z"},toString:function(){return this._}};function Je(){}function Ke(t,n){var e=new Je;if(t instanceof Je)t.each((function(t,n){e.set(n,t)}));else if(Array.isArray(t)){var r,i=-1,o=t.length;if(null==n)for(;++i<o;)e.set(i,t[i]);else for(;++i<o;)e.set(n(r=t[i],i,t),r)}else if(t)for(var u in t)e.set(u,t[u]);return e}Je.prototype=Ke.prototype={constructor:Je,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,n){return this["$"+t]=n,this},remove:function(t){var n="$"+t;return n in this&&delete this[n]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(n.slice(1));return t},values:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(this[n]);return t},entries:function(){var t=[];for(var n in this)"$"===n[0]&&t.push({key:n.slice(1),value:this[n]});return t},size:function(){var t=0;for(var n in this)"$"===n[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var n in this)"$"===n[0]&&t(this[n],n.slice(1),this)}};var tr=Ke;function nr(){}var er=tr.prototype;function rr(t,n){var e=new nr;if(t instanceof nr)t.each((function(t){e.add(t)}));else if(t){var r=-1,i=t.length;if(null==n)for(;++r<i;)e.add(t[r]);else for(;++r<i;)e.add(n(t[r],r,t))}return e}nr.prototype=rr.prototype={constructor:nr,has:er.has,add:function(t){return this["$"+(t+="")]=t,this},remove:er.remove,clear:er.clear,values:er.keys,size:er.size,empty:er.empty,each:er.each};var ir=function(t,n){return t<n?-1:t>n?1:t>=n?0:NaN};var or=function(t){return 1===t.length&&(t=function(t){return function(n,e){return ir(t(n),e)}}(t)),{left:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r<i;){var o=r+i>>>1;t(n[o],e)<0?r=o+1:i=o}return r},right:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r<i;){var o=r+i>>>1;t(n[o],e)>0?i=o:r=o+1}return r}}}(ir);or.right,or.left;var ur=Array.prototype;ur.slice,ur.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2);Array.prototype.slice;var ar=function(t){return function(){return t}};function sr(t,n,e,r,i,o,u,a,s,c){this.target=t,this.type=n,this.subject=e,this.identifier=r,this.active=i,this.x=o,this.y=u,this.dx=a,this.dy=s,this._=c}function cr(){return!pt.ctrlKey&&!pt.button}function lr(){return this.parentNode}function hr(t){return null==t?{x:pt.x,y:pt.y}:t}function fr(){return navigator.maxTouchPoints||"ontouchstart"in this}sr.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var dr={},pr={},gr=34,vr=10,yr=13;function mr(t){return new Function("d","return {"+t.map((function(t,n){return JSON.stringify(t)+": d["+n+'] || ""'})).join(",")+"}")}function _r(t){var n=Object.create(null),e=[];return t.forEach((function(t){for(var r in t)r in n||e.push(n[r]=r)})),e}function wr(t,n){var e=t+"",r=e.length;return r<n?new Array(n-r+1).join(0)+e:e}function xr(t){var n,e=t.getUTCHours(),r=t.getUTCMinutes(),i=t.getUTCSeconds(),o=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((n=t.getUTCFullYear())<0?"-"+wr(-n,6):n>9999?"+"+wr(n,6):wr(n,4))+"-"+wr(t.getUTCMonth()+1,2)+"-"+wr(t.getUTCDate(),2)+(o?"T"+wr(e,2)+":"+wr(r,2)+":"+wr(i,2)+"."+wr(o,3)+"Z":i?"T"+wr(e,2)+":"+wr(r,2)+":"+wr(i,2)+"Z":r||e?"T"+wr(e,2)+":"+wr(r,2)+"Z":"")}var Mr=function(t){var n=new RegExp('["'+t+"\n\r]"),e=t.charCodeAt(0);function r(t,n){var r,i=[],o=t.length,u=0,a=0,s=o<=0,c=!1;function l(){if(s)return pr;if(c)return c=!1,dr;var n,r,i=u;if(t.charCodeAt(i)===gr){for(;u++<o&&t.charCodeAt(u)!==gr||t.charCodeAt(++u)===gr;);return(n=u)>=o?s=!0:(r=t.charCodeAt(u++))===vr?c=!0:r===yr&&(c=!0,t.charCodeAt(u)===vr&&++u),t.slice(i+1,n-1).replace(/""/g,'"')}for(;u<o;){if((r=t.charCodeAt(n=u++))===vr)c=!0;else if(r===yr)c=!0,t.charCodeAt(u)===vr&&++u;else if(r!==e)continue;return t.slice(i,n)}return s=!0,t.slice(i,o)}for(t.charCodeAt(o-1)===vr&&--o,t.charCodeAt(o-1)===yr&&--o;(r=l())!==pr;){for(var h=[];r!==dr&&r!==pr;)h.push(r),r=l();n&&null==(h=n(h,a++))||i.push(h)}return i}function i(n,e){return n.map((function(n){return e.map((function(t){return u(n[t])})).join(t)}))}function o(n){return n.map(u).join(t)}function u(t){return null==t?"":t instanceof Date?xr(t):n.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,n){var e,i,o=r(t,(function(t,r){if(e)return e(t,r-1);i=t,e=n?function(t,n){var e=mr(t);return function(r,i){return n(e(r),i,t)}}(t,n):mr(t)}));return o.columns=i||[],o},parseRows:r,format:function(n,e){return null==e&&(e=_r(n)),[e.map(u).join(t)].concat(i(n,e)).join("\n")},formatBody:function(t,n){return null==n&&(n=_r(t)),i(t,n).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:u}},br=Mr(","),Nr=br.parse,Cr=(br.parseRows,br.format,br.formatBody,br.formatRows,br.formatRow,br.formatValue,Mr("\t")),kr=Cr.parse;Cr.parseRows,Cr.format,Cr.formatBody,Cr.formatRows,Cr.formatRow,Cr.formatValue;function Tr(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}var Ar=function(t,n){return fetch(t,n).then(Tr)};function Ur(t){return function(n,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=void 0),Ar(n,e).then((function(n){return t(n,r)}))}}Ur(Nr),Ur(kr);function zr(t){return function(n,e){return Ar(n,e).then((function(n){return(new DOMParser).parseFromString(n,t)}))}}zr("application/xml"),zr("text/html"),zr("image/svg+xml");var Dr=function(t){return function(){return t}},Sr=function(){return 1e-6*(Math.random()-.5)};function Lr(t,n,e,r){if(isNaN(n)||isNaN(e))return t;var i,o,u,a,s,c,l,h,f,d=t._root,p={data:r},g=t._x0,v=t._y0,y=t._x1,m=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((c=n>=(o=(g+y)/2))?g=o:y=o,(l=e>=(u=(v+m)/2))?v=u:m=u,i=d,!(d=d[h=l<<1|c]))return i[h]=p,t;if(a=+t._x.call(null,d.data),s=+t._y.call(null,d.data),n===a&&e===s)return p.next=d,i?i[h]=p:t._root=p,t;do{i=i?i[h]=new Array(4):t._root=new Array(4),(c=n>=(o=(g+y)/2))?g=o:y=o,(l=e>=(u=(v+m)/2))?v=u:m=u}while((h=l<<1|c)==(f=(s>=u)<<1|a>=o));return i[f]=d,i[h]=p,t}var Er=function(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i};function Rr(t){return t[0]}function Pr(t){return t[1]}function Fr(t,n,e){var r=new qr(null==n?Rr:n,null==e?Pr:e,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function qr(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 Yr(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}var jr=Fr.prototype=qr.prototype;function Hr(t){return t.x+t.vx}function Or(t){return t.y+t.vy}jr.copy=function(){var t,n,e=new qr(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=Yr(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]=Yr(n));return e},jr.add=function(t){var n=+this._x.call(null,t),e=+this._y.call(null,t);return Lr(this.cover(n,e),n,e,t)},jr.addAll=function(t){var n,e,r,i,o=t.length,u=new Array(o),a=new Array(o),s=1/0,c=1/0,l=-1/0,h=-1/0;for(e=0;e<o;++e)isNaN(r=+this._x.call(null,n=t[e]))||isNaN(i=+this._y.call(null,n))||(u[e]=r,a[e]=i,r<s&&(s=r),r>l&&(l=r),i<c&&(c=i),i>h&&(h=i));if(s>l||c>h)return this;for(this.cover(s,c).cover(l,h),e=0;e<o;++e)Lr(this,u[e],a[e],t[e]);return this},jr.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 u,a,s=i-e,c=this._root;e>t||t>=i||r>n||n>=o;)switch(a=(n<r)<<1|t<e,(u=new Array(4))[a]=c,c=u,s*=2,a){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=c)}return this._x0=e,this._y0=r,this._x1=i,this._y1=o,this},jr.data=function(){var t=[];return this.visit((function(n){if(!n.length)do{t.push(n.data)}while(n=n.next)})),t},jr.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]]},jr.find=function(t,n,e){var r,i,o,u,a,s,c,l=this._x0,h=this._y0,f=this._x1,d=this._y1,p=[],g=this._root;for(g&&p.push(new Er(g,l,h,f,d)),null==e?e=1/0:(l=t-e,h=n-e,f=t+e,d=n+e,e*=e);s=p.pop();)if(!(!(g=s.node)||(i=s.x0)>f||(o=s.y0)>d||(u=s.x1)<l||(a=s.y1)<h))if(g.length){var v=(i+u)/2,y=(o+a)/2;p.push(new Er(g[3],v,y,u,a),new Er(g[2],i,y,v,a),new Er(g[1],v,o,u,y),new Er(g[0],i,o,v,y)),(c=(n>=y)<<1|t>=v)&&(s=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=s)}else{var m=t-+this._x.call(null,g.data),_=n-+this._y.call(null,g.data),w=m*m+_*_;if(w<e){var x=Math.sqrt(e=w);l=t-x,h=n-x,f=t+x,d=n+x,r=g.data}}return r},jr.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(u=+this._y.call(null,t)))return this;var n,e,r,i,o,u,a,s,c,l,h,f,d=this._root,p=this._x0,g=this._y0,v=this._x1,y=this._y1;if(!d)return this;if(d.length)for(;;){if((c=o>=(a=(p+v)/2))?p=a:v=a,(l=u>=(s=(g+y)/2))?g=s:y=s,n=d,!(d=d[h=l<<1|c]))return this;if(!d.length)break;(n[h+1&3]||n[h+2&3]||n[h+3&3])&&(e=n,f=h)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):n?(i?n[h]=i:delete n[h],(d=n[0]||n[1]||n[2]||n[3])&&d===(n[3]||n[2]||n[1]||n[0])&&!d.length&&(e?e[f]=d:this._root=d),this):(this._root=i,this)},jr.removeAll=function(t){for(var n=0,e=t.length;n<e;++n)this.remove(t[n]);return this},jr.root=function(){return this._root},jr.size=function(){var t=0;return this.visit((function(n){if(!n.length)do{++t}while(n=n.next)})),t},jr.visit=function(t){var n,e,r,i,o,u,a=[],s=this._root;for(s&&a.push(new Er(s,this._x0,this._y0,this._x1,this._y1));n=a.pop();)if(!t(s=n.node,r=n.x0,i=n.y0,o=n.x1,u=n.y1)&&s.length){var c=(r+o)/2,l=(i+u)/2;(e=s[3])&&a.push(new Er(e,c,l,o,u)),(e=s[2])&&a.push(new Er(e,r,l,c,u)),(e=s[1])&&a.push(new Er(e,c,i,o,l)),(e=s[0])&&a.push(new Er(e,r,i,c,l))}return this},jr.visitAfter=function(t){var n,e=[],r=[];for(this._root&&e.push(new Er(this._root,this._x0,this._y0,this._x1,this._y1));n=e.pop();){var i=n.node;if(i.length){var o,u=n.x0,a=n.y0,s=n.x1,c=n.y1,l=(u+s)/2,h=(a+c)/2;(o=i[0])&&e.push(new Er(o,u,a,l,h)),(o=i[1])&&e.push(new Er(o,l,a,s,h)),(o=i[2])&&e.push(new Er(o,u,h,l,c)),(o=i[3])&&e.push(new Er(o,l,h,s,c))}r.push(n)}for(;n=r.pop();)t(n.node,n.x0,n.y0,n.x1,n.y1);return this},jr.x=function(t){return arguments.length?(this._x=t,this):this._x},jr.y=function(t){return arguments.length?(this._y=t,this):this._y};function Xr(t){return t.index}function Ir(t,n){var e=t.get(n);if(!e)throw new Error("missing: "+n);return e}function Vr(t){return t.x}function Wr(t){return t.y}var $r=10,Br=Math.PI*(3-Math.sqrt(5)),Zr=function(){return Math.random()},Gr=(function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,1===arguments.length?(e=t,t=0):e-=t,function(){return n()*e+t}}return e.source=t,e}(Zr),function t(n){function e(t,e){var r,i;return t=null==t?0:+t,e=null==e?1:+e,function(){var o;if(null!=r)o=r,r=null;else do{r=2*n()-1,o=2*n()-1,i=r*r+o*o}while(!i||i>1);return t+e*o*Math.sqrt(-2*Math.log(i)/i)}}return e.source=t,e}(Zr)),Qr=(function t(n){function e(){var t=Gr.source(n).apply(this,arguments);return function(){return Math.exp(t())}}return e.source=t,e}(Zr),function t(n){function e(t){return function(){for(var e=0,r=0;r<t;++r)e+=n();return e}}return e.source=t,e}(Zr));(function t(n){function e(t){var e=Qr.source(n)(t);return function(){return e()/t}}return e.source=t,e})(Zr),function t(n){function e(t){return function(){return-Math.log(1-n())/t}}return e.source=t,e}(Zr);var Jr=Array.prototype;Jr.map,Jr.slice;var Kr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ti(t){if(!(n=Kr.exec(t)))throw new Error("invalid format: "+t);var n;return new ni({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 ni(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+""}ti.prototype=ni.prototype,ni.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 ei,ri,ii=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)]},oi=function(t){return(t=ii(Math.abs(t)))?t[1]:NaN},ui=function(t){t:for(var n,e=t.length,r=1,i=-1;r<e;++r)switch(t[r]){case".":i=n=r;break;case"0":0===i&&(i=r),n=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(n+1):t},ai=function(t,n){var e=ii(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")},si={"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return ai(100*t,n)},r:ai,s:function(t,n){var e=ii(t,n);if(!e)return t+"";var r=e[0],i=e[1],o=i-(ei=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,u=r.length;return o===u?r:o>u?r+new Array(o-u+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+ii(t,Math.max(0,n+o-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},ci=function(t){return t},li=Array.prototype.map,hi=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];ri=function(t){var n,e,r=void 0===t.grouping||void 0===t.thousands?ci:(n=li.call(t.grouping,Number),e=t.thousands+"",function(t,r){for(var i=t.length,o=[],u=0,a=n[0],s=0;i>0&&a>0&&(s+a+1>r&&(a=Math.max(1,r-s)),o.push(t.substring(i-=a,i+a)),!((s+=a+1)>r));)a=n[u=(u+1)%n.length];return o.reverse().join(e)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",u=void 0===t.decimal?".":t.decimal+"",a=void 0===t.numerals?ci:function(t){return function(n){return n.replace(/[0-9]/g,(function(n){return t[+n]}))}}(li.call(t.numerals,String)),s=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"-":t.minus+"",l=void 0===t.nan?"NaN":t.nan+"";function h(t){var n=(t=ti(t)).fill,e=t.align,h=t.sign,f=t.symbol,d=t.zero,p=t.width,g=t.comma,v=t.precision,y=t.trim,m=t.type;"n"===m?(g=!0,m="g"):si[m]||(void 0===v&&(v=12),y=!0,m="g"),(d||"0"===n&&"="===e)&&(d=!0,n="0",e="=");var _="$"===f?i:"#"===f&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",w="$"===f?o:/[%p]/.test(m)?s:"",x=si[m],M=/[defgprs%]/.test(m);function b(t){var i,o,s,f=_,b=w;if("c"===m)b=x(t)+b,t="";else{var N=(t=+t)<0;if(t=isNaN(t)?l:x(Math.abs(t),v),y&&(t=ui(t)),N&&0==+t&&(N=!1),f=(N?"("===h?h:c:"-"===h||"("===h?"":h)+f,b=("s"===m?hi[8+ei/3]:"")+b+(N&&"("===h?")":""),M)for(i=-1,o=t.length;++i<o;)if(48>(s=t.charCodeAt(i))||s>57){b=(46===s?u+t.slice(i+1):t.slice(i))+b,t=t.slice(0,i);break}}g&&!d&&(t=r(t,1/0));var C=f.length+t.length+b.length,k=C<p?new Array(p-C+1).join(n):"";switch(g&&d&&(t=r(k+t,k.length?p-b.length:1/0),k=""),e){case"<":t=f+t+b+k;break;case"=":t=f+k+t+b;break;case"^":t=k.slice(0,C=k.length>>1)+f+t+b+k.slice(C);break;default:t=k+f+t+b}return a(t)}return v=void 0===v?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v)),b.toString=function(){return t+""},b}return{format:h,formatPrefix:function(t,n){var e=h(((t=ti(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(oi(n)/3))),i=Math.pow(10,-r),o=hi[8+r/3];return function(t){return e(i*t)+o}}}}({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),ri.format,ri.formatPrefix;var fi=new Date,di=new Date;function pi(t,n,e,r){function i(n){return t(n=0===arguments.length?new Date:new Date(+n)),n}return i.floor=function(n){return t(n=new Date(+n)),n},i.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},i.round=function(t){var n=i(t),e=i.ceil(t);return t-n<e-t?n:e},i.offset=function(t,e){return n(t=new Date(+t),null==e?1:Math.floor(e)),t},i.range=function(e,r,o){var u,a=[];if(e=i.ceil(e),o=null==o?1:Math.floor(o),!(e<r&&o>0))return a;do{a.push(u=new Date(+e)),n(e,o),t(e)}while(u<e&&e<r);return a},i.filter=function(e){return pi((function(n){if(n>=n)for(;t(n),!e(n);)n.setTime(n-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;n(t,-1),!e(t););else for(;--r>=0;)for(;n(t,1),!e(t););}))},e&&(i.count=function(n,r){return fi.setTime(+n),di.setTime(+r),t(fi),t(di),Math.floor(e(fi,di))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(n){return r(n)%t==0}:function(n){return i.count(0,n)%t==0}):i:null}),i}var gi=pi((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n)}),(function(t,n){return n.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));gi.every=function(t){return isFinite(t=Math.floor(t))&&t>0?pi((function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)}),(function(n,e){n.setFullYear(n.getFullYear()+e*t)})):null};var vi=gi,yi=(gi.range,pi((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,n){t.setMonth(t.getMonth()+n)}),(function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()}))),mi=(yi.range,6e4),_i=6048e5;function wi(t){return pi((function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)}),(function(t,n){t.setDate(t.getDate()+7*n)}),(function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*mi)/_i}))}var xi=wi(0),Mi=wi(1),bi=wi(2),Ni=wi(3),Ci=wi(4),ki=wi(5),Ti=wi(6),Ai=(xi.range,Mi.range,bi.range,Ni.range,Ci.range,ki.range,Ti.range,pi((function(t){t.setHours(0,0,0,0)}),(function(t,n){t.setDate(t.getDate()+n)}),(function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*mi)/864e5}),(function(t){return t.getDate()-1}))),Ui=Ai,zi=(Ai.range,pi((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-t.getMinutes()*mi)}),(function(t,n){t.setTime(+t+36e5*n)}),(function(t,n){return(n-t)/36e5}),(function(t){return t.getHours()}))),Di=(zi.range,pi((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,n){t.setTime(+t+n*mi)}),(function(t,n){return(n-t)/mi}),(function(t){return t.getMinutes()}))),Si=(Di.range,pi((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,n){t.setTime(+t+1e3*n)}),(function(t,n){return(n-t)/1e3}),(function(t){return t.getUTCSeconds()}))),Li=(Si.range,pi((function(){}),(function(t,n){t.setTime(+t+n)}),(function(t,n){return n-t})));Li.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?pi((function(n){n.setTime(Math.floor(n/t)*t)}),(function(n,e){n.setTime(+n+e*t)}),(function(n,e){return(e-n)/t})):Li:null};Li.range;function Ei(t){return pi((function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+7*n)}),(function(t,n){return(n-t)/_i}))}var Ri=Ei(0),Pi=Ei(1),Fi=Ei(2),qi=Ei(3),Yi=Ei(4),ji=Ei(5),Hi=Ei(6),Oi=(Ri.range,Pi.range,Fi.range,qi.range,Yi.range,ji.range,Hi.range,pi((function(t){t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+n)}),(function(t,n){return(n-t)/864e5}),(function(t){return t.getUTCDate()-1}))),Xi=Oi,Ii=(Oi.range,pi((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)}),(function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()})));Ii.every=function(t){return isFinite(t=Math.floor(t))&&t>0?pi((function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)}),(function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)})):null};var Vi=Ii;Ii.range;function Wi(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function $i(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Bi(t,n,e){return{y:t,m:n,d:e,H:0,M:0,S:0,L:0}}var Zi,Gi={"-":"",_:" ",0:"0"},Qi=/^\s*\d+/,Ji=/^%/,Ki=/[\\^$*+?|[\]().{}]/g;function to(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o<e?new Array(e-o+1).join(n)+i:i)}function no(t){return t.replace(Ki,"\\$&")}function eo(t){return new RegExp("^(?:"+t.map(no).join("|")+")","i")}function ro(t){for(var n={},e=-1,r=t.length;++e<r;)n[t[e].toLowerCase()]=e;return n}function io(t,n,e){var r=Qi.exec(n.slice(e,e+1));return r?(t.w=+r[0],e+r[0].length):-1}function oo(t,n,e){var r=Qi.exec(n.slice(e,e+1));return r?(t.u=+r[0],e+r[0].length):-1}function uo(t,n,e){var r=Qi.exec(n.slice(e,e+2));return r?(t.U=+r[0],e+r[0].length):-1}function ao(t,n,e){var r=Qi.exec(n.slice(e,e+2));return r?(t.V=+r[0],e+r[0].length):-1}function so(t,n,e){var r=Qi.exec(n.slice(e,e+2));return r?(t.W=+r[0],e+r[0].length):-1}function co(t,n,e){var r=Qi.exec(n.slice(e,e+4));return r?(t.y=+r[0],e+r[0].length):-1}function lo(t,n,e){var r=Qi.exec(n.slice(e,e+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),e+r[0].length):-1}function ho(t,n,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function fo(t,n,e){var r=Qi.exec(n.slice(e,e+1));return r?(t.q=3*r[0]-3,e+r[0].length):-1}function po(t,n,e){var r=Qi.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function go(t,n,e){var r=Qi.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function vo(t,n,e){var r=Qi.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function yo(t,n,e){var r=Qi.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function mo(t,n,e){var r=Qi.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function _o(t,n,e){var r=Qi.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function wo(t,n,e){var r=Qi.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function xo(t,n,e){var r=Qi.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function Mo(t,n,e){var r=Ji.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function bo(t,n,e){var r=Qi.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function No(t,n,e){var r=Qi.exec(n.slice(e));return r?(t.s=+r[0],e+r[0].length):-1}function Co(t,n){return to(t.getDate(),n,2)}function ko(t,n){return to(t.getHours(),n,2)}function To(t,n){return to(t.getHours()%12||12,n,2)}function Ao(t,n){return to(1+Ui.count(vi(t),t),n,3)}function Uo(t,n){return to(t.getMilliseconds(),n,3)}function zo(t,n){return Uo(t,n)+"000"}function Do(t,n){return to(t.getMonth()+1,n,2)}function So(t,n){return to(t.getMinutes(),n,2)}function Lo(t,n){return to(t.getSeconds(),n,2)}function Eo(t){var n=t.getDay();return 0===n?7:n}function Ro(t,n){return to(xi.count(vi(t)-1,t),n,2)}function Po(t,n){var e=t.getDay();return t=e>=4||0===e?Ci(t):Ci.ceil(t),to(Ci.count(vi(t),t)+(4===vi(t).getDay()),n,2)}function Fo(t){return t.getDay()}function qo(t,n){return to(Mi.count(vi(t)-1,t),n,2)}function Yo(t,n){return to(t.getFullYear()%100,n,2)}function jo(t,n){return to(t.getFullYear()%1e4,n,4)}function Ho(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+to(n/60|0,"0",2)+to(n%60,"0",2)}function Oo(t,n){return to(t.getUTCDate(),n,2)}function Xo(t,n){return to(t.getUTCHours(),n,2)}function Io(t,n){return to(t.getUTCHours()%12||12,n,2)}function Vo(t,n){return to(1+Xi.count(Vi(t),t),n,3)}function Wo(t,n){return to(t.getUTCMilliseconds(),n,3)}function $o(t,n){return Wo(t,n)+"000"}function Bo(t,n){return to(t.getUTCMonth()+1,n,2)}function Zo(t,n){return to(t.getUTCMinutes(),n,2)}function Go(t,n){return to(t.getUTCSeconds(),n,2)}function Qo(t){var n=t.getUTCDay();return 0===n?7:n}function Jo(t,n){return to(Ri.count(Vi(t)-1,t),n,2)}function Ko(t,n){var e=t.getUTCDay();return t=e>=4||0===e?Yi(t):Yi.ceil(t),to(Yi.count(Vi(t),t)+(4===Vi(t).getUTCDay()),n,2)}function tu(t){return t.getUTCDay()}function nu(t,n){return to(Pi.count(Vi(t)-1,t),n,2)}function eu(t,n){return to(t.getUTCFullYear()%100,n,2)}function ru(t,n){return to(t.getUTCFullYear()%1e4,n,4)}function iu(){return"+0000"}function ou(){return"%"}function uu(t){return+t}function au(t){return Math.floor(+t/1e3)}!function(t){Zi=function(t){var n=t.dateTime,e=t.date,r=t.time,i=t.periods,o=t.days,u=t.shortDays,a=t.months,s=t.shortMonths,c=eo(i),l=ro(i),h=eo(o),f=ro(o),d=eo(u),p=ro(u),g=eo(a),v=ro(a),y=eo(s),m=ro(s),_={a:function(t){return u[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return s[t.getMonth()]},B:function(t){return a[t.getMonth()]},c:null,d:Co,e:Co,f:zo,H:ko,I:To,j:Ao,L:Uo,m:Do,M:So,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:uu,s:au,S:Lo,u:Eo,U:Ro,V:Po,w:Fo,W:qo,x:null,X:null,y:Yo,Y:jo,Z:Ho,"%":ou},w={a:function(t){return u[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return s[t.getUTCMonth()]},B:function(t){return a[t.getUTCMonth()]},c:null,d:Oo,e:Oo,f:$o,H:Xo,I:Io,j:Vo,L:Wo,m:Bo,M:Zo,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:uu,s:au,S:Go,u:Qo,U:Jo,V:Ko,w:tu,W:nu,x:null,X:null,y:eu,Y:ru,Z:iu,"%":ou},x={a:function(t,n,e){var r=d.exec(n.slice(e));return r?(t.w=p[r[0].toLowerCase()],e+r[0].length):-1},A:function(t,n,e){var r=h.exec(n.slice(e));return r?(t.w=f[r[0].toLowerCase()],e+r[0].length):-1},b:function(t,n,e){var r=y.exec(n.slice(e));return r?(t.m=m[r[0].toLowerCase()],e+r[0].length):-1},B:function(t,n,e){var r=g.exec(n.slice(e));return r?(t.m=v[r[0].toLowerCase()],e+r[0].length):-1},c:function(t,e,r){return N(t,n,e,r)},d:go,e:go,f:xo,H:yo,I:yo,j:vo,L:wo,m:po,M:mo,p:function(t,n,e){var r=c.exec(n.slice(e));return r?(t.p=l[r[0].toLowerCase()],e+r[0].length):-1},q:fo,Q:bo,s:No,S:_o,u:oo,U:uo,V:ao,w:io,W:so,x:function(t,n,r){return N(t,e,n,r)},X:function(t,n,e){return N(t,r,n,e)},y:lo,Y:co,Z:ho,"%":Mo};function M(t,n){return function(e){var r,i,o,u=[],a=-1,s=0,c=t.length;for(e instanceof Date||(e=new Date(+e));++a<c;)37===t.charCodeAt(a)&&(u.push(t.slice(s,a)),null!=(i=Gi[r=t.charAt(++a)])?r=t.charAt(++a):i="e"===r?" ":"0",(o=n[r])&&(r=o(e,i)),u.push(r),s=a+1);return u.push(t.slice(s,a)),u.join("")}}function b(t,n){return function(e){var r,i,o=Bi(1900,void 0,1);if(N(o,t,e+="",0)!=e.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(!n||"Z"in o||(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=$i(Bi(o.y,0,1))).getUTCDay(),r=i>4||0===i?Pi.ceil(r):Pi(r),r=Xi.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=Wi(Bi(o.y,0,1))).getDay(),r=i>4||0===i?Mi.ceil(r):Mi(r),r=Ui.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?$i(Bi(o.y,0,1)).getUTCDay():Wi(Bi(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,$i(o)):Wi(o)}}function N(t,n,e,r){for(var i,o,u=0,a=n.length,s=e.length;u<a;){if(r>=s)return-1;if(37===(i=n.charCodeAt(u++))){if(i=n.charAt(u++),!(o=x[i in Gi?n.charAt(u++):i])||(r=o(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}return(_.x=M(e,_),_.X=M(r,_),_.c=M(n,_),w.x=M(e,w),w.X=M(r,w),w.c=M(n,w),{format:function(t){var n=M(t+="",_);return n.toString=function(){return t},n},parse:function(t){var n=b(t+="",!1);return n.toString=function(){return t},n},utcFormat:function(t){var n=M(t+="",w);return n.toString=function(){return t},n},utcParse:function(t){var n=b(t+="",!0);return n.toString=function(){return t},n}})}(t),Zi.format,Zi.parse,Zi.utcFormat,Zi.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var su=pi((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCMonth(t.getUTCMonth()+n)}),(function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),cu=(su.range,pi((function(t){t.setUTCMinutes(0,0,0)}),(function(t,n){t.setTime(+t+36e5*n)}),(function(t,n){return(n-t)/36e5}),(function(t){return t.getUTCHours()}))),lu=(cu.range,pi((function(t){t.setUTCSeconds(0,0)}),(function(t,n){t.setTime(+t+n*mi)}),(function(t,n){return(n-t)/mi}),(function(t){return t.getUTCMinutes()})));lu.range;function hu(){this._=null}function fu(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function du(t,n){var e=n,r=n.R,i=e.U;i?i.L===e?i.L=r:i.R=r:t._=r,r.U=i,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function pu(t,n){var e=n,r=n.L,i=e.U;i?i.L===e?i.L=r:i.R=r:t._=r,r.U=i,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function gu(t){for(;t.L;)t=t.L;return t}hu.prototype={constructor:hu,insert:function(t,n){var e,r,i;if(t){if(n.P=t,n.N=t.N,t.N&&(t.N.P=n),t.N=n,t.R){for(t=t.R;t.L;)t=t.L;t.L=n}else t.R=n;e=t}else this._?(t=gu(this._),n.P=null,n.N=t,t.P=t.L=n,e=t):(n.P=n.N=null,this._=n,e=null);for(n.L=n.R=null,n.U=e,n.C=!0,t=n;e&&e.C;)e===(r=e.U).L?(i=r.R)&&i.C?(e.C=i.C=!1,r.C=!0,t=r):(t===e.R&&(du(this,e),e=(t=e).U),e.C=!1,r.C=!0,pu(this,r)):(i=r.L)&&i.C?(e.C=i.C=!1,r.C=!0,t=r):(t===e.L&&(pu(this,e),e=(t=e).U),e.C=!1,r.C=!0,du(this,r)),e=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var n,e,r,i=t.U,o=t.L,u=t.R;if(e=o?u?gu(u):o:u,i?i.L===t?i.L=e:i.R=e:this._=e,o&&u?(r=e.C,e.C=t.C,e.L=o,o.U=e,e!==u?(i=e.U,e.U=t.U,t=e.R,i.L=t,e.R=u,u.U=e):(e.U=i,i=e,t=e.R)):(r=t.C,t=e),t&&(t.U=i),!r)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((n=i.R).C&&(n.C=!1,i.C=!0,du(this,i),n=i.R),n.L&&n.L.C||n.R&&n.R.C){n.R&&n.R.C||(n.L.C=!1,n.C=!0,pu(this,n),n=i.R),n.C=i.C,i.C=n.R.C=!1,du(this,i),t=this._;break}}else if((n=i.L).C&&(n.C=!1,i.C=!0,pu(this,i),n=i.L),n.L&&n.L.C||n.R&&n.R.C){n.L&&n.L.C||(n.R.C=!1,n.C=!0,du(this,n),n=i.L),n.C=i.C,i.C=n.L.C=!1,pu(this,i),t=this._;break}n.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}};var vu=hu;function yu(t,n,e,r){var i=[null,null],o=Hu.push(i)-1;return i.left=t,i.right=n,e&&_u(i,t,n,e),r&&_u(i,n,t,r),Yu[t.index].halfedges.push(o),Yu[n.index].halfedges.push(o),i}function mu(t,n,e){var r=[n,e];return r.left=t,r}function _u(t,n,e,r){t[0]||t[1]?t.left===e?t[1]=r:t[0]=r:(t[0]=r,t.left=n,t.right=e)}function wu(t,n,e,r,i){var o,u=t[0],a=t[1],s=u[0],c=u[1],l=0,h=1,f=a[0]-s,d=a[1]-c;if(o=n-s,f||!(o>0)){if(o/=f,f<0){if(o<l)return;o<h&&(h=o)}else if(f>0){if(o>h)return;o>l&&(l=o)}if(o=r-s,f||!(o<0)){if(o/=f,f<0){if(o>h)return;o>l&&(l=o)}else if(f>0){if(o<l)return;o<h&&(h=o)}if(o=e-c,d||!(o>0)){if(o/=d,d<0){if(o<l)return;o<h&&(h=o)}else if(d>0){if(o>h)return;o>l&&(l=o)}if(o=i-c,d||!(o<0)){if(o/=d,d<0){if(o>h)return;o>l&&(l=o)}else if(d>0){if(o<l)return;o<h&&(h=o)}return!(l>0||h<1)||(l>0&&(t[0]=[s+l*f,c+l*d]),h<1&&(t[1]=[s+h*f,c+h*d]),!0)}}}}}function xu(t,n,e,r,i){var o=t[1];if(o)return!0;var u,a,s=t[0],c=t.left,l=t.right,h=c[0],f=c[1],d=l[0],p=l[1],g=(h+d)/2,v=(f+p)/2;if(p===f){if(g<n||g>=r)return;if(h>d){if(s){if(s[1]>=i)return}else s=[g,e];o=[g,i]}else{if(s){if(s[1]<e)return}else s=[g,i];o=[g,e]}}else if(a=v-(u=(h-d)/(p-f))*g,u<-1||u>1)if(h>d){if(s){if(s[1]>=i)return}else s=[(e-a)/u,e];o=[(i-a)/u,i]}else{if(s){if(s[1]<e)return}else s=[(i-a)/u,i];o=[(e-a)/u,e]}else if(f<p){if(s){if(s[0]>=r)return}else s=[n,u*n+a];o=[r,u*r+a]}else{if(s){if(s[0]<n)return}else s=[r,u*r+a];o=[n,u*n+a]}return t[0]=s,t[1]=o,!0}function Mu(t,n){var e=t.site,r=n.left,i=n.right;return e===i&&(i=r,r=e),i?Math.atan2(i[1]-r[1],i[0]-r[0]):(e===r?(r=n[1],i=n[0]):(r=n[0],i=n[1]),Math.atan2(r[0]-i[0],i[1]-r[1]))}function bu(t,n){return n[+(n.left!==t.site)]}function Nu(t,n){return n[+(n.left===t.site)]}var Cu,ku=[];function Tu(){fu(this),this.x=this.y=this.arc=this.site=this.cy=null}function Au(t){var n=t.P,e=t.N;if(n&&e){var r=n.site,i=t.site,o=e.site;if(r!==o){var u=i[0],a=i[1],s=r[0]-u,c=r[1]-a,l=o[0]-u,h=o[1]-a,f=2*(s*h-c*l);if(!(f>=-Xu)){var d=s*s+c*c,p=l*l+h*h,g=(h*d-c*p)/f,v=(s*p-l*d)/f,y=ku.pop()||new Tu;y.arc=t,y.site=i,y.x=g+u,y.y=(y.cy=v+a)+Math.sqrt(g*g+v*v),t.circle=y;for(var m=null,_=ju._;_;)if(y.y<_.y||y.y===_.y&&y.x<=_.x){if(!_.L){m=_.P;break}_=_.L}else{if(!_.R){m=_;break}_=_.R}ju.insert(m,y),m||(Cu=y)}}}}function Uu(t){var n=t.circle;n&&(n.P||(Cu=n.N),ju.remove(n),ku.push(n),fu(n),t.circle=null)}var zu=[];function Du(){fu(this),this.edge=this.site=this.circle=null}function Su(t){var n=zu.pop()||new Du;return n.site=t,n}function Lu(t){Uu(t),qu.remove(t),zu.push(t),fu(t)}function Eu(t){var n=t.circle,e=n.x,r=n.cy,i=[e,r],o=t.P,u=t.N,a=[t];Lu(t);for(var s=o;s.circle&&Math.abs(e-s.circle.x)<Ou&&Math.abs(r-s.circle.cy)<Ou;)o=s.P,a.unshift(s),Lu(s),s=o;a.unshift(s),Uu(s);for(var c=u;c.circle&&Math.abs(e-c.circle.x)<Ou&&Math.abs(r-c.circle.cy)<Ou;)u=c.N,a.push(c),Lu(c),c=u;a.push(c),Uu(c);var l,h=a.length;for(l=1;l<h;++l)c=a[l],s=a[l-1],_u(c.edge,s.site,c.site,i);s=a[0],(c=a[h-1]).edge=yu(s.site,c.site,null,i),Au(s),Au(c)}function Ru(t){for(var n,e,r,i,o=t[0],u=t[1],a=qu._;a;)if((r=Pu(a,u)-o)>Ou)a=a.L;else{if(!((i=o-Fu(a,u))>Ou)){r>-Ou?(n=a.P,e=a):i>-Ou?(n=a,e=a.N):n=e=a;break}if(!a.R){n=a;break}a=a.R}!function(t){Yu[t.index]={site:t,halfedges:[]}}(t);var s=Su(t);if(qu.insert(n,s),n||e){if(n===e)return Uu(n),e=Su(n.site),qu.insert(s,e),s.edge=e.edge=yu(n.site,s.site),Au(n),void Au(e);if(e){Uu(n),Uu(e);var c=n.site,l=c[0],h=c[1],f=t[0]-l,d=t[1]-h,p=e.site,g=p[0]-l,v=p[1]-h,y=2*(f*v-d*g),m=f*f+d*d,_=g*g+v*v,w=[(v*m-d*_)/y+l,(f*_-g*m)/y+h];_u(e.edge,c,p,w),s.edge=yu(c,t,null,w),e.edge=yu(t,p,null,w),Au(n),Au(e)}else s.edge=yu(n.site,s.site)}}function Pu(t,n){var e=t.site,r=e[0],i=e[1],o=i-n;if(!o)return r;var u=t.P;if(!u)return-1/0;var a=(e=u.site)[0],s=e[1],c=s-n;if(!c)return a;var l=a-r,h=1/o-1/c,f=l/c;return h?(-f+Math.sqrt(f*f-2*h*(l*l/(-2*c)-s+c/2+i-o/2)))/h+r:(r+a)/2}function Fu(t,n){var e=t.N;if(e)return Pu(e,n);var r=t.site;return r[1]===n?r[0]:1/0}var qu,Yu,ju,Hu,Ou=1e-6,Xu=1e-12;function Iu(t,n){return n[1]-t[1]||n[0]-t[0]}function Vu(t,n){var e,r,i,o=t.sort(Iu).pop();for(Hu=[],Yu=new Array(t.length),qu=new vu,ju=new vu;;)if(i=Cu,o&&(!i||o[1]<i.y||o[1]===i.y&&o[0]<i.x))o[0]===e&&o[1]===r||(Ru(o),e=o[0],r=o[1]),o=t.pop();else{if(!i)break;Eu(i.arc)}if(function(){for(var t,n,e,r,i=0,o=Yu.length;i<o;++i)if((t=Yu[i])&&(r=(n=t.halfedges).length)){var u=new Array(r),a=new Array(r);for(e=0;e<r;++e)u[e]=e,a[e]=Mu(t,Hu[n[e]]);for(u.sort((function(t,n){return a[n]-a[t]})),e=0;e<r;++e)a[e]=n[u[e]];for(e=0;e<r;++e)n[e]=a[e]}}(),n){var u=+n[0][0],a=+n[0][1],s=+n[1][0],c=+n[1][1];!function(t,n,e,r){for(var i,o=Hu.length;o--;)xu(i=Hu[o],t,n,e,r)&&wu(i,t,n,e,r)&&(Math.abs(i[0][0]-i[1][0])>Ou||Math.abs(i[0][1]-i[1][1])>Ou)||delete Hu[o]}(u,a,s,c),function(t,n,e,r){var i,o,u,a,s,c,l,h,f,d,p,g,v=Yu.length,y=!0;for(i=0;i<v;++i)if(o=Yu[i]){for(u=o.site,a=(s=o.halfedges).length;a--;)Hu[s[a]]||s.splice(a,1);for(a=0,c=s.length;a<c;)p=(d=Nu(o,Hu[s[a]]))[0],g=d[1],h=(l=bu(o,Hu[s[++a%c]]))[0],f=l[1],(Math.abs(p-h)>Ou||Math.abs(g-f)>Ou)&&(s.splice(a,0,Hu.push(mu(u,d,Math.abs(p-t)<Ou&&r-g>Ou?[t,Math.abs(h-t)<Ou?f:r]:Math.abs(g-r)<Ou&&e-p>Ou?[Math.abs(f-r)<Ou?h:e,r]:Math.abs(p-e)<Ou&&g-n>Ou?[e,Math.abs(h-e)<Ou?f:n]:Math.abs(g-n)<Ou&&p-t>Ou?[Math.abs(f-n)<Ou?h:t,n]:null))-1),++c);c&&(y=!1)}if(y){var m,_,w,x=1/0;for(i=0,y=null;i<v;++i)(o=Yu[i])&&(w=(m=(u=o.site)[0]-t)*m+(_=u[1]-n)*_)<x&&(x=w,y=o);if(y){var M=[t,n],b=[t,r],N=[e,r],C=[e,n];y.halfedges.push(Hu.push(mu(u=y.site,M,b))-1,Hu.push(mu(u,b,N))-1,Hu.push(mu(u,N,C))-1,Hu.push(mu(u,C,M))-1)}}for(i=0;i<v;++i)(o=Yu[i])&&(o.halfedges.length||delete Yu[i])}(u,a,s,c)}this.edges=Hu,this.cells=Yu,qu=ju=Hu=Yu=null}Vu.prototype={constructor:Vu,polygons:function(){var t=this.edges;return this.cells.map((function(n){var e=n.halfedges.map((function(e){return bu(n,t[e])}));return e.data=n.site.data,e}))},triangles:function(){var t=[],n=this.edges;return this.cells.forEach((function(e,r){if(o=(i=e.halfedges).length)for(var i,o,u,a,s,c,l=e.site,h=-1,f=n[i[o-1]],d=f.left===l?f.right:f.left;++h<o;)u=d,d=(f=n[i[h]]).left===l?f.right:f.left,u&&d&&r<u.index&&r<d.index&&(s=u,c=d,((a=l)[0]-c[0])*(s[1]-a[1])-(a[0]-s[0])*(c[1]-a[1])<0)&&t.push([l.data,u.data,d.data])})),t},links:function(){return this.edges.filter((function(t){return t.right})).map((function(t){return{source:t.left.data,target:t.right.data}}))},find:function(t,n,e){for(var r,i,o=this,u=o._found||0,a=o.cells.length;!(i=o.cells[u]);)if(++u>=a)return null;var s=t-i.site[0],c=n-i.site[1],l=s*s+c*c;do{i=o.cells[r=u],u=null,i.halfedges.forEach((function(e){var r=o.edges[e],a=r.left;if(a!==i.site&&a||(a=r.right)){var s=t-a[0],c=n-a[1],h=s*s+c*c;h<l&&(l=h,u=a.index)}}))}while(null!==u);return o._found=r,null==e||l<=e*e?i.site:null}};var Wu=Math.SQRT2;function $u(t){return((t=Math.exp(t))+1/t)/2}var Bu=function(t,n){var e,r,i=t[0],o=t[1],u=t[2],a=n[0],s=n[1],c=n[2],l=a-i,h=s-o,f=l*l+h*h;if(f<1e-12)r=Math.log(c/u)/Wu,e=function(t){return[i+t*l,o+t*h,u*Math.exp(Wu*t*r)]};else{var d=Math.sqrt(f),p=(c*c-u*u+4*f)/(2*u*2*d),g=(c*c-u*u-4*f)/(2*c*2*d),v=Math.log(Math.sqrt(p*p+1)-p),y=Math.log(Math.sqrt(g*g+1)-g);r=(y-v)/Wu,e=function(t){var n,e=t*r,a=$u(v),s=u/(2*d)*(a*(n=Wu*e+v,((n=Math.exp(2*n))-1)/(n+1))-function(t){return((t=Math.exp(t))-1/t)/2}(v));return[i+s*l,o+s*h,u*a/$u(Wu*e+v)]}}return e.duration=1e3*r,e},Zu=function(t){return function(){return t}};function Gu(t,n,e){this.target=t,this.type=n,this.transform=e}function Qu(t,n,e){this.k=t,this.x=n,this.y=e}Qu.prototype={constructor:Qu,scale:function(t){return 1===t?this:new Qu(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new Qu(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 Ju=new Qu(1,0,0);function Ku(){pt.stopImmediatePropagation()}Qu.prototype;var ta=function(){pt.preventDefault(),pt.stopImmediatePropagation()};function na(){return!pt.ctrlKey&&!pt.button}function ea(){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 ra(){return this.__zoom||Ju}function ia(){return-pt.deltaY*(1===pt.deltaMode?.05:pt.deltaMode?1:.002)}function oa(){return navigator.maxTouchPoints||"ontouchstart"in this}function ua(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 aa(t,n){this.svg,this.visid=function(t){var n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".split("");t||(t=Math.floor(Math.random()*n.length));for(var e="",r=0;r<t;r++)e+=n[Math.floor(Math.random()*n.length)];return e}(8),this.currentDate=Date.now()/1e3,this.link_elements,this.node_elements,this.container=!1,this.loadedNodes={},this.focusNodes=[],this.nodes,this.links,this.selected_id,this.setConfigOptions(t),this.result=n}aa.prototype.load=function(t,n){this.initD3(t),this.loadNewData(),this.updateGraph(),n&&this.updateSimulation("init")},aa.prototype.setData=function(t,n){this.result&&this.clear(),this.result=t,this.load(n)},aa.prototype.loadNewData=function(){this.nodes=this.result.getNodes().slice();for(var t=0;t<this.nodes.length;t++)this.loadedNodes[this.nodes[t].id]=this.nodes[t];this.links=this.result.getEdges()},aa.prototype.updateData=function(t,n){this.setFocusNodeFromResult(t),this.result=t,this.reload(n,"update",this.fix_nodes)},aa.prototype.setFocusNodeFromResult=function(t){var n=t.getFocusNode();n&&(this.selected_id=n,this.focusNodes.push(n))},aa.prototype.setFilter=function(t,n){this.simulation.stop(),this.reload(n,"filter",!0)},aa.prototype.wake=function(){this.simulation&&this.updateSimulation("wake")},aa.prototype.hibernate=function(){this.simulation.stop()},aa.prototype.reload=function(t,n,e){for(var r=0;r<this.nodes.length;r++)this.loadedNodes[this.nodes[r].id]=this.nodes[r];var i=this.result.getNodesAndFringes().slice();this.nodes=[];var o=this.loadedNodes[this.selected_id];for(r=0;r<i.length;r++){var u=i[r];this.loadedNodes[u.id]?u.id==this.selected_id?(this.loadedNodes[u.id].fx=this.loadedNodes[u.id].x,this.loadedNodes[u.id].fy=this.loadedNodes[u.id].y):e?this.loadedNodes[u.id].x&&(this.loadedNodes[u.id].fx=this.loadedNodes[u.id].x,this.loadedNodes[u.id].fy=this.loadedNodes[u.id].y):(this.loadedNodes[u.id].fx=null,this.loadedNodes[u.id].fy=null):(this.explode_out&&o.x&&(u.x=o.x,u.y=o.y),this.loadedNodes[u.id]=u),this.nodes.push(this.loadedNodes[u.id])}this.links=this.result.getLinks(),this.updateGraph(),t&&this.updateSimulation(n)},aa.prototype.clear=function(){this.nodes=[],this.loadedNodes={},this.links=[],this.updateGraph(),this.scale_factor=1},aa.prototype.initDOM=function(t){this.width||(this.width=this.setWidth()),this.height||(this.height=this.setHeight()),this.d3DOM=t,this.result&&this.load(!0)},aa.prototype.getAsDOM=function(){var t=document.createElement("div");return t.setAttribute("class","terminus-gviz-panel"),t.setAttribute("id",this.visid),t.setAttribute("width","100%"),this.container=t,t},aa.prototype.setWidth=function(){if(this.container&&this.container.clientWidth)this.width=this.container.clientWidth;else if(this.container.parentNode&&this.container.parentNode.clientWidth)this.width=this.container.parentNode.clientWidth;else{var t=jQuery(this.container).width();0==t&&(t=jQuery(this.container.parentNode).width()),0==t&&(t=800),this.width=t}return this.width},aa.prototype.setHeight=function(){if(this.container&&this.container.clientHeight)this.height=this.container.clientHeight;else if(this.container.parentNode&&this.container.parentNode.clientHeight)this.height=this.container.parentNode.clientHeight;else{var t=jQuery(this.container).height();0==t&&(t=jQuery(this.container.parentNode).height()),0==t&&(t=400),this.height=t}return this.height},aa.prototype.initD3=function(t){var n=this;try{At(t).selectAll("svg").remove()}catch(t){console.log("no svg")}this.svg=At(t).append("svg").attr("width",this.width).attr("height",this.height);this.simulation=function(t){var n,e=1,r=.001,i=1-Math.pow(r,1/300),o=0,u=.6,a=tr(),s=Fn(l),c=g("tick","end");function l(){h(),c.call("tick",n),e<r&&(s.stop(),c.call("end",n))}function h(r){var s,c,l=t.length;void 0===r&&(r=1);for(var h=0;h<r;++h)for(e+=(o-e)*i,a.each((function(t){t(e)})),s=0;s<l;++s)null==(c=t[s]).fx?c.x+=c.vx*=u:(c.x=c.fx,c.vx=0),null==c.fy?c.y+=c.vy*=u:(c.y=c.fy,c.vy=0);return n}function f(){for(var n,e=0,r=t.length;e<r;++e){if((n=t[e]).index=e,null!=n.fx&&(n.x=n.fx),null!=n.fy&&(n.y=n.fy),isNaN(n.x)||isNaN(n.y)){var i=$r*Math.sqrt(e),o=e*Br;n.x=i*Math.cos(o),n.y=i*Math.sin(o)}(isNaN(n.vx)||isNaN(n.vy))&&(n.vx=n.vy=0)}}function d(n){return n.initialize&&n.initialize(t),n}return null==t&&(t=[]),f(),n={tick:h,restart:function(){return s.restart(l),n},stop:function(){return s.stop(),n},nodes:function(e){return arguments.length?(t=e,f(),a.each(d),n):t},alpha:function(t){return arguments.length?(e=+t,n):e},alphaMin:function(t){return arguments.length?(r=+t,n):r},alphaDecay:function(t){return arguments.length?(i=+t,n):+i},alphaTarget:function(t){return arguments.length?(o=+t,n):o},velocityDecay:function(t){return arguments.length?(u=1-t,n):1-u},force:function(t,e){return arguments.length>1?(null==e?a.remove(t):a.set(t,d(e)),n):a.get(t)},find:function(n,e,r){var i,o,u,a,s,c=0,l=t.length;for(null==r?r=1/0:r*=r,c=0;c<l;++c)(u=(i=n-(a=t[c]).x)*i+(o=e-a.y)*o)<r&&(s=a,r=u);return s},on:function(t,e){return arguments.length>1?(c.on(t,e),n):c.on(t)}}}().force("link",function(t){var n,e,r,i,o,u=Xr,a=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},s=Dr(30),c=1;function l(r){for(var i=0,u=t.length;i<c;++i)for(var a,s,l,h,f,d,p,g=0;g<u;++g)s=(a=t[g]).source,h=(l=a.target).x+l.vx-s.x-s.vx||Sr(),f=l.y+l.vy-s.y-s.vy||Sr(),h*=d=((d=Math.sqrt(h*h+f*f))-e[g])/d*r*n[g],f*=d,l.vx-=h*(p=o[g]),l.vy-=f*p,s.vx+=h*(p=1-p),s.vy+=f*p}function h(){if(r){var a,s,c=r.length,l=t.length,h=tr(r,u);for(a=0,i=new Array(c);a<l;++a)(s=t[a]).index=a,"object"!=typeof s.source&&(s.source=Ir(h,s.source)),"object"!=typeof s.target&&(s.target=Ir(h,s.target)),i[s.source.index]=(i[s.source.index]||0)+1,i[s.target.index]=(i[s.target.index]||0)+1;for(a=0,o=new Array(l);a<l;++a)s=t[a],o[a]=i[s.source.index]/(i[s.source.index]+i[s.target.index]);n=new Array(l),f(),e=new Array(l),d()}}function f(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+a(t[e],e,t)}function d(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+s(t[n],n,t)}return null==t&&(t=[]),l.initialize=function(t){r=t,h()},l.links=function(n){return arguments.length?(t=n,h(),l):t},l.id=function(t){return arguments.length?(u=t,l):u},l.iterations=function(t){return arguments.length?(c=+t,l):c},l.strength=function(t){return arguments.length?(a="function"==typeof t?t:Dr(+t),f(),l):a},l.distance=function(t){return arguments.length?(s="function"==typeof t?t:Dr(+t),d(),l):s},l}().distance((function(t){return n.getLinkDistance(t)})).id((function(t){return t.id}))).force("charge",function(){var t,n,e,r,i=Dr(-30),o=1,u=1/0,a=.81;function s(r){var i,o=t.length,u=Fr(t,Vr,Wr).visitAfter(l);for(e=r,i=0;i<o;++i)n=t[i],u.visit(h)}function c(){if(t){var n,e,o=t.length;for(r=new Array(o),n=0;n<o;++n)e=t[n],r[e.index]=+i(e,n,t)}}function l(t){var n,e,i,o,u,a=0,s=0;if(t.length){for(i=o=u=0;u<4;++u)(n=t[u])&&(e=Math.abs(n.value))&&(a+=n.value,s+=e,i+=e*n.x,o+=e*n.y);t.x=i/s,t.y=o/s}else{(n=t).x=n.data.x,n.y=n.data.y;do{a+=r[n.data.index]}while(n=n.next)}t.value=a}function h(t,i,s,c){if(!t.value)return!0;var l=t.x-n.x,h=t.y-n.y,f=c-i,d=l*l+h*h;if(f*f/a<d)return d<u&&(0===l&&(d+=(l=Sr())*l),0===h&&(d+=(h=Sr())*h),d<o&&(d=Math.sqrt(o*d)),n.vx+=l*t.value*e/d,n.vy+=h*t.value*e/d),!0;if(!(t.length||d>=u)){(t.data!==n||t.next)&&(0===l&&(d+=(l=Sr())*l),0===h&&(d+=(h=Sr())*h),d<o&&(d=Math.sqrt(o*d)));do{t.data!==n&&(f=r[t.data.index]*e/d,n.vx+=l*f,n.vy+=h*f)}while(t=t.next)}}return s.initialize=function(n){t=n,c()},s.strength=function(t){return arguments.length?(i="function"==typeof t?t:Dr(+t),c(),s):i},s.distanceMin=function(t){return arguments.length?(o=t*t,s):Math.sqrt(o)},s.distanceMax=function(t){return arguments.length?(u=t*t,s):Math.sqrt(u)},s.theta=function(t){return arguments.length?(a=t*t,s):Math.sqrt(a)},s}().strength((function(t){return n.getCharge(t)}))).force("collision",function(t){var n,e,r=1,i=1;function o(){for(var t,o,a,s,c,l,h,f=n.length,d=0;d<i;++d)for(o=Fr(n,Hr,Or).visitAfter(u),t=0;t<f;++t)a=n[t],l=e[a.index],h=l*l,s=a.x+a.vx,c=a.y+a.vy,o.visit(p);function p(t,n,e,i,o){var u=t.data,f=t.r,d=l+f;if(!u)return n>s+d||i<s-d||e>c+d||o<c-d;if(u.index>a.index){var p=s-u.x-u.vx,g=c-u.y-u.vy,v=p*p+g*g;v<d*d&&(0===p&&(v+=(p=Sr())*p),0===g&&(v+=(g=Sr())*g),v=(d-(v=Math.sqrt(v)))/v*r,a.vx+=(p*=v)*(d=(f*=f)/(h+f)),a.vy+=(g*=v)*d,u.vx-=p*(d=1-d),u.vy-=g*d)}}}function u(t){if(t.data)return t.r=e[t.data.index];for(var n=t.r=0;n<4;++n)t[n]&&t[n].r>t.r&&(t.r=t[n].r)}function a(){if(n){var r,i,o=n.length;for(e=new Array(o),r=0;r<o;++r)i=n[r],e[i.index]=+t(i,r,n)}}return"function"!=typeof t&&(t=Dr(null==t?1:+t)),o.initialize=function(t){n=t,a()},o.iterations=function(t){return arguments.length?(i=+t,o):i},o.strength=function(t){return arguments.length?(r=+t,o):r},o.radius=function(n){return arguments.length?(t="function"==typeof n?n:Dr(+n),a(),o):t},o}().radius((function(t){return n.getCollisionRadius(t)}))).force("center",function(t,n){var e;function r(){var r,i,o=e.length,u=0,a=0;for(r=0;r<o;++r)u+=(i=e[r]).x,a+=i.y;for(u=u/o-t,a=a/o-n,r=0;r<o;++r)(i=e[r]).x-=u,i.y-=a}return null==t&&(t=0),null==n&&(n=0),r.initialize=function(t){e=t},r.x=function(n){return arguments.length?(t=+n,r):t},r.y=function(t){return arguments.length?(n=+t,r):n},r}(this.width/2,this.height/2)),this.drag_drop=function(){var t,n,e,r,i=cr,o=lr,u=hr,a=fr,s={},c=g("start","drag","end"),l=0,h=0;function f(t){t.on("mousedown.drag",d).filter(a).on("touchstart.drag",y).on("touchmove.drag",m).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(){if(!r&&i.apply(this,arguments)){var u=w("mouse",o.apply(this,arguments),Nn,this,arguments);u&&(At(pt.view).on("mousemove.drag",p,!0).on("mouseup.drag",v,!0),Dt(pt.view),Ut(),e=!1,t=pt.clientX,n=pt.clientY,u("start"))}}function p(){if(zt(),!e){var r=pt.clientX-t,i=pt.clientY-n;e=r*r+i*i>h}s.mouse("drag")}function v(){At(pt.view).on("mousemove.drag mouseup.drag",null),St(pt.view,e),zt(),s.mouse("end")}function y(){if(i.apply(this,arguments)){var t,n,e=pt.changedTouches,r=o.apply(this,arguments),u=e.length;for(t=0;t<u;++t)(n=w(e[t].identifier,r,bn,this,arguments))&&(Ut(),n("start"))}}function m(){var t,n,e=pt.changedTouches,r=e.length;for(t=0;t<r;++t)(n=s[e[t].identifier])&&(zt(),n("drag"))}function _(){var t,n,e=pt.changedTouches,i=e.length;for(r&&clearTimeout(r),r=setTimeout((function(){r=null}),500),t=0;t<i;++t)(n=s[e[t].identifier])&&(Ut(),n("end"))}function w(t,n,e,r,i){var o,a,h,d=e(n,t),p=c.copy();if(wt(new sr(f,"beforestart",o,t,l,d[0],d[1],0,0,p),(function(){return null!=(pt.subject=o=u.apply(r,i))&&(a=o.x-d[0]||0,h=o.y-d[1]||0,!0)})))return function u(c){var g,v=d;switch(c){case"start":s[t]=u,g=l++;break;case"end":delete s[t],--l;case"drag":d=e(n,t),g=l}wt(new sr(f,c,o,t,g,d[0]+a,d[1]+h,d[0]-v[0],d[1]-v[1],p),p.apply,p,[c,r,i])}}return f.filter=function(t){return arguments.length?(i="function"==typeof t?t:ar(!!t),f):i},f.container=function(t){return arguments.length?(o="function"==typeof t?t:ar(t),f):o},f.subject=function(t){return arguments.length?(u="function"==typeof t?t:ar(t),f):u},f.touchable=function(t){return arguments.length?(a="function"==typeof t?t:ar(!!t),f):a},f.on=function(){var t=c.on.apply(c,arguments);return t===c?f:t},f.clickDistance=function(t){return arguments.length?(h=(t=+t)*t,f):Math.sqrt(h)},f}().on("start",(function(t){t.fx=t.x,t.fy=t.y})).on("drag",(function(t){n.simulation.restart(),t.fx=pt.x,t.fy=pt.y})).on("end",(function(t){t.fx=null,t.fx=null,n.simulation.stop()})),this.svg.append("rect").attr("width",this.width).attr("height",this.height).style("fill","none").style("pointer-events","all").call(function(){var t,n,e=na,r=ea,i=ua,o=ia,u=oa,a=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],c=250,l=Bu,h=g("start","zoom","end"),f=500,d=150,p=0;function v(t){t.property("__zoom",ra).on("wheel.zoom",b).on("mousedown.zoom",N).on("dblclick.zoom",C).filter(u).on("touchstart.zoom",k).on("touchmove.zoom",T).on("touchend.zoom touchcancel.zoom",A).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(t,n){return(n=Math.max(a[0],Math.min(a[1],n)))===t.k?t:new Qu(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 Qu(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){t.on("start.zoom",(function(){x(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){x(this,arguments).end()})).tween("zoom",(function(){var t=this,i=arguments,o=x(t,i),u=r.apply(t,i),a=null==e?_(u):"function"==typeof e?e.apply(t,i):e,s=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),c=t.__zoom,h="function"==typeof n?n.apply(t,i):n,f=l(c.invert(a).concat(s/c.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 Qu(e,a[0]-n[0]*e,a[1]-n[1]*e)}o.zoom(null,t)}}))}function x(t,n,e){return!e&&t.__zooming||new M(t,n)}function M(t,n){this.that=t,this.args=n,this.active=0,this.extent=r.apply(t,n),this.taps=0}function b(){if(e.apply(this,arguments)){var t=x(this,arguments),n=this.__zoom,r=Math.max(a[0],Math.min(a[1],n.k*Math.pow(2,o.apply(this,arguments)))),u=Nn(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)],oe(this),t.start()}ta(),t.wheel=setTimeout((function(){t.wheel=null,t.end()}),d),t.zoom("mouse",i(m(y(n,r),t.mouse[0],t.mouse[1]),t.extent,s))}}function N(){if(!n&&e.apply(this,arguments)){var t=x(this,arguments,!0),r=At(pt.view).on("mousemove.zoom",(function(){if(ta(),!t.moved){var n=pt.clientX-u,e=pt.clientY-a;t.moved=n*n+e*e>p}t.zoom("mouse",i(m(t.that.__zoom,t.mouse[0]=Nn(t.that),t.mouse[1]),t.extent,s))}),!0).on("mouseup.zoom",(function(){r.on("mousemove.zoom mouseup.zoom",null),St(pt.view,t.moved),ta(),t.end()}),!0),o=Nn(this),u=pt.clientX,a=pt.clientY;Dt(pt.view),Ku(),t.mouse=[o,this.__zoom.invert(o)],oe(this),t.start()}}function C(){if(e.apply(this,arguments)){var t=this.__zoom,n=Nn(this),o=t.invert(n),u=t.k*(pt.shiftKey?.5:2),a=i(m(y(t,u),n,o),r.apply(this,arguments),s);ta(),c>0?At(this).transition().duration(c).call(w,a,n):At(this).call(v.transform,a)}}function k(){if(e.apply(this,arguments)){var n,r,i,o,u=pt.touches,a=u.length,s=x(this,arguments,pt.changedTouches.length===a);for(Ku(),r=0;r<a;++r)i=u[r],o=[o=bn(this,u,i.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}),f)),oe(this),s.start())}}function T(){if(this.__zooming){var n,e,r,o,u=x(this,arguments),a=pt.changedTouches,c=a.length;for(ta(),t&&(t=clearTimeout(t)),u.taps=0,n=0;n<c;++n)e=a[n],r=bn(this,a,e.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 l=u.touch0[0],h=u.touch0[1],f=u.touch1[0],d=u.touch1[1],p=(p=f[0]-l[0])*p+(p=f[1]-l[1])*p,g=(g=d[0]-h[0])*g+(g=d[1]-h[1])*g;e=y(e,Math.sqrt(p/g)),r=[(l[0]+f[0])/2,(l[1]+f[1])/2],o=[(h[0]+d[0])/2,(h[1]+d[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 A(){if(this.__zooming){var t,e,r=x(this,arguments),i=pt.changedTouches,o=i.length;for(Ku(),n&&clearTimeout(n),n=setTimeout((function(){n=null}),f),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=At(this).on("dblclick.zoom");u&&u.apply(this,arguments)}}}return v.transform=function(t,n,e){var r=t.selection?t.selection():t;r.property("__zoom",ra),t!==r?w(t,n,e):r.interrupt().each((function(){x(this,arguments).start().zoom(null,"function"==typeof n?n.apply(this,arguments):n).end()}))},v.scaleBy=function(t,n,e){v.scaleTo(t,(function(){var t=this.__zoom.k,e="function"==typeof n?n.apply(this,arguments):n;return t*e}),e)},v.scaleTo=function(t,n,e){v.transform(t,(function(){var t=r.apply(this,arguments),o=this.__zoom,u=null==e?_(t):"function"==typeof e?e.apply(this,arguments):e,a=o.invert(u),c="function"==typeof n?n.apply(this,arguments):n;return i(m(y(o,c),u,a),t,s)}),e)},v.translateBy=function(t,n,e){v.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)}))},v.translateTo=function(t,n,e,o){v.transform(t,(function(){var t=r.apply(this,arguments),u=this.__zoom,a=null==o?_(t):"function"==typeof o?o.apply(this,arguments):o;return i(Ju.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)},M.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){wt(new Gu(v,t,this.that.__zoom),h.apply,h,[t,this.that,this.args])}},v.wheelDelta=function(t){return arguments.length?(o="function"==typeof t?t:Zu(+t),v):o},v.filter=function(t){return arguments.length?(e="function"==typeof t?t:Zu(!!t),v):e},v.touchable=function(t){return arguments.length?(u="function"==typeof t?t:Zu(!!t),v):u},v.extent=function(t){return arguments.length?(r="function"==typeof t?t:Zu([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),v):r},v.scaleExtent=function(t){return arguments.length?(a[0]=+t[0],a[1]=+t[1],v):[a[0],a[1]]},v.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],v):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},v.constrain=function(t){return arguments.length?(i=t,v):i},v.duration=function(t){return arguments.length?(c=+t,v):c},v.interpolate=function(t){return arguments.length?(l=t,v):l},v.on=function(){var t=h.on.apply(h,arguments);return t===h?v:t},v.clickDistance=function(t){return arguments.length?(p=(t=+t)*t,v):Math.sqrt(p)},v}().on("zoom",(function(){n.zoomed()}))),this.link_group=this.svg.append("g").classed("links",!0),this.node_group=this.svg.append("g").classed("nodes",!0)},aa.prototype.zoomed=function(){this.current_transform=pt.transform,this.node_elements&&this.node_elements.attr("transform",pt.transform),this.link_elements&&this.link_elements.attr("transform",pt.transform)},aa.prototype.updateGraph=function(t,n){var e=this,r=function(t){e.nodeSelected(t)};t=void 0!==t?t:this.nodes,n=void 0!==n?n:this.links,this.node_elements=this.node_group.selectAll("g").data(t),this.node_elements.exit().remove();var i=this.node_elements.enter().append("g");i.append("circle").style("opacity",.99).attr("r",(function(t){return e.getRadius(t)})).attr("cx",(function(t){return t.x})).attr("cy",(function(t){return t.y})).attr("type",(function(t){return e.isFringe(t)?"fringe":"node"})).call(e.drag_drop).on("mouseover",(function(t){At(this).style("cursor","pointer")})).on("mouseout",(function(t){At(this).style("cursor","default")})).on("click",r),i.append("text").attr("x",(function(t){return t.x})).attr("y",(function(t){return t.y})).text((function(t){return e.getNodeIconUnicode(t)})).call(e.drag_drop).on("mouseover",(function(t){At(this).style("cursor","pointer")})).on("mouseout",(function(t){At(this).style("cursor","default")})).on("click",r),this.node_elements=i.merge(this.node_elements),this.styleNodeElements(),this.link_elements=this.link_group.selectAll("line").data(n),this.link_elements.exit().remove();var o=this.link_elements.enter().append("line");this.link_elements=o.merge(this.link_elements),this.styleLinkElements(),this.current_transform&&(this.node_elements&&this.node_elements.attr("transform",this.current_transform),this.link_elements&&this.link_elements.attr("transform",this.current_transform))},aa.prototype.updateSimulation=function(t){var n=this,e=function(){n.node_elements.selectAll("circle").attr("cx",(function(t){return t.x})).attr("cy",(function(t){return t.y})),n.node_elements.selectAll("text").attr("x",(function(t){return t.x})).attr("y",(function(t){return t.y})),n.link_elements.attr("x1",(function(t){return t.source.x})).attr("y1",(function(t){return t.source.y})).attr("x2",(function(t){return t.target.x})).attr("y2",(function(t){return t.target.y}))};this.show_force?this.simulation.nodes(this.nodes).on("tick",e).force("link").links(this.links):this.simulation.nodes(this.nodes).on("end",e).force("link").links(this.links),this.nodes.length&&("wake"==t||"init"==t?this.simulation.restart():"filter"==t?this.simulation.restart():this.simulation.alpha(1).restart())},aa.prototype.styleNodeElements=function(){var t=this;this.node_elements&&this.node_elements.each((function(n){var e=At(this),r=e.select("circle");r.select("title").remove(),r.style("fill",t.getNodeColour(n)),r.attr("r",t.getRadius(n)),r.classed("highlighted",(function(n){return-1!=t.focusNodes.indexOf(n.id)})),r.append("title").classed("terminus-gnode-title",!0).text(t.getNodeText(n));var i=e.select("text");i.select("title").remove(),i.attr("text-anchor","middle").attr("title",t.getNodeText(n)).attr("dominant-baseline","central").style("font-family","'"+t.fontfam+"'").style("font-weight",t.getNodeIconWeight(n)).style("font-size",t.getNodeIconSize(n)).style("fill",t.getNodeIconColour(n)).text(t.getNodeIconUnicode(n)).append("title").classed("terminus-gnode-title",!0).text(t.getNodeText(n))}))},aa.prototype.styleLinkElements=function(){var t=this;this.link_elements&&this.link_elements.each((function(n){var e=At(this);e.select("title").remove(),e.attr("stroke-width",t.getLineWidth(n)),e.attr("marker-end",t.getEdgeArrow(n)),e.style("stroke",t.getEdgeColour(n)),e.append("title").classed("terminus-glink-title",!0).text(t.getLinkText(n))}))},aa.prototype.getEdgeArrow=function(t){if(t){var n=this.getEdgeDirection(t),e=this.getEdgeColour(t);return this.svg.append("svg:defs").selectAll("marker").data([void 0]).enter().append("svg:marker").attr("id",String).attr("viewBox","0 -5 10 10").attr("refX",22).attr("refY",0).attr("markerWidth",this.getArrowWidth(t)).attr("markerHeight",this.getArrowHeight(t)).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("svg:path").attr("d",n).style("fill",e),"url(#undefined)"}return""},aa.prototype.nodeSelected=function(t){this.selected_id==t.id&&this.selection_grows?(this.selection_grows=!1,this.styleNodeElements()):(this.selection_grows=!0,this.selected_id=t.id,this.styleNodeElements(),this.isFringe(t))},aa.prototype.getScaleTransform=function(t,n,e){return"scale("+e+") translate("+t+","+n+")"},aa.prototype.scale=function(t){new_mol_width=this.width*t,new_mol_height=this.height*t;var n=this.height-new_mol_height,e=this.width-new_mol_width,r=this;this.node_elements&&this.node_elements.transition().duration(750).attr("transform",(function(i){return r.getScaleTransform(e,n,t)})),this.link_elements&&this.link_elements.transition().duration(750).attr("transform",(function(i){return r.getScaleTransform(e,n,t)})),this.scale_factor=t,this.svg.selectAll("marker").attr("markerWidth",this.getArrowWidth()).attr("markerHeight",this.getArrowHeight())},aa.prototype.scaleToFit=function(){0!==this.nodes.length&&(min_x=s(this.nodes.map((function(t){return t.x}))),min_y=s(this.nodes.map((function(t){return t.y}))),max_x=a(this.nodes.map((function(t){return t.x}))),max_y=a(this.nodes.map((function(t){return t.y}))),mol_width=max_x-min_x,mol_height=max_y-min_y,mol_width*=1.05,mol_height*=1.05,width_ratio=this.width/mol_width,height_ratio=this.height/mol_height,min_ratio=Math.min(width_ratio,height_ratio),min_ratio<1&&this.scale(min_ratio))},aa.prototype.recentre=function(t){this.translated=!0,this.dcx=this.width/2-t.x,this.dcy=this.height/2-t.y,this.node_elements.attr("transform","translate("+this.dcx+","+this.dcy+")"),this.link_elements.attr("transform","translate("+this.dcx+","+this.dcy+")"),this.text_elements.attr("transform","translate("+this.dcx+","+this.dcy+")")},aa.prototype.setConfigOptions=function(t){this.fontfam=t&&t.fontfamily()?t.fontfamily():"FontAwesome",this.selected_grows=!t||void 0===t.selected_grows()||t.selected_grows(),this.show_force=!t||void 0===t.show_force()||t.show_force(),this.fix_nodes=!(!t||void 0===t.fix_nodes())&&t.fix_nodes(),this.explode_out=!(!t||void 0===t.explode_out())&&t.explode_out(),this.width=t&&t.width()?t.width():800,this.height=t&&t.height()?t.height():800,this.defaults={edge:{type:"edge",distance:t&&t.edge&&t.edge.distance?t.edge.distance:70,arrow:t&&t.edge&&t.edge.arrow?t.edge.arrow:{width:20,height:10},symmetric:!(t&&t.edge&&t.edge.symmetric)||t.edge.symmetric,color:t&&t.edge&&t.edge.color?t.edge.color:[120,118,116],weight:t&&t.edge&&t.edge.weight?t.edge.weight:.3,size:t&&t.edge&&t.edge.size?t.edge.size:2},node:{type:"node",radius:t&&t.node&&t.node.radius?t.node.radius:16,charge:t&&t.node&&t.node.charge?t.node.charge:-60,collisionRadius:t&&t.node&&t.node.collisionRadius?t.node.collisionRadius:20,color:t&&t.node&&t.node.color?t.node.color:[245,114,7],icon:{weight:t&&t.node&&t.node.icon&&t.node.icon.weight?t.node.icon.weight:900,color:t&&t.node&&t.node.icon&&t.node.icon.color?t.node.icon.color:[255,255,255],unicode:t&&t.node&&t.node.icon&&t.node.icon.unicode?t.node.icon.unicode:"",size:t&&t.node&&t.node.icon&&t.node.icon.size?t.node.icon.size:10,faclass:t&&t.node&&t.node.icon&&t.node.icon.faclass?t.node.icon.faclass:"fas fa-user"},text:{color:t&&t.node&&t.node.text&&t.node.text.color?t.node.text.color:[0,0,0],size:t&&t.node&&t.node.icon&&t.node.text.size?t.node.text.size:10},border:{color:t&&t.node&&t.node.border&&t.node.border.color?t.node.border.color:[0,0,0],size:t&&t.node&&t.node.border&&t.node.border.size?t.node.border.size:10}}}},aa.prototype.getMultiplier=function(t){var n=t&&t.size?t.size:1;return t.id==this.selected_id&&this.selection_grows&&(n*=2),n},aa.prototype.getRadius=function(t){var n=t&&t.radius?t.radius:this.defaults.node.radius,e=this.scale_factor?Math.min(this.scale_factor*n,n):n;return e*=this.getMultiplier(t)},aa.prototype.getCollisionRadius=function(t){var n=t&&t.collisionRadius?t.collisionRadius:this.defaults.node.collisionRadius;return(this.scale_factor?Math.min(this.scale_factor*n,n):n)*this.getMultiplier(t)},aa.prototype.getCharge=function(t){var n=t&&t.charge?t.charge:this.defaults.node.charge;if(n<0)var e=this.scale_factor?Math.max(this.scale_factor*n,n):n;else e=this.scale_factor?Math.min(this.scale_factor*n,n):n;return e*this.getMultiplier(t)},aa.prototype.getLinkDistance=function(t){var n=t&&t.distance?t.distance:this.defaults.edge.distance;return this.scale_factor?Math.min(this.scale_factor*n,n):n},aa.prototype.getNodeIconSize=function(t){return t&&t.icon&&t.icon.size?t.icon.size+"em":this.getMultiplier(t)+"em"},aa.prototype.getNodeColour=function(t){var n=t&&t.color?t.color:this.defaults.node.color;return this.isFringe(t)?"rgba("+n.join(",")+",0.25)":"rgb("+n.join(",")+")"},aa.prototype.getNodeIcon=function(t){return t&&t.icon&&t.icon.faclass?t.icon.faclass:this.defaults.node.icon.faclass},aa.prototype.getNodeIconUnicode=function(t){if(t&&void 0!==t.icon){if(t.icon.unicode)return t.icon.unicode;if(!0===t.icon.label)return this.getNodeText(t);if(t.icon.label)return t.icon.label}return this.defaults.node.icon.unicode},aa.prototype.getNodeIconWeight=function(t){return t&&t.icon&&t.icon.weight?t.icon.weight:this.defaults.node.icon.weight},aa.prototype.getNodeIconColour=function(t){var n=t&&t.icon&&t.icon.color?t.icon.color:this.defaults.node.icon.color;return this.isFringe(t)?"rgba("+n.join(",")+",0.25)":"rgb("+n.join(",")+")"},aa.prototype.getEdgeColour=function(t){var n=t&&t.color?t.color:this.defaults.edge.color,e=t&&t.weight?t.weight:this.defaults.edge.weight;return"rgba("+n.concat([e]).join(",")+")"},aa.prototype.getEdgeDirection=function(t){return t&&t.symmetric?"M10,-5 L0,0 L10,5":"M0,-5 L10,0 L0,5"},aa.prototype.getLineWidth=function(t){return t&&t.size?t.size:this.defaults.edge.size},aa.prototype.getNodeText=function(t){return t&&t.text?t.text:t.id},aa.prototype.getLinkText=function(t){return t&&t.text?t.text:t&&t.id?t.id:""},aa.prototype.getArrowWidth=function(t){var n=t&&t.arrow&&t.arrow.width?t.arrow.width:this.defaults.edge.arrow.width;return this.scale_factor?Math.min(this.scale_factor*n,n):n},aa.prototype.getArrowHeight=function(t){var n=t&&t.arrow&&t.arrow.height?t.arrow.height:this.defaults.edge.arrow.height;return this.scale_factor?Math.min(this.scale_factor*n,n):n},aa.prototype.isNeighbourLink=function(t,n){return n.target.id===t.id||n.source.id===t.id},aa.prototype.isFringe=function(t){return this.result&&this.result.added&&this.result.added.upgraded&&-1!=this.result.added.upgraded.indexOf(t.id)?(t.type="node",!1):t.type&&"fringe"==t.type};var sa=aa;e.d(n,"GraphResultsViewer",(function(){return sa}))}})}));