summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan-Erik Rediger <janerik@fnordig.de>2021-01-06 16:03:25 +0100
committerJan-Erik Rediger <janerik@fnordig.de>2021-01-06 16:03:25 +0100
commit8e1fc53ee9a46a7e6dc3ff50f2d1492adc6b3b04 (patch)
treea13a4266e075cccdff03cb0ef191db1ff4a96aa5
parentf03a6ebdeebe18c62b329861709a307d0621db31 (diff)
Upgrade to mermaid v8.8.4
Release: https://github.com/mermaid-js/mermaid/releases/tag/v8.8.4 Asset URL: https://github.com/mermaid-js/mermaid/raw/03c19ccae906017d97d0680979d51e8aa31155dc/dist/mermaid.min.js
-rw-r--r--src/bin/assets/mermaid.min.js27
1 files changed, 5 insertions, 22 deletions
diff --git a/src/bin/assets/mermaid.min.js b/src/bin/assets/mermaid.min.js
index 0a72f33..8d71a81 100644
--- a/src/bin/assets/mermaid.min.js
+++ b/src/bin/assets/mermaid.min.js
@@ -1,11 +1,4 @@
-!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.mermaid=e():t.mermaid=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=509)}([function(t,e,n){"use strict";n.r(e);var r=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN},i=function(t){var e;return 1===t.length&&(e=t,t=function(t,n){return r(e(t),n)}),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)>0?i=o:r=o+1}return r}}};var o=i(r),a=o.right,s=o.left,u=a,c=function(t,e){null==e&&(e=f);for(var n=0,r=t.length-1,i=t[0],o=new Array(r<0?0:r);n<r;)o[n]=e(i,i=t[++n]);return o};function f(t,e){return[t,e]}var l=function(t,e,n){var r,i,o,a,s=t.length,u=e.length,c=new Array(s*u);for(null==n&&(n=f),r=o=0;r<s;++r)for(a=t[r],i=0;i<u;++i,++o)c[o]=n(a,e[i]);return c},h=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},d=function(t){return null===t?NaN:+t},p=function(t,e){var n,r,i=t.length,o=0,a=-1,s=0,u=0;if(null==e)for(;++a<i;)isNaN(n=d(t[a]))||(u+=(r=n-s)*(n-(s+=r/++o)));else for(;++a<i;)isNaN(n=d(e(t[a],a,t)))||(u+=(r=n-s)*(n-(s+=r/++o)));if(o>1)return u/(o-1)},g=function(t,e){var n=p(t,e);return n?Math.sqrt(n):n},y=function(t,e){var n,r,i,o=t.length,a=-1;if(null==e){for(;++a<o;)if(null!=(n=t[a])&&n>=n)for(r=i=n;++a<o;)null!=(n=t[a])&&(r>n&&(r=n),i<n&&(i=n))}else for(;++a<o;)if(null!=(n=e(t[a],a,t))&&n>=n)for(r=i=n;++a<o;)null!=(n=e(t[a],a,t))&&(r>n&&(r=n),i<n&&(i=n));return[r,i]},b=Array.prototype,m=b.slice,v=b.map,_=function(t){return function(){return t}},w=function(t){return t},x=function(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++r<i;)o[r]=t+r*n;return o},k=Math.sqrt(50),E=Math.sqrt(10),A=Math.sqrt(2),S=function(t,e,n){var r,i,o,a,s=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if((r=e<t)&&(i=t,t=e,e=i),0===(a=T(t,e,n))||!isFinite(a))return[];if(a>0)for(t=Math.ceil(t/a),e=Math.floor(e/a),o=new Array(i=Math.ceil(e-t+1));++s<i;)o[s]=(t+s)*a;else for(t=Math.floor(t*a),e=Math.ceil(e*a),o=new Array(i=Math.ceil(t-e+1));++s<i;)o[s]=(t-s)/a;return r&&o.reverse(),o};function T(t,e,n){var r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=k?10:o>=E?5:o>=A?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=k?10:o>=E?5:o>=A?2:1)}function M(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=k?i*=10:o>=E?i*=5:o>=A&&(i*=2),e<t?-i:i}var D=function(t){return Math.ceil(Math.log(t.length)/Math.LN2)+1},C=function(){var t=w,e=y,n=D;function r(r){var i,o,a=r.length,s=new Array(a);for(i=0;i<a;++i)s[i]=t(r[i],i,r);var c=e(s),f=c[0],l=c[1],h=n(s,f,l);Array.isArray(h)||(h=M(f,l,h),h=x(Math.ceil(f/h)*h,l,h));for(var d=h.length;h[0]<=f;)h.shift(),--d;for(;h[d-1]>l;)h.pop(),--d;var p,g=new Array(d+1);for(i=0;i<=d;++i)(p=g[i]=[]).x0=i>0?h[i-1]:f,p.x1=i<d?h[i]:l;for(i=0;i<a;++i)f<=(o=s[i])&&o<=l&&g[u(h,o,0,d)].push(r[i]);return g}return r.value=function(e){return arguments.length?(t="function"==typeof e?e:_(e),r):t},r.domain=function(t){return arguments.length?(e="function"==typeof t?t:_([t[0],t[1]]),r):e},r.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Array.isArray(t)?_(m.call(t)):_(t),r):n},r},O=function(t,e,n){if(null==n&&(n=d),r=t.length){if((e=+e)<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t);return a+(+n(t[o+1],o+1,t)-a)*(i-o)}},R=function(t,e,n){return t=v.call(t,d).sort(r),Math.ceil((n-e)/(2*(O(t,.75)-O(t,.25))*Math.pow(t.length,-1/3)))},I=function(t,e,n){return Math.ceil((n-e)/(3.5*g(t)*Math.pow(t.length,-1/3)))},N=function(t,e){var n,r,i=t.length,o=-1;if(null==e){for(;++o<i;)if(null!=(n=t[o])&&n>=n)for(r=n;++o<i;)null!=(n=t[o])&&n>r&&(r=n)}else for(;++o<i;)if(null!=(n=e(t[o],o,t))&&n>=n)for(r=n;++o<i;)null!=(n=e(t[o],o,t))&&n>r&&(r=n);return r},B=function(t,e){var n,r=t.length,i=r,o=-1,a=0;if(null==e)for(;++o<r;)isNaN(n=d(t[o]))?--i:a+=n;else for(;++o<r;)isNaN(n=d(e(t[o],o,t)))?--i:a+=n;if(i)return a/i},L=function(t,e){var n,i=t.length,o=-1,a=[];if(null==e)for(;++o<i;)isNaN(n=d(t[o]))||a.push(n);else for(;++o<i;)isNaN(n=d(e(t[o],o,t)))||a.push(n);return O(a.sort(r),.5)},P=function(t){for(var e,n,r,i=t.length,o=-1,a=0;++o<i;)a+=t[o].length;for(n=new Array(a);--i>=0;)for(e=(r=t[i]).length;--e>=0;)n[--a]=r[e];return n},F=function(t,e){var n,r,i=t.length,o=-1;if(null==e){for(;++o<i;)if(null!=(n=t[o])&&n>=n)for(r=n;++o<i;)null!=(n=t[o])&&r>n&&(r=n)}else for(;++o<i;)if(null!=(n=e(t[o],o,t))&&n>=n)for(r=n;++o<i;)null!=(n=e(t[o],o,t))&&r>n&&(r=n);return r},q=function(t,e){for(var n=e.length,r=new Array(n);n--;)r[n]=t[e[n]];return r},j=function(t,e){if(n=t.length){var n,i,o=0,a=0,s=t[a];for(null==e&&(e=r);++o<n;)(e(i=t[o],s)<0||0!==e(s,s))&&(s=i,a=o);return 0===e(s,s)?a:void 0}},U=function(t,e,n){for(var r,i,o=(null==n?t.length:n)-(e=null==e?0:+e);o;)i=Math.random()*o--|0,r=t[o+e],t[o+e]=t[i+e],t[i+e]=r;return t},z=function(t,e){var n,r=t.length,i=-1,o=0;if(null==e)for(;++i<r;)(n=+t[i])&&(o+=n);else for(;++i<r;)(n=+e(t[i],i,t))&&(o+=n);return o},Y=function(t){if(!(i=t.length))return[];for(var e=-1,n=F(t,V),r=new Array(n);++e<n;)for(var i,o=-1,a=r[e]=new Array(i);++o<i;)a[o]=t[o][e];return r};function V(t){return t.length}var H=function(){return Y(arguments)},$=Array.prototype.slice,G=function(t){return t},W=1,K=2,X=3,Z=4,J=1e-6;function Q(t){return"translate("+(t+.5)+",0)"}function tt(t){return"translate(0,"+(t+.5)+")"}function et(t){return function(e){return+t(e)}}function nt(t){var e=Math.max(0,t.bandwidth()-1)/2;return t.round()&&(e=Math.round(e)),function(n){return+t(n)+e}}function rt(){return!this.__axis}function it(t,e){var n=[],r=null,i=null,o=6,a=6,s=3,u=t===W||t===Z?-1:1,c=t===Z||t===K?"x":"y",f=t===W||t===X?Q:tt;function l(l){var h=null==r?e.ticks?e.ticks.apply(e,n):e.domain():r,d=null==i?e.tickFormat?e.tickFormat.apply(e,n):G:i,p=Math.max(o,0)+s,g=e.range(),y=+g[0]+.5,b=+g[g.length-1]+.5,m=(e.bandwidth?nt:et)(e.copy()),v=l.selection?l.selection():l,_=v.selectAll(".domain").data([null]),w=v.selectAll(".tick").data(h,e).order(),x=w.exit(),k=w.enter().append("g").attr("class","tick"),E=w.select("line"),A=w.select("text");_=_.merge(_.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),w=w.merge(k),E=E.merge(k.append("line").attr("stroke","currentColor").attr(c+"2",u*o)),A=A.merge(k.append("text").attr("fill","currentColor").attr(c,u*p).attr("dy",t===W?"0em":t===X?"0.71em":"0.32em")),l!==v&&(_=_.transition(l),w=w.transition(l),E=E.transition(l),A=A.transition(l),x=x.transition(l).attr("opacity",J).attr("transform",(function(t){return isFinite(t=m(t))?f(t):this.getAttribute("transform")})),k.attr("opacity",J).attr("transform",(function(t){var e=this.parentNode.__axis;return f(e&&isFinite(e=e(t))?e:m(t))}))),x.remove(),_.attr("d",t===Z||t==K?a?"M"+u*a+","+y+"H0.5V"+b+"H"+u*a:"M0.5,"+y+"V"+b:a?"M"+y+","+u*a+"V0.5H"+b+"V"+u*a:"M"+y+",0.5H"+b),w.attr("opacity",1).attr("transform",(function(t){return f(m(t))})),E.attr(c+"2",u*o),A.attr(c,u*p).text(d),v.filter(rt).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===K?"start":t===Z?"end":"middle"),v.each((function(){this.__axis=m}))}return l.scale=function(t){return arguments.length?(e=t,l):e},l.ticks=function(){return n=$.call(arguments),l},l.tickArguments=function(t){return arguments.length?(n=null==t?[]:$.call(t),l):n.slice()},l.tickValues=function(t){return arguments.length?(r=null==t?null:$.call(t),l):r&&r.slice()},l.tickFormat=function(t){return arguments.length?(i=t,l):i},l.tickSize=function(t){return arguments.length?(o=a=+t,l):o},l.tickSizeInner=function(t){return arguments.length?(o=+t,l):o},l.tickSizeOuter=function(t){return arguments.length?(a=+t,l):a},l.tickPadding=function(t){return arguments.length?(s=+t,l):s},l}function ot(t){return it(W,t)}function at(t){return it(K,t)}function st(t){return it(X,t)}function ut(t){return it(Z,t)}var ct={value:function(){}};function ft(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r)throw new Error("illegal type: "+t);r[t]=[]}return new lt(r)}function lt(t){this._=t}function ht(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function dt(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function pt(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=ct,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}lt.prototype=ft.prototype={constructor:lt,on:function(t,e){var n,r=this._,i=ht(t+"",r),o=-1,a=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<a;)if(n=(t=i[o]).type)r[n]=pt(r[n],t.name,e);else if(null==e)for(n in r)r[n]=pt(r[n],t.name,null);return this}for(;++o<a;)if((n=(t=i[o]).type)&&(n=dt(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new lt(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){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(e,n)}};var gt=ft,yt="http://www.w3.org/1999/xhtml",bt={svg:"http://www.w3.org/2000/svg",xhtml:yt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},mt=function(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),bt.hasOwnProperty(e)?{space:bt[e],local:t}:t};function vt(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===yt&&e.documentElement.namespaceURI===yt?e.createElement(t):e.createElementNS(n,t)}}function _t(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}var wt=function(t){var e=mt(t);return(e.local?_t:vt)(e)};function xt(){}var kt=function(t){return null==t?xt:function(){return this.querySelector(t)}};function Et(){return[]}var At=function(t){return null==t?Et:function(){return this.querySelectorAll(t)}},St=function(t){return function(){return this.matches(t)}},Tt=function(t){return new Array(t.length)};function Mt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Mt.prototype={constructor:Mt,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var Dt="$";function Ct(t,e,n,r,i,o){for(var a,s=0,u=e.length,c=o.length;s<c;++s)(a=e[s])?(a.__data__=o[s],r[s]=a):n[s]=new Mt(t,o[s]);for(;s<u;++s)(a=e[s])&&(i[s]=a)}function Ot(t,e,n,r,i,o,a){var s,u,c,f={},l=e.length,h=o.length,d=new Array(l);for(s=0;s<l;++s)(u=e[s])&&(d[s]=c=Dt+a.call(u,u.__data__,s,e),c in f?i[s]=u:f[c]=u);for(s=0;s<h;++s)(u=f[c=Dt+a.call(t,o[s],s,o)])?(r[s]=u,u.__data__=o[s],f[c]=null):n[s]=new Mt(t,o[s]);for(s=0;s<l;++s)(u=e[s])&&f[d[s]]===u&&(i[s]=u)}function Rt(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function It(t){return function(){this.removeAttribute(t)}}function Nt(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Bt(t,e){return function(){this.setAttribute(t,e)}}function Lt(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Pt(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Ft(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}var qt=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function jt(t){return function(){this.style.removeProperty(t)}}function Ut(t,e,n){return function(){this.style.setProperty(t,e,n)}}function zt(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Yt(t,e){return t.style.getPropertyValue(e)||qt(t).getComputedStyle(t,null).getPropertyValue(e)}function Vt(t){return function(){delete this[t]}}function Ht(t,e){return function(){this[t]=e}}function $t(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function Gt(t){return t.trim().split(/^|\s+/)}function Wt(t){return t.classList||new Kt(t)}function Kt(t){this._node=t,this._names=Gt(t.getAttribute("class")||"")}function Xt(t,e){for(var n=Wt(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function Zt(t,e){for(var n=Wt(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function Jt(t){return function(){Xt(this,t)}}function Qt(t){return function(){Zt(this,t)}}function te(t,e){return function(){(e.apply(this,arguments)?Xt:Zt)(this,t)}}Kt.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function ee(){this.textContent=""}function ne(t){return function(){this.textContent=t}}function re(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function ie(){this.innerHTML=""}function oe(t){return function(){this.innerHTML=t}}function ae(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function se(){this.nextSibling&&this.parentNode.appendChild(this)}function ue(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ce(){return null}function fe(){var t=this.parentNode;t&&t.removeChild(this)}function le(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function he(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}var de={},pe=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(de={mouseenter:"mouseover",mouseleave:"mouseout"}));function ge(t,e,n){return t=ye(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function ye(t,e,n){return function(r){var i=pe;pe=r;try{t.call(this,this.__data__,e,n)}finally{pe=i}}}function be(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function me(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,o=e.length;r<o;++r)n=e[r],t.type&&n.type!==t.type||n.name!==t.name?e[++i]=n:this.removeEventListener(n.type,n.listener,n.capture);++i?e.length=i:delete this.__on}}}function ve(t,e,n){var r=de.hasOwnProperty(t.type)?ge:ye;return function(i,o,a){var s,u=this.__on,c=r(e,o,a);if(u)for(var f=0,l=u.length;f<l;++f)if((s=u[f]).type===t.type&&s.name===t.name)return this.removeEventListener(s.type,s.listener,s.capture),this.addEventListener(s.type,s.listener=c,s.capture=n),void(s.value=e);this.addEventListener(t.type,c,n),s={type:t.type,name:t.name,value:e,listener:c,capture:n},u?u.push(s):this.__on=[s]}}function _e(t,e,n,r){var i=pe;t.sourceEvent=pe,pe=t;try{return e.apply(n,r)}finally{pe=i}}function we(t,e,n){var r=qt(t),i=r.CustomEvent;"function"==typeof i?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function xe(t,e){return function(){return we(this,t,e)}}function ke(t,e){return function(){return we(this,t,e.apply(this,arguments))}}var Ee=[null];function Ae(t,e){this._groups=t,this._parents=e}function Se(){return new Ae([[document.documentElement]],Ee)}Ae.prototype=Se.prototype={constructor:Ae,select:function(t){"function"!=typeof t&&(t=kt(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o,a,s=e[i],u=s.length,c=r[i]=new Array(u),f=0;f<u;++f)(o=s[f])&&(a=t.call(o,o.__data__,f,s))&&("__data__"in o&&(a.__data__=o.__data__),c[f]=a);return new Ae(r,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=At(t));for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var a,s=e[o],u=s.length,c=0;c<u;++c)(a=s[c])&&(r.push(t.call(a,a.__data__,c,s)),i.push(a));return new Ae(r,i)},filter:function(t){"function"!=typeof t&&(t=St(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o,a=e[i],s=a.length,u=r[i]=[],c=0;c<s;++c)(o=a[c])&&t.call(o,o.__data__,c,a)&&u.push(o);return new Ae(r,this._parents)},data:function(t,e){if(!t)return p=new Array(this.size()),f=-1,this.each((function(t){p[++f]=t})),p;var n,r=e?Ot:Ct,i=this._parents,o=this._groups;"function"!=typeof t&&(n=t,t=function(){return n});for(var a=o.length,s=new Array(a),u=new Array(a),c=new Array(a),f=0;f<a;++f){var l=i[f],h=o[f],d=h.length,p=t.call(l,l&&l.__data__,f,i),g=p.length,y=u[f]=new Array(g),b=s[f]=new Array(g);r(l,h,y,b,c[f]=new Array(d),p,e);for(var m,v,_=0,w=0;_<g;++_)if(m=y[_]){for(_>=w&&(w=_+1);!(v=b[w])&&++w<g;);m._next=v||null}}return(s=new Ae(s,i))._enter=u,s._exit=c,s},enter:function(){return new Ae(this._enter||this._groups.map(Tt),this._parents)},exit:function(){return new Ae(this._exit||this._groups.map(Tt),this._parents)},join:function(t,e,n){var r=this.enter(),i=this,o=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=e&&(i=e(i)),null==n?o.remove():n(o),r&&i?r.merge(i).order():i},merge:function(t){for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var u,c=e[s],f=n[s],l=c.length,h=a[s]=new Array(l),d=0;d<l;++d)(u=c[d]||f[d])&&(h[d]=u);for(;s<r;++s)a[s]=e[s];return new Ae(a,this._parents)},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,i=t[e],o=i.length-1,a=i[o];--o>=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=Rt);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a,s=n[o],u=s.length,c=i[o]=new Array(u),f=0;f<u;++f)(a=s[f])&&(c[f]=a);c.sort(e)}return new Ae(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()),e=-1;return this.each((function(){t[++e]=this})),t},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null},size:function(){var t=0;return this.each((function(){++t})),t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i,o=e[n],a=0,s=o.length;a<s;++a)(i=o[a])&&t.call(i,i.__data__,a,o);return this},attr:function(t,e){var n=mt(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?Nt:It:"function"==typeof e?n.local?Ft:Pt:n.local?Lt:Bt)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?jt:"function"==typeof e?zt:Ut)(t,e,null==n?"":n)):Yt(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?Vt:"function"==typeof e?$t:Ht)(t,e)):this.node()[t]},classed:function(t,e){var n=Gt(t+"");if(arguments.length<2){for(var r=Wt(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each(("function"==typeof e?te:e?Jt:Qt)(n,e))},text:function(t){return arguments.length?this.each(null==t?ee:("function"==typeof t?re:ne)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?ie:("function"==typeof t?ae:oe)(t)):this.node().innerHTML},raise:function(){return this.each(se)},lower:function(){return this.each(ue)},append:function(t){var e="function"==typeof t?t:wt(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:wt(t),r=null==e?ce:"function"==typeof e?e:kt(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(fe)},clone:function(t){return this.select(t?he:le)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,i,o=be(t+""),a=o.length;if(!(arguments.length<2)){for(s=e?ve:me,null==n&&(n=!1),r=0;r<a;++r)this.each(s(o[r],e,n));return this}var s=this.node().__on;if(s)for(var u,c=0,f=s.length;c<f;++c)for(r=0,u=s[c];r<a;++r)if((i=o[r]).type===u.type&&i.name===u.name)return u.value},dispatch:function(t,e){return this.each(("function"==typeof e?ke:xe)(t,e))}};var Te=Se,Me=function(t){return"string"==typeof t?new Ae([[document.querySelector(t)]],[document.documentElement]):new Ae([[t]],Ee)},De=function(t){return Me(wt(t).call(document.documentElement))},Ce=0;function Oe(){return new Re}function Re(){this._="@"+(++Ce).toString(36)}Re.prototype=Oe.prototype={constructor:Re,get:function(t){for(var e=this._;!(e in t);)if(!(t=t.parentNode))return;return t[e]},set:function(t,e){return t[this._]=e},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};var Ie=function(){for(var t,e=pe;t=e.sourceEvent;)e=t;return e},Ne=function(t,e){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]},Be=function(t){var e=Ie();return e.changedTouches&&(e=e.changedTouches[0]),Ne(t,e)},Le=function(t){return"string"==typeof t?new Ae([document.querySelectorAll(t)],[document.documentElement]):new Ae([null==t?[]:t],Ee)},Pe=function(t,e,n){arguments.length<3&&(n=e,e=Ie().changedTouches);for(var r,i=0,o=e?e.length:0;i<o;++i)if((r=e[i]).identifier===n)return Ne(t,r);return null},Fe=function(t,e){null==e&&(e=Ie().touches);for(var n=0,r=e?e.length:0,i=new Array(r);n<r;++n)i[n]=Ne(t,e[n]);return i};function qe(){pe.stopImmediatePropagation()}var je=function(){pe.preventDefault(),pe.stopImmediatePropagation()},Ue=function(t){var e=t.document.documentElement,n=Me(t).on("dragstart.drag",je,!0);"onselectstart"in e?n.on("selectstart.drag",je,!0):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")};function ze(t,e){var n=t.document.documentElement,r=Me(t).on("dragstart.drag",null);e&&(r.on("click.drag",je,!0),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Ye=function(t){return function(){return t}};function Ve(t,e,n,r,i,o,a,s,u,c){this.target=t,this.type=e,this.subject=n,this.identifier=r,this.active=i,this.x=o,this.y=a,this.dx=s,this.dy=u,this._=c}function He(){return!pe.ctrlKey&&!pe.button}function $e(){return this.parentNode}function Ge(t){return null==t?{x:pe.x,y:pe.y}:t}function We(){return navigator.maxTouchPoints||"ontouchstart"in this}Ve.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var Ke=function(){var t,e,n,r,i=He,o=$e,a=Ge,s=We,u={},c=gt("start","drag","end"),f=0,l=0;function h(t){t.on("mousedown.drag",d).filter(s).on("touchstart.drag",y).on("touchmove.drag",b).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(){if(!r&&i.apply(this,arguments)){var a=v("mouse",o.apply(this,arguments),Be,this,arguments);a&&(Me(pe.view).on("mousemove.drag",p,!0).on("mouseup.drag",g,!0),Ue(pe.view),qe(),n=!1,t=pe.clientX,e=pe.clientY,a("start"))}}function p(){if(je(),!n){var r=pe.clientX-t,i=pe.clientY-e;n=r*r+i*i>l}u.mouse("drag")}function g(){Me(pe.view).on("mousemove.drag mouseup.drag",null),ze(pe.view,n),je(),u.mouse("end")}function y(){if(i.apply(this,arguments)){var t,e,n=pe.changedTouches,r=o.apply(this,arguments),a=n.length;for(t=0;t<a;++t)(e=v(n[t].identifier,r,Pe,this,arguments))&&(qe(),e("start"))}}function b(){var t,e,n=pe.changedTouches,r=n.length;for(t=0;t<r;++t)(e=u[n[t].identifier])&&(je(),e("drag"))}function m(){var t,e,n=pe.changedTouches,i=n.length;for(r&&clearTimeout(r),r=setTimeout((function(){r=null}),500),t=0;t<i;++t)(e=u[n[t].identifier])&&(qe(),e("end"))}function v(t,e,n,r,i){var o,s,l,d=n(e,t),p=c.copy();if(_e(new Ve(h,"beforestart",o,t,f,d[0],d[1],0,0,p),(function(){return null!=(pe.subject=o=a.apply(r,i))&&(s=o.x-d[0]||0,l=o.y-d[1]||0,!0)})))return function a(c){var g,y=d;switch(c){case"start":u[t]=a,g=f++;break;case"end":delete u[t],--f;case"drag":d=n(e,t),g=f}_e(new Ve(h,c,o,t,g,d[0]+s,d[1]+l,d[0]-y[0],d[1]-y[1],p),p.apply,p,[c,r,i])}}return h.filter=function(t){return arguments.length?(i="function"==typeof t?t:Ye(!!t),h):i},h.container=function(t){return arguments.length?(o="function"==typeof t?t:Ye(t),h):o},h.subject=function(t){return arguments.length?(a="function"==typeof t?t:Ye(t),h):a},h.touchable=function(t){return arguments.length?(s="function"==typeof t?t:Ye(!!t),h):s},h.on=function(){var t=c.on.apply(c,arguments);return t===c?h:t},h.clickDistance=function(t){return arguments.length?(l=(t=+t)*t,h):Math.sqrt(l)},h},Xe=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function Ze(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Je(){}var Qe="\\s*([+-]?\\d+)\\s*",tn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",en="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",nn=/^#([0-9a-f]{3,8})$/,rn=new RegExp("^rgb\\("+[Qe,Qe,Qe]+"\\)$"),on=new RegExp("^rgb\\("+[en,en,en]+"\\)$"),an=new RegExp("^rgba\\("+[Qe,Qe,Qe,tn]+"\\)$"),sn=new RegExp("^rgba\\("+[en,en,en,tn]+"\\)$"),un=new RegExp("^hsl\\("+[tn,en,en]+"\\)$"),cn=new RegExp("^hsla\\("+[tn,en,en,tn]+"\\)$"),fn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function ln(){return this.rgb().formatHex()}function hn(){return this.rgb().formatRgb()}function dn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=nn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?pn(e):3===n?new mn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?new mn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?new mn(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=rn.exec(t))?new mn(e[1],e[2],e[3],1):(e=on.exec(t))?new mn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=an.exec(t))?gn(e[1],e[2],e[3],e[4]):(e=sn.exec(t))?gn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=un.exec(t))?xn(e[1],e[2]/100,e[3]/100,1):(e=cn.exec(t))?xn(e[1],e[2]/100,e[3]/100,e[4]):fn.hasOwnProperty(t)?pn(fn[t]):"transparent"===t?new mn(NaN,NaN,NaN,0):null}function pn(t){return new mn(t>>16&255,t>>8&255,255&t,1)}function gn(t,e,n,r){return r<=0&&(t=e=n=NaN),new mn(t,e,n,r)}function yn(t){return t instanceof Je||(t=dn(t)),t?new mn((t=t.rgb()).r,t.g,t.b,t.opacity):new mn}function bn(t,e,n,r){return 1===arguments.length?yn(t):new mn(t,e,n,null==r?1:r)}function mn(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function vn(){return"#"+wn(this.r)+wn(this.g)+wn(this.b)}function _n(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function wn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function xn(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new An(t,e,n,r)}function kn(t){if(t instanceof An)return new An(t.h,t.s,t.l,t.opacity);if(t instanceof Je||(t=dn(t)),!t)return new An;if(t instanceof An)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n<r):n===o?(r-e)/s+2:(e-n)/s+4,s/=u<.5?o+i:2-o-i,a*=60):s=u>0&&u<1?0:a,new An(a,s,u,t.opacity)}function En(t,e,n,r){return 1===arguments.length?kn(t):new An(t,e,n,null==r?1:r)}function An(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Sn(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Tn(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}Xe(Je,dn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:ln,formatHex:ln,formatHsl:function(){return kn(this).formatHsl()},formatRgb:hn,toString:hn}),Xe(mn,bn,Ze(Je,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new mn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new mn(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:vn,formatHex:vn,formatRgb:_n,toString:_n})),Xe(An,En,Ze(Je,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new An(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new An(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new mn(Sn(t>=240?t-240:t+120,i,r),Sn(t,i,r),Sn(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 Mn=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return Tn((n-r/e)*e,a,i,o,s)}},Dn=function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],o=t[r%e],a=t[(r+1)%e],s=t[(r+2)%e];return Tn((n-r/e)*e,i,o,a,s)}},Cn=function(t){return function(){return t}};function On(t,e){return function(n){return t+n*e}}function Rn(t,e){var n=e-t;return n?On(t,n>180||n<-180?n-360*Math.round(n/360):n):Cn(isNaN(t)?e:t)}function In(t){return 1==(t=+t)?Nn:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Cn(isNaN(e)?n:e)}}function Nn(t,e){var n=e-t;return n?On(t,n):Cn(isNaN(t)?e:t)}var Bn=function t(e){var n=In(e);function r(t,e){var r=n((t=bn(t)).r,(e=bn(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=Nn(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function Ln(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;n<i;++n)r=bn(e[n]),o[n]=r.r||0,a[n]=r.g||0,s[n]=r.b||0;return o=t(o),a=t(a),s=t(s),r.opacity=1,function(t){return r.r=o(t),r.g=a(t),r.b=s(t),r+""}}}var Pn=Ln(Mn),Fn=Ln(Dn),qn=function(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=Xn(t[n],e[n]);for(;n<r;++n)a[n]=e[n];return function(t){for(n=0;n<i;++n)a[n]=o[n](t);return a}},jn=function(t,e){var n=new Date;return e-=t=+t,function(r){return n.setTime(t+e*r),n}},Un=function(t,e){return e-=t=+t,function(n){return t+e*n}},zn=function(t,e){var n,r={},i={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?r[n]=Xn(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}},Yn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Vn=new RegExp(Yn.source,"g");var Hn,$n,Gn,Wn,Kn=function(t,e){var n,r,i,o=Yn.lastIndex=Vn.lastIndex=0,a=-1,s=[],u=[];for(t+="",e+="";(n=Yn.exec(t))&&(r=Vn.exec(e));)(i=r.index)>o&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:Un(n,r)})),o=Vn.lastIndex;return o<e.length&&(i=e.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?u[0]?function(t){return function(e){return t(e)+""}}(u[0].x):function(t){return function(){return t}}(e):(e=u.length,function(t){for(var n,r=0;r<e;++r)s[(n=u[r]).i]=n.x(t);return s.join("")})},Xn=function(t,e){var n,r=typeof e;return null==e||"boolean"===r?Cn(e):("number"===r?Un:"string"===r?(n=dn(e))?(e=n,Bn):Kn:e instanceof dn?Bn:e instanceof Date?jn:Array.isArray(e)?qn:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?zn:Un)(t,e)},Zn=function(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}},Jn=function(t,e){var n=Rn(+t,+e);return function(t){var e=n(t);return e-360*Math.floor(e/360)}},Qn=function(t,e){return e-=t=+t,function(n){return Math.round(t+e*n)}},tr=180/Math.PI,er={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},nr=function(t,e,n,r,i,o){var a,s,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r<e*n&&(t=-t,e=-e,u=-u,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*tr,skewX:Math.atan(u)*tr,scaleX:a,scaleY:s}};function rr(t,e,n,r){function i(t){return t.length?t.pop()+" ":""}return function(o,a){var s=[],u=[];return o=t(o),a=t(a),function(t,r,i,o,a,s){if(t!==i||r!==o){var u=a.push("translate(",null,e,null,n);s.push({i:u-4,x:Un(t,i)},{i:u-2,x:Un(r,o)})}else(i||o)&&a.push("translate("+i+e+o+n)}(o.translateX,o.translateY,a.translateX,a.translateY,s,u),function(t,e,n,o){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:Un(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,a.rotate,s,u),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:Un(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,a.skewX,s,u),function(t,e,n,r,o,a){if(t!==n||e!==r){var s=o.push(i(o)+"scale(",null,",",null,")");a.push({i:s-4,x:Un(t,n)},{i:s-2,x:Un(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,u),o=a=null,function(t){for(var e,n=-1,r=u.length;++n<r;)s[(e=u[n]).i]=e.x(t);return s.join("")}}}var ir=rr((function(t){return"none"===t?er:(Hn||(Hn=document.createElement("DIV"),$n=document.documentElement,Gn=document.defaultView),Hn.style.transform=t,t=Gn.getComputedStyle($n.appendChild(Hn),null).getPropertyValue("transform"),$n.removeChild(Hn),t=t.slice(7,-1).split(","),nr(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),"px, ","px)","deg)"),or=rr((function(t){return null==t?er:(Wn||(Wn=document.createElementNS("http://www.w3.org/2000/svg","g")),Wn.setAttribute("transform",t),(t=Wn.transform.baseVal.consolidate())?(t=t.matrix,nr(t.a,t.b,t.c,t.d,t.e,t.f)):er)}),", ",")",")"),ar=Math.SQRT2;function sr(t){return((t=Math.exp(t))+1/t)/2}var ur=function(t,e){var n,r,i=t[0],o=t[1],a=t[2],s=e[0],u=e[1],c=e[2],f=s-i,l=u-o,h=f*f+l*l;if(h<1e-12)r=Math.log(c/a)/ar,n=function(t){return[i+t*f,o+t*l,a*Math.exp(ar*t*r)]};else{var d=Math.sqrt(h),p=(c*c-a*a+4*h)/(2*a*2*d),g=(c*c-a*a-4*h)/(2*c*2*d),y=Math.log(Math.sqrt(p*p+1)-p),b=Math.log(Math.sqrt(g*g+1)-g);r=(b-y)/ar,n=function(t){var e,n=t*r,s=sr(y),u=a/(2*d)*(s*(e=ar*n+y,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(y));return[i+u*f,o+u*l,a*s/sr(ar*n+y)]}}return n.duration=1e3*r,n};function cr(t){return function(e,n){var r=t((e=En(e)).h,(n=En(n)).h),i=Nn(e.s,n.s),o=Nn(e.l,n.l),a=Nn(e.opacity,n.opacity);return function(t){return e.h=r(t),e.s=i(t),e.l=o(t),e.opacity=a(t),e+""}}}var fr=cr(Rn),lr=cr(Nn),hr=Math.PI/180,dr=180/Math.PI,pr=.96422,gr=1,yr=.82521,br=4/29,mr=6/29,vr=3*mr*mr,_r=mr*mr*mr;function wr(t){if(t instanceof Er)return new Er(t.l,t.a,t.b,t.opacity);if(t instanceof Rr)return Ir(t);t instanceof mn||(t=yn(t));var e,n,r=Mr(t.r),i=Mr(t.g),o=Mr(t.b),a=Ar((.2225045*r+.7168786*i+.0606169*o)/gr);return r===i&&i===o?e=n=a:(e=Ar((.4360747*r+.3850649*i+.1430804*o)/pr),n=Ar((.0139322*r+.0971045*i+.7141733*o)/yr)),new Er(116*a-16,500*(e-a),200*(a-n),t.opacity)}function xr(t,e){return new Er(t,0,0,null==e?1:e)}function kr(t,e,n,r){return 1===arguments.length?wr(t):new Er(t,e,n,null==r?1:r)}function Er(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function Ar(t){return t>_r?Math.pow(t,1/3):t/vr+br}function Sr(t){return t>mr?t*t*t:vr*(t-br)}function Tr(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Mr(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Dr(t){if(t instanceof Rr)return new Rr(t.h,t.c,t.l,t.opacity);if(t instanceof Er||(t=wr(t)),0===t.a&&0===t.b)return new Rr(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*dr;return new Rr(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function Cr(t,e,n,r){return 1===arguments.length?Dr(t):new Rr(n,e,t,null==r?1:r)}function Or(t,e,n,r){return 1===arguments.length?Dr(t):new Rr(t,e,n,null==r?1:r)}function Rr(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function Ir(t){if(isNaN(t.h))return new Er(t.l,0,0,t.opacity);var e=t.h*hr;return new Er(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}function Nr(t,e){var n=Nn((t=kr(t)).l,(e=kr(e)).l),r=Nn(t.a,e.a),i=Nn(t.b,e.b),o=Nn(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=r(e),t.b=i(e),t.opacity=o(e),t+""}}function Br(t){return function(e,n){var r=t((e=Or(e)).h,(n=Or(n)).h),i=Nn(e.c,n.c),o=Nn(e.l,n.l),a=Nn(e.opacity,n.opacity);return function(t){return e.h=r(t),e.c=i(t),e.l=o(t),e.opacity=a(t),e+""}}}Xe(Er,kr,Ze(Je,{brighter:function(t){return new Er(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new Er(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new mn(Tr(3.1338561*(e=pr*Sr(e))-1.6168667*(t=gr*Sr(t))-.4906146*(n=yr*Sr(n))),Tr(-.9787684*e+1.9161415*t+.033454*n),Tr(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),Xe(Rr,Or,Ze(Je,{brighter:function(t){return new Rr(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new Rr(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return Ir(this).rgb()}}));var Lr=Br(Rn),Pr=Br(Nn),Fr=-.29227,qr=-.90649,jr=1.97294,Ur=jr*qr,zr=1.78277*jr,Yr=1.78277*Fr- -.14861*qr;function Vr(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof Hr)return new Hr(t.h,t.s,t.l,t.opacity);t instanceof mn||(t=yn(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(Yr*r+Ur*e-zr*n)/(Yr+Ur-zr),o=r-i,a=(jr*(n-i)-Fr*o)/qr,s=Math.sqrt(a*a+o*o)/(jr*i*(1-i)),u=s?Math.atan2(a,o)*dr-120:NaN;return new Hr(u<0?u+360:u,s,i,t.opacity)}(t):new Hr(t,e,n,null==r?1:r)}function Hr(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function $r(t){return function e(n){function r(e,r){var i=t((e=Vr(e)).h,(r=Vr(r)).h),o=Nn(e.s,r.s),a=Nn(e.l,r.l),s=Nn(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=o(t),e.l=a(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}Xe(Hr,Vr,Ze(Je,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Hr(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Hr(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*hr,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new mn(255*(e+n*(-.14861*r+1.78277*i)),255*(e+n*(Fr*r+qr*i)),255*(e+n*(jr*r)),this.opacity)}}));var Gr=$r(Rn),Wr=$r(Nn);function Kr(t,e){for(var n=0,r=e.length-1,i=e[0],o=new Array(r<0?0:r);n<r;)o[n]=t(i,i=e[++n]);return function(t){var e=Math.max(0,Math.min(r-1,Math.floor(t*=r)));return o[e](t-e)}}var Xr,Zr,Jr=function(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t(r/(e-1));return n},Qr=0,ti=0,ei=0,ni=1e3,ri=0,ii=0,oi=0,ai="object"==typeof performance&&performance.now?performance:Date,si="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function ui(){return ii||(si(ci),ii=ai.now()+oi)}function ci(){ii=0}function fi(){this._call=this._time=this._next=null}function li(t,e,n){var r=new fi;return r.restart(t,e,n),r}function hi(){ui(),++Qr;for(var t,e=Xr;e;)(t=ii-e._time)>=0&&e._call.call(null,t),e=e._next;--Qr}function di(){ii=(ri=ai.now())+oi,Qr=ti=0;try{hi()}finally{Qr=0,function(){var t,e,n=Xr,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Xr=e);Zr=t,gi(r)}(),ii=0}}function pi(){var t=ai.now(),e=t-ri;e>ni&&(oi-=e,ri=t)}function gi(t){Qr||(ti&&(ti=clearTimeout(ti)),t-ii>24?(t<1/0&&(ti=setTimeout(di,t-ai.now()-oi)),ei&&(ei=clearInterval(ei))):(ei||(ri=ai.now(),ei=setInterval(pi,ni)),Qr=1,si(di)))}fi.prototype=li.prototype={constructor:fi,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?ui():+n)+(null==e?0:+e),this._next||Zr===this||(Zr?Zr._next=this:Xr=this,Zr=this),this._call=t,this._time=n,gi()},stop:function(){this._call&&(this._call=null,this._time=1/0,gi())}};var yi=function(t,e,n){var r=new fi;return e=null==e?0:+e,r.restart((function(n){r.stop(),t(n+e)}),e,n),r},bi=function(t,e,n){var r=new fi,i=e;return null==e?(r.restart(t,e,n),r):(e=+e,n=null==n?ui():+n,r.restart((function o(a){a+=i,r.restart(o,i+=e,n),t(a)}),e,n),r)},mi=gt("start","end","cancel","interrupt"),vi=[],_i=0,wi=1,xi=2,ki=3,Ei=4,Ai=5,Si=6,Ti=function(t,e,n,r,i,o){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function o(u){var c,f,l,h;if(n.state!==wi)return s();for(c in i)if((h=i[c]).name===n.name){if(h.state===ki)return yi(o);h.state===Ei?(h.state=Si,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[c]):+c<e&&(h.state=Si,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete i[c])}if(yi((function(){n.state===ki&&(n.state=Ei,n.timer.restart(a,n.delay,n.time),a(u))})),n.state=xi,n.on.call("start",t,t.__data__,n.index,n.group),n.state===xi){for(n.state=ki,r=new Array(l=n.tween.length),c=0,f=-1;c<l;++c)(h=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(r[++f]=h);r.length=f+1}}function a(e){for(var i=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(s),n.state=Ai,1),o=-1,a=r.length;++o<a;)r[o].call(t,i);n.state===Ai&&(n.on.call("end",t,t.__data__,n.index,n.group),s())}function s(){for(var r in n.state=Si,n.timer.stop(),delete i[e],i)return;delete t.__transition}i[e]=n,n.timer=li((function(t){n.state=wi,n.timer.restart(o,n.delay,n.time),n.delay<=t&&o(t-n.delay)}),0,n.time)}(t,n,{name:e,index:r,group:i,on:mi,tween:vi,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:_i})};function Mi(t,e){var n=Ci(t,e);if(n.state>_i)throw new Error("too late; already scheduled");return n}function Di(t,e){var n=Ci(t,e);if(n.state>ki)throw new Error("too late; already running");return n}function Ci(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}var Oi=function(t,e){var n,r,i,o=t.__transition,a=!0;if(o){for(i in e=null==e?null:e+"",o)(n=o[i]).name===e?(r=n.state>xi&&n.state<Ai,n.state=Si,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[i]):a=!1;a&&delete t.__transition}};function Ri(t,e){var n,r;return function(){var i=Di(this,t),o=i.tween;if(o!==n)for(var a=0,s=(r=n=o).length;a<s;++a)if(r[a].name===e){(r=r.slice()).splice(a,1);break}i.tween=r}}function Ii(t,e,n){var r,i;if("function"!=typeof n)throw new Error;return function(){var o=Di(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var s={name:e,value:n},u=0,c=i.length;u<c;++u)if(i[u].name===e){i[u]=s;break}u===c&&i.push(s)}o.tween=i}}function Ni(t,e,n){var r=t._id;return t.each((function(){var t=Di(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return Ci(t,r).value[e]}}var Bi=function(t,e){var n;return("number"==typeof e?Un:e instanceof dn?Bn:(n=dn(e))?(e=n,Bn):Kn)(t,e)};function Li(t){return function(){this.removeAttribute(t)}}function Pi(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Fi(t,e,n){var r,i,o=n+"";return function(){var a=this.getAttribute(t);return a===o?null:a===r?i:i=e(r=a,n)}}function qi(t,e,n){var r,i,o=n+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===o?null:a===r?i:i=e(r=a,n)}}function ji(t,e,n){var r,i,o;return function(){var a,s,u=n(this);if(null!=u)return(a=this.getAttribute(t))===(s=u+"")?null:a===r&&s===i?o:(i=s,o=e(r=a,u));this.removeAttribute(t)}}function Ui(t,e,n){var r,i,o;return function(){var a,s,u=n(this);if(null!=u)return(a=this.getAttributeNS(t.space,t.local))===(s=u+"")?null:a===r&&s===i?o:(i=s,o=e(r=a,u));this.removeAttributeNS(t.space,t.local)}}function zi(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&function(t,e){return function(n){this.setAttributeNS(t.space,t.local,e(n))}}(t,i)),n}return i._value=e,i}function Yi(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&function(t,e){return function(n){this.setAttribute(t,e(n))}}(t,i)),n}return i._value=e,i}function Vi(t,e){return function(){Mi(this,t).delay=+e.apply(this,arguments)}}function Hi(t,e){return e=+e,function(){Mi(this,t).delay=e}}function $i(t,e){return function(){Di(this,t).duration=+e.apply(this,arguments)}}function Gi(t,e){return e=+e,function(){Di(this,t).duration=e}}function Wi(t,e){if("function"!=typeof e)throw new Error;return function(){Di(this,t).ease=e}}function Ki(t,e,n){var r,i,o=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?Mi:Di;return function(){var a=o(this,t),s=a.on;s!==r&&(i=(r=s).copy()).on(e,n),a.on=i}}var Xi=Te.prototype.constructor;function Zi(t){return function(){this.style.removeProperty(t)}}function Ji(t,e,n){var r,i;function o(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,e,n){return function(r){this.style.setProperty(t,e(r),n)}}(t,o,n)),r}return o._value=e,o}var Qi=0;function to(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function eo(t){return Te().transition(t)}function no(){return++Qi}var ro=Te.prototype;function io(t){return+t}function oo(t){return t*t}function ao(t){return t*(2-t)}function so(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function uo(t){return t*t*t}function co(t){return--t*t*t+1}function fo(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}to.prototype=eo.prototype={constructor:to,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=kt(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var s,u,c=r[a],f=c.length,l=o[a]=new Array(f),h=0;h<f;++h)(s=c[h])&&(u=t.call(s,s.__data__,h,c))&&("__data__"in s&&(u.__data__=s.__data__),l[h]=u,Ti(l[h],e,n,h,l,Ci(s,n)));return new to(o,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=At(t));for(var r=this._groups,i=r.length,o=[],a=[],s=0;s<i;++s)for(var u,c=r[s],f=c.length,l=0;l<f;++l)if(u=c[l]){for(var h,d=t.call(u,u.__data__,l,c),p=Ci(u,n),g=0,y=d.length;g<y;++g)(h=d[g])&&Ti(h,e,n,g,d,p);o.push(d),a.push(u)}return new to(o,a,e,n)},filter:function(t){"function"!=typeof t&&(t=St(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o,a=e[i],s=a.length,u=r[i]=[],c=0;c<s;++c)(o=a[c])&&t.call(o,o.__data__,c,a)&&u.push(o);return new to(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var u,c=e[s],f=n[s],l=c.length,h=a[s]=new Array(l),d=0;d<l;++d)(u=c[d]||f[d])&&(h[d]=u);for(;s<r;++s)a[s]=e[s];return new to(a,this._parents,this._name,this._id)},selection:function(){return new Xi(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=no(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a,s=r[o],u=s.length,c=0;c<u;++c)if(a=s[c]){var f=Ci(a,e);Ti(a,t,n,c,s,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new to(r,this._parents,t,n)},call:ro.call,nodes:ro.nodes,node:ro.node,size:ro.size,empty:ro.empty,each:ro.each,on:function(t,e){var n=this._id;return arguments.length<2?Ci(this.node(),n).on.on(t):this.each(Ki(n,t,e))},attr:function(t,e){var n=mt(t),r="transform"===n?or:Bi;return this.attrTween(t,"function"==typeof e?(n.local?Ui:ji)(n,r,Ni(this,"attr."+t,e)):null==e?(n.local?Pi:Li)(n):(n.local?qi:Fi)(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=mt(t);return this.tween(n,(r.local?zi:Yi)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?ir:Bi;return null==e?this.styleTween(t,function(t,e){var n,r,i;return function(){var o=Yt(this,t),a=(this.style.removeProperty(t),Yt(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}(t,r)).on("end.style."+t,Zi(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,i,o;return function(){var a=Yt(this,t),s=n(this),u=s+"";return null==s&&(this.style.removeProperty(t),u=s=Yt(this,t)),a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s))}}(t,r,Ni(this,"style."+t,e))).each(function(t,e){var n,r,i,o,a="style."+e,s="end."+a;return function(){var u=Di(this,t),c=u.on,f=null==u.value[a]?o||(o=Zi(e)):void 0;c===n&&i===f||(r=(n=c).copy()).on(s,i=f),u.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,i,o=n+"";return function(){var a=Yt(this,t);return a===o?null:a===r?i:i=e(r=a,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,Ji(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(Ni(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",(t=this._id,function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}));var t},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,i=Ci(this.node(),n).tween,o=0,a=i.length;o<a;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==e?Ri:Ii)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?Vi:Hi)(e,t)):Ci(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?$i:Gi)(e,t)):Ci(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(Wi(e,t)):Ci(this.node(),e).ease},end:function(){var t,e,n=this,r=n._id,i=n.size();return new Promise((function(o,a){var s={value:a},u={value:function(){0==--i&&o()}};n.each((function(){var n=Di(this,r),i=n.on;i!==t&&((e=(t=i).copy())._.cancel.push(s),e._.interrupt.push(s),e._.end.push(u)),n.on=e}))}))}};var lo=function t(e){function n(t){return Math.pow(t,e)}return e=+e,n.exponent=t,n}(3),ho=function t(e){function n(t){return 1-Math.pow(1-t,e)}return e=+e,n.exponent=t,n}(3),po=function t(e){function n(t){return((t*=2)<=1?Math.pow(t,e):2-Math.pow(2-t,e))/2}return e=+e,n.exponent=t,n}(3),go=Math.PI,yo=go/2;function bo(t){return 1-Math.cos(t*yo)}function mo(t){return Math.sin(t*yo)}function vo(t){return(1-Math.cos(go*t))/2}function _o(t){return Math.pow(2,10*t-10)}function wo(t){return 1-Math.pow(2,-10*t)}function xo(t){return((t*=2)<=1?Math.pow(2,10*t-10):2-Math.pow(2,10-10*t))/2}function ko(t){return 1-Math.sqrt(1-t*t)}function Eo(t){return Math.sqrt(1- --t*t)}function Ao(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var So=4/11,To=6/11,Mo=8/11,Do=.75,Co=9/11,Oo=10/11,Ro=.9375,Io=21/22,No=63/64,Bo=1/So/So;function Lo(t){return 1-Po(1-t)}function Po(t){return(t=+t)<So?Bo*t*t:t<Mo?Bo*(t-=To)*t+Do:t<Oo?Bo*(t-=Co)*t+Ro:Bo*(t-=Io)*t+No}function Fo(t){return((t*=2)<=1?1-Po(1-t):Po(t-1)+1)/2}var qo=function t(e){function n(t){return t*t*((e+1)*t-e)}return e=+e,n.overshoot=t,n}(1.70158),jo=function t(e){function n(t){return--t*t*((e+1)*t+e)+1}return e=+e,n.oversho