forked from thomasbanghart/viz-sunburst-marketplace
-
Notifications
You must be signed in to change notification settings - Fork 6
/
sunburst.js
1 lines (1 loc) · 85.8 KB
/
sunburst.js
1
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.sunburst=e():t.sunburst=e()}(self,(()=>(()=>{var t={776:t=>{var e={};!function(t){function e(t){for(var e="",n=t.length-1;n>=0;)e+=t.charAt(n--);return e}function n(t,e){for(var n="";n.length<e;)n+=t;return n}function r(t,e){var r=""+t;return r.length>=e?r:n("0",e-r.length)+r}function a(t,e){var r=""+t;return r.length>=e?r:n(" ",e-r.length)+r}function i(t,e){var r=""+t;return r.length>=e?r:r+n(" ",e-r.length)}t.version="0.11.0";var o=Math.pow(2,32);function u(t,e){return t>o||t<-o?function(t,e){var r=""+Math.round(t);return r.length>=e?r:n("0",e-r.length)+r}(t,e):function(t,e){var r=""+t;return r.length>=e?r:n("0",e-r.length)+r}(Math.round(t),e)}function s(t,e){return e=e||0,t.length>=7+e&&103==(32|t.charCodeAt(e))&&101==(32|t.charCodeAt(e+1))&&110==(32|t.charCodeAt(e+2))&&101==(32|t.charCodeAt(e+3))&&114==(32|t.charCodeAt(e+4))&&97==(32|t.charCodeAt(e+5))&&108==(32|t.charCodeAt(e+6))}var l=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],c=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function h(t){t[0]="General",t[1]="0",t[2]="0.00",t[3]="#,##0",t[4]="#,##0.00",t[9]="0%",t[10]="0.00%",t[11]="0.00E+00",t[12]="# ?/?",t[13]="# ??/??",t[14]="m/d/yy",t[15]="d-mmm-yy",t[16]="d-mmm",t[17]="mmm-yy",t[18]="h:mm AM/PM",t[19]="h:mm:ss AM/PM",t[20]="h:mm",t[21]="h:mm:ss",t[22]="m/d/yy h:mm",t[37]="#,##0 ;(#,##0)",t[38]="#,##0 ;[Red](#,##0)",t[39]="#,##0.00;(#,##0.00)",t[40]="#,##0.00;[Red](#,##0.00)",t[45]="mm:ss",t[46]="[h]:mm:ss",t[47]="mmss.0",t[48]="##0.0E+0",t[49]="@",t[56]='"上午/下午 "hh"時"mm"分"ss"秒 "',t[65535]="General"}var f={};function p(t,e,n){for(var r=t<0?-1:1,a=t*r,i=0,o=1,u=0,s=1,l=0,c=0,h=Math.floor(a);l<e&&(u=(h=Math.floor(a))*o+i,c=h*l+s,!(a-h<5e-8));)a=1/(a-h),i=o,o=u,s=l,l=c;if(c>e&&(l>e?(c=s,u=i):(c=l,u=o)),!n)return[0,r*u,c];var f=Math.floor(r*u/c);return[f,r*u-f*c,c]}function d(t,e,n){if(t>2958465||t<0)return null;var r=0|t,a=Math.floor(86400*(t-r)),i=0,o=[],u={D:r,T:a,u:86400*(t-r)-a,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(u.u)<1e-6&&(u.u=0),e&&e.date1904&&(r+=1462),u.u>.9999&&(u.u=0,86400==++a&&(u.T=a=0,++r,++u.D)),60===r)o=n?[1317,10,29]:[1900,2,29],i=3;else if(0===r)o=n?[1317,8,29]:[1900,1,0],i=6;else{r>60&&--r;var s=new Date(1900,0,1);s.setDate(s.getDate()+r-1),o=[s.getFullYear(),s.getMonth()+1,s.getDate()],i=s.getDay(),r<60&&(i=(i+6)%7),n&&(i=0)}return u.y=o[0],u.m=o[1],u.d=o[2],u.S=a%60,a=Math.floor(a/60),u.M=a%60,a=Math.floor(a/60),u.H=a,u.q=i,u}h(f),t.parse_date_code=d;var v=new Date(1899,11,31,0,0,0),g=v.getTime(),m=new Date(1900,2,1,0,0,0);function y(t,e){var n=t.getTime();return e?n-=1262304e5:t>=m&&(n+=864e5),(n-(g+6e4*(t.getTimezoneOffset()-v.getTimezoneOffset())))/864e5}t._general_int=function(t){return t.toString(10)};var _=function(){var t=/\.(\d*[1-9])0+$/,e=/\.0*$/,n=/\.(\d*[1-9])0+/,r=/\.0*[Ee]/,a=/(E[+-])(\d)$/;function i(n){return n.indexOf(".")>-1?n.replace(e,"").replace(t,".$1"):n}return function(e){var o,u=Math.floor(Math.log(Math.abs(e))*Math.LOG10E);return o=u>=-4&&u<=-1?e.toPrecision(10+u):Math.abs(u)<=9?function(t){var e=t<0?12:11,n=i(t.toFixed(12));return n.length<=e||(n=t.toPrecision(10)).length<=e?n:t.toExponential(5)}(e):10===u?e.toFixed(10).substr(0,12):function(e){var n=e.toFixed(11).replace(t,".$1");return n.length>(e<0?12:11)&&(n=e.toPrecision(6)),n}(e),i(function(t){for(var e=0;e!=t.length;++e)if(101==(32|t.charCodeAt(e)))return t.replace(n,".$1").replace(r,"E").replace("e","E").replace(a,"$10$2");return t}(o))}}();function w(t,e){switch(typeof t){case"string":return t;case"boolean":return t?"TRUE":"FALSE";case"number":return(0|t)===t?t.toString(10):_(t);case"undefined":return"";case"object":if(null==t)return"";if(t instanceof Date)return R(14,y(t,e&&e.date1904),e)}throw new Error("unsupported value in General format: "+t)}function b(t,e,n,a){var i,o="",u=0,s=0,h=n.y,f=0;switch(t){case 98:h=n.y+543;case 121:switch(e.length){case 1:case 2:i=h%100,f=2;break;default:i=h%1e4,f=4}break;case 109:switch(e.length){case 1:case 2:i=n.m,f=e.length;break;case 3:return c[n.m-1][1];case 5:return c[n.m-1][0];default:return c[n.m-1][2]}break;case 100:switch(e.length){case 1:case 2:i=n.d,f=e.length;break;case 3:return l[n.q][0];default:return l[n.q][1]}break;case 104:switch(e.length){case 1:case 2:i=1+(n.H+11)%12,f=e.length;break;default:throw"bad hour format: "+e}break;case 72:switch(e.length){case 1:case 2:i=n.H,f=e.length;break;default:throw"bad hour format: "+e}break;case 77:switch(e.length){case 1:case 2:i=n.M,f=e.length;break;default:throw"bad minute format: "+e}break;case 115:if("s"!=e&&"ss"!=e&&".0"!=e&&".00"!=e&&".000"!=e)throw"bad second format: "+e;return 0!==n.u||"s"!=e&&"ss"!=e?(s=a>=2?3===a?1e3:100:1===a?10:1,(u=Math.round(s*(n.S+n.u)))>=60*s&&(u=0),"s"===e?0===u?"0":""+u/s:(o=r(u,2+a),"ss"===e?o.substr(0,2):"."+o.substr(2,e.length-1))):r(n.S,e.length);case 90:switch(e){case"[h]":case"[hh]":i=24*n.D+n.H;break;case"[m]":case"[mm]":i=60*(24*n.D+n.H)+n.M;break;case"[s]":case"[ss]":i=60*(60*(24*n.D+n.H)+n.M)+Math.round(n.S+n.u);break;default:throw"bad abstime format: "+e}f=3===e.length?1:2;break;case 101:i=h,f=1}return f>0?r(i,f):""}function x(t){if(t.length<=3)return t;for(var e=t.length%3,n=t.substr(0,e);e!=t.length;e+=3)n+=(n.length>0?",":"")+t.substr(e,3);return n}t._general_num=_,t._general=w;var M=function(){var t=/%/g;function o(t,e){var n,r=t.indexOf("E")-t.indexOf(".")-1;if(t.match(/^#+0.0E\+0$/)){if(0==e)return"0.0E+0";if(e<0)return"-"+o(t,-e);var a=t.indexOf(".");-1===a&&(a=t.indexOf("E"));var i=Math.floor(Math.log(e)*Math.LOG10E)%a;if(i<0&&(i+=a),-1===(n=(e/Math.pow(10,i)).toPrecision(r+1+(a+i)%a)).indexOf("e")){var u=Math.floor(Math.log(e)*Math.LOG10E);for(-1===n.indexOf(".")?n=n.charAt(0)+"."+n.substr(1)+"E+"+(u-n.length+i):n+="E+"+(u-i);"0."===n.substr(0,2);)n=(n=n.charAt(0)+n.substr(2,a)+"."+n.substr(2+a)).replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");n=n.replace(/\+-/,"-")}n=n.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,(function(t,e,n,r){return e+n+r.substr(0,(a+i)%a)+"."+r.substr(i)+"E"}))}else n=e.toExponential(r);return t.match(/E\+00$/)&&n.match(/e[+-]\d$/)&&(n=n.substr(0,n.length-1)+"0"+n.charAt(n.length-1)),t.match(/E\-/)&&n.match(/e\+/)&&(n=n.replace(/e\+/,"e")),n.replace("e","E")}var s=/# (\?+)( ?)\/( ?)(\d+)/;var l=/^#*0*\.([0#]+)/,c=/\).*[0#]/,h=/\(###\) ###\\?-####/;function f(t){for(var e,n="",r=0;r!=t.length;++r)switch(e=t.charCodeAt(r)){case 35:break;case 63:n+=" ";break;case 48:n+="0";break;default:n+=String.fromCharCode(e)}return n}function d(t,e){var n=Math.pow(10,e);return""+Math.round(t*n)/n}function v(t,e){return e<(""+Math.round((t-Math.floor(t))*Math.pow(10,e))).length?0:Math.round((t-Math.floor(t))*Math.pow(10,e))}function g(m,y,_){if(40===m.charCodeAt(0)&&!y.match(c)){var w=y.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return _>=0?g("n",w,_):"("+g("n",w,-_)+")"}if(44===y.charCodeAt(y.length-1))return function(t,e,n){for(var r=e.length-1;44===e.charCodeAt(r-1);)--r;return M(t,e.substr(0,r),n/Math.pow(10,3*(e.length-r)))}(m,y,_);if(-1!==y.indexOf("%"))return function(e,r,a){var i=r.replace(t,""),o=r.length-i.length;return M(e,i,a*Math.pow(10,2*o))+n("%",o)}(m,y,_);if(-1!==y.indexOf("E"))return o(y,_);if(36===y.charCodeAt(0))return"$"+g(m,y.substr(" "==y.charAt(1)?2:1),_);var b,A,k,C,E=Math.abs(_),N=_<0?"-":"";if(y.match(/^00+$/))return N+u(E,y.length);if(y.match(/^[#?]+$/))return"0"===(b=u(_,0))&&(b=""),b.length>y.length?b:f(y.substr(0,y.length-b.length))+b;if(A=y.match(s))return function(t,e,i){var o=parseInt(t[4],10),u=Math.round(e*o),s=Math.floor(u/o),l=u-s*o,c=o;return i+(0===s?"":""+s)+" "+(0===l?n(" ",t[1].length+1+t[4].length):a(l,t[1].length)+t[2]+"/"+t[3]+r(c,t[4].length))}(A,E,N);if(y.match(/^#+0+$/))return N+u(E,y.length-y.indexOf("0"));if(A=y.match(l))return b=d(_,A[1].length).replace(/^([^\.]+)$/,"$1."+f(A[1])).replace(/\.$/,"."+f(A[1])).replace(/\.(\d*)$/,(function(t,e){return"."+e+n("0",f(A[1]).length-e.length)})),-1!==y.indexOf("0.")?b:b.replace(/^0\./,".");if(y=y.replace(/^#+([0.])/,"$1"),A=y.match(/^(0*)\.(#*)$/))return N+d(E,A[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,A[1].length?"0.":".");if(A=y.match(/^#{1,3},##0(\.?)$/))return N+x(u(E,0));if(A=y.match(/^#,##0\.([#0]*0)$/))return _<0?"-"+g(m,y,-_):x(""+(Math.floor(_)+function(t,e){return e<(""+Math.round((t-Math.floor(t))*Math.pow(10,e))).length?1:0}(_,A[1].length)))+"."+r(v(_,A[1].length),A[1].length);if(A=y.match(/^#,#*,#0/))return g(m,y.replace(/^#,#*,/,""),_);if(A=y.match(/^([0#]+)(\\?-([0#]+))+$/))return b=e(g(m,y.replace(/[\\-]/g,""),_)),k=0,e(e(y.replace(/\\/g,"")).replace(/[0#]/g,(function(t){return k<b.length?b.charAt(k++):"0"===t?"0":""})));if(y.match(h))return"("+(b=g(m,"##########",_)).substr(0,3)+") "+b.substr(3,3)+"-"+b.substr(6);var O="";if(A=y.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return k=Math.min(A[4].length,7),C=p(E,Math.pow(10,k)-1,!1),b=""+N," "==(O=M("n",A[1],C[1])).charAt(O.length-1)&&(O=O.substr(0,O.length-1)+"0"),b+=O+A[2]+"/"+A[3],(O=i(C[2],k)).length<A[4].length&&(O=f(A[4].substr(A[4].length-O.length))+O),b+=O;if(A=y.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return k=Math.min(Math.max(A[1].length,A[4].length),7),N+((C=p(E,Math.pow(10,k)-1,!0))[0]||(C[1]?"":"0"))+" "+(C[1]?a(C[1],k)+A[2]+"/"+A[3]+i(C[2],k):n(" ",2*k+1+A[2].length+A[3].length));if(A=y.match(/^[#0?]+$/))return b=u(_,0),y.length<=b.length?b:f(y.substr(0,y.length-b.length))+b;if(A=y.match(/^([#0?]+)\.([#0]+)$/)){b=""+_.toFixed(Math.min(A[2].length,10)).replace(/([^0])0+$/,"$1"),k=b.indexOf(".");var $=y.indexOf(".")-k,R=y.length-b.length-$;return f(y.substr(0,$)+b+y.substr(y.length-R))}if(A=y.match(/^00,000\.([#0]*0)$/))return k=v(_,A[1].length),_<0?"-"+g(m,y,-_):x(function(t){return t<2147483647&&t>-2147483648?""+(t>=0?0|t:t-1|0):""+Math.floor(t)}(_)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,(function(t){return"00,"+(t.length<3?r(0,3-t.length):"")+t}))+"."+r(k,A[1].length);switch(y){case"###,##0.00":return g(m,"#,##0.00",_);case"###,###":case"##,###":case"#,###":var L=x(u(E,0));return"0"!==L?N+L:"";case"###,###.00":return g(m,"###,##0.00",_).replace(/^0\./,".");case"#,###.00":return g(m,"#,##0.00",_).replace(/^0\./,".")}throw new Error("unsupported format |"+y+"|")}function m(t,e){var n,r=t.indexOf("E")-t.indexOf(".")-1;if(t.match(/^#+0.0E\+0$/)){if(0==e)return"0.0E+0";if(e<0)return"-"+m(t,-e);var a=t.indexOf(".");-1===a&&(a=t.indexOf("E"));var i=Math.floor(Math.log(e)*Math.LOG10E)%a;if(i<0&&(i+=a),!(n=(e/Math.pow(10,i)).toPrecision(r+1+(a+i)%a)).match(/[Ee]/)){var o=Math.floor(Math.log(e)*Math.LOG10E);-1===n.indexOf(".")?n=n.charAt(0)+"."+n.substr(1)+"E+"+(o-n.length+i):n+="E+"+(o-i),n=n.replace(/\+-/,"-")}n=n.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,(function(t,e,n,r){return e+n+r.substr(0,(a+i)%a)+"."+r.substr(i)+"E"}))}else n=e.toExponential(r);return t.match(/E\+00$/)&&n.match(/e[+-]\d$/)&&(n=n.substr(0,n.length-1)+"0"+n.charAt(n.length-1)),t.match(/E\-/)&&n.match(/e\+/)&&(n=n.replace(/e\+/,"e")),n.replace("e","E")}function y(o,u,d){if(40===o.charCodeAt(0)&&!u.match(c)){var v=u.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return d>=0?y("n",v,d):"("+y("n",v,-d)+")"}if(44===u.charCodeAt(u.length-1))return function(t,e,n){for(var r=e.length-1;44===e.charCodeAt(r-1);)--r;return M(t,e.substr(0,r),n/Math.pow(10,3*(e.length-r)))}(o,u,d);if(-1!==u.indexOf("%"))return function(e,r,a){var i=r.replace(t,""),o=r.length-i.length;return M(e,i,a*Math.pow(10,2*o))+n("%",o)}(o,u,d);if(-1!==u.indexOf("E"))return m(u,d);if(36===u.charCodeAt(0))return"$"+y(o,u.substr(" "==u.charAt(1)?2:1),d);var g,_,w,b,A=Math.abs(d),k=d<0?"-":"";if(u.match(/^00+$/))return k+r(A,u.length);if(u.match(/^[#?]+$/))return g=""+d,0===d&&(g=""),g.length>u.length?g:f(u.substr(0,u.length-g.length))+g;if(_=u.match(s))return function(t,e,r){return r+(0===e?"":""+e)+n(" ",t[1].length+2+t[4].length)}(_,A,k);if(u.match(/^#+0+$/))return k+r(A,u.length-u.indexOf("0"));if(_=u.match(l))return g=(g=(""+d).replace(/^([^\.]+)$/,"$1."+f(_[1])).replace(/\.$/,"."+f(_[1]))).replace(/\.(\d*)$/,(function(t,e){return"."+e+n("0",f(_[1]).length-e.length)})),-1!==u.indexOf("0.")?g:g.replace(/^0\./,".");if(u=u.replace(/^#+([0.])/,"$1"),_=u.match(/^(0*)\.(#*)$/))return k+(""+A).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,_[1].length?"0.":".");if(_=u.match(/^#{1,3},##0(\.?)$/))return k+x(""+A);if(_=u.match(/^#,##0\.([#0]*0)$/))return d<0?"-"+y(o,u,-d):x(""+d)+"."+n("0",_[1].length);if(_=u.match(/^#,#*,#0/))return y(o,u.replace(/^#,#*,/,""),d);if(_=u.match(/^([0#]+)(\\?-([0#]+))+$/))return g=e(y(o,u.replace(/[\\-]/g,""),d)),w=0,e(e(u.replace(/\\/g,"")).replace(/[0#]/g,(function(t){return w<g.length?g.charAt(w++):"0"===t?"0":""})));if(u.match(h))return"("+(g=y(o,"##########",d)).substr(0,3)+") "+g.substr(3,3)+"-"+g.substr(6);var C="";if(_=u.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return w=Math.min(_[4].length,7),b=p(A,Math.pow(10,w)-1,!1),g=""+k," "==(C=M("n",_[1],b[1])).charAt(C.length-1)&&(C=C.substr(0,C.length-1)+"0"),g+=C+_[2]+"/"+_[3],(C=i(b[2],w)).length<_[4].length&&(C=f(_[4].substr(_[4].length-C.length))+C),g+=C;if(_=u.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return w=Math.min(Math.max(_[1].length,_[4].length),7),k+((b=p(A,Math.pow(10,w)-1,!0))[0]||(b[1]?"":"0"))+" "+(b[1]?a(b[1],w)+_[2]+"/"+_[3]+i(b[2],w):n(" ",2*w+1+_[2].length+_[3].length));if(_=u.match(/^[#0?]+$/))return g=""+d,u.length<=g.length?g:f(u.substr(0,u.length-g.length))+g;if(_=u.match(/^([#0]+)\.([#0]+)$/)){g=""+d.toFixed(Math.min(_[2].length,10)).replace(/([^0])0+$/,"$1"),w=g.indexOf(".");var E=u.indexOf(".")-w,N=u.length-g.length-E;return f(u.substr(0,E)+g+u.substr(u.length-N))}if(_=u.match(/^00,000\.([#0]*0)$/))return d<0?"-"+y(o,u,-d):x(""+d).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,(function(t){return"00,"+(t.length<3?r(0,3-t.length):"")+t}))+"."+r(0,_[1].length);switch(u){case"###,###":case"##,###":case"#,###":var O=x(""+A);return"0"!==O?k+O:"";default:if(u.match(/\.[0#?]*$/))return y(o,u.slice(0,u.lastIndexOf(".")),d)+f(u.slice(u.lastIndexOf(".")))}throw new Error("unsupported format |"+u+"|")}return function(t,e,n){return(0|n)===n?y(t,e,n):g(t,e,n)}}();function A(t){for(var e=[],n=!1,r=0,a=0;r<t.length;++r)switch(t.charCodeAt(r)){case 34:n=!n;break;case 95:case 42:case 92:++r;break;case 59:e[e.length]=t.substr(a,r-a),a=r+1}if(e[e.length]=t.substr(a),!0===n)throw new Error("Format |"+t+"| unterminated string ");return e}t._split=A;var k=/\[[HhMmSs]*\]/;function C(t){for(var e=0,n="",r="";e<t.length;)switch(n=t.charAt(e)){case"G":s(t,e)&&(e+=6),e++;break;case'"':for(;34!==t.charCodeAt(++e)&&e<t.length;);++e;break;case"\\":case"_":e+=2;break;case"@":++e;break;case"B":case"b":if("1"===t.charAt(e+1)||"2"===t.charAt(e+1))return!0;case"M":case"D":case"Y":case"H":case"S":case"E":case"m":case"d":case"y":case"h":case"s":case"e":case"g":return!0;case"A":case"a":if("A/P"===t.substr(e,3).toUpperCase())return!0;if("AM/PM"===t.substr(e,5).toUpperCase())return!0;++e;break;case"[":for(r=n;"]"!==t.charAt(e++)&&e<t.length;)r+=t.charAt(e);if(r.match(k))return!0;break;case".":case"0":case"#":for(;e<t.length&&("0#?.,E+-%".indexOf(n=t.charAt(++e))>-1||"\\"==n&&"-"==t.charAt(e+1)&&"0#".indexOf(t.charAt(e+2))>-1););break;case"?":for(;t.charAt(++e)===n;);break;case"*":++e," "!=t.charAt(e)&&"*"!=t.charAt(e)||++e;break;case"(":case")":++e;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;e<t.length&&"0123456789".indexOf(t.charAt(++e))>-1;);break;default:++e}return!1}function E(t,e,n,r){for(var a,i,o,u=[],l="",c=0,h="",f="t",p="H";c<t.length;)switch(h=t.charAt(c)){case"G":if(!s(t,c))throw new Error("unrecognized character "+h+" in "+t);u[u.length]={t:"G",v:"General"},c+=7;break;case'"':for(l="";34!==(o=t.charCodeAt(++c))&&c<t.length;)l+=String.fromCharCode(o);u[u.length]={t:"t",v:l},++c;break;case"\\":var v=t.charAt(++c),g="("===v||")"===v?v:"t";u[u.length]={t:g,v},++c;break;case"_":u[u.length]={t:"t",v:" "},c+=2;break;case"@":u[u.length]={t:"T",v:e},++c;break;case"B":case"b":if("1"===t.charAt(c+1)||"2"===t.charAt(c+1)){if(null==a&&null==(a=d(e,n,"2"===t.charAt(c+1))))return"";u[u.length]={t:"X",v:t.substr(c,2)},f=h,c+=2;break}case"M":case"D":case"Y":case"H":case"S":case"E":h=h.toLowerCase();case"m":case"d":case"y":case"h":case"s":case"e":case"g":if(e<0)return"";if(null==a&&null==(a=d(e,n)))return"";for(l=h;++c<t.length&&t.charAt(c).toLowerCase()===h;)l+=h;"m"===h&&"h"===f.toLowerCase()&&(h="M"),"h"===h&&(h=p),u[u.length]={t:h,v:l},f=h;break;case"A":case"a":var m={t:h,v:h};if(null==a&&(a=d(e,n)),"A/P"===t.substr(c,3).toUpperCase()?(null!=a&&(m.v=a.H>=12?"P":"A"),m.t="T",p="h",c+=3):"AM/PM"===t.substr(c,5).toUpperCase()?(null!=a&&(m.v=a.H>=12?"PM":"AM"),m.t="T",c+=5,p="h"):(m.t="t",++c),null==a&&"T"===m.t)return"";u[u.length]=m,f=h;break;case"[":for(l=h;"]"!==t.charAt(c++)&&c<t.length;)l+=t.charAt(c);if("]"!==l.slice(-1))throw'unterminated "[" block: |'+l+"|";if(l.match(k)){if(null==a&&null==(a=d(e,n)))return"";u[u.length]={t:"Z",v:l.toLowerCase()},f=l.charAt(1)}else l.indexOf("$")>-1&&(l=(l.match(/\$([^-\[\]]*)/)||[])[1]||"$",C(t)||(u[u.length]={t:"t",v:l}));break;case".":if(null!=a){for(l=h;++c<t.length&&"0"===(h=t.charAt(c));)l+=h;u[u.length]={t:"s",v:l};break}case"0":case"#":for(l=h;++c<t.length&&"0#?.,E+-%".indexOf(h=t.charAt(c))>-1;)l+=h;u[u.length]={t:"n",v:l};break;case"?":for(l=h;t.charAt(++c)===h;)l+=h;u[u.length]={t:h,v:l},f=h;break;case"*":++c," "!=t.charAt(c)&&"*"!=t.charAt(c)||++c;break;case"(":case")":u[u.length]={t:1===r?"t":h,v:h},++c;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(l=h;c<t.length&&"0123456789".indexOf(t.charAt(++c))>-1;)l+=t.charAt(c);u[u.length]={t:"D",v:l};break;case" ":u[u.length]={t:h,v:h},++c;break;case"$":u[u.length]={t:"t",v:"$"},++c;break;default:if(-1===",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(h))throw new Error("unrecognized character "+h+" in "+t);u[u.length]={t:"t",v:h},++c}var y,_=0,x=0;for(c=u.length-1,f="t";c>=0;--c)switch(u[c].t){case"h":case"H":u[c].t=p,f="h",_<1&&(_=1);break;case"s":(y=u[c].v.match(/\.0+$/))&&(x=Math.max(x,y[0].length-1)),_<3&&(_=3);case"d":case"y":case"M":case"e":f=u[c].t;break;case"m":"s"===f&&(u[c].t="M",_<2&&(_=2));break;case"X":break;case"Z":_<1&&u[c].v.match(/[Hh]/)&&(_=1),_<2&&u[c].v.match(/[Mm]/)&&(_=2),_<3&&u[c].v.match(/[Ss]/)&&(_=3)}switch(_){case 0:break;case 1:a.u>=.5&&(a.u=0,++a.S),a.S>=60&&(a.S=0,++a.M),a.M>=60&&(a.M=0,++a.H);break;case 2:a.u>=.5&&(a.u=0,++a.S),a.S>=60&&(a.S=0,++a.M)}var A,E="";for(c=0;c<u.length;++c)switch(u[c].t){case"t":case"T":case" ":case"D":break;case"X":u[c].v="",u[c].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":u[c].v=b(u[c].t.charCodeAt(0),u[c].v,a,x),u[c].t="t";break;case"n":case"?":for(A=c+1;null!=u[A]&&("?"===(h=u[A].t)||"D"===h||(" "===h||"t"===h)&&null!=u[A+1]&&("?"===u[A+1].t||"t"===u[A+1].t&&"/"===u[A+1].v)||"("===u[c].t&&(" "===h||"n"===h||")"===h)||"t"===h&&("/"===u[A].v||" "===u[A].v&&null!=u[A+1]&&"?"==u[A+1].t));)u[c].v+=u[A].v,u[A]={v:"",t:";"},++A;E+=u[c].v,c=A-1;break;case"G":u[c].t="t",u[c].v=w(e,n)}var N,O,$="";if(E.length>0){40==E.charCodeAt(0)?(N=e<0&&45===E.charCodeAt(0)?-e:e,O=M("n",E,N)):(O=M("n",E,N=e<0&&r>1?-e:e),N<0&&u[0]&&"t"==u[0].t&&(O=O.substr(1),u[0].v="-"+u[0].v)),A=O.length-1;var R=u.length;for(c=0;c<u.length;++c)if(null!=u[c]&&"t"!=u[c].t&&u[c].v.indexOf(".")>-1){R=c;break}var L=u.length;if(R===u.length&&-1===O.indexOf("E")){for(c=u.length-1;c>=0;--c)null!=u[c]&&-1!=="n?".indexOf(u[c].t)&&(A>=u[c].v.length-1?(A-=u[c].v.length,u[c].v=O.substr(A+1,u[c].v.length)):A<0?u[c].v="":(u[c].v=O.substr(0,A+1),A=-1),u[c].t="t",L=c);A>=0&&L<u.length&&(u[L].v=O.substr(0,A+1)+u[L].v)}else if(R!==u.length&&-1===O.indexOf("E")){for(A=O.indexOf(".")-1,c=R;c>=0;--c)if(null!=u[c]&&-1!=="n?".indexOf(u[c].t)){for(i=u[c].v.indexOf(".")>-1&&c===R?u[c].v.indexOf(".")-1:u[c].v.length-1,$=u[c].v.substr(i+1);i>=0;--i)A>=0&&("0"===u[c].v.charAt(i)||"#"===u[c].v.charAt(i))&&($=O.charAt(A--)+$);u[c].v=$,u[c].t="t",L=c}for(A>=0&&L<u.length&&(u[L].v=O.substr(0,A+1)+u[L].v),A=O.indexOf(".")+1,c=R;c<u.length;++c)if(null!=u[c]&&(-1!=="n?(".indexOf(u[c].t)||c===R)){for(i=u[c].v.indexOf(".")>-1&&c===R?u[c].v.indexOf(".")+1:0,$=u[c].v.substr(0,i);i<u[c].v.length;++i)A<O.length&&($+=O.charAt(A++));u[c].v=$,u[c].t="t",L=c}}}for(c=0;c<u.length;++c)null!=u[c]&&"n?".indexOf(u[c].t)>-1&&(N=r>1&&e<0&&c>0&&"-"===u[c-1].v?-e:e,u[c].v=M(u[c].t,u[c].v,N),u[c].t="t");var S="";for(c=0;c!==u.length;++c)null!=u[c]&&(S+=u[c].v);return S}t.is_date=C,t._eval=E;var N=/\[[=<>]/,O=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function $(t,e){if(null==e)return!1;var n=parseFloat(e[2]);switch(e[1]){case"=":if(t==n)return!0;break;case">":if(t>n)return!0;break;case"<":if(t<n)return!0;break;case"<>":if(t!=n)return!0;break;case">=":if(t>=n)return!0;break;case"<=":if(t<=n)return!0}return!1}function R(t,e,n){null==n&&(n={});var r="";switch(typeof t){case"string":r="m/d/yy"==t&&n.dateNF?n.dateNF:t;break;case"number":r=14==t&&n.dateNF?n.dateNF:(null!=n.table?n.table:f)[t]}if(s(r,0))return w(e,n);e instanceof Date&&(e=y(e,n.date1904));var a=function(t,e){var n=A(t),r=n.length,a=n[r-1].indexOf("@");if(r<4&&a>-1&&--r,n.length>4)throw new Error("cannot find right format for |"+n.join("|")+"|");if("number"!=typeof e)return[4,4===n.length||a>-1?n[n.length-1]:"@"];switch(n.length){case 1:n=a>-1?["General","General","General",n[0]]:[n[0],n[0],n[0],"@"];break;case 2:n=a>-1?[n[0],n[0],n[0],n[1]]:[n[0],n[1],n[0],"@"];break;case 3:n=a>-1?[n[0],n[1],n[0],n[2]]:[n[0],n[1],n[2],"@"]}var i=e>0?n[0]:e<0?n[1]:n[2];if(-1===n[0].indexOf("[")&&-1===n[1].indexOf("["))return[r,i];if(null!=n[0].match(N)||null!=n[1].match(N)){var o=n[0].match(O),u=n[1].match(O);return $(e,o)?[r,n[0]]:$(e,u)?[r,n[1]]:[r,n[null!=o&&null!=u?2:1]]}return[r,i]}(r,e);if(s(a[1]))return w(e,n);if(!0===e)e="TRUE";else if(!1===e)e="FALSE";else if(""===e||null==e)return"";return E(a[1],e,n,a[0])}function L(t,e){if("number"!=typeof e){e=+e||-1;for(var n=0;n<392;++n)if(null!=f[n]){if(f[n]==t){e=n;break}}else e<0&&(e=n);e<0&&(e=391)}return f[e]=t,e}t.load=L,t._table=f,t.get_table=function(){return f},t.load_table=function(t){for(var e=0;392!=e;++e)void 0!==t[e]&&L(t[e],e)},t.init_table=h,t.format=R}(e),"undefined"==typeof DO_NOT_EXPORT_SSF&&(t.exports=e)}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var i=e[r]={exports:{}};return t[r](i,i.exports,n),i.exports}return(()=>{"use strict";function t(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}var e,r;1===(e=t).length&&(r=e,e=function(e,n){return t(r(e),n)});var a=Array.prototype;a.slice,a.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2);Array.prototype.slice;function i(){}function o(t){return null==t?i:function(){return this.querySelector(t)}}function u(){return[]}function s(t){return null==t?u:function(){return this.querySelectorAll(t)}}function l(t){return function(){return this.matches(t)}}function c(t){return new Array(t.length)}function h(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}h.prototype={constructor:h,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 f="$";function p(t,e,n,r,a,i){for(var o,u=0,s=e.length,l=i.length;u<l;++u)(o=e[u])?(o.__data__=i[u],r[u]=o):n[u]=new h(t,i[u]);for(;u<s;++u)(o=e[u])&&(a[u]=o)}function d(t,e,n,r,a,i,o){var u,s,l,c={},p=e.length,d=i.length,v=new Array(p);for(u=0;u<p;++u)(s=e[u])&&(v[u]=l=f+o.call(s,s.__data__,u,e),l in c?a[u]=s:c[l]=s);for(u=0;u<d;++u)(s=c[l=f+o.call(t,i[u],u,i)])?(r[u]=s,s.__data__=i[u],c[l]=null):n[u]=new h(t,i[u]);for(u=0;u<p;++u)(s=e[u])&&c[v[u]]===s&&(a[u]=s)}function v(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}var g="http://www.w3.org/1999/xhtml";const m={svg:"http://www.w3.org/2000/svg",xhtml:g,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function y(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),m.hasOwnProperty(e)?{space:m[e],local:t}:t}function _(t){return function(){this.removeAttribute(t)}}function w(t){return function(){this.removeAttributeNS(t.space,t.local)}}function b(t,e){return function(){this.setAttribute(t,e)}}function x(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function M(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function A(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)}}function k(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function C(t){return function(){this.style.removeProperty(t)}}function E(t,e,n){return function(){this.style.setProperty(t,e,n)}}function N(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function O(t,e){return t.style.getPropertyValue(e)||k(t).getComputedStyle(t,null).getPropertyValue(e)}function $(t){return function(){delete this[t]}}function R(t,e){return function(){this[t]=e}}function L(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function S(t){return t.trim().split(/^|\s+/)}function P(t){return t.classList||new T(t)}function T(t){this._node=t,this._names=S(t.getAttribute("class")||"")}function q(t,e){for(var n=P(t),r=-1,a=e.length;++r<a;)n.add(e[r])}function U(t,e){for(var n=P(t),r=-1,a=e.length;++r<a;)n.remove(e[r])}function D(t){return function(){q(this,t)}}function F(t){return function(){U(this,t)}}function H(t,e){return function(){(e.apply(this,arguments)?q:U)(this,t)}}function j(){this.textContent=""}function B(t){return function(){this.textContent=t}}function X(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function I(){this.innerHTML=""}function z(t){return function(){this.innerHTML=t}}function Y(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function G(){this.nextSibling&&this.parentNode.appendChild(this)}function V(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function J(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===g&&e.documentElement.namespaceURI===g?e.createElement(t):e.createElementNS(n,t)}}function Z(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function W(t){var e=y(t);return(e.local?Z:J)(e)}function K(){return null}function Q(){var t=this.parentNode;t&&t.removeChild(this)}function tt(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function et(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}T.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}};var nt={},rt=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(nt={mouseenter:"mouseover",mouseleave:"mouseout"}));function at(t,e,n){return t=it(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function it(t,e,n){return function(r){var a=rt;rt=r;try{t.call(this,this.__data__,e,n)}finally{rt=a}}}function ot(t){return function(){var e=this.__on;if(e){for(var n,r=0,a=-1,i=e.length;r<i;++r)n=e[r],t.type&&n.type!==t.type||n.name!==t.name?e[++a]=n:this.removeEventListener(n.type,n.listener,n.capture);++a?e.length=a:delete this.__on}}}function ut(t,e,n){var r=nt.hasOwnProperty(t.type)?at:it;return function(a,i,o){var u,s=this.__on,l=r(e,i,o);if(s)for(var c=0,h=s.length;c<h;++c)if((u=s[c]).type===t.type&&u.name===t.name)return this.removeEventListener(u.type,u.listener,u.capture),this.addEventListener(u.type,u.listener=l,u.capture=n),void(u.value=e);this.addEventListener(t.type,l,n),u={type:t.type,name:t.name,value:e,listener:l,capture:n},s?s.push(u):this.__on=[u]}}function st(t,e,n){var r=k(t),a=r.CustomEvent;"function"==typeof a?a=new a(e,n):(a=r.document.createEvent("Event"),n?(a.initEvent(e,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(e,!1,!1)),t.dispatchEvent(a)}function lt(t,e){return function(){return st(this,t,e)}}function ct(t,e){return function(){return st(this,t,e.apply(this,arguments))}}var ht=[null];function ft(t,e){this._groups=t,this._parents=e}function pt(){return new ft([[document.documentElement]],ht)}ft.prototype=pt.prototype={constructor:ft,select:function(t){"function"!=typeof t&&(t=o(t));for(var e=this._groups,n=e.length,r=new Array(n),a=0;a<n;++a)for(var i,u,s=e[a],l=s.length,c=r[a]=new Array(l),h=0;h<l;++h)(i=s[h])&&(u=t.call(i,i.__data__,h,s))&&("__data__"in i&&(u.__data__=i.__data__),c[h]=u);return new ft(r,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=s(t));for(var e=this._groups,n=e.length,r=[],a=[],i=0;i<n;++i)for(var o,u=e[i],l=u.length,c=0;c<l;++c)(o=u[c])&&(r.push(t.call(o,o.__data__,c,u)),a.push(o));return new ft(r,a)},filter:function(t){"function"!=typeof t&&(t=l(t));for(var e=this._groups,n=e.length,r=new Array(n),a=0;a<n;++a)for(var i,o=e[a],u=o.length,s=r[a]=[],c=0;c<u;++c)(i=o[c])&&t.call(i,i.__data__,c,o)&&s.push(i);return new ft(r,this._parents)},data:function(t,e){if(!t)return v=new Array(this.size()),l=-1,this.each((function(t){v[++l]=t})),v;var n=e?d:p,r=this._parents,a=this._groups;"function"!=typeof t&&(t=function(t){return function(){return t}}(t));for(var i=a.length,o=new Array(i),u=new Array(i),s=new Array(i),l=0;l<i;++l){var c=r[l],h=a[l],f=h.length,v=t.call(c,c&&c.__data__,l,r),g=v.length,m=u[l]=new Array(g),y=o[l]=new Array(g);n(c,h,m,y,s[l]=new Array(f),v,e);for(var _,w,b=0,x=0;b<g;++b)if(_=m[b]){for(b>=x&&(x=b+1);!(w=y[x])&&++x<g;);_._next=w||null}}return(o=new ft(o,r))._enter=u,o._exit=s,o},enter:function(){return new ft(this._enter||this._groups.map(c),this._parents)},exit:function(){return new ft(this._exit||this._groups.map(c),this._parents)},join:function(t,e,n){var r=this.enter(),a=this,i=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=e&&(a=e(a)),null==n?i.remove():n(i),r&&a?r.merge(a).order():a},merge:function(t){for(var e=this._groups,n=t._groups,r=e.length,a=n.length,i=Math.min(r,a),o=new Array(r),u=0;u<i;++u)for(var s,l=e[u],c=n[u],h=l.length,f=o[u]=new Array(h),p=0;p<h;++p)(s=l[p]||c[p])&&(f[p]=s);for(;u<r;++u)o[u]=e[u];return new ft(o,this._parents)},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,a=t[e],i=a.length-1,o=a[i];--i>=0;)(r=a[i])&&(o&&4^r.compareDocumentPosition(o)&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=v);for(var n=this._groups,r=n.length,a=new Array(r),i=0;i<r;++i){for(var o,u=n[i],s=u.length,l=a[i]=new Array(s),c=0;c<s;++c)(o=u[c])&&(l[c]=o);l.sort(e)}return new ft(a,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],a=0,i=r.length;a<i;++a){var o=r[a];if(o)return o}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 a,i=e[n],o=0,u=i.length;o<u;++o)(a=i[o])&&t.call(a,a.__data__,o,i);return this},attr:function(t,e){var n=y(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?w:_:"function"==typeof e?n.local?A:M:n.local?x:b)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?C:"function"==typeof e?N:E)(t,e,null==n?"":n)):O(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?$:"function"==typeof e?L:R)(t,e)):this.node()[t]},classed:function(t,e){var n=S(t+"");if(arguments.length<2){for(var r=P(this.node()),a=-1,i=n.length;++a<i;)if(!r.contains(n[a]))return!1;return!0}return this.each(("function"==typeof e?H:e?D:F)(n,e))},text:function(t){return arguments.length?this.each(null==t?j:("function"==typeof t?X:B)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?I:("function"==typeof t?Y:z)(t)):this.node().innerHTML},raise:function(){return this.each(G)},lower:function(){return this.each(V)},append:function(t){var e="function"==typeof t?t:W(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:W(t),r=null==e?K:"function"==typeof e?e:o(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(Q)},clone:function(t){return this.select(t?et:tt)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,a,i=function(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}}))}(t+""),o=i.length;if(!(arguments.length<2)){for(u=e?ut:ot,null==n&&(n=!1),r=0;r<o;++r)this.each(u(i[r],e,n));return this}var u=this.node().__on;if(u)for(var s,l=0,c=u.length;l<c;++l)for(r=0,s=u[l];r<o;++r)if((a=i[r]).type===s.type&&a.name===s.name)return s.value},dispatch:function(t,e){return this.each(("function"==typeof e?ct:lt)(t,e))}};const dt=pt;var vt={value:function(){}};function gt(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new mt(r)}function mt(t){this._=t}function yt(t,e){for(var n,r=0,a=t.length;r<a;++r)if((n=t[r]).name===e)return n.value}function _t(t,e,n){for(var r=0,a=t.length;r<a;++r)if(t[r].name===e){t[r]=vt,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}mt.prototype=gt.prototype={constructor:mt,on:function(t,e){var n,r,a=this._,i=(r=a,(t+"").trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),o=-1,u=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<u;)if(n=(t=i[o]).type)a[n]=_t(a[n],t.name,e);else if(null==e)for(n in a)a[n]=_t(a[n],t.name,null);return this}for(;++o<u;)if((n=(t=i[o]).type)&&(n=yt(a[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new mt(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,a=new Array(n),i=0;i<n;++i)a[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=0,n=(r=this._[t]).length;i<n;++i)r[i].value.apply(e,a)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],a=0,i=r.length;a<i;++a)r[a].value.apply(e,n)}};const wt=gt;var bt,xt,Mt=0,At=0,kt=0,Ct=1e3,Et=0,Nt=0,Ot=0,$t="object"==typeof performance&&performance.now?performance:Date,Rt="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Lt(){return Nt||(Rt(St),Nt=$t.now()+Ot)}function St(){Nt=0}function Pt(){this._call=this._time=this._next=null}function Tt(t,e,n){var r=new Pt;return r.restart(t,e,n),r}function qt(){Nt=(Et=$t.now())+Ot,Mt=At=0;try{!function(){Lt(),++Mt;for(var t,e=bt;e;)(t=Nt-e._time)>=0&&e._call.call(null,t),e=e._next;--Mt}()}finally{Mt=0,function(){var t,e,n=bt,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:bt=e);xt=t,Dt(r)}(),Nt=0}}function Ut(){var t=$t.now(),e=t-Et;e>Ct&&(Ot-=e,Et=t)}function Dt(t){Mt||(At&&(At=clearTimeout(At)),t-Nt>24?(t<1/0&&(At=setTimeout(qt,t-$t.now()-Ot)),kt&&(kt=clearInterval(kt))):(kt||(Et=$t.now(),kt=setInterval(Ut,Ct)),Mt=1,Rt(qt)))}function Ft(t,e,n){var r=new Pt;return e=null==e?0:+e,r.restart((function(n){r.stop(),t(n+e)}),e,n),r}Pt.prototype=Tt.prototype={constructor:Pt,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Lt():+n)+(null==e?0:+e),this._next||xt===this||(xt?xt._next=this:bt=this,xt=this),this._call=t,this._time=n,Dt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Dt())}};var Ht=wt("start","end","cancel","interrupt"),jt=[],Bt=0,Xt=1,It=2,zt=3,Yt=4,Gt=5,Vt=6;function Jt(t,e,n,r,a,i){var o=t.__transition;if(o){if(n in o)return}else t.__transition={};!function(t,e,n){var r,a=t.__transition;function i(t){n.state=Xt,n.timer.restart(o,n.delay,n.time),n.delay<=t&&o(t-n.delay)}function o(i){var l,c,h,f;if(n.state!==Xt)return s();for(l in a)if((f=a[l]).name===n.name){if(f.state===zt)return Ft(o);f.state===Yt?(f.state=Vt,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete a[l]):+l<e&&(f.state=Vt,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete a[l])}if(Ft((function(){n.state===zt&&(n.state=Yt,n.timer.restart(u,n.delay,n.time),u(i))})),n.state=It,n.on.call("start",t,t.__data__,n.index,n.group),n.state===It){for(n.state=zt,r=new Array(h=n.tween.length),l=0,c=-1;l<h;++l)(f=n.tween[l].value.call(t,t.__data__,n.index,n.group))&&(r[++c]=f);r.length=c+1}}function u(e){for(var a=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(s),n.state=Gt,1),i=-1,o=r.length;++i<o;)r[i].call(t,a);n.state===Gt&&(n.on.call("end",t,t.__data__,n.index,n.group),s())}function s(){for(var r in n.state=Vt,n.timer.stop(),delete a[e],a)return;delete t.__transition}a[e]=n,n.timer=Tt(i,0,n.time)}(t,n,{name:e,index:r,group:a,on:Ht,tween:jt,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Bt})}function Zt(t,e){var n=Kt(t,e);if(n.state>Bt)throw new Error("too late; already scheduled");return n}function Wt(t,e){var n=Kt(t,e);if(n.state>zt)throw new Error("too late; already running");return n}function Kt(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Qt(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var te,ee,ne,re,ae=180/Math.PI,ie={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function oe(t,e,n,r,a,i){var o,u,s;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(s=t*n+e*r)&&(n-=t*s,r-=e*s),(u=Math.sqrt(n*n+r*r))&&(n/=u,r/=u,s/=u),t*r<e*n&&(t=-t,e=-e,s=-s,o=-o),{translateX:a,translateY:i,rotate:Math.atan2(e,t)*ae,skewX:Math.atan(s)*ae,scaleX:o,scaleY:u}}function ue(t,e,n,r){function a(t){return t.length?t.pop()+" ":""}return function(i,o){var u=[],s=[];return i=t(i),o=t(o),function(t,r,a,i,o,u){if(t!==a||r!==i){var s=o.push("translate(",null,e,null,n);u.push({i:s-4,x:Qt(t,a)},{i:s-2,x:Qt(r,i)})}else(a||i)&&o.push("translate("+a+e+i+n)}(i.translateX,i.translateY,o.translateX,o.translateY,u,s),function(t,e,n,i){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),i.push({i:n.push(a(n)+"rotate(",null,r)-2,x:Qt(t,e)})):e&&n.push(a(n)+"rotate("+e+r)}(i.rotate,o.rotate,u,s),function(t,e,n,i){t!==e?i.push({i:n.push(a(n)+"skewX(",null,r)-2,x:Qt(t,e)}):e&&n.push(a(n)+"skewX("+e+r)}(i.skewX,o.skewX,u,s),function(t,e,n,r,i,o){if(t!==n||e!==r){var u=i.push(a(i)+"scale(",null,",",null,")");o.push({i:u-4,x:Qt(t,n)},{i:u-2,x:Qt(e,r)})}else 1===n&&1===r||i.push(a(i)+"scale("+n+","+r+")")}(i.scaleX,i.scaleY,o.scaleX,o.scaleY,u,s),i=o=null,function(t){for(var e,n=-1,r=s.length;++n<r;)u[(e=s[n]).i]=e.x(t);return u.join("")}}}var se=ue((function(t){return"none"===t?ie:(te||(te=document.createElement("DIV"),ee=document.documentElement,ne=document.defaultView),te.style.transform=t,t=ne.getComputedStyle(ee.appendChild(te),null).getPropertyValue("transform"),ee.removeChild(te),oe(+(t=t.slice(7,-1).split(","))[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),"px, ","px)","deg)"),le=ue((function(t){return null==t?ie:(re||(re=document.createElementNS("http://www.w3.org/2000/svg","g")),re.setAttribute("transform",t),(t=re.transform.baseVal.consolidate())?oe((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):ie)}),", ",")",")");function ce(t,e){var n,r;return function(){var a=Wt(this,t),i=a.tween;if(i!==n)for(var o=0,u=(r=n=i).length;o<u;++o)if(r[o].name===e){(r=r.slice()).splice(o,1);break}a.tween=r}}function he(t,e,n){var r,a;if("function"!=typeof n)throw new Error;return function(){var i=Wt(this,t),o=i.tween;if(o!==r){a=(r=o).slice();for(var u={name:e,value:n},s=0,l=a.length;s<l;++s)if(a[s].name===e){a[s]=u;break}s===l&&a.push(u)}i.tween=a}}function fe(t,e,n){var r=t._id;return t.each((function(){var t=Wt(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return Kt(t,r).value[e]}}function pe(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function de(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function ve(){}var ge=.7,me=1/ge,ye="\\s*([+-]?\\d+)\\s*",_e="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",we="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",be=/^#([0-9a-f]{3,8})$/,xe=new RegExp("^rgb\\("+[ye,ye,ye]+"\\)$"),Me=new RegExp("^rgb\\("+[we,we,we]+"\\)$"),Ae=new RegExp("^rgba\\("+[ye,ye,ye,_e]+"\\)$"),ke=new RegExp("^rgba\\("+[we,we,we,_e]+"\\)$"),Ce=new RegExp("^hsl\\("+[_e,we,we]+"\\)$"),Ee=new RegExp("^hsla\\("+[_e,we,we,_e]+"\\)$"),Ne={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 Oe(){return this.rgb().formatHex()}function $e(){return this.rgb().formatRgb()}function Re(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=be.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Le(e):3===n?new Te(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Se(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Se(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=xe.exec(t))?new Te(e[1],e[2],e[3],1):(e=Me.exec(t))?new Te(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Ae.exec(t))?Se(e[1],e[2],e[3],e[4]):(e=ke.exec(t))?Se(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Ce.exec(t))?Fe(e[1],e[2]/100,e[3]/100,1):(e=Ee.exec(t))?Fe(e[1],e[2]/100,e[3]/100,e[4]):Ne.hasOwnProperty(t)?Le(Ne[t]):"transparent"===t?new Te(NaN,NaN,NaN,0):null}function Le(t){return new Te(t>>16&255,t>>8&255,255&t,1)}function Se(t,e,n,r){return r<=0&&(t=e=n=NaN),new Te(t,e,n,r)}function Pe(t,e,n,r){return 1===arguments.length?((a=t)instanceof ve||(a=Re(a)),a?new Te((a=a.rgb()).r,a.g,a.b,a.opacity):new Te):new Te(t,e,n,null==r?1:r);var a}function Te(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function qe(){return"#"+De(this.r)+De(this.g)+De(this.b)}function Ue(){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 De(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Fe(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new je(t,e,n,r)}function He(t){if(t instanceof je)return new je(t.h,t.s,t.l,t.opacity);if(t instanceof ve||(t=Re(t)),!t)return new je;if(t instanceof je)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,a=Math.min(e,n,r),i=Math.max(e,n,r),o=NaN,u=i-a,s=(i+a)/2;return u?(o=e===i?(n-r)/u+6*(n<r):n===i?(r-e)/u+2:(e-n)/u+4,u/=s<.5?i+a:2-i-a,o*=60):u=s>0&&s<1?0:o,new je(o,u,s,t.opacity)}function je(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Be(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 Xe(t,e,n,r,a){var i=t*t,o=i*t;return((1-3*t+3*i-o)*e+(4-6*i+3*o)*n+(1+3*t+3*i-3*o)*r+o*a)/6}function Ie(t){return function(){return t}}function ze(t,e){return function(n){return t+n*e}}function Ye(t){return 1==(t=+t)?Ge: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):Ie(isNaN(e)?n:e)}}function Ge(t,e){var n=e-t;return n?ze(t,n):Ie(isNaN(t)?e:t)}pe(ve,Re,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Oe,formatHex:Oe,formatHsl:function(){return He(this).formatHsl()},formatRgb:$e,toString:$e}),pe(Te,Pe,de(ve,{brighter:function(t){return t=null==t?me:Math.pow(me,t),new Te(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?ge:Math.pow(ge,t),new Te(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:qe,formatHex:qe,formatRgb:Ue,toString:Ue})),pe(je,(function(t,e,n,r){return 1===arguments.length?He(t):new je(t,e,n,null==r?1:r)}),de(ve,{brighter:function(t){return t=null==t?me:Math.pow(me,t),new je(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?ge:Math.pow(ge,t),new je(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,a=2*n-r;return new Te(Be(t>=240?t-240:t+120,a,r),Be(t,a,r),Be(t<120?t+240:t-120,a,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+")")}}));const Ve=function t(e){var n=Ye(e);function r(t,e){var r=n((t=Pe(t)).r,(e=Pe(e)).r),a=n(t.g,e.g),i=n(t.b,e.b),o=Ge(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=a(e),t.b=i(e),t.opacity=o(e),t+""}}return r.gamma=t,r}(1);function Je(t){return function(e){var n,r,a=e.length,i=new Array(a),o=new Array(a),u=new Array(a);for(n=0;n<a;++n)r=Pe(e[n]),i[n]=r.r||0,o[n]=r.g||0,u[n]=r.b||0;return i=t(i),o=t(o),u=t(u),r.opacity=1,function(t){return r.r=i(t),r.g=o(t),r.b=u(t),r+""}}}Je((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),a=t[r],i=t[r+1],o=r>0?t[r-1]:2*a-i,u=r<e-1?t[r+2]:2*i-a;return Xe((n-r/e)*e,o,a,i,u)}})),Je((function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),a=t[(r+e-1)%e],i=t[r%e],o=t[(r+1)%e],u=t[(r+2)%e];return Xe((n-r/e)*e,a,i,o,u)}}));var Ze=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,We=new RegExp(Ze.source,"g");function Ke(t,e){var n,r,a,i=Ze.lastIndex=We.lastIndex=0,o=-1,u=[],s=[];for(t+="",e+="";(n=Ze.exec(t))&&(r=We.exec(e));)(a=r.index)>i&&(a=e.slice(i,a),u[o]?u[o]+=a:u[++o]=a),(n=n[0])===(r=r[0])?u[o]?u[o]+=r:u[++o]=r:(u[++o]=null,s.push({i:o,x:Qt(n,r)})),i=We.lastIndex;return i<e.length&&(a=e.slice(i),u[o]?u[o]+=a:u[++o]=a),u.length<2?s[0]?function(t){return function(e){return t(e)+""}}(s[0].x):function(t){return function(){return t}}(e):(e=s.length,function(t){for(var n,r=0;r<e;++r)u[(n=s[r]).i]=n.x(t);return u.join("")})}function Qe(t,e){var n;return("number"==typeof e?Qt:e instanceof Re?Ve:(n=Re(e))?(e=n,Ve):Ke)(t,e)}function tn(t){return function(){this.removeAttribute(t)}}function en(t){return function(){this.removeAttributeNS(t.space,t.local)}}function nn(t,e,n){var r,a,i=n+"";return function(){var o=this.getAttribute(t);return o===i?null:o===r?a:a=e(r=o,n)}}function rn(t,e,n){var r,a,i=n+"";return function(){var o=this.getAttributeNS(t.space,t.local);return o===i?null:o===r?a:a=e(r=o,n)}}function an(t,e,n){var r,a,i;return function(){var o,u,s=n(this);if(null!=s)return(o=this.getAttribute(t))===(u=s+"")?null:o===r&&u===a?i:(a=u,i=e(r=o,s));this.removeAttribute(t)}}function on(t,e,n){var r,a,i;return function(){var o,u,s=n(this);if(null!=s)return(o=this.getAttributeNS(t.space,t.local))===(u=s+"")?null:o===r&&u===a?i:(a=u,i=e(r=o,s));this.removeAttributeNS(t.space,t.local)}}function un(t,e){var n,r;function a(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&function(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}(t,a)),n}return a._value=e,a}function sn(t,e){var n,r;function a(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&function(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}(t,a)),n}return a._value=e,a}function ln(t,e){return function(){Zt(this,t).delay=+e.apply(this,arguments)}}function cn(t,e){return e=+e,function(){Zt(this,t).delay=e}}function hn(t,e){return function(){Wt(this,t).duration=+e.apply(this,arguments)}}function fn(t,e){return e=+e,function(){Wt(this,t).duration=e}}var pn=dt.prototype.constructor;function dn(t){return function(){this.style.removeProperty(t)}}var vn=0;function gn(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function mn(){return++vn}var yn=dt.prototype;gn.prototype=function(t){return dt().transition(t)}.prototype={constructor:gn,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=o(t));for(var r=this._groups,a=r.length,i=new Array(a),u=0;u<a;++u)for(var s,l,c=r[u],h=c.length,f=i[u]=new Array(h),p=0;p<h;++p)(s=c[p])&&(l=t.call(s,s.__data__,p,c))&&("__data__"in s&&(l.__data__=s.__data__),f[p]=l,Jt(f[p],e,n,p,f,Kt(s,n)));return new gn(i,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=s(t));for(var r=this._groups,a=r.length,i=[],o=[],u=0;u<a;++u)for(var l,c=r[u],h=c.length,f=0;f<h;++f)if(l=c[f]){for(var p,d=t.call(l,l.__data__,f,c),v=Kt(l,n),g=0,m=d.length;g<m;++g)(p=d[g])&&Jt(p,e,n,g,d,v);i.push(d),o.push(l)}return new gn(i,o,e,n)},filter:function(t){"function"!=typeof t&&(t=l(t));for(var e=this._groups,n=e.length,r=new Array(n),a=0;a<n;++a)for(var i,o=e[a],u=o.length,s=r[a]=[],c=0;c<u;++c)(i=o[c])&&t.call(i,i.__data__,c,o)&&s.push(i);return new gn(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,a=n.length,i=Math.min(r,a),o=new Array(r),u=0;u<i;++u)for(var s,l=e[u],c=n[u],h=l.length,f=o[u]=new Array(h),p=0;p<h;++p)(s=l[p]||c[p])&&(f[p]=s);for(;u<r;++u)o[u]=e[u];return new gn(o,this._parents,this._name,this._id)},selection:function(){return new pn(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=mn(),r=this._groups,a=r.length,i=0;i<a;++i)for(var o,u=r[i],s=u.length,l=0;l<s;++l)if(o=u[l]){var c=Kt(o,e);Jt(o,t,n,l,u,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new gn(r,this._parents,t,n)},call:yn.call,nodes:yn.nodes,node:yn.node,size:yn.size,empty:yn.empty,each:yn.each,on:function(t,e){var n=this._id;return arguments.length<2?Kt(this.node(),n).on.on(t):this.each(function(t,e,n){var r,a,i=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)?Zt:Wt;return function(){var o=i(this,t),u=o.on;u!==r&&(a=(r=u).copy()).on(e,n),o.on=a}}(n,t,e))},attr:function(t,e){var n=y(t),r="transform"===n?le:Qe;return this.attrTween(t,"function"==typeof e?(n.local?on:an)(n,r,fe(this,"attr."+t,e)):null==e?(n.local?en:tn)(n):(n.local?rn:nn)(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=y(t);return this.tween(n,(r.local?un:sn)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?se:Qe;return null==e?this.styleTween(t,function(t,e){var n,r,a;return function(){var i=O(this,t),o=(this.style.removeProperty(t),O(this,t));return i===o?null:i===n&&o===r?a:a=e(n=i,r=o)}}(t,r)).on("end.style."+t,dn(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,a,i;return function(){var o=O(this,t),u=n(this),s=u+"";return null==u&&(this.style.removeProperty(t),s=u=O(this,t)),o===s?null:o===r&&s===a?i:(a=s,i=e(r=o,u))}}(t,r,fe(this,"style."+t,e))).each(function(t,e){var n,r,a,i,o="style."+e,u="end."+o;return function(){var s=Wt(this,t),l=s.on,c=null==s.value[o]?i||(i=dn(e)):void 0;l===n&&a===c||(r=(n=l).copy()).on(u,a=c),s.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,a,i=n+"";return function(){var o=O(this,t);return o===i?null:o===r?a:a=e(r=o,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,function(t,e,n){var r,a;function i(){var i=e.apply(this,arguments);return i!==a&&(r=(a=i)&&function(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}(t,i,n)),r}return i._value=e,i}(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}}(fe(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&function(t){return function(e){this.textContent=t.call(this,e)}}(r)),e}return r._value=t,r}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,a=Kt(this.node(),n).tween,i=0,o=a.length;i<o;++i)if((r=a[i]).name===t)return r.value;return null}return this.each((null==e?ce:he)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?ln:cn)(e,t)):Kt(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?hn:fn)(e,t)):Kt(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw new Error;return function(){Wt(this,t).ease=e}}(e,t)):Kt(this.node(),e).ease},end:function(){var t,e,n=this,r=n._id,a=n.size();return new Promise((function(i,o){var u={value:o},s={value:function(){0==--a&&i()}};n.each((function(){var n=Wt(this,r),a=n.on;a!==t&&((e=(t=a).copy())._.cancel.push(u),e._.interrupt.push(u),e._.end.push(s)),n.on=e}))}))}};var _n={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function wn(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))return _n.time=Lt(),_n;return n}dt.prototype.interrupt=function(t){return this.each((function(){!function(t,e){var n,r,a,i=t.__transition,o=!0;if(i){for(a in e=null==e?null:e+"",i)(n=i[a]).name===e?(r=n.state>It&&n.state<Gt,n.state=Vt,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete i[a]):o=!1;o&&delete t.__transition}}(this,t)}))},dt.prototype.transition=function(t){var e,n;t instanceof gn?(e=t._id,t=t._name):(e=mn(),(n=_n).time=Lt(),t=null==t?null:t+"");for(var r=this._groups,a=r.length,i=0;i<a;++i)for(var o,u=r[i],s=u.length,l=0;l<s;++l)(o=u[l])&&Jt(o,t,e,l,u,n||wn(o,e));return new gn(r,this._parents,t,e)};function bn(t){return[+t[0],+t[1]]}function xn(t){return[bn(t[0]),bn(t[1])]}["w","e"].map(Mn),["n","s"].map(Mn),["n","w","e","s","nw","ne","sw","se"].map(Mn);function Mn(t){return{type:t}}Math.cos,Math.sin,Math.PI,Math.max;Array.prototype.slice;var An="$";function kn(){}function Cn(t,e){var n=new kn;if(t instanceof kn)t.each((function(t,e){n.set(e,t)}));else if(Array.isArray(t)){var r,a=-1,i=t.length;if(null==e)for(;++a<i;)n.set(a,t[a]);else for(;++a<i;)n.set(e(r=t[a],a,t),r)}else if(t)for(var o in t)n.set(o,t[o]);return n}kn.prototype=Cn.prototype={constructor:kn,has:function(t){return An+t in this},get:function(t){return this[An+t]},set:function(t,e){return this[An+t]=e,this},remove:function(t){var e=An+t;return e in this&&delete this[e]},clear:function(){for(var t in this)t[0]===An&&delete this[t]},keys:function(){var t=[];for(var e in this)e[0]===An&&t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)e[0]===An&&t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)e[0]===An&&t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)e[0]===An&&++t;return t},empty:function(){for(var t in this)if(t[0]===An)return!1;return!0},each:function(t){for(var e in this)e[0]===An&&t(this[e],e.slice(1),this)}};const En=Cn;function Nn(){}var On=En.prototype;function $n(t,e){var n=new Nn;if(t instanceof Nn)t.each((function(t){n.add(t)}));else if(t){var r=-1,a=t.length;if(null==e)for(;++r<a;)n.add(t[r]);else for(;++r<a;)n.add(e(t[r],r,t))}return n}Nn.prototype=$n.prototype={constructor:Nn,has:On.has,add:function(t){return this[An+(t+="")]=t,this},remove:On.remove,clear:On.clear,values:On.keys,size:On.size,empty:On.empty,each:On.each};Array.prototype.slice;var Rn={},Ln={};function Sn(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function Pn(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var r in t)r in e||n.push(e[r]=r)})),n}function Tn(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function qn(t){var e,n=t.getUTCHours(),r=t.getUTCMinutes(),a=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((e=t.getUTCFullYear())<0?"-"+Tn(-e,6):e>9999?"+"+Tn(e,6):Tn(e,4))+"-"+Tn(t.getUTCMonth()+1,2)+"-"+Tn(t.getUTCDate(),2)+(i?"T"+Tn(n,2)+":"+Tn(r,2)+":"+Tn(a,2)+"."+Tn(i,3)+"Z":a?"T"+Tn(n,2)+":"+Tn(r,2)+":"+Tn(a,2)+"Z":r||n?"T"+Tn(n,2)+":"+Tn(r,2)+"Z":"")}function Un(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,a=[],i=t.length,o=0,u=0,s=i<=0,l=!1;function c(){if(s)return Ln;if(l)return l=!1,Rn;var e,r,a=o;if(34===t.charCodeAt(a)){for(;o++<i&&34!==t.charCodeAt(o)||34===t.charCodeAt(++o););return(e=o)>=i?s=!0:10===(r=t.charCodeAt(o++))?l=!0:13===r&&(l=!0,10===t.charCodeAt(o)&&++o),t.slice(a+1,e-1).replace(/""/g,'"')}for(;o<i;){if(10===(r=t.charCodeAt(e=o++)))l=!0;else if(13===r)l=!0,10===t.charCodeAt(o)&&++o;else if(r!==n)continue;return t.slice(a,e)}return s=!0,t.slice(a,i)}for(10===t.charCodeAt(i-1)&&--i,13===t.charCodeAt(i-1)&&--i;(r=c())!==Ln;){for(var h=[];r!==Rn&&r!==Ln;)h.push(r),r=c();e&&null==(h=e(h,u++))||a.push(h)}return a}function a(e,n){return e.map((function(e){return n.map((function(t){return o(e[t])})).join(t)}))}function i(e){return e.map(o).join(t)}function o(t){return null==t?"":t instanceof Date?qn(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,a,i=r(t,(function(t,r){if(n)return n(t,r-1);a=t,n=e?function(t,e){var n=Sn(t);return function(r,a){return e(n(r),a,t)}}(t,e):Sn(t)}));return i.columns=a||[],i},parseRows:r,format:function(e,n){return null==n&&(n=Pn(e)),[n.map(o).join(t)].concat(a(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=Pn(t)),a(t,e).join("\n")},formatRows:function(t){return t.map(i).join("\n")},formatRow:i,formatValue:o}}var Dn=Un(","),Fn=Dn.parse,Hn=(Dn.parseRows,Dn.format,Dn.formatBody,Dn.formatRows,Dn.formatRow,Dn.formatValue,Un("\t")),jn=Hn.parse;Hn.parseRows,Hn.format,Hn.formatBody,Hn.formatRows,Hn.formatRow,Hn.formatValue;function Bn(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function Xn(t,e){return fetch(t,e).then(Bn)}function In(t){return function(e,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=void 0),Xn(e,n).then((function(e){return t(e,r)}))}}In(Fn),In(jn);function zn(t){return function(e,n){return Xn(e,n).then((function(e){return(new DOMParser).parseFromString(e,t)}))}}zn("application/xml");zn("text/html"),zn("image/svg+xml");Math.PI,Math.sqrt(5);function Yn(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function Gn(t,e){var n,r,a,i,o,u=new Wn(t),s=+t.value&&(u.value=t.value),l=[u];for(null==e&&(e=Vn);n=l.pop();)if(s&&(n.value=+n.data.value),(a=e(n.data))&&(o=a.length))for(n.children=new Array(o),i=o-1;i>=0;--i)l.push(r=n.children[i]=new Wn(a[i])),r.parent=n,r.depth=n.depth+1;return u.eachBefore(Zn)}function Vn(t){return t.children}function Jn(t){t.data=t.data.data}function Zn(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function Wn(t){this.data=t,this.depth=this.height=0,this.parent=null}function Kn(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Qn(){var t=1,e=1,n=0,r=!1;function a(a){var i=a.height+1;return a.x0=a.y0=n,a.x1=t,a.y1=e/i,a.eachBefore(function(t,e){return function(r){r.children&&function(t,e,n,r,a){for(var i,o=t.children,u=-1,s=o.length,l=t.value&&(r-e)/t.value;++u<s;)(i=o[u]).y0=n,i.y1=a,i.x0=e,i.x1=e+=i.value*l}(r,r.x0,t*(r.depth+1)/e,r.x1,t*(r.depth+2)/e);var a=r.x0,i=r.y0,o=r.x1-n,u=r.y1-n;o<a&&(a=o=(a+o)/2),u<i&&(i=u=(i+u)/2),r.x0=a,r.y0=i,r.x1=o,r.y1=u}}(e,i)),r&&a.eachBefore(Kn),a}return a.round=function(t){return arguments.length?(r=!!t,a):r},a.size=function(n){return arguments.length?(t=+n[0],e=+n[1],a):[t,e]},a.padding=function(t){return arguments.length?(n=+t,a):n},a}function tr(){return Math.random()}Wn.prototype=Gn.prototype={constructor:Wn,count:function(){return this.eachAfter(Yn)},each:function(t){var e,n,r,a,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(t(i),n=i.children)for(r=0,a=n.length;r<a;++r)o.push(n[r])}while(o.length);return this},eachAfter:function(t){for(var e,n,r,a=this,i=[a],o=[];a=i.pop();)if(o.push(a),e=a.children)for(n=0,r=e.length;n<r;++n)i.push(e[n]);for(;a=o.pop();)t(a);return this},eachBefore:function(t){for(var e,n,r=this,a=[r];r=a.pop();)if(t(r),e=r.children)for(n=e.length-1;n>=0;--n)a.push(e[n]);return this},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,a=r&&r.length;--a>=0;)n+=r[a].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),a=null;t=n.pop(),e=r.pop();for(;t===e;)a=t,t=n.pop(),e=r.pop();return a}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var a=r.length;t!==n;)r.splice(a,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each((function(e){t.push(e)})),t},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return Gn(this).eachBefore(Jn)}};(function t(e){function n(t,n){return t=null==t?0:+t,n=null==n?1:+n,1===arguments.length?(n=t,t=0):n-=t,function(){return e()*n+t}}return n.source=t,n})(tr);const er=function t(e){function n(t,n){var r,a;return t=null==t?0:+t,n=null==n?1:+n,function(){var i;if(null!=r)i=r,r=null;else do{r=2*e()-1,i=2*e()-1,a=r*r+i*i}while(!a||a>1);return t+n*i*Math.sqrt(-2*Math.log(a)/a)}}return n.source=t,n}(tr),nr=(function t(e){function n(){var t=er.source(e).apply(this,arguments);return function(){return Math.exp(t())}}return n.source=t,n}(tr),function t(e){function n(t){return function(){for(var n=0,r=0;r<t;++r)n+=e();return n}}return n.source=t,n}(tr));(function t(e){function n(t){var n=nr.source(e)(t);return function(){return n()/t}}return n.source=t,n})(tr),function t(e){function n(t){return function(){return-Math.log(1-e())/t}}return n.source=t,n}(tr);var rr=Array.prototype,ar=(rr.map,rr.slice);function ir(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}var or={name:"implicit"};function ur(){var t=En(),e=[],n=[],r=or;function a(a){var i=a+"",o=t.get(i);if(!o){if(r!==or)return r;t.set(i,o=e.push(a))}return n[(o-1)%n.length]}return a.domain=function(n){if(!arguments.length)return e.slice();e=[],t=En();for(var r,i,o=-1,u=n.length;++o<u;)t.has(i=(r=n[o])+"")||t.set(i,e.push(r));return a},a.range=function(t){return arguments.length?(n=ar.call(t),a):n.slice()},a.unknown=function(t){return arguments.length?(r=t,a):r},a.copy=function(){return ur(e,n).unknown(r)},ir.apply(a,arguments),a}function sr(t){return"string"==typeof t?new ft([[document.querySelector(t)]],[document.documentElement]):new ft([[t]],ht)}var lr=Math.PI,cr=2*lr,hr=1e-6,fr=cr-hr;function pr(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function dr(){return new pr}pr.prototype=dr.prototype={constructor:pr,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,r){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(t,e,n,r,a,i){this._+="C"+ +t+","+ +e+","+ +n+","+ +r+","+(this._x1=+a)+","+(this._y1=+i)},arcTo:function(t,e,n,r,a){t=+t,e=+e,n=+n,r=+r,a=+a;var i=this._x1,o=this._y1,u=n-t,s=r-e,l=i-t,c=o-e,h=l*l+c*c;if(a<0)throw new Error("negative radius: "+a);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(h>hr)if(Math.abs(c*u-s*l)>hr&&a){var f=n-i,p=r-o,d=u*u+s*s,v=f*f+p*p,g=Math.sqrt(d),m=Math.sqrt(h),y=a*Math.tan((lr-Math.acos((d+h-v)/(2*g*m)))/2),_=y/m,w=y/g;Math.abs(_-1)>hr&&(this._+="L"+(t+_*l)+","+(e+_*c)),this._+="A"+a+","+a+",0,0,"+ +(c*f>l*p)+","+(this._x1=t+w*u)+","+(this._y1=e+w*s)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,r,a,i){t=+t,e=+e,i=!!i;var o=(n=+n)*Math.cos(r),u=n*Math.sin(r),s=t+o,l=e+u,c=1^i,h=i?r-a:a-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+s+","+l:(Math.abs(this._x1-s)>hr||Math.abs(this._y1-l)>hr)&&(this._+="L"+s+","+l),n&&(h<0&&(h=h%cr+cr),h>fr?this._+="A"+n+","+n+",0,1,"+c+","+(t-o)+","+(e-u)+"A"+n+","+n+",0,1,"+c+","+(this._x1=s)+","+(this._y1=l):h>hr&&(this._+="A"+n+","+n+",0,"+ +(h>=lr)+","+c+","+(this._x1=t+n*Math.cos(a))+","+(this._y1=e+n*Math.sin(a))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};const vr=dr;function gr(t){return function(){return t}}var mr=Math.abs,yr=Math.atan2,_r=Math.cos,wr=Math.max,br=Math.min,xr=Math.sin,Mr=Math.sqrt,Ar=1e-12,kr=Math.PI,Cr=kr/2,Er=2*kr;function Nr(t){return t>=1?Cr:t<=-1?-Cr:Math.asin(t)}function Or(t){return t.innerRadius}function $r(t){return t.outerRadius}function Rr(t){return t.startAngle}function Lr(t){return t.endAngle}function Sr(t){return t&&t.padAngle}function Pr(t,e,n,r,a,i,o){var u=t-n,s=e-r,l=(o?i:-i)/Mr(u*u+s*s),c=l*s,h=-l*u,f=t+c,p=e+h,d=n+c,v=r+h,g=(f+d)/2,m=(p+v)/2,y=d-f,_=v-p,w=y*y+_*_,b=a-i,x=f*v-d*p,M=(_<0?-1:1)*Mr(wr(0,b*b*w-x*x)),A=(x*_-y*M)/w,k=(-x*y-_*M)/w,C=(x*_+y*M)/w,E=(-x*y+_*M)/w,N=A-g,O=k-m,$=C-g,R=E-m;return N*N+O*O>$*$+R*R&&(A=C,k=E),{cx:A,cy:k,x01:-c,y01:-h,x11:A*(a/b-1),y11:k*(a/b-1)}}function Tr(){var t=Or,e=$r,n=gr(0),r=null,a=Rr,i=Lr,o=Sr,u=null;function s(){var s,l,c=+t.apply(this,arguments),h=+e.apply(this,arguments),f=a.apply(this,arguments)-Cr,p=i.apply(this,arguments)-Cr,d=mr(p-f),v=p>f;if(u||(u=s=vr()),h<c&&(l=h,h=c,c=l),h>Ar)if(d>Er-Ar)u.moveTo(h*_r(f),h*xr(f)),u.arc(0,0,h,f,p,!v),c>Ar&&(u.moveTo(c*_r(p),c*xr(p)),u.arc(0,0,c,p,f,v));else{var g,m,y=f,_=p,w=f,b=p,x=d,M=d,A=o.apply(this,arguments)/2,k=A>Ar&&(r?+r.apply(this,arguments):Mr(c*c+h*h)),C=br(mr(h-c)/2,+n.apply(this,arguments)),E=C,N=C;if(k>Ar){var O=Nr(k/c*xr(A)),$=Nr(k/h*xr(A));(x-=2*O)>Ar?(w+=O*=v?1:-1,b-=O):(x=0,w=b=(f+p)/2),(M-=2*$)>Ar?(y+=$*=v?1:-1,_-=$):(M=0,y=_=(f+p)/2)}var R=h*_r(y),L=h*xr(y),S=c*_r(b),P=c*xr(b);if(C>Ar){var T,q=h*_r(_),U=h*xr(_),D=c*_r(w),F=c*xr(w);if(d<kr&&(T=function(t,e,n,r,a,i,o,u){var s=n-t,l=r-e,c=o-a,h=u-i,f=h*s-c*l;if(!(f*f<Ar))return[t+(f=(c*(e-i)-h*(t-a))/f)*s,e+f*l]}(R,L,D,F,q,U,S,P))){var H=R-T[0],j=L-T[1],B=q-T[0],X=U-T[1],I=1/xr(function(t){return t>1?0:t<-1?kr:Math.acos(t)}((H*B+j*X)/(Mr(H*H+j*j)*Mr(B*B+X*X)))/2),z=Mr(T[0]*T[0]+T[1]*T[1]);E=br(C,(c-z)/(I-1)),N=br(C,(h-z)/(I+1))}}M>Ar?N>Ar?(g=Pr(D,F,R,L,h,N,v),m=Pr(q,U,S,P,h,N,v),u.moveTo(g.cx+g.x01,g.cy+g.y01),N<C?u.arc(g.cx,g.cy,N,yr(g.y01,g.x01),yr(m.y01,m.x01),!v):(u.arc(g.cx,g.cy,N,yr(g.y01,g.x01),yr(g.y11,g.x11),!v),u.arc(0,0,h,yr(g.cy+g.y11,g.cx+g.x11),yr(m.cy+m.y11,m.cx+m.x11),!v),u.arc(m.cx,m.cy,N,yr(m.y11,m.x11),yr(m.y01,m.x01),!v))):(u.moveTo(R,L),u.arc(0,0,h,y,_,!v)):u.moveTo(R,L),c>Ar&&x>Ar?E>Ar?(g=Pr(S,P,q,U,c,-E,v),m=Pr(R,L,D,F,c,-E,v),u.lineTo(g.cx+g.x01,g.cy+g.y01),E<C?u.arc(g.cx,g.cy,E,yr(g.y01,g.x01),yr(m.y01,m.x01),!v):(u.arc(g.cx,g.cy,E,yr(g.y01,g.x01),yr(g.y11,g.x11),!v),u.arc(0,0,c,yr(g.cy+g.y11,g.cx+g.x11),yr(m.cy+m.y11,m.cx+m.x11),v),u.arc(m.cx,m.cy,E,yr(m.y11,m.x11),yr(m.y01,m.x01),!v))):u.arc(0,0,c,b,w,v):u.lineTo(S,P)}else u.moveTo(0,0);if(u.closePath(),s)return u=null,s+""||null}return s.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+a.apply(this,arguments)+ +i.apply(this,arguments))/2-kr/2;return[_r(r)*n,xr(r)*n]},s.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:gr(+e),s):t},s.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:gr(+t),s):e},s.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:gr(+t),s):n},s.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:gr(+t),s):r},s.startAngle=function(t){return arguments.length?(a="function"==typeof t?t:gr(+t),s):a},s.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:gr(+t),s):i},s.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:gr(+t),s):o},s.context=function(t){return arguments.length?(u=null==t?null:t,s):u},s}function qr(){this._=null}function Ur(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Dr(t,e){var n=e,r=e.R,a=n.U;a?a.L===n?a.L=r:a.R=r:t._=r,r.U=a,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function Fr(t,e){var n=e,r=e.L,a=n.U;a?a.L===n?a.L=r:a.R=r:t._=r,r.U=a,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function Hr(t){for(;t.L;)t=t.L;return t}qr.prototype={constructor:qr,insert:function(t,e){var n,r,a;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;n=t}else this._?(t=Hr(this._),e.P=null,e.N=t,t.P=t.L=e,n=t):(e.P=e.N=null,this._=e,n=null);for(e.L=e.R=null,e.U=n,e.C=!0,t=e;n&&n.C;)n===(r=n.U).L?(a=r.R)&&a.C?(n.C=a.C=!1,r.C=!0,t=r):(t===n.R&&(Dr(this,n),n=(t=n).U),n.C=!1,r.C=!0,Fr(this,r)):(a=r.L)&&a.C?(n.C=a.C=!1,r.C=!0,t=r):(t===n.L&&(Fr(this,n),n=(t=n).U),n.C=!1,r.C=!0,Dr(this,r)),n=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 e,n,r,a=t.U,i=t.L,o=t.R;if(n=i?o?Hr(o):i:o,a?a.L===t?a.L=n:a.R=n:this._=n,i&&o?(r=n.C,n.C=t.C,n.L=i,i.U=n,n!==o?(a=n.U,n.U=t.U,t=n.R,a.L=t,n.R=o,o.U=n):(n.U=a,a=n,t=n.R)):(r=t.C,t=n),t&&(t.U=a),!r)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===a.L){if((e=a.R).C&&(e.C=!1,a.C=!0,Dr(this,a),e=a.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,Fr(this,e),e=a.R),e.C=a.C,a.C=e.R.C=!1,Dr(this,a),t=this._;break}}else if((e=a.L).C&&(e.C=!1,a.C=!0,Fr(this,a),e=a.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,Dr(this,e),e=a.L),e.C=a.C,a.C=e.L.C=!1,Fr(this,a),t=this._;break}e.C=!0,t=a,a=a.U}while(!t.C);t&&(t.C=!1)}}};const jr=qr;function Br(t,e,n,r){var a=[null,null],i=fa.push(a)-1;return a.left=t,a.right=e,n&&Ir(a,t,e,n),r&&Ir(a,e,t,r),ca[t.index].halfedges.push(i),ca[e.index].halfedges.push(i),a}function Xr(t,e,n){var r=[e,n];return r.left=t,r}function Ir(t,e,n,r){t[0]||t[1]?t.left===n?t[1]=r:t[0]=r:(t[0]=r,t.left=e,t.right=n)}function zr(t,e,n,r,a){var i,o=t[0],u=t[1],s=o[0],l=o[1],c=0,h=1,f=u[0]-s,p=u[1]-l;if(i=e-s,f||!(i>0)){if(i/=f,f<0){if(i<c)return;i<h&&(h=i)}else if(f>0){if(i>h)return;i>c&&(c=i)}if(i=r-s,f||!(i<0)){if(i/=f,f<0){if(i>h)return;i>c&&(c=i)}else if(f>0){if(i<c)return;i<h&&(h=i)}if(i=n-l,p||!(i>0)){if(i/=p,p<0){if(i<c)return;i<h&&(h=i)}else if(p>0){if(i>h)return;i>c&&(c=i)}if(i=a-l,p||!(i<0)){if(i/=p,p<0){if(i>h)return;i>c&&(c=i)}else if(p>0){if(i<c)return;i<h&&(h=i)}return!(c>0||h<1)||(c>0&&(t[0]=[s+c*f,l+c*p]),h<1&&(t[1]=[s+h*f,l+h*p]),!0)}}}}}function Yr(t,e,n,r,a){var i=t[1];if(i)return!0;var o,u,s=t[0],l=t.left,c=t.right,h=l[0],f=l[1],p=c[0],d=c[1],v=(h+p)/2,g=(f+d)/2;if(d===f){if(v<e||v>=r)return;if(h>p){if(s){if(s[1]>=a)return}else s=[v,n];i=[v,a]}else{if(s){if(s[1]<n)return}else s=[v,a];i=[v,n]}}else if(u=g-(o=(h-p)/(d-f))*v,o<-1||o>1)if(h>p){if(s){if(s[1]>=a)return}else s=[(n-u)/o,n];i=[(a-u)/o,a]}else{if(s){if(s[1]<n)return}else s=[(a-u)/o,a];i=[(n-u)/o,n]}else if(f<d){if(s){if(s[0]>=r)return}else s=[e,o*e+u];i=[r,o*r+u]}else{if(s){if(s[0]<e)return}else s=[r,o*r+u];i=[e,o*e+u]}return t[0]=s,t[1]=i,!0}function Gr(t,e){var n=t.site,r=e.left,a=e.right;return n===a&&(a=r,r=n),a?Math.atan2(a[1]-r[1],a[0]-r[0]):(n===r?(r=e[1],a=e[0]):(r=e[0],a=e[1]),Math.atan2(r[0]-a[0],a[1]-r[1]))}function Vr(t,e){return e[+(e.left!==t.site)]}function Jr(t,e){return e[+(e.left===t.site)]}var Zr,Wr=[];function Kr(){Ur(this),this.x=this.y=this.arc=this.site=this.cy=null}function Qr(t){var e=t.P,n=t.N;if(e&&n){var r=e.site,a=t.site,i=n.site;if(r!==i){var o=a[0],u=a[1],s=r[0]-o,l=r[1]-u,c=i[0]-o,h=i[1]-u,f=2*(s*h-l*c);if(!(f>=-da)){var p=s*s+l*l,d=c*c+h*h,v=(h*p-l*d)/f,g=(s*d-c*p)/f,m=Wr.pop()||new Kr;m.arc=t,m.site=a,m.x=v+o,m.y=(m.cy=g+u)+Math.sqrt(v*v+g*g),t.circle=m;for(var y=null,_=ha._;_;)if(m.y<_.y||m.y===_.y&&m.x<=_.x){if(!_.L){y=_.P;break}_=_.L}else{if(!_.R){y=_;break}_=_.R}ha.insert(y,m),y||(Zr=m)}}}}function ta(t){var e=t.circle;e&&(e.P||(Zr=e.N),ha.remove(e),Wr.push(e),Ur(e),t.circle=null)}var ea=[];function na(){Ur(this),this.edge=this.site=this.circle=null}function ra(t){var e=ea.pop()||new na;return e.site=t,e}function aa(t){ta(t),la.remove(t),ea.push(t),Ur(t)}function ia(t){var e=t.circle,n=e.x,r=e.cy,a=[n,r],i=t.P,o=t.N,u=[t];aa(t);for(var s=i;s.circle&&Math.abs(n-s.circle.x)<pa&&Math.abs(r-s.circle.cy)<pa;)i=s.P,u.unshift(s),aa(s),s=i;u.unshift(s),ta(s);for(var l=o;l.circle&&Math.abs(n-l.circle.x)<pa&&Math.abs(r-l.circle.cy)<pa;)o=l.N,u.push(l),aa(l),l=o;u.push(l),ta(l);var c,h=u.length;for(c=1;c<h;++c)l=u[c],s=u[c-1],Ir(l.edge,s.site,l.site,a);s=u[0],(l=u[h-1]).edge=Br(s.site,l.site,null,a),Qr(s),Qr(l)}function oa(t){for(var e,n,r,a,i=t[0],o=t[1],u=la._;u;)if((r=ua(u,o)-i)>pa)u=u.L;else{if(!((a=i-sa(u,o))>pa)){r>-pa?(e=u.P,n=u):a>-pa?(e=u,n=u.N):e=n=u;break}if(!u.R){e=u;break}u=u.R}!function(t){ca[t.index]={site:t,halfedges:[]}}(t);var s=ra(t);if(la.insert(e,s),e||n){if(e===n)return ta(e),n=ra(e.site),la.insert(s,n),s.edge=n.edge=Br(e.site,s.site),Qr(e),void Qr(n);if(n){ta(e),ta(n);var l=e.site,c=l[0],h=l[1],f=t[0]-c,p=t[1]-h,d=n.site,v=d[0]-c,g=d[1]-h,m=2*(f*g-p*v),y=f*f+p*p,_=v*v+g*g,w=[(g*y-p*_)/m+c,(f*_-v*y)/m+h];Ir(n.edge,l,d,w),s.edge=Br(l,t,null,w),n.edge=Br(t,d,null,w),Qr(e),Qr(n)}else s.edge=Br(e.site,s.site)}}function ua(t,e){var n=t.site,r=n[0],a=n[1],i=a-e;if(!i)return r;var o=t.P;if(!o)return-1/0;var u=(n=o.site)[0],s=n[1],l=s-e;if(!l)return u;var c=u-r,h=1/i-1/l,f=c/l;return h?(-f+Math.sqrt(f*f-2*h*(c*c/(-2*l)-s+l/2+a-i/2)))/h+r:(r+u)/2}function sa(t,e){var n=t.N;if(n)return ua(n,e);var r=t.site;return r[1]===e?r[0]:1/0}var la,ca,ha,fa,pa=1e-6,da=1e-12;function va(t,e){return e[1]-t[1]||e[0]-t[0]}function ga(t,e){var n,r,a,i=t.sort(va).pop();for(fa=[],ca=new Array(t.length),la=new jr,ha=new jr;;)if(a=Zr,i&&(!a||i[1]<a.y||i[1]===a.y&&i[0]<a.x))i[0]===n&&i[1]===r||(oa(i),n=i[0],r=i[1]),i=t.pop();else{if(!a)break;ia(a.arc)}if(function(){for(var t,e,n,r,a=0,i=ca.length;a<i;++a)if((t=ca[a])&&(r=(e=t.halfedges).length)){var o=new Array(r),u=new Array(r);for(n=0;n<r;++n)o[n]=n,u[n]=Gr(t,fa[e[n]]);for(o.sort((function(t,e){return u[e]-u[t]})),n=0;n<r;++n)u[n]=e[o[n]];for(n=0;n<r;++n)e[n]=u[n]}}(),e){var o=+e[0][0],u=+e[0][1],s=+e[1][0],l=+e[1][1];!function(t,e,n,r){for(var a,i=fa.length;i--;)Yr(a=fa[i],t,e,n,r)&&zr(a,t,e,n,r)&&(Math.abs(a[0][0]-a[1][0])>pa||Math.abs(a[0][1]-a[1][1])>pa)||delete fa[i]}(o,u,s,l),function(t,e,n,r){var a,i,o,u,s,l,c,h,f,p,d,v,g=ca.length,m=!0;for(a=0;a<g;++a)if(i=ca[a]){for(o=i.site,u=(s=i.halfedges).length;u--;)fa[s[u]]||s.splice(u,1);for(u=0,l=s.length;u<l;)d=(p=Jr(i,fa[s[u]]))[0],v=p[1],h=(c=Vr(i,fa[s[++u%l]]))[0],f=c[1],(Math.abs(d-h)>pa||Math.abs(v-f)>pa)&&(s.splice(u,0,fa.push(Xr(o,p,Math.abs(d-t)<pa&&r-v>pa?[t,Math.abs(h-t)<pa?f:r]:Math.abs(v-r)<pa&&n-d>pa?[Math.abs(f-r)<pa?h:n,r]:Math.abs(d-n)<pa&&v-e>pa?[n,Math.abs(h-n)<pa?f:e]:Math.abs(v-e)<pa&&d-t>pa?[Math.abs(f-e)<pa?h:t,e]:null))-1),++l);l&&(m=!1)}if(m){var y,_,w,b=1/0;for(a=0,m=null;a<g;++a)(i=ca[a])&&(w=(y=(o=i.site)[0]-t)*y+(_=o[1]-e)*_)<b&&(b=w,m=i);if(m){var x=[t,e],M=[t,r],A=[n,r],k=[n,e];m.halfedges.push(fa.push(Xr(o=m.site,x,M))-1,fa.push(Xr(o,M,A))-1,fa.push(Xr(o,A,k))-1,fa.push(Xr(o,k,x))-1)}}for(a=0;a<g;++a)(i=ca[a])&&(i.halfedges.length||delete ca[a])}(o,u,s,l)}this.edges=fa,this.cells=ca,la=ha=fa=ca=null}function ma(t,e,n){this.k=t,this.x=e,this.y=n}ga.prototype={constructor:ga,polygons:function(){var t=this.edges;return this.cells.map((function(e){var n=e.halfedges.map((function(n){return Vr(e,t[n])}));return n.data=e.site.data,n}))},triangles:function(){var t=[],e=this.edges;return this.cells.forEach((function(n,r){if(i=(a=n.halfedges).length)for(var a,i,o,u,s,l,c=n.site,h=-1,f=e[a[i-1]],p=f.left===c?f.right:f.left;++h<i;)o=p,p=(f=e[a[h]]).left===c?f.right:f.left,o&&p&&r<o.index&&r<p.index&&(s=o,l=p,((u=c)[0]-l[0])*(s[1]-u[1])-(u[0]-s[0])*(l[1]-u[1])<0)&&t.push([c.data,o.data,p.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,e,n){for(var r,a,i=this,o=i._found||0,u=i.cells.length;!(a=i.cells[o]);)if(++o>=u)return null;var s=t-a.site[0],l=e-a.site[1],c=s*s+l*l;do{a=i.cells[r=o],o=null,a.halfedges.forEach((function(n){var r=i.edges[n],u=r.left;if(u!==a.site&&u||(u=r.right)){var s=t-u[0],l=e-u[1],h=s*s+l*l;h<c&&(c=h,o=u.index)}}))}while(null!==o);return i._found=r,null==n||c<=n*n?a.site:null}},ma.prototype={constructor:ma,scale:function(t){return 1===t?this:new ma(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new ma(this.k,this.x+this.k*t,this.y+this.k*e)},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+")"}};new ma(1,0,0);ma.prototype;var ya=n(776),_a="node",wa="root";function ba(t,e){void 0===e&&(e=0);var n=[];for(var r in t)if("__data"!==r){var a={name:r,depth:e,children:ba(t[r],e+1)};"__data"in t[r]&&(a.data=t[r].__data,a.links=t[r].__data.taxonomy.links),n.push(a)}return n}var xa=function(t){return Object.keys(t).reduce((function(e,n){if(t[n].links){var r=t[n].links;return e.concat(r)}return e}),[])},Ma={id:"sunburst",label:"Sunburst",options:{color_range:{type:"array",label:"Color Range",display:"colors",default:["#4285F4","#EA4335","#FBBC04","#34A852","#5F6368"]},color_by:{type:"string",label:"Color By",display:"select",values:[{"Color By Root":wa},{"Color By Node":_a}],default:wa},show_null_points:{type:"boolean",label:"Plot Null Values",default:!0},value_format_override:{type:"string",label:"Value Format Override",default:""},show_percent:{type:"boolean",label:"Percent on Hover",default:!0}},create:function(t,e){t.style.fontFamily='"Open Sans","Noto Sans JP","Noto Sans","Noto Sans CJK KR", "Helvetica" , "Arial" , "sans-serif"',sr(t).append("div").attr("id","sunburst-breadcrumbs"),this.svg=sr(t).append("svg").style("margin-top","-25px")},update:function(t,e,n,r){if(function(t,e,n){var r=function(e,n,r,a,i){return!(!t.addError||!t.clearErrors||(r<a?(t.addError({title:"Not Enough "+n+"s",message:"This visualization requires "+(a===i?"exactly":"at least")+" "+a+" "+n.toLowerCase()+(1===a?"":"s")+".",group:e}),1):r>i?(t.addError({title:"Too Many "+n+"s",message:"This visualization requires "+(a===i?"exactly":"no more than")+" "+i+" "+n.toLowerCase()+(1===a?"":"s")+".",group:e}),1):(t.clearErrors(e),0)))},a=e.fields,i=a.pivots,o=a.dimensions,u=a.measure_like;return r("pivot-req","Pivot",i.length,n.min_pivots,n.max_pivots)&&r("dim-req","Dimension",o.length,n.min_dimensions,n.max_dimensions)&&r("mes-req","Measure",u.length,n.min_measures,n.max_measures)}(this,r,{min_pivots:0,max_pivots:0,min_dimensions:1,max_dimensions:void 0,min_measures:1,max_measures:1})){sr("#trail").remove();var a=e.clientWidth,i=e.clientHeight,o=Math.min(a,i)/2-8,u=r.fields.dimension_like,s=r.fields.measure_like[0],l=s.value_format||"#,##0",c=function(t){return ya.format(""!==n.value_format_override?n.value_format_override:l,t)},h=ur().range(n.color_range||[]),f={w:75,h:30,s:4,t:10},p=function(t){return Math.max(10*t.length,f.w)},d=0;t.forEach((function(t){t.taxonomy={links:xa(t),value:u.map((function(e){return t[e.name].value}))},d+=t[s.name].value}));var v=Qn().size([2*Math.PI,o*o]),g=Tr().startAngle((function(t){return t.x0})).endAngle((function(t){return t.x1})).innerRadius((function(t){return Math.sqrt(t.y0)})).outerRadius((function(t){return Math.sqrt(t.y1)})),m=this.svg.html("").attr("width","100%").attr("height","100%").append("g").attr("transform","translate("+a/2+","+i/2+")"),y=m.append("text").style("text-anchor","middle").style("dominant-baseline","middle").attr("font-size",Math.min(parseInt(sr("svg").style("width")),parseInt(sr("svg").style("height")))/12),_=function(t){return 0===t.depth?"none":n.color_by===_a?h(t.data.name):h(t.ancestors().map((function(t){return t.data.name})).slice(-2,-1))},w=sr("#sunburst-breadcrumbs").append("svg:svg").attr("width",750).attr("height",50).attr("id","trail");w.append("svg:text").attr("id","endlabel").style("fill","#000");var b=function(t,e){var n=[],r=f,a=p(t.data.name);return n.push("0,0"),n.push(a+",0"),n.push(a+r.t+","+r.h/2),n.push(a+","+r.h),n.push("0,"+r.h),e>0&&n.push(r.t+","+r.h/2),n.join(" ")},x=function(t,e){var n=f,r=sr("#trail").selectAll("g").data(t,(function(t){return t.data.name+t.data.depth})),a=r.enter().append("svg:g");a.append("svg:polygon").attr("points",b).style("fill",_),a.append("svg:text").attr("x",(function(t){return(p(t.data.name)+n.t)/2})).attr("y",n.h/2).attr("dy","0.35em").attr("text-anchor","middle").text((function(t){return t.data.name})),r.exit().remove();var i,o,s=0;sr("#trail").selectAll("g").attr("transform",(function(t,e){return i=t,e>=u.length?"translate("+s+", 0)":"translate("+(s+="root"===t.parent.data.name?0:p(t.parent.data.name)+n.s)+", 0)"})),sr("#sunburst-breadcrumbs").select("#trail").select("#endlabel").attr("x",s+p(i.data.name)+n.s+50+"px").attr("y",n.h/2).attr("dy","0.35em").attr("text-anchor","middle").html(c(e)).style("font-weight","bold"),void 0===(o=s+p(i.data.name)+n.s+50+p(c(e)))&&(o=0),w.attr("width",Math.max(750,o)),sr("#sunburst-breadcrumbs").select("#trail").style("visibility","")},M=Gn(function(t,e){var n={};return t.forEach((function(t){var r=n;t.taxonomy.value.forEach((function(t){(null!==t||e.show_null_points)&&(r[t]=t in r?r[t]:{},r=r[t])})),r.__data=t})),{name:"root",children:ba(n,1),depth:0}}(t,n)).sum((function(t){return"data"in t?t.data[s.name].value:0}));v(M),m.selectAll("path").data(M.descendants()).enter().append("path").attr("d",g).style("fill",_).style("fill-opacity",(function(t){return 1-.15*t.depth})).style("transition",(function(t){return"fill-opacity 0.2s"})).style("stroke",(function(t){return"#fff"})).style("stroke-width",(function(t){return"0.5px"})).on("click",(function(t){var e={pageX:rt.pageX,pageY:rt.pageY};LookerCharts.Utils.openDrillMenu({links:t.data.links,event:e})})).on("mouseenter",(function(t){var e=function(t){for(var e=[],n=t;n.parent;)e.unshift(n),n=n.parent;return e}(t);x(e,t.value),n.show_percent&&y.text(" "+(t.value/d*100).toFixed(2).toString()+"%");var r=t.ancestors();m.selectAll("path").style("fill-opacity",(function(t){return r.indexOf(t)>-1?1:.15}))})).on("mouseleave",(function(t){sr("#sunburst-breadcrumbs").select("#trail").style("visibility","hidden"),y.text(""),m.selectAll("path").style("fill-opacity",(function(t){return 1-.15*t.depth}))}))}}};looker.plugins.visualizations.add(Ma)})(),{}})()));