UNPKG

327 kBJavaScriptView Raw
1/*!
2 * Copyright (c) 2017 ~ present NAVER Corp.
3 * billboard.js project is licensed under the MIT license
4 *
5 * billboard.js, JavaScript chart library
6 * http://naver.github.io/billboard.js/
7 *
8 * @version 1.9.5
9 *
10 * All-in-one packaged file for ease use of 'billboard.js' with below dependency.
11 * - d3 ^5.9.2
12 */
13!function webpackUniversalModuleDefinition(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var i in n)("object"==typeof exports?exports:t)[i]=n[i]}}(this,function(){return i={},__webpack_require__.m=n=[function(t,e){t.exports=function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){var i=n(2),a=n(3),r=n(4);t.exports=function _slicedToArray(t,e){return i(t)||a(t,e)||r()}},function(t,e){t.exports=function _arrayWithHoles(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function _iterableToArrayLimit(t,e){var n=[],i=!0,a=!1,r=void 0;try{for(var o,s=t[Symbol.iterator]();!(i=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);i=!0);}catch(t){a=!0,r=t}finally{try{i||null==s.return||s.return()}finally{if(a)throw r}}return n}},function(t,e){t.exports=function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(t,e){function _defineProperties(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}t.exports=function _createClass(t,e,n){return e&&_defineProperties(t.prototype,e),n&&_defineProperties(t,n),t}},function(t,e,n){var i=n(7),a=n(8),r=n(9);t.exports=function _toConsumableArray(t){return i(t)||a(t)||r()}},function(t,e){t.exports=function _arrayWithoutHoles(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}},function(t,e){t.exports=function _iterableToArray(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}},function(t,e){t.exports=function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(e,t){function _typeof2(t){return(_typeof2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof2(t){return typeof t}:function _typeof2(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _typeof(t){return"function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?e.exports=_typeof=function _typeof(t){return _typeof2(t)}:e.exports=_typeof=function _typeof(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":_typeof2(t)},_typeof(t)}e.exports=_typeof},function(t,i,a){"use strict";a.r(i),function(t){a.d(i,"window",function(){return e}),a.d(i,"document",function(){return n});var e=Ka(self)||Ka(window)||Ka(t)||Ka(globalThis)||Function("return this")(),n=e&&e.document;function Ka(t){return void 0!==t&&t}}.call(this,a(12))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";n.r(e);var i=n(0),a=n.n(i),r=n(1),k=n.n(r),o=n(5),s=n.n(o),c=new Date,u=new Date;function newInterval(r,o,n,i){function interval(t){return r(t=new Date(+t)),t}return(interval.floor=interval).ceil=function(t){return r(t=new Date(t-1)),o(t,1),r(t),t},interval.round=function(t){var e=interval(t),n=interval.ceil(t);return t-e<n-t?e:n},interval.offset=function(t,e){return o(t=new Date(+t),null==e?1:Math.floor(e)),t},interval.range=function(t,e,n){var i,a=[];if(t=interval.ceil(t),n=null==n?1:Math.floor(n),!(t<e&&0<n))return a;for(;a.push(i=new Date(+t)),o(t,n),r(t),i<t&&t<e;);return a},interval.filter=function(n){return newInterval(function(t){if(t<=t)for(;r(t),!n(t);)t.setTime(t-1)},function(t,e){if(t<=t)if(e<0)for(;++e<=0;)for(;o(t,-1),!n(t););else for(;0<=--e;)for(;o(t,1),!n(t););})},n&&(interval.count=function(t,e){return c.setTime(+t),u.setTime(+e),r(c),r(u),Math.floor(n(c,u))},interval.every=function(e){return e=Math.floor(e),isFinite(e)&&0<e?1<e?interval.filter(i?function(t){return i(t)%e==0}:function(t){return interval.count(0,t)%e==0}):interval:null}),interval}var l=newInterval(function(){},function(t,e){t.setTime(+t+e)},function(t,e){return e-t});l.every=function(n){return n=Math.floor(n),isFinite(n)&&0<n?1<n?newInterval(function(t){t.setTime(Math.floor(t/n)*n)},function(t,e){t.setTime(+t+e*n)},function(t,e){return(e-t)/n}):l:null};var h=l,d=(l.range,newInterval(function(t){t.setTime(t-t.getMilliseconds())},function(t,e){t.setTime(+t+1e3*e)},function(t,e){return(e-t)/1e3},function(t){return t.getUTCSeconds()})),f=d,g=(d.range,newInterval(function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())},function(t,e){t.setTime(+t+6e4*e)},function(t,e){return(e-t)/6e4},function(t){return t.getMinutes()})),p=g,_=(g.range,newInterval(function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())},function(t,e){t.setTime(+t+36e5*e)},function(t,e){return(e-t)/36e5},function(t){return t.getHours()})),m=_,v=(_.range,newInterval(function(t){t.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+e)},function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5},function(t){return t.getDate()-1})),T=v;v.range;function weekday(e){return newInterval(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+7*e)},function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5})}var y=weekday(0),w=weekday(1),b=weekday(2),A=weekday(3),C=weekday(4),S=weekday(5),M=weekday(6),L=(y.range,w.range,b.range,A.range,C.range,S.range,M.range,newInterval(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,e){t.setMonth(t.getMonth()+e)},function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())},function(t){return t.getMonth()})),D=L,F=(L.range,newInterval(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t,e){return e.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()}));F.every=function(n){return isFinite(n=Math.floor(n))&&0<n?newInterval(function(t){t.setFullYear(Math.floor(t.getFullYear()/n)*n),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,e){t.setFullYear(t.getFullYear()+e*n)}):null};var R=F,E=(F.range,newInterval(function(t){t.setUTCSeconds(0,0)},function(t,e){t.setTime(+t+6e4*e)},function(t,e){return(e-t)/6e4},function(t){return t.getUTCMinutes()})),z=(E.range,newInterval(function(t){t.setUTCMinutes(0,0,0)},function(t,e){t.setTime(+t+36e5*e)},function(t,e){return(e-t)/36e5},function(t){return t.getUTCHours()})),X=(z.range,newInterval(function(t){t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+e)},function(t,e){return(e-t)/864e5},function(t){return t.getUTCDate()-1})),I=X;X.range;function utcWeekday(e){return newInterval(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+7*e)},function(t,e){return(e-t)/6048e5})}var O=utcWeekday(0),P=utcWeekday(1),N=utcWeekday(2),Y=utcWeekday(3),B=utcWeekday(4),H=utcWeekday(5),V=utcWeekday(6),U=(O.range,P.range,N.range,Y.range,B.range,H.range,V.range,newInterval(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCMonth(t.getUTCMonth()+e)},function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()})),W=(U.range,newInterval(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)},function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()}));W.every=function(n){return isFinite(n=Math.floor(n))&&0<n?newInterval(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/n)*n),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e*n)}):null};var j=W;W.range;function localDate(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function utcDate(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function newYear(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}var G,q,$,Z,K,Q={"-":"",_:" ",0:"0"},J=/^\s*\d+/,tt=/^%/,et=/[\\^$*+?|[\]().{}]/g;function pad(t,e,n){var i=t<0?"-":"",a=(i?-t:t)+"",r=a.length;return i+(r<n?new Array(n-r+1).join(e)+a:a)}function requote(t){return t.replace(et,"\\$&")}function formatRe(t){return new RegExp("^(?:"+t.map(requote).join("|")+")","i")}function formatLookup(t){for(var e={},n=-1,i=t.length;++n<i;)e[t[n].toLowerCase()]=n;return e}function parseWeekdayNumberSunday(t,e,n){var i=J.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function parseWeekdayNumberMonday(t,e,n){var i=J.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function parseWeekNumberSunday(t,e,n){var i=J.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function parseWeekNumberISO(t,e,n){var i=J.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function parseWeekNumberMonday(t,e,n){var i=J.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function parseFullYear(t,e,n){var i=J.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function parseYear(t,e,n){var i=J.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(68<+i[0]?1900:2e3),n+i[0].length):-1}function parseZone(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function parseMonthNumber(t,e,n){var i=J.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function parseDayOfMonth(t,e,n){var i=J.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function parseDayOfYear(t,e,n){var i=J.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function parseHour24(t,e,n){var i=J.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function parseMinutes(t,e,n){var i=J.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function parseSeconds(t,e,n){var i=J.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function parseMilliseconds(t,e,n){var i=J.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function parseMicroseconds(t,e,n){var i=J.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function parseLiteralPercent(t,e,n){var i=tt.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function parseUnixTimestamp(t,e,n){var i=J.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function parseUnixTimestampSeconds(t,e,n){var i=J.exec(e.slice(n));return i?(t.Q=1e3*+i[0],n+i[0].length):-1}function formatDayOfMonth(t,e){return pad(t.getDate(),e,2)}function formatHour24(t,e){return pad(t.getHours(),e,2)}function formatHour12(t,e){return pad(t.getHours()%12||12,e,2)}function formatDayOfYear(t,e){return pad(1+T.count(R(t),t),e,3)}function formatMilliseconds(t,e){return pad(t.getMilliseconds(),e,3)}function formatMicroseconds(t,e){return formatMilliseconds(t,e)+"000"}function formatMonthNumber(t,e){return pad(t.getMonth()+1,e,2)}function formatMinutes(t,e){return pad(t.getMinutes(),e,2)}function formatSeconds(t,e){return pad(t.getSeconds(),e,2)}function formatWeekdayNumberMonday(t){var e=t.getDay();return 0===e?7:e}function formatWeekNumberSunday(t,e){return pad(y.count(R(t),t),e,2)}function formatWeekNumberISO(t,e){var n=t.getDay();return t=4<=n||0===n?C(t):C.ceil(t),pad(C.count(R(t),t)+(4===R(t).getDay()),e,2)}function formatWeekdayNumberSunday(t){return t.getDay()}function formatWeekNumberMonday(t,e){return pad(w.count(R(t),t),e,2)}function locale_formatYear(t,e){return pad(t.getFullYear()%100,e,2)}function formatFullYear(t,e){return pad(t.getFullYear()%1e4,e,4)}function formatZone(t){var e=t.getTimezoneOffset();return(0<e?"-":(e*=-1,"+"))+pad(e/60|0,"0",2)+pad(e%60,"0",2)}function formatUTCDayOfMonth(t,e){return pad(t.getUTCDate(),e,2)}function formatUTCHour24(t,e){return pad(t.getUTCHours(),e,2)}function formatUTCHour12(t,e){return pad(t.getUTCHours()%12||12,e,2)}function formatUTCDayOfYear(t,e){return pad(1+I.count(j(t),t),e,3)}function formatUTCMilliseconds(t,e){return pad(t.getUTCMilliseconds(),e,3)}function formatUTCMicroseconds(t,e){return formatUTCMilliseconds(t,e)+"000"}function formatUTCMonthNumber(t,e){return pad(t.getUTCMonth()+1,e,2)}function formatUTCMinutes(t,e){return pad(t.getUTCMinutes(),e,2)}function formatUTCSeconds(t,e){return pad(t.getUTCSeconds(),e,2)}function formatUTCWeekdayNumberMonday(t){var e=t.getUTCDay();return 0===e?7:e}function formatUTCWeekNumberSunday(t,e){return pad(O.count(j(t),t),e,2)}function formatUTCWeekNumberISO(t,e){var n=t.getUTCDay();return t=4<=n||0===n?B(t):B.ceil(t),pad(B.count(j(t),t)+(4===j(t).getUTCDay()),e,2)}function formatUTCWeekdayNumberSunday(t){return t.getUTCDay()}function formatUTCWeekNumberMonday(t,e){return pad(P.count(j(t),t),e,2)}function formatUTCYear(t,e){return pad(t.getUTCFullYear()%100,e,2)}function formatUTCFullYear(t,e){return pad(t.getUTCFullYear()%1e4,e,4)}function formatUTCZone(){return"+0000"}function formatLiteralPercent(){return"%"}function formatUnixTimestamp(t){return+t}function formatUnixTimestampSeconds(t){return Math.floor(+t/1e3)}!function defaultLocale(t){return G=function formatLocale(t){var i=t.dateTime,a=t.date,r=t.time,e=t.periods,n=t.days,o=t.shortDays,s=t.months,c=t.shortMonths,u=formatRe(e),l=formatLookup(e),h=formatRe(n),d=formatLookup(n),f=formatRe(o),g=formatLookup(o),p=formatRe(s),_=formatLookup(s),m=formatRe(c),x=formatLookup(c),v={a:function formatShortWeekday(t){return o[t.getDay()]},A:function formatWeekday(t){return n[t.getDay()]},b:function formatShortMonth(t){return c[t.getMonth()]},B:function formatMonth(t){return s[t.getMonth()]},c:null,d:formatDayOfMonth,e:formatDayOfMonth,f:formatMicroseconds,H:formatHour24,I:formatHour12,j:formatDayOfYear,L:formatMilliseconds,m:formatMonthNumber,M:formatMinutes,p:function formatPeriod(t){return e[+(12<=t.getHours())]},Q:formatUnixTimestamp,s:formatUnixTimestampSeconds,S:formatSeconds,u:formatWeekdayNumberMonday,U:formatWeekNumberSunday,V:formatWeekNumberISO,w:formatWeekdayNumberSunday,W:formatWeekNumberMonday,x:null,X:null,y:locale_formatYear,Y:formatFullYear,Z:formatZone,"%":formatLiteralPercent},y={a:function formatUTCShortWeekday(t){return o[t.getUTCDay()]},A:function formatUTCWeekday(t){return n[t.getUTCDay()]},b:function formatUTCShortMonth(t){return c[t.getUTCMonth()]},B:function formatUTCMonth(t){return s[t.getUTCMonth()]},c:null,d:formatUTCDayOfMonth,e:formatUTCDayOfMonth,f:formatUTCMicroseconds,H:formatUTCHour24,I:formatUTCHour12,j:formatUTCDayOfYear,L:formatUTCMilliseconds,m:formatUTCMonthNumber,M:formatUTCMinutes,p:function formatUTCPeriod(t){return e[+(12<=t.getUTCHours())]},Q:formatUnixTimestamp,s:formatUnixTimestampSeconds,S:formatUTCSeconds,u:formatUTCWeekdayNumberMonday,U:formatUTCWeekNumberSunday,V:formatUTCWeekNumberISO,w:formatUTCWeekdayNumberSunday,W:formatUTCWeekNumberMonday,x:null,X:null,y:formatUTCYear,Y:formatUTCFullYear,Z:formatUTCZone,"%":formatLiteralPercent},b={a:function parseShortWeekday(t,e,n){var i=f.exec(e.slice(n));return i?(t.w=g[i[0].toLowerCase()],n+i[0].length):-1},A:function parseWeekday(t,e,n){var i=h.exec(e.slice(n));return i?(t.w=d[i[0].toLowerCase()],n+i[0].length):-1},b:function parseShortMonth(t,e,n){var i=m.exec(e.slice(n));return i?(t.m=x[i[0].toLowerCase()],n+i[0].length):-1},B:function parseMonth(t,e,n){var i=p.exec(e.slice(n));return i?(t.m=_[i[0].toLowerCase()],n+i[0].length):-1},c:function parseLocaleDateTime(t,e,n){return parseSpecifier(t,i,e,n)},d:parseDayOfMonth,e:parseDayOfMonth,f:parseMicroseconds,H:parseHour24,I:parseHour24,j:parseDayOfYear,L:parseMilliseconds,m:parseMonthNumber,M:parseMinutes,p:function parsePeriod(t,e,n){var i=u.exec(e.slice(n));return i?(t.p=l[i[0].toLowerCase()],n+i[0].length):-1},Q:parseUnixTimestamp,s:parseUnixTimestampSeconds,S:parseSeconds,u:parseWeekdayNumberMonday,U:parseWeekNumberSunday,V:parseWeekNumberISO,w:parseWeekdayNumberSunday,W:parseWeekNumberMonday,x:function parseLocaleDate(t,e,n){return parseSpecifier(t,a,e,n)},X:function parseLocaleTime(t,e,n){return parseSpecifier(t,r,e,n)},y:parseYear,Y:parseFullYear,Z:parseZone,"%":parseLiteralPercent};function newFormat(c,u){return function(t){var e,n,i,a=[],r=-1,o=0,s=c.length;for(t instanceof Date||(t=new Date(+t));++r<s;)37===c.charCodeAt(r)&&(a.push(c.slice(o,r)),null!=(n=Q[e=c.charAt(++r)])?e=c.charAt(++r):n="e"===e?" ":"0",(i=u[e])&&(e=i(t,n)),a.push(e),o=r+1);return a.push(c.slice(o,r)),a.join("")}}function newParse(a,r){return function(t){var e,n,i=newYear(1900);if(parseSpecifier(i,a,t+="",0)!=t.length)return null;if("Q"in i)return new Date(i.Q);if("p"in i&&(i.H=i.H%12+12*i.p),"V"in i){if(i.V<1||53<i.V)return null;"w"in i||(i.w=1),"Z"in i?(e=4<(n=(e=utcDate(newYear(i.y))).getUTCDay())||0===n?P.ceil(e):P(e),e=I.offset(e,7*(i.V-1)),i.y=e.getUTCFullYear(),i.m=e.getUTCMonth(),i.d=e.getUTCDate()+(i.w+6)%7):(e=4<(n=(e=r(newYear(i.y))).getDay())||0===n?w.ceil(e):w(e),e=T.offset(e,7*(i.V-1)),i.y=e.getFullYear(),i.m=e.getMonth(),i.d=e.getDate()+(i.w+6)%7)}else("W"in i||"U"in i)&&("w"in i||(i.w="u"in i?i.u%7:"W"in i?1:0),n="Z"in i?utcDate(newYear(i.y)).getUTCDay():r(newYear(i.y)).getDay(),i.m=0,i.d="W"in i?(i.w+6)%7+7*i.W-(n+5)%7:i.w+7*i.U-(n+6)%7);return"Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,utcDate(i)):r(i)}}function parseSpecifier(t,e,n,i){for(var a,r,o=0,s=e.length,c=n.length;o<s;){if(c<=i)return-1;if(37===(a=e.charCodeAt(o++))){if(a=e.charAt(o++),!(r=b[a in Q?e.charAt(o++):a])||(i=r(t,n,i))<0)return-1}else if(a!=n.charCodeAt(i++))return-1}return i}return v.x=newFormat(a,v),v.X=newFormat(r,v),v.c=newFormat(i,v),y.x=newFormat(a,y),y.X=newFormat(r,y),y.c=newFormat(i,y),{format:function(t){var e=newFormat(t+="",v);return e.toString=function(){return t},e},parse:function(t){var e=newParse(t+="",localDate);return e.toString=function(){return t},e},utcFormat:function(t){var e=newFormat(t+="",y);return e.toString=function(){return t},e},utcParse:function(t){var e=newParse(t,utcDate);return e.toString=function(){return t},e}}}(t),q=G.format,$=G.parse,Z=G.utcFormat,K=G.utcParse,G}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var nt="%Y-%m-%dT%H:%M:%S.%LZ";Date.prototype.toISOString||Z(nt);+new Date("2000-01-01T00:00:00.000Z")||K(nt);function Ec(t){var e=t+="",n=e.indexOf(":");return 0<=n&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),at.hasOwnProperty(e)?{space:at[e],local:t}:t}var it="http://www.w3.org/1999/xhtml",at={svg:"http://www.w3.org/2000/svg",xhtml:it,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Fc(t){var e=Ec(t);return(e.local?function creatorFixed(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function creatorInherit(n){return function(){var t=this.ownerDocument,e=this.namespaceURI;return e===it&&t.documentElement.namespaceURI===it?t.createElement(n):t.createElementNS(e,n)}})(e)}function none(){}function Gc(t){return null==t?none:function(){return this.querySelector(t)}}function selectorAll_empty(){return[]}function Ic(t){return null==t?selectorAll_empty:function(){return this.querySelectorAll(t)}}function Kc(t){return function(){return this.matches(t)}}function Mc(t){return new Array(t.length)}function EnterNode(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}EnterNode.prototype={constructor:EnterNode,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)}};function bindIndex(t,e,n,i,a,r){for(var o,s=0,c=e.length,u=r.length;s<u;++s)(o=e[s])?(o.__data__=r[s],i[s]=o):n[s]=new EnterNode(t,r[s]);for(;s<c;++s)(o=e[s])&&(a[s]=o)}function bindKey(t,e,n,i,a,r,o){var s,c,u,l={},h=e.length,d=r.length,f=new Array(h);for(s=0;s<h;++s)(c=e[s])&&(f[s]=u="$"+o.call(c,c.__data__,s,e),u in l?a[s]=c:l[u]=c);for(s=0;s<d;++s)(c=l[u="$"+o.call(t,r[s],s,r)])?((i[s]=c).__data__=r[s],l[u]=null):n[s]=new EnterNode(t,r[s]);for(s=0;s<h;++s)(c=e[s])&&l[f[s]]===c&&(a[s]=c)}function ascending(t,e){return t<e?-1:e<t?1:e<=t?0:NaN}var rt=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function styleValue(t,e){return t.style.getPropertyValue(e)||rt(t).getComputedStyle(t,null).getPropertyValue(e)}function classArray(t){return t.trim().split(/^|\s+/)}function classList(t){return t.classList||new ClassList(t)}function ClassList(t){this._node=t,this._names=classArray(t.getAttribute("class")||"")}function classedAdd(t,e){for(var n=classList(t),i=-1,a=e.length;++i<a;)n.add(e[i])}function classedRemove(t,e){for(var n=classList(t),i=-1,a=e.length;++i<a;)n.remove(e[i])}ClassList.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);0<=e&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return 0<=this._names.indexOf(t)}};function textRemove(){this.textContent=""}function htmlRemove(){this.innerHTML=""}function raise(){this.nextSibling&&this.parentNode.appendChild(this)}function lower(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function constantNull(){return null}function remove_remove(){var t=this.parentNode;t&&t.removeChild(this)}function selection_cloneShallow(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function selection_cloneDeep(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}var ot={},st=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(ot={mouseenter:"mouseover",mouseleave:"mouseout"}));function filterContextListener(n,t,e){return n=contextListener(n,t,e),function(t){var e=t.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||n.call(this,t)}}function contextListener(n,i,a){return function(t){var e=st;st=t;try{n.call(this,this.__data__,i,a)}finally{st=e}}}function onRemove(r){return function(){var t=this.__on;if(t){for(var e,n=0,i=-1,a=t.length;n<a;++n)e=t[n],r.type&&e.type!==r.type||e.name!==r.name?t[++i]=e:this.removeEventListener(e.type,e.listener,e.capture);++i?t.length=i:delete this.__on}}}function onAdd(c,u,l){var h=ot.hasOwnProperty(c.type)?filterContextListener:contextListener;return function(t,e,n){var i,a=this.__on,r=h(u,e,n);if(a)for(var o=0,s=a.length;o<s;++o)if((i=a[o]).type===c.type&&i.name===c.name)return this.removeEventListener(i.type,i.listener,i.capture),this.addEventListener(i.type,i.listener=r,i.capture=l),void(i.value=u);this.addEventListener(c.type,r,l),i={type:c.type,name:c.name,value:u,listener:r,capture:l},a?a.push(i):this.__on=[i]}}function customEvent(t,e,n,i){var a=st;t.sourceEvent=st,st=t;try{return e.apply(n,i)}finally{st=a}}function dispatch_dispatchEvent(t,e,n){var i=rt(t),a=i.CustomEvent;"function"==typeof a?a=new a(e,n):(a=i.document.createEvent("Event"),n?(a.initEvent(e,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(e,!1,!1)),t.dispatchEvent(a)}var ct=[null];function Selection(t,e){this._groups=t,this._parents=e}function selection_selection(){return new Selection([[document.documentElement]],ct)}Selection.prototype=selection_selection.prototype={constructor:Selection,select:function(t){"function"!=typeof t&&(t=Gc(t));for(var e=this._groups,n=e.length,i=new Array(n),a=0;a<n;++a)for(var r,o,s=e[a],c=s.length,u=i[a]=new Array(c),l=0;l<c;++l)(r=s[l])&&(o=t.call(r,r.__data__,l,s))&&("__data__"in r&&(o.__data__=r.__data__),u[l]=o);return new Selection(i,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=Ic(t));for(var e=this._groups,n=e.length,i=[],a=[],r=0;r<n;++r)for(var o,s=e[r],c=s.length,u=0;u<c;++u)(o=s[u])&&(i.push(t.call(o,o.__data__,u,s)),a.push(o));return new Selection(i,a)},filter:function(t){"function"!=typeof t&&(t=Kc(t));for(var e=this._groups,n=e.length,i=new Array(n),a=0;a<n;++a)for(var r,o=e[a],s=o.length,c=i[a]=[],u=0;u<s;++u)(r=o[u])&&t.call(r,r.__data__,u,o)&&c.push(r);return new Selection(i,this._parents)},data:function(t,e){if(!t)return f=new Array(this.size()),u=-1,this.each(function(t){f[++u]=t}),f;var n=e?bindKey:bindIndex,i=this._parents,a=this._groups;"function"!=typeof t&&(t=function(t){return function(){return t}}(t));for(var r=a.length,o=new Array(r),s=new Array(r),c=new Array(r),u=0;u<r;++u){var l=i[u],h=a[u],d=h.length,f=t.call(l,l&&l.__data__,u,i),g=f.length,p=s[u]=new Array(g),_=o[u]=new Array(g);n(l,h,p,_,c[u]=new Array(d),f,e);for(var m,x,v=0,y=0;v<g;++v)if(m=p[v]){for(y<=v&&(y=v+1);!(x=_[y])&&++y<g;);m._next=x||null}}return(o=new Selection(o,i))._enter=s,o._exit=c,o},enter:function(){return new Selection(this._enter||this._groups.map(Mc),this._parents)},exit:function(){return new Selection(this._exit||this._groups.map(Mc),this._parents)},join:function(t,e,n){var i=this.enter(),a=this,r=this.exit();return i="function"==typeof t?t(i):i.append(t+""),null!=e&&(a=e(a)),null==n?r.remove():n(r),i&&a?i.merge(a).order():a},merge:function(t){for(var e=this._groups,n=t._groups,i=e.length,a=n.length,r=Math.min(i,a),o=new Array(i),s=0;s<r;++s)for(var c,u=e[s],l=n[s],h=u.length,d=o[s]=new Array(h),f=0;f<h;++f)(c=u[f]||l[f])&&(d[f]=c);for(;s<i;++s)o[s]=e[s];return new Selection(o,this._parents)},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var i,a=t[e],r=a.length-1,o=a[r];0<=--r;)(i=a[r])&&(o&&4^i.compareDocumentPosition(o)&&o.parentNode.insertBefore(i,o),o=i);return this},sort:function(n){function compareNode(t,e){return t&&e?n(t.__data__,e.__data__):!t-!e}n=n||ascending;for(var t=this._groups,e=t.length,i=new Array(e),a=0;a<e;++a){for(var r,o=t[a],s=o.length,c=i[a]=new Array(s),u=0;u<s;++u)(r=o[u])&&(c[u]=r);c.sort(compareNode)}return new Selection(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 i=t[e],a=0,r=i.length;a<r;++a){var o=i[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,i=e.length;n<i;++n)for(var a,r=e[n],o=0,s=r.length;o<s;++o)(a=r[o])&&t.call(a,a.__data__,o,r);return this},attr:function(t,e){var n=Ec(t);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((null==e?n.local?function attrRemoveNS(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function attrRemove(t){return function(){this.removeAttribute(t)}}:"function"==typeof e?n.local?function attrFunctionNS(e,n){return function(){var t=n.apply(this,arguments);null==t?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,t)}}:function attrFunction(e,n){return function(){var t=n.apply(this,arguments);null==t?this.removeAttribute(e):this.setAttribute(e,t)}}:n.local?function attrConstantNS(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}:function attrConstant(t,e){return function(){this.setAttribute(t,e)}})(n,e))},style:function(t,e,n){return 1<arguments.length?this.each((null==e?function styleRemove(t){return function(){this.style.removeProperty(t)}}:"function"==typeof e?function styleFunction(e,n,i){return function(){var t=n.apply(this,arguments);null==t?this.style.removeProperty(e):this.style.setProperty(e,t,i)}}:function styleConstant(t,e,n){return function(){this.style.setProperty(t,e,n)}})(t,e,null==n?"":n)):styleValue(this.node(),t)},property:function(t,e){return 1<arguments.length?this.each((null==e?function propertyRemove(t){return function(){delete this[t]}}:"function"==typeof e?function propertyFunction(e,n){return function(){var t=n.apply(this,arguments);null==t?delete this[e]:this[e]=t}}:function propertyConstant(t,e){return function(){this[t]=e}})(t,e)):this.node()[t]},classed:function(t,e){var n=classArray(t+"");if(arguments.length<2){for(var i=classList(this.node()),a=-1,r=n.length;++a<r;)if(!i.contains(n[a]))return!1;return!0}return this.each(("function"==typeof e?function classedFunction(t,e){return function(){(e.apply(this,arguments)?classedAdd:classedRemove)(this,t)}}:e?function classedTrue(t){return function(){classedAdd(this,t)}}:function classedFalse(t){return function(){classedRemove(this,t)}})(n,e))},text:function(t){return arguments.length?this.each(null==t?textRemove:("function"==typeof t?function textFunction(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}:function textConstant(t){return function(){this.textContent=t}})(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?htmlRemove:("function"==typeof t?function htmlFunction(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}:function htmlConstant(t){return function(){this.innerHTML=t}})(t)):this.node().innerHTML},raise:function(){return this.each(raise)},lower:function(){return this.each(lower)},append:function(t){var e="function"==typeof t?t:Fc(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})},insert:function(t,e){var n="function"==typeof t?t:Fc(t),i=null==e?constantNull:"function"==typeof e?e:Gc(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})},remove:function(){return this.each(remove_remove)},clone:function(t){return this.select(t?selection_cloneDeep:selection_cloneShallow)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var i,a,r=function parseTypenames(t){return t.trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");return 0<=n&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}})}(t+""),o=r.length;if(!(arguments.length<2)){for(s=e?onAdd:onRemove,null==n&&(n=!1),i=0;i<o;++i)this.each(s(r[i],e,n));return this}var s=this.node().__on;if(s)for(var c,u=0,l=s.length;u<l;++u)for(i=0,c=s[u];i<o;++i)if((a=r[i]).type===c.type&&a.name===c.name)return c.value},dispatch:function(t,e){return this.each(("function"==typeof e?function dispatchFunction(t,e){return function(){return dispatch_dispatchEvent(this,t,e.apply(this,arguments))}}:function dispatchConstant(t,e){return function(){return dispatch_dispatchEvent(this,t,e)}})(t,e))}};var ut=selection_selection,lt=function(t){return"string"==typeof t?new Selection([[document.querySelector(t)]],[document.documentElement]):new Selection([[t]],ct)},ht=0;function Local(){this._="@"+(++ht).toString(36)}Local.prototype=function local(){return new Local}.prototype={constructor:Local,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._}};function yd(){for(var t,e=st;t=e.sourceEvent;)e=t;return e}function zd(t,e){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,[(i=i.matrixTransform(t.getScreenCTM().inverse())).x,i.y]}var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}function Bd(t){return"string"==typeof t?new Selection([document.querySelectorAll(t)],[document.documentElement]):new Selection([null==t?[]:t],ct)}function Cd(t,e,n){arguments.length<3&&(n=e,e=yd().changedTouches);for(var i,a=0,r=e?e.length:0;a<r;++a)if((i=e[a]).identifier===n)return zd(t,i);return null}var dt=function(t){var e=yd();return e.changedTouches&&(e=e.changedTouches[0]),zd(t,e)},ft={value:function(){}};function dispatch_dispatch(){for(var t,e=0,n=arguments.length,i={};e<n;++e){if(!(t=arguments[e]+"")||t in i)throw new Error("illegal type: "+t);i[t]=[]}return new Dispatch(i)}function Dispatch(t){this._=t}function get(t,e){for(var n,i=0,a=t.length;i<a;++i)if((n=t[i]).name===e)return n.value}function set(t,e,n){for(var i=0,a=t.length;i<a;++i)if(t[i].name===e){t[i]=ft,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=n&&t.push({name:e,value:n}),t}Dispatch.prototype=dispatch_dispatch.prototype={constructor:Dispatch,on:function(t,e){var n,i=this._,a=function dispatch_parseTypenames(t,i){return t.trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");if(0<=n&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!i.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})}(t+"",i),r=-1,o=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++r<o;)if(n=(t=a[r]).type)i[n]=set(i[n],t.name,e);else if(null==e)for(n in i)i[n]=set(i[n],t.name,null);return this}for(;++r<o;)if((n=(t=a[r]).type)&&(n=get(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Dispatch(t)},call:function(t,e){if(0<(n=arguments.length-2))for(var n,i,a=new Array(n),r=0;r<n;++r)a[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(r=0,n=(i=this._[t]).length;r<n;++r)i[r].value.apply(e,a)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],a=0,r=i.length;a<r;++a)i[a].value.apply(e,n)}};var gt,pt,_t=dispatch_dispatch,mt=0,xt=0,vt=0,yt=1e3,bt=0,Tt=0,wt=0,At="object"==typeof performance&&performance.now?performance:Date,kt="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function now(){return Tt||(kt(clearNow),Tt=At.now()+wt)}function clearNow(){Tt=0}function Timer(){this._call=this._time=this._next=null}function timer(t,e,n){var i=new Timer;return i.restart(t,e,n),i}function wake(){Tt=(bt=At.now())+wt,mt=xt=0;try{!function timerFlush(){now(),++mt;for(var t,e=gt;e;)0<=(t=Tt-e._time)&&e._call.call(null,t),e=e._next;--mt}()}finally{mt=0,function nap(){var t,e,n=gt,i=1/0;for(;n;)n=n._call?(i>n._time&&(i=n._time),(t=n)._next):(e=n._next,n._next=null,t?t._next=e:gt=e);pt=t,sleep(i)}(),Tt=0}}function poke(){var t=At.now(),e=t-bt;yt<e&&(wt-=e,bt=t)}function sleep(t){mt||(xt=xt&&clearTimeout(xt),24<t-Tt?(t<1/0&&(xt=setTimeout(wake,t-At.now()-wt)),vt=vt&&clearInterval(vt)):(vt||(bt=At.now(),vt=setInterval(poke,yt)),mt=1,kt(wake)))}Timer.prototype=timer.prototype={constructor:Timer,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?now():+n)+(null==e?0:+e),this._next||pt===this||(pt?pt._next=this:gt=this,pt=this),this._call=t,this._time=n,sleep()},stop:function(){this._call&&(this._call=null,this._time=1/0,sleep())}};function Rd(e,n,t){var i=new Timer;return n=null==n?0:+n,i.restart(function(t){i.stop(),e(t+n)},n,t),i}function ae(t,e,n,i,a,r){var o=t.__transition;if(o){if(n in o)return}else t.__transition={};!function schedule_create(r,o,s){var c,u=r.__transition;function start(t){var e,n,i,a;if(1!==s.state)return stop();for(e in u)if((a=u[e]).name===s.name){if(a.state===Lt)return Rd(start);4===a.state?(a.state=6,a.timer.stop(),a.on.call("interrupt",r,r.__data__,a.index,a.group),delete u[e]):+e<o&&(a.state=6,a.timer.stop(),a.on.call("cancel",r,r.__data__,a.index,a.group),delete u[e])}if(Rd(function(){s.state===Lt&&(s.state=4,s.timer.restart(tick,s.delay,s.time),tick(t))}),s.state=2,s.on.call("start",r,r.__data__,s.index,s.group),2===s.state){for(s.state=Lt,c=new Array(i=s.tween.length),e=0,n=-1;e<i;++e)(a=s.tween[e].value.call(r,r.__data__,s.index,s.group))&&(c[++n]=a);c.length=n+1}}function tick(t){for(var e=t<s.duration?s.ease.call(null,t/s.duration):(s.timer.restart(stop),s.state=5,1),n=-1,i=c.length;++n<i;)c[n].call(r,e);5===s.state&&(s.on.call("end",r,r.__data__,s.index,s.group),stop())}function stop(){for(var t in s.state=6,s.timer.stop(),delete u[o],u)return;delete r.__transition}(u[o]=s).timer=timer(function schedule(t){s.state=1,s.timer.restart(start,s.delay,s.time),s.delay<=t&&start(t-s.delay)},0,s.time)}(t,n,{name:e,index:i,group:a,on:Ct,tween:St,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Mt})}var Ct=_t("start","end","cancel","interrupt"),St=[],Mt=0,Lt=3;function schedule_init(t,e){var n=schedule_get(t,e);if(n.state>Mt)throw new Error("too late; already scheduled");return n}function schedule_set(t,e){var n=schedule_get(t,e);if(n.state>Lt)throw new Error("too late; already running");return n}function schedule_get(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function de(t,e,n){t.prototype=e.prototype=n,n.constructor=t}var Dt=function(t,e){var n,i,a,r=t.__transition,o=!0;if(r){for(a in e=null==e?null:e+"",r)(n=r[a]).name===e?(i=2<n.state&&n.state<5,n.state=6,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete r[a]):o=!1;o&&delete t.__transition}};function extend(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function Color(){}var Ft=1/.7,Rt="\\s*([+-]?\\d+)\\s*",Et="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",zt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Xt=/^#([0-9a-f]{3})$/,It=/^#([0-9a-f]{6})$/,Ot=new RegExp("^rgb\\("+[Rt,Rt,Rt]+"\\)$"),Pt=new RegExp("^rgb\\("+[zt,zt,zt]+"\\)$"),Nt=new RegExp("^rgba\\("+[Rt,Rt,Rt,Et]+"\\)$"),Yt=new RegExp("^rgba\\("+[zt,zt,zt,Et]+"\\)$"),Bt=new RegExp("^hsl\\("+[Et,zt,zt]+"\\)$"),Ht=new RegExp("^hsla\\("+[Et,zt,zt,Et]+"\\)$"),Vt={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 color_color(t){var e;return t=(t+"").trim().toLowerCase(),(e=Xt.exec(t))?new Rgb((e=parseInt(e[1],16))>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):(e=It.exec(t))?rgbn(parseInt(e[1],16)):(e=Ot.exec(t))?new Rgb(e[1],e[2],e[3],1):(e=Pt.exec(t))?new Rgb(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Nt.exec(t))?rgba(e[1],e[2],e[3],e[4]):(e=Yt.exec(t))?rgba(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Bt.exec(t))?hsla(e[1],e[2]/100,e[3]/100,1):(e=Ht.exec(t))?hsla(e[1],e[2]/100,e[3]/100,e[4]):Vt.hasOwnProperty(t)?rgbn(Vt[t]):"transparent"===t?new Rgb(NaN,NaN,NaN,0):null}function rgbn(t){return new Rgb(t>>16&255,t>>8&255,255&t,1)}function rgba(t,e,n,i){return i<=0&&(t=e=n=NaN),new Rgb(t,e,n,i)}function rgbConvert(t){return t instanceof Color||(t=color_color(t)),t?new Rgb((t=t.rgb()).r,t.g,t.b,t.opacity):new Rgb}function color_rgb(t,e,n,i){return 1===arguments.length?rgbConvert(t):new Rgb(t,e,n,null==i?1:i)}function Rgb(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function hex(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function hsla(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||1<=n?t=e=NaN:e<=0&&(t=NaN),new Hsl(t,e,n,i)}function hsl(t,e,n,i){return 1===arguments.length?function hslConvert(t){if(t instanceof Hsl)return new Hsl(t.h,t.s,t.l,t.opacity);if(t instanceof Color||(t=color_color(t)),!t)return new Hsl;if(t instanceof Hsl)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,a=Math.min(e,n,i),r=Math.max(e,n,i),o=NaN,s=r-a,c=(r+a)/2;return s?(o=e===r?(n-i)/s+6*(n<i):n===r?(i-e)/s+2:(e-n)/s+4,s/=c<.5?r+a:2-r-a,o*=60):s=0<c&&c<1?0:o,new Hsl(o,s,c,t.opacity)}(t):new Hsl(t,e,n,null==i?1:i)}function Hsl(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function hsl2rgb(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}de(Color,color_color,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),de(Rgb,color_rgb,extend(Color,{brighter:function(t){return t=null==t?Ft:Math.pow(Ft,t),new Rgb(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Rgb(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+hex(this.r)+hex(this.g)+hex(this.b)},toString:function(){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+")")}})),de(Hsl,hsl,extend(Color,{brighter:function(t){return t=null==t?Ft:Math.pow(Ft,t),new Hsl(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Hsl(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,i=n+(n<.5?n:1-n)*e,a=2*n-i;return new Rgb(hsl2rgb(240<=t?t-240:120+t,a,i),hsl2rgb(t,a,i),hsl2rgb(t<120?240+t:t-120,a,i),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}}));var Ut=Math.PI/180,Wt=180/Math.PI,jt=.96422,Gt=1,qt=.82521,$t=4/29,Zt=6/29,Kt=3*Zt*Zt,Qt=Zt*Zt*Zt;function labConvert(t){if(t instanceof Lab)return new Lab(t.l,t.a,t.b,t.opacity);if(t instanceof Hcl){if(isNaN(t.h))return new Lab(t.l,0,0,t.opacity);var e=t.h*Ut;return new Lab(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof Rgb||(t=rgbConvert(t));var n,i,a=rgb2lrgb(t.r),r=rgb2lrgb(t.g),o=rgb2lrgb(t.b),s=xyz2lab((.2225045*a+.7168786*r+.0606169*o)/Gt);return a===r&&r===o?n=i=s:(n=xyz2lab((.4360747*a+.3850649*r+.1430804*o)/jt),i=xyz2lab((.0139322*a+.0971045*r+.7141733*o)/qt)),new Lab(116*s-16,500*(n-s),200*(s-i),t.opacity)}function lab(t,e,n,i){return 1===arguments.length?labConvert(t):new Lab(t,e,n,null==i?1:i)}function Lab(t,e,n,i){this.l=+t,this.a=+e,this.b=+n,this.opacity=+i}function xyz2lab(t){return Qt<t?Math.pow(t,1/3):t/Kt+$t}function lab2xyz(t){return Zt<t?t*t*t:Kt*(t-$t)}function lrgb2rgb(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function rgb2lrgb(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function hclConvert(t){if(t instanceof Hcl)return new Hcl(t.h,t.c,t.l,t.opacity);if(t instanceof Lab||(t=labConvert(t)),0===t.a&&0===t.b)return new Hcl(NaN,0,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*Wt;return new Hcl(e<0?360+e:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function hcl(t,e,n,i){return 1===arguments.length?hclConvert(t):new Hcl(t,e,n,null==i?1:i)}function Hcl(t,e,n,i){this.h=+t,this.c=+e,this.l=+n,this.opacity=+i}de(Lab,lab,extend(Color,{brighter:function(t){return new Lab(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new Lab(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 Rgb(lrgb2rgb(3.1338561*(e=jt*lab2xyz(e))-1.6168667*(t=Gt*lab2xyz(t))-.4906146*(n=qt*lab2xyz(n))),lrgb2rgb(-.9787684*e+1.9161415*t+.033454*n),lrgb2rgb(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),de(Hcl,hcl,extend(Color,{brighter:function(t){return new Hcl(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new Hcl(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return labConvert(this).rgb()}}));var Jt=1.78277,te=-.29227,ee=-.90649,ne=1.97294,ie=ne*ee,re=ne*Jt,oe=Jt*te- -.14861*ee;function cubehelix_cubehelix(t,e,n,i){return 1===arguments.length?function cubehelixConvert(t){if(t instanceof Cubehelix)return new Cubehelix(t.h,t.s,t.l,t.opacity);t instanceof Rgb||(t=rgbConvert(t));var e=t.r/255,n=t.g/255,i=t.b/255,a=(oe*i+ie*e-re*n)/(oe+ie-re),r=i-a,o=(ne*(n-a)-te*r)/ee,s=Math.sqrt(o*o+r*r)/(ne*a*(1-a)),c=s?Math.atan2(o,r)*Wt-120:NaN;return new Cubehelix(c<0?c+360:c,s,a,t.opacity)}(t):new Cubehelix(t,e,n,null==i?1:i)}function Cubehelix(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function basis(t,e,n,i,a){var r=t*t,o=r*t;return((1-3*t+3*r-o)*e+(4-6*r+3*o)*n+(1+3*t+3*r-3*o)*i+o*a)/6}de(Cubehelix,cubehelix_cubehelix,extend(Color,{brighter:function(t){return t=null==t?Ft:Math.pow(Ft,t),new Cubehelix(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Cubehelix(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*Ut,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),i=Math.cos(t),a=Math.sin(t);return new Rgb(255*(e+n*(-.14861*i+Jt*a)),255*(e+n*(te*i+ee*a)),255*(e+ne*i*n),this.opacity)}}));var se=function(t){return function(){return t}};function linear(e,n){return function(t){return e+t*n}}function color_hue(t,e){var n=e-t;return n?linear(t,180<n||n<-180?n-360*Math.round(n/360):n):se(isNaN(t)?e:t)}function gamma(n){return 1==(n=+n)?nogamma:function(t,e){return e-t?function exponential(e,n,i){return e=Math.pow(e,i),n=Math.pow(n,i)-e,i=1/i,function(t){return Math.pow(e+t*n,i)}}(t,e,n):se(isNaN(t)?e:t)}}function nogamma(t,e){var n=e-t;return n?linear(t,n):se(isNaN(t)?e:t)}var ce=function rgbGamma(t){var o=gamma(t);function rgb(e,t){var n=o((e=color_rgb(e)).r,(t=color_rgb(t)).r),i=o(e.g,t.g),a=o(e.b,t.b),r=nogamma(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=i(t),e.b=a(t),e.opacity=r(t),e+""}}return rgb.gamma=rgbGamma,rgb}(1);function rgbSpline(s){return function(t){var e,n,i=t.length,a=new Array(i),r=new Array(i),o=new Array(i);for(e=0;e<i;++e)n=color_rgb(t[e]),a[e]=n.r||0,r[e]=n.g||0,o[e]=n.b||0;return a=s(a),r=s(r),o=s(o),n.opacity=1,function(t){return n.r=a(t),n.g=r(t),n.b=o(t),n+""}}}rgbSpline(function(o){var s=o.length-1;return function(t){var e=t<=0?t=0:1<=t?s-(t=1):Math.floor(t*s),n=o[e],i=o[e+1],a=0<e?o[e-1]:2*n-i,r=e<s-1?o[e+2]:2*i-n;return basis((t-e/s)*s,a,n,i,r)}}),rgbSpline(function(o){var s=o.length;return function(t){var e=Math.floor(((t%=1)<0?++t:t)*s),n=o[(e+s-1)%s],i=o[e%s],a=o[(e+1)%s],r=o[(e+2)%s];return basis((t-e/s)*s,n,i,a,r)}});var ue=function(e,n){return n-=e=+e,function(t){return e+n*t}},le=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,he=new RegExp(le.source,"g");function We(t,i){var e,n,a,r=le.lastIndex=he.lastIndex=0,o=-1,s=[],c=[];for(t+="",i+="";(e=le.exec(t))&&(n=he.exec(i));)(a=n.index)>r&&(a=i.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(e=e[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,c.push({i:o,x:ue(e,n)})),r=he.lastIndex;return r<i.length&&(a=i.slice(r),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?function one(e){return function(t){return e(t)+""}}(c[0].x):function string_zero(t){return function(){return t}}(i):(i=c.length,function(t){for(var e,n=0;n<i;++n)s[(e=c[n]).i]=e.x(t);return s.join("")})}function bf(t,e,n,i,a,r){var o,s,c;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(c=t*n+e*i)&&(n-=t*c,i-=e*c),(s=Math.sqrt(n*n+i*i))&&(n/=s,i/=s,c/=s),t*i<e*n&&(t=-t,e=-e,c=-c,o=-o),{translateX:a,translateY:r,rotate:Math.atan2(e,t)*ve,skewX:Math.atan(c)*ve,scaleX:o,scaleY:s}}var fe,ge,pe,_e,me=function(t,e){var n,i=typeof e;return null==e||"boolean"==i?se(e):("number"==i?ue:"string"==i?(n=color_color(e))?(e=n,ce):We:e instanceof color_color?ce:e instanceof Date?function(e,n){var i=new Date;return n-=e=+e,function(t){return i.setTime(e+n*t),i}}:Array.isArray(e)?function(t,e){var n,i=e?e.length:0,a=t?Math.min(i,t.length):0,r=new Array(a),o=new Array(i);for(n=0;n<a;++n)r[n]=me(t[n],e[n]);for(;n<i;++n)o[n]=e[n];return function(t){for(n=0;n<a;++n)o[n]=r[n](t);return o}}:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?function(t,e){var n,i={},a={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?i[n]=me(t[n],e[n]):a[n]=e[n];return function(t){for(n in i)a[n]=i[n](t);return a}}:ue)(t,e)},xe=function(e,n){return n-=e=+e,function(t){return Math.round(e+n*t)}},ve=180/Math.PI,ye={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function interpolateTransform(n,s,c,o){function pop(t){return t.length?t.pop()+" ":""}return function(t,e){var a=[],r=[];return t=n(t),e=n(e),function translate(t,e,n,i,a,r){if(t!==n||e!==i){var o=a.push("translate(",null,s,null,c);r.push({i:o-4,x:ue(t,n)},{i:o-2,x:ue(e,i)})}else(n||i)&&a.push("translate("+n+s+i+c)}(t.translateX,t.translateY,e.translateX,e.translateY,a,r),function rotate(t,e,n,i){t!==e?(180<t-e?e+=360:180<e-t&&(t+=360),i.push({i:n.push(pop(n)+"rotate(",null,o)-2,x:ue(t,e)})):e&&n.push(pop(n)+"rotate("+e+o)}(t.rotate,e.rotate,a,r),function skewX(t,e,n,i){t!==e?i.push({i:n.push(pop(n)+"skewX(",null,o)-2,x:ue(t,e)}):e&&n.push(pop(n)+"skewX("+e+o)}(t.skewX,e.skewX,a,r),function scale(t,e,n,i,a,r){if(t!==n||e!==i){var o=a.push(pop(a)+"scale(",null,",",null,")");r.push({i:o-4,x:ue(t,n)},{i:o-2,x:ue(e,i)})}else 1===n&&1===i||a.push(pop(a)+"scale("+n+","+i+")")}(t.scaleX,t.scaleY,e.scaleX,e.scaleY,a,r),t=e=null,function(t){for(var e,n=-1,i=r.length;++n<i;)a[(e=r[n]).i]=e.x(t);return a.join("")}}}var be=interpolateTransform(function parseCss(t){return"none"===t?ye:(fe||(fe=document.createElement("DIV"),ge=document.documentElement,pe=document.defaultView),fe.style.transform=t,t=pe.getComputedStyle(ge.appendChild(fe),null).getPropertyValue("transform"),ge.removeChild(fe),t=t.slice(7,-1).split(","),bf(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))},"px, ","px)","deg)"),Te=interpolateTransform(function parseSvg(t){return null==t?ye:((_e=_e||document.createElementNS("http://www.w3.org/2000/svg","g")).setAttribute("transform",t),(t=_e.transform.baseVal.consolidate())?(t=t.matrix,bf(t.a,t.b,t.c,t.d,t.e,t.f)):ye)},", ",")",")"),we=Math.SQRT2;function zoom_cosh(t){return((t=Math.exp(t))+1/t)/2}function nf(t,e){var n,a,r=t[0],o=t[1],s=t[2],i=e[0],c=e[1],u=e[2],l=i-r,h=c-o,d=l*l+h*h;if(d<1e-12)a=Math.log(u/s)/we,n=function(t){return[r+t*l,o+t*h,s*Math.exp(we*t*a)]};else{var f=Math.sqrt(d),g=(u*u-s*s+4*d)/(2*s*2*f),p=(u*u-s*s-4*d)/(2*u*2*f),_=Math.log(Math.sqrt(g*g+1)-g),m=Math.log(Math.sqrt(p*p+1)-p);a=(m-_)/we,n=function(t){var e=t*a,n=zoom_cosh(_),i=s/(2*f)*(n*function tanh(t){return((t=Math.exp(2*t))-1)/(t+1)}(we*e+_)-function zoom_sinh(t){return((t=Math.exp(t))-1/t)/2}(_));return[r+i*l,o+i*h,s*n/zoom_cosh(we*e+_)]}}return n.duration=1e3*a,n}function hsl_hsl(o){return function(e,t){var n=o((e=hsl(e)).h,(t=hsl(t)).h),i=nogamma(e.s,t.s),a=nogamma(e.l,t.l),r=nogamma(e.opacity,t.opacity);return function(t){return e.h=n(t),e.s=i(t),e.l=a(t),e.opacity=r(t),e+""}}}hsl_hsl(color_hue),hsl_hsl(nogamma);function hcl_hcl(o){return function(e,t){var n=o((e=hcl(e)).h,(t=hcl(t)).h),i=nogamma(e.c,t.c),a=nogamma(e.l,t.l),r=nogamma(e.opacity,t.opacity);return function(t){return e.h=n(t),e.c=i(t),e.l=a(t),e.opacity=r(t),e+""}}}hcl_hcl(color_hue),hcl_hcl(nogamma);function src_cubehelix_cubehelix(s){return function cubehelixGamma(o){function cubehelix(e,t){var n=s((e=cubehelix_cubehelix(e)).h,(t=cubehelix_cubehelix(t)).h),i=nogamma(e.s,t.s),a=nogamma(e.l,t.l),r=nogamma(e.opacity,t.opacity);return function(t){return e.h=n(t),e.s=i(t),e.l=a(Math.pow(t,o)),e.opacity=r(t),e+""}}return o=+o,cubehelix.gamma=cubehelixGamma,cubehelix}(1)}src_cubehelix_cubehelix(color_hue),src_cubehelix_cubehelix(nogamma);function tweenValue(t,e,n){var i=t._id;return t.each(function(){var t=schedule_set(this,i);(t.value||(t.value={}))[e]=n.apply(this,arguments)}),function(t){return schedule_get(t,i).value[e]}}function wf(t,e){var n;return("number"==typeof e?ue:e instanceof color_color?ce:(n=color_color(e))?(e=n,ce):We)(t,e)}var Ae=ut.prototype.constructor;function style_styleRemove(t){return function(){this.style.removeProperty(t)}}var ke=0;function Transition(t,e,n,i){this._groups=t,this._parents=e,this._name=n,this._id=i}function src_transition_transition(t){return ut().transition(t)}function newId(){return++ke}var Ce=ut.prototype;function linear_linear(t){return+t}Transition.prototype=src_transition_transition.prototype={constructor:Transition,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=Gc(t));for(var i=this._groups,a=i.length,r=new Array(a),o=0;o<a;++o)for(var s,c,u=i[o],l=u.length,h=r[o]=new Array(l),d=0;d<l;++d)(s=u[d])&&(c=t.call(s,s.__data__,d,u))&&("__data__"in s&&(c.__data__=s.__data__),h[d]=c,ae(h[d],e,n,d,h,schedule_get(s,n)));return new Transition(r,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=Ic(t));for(var i=this._groups,a=i.length,r=[],o=[],s=0;s<a;++s)for(var c,u=i[s],l=u.length,h=0;h<l;++h)if(c=u[h]){for(var d,f=t.call(c,c.__data__,h,u),g=schedule_get(c,n),p=0,_=f.length;p<_;++p)(d=f[p])&&ae(d,e,n,p,f,g);r.push(f),o.push(c)}return new Transition(r,o,e,n)},filter:function(t){"function"!=typeof t&&(t=Kc(t));for(var e=this._groups,n=e.length,i=new Array(n),a=0;a<n;++a)for(var r,o=e[a],s=o.length,c=i[a]=[],u=0;u<s;++u)(r=o[u])&&t.call(r,r.__data__,u,o)&&c.push(r);return new Transition(i,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,i=e.length,a=n.length,r=Math.min(i,a),o=new Array(i),s=0;s<r;++s)for(var c,u=e[s],l=n[s],h=u.length,d=o[s]=new Array(h),f=0;f<h;++f)(c=u[f]||l[f])&&(d[f]=c);for(;s<i;++s)o[s]=e[s];return new Transition(o,this._parents,this._name,this._id)},selection:function(){return new Ae(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=newId(),i=this._groups,a=i.length,r=0;r<a;++r)for(var o,s=i[r],c=s.length,u=0;u<c;++u)if(o=s[u]){var l=schedule_get(o,e);ae(o,t,n,u,s,{time:l.time+l.delay+l.duration,delay:0,duration:l.duration,ease:l.ease})}return new Transition(i,this._parents,t,n)},call:Ce.call,nodes:Ce.nodes,node:Ce.node,size:Ce.size,empty:Ce.empty,each:Ce.each,on:function(t,e){var n=this._id;return arguments.length<2?schedule_get(this.node(),n).on.on(t):this.each(function onFunction(n,i,a){var r,o,s=function on_start(t){return(t+"").trim().split(/^|\s+/).every(function(t){var e=t.indexOf(".");return 0<=e&&(t=t.slice(0,e)),!t||"start"===t})}(i)?schedule_init:schedule_set;return function(){var t=s(this,n),e=t.on;e!==r&&(o=(r=e).copy()).on(i,a),t.on=o}}(n,t,e))},attr:function(t,e){var n=Ec(t),i="transform"===n?Te:wf;return this.attrTween(t,"function"==typeof e?(n.local?function attr_attrFunctionNS(i,a,r){var o,s,c;return function(){var t,e,n=r(this);if(null!=n)return(t=this.getAttributeNS(i.space,i.local))===(e=n+"")?null:t===o&&e===s?c:(s=e,c=a(o=t,n));this.removeAttributeNS(i.space,i.local)}}:function attr_attrFunction(i,a,r){var o,s,c;return function(){var t,e,n=r(this);if(null!=n)return(t=this.getAttribute(i))===(e=n+"")?null:t===o&&e===s?c:(s=e,c=a(o=t,n));this.removeAttribute(i)}})(n,i,tweenValue(this,"attr."+t,e)):null==e?(n.local?function attr_attrRemoveNS(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function attr_attrRemove(t){return function(){this.removeAttribute(t)}})(n):(n.local?function attr_attrConstantNS(e,n,i){var a,r,o=i+"";return function(){var t=this.getAttributeNS(e.space,e.local);return t===o?null:t===a?r:r=n(a=t,i)}}:function attr_attrConstant(e,n,i){var a,r,o=i+"";return function(){var t=this.getAttribute(e);return t===o?null:t===a?r:r=n(a=t,i)}})(n,i,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 i=Ec(t);return this.tween(n,(i.local?function attrTweenNS(e,n){var i,a;function tween(){var t=n.apply(this,arguments);return t!==a&&(i=(a=t)&&function attrInterpolateNS(e,n){return function(t){this.setAttributeNS(e.space,e.local,n(t))}}(e,t)),i}return tween._value=n,tween}:function attrTween(e,n){var i,a;function tween(){var t=n.apply(this,arguments);return t!==a&&(i=(a=t)&&function attrInterpolate(e,n){return function(t){this.setAttribute(e,n(t))}}(e,t)),i}return tween._value=n,tween})(i,e))},style:function(t,e,n){var i="transform"==(t+="")?be:wf;return null==e?this.styleTween(t,function styleNull(n,i){var a,r,o;return function(){var t=styleValue(this,n),e=(this.style.removeProperty(n),styleValue(this,n));return t===e?null:t===a&&e===r?o:o=i(a=t,r=e)}}(t,i)).on("end.style."+t,style_styleRemove(t)):"function"==typeof e?this.styleTween(t,function style_styleFunction(i,a,r){var o,s,c;return function(){var t=styleValue(this,i),e=r(this),n=e+"";return null==e&&(this.style.removeProperty(i),n=e=styleValue(this,i)),t===n?null:t===o&&n===s?c:(s=n,c=a(o=t,e))}}(t,i,tweenValue(this,"style."+t,e))).each(function styleMaybeRemove(i,a){var r,o,s,c,u="style."+a,l="end."+u;return function(){var t=schedule_set(this,i),e=t.on,n=null==t.value[u]?c=c||style_styleRemove(a):void 0;e===r&&s===n||(o=(r=e).copy()).on(l,s=n),t.on=o}}(this._id,t)):this.styleTween(t,function style_styleConstant(e,n,i){var a,r,o=i+"";return function(){var t=styleValue(this,e);return t===o?null:t===a?r:r=n(a=t,i)}}(t,i,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw new Error;return this.tween(i,function styleTween(e,n,i){var a,r;function tween(){var t=n.apply(this,arguments);return t!==r&&(a=(r=t)&&function styleInterpolate(e,n,i){return function(t){this.style.setProperty(e,n(t),i)}}(e,t,i)),a}return tween._value=n,tween}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function text_textFunction(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(tweenValue(this,"text",t)):function text_textConstant(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",function removeFunction(n){return function(){var t=this.parentNode;for(var e in this.__transition)if(+e!==n)return;t&&t.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i,a=schedule_get(this.node(),n).tween,r=0,o=a.length;r<o;++r)if((i=a[r]).name===t)return i.value;return null}return this.each((null==e?function tweenRemove(a,r){var o,s;return function(){var t=schedule_set(this,a),e=t.tween;if(e!==o)for(var n=0,i=(s=o=e).length;n<i;++n)if(s[n].name===r){(s=s.slice()).splice(n,1);break}t.tween=s}}:function tweenFunction(r,o,s){var c,u;if("function"!=typeof s)throw new Error;return function(){var t=schedule_set(this,r),e=t.tween;if(e!==c){u=(c=e).slice();for(var n={name:o,value:s},i=0,a=u.length;i<a;++i)if(u[i].name===o){u[i]=n;break}i===a&&u.push(n)}t.tween=u}})(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?function delayFunction(t,e){return function(){schedule_init(this,t).delay=+e.apply(this,arguments)}}:function delayConstant(t,e){return e=+e,function(){schedule_init(this,t).delay=e}})(e,t)):schedule_get(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?function durationFunction(t,e){return function(){schedule_set(this,t).duration=+e.apply(this,arguments)}}:function durationConstant(t,e){return e=+e,function(){schedule_set(this,t).duration=e}})(e,t)):schedule_get(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function easeConstant(t,e){if("function"!=typeof e)throw new Error;return function(){schedule_set(this,t).ease=e}}(e,t)):schedule_get(this.node(),e).ease},end:function(){var a,r,o=this,s=o._id,c=o.size();return new Promise(function(t,e){var n={value:e},i={value:function(){0==--c&&t()}};o.each(function(){var t=schedule_set(this,s),e=t.on;e!==a&&((r=(a=e).copy())._.cancel.push(n),r._.interrupt.push(n),r._.end.push(i)),t.on=r})})}};(function custom(e){function polyIn(t){return Math.pow(t,e)}return e=+e,polyIn.exponent=custom,polyIn})(3),function custom(e){function polyOut(t){return 1-Math.pow(1-t,e)}return e=+e,polyOut.exponent=custom,polyOut}(3),function custom(e){function polyInOut(t){return((t*=2)<=1?Math.pow(t,e):2-Math.pow(2-t,e))/2}return e=+e,polyInOut.exponent=custom,polyInOut}(3),Math.PI;var Se=1.70158,Me=(function custom(e){function backIn(t){return t*t*((e+1)*t-e)}return e=+e,backIn.overshoot=custom,backIn}(Se),function custom(e){function backOut(t){return--t*t*((e+1)*t+e)+1}return e=+e,backOut.overshoot=custom,backOut}(Se),function custom(e){function backInOut(t){return((t*=2)<1?t*t*((e+1)*t-e):(t-=2)*t*((e+1)*t+e)+2)/2}return e=+e,backInOut.overshoot=custom,backInOut}(Se),2*Math.PI),Le=(function custom(e,n){var i=Math.asin(1/(e=Math.max(1,e)))*(n/=Me);function elasticIn(t){return e*Math.pow(2,10*--t)*Math.sin((i-t)/n)}return elasticIn.amplitude=function(t){return custom(t,n*Me)},elasticIn.period=function(t){return custom(e,t)},elasticIn}(1,.3),function custom(e,n){var i=Math.asin(1/(e=Math.max(1,e)))*(n/=Me);function elasticOut(t){return 1-e*Math.pow(2,-10*(t=+t))*Math.sin((t+i)/n)}return elasticOut.amplitude=function(t){return custom(t,n*Me)},elasticOut.period=function(t){return custom(e,t)},elasticOut}(1,.3),function custom(e,n){var i=Math.asin(1/(e=Math.max(1,e)))*(n/=Me);function elasticInOut(t){return((t=2*t-1)<0?e*Math.pow(2,10*t)*Math.sin((i-t)/n):2-e*Math.pow(2,-10*t)*Math.sin((i+t)/n))/2}return elasticInOut.amplitude=function(t){return custom(t,n*Me)},elasticInOut.period=function(t){return custom(e,t)},elasticInOut}(1,.3),{time:null,delay:0,duration:250,ease:function cubicInOut(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}});function transition_inherit(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))return Le.time=now(),Le;return n}ut.prototype.interrupt=function(t){return this.each(function(){Dt(this,t)})},ut.prototype.transition=function(t){var e,n;t=t instanceof Transition?(e=t._id,t._name):(e=newId(),(n=Le).time=now(),null==t?null:t+"");for(var i=this._groups,a=i.length,r=0;r<a;++r)for(var o,s=i[r],c=s.length,u=0;u<c;++u)(o=s[u])&&ae(o,t,e,u,s,n||transition_inherit(o,e));return new Transition(i,this._parents,t,e)};var De=Array.prototype.slice,Fe=function(t){return t},Re=1,Ee=2,ze=3,Xe=4,Ie=1e-6;function axis_translateX(t){return"translate("+(t+.5)+",0)"}function translateY(t){return"translate(0,"+(t+.5)+")"}function entering(){return!this.__axis}function axis_axis(p,_){var m=[],x=null,v=null,y=6,b=6,T=3,w=p===Re||p===Xe?-1:1,A=p===Xe||p===Ee?"x":"y",k=p===Re||p===ze?axis_translateX:translateY;function axis(t){var e=null==x?_.ticks?_.ticks.apply(_,m):_.domain():x,n=null==v?_.tickFormat?_.tickFormat.apply(_,m):Fe:v,i=Math.max(y,0)+T,a=_.range(),r=+a[0]+.5,o=+a[a.length-1]+.5,s=(_.bandwidth?function axis_center(e){var n=Math.max(0,e.bandwidth()-1)/2;return e.round()&&(n=Math.round(n)),function(t){return+e(t)+n}}:function axis_number(e){return function(t){return+e(t)}})(_.copy()),c=t.selection?t.selection():t,u=c.selectAll(".domain").data([null]),l=c.selectAll(".tick").data(e,_).order(),h=l.exit(),d=l.enter().append("g").attr("class","tick"),f=l.select("line"),g=l.select("text");u=u.merge(u.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),l=l.merge(d),f=f.merge(d.append("line").attr("stroke","currentColor").attr(A+"2",w*y)),g=g.merge(d.append("text").attr("fill","currentColor").attr(A,w*i).attr("dy",p===Re?"0em":p===ze?"0.71em":"0.32em")),t!==c&&(u=u.transition(t),l=l.transition(t),f=f.transition(t),g=g.transition(t),h=h.transition(t).attr("opacity",Ie).attr("transform",function(t){return isFinite(t=s(t))?k(t):this.getAttribute("transform")}),d.attr("opacity",Ie).attr("transform",function(t){var e=this.parentNode.__axis;return k(e&&isFinite(e=e(t))?e:s(t))})),h.remove(),u.attr("d",p===Xe||p==Ee?b?"M"+w*b+","+r+"H0.5V"+o+"H"+w*b:"M0.5,"+r+"V"+o:b?"M"+r+","+w*b+"V0.5H"+o+"V"+w*b:"M"+r+",0.5H"+o),l.attr("opacity",1).attr("transform",function(t){return k(s(t))}),f.attr(A+"2",w*y),g.attr(A,w*i).text(n),c.filter(entering).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",p===Ee?"start":p===Xe?"end":"middle"),c.each(function(){this.__axis=s})}return axis.scale=function(t){return arguments.length?(_=t,axis):_},axis.ticks=function(){return m=De.call(arguments),axis},axis.tickArguments=function(t){return arguments.length?(m=null==t?[]:De.call(t),axis):m.slice()},axis.tickValues=function(t){return arguments.length?(x=null==t?null:De.call(t),axis):x&&x.slice()},axis.tickFormat=function(t){return arguments.length?(v=t,axis):v},axis.tickSize=function(t){return arguments.length?(y=b=+t,axis):y},axis.tickSizeInner=function(t){return arguments.length?(y=+t,axis):y},axis.tickSizeOuter=function(t){return arguments.length?(b=+t,axis):b},axis.tickPadding=function(t){return arguments.length?(T=+t,axis):T},axis}function axisTop(t){return axis_axis(Re,t)}function axisRight(t){return axis_axis(Ee,t)}function axisBottom(t){return axis_axis(ze,t)}function axisLeft(t){return axis_axis(Xe,t)}var Oe={arc:"bb-arc",arcs:"bb-arcs",area:"bb-area",areas:"bb-areas",axis:"bb-axis",axisX:"bb-axis-x",axisXLabel:"bb-axis-x-label",axisY:"bb-axis-y",axisY2:"bb-axis-y2",axisY2Label:"bb-axis-y2-label",axisYLabel:"bb-axis-y-label",bar:"bb-bar",bars:"bb-bars",brush:"bb-brush",button:"bb-button",buttonZoomReset:"bb-zoom-reset",chart:"bb-chart",chartArc:"bb-chart-arc",chartArcs:"bb-chart-arcs",chartArcsBackground:"bb-chart-arcs-background",chartArcsGaugeMax:"bb-chart-arcs-gauge-max",chartArcsGaugeMin:"bb-chart-arcs-gauge-min",chartArcsGaugeUnit:"bb-chart-arcs-gauge-unit",chartArcsTitle:"bb-chart-arcs-title",chartArcsGaugeTitle:"bb-chart-arcs-gauge-title",chartBar:"bb-chart-bar",chartBars:"bb-chart-bars",chartLine:"bb-chart-line",chartLines:"bb-chart-lines",chartRadar:"bb-chart-radar",chartRadars:"bb-chart-radars",chartText:"bb-chart-text",chartTexts:"bb-chart-texts",circle:"bb-circle",circles:"bb-circles",colorPattern:"bb-color-pattern",colorScale:"bb-colorscale",defocused:"bb-defocused",dragarea:"bb-dragarea",empty:"bb-empty",eventRect:"bb-event-rect",eventRects:"bb-event-rects",eventRectsMultiple:"bb-event-rects-multiple",eventRectsSingle:"bb-event-rects-single",focused:"bb-focused",gaugeValue:"bb-gauge-value",grid:"bb-grid",gridLines:"bb-grid-lines",legendBackground:"bb-legend-background",legendItem:"bb-legend-item",legendItemEvent:"bb-legend-item-event",legendItemFocused:"bb-legend-item-focused",legendItemHidden:"bb-legend-item-hidden",legendItemPoint:"bb-legend-item-point",legendItemTile:"bb-legend-item-tile",level:"bb-level",levels:"bb-levels",line:"bb-line",lines:"bb-lines",region:"bb-region",regions:"bb-regions",selectedCircle:"bb-selected-circle",selectedCircles:"bb-selected-circles",shape:"bb-shape",shapes:"bb-shapes",stanfordElements:"bb-stanford-elements",stanfordLine:"bb-stanford-line",stanfordLines:"bb-stanford-lines",stanfordRegion:"bb-stanford-region",stanfordRegions:"bb-stanford-regions",target:"bb-target",text:"bb-text",texts:"bb-texts",title:"bb-title",tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name",xgrid:"bb-xgrid",xgridFocus:"bb-xgrid-focus",xgridLine:"bb-xgrid-line",xgridLines:"bb-xgrid-lines",xgrids:"bb-xgrids",ygrid:"bb-ygrid",ygridLine:"bb-ygrid-line",ygridLines:"bb-ygrid-lines",ygrids:"bb-ygrids",zoomBrush:"bb-zoom-brush",zoomRect:"bb-zoom-rect",EXPANDED:"_expanded_",SELECTED:"_selected_",INCLUDED:"_included_"},Pe=n(6),Ne=n.n(Pe),Ye=n(10),Be=n.n(Ye);function nopropagation(){st.stopImmediatePropagation()}var He=function(){st.preventDefault(),st.stopImmediatePropagation()},Ve=function(t){var e=t.document.documentElement,n=lt(t).on("dragstart.drag",He,!0);"onselectstart"in e?n.on("selectstart.drag",He,!0):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")};function yesdrag(t,e){var n=t.document.documentElement,i=lt(t).on("dragstart.drag",null);e&&(i.on("click.drag",He,!0),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function Hg(t){return function(){return t}}function DragEvent(t,e,n,i,a,r,o,s,c,u){this.target=t,this.type=e,this.subject=n,this.identifier=i,this.active=a,this.x=r,this.y=o,this.dx=s,this.dy=c,this._=u}function defaultFilter(){return!st.button}function defaultContainer(){return this.parentNode}function defaultSubject(t){return null==t?{x:st.x,y:st.y}:t}function defaultTouchable(){return"ontouchstart"in this}DragEvent.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function Ig(){var n,i,a,r,o=defaultFilter,s=defaultContainer,e=defaultSubject,c=defaultTouchable,f={},g=_t("start","drag","end"),p=0,u=0;function drag(t){t.on("mousedown.drag",mousedowned).filter(c).on("touchstart.drag",touchstarted).on("touchmove.drag",touchmoved).on("touchend.drag touchcancel.drag",touchended).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function mousedowned(){if(!r&&o.apply(this,arguments)){var t=beforestart("mouse",s.apply(this,arguments),dt,this,arguments);t&&(lt(st.view).on("mousemove.drag",mousemoved,!0).on("mouseup.drag",mouseupped,!0),Ve(st.view),nopropagation(),a=!1,n=st.clientX,i=st.clientY,t("start"))}}function mousemoved(){if(He(),!a){var t=st.clientX-n,e=st.clientY-i;a=u<t*t+e*e}f.mouse("drag")}function mouseupped(){lt(st.view).on("mousemove.drag mouseup.drag",null),yesdrag(st.view,a),He(),f.mouse("end")}function touchstarted(){if(o.apply(this,arguments)){var t,e,n=st.changedTouches,i=s.apply(this,arguments),a=n.length;for(t=0;t<a;++t)(e=beforestart(n[t].identifier,i,Cd,this,arguments))&&(nopropagation(),e("start"))}}function touchmoved(){var t,e,n=st.changedTouches,i=n.length;for(t=0;t<i;++t)(e=f[n[t].identifier])&&(He(),e("drag"))}function touchended(){var t,e,n=st.changedTouches,i=n.length;for(r&&clearTimeout(r),r=setTimeout(function(){r=null},500),t=0;t<i;++t)(e=f[n[t].identifier])&&(nopropagation(),e("end"))}function beforestart(i,a,r,o,s){var c,u,l,h=r(a,i),d=g.copy();if(customEvent(new DragEvent(drag,"beforestart",c,i,p,h[0],h[1],0,0,d),function(){return null!=(st.subject=c=e.apply(o,s))&&(u=c.x-h[0]||0,l=c.y-h[1]||0,!0)}))return function gesture(t){var e,n=h;switch(t){case"start":f[i]=gesture,e=p++;break;case"end":delete f[i],--p;case"drag":h=r(a,i),e=p}customEvent(new DragEvent(drag,t,c,i,e,h[0]+u,h[1]+l,h[0]-n[0],h[1]-n[1],d),d.apply,d,[t,o,s])}}return drag.filter=function(t){return arguments.length?(o="function"==typeof t?t:Hg(!!t),drag):o},drag.container=function(t){return arguments.length?(s="function"==typeof t?t:Hg(t),drag):s},drag.subject=function(t){return arguments.length?(e="function"==typeof t?t:Hg(t),drag):e},drag.touchable=function(t){return arguments.length?(c="function"==typeof t?t:Hg(!!t),drag):c},drag.on=function(){var t=g.on.apply(g,arguments);return t===g?drag:t},drag.clickDistance=function(t){return arguments.length?(u=(t=+t)*t,drag):Math.sqrt(u)},drag}var Ue=function(t){return function(){return t}},je=function(t,e,n){this.target=t,this.type=e,this.selection=n};function noevent_nopropagation(){st.stopImmediatePropagation()}var Ge=function(){st.preventDefault(),st.stopImmediatePropagation()},qe={name:"drag"},$e={name:"space"},Ze={name:"handle"},Ke={name:"center"},Qe={name:"x",handles:["e","w"].map(brush_type),input:function(t,e){return t&&[[t[0],e[0][1]],[t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},Je={name:"y",handles:["n","s"].map(brush_type),input:function(t,e){return t&&[[e[0][0],t[0]],[e[1][0],t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},tn=(["n","e","s","w","nw","ne","se","sw"].map(brush_type),{overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"}),en={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},nn={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},an={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},rn={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function brush_type(t){return{type:t}}function brush_defaultFilter(){return!st.button}function defaultExtent(){var t=this.ownerSVGElement||this;return[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function brush_local(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function brush_empty(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function brushSelection(t){var e=t.__brush;return e?e.dim.output(e.selection):null}function brush_brush(R){var E,e=defaultExtent,z=brush_defaultFilter,n=_t(brush,"start","brush","end"),i=6;function brush(t){var e=t.property("__brush",initialize).selectAll(".overlay").data([brush_type("overlay")]);e.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",tn.overlay).merge(e).each(function(){var t=brush_local(this).extent;lt(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])}),t.selectAll(".selection").data([brush_type("selection")]).enter().append("rect").attr("class","selection").attr("cursor",tn.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var n=t.selectAll(".handle").data(R.handles,function(t){return t.type});n.exit().remove(),n.enter().append("rect").attr("class",function(t){return"handle handle--"+t.type}).attr("cursor",function(t){return tn[t.type]}),t.each(redraw).attr("fill","none").attr("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush touchstart.brush",started)}function redraw(){var t=lt(this),e=brush_local(this).selection;e?(t.selectAll(".selection").style("display",null).attr("x",e[0][0]).attr("y",e[0][1]).attr("width",e[1][0]-e[0][0]).attr("height",e[1][1]-e[0][1]),t.selectAll(".handle").style("display",null).attr("x",function(t){return"e"===t.type[t.type.length-1]?e[1][0]-i/2:e[0][0]-i/2}).attr("y",function(t){return"s"===t.type[0]?e[1][1]-i/2:e[0][1]-i/2}).attr("width",function(t){return"n"===t.type||"s"===t.type?e[1][0]-e[0][0]+i:i}).attr("height",function(t){return"e"===t.type||"w"===t.type?e[1][1]-e[0][1]+i:i})):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function emitter(t,e){return t.__brush.emitter||new Emitter(t,e)}function Emitter(t,e){this.that=t,this.args=e,this.state=t.__brush,this.active=0}function started(){if(st.touches){if(st.changedTouches.length<st.touches.length)return Ge()}else if(E)return;if(z.apply(this,arguments)){var e,n,i,a,r,o,s,c,u,l,h,d,f,g=this,p=st.target.__data__.type,_="selection"===(st.metaKey?p="overlay":p)?qe:st.altKey?Ke:Ze,m=R===Je?null:an[p],x=R===Qe?null:rn[p],v=brush_local(g),t=v.extent,y=v.selection,b=t[0][0],T=t[0][1],w=t[1][0],A=t[1][1],k=m&&x&&st.shiftKey,C=dt(g),S=C,M=emitter(g,arguments).beforestart();"overlay"===p?v.selection=y=[[e=R===Je?b:C[0],i=R===Qe?T:C[1]],[r=R===Je?w:e,s=R===Qe?A:i]]:(e=y[0][0],i=y[0][1],r=y[1][0],s=y[1][1]),n=e,a=i,o=r,c=s;var L=lt(g).attr("pointer-events","none"),D=L.selectAll(".overlay").attr("cursor",tn[p]);if(st.touches)L.on("touchmove.brush",moved,!0).on("touchend.brush touchcancel.brush",ended,!0);else{var F=lt(st.view).on("keydown.brush",function keydowned(){switch(st.keyCode){case 16:k=m&&x;break;case 18:_===Ze&&(m&&(r=o-u*m,e=n+u*m),x&&(s=c-l*x,i=a+l*x),_=Ke,move());break;case 32:_!==Ze&&_!==Ke||(m<0?r=o-u:0<m&&(e=n-u),x<0?s=c-l:0<x&&(i=a-l),_=$e,D.attr("cursor",tn.selection),move());break;default:return}Ge()},!0).on("keyup.brush",function keyupped(){switch(st.keyCode){case 16:k&&(d=f=k=!1,move());break;case 18:_===Ke&&(m<0?r=o:0<m&&(e=n),x<0?s=c:0<x&&(i=a),_=Ze,move());break;case 32:_===$e&&(_=st.altKey?(m&&(r=o-u*m,e=n+u*m),x&&(s=c-l*x,i=a+l*x),Ke):(m<0?r=o:0<m&&(e=n),x<0?s=c:0<x&&(i=a),Ze),D.attr("cursor",tn[p]),move());break;default:return}Ge()},!0).on("mousemove.brush",moved,!0).on("mouseup.brush",ended,!0);Ve(st.view)}noevent_nopropagation(),Dt(g),redraw.call(g),M.start()}function moved(){var t=dt(g);!k||d||f||(Math.abs(t[0]-S[0])>Math.abs(t[1]-S[1])?f=!0:d=!0),S=t,h=!0,Ge(),move()}function move(){var t;switch(u=S[0]-C[0],l=S[1]-C[1],_){case $e:case qe:m&&(u=Math.max(b-e,Math.min(w-r,u)),n=e+u,o=r+u),x&&(l=Math.max(T-i,Math.min(A-s,l)),a=i+l,c=s+l);break;case Ze:m<0?(u=Math.max(b-e,Math.min(w-e,u)),n=e+u,o=r):0<m&&(u=Math.max(b-r,Math.min(w-r,u)),n=e,o=r+u),x<0?(l=Math.max(T-i,Math.min(A-i,l)),a=i+l,c=s):0<x&&(l=Math.max(T-s,Math.min(A-s,l)),a=i,c=s+l);break;case Ke:m&&(n=Math.max(b,Math.min(w,e-u*m)),o=Math.max(b,Math.min(w,r+u*m))),x&&(a=Math.max(T,Math.min(A,i-l*x)),c=Math.max(T,Math.min(A,s+l*x)))}o<n&&(m*=-1,t=e,e=r,r=t,t=n,n=o,o=t,p in en&&D.attr("cursor",tn[p=en[p]])),c<a&&(x*=-1,t=i,i=s,s=t,t=a,a=c,c=t,p in nn&&D.attr("cursor",tn[p=nn[p]])),v.selection&&(y=v.selection),d&&(n=y[0][0],o=y[1][0]),f&&(a=y[0][1],c=y[1][1]),y[0][0]===n&&y[0][1]===a&&y[1][0]===o&&y[1][1]===c||(v.selection=[[n,a],[o,c]],redraw.call(g),M.brush())}function ended(){if(noevent_nopropagation(),st.touches){if(st.touches.length)return;E&&clearTimeout(E),E=setTimeout(function(){E=null},500),L.on("touchmove.brush touchend.brush touchcancel.brush",null)}else yesdrag(st.view,h),F.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);L.attr("pointer-events","all"),D.attr("cursor",tn.overlay),v.selection&&(y=v.selection),brush_empty(y)&&(v.selection=null,redraw.call(g)),M.end()}}function initialize(){var t=this.__brush||{selection:null};return t.extent=e.apply(this,arguments),t.dim=R,t}return brush.move=function(t,o){t.selection?t.on("start.brush",function(){emitter(this,arguments).beforestart().start()}).on("interrupt.brush end.brush",function(){emitter(this,arguments).end()}).tween("brush",function(){var e=this,n=e.__brush,i=emitter(e,arguments),t=n.selection,a=R.input("function"==typeof o?o.apply(this,arguments):o,n.extent),r=me(t,a);function tween(t){n.selection=1===t&&brush_empty(a)?null:r(t),redraw.call(e),i.brush()}return t&&a?tween:tween(1)}):t.each(function(){var t=this,e=arguments,n=t.__brush,i=R.input("function"==typeof o?o.apply(t,e):o,n.extent),a=emitter(t,e).beforestart();Dt(t),n.selection=null==i||brush_empty(i)?null:i,redraw.call(t),a.start().brush().end()})},Emitter.prototype={beforestart:function(){return 1==++this.active&&((this.state.emitter=this).starting=!0),this},start:function(){return this.starting&&(this.starting=!1,this.emit("start")),this},brush:function(){return this.emit("brush"),this},end:function(){return 0==--this.active&&(delete this.state.emitter,this.emit("end")),this},emit:function(t){customEvent(new je(brush,t,R.output(this.state.selection)),n.apply,n,[t,this.that,this.args])}},brush.extent=function(t){return arguments.length?(e="function"==typeof t?t:Ue([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),brush):e},brush.filter=function(t){return arguments.length?(z="function"==typeof t?t:Ue(!!t),brush):z},brush.handleSize=function(t){return arguments.length?(i=+t,brush):i},brush.on=function(){var t=n.on.apply(n,arguments);return t===n?brush:t},brush}function $g(t){return t||0===t}function _g(t){return"function"==typeof t}function ah(t){return"string"==typeof t}function bh(t){return"number"==typeof t}function ch(t){return void 0===t}function dh(t){return void 0!==t}function eh(t){return"boolean"==typeof t}function fh(t){return 10*Math.ceil(t/10)}function gh(t){return Math.ceil(t)+.5}function hh(t){return t[1]-t[0]}function ih(t){return"object"===Be()(t)}function jh(t){return ch(t)||null===t||ah(t)&&0===t.length||ih(t)&&!(t instanceof Date)&&0===Object.keys(t).length||bh(t)&&isNaN(t)}function kh(t){return!jh(t)}function lh(t){return t&&t.constructor===Array}function mh(t){return t&&!t.nodeType&&ih(t)&&!lh(t)}function nh(t,e,n){return dh(t[e])?t[e]:n}function ph(t){for(var e=_g(t),n=arguments.length,i=Array(1<n?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return e&&t.call.apply(t,i),e}function qh(t){return ah(t)?t.replace(/</g,"&lt;").replace(/>/g,"&gt;"):t}function rh(n,t){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:[-1,1];if(n&&ah(t))if(-1===t.indexOf("\n"))n.text(t);else{var e=[n.text(),t].map(function(t){return t.replace(/[\s\n]/g,"")});if(e[0]!==e[1]){var a=t.split("\n");n.html(""),a.forEach(function(t,e){n.append("tspan").attr("x",0).attr("dy","".concat(0===e?i[0]:i[1],"em")).text(t)})}}}function sh(t){var e=t.getBBox(),n=e.x,i=e.y,a=e.width,r=e.height;return[{x:n,y:i+r},{x:n,y:i},{x:n+a,y:i},{x:n+a,y:i+r}]}function uh(t){var e=null,n=st,i=t.context||t.main;return n&&"BrushEvent"===n.constructor.name?e=n.selection:i&&(e=i.select(".".concat(Oe.brush)).node())&&(e=brushSelection(e)),e}function vh(){var t=!(0<arguments.length&&void 0!==arguments[0])||arguments[0];return Math.random()+(t?"":0)}function wh(t){var e=uh(t);return!e||e[0]===e[1]}function xh(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=1<arguments.length?arguments[1]:void 0;for(var n in e)t[n]=e[n];return t}function yh(t){return t.charAt(0).toUpperCase()+t.slice(1)}function zh(t){return[].slice.call(t)}function Ch(t){return t&&t.length?t.reduce(function(t,e){return t.concat(e)}):[]}function Eh(t){var e,n=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];return t[0]instanceof Date?e=n?function(t,e){return t-e}:function(t,e){return e-t}:n&&t.every(Number)?e=function(t,e){return t-e}:n||(e=function(t,e){return(e<t?-1:t<e&&1)||t===e&&0}),t.concat().sort(e)}function Fh(t,e){var n=e.filter(function(t){return kh(t)});return n.length?bh(n[0])?n=Math[t].apply(Math,Ne()(n)):n[0]instanceof Date&&(n=Eh(n,"min"===t)[0]):n=void 0,n}function Gh(t,e){for(var n=[],i=t;i<e;i++)n.push(i);return n}function Ih(t,e){var n=t;for(var i in e)n=n.replace(new RegExp("{=".concat(i,"}"),"g"),e[i]);return n}var on,sn=n(11),cn=(on=function(n){for(var t=arguments.length,e=Array(1<t?t-1:0),i=1;i<t;i++)e[i-1]=arguments[i];if(!e.length||1===e.length&&!e[0])return n;var a=e.shift();return mh(n)&&mh(a)&&Object.keys(a).forEach(function(t){var e=a[t];mh(e)?(n[t]||(n[t]={}),n[t]=cn(n[t],e)):n[t]=lh(e)?e.concat():e}),cn.apply(void 0,[n].concat(e))},mergeObj.toString=function(){return on.toString()},mergeObj),un={mouse:function(){try{return new MouseEvent("t"),function(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0};t.dispatchEvent(new MouseEvent(e,n))}}catch(t){return function(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0},i=sn.document.createEvent("MouseEvent");i.initMouseEvent(e,n.bubbles,n.cancelable,sn.window,0,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),t.dispatchEvent(i)}}}(),touch:function touch(t,e,n){var i=new Touch(Object.assign({identifier:Date.now(),target:t,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},n));t.dispatchEvent(new TouchEvent(e,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[i],targetTouches:[],changedTouches:[i]}))}};function mergeObj(){return on.apply(this,arguments)}var ln=function(t,e){return t<e?-1:e<t?1:e<=t?0:NaN},hn=function(r){return 1===r.length&&(r=function ascendingComparator(n){return function(t,e){return ln(n(t),e)}}(r)),{left:function(t,e,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n<i;){var a=n+i>>>1;r(t[a],e)<0?n=1+a:i=a}return n},right:function(t,e,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n<i;){var a=n+i>>>1;0<r(t[a],e)?i=a:n=1+a}return n}}};var dn=hn(ln),fn=dn.right,gn=(dn.left,fn);var pn=Array.prototype,_n=(pn.slice,pn.map,Math.sqrt(50)),mn=Math.sqrt(10),xn=Math.sqrt(2),vn=function(t,e,n){var i,a,r,o,s=-1;if(n=+n,(t=+t)===(e=+e)&&0<n)return[t];if((i=e<t)&&(a=t,t=e,e=a),0===(o=tickIncrement(t,e,n))||!isFinite(o))return[];if(0<o)for(t=Math.ceil(t/o),e=Math.floor(e/o),r=new Array(a=Math.ceil(e-t+1));++s<a;)r[s]=(t+s)*o;else for(t=Math.floor(t*o),e=Math.ceil(e*o),r=new Array(a=Math.ceil(t-e+1));++s<a;)r[s]=(t-s)/o;return i&&r.reverse(),r};function tickIncrement(t,e,n){var i=(e-t)/Math.max(0,n),a=Math.floor(Math.log(i)/Math.LN10),r=i/Math.pow(10,a);return 0<=a?(_n<=r?10:mn<=r?5:xn<=r?2:1)*Math.pow(10,a):-Math.pow(10,-a)/(_n<=r?10:mn<=r?5:xn<=r?2:1)}function tickStep(t,e,n){var i=Math.abs(e-t)/Math.max(0,n),a=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),r=i/a;return _n<=r?a*=10:mn<=r?a*=5:xn<=r&&(a*=2),e<t?-a:a}function initRange(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}var yn="$";function Map(){}function map_map(t,e){var n=new Map;if(t instanceof Map)t.each(function(t,e){n.set(e,t)});else if(Array.isArray(t)){var i,a=-1,r=t.length;if(null==e)for(;++a<r;)n.set(a,t[a]);else for(;++a<r;)n.set(e(i=t[a],a,t),i)}else if(t)for(var o in t)n.set(o,t[o]);return n}Map.prototype=map_map.prototype={constructor:Map,has:function(t){return yn+t in this},get:function(t){return this[yn+t]},set:function(t,e){return this[yn+t]=e,this},remove:function(t){var e=yn+t;return e in this&&delete this[e]},clear:function(){for(var t in this)t[0]===yn&&delete this[t]},keys:function(){var t=[];for(var e in this)e[0]===yn&&t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)e[0]===yn&&t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)e[0]===yn&&t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)e[0]===yn&&++t;return t},empty:function(){for(var t in this)if(t[0]===yn)return!1;return!0},each:function(t){for(var e in this)e[0]===yn&&t(this[e],e.slice(1),this)}};var bn=map_map;function Set(){}var Tn=bn.prototype;Set.prototype={constructor:Set,has:Tn.has,add:function(t){return this[yn+(t+="")]=t,this},remove:Tn.remove,clear:Tn.clear,values:Tn.keys,size:Tn.size,empty:Tn.empty,each:Tn.each};var wn=Array.prototype,An=wn.map,kn=wn.slice,Cn={name:"implicit"};function ordinal(){var r=bn(),o=[],i=[],a=Cn;function scale(t){var e=t+"",n=r.get(e);if(!n){if(a!==Cn)return a;r.set(e,n=o.push(t))}return i[(n-1)%i.length]}return scale.domain=function(t){if(!arguments.length)return o.slice();o=[],r=bn();for(var e,n,i=-1,a=t.length;++i<a;)r.has(n=(e=t[i])+"")||r.set(n,o.push(e));return scale},scale.range=function(t){return arguments.length?(i=kn.call(t),scale):i.slice()},scale.unknown=function(t){return arguments.length?(a=t,scale):a},scale.copy=function(){return ordinal(o,i).unknown(a)},initRange.apply(scale,arguments),scale}var Sn=function(t){return function(){return t}},Mn=function(t){return+t},Ln=[0,1];function continuous_identity(t){return t}function normalize(e,n){return(n-=e=+e)?function(t){return(t-e)/n}:Sn(isNaN(n)?NaN:.5)}function clamper(t){var e,n=t[0],i=t[t.length-1];return i<n&&(e=n,n=i,i=e),function(t){return Math.max(n,Math.min(i,t))}}function bimap(t,e,n){var i=t[0],a=t[1],r=e[0],o=e[1];return r=a<i?(i=normalize(a,i),n(o,r)):(i=normalize(i,a),n(r,o)),function(t){return r(i(t))}}function polymap(n,t,e){var i=Math.min(n.length,t.length)-1,a=new Array(i),r=new Array(i),o=-1;for(n[i]<n[0]&&(n=n.slice().reverse(),t=t.slice().reverse());++o<i;)a[o]=normalize(n[o],n[o+1]),r[o]=e(t[o],t[o+1]);return function(t){var e=gn(n,t,1,i)-1;return r[e](a[e](t))}}function copy(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function transformer(){var n,i,e,a,r,o,s=Ln,c=Ln,u=me,l=continuous_identity;function rescale(){return a=2<Math.min(s.length,c.length)?polymap:bimap,r=o=null,scale}function scale(t){return isNaN(t=+t)?e:(r=r||a(s.map(n),c,u))(n(l(t)))}return scale.invert=function(t){return l(i((o=o||a(c,s.map(n),ue))(t)))},scale.domain=function(t){return arguments.length?(s=An.call(t,Mn),l===continuous_identity||(l=clamper(s)),rescale()):s.slice()},scale.range=function(t){return arguments.length?(c=kn.call(t),rescale()):c.slice()},scale.rangeRound=function(t){return c=kn.call(t),u=xe,rescale()},scale.clamp=function(t){return arguments.length?(l=t?clamper(s):continuous_identity,scale):l!==continuous_identity},scale.interpolate=function(t){return arguments.length?(u=t,rescale()):u},scale.unknown=function(t){return arguments.length?(e=t,scale):e},function(t,e){return n=t,i=e,rescale()}}function continuous(t,e){return transformer()(t,e)}function Ji(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[1<i.length?i[0]+i.slice(2):i,+t.slice(n+1)]}function Ki(t){return(t=Ji(Math.abs(t)))?t[1]:NaN}var Dn=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function formatSpecifier(t){return new FormatSpecifier(t)}function FormatSpecifier(t){if(!(e=Dn.exec(t)))throw new Error("invalid format: "+t);var e;this.fill=e[1]||" ",this.align=e[2]||">",this.sign=e[3]||"-",this.symbol=e[4]||"",this.zero=!!e[5],this.width=e[6]&&+e[6],this.comma=!!e[7],this.precision=e[8]&&+e[8].slice(1),this.trim=!!e[9],this.type=e[10]||""}formatSpecifier.prototype=FormatSpecifier.prototype,FormatSpecifier.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};function Ri(t,e){var n=Ji(t,e);if(!n)return t+"";var i=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+new Array(a-i.length+2).join("0")}function Ti(t){return t}function Vi(t){var T=t.grouping&&t.thousands?function(s,c){return function(t,e){for(var n=t.length,i=[],a=0,r=s[0],o=0;0<n&&0<r&&(e<o+r+1&&(r=Math.max(1,e-o)),i.push(t.substring(n-=r,n+r)),!((o+=r+1)>e));)r=s[a=(a+1)%s.length];return i.reverse().join(c)}}(t.grouping,t.thousands):Ti,n=t.currency,w=t.decimal,A=t.numerals?function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}(t.numerals):Ti,i=t.percent||"%";function newFormat(t){var u=(t=formatSpecifier(t)).fill,l=t.align,h=t.sign,e=t.symbol,d=t.zero,f=t.width,g=t.comma,p=t.precision,_=t.trim,m=t.type;"n"===m?(g=!0,m="g"):Xn[m]||(null==p&&(p=12),_=!0,m="g"),(d||"0"===u&&"="===l)&&(d=!0,u="0",l="=");var x="$"===e?n[0]:"#"===e&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",v="$"===e?n[1]:/[%p]/.test(m)?i:"",y=Xn[m],b=/[defgprs%]/.test(m);function format(t){var e,n,i,a=x,r=v;if("c"===m)r=y(t)+r,t="";else{var o=(t=+t)<0;if(t=y(Math.abs(t),p),_&&(t=function(t){t:for(var e,n=t.length,i=1,a=-1;i<n;++i)switch(t[i]){case".":a=e=i;break;case"0":0===a&&(a=i),e=i;break;default:if(0<a){if(!+t[i])break t;a=0}}return 0<a?t.slice(0,a)+t.slice(e+1):t}(t)),o&&0==+t&&(o=!1),a=(o?"("===h?h:"-":"-"===h||"("===h?"":h)+a,r=("s"===m?In[8+Fn/3]:"")+r+(o&&"("===h?")":""),b)for(e=-1,n=t.length;++e<n;)if((i=t.charCodeAt(e))<48||57<i){r=(46===i?w+t.slice(e+1):t.slice(e))+r,t=t.slice(0,e);break}}g&&!d&&(t=T(t,1/0));var s=a.length+t.length+r.length,c=s<f?new Array(f-s+1).join(u):"";switch(g&&d&&(t=T(c+t,c.length?f-r.length:1/0),c=""),l){case"<":t=a+t+r+c;break;case"=":t=a+c+t+r;break;case"^":t=c.slice(0,s=c.length>>1)+a+t+r+c.slice(s);break;default:t=c+a+t+r}return A(t)}return p=null==p?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,p)):Math.max(0,Math.min(20,p)),format.toString=function(){return t+""},format}return{format:newFormat,formatPrefix:function formatPrefix(t,e){var n=newFormat(((t=formatSpecifier(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(Ki(e)/3))),a=Math.pow(10,-i),r=In[8+i/3];return function(t){return n(a*t)+r}}}}var Fn,Rn,En,zn,Xn={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return Ri(100*t,e)},r:Ri,s:function(t,e){var n=Ji(t,e);if(!n)return t+"";var i=n[0],a=n[1],r=a-(Fn=3*Math.max(-8,Math.min(8,Math.floor(a/3))))+1,o=i.length;return r===o?i:o<r?i+new Array(r-o+1).join("0"):0<r?i.slice(0,r)+"."+i.slice(r):"0."+new Array(1-r).join("0")+Ji(t,Math.max(0,e+r-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},In=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];!function defaultLocale_defaultLocale(t){return Rn=Vi(t),En=Rn.format,zn=Rn.formatPrefix,Rn}({decimal:".",thousands:",",grouping:[3],currency:["$",""]});var On=function(t,e,n,i){var a,r=tickStep(t,e,n);switch((i=formatSpecifier(null==i?",f":i)).type){case"s":var o=Math.max(Math.abs(t),Math.abs(e));return null!=i.precision||isNaN(a=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Ki(e)/3)))-Ki(Math.abs(t)))}(r,o))||(i.precision=a),zn(i,o);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(a=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Ki(e)-Ki(t))+1}(r,Math.max(Math.abs(t),Math.abs(e))))||(i.precision=a-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(a=function(t){return Math.max(0,-Ki(Math.abs(t)))}(r))||(i.precision=a-2*("%"===i.type))}return En(i)};function linearish(s){var c=s.domain;return s.ticks=function(t){var e=c();return vn(e[0],e[e.length-1],null==t?10:t)},s.tickFormat=function(t,e){var n=c();return On(n[0],n[n.length-1],null==t?10:t,e)},s.nice=function(t){null==t&&(t=10);var e,n=c(),i=0,a=n.length-1,r=n[i],o=n[a];return o<r&&(e=r,r=o,o=e,e=i,i=a,a=e),0<(e=tickIncrement(r,o,t))?e=tickIncrement(r=Math.floor(r/e)*e,o=Math.ceil(o/e)*e,t):e<0&&(e=tickIncrement(r=Math.ceil(r*e)/e,o=Math.floor(o*e)/e,t)),0<e?(n[i]=Math.floor(r/e)*e,n[a]=Math.ceil(o/e)*e,c(n)):e<0&&(n[i]=Math.ceil(r*e)/e,n[a]=Math.floor(o*e)/e,c(n)),s},s}function src_linear_linear(){var t=continuous(continuous_identity,continuous_identity);return t.copy=function(){return copy(t,src_linear_linear())},initRange.apply(t,arguments),linearish(t)}var Pn=function(t,e){var n,i=0,a=(t=t.slice()).length-1,r=t[i],o=t[a];return o<r&&(n=i,i=a,a=n,n=r,r=o,o=n),t[i]=e.floor(r),t[a]=e.ceil(o),t};var Nn=1e3,Yn=60*Nn,Bn=60*Yn,Hn=24*Bn,Vn=7*Hn,Un=30*Hn,Wn=365*Hn;function time_date(t){return new Date(t)}function time_number(t){return t instanceof Date?+t:+new Date(+t)}function calendar(o,e,n,i,a,r,s,c,u){var l=continuous(continuous_identity,continuous_identity),h=l.invert,d=l.domain,f=u(".%L"),g=u(":%S"),p=u("%I:%M"),_=u("%I %p"),m=u("%a %d"),x=u("%b %d"),v=u("%B"),y=u("%Y"),b=[[s,1,Nn],[s,5,5*Nn],[s,15,15*Nn],[s,30,30*Nn],[r,1,Yn],[r,5,5*Yn],[r,15,15*Yn],[r,30,30*Yn],[a,1,Bn],[a,3,3*Bn],[a,6,6*Bn],[a,12,12*Bn],[i,1,Hn],[i,2,2*Hn],[n,1,Vn],[e,1,Un],[e,3,3*Un],[o,1,Wn]];function tickFormat(t){return(s(t)<t?f:r(t)<t?g:a(t)<t?p:i(t)<t?_:e(t)<t?n(t)<t?m:x:o(t)<t?v:y)(t)}function tickInterval(t,e,n,i){if(null==t&&(t=10),"number"==typeof t){var a=Math.abs(n-e)/t,r=hn(function(t){return t[2]}).right(b,a);t=r===b.length?(i=tickStep(e/Wn,n/Wn,t),o):r?(i=(r=b[a/b[r-1][2]<b[r][2]/a?r-1:r])[1],r[0]):(i=Math.max(tickStep(e,n,t),1),c)}return null==i?t:t.every(i)}return l.invert=function(t){return new Date(h(t))},l.domain=function(t){return arguments.length?d(An.call(t,time_number)):d().map(time_date)},l.ticks=function(t,e){var n,i=d(),a=i[0],r=i[i.length-1],o=r<a;return o&&(n=a,a=r,r=n),n=(n=tickInterval(t,a,r,e))?n.range(a,r+1):[],o?n.reverse():n},l.tickFormat=function(t,e){return null==e?tickFormat:u(e)},l.nice=function(t,e){var n=d();return(t=tickInterval(t,n[0],n[n.length-1],e))?d(Pn(n,t)):l},l.copy=function(){return copy(l,calendar(o,e,n,i,a,r,s,c,u))},l}function nj(t,e){var n=t.config.axis_rotated;return e?n:!n}function oj(t){return"".concat(Oe.axis," ").concat(Oe["axis".concat(yh(t))])}function rj(t){a()(this,rj);var e=new $n(this);this.plugins=[],(this.internal=e).loadConfig(t),e.beforeInit(t),e.init(),this.$=e.getChartElements(),e.afterInit(t),function bindThis(e,n,i){Object.keys(e).forEach(function(t){n[t]=e[t].bind(i),Object.keys(e[t]).length&&bindThis(e[t],n[t],i)})}(rj.prototype,this,this)}function sj(){return a()(this,sj),{bindto:"#chart",clipPath:!0,svg_classname:void 0,size_width:void 0,size_height:void 0,padding_left:void 0,padding_right:void 0,padding_top:void 0,padding_bottom:void 0,resize_auto:!0,zoom_enabled:void 0,zoom_extent:void 0,zoom_privileged:!1,zoom_rescale:!1,zoom_onzoom:void 0,zoom_onzoomstart:void 0,zoom_onzoomend:void 0,zoom_resetButton:!0,zoom_x_min:void 0,zoom_x_max:void 0,interaction_enabled:!0,interaction_brighten:!0,interaction_inputType_mouse:!0,interaction_inputType_touch:{},onover:function onover(){},onout:function onout(){},onresize:function onresize(){},onresized:function onresized(){},onbeforeinit:void 0,oninit:function oninit(){},onafterinit:void 0,onrendered:void 0,transition_duration:350,data_x:void 0,data_xs:{},data_xFormat:"%Y-%m-%d",data_xLocaltime:!0,data_xSort:!0,data_idConverter:function data_idConverter(t){return t},data_names:{},data_classes:{},data_groups:[],data_axes:{},data_type:void 0,data_types:{},data_labels:{},data_labels_colors:void 0,data_labels_position:{},data_order:"desc",data_regions:{},data_color:void 0,data_colors:{},data_hide:!1,data_filter:void 0,data_stack_normalize:!1,data_selection_enabled:!1,data_selection_grouped:!1,data_selection_isselectable:function data_selection_isselectable(){return!0},data_selection_multiple:!0,data_selection_draggable:!1,data_onclick:function data_onclick(){},data_onover:function data_onover(){},data_onout:function data_onout(){},data_onselected:function data_onselected(){},data_onunselected:function data_onunselected(){},data_onmin:void 0,data_onmax:void 0,data_url:void 0,data_headers:void 0,data_json:void 0,data_rows:void 0,data_columns:void 0,data_mimeType:void 0,data_keys:void 0,data_empty_label_text:"",subchart_show:!1,subchart_size_height:60,subchart_axis_x_show:!0,subchart_axis_x_tick_show:!0,subchart_axis_x_tick_text_show:!0,subchart_onbrush:function subchart_onbrush(){},color_pattern:[],color_tiles:void 0,color_threshold:{},color_onover:void 0,legend_show:!0,legend_hide:!1,legend_contents_bindto:void 0,legend_contents_template:void 0,legend_position:"bottom",legend_inset_anchor:"top-left",legend_inset_x:10,legend_inset_y:0,legend_inset_step:void 0,legend_item_onclick:void 0,legend_item_onover:void 0,legend_item_onout:void 0,legend_equally:!1,legend_padding:0,legend_item_tile_width:10,legend_item_tile_height:10,legend_usePoint:!1,axis_rotated:!1,axis_x_clipPath:!0,axis_x_show:!0,axis_x_type:"indexed",axis_x_localtime:!0,axis_x_categories:[],axis_x_tick_centered:!1,axis_x_tick_format:void 0,axis_x_tick_culling:{},axis_x_tick_culling_max:10,axis_x_tick_count:void 0,axis_x_tick_show:!0,axis_x_tick_text_show:!0,axis_x_tick_text_position:{x:0,y:0},axis_x_tick_fit:!0,axis_x_tick_values:null,axis_x_tick_rotate:0,axis_x_tick_outer:!0,axis_x_tick_multiline:!0,axis_x_tick_width:null,axis_x_tick_tooltip:!1,axis_x_max:void 0,axis_x_min:void 0,axis_x_padding:{},axis_x_height:void 0,axis_x_extent:void 0,axis_x_label:{},axis_x_axes:[],axis_y_clipPath:!0,axis_y_show:!0,axis_y_type:void 0,axis_y_max:void 0,axis_y_min:void 0,axis_y_inverted:!1,axis_y_center:void 0,axis_y_inner:!1,axis_y_label:{},axis_y_tick_format:void 0,axis_y_tick_outer:!0,axis_y_tick_values:null,axis_y_tick_rotate:0,axis_y_tick_count:void 0,axis_y_tick_show:!0,axis_y_tick_text_show:!0,axis_y_tick_text_position:{x:0,y:0},axis_y_tick_time_value:void 0,axis_y_padding:{},axis_y_default:void 0,axis_y_axes:[],axis_y2_show:!1,axis_y2_max:void 0,axis_y2_min:void 0,axis_y2_inverted:!1,axis_y2_center:void 0,axis_y2_inner:!1,axis_y2_label:{},axis_y2_tick_format:void 0,axis_y2_tick_outer:!0,axis_y2_tick_values:null,axis_y2_tick_count:void 0,axis_y2_tick_show:!0,axis_y2_tick_text_show:!0,axis_y2_tick_text_position:{x:0,y:0},axis_y2_padding:{},axis_y2_default:void 0,axis_y2_axes:[],grid_x_show:!1,grid_x_type:"tick",grid_x_lines:[],grid_y_show:!1,grid_y_lines:[],grid_y_ticks:10,grid_focus_show:!0,grid_front:!1,grid_lines_front:!0,point_show:!0,point_r:2.5,point_sensitivity:10,point_focus_expand_enabled:!0,point_focus_expand_r:void 0,point_pattern:[],point_select_r:void 0,point_type:"circle",line_connectNull:!1,line_step_type:"step",line_classes:void 0,line_point:!0,bar_padding:0,bar_radius:void 0,bar_radius_ratio:void 0,bar_sensitivity:2,bar_width:void 0,bar_width_ratio:.6,bar_width_max:void 0,bar_zerobased:!0,bubble_maxR:35,area_zerobased:!0,area_above:!1,area_linearGradient:!1,pie_label_show:!0,pie_label_format:void 0,pie_label_threshold:.05,pie_label_ratio:void 0,pie_expand:{},pie_expand_duration:50,pie_innerRadius:0,pie_padAngle:0,pie_padding:0,plugins:[],gauge_fullCircle:!1,gauge_label_show:!0,gauge_label_format:void 0,gauge_min:0,gauge_max:100,gauge_startingAngle:-1*Math.PI/2,gauge_label_extents:void 0,gauge_title:"",gauge_units:void 0,gauge_width:void 0,gauge_expand:{},gauge_expand_duration:50,donut_label_show:!0,donut_label_format:void 0,donut_label_threshold:.05,donut_label_ratio:void 0,donut_width:void 0,donut_title:"",donut_expand:{},donut_expand_duration:50,donut_padAngle:0,spline_interpolation_type:"cardinal",radar_axis_max:void 0,radar_axis_line_show:!0,radar_axis_text_show:!0,radar_level_depth:3,radar_level_show:!0,radar_level_text_format:function radar_level_text_format(t){return t%1==0?t:t.toFixed(2)},radar_level_text_show:!0,radar_size_ratio:.87,radar_direction_clockwise:!1,regions:[],tooltip_show:!0,tooltip_doNotHide:!1,tooltip_grouped:!0,tooltip_format_title:void 0,tooltip_format_name:void 0,tooltip_format_value:void 0,tooltip_position:void 0,tooltip_contents:{},tooltip_init_show:!1,tooltip_init_x:0,tooltip_init_position:{top:"0px",left:"50px"},tooltip_linked:!1,tooltip_linked_name:"",tooltip_onshow:function tooltip_onshow(){},tooltip_onhide:function tooltip_onhide(){},tooltip_onshown:function tooltip_onshown(){},tooltip_onhidden:function tooltip_onhidden(){},tooltip_order:null,title_text:void 0,title_padding:{top:0,right:0,bottom:0,left:0},title_position:"center"}}var jn=function(){function AxisRendererHelper(t,e){a()(this,AxisRendererHelper);var n=src_linear_linear();this.config=t,this.scale=n,!t.noTransition&&e.config.transition_duration||(t.withoutTransition=!0),t.range=n.rangeExtent?n.rangeExtent():this.scaleExtent((e.orgXScale||n).range())}return s()(AxisRendererHelper,[{key:"axisX",value:function axisX(t,e){var n=this;t.attr("transform",function(t){return"translate(".concat(Math.ceil(e(t)+n.config.tickOffset),",0)")})}},{key:"axisY",value:function axisY(t,e){t.attr("transform",function(t){return"translate(0,".concat(Math.ceil(e(t)),")")})}},{key:"scaleExtent",value:function scaleExtent(t){var e=t[0],n=t[t.length-1];return e<n?[e,n]:[n,e]}},{key:"generateTicks",value:function generateTicks(t){var e=[];if(t.ticks)return t.ticks.apply(t,Ne()(this.config.tickArguments||[])).map(function(t){return ah(t)&&bh(t)&&!isNaN(t)&&Math.round(10*t)/10||t});for(var n=t.domain(),i=Math.ceil(n[0]);i<n[1];i++)e.push(i);return 0<e.length&&0<e[0]&&e.unshift(e[0]-(e[1]-e[0])),e}},{key:"copyScale",value:function copyScale(){var t=this.scale.copy();return t.domain().length||t.domain(this.scale.domain()),t}},{key:"textFormatted",value:function textFormatted(t){var e=this.config.tickFormat,n=/\d+\.\d+0{5,}\d$/.test(t)?+(t+"").replace(/0+\d$/,""):t,i=e?e(n):n;return dh(i)?i:""}},{key:"transitionise",value:function transitionise(t){var e=this.config;return e.withoutTransition?t.interrupt():t.transition(e.transition)}}],[{key:"getSizeFor1Char",value:function getSizeFor1Char(t){var a={w:5.5,h:11.5};return t.empty()||t.select("text").text("0").call(function(t){try{var e=t.node().getBBox(),n=e.width,i=e.height;n&&i&&(a.w=n,a.h=i),t.text("")}catch(t){}}),this.getSizeFor1Char=function(){return a},a}}]),AxisRendererHelper}(),Gn=function(){function AxisRenderer(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};a()(this,AxisRenderer);var e={innerTickSize:6,outerTickSize:t.outerTick?6:0,orient:"bottom",range:[],tickArguments:null,tickCentered:null,tickCulling:!0,tickFormat:null,tickLength:9,tickOffset:0,tickPadding:3,tickValues:null,transition:null,noTransition:t.noTransition};e.tickLength=Math.max(e.innerTickSize,0)+e.tickPadding,this.helper=new jn(e,t),this.config=e,this.params=t}return s()(AxisRenderer,[{key:"create",value:function create(t){var _=this,m=this.config,x=this.params,v=this.helper,y=v.scale,b=m.orient,T=this.splitTickText.bind(this),w=/^(left|right)$/.test(b),A=/^(top|bottom)$/.test(b),k=v[A?"axisX":"axisY"],C=k===v.axisX?"y":"x",S=/^(top|left)$/.test(b)?-1:1,M=x.tickTextRotate;this.config.range=y.rangeExtent?y.rangeExtent():v.scaleExtent((x.orgXScale||y).range());var e=m,L=e.innerTickSize,D=e.tickLength,F=e.range,n=x.name,R=n&&/^(x|y|y2)$/.test(n)?x.config["axis_".concat(n,"_tick_text_position")]:{x:0,y:0},i="subX"===n?"subchart_axis_x":"axis_".concat(n),a=x.config["".concat(i,"_show")],E=!!a&&x.config["".concat(i,"_tick_show")],z=!!a&&x.config["".concat(i,"_tick_text_show")],X=null;t.each(function(){var t=lt(this),e=this.__chart__||y,i=v.copyScale();X=t,this.__chart__=i,m.tickOffset=x.isCategory?Math.ceil((i(1)-i(0))/2):0;var n,a=t.selectAll(".domain").data([0]);if(a.enter().append("path").attr("class","domain").merge(v.transitionise(a)).attr("d",function(){var t=m.outerTickSize*S;return A?"M".concat(F[0],",").concat(t,"V0H").concat(F[1],"V").concat(t):"M".concat(t,",").concat(F[0],"H0V").concat(F[1],"H").concat(t)}),E||z){var r=m.tickValues||v.generateTicks(i),o=t.selectAll(".tick").data(r,i),s=o.enter().insert("g",".domain").attr("class","tick").style("opacity","1"),c=o.exit().remove();o=s.merge(o),E&&s.append("line"),z&&s.append("text");var u=jn.getSizeFor1Char(o),l=[],h=o.select("text").selectAll("tspan").data(function(t,e){var n=x.tickMultiline?T(t,i,r,w,u.w):lh(v.textFormatted(t))?v.textFormatted(t).concat():[v.textFormatted(t)];return l[e]=n.length,n.map(function(t){return{index:e,splitted:t}})});h.exit().remove(),(h=h.enter().append("tspan").merge(h).text(function(t){return t.splitted})).attr("x",A?0:D*S).attr("dx",(n=0,"bottom"===b&&M&&(n=8*Math.sin(Math.PI*(M/180))),n+(R.x||0))).attr("dy",function(t,e){var n=0;return"top"!==b&&(n=u.h,0===e&&(n=w?-((l[t.index]-1)*(u.h/2)-3):0===R.y?".71em":0)),bh(n)&&R.y?n+R.y:n||".71em"});var d=o.select("line"),f=o.select("text");if(s.select("line").attr("".concat(C,"2"),L*S),s.select("text").attr("".concat(C),D*S),_.setTickLineTextPosition(d,f),x.tickTitle&&f.append&&f.append("title").each(function(t){lt(this).text(x.tickTitle[t])}),i.bandwidth){var g=i,p=g.bandwidth()/2;i=e=function(t){return g(t)+p}}else e.bandwidth?e=i:k.call(v,c,i);k.call(v,s,e),k.call(v,v.transitionise(o).style("opacity","1"),i)}}),this.g=X}},{key:"getTickXY",value:function getTickXY(){var t=this.config,e={x:0,y:0};return this.params.isCategory&&(e.x=t.tickCentered?0:t.tickOffset,e.y=t.tickCentered?t.tickOffset:0),e}},{key:"getTickSize",value:function getTickSize(t){var e=this.helper.scale,n=this.config,i=n.innerTickSize,a=n.range,r=e(t)+(n.tickCentered?0:n.tickOffset);return a[0]<r&&r<a[1]?i:0}},{key:"setTickLineTextPosition",value:function setTickLineTextPosition(t,e){var n=this.getTickXY(),i=this.config,a=i.innerTickSize,r=i.orient,o=i.tickLength,s=i.tickOffset,c=this.params.tickTextRotate;"bottom"===r?(t.attr("x1",n.x).attr("x2",n.x).attr("y2",this.getTickSize.bind(this)),e.attr("x",0).attr("y",function yForText(t){return t?11.5-t/15*2.5*(0<t?1:-1):o}(c)).style("text-anchor",function textAnchorForText(t){return t?0<t?"start":"end":"middle"}(c)).attr("transform",function textTransform(t){return t?"rotate(".concat(t,")"):null}(c))):"top"===r?(t.attr("x2",0).attr("y2",-a),e.attr("x",0).attr("y",2*-o).style("text-anchor","middle")):"left"===r?(t.attr("x2",-a).attr("y1",n.y).attr("y2",n.y),e.attr("x",-o).attr("y",s).style("text-anchor","end")):"right"===r&&(t.attr("x2",a).attr("y2",0),e.attr("x",o).attr("y",0).style("text-anchor","start"))}},{key:"splitTickText",value:function splitTickText(t,e,n,i,o){var a=this.params,r=this.helper.textFormatted(t),s=ah(r)&&-1<r.indexOf("\n")?r.split("\n"):[];if(s.length)return s;if(lh(r))return r;var c=a.tickWidth;return(!c||c<=0)&&(c=i?95:a.isCategory?Math.ceil(e(n[1])-e(n[0]))-12:110),function split(t,e){for(var n,i,a,r=1;r<e.length;r++)if(" "===e.charAt(r)&&(i=r),n=e.substr(0,r+1),a=o*n.length,c<a)return split(t.concat(e.substr(0,i||r)),e.slice(i?i+1:r));return t.concat(e)}(s,r+"")}},{key:"scale",value:function scale(t){return arguments.length?(this.helper.scale=t,this):this.helper.scale}},{key:"orient",value:function orient(t){return arguments.length?(this.config.orient=t in{top:1,right:1,bottom:1,left:1}?t+"":"bottom",this):this.config.orient}},{key:"tickFormat",value:function tickFormat(t){return arguments.length?(this.config.tickFormat=t,this):this.config.tickFormat}},{key:"tickCentered",value:function tickCentered(t){var e=this.config;return arguments.length?(e.tickCentered=t,this):e.tickCentered}},{key:"tickOffset",value:function tickOffset(){return this.config.tickOffset}},{key:"tickInterval",value:function tickInterval(t){var e;this.params.isCategory?e=2*this.config.tickOffset:e=(this.g.select("path.domain").node().getTotalLength()-2*this.config.outerTickSize)/(t||this.g.selectAll("line").size());return e===1/0?0:e}},{key:"ticks",value:function ticks(){for(var t=this.config,e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];return n.length?(t.tickArguments=zh(n),this):t.tickArguments}},{key:"tickCulling",value:function tickCulling(t){var e=this.config;return arguments.length?(e.tickCulling=t,this):e.tickCulling}},{key:"tickValues",value:function tickValues(t){var e=this,n=this.config;if(_g(t))n.tickValues=function(){return t(e.helper.scale.domain())};else{if(!arguments.length)return n.tickValues;n.tickValues=t}return this}},{key:"setTransition",value:function setTransition(t){return this.config.transition=t,this}}]),AxisRenderer}(),qn=function(){function Axis(t){a()(this,Axis),this.owner=t,this.setOrient()}return s()(Axis,[{key:"init",value:function init(){var i=this,a=this.owner,r=a.config,o=r.axis_rotated,s=a.main,t=["x","y"];r.axis_y2_show&&t.push("y2"),a.axesList={},t.forEach(function(e){var t=oj(e),n=Oe["axis".concat(yh(e),"Label")];a.axes[e]=s.append("g").attr("class",t).attr("clip-path",function(){var t=null;return"x"===e?t=a.clipPathForXAxis:"y"===e&&r.axis_y_inner&&(t=a.clipPathForYAxis),t}).attr("transform",a.getTranslate(e)).style("visibility",r["axis_".concat(e,"_show")]?"visible":"hidden"),a.axes[e].append("text").attr("class",n).attr("transform",["rotate(-90)",null]["x"===e?+!o:+o]).style("text-anchor",i.textAnchorForXAxisLabel.bind(i)),i.generateAxes(e)})}},{key:"setOrient",value:function setOrient(){var t=this.owner,e=t.config,n=e.axis_rotated,i=e.axis_y_inner,a=e.axis_y2_inner;t.xOrient=n?"left":"bottom",t.yOrient=n?i?"top":"bottom":i?"right":"left",t.y2Orient=n?a?"bottom":"top":a?"left":"right",t.subXOrient=n?"left":"bottom"}},{key:"generateAxes",value:function generateAxes(n){var i,a=this.owner,t=a.config,r=[],e=t["axis_".concat(n,"_axes")],o=t.axis_rotated;"x"===n?i=o?axisLeft:axisBottom:"y"===n?i=o?axisBottom:axisLeft:"y2"===n&&(i=o?axisTop:axisRight),e.length&&e.forEach(function(t){var e=t.tick;r.push(i(a[n]).ticks(e.count).tickFormat(e.format||function(t){return t}).tickValues(e.values).tickSizeOuter(!1===e.outer?0:6))}),a.axesList[n]=r}},{key:"updateAxes",value:function updateAxes(){var s=this.owner,c=s.config;Object.keys(s.axesList).forEach(function(r){var o=s[r].range();s.axesList[r].forEach(function(t,e){var n=t.scale().range();o.every(function(t,e){return t===n[e]})||t.scale().range(o);var i="".concat(oj(r),"-").concat(e+1),a=s.main.select(".".concat(i.replace(/\s/,".")));a.empty()?a=s.main.append("g").attr("class",i).style("visibility",c["axis_".concat(r,"_show")]?"visible":"hidden").call(t):s.xAxis.helper.transitionise(a).call(t.scale(s[r])),a.attr("transform",s.getTranslate(r,e+1))})})}},{key:"getXAxis",value:function getXAxis(t,e,n,i,a){var r=this.owner,o=r.config,s=r.isCategorized(),c=r["".concat(t,"Orient")],u=r.xAxisTickFormat,l=r.xAxisTickValues,h={isCategory:s,outerTick:n,noTransition:i,config:o,name:t,tickMultiline:o.axis_x_tick_multiline,tickWidth:o.axis_x_tick_width,tickTextRotate:a?0:o.axis_x_tick_rotate,tickTitle:s&&o.axis_x_tick_tooltip&&r.api.categories(),orgXScale:r.x},d=new Gn(h).scale(r.zoomScale||e).orient(c),f=l;return r.isTimeSeries()&&l&&!_g(l)&&(f=l.map(function(t){return r.parseDate(t)})),d.tickFormat(u).tickValues(f),s&&(d.tickCentered(o.axis_x_tick_centered),jh(o.axis_x_tick_culling)&&(o.axis_x_tick_culling=!1)),o.axis_x_tick_count&&d.ticks(o.axis_x_tick_count),d}},{key:"getYAxis",value:function getYAxis(t,e,n,i,a){var r=this.owner,o=r.config,s=r["".concat(t,"Orient")],c=o["axis_".concat(t,"_tick_format")],u=r["".concat(t,"AxisTickValues")],l={outerTick:n,noTransition:i,config:o,name:t,tickTextRotate:a?0:o.axis_y_tick_rotate},h=new Gn(l).scale(e).orient(s).tickFormat(c||r.isStackNormalized()&&function(t){return"".concat(t,"%")});return r.isTimeSeriesY()?h.ticks(o.axis_y_tick_time_value):h.tickValues(u),h}},{key:"updateXAxisTickValues",value:function updateXAxisTickValues(t,e){var n,i=this.owner,a=i.config,r=a.axis_x_tick_fit,o=a.axis_x_tick_count;return(r||o&&r)&&(n=this.generateTickValues(i.mapTargetsToUniqueXs(t),o,i.isTimeSeries())),e?e.tickValues(n):i.xAxis&&(i.xAxis.tickValues(n),i.subXAxis.tickValues(n)),n}},{key:"getId",value:function getId(t){var e=this.owner.config;return t in e.data_axes?e.data_axes[t]:"y"}},{key:"getXAxisTickFormat",value:function getXAxisTickFormat(){var e,n=this.owner,i=n.config.axis_x_tick_format,t=n.isTimeSeries(),a=n.isCategorized();return i?_g(i)?e=i:t&&(e=function(t){return t?n.axisTimeFormat(i)(t):""}):e=t?n.defaultAxisTimeFormat:a?n.categoryName:function(t){return t<0?t.toFixed(0):t},_g(e)?function(t){return e.apply(n,a?[t,n.categoryName(t)]:[t])}:e}},{key:"getTickValues",value:function getTickValues(t){var e=this.owner,n=e.config["axis_".concat(t,"_tick_values")],i=e["".concat(t,"Axis")];return n||(i?i.tickValues():void 0)}},{key:"getXAxisTickValues",value:function getXAxisTickValues(){return this.getTickValues("x")}},{key:"getYAxisTickValues",value:function getYAxisTickValues(){return this.getTickValues("y")}},{key:"getY2AxisTickValues",value:function getY2AxisTickValues(){return this.getTickValues("y2")}},{key:"getLabelOptionByAxisId",value:function getLabelOptionByAxisId(t){return this.owner.config["axis_".concat(t,"_label")]}},{key:"getLabelText",value:function getLabelText(t){var e=this.getLabelOptionByAxisId(t);return ah(e)?e:e?e.text:null}},{key:"setLabelText",value:function setLabelText(t,e){var n=this.owner.config,i=this.getLabelOptionByAxisId(t);ah(i)?n["axis_".concat(t,"_label")]=e:i&&(i.text=e)}},{key:"getLabelPosition",value:function getLabelPosition(t,e){function O8(t){return!!~a.indexOf(t)}var n=this.owner.config.axis_rotated,i=this.getLabelOptionByAxisId(t),a=ih(i)&&i.position?i.position:e[+!n];return{isInner:O8("inner"),isOuter:O8("outer"),isLeft:O8("left"),isCenter:O8("center"),isRight:O8("right"),isTop:O8("top"),isMiddle:O8("middle"),isBottom:O8("bottom")}}},{key:"getXAxisLabelPosition",value:function getXAxisLabelPosition(){return this.getLabelPosition("x",["inner-top","inner-right"])}},{key:"getYAxisLabelPosition",value:function getYAxisLabelPosition(){return this.getLabelPosition("y",["inner-right","inner-top"])}},{key:"getY2AxisLabelPosition",value:function getY2AxisLabelPosition(){return this.getLabelPosition("y2",["inner-right","inner-top"])}},{key:"getLabelPositionById",value:function getLabelPositionById(t){return this["get".concat(t.toUpperCase(),"AxisLabelPosition")]()}},{key:"textForXAxisLabel",value:function textForXAxisLabel(){return this.getLabelText("x")}},{key:"textForYAxisLabel",value:function textForYAxisLabel(){return this.getLabelText("y")}},{key:"textForY2AxisLabel",value:function textForY2AxisLabel(){return this.getLabelText("y2")}},{key:"xForAxisLabel",value:function xForAxisLabel(t,e){var n=!(1<arguments.length&&void 0!==e)||e,i=this.owner,a=t.isMiddle?-i.height/2:0;return nj(i,n)?a=t.isLeft?0:t.isCenter?i.width/2:i.width:t.isBottom&&(a=-i.height),a}},{key:"dxForAxisLabel",value:function dxForAxisLabel(t,e){var n=!(1<arguments.length&&void 0!==e)||e,i=this.owner,a=t.isBottom?"0.5em":"0";return nj(i,n)?a=t.isLeft?"0.5em":t.isRight?"-0.5em":"0":t.isTop&&(a="-0.5em"),a}},{key:"textAnchorForAxisLabel",value:function textAnchorForAxisLabel(t,e){var n=!(1<arguments.length&&void 0!==e)||e,i=this.owner,a=t.isMiddle?"middle":"end";return nj(i,n)?a=t.isLeft?"start":t.isCenter?"middle":"end":t.isBottom&&(a="start"),a}},{key:"xForXAxisLabel",value:function xForXAxisLabel(){return this.xForAxisLabel(this.getXAxisLabelPosition(),!1)}},{key:"xForYAxisLabel",value:function xForYAxisLabel(){return this.xForAxisLabel(this.getYAxisLabelPosition())}},{key:"xForY2AxisLabel",value:function xForY2AxisLabel(){return this.xForAxisLabel(this.getY2AxisLabelPosition())}},{key:"dxForXAxisLabel",value:function dxForXAxisLabel(){return this.dxForAxisLabel(this.getXAxisLabelPosition(),!1)}},{key:"dxForYAxisLabel",value:function dxForYAxisLabel(){return this.dxForAxisLabel(this.getYAxisLabelPosition())}},{key:"dxForY2AxisLabel",value:function dxForY2AxisLabel(){return this.dxForAxisLabel(this.getY2AxisLabelPosition())}},{key:"dyForXAxisLabel",value:function dyForXAxisLabel(){var t=this.owner.config,e=this.getXAxisLabelPosition().isInner,n=t.axis_x_height;return t.axis_rotated?e?"1.2em":-25-this.getMaxTickWidth("x"):e?"-0.5em":n?n-10:"3em"}},{key:"dyForYAxisLabel",value:function dyForYAxisLabel(){var t=this.owner,e=this.getYAxisLabelPosition().isInner;return t.config.axis_rotated?e?"-0.5em":"3em":e?"1.2em":-10-(t.config.axis_y_inner?0:this.getMaxTickWidth("y")+10)}},{key:"dyForY2AxisLabel",value:function dyForY2AxisLabel(){var t=this.owner,e=this.getY2AxisLabelPosition().isInner;return t.config.axis_rotated?e?"1.2em":"-2.2em":e?"-0.5em":15+(t.config.axis_y2_inner?0:this.getMaxTickWidth("y2")+15)}},{key:"textAnchorForXAxisLabel",value:function textAnchorForXAxisLabel(){return this.textAnchorForAxisLabel(this.getXAxisLabelPosition(),!1)}},{key:"textAnchorForYAxisLabel",value:function textAnchorForYAxisLabel(){return this.textAnchorForAxisLabel(this.getYAxisLabelPosition())}},{key:"textAnchorForY2AxisLabel",value:function textAnchorForY2AxisLabel(){return this.textAnchorForAxisLabel(this.getY2AxisLabelPosition())}},{key:"getMaxTickWidth",value:function getMaxTickWidth(t,e){var n=this.owner,i=n.config,a=n.currentMaxTickWidths[t],r=0;if(e||!i["axis_".concat(t,"_show")])return a.size;if(n.svg){var o=/^y2?$/.test(t),s=n.filterTargetsToShow(n.data.targets),c=o?"getY":"getX",u=n[t].copy().domain(n["".concat(c,"Domain")](s,t)),l=u.domain();if(lh(a.domain)&&a.domain.every(function(t,e){return t===l[e]}))return a.size;a.domain=l;var h=this["".concat(c,"Axis")](t,u,!1,!1,!0),d=i["axis_".concat(t,"_tick_count")];d&&h.tickValues(this.generateTickValues(l,d,o?n.isTimeSeriesY():n.isTimeSeries())),o||this.updateXAxisTickValues(s,h);var f=n.selectChart.append("svg").style("visibility","hidden").style("position","fixed").style("top","0px").style("left","0px");h.create(f),f.selectAll("text").each(function(){r=Math.max(r,this.getBoundingClientRect().width)}),f.remove()}return 0<r&&(a.size=r),a.size}},{key:"updateLabels",value:function updateLabels(i){var a=this,t=this.owner,r={X:t.main.select(".".concat(Oe.axisX," .").concat(Oe.axisXLabel)),Y:t.main.select(".".concat(Oe.axisY," .").concat(Oe.axisYLabel)),Y2:t.main.select(".".concat(Oe.axisY2," .").concat(Oe.axisY2Label))};Object.keys(r).filter(function(t){return!r[t].empty()}).forEach(function(t){var e=r[t],n="".concat(t,"AxisLabel");(i?e.transition():e).attr("x",a["xFor".concat(n)].bind(a)).attr("dx",a["dxFor".concat(n)].bind(a)).attr("dy",a["dyFor".concat(n)].bind(a)).text(a["textFor".concat(n)].bind(a))})}},{key:"getPadding",value:function getPadding(t,e,n,i){var a=bh(t)?t:t[e];return $g(a)?"ratio"===t.unit?t[e]*i:this.convertPixelsToAxisPadding(a,i):n}},{key:"convertPixelsToAxisPadding",value:function convertPixelsToAxisPadding(t,e){var n=this.owner;return e*(t/(n.config.axis_rotated?n.width:n.height))}},{key:"generateTickValues",value:function generateTickValues(t,e,n){var i,a,r,o,s,c,u=t;if(e){var l=_g(e)?e():e;if(1===l)u=[t[0]];else if(2===l)u=[t[0],t[t.length-1]];else if(2<l){for(r=l-2,i=t[0],o=((a=t[t.length-1])-i)/(1+r),u=[i],s=0;s<r;s++)c=+i+o*(s+1),u.push(n?new Date(c):c);u.push(a)}}return n||(u=u.sort(function(t,e){return t-e})),u}},{key:"generateTransitions",value:function generateTransitions(n){var i=this.owner.axes,t=["x","y","y2","subx"].map(function(t){var e=i[t];return e&&n&&(e=e.transition().duration(n)),e}),e=k()(t,4);return{axisX:e[0],axisY:e[1],axisY2:e[2],axisSubX:e[3]}}},{key:"redraw",value:function redraw(n,t,i){var a=this.owner,r=t?"0":"1";["x","y","y2","subX"].forEach(function(t){var e=a["".concat(t,"Axis")];e&&(i||(e.config.withoutTransition=!a.config.transition_duration),a.axes[t.toLowerCase()].style("opacity",r),e.create(n["axis".concat(yh(t))]))}),this.updateAxes()}}]),Axis}(),$n=function(){function ChartInternal(t){a()(this,ChartInternal);this.api=t,this.config=this.getOptions(),this.data={},this.cache={},this.axes={}}return s()(ChartInternal,[{key:"beforeInit",value:function beforeInit(){this.callPluginHook("$beforeInit"),ph(this.config.onbeforeinit,this)}},{key:"afterInit",value:function afterInit(){this.callPluginHook("$afterInit"),ph(this.config.onafterinit,this)}},{key:"init",value:function init(){this.initParams();var t=this.convertData(this.config,this.initWithData);t&&this.initWithData(t)}},{key:"initParams",value:function initParams(){var i=this,a=this,t=a.config,e=t.axis_rotated;a.datetimeId="bb-".concat(+new Date),a.initClip(),a.dragStart=null,a.dragging=!1,a.flowing=!1,a.cancelClick=!1,a.mouseover=!1,a.transiting=!1,a.color=a.generateColor(),a.levelColor=a.generateLevelColor(),a.point=a.generatePoint(),a.extraLineClasses=a.generateExtraLineClass(),a.dataTimeFormat=t.data_xLocaltime?$:K,a.axisTimeFormat=t.axis_x_localtime?q:Z;var r=a.config.zoom_enabled&&"drag"===a.config.zoom_enabled.type;a.defaultAxisTimeFormat=function(t){var e=r?i.zoomScale:i.zoomScale&&a.x.orgDomain().toString()!==i.zoomScale.domain().toString(),n=(t.getMilliseconds()?".%L":t.getSeconds()&&".:%S")||t.getMinutes()&&"%I:%M"||t.getHours()&&"%I %p"||1!==t.getDate()&&"%b %d"||e&&1===t.getDate()&&"%b'%y"||t.getMonth()&&"%-m/%-d"||"%Y";return a.axisTimeFormat(n)(t)},a.hiddenTargetIds=[],a.hiddenLegendIds=[],a.focusedTargetIds=[],a.defocusedTargetIds=[],a.isLegendRight="right"===t.legend_position,a.isLegendInset="inset"===t.legend_position,a.isLegendTop="top-left"===t.legend_inset_anchor||"top-right"===t.legend_inset_anchor,a.isLegendLeft="top-left"===t.legend_inset_anchor||"bottom-left"===t.legend_inset_anchor,a.legendStep=0,a.legendItemWidth=0,a.legendItemHeight=0,a.currentMaxTickWidths={x:{size:0,domain:""},y:{size:0,domain:""},y2:{size:0,domain:""}},a.rotated_padding_left=30,a.rotated_padding_right=e&&!t.axis_x_show?0:30,a.rotated_padding_top=5,a.withoutFadeIn={},a.inputType=a.convertInputType(),a.axes.subx=Bd([])}},{key:"initWithData",value:function initWithData(t){var e=this,n=e.config;e.axis=new qn(e),n.zoom_enabled&&e.initZoom();var i={element:n.bindto,classname:"bb"};if(mh(n.bindto)&&(i.element=n.bindto.element||"#chart",i.classname=n.bindto.classname||i.classname),e.selectChart=_g(i.element.node)?n.bindto.element:lt(i.element||[]),e.selectChart.empty()&&(e.selectChart=lt(sn.document.body.appendChild(sn.document.createElement("div")))),e.selectChart.html("").classed(i.classname,!0),e.data.xs={},e.data.targets=e.convertDataToTargets(t),n.data_filter&&(e.data.targets=e.data.targets.filter(n.data_filter)),n.data_hide&&e.addHiddenTargetIds(!0===n.data_hide?e.mapToIds(e.data.targets):n.data_hide),n.legend_hide&&e.addHiddenLegendIds(!0===n.legend_hide?e.mapToIds(e.data.targets):n.legend_hide),e.hasType("gauge")&&(n.legend_show=!1),e.updateSizes(),e.updateScales(!0),e.x&&(e.x.domain(Eh(e.getXDomain(e.data.targets))),e.subX.domain(e.x.domain()),e.orgXDomain=e.x.domain()),e.y&&(e.y.domain(e.getYDomain(e.data.targets,"y")),e.subY.domain(e.y.domain())),e.y2&&(e.y2.domain(e.getYDomain(e.data.targets,"y2")),e.subY2&&e.subY2.domain(e.y2.domain())),e.svg=e.selectChart.append("svg").style("overflow","hidden").style("display","block"),n.interaction_enabled&&e.inputType){var a="touch"===e.inputType;e.svg.on(a?"touchstart":"mouseenter",function(){return ph(n.onover,e)}).on(a?"touchend":"mouseleave",function(){return ph(n.onout,e)})}n.svg_classname&&e.svg.attr("class",n.svg_classname),e.defs=e.svg.append("defs"),e.clipChart=e.appendClip(e.defs,e.clipId),e.clipXAxis=e.appendClip(e.defs,e.clipIdForXAxis),e.clipYAxis=e.appendClip(e.defs,e.clipIdForYAxis),e.clipGrid=e.appendClip(e.defs,e.clipIdForGrid),_g(n.color_tiles)&&e.patterns&&e.patterns.forEach(function(t){return e.defs.append(function(){return t.node})}),e.updateSvgSize();var r=e.svg.append("g").attr("transform",e.getTranslate("main"));if(e.main=r,n.subchart_show&&e.initSubchart(),e.initTooltip&&e.initTooltip(),e.initLegend&&e.initLegend(),e.initTitle&&e.initTitle(),n.data_empty_label_text&&r.append("text").attr("class","".concat(Oe.text," ").concat(Oe.empty)).attr("text-anchor","middle").attr("dominant-baseline","middle"),e.initRegion(),n.clipPath||e.axis.init(),r.append("g").attr("class",Oe.chart).attr("clip-path",e.clipPath),e.callPluginHook("$init"),e.initEventRect(),e.initChartElements(),e.initGrid(),r.insert("rect",n.zoom_privileged?null:"g.".concat(Oe.regions)).attr("class",Oe.zoomRect).attr("width",e.width).attr("height",e.height).style("opacity","0").on("dblclick.zoom",null),n.clipPath&&e.axis.init(),e.updateTargets(e.data.targets),e.updateDimension(),n.oninit.call(e),e.redraw({withTransition:!1,withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransitionForAxis:!1,initializing:!0}),n.data_onmin||n.data_onmax){var o=e.getMinMaxData();ph(n.data_onmin,e,o.min),ph(n.data_onmax,e,o.max)}e.bindResize(),e.api.element=e.selectChart.node()}},{key:"initChartElements",value:function initChartElements(){var e=this;["Bar","Radar","Line","Bubble","Arc","Gauge","Pie"].forEach(function(t){e["init".concat(t)]()}),kh(e.config.data_labels)&&e.initText()}},{key:"getChartElements",value:function getChartElements(){var t=this;return{chart:t.selectChart,svg:t.svg,defs:t.defs,main:t.main,tooltip:t.tooltip,legend:t.legend,title:t.title,grid:t.grid,arc:t.arcs,bar:{bars:t.mainBar},line:{lines:t.mainLine,areas:t.mainArea,circles:t.mainCircle},text:{texts:t.mainText}}}},{key:"smoothLines",value:function smoothLines(t,e){"grid"===e&&t.each(function(){var e=lt(this),t=["x1","x2","y1","y2"].map(function(t){return Math.ceil(e.attr(t))}),n=k()(t,4),i=n[0],a=n[1],r=n[2],o=n[3];e.attr({x1:i,x2:a,y1:r,y2:o})})}},{key:"updateSizes",value:function updateSizes(t){var e=this,n=e.config,i=n.axis_rotated,a=e.hasArcType(),r={width:e.legend?e.getLegendWidth():0,height:e.legend?e.getLegendHeight():0},o=e.isLegendRight||e.isLegendInset?0:r.height,s=i||a?0:e.getHorizontalAxisHeight("x"),c=n.subchart_axis_x_show&&n.subchart_axis_x_tick_text_show?s:30,u=n.subchart_show&&!a?n.subchart_size_height+c:0;t||e.setContainerSize(),e.margin=i?{top:e.getHorizontalAxisHeight("y2")+e.getCurrentPaddingTop(),right:a?0:e.getCurrentPaddingRight(),bottom:e.getHorizontalAxisHeight("y")+o+e.getCurrentPaddingBottom(),left:u+(a?0:e.getCurrentPaddingLeft())}:{top:4+e.getCurrentPaddingTop(),right:a?0:e.getCurrentPaddingRight(),bottom:s+u+o+e.getCurrentPaddingBottom(),left:a?0:e.getCurrentPaddingLeft()},e.margin2=i?{top:e.margin.top,right:NaN,bottom:20+o,left:e.rotated_padding_left}:{top:e.currentHeight-u-o,right:NaN,bottom:c+o,left:e.margin.left},e.margin3={top:0,right:NaN,bottom:0,left:0},e.updateSizeForLegend&&e.updateSizeForLegend(r),e.width=e.currentWidth-e.margin.left-e.margin.right,e.height=e.currentHeight-e.margin.top-e.margin.bottom,e.width<0&&(e.width=0),e.height<0&&(e.height=0),e.width2=i?e.margin.left-e.rotated_padding_left-e.rotated_padding_right:e.width,e.height2=i?e.height:e.currentHeight-e.margin2.top-e.margin2.bottom,e.width2<0&&(e.width2=0),e.height2<0&&(e.height2=0),e.arcWidth=e.width-(e.isLegendRight?r.width+10:0),e.arcHeight=e.height-(e.isLegendRight?0:10),e.hasType("gauge")&&!n.gauge_fullCircle&&(e.arcHeight+=e.height-e.getGaugeLabelHeight()),e.updateRadius&&e.updateRadius(),e.isLegendRight&&a&&(e.margin3.left=e.arcWidth/2+1.1*e.radiusExpanded)}},{key:"updateTargets",value:function updateTargets(t){var e=this;e.updateTargetsForText(t),e.updateTargetsForBar(t),e.updateTargetsForLine(t),e.hasArcType(t)&&(e.hasType("radar")?e.updateTargetsForRadar(t):e.updateTargetsForArc(t)),e.updateTargetsForSubchart&&e.updateTargetsForSubchart(t),e.showTargets()}},{key:"showTargets",value:function showTargets(){var e=this;e.svg.selectAll(".".concat(Oe.target)).filter(function(t){return e.isTargetToShow(t.id)}).transition().duration(e.config.transition_duration).style("opacity","1")}},{key:"getWithOption",value:function getWithOption(n){var i={Y:!0,Subchart:!0,Transition:!0,EventRect:!0,Dimension:!0,TrimXDomain:!0,Transform:!1,UpdateXDomain:!1,UpdateOrgXDomain:!1,Legend:!1,UpdateXAxis:"UpdateXDomain",TransitionForExit:"Transition",TransitionForAxis:"Transition"};return Object.keys(i).forEach(function(t){var e=i[t];ah(e)&&(e=i[e]),i[t]=nh(n,"with".concat(t),e)}),i}},{key:"redraw",value:function redraw(t,e){var n=0<arguments.length&&void 0!==t?t:{},i=1<arguments.length?e:void 0,a=this,r=a.main,o=a.config,s=a.filterTargetsToShow(a.data.targets),c=n.initializing,u=n.flow,l=a.getWithOption(n),h=l.Transition?o.transition_duration:0,d=l.TransitionForExit?h:0,f=l.TransitionForAxis?h:0,g=i||a.axis.generateTransitions(f);c&&o.tooltip_init_show||"touch"!==a.inputType||a.hideTooltip(),a.updateSizes(c),l.Legend&&o.legend_show?a.updateLegend(a.mapToIds(a.data.targets),n,g):l.Dimension&&a.updateDimension(!0),a.redrawAxis(s,l,g,u,c),a.updateCircleY(),a.updateXgridFocus(),o.data_empty_label_text&&r.select("text.".concat(Oe.text,".").concat(Oe.empty)).attr("x",a.width/2).attr("y",a.height/2).text(o.data_empty_label_text).style("display",s.length?"none":null),a.updateGrid(h),a.updateRegion(h),a.updateBar(d),a.updateLine(d),a.updateArea(d),a.updateCircle(),a.hasDataLabel()&&a.updateText(d),a.redrawTitle&&a.redrawTitle(),a.arcs&&a.redrawArc(h,d,l.Transform),a.radars&&a.redrawRadar(h,d),a.mainText&&r.selectAll(".".concat(Oe.selectedCircles)).filter(a.isBarType.bind(a)).selectAll("circle").remove(),o.interaction_enabled&&!u&&l.EventRect&&(a.redrawEventRect(),a.bindZoomEvent()),a.generateRedrawList(s,u,h,l.Subchart),a.callPluginHook("$redraw",n,h)}},{key:"redrawAxis",value:function redrawAxis(r,t,e,n,i){var a,o,s,c=this,u=c.config,l=c.hasArcType(),h=!!c.zoomScale;if(!h&&c.isCategorized()&&0===r.length&&c.x.domain([0,c.axes.x.selectAll(".tick").size()]),c.x&&r.length?(h||c.updateXDomain(r,t.UpdateXDomain,t.UpdateOrgXDomain,t.TrimXDomain),u.axis_x_tick_values||(a=c.axis.updateXAxisTickValues(r))):c.xAxis&&(c.xAxis.tickValues([]),c.subXAxis.tickValues([])),u.zoom_rescale&&!n&&(s=c.x.orgDomain()),["y","y2"].forEach(function(t){var e=c[t];if(e){var n=u["axis_".concat(t,"_tick_values")],i=u["axis_".concat(t,"_tick_count")];if(e.domain(c.getYDomain(r,t,s)),!n&&i){var a=e.domain();c["".concat(t,"Axis")].tickValues(c.axis.generateTickValues(a,a.every(function(t){return 0===t})?1:i,c.isTimeSeriesY()))}}}),c.axis.redraw(e,l,i),c.axis.updateLabels(t.Transition),(t.UpdateXDomain||t.UpdateXAxis)&&r.length)if(u.axis_x_tick_culling&&a){for(var d=1;d<a.length;d++)if(a.length/d<u.axis_x_tick_culling_max){o=d;break}c.svg.selectAll(".".concat(Oe.axisX," .tick text")).each(function(t){var e=a.indexOf(t);0<=e&&lt(this).style("display",e%o?"none":"block")})}else c.svg.selectAll(".".concat(Oe.axisX," .tick text")).style("display","block");t.Y&&(c.subY&&c.subY.domain(c.getYDomain(r,"y")),c.subY2&&c.subY2.domain(c.getYDomain(r,"y2")))}},{key:"generateRedrawList",value:function generateRedrawList(t,e,n,i){var a=this,r=a.config,o=a.getDrawShape();r.subchart_show&&a.redrawSubchart(i,n,o);var s=e&&a.generateFlow({targets:t,flow:e,duration:e.duration,shape:o,xv:a.xv.bind(a)}),c=(n||s)&&a.isTabVisible(),u=a.getRedrawList(o,e,s,c),l=e||r.onrendered?function(){s&&s(),ph(r.onrendered,a)}:null;if(l)if(c){var h=a.generateWait();src_transition_transition().duration(n).each(function(){u.reduce(function(t,e){return t.concat(e)},[]).forEach(function(t){return h.add(t)})}).call(h,l)}else l();a.mapToIds(a.data.targets).forEach(function(t){a.withoutFadeIn[t]=!0})}},{key:"getDrawShape",value:function getDrawShape(){var t=this,e=t.config.axis_rotated,n=t.hasType("radar"),i={type:{},indices:{}};if(t.hasTypeOf("Line")||t.hasType("bubble")||t.hasType("scatter")){var a=t.getShapeIndices(t.isLineType);if(i.indices.line=a,i.type.line=t.generateDrawLine?t.generateDrawLine(a,!1):void 0,t.hasTypeOf("Area")){var r=t.getShapeIndices(t.isAreaType);i.indices.area=r,i.type.area=t.generateDrawArea?t.generateDrawArea(r,!1):void 0}}if(t.hasType("bar")){var o=t.getShapeIndices(t.isBarType);i.indices.bar=o,i.type.bar=t.generateDrawBar?t.generateDrawBar(o):void 0}return i.pos={xForText:t.generateXYForText(i.indices,!0),yForText:t.generateXYForText(i.indices,!1),cx:(n?t.radarCircleX:e?t.circleY:t.circleX).bind(t),cy:(n?t.radarCircleY:e?t.circleX:t.circleY).bind(t)},i}},{key:"getRedrawList",value:function getRedrawList(t,e,n,i){var a=this,r=a.config,o=a.hasArcType(),s=t.pos,c=s.cx,u=s.cy,l=s.xForText,h=s.yForText,d=[];if(!o){var f=t.type,g=f.area,p=f.bar,_=f.line;(r.grid_x_lines.length||r.grid_y_lines.length)&&d.push(a.redrawGrid(i)),r.regions.length&&d.push(a.redrawRegion(i)),a.hasTypeOf("Line")&&(d.push(a.redrawLine(_,i)),a.hasTypeOf("Area")&&d.push(a.redrawArea(g,i))),a.hasType("bar")&&d.push(a.redrawBar(p,i)),kh(r.data_labels)&&d.push(a.redrawText(l,h,e,i))}return o&&!a.hasType("radar")||d.push(a.redrawCircle(c,u,i,n)),d}},{key:"updateAndRedraw",value:function updateAndRedraw(t){var e,n=0<arguments.length&&void 0!==t?t:{},i=this.config;n.withTransition=nh(n,"withTransition",!0),n.withTransform=nh(n,"withTransform",!1),n.withLegend=nh(n,"withLegend",!1),n.withUpdateXDomain=!0,n.withUpdateOrgXDomain=!0,n.withTransitionForExit=!1,n.withTransitionForTransform=nh(n,"withTransitionForTransform",n.withTransition),n.withLegend&&i.legend_show||(e=this.axis.generateTransitions(n.withTransitionForAxis?i.transition_duration:0),this.updateScales(),this.updateSvgSize(),this.transformAll(n.withTransitionForTransform,e)),this.redraw(n,e)}},{key:"redrawWithoutRescale",value:function redrawWithoutRescale(){this.redraw({withY:!1,withSubchart:!1,withEventRect:!1,withTransitionForAxis:!1})}},{key:"isTimeSeries",value:function isTimeSeries(){return"timeseries"===this.config.axis_x_type}},{key:"isCategorized",value:function isCategorized(){return 0<=this.config.axis_x_type.indexOf("category")||this.hasType("radar")}},{key:"isCustomX",value:function isCustomX(){var t=this.config;return!this.isTimeSeries()&&(t.data_x||kh(t.data_xs))}},{key:"isTimeSeriesY",value:function isTimeSeriesY(){return"timeseries"===this.config.axis_y_type}},{key:"getTranslate",value:function getTranslate(t,e){var n,i,a=1<arguments.length&&void 0!==e?e:0,r=this,o=r.config.axis_rotated,s=0;if(a&&/^(x|y2?)$/.test(t)&&(s=r.getAxisSize(t)*a),"main"===t)n=gh(r.margin.left),i=gh(r.margin.top);else if("context"===t)n=gh(r.margin2.left),i=gh(r.margin2.top);else if("legend"===t)n=r.margin3.left,i=r.margin3.top;else if("x"===t)n=o?-s:0,i=o?0:r.height+s;else if("y"===t)n=o?0:-s,i=o?r.height+s:0;else if("y2"===t)n=o?0:r.width+s,i=o?1-s:0;else if("subx"===t)n=0,i=o?0:r.height2;else if("arc"===t)n=r.arcWidth/2,i=r.arcHeight/2;else if("radar"===t){var c=r.getRadarSize(),u=k()(c,1)[0];n=r.width/2-u,i=gh(r.margin.top)}return"translate(".concat(n,", ").concat(i,")")}},{key:"initialOpacity",value:function initialOpacity(t){return null!==this.getBaseValue(t)&&this.withoutFadeIn[t.id]?"1":"0"}},{key:"initialOpacityForCircle",value:function initialOpacityForCircle(t){return null!==this.getBaseValue(t)&&this.withoutFadeIn[t.id]?this.opacityForCircle(t):"0"}},{key:"opacityForCircle",value:function opacityForCircle(t){var e=this.config.point_show?"1":"0";return $g(this.getBaseValue(t))?this.isBubbleType(t)||this.isScatterType(t)?"0.5":e:"0"}},{key:"opacityForText",value:function opacityForText(){return this.hasDataLabel()?"1":"0"}},{key:"xx",value:function xx(t){var e=this.config.zoom_enabled&&this.zoomScale?this.zoomScale:this.x;return t?e(t.x):null}},{key:"xv",value:function xv(t){var e=this.getBaseValue(t);return this.isTimeSeries()?e=this.parseDate(e):this.isCategorized()&&ah(e)&&(e=this.config.axis_x_categories.indexOf(e)),Math.ceil(this.x(e))}},{key:"yv",value:function yv(t){var e=t.axis&&"y2"===t.axis?this.y2:this.y;return Math.ceil(e(this.getBaseValue(t)))}},{key:"subxx",value:function subxx(t){return t?this.subX(t.x):null}},{key:"transformMain",value:function transformMain(t,e){var n,i,a,r=this;e&&e.axisX?n=e.axisX:(n=r.main.select(".".concat(Oe.axisX)),t&&(n=n.transition())),e&&e.axisY?i=e.axisY:(i=r.main.select(".".concat(Oe.axisY)),t&&(i=i.transition())),e&&e.axisY2?a=e.axisY2:(a=r.main.select(".".concat(Oe.axisY2)),t&&(a=a.transition())),(t?r.main.transition():r.main).attr("transform",r.getTranslate("main")),n.attr("transform",r.getTranslate("x")),i.attr("transform",r.getTranslate("y")),a.attr("transform",r.getTranslate("y2")),r.main.select(".".concat(Oe.chartArcs)).attr("transform",r.getTranslate("arc"))}},{key:"transformAll",value:function transformAll(t,e){this.transformMain(t,e),this.config.subchart_show&&this.transformContext(t,e),this.legend&&this.transformLegend(t)}},{key:"updateSvgSize",value:function updateSvgSize(){var t=this,e=t.svg.select(".".concat(Oe.brush," .overlay")),n={width:0,height:0};e.size()&&(n.width=+e.attr("width"),n.height=+e.attr("height")),t.svg.attr("width",t.currentWidth).attr("height",t.currentHeight),t.svg.selectAll(["#".concat(t.clipId),"#".concat(t.clipIdForGrid)]).select("rect").attr("width",t.width).attr("height",t.height),t.svg.select("#".concat(t.clipIdForXAxis)).select("rect").attr("x",t.getXAxisClipX.bind(t)).attr("y",t.getXAxisClipY.bind(t)).attr("width",t.getXAxisClipWidth.bind(t)).attr("height",t.getXAxisClipHeight.bind(t)),t.svg.select("#".concat(t.clipIdForYAxis)).select("rect").attr("x",t.getYAxisClipX.bind(t)).attr("y",t.getYAxisClipY.bind(t)).attr("width",t.getYAxisClipWidth.bind(t)).attr("height",t.getYAxisClipHeight.bind(t)),t.svg.select("#".concat(t.clipIdForSubchart)).select("rect").attr("width",t.width).attr("height",n.height),t.svg.select(".".concat(Oe.zoomRect)).attr("width",t.width).attr("height",t.height)}},{key:"updateDimension",value:function updateDimension(t){var e=this;t||(e.xAxis&&e.config.axis_rotated?(e.xAxis.create(e.axes.x),e.subXAxis.create(e.axes.subx)):(e.yAxis&&e.yAxis.create(e.axes.y),e.y2Axis&&e.y2Axis.create(e.axes.y2))),e.updateScales(t),e.updateSvgSize(),e.transformAll(!1)}},{key:"bindResize",value:function bindResize(){var t=this,e=t.config;t.resizeFunction=t.generateResize(),t.resizeFunction.add(e.onresize.bind(t)),e.resize_auto&&t.resizeFunction.add(function(){t.resizeTimeout&&(sn.window.clearTimeout(t.resizeTimeout),t.resizeTimeout=null),t.resizeTimeout=sn.window.setTimeout(function(){t.api.flush(!1,!0)},200)}),t.resizeFunction.add(e.onresized.bind(t)),sn.window.addEventListener("resize",t.resizeFunction)}},{key:"generateResize",value:function generateResize(){function callResizeFunctions(){e.forEach(function(t){return t()})}var e=[];return callResizeFunctions.add=function(t){return e.push(t)},callResizeFunctions.remove=function(t){return e.splice(e.indexOf(t),1)},callResizeFunctions}},{key:"endall",value:function endall(t,i){var a=0;t.each(function(){return++a}).on("end",function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];--a||i.apply.apply(i,[this].concat(e))})}},{key:"generateWait",value:function generateWait(){function Pda(t,n){var i;!function loop(){var e=0;a.forEach(function(t){if(t.empty())e++;else try{t.transition()}catch(t){e++}}),i&&clearTimeout(i),e===a.length?n&&n():i=setTimeout(loop,50)}()}var a=[];return Pda.add=function(t){lh(t)?a=a.concat(t):a.push(t)},Pda}},{key:"parseDate",value:function parseDate(t){var e;return t instanceof Date?e=t:ah(t)?e=this.dataTimeFormat(this.config.data_xFormat)(t):bh(t)&&!isNaN(t)&&(e=new Date(+t)),(!e||isNaN(+e))&&console&&console.error&&console.error("Failed to parse x '".concat(t,"' to Date object")),e}},{key:"isTabVisible",value:function isTabVisible(){return!sn.document.hidden}},{key:"convertInputType",value:function convertInputType(){var t=this.config,e=sn.window.navigator&&"maxTouchPoints"in sn.window.navigator&&0<sn.window.navigator.maxTouchPoints||!1,n=t.interaction_inputType_mouse&&!e&&"onmouseover"in sn.window,i=!1;return t.interaction_inputType_touch&&(i="ontouchmove"in sn.window||sn.window.DocumentTouch&&sn.document instanceof sn.window.DocumentTouch),(n?"mouse":i&&"touch")||null}},{key:"callPluginHook",value:function callPluginHook(e){for(var n=this,t=arguments.length,i=Array(1<t?t-1:0),a=1;a<t;a++)i[a-1]=arguments[a];this.config.plugins.forEach(function(t){"$beforeInit"===e&&(t.$$=n).api.plugins.push(t),t[e].apply(t,i)})}}]),ChartInternal}();xh($n.prototype,{getOptions:function getOptions(){return new sj},loadConfig:function loadConfig(e){var n,i,a,r=this.config,o=function(){var t=i.shift();return t&&n&&ih(n)&&t in n?(n=n[t],o()):t?void 0:n};Object.keys(r).forEach(function(t){n=e,i=t.split("_"),a=o(),dh(a)&&(r[t]=a)})}}),xh($n.prototype,{getScale:function getScale(t,e,n){return(n?function(){return initRange.apply(calendar(R,D,y,T,m,p,f,h,q).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}():src_linear_linear()).range([t,e])},getX:function getX(t,e,n,i){var a=this.zoomScale||this.getScale(t,e,this.isTimeSeries());return this.getCustomizedScale(n?a.domain(n):a,i)},getY:function getY(t,e,n){var i=this.getScale(t,e,this.isTimeSeriesY());return n&&i.domain(n),i},getCustomizedScale:function getCustomizedScale(i,t){function Qea(t,e){var n=i(t)+a();return e?n:Math.ceil(n)}var e=this,a=t||function(){return e.xAxis.tickOffset()};for(var n in i)Qea[n]=i[n];return Qea.orgDomain=function(){return i.domain()},Qea.orgScale=function(){return i},e.isCategorized()&&(Qea.domain=function(t){var e=t;return arguments.length?(i.domain(e),Qea):[(e=this.orgDomain())[0],e[1]+1]}),Qea},getYScale:function getYScale(t){return"y2"===this.axis.getId(t)?this.y2:this.y},getSubYScale:function getSubYScale(t){return"y2"===this.axis.getId(t)?this.subY2:this.subY},updateScales:function updateScales(t,e){var n=!(1<arguments.length&&void 0!==e)||e,i=this,a=i.config,r=a.axis_rotated;i.xMin=r?1:0,i.xMax=r?i.height:i.width,i.yMin=r?0:i.height,i.yMax=r?i.width:1,i.subXMin=i.xMin,i.subXMax=i.xMax,i.subYMin=r?0:i.height2,i.subYMax=r?i.width2:1;var o=n&&i.x&&i.x.orgDomain(),s=n&&i.orgXDomain;i.x=i.getX(i.xMin,i.xMax,o,function(){return i.xAxis.tickOffset()}),i.subX=i.getX(i.xMin,i.xMax,s,function(t){return t%1?0:i.subXAxis.tickOffset()}),i.xAxisTickFormat=i.axis.getXAxisTickFormat(),i.xAxisTickValues=i.axis.getXAxisTickValues(),i.xAxis=i.axis.getXAxis("x",i.x,a.axis_x_tick_outer,t),i.subXAxis=i.axis.getXAxis("subX",i.subX,a.axis_x_tick_outer,t),i.y=i.getY(i.yMin,i.yMax,i.y?i.y.domain():a.axis_y_default),i.subY=i.getY(i.subYMin,i.subYMax,i.subY?i.subY.domain():a.axis_y_default),i.yAxisTickValues=i.axis.getYAxisTickValues(),i.yAxis=i.axis.getYAxis("y",i.y,a.axis_y_tick_outer,t),a.axis_y2_show&&(i.y2=i.getY(i.yMin,i.yMax,i.y2?i.y2.domain():a.axis_y2_default),i.subY2=i.getY(i.subYMin,i.subYMax,i.subY2?i.subY2.domain():a.axis_y2_default),i.y2AxisTickValues=i.axis.getY2AxisTickValues(),i.y2Axis=i.axis.getYAxis("y2",i.y2,a.axis_y2_tick_outer,t)),i.updateArc&&i.updateArc()}}),xh($n.prototype,{getYDomainMinMax:function getYDomainMinMax(n,e){var u=this,t=u.config,l="min"===e,i=t.data_groups,h=u.mapToIds(n),d=u.getValuesAsIdKeyed(n);return 0<i.length&&function(){for(var s,c=u["has".concat(l?"Negative":"Positive","ValueInTargets")](n),t=function(t,e){if(0===(e=e.filter(function(t){return 0<=h.indexOf(t)})).length)return s=e,"continue";var a=e[0],r=u.axis.getId(a);c&&d[a]&&(d[a]=d[a].map(function(t){return(l?t<0:0<t)?t:0}));for(var n,i=function(t,e){if(!d[e])return"continue";var i=u.axis.getId(e);d[e].forEach(function(t,e){var n=+t;i!==r||c&&(l?0<n:n<0)||(d[a][e]+=n)})},o=1;n=e[o];o++)i(0,n);s=e},e=0;s=i[e];e++)t(0,s)}(),Fh(e,Object.keys(d).map(function(t){return Fh(e,d[t])}))},getYDomainMin:function getYDomainMin(t){return this.getYDomainMinMax(t,"min")},getYDomainMax:function getYDomainMax(t){return this.getYDomainMinMax(t,"max")},getYDomain:function getYDomain(t,e,n){var i=this,a=i.config;if(i.isStackNormalized())return[0,100];var r=t.filter(function(t){return i.axis.getId(t.id)===e}),o=n?i.filterByXDomain(r,n):r,s=a["axis_".concat(e,"_min")],c=a["axis_".concat(e,"_max")],u=i.getYDomainMin(o),l=i.getYDomainMax(o),h=a["axis_".concat(e,"_center")],d=i.hasType("bar",o)&&a.bar_zerobased||i.hasType("area",o)&&a.area_zerobased,f=a["axis_".concat(e,"_inverted")],g=i.hasDataLabel()&&a.axis_rotated,p=i.hasDataLabel()&&!a.axis_rotated;if(u=$g(s)?s:$g(c)?u<c?u:c-10:u,l=$g(c)?c:$g(s)?s<l?l:s+10:l,0===o.length)return i[e].domain();isNaN(u)&&(u=0),isNaN(l)&&(l=u),u===l&&(u<0?l=0:u=0);var _=0<=u&&0<=l,m=u<=0&&l<=0;($g(s)&&_||$g(c)&&m)&&(d=!1),d&&(_&&(u=0),m&&(l=0));var x=Math.abs(l-u),v={top:.1*x,bottom:.1*x};if(dh(h)){var y=Math.max(Math.abs(u),Math.abs(l));l=h+y,u=h-y}if(g){var b=hh(i.y.range()),T=i.getDataLabelLength(u,l,"width").map(function(t){return t/b});["bottom","top"].forEach(function(t,e){v[t]+=x*(T[e]/(1-T[0]-T[1]))})}else if(p){var w=i.getDataLabelLength(u,l,"height");["bottom","top"].forEach(function(t,e){v[t]+=i.axis.convertPixelsToAxisPadding(w[e],x)})}if(/^y2?$/.test(e)){var A=a["axis_".concat(e,"_padding")];kh(A)&&["bottom","top"].forEach(function(t){v[t]=i.axis.getPadding(A,t,v[t],x)})}d&&(_&&(v.bottom=u),m&&(v.top=-l));var k=[u-v.bottom,l+v.top];return f?k.reverse():k},getXDomainMinMax:function getXDomainMinMax(t,e){var n=this.config["axis_x_".concat(e)];return dh(n)?this.isTimeSeries()?this.parseDate(n):n:Fh(e,t.map(function(t){return Fh(e,t.values.map(function(t){return t.x}))}))},getXDomainMin:function getXDomainMin(t){return this.getXDomainMinMax(t,"min")},getXDomainMax:function getXDomainMax(t){return this.getXDomainMinMax(t,"max")},getXDomainPadding:function getXDomainPadding(t){var e,n,i=this.config,a=t[1]-t[0],r=i.axis_x_padding,o=n=this.isCategorized()?0:this.hasType("bar")?1<(e=this.getMaxDataCount())?a/(e-1)/2:.5:.01*a,s=n;return mh(r)&&kh(r)?(o=$g(r.left)?r.left:n,s=$g(r.right)?r.right:n):bh(i.axis_x_padding)&&(s=o=r),{left:o,right:s}},getXDomain:function getXDomain(t){var e=[this.getXDomainMin(t),this.getXDomainMax(t)],n=e[0],i=e[1],a=this.getXDomainPadding(e),r=0,o=0;return n-i!=0||this.isCategorized()||(i=this.isTimeSeries()?(n=new Date(.5*n.getTime()),new Date(1.5*i.getTime())):(n=0===n?1:.5*n,0===i?-1:1.5*i)),!n&&0!==n||(r=this.isTimeSeries()?new Date(n.getTime()-a.left):n-a.left),!i&&0!==i||(o=this.isTimeSeries()?new Date(i.getTime()+a.right):i+a.right),[r,o]},updateXDomain:function updateXDomain(t,e,n,i,a){var r=this,o=r.config.zoom_enabled;if(n&&(r.x.domain(a||Eh(r.getXDomain(t))),r.orgXDomain=r.x.domain(),o&&r.zoom.updateScaleExtent(),r.subX.domain(r.x.domain()),r.brush&&r.brush.scale(r.subX)),e){var s=a||!r.brush||wh(r)?r.orgXDomain:uh(r).map(r.subX.invert);r.x.domain(s),o&&r.zoom.updateScaleExtent()}return i&&r.x.domain(r.trimXDomain(r.x.orgDomain())),r.x.domain()},trimXDomain:function trimXDomain(t){var e=this.getZoomDomain(),n=k()(e,2),i=n[0],a=n[1];return t[0]<=i&&(t[1]=+t[1]+(i-t[0]),t[0]=i),a<=t[1]&&(t[0]=+t[0]-(t[1]-a),t[1]=a),t}}),xh($n.prototype,{isX:function isX(t){var e=this.config,n=e.data_x&&t===e.data_x,i=kh(e.data_xs)&&function(e,n){var i=!1;return Object.keys(e).forEach(function(t){return e[t]===n&&(i=!0)}),i}(e.data_xs,t);return n||i},isNotX:function isNotX(t){return!this.isX(t)},isStackNormalized:function isStackNormalized(){var t=this.config;return t.data_stack_normalize&&t.data_groups.length},isGrouped:function isGrouped(e){return this.config.data_groups.map(function(t){return 0<=t.indexOf(e)})[0]},getXKey:function getXKey(t){var e=this.config;return e.data_x?e.data_x:kh(e.data_xs)?e.data_xs[t]:null},getXValuesOfXKey:function getXValuesOfXKey(e,t){var n,i=this;return(t&&kh(t)?i.mapToIds(t):[]).forEach(function(t){i.getXKey(t)===e&&(n=i.data.xs[t])}),n},getIndexByX:function getIndexByX(t,e){return e?e.indexOf(ah(t)?t:+t):(this.filterByX(this.data.targets,t)[0]||{index:null}).index},getXValue:function getXValue(t,e){return t in this.data.xs&&this.data.xs[t]&&$g(this.data.xs[t][e])?this.data.xs[t][e]:e},getOtherTargetXs:function getOtherTargetXs(){var t=Object.keys(this.data.xs);return t.length?this.data.xs[t[0]]:null},getOtherTargetX:function getOtherTargetX(t){var e=this.getOtherTargetXs();return e&&t<e.length?e[t]:null},addXs:function addXs(e){var n=this;Object.keys(e).forEach(function(t){n.config.data_xs[t]=e[t]})},hasMultipleX:function hasMultipleX(e){return 1<Object.keys(e).map(function(t){return e[t]}).length},isMultipleX:function isMultipleX(){return kh(this.config.data_xs)||!this.config.data_xSort||this.hasType("bubble")||this.hasType("scatter")},addName:function addName(t){var e;return t&&(e=this.config.data_names[t.id],t.name=void 0===e?t.id:e),t},getAllValuesOnIndex:function getAllValuesOnIndex(e){var n=this;return n.filterTargetsToShow(n.data.targets).map(function(t){return n.addName(n.getValueOnIndex(t.values,e))})},getValueOnIndex:function getValueOnIndex(t,e){var n=t.filter(function(t){return t.index===e});return n.length?n[0]:null},updateTargetX:function updateTargetX(t,i){var a=this;t.forEach(function(n){n.values.forEach(function(t,e){t.x=a.generateTargetX(i[e],n.id,e)}),a.data.xs[n.id]=i})},updateTargetXs:function updateTargetXs(t,e){var n=this;t.forEach(function(t){e[t.id]&&n.updateTargetX([t],e[t.id])})},generateTargetX:function generateTargetX(t,e,n){var i=this.isCategorized()?n:t||n;return this.isTimeSeries()?i=t?this.parseDate(t):this.parseDate(this.getXValue(e,n)):this.isCustomX()&&!this.isCategorized()&&(i=$g(t)?+t:this.getXValue(e,n)),i},cloneTarget:function cloneTarget(t){return{id:t.id,id_org:t.id_org,values:t.values.map(function(t){return{x:t.x,value:t.value,id:t.id}})}},updateXs:function updateXs(){var e=this,t=e.data.targets;t.length&&(e.xs=[],t[0].values.forEach(function(t){e.xs[t.index]=t.x}))},getPrevX:function getPrevX(t){var e=this.xs[t-1];return dh(e)?e:null},getNextX:function getNextX(t){var e=this.xs[t+1];return dh(e)?e:null},getBaseValue:function getBaseValue(t){var e=t.value;return e&&this.isAreaRangeType(t)&&(e=this.getAreaRangeData(t,"mid")),e},getMinMaxValue:function getMinMaxValue(t){var i,a,r=this.getBaseValue.bind(this);return(t||this.data.targets.map(function(t){return t.values})).forEach(function(t,e){var n=t.map(r).filter(bh);i=Math.min.apply(Math,[e?i:1/0].concat(Ne()(n))),a=Math.max.apply(Math,[e?a:-1/0].concat(Ne()(n)))}),{min:i,max:a}},getMinMaxData:function getMinMaxData(){var i=this,t="$minMaxData",e=i.getCache(t);if(!e){var n=i.data.targets.map(function(t){return t.values}),a=i.getMinMaxValue(n),r=[],o=[];n.forEach(function(t){var e=i.getFilteredDataByValue(t,a.min),n=i.getFilteredDataByValue(t,a.max);e.length&&(r=r.concat(e)),n.length&&(o=o.concat(n))}),i.addCache(t,e={min:r,max:o})}return e},getTotalPerIndex:function getTotalPerIndex(){var n=this.getCache("$totalPerIndex");return this.isStackNormalized()&&!n&&(n=[],this.data.targets.forEach(function(t){t.values.forEach(function(t,e){n[e]||(n[e]=0),n[e]+=bh(t.value)?t.value:0})})),n},getTotalDataSum:function getTotalDataSum(){var t="$totalDataSum",e=this.getCache(t);if(!e){var n=Ch(this.data.targets.map(function(t){return t.values})).map(function(t){return t.value}).reduce(function(t,e){return t+e});this.addCache(t,e=n)}return e},getFilteredDataByValue:function getFilteredDataByValue(t,e){var n=this;return t.filter(function(t){return n.getBaseValue(t)===e})},getMaxDataCount:function getMaxDataCount(){return Math.max.apply(Math,Ne()(this.data.targets.map(function(t){return t.values.length})))},getMaxDataCountTarget:function getMaxDataCountTarget(t){var e,n=t.length,i=0;return 1<n?t.forEach(function(t){t.values.length>i&&(i=(e=t).values.length)}):e=n?t[0]:null,e},mapToIds:function mapToIds(t){return t.map(function(t){return t.id})},mapToTargetIds:function mapToTargetIds(t){return t?lh(t)?t.concat():[t]:this.mapToIds(this.data.targets)},hasTarget:function hasTarget(t,e){for(var n,i=this.mapToIds(t),a=0;n=i[a];a++)if(n===e)return!0;return!1},isTargetToShow:function isTargetToShow(t){return this.hiddenTargetIds.indexOf(t)<0},isLegendToShow:function isLegendToShow(t){return this.hiddenLegendIds.indexOf(t)<0},filterTargetsToShow:function filterTargetsToShow(t){var e=this;return(t||e.data.targets).filter(function(t){return e.isTargetToShow(t.id)})},mapTargetsToUniqueXs:function mapTargetsToUniqueXs(t){var e=[];return t&&t.length&&(e=function(t){return t.filter(function(t,e,n){return n.indexOf(t)===e})}(Ch(t.map(function(t){return t.values.map(function(t){return+t.x})}))),e=this.isTimeSeries()?e.map(function(t){return new Date(+t)}):e.map(function(t){return+t})),Eh(e)},addHiddenTargetIds:function addHiddenTargetIds(t){this.hiddenTargetIds=this.hiddenTargetIds.concat(t)},removeHiddenTargetIds:function removeHiddenTargetIds(e){this.hiddenTargetIds=this.hiddenTargetIds.filter(function(t){return e.indexOf(t)<0})},addHiddenLegendIds:function addHiddenLegendIds(t){this.hiddenLegendIds=this.hiddenLegendIds.concat(t)},removeHiddenLegendIds:function removeHiddenLegendIds(e){this.hiddenLegendIds=this.hiddenLegendIds.filter(function(t){return e.indexOf(t)<0})},getValuesAsIdKeyed:function getValuesAsIdKeyed(t){var i=this,e={},a=i.isMultipleX(),r=a?i.mapTargetsToUniqueXs(t).map(function(t){return ah(t)?t:+t}):null;return t.forEach(function(t){var n=[];t.values.forEach(function(t){var e=t.value;lh(e)?n.push.apply(n,Ne()(e)):mh(e)&&"high"in e?n.push.apply(n,Ne()(Object.values(e))):a?n[i.getIndexByX(t.x,r)]=e:n.push(e)}),e[t.id]=n}),e},checkValueInTargets:function checkValueInTargets(t,e){for(var n,i=Object.keys(t),a=0;a<i.length;a++){n=t[i[a]].values;for(var r=0;r<n.length;r++)if(e(n[r].value))return!0}return!1},hasMultiTargets:function hasMultiTargets(){return 1<this.filterTargetsToShow().length},hasNegativeValueInTargets:function hasNegativeValueInTargets(t){return this.checkValueInTargets(t,function(t){return t<0})},hasPositiveValueInTargets:function hasPositiveValueInTargets(t){return this.checkValueInTargets(t,function(t){return 0<t})},_checkOrder:function _checkOrder(t){var e=this.config.data_order;return ah(e)&&e.toLowerCase()===t},isOrderDesc:function isOrderDesc(){return this._checkOrder("desc")},isOrderAsc:function isOrderAsc(){return this._checkOrder("asc")},orderTargets:function orderTargets(t){var e=this.config,n=Ne()(t),a=this.isOrderAsc(),i=this.isOrderDesc();return a||i?n.sort(function(t,e){function kka(t,e){return t+Math.abs(e.value)}var n=t.values.reduce(kka,0),i=e.values.reduce(kka,0);return a?i-n:n-i}):_g(e.data_order)&&n.sort(e.data_order),n},filterByX:function filterByX(t,e){return Ch(t.map(function(t){return t.values})).filter(function(t){return t.x-e==0})},filterRemoveNull:function filterRemoveNull(t){var e=this;return t.filter(function(t){return $g(e.getBaseValue(t))})},filterByXDomain:function filterByXDomain(t,e){return t.map(function(t){return{id:t.id,id_org:t.id_org,values:t.values.filter(function(t){return e[0]<=t.x&&t.x<=e[1]})}})},hasDataLabel:function hasDataLabel(){var t=this.config.data_labels;return eh(t)&&t||ih(t)&&kh(t)},getDataLabelLength:function getDataLabelLength(t,e,n){var i=this,a=[0,0];return i.selectChart.select("svg").selectAll(".dummy").data([t,e]).enter().append("text").text(function(t){return i.dataLabelFormat(t.id)(t)}).each(function(t,e){a[e]=1.3*this.getBoundingClientRect()[n]}).remove(),a},isNoneArc:function isNoneArc(t){return this.hasTarget(this.data.targets,t.id)},isArc:function isArc(t){return"data"in t&&this.hasTarget(this.data.targets,t.data.id)},findSameXOfValues:function findSameXOfValues(t,e){var n,i=t[e].x,a=[];for(n=e-1;0<=n&&i===t[n].x;n--)a.push(t[n]);for(n=e;n<t.length&&i===t[n].x;n++)a.push(t[n]);return a},findClosestFromTargets:function findClosestFromTargets(t,e){var n=this,i=t.map(function(t){return n.findClosest(t.values,e)});return n.findClosest(i,e)},findClosest:function findClosest(t,n){var i,a=this,r=a.config.point_sensitivity;return t.filter(function(t){return t&&a.isBarType(t.id)}).forEach(function(t){var e=a.main.select(".".concat(Oe.bars).concat(a.getTargetSelectorSuffix(t.id)," .").concat(Oe.bar,"-").concat(t.index)).node();!i&&a.isWithinBar(e)&&(i=t)}),t.filter(function(t){return t&&!a.isBarType(t.id)}).forEach(function(t){var e=a.dist(t,n);e<r&&(r=e,i=t)}),i},dist:function dist(t,e){var n=this.config.axis_rotated,i=n?1:0,a=n?0:1,r=this.circleY(t,t.index),o=(this.zoomScale||this.x)(t.x);return Math.sqrt(Math.pow(o-e[i],2)+Math.pow(r-e[a],2))},convertValuesToStep:function convertValuesToStep(t){var e=this.config,n=e.axis_rotated,i=e.line_step_type,a=this.isCategorized(),r=lh(t)?t.concat():[t];if(!n&&!a)return t;var o=r[0].id,s=r[0].x-1,c=r[0].value;return a&&r.unshift({x:s,value:c,id:o}),"step-after"===i&&r.unshift({x:s-1,value:c,id:o}),c=r[(s=r.length)-1].value,a&&r.push({x:s,value:c,id:o}),"step-before"===i&&r.push({x:s+1,value:c,id:o}),r},convertValuesToRange:function convertValuesToRange(t){var e=lh(t)?t.concat():[t],i=[];return e.forEach(function(t){var e=t.x,n=t.id;i.push({x:e,id:n,value:t.value[0]}),i.push({x:e,id:n,value:t.value[2]})}),i},updateDataAttributes:function updateDataAttributes(t,e){var n=this.config["data_".concat(t)];return ch(e)||(Object.keys(e).forEach(function(t){n[t]=e[t]}),this.redraw({withLegend:!0})),n},getAreaRangeData:function getAreaRangeData(t,e){var n=t.value;if(lh(n)){var i=["high","mid","low"].indexOf(e);return-1===i?null:n[i]}return n[e]},getRatio:function getRatio(t,e,n){var i=this,a=i.config,r=i.api,o=0;if(e&&r.data.shown.call(r).length){var s=r.data.values.bind(r);if(o=e.ratio||e.value,"arc"===t)if(i.pie.padAngle()()){var c=i.getTotalDataSum();i.hiddenTargetIds.length&&(c-=s(i.hiddenTargetIds).reduce(function(t,e){return t+e})),o=e.value/c}else o=(e.endAngle-e.startAngle)/(Math.PI*(i.hasType("gauge")&&!a.gauge_fullCircle?1:2));else if("index"===t){var u=this.getTotalPerIndex();if(i.hiddenTargetIds.length){var l=s(i.hiddenTargetIds,!1);l.length&&(l=l.reduce(function(t,n){return t.map(function(t,e){return(bh(t)?t:0)+n[e]})}),u=u.map(function(t,e){return t-l[e]}))}e.ratio=bh(e.value)&&u&&0<u[e.index]?e.value/u[e.index]:0,o=e.ratio}else"radar"===t&&(o=parseFloat(Math.max(e.value,0))/i.maxValue*a.radar_size_ratio)}return n&&o?100*o:o}});var Zn={},Kn={};function objectConverter(t){return new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}")}function inferColumns(t){var n=Object.create(null),i=[];return t.forEach(function(t){for(var e in t)e in n||i.push(n[e]=e)}),i}function dsv_pad(t,e){var n=t+"",i=n.length;return i<e?new Array(e-i+1).join(0)+n:n}function formatDate(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),i=t.getUTCSeconds(),a=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":function dsv_formatYear(t){return t<0?"-"+dsv_pad(-t,6):9999<t?"+"+dsv_pad(t,6):dsv_pad(t,4)}(t.getUTCFullYear())+"-"+dsv_pad(t.getUTCMonth()+1,2)+"-"+dsv_pad(t.getUTCDate(),2)+(a?"T"+dsv_pad(e,2)+":"+dsv_pad(n,2)+":"+dsv_pad(i,2)+"."+dsv_pad(a,3)+"Z":i?"T"+dsv_pad(e,2)+":"+dsv_pad(n,2)+":"+dsv_pad(i,2)+"Z":n||e?"T"+dsv_pad(e,2)+":"+dsv_pad(n,2)+"Z":"")}function yj(i){var e=new RegExp('["'+i+"\n\r]"),l=i.charCodeAt(0);function parseRows(i,t){var e,n=[],a=i.length,r=0,o=0,s=a<=0,c=!1;function token(){if(s)return Kn;if(c)return c=!1,Zn;var t,e,n=r;if(34===i.charCodeAt(n)){for(;r++<a&&34!==i.charCodeAt(r)||34===i.charCodeAt(++r););return(t=r)>=a?s=!0:10===(e=i.charCodeAt(r++))?c=!0:13===e&&(c=!0,10===i.charCodeAt(r)&&++r),i.slice(n+1,t-1).replace(/""/g,'"')}for(;r<a;){if(10===(e=i.charCodeAt(t=r++)))c=!0;else if(13===e)c=!0,10===i.charCodeAt(r)&&++r;else if(e!==l)continue;return i.slice(n,t)}return s=!0,i.slice(n,a)}for(10===i.charCodeAt(a-1)&&--a,13===i.charCodeAt(a-1)&&--a;(e=token())!==Kn;){for(var u=[];e!==Zn&&e!==Kn;)u.push(e),e=token();t&&null==(u=t(u,o++))||n.push(u)}return n}function preformatBody(t,n){return t.map(function(e){return n.map(function(t){return formatValue(e[t])}).join(i)})}function formatRow(t){return t.map(formatValue).join(i)}function formatValue(t){return null==t?"":t instanceof Date?formatDate(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function parse(t,n){var i,a,e=parseRows(t,function(t,e){if(i)return i(t,e-1);a=t,i=n?function customConverter(n,i){var a=objectConverter(n);return function(t,e){return i(a(t),e,n)}}(t,n):objectConverter(t)});return e.columns=a||[],e},parseRows:parseRows,format:function format(t,e){return null==e&&(e=inferColumns(t)),[e.map(formatValue).join(i)].concat(preformatBody(t,e)).join("\n")},formatBody:function formatBody(t,e){return null==e&&(e=inferColumns(t)),preformatBody(t,e).join("\n")},formatRows:function formatRows(t){return t.map(formatRow).join("\n")}}}var Qn=yj(","),Jn=Qn.parse,ti=Qn.parseRows,ei=(Qn.format,Qn.formatBody,Qn.formatRows,yj("\t")),ni=ei.parse,ii=ei.parseRows;ei.format,ei.formatBody,ei.formatRows;xh($n.prototype,{convertData:function convertData(n,t){var i;if(n.bindto?(i={},["url","mimeType","headers","keys","json","keys","rows","columns"].forEach(function(t){var e="data_".concat(t);e in n&&(i[t]=n[e])})):i=n,i.url&&t)this.convertUrlToData(i.url,i.mimeType,i.headers,i.keys,t);else if(i.json)i=this.convertJsonToData(i.json,i.keys);else if(i.rows)i=this.convertRowsToData(i.rows);else if(i.columns)i=this.convertColumnsToData(i.columns);else if(n.bindto)throw Error("url or json or rows or columns is required.");return i},convertUrlToData:function convertUrlToData(e,t,n,i,a){var r=this,o=1<arguments.length&&void 0!==t?t:"csv",s=2<arguments.length?n:void 0,c=3<arguments.length?i:void 0,u=4<arguments.length?a:void 0,l=new XMLHttpRequest;s&&Object.keys(s).forEach(function(t){l.setRequestHeader(t,s[t])}),l.open("GET",e),l.onreadystatechange=function(){if(4===l.readyState){if(200!==l.status)throw new Error("".concat(e,": Something went wrong loading!"));var t=l.responseText;t&&u.call(r,r["convert".concat(yh(o),"ToData")]("json"===o?JSON.parse(t):t,c))}},l.send()},_convertCsvTsvToData:function _convertCsvTsvToData(t,e){var n,i=t.rows(e);return 1===i.length?(n=[{}],i[0].forEach(function(t){n[0][t]=null})):n=t.parse(e),n},convertCsvToData:function convertCsvToData(t){return this._convertCsvTsvToData({rows:ti,parse:Jn},t)},convertTsvToData:function convertTsvToData(t){return this._convertCsvTsvToData({rows:ii,parse:ni},t)},convertJsonToData:function convertJsonToData(n,t){var e,i,a=this,r=this.config,o=[];if(lh(n)){var s=t||r.data_keys;s.x?(e=s.value.concat(s.x),r.data_x=s.x):e=s.value,o.push(e),n.forEach(function(n){var t=e.map(function(t){var e=a.findValueInJson(n,t);return ch(e)&&(e=null),e});o.push(t)}),i=this.convertRowsToData(o)}else Object.keys(n).forEach(function(t){var e=n[t].concat();e.unshift(t),o.push(e)}),i=this.convertColumnsToData(o);return i},findValueInJson:function findValueInJson(t,e){if(void 0!==t[e])return t[e];var n=e.replace(/\[(\w+)\]/g,".$1").replace(/^\./,"").split("."),i=t;return n.some(function(t){return!(i=i&&t in i?i[t]:void 0)}),i},convertRowsToData:function convertRowsToData(t){for(var e=t[0],n=[],i=1,a=t.length;i<a;i++){for(var r={},o=0,s=t[i].length;o<s;o++){if(ch(t[i][o]))throw new Error("Source data is missing a component at (".concat(i,", ").concat(o,")!"));r[e[o]]=t[i][o]}n.push(r)}return n},convertColumnsToData:function convertColumnsToData(t){for(var e=[],n=0,i=t.length;n<i;n++)for(var a=t[n][0],r=1,o=t[n].length;r<o;r++){if(ch(e[r-1])&&(e[r-1]={}),ch(t[n][r]))throw new Error("Source data is missing a component at (".concat(n,", ").concat(r,")!"));e[r-1][a]=t[n][r]}return e},convertDataToTargets:function convertDataToTargets(t,i){var a,r=this,h=this,d=h.config,e=Object.keys(t[0]||{}),n=e.length?e.filter(h.isNotX,h):[],o=e.length?e.filter(h.isX,h):[];n.forEach(function(n){var e=r.getXKey(n);r.isCustomX()||r.isTimeSeries()?0<=o.indexOf(e)?a=(i&&h.data.xs[n]||[]).concat(t.map(function(t){return t[e]}).filter($g).map(function(t,e){return h.generateTargetX(t,n,e)})):d.data_x?a=r.getOtherTargetXs():kh(d.data_xs)&&(a=h.getXValuesOfXKey(e,h.data.targets)):a=t.map(function(t,e){return e}),a&&(r.data.xs[n]=a)}),n.forEach(function(t){if(!a)throw new Error('x is not defined for id = "'.concat(t,'".'))});var s=n.map(function(r,o){var s=d.data_idConverter(r),c=h.getXKey(r),u=h.isCustomX()&&h.isCategorized(),l=u&&t.map(function(t){return t.x}).every(function(t){return-1<d.axis_x_categories.indexOf(t)});return{id:s,id_org:r,values:t.map(function(t,e){var n,i=t[c],a=t[r];return a=null===a||isNaN(a)?lh(a)||mh(a)&&a.high?a:null:+t[r],u&&0===o&&!ch(i)?(l||0!==o||0!==e||(d.axis_x_categories=[]),-1===(n=d.axis_x_categories.indexOf(i))&&(n=d.axis_x_categories.length,d.axis_x_categories.push(i))):n=h.generateTargetX(i,r,e),(ch(t[r])||h.data.xs[r].length<=e)&&(n=void 0),{x:n,value:a,id:s}}).filter(function(t){return dh(t.x)})}});return s.forEach(function(t){d.data_xSort&&(t.values=t.values.sort(function(t,e){return(t.x||0===t.x?t.x:1/0)-(e.x||0===e.x?e.x:1/0)})),t.values.forEach(function(t,e){return t.index=e}),h.data.xs[t.id].sort(function(t,e){return t-e})}),h.hasNegativeValue=h.hasNegativeValueInTargets(s),h.hasPositiveValue=h.hasPositiveValueInTargets(s),d.data_type&&h.setTargetType(h.mapToIds(s).filter(function(t){return!(t in d.data_types)}),d.data_type),s.forEach(function(t){return h.addCache(t.id_org,t,!0)}),s}}),xh($n.prototype,{load:function load(t,n){var i=this,a=t;a&&(n.filter&&(a=a.filter(n.filter)),(n.type||n.types)&&a.forEach(function(t){var e=n.types&&n.types[t.id]||n.type;i.setTargetType(t.id,e)}),i.data.targets.forEach(function(t){for(var e=0;e<a.length;e++)if(t.id===a[e].id){t.values=a[e].values,a.splice(e,1);break}}),i.data.targets=i.data.targets.concat(a)),i.updateTargets(i.data.targets),i.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),n.done&&n.done()},loadFromArgs:function loadFromArgs(e){var n=this;if(n.config){n.resetCache();var t=e.data||n.convertData(e,function(t){return n.load(n.convertDataToTargets(t),e)});n.load(t?n.convertDataToTargets(t):null,e)}},unload:function unload(t,e){var n=this,i=e,a=t;return n.resetCache(),i=i||function(){},(a=a.filter(function(t){return n.hasTarget(n.data.targets,t)}))&&0!==a.length?(n.svg.selectAll(a.map(function(t){return n.selectorTarget(t)})).transition().style("opacity","0").remove().call(n.endall,i),void a.forEach(function(e){n.withoutFadeIn[e]=!1,n.legend&&n.legend.selectAll(".".concat(Oe.legendItem).concat(n.getTargetSelectorSuffix(e))).remove(),n.data.targets=n.data.targets.filter(function(t){return t.id!==e})})):void i()}}),xh($n.prototype,{categoryName:function categoryName(t){var e=this.config;return t<e.axis_x_categories.length?e.axis_x_categories[t]:t}}),xh($n.prototype,{initEventRect:function initEventRect(){this.main.select(".".concat(Oe.chart)).append("g").attr("class",Oe.eventRects).style("fill-opacity","0")},redrawEventRect:function redrawEventRect(){var t,e=this,n=e.config,i=e.isMultipleX(),a=n.zoom_enabled,r=e.main.select(".".concat(Oe.eventRects)).style("cursor",a&&"drag"!==a.type?n.axis_rotated?"ns-resize":"ew-resize":null).classed(Oe.eventRectsMultiple,i).classed(Oe.eventRectsSingle,!i);if(r.selectAll(".".concat(Oe.eventRect)).remove(),e.eventRect=r.selectAll(".".concat(Oe.eventRect)),i)t=e.eventRect.data([0]),t=e.generateEventRectsForMultipleXs(t.enter()).merge(t);else{var o=e.getMaxDataCountTarget(e.data.targets);r.datum(o?o.values:[]),e.eventRect=r.selectAll(".".concat(Oe.eventRect)),(t=e.eventRect.data(function(t){return t})).exit().remove(),t=e.generateEventRectsForSingleX(t.enter()).merge(t)}e.updateEventRect(t),"touch"!==e.inputType||e.svg.on("touchstart.eventRect")||e.hasArcType()||e.bindTouchOnEventRect(i)},bindTouchOnEventRect:function bindTouchOnEventRect(i){function Mpa(){var t=st.changedTouches[0];return lt(sn.document.elementFromPoint(t.clientX,t.clientY))}function Opa(t){if(i)r.selectRectForMultipleXs(t);else{var e=Mpa(),n=function(t){var e=t&&t.attr("class")&&1*t.attr("class").replace(new RegExp("(".concat(Oe.eventRect,"-?|s)"),"g"),"");return!isNaN(e)&&null!==e||(e=-1),e}(e);r.callOverOutForTouch(n),-1===n?r.unselectRect():r.selectRectForSingle(t,e,n)}}var a,r=this,o=r.config,t=o.interaction_inputType_touch.preventDefault,s=eh(t)&&t||!1,c=!isNaN(t)&&t||null;r.svg.on("touchstart.eventRect touchmove.eventRect",function(){var t=Mpa();if(!t.empty()&&t.classed(Oe.eventRect)){if(r.dragging||r.flowing||r.hasArcType())return;(function(t){var e=t.type,n=t.changedTouches[0]["client".concat(o.axis_rotated?"Y":"X")];"touchstart"===e?s?t.preventDefault():null!==c&&(a=n):"touchmove"===e&&(s||!0===a||null!==c&&Math.abs(a-n)>=c)&&(a=!0,t.preventDefault())})(st),Opa(this)}else r.unselectRect(),r.callOverOutForTouch()}).on("touchend.eventRect",function(){var t=Mpa();!t.empty()&&t.classed(Oe.eventRect)&&(r.hasArcType()||!r.toggleShape||r.cancelClick)&&r.cancelClick&&(r.cancelClick=!1)})},updateEventRect:function updateEventRect(t){var e,n,i,a,r=this,o=r.config,s=r.zoomScale||r.x,c=t||r.eventRect.data(),u=o.axis_rotated;if(r.isMultipleX())n=e=0,i=r.width,a=r.height;else{var l,h;if(r.isCategorized())l=r.getEventRectWidth(),h=function(t){return s(t.x)-l/2};else{r.updateXs();var d=function(t){var e=t.index;return{prev:r.getPrevX(e),next:r.getNextX(e)}};l=function(t){var e=d(t);return null===e.prev&&null===e.next?u?r.height:r.width:(null===e.prev&&(e.prev=s.domain()[0]),null===e.next&&(e.next=s.domain()[1]),Math.max(0,(s(e.next)-s(e.prev))/2))},h=function(t){var e=d(t),n=r.data.xs[t.id][t.index];return null===e.prev&&null===e.next?0:(null===e.prev&&(e.prev=s.domain()[0]),(s(n)+s(e.prev))/2)}}e=u?0:h,n=u?h:0,i=u?r.width:l,a=u?l:r.height}c.attr("class",r.classEvent.bind(r)).attr("x",e).attr("y",n).attr("width",i).attr("height",a)},selectRectForSingle:function selectRectForSingle(n,i,a){var r=this,o=r.config,s=o.data_selection_enabled,c=o.data_selection_grouped,u=o.tooltip_grouped,t=r.getAllValuesOnIndex(a);u&&(r.showTooltip(t,n),r.showXGridFocus(t),!s||c)||r.main.selectAll(".".concat(Oe.shape,"-").concat(a)).each(function(){lt(this).classed(Oe.EXPANDED,!0),s&&i.style("cursor",c?"pointer":null),u||(r.hideXGridFocus(),r.hideTooltip(),c||r.expandCirclesBars(a))}).filter(function(t){return r.isWithinShape(this,t)}).call(function(t){var e=t.data();s&&(c||o.data_selection_isselectable(e))&&i.style("cursor","pointer"),u||(r.showTooltip(e,n),r.showXGridFocus(e),r.unexpandCircles(),t.each(function(t){return r.expandCirclesBars(a,t.id)}))})},expandCirclesBars:function expandCirclesBars(t,e,n){this.config.point_focus_expand_enabled&&this.expandCircles(t,e,n),this.expandBars(t,e,n)},selectRectForMultipleXs:function selectRectForMultipleXs(t){var e=this,n=e.config,i=e.filterTargetsToShow(e.data.targets);if(!e.dragging&&!e.hasArcType(i)){var a=dt(t),r=e.findClosestFromTargets(i,a);if(!e.mouseover||r&&r.id===e.mouseover.id||(n.data_onout.call(e.api,e.mouseover),e.mouseover=void 0),!r)return void e.unselectRect();var o=(e.isBubbleType(r)||e.isScatterType(r)||!n.tooltip_grouped?[r]:e.filterByX(i,r.x)).map(function(t){return e.addName(t)});e.showTooltip(o,t),e.expandCirclesBars(r.index,r.id,!0),e.showXGridFocus(o),(e.isBarType(r.id)||e.dist(r,a)<n.point_sensitivity)&&(e.svg.select(".".concat(Oe.eventRect)).style("cursor","pointer"),e.mouseover||(n.data_onover.call(e.api,r),e.mouseover=r))}},unselectRect:function unselectRect(){this.svg.select(".".concat(Oe.eventRect)).style("cursor",null),this.hideXGridFocus(),this.hideTooltip(),this._handleLinkedCharts(!1),this.unexpandCircles(),this.unexpandBars()},setOverOut:function setOverOut(t,e){var n=this.config,i=mh(e);if(i||-1!==e){var a=n[t?"data_onover":"data_onout"].bind(this.api);n.color_onover&&this.setOverColor(t,e,i),i?a(e):(t&&this.expandCirclesBars(e,null,!0),this.isMultipleX()||this.main.selectAll(".".concat(Oe.shape,"-").concat(e)).each(a))}},callOverOutForTouch:function callOverOutForTouch(t){var e=this.callOverOutForTouch,n=e.last;(mh(t)&&n?t.id!==n.id:t!==n)&&((n||bh(n))&&this.setOverOut(!1,n),(t||bh(t))&&this.setOverOut(!0,t),e.last=t)},getDraggableSelection:function getDraggableSelection(){var t=this,e=t.config;return e.interaction_enabled&&e.data_selection_draggable&&t.drag?Ig().on("drag",function(){t.drag(dt(this))}).on("start",function(){t.dragstart(dt(this))}).on("end",function(){t.dragend()}):function(){}},generateEventRectsForSingleX:function generateEventRectsForSingleX(t){var i=this,e=i.config,n=t.append("rect").attr("class",i.classEvent.bind(i)).style("cursor",e.data_selection_enabled&&e.data_selection_grouped?"pointer":null).on("click",function(t){i.clickHandlerForSingleX.bind(this)(t,i)}).call(i.getDraggableSelection());return"mouse"===i.inputType&&n.on("mouseover",function(t){i.dragging||i.flowing||i.hasArcType()||i.setOverOut(!0,t.index)}).on("mousemove",function(t){if(!(i.dragging||i.flowing||i.hasArcType())){var e=t.index,n=i.svg.select(".".concat(Oe.eventRect,"-").concat(e));i.isStepType(t)&&"step-after"===i.config.line_step_type&&dt(this)[0]<i.x(i.getXValue(t.id,e))&&(e-=1),-1===e?i.unselectRect():i.selectRectForSingle(this,n,e)}}).on("mouseout",function(t){!i.config||i.hasArcType()||(i.unselectRect(),i.setOverOut(!1,t.index))}),n},clickHandlerForSingleX:function clickHandlerForSingleX(t,e){var n=e,i=n.config;if(n.hasArcType()||!n.toggleShape||n.cancelClick)n.cancelClick&&(n.cancelClick=!1);else{var a=t.index;n.main.selectAll(".".concat(Oe.shape,"-").concat(a)).each(function(t){(i.data_selection_grouped||n.isWithinShape(this,t))&&(n.toggleShape(this,t,a),i.data_onclick.call(n.api,t,this))})}},generateEventRectsForMultipleXs:function generateEventRectsForMultipleXs(t){var e=this,n=t.append("rect").attr("x",0).attr("y",0).attr("width",e.width).attr("height",e.height).attr("class",Oe.eventRect).on("click",function(){e.clickHandlerForMultipleXS.bind(this)(e)}).call(e.getDraggableSelection());return"mouse"===e.inputType&&n.on("mouseover mousemove",function(){e.selectRectForMultipleXs(this)}).on("mouseout",function(){!e.config||e.hasArcType()||e.unselectRect()}),n},clickHandlerForMultipleXS:function clickHandlerForMultipleXS(t){var e=t,n=e.config,i=e.filterTargetsToShow(e.data.targets);if(!e.hasArcType(i)){var a=dt(this),r=e.findClosestFromTargets(i,a);!r||(e.isBarType(r.id)||e.dist(r,a)<n.point_sensitivity)&&e.main.selectAll(".".concat(Oe.shapes).concat(e.getTargetSelectorSuffix(r.id))).selectAll(".".concat(Oe.shape,"-").concat(r.index)).each(function(){(n.data_selection_grouped||e.isWithinShape(this,r))&&(e.toggleShape(this,r,r.index),n.data_onclick.call(e.api,r,this))})}},dispatchEvent:function dispatchEvent(t,e,n){var i=this.isMultipleX(),a=".".concat(i?Oe.eventRect:"".concat(Oe.eventRect,"-").concat(e)),r=this.main.select(a).node(),o=r.getBoundingClientRect(),s=o.width,c=o.left,u=o.top,l=c+(n?n[0]:0)+(i?0:s/2),h=u+(n?n[1]:0);un[/^(mouse|click)/.test(t)?"mouse":"touch"](r,t,{screenX:l,screenY:h,clientX:l,clientY:h})}}),xh($n.prototype,{setContainerSize:function setContainerSize(){this.currentWidth=this.getCurrentWidth(),this.currentHeight=this.getCurrentHeight()},getCurrentWidth:function getCurrentWidth(){return this.config.size_width||this.getParentWidth()},getCurrentHeight:function getCurrentHeight(){var t=this.config,e=t.size_height||this.getParentHeight();return 0<e?e:320/(this.hasType("gauge")&&!t.gauge_fullCircle?2:1)},getAxisSize:function getAxisSize(t){var e=this.config.axis_rotated;return e&&"x"===t||!e&&/y2?/.test(t)?this.getAxisWidthByAxisId(t,!0):this.getHorizontalAxisHeight(t)},getCurrentPaddingTop:function getCurrentPaddingTop(){var t=this.config,e=t.axis_y2_axes.length,n=$g(t.padding_top)?t.padding_top:0;return this.title&&this.title.node()&&(n+=this.getTitlePadding()),e&&t.axis_rotated&&(n+=this.getHorizontalAxisHeight("y2")*e),n},getCurrentPaddingBottom:function getCurrentPaddingBottom(){var t=this.config,e=t.axis_rotated?"y":"x",n=t["axis_".concat(e,"_axes")].length;return($g(t.padding_bottom)?t.padding_bottom:0)+(n?this.getHorizontalAxisHeight(e)*n:0)},getCurrentPaddingLeft:function getCurrentPaddingLeft(t){var e=this.config,n=e.axis_rotated,i=n?"x":"y",a=e["axis_".concat(i,"_axes")].length,r=this.getAxisWidthByAxisId(i,t);return($g(e.padding_left)?e.padding_left:n?e.axis_x_show?Math.max(fh(r),40):1:!e.axis_y_show||e.axis_y_inner?this.axis.getYAxisLabelPosition().isOuter?30:1:fh(r))+r*a},getCurrentPaddingRight:function getCurrentPaddingRight(){var t=this.config,e=this.isLegendRight?this.getLegendWidth()+20:0,n=t.axis_y2_axes.length,i=this.getAxisWidthByAxisId("y2");return($g(t.padding_right)?t.padding_right+1:t.axis_rotated?10+e:!t.axis_y2_show||t.axis_y2_inner?2+e+(this.axis.getY2AxisLabelPosition().isOuter?20:0):fh(i)+e)+i*n},getParentRectValue:function getParentRectValue(t){for(var e,n="offset".concat(yh(t)),i=this.selectChart.node();!e&&i&&"BODY"!==i.tagName;){try{e=i.getBoundingClientRect()[t]}catch(t){n in i&&(e=i[n])}i=i.parentNode}if("width"===t){var a=sn.document.body.offsetWidth;a<e&&(e=a)}return e},getParentWidth:function getParentWidth(){return this.getParentRectValue("width")},getParentHeight:function getParentHeight(){var t=this.selectChart.style("height");return 0<t.indexOf("px")?parseInt(t,10):0},getSvgLeft:function getSvgLeft(t){var e=this.config,n=e.axis_rotated||!e.axis_rotated&&!e.axis_y_inner,i=e.axis_rotated?Oe.axisX:Oe.axisY,a=this.main.select(".".concat(i)).node(),r=a&&n?a.getBoundingClientRect():{right:0},o=this.selectChart.node().getBoundingClientRect(),s=this.hasArcType(),c=r.right-o.left-(s?0:this.getCurrentPaddingLeft(t));return 0<c?c:0},getAxisWidthByAxisId:function getAxisWidthByAxisId(t,e){var n=this.axis.getLabelPositionById(t);return this.axis.getMaxTickWidth(t,e)+(n.isInner?20:40)},getHorizontalAxisHeight:function getHorizontalAxisHeight(t){var e=this.config,n=e.axis_rotated,i=30;return"x"!==t||e.axis_x_show?"x"===t&&e.axis_x_height?e.axis_x_height:"y"!==t||e.axis_y_show?"y2"!==t||e.axis_y2_show?(("x"===t&&!n&&e.axis_x_tick_rotate||"y"===t&&n&&e.axis_y_tick_rotate)&&(i=30+this.axis.getMaxTickWidth(t)*Math.cos(Math.PI*(90-e["axis_".concat(t,"_tick_rotate")])/180)),i+(this.axis.getLabelPositionById(t).isInner?0:10)+("y2"!==t||n?0:-10)):this.rotated_padding_top:!e.legend_show||this.isLegendRight||this.isLegendInset?1:10:8},getEventRectWidth:function getEventRectWidth(){return Math.max(0,this.xAxis.tickInterval())}});var ai=Math.PI,ri=2*ai,oi=1e-6,si=ri-oi;function Path(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function path_path(){return new Path}Path.prototype=path_path.prototype={constructor:Path,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,i){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(t,e,n,i,a,r){this._+="C"+ +t+","+ +e+","+ +n+","+ +i+","+(this._x1=+a)+","+(this._y1=+r)},arcTo:function(t,e,n,i,a){t=+t,e=+e,n=+n,i=+i,a=+a;var r=this._x1,o=this._y1,s=n-t,c=i-e,u=r-t,l=o-e,h=u*u+l*l;if(a<0)throw new Error("negative radius: "+a);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(oi<h)if(Math.abs(l*s-c*u)>oi&&a){var d=n-r,f=i-o,g=s*s+c*c,p=d*d+f*f,_=Math.sqrt(g),m=Math.sqrt(h),x=a*Math.tan((ai-Math.acos((g+h-p)/(2*_*m)))/2),v=x/m,y=x/_;Math.abs(v-1)>oi&&(this._+="L"+(t+v*u)+","+(e+v*l)),this._+="A"+a+","+a+",0,0,"+ +(u*f<l*d)+","+(this._x1=t+y*s)+","+(this._y1=e+y*c)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,i,a,r){t=+t,e=+e;var o=(n=+n)*Math.cos(i),s=n*Math.sin(i),c=t+o,u=e+s,l=1^r,h=r?i-a:a-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+c+","+u:(Math.abs(this._x1-c)>oi||Math.abs(this._y1-u)>oi)&&(this._+="L"+c+","+u),n&&(h<0&&(h=h%ri+ri),si<h?this._+="A"+n+","+n+",0,1,"+l+","+(t-o)+","+(e-s)+"A"+n+","+n+",0,1,"+l+","+(this._x1=c)+","+(this._y1=u):oi<h&&(this._+="A"+n+","+n+",0,"+ +(ai<=h)+","+l+","+(this._x1=t+n*Math.cos(a))+","+(this._y1=e+n*Math.sin(a))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};var ci=path_path,ui=function(t){return function constant(){return t}},li=Math.abs,hi=Math.atan2,di=Math.cos,fi=Math.max,gi=Math.min,pi=Math.sin,_i=Math.sqrt,mi=1e-12,xi=Math.PI,vi=xi/2,yi=2*xi;function asin(t){return 1<=t?vi:t<=-1?-vi:Math.asin(t)}function arcInnerRadius(t){return t.innerRadius}function arcOuterRadius(t){return t.outerRadius}function arcStartAngle(t){return t.startAngle}function arcEndAngle(t){return t.endAngle}function arcPadAngle(t){return t&&t.padAngle}function cornerTangents(t,e,n,i,a,r,o){var s=t-n,c=e-i,u=(o?r:-r)/_i(s*s+c*c),l=u*c,h=-u*s,d=t+l,f=e+h,g=n+l,p=i+h,_=(d+g)/2,m=(f+p)/2,x=g-d,v=p-f,y=x*x+v*v,b=a-r,T=d*p-g*f,w=(v<0?-1:1)*_i(fi(0,b*b*y-T*T)),A=(T*v-x*w)/y,k=(-T*x-v*w)/y,C=(T*v+x*w)/y,S=(-T*x+v*w)/y,M=A-_,L=k-m,D=C-_,F=S-m;return D*D+F*F<M*M+L*L&&(A=C,k=S),{cx:A,cy:k,x01:-l,y01:-h,x11:A*(a/b-1),y11:k*(a/b-1)}}function ak(){var P=arcInnerRadius,N=arcOuterRadius,Y=ui(0),B=null,H=arcStartAngle,V=arcEndAngle,U=arcPadAngle,W=null;function arc(){var t,e,n=+P.apply(this,arguments),i=+N.apply(this,arguments),a=H.apply(this,arguments)-vi,r=V.apply(this,arguments)-vi,o=li(r-a),s=a<r;if(W=W||(t=ci()),i<n&&(e=i,i=n,n=e),mi<i)if(yi-mi<o)W.moveTo(i*di(a),i*pi(a)),W.arc(0,0,i,a,r,!s),mi<n&&(W.moveTo(n*di(r),n*pi(r)),W.arc(0,0,n,r,a,s));else{var c,u,l=a,h=r,d=a,f=r,g=o,p=o,_=U.apply(this,arguments)/2,m=mi<_&&(B?+B.apply(this,arguments):_i(n*n+i*i)),x=gi(li(i-n)/2,+Y.apply(this,arguments)),v=x,y=x;if(mi<m){var b=asin(m/n*pi(_)),T=asin(m/i*pi(_));(g-=2*b)>mi?(d+=b*=s?1:-1,f-=b):(g=0,d=f=(a+r)/2),(p-=2*T)>mi?(l+=T*=s?1:-1,h-=T):(p=0,l=h=(a+r)/2)}var w=i*di(l),A=i*pi(l),k=n*di(f),C=n*pi(f);if(mi<x){var S,M=i*di(h),L=i*pi(h),D=n*di(d),F=n*pi(d);if(o<xi&&(S=function intersect(t,e,n,i,a,r,o,s){var c=n-t,u=i-e,l=o-a,h=s-r,d=h*c-l*u;if(!(d*d<mi))return[t+(d=(l*(e-r)-h*(t-a))/d)*c,e+d*u]}(w,A,D,F,M,L,k,C))){var R=w-S[0],E=A-S[1],z=M-S[0],X=L-S[1],I=1/pi(function acos(t){return 1<t?0:t<-1?xi:Math.acos(t)}((R*z+E*X)/(_i(R*R+E*E)*_i(z*z+X*X)))/2),O=_i(S[0]*S[0]+S[1]*S[1]);v=gi(x,(n-O)/(I-1)),y=gi(x,(i-O)/(1+I))}}mi<p?mi<y?(c=cornerTangents(D,F,w,A,i,y,s),u=cornerTangents(M,L,k,C,i,y,s),W.moveTo(c.cx+c.x01,c.cy+c.y01),y<x?W.arc(c.cx,c.cy,y,hi(c.y01,c.x01),hi(u.y01,u.x01),!s):(W.arc(c.cx,c.cy,y,hi(c.y01,c.x01),hi(c.y11,c.x11),!s),W.arc(0,0,i,hi(c.cy+c.y11,c.cx+c.x11),hi(u.cy+u.y11,u.cx+u.x11),!s),W.arc(u.cx,u.cy,y,hi(u.y11,u.x11),hi(u.y01,u.x01),!s))):(W.moveTo(w,A),W.arc(0,0,i,l,h,!s)):W.moveTo(w,A),mi<n&&mi<g?mi<v?(c=cornerTangents(k,C,M,L,n,-v,s),u=cornerTangents(w,A,D,F,n,-v,s),W.lineTo(c.cx+c.x01,c.cy+c.y01),v<x?W.arc(c.cx,c.cy,v,hi(c.y01,c.x01),hi(u.y01,u.x01),!s):(W.arc(c.cx,c.cy,v,hi(c.y01,c.x01),hi(c.y11,c.x11),!s),W.arc(0,0,n,hi(c.cy+c.y11,c.cx+c.x11),hi(u.cy+u.y11,u.cx+u.x11),s),W.arc(u.cx,u.cy,v,hi(u.y11,u.x11),hi(u.y01,u.x01),!s))):W.arc(0,0,n,f,d,s):W.lineTo(k,C)}else W.moveTo(0,0);if(W.closePath(),t)return W=null,t+""||null}return arc.centroid=function(){var t=(+P.apply(this,arguments)+ +N.apply(this,arguments))/2,e=(+H.apply(this,arguments)+ +V.apply(this,arguments))/2-xi/2;return[di(e)*t,pi(e)*t]},arc.innerRadius=function(t){return arguments.length?(P="function"==typeof t?t:ui(+t),arc):P},arc.outerRadius=function(t){return arguments.length?(N="function"==typeof t?t:ui(+t),arc):N},arc.cornerRadius=function(t){return arguments.length?(Y="function"==typeof t?t:ui(+t),arc):Y},arc.padRadius=function(t){return arguments.length?(B=null==t?null:"function"==typeof t?t:ui(+t),arc):B},arc.startAngle=function(t){return arguments.length?(H="function"==typeof t?t:ui(+t),arc):H},arc.endAngle=function(t){return arguments.length?(V="function"==typeof t?t:ui(+t),arc):V},arc.padAngle=function(t){return arguments.length?(U="function"==typeof t?t:ui(+t),arc):U},arc.context=function(t){return arguments.length?(W=null==t?null:t,arc):W},arc}function Linear(t){this._context=t}Linear.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};function bk(t){return new Linear(t)}function point_x(t){return t[0]}function point_y(t){return t[1]}function ck(){var o=point_x,s=point_y,c=ui(!0),u=null,l=bk,h=null;function line(t){var e,n,i,a=t.length,r=!1;for(null==u&&(h=l(i=ci())),e=0;e<=a;++e)!(e<a&&c(n=t[e],e,t))===r&&((r=!r)?h.lineStart():h.lineEnd()),r&&h.point(+o(n,e,t),+s(n,e,t));if(i)return h=null,i+""||null}return line.x=function(t){return arguments.length?(o="function"==typeof t?t:ui(+t),line):o},line.y=function(t){return arguments.length?(s="function"==typeof t?t:ui(+t),line):s},line.defined=function(t){return arguments.length?(c="function"==typeof t?t:ui(!!t),line):c},line.curve=function(t){return arguments.length?(l=t,null!=u&&(h=l(u)),line):l},line.context=function(t){return arguments.length?(null==t?u=h=null:h=l(u=t),line):u},line}function dk(){var l=point_x,h=null,d=ui(0),f=point_y,g=ui(!0),p=null,_=bk,m=null;function area(t){var e,n,i,a,r,o=t.length,s=!1,c=new Array(o),u=new Array(o);for(null==p&&(m=_(r=ci())),e=0;e<=o;++e){if(!(e<o&&g(a=t[e],e,t))===s)if(s=!s)n=e,m.areaStart(),m.lineStart();else{for(m.lineEnd(),m.lineStart(),i=e-1;n<=i;--i)m.point(c[i],u[i]);m.lineEnd(),m.areaEnd()}s&&(c[e]=+l(a,e,t),u[e]=+d(a,e,t),m.point(h?+h(a,e,t):c[e],f?+f(a,e,t):u[e]))}if(r)return m=null,r+""||null}function arealine(){return ck().defined(g).curve(_).context(p)}return area.x=function(t){return arguments.length?(l="function"==typeof t?t:ui(+t),h=null,area):l},area.x0=function(t){return arguments.length?(l="function"==typeof t?t:ui(+t),area):l},area.x1=function(t){return arguments.length?(h=null==t?null:"function"==typeof t?t:ui(+t),area):h},area.y=function(t){return arguments.length?(d="function"==typeof t?t:ui(+t),f=null,area):d},area.y0=function(t){return arguments.length?(d="function"==typeof t?t:ui(+t),area):d},area.y1=function(t){return arguments.length?(f=null==t?null:"function"==typeof t?t:ui(+t),area):f},area.lineX0=area.lineY0=function(){return arealine().x(l).y(d)},area.lineY1=function(){return arealine().x(l).y(f)},area.lineX1=function(){return arealine().x(h).y(d)},area.defined=function(t){return arguments.length?(g="function"==typeof t?t:ui(!!t),area):g},area.curve=function(t){return arguments.length?(_=t,null!=p&&(m=_(p)),area):_},area.context=function(t){return arguments.length?(null==t?p=m=null:m=_(p=t),area):p},area}function ek(t,e){return e<t?-1:t<e?1:t<=e?0:NaN}function fk(t){return t}curveRadial(bk);function Radial(t){this._curve=t}function curveRadial(e){function radial(t){return new Radial(e(t))}return radial._curve=e,radial}Radial.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};Array.prototype.slice;Math.sqrt(1/3);function Gk(){}var bi=Math.sin(xi/10)/Math.sin(7*xi/10);Math.sin(yi/10),Math.cos(yi/10),Math.sqrt(3),Math.sqrt(3),Math.sqrt(12);function basis_point(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Basis(t){this._context=t}Basis.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:basis_point(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:basis_point(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Hk(t){return new Basis(t)}function BasisClosed(t){this._context=t}BasisClosed.prototype={areaStart:Gk,areaEnd:Gk,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:basis_point(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Ik(t){return new BasisClosed(t)}function BasisOpen(t){this._context=t}BasisOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:basis_point(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Jk(t){return new BasisOpen(t)}function Bundle(t,e){this._basis=new Basis(t),this._beta=e}Bundle.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(0<n)for(var i,a=t[0],r=e[0],o=t[n]-a,s=e[n]-r,c=-1;++c<=n;)i=c/n,this._basis.point(this._beta*t[c]+(1-this._beta)*(a+i*o),this._beta*e[c]+(1-this._beta)*(r+i*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var wi=function custom(e){function bundle(t){return 1===e?new Basis(t):new Bundle(t,e)}return bundle.beta=function(t){return custom(+t)},bundle}(.85);function cardinal_point(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Cardinal(t,e){this._context=t,this._k=(1-e)/6}Cardinal.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:cardinal_point(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:cardinal_point(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Ai=function custom(e){function cardinal(t){return new Cardinal(t,e)}return cardinal.tension=function(t){return custom(+t)},cardinal}(0);function CardinalClosed(t,e){this._context=t,this._k=(1-e)/6}CardinalClosed.prototype={areaStart:Gk,areaEnd:Gk,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:cardinal_point(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var ki=function custom(e){function cardinal(t){return new CardinalClosed(t,e)}return cardinal.tension=function(t){return custom(+t)},cardinal}(0);function CardinalOpen(t,e){this._context=t,this._k=(1-e)/6}CardinalOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:cardinal_point(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Ci=function custom(e){function cardinal(t){return new CardinalOpen(t,e)}return cardinal.tension=function(t){return custom(+t)},cardinal}(0);function catmullRom_point(t,e,n){var i=t._x1,a=t._y1,r=t._x2,o=t._y2;if(t._l01_a>mi){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,a=(a*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>mi){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);r=(r*u+t._x1*t._l23_2a-e*t._l12_2a)/l,o=(o*u+t._y1*t._l23_2a-n*t._l12_2a)/l}t._context.bezierCurveTo(i,a,r,o,t._x2,t._y2)}function CatmullRom(t,e){this._context=t,this._alpha=e}CatmullRom.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:catmullRom_point(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Si=function custom(e){function catmullRom(t){return e?new CatmullRom(t,e):new Cardinal(t,0)}return catmullRom.alpha=function(t){return custom(+t)},catmullRom}(.5);function CatmullRomClosed(t,e){this._context=t,this._alpha=e}CatmullRomClosed.prototype={areaStart:Gk,areaEnd:Gk,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:catmullRom_point(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Mi=function custom(e){function catmullRom(t){return e?new CatmullRomClosed(t,e):new CardinalClosed(t,0)}return catmullRom.alpha=function(t){return custom(+t)},catmullRom}(.5);function CatmullRomOpen(t,e){this._context=t,this._alpha=e}CatmullRomOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:catmullRom_point(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Li=function custom(e){function catmullRom(t){return e?new CatmullRomOpen(t,e):new CardinalOpen(t,0)}return catmullRom.alpha=function(t){return custom(+t)},catmullRom}(.5);function LinearClosed(t){this._context=t}LinearClosed.prototype={areaStart:Gk,areaEnd:Gk,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Rk(t){return new LinearClosed(t)}function monotone_sign(t){return t<0?-1:1}function slope3(t,e,n){var i=t._x1-t._x0,a=e-t._x1,r=(t._y1-t._y0)/(i||a<0&&-0),o=(n-t._y1)/(a||i<0&&-0),s=(r*a+o*i)/(i+a);return(monotone_sign(r)+monotone_sign(o))*Math.min(Math.abs(r),Math.abs(o),.5*Math.abs(s))||0}function slope2(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function monotone_point(t,e,n){var i=t._x0,a=t._y0,r=t._x1,o=t._y1,s=(r-i)/3;t._context.bezierCurveTo(i+s,a+s*e,r-s,o-s*n,r,o)}function MonotoneX(t){this._context=t}function MonotoneY(t){this._context=new ReflectContext(t)}function ReflectContext(t){this._context=t}function monotoneX(t){return new MonotoneX(t)}function monotoneY(t){return new MonotoneY(t)}function Natural(t){this._context=t}function controlPoints(t){var e,n,i=t.length-1,a=new Array(i),r=new Array(i),o=new Array(i);for(r[a[0]=0]=2,o[0]=t[0]+2*t[1],e=1;e<i-1;++e)a[e]=1,r[e]=4,o[e]=4*t[e]+2*t[e+1];for(a[i-1]=2,r[i-1]=7,o[i-1]=8*t[i-1]+t[i],e=1;e<i;++e)n=a[e]/r[e-1],r[e]-=n,o[e]-=n*o[e-1];for(a[i-1]=o[i-1]/r[i-1],e=i-2;0<=e;--e)a[e]=(o[e]-a[e+1])/r[e];for(r[i-1]=(t[i]+a[i-1])/2,e=0;e<i-1;++e)r[e]=2*t[e+1]-a[e+1];return[a,r]}MonotoneX.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:monotone_point(this,this._t0,slope2(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,monotone_point(this,slope2(this,n=slope3(this,t,e)),n);break;default:monotone_point(this,this._t0,n=slope3(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(MonotoneY.prototype=Object.create(MonotoneX.prototype)).point=function(t,e){MonotoneX.prototype.point.call(this,e,t)},ReflectContext.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,i,a,r){this._context.bezierCurveTo(e,t,i,n,r,a)}},Natural.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===n)this._context.lineTo(t[1],e[1]);else for(var i=controlPoints(t),a=controlPoints(e),r=0,o=1;o<n;++r,++o)this._context.bezierCurveTo(i[0][r],a[0][r],i[1][r],a[1][r],t[o],e[o]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function Sk(t){return new Natural(t)}function Step(t,e){this._context=t,this._t=e}Step.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),0<=this._line&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};function Tk(t){return new Step(t,.5)}function stepBefore(t){return new Step(t,0)}function stepAfter(t){return new Step(t,1)}xh($n.prototype,{getShapeIndices:function getShapeIndices(t){var r=this.config,o={},s=0;return this.filterTargetsToShow(this.data.targets.filter(t,this)).forEach(function(t){for(var e,n=0;e=r.data_groups[n];n++)if(!(e.indexOf(t.id)<0))for(var i,a=0;i=e[a];a++)if(i in o){o[t.id]=o[i];break}ch(o[t.id])&&(o[t.id]=s++)}),o.__max__=s-1,o},getShapeX:function getShapeX(a,r,o,t){function FEa(t,e){return t+e}var s=t?this.subX:this.zoomScale||this.x,c=this.config.bar_padding,u=ih(a)&&a.total.length?a.total.reduce(FEa)/2:0;return function(t){var e=t.id in o?o[t.id]:0,n=0;if(kh(t.x)){var i=s(t.x);n=u?i-(a[t.id]||a.width)+a.total.slice(0,e+1).reduce(FEa)-u:i-(bh(a)?a:a.width)*(r/2-e)}return a&&n&&1<r&&c&&(e&&(n+=c*e),2<r?n-=(r-1)*c/2:2===r&&(n-=c/2)),n}},getShapeY:function getShapeY(e){var n=this,i=n.isStackNormalized();return function(t){return(e?n.getSubYScale(t.id):n.getYScale(t.id))(i?n.getRatio("index",t,!0):t.value)}},getShapeOffset:function getShapeOffset(t,c,e){var u=this,n=u.orderTargets(u.filterTargetsToShow(u.data.targets.filter(t,u))),l=n.map(function(t){return t.id});return function(i,t){var a=e?u.getSubYScale(i.id):u.getYScale(i.id),r=a(0),o=r,s=t;return n.forEach(function(t){var e=u.isStepType(i)?u.convertValuesToStep(t.values):t.values,n=e.map(function(t){return u.isStackNormalized()?u.getRatio("index",t,!0):t.value});t.id===i.id||c[t.id]!==c[i.id]||l.indexOf(t.id)<l.indexOf(i.id)&&(!ch(e[s])&&+e[s].x==+i.x||(s=-1,e.forEach(function(t,e){(t.x.constructor===Date?+t.x:t.x)===(i.x.constructor===Date?+i.x:i.x)&&(s=e)})),s in e&&0<=e[s].value*i.value&&(o+=a(n[s])-r))}),o}},isWithinShape:function isWithinShape(t,e){var n,i=lt(t);return this.isTargetToShow(e.id)?this.hasValidPointType(t.nodeName)?n=this.isStepType(e)?this.isWithinStep(t,this.getYScale(e.id)(e.value)):this.isWithinCircle(t,this.isBubbleType(e)?1.5*this.pointSelectR(e):0):"path"===t.nodeName&&(n=!i.classed(Oe.bar)||this.isWithinBar(t)):n=!1,n},getInterpolate:function getInterpolate(t){var e=this.getInterpolateType(t);return{basis:Hk,"basis-closed":Ik,"basis-open":Jk,bundle:wi,cardinal:Ai,"cardinal-closed":ki,"cardinal-open":Ci,"catmull-rom":Si,"catmull-rom-closed":Mi,"catmull-rom-open":Li,"monotone-x":monotoneX,"monotone-y":monotoneY,natural:Sk,"linear-closed":Rk,linear:bk,step:Tk,"step-after":stepAfter,"step-before":stepBefore}[e]},getInterpolateType:function getInterpolateType(t){var e=this.config.spline_interpolation_type,n=this.isInterpolationType(e)?e:"cardinal";return this.isSplineType(t)?n:this.isStepType(t)?this.config.line_step_type:"linear"}}),xh($n.prototype,{initPie:function initPie(){var n=this,t=n.config,e=t.pie_padding,i=n.hasType("pie")&&e?.01*e:t["".concat(t.data_type,"_padAngle")]?t["".concat(t.data_type,"_padAngle")]:0;n.pie=function(){var g=fk,p=ek,_=null,m=ui(0),x=ui(yi),v=ui(0);function pie(n){var t,e,i,a,r,o=n.length,s=0,c=new Array(o),u=new Array(o),l=+m.apply(this,arguments),h=Math.min(yi,Math.max(-yi,x.apply(this,arguments)-l)),d=Math.min(Math.abs(h)/o,v.apply(this,arguments)),f=d*(h<0?-1:1);for(t=0;t<o;++t)0<(r=u[c[t]=t]=+g(n[t],t,n))&&(s+=r);for(null!=p?c.sort(function(t,e){return p(u[t],u[e])}):null!=_&&c.sort(function(t,e){return _(n[t],n[e])}),t=0,i=s?(h-o*f)/s:0;t<o;++t,l=a)e=c[t],a=l+(0<(r=u[e])?r*i:0)+f,u[e]={data:n[e],index:t,value:r,startAngle:l,endAngle:a,padAngle:d};return u}return pie.value=function(t){return arguments.length?(g="function"==typeof t?t:ui(+t),pie):g},pie.sortValues=function(t){return arguments.length?(p=t,_=null,pie):p},pie.sort=function(t){return arguments.length?(_=t,p=null,pie):_},pie.startAngle=function(t){return arguments.length?(m="function"==typeof t?t:ui(+t),pie):m},pie.endAngle=function(t){return arguments.length?(x="function"==typeof t?t:ui(+t),pie):x},pie.padAngle=function(t){return arguments.length?(v="function"==typeof t?t:ui(+t),pie):v},pie}().padAngle(i).sortValues(n.isOrderAsc()||n.isOrderDesc()?function(t,e){return n.isOrderAsc()?t-e:e-t}:null).value(function(t){return t.values.reduce(function(t,e){return t+e.value},0)})},updateRadius:function updateRadius(){var t=this,e=t.config,n=e.pie_innerRadius,i=e.pie_padding,a=e.gauge_width||e.donut_width;t.radiusExpanded=Math.min(t.arcWidth,t.arcHeight)/2,t.radius=.95*t.radiusExpanded,t.innerRadiusRatio=a?(t.radius-a)/t.radius:.6;var r=n||(i?i*(t.innerRadiusRatio+.1):0);t.innerRadius=t.hasType("donut")||t.hasType("gauge")?t.radius*t.innerRadiusRatio:r},getInnerRadius:function getInnerRadius(t){var e=this.innerRadius;return!bh(e)&&t&&(e=e[t.data.id]||0),e},updateArc:function updateArc(){this.svgArc=this.getSvgArc(),this.svgArcExpanded=this.getSvgArcExpanded(),this.svgArcExpandedSub=this.getSvgArcExpanded(.98)},updateAngle:function updateAngle(t){var e=this.config,n=this.pie,i=t,a=!1;if(!e)return null;if(i.data&&this.isGaugeType(i.data)){var r=this.getTotalDataSum();r>e.gauge_max&&(e.gauge_max=r);var o=Math.PI*(e.gauge_fullCircle?2:1),s=e.gauge_startingAngle,c=o*(r/(e.gauge_max-e.gauge_min));n=this.pie.startAngle(s).endAngle(c+s)}return n(this.filterTargetsToShow()).forEach(function(t){a||t.data.id!==i.data.id||(a=!0,i=t)}),isNaN(i.startAngle)&&(i.startAngle=0),isNaN(i.endAngle)&&(i.endAngle=i.startAngle),a?i:null},getSvgArc:function getSvgArc(){function bGa(t,e){var n="M 0 0";if(t.value||t.data){bh(r)||(o=o.innerRadius(a.getInnerRadius(t)));var i=!e&&a.updateAngle(t);e?n=o(t):i&&(n=o(i))}return n}var a=this,r=a.getInnerRadius(),o=ak().outerRadius(a.radius).innerRadius(bh(r)?r:0);return bGa.centroid=o.centroid,bGa},getSvgArcExpanded:function getSvgArcExpanded(t){var n=this,i=ak().outerRadius(n.radiusExpanded*(t||1));return function(t){var e=n.updateAngle(t);return e?i.innerRadius(n.getInnerRadius(t))(e):"M 0 0"}},getArc:function getArc(t,e,n){return n||this.isArcType(t.data)?this.svgArc(t,e):"M 0 0"},transformForArcLabel:function transformForArcLabel(t){var e=this,n=e.config,i=e.updateAngle(t),a="";if(i&&(!e.hasType("gauge")||e.hasMultiTargets())){var r=this.svgArc.centroid(i),o=isNaN(r[0])?0:r[0],s=isNaN(r[1])?0:r[1],c=Math.sqrt(o*o+s*s),u=e.hasType("donut")&&n.donut_label_ratio||e.hasType("pie")&&n.pie_label_ratio;u=u?_g(u)?u(t,e.radius,c):u:e.radius&&(c?(.375<36/e.radius?1.175-36/e.radius:.8)*e.radius/c:0),a="translate(".concat(o*u,",").concat(s*u,")")}return a},convertToArcData:function convertToArcData(t){return this.addName({id:t.data.id,value:t.value,ratio:this.getRatio("arc",t),index:t.index})},textForArcLabel:function textForArcLabel(t){var s=this;s.shouldShowArcLabel()&&t.each(function(t){var e=lt(this),n=s.updateAngle(t),i=n?n.value:null,a=s.getRatio("arc",n),r=t.data.id;if(s.hasType("gauge")||s.meetsArcLabelThreshold(a)){var o=(s.getArcLabelFormat()||s.defaultArcValueFormat)(i,a,r).toString();rh(e,o)}})},textForGaugeMinMax:function textForGaugeMinMax(t,e){var n=this.getGaugeLabelExtents();return n?n(t,e):t},expandArc:function expandArc(t){var n=this;if(n.transiting)var e=setInterval(function(){n.transiting||(clearInterval(e),0<n.legend.selectAll(".".concat(Oe.legendItemFocused)).size()&&n.expandArc(t))},10);else{var i=n.mapToTargetIds(t);n.svg.selectAll(n.selectorTargets(i,".".concat(Oe.chartArc))).each(function(t){if(n.shouldExpand(t.data.id)&&0!==t.value){var e=n.expandDuration(t.data.id);lt(this).selectAll("path").transition().duration(e).attr("d",n.svgArcExpanded).transition().duration(2*e).attr("d",n.svgArcExpandedSub)}})}},unexpandArc:function unexpandArc(t){var e=this;if(!e.transiting){var n=e.mapToTargetIds(t);e.svg.selectAll(e.selectorTargets(n,".".concat(Oe.chartArc))).selectAll("path").transition().duration(function(t){return e.expandDuration(t.data.id)}).attr("d",e.svgArc),e.svg.selectAll("".concat(Oe.arc)).style("opacity","1")}},expandDuration:function expandDuration(t){var e,n=this.config;return this.isDonutType(t)?e="donut":this.isGaugeType(t)?e="gauge":this.isPieType(t)&&(e="pie"),e?n["".concat(e,"_expand_duration")]:50},shouldExpand:function shouldExpand(t){var e=this.config;return this.isDonutType(t)&&e.donut_expand||this.isGaugeType(t)&&e.gauge_expand||this.isPieType(t)&&e.pie_expand},shouldShowArcLabel:function shouldShowArcLabel(){var e=this,n=e.config;return["pie","donut","gauge"].some(function(t){return e.hasType(t)&&n["".concat(t,"_label_show")]})},meetsArcLabelThreshold:function meetsArcLabelThreshold(t){var e=this.config;return(this.hasType("donut")?e.donut_label_threshold:e.pie_label_threshold)<=t},getArcLabelFormat:function getArcLabelFormat(){var t=this.config,e=t.pie_label_format;return this.hasType("gauge")?e=t.gauge_label_format:this.hasType("donut")&&(e=t.donut_label_format),e},getGaugeLabelExtents:function getGaugeLabelExtents(){return this.config.gauge_label_extents},getArcTitle:function getArcTitle(){var t=this.hasType("donut")?"donut":this.hasType("gauge")&&"gauge";return t?this.config["".concat(t,"_title")]:""},updateTargetsForArc:function updateTargetsForArc(t){var e=this,n=e.main,i=e.hasType("gauge"),a=e.classChartArc.bind(e),r=e.classArcs.bind(e),o=e.classFocus.bind(e),s=n.select(".".concat(Oe.chartArcs)).selectAll(".".concat(Oe.chartArc)).data(e.pie(t)).attr("class",function(t){return a(t)+o(t.data)}),c=s.enter().append("g").attr("class",a);c.append("g").attr("class",r).merge(s),c.append("text").attr("dy",i&&!e.hasMultiTargets()?"-.1em":".35em").style("opacity","0").style("text-anchor","middle").style("pointer-events","none")},initArc:function initArc(){this.arcs=this.main.select(".".concat(Oe.chart)).append("g").attr("class",Oe.chartArcs).attr("transform",this.getTranslate("arc")),this.setArcTitle()},setArcTitle:function setArcTitle(){var t=this.getArcTitle(),e=this.hasType("gauge");if(t){var n=this.arcs.append("text").attr("class",Oe[e?"chartArcsGaugeTitle":"chartArcsTitle"]).style("text-anchor","middle");e&&n.attr("dy","-0.3em").style("font-size","27px"),rh(n,t,e?void 0:[-1.3,1.3])}},redrawArc:function redrawArc(t,e,n){var a=this,i=a.config,r=a.main,o=i.interaction_enabled,s=r.selectAll(".".concat(Oe.arcs)).selectAll(".".concat(Oe.arc)).data(a.arcData.bind(a));s.exit().transition().duration(e).style("opacity","0").remove(),(s=s.enter().append("path").attr("class",a.classArc.bind(a)).style("fill",function(t){return a.color(t.data)}).style("cursor",function(t){return o&&(i.data_selection_isselectable(t)?"pointer":null)}).style("opacity","0").each(function(t){a.isGaugeType(t.data)&&(t.startAngle=i.gauge_startingAngle,t.endAngle=i.gauge_startingAngle),this._current=t}).merge(s)).attr("transform",function(t){return!a.isGaugeType(t.data)&&n?"scale(0)":""}).style("opacity",function(t){return t===this._current?"0":"1"}).each(function(){a.transiting=!0}).transition().duration(t).attrTween("d",function(n){var t=a.updateAngle(n);if(!t)return function(){return"M 0 0"};isNaN(this._current.startAngle)&&(this._current.startAngle=0),isNaN(this._current.endAngle)&&(this._current.endAngle=this._current.startAngle);var i=me(this._current,t);return this._current=i(0),function(t){var e=i(t);return e.data=n.data,a.getArc(e,!0)}}).attr("transform",n?"scale(1)":"").style("fill",function(t){return a.levelColor?a.levelColor(t.data.values[0].value):a.color(t.data.id)}).style("opacity","1").call(a.endall,function(){a.transiting=!1}),o&&a.bindArcEvent(s),a.redrawArcText(t)},bindArcEvent:function bindArcEvent(t){function selectArc(t,e,n){a.expandArc(n),a.api.focus(n),a.toggleFocusLegend(n,!0),a.showTooltip([e],t)}function unselectArc(t){var e=t&&t.id||void 0;a.unexpandArc(e),a.api.revert(),a.revertLegend(),a.hideTooltip()}var a=this,e="touch"===a.inputType,n="mouse"===a.inputType;if(t.on("click",function(t,e){var n,i=a.updateAngle(t);i&&(n=a.convertToArcData(i),a.toggleShape&&a.toggleShape(this,n,e),a.config.data_onclick.call(a.api,n,this))}),n&&t.on("mouseover",function(t){if(!a.transiting){var e=a.updateAngle(t),n=e?a.convertToArcData(e):null;selectArc(this,n,n&&n.id||void 0),a.setOverOut(!0,n)}}).on("mouseout",function(t){if(!a.transiting){var e=a.updateAngle(t),n=e?a.convertToArcData(e):null;unselectArc(),a.setOverOut(!1,n)}}).on("mousemove",function(t){var e=a.updateAngle(t),n=e?a.convertToArcData(e):null;a.showTooltip([n],this)}),e&&a.hasArcType()&&!a.radars){var i=function(){if(!a.transiting){var t=function(){var t=st.changedTouches[0];return lt(sn.document.elementFromPoint(t.clientX,t.clientY))}().datum(),e=t&&t.data&&t.data.id?a.updateAngle(t):null,n=e?a.convertToArcData(e):null,i=n&&n.id||void 0;a.callOverOutForTouch(n),ch(i)?unselectArc():selectArc(this,n,i)}};a.svg.on("touchstart",i).on("touchmove",i)}},redrawArcText:function redrawArcText(t){var e=this,n=e.config,i=e.main,a=e.hasType("gauge"),r=i.selectAll(".".concat(Oe.chartArc)).select("text").style("opacity","0").attr("class",function(t){return e.isGaugeType(t.data)?Oe.gaugeValue:null}).call(e.textForArcLabel.bind(e)).attr("transform",e.transformForArcLabel.bind(e)).style("font-size",function(t){return e.isGaugeType(t.data)&&!e.hasMultiTargets()?"".concat(Math.round(e.radius/5),"px"):""}).transition().duration(t).style("opacity",function(t){return e.isTargetToShow(t.data.id)&&e.isArcType(t.data)?"1":"0"});if(i.select(".".concat(Oe.chartArcsTitle)).style("opacity",e.hasType("donut")||a?"1":"0"),a){var o=n.gauge_fullCircle,s=(o?-4:-1)*n.gauge_startingAngle;o&&r.attr("dy","".concat(Math.round(e.radius/14))),e.arcs.select(".".concat(Oe.chartArcsBackground)).attr("d",function(){var t={data:[{value:n.gauge_max}],startAngle:n.gauge_startingAngle,endAngle:s};return e.getArc(t,!0,!0)}),e.arcs.select(".".concat(Oe.chartArcsGaugeUnit)).attr("dy",".75em").text(n.gauge_label_show?n.gauge_units:""),n.gauge_label_show&&(e.arcs.select(".".concat(Oe.chartArcsGaugeMin)).attr("dx","".concat(-1*(e.innerRadius+(e.radius-e.innerRadius)/(n.gauge_fullCircle?1:2)),"px")).attr("dy","1.2em").text(e.textForGaugeMinMax(n.gauge_min,!1)),o||e.arcs.select(".".concat(Oe.chartArcsGaugeMax)).attr("dx","".concat(e.innerRadius+(e.radius-e.innerRadius)/2,"px")).attr("dy","1.2em").text(e.textForGaugeMinMax(n.gauge_max,!0)))}},initGauge:function initGauge(){function PIa(t){e.append("text").attr("class",t).style("text-anchor","middle").style("pointer-events","none")}var t=this.config,e=this.arcs;this.hasType("gauge")&&(e.append("path").attr("class",Oe.chartArcsBackground),t.gauge_units&&PIa(Oe.chartArcsGaugeUnit),t.gauge_label_show&&(PIa(Oe.chartArcsGaugeMin),t.gauge_fullCircle||PIa(Oe.chartArcsGaugeMax)))},getGaugeLabelHeight:function getGaugeLabelHeight(){return this.config.gauge_label_show?20:0}}),xh($n.prototype,{initBar:function initBar(){this.main.select(".".concat(Oe.chart)).append("g").attr("class",Oe.chartBars)},updateTargetsForBar:function updateTargetsForBar(t){var e=this.config,n=this.classChartBar.bind(this),i=this.classBars.bind(this),a=this.classFocus.bind(this);this.main.select(".".concat(Oe.chartBars)).selectAll(".".concat(Oe.chartBar)).data(t).attr("class",function(t){return n(t)+a(t)}).enter().append("g").attr("class",n).style("opacity","0").style("pointer-events","none").append("g").attr("class",i).style("cursor",function(t){return e.data_selection_isselectable(t)?"pointer":null})},updateBar:function updateBar(t){var e=this,n=e.barData.bind(e),i=e.classBar.bind(e),a=e.initialOpacity.bind(e);e.mainBar=e.main.selectAll(".".concat(Oe.bars)).selectAll(".".concat(Oe.bar)).data(n),e.mainBar.exit().transition().duration(t).style("opacity","0").remove(),e.mainBar=e.mainBar.enter().append("path").attr("class",i).style("fill",e.color).merge(e.mainBar).style("opacity",a)},redrawBar:function redrawBar(t,e){return[(e?this.mainBar.transition(vh()):this.mainBar).attr("d",t).style("fill",this.color).style("opacity","1")]},getBarW:function getBarW(t,r){function oJa(t){var e=t?o.bar_width[t]:o.bar_width,n=t?e.ratio:o.bar_width_ratio,i=t?e.max:o.bar_width_max,a=bh(e)?e:r?s*n/r:0;return i&&i<a?i:a}var e,o=this.config,s=t.tickInterval(this.getMaxDataCount()),n=o.data_groups.length;return e=oJa(),!n&&ih(o.bar_width)&&(e={width:e,total:[]},this.filterTargetsToShow(this.data.targets).forEach(function(t){o.bar_width[t.id]&&(e[t.id]=oJa(t.id),e.total.push(e[t.id]||e.width))})),e},getBars:function getBars(t,e){var n=$g(t)?"-".concat(t):"";return(e?this.main.selectAll(".".concat(Oe.bars).concat(this.getTargetSelectorSuffix(e))):this.main).selectAll(".".concat(Oe.bar).concat(n))},expandBars:function expandBars(t,e,n){n&&this.unexpandBars(),this.getBars(t,e).classed(Oe.EXPANDED,!0)},unexpandBars:function unexpandBars(t){this.getBars(t).classed(Oe.EXPANDED,!1)},generateDrawBar:function generateDrawBar(t,e){var n=this.config,d=this.generateGetBarPoints(t,e),f=n.axis_rotated,g=n.data_groups.length,i=n.bar_radius,a=n.bar_radius_ratio,p=bh(i)&&0<i?function(){return i}:bh(a)?function(t){return t*a}:null;return function(t,e){var n=d(t,e),i=+f,a=+!i,r=t.value<0,o=["",""],s=0;if(p&&!g){var c=f?a:i,u=n[2][c]-n[0][c];s=p(u);var l="a".concat(s,",").concat(s," ").concat(r?"1 0 0":"0 0 1"," ");o[+!f]="".concat(l).concat(s,",").concat(s),o[+f]="".concat(l).concat([-s,s][f?"sort":"reverse"]()),r&&o.reverse()}var h=f?"H".concat(n[1][i]-s," ").concat(o[0],"V").concat(n[2][a]-s," ").concat(o[1],"H").concat(n[3][i]):"V".concat(n[1][a]+(r?-s:s)," ").concat(o[0],"H").concat(n[2][i]-s," ").concat(o[1],"V").concat(n[3][a]);return"M".concat(n[0][i],",").concat(n[0][a]).concat(h,"z")}},generateGetBarPoints:function generateGetBarPoints(t,e){var s=this,n=e?s.subXAxis:s.xAxis,i=t.__max__+1,c=s.getBarW(n,i),u=s.getShapeX(c,i,t,!!e),l=s.getShapeY(!!e),h=s.getShapeOffset(s.isBarType,t,!!e),d=e?s.getSubYScale:s.getYScale;return function(t,e){var n=d.call(s,t.id)(0),i=h(t,e)||n,a=bh(c)?c:c[t.id]||c.width,r=u(t),o=l(t);return s.config.axis_rotated&&(0<t.value&&o<n||t.value<0&&n<o)&&(o=n),[[r,i],[r,o-=n-i],[r+a,o],[r+a,i]]}},isWithinBar:function isWithinBar(t){var e=dt(t),n=sh(t),i=k()(n,2),a=i[0],r=i[1],o=Math.min(a.x,r.x),s=Math.min(a.y,r.y),c=this.config.bar_sensitivity,u=t.getBBox(),l=u.width,h=u.height;return o-c<e[0]&&e[0]<o+l+c&&s-c<e[1]&&e[1]<s+h+c}}),xh($n.prototype,{initBubble:function initBubble(){var t=this.config;this.hasType("bubble")&&(t.point_show=!0,t.point_type="circle",t.point_sensitivity=25)},getBaseLength:function getBaseLength(){var t="$baseLength",e=this.getCache(t);return e||this.addCache(t,e=Fh("min",[this.axes.x.select("path").node().getTotalLength(),this.axes.y.select("path").node().getTotalLength()])),e},getBubbleR:function getBubbleR(t){var e=this.config.bubble_maxR;_g(e)?e=e(t):bh(e)||(e=this.getBaseLength()/(2*this.getMaxDataCount())+12);var n=Fh("max",this.getMinMaxData().max.map(function(t){return mh(t.value)?t.value.mid:t.value})),i=e*e*Math.PI,a=t.value*(i/n);return Math.sqrt(a/Math.PI)}}),xh($n.prototype,{initLine:function initLine(){this.main.select(".".concat(Oe.chart)).append("g").attr("class",Oe.chartLines)},updateTargetsForLine:function updateTargetsForLine(t){var n=this,e=n.config,i=n.classChartLine.bind(n),a=n.classLines.bind(n),r=n.classAreas.bind(n),o=n.classCircles.bind(n),s=n.classFocus.bind(n),c=n.main.select(".".concat(Oe.chartLines)).selectAll(".".concat(Oe.chartLine)).data(t).attr("class",function(t){return i(t)+s(t)}).enter().append("g").attr("class",i).style("opacity","0").style("pointer-events","none");c.append("g").attr("class",a),c.append("g").attr("class",r),e.point_show&&(e.data_selection_enabled&&c.append("g").attr("class",function(t){return n.generateClass(Oe.selectedCircles,t.id)}),c.append("g").attr("class",o).style("cursor",function(t){return e.data_selection_isselectable(t)?"pointer":null})),t.forEach(function(e){n.main.selectAll(".".concat(Oe.selectedCircles).concat(n.getTargetSelectorSuffix(e.id))).selectAll("".concat(Oe.selectedCircle)).each(function(t){t.value=e.values[t.index].value})})},updateLine:function updateLine(t){var e=this;e.mainLine=e.main.selectAll(".".concat(Oe.lines)).selectAll(".".concat(Oe.line)).data(e.lineData.bind(e)),e.mainLine.exit().transition().duration(t).style("opacity","0").remove(),e.mainLine=e.mainLine.enter().append("path").attr("class",function(t){return"".concat(e.classLine.bind(e)(t)," ").concat(e.extraLineClasses(t)||"")}).style("stroke",e.color).merge(e.mainLine).style("opacity",e.initialOpacity.bind(e)).style("shape-rendering",function(t){return e.isStepType(t)?"crispEdges":""}).attr("transform",null)},redrawLine:function redrawLine(t,e){return[(e?this.mainLine.transition(vh()):this.mainLine).attr("d",t).style("stroke",this.color).style("opacity","1")]},getCurve:function getCurve(n){var i=this;return i.config.axis_rotated&&i.isStepType(n)?function(t){var e=i.getInterpolate(n)(t);return e.orgPoint=e.point,e.pointRotated=function(t,e){1===this._point&&(this._point=2);var n=this._y*(1-this._t)+e*this._t;this._context.lineTo(this._x,n),this._context.lineTo(t,n),this._x=t,this._y=e},e.point=function(t,e){0===this._point?this.orgPoint(t,e):this.pointRotated(t,e)},e}:i.getInterpolate(n)},generateDrawLine:function generateDrawLine(t,e){function ALa(t){return(e?s.subxx:s.xx).call(s,t)}function BLa(t,e){return s.isGrouped(t.id)?n(t,e)[0][1]:h.call(s,t.id)(s.getBaseValue(t))}var s=this,c=s.config,u=c.line_connectNull,l=c.axis_rotated,n=s.generateGetLinePoints(t,e),h=e?s.getSubYScale:s.getYScale,d=ck();d=l?d.x(BLa).y(ALa):d.x(ALa).y(BLa),u||(d=d.defined(function(t){return null!==s.getBaseValue(t)}));var f=e?s.subX:s.x;return function(t){var e,n=h.call(s,t.id),i=u?s.filterRemoveNull(t.values):t.values,a=0,r=0;if(s.isLineType(t)){var o=c.data_regions[t.id];e=o?s.lineWithRegions(i,f,n,o):(s.isStepType(t)&&(i=s.convertValuesToStep(i)),d.curve(s.getCurve(t))(i))}else i[0]&&(a=f(i[0].x),r=n(i[0].value)),e=l?"M ".concat(r," ").concat(a):"M ".concat(a," ").concat(r);return e||"M 0 0"}},generateGetLinePoints:function generateGetLinePoints(t,e){var s=this,c=s.config,n=t.__max__+1,i=!!e,u=s.getShapeX(0,n,t,i),l=s.getShapeY(i),h=s.getShapeOffset(s.isLineType,t,i),d=i?s.getSubYScale:s.getYScale;return function(t,e){var n=d.call(s,t.id)(0),i=h(t,e)||n,a=u(t),r=l(t);c.axis_rotated&&(0<t.value&&r<n||t.value<0&&n<r)&&(r=n);var o=[a,r-(n-i)];return[o,o,o,o]}},lineWithRegions:function lineWithRegions(t,u,l,e){function tMa(t,e){for(var n,i=0;n=e[i];i++)if(n.start<t&&t<=n.end)return n.style;return!1}var r,h,d,n,i=this,f=i.config.axis_rotated,a=i.isTimeSeries(),o=i.isCategorized()?.5:0,s=[];if(dh(e))for(var c,g=function(t,e){return ch(t)?e:a?i.parseDate(t):t},p=0;c=e[p];p++){var _=g(c.start,t[0].x),m=g(c.end,t[t.length-1].x),x=c.style||{dasharray:"2 2"};s[p]={start:_,end:m,style:x}}for(var v,y=f?function(t){return l(t.value)}:function(t){return u(t.x)},b=f?function(t){return u(t.x)}:function(t){return l(t.value)},T=function(t){return"M".concat(t[0][0],",").concat(t[0][1],"L").concat(t[1][0],",").concat(t[1][1])},w=a?function(t,e,n,i){var a=t.x.getTime(),r=e.x-t.x,o=new Date(a+r*n),s=new Date(a+r*(n+i)),c=f?[[l(h(n)),u(o)],[l(h(n+d)),u(s)]]:[[u(o),l(h(n))],[u(s),l(h(n+d))]];return T(c)}:function(t,e,n,i){var a=f?[[l(h(n),!0),u(r(n))],[l(h(n+i),!0),u(r(n+i))]]:[[u(r(n),!0),l(h(n))],[u(r(n+i),!0),l(h(n+i))]];return T(a)},A="M",k=0;v=t[k];k++){var C=t[k-1];x=tMa(v.x,s);if(ch(s)||!x)A+="".concat(k?"L":"").concat(y(v),",").concat(b(v));else{try{x=x.dasharray.split(" ")}catch(t){x="2 2".split(" ")}r=i.getScale(C.x+o,v.x+o,a),h=i.getScale(C.value,v.value);var S=u(v.x)-u(C.x),M=l(v.value)-l(C.value),L=Math.sqrt(Math.pow(S,2)+Math.pow(M,2));n=(d=x[0]/L)*x[1];for(var D=d;D<=1;D+=n)A+=w(C,v,D,d),1<=D+n&&(A+=w(C,v,1,0))}}return A},updateAreaGradient:function updateAreaGradient(){var h=this;h.data.targets.forEach(function(n){var t="".concat(h.datetimeId,"-areaGradient").concat(h.getTargetSelectorSuffix(n.id));if(h.isAreaType(n)&&h.defs.select("#".concat(t)).empty()){var i=h.color(n),e=h.config.area_linearGradient,a=e.x,r=void 0===a?[0,0]:a,o=e.y,s=void 0===o?[0,1]:o,c=e.stops,u=void 0===c?[[0,i,1],[1,i,0]]:c,l=h.defs.append("linearGradient").attr("id","".concat(t)).attr("x1",r[0]).attr("x2",r[1]).attr("y1",s[0]).attr("y2",s[1]);u.forEach(function(t){var e=_g(t[1])?t[1](n.id):t[1];l.append("stop").attr("offset",t[0]).attr("stop-color",e||i).attr("stop-opacity",t[2])})}})},updateAreaColor:function updateAreaColor(t){return this.config.area_linearGradient?"url(#".concat(this.datetimeId,"-areaGradient").concat(this.getTargetSelectorSuffix(t.id),")"):this.color(t)},updateArea:function updateArea(t){var e=this;e.config.area_linearGradient&&e.updateAreaGradient(),e.mainArea=e.main.selectAll(".".concat(Oe.areas)).selectAll(".".concat(Oe.area)).data(e.lineData.bind(e)),e.mainArea.exit().transition().duration(t).style("opacity","0").remove(),e.mainArea=e.mainArea.enter().append("path").attr("class",e.classArea.bind(e)).style("fill",e.updateAreaColor.bind(e)).style("opacity",function(){return e.orgAreaOpacity=lt(this).style("opacity"),"0"}).merge(e.mainArea),e.mainArea.style("opacity",e.orgAreaOpacity)},redrawArea:function redrawArea(t,e){var n=this;return[(e?n.mainArea.transition(vh()):n.mainArea).attr("d",t).style("fill",n.updateAreaColor.bind(n)).style("opacity",function(t){return n.isAreaRangeType(t)?n.orgAreaOpacity/1.75:n.orgAreaOpacity})]},generateDrawArea:function generateDrawArea(t,e){function ONa(t){return(e?o.subxx:o.xx).call(o,t)}function PNa(t,e){return o.isGrouped(t.id)?n(t,e)[0][1]:i.call(o,t.id)(o.isAreaRangeType(t)?o.getAreaRangeData(t,"high"):0)}function QNa(t,e){return o.isGrouped(t.id)?n(t,e)[1][1]:i.call(o,t.id)(o.isAreaRangeType(t)?o.getAreaRangeData(t,"low"):t.value)}var o=this,s=o.config,c=s.line_connectNull,u=s.axis_rotated,n=o.generateGetAreaPoints(t,e),i=e?o.getSubYScale:o.getYScale;return function(t){var e,n=c?o.filterRemoveNull(t.values):t.values,i=0,a=0;if(o.isAreaType(t)){var r=dk();r=u?r.y(ONa).x0(PNa).x1(QNa):r.x(ONa).y0(s.area_above?0:PNa).y1(QNa),c||(r=r.defined(function(t){return null!==o.getBaseValue(t)})),o.isStepType(t)&&(n=o.convertValuesToStep(n)),e=r.curve(o.getCurve(t))(n)}else n[0]&&(i=o.x(n[0].x),a=o.getYScale(t.id)(n[0].value)),e=u?"M ".concat(a," ").concat(i):"M ".concat(i," ").concat(a);return e||"M 0 0"}},generateGetAreaPoints:function generateGetAreaPoints(t,e){var o=this,s=o.config,n=t.__max__+1,c=o.getShapeX(0,n,t,!!e),u=o.getShapeY(!!e),l=o.getShapeOffset(o.isAreaType,t,!!e),h=e?o.getSubYScale:o.getYScale;return function(t,e){var n=h.call(o,t.id)(0),i=l(t,e)||n,a=c(t),r=u(t);return s.axis_rotated&&(0<t.value&&r<n||t.value<0&&n<r)&&(r=n),[[a,i],[a,r-(n-i)],[a,r-(n-i)],[a,i]]}},updateCircle:function updateCircle(){var e=this;e.config.point_show&&(e.mainCircle=e.main.selectAll(".".concat(Oe.circles)).selectAll(".".concat(Oe.circle)).data(function(t){return!e.isBarType(t)&&(!e.isLineType(t)||e.shouldDrawPointsForLine(t))&&e.labelishData(t)}),e.mainCircle.exit().remove(),e.mainCircle=e.mainCircle.enter().append(e.point("create",this,e.classCircle.bind(e),e.pointR.bind(e),e.color)).merge(e.mainCircle).style("stroke",e.color).style("opacity",e.initialOpacityForCircle.bind(e)))},redrawCircle:function redrawCircle(n,i,a,r){var o=this,s=o.main.selectAll(".".concat(Oe.selectedCircle));if(!o.config.point_show)return[];var c=[];o.mainCircle.each(function(t){var e=o.point("update",o,n,i,o.opacityForCircle.bind(o),o.color,a,r,s).bind(this)(t);c.push(e)});var t=o.isCirclePoint()?"c":"";return[c,s.attr("".concat(t,"x"),n).attr("".concat(t,"y"),i)]},circleX:function circleX(t){var e=$g(t.x);return this.config.zoom_enabled&&this.zoomScale?e?this.zoomScale(t.x):null:e?this.x(t.x):null},updateCircleY:function updateCircleY(){var i=this;i.circleY=function(t,e){var n=t.id;return i.isGrouped(n)?i.generateGetLinePoints(i.getShapeIndices(i.isLineType))(t,e)[0][1]:i.getYScale(n)(i.getBaseValue(t))}},getCircles:function getCircles(t,e){var n=$g(t)?"-".concat(t):"";return(e?this.main.selectAll(".".concat(Oe.circles).concat(this.getTargetSelectorSuffix(e))):this.main).selectAll(".".concat(Oe.circle).concat(n))},expandCircles:function expandCircles(t,e,n){var o=this.pointExpandedR.bind(this);n&&this.unexpandCircles();var i=this.getCircles(t,e).classed(Oe.EXPANDED,!0),s=o(i)/this.config.point_r,c=1-s;this.isCirclePoint()?i.attr("r",o):i.each(function(){var t=lt(this);if("circle"===this.tagName)t.attr("r",o);else{var e=this.getBBox(),n=e.width,i=e.height,a=c*(+t.attr("x")+n/2),r=c*(+t.attr("y")+i/2);t.attr("transform","translate(".concat(a," ").concat(r,") scale(").concat(s,")"))}})},unexpandCircles:function unexpandCircles(t){var e=this.pointR.bind(this),n=this.getCircles(t).filter(function(){return lt(this).classed(Oe.EXPANDED)}).classed(Oe.EXPANDED,!1);n.attr("r",e),this.isCirclePoint()||n.attr("transform","scale(".concat(e(n)/this.config.point_r,")"))},pointR:function(t){var e=this.config.point_r,n=e;return this.isStepType(t)?n=0:this.isBubbleType(t)?n=this.getBubbleR(t):_g(e)&&(n=e(t)),n},pointExpandedR:function pointExpandedR(t){var e=this.config,n=this.isBubbleType(t)?1.15:1.75;return e.point_focus_expand_enabled?e.point_focus_expand_r||this.pointR(t)*n:this.pointR(t)},pointSelectR:function pointSelectR(t){var e=this.config.point_select_r;return _g(e)?e(t):e||4*this.pointR(t)},isWithinCircle:function isWithinCircle(t,e){var n=dt(t),i=lt(t),a=this.isCirclePoint()?"c":"",r=+i.attr("".concat(a,"x")),o=+i.attr("".concat(a,"y"));if(!r&&!o&&1===t.nodeType){var s=t.getBBox?t.getBBox():t.getBoundingClientRect();r=s.x,o=s.y}return Math.sqrt(Math.pow(r-n[0],2)+Math.pow(o-n[1],2))<(e||this.config.point_sensitivity)},isWithinStep:function isWithinStep(t,e){return Math.abs(e-dt(t)[1])<30},shouldDrawPointsForLine:function shouldDrawPointsForLine(t){var e=this.config.line_point;return!0===e||lh(e)&&-1!==e.indexOf(t.id)}}),xh($n.prototype,{hasValidPointType:function hasValidPointType(t){return/^(circle|rect(angle)?|polygon|ellipse|use)$/i.test(t||this.config.point_type)},hasValidPointDrawMethods:function hasValidPointDrawMethods(t){var e=t||this.config.point_type;return ih(e)&&_g(e.create)&&_g(e.update)},insertPointInfoDefs:function insertPointInfoDefs(t,e){function LPa(t,e){for(var n,i=t.attributes,a=0;n=i[a];a++)n=n.name,e.setAttribute(n,t.getAttribute(n))}var n=(new DOMParser).parseFromString(t,"image/svg+xml").documentElement,i=sn.document.createElementNS(at.svg,n.nodeName.toLowerCase());if(i.id=e,i.style.fill="inherit",i.style.stroke="inherit",LPa(n,i),n.childNodes&&n.childNodes.length){var a=lt(i);"innerHTML"in i?a.html(n.innerHTML):zh(n.childNodes).forEach(function(t){LPa(t,a.append(t.tagName).node())})}this.defs.node().appendChild(i)},pointFromDefs:function pointFromDefs(t){return this.defs.select("#".concat(t))},generatePoint:function generatePoint(){var c=this,t=c.config,u=[],l=kh(t.point_pattern)?t.point_pattern:[t.point_type];return function(r,o){for(var t=arguments.length,s=Array(2<t?t-2:0),e=2;e<t;e++)s[e-2]=arguments[e];return function(t){var e,n=t.id||t.data&&t.data.id||t,i=lt(this);if(u.indexOf(n)<0&&u.push(n),e=l[u.indexOf(n)%l.length],c.hasValidPointType(e))e=c[e];else if(!c.hasValidPointDrawMethods(e)){var a="".concat(c.datetimeId,"-point-").concat(n);if(c.pointFromDefs(a).size()<1&&c.insertPointInfoDefs(e,a),"create"===r)return c.custom.create.bind(o).apply(void 0,[i,a].concat(s));if("update"===r)return c.custom.update.bind(o).apply(void 0,[i].concat(s))}return e[r].bind(o).apply(void 0,[i].concat(s))}}},getTransitionName:function getTransitionName(){return vh()},custom:{create:function create(t,e,n,i,a){return t.append("use").attr("xlink:href","#".concat(e)).attr("class",n).style("fill",a).node()},update:function update(t,e,n,i,a,r,o,s){function BQa(t){return e(t)-u/2}function CQa(t){return n(t)-l/2}var c=t.node().getBBox(),u=c.width,l=c.height,h=t;if(r){var d=this.getTransitionName();o&&(h=t.attr("x",BQa)),h=t.transition(d).attr("x",BQa).attr("y",CQa).transition(d),s.transition(this.getTransitionName())}else h=t.attr("x",BQa).attr("y",CQa);return h.style("opacity",i).style("fill",a)}},circle:{create:function create(t,e,n,i){return t.append("circle").attr("class",e).attr("r",n).style("fill",i).node()},update:function update(t,e,n,i,a,r,o,s){var c=t;if(this.hasType("bubble")&&(c=c.attr("r",this.pointR.bind(this))),r){var u=this.getTransitionName();o&&(c=c.attr("cx",e)),c=t.attr("cx")?c.transition(u).attr("cx",e).attr("cy",n).transition(u):c.attr("cx",e).attr("cy",n),s.transition(this.getTransitionName())}else c=c.attr("cx",e).attr("cy",n);return c.style("opacity",i).style("fill",a)}},rectangle:{create:function create(t,e,n,i){function $Qa(t){return 2*n(t)}return t.append("rect").attr("class",e).attr("width",$Qa).attr("height",$Qa).style("fill",i).node()},update:function update(t,e,n,i,a,r,o,s){function kRa(t){return e(t)-c}function lRa(t){return n(t)-c}var c=this.config.point_r,u=t;if(r){var l=this.getTransitionName();o&&(u=u.attr("x",kRa)),u=u.transition(l).attr("x",kRa).attr("y",lRa).transition(l),s.transition(this.getTransitionName())}else u=u.attr("x",kRa).attr("y",lRa);return u.style("opacity",i).style("fill",a)}}});var Di="$radarPoints";xh($n.prototype,{initRadar:function initRadar(){var t=this,e=t.config;t.hasType("radar")&&(t.radars=t.main.select(".".concat(Oe.chart)).append("g").attr("class",Oe.chartRadars),t.radars.levels=t.radars.append("g").attr("class",Oe.levels),t.radars.axes=t.radars.append("g").attr("class",Oe.axis),t.radars.shapes=t.radars.append("g").attr("class",Oe.shapes),t.maxValue=e.radar_axis_max||t.getMinMaxData().max[0].value)},getRadarSize:function getRadarSize(){var t=this.config.axis_x_categories.length<4?-20:10,e=(Math.min(this.arcWidth,this.arcHeight)-t)/2;return[e,e]},updateTargetsForRadar:function updateTargetsForRadar(t){var e=this.config;jh(e.axis_x_categories)&&(e.axis_x_categories=Gh(0,Fh("max",t.map(function(t){return t.values.length})))),this.generateRadarPoints()},getRadarPosition:function getRadarPosition(e,n,i,a){var r=this.config,t=this.getRadarSize(),o=k()(t,2),s=o[0],c=o[1],u=r.axis_x_categories.length,l=r.radar_direction_clockwise,h=zh(e).map(function(t){return function getPosition(t,e,n,i,a,r){var o=t&&0<i?n-i:i,s=2*Math.PI;return a*(1-r*("x"===e?Math.sin:Math.cos)(o*s/n))}(l,t,u,n,dh(i)?i:"x"===e?s:c,bh(a)?a:r.radar_size_ratio)});return 1===h.length?h[0]:h},generateRadarPoints:function generateRadarPoints(){var n=this,t=n.data.targets,e=n.getRadarSize(),i=k()(e,2),a=i[0],r=i[1],o=n.getCache(Di)||{},s=o._size;s&&(s.width===a||s.height===r)||(t.forEach(function(t){o[t.id]=t.values.map(function(t,e){return n.getRadarPosition(["x","y"],e,void 0,n.getRatio("radar",t))})}),o._size={width:a,height:r},n.addCache(Di,o))},redrawRadar:function redrawRadar(t,e){var n=this.getTranslate("radar");n&&(this.radars.attr("transform",n),this.main.selectAll(".".concat(Oe.circles)).attr("transform",n),this.main.select(".".concat(Oe.chartTexts)).attr("transform",n),this.generateRadarPoints(),this.updateRadarLevel(),this.updateRadarAxes(),this.updateRadarShape(t,e))},generateGetRadarPoints:function generateGetRadarPoints(){var i=this.getCache(Di);return function(t,e){var n=i[t.id][e];return[n,n,n,n]}},updateRadarLevel:function updateRadarLevel(){var n=this,t=n.config,e=n.getRadarSize(),i=k()(e,2),a=i[0],r=i[1],o=t.radar_level_depth,s=t.axis_x_categories.length,c=t.radar_level_text_show,u=n.radars.levels,l=Gh(0,o),h=t.radar_size_ratio*Math.min(a,r),d=l.map(function(t){return(t+1)/o*h}),f=t.radar_level_text_format,g=l.map(function(t){var e=d[t];return Gh(0,s).map(function(t){return n.getRadarPosition(["x","y"],t,e,1).join(",")}).join(" ")}),p=u.selectAll(".".concat(Oe.level)).data(l);p.exit().remove();var _=p.enter().append("g").attr("class",function(t,e){return"".concat(Oe.level," ").concat(Oe.level,"-").concat(e)});_.append("polygon").style("visibility",t.radar_level_show?null:"hidden"),c&&(u.select("text").empty()&&u.append("text").attr("dx","-.5em").attr("dy","-.7em").style("text-anchor","end").text(function(){return f(0)}),_.append("text").attr("dx","-.5em").style("text-anchor","end").text(function(t){return f(n.maxValue/l.length*(t+1))})),_.merge(p).attr("transform",function(t){return"translate(".concat(a-d[t],", ").concat(r-d[t],")")}).selectAll("polygon").attr("points",function(t){return g[t]}),c&&u.selectAll("text").attr("x",function(t){return ch(t)?a:g[t].split(",")[0]}).attr("y",function(t){return ch(t)?r:0})},updateRadarAxes:function updateRadarAxes(){var n=this,t=n.config,e=n.getRadarSize(),i=k()(e,2),a=i[0],r=i[1],o=t.axis_x_categories,s=n.radars.axes.selectAll("g").data(o);s.exit().remove();var c=s.enter().append("g").attr("class",function(t,e){return"".concat(Oe.axis,"-").concat(e)});t.radar_axis_line_show&&c.append("line"),t.radar_axis_text_show&&c.append("text"),s=c.merge(s),t.radar_axis_line_show&&s.select("line").attr("x1",a).attr("y1",r).attr("x2",function(t,e){return n.getRadarPosition("x",e)}).attr("y2",function(t,e){return n.getRadarPosition("y",e)}),t.radar_axis_text_show&&s.select("text").style("text-anchor","middle").attr("dy",".5em").call(function(t){t.each(function(t){rh(lt(this),t,[-1.2,1.2])})}).datum(function(t,e){return{index:e}}).attr("transform",function(t,e){return"translate(".concat(n.getRadarPosition("x",e,void 0,1)," ").concat(n.getRadarPosition("y",e,void 0,1),")")}),n.bindEvent()},bindEvent:function bindEvent(){var n=this,i=this;if(i.config.interaction_enabled){var a="mouse"===i.inputType,r=function(){var t=st.target;/tspan/i.test(t.tagName)&&(t=t.parentNode);var e=lt(t).datum();return e&&1===Object.keys(e).length?e.index:void 0},t=function(){var t=r(),e=ch(t);(a||e)&&(n.hideTooltip(),n.unexpandCircles(),a?i.setOverOut(!1,t):e&&i.callOverOutForTouch())};i.radars.select(".".concat(Oe.axis)).on(a?"mouseover ":"touchstart",function(){if(!i.transiting){var t=r();i.selectRectForSingle(i.svg.node(),null,t),a?i.setOverOut(!0,t):i.callOverOutForTouch(t)}}).on("mouseout",a?t:null),a||i.svg.on("touchstart",t)}},updateRadarShape:function updateRadarShape(t,e){var n=this,i=n.data.targets,a=n.getCache(Di),r=n.radars.shapes.selectAll("polygon").data(i),o=r.enter().append("g").attr("class",n.classChartRadar.bind(n));r.exit().transition().duration(e).remove(),o.append("polygon").merge(r).transition().duration(t).style("fill",function(t){return n.color(t)}).style("stroke",function(t){return n.color(t)}).attr("points",function(t){return a[t.id].join(" ")})},radarCircleX:function radarCircleX(t){return this.getCache(Di)[t.id][t.index][0]},radarCircleY:function radarCircleY(t){return this.getCache(Di)[t.id][t.index][1]}}),xh($n.prototype,{initText:function initText(){this.main.select(".".concat(Oe.chart)).append("g").attr("class",Oe.chartTexts),this.mainText=Bd([])},updateTargetsForText:function updateTargetsForText(t){var e=this.classChartText.bind(this),n=this.classTexts.bind(this),i=this.classFocus.bind(this);this.main.select(".".concat(Oe.chartTexts)).selectAll(".".concat(Oe.chartText)).data(t).attr("class",function(t){return e(t)+i(t)}).enter().append("g").attr("class",e).style("opacity","0").style("pointer-events","none").append("g").attr("class",n)},updateText:function updateText(t){var e=this,i=this,n=i.config,a=i.labelishData.bind(i),r=i.classText.bind(i);i.mainText=i.main.selectAll(".".concat(Oe.texts)).selectAll(".".concat(Oe.text)).data(function(t){return e.isRadarType(t)?t.values:a(t)}),i.mainText.exit().transition().duration(t).style("fill-opacity","0").remove(),i.mainText=i.mainText.enter().append("text").merge(i.mainText).attr("class",r).attr("text-anchor",function(t){return n.axis_rotated?t.value<0?"end":"start":"middle"}).style("fill",i.updateTextColor.bind(i)).style("fill-opacity","0").text(function(t,e,n){return i.dataLabelFormat(t.id)(t.value,t.id,e,n)})},updateTextColor:function updateTextColor(t){var e,n=this.config.data_labels_colors;return ah(n)?e=n:mh(n)&&(e=n[t.id]),e||this.color(t)},redrawText:function redrawText(e,n,t,i){var a=this,r=vh(),o=t?0:a.opacityForText.bind(a);return[this.mainText.each(function(){var t=lt(this);(i&&t.attr("x")?t.transition(r):t).attr("x",e).attr("y",n).style("fill",a.updateTextColor.bind(a)).style("fill-opacity",o)})]},getTextRect:function getTextRect(t,e){var n=t.node?t.node():t;/text/i.test(n.tagName)||(n=n.querySelector("text"));var i=n.textContent,a="$".concat(i.replace(/\W/g,"_")),r=this.getCache(a);return r||(this.svg.append("text").style("visibility","hidden").style("font",lt(n).style("font")).classed(e,!0).text(i).call(function(t){r=t.node().getBoundingClientRect()}).remove(),this.addCache(a,r)),r},generateXYForText:function generateXYForText(e,t){var i=this,n=Object.keys(e),a={},r=t?i.getXForText:i.getYForText;return i.hasType("radar")&&n.push("radar"),n.forEach(function(t){a[t]=i["generateGet".concat(yh(t),"Points")](e[t],!1)}),function(t,e){var n=(i.isAreaType(t)?"area":i.isBarType(t)&&"bar")||i.isRadarType(t)&&"radar"||"line";return r.call(i,a[n](t,e),t,this)}},getCenteredTextPos:function getCenteredTextPos(t,e,n){var i=this.config,a=i.axis_rotated;if(i.data_labels.centered&&this.isBarType(t)){var r=n.getBoundingClientRect(),o=0<=t.value;if(a){var s=(o?e[1][1]-e[0][1]:e[0][1]-e[1][1])/2+r.width/2;return o?-s-3:2+s}var c=(o?e[0][1]-e[1][1]:e[1][1]-e[0][1])/2+r.height/2;return o?c:-c-2}return 0},getXForText:function getXForText(t,e,n){var i,a,r=this.config,o=r.axis_rotated;return i=o?(a=this.isBarType(e)?4:6,t[2][1]+a*(e.value<0?-1:1)):this.hasType("bar")?(t[2][0]+t[0][0])/2:t[0][0],null===e.value&&(i>this.width?i=this.width-n.getBoundingClientRect().width:i<0&&(i=4)),o&&(i+=this.getCenteredTextPos(e,t,n)),i+(r.data_labels_position.x||0)},getYForText:function getYForText(t,e,n){var i,a=this.config,r=a.axis_rotated,o=a.point_r,s=n.getBoundingClientRect(),c=3;if(r)i=(t[0][0]+t[2][0]+.6*s.height)/2;else if(i=t[2][1],bh(o)&&5<o&&(this.isLineType(e)||this.isScatterType(e))&&(c+=a.point_r/2.3),e.value<0||0===e.value&&!this.hasPositiveValue)i+=s.height,this.isBarType(e)?i-=c:this.isBarType(e)||(i+=c);else{var u=2*-c;this.isBarType(e)?u=-c:this.isBubbleType(e)&&(u=c),i+=u}if(null===e.value&&!r){var l=s.height;i<l?i=l:i>this.height&&(i=this.height-4)}return r||(i+=this.getCenteredTextPos(e,t,n)),i+(a.data_labels_position.y||0)}});var Fi={Area:["area","area-spline","area-spline-range","area-line-range","area-step"],AreaRange:["area-spline-range","area-line-range"],Arc:["pie","donut","gauge","radar"],Line:["line","spline","area","area-spline","area-spline-range","area-line-range","step","area-step"],Step:["step","area-step"],Spline:["spline","area-spline","area-spline-range"]};xh($n.prototype,{setTargetType:function setTargetType(t,e){var n=this,i=n.config;n.mapToTargetIds(t).forEach(function(t){n.withoutFadeIn[t]=e===i.data_types[t],i.data_types[t]=e}),t||(i.data_type=e)},hasType:function hasType(n,t){var i=this.config.data_types,e=t||this.data.targets,a=!1;return e&&e.length?e.forEach(function(t){var e=i[t.id];(e&&0<=e.indexOf(n)||!e&&"line"===n)&&(a=!0)}):Object.keys(i).length?Object.keys(i).forEach(function(t){i[t]===n&&(a=!0)}):a=this.config.data_type===n,a},hasTypeOf:function hasTypeOf(t,e,n){var i=this,a=2<arguments.length&&void 0!==n?n:[];return!Fi[t].filter(function(t){return-1===a.indexOf(t)}).every(function(t){return!i.hasType(t,e)})},isTypeOf:function isTypeOf(t,e){var n=ah(t)?t:t.id,i=this.config.data_types[n];return lh(e)?0<=e.indexOf(i):i===e},hasArcType:function hasArcType(t,e){return this.hasTypeOf("Arc",t,e)},isLineType:function isLineType(t){var e=ah(t)?t:t.id;return!this.config.data_types[e]||this.isTypeOf(e,Fi.Line)},isStepType:function isStepType(t){return this.isTypeOf(t,Fi.Step)},isSplineType:function isSplineType(t){return this.isTypeOf(t,Fi.Spline)},isAreaType:function isAreaType(t){return this.isTypeOf(t,Fi.Area)},isAreaRangeType:function isAreaRangeType(t){return this.isTypeOf(t,Fi.AreaRange)},isBarType:function isBarType(t){return this.isTypeOf(t,"bar")},isBubbleType:function isBubbleType(t){return this.isTypeOf(t,"bubble")},isScatterType:function isScatterType(t){return this.isTypeOf(t,"scatter")},isPieType:function isPieType(t){return this.isTypeOf(t,"pie")},isGaugeType:function isGaugeType(t){return this.isTypeOf(t,"gauge")},isDonutType:function isDonutType(t){return this.isTypeOf(t,"donut")},isRadarType:function isRadarType(t){return this.isTypeOf(t,"radar")},isArcType:function isArcType(t){return this.isPieType(t)||this.isDonutType(t)||this.isGaugeType(t)||this.isRadarType(t)},isCirclePoint:function isCirclePoint(){var t=this.config,e=t.point_pattern;return"circle"===t.point_type&&(!e||lh(e)&&0===e.length)},lineData:function lineData(t){return this.isLineType(t)?[t]:[]},arcData:function arcData(t){return this.isArcType(t.data)?[t]:[]},barData:function barData(t){return this.isBarType(t)?t.values:[]},labelishData:function labelishData(t){return this.isBarType(t)||this.isLineType(t)||this.isScatterType(t)||this.isBubbleType(t)||this.isRadarType(t)?t.values:[]},barLineBubbleData:function barLineBubbleData(t){return this.isBarType(t)||this.isLineType(t)||this.isBubbleType(t)?t.values:[]},isInterpolationType:function isInterpolationType(t){return 0<=["basis","basis-closed","basis-open","bundle","cardinal","cardinal-closed","cardinal-open","catmull-rom","catmull-rom-closed","catmull-rom-open","linear","linear-closed","monotone-x","monotone-y","natural"].indexOf(t)}});function gl(t){return $g(t.position)||"end"}function hl(t){return"start"===t.position?4:"middle"===t.position?0:-4}function il(n,i,a){return function(t){var e=n?0:i;return"start"===t.position?e=n?-a:0:"middle"===t.position&&(e=(n?-a:i)/2),e}}xh($n.prototype,{initGrid:function initGrid(){this.xgrid=Bd([]),this.initGridLines(),this.initXYFocusGrid()},initGridLines:function initGridLines(){var t=this.config;(t.grid_x_lines.length||t.grid_y_lines.length)&&(this.gridLines=this.main.insert("g",".".concat(Oe.chart).concat(t.grid_lines_front?" + *":"")).attr("clip-path",this.clipPathForGrid).attr("class","".concat(Oe.grid," ").concat(Oe.gridLines)),this.gridLines.append("g").attr("class",Oe.xgridLines),this.gridLines.append("g").attr("class",Oe.ygridLines),this.xgridLines=Bd([]))},updateXGrid:function updateXGrid(t){function qWa(t){return((n.zoomScale||n.x)(t)+r)*(i?-1:1)}var n=this,e=n.config,i=e.axis_rotated,a=n.generateGridData(e.grid_x_type,n.x),r=n.isCategorized()?n.xAxis.tickOffset():0;n.xgridAttr=i?{x1:0,x2:n.width,y1:qWa,y2:qWa}:{x1:qWa,x2:qWa,y1:0,y2:n.height},n.xgrid=n.main.select(".".concat(Oe.xgrids)).selectAll(".".concat(Oe.xgrid)).data(a),n.xgrid.exit().remove(),n.xgrid=n.xgrid.enter().append("line").attr("class",Oe.xgrid).merge(n.xgrid),t||n.xgrid.each(function(){var e=lt(this);Object.keys(n.xgridAttr).forEach(function(t){e.attr(t,n.xgridAttr[t]).style("opacity",function(){return e.attr(i?"y1":"x1")===(i?n.height:0)?"0":"1"})})})},updateYGrid:function updateYGrid(){function yWa(t){return Math.ceil(e.y(t))}var e=this,t=e.config,n=t.axis_rotated,i=e.yAxis.tickValues()||e.y.ticks(t.grid_y_ticks);e.ygrid=e.main.select(".".concat(Oe.ygrids)).selectAll(".".concat(Oe.ygrid)).data(i),e.ygrid.exit().remove(),e.ygrid=e.ygrid.enter().append("line").attr("class",Oe.ygrid).merge(e.ygrid),e.ygrid.attr("x1",n?yWa:0).attr("x2",n?yWa:e.width).attr("y1",n?0:yWa).attr("y2",n?e.height:yWa),e.smoothLines(e.ygrid,"grid")},updateGrid:function updateGrid(t){this.gridLines||this.initGridLines(),this.grid.style("visibility",this.hasArcType()?"hidden":"visible"),this.main.select("line.".concat(Oe.xgridFocus)).style("visibility","hidden"),this.updateXGridLines(t),this.updateYGridLines(t)},updateXGridLines:function updateXGridLines(t){var e=this.main,n=this.config,i=n.axis_rotated;n.grid_x_show&&this.updateXGrid(),this.xgridLines=e.select(".".concat(Oe.xgridLines)).selectAll(".".concat(Oe.xgridLine)).data(n.grid_x_lines),this.xgridLines.exit().transition().duration(t).style("opacity","0").remove();var a=this.xgridLines.enter().append("g");a.append("line").style("opacity","0"),a.append("text").attr("transform",i?"":"rotate(-90)").attr("dy",-5).style("opacity","0"),this.xgridLines=a.merge(this.xgridLines),this.xgridLines.attr("class",function(t){return"".concat(Oe.xgridLine," ").concat(t.class||"").trim()}).select("text").attr("text-anchor",gl).attr("dx",hl).transition().duration(t).text(function(t){return t.text}).transition().style("opacity","1")},updateYGridLines:function updateYGridLines(t){var e=this,n=e.main,i=e.config,a=i.axis_rotated;i.grid_y_show&&e.updateYGrid(),e.ygridLines=n.select(".".concat(Oe.ygridLines)).selectAll(".".concat(Oe.ygridLine)).data(i.grid_y_lines),e.ygridLines.exit().transition().duration(t).style("opacity","0").remove();var r=e.ygridLines.enter().append("g");r.append("line").style("opacity","0"),r.append("text").attr("transform",a?"rotate(-90)":"").style("opacity","0"),e.ygridLines=r.merge(e.ygridLines);var o=e.yv.bind(e);e.ygridLines.attr("class",function(t){return"".concat(Oe.ygridLine," ").concat(t.class||"").trim()}).select("line").transition().duration(t).attr("x1",a?o:0).attr("x2",a?o:e.width).attr("y1",a?0:o).attr("y2",a?e.height:o).transition().style("opacity","1"),e.ygridLines.select("text").attr("text-anchor",gl).attr("dx",hl).transition().duration(t).attr("dy",-5).attr("x",il(a,e.width,e.height)).attr("y",o).text(function(t){return t.text}).transition().style("opacity","1")},redrawGrid:function redrawGrid(t){var e=this.config.axis_rotated,n=this.xv.bind(this),i=this.xgridLines.select("line"),a=this.xgridLines.select("text");return i=(t?i.transition():i).attr("x1",e?0:n).attr("x2",e?this.width:n).attr("y1",e?n:0).attr("y2",e?n:this.height),a=(t?a.transition():a).attr("x",il(!e,this.width,this.height)).attr("y",n).text(function(t){return t.text}),[(t?i.transition():i).style("opacity","1"),(t?a.transition():a).style("opacity","1")]},initXYFocusGrid:function initXYFocusGrid(){var t=this.config,e=t.grid_front,n=".".concat(Oe[e&&this.gridLines?"gridLines":"chart"]).concat(e?" + *":"");this.grid=this.main.insert("g",n).attr("clip-path",this.clipPathForGrid).attr("class",Oe.grid),t.grid_x_show&&this.grid.append("g").attr("class",Oe.xgrids),t.grid_y_show&&this.grid.append("g").attr("class",Oe.ygrids),t.grid_focus_show&&this.grid.append("g").attr("class",Oe.xgridFocus).append("line").attr("class",Oe.xgridFocus)},showXGridFocus:function showXGridFocus(t){var e=this,n=e.config,i=n.axis_rotated,a=t.filter(function(t){return t&&$g(e.getBaseValue(t))}),r=e.main.selectAll("line.".concat(Oe.xgridFocus)),o=e.xx.bind(e);!n.tooltip_show||e.hasType("bubble")||e.hasType("scatter")||e.hasArcType()||(r.style("visibility","visible").data([a[0]]).attr(i?"y1":"x1",o).attr(i?"y2":"x2",o),e.smoothLines(r,"grid"))},hideXGridFocus:function hideXGridFocus(){this.main.select("line.".concat(Oe.xgridFocus)).style("visibility","hidden")},updateXgridFocus:function updateXgridFocus(){var t=this.config.axis_rotated;this.main.select("line.".concat(Oe.xgridFocus)).attr("x1",t?0:-10).attr("x2",t?this.width:-10).attr("y1",t?-10:0).attr("y2",t?-10:this.height)},generateGridData:function generateGridData(t,e){var n=this.main.select(".".concat(Oe.axisX)).selectAll(".tick").size(),i=[];if("year"===t)for(var a=this.getXDomain(),r=a[0].getFullYear(),o=a[1].getFullYear(),s=r;s<=o;s++)i.push(new Date("".concat(s,"-01-01 00:00:00")));else(i=e.ticks(10)).length>n&&(i=i.filter(function(t){return(t+"").indexOf(".")<0}));return i},getGridFilterToRemove:function getGridFilterToRemove(t){return t?function(e){var n=!1;return(lh(t)?t.concat():[t]).forEach(function(t){("value"in t&&e.value===t.value||"class"in t&&e.class===t.class)&&(n=!0)}),n}:function(){return!0}},removeGridLines:function removeGridLines(t,e){var n=this.config,i=this.getGridFilterToRemove(t),a=e?Oe.xgridLines:Oe.ygridLines,r=e?Oe.xgridLine:Oe.ygridLine;this.main.select(".".concat(a)).selectAll(".".concat(r)).filter(i).transition().duration(n.transition_duration).style("opacity","0").remove();var o="grid_".concat(e?"x":"y","_lines");n[o]=n[o].filter(function toShow(t){return!i(t)})}}),xh($n.prototype,{initTooltip:function initTooltip(){var e=this,n=e.config,t=n.tooltip_contents.bindto;if(e.tooltip=lt(t),e.tooltip.empty()&&(e.tooltip=e.selectChart.style("position","relative").append("div").attr("class",Oe.tooltipContainer).style("position","absolute").style("pointer-events","none").style("display","none")),n.tooltip_init_show){if(e.isTimeSeries()&&ah(n.tooltip_init_x)){var i,a,r=e.data.targets[0];for(n.tooltip_init_x=e.parseDate(n.tooltip_init_x),i=0;(a=r.values[i])&&a.x-n.tooltip_init_x!=0;i++);n.tooltip_init_x=i}e.tooltip.html(e.getTooltipHTML(e.data.targets.map(function(t){return e.addName(t.values[n.tooltip_init_x])}),e.axis.getXAxisTickFormat(),e.getYFormat(e.hasArcType(null,["radar"])),e.color)),t||e.tooltip.style("top",n.tooltip_init_position.top).style("left",n.tooltip_init_position.left).style("display","block")}},getTooltipHTML:function getTooltipHTML(){for(var t,e,n=this,i=n.config,a=arguments.length,r=Array(a),o=0;o<a;o++)r[o]=arguments[o];return _g(i.tooltip_contents)?(t=i.tooltip_contents).call.apply(t,[n].concat(r)):(e=n).getTooltipContent.apply(e,r)},getTooltipContent:function getTooltipContent(t,e,n,i){function fYa(t){return a.getBaseValue(t)}var a=this,r=a.config,o=r.tooltip_format_title||e,s=r.tooltip_format_name||function(t){return t},c=r.tooltip_format_value||(a.isStackNormalized()?function(t,e){return"".concat((100*e).toFixed(2),"%")}:n),u=r.tooltip_order,l=a.levelColor?function(t){return a.levelColor(t.value)}:function(t){return i(t)},h=r.tooltip_contents,d=h.template;if(null===u&&r.data_groups.length){var f=a.orderTargets(a.data.targets).map(function(t){return t.id}).reverse();t.sort(function(t,e){var n=t?t.value:null,i=e?e.value:null;return 0<n&&0<i&&(n=t.id?f.indexOf(t.id):null,i=e.id?f.indexOf(e.id):null),n-i})}else/^(asc|desc)$/.test(u)?t.sort(function(t,e){var n=t?fYa(t):null,i=e?fYa(e):null;return"asc"===u?n-i:i-n}):_g(u)&&t.sort(u);var g,p,_,m,x,v=a.getTooltipContentTemplate(d);for(x=0;p=t[x];x++)if(fYa(p)||0===fYa(p)){if(ch(g)){var y=qh(o?o(p.x):p.x);g=Ih(v[0],{CLASS_TOOLTIP:Oe.tooltip,TITLE:$g(y)?d?y:'<tr><th colspan="2">'.concat(y,"</th></tr>"):""})}if(_=[p.ratio,p.id,p.index,t],m=qh(c.apply(void 0,[fYa(p)].concat(Ne()(_)))),a.isAreaRangeType(p)){var b=["high","low"].map(function(t){return qh(c.apply(void 0,[a.getAreaRangeData(p,t)].concat(Ne()(_))))}),T=k()(b,2),w=T[0],A=T[1];m="<b>Mid:</b> ".concat(m," <b>High:</b> ").concat(w," <b>Low:</b> ").concat(A)}if(void 0!==m)if("continue"===function(){if(null===p.name)return"continue";var t=qh(s.apply(void 0,[p.name].concat(Ne()(_)))),e=l(p),n={CLASS_TOOLTIP_NAME:Oe.tooltipName+a.getTargetSelectorSuffix(p.id),COLOR:d||!a.patterns?e:'<svg><rect style="fill:'.concat(e,'" width="10" height="10"></rect></svg>'),NAME:t,VALUE:m};d&&mh(h.text)&&Object.keys(h.text).forEach(function(t){n[t]=h.text[t][x]}),g+=Ih(v[1],n)}())continue}return"".concat(g,"</table>")},getTooltipContentTemplate:function getTooltipContentTemplate(t){return(t||'<table class="{=CLASS_TOOLTIP}"><tbody>\n\t\t\t\t{=TITLE}\n\t\t\t\t{{<tr class="{=CLASS_TOOLTIP_NAME}">\n\t\t\t\t\t<td class="name">'.concat(this.patterns?"{=COLOR}":'<span style="background-color:{=COLOR}"></span>','{=NAME}</td>\n\t\t\t\t\t<td class="value">{=VALUE}</td>\n\t\t\t\t</tr>}}\n\t\t\t</tbody></table>')).replace(/(\r?\n|\t)/g,"").split(/{{(.*)}}/)},tooltipPosition:function tooltipPosition(t,e,n,i){var a=this,r=a.config,o=dt(i),s=k()(o,2),c=s[0],u=s[1],l=a.getSvgLeft(!0),h=l+a.currentWidth-a.getCurrentPaddingRight();if(u+=20,a.hasArcType()){"touch"===a.inputType||a.hasType("radar")||(u+=a.height/2,c+=(a.width-(a.isLegendRight?a.getLegendWidth():0))/2)}else{var d=a.x(t[0].x);r.axis_rotated?(u=d+20,c+=l+100,h-=l):(u-=5,c=l+a.getCurrentPaddingLeft(!0)+20+(a.zoomScale?c:d))}var f=c+e;return h<f&&(c-=f-h+20),u+n>a.currentHeight&&(u-=n+30),u<0&&(u=0),{top:u,left:c}},showTooltip:function showTooltip(t,e){var n=this,i=n.config,a=i.tooltip_contents.bindto,r=n.hasArcType(null,["radar"]),o=t.filter(function(t){return t&&$g(n.getBaseValue(t))}),s=i.tooltip_position||n.tooltipPosition;if(0!==o.length&&i.tooltip_show){var c=n.tooltip.datum(),u=JSON.stringify(t),l=c&&c.width||0,h=c&&c.height||0;if(!c||c.current!==u){var d=t.concat().sort()[0].index;ph(i.tooltip_onshow,n),n.tooltip.html(n.getTooltipHTML(t,n.axis.getXAxisTickFormat(),n.getYFormat(r),n.color)).style("display",null).style("visibility",null).datum({index:d,current:u,width:l=n.tooltip.property("offsetWidth"),height:h=n.tooltip.property("offsetHeight")}),ph(i.tooltip_onshown,n),n._handleLinkedCharts(!0,d)}if(!a){var f=s.call(this,o,l,h,e);n.tooltip.style("top","".concat(f.top,"px")).style("left","".concat(f.left,"px"))}}},hideTooltip:function hideTooltip(t){var e=this.config;e.tooltip_doNotHide&&!t||(ph(e.tooltip_onhide,this),this.tooltip.style("display","none").style("visibility","hidden").datum(null),ph(e.tooltip_onhidden,this))},_handleLinkedCharts:function _handleLinkedCharts(s,c){var u=this;if(u.config.tooltip_linked){var l=u.config.tooltip_linked_name;(u.api.internal.charts||[]).forEach(function(t){if(t!==u.api){var e=t.internal.config,n=e.tooltip_linked,i=e.tooltip_linked_name,a=sn.document.body.contains(t.element);if(n&&l===i&&a){var r=t.internal.tooltip.data()[0],o=c!==(r&&r.index);try{s&&o?t.tooltip.show({index:c}):s||t.tooltip.hide()}catch(t){}}}})}}}),xh($n.prototype,{initLegend:function initLegend(){var t=this,e=t.config;t.legendItemTextBox={},t.legendHasRendered=!1,t.legend=t.svg.append("g"),e.legend_show?(t.legend.attr("transform",t.getTranslate("legend")),t.updateLegend()):(t.legend.style("visibility","hidden"),t.hiddenLegendIds=t.mapToIds(t.data.targets))},updateLegend:function updateLegend(t,e,n){var i=this,a=i.config,r=e||{withTransform:!1,withTransitionForTransform:!1,withTransition:!1};r.withTransition=nh(r,"withTransition",!0),r.withTransitionForTransform=nh(r,"withTransitionForTransform",!0),a.legend_contents_bindto&&a.legend_contents_template?i.updateLegendTemplate():i.updateLegendElement(t||i.mapToIds(i.data.targets),r,n),i.legend.selectAll(".".concat(Oe.legendItem)).classed(Oe.legendItemHidden,function(t){return!i.isTargetToShow(t)}),i.updateScales(!1,!i.zoomScale),i.updateSvgSize(),i.transformAll(r.withTransitionForTransform,n),i.legendHasRendered=!0},updateLegendTemplate:function updateLegendTemplate(){var n=this,t=n.config,e=lt(t.legend_contents_bindto),i=t.legend_contents_template;if(!e.empty()){var a=n.mapToIds(n.data.targets),r=[],o="";a.forEach(function(t){var e=_g(i)?i.call(n,t,n.color(t),n.api.data(t)[0].values):Ih(i,{COLOR:n.color(t),TITLE:t});e&&(r.push(t),o+=e)});var s=e.html(o).selectAll(function(){return this.childNodes}).data(r);n.setLegendItem(s),n.legend=e}},updateSizeForLegend:function updateSizeForLegend(t){var e=this,n=e.config,i=t.width,a=t.height,r={top:e.isLegendTop?e.getCurrentPaddingTop()+n.legend_inset_y+5.5:e.currentHeight-a-e.getCurrentPaddingBottom()-n.legend_inset_y,left:e.isLegendLeft?e.getCurrentPaddingLeft()+n.legend_inset_x+.5:e.currentWidth-i-e.getCurrentPaddingRight()-n.legend_inset_x+.5};e.margin3={top:e.isLegendRight?0:e.isLegendInset?r.top:e.currentHeight-a,right:NaN,bottom:0,left:e.isLegendRight?e.currentWidth-i:e.isLegendInset?r.left:0}},transformLegend:function transformLegend(t){(t?this.legend.transition():this.legend).attr("transform",this.getTranslate("legend"))},updateLegendStep:function updateLegendStep(t){this.legendStep=t},updateLegendItemWidth:function updateLegendItemWidth(t){this.legendItemWidth=t},updateLegendItemHeight:function updateLegendItemHeight(t){this.legendItemHeight=t},getLegendWidth:function getLegendWidth(){return this.config.legend_show?this.isLegendRight||this.isLegendInset?this.legendItemWidth*(this.legendStep+1):this.currentWidth:0},getLegendHeight:function getLegendHeight(){return this.config.legend_show?this.isLegendRight?this.currentHeight:Math.max(20,this.legendItemHeight)*(this.legendStep+1):0},opacityForLegend:function opacityForLegend(t){return t.classed(Oe.legendItemHidden)?null:"1"},opacityForUnfocusedLegend:function opacityForUnfocusedLegend(t){return t.classed(Oe.legendItemHidden)?null:"0.3"},toggleFocusLegend:function toggleFocusLegend(t,e){var n=this,i=n.mapToTargetIds(t);n.legend.selectAll(".".concat(Oe.legendItem)).filter(function(t){return 0<=i.indexOf(t)}).classed(Oe.legendItemFocused,e).transition().duration(100).style("opacity",function(){return(e?n.opacityForLegend:n.opacityForUnfocusedLegend).call(n,lt(this))})},revertLegend:function revertLegend(){var t=this;t.legend.selectAll(".".concat(Oe.legendItem)).classed(Oe.legendItemFocused,!1).transition().duration(100).style("opacity",function(){return t.opacityForLegend(lt(this))})},showLegend:function showLegend(t){var e=this,n=e.config;n.legend_show||(n.legend_show=!0,e.legend.style("visibility","visible"),e.legendHasRendered||e.updateLegend()),e.removeHiddenLegendIds(t),e.legend.selectAll(e.selectorLegends(t)).style("visibility","visible").transition().style("opacity",function(){return e.opacityForLegend(lt(this))})},hideLegend:function hideLegend(t){var e=this.config;e.legend_show&&jh(t)&&(e.legend_show=!1,this.legend.style("visibility","hidden")),this.addHiddenLegendIds(t),this.legend.selectAll(this.selectorLegends(t)).style("opacity","0").style("visibility","hidden")},clearLegendItemTextBoxCache:function clearLegendItemTextBoxCache(){this.legendItemTextBox={}},setLegendItem:function setLegendItem(t){var n=this,e=n.config,i="touch"===n.inputType;t.attr("class",function(t){var e=lt(this);return(!e.empty()&&e.attr("class")||"")+n.generateClass(Oe.legendItem,t)}).style("visibility",function(t){return n.isLegendToShow(t)?"visible":"hidden"}).style("cursor","pointer").on("click",function(t){ph(e.legend_item_onclick,n,t)||(st.altKey?(n.api.hide(),n.api.show(t)):(n.api.toggle(t),!i&&n.isTargetToShow(t)?n.api.focus(t):n.api.revert())),i&&n.hideTooltip()}),i||t.on("mouseout",function(t){ph(e.legend_item_onout,n,t)||(lt(this).classed(Oe.legendItemFocused,!1),n.api.revert())}).on("mouseover",function(t){ph(e.legend_item_onover,n,t)||(lt(this).classed(Oe.legendItemFocused,!0),!n.transiting&&n.isTargetToShow(t)&&n.api.focus(t))})},updateLegendElement:function updateLegendElement(t,e){function f_a(t,e,n){function I_a(t,e){e||(i=(u-_-c)/2)<10&&(i=(u-c)/2,_=0,T++),b[t]=T,y[T]=h.isLegendInset?10:i,m[t]=_,_+=c}var i,a=n===A.length-1,r=function(t,e){return h.legendItemTextBox[e]||(h.legendItemTextBox[e]=h.getTextRect(t,Oe.legendItem)),h.legendItemTextBox[e]}(t,e),o=r.width+f+(a&&!w?0:10)+d.legend_padding,s=r.height+4,c=w?s:o,u=w?h.getLegendHeight():h.getLegendWidth();if(0===n&&(p=g=T=_=0),d.legend_show&&!h.isLegendToShow(e))return x[e]=0,v[e]=0,b[e]=0,void(m[e]=0);x[e]=o,v[e]=s,(!g||g<=o)&&(g=o),(!p||p<=s)&&(p=s);var l=w?p:g;d.legend_equally?(Object.keys(x).forEach(function(t){return x[t]=g}),Object.keys(v).forEach(function(t){return v[t]=p}),(i=(u-l*A.length)/2)<10?(T=_=0,A.forEach(function(t){return I_a(t)})):I_a(e,!0)):I_a(e)}var n,i,a,h=this,d=h.config,f=d.legend_item_tile_width+5,g=0,p=0,_=0,m={},x={},v={},y=[0],b={},T=0,w=h.isLegendRight||h.isLegendInset,A=t.filter(function(t){return!dh(d.data_names[t])||null!==d.data_names[t]}),r=e.withTransition;h.isLegendInset&&(T=d.legend_inset_step?d.legend_inset_step:A.length,h.updateLegendStep(T)),i=h.isLegendRight?(n=function(t){return g*b[t]},function(t){return y[b[t]]+m[t]}):h.isLegendInset?(n=function(t){return g*b[t]+10},function(t){return y[b[t]]+m[t]}):(n=function(t){return y[b[t]]+m[t]},function(t){return p*b[t]});function g_a(t,e){return n(t,e)+4+d.legend_item_tile_width}function h_a(t,e){return n(t,e)}function i_a(t,e){return n(t,e)-2}function j_a(t,e){return n(t,e)-2+d.legend_item_tile_width}function k_a(t,e){return i(t,e)+9}function l_a(t,e){return i(t,e)-5}function m_a(t,e){return i(t,e)+4}var o=h.legend.selectAll(".".concat(Oe.legendItem)).data(A).enter().append("g");h.setLegendItem(o),o.append("text").text(function(t){return dh(d.data_names[t])?d.data_names[t]:t}).each(function(t,e){f_a(this,t,e)}).style("pointer-events","none").attr("x",w?g_a:-200).attr("y",w?-200:k_a),o.append("rect").attr("class",Oe.legendItemEvent).style("fill-opacity","0").attr("x",w?h_a:-200).attr("y",w?-200:l_a);var s=h.config.legend_usePoint;if(s){var c=[];o.append(function(t){var e=kh(d.point_pattern)?d.point_pattern:[d.point_type];-1===c.indexOf(t)&&c.push(t);var n=e[c.indexOf(t)%e.length];return"rectangle"===n&&(n="rect"),sn.document.createElementNS(at.svg,h.hasValidPointType(n)?n:"use")}).attr("class",Oe.legendItemPoint).style("fill",function(t){return h.color(t)}).style("pointer-events","none").attr("href",function(t,e,n){return"use"===n[e].nodeName.toLowerCase()?"#".concat(h.datetimeId,"-point-").concat(t):void 0})}else o.append("line").attr("class",Oe.legendItemTile).style("stroke",h.color).style("pointer-events","none").attr("x1",w?i_a:-200).attr("y1",w?-200:m_a).attr("x2",w?j_a:-200).attr("y2",w?-200:m_a).attr("stroke-width",d.legend_item_tile_height);a=h.legend.select(".".concat(Oe.legendBackground," rect")),h.isLegendInset&&0<g&&0===a.size()&&(a=h.legend.insert("g",".".concat(Oe.legendItem)).attr("class",Oe.legendBackground).append("rect"));var u=h.legend.selectAll("text").data(A).text(function(t){return dh(d.data_names[t])?d.data_names[t]:t}).each(function(t,e){f_a(this,t,e)});(r?u.transition():u).attr("x",g_a).attr("y",k_a);var l=h.legend.selectAll("rect.".concat(Oe.legendItemEvent)).data(A);if((r?l.transition():l).attr("width",function(t){return x[t]}).attr("height",function(t){return v[t]}).attr("x",h_a).attr("y",l_a),s){var k=h.legend.selectAll(".".concat(Oe.legendItemPoint)).data(A);(r?k.transition():k).each(function(){var t,e,n,i=this.nodeName.toLowerCase(),a=h.config.point_r,r="x",o="y",s=2,c=2.5;if("circle"===i){var u=.2*a;r="cx",o="cy",t=a+u,s=2*a,c=-u}else if("rect"===i){var l=2.5*a;n=e=l,c=3}lt(this).attr(r,function(t){return i_a(t)+s}).attr(o,function(t){return m_a(t)-c}).attr("r",t).attr("width",e).attr("height",n)})}else{var C=h.legend.selectAll("line.".concat(Oe.legendItemTile)).data(A);(r?C.transition():C).style("stroke",h.color).attr("x1",i_a).attr("y1",m_a).attr("x2",j_a).attr("y2",m_a)}a&&(r?a.transition():a).attr("height",h.getLegendHeight()-12).attr("width",g*(T+1)+10),h.updateLegendItemWidth(g),h.updateLegendItemHeight(p),h.updateLegendStep(T)}});function jl(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"left",e=1<arguments.length?arguments[1]:void 0,n=bh(e);return-1<t.indexOf("center")?n?e/2:"middle":-1<t.indexOf("right")?n?e:"end":n?0:"start"}xh($n.prototype,{initTitle:function initTitle(){if(this.config.title_text){this.title=this.svg.append("g");var t=this.title.append("text").style("text-anchor",jl(this.config.title_position)).attr("class",Oe.title);rh(t,this.config.title_text,[.3,1.5])}},redrawTitle:function redrawTitle(){var t=this;if(t.title){var e=t.yForTitle.call(t);/g/i.test(t.title.node().tagName)?t.title.attr("transform","translate(".concat(jl(t.config.title_position,t.currentWidth),", ").concat(e,")")):t.title.attr("x",t.xForTitle.call(t)).attr("y",e)}},xForTitle:function xForTitle(){var t,e=this.config,n=e.title_position||"left";return/(right|center)/.test(n)?(t=this.currentWidth-this.getTextRect(this.title,Oe.title).width,0<=n.indexOf("right")?t-=e.title_padding.right||0:0<=n.indexOf("center")&&(t/=2)):t=e.title_padding.left||0,t},yForTitle:function yForTitle(){return(this.config.title_padding.top||0)+this.getTextRect(this.title,Oe.title).height},getTitlePadding:function getTitlePadding(){return this.yForTitle()+(this.config.title_padding.bottom||0)}}),xh($n.prototype,{initClip:function initClip(){var t=this;t.clipId="".concat(t.datetimeId,"-clip"),t.clipIdForXAxis="".concat(t.clipId,"-xaxis"),t.clipIdForYAxis="".concat(t.clipId,"-yaxis"),t.clipIdForGrid="".concat(t.clipId,"-grid"),t.clipPath=t.getClipPath(t.clipId),t.clipPathForXAxis=t.getClipPath(t.clipIdForXAxis),t.clipPathForYAxis=t.getClipPath(t.clipIdForYAxis),t.clipPathForGrid=t.getClipPath(t.clipIdForGrid)},getClipPath:function getClipPath(t){var e=this.config;if(!e.clipPath&&/-clip$/.test(t)||!e.axis_x_clipPath&&/-clip-xaxis$/.test(t)||!e.axis_y_clipPath&&/-clip-yaxis$/.test(t))return null;var n=!!sn.window.navigator&&0<=sn.window.navigator.appVersion.toLowerCase().indexOf("msie 9.");return"url(".concat(n?"":sn.document.URL.split("#")[0],"#").concat(t,")")},appendClip:function appendClip(t,e){return t.append("clipPath").attr("id",e).append("rect")},getAxisClipX:function getAxisClipX(t){var e=Math.max(30,this.margin.left);return t?-(1+e):-(e-1)},getAxisClipY:function getAxisClipY(t){return t?-20:-this.margin.top},getXAxisClipX:function getXAxisClipX(){return this.getAxisClipX(!this.config.axis_rotated)},getXAxisClipY:function getXAxisClipY(){return this.getAxisClipY(!this.config.axis_rotated)},getYAxisClipX:function getYAxisClipX(){return this.config.axis_y_inner?-1:this.getAxisClipX(this.config.axis_rotated)},getYAxisClipY:function getYAxisClipY(){return this.getAxisClipY(this.config.axis_rotated)},getAxisClipWidth:function getAxisClipWidth(t){var e=Math.max(30,this.margin.left),n=Math.max(30,this.margin.right);return t?this.width+2+e+n:this.margin.left+20},getAxisClipHeight:function getAxisClipHeight(t){return(t?this.margin.bottom:this.margin.top+this.height)+20},getXAxisClipWidth:function getXAxisClipWidth(){return this.getAxisClipWidth(!this.config.axis_rotated)},getXAxisClipHeight:function getXAxisClipHeight(){return this.getAxisClipHeight(!this.config.axis_rotated)},getYAxisClipWidth:function getYAxisClipWidth(){return this.getAxisClipWidth(this.config.axis_rotated)+(this.config.axis_y_inner?20:0)},getYAxisClipHeight:function getYAxisClipHeight(){return this.getAxisClipHeight(this.config.axis_rotated)}}),xh($n.prototype,{initRegion:function initRegion(){this.region=this.main.append("g").attr("clip-path",this.clipPath).attr("class",Oe.regions)},updateRegion:function updateRegion(t){var e=this,n=e.config;e.region.style("visibility",e.hasArcType()?"hidden":"visible"),e.mainRegion=e.main.select(".".concat(Oe.regions)).selectAll(".".concat(Oe.region)).data(n.regions),e.mainRegion.exit().transition().duration(t).style("opacity","0").remove(),e.mainRegion=e.mainRegion.enter().append("g").merge(e.mainRegion).attr("class",e.classRegion.bind(e)),e.mainRegion.append("rect").style("fill-opacity","0")},redrawRegion:function redrawRegion(t){var e=this.mainRegion.select("rect");return e=(t?e.transition():e).attr("x",this.regionX.bind(this)).attr("y",this.regionY.bind(this)).attr("width",this.regionWidth.bind(this)).attr("height",this.regionHeight.bind(this)),[(t?e.transition():e).style("fill-opacity",function(t){return $g(t.opacity)?t.opacity:"0.1"}).on("end",function(){lt(this.parentNode).selectAll("rect:not([x])").remove()})]},getRegionXY:function getRegionXY(t,e){var n=this.config.axis_rotated,i="x"===t,a="start",r=0;return"y"===e.axis||"y2"===e.axis?(i||(a="end"),(i?n:!n)&&a in e&&(r=(0,this[e.axis])(e[a]))):(i?!n:n)&&a in e&&(r=(this.zoomScale||this.x)(this.isTimeSeries()?this.parseDate(e[a]):e[a])),r},regionX:function regionX(t){return this.getRegionXY("x",t)},regionY:function regionY(t){return this.getRegionXY("y",t)},getRegionSize:function getRegionSize(t,e){var n=this.config.axis_rotated,i="width"===t,a=this[i?"regionX":"regionY"](e),r="end",o=this[t];return"y"===e.axis||"y2"===e.axis?(i||(r="start"),(i?n:!n)&&r in e&&(o=(0,this[e.axis])(e[r]))):(i?!n:n)&&r in e&&(o=(this.zoomScale||this.x)(this.isTimeSeries()?this.parseDate(e[r]):e[r])),o<a?0:o-a},regionWidth:function regionWidth(t){return this.getRegionSize("width",t)},regionHeight:function regionHeight(t){return this.getRegionSize("height",t)},isRegionOnX:function isRegionOnX(t){return!t.axis||"x"===t.axis}}),xh($n.prototype,{drag:function drag(t){var f=this,e=f.config,n=f.main;if(!f.hasArcType()&&e.data_selection_enabled&&(!e.zoom_enabled||f.zoom.altDomain)&&e.data_selection_multiple){var i=k()(f.dragStart,2),a=i[0],r=i[1],o=k()(t,2),s=o[0],c=o[1],g=Math.min(a,s),p=Math.max(a,s),_=e.data_selection_grouped?f.margin.top:Math.min(r,c),m=e.data_selection_grouped?f.height:Math.max(r,c);n.select(".".concat(Oe.dragarea)).attr("x",g).attr("y",_).attr("width",p-g).attr("height",m-_),n.selectAll(".".concat(Oe.shapes)).selectAll(".".concat(Oe.shape)).filter(function(t){return e.data_selection_isselectable(t)}).each(function(t,e){var n,i=lt(this),a=i.classed(Oe.SELECTED),r=i.classed(Oe.INCLUDED),o=!1;if(i.classed(Oe.circle)){var s=1*i.attr("cx"),c=1*i.attr("cy");n=f.togglePoint,o=g<s&&s<p&&_<c&&c<m}else{if(!i.classed(Oe.bar))return;var u=function(t){var e=t.getBoundingClientRect(),n=e.width,i=e.height,a=sh(t);return{x:a[0].x,y:Math.min(a[0].y,a[1].y),width:n,height:i}}(this),l=u.x,h=(c=u.y,u.width),d=u.height;n=f.togglePath,o=!(p<l||l+h<g||m<c||c+d<_)}o^r&&(i.classed(Oe.INCLUDED,!r),i.classed(Oe.SELECTED,!a),n.call(f,!a,i,t,e))})}},dragstart:function dragstart(t){var e=this.config;this.hasArcType()||!e.data_selection_enabled||(this.dragStart=t,this.main.select(".".concat(Oe.chart)).append("rect").attr("class",Oe.dragarea).style("opacity","0.1"),this.setDragStatus(!0))},dragend:function dragend(){var t=this.config;this.hasArcType()||!t.data_selection_enabled||(this.main.select(".".concat(Oe.dragarea)).transition().duration(100).style("opacity","0").remove(),this.main.selectAll(".".concat(Oe.shape)).classed(Oe.INCLUDED,!1),this.setDragStatus(!1))},setDragStatus:function setDragStatus(t){this.dragging=t}}),xh($n.prototype,{selectPoint:function selectPoint(t,e,n){var i=this,a=i.config,r=a.axis_rotated,o=(r?i.circleY:i.circleX).bind(i),s=(r?i.circleX:i.circleY).bind(i),c=i.pointSelectR.bind(i);ph(a.data_onselected,i.api,e,t.node()),i.main.select(".".concat(Oe.selectedCircles).concat(i.getTargetSelectorSuffix(e.id))).selectAll(".".concat(Oe.selectedCircle,"-").concat(n)).data([e]).enter().append("circle").attr("class",function(){return i.generateClass(Oe.selectedCircle,n)}).attr("cx",o).attr("cy",s).attr("stroke",i.color).attr("r",function(t){return 1.4*i.pointSelectR(t)}).transition().duration(100).attr("r",c)},unselectPoint:function unselectPoint(t,e,n){ph(this.config.data_onunselected,this.api,e,t.node()),this.main.select(".".concat(Oe.selectedCircles).concat(this.getTargetSelectorSuffix(e.id))).selectAll(".".concat(Oe.selectedCircle,"-").concat(n)).transition().duration(100).attr("r",0).remove()},togglePoint:function togglePoint(t,e,n,i){this["".concat(t?"":"un","selectPoint")](e,n,i)},selectPath:function selectPath(t,e){var n=this,i=n.config;ph(i.data_onselected,n,e,t.node()),i.interaction_brighten&&t.transition().duration(100).style("fill",function(){return color_rgb(n.color(e)).brighter(.75)})},unselectPath:function unselectPath(t,e){var n=this,i=n.config;ph(i.data_onunselected,n,e,t.node()),i.interaction_brighten&&t.transition().duration(100).style("fill",function(){return n.color(e)})},togglePath:function togglePath(t,e,n,i){this["".concat(t?"":"un","selectPath")](e,n,i)},getToggle:function getToggle(t,e){return"path"===t.nodeName?this.togglePath:this.isStepType(e)?function(){}:this.togglePoint},toggleShape:function toggleShape(t,e,n){var i,a=this.config,r=lt(t),o=r.classed(Oe.SELECTED),s=this.getToggle(t,e).bind(this);if(a.data_selection_enabled&&a.data_selection_isselectable(e)){if(!a.data_selection_multiple){var c=".".concat(Oe.shapes);a.data_selection_grouped&&(c+=this.getTargetSelectorSuffix(e.id)),this.main.selectAll(c).selectAll(".".concat(Oe.shape)).each(function(t,e){var n=lt(this);n.classed(Oe.SELECTED)&&s(!1,(i=n).classed(Oe.SELECTED,!1),t,e)})}i&&i.node()===r.node()||(r.classed(Oe.SELECTED,!o),s(!o,r,e,n))}}}),xh($n.prototype,{initBrush:function initBrush(){var i=this,a=i.config,r=a.axis_rotated;i.brush=r?function brushY(){return brush_brush(Je)}():function brushX(){return brush_brush(Qe)}();function E3a(){i.redrawForBrush()}var n,t;i.brush.on("start",function(){"touch"===i.inputType&&i.hideTooltip(),E3a()}).on("brush",E3a).on("end",function(){n=i.x.orgDomain()}),i.brush.updateResize=function(){var e=this;t&&clearTimeout(t),t=setTimeout(function(){var t=e.getSelection();n&&brushSelection(t.node())&&e.move(t,n.map(i.subX.orgScale()))},0)},i.brush.update=function(){return 0===this.extent()()[1].filter(function(t){return isNaN(t)}).length&&i.context&&i.context.select(".".concat(Oe.brush)).call(this),this},i.brush.scale=function(t){var n=a.subchart_size_height||function(){var t=i.svg.select(".".concat(Oe.brush," .overlay")),e={width:0,height:0};return t.size()&&(e.width=+t.attr("width"),e.height=+t.attr("height")),e[r?"width":"height"]}(),e=i.getExtent();!e&&t.range?e=[[0,0],[t.range()[1],n]]:lh(e)&&(e=e.map(function(t,e){return[t,0<e?n:e]})),r&&e[1].reverse(),this.extent(e),this.update()},i.brush.getSelection=function(){return i.context?i.context.select(".".concat(Oe.brush)):lt([])}},initSubchart:function initSubchart(){var t=this,e=t.config,n=e.subchart_show?"visible":"hidden",i="".concat(t.clipId,"-subchart"),a=t.getClipPath(i);t.clipIdForSubchart=i,t.appendClip(t.defs,i),t.initBrush(),t.context=t.svg.append("g").attr("transform",t.getTranslate("context"));var r=t.context;r.style("visibility",n),r.append("g").attr("clip-path",a).attr("class",Oe.chart),t.hasType("bar")&&r.select(".".concat(Oe.chart)).append("g").attr("class",Oe.chartBars),r.select(".".concat(Oe.chart)).append("g").attr("class",Oe.chartLines),r.append("g").attr("clip-path",a).attr("class",Oe.brush).call(t.brush),t.axes.subx=r.append("g").attr("class",Oe.axisX).attr("transform",t.getTranslate("subx")).attr("clip-path",e.axis_rotated?"":t.clipPathForXAxis).style("visibility",e.subchart_axis_x_show?n:"hidden")},updateTargetsForSubchart:function updateTargetsForSubchart(t){var e=this,n=e.context,i=e.config,a=e.classChartBar.bind(e),r=e.classBars.bind(e),o=e.classChartLine.bind(e),s=e.classLines.bind(e),c=e.classAreas.bind(e);if(i.subchart_show){var u=n.select(".".concat(Oe.chartBars)).selectAll(".".concat(Oe.chartBar)).data(t).attr("class",a);u.enter().append("g").style("opacity","0").attr("class",a).merge(u).append("g").attr("class",r);var l=n.select(".".concat(Oe.chartLines)).selectAll(".".concat(Oe.chartLine)).data(t).attr("class",o),h=l.enter().append("g").style("opacity","0").attr("class",o).merge(l);h.append("g").attr("class",s),e.hasType("area")&&h.append("g").attr("class",c),n.selectAll(".".concat(Oe.brush," rect")).attr(i.axis_rotated?"width":"height",i.axis_rotated?e.width2:e.height2)}},updateBarForSubchart:function updateBarForSubchart(t){var e=this;e.contextBar=e.context.selectAll(".".concat(Oe.bars)).selectAll(".".concat(Oe.bar)).data(e.barData.bind(e)),e.contextBar.exit().transition().duration(t).style("opacity","0").remove(),e.contextBar=e.contextBar.enter().append("path").attr("class",e.classBar.bind(e)).style("stroke","none").style("fill",e.color).merge(e.contextBar).style("opacity",e.initialOpacity.bind(e))},redrawBarForSubchart:function redrawBarForSubchart(t,e,n){(e?this.contextBar.transition(vh()).duration(n):this.contextBar).attr("d",t).style("opacity","1")},updateLineForSubchart:function updateLineForSubchart(t){var e=this;e.contextLine=e.context.selectAll(".".concat(Oe.lines)).selectAll(".".concat(Oe.line)).data(e.lineData.bind(e)),e.contextLine.exit().transition().duration(t).style("opacity","0").remove(),e.contextLine=e.contextLine.enter().append("path").attr("class",e.classLine.bind(e)).style("stroke",e.color).merge(e.contextLine).style("opacity",e.initialOpacity.bind(e))},redrawLineForSubchart:function redrawLineForSubchart(t,e,n){(e?this.contextLine.transition(vh()).duration(n):this.contextLine).attr("d",t).style("opacity","1")},updateAreaForSubchart:function updateAreaForSubchart(t){var e=this;e.contextArea=e.context.selectAll(".".concat(Oe.areas)).selectAll(".".concat(Oe.area)).data(e.lineData.bind(e)),e.contextArea.exit().transition().duration(t).style("opacity","0").remove(),e.contextArea=e.contextArea.enter().append("path").attr("class",e.classArea.bind(e)).style("fill",e.color).style("opacity",function(){return e.orgAreaOpacity=lt(this).style("opacity"),"0"}).merge(e.contextArea).style("opacity","0")},redrawAreaForSubchart:function redrawAreaForSubchart(t,e,n){(e?this.contextArea.transition(vh()).duration(n):this.contextArea).attr("d",t).style("fill",this.color).style("opacity",this.orgAreaOpacity)},redrawSubchart:function redrawSubchart(t,i,a){var r=this,e=r.config;r.context.style("visibility",e.subchart_show?"visible":"hidden"),e.subchart_show&&(st&&"zoom"===st.type&&r.brush.update(),t&&(wh(r)||r.brush.update(),Object.keys(a.type).forEach(function(t){var e=yh(t),n=r["generateDraw".concat(e)](a.indices[t],!0);r["update".concat(e,"ForSubchart")](i),r["redraw".concat(e,"ForSubchart")](n,i,i)})))},redrawForBrush:function redrawForBrush(){this.redraw({withTransition:!1,withY:this.config.zoom_rescale,withSubchart:!1,withUpdateXDomain:!0,withDimension:!1}),this.config.subchart_onbrush.call(this.api,this.x.orgDomain())},transformContext:function transformContext(t,e){var n;e&&e.axisSubX?n=e.axisSubX:(n=this.context.select(".".concat(Oe.axisX)),t&&(n=n.transition())),this.context.attr("transform",this.getTranslate("context")),n.attr("transform",this.getTranslate("subx"))},getExtent:function getExtent(){var e=this,t=e.config.axis_x_extent;return t&&(_g(t)?t=t(e.getXDomain(e.data.targets),e.subX):e.isTimeSeries()&&t.every(isNaN)&&(t=t.map(function(t){return e.subX(e.parseDate(t))}))),t}});function kl(t){return function(){return t}}function ZoomEvent(t,e,n){this.target=t,this.type=e,this.transform=n}function Transform(t,e,n){this.k=t,this.x=e,this.y=n}Transform.prototype={constructor:Transform,scale:function(t){return 1===t?this:new Transform(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new Transform(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+")"}};var Ei=new Transform(1,0,0);function transform_transform(t){return t.__zoom||Ei}function src_noevent_nopropagation(){st.stopImmediatePropagation()}transform_transform.prototype=Transform.prototype;function ml(){st.preventDefault(),st.stopImmediatePropagation()}function zoom_defaultFilter(){return!st.button}function zoom_defaultExtent(){var t,e,n=this;return e=n instanceof SVGElement?(t=(n=n.ownerSVGElement||n).width.baseVal.value,n.height.baseVal.value):(t=n.clientWidth,n.clientHeight),[[0,0],[t,e]]}function defaultTransform(){return this.__zoom||Ei}function defaultWheelDelta(){return-st.deltaY*(st.deltaMode?120:1)/500}function zoom_defaultTouchable(){return"ontouchstart"in this}function defaultConstrain(t,e,n){var i=t.invertX(e[0][0])-n[0][0],a=t.invertX(e[1][0])-n[1][0],r=t.invertY(e[0][1])-n[0][1],o=t.invertY(e[1][1])-n[1][1];return t.translate(i<a?(i+a)/2:Math.min(0,i)||Math.max(0,a),r<o?(r+o)/2:Math.min(0,r)||Math.max(0,o))}xh($n.prototype,{initZoom:function initZoom(){this.zoomScale=null,this.generateZoom(),this.initZoomBehaviour()},bindZoomEvent:function bindZoomEvent(t){var e=!(0<arguments.length&&void 0!==t)||t,n=this.config.zoom_enabled;this.redrawEventRect();var i=this.main.select(".".concat(Oe.eventRects));n&&e?this.bindZoomOnEventRect(i,n.type):!1===e&&(this.api.unzoom(),i.on(".zoom",null).on(".drag",null))},generateZoom:function generateZoom(){var a=this,r=a.config,t=function(){var f,r,s=zoom_defaultFilter,l=zoom_defaultExtent,g=defaultConstrain,a=defaultWheelDelta,e=zoom_defaultTouchable,o=[0,1/0],p=[[-1/0,-1/0],[1/0,1/0]],c=250,h=nf,u=[],n=_t("start","zoom","end"),d=500,_=150,m=0;function zoom(t){t.property("__zoom",defaultTransform).on("wheel.zoom",wheeled).on("mousedown.zoom",mousedowned).on("dblclick.zoom",dblclicked).filter(e).on("touchstart.zoom",touchstarted).on("touchmove.zoom",touchmoved).on("touchend.zoom touchcancel.zoom",touchended).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function scale(t,e){return(e=Math.max(o[0],Math.min(o[1],e)))===t.k?t:new Transform(e,t.x,t.y)}function translate(t,e,n){var i=e[0]-n[0]*t.k,a=e[1]-n[1]*t.k;return i===t.x&&a===t.y?t:new Transform(t.k,i,a)}function centroid(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function schedule(t,c,u){t.on("start.zoom",function(){gesture(this,arguments).start()}).on("interrupt.zoom end.zoom",function(){gesture(this,arguments).end()}).tween("zoom",function(){var t=arguments,i=gesture(this,t),e=l.apply(this,t),a=u||centroid(e),r=Math.max(e[1][0]-e[0][0],e[1][1]-e[0][1]),n=this.__zoom,o="function"==typeof c?c.apply(this,t):c,s=h(n.invert(a).concat(r/n.k),o.invert(a).concat(r/o.k));return function(t){if(1===t)t=o;else{var e=s(t),n=r/e[2];t=new Transform(n,a[0]-e[0]*n,a[1]-e[1]*n)}i.zoom(null,t)}})}function gesture(t,e){for(var n,i=0,a=u.length;i<a;++i)if((n=u[i]).that===t)return n;return new Gesture(t,e)}function Gesture(t,e){this.that=t,this.args=e,this.index=-1,this.active=0,this.extent=l.apply(t,e)}function wheeled(){if(s.apply(this,arguments)){var t=gesture(this,arguments),e=this.__zoom,n=Math.max(o[0],Math.min(o[1],e.k*Math.pow(2,a.apply(this,arguments)))),i=dt(this);if(t.wheel)t.mouse[0][0]===i[0]&&t.mouse[0][1]===i[1]||(t.mouse[1]=e.invert(t.mouse[0]=i)),clearTimeout(t.wheel);else{if(e.k===n)return;t.mouse=[i,e.invert(i)],Dt(this),t.start()}ml(),t.wheel=setTimeout(function wheelidled(){t.wheel=null,t.end()},_),t.zoom("mouse",g(translate(scale(e,n),t.mouse[0],t.mouse[1]),t.extent,p))}}function mousedowned(){if(!r&&s.apply(this,arguments)){var n=gesture(this,arguments),t=lt(st.view).on("mousemove.zoom",function mousemoved(){if(ml(),!n.moved){var t=st.clientX-i,e=st.clientY-a;n.moved=m<t*t+e*e}n.zoom("mouse",g(translate(n.that.__zoom,n.mouse[0]=dt(n.that),n.mouse[1]),n.extent,p))},!0).on("mouseup.zoom",function mouseupped(){t.on("mousemove.zoom mouseup.zoom",null),yesdrag(st.view,n.moved),ml(),n.end()},!0),e=dt(this),i=st.clientX,a=st.clientY;Ve(st.view),src_noevent_nopropagation(),n.mouse=[e,this.__zoom.invert(e)],Dt(this),n.start()}}function dblclicked(){if(s.apply(this,arguments)){var t=this.__zoom,e=dt(this),n=t.invert(e),i=t.k*(st.shiftKey?.5:2),a=g(translate(scale(t,i),e,n),l.apply(this,arguments),p);ml(),0<c?lt(this).transition().duration(c).call(schedule,a,e):lt(this).call(zoom.transform,a)}}function touchstarted(){if(s.apply(this,arguments)){var t,e,n,i,a=gesture(this,arguments),r=st.changedTouches,o=r.length;for(src_noevent_nopropagation(),e=0;e<o;++e)n=r[e],i=[i=Cd(this,r,n.identifier),this.__zoom.invert(i),n.identifier],a.touch0?a.touch1||(a.touch1=i):(a.touch0=i,t=!0);if(f&&(f=clearTimeout(f),!a.touch1))return a.end(),void((i=lt(this).on("dblclick.zoom"))&&i.apply(this,arguments));t&&(f=setTimeout(function(){f=null},d),Dt(this),a.start())}}function touchmoved(){var t,e,n,i,a=gesture(this,arguments),r=st.changedTouches,o=r.length;for(ml(),f=f&&clearTimeout(f),t=0;t<o;++t)e=r[t],n=Cd(this,r,e.identifier),a.touch0&&a.touch0[2]===e.identifier?a.touch0[0]=n:a.touch1&&a.touch1[2]===e.identifier&&(a.touch1[0]=n);if(e=a.that.__zoom,a.touch1){var s=a.touch0[0],c=a.touch0[1],u=a.touch1[0],l=a.touch1[1],h=(h=u[0]-s[0])*h+(h=u[1]-s[1])*h,d=(d=l[0]-c[0])*d+(d=l[1]-c[1])*d;e=scale(e,Math.sqrt(h/d)),n=[(s[0]+u[0])/2,(s[1]+u[1])/2],i=[(c[0]+l[0])/2,(c[1]+l[1])/2]}else{if(!a.touch0)return;n=a.touch0[0],i=a.touch0[1]}a.zoom("touch",g(translate(e,n,i),a.extent,p))}function touchended(){var t,e,n=gesture(this,arguments),i=st.changedTouches,a=i.length;for(src_noevent_nopropagation(),r&&clearTimeout(r),r=setTimeout(function(){r=null},d),t=0;t<a;++t)e=i[t],n.touch0&&n.touch0[2]===e.identifier?delete n.touch0:n.touch1&&n.touch1[2]===e.identifier&&delete n.touch1;n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0?n.touch0[1]=this.__zoom.invert(n.touch0[0]):n.end()}return zoom.transform=function(t,e){var n=t.selection?t.selection():t;n.property("__zoom",defaultTransform),t!==n?schedule(t,e):n.interrupt().each(function(){gesture(this,arguments).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()})},zoom.scaleBy=function(t,e){zoom.scaleTo(t,function(){return this.__zoom.k*("function"==typeof e?e.apply(this,arguments):e)})},zoom.scaleTo=function(t,r){zoom.transform(t,function(){var t=l.apply(this,arguments),e=this.__zoom,n=centroid(t),i=e.invert(n),a="function"==typeof r?r.apply(this,arguments):r;return g(translate(scale(e,a),n,i),t,p)})},zoom.translateBy=function(t,e,n){zoom.transform(t,function(){return g(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof n?n.apply(this,arguments):n),l.apply(this,arguments),p)})},zoom.translateTo=function(t,i,a){zoom.transform(t,function(){var t=l.apply(this,arguments),e=this.__zoom,n=centroid(t);return g(Ei.translate(n[0],n[1]).scale(e.k).translate("function"==typeof i?-i.apply(this,arguments):-i,"function"==typeof a?-a.apply(this,arguments):-a),t,p)})},Gesture.prototype={start:function(){return 1==++this.active&&(this.index=u.push(this)-1,this.emit("start")),this},zoom:function(t,e){return this.mouse&&"mouse"!==t&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0==--this.active&&(u.splice(this.index,1),this.index=-1,this.emit("end")),this},emit:function(t){customEvent(new ZoomEvent(zoom,t,this.that.__zoom),n.apply,n,[t,this.that,this.args])}},zoom.wheelDelta=function(t){return arguments.length?(a="function"==typeof t?t:kl(+t),zoom):a},zoom.filter=function(t){return arguments.length?(s="function"==typeof t?t:kl(!!t),zoom):s},zoom.touchable=function(t){return arguments.length?(e="function"==typeof t?t:kl(!!t),zoom):e},zoom.extent=function(t){return arguments.length?(l="function"==typeof t?t:kl([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),zoom):l},zoom.scaleExtent=function(t){return arguments.length?(o[0]=+t[0],o[1]=+t[1],zoom):[o[0],o[1]]},zoom.translateExtent=function(t){return arguments.length?(p[0][0]=+t[0][0],p[1][0]=+t[1][0],p[0][1]=+t[0][1],p[1][1]=+t[1][1],zoom):[[p[0][0],p[0][1]],[p[1][0],p[1][1]]]},zoom.constrain=function(t){return arguments.length?(g=t,zoom):g},zoom.duration=function(t){return arguments.length?(c=+t,zoom):c},zoom.interpolate=function(t){return arguments.length?(h=t,zoom):h},zoom.on=function(){var t=n.on.apply(n,arguments);return t===n?zoom:t},zoom.clickDistance=function(t){return arguments.length?(m=(t=+t)*t,zoom):Math.sqrt(m)},zoom}().duration(0).on("start",a.onZoomStart.bind(a)).on("zoom",a.onZoom.bind(a)).on("end",a.onZoomEnd.bind(a));t.orgScaleExtent=function(){var t=r.zoom_extent||[1,10];return[t[0],Math.max(a.getMaxDataCount()/t[1],t[1])]},t.updateScaleExtent=function(){var t=hh(a.x.orgDomain())/hh(a.getZoomDomain()),e=this.orgScaleExtent();return this.scaleExtent([e[0]*t,e[1]*t]),this},t.updateTransformScale=function(t){a.orgXScale&&a.orgXScale.range(a.x.range());var e=t[r.axis_rotated?"rescaleY":"rescaleX"](a.orgXScale||a.x),n=a.trimXDomain(e.domain()),i=r.zoom_rescale;e.domain(n,a.orgXDomain),a.zoomScale=a.getCustomizedScale(e),a.xAxis.scale(a.zoomScale),i&&(a.orgXScale||(a.orgXScale=a.x.copy()),a.x.domain(n))},a.zoom=t},onZoomStart:function onZoomStart(){var t=st.sourceEvent;t&&(this.zoom.startEvent=t,ph(this.config.zoom_onzoomstart,this.api,t))},onZoom:function onZoom(){var n=this,t=n.config,e=st;if(t.zoom_enabled&&e.sourceEvent&&0!==n.filterTargetsToShow(n.data.targets).length){var i="mousemove"===e.sourceEvent.type,a=e.sourceEvent.wheelDelta<0,r=e.transform;!i&&a&&n.x.domain().every(function(t,e){return t!==n.orgXDomain[e]})&&n.x.domain(n.orgXDomain),n.zoom.updateTransformScale(r),n.isCategorized()&&n.x.orgDomain()[0]===n.orgXDomain[0]&&n.x.domain([n.orgXDomain[0]-1e-10,n.x.orgDomain()[1]]),n.redraw({withTransition:!1,withY:t.zoom_rescale,withSubchart:!1,withEventRect:!1,withDimension:!1}),n.cancelClick=i,ph(t.zoom_onzoom,n.api,n.zoomScale.domain())}},onZoomEnd:function onZoomEnd(){var t=this.zoom.startEvent;!t||event&&t.clientX===event.clientX&&t.clientY===event.clientY||(this.redrawEventRect(),this.updateZoom(),ph(this.config.zoom_onzoomend,this.api,this[this.zoomScale?"zoomScale":"subX"].domain()))},getZoomDomain:function getZoomDomain(){var t=this.config,e=k()(this.orgXDomain,2),n=e[0],i=e[1];return dh(t.zoom_x_min)&&(n=Fh("min",[n,t.zoom_x_min])),dh(t.zoom_x_max)&&(i=Fh("max",[i,t.zoom_x_max])),[n,i]},updateZoom:function updateZoom(t){if(this.zoomScale){var e=this.zoomScale.domain(),n=this.subX.domain(),i=(e[0]<=n[0]||e[0]-.015<=n[0])&&(n[1]<=e[1]||n[1]<=e[1]-.015);(t||i)&&(this.xAxis.scale(this.subX),this.x.domain(this.subX.orgDomain()),this.zoomScale=null)}},bindZoomOnEventRect:function bindZoomOnEventRect(t,e){var n="drag"===e?this.zoomBehaviour:this.zoom;t.call(n).on("dblclick.zoom",null)},initZoomBehaviour:function initZoomBehaviour(){var c=this,t=c.config.axis_rotated,u=0,l=0,h=null,d={axis:t?"y":"x",attr:t?"height":"width",index:t?1:0};c.zoomBehaviour=Ig().clickDistance(4).on("start",function(){c.setDragStatus(!0),h=h||c.main.append("rect").attr("clip-path",c.clipPath).attr("class",Oe.zoomBrush).attr("width",t?c.width:0).attr("height",t?0:c.height),u=dt(this)[d.index],l=u,h.attr(d.axis,u).attr(d.attr,0),c.onZoomStart()}).on("drag",function(){l=dt(this)[d.index],h.attr(d.axis,Math.min(u,l)).attr(d.attr,Math.abs(l-u))}).on("end",function(){var t,e=c.zoomScale||c.x;if(c.setDragStatus(!1),h.attr(d.axis,0).attr(d.attr,0),l<u&&(u=(t=[l,u])[0],l=t[1]),u<0&&(l+=Math.abs(u),u=0),u!==l)c.api.zoom([u,l].map(function(t){return e.invert(t)})),c.onZoomEnd();else if(c.isMultipleX())c.clickHandlerForMultipleXS.bind(this)(c);else{var n=st.sourceEvent||st,i="clientX"in n?[n.clientX,n.clientY]:[n.x,n.y],a=k()(i,2),r=a[0],o=a[1],s=sn.document.elementFromPoint(r,o);c.clickHandlerForSingleX.bind(s)(lt(s).datum(),c)}})},setZoomResetButton:function setZoomResetButton(){var t=this.config,e=t.zoom_resetButton;e&&"drag"===t.zoom_enabled.type&&(this.zoom.resetBtn?this.zoom.resetBtn.style("display",null):this.zoom.resetBtn=this.selectChart.append("div").classed(Oe.button,!0).append("span").on("click",this.api.unzoom.bind(this)).classed(Oe.buttonZoomReset,!0).text(e.text||"Reset Zoom"))}});var zi=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"];xh($n.prototype,{getColorFromCss:function getColorFromCss(){var t=sn.document.body,e=t.__colorPattern__;if(!e){var n=sn.document.createElement("span");n.className=Oe.colorPattern,n.style.display="none",t.appendChild(n);var i=sn.window.getComputedStyle(n).backgroundImage;n.parentNode.removeChild(n),-1<i.indexOf(";")&&(e=i.replace(/url[^#]*|["'()]|(\s|%20)/g,"").split(";").map(function(t){return t.trim().replace(/[\"'\s]/g,"")}).filter(Boolean),t.__colorPattern__=e)}return e},generateColor:function generateColor(){var a=this,t=a.config,r=t.data_colors,o=t.data_color,s=[],c=kh(t.color_pattern)?t.color_pattern:ordinal(a.getColorFromCss()||zi).range(),u=c;if(_g(t.color_tiles)){var l=t.color_tiles(),e=c.map(function(t,e){var n=t.replace(/[#\(\)\s,]/g,""),i="".concat(a.datetimeId,"-pattern-").concat(n,"-").concat(e);return function(t,e,n){var i=lt(t.cloneNode(!0));return i.attr("id",n).insert("rect",":first-child").attr("width",i.attr("width")).attr("height",i.attr("height")).style("fill",e),{id:n,node:i.node()}}(l[e%l.length],t,i)});c=e.map(function(t){return"url(#".concat(t.id,")")}),a.patterns=e}return function(t){var e,n=t.id||t.data&&t.data.id||t,i=a.isTypeOf(n,["line","spline","step"])||!a.config.data_types[n];return _g(r[n])?e=r[n](t):r[n]?e=r[n]:(s.indexOf(n)<0&&s.push(n),e=i?u[s.indexOf(n)%u.length]:c[s.indexOf(n)%c.length],r[n]=e),_g(o)?o(e,t):e}},generateLevelColor:function generateLevelColor(){var t=this.config,r=t.color_pattern,e=t.color_threshold,o="value"===e.unit,s=e.max||100,c=e.values&&e.values.length?e.values:[];return kh(e)?function(t){for(var e=o?t:100*t/s,n=r[r.length-1],i=0,a=c.length;i<a;i++)if(e<=c[i]){n=r[i];break}return n}:null},setOverColor:function setOverColor(t,e){var n=this,i=n.config.color_onover,a=t?i:n.color;mh(a)?a=function(t){var e=t.id;return e in i?i[e]:n.color(e)}:ah(a)&&(a=function(){return i}),mh(e)?n.main.selectAll(".".concat(Oe.arc,"-").concat(e.id)).style("fill",a(e)):n.main.selectAll(".".concat(Oe.shape,"-").concat(e)).each(function(t){var e=a(t);this.style.stroke=e,this.style.fill=e})}});function ql(t,e,n){var i=t.config,a="axis_".concat(e,"_tick_format");return(i[a]?i[a]:t.defaultValueFormat)(n)}xh($n.prototype,{getYFormat:function getYFormat(t){var i=this,a=i.yFormat,r=i.y2Format;return t&&!i.hasType("gauge")&&(a=i.defaultArcValueFormat,r=i.defaultArcValueFormat),function(t,e,n){return("y2"===i.axis.getId(n)?r:a).call(i,t,e)}},yFormat:function yFormat(t){return ql(this,"y",t)},y2Format:function y2Format(t){return ql(this,"y2",t)},defaultValueFormat:function defaultValueFormat(t){return $g(t)?+t:""},defaultArcValueFormat:function defaultArcValueFormat(t,e){return"".concat((100*e).toFixed(1),"%")},dataLabelFormat:function dataLabelFormat(t){function eab(t){return $g(t)?+t:""}var e=this.config.data_labels,n=eab;return _g(e.format)?n=e.format:ih(e.format)&&(n=e.format[t]?!0===e.format[t]?eab:e.format[t]:function(){return""}),n}}),xh($n.prototype,{addCache:function addCache(t,e,n){var i=!!(2<arguments.length&&void 0!==n)&&n;this.cache[t]=i?this.cloneTarget(e):e},removeCache:function removeCache(t){var e=this;zh(t).forEach(function(t){return delete e.cache[t]})},getCache:function getCache(t,e){if(!(1<arguments.length&&void 0!==e&&e))return this.cache[t]||null;for(var n,i=[],a=0;n=t[a];a++)n in this.cache&&i.push(this.cloneTarget(this.cache[n]));return i},resetCache:function resetCache(t){for(var e in this.cache)(t||/^\$/.test(e))&&(this.cache[e]=null)}}),xh($n.prototype,{generateClass:function generateClass(t,e){return" ".concat(t," ").concat(t+this.getTargetSelectorSuffix(e))},classText:function classText(t){return this.generateClass(Oe.text,t.index)},classTexts:function classTexts(t){return this.generateClass(Oe.texts,t.id)},classShape:function classShape(t){return this.generateClass(Oe.shape,t.index)},classShapes:function classShapes(t){return this.generateClass(Oe.shapes,t.id)},generateExtraLineClass:function generateExtraLineClass(){var n=this.config.line_classes||[],i=[];return function(t){var e=t.id||t.data&&t.data.id||t;return i.indexOf(e)<0&&i.push(e),n[i.indexOf(e)%n.length]}},classLine:function classLine(t){return this.classShape(t)+this.generateClass(Oe.line,t.id)},classLines:function classLines(t){return this.classShapes(t)+this.generateClass(Oe.lines,t.id)},classCircle:function classCircle(t){return this.classShape(t)+this.generateClass(Oe.circle,t.index)},classCircles:function classCircles(t){return this.classShapes(t)+this.generateClass(Oe.circles,t.id)},classBar:function classBar(t){return this.classShape(t)+this.generateClass(Oe.bar,t.index)},classBars:function classBars(t){return this.classShapes(t)+this.generateClass(Oe.bars,t.id)},classArc:function classArc(t){return this.classShape(t.data)+this.generateClass(Oe.arc,t.data.id)},classArcs:function classArcs(t){return this.classShapes(t.data)+this.generateClass(Oe.arcs,t.data.id)},classArea:function classArea(t){return this.classShape(t)+this.generateClass(Oe.area,t.id)},classAreas:function classAreas(t){return this.classShapes(t)+this.generateClass(Oe.areas,t.id)},classRegion:function classRegion(t,e){return"".concat(this.generateClass(Oe.region,e)," ").concat("class"in t?t.class:"")},classEvent:function classEvent(t){return this.generateClass(Oe.eventRect,t.index)},classTarget:function classTarget(t){var e=this.config.data_classes[t],n="";return e&&(n=" ".concat(Oe.target,"-").concat(e)),this.generateClass(Oe.target,t)+n},classFocus:function classFocus(t){return this.classFocused(t)+this.classDefocused(t)},classFocused:function classFocused(t){return" ".concat(0<=this.focusedTargetIds.indexOf(t.id)?Oe.focused:"")},classDefocused:function classDefocused(t){return" ".concat(0<=this.defocusedTargetIds.indexOf(t.id)?Oe.defocused:"")},classChartText:function classChartText(t){return Oe.chartText+this.classTarget(t.id)},classChartLine:function classChartLine(t){return Oe.chartLine+this.classTarget(t.id)},classChartBar:function classChartBar(t){return Oe.chartBar+this.classTarget(t.id)},classChartArc:function classChartArc(t){return Oe.chartArc+this.classTarget(t.data.id)},classChartRadar:function classChartRadar(t){return Oe.chartRadar+this.classTarget(t.id)},getTargetSelectorSuffix:function getTargetSelectorSuffix(t){return t||0===t?"-".concat(t).replace(/[\s?!@#$%^&*()_=+,.<>'":;\[\]\/|~`{}\\]/g,"-"):""},selectorTarget:function selectorTarget(t,e){return"".concat(e||"",".").concat(Oe.target+this.getTargetSelectorSuffix(t))},selectorTargets:function selectorTargets(t,e){var n=this,i=t||[];return i.length?i.map(function(t){return n.selectorTarget(t,e)}):null},selectorLegend:function selectorLegend(t){return".".concat(Oe.legendItem+this.getTargetSelectorSuffix(t))},selectorLegends:function selectorLegends(t){var e=this;return t&&t.length?t.map(function(t){return e.selectorLegend(t)}):null}}),xh(rj.prototype,{focus:function focus(t){var e=this.internal,n=e.mapToTargetIds(t),i=e.svg.selectAll(e.selectorTargets(n.filter(e.isTargetToShow,e)));this.revert(),this.defocus(),i.classed(Oe.focused,!0).classed(Oe.defocused,!1),e.hasArcType()&&e.expandArc(n),e.toggleFocusLegend(n,!0),e.focusedTargetIds=n,e.defocusedTargetIds=e.defocusedTargetIds.filter(function(t){return n.indexOf(t)<0})},defocus:function defocus(t){var e=this.internal,n=e.mapToTargetIds(t);e.svg.selectAll(e.selectorTargets(n.filter(e.isTargetToShow,e))).classed(Oe.focused,!1).classed(Oe.defocused,!0),e.hasArcType()&&e.unexpandArc(n),e.toggleFocusLegend(n,!1),e.focusedTargetIds=e.focusedTargetIds.filter(function(t){return n.indexOf(t)<0}),e.defocusedTargetIds=n},revert:function revert(t){var e=this.internal,n=e.mapToTargetIds(t);e.svg.selectAll(e.selectorTargets(n)).classed(Oe.focused,!1).classed(Oe.defocused,!1),e.hasArcType()&&e.unexpandArc(n),e.config.legend_show&&(e.showLegend(n.filter(e.isLegendToShow.bind(e))),e.legend.selectAll(e.selectorLegends(n)).filter(function(){return lt(this).classed(Oe.legendItemFocused)}).classed(Oe.legendItemFocused,!1)),e.focusedTargetIds=[],e.defocusedTargetIds=[]}}),xh(rj.prototype,{_showHide:function _showHide(t,e,n){var i=this.internal,a=i.mapToTargetIds(e);i["".concat(t?"remove":"add","HiddenTargetIds")](a);var r=i.svg.selectAll(i.selectorTargets(a)),o=t?"1":"0";r.transition().style("opacity",o,"important").call(i.endall,function(){r.style("opacity",null).style("opacity",o)}),n.withLegend&&i["".concat(t?"show":"hide","Legend")](a),i.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},show:function show(t,e){var n=1<arguments.length&&void 0!==e?e:{};this._showHide(!0,t,n)},hide:function hide(t,e){var n=1<arguments.length&&void 0!==e?e:{};this._showHide(!1,t,n)},toggle:function toggle(t,e){var n=this,i=1<arguments.length&&void 0!==e?e:{},a=this.internal,r={show:[],hide:[]};a.mapToTargetIds(t).forEach(function(t){return r[a.isTargetToShow(t)?"hide":"show"].push(t)}),r.show.length&&this.show(r.show,i),r.hide.length&&setTimeout(function(){return n.hide(r.hide,i)},0)}});function sl(t){var e,n=this.internal,i=t;if(n.config.zoom_enabled&&i&&function(t,e){var n=k()(e,2),i=n[0],a=n[1];return t.every(function(t,e){return 0===e?i<=t:t<=a})}(i,n.getZoomDomain())){if(n.isTimeSeries()&&(i=i.map(function(t){return n.parseDate(t)})),n.config.subchart_show){var a=n.zoomScale||n.x;n.brush.getSelection().call(n.brush.move,[a(i[0]),a(i[1])]),e=i}else n.x.domain(i),n.zoomScale=n.x,n.xAxis.scale(n.zoomScale),e=n.zoomScale.orgDomain();n.redraw({withTransition:!0,withY:n.config.zoom_rescale,withDimension:!1}),n.setZoomResetButton(),ph(n.config.zoom_onzoom,e)}else e=n.zoomScale?n.zoomScale.domain():n.x.orgDomain();return e}xh(sl,{enable:function enable(t){var e=0<arguments.length&&void 0!==t?t:"wheel",n=this.internal,i=n.config,a=e;e&&(a=ah(e)&&/^(drag|wheel)$/.test(e)?{type:e}:e),i.zoom_enabled=a,n.zoom?!1===e&&n.bindZoomEvent(!1):(n.initZoom(),n.bindZoomEvent()),n.updateAndRedraw()},max:function max(t){var e=this.internal,n=e.config;return 0!==t&&!t||(n.zoom_x_max=Fh("max",[e.orgXDomain[1],t])),n.zoom_x_max},min:function min(t){var e=this.internal,n=e.config;return 0!==t&&!t||(n.zoom_x_min=Fh("min",[e.orgXDomain[0],t])),n.zoom_x_min},range:function range(t){var e=this.zoom;if(mh(t)){var n=t.min,i=t.max;dh(n)&&e.min(n),dh(i)&&e.max(i)}return{min:e.min(),max:e.max()}}}),xh(rj.prototype,{zoom:sl,unzoom:function unzoom(){var t=this.internal,e=t.config;if(t.zoomScale){e.subchart_show?t.brush.getSelection().call(t.brush.move,null):t.zoom.updateTransformScale(Ei),t.updateZoom(!0),t.zoom.resetBtn&&t.zoom.resetBtn.style("display","none");var n=t.main.select(".".concat(Oe.eventRects));transform_transform(n.node())!==Ei&&t.zoom.transform(n,Ei),t.redraw({withTransition:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withY:e.zoom_rescale})}}}),xh(rj.prototype,{load:function load(e){var t=this.internal,n=t.config;e.xs&&t.addXs(e.xs),"names"in e&&this.data.names(e.names),"classes"in e&&Object.keys(e.classes).forEach(function(t){n.data_classes[t]=e.classes[t]}),"categories"in e&&t.isCategorized()&&(n.axis_x_categories=e.categories),"axes"in e&&Object.keys(e.axes).forEach(function(t){n.data_axes[t]=e.axes[t]}),"colors"in e&&Object.keys(e.colors).forEach(function(t){n.data_colors[t]=e.colors[t]}),"unload"in e&&!1!==e.unload?t.unload(t.mapToTargetIds(!0===e.unload?null:e.unload),function(){return t.loadFromArgs(e)}):t.loadFromArgs(e)},unload:function unload(t){var e=this.internal,n=t||{};lh(n)?n={ids:n}:ah(n)&&(n={ids:[n]});var i=e.mapToTargetIds(n.ids);e.unload(i,function(){e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),e.removeCache(i),n.done&&n.done()})}}),xh(rj.prototype,{flow:function flow(t){var e,n,i,a,r=this.internal,o=0,s=0;if((t.json||t.rows||t.columns)&&(e=r.convertData(t)),e&&r.isTabVisible()){var c=[],u=r.getMaxDataCount(),l=r.convertDataToTargets(e,!0);r.data.targets.forEach(function(t){for(var e=!1,n=0;n<l.length;n++)if(t.id===l[n].id){e=!0,t.values[t.values.length-1]&&(s=t.values[t.values.length-1].index+1),o=l[n].values.length;for(var i=0;i<o;i++)l[n].values[i].index=s+i,r.isTimeSeries()||(l[n].values[i].x=s+i);t.values=t.values.concat(l[n].values),l.splice(n,1);break}e||c.push(t.id)}),r.data.targets.forEach(function(t){for(var e=0;e<c.length;e++)if(t.id===c[e]){s=t.values[t.values.length-1].index+1;for(var n=0;n<o;n++)t.values.push({id:t.id,index:s+n,x:r.isTimeSeries()?r.getOtherTargetX(s+n):s+n,value:null})}}),r.data.targets.length&&l.forEach(function(t){for(var e=[],n=r.data.targets[0].values[0].index;n<s;n++)e.push({id:t.id,index:n,x:r.isTimeSeries()?r.getOtherTargetX(n):n,value:null});t.values.forEach(function(t){t.index+=s,r.isTimeSeries()||(t.x+=s)}),t.values=e.concat(t.values)}),r.data.targets=r.data.targets.concat(l);var h=r.data.targets[0],d=h.values[0];dh(t.to)?(o=0,a=r.isTimeSeries()?r.parseDate(t.to):t.to,h.values.forEach(function(t){t.x<a&&o++})):dh(t.length)&&(o=t.length),u?1===u&&r.isTimeSeries()&&(i=(h.values[h.values.length-1].x-d.x)/2,n=[new Date(+d.x-i),new Date(+d.x+i)]):(i=r.isTimeSeries()?1<h.values.length?h.values[h.values.length-1].x-d.x:d.x-r.getXDomain(r.data.targets)[0]:1,n=[d.x-i,d.x]),n&&r.updateXDomain(null,!0,!0,!1,n),r.updateTargets(r.data.targets),r.redraw({flow:{index:d.index,length:o,duration:$g(t.duration)?t.duration:r.config.transition_duration,done:t.done,orgDataCount:u},withLegend:!0,withTransition:1<u,withTrimXDomain:!1,withUpdateXAxis:!0})}}}),xh($n.prototype,{generateFlow:function generateFlow(z){var X=this,I=X.config;return function(){var t,e,n=z.targets,i=z.flow,a=z.shape.type,r=a.bar,o=a.line,s=a.area,c=z.shape.pos,u=c.cx,l=c.cy,h=c.xForText,d=c.yForText,f=z.xv,g=z.duration,p=i.index,_=i.length,m=X.getValueOnIndex(X.data.targets[0].values,p),x=X.getValueOnIndex(X.data.targets[0].values,p+_),v=X.x.domain(),y=i.duration||g,b=i.done||function(){},T=X.generateWait(),w=X.xgrid||Bd([]),A=X.xgridLines||Bd([]),k=X.mainRegion||Bd([]),C=X.mainText||Bd([]),S=X.mainBar||Bd([]),M=X.mainLine||Bd([]),L=X.mainArea||Bd([]),D=X.mainCircle||Bd([]);X.flowing=!0,X.data.targets.forEach(function(t){t.values.splice(0,_)});var F=X.updateXDomain(n,!0,!0);X.updateXGrid&&X.updateXGrid(!0),t=i.orgDataCount?1===i.orgDataCount||(m&&m.x)===(x&&x.x)?X.x(v[0])-X.x(F[0]):X.isTimeSeries()?X.x(v[0])-X.x(F[0]):X.x(m.x)-X.x(x.x):1===X.data.targets[0].values.length?X.isTimeSeries()?(m=X.getValueOnIndex(X.data.targets[0].values,0),x=X.getValueOnIndex(X.data.targets[0].values,X.data.targets[0].values.length-1),X.x(m.x)-X.x(x.x)):hh(F)/2:X.x(v[0])-X.x(F[0]),e=hh(v)/hh(F);var R="translate(".concat(t,",0) scale(").concat(e,",1)");X.hideXGridFocus();var E=src_transition_transition().ease(linear_linear).duration(y);T.add([X.axes.x.transition(E).call(function(t){return X.xAxis.setTransition(E).create(t)}),S.transition(E).attr("transform",R),M.transition(E).attr("transform",R),L.transition(E).attr("transform",R),D.transition(E).attr("transform",R),C.transition(E).attr("transform",R),k.filter(X.isRegionOnX).transition(E).attr("transform",R),w.transition(E).attr("transform",R),A.transition(E).attr("transform",R)]),E.call(T,function(){var t=[],e=[],n=[];if(_){for(var i,a=0;a<_;a++)i=p+a,t.push(".".concat(Oe.shape,"-").concat(i)),e.push(".".concat(Oe.text,"-").concat(i)),n.push(".".concat(Oe.eventRect,"-").concat(i));X.svg.selectAll(".".concat(Oe.shapes)).selectAll(t).remove(),X.svg.selectAll(".".concat(Oe.texts)).selectAll(e).remove(),X.svg.selectAll(".".concat(Oe.eventRects)).selectAll(n).remove(),X.svg.select(".".concat(Oe.xgrid)).remove()}if(w.size()&&w.attr("transform",null).attr(X.xgridAttr),A.attr("transform",null),A.select("line").attr("x1",I.axis_rotated?0:f).attr("x2",I.axis_rotated?X.width:f),A.select("text").attr("x",I.axis_rotated?X.width:0).attr("y",f),S.attr("transform",null).attr("d",r),M.attr("transform",null).attr("d",o),L.attr("transform",null).attr("d",s),D.attr("transform",null),X.isCirclePoint())D.attr("cx",u).attr("cy",l);else{D.attr("x",function(t){return u(t)-I.point_r}).attr("y",function(t){return l(t)-I.point_r}).attr("cx",u).attr("cy",l)}C.attr("transform",null).attr("x",h).attr("y",d).style("fill-opacity",X.opacityForText.bind(X)),k.attr("transform",null),k.select("rect").filter(X.isRegionOnX).attr("x",X.regionX.bind(X)).attr("width",X.regionWidth.bind(X)),I.interaction_enabled&&X.redrawEventRect(),b(),X.flowing=!1})}}}),xh(rj.prototype,{selected:function selected(t){var e=this.internal,n=[];return e.main.selectAll(".".concat(Oe.shapes+e.getTargetSelectorSuffix(t))).selectAll(".".concat(Oe.shape)).filter(function(){return lt(this).classed(Oe.SELECTED)}).each(function(t){return n.push(t)}),n},select:function select(c,u,l){var h=this.internal,d=h.config;d.data_selection_enabled&&h.main.selectAll(".".concat(Oe.shapes)).selectAll(".".concat(Oe.shape)).each(function(t,e){var n=lt(this),i=t.data?t.data.id:t.id,a=h.getToggle(this,t).bind(h),r=d.data_selection_grouped||!c||0<=c.indexOf(i),o=!u||0<=u.indexOf(e),s=n.classed(Oe.SELECTED);n.classed(Oe.line)||n.classed(Oe.area)||(r&&o?d.data_selection_isselectable(t)&&!s&&a(!0,n.classed(Oe.SELECTED,!0),t,e):dh(l)&&l&&s&&a(!1,n.classed(Oe.SELECTED,!1),t,e))})},unselect:function unselect(c,u){var l=this.internal,h=l.config;h.data_selection_enabled&&l.main.selectAll(".".concat(Oe.shapes)).selectAll(".".concat(Oe.shape)).each(function(t,e){var n=lt(this),i=t.data?t.data.id:t.id,a=l.getToggle(this,t).bind(l),r=h.data_selection_grouped||!c||0<=c.indexOf(i),o=!u||0<=u.indexOf(e),s=n.classed(Oe.SELECTED);n.classed(Oe.line)||n.classed(Oe.area)||r&&o&&h.data_selection_isselectable(t)&&s&&a(!1,n.classed(Oe.SELECTED,!1),t,e)})}}),xh(rj.prototype,{transform:function transform(t,e){var n=this.internal,i=0<=["pie","donut"].indexOf(t)?{withTransform:!0}:null;(function transformTo(t,e,n){var i=n||{withTransitionForAxis:!this.hasArcType()};i.withTransitionForTransform=!1,this.transiting=!1,this.setTargetType(t,e),this.updateTargets(this.data.targets),this.updateAndRedraw(i)}).bind(n)(e,t,i)}}),xh(rj.prototype,{groups:function groups(t){var e=this.internal,n=e.config;return ch(t)||(n.data_groups=t,e.redraw()),n.data_groups}});function tl(t){var e=this.internal,n=e.config;return t&&(n.grid_x_lines=t,e.redrawWithoutRescale()),n.grid_x_lines}xh(tl,{add:function add(t){return this.xgrids(this.internal.config.grid_x_lines.concat(t||[]))},remove:function remove(t){this.internal.removeGridLines(t,!0)}});function ul(t){var e=this.internal,n=e.config;return t&&(n.grid_y_lines=t,e.redrawWithoutRescale()),n.grid_y_lines}xh(ul,{add:function add(t){return this.ygrids(this.internal.config.grid_y_lines.concat(t||[]))},remove:function remove(t){this.internal.removeGridLines(t,!1)}}),xh(rj.prototype,{xgrids:tl,ygrids:ul});function vl(t){var e=this.internal,n=e.config;return t?(n.regions=t,e.redrawWithoutRescale(),t):n.regions}xh(vl,{add:function add(t){var e=this.internal,n=e.config;return t&&(n.regions=n.regions.concat(t),e.redrawWithoutRescale()),n.regions},remove:function remove(t){var e=this.internal,n=e.config,i=t||{},a=nh(i,"duration",n.transition_duration),r=nh(i,"classes",[Oe.region]),o=e.main.select(".".concat(Oe.regions)).selectAll(r.map(function(t){return".".concat(t)}));return(a?o.transition().duration(a):o).style("opacity","0").remove(),o=n.regions,Object.keys(i).length?(o=o.filter(function(t){var e=!1;return!t.class||(t.class.split(" ").forEach(function(t){0<=r.indexOf(t)&&(e=!0)}),!e)}),n.regions=o):n.regions=[],o}}),xh(rj.prototype,{regions:vl});function wl(e){var t=this.internal.data.targets;return ch(e)?t:t.filter(function(t){return 0<=e.indexOf(t.id)})}xh(wl,{shown:function shown(t){return this.internal.filterTargetsToShow(this.data(t))},values:function(t){var n=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],i=null;if(t){var e=this.data(t);e&&lh(e)&&(i=[],e.forEach(function(t){var e=t.values.map(function(t){return t.value});n?i=i.concat(e):i.push(e)}))}return i},names:function names(t){return this.internal.clearLegendItemTextBoxCache(),this.internal.updateDataAttributes("names",t)},colors:function colors(t){return this.internal.updateDataAttributes("colors",t)},axes:function axes(t){return this.internal.updateDataAttributes("axes",t)},min:function min(){return this.internal.getMinMaxData().min},max:function max(){return this.internal.getMinMaxData().max}}),xh(rj.prototype,{data:wl}),xh(rj.prototype,{category:function category(t,e){var n=this.internal,i=n.config;return 1<arguments.length&&(i.axis_x_categories[t]=e,n.redraw()),i.axis_x_categories[t]},categories:function categories(t){var e=this.internal,n=e.config;return arguments.length&&(n.axis_x_categories=t,e.redraw()),n.axis_x_categories}}),xh(rj.prototype,{color:function color(t){return this.internal.color(t)}}),xh(rj.prototype,{x:function x(t){var e=this.internal,n=e.isCustomX()&&e.isCategorized();return lh(t)&&(n?e.api.categories(t):(e.updateTargetX(e.data.targets,t),e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))),n?e.api.categories():e.data.xs},xs:function xs(t){var e=this.internal;return mh(t)&&(e.updateTargetXs(e.data.targets,t),e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),e.data.xs}});function xl(t,e,n){var i=t.config,a="axis_x_".concat(e),r="axis_y_".concat(e),o="axis_y2_".concat(e);dh(n)&&(ih(n)?($g(n.x)&&(i[a]=n.x),$g(n.y)&&(i[r]=n.y),$g(n.y2)&&(i[o]=n.y2)):(i[r]=n,i[o]=n),t.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))}function yl(t,e){var n=t.config;return{x:n["axis_x_".concat(e)],y:n["axis_y_".concat(e)],y2:n["axis_y2_".concat(e)]}}var Xi=xh(function(){},{labels:function labels(e){var n=this.internal;arguments.length&&(Object.keys(e).forEach(function(t){n.axis.setLabelText(t,e[t])}),n.axis.updateLabels())},min:function min(t){var e=this.internal;return arguments.length?xl(e,"min",t):yl(e,"min")},max:function max(t){var e=this.internal;return arguments.length?xl(e,"max",t):yl(e,"max")},range:function range(t){var e=this.axis;if(!arguments.length)return{max:e.max(),min:e.min()};dh(t.max)&&e.max(t.max),dh(t.min)&&e.min(t.min)}});xh(rj.prototype,{axis:Xi});var Ii=xh(function(){},{show:function show(t){var e=this.internal;e.showLegend(e.mapToTargetIds(t)),e.updateAndRedraw({withLegend:!0})},hide:function hide(t){var e=this.internal;e.hideLegend(e.mapToTargetIds(t)),e.updateAndRedraw({withLegend:!0})}});xh(rj.prototype,{legend:Ii}),xh(rj.prototype,{resize:function resize(t){var e=this.internal.config;e.size_width=t?t.width:null,e.size_height=t?t.height:null,this.flush(!1,!0)},flush:function flush(t,e){var n=this.internal;e?n.brush&&n.brush.updateResize():n.axis&&n.axis.setOrient(),n.zoomScale=null,t?n.redraw({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withLegend:!0}):n.updateAndRedraw({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})},destroy:function destroy(){var e=this,n=this.internal;return kh(n)&&(n.callPluginHook("$willDestroy"),n.charts.splice(n.charts.indexOf(this),1),n.svg.select("*").interrupt(),dh(n.resizeTimeout)&&sn.window.clearTimeout(n.resizeTimeout),sn.window.removeEventListener("resize",n.resizeFunction),n.selectChart.classed("bb",!1).html(""),Object.keys(this).forEach(function(t){"internal"===t&&Object.keys(n).forEach(function(t){n[t]=null}),e[t]=null,delete e[t]})),null},config:function config(t,e,n){var i,a=this.internal,r=t&&t.replace(/\./g,"_");return r in a.config&&(dh(e)?(i=a.config[r]=e,n&&this.flush()):i=a.config[r]),i}});var Oi=xh(function(){},{show:function show(t){var e,n,i=0<arguments.length&&void 0!==t?t:{},a=this.internal;if(i.mouse&&(n=i.mouse),i.data){var r=a.getYScale(i.data.id)(i.data.value);a.isMultipleX()?n=[a.x(i.data.x),r]:(a.config.tooltip_grouped||(n=[0,r]),e=$g(i.data.index)?i.data.index:a.getIndexByX(i.data.x))}else dh(i.x)?e=a.getIndexByX(i.x):dh(i.index)&&(e=i.index);("mouse"===a.inputType?["mouseover","mousemove"]:["touchstart"]).forEach(function(t){a.dispatchEvent(t,e,n)})},hide:function hide(){var t=this.internal;t.hideTooltip(!0),t.hideXGridFocus(),t.unexpandCircles(),t.unexpandBars()}});xh(rj.prototype,{tooltip:Oi});function Dl(t,e){var n=new XMLSerializer,i=t.cloneNode(!0),a=function(t){var n=[];return t.forEach(function(e){try{e.cssRules&&e.cssRules.length&&(n=n.concat(zh(e.cssRules)))}catch(t){console.error("Error while reading rules from ".concat(e.href,": ").concat(t.toString()))}}),n}(zh(sn.document.styleSheets)).filter(function(t){return t.cssText}).map(function(t){return t.cssText});i.setAttribute("xmlns",at.xhtml);var r=n.serializeToString(i),o=sn.document.createElement("style");o.appendChild(sn.document.createTextNode(a.join("\n")));var s=n.serializeToString(o),c='<svg xmlns="'.concat(at.svg,'" width="').concat(e.width,'" height="').concat(e.height,'">\n\t\t\t<foreignObject width="100%" height="100%">\n\t\t\t\t').concat(s,"\n\t\t\t\t").concat(r.replace(/(url\()[^#]+/g,"$1"),"\n\t\t\t</foreignObject></svg>").replace("/\n/g","%0A");return"data:image/svg+xml;base64,".concat(function(t){return btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,function(t,e){return String.fromCharCode("0x".concat(e))}))}(c))}xh(rj.prototype,{export:function _export(n,i){var t=this.internal,a={width:t.currentWidth,height:t.currentHeight},e=Dl(this.element,a);if(_g(i)){var r=new Image;r.crosssOrigin="Anonymous",r.onload=function(){var t=sn.document.createElement("canvas"),e=t.getContext("2d");t.width=a.width,t.height=a.height,e.drawImage(r,0,0),i(t.toDataURL(n))},r.src=e}return e}}),n.d(e,"bb",function(){return Ni});var Pi={},Ni={version:"1.9.5",generate:function generate(t){var e=cn({},Pi,t),n=new rj(e);return n.internal.charts=this.instance,this.instance.push(n),n},defaults:function defaults(t){return mh(t)&&(Pi=t),Pi},instance:[],plugin:{},chart:{fn:rj.prototype,internal:{fn:$n.prototype,axis:{fn:qn.prototype}}}};e.default=Ni}],__webpack_require__.c=i,__webpack_require__.d=function(t,e,n){__webpack_require__.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},__webpack_require__.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(__webpack_require__.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)__webpack_require__.d(n,i,function(t){return e[t]}.bind(null,i));return n},__webpack_require__.n=function(t){var e=t&&t.__esModule?function getDefault(){return t.default}:function getModuleExports(){return t};return __webpack_require__.d(e,"a",e),e},__webpack_require__.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=13);function __webpack_require__(t){if(i[t])return i[t].exports;var e=i[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,__webpack_require__),e.l=!0,e.exports}var n,i});
\No newline at end of file