-
Notifications
You must be signed in to change notification settings - Fork 1
/
61499c24-1dca99a9ba64e0548dc1.js
1 lines (1 loc) · 204 KB
/
61499c24-1dca99a9ba64e0548dc1.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{LV99:function(t,e,i){i("ToJy"),i("E9XD"),t.exports=function(){"use strict";function t(t){var e=this;e.d3=window.d3?window.d3:i("VphZ"),e.api=t,e.config=e.getDefaultConfig(),e.data={},e.cache={},e.axes={}}function e(i){this.internal=new t(this),this.internal.loadConfig(i),this.internal.beforeInit(i),this.internal.init(),this.internal.afterInit(i),function t(e,i,n){Object.keys(e).forEach((function(r){i[r]=e[r].bind(n),Object.keys(e[r]).length>0&&t(e[r],i[r],n)}))}(e.prototype,this,this)}var n=function(t){return Math.ceil(t)+.5},r=function(t){return 10*Math.ceil(t/10)},a=function(t){return t[1]-t[0]},o=function(t,e,i){return l(t[e])?t[e]:i},s=function(t){var e=c(t),i=[t.pathSegList.getItem(0),t.pathSegList.getItem(1)];return{x:i[0].x,y:Math.min(i[0].y,i[1].y),width:e.width,height:e.height}},c=function(t){try{return t.getBBox()}catch(e){return{x:0,y:0,width:0,height:0}}},d=function(t){return Array.isArray(t)},l=function(t){return void 0!==t},u=function(t){return null==t||p(t)&&0===t.length||"object"==typeof t&&0===Object.keys(t).length},h=function(t){return"function"==typeof t},g=function(t){return"number"==typeof t},p=function(t){return"string"==typeof t},f=function(t){return void 0===t},_=function(t){return t||0===t},x=function(t){return!u(t)},y=function(t){return"string"==typeof t?t.replace(/</g,"<").replace(/>/g,">"):t},m=function(t){var e=function(t){void 0===t&&(t=window.navigator.userAgent);var e=t.indexOf("MSIE ");return e>0?parseInt(t.substring(e+5,t.indexOf(".",e)),10):(e=t.indexOf("Trident/"))>0&&(e=t.indexOf("rv:"),parseInt(t.substring(e+3,t.indexOf(".",e)),10))}();return void 0===t?!!e:t===e};function S(t,e){this.component=t,this.params=e||{},this.d3=t.d3,this.scale=this.d3.scaleLinear(),this.range,this.orient="bottom",this.innerTickSize=6,this.outerTickSize=this.params.withOuterTick?6:0,this.tickPadding=3,this.tickValues=null,this.tickFormat,this.tickArguments,this.tickOffset=0,this.tickCulling=!0,this.tickCentered,this.tickTextCharSize,this.tickTextRotate=this.params.tickTextRotate,this.tickLength,this.axis=this.generateAxis()}S.prototype.axisX=function(t,e,i){t.attr("transform",(function(t){return"translate("+Math.ceil(e(t)+i)+", 0)"}))},S.prototype.axisY=function(t,e){t.attr("transform",(function(t){return"translate(0,"+Math.ceil(e(t))+")"}))},S.prototype.scaleExtent=function(t){var e=t[0],i=t[t.length-1];return e<i?[e,i]:[i,e]},S.prototype.generateTicks=function(t){var e,i,n=[];if(t.ticks)return t.ticks.apply(t,this.tickArguments);for(i=t.domain(),e=Math.ceil(i[0]);e<i[1];e++)n.push(e);return n.length>0&&n[0]>0&&n.unshift(n[0]-(n[1]-n[0])),n},S.prototype.copyScale=function(){var t,e=this.scale.copy();return this.params.isCategory&&(t=this.scale.domain(),e.domain([t[0],t[1]-1])),e},S.prototype.textFormatted=function(t){var e=this.tickFormat?this.tickFormat(t):t;return void 0!==e?e:""},S.prototype.updateRange=function(){return this.range=this.scale.rangeExtent?this.scale.rangeExtent():this.scaleExtent(this.scale.range()),this.range},S.prototype.updateTickTextCharSize=function(t){var e=this;if(e.tickTextCharSize)return e.tickTextCharSize;var i={h:11.5,w:5.5};return t.select("text").text((function(t){return e.textFormatted(t)})).each((function(t){var n=c(this),r=e.textFormatted(t),a=n.height,o=r?n.width/r.length:void 0;a&&o&&(i.h=a,i.w=o)})).text(""),e.tickTextCharSize=i,i},S.prototype.isVertical=function(){return"left"===this.orient||"right"===this.orient},S.prototype.tspanData=function(t,e,i){var n=this.params.tickMultiline?this.splitTickText(t,i):[].concat(this.textFormatted(t));return this.params.tickMultiline&&this.params.tickMultilineMax>0&&(n=this.ellipsify(n,this.params.tickMultilineMax)),n.map((function(t){return{index:e,splitted:t,length:n.length}}))},S.prototype.splitTickText=function(t,e){var i,n,r,a=this,o=a.textFormatted(t),s=a.params.tickWidth;return"[object Array]"===Object.prototype.toString.call(o)?o:((!s||s<=0)&&(s=a.isVertical()?95:a.params.isCategory?Math.ceil(e(1)-e(0))-12:110),function t(e,o){n=void 0;for(var c=1;c<o.length;c++)if(" "===o.charAt(c)&&(n=c),i=o.substr(0,c+1),r=a.tickTextCharSize.w*i.length,s<r)return t(e.concat(o.substr(0,n||c)),o.slice(n?n+1:c));return e.concat(o)}([],o+""))},S.prototype.ellipsify=function(t,e){if(t.length<=e)return t;for(var i=t.slice(0,e),n=3,r=e-1;r>=0;r--){var a=i[r].length;if(i[r]=i[r].substr(0,a-n).padEnd(a,"."),(n-=a)<=0)break}return i},S.prototype.updateTickLength=function(){this.tickLength=Math.max(this.innerTickSize,0)+this.tickPadding},S.prototype.lineY2=function(t){var e=this.scale(t)+(this.tickCentered?0:this.tickOffset);return this.range[0]<e&&e<this.range[1]?this.innerTickSize:0},S.prototype.textY=function(){var t=this.tickTextRotate;return t?11.5-t/15*2.5*(t>0?1:-1):this.tickLength},S.prototype.textTransform=function(){var t=this.tickTextRotate;return t?"rotate("+t+")":""},S.prototype.textTextAnchor=function(){var t=this.tickTextRotate;return t?t>0?"start":"end":"middle"},S.prototype.tspanDx=function(){var t=this.tickTextRotate;return t?8*Math.sin(Math.PI*(t/180)):0},S.prototype.tspanDy=function(t,e){var i=this.tickTextCharSize.h;return 0===e&&(i=this.isVertical()?-((t.length-1)*(this.tickTextCharSize.h/2)-3):".71em"),i},S.prototype.generateAxis=function(){var t=this,e=t.d3,i=t.params;function n(r,a){var o;return r.each((function(){var r,s,c,d=n.g=e.select(this),l=this.__chart__||t.scale,u=this.__chart__=t.copyScale(),h=t.tickValues?t.tickValues:t.generateTicks(u),g=d.selectAll(".tick").data(h,u),p=g.enter().insert("g",".domain").attr("class","tick").style("opacity",1e-6),f=g.exit().remove(),_=g.merge(p);i.isCategory?(t.tickOffset=Math.ceil((u(1)-u(0))/2),s=t.tickCentered?0:t.tickOffset,c=t.tickCentered?t.tickOffset:0):t.tickOffset=s=0,t.updateRange(),t.updateTickLength(),t.updateTickTextCharSize(d.select(".tick"));var x=_.select("line").merge(p.append("line")),y=_.select("text").merge(p.append("text")),m=_.selectAll("text").selectAll("tspan").data((function(e,i){return t.tspanData(e,i,u)})),S=m.enter().append("tspan").merge(m).text((function(t){return t.splitted}));m.exit().remove();var w=d.selectAll(".domain").data([0]),v=w.enter().append("path").merge(w).attr("class","domain");switch(t.orient){case"bottom":r=t.axisX,x.attr("x1",s).attr("x2",s).attr("y2",(function(e,i){return t.lineY2(e,i)})),y.attr("x",0).attr("y",(function(e,i){return t.textY(e,i)})).attr("transform",(function(e,i){return t.textTransform(e,i)})).style("text-anchor",(function(e,i){return t.textTextAnchor(e,i)})),S.attr("x",0).attr("dy",(function(e,i){return t.tspanDy(e,i)})).attr("dx",(function(e,i){return t.tspanDx(e,i)})),v.attr("d","M"+t.range[0]+","+t.outerTickSize+"V0H"+t.range[1]+"V"+t.outerTickSize);break;case"top":r=t.axisX,x.attr("x1",s).attr("x2",s).attr("y2",(function(e,i){return-1*t.lineY2(e,i)})),y.attr("x",0).attr("y",(function(e,n){return-1*t.textY(e,n)-(i.isCategory?2:t.tickLength-2)})).attr("transform",(function(e,i){return t.textTransform(e,i)})).style("text-anchor",(function(e,i){return t.textTextAnchor(e,i)})),S.attr("x",0).attr("dy",(function(e,i){return t.tspanDy(e,i)})).attr("dx",(function(e,i){return t.tspanDx(e,i)})),v.attr("d","M"+t.range[0]+","+-t.outerTickSize+"V0H"+t.range[1]+"V"+-t.outerTickSize);break;case"left":r=t.axisY,x.attr("x2",-t.innerTickSize).attr("y1",c).attr("y2",c),y.attr("x",-t.tickLength).attr("y",t.tickOffset).style("text-anchor","end"),S.attr("x",-t.tickLength).attr("dy",(function(e,i){return t.tspanDy(e,i)})),v.attr("d","M"+-t.outerTickSize+","+t.range[0]+"H0V"+t.range[1]+"H"+-t.outerTickSize);break;case"right":r=t.axisY,x.attr("x2",t.innerTickSize).attr("y1",c).attr("y2",c),y.attr("x",t.tickLength).attr("y",t.tickOffset).style("text-anchor","start"),S.attr("x",t.tickLength).attr("dy",(function(e,i){return t.tspanDy(e,i)})),v.attr("d","M"+t.outerTickSize+","+t.range[0]+"H0V"+t.range[1]+"H"+t.outerTickSize)}if(u.rangeBand){var b=u,T=b.rangeBand()/2;l=u=function(t){return b(t)+T}}else l.rangeBand?l=u:f.call(r,u,t.tickOffset);p.call(r,l,t.tickOffset),o=(a?_.transition(a):_).style("opacity",1).call(r,u,t.tickOffset)})),o}return n.scale=function(e){return arguments.length?(t.scale=e,n):t.scale},n.orient=function(e){return arguments.length?(t.orient=e in{top:1,right:1,bottom:1,left:1}?e+"":"bottom",n):t.orient},n.tickFormat=function(e){return arguments.length?(t.tickFormat=e,n):t.tickFormat},n.tickCentered=function(e){return arguments.length?(t.tickCentered=e,n):t.tickCentered},n.tickOffset=function(){return t.tickOffset},n.tickInterval=function(){var e;return(e=i.isCategory?2*t.tickOffset:(n.g.select("path.domain").node().getTotalLength()-2*t.outerTickSize)/n.g.selectAll("line").size())==1/0?0:e},n.ticks=function(){return arguments.length?(t.tickArguments=arguments,n):t.tickArguments},n.tickCulling=function(e){return arguments.length?(t.tickCulling=e,n):t.tickCulling},n.tickValues=function(e){if("function"==typeof e)t.tickValues=function(){return e(t.scale.domain())};else{if(!arguments.length)return t.tickValues;t.tickValues=e}return n},n};var w={target:"c3-target",chart:"c3-chart",chartLine:"c3-chart-line",chartLines:"c3-chart-lines",chartBar:"c3-chart-bar",chartBars:"c3-chart-bars",chartText:"c3-chart-text",chartTexts:"c3-chart-texts",chartArc:"c3-chart-arc",chartArcs:"c3-chart-arcs",chartArcsTitle:"c3-chart-arcs-title",chartArcsBackground:"c3-chart-arcs-background",chartArcsGaugeUnit:"c3-chart-arcs-gauge-unit",chartArcsGaugeMax:"c3-chart-arcs-gauge-max",chartArcsGaugeMin:"c3-chart-arcs-gauge-min",selectedCircle:"c3-selected-circle",selectedCircles:"c3-selected-circles",eventRect:"c3-event-rect",eventRects:"c3-event-rects",eventRectsSingle:"c3-event-rects-single",eventRectsMultiple:"c3-event-rects-multiple",zoomRect:"c3-zoom-rect",brush:"c3-brush",dragZoom:"c3-drag-zoom",focused:"c3-focused",defocused:"c3-defocused",region:"c3-region",regions:"c3-regions",title:"c3-title",tooltipContainer:"c3-tooltip-container",tooltip:"c3-tooltip",tooltipName:"c3-tooltip-name",shape:"c3-shape",shapes:"c3-shapes",line:"c3-line",lines:"c3-lines",bar:"c3-bar",bars:"c3-bars",circle:"c3-circle",circles:"c3-circles",arc:"c3-arc",arcLabelLine:"c3-arc-label-line",arcs:"c3-arcs",area:"c3-area",areas:"c3-areas",empty:"c3-empty",text:"c3-text",texts:"c3-texts",gaugeValue:"c3-gauge-value",grid:"c3-grid",gridLines:"c3-grid-lines",xgrid:"c3-xgrid",xgrids:"c3-xgrids",xgridLine:"c3-xgrid-line",xgridLines:"c3-xgrid-lines",xgridFocus:"c3-xgrid-focus",ygrid:"c3-ygrid",ygrids:"c3-ygrids",ygridLine:"c3-ygrid-line",ygridLines:"c3-ygrid-lines",colorScale:"c3-colorscale",stanfordElements:"c3-stanford-elements",stanfordLine:"c3-stanford-line",stanfordLines:"c3-stanford-lines",stanfordRegion:"c3-stanford-region",stanfordRegions:"c3-stanford-regions",stanfordText:"c3-stanford-text",stanfordTexts:"c3-stanford-texts",axis:"c3-axis",axisX:"c3-axis-x",axisXLabel:"c3-axis-x-label",axisY:"c3-axis-y",axisYLabel:"c3-axis-y-label",axisY2:"c3-axis-y2",axisY2Label:"c3-axis-y2-label",legendBackground:"c3-legend-background",legendItem:"c3-legend-item",legendItemEvent:"c3-legend-item-event",legendItemTile:"c3-legend-item-tile",legendItemHidden:"c3-legend-item-hidden",legendItemFocused:"c3-legend-item-focused",dragarea:"c3-dragarea",EXPANDED:"_expanded_",SELECTED:"_selected_",INCLUDED:"_included_"},v=function(t){this.owner=t,this.d3=t.d3,this.internal=S},b=v;b.prototype.init=function(){var t=this.owner,e=t.config,i=t.main;t.axes.x=i.append("g").attr("class",w.axis+" "+w.axisX).attr("clip-path",e.axis_x_inner?"":t.clipPathForXAxis).attr("transform",t.getTranslate("x")).style("visibility",e.axis_x_show?"visible":"hidden"),t.axes.x.append("text").attr("class",w.axisXLabel).attr("transform",e.axis_rotated?"rotate(-90)":"").style("text-anchor",this.textAnchorForXAxisLabel.bind(this)),t.axes.y=i.append("g").attr("class",w.axis+" "+w.axisY).attr("clip-path",e.axis_y_inner?"":t.clipPathForYAxis).attr("transform",t.getTranslate("y")).style("visibility",e.axis_y_show?"visible":"hidden"),t.axes.y.append("text").attr("class",w.axisYLabel).attr("transform",e.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForYAxisLabel.bind(this)),t.axes.y2=i.append("g").attr("class",w.axis+" "+w.axisY2).attr("transform",t.getTranslate("y2")).style("visibility",e.axis_y2_show?"visible":"hidden"),t.axes.y2.append("text").attr("class",w.axisY2Label).attr("transform",e.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForY2AxisLabel.bind(this))},b.prototype.getXAxis=function(t,e,i,n,r,a,o){var s=this.owner,c=s.config,d={isCategory:s.isCategorized(),withOuterTick:r,tickMultiline:c.axis_x_tick_multiline,tickMultilineMax:c.axis_x_tick_multiline?Number(c.axis_x_tick_multilineMax):0,tickWidth:c.axis_x_tick_width,tickTextRotate:o?0:c.axis_x_tick_rotate,withoutTransition:a},l=new this.internal(this,d).axis.scale(t).orient(e);return s.isTimeSeries()&&n&&"function"!=typeof n&&(n=n.map((function(t){return s.parseDate(t)}))),l.tickFormat(i).tickValues(n),s.isCategorized()&&(l.tickCentered(c.axis_x_tick_centered),u(c.axis_x_tick_culling)&&(c.axis_x_tick_culling=!1)),l},b.prototype.updateXAxisTickValues=function(t,e){var i,n=this.owner,r=n.config;return(r.axis_x_tick_fit||r.axis_x_tick_count)&&(i=this.generateTickValues(n.mapTargetsToUniqueXs(t),r.axis_x_tick_count,n.isTimeSeries())),e?e.tickValues(i):(n.xAxis.tickValues(i),n.subXAxis.tickValues(i)),i},b.prototype.getYAxis=function(t,e,i,n,r,a,o){var s=this.owner,c=s.config,d=c["axis_"+t+"_tick_format"];!d&&s.isAxisNormalized(t)&&(d=function(t){return t+"%"});var l=new this.internal(this,{withOuterTick:r,withoutTransition:a,tickTextRotate:o?0:c.axis_y_tick_rotate}).axis.scale(e).orient(i);return d&&l.tickFormat(d),s.isTimeSeriesY()?l.ticks(c.axis_y_tick_time_type,c.axis_y_tick_time_interval):l.tickValues(n),l},b.prototype.getId=function(t){var e=this.owner.config;return t in e.data_axes?e.data_axes[t]:"y"},b.prototype.getXAxisTickFormat=function(){var t=this.owner,e=t.config,i=t.isTimeSeries()?t.defaultAxisTimeFormat:t.isCategorized()?t.categoryName:function(t){return t};return e.axis_x_tick_format&&(h(e.axis_x_tick_format)?i=e.axis_x_tick_format:t.isTimeSeries()&&(i=function(i){return i?t.axisTimeFormat(e.axis_x_tick_format)(i):""})),h(i)?function(e){return i.call(t,e)}:i},b.prototype.getTickValues=function(t,e){return t||(e?e.tickValues():void 0)},b.prototype.getXAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_x_tick_values,this.owner.xAxis)},b.prototype.getYAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y_tick_values,this.owner.yAxis)},b.prototype.getY2AxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y2_tick_values,this.owner.y2Axis)},b.prototype.getLabelOptionByAxisId=function(t){var e,i=this.owner.config;return"y"===t?e=i.axis_y_label:"y2"===t?e=i.axis_y2_label:"x"===t&&(e=i.axis_x_label),e},b.prototype.getLabelText=function(t){var e=this.getLabelOptionByAxisId(t);return p(e)?e:e?e.text:null},b.prototype.setLabelText=function(t,e){var i=this.owner.config,n=this.getLabelOptionByAxisId(t);p(n)?"y"===t?i.axis_y_label=e:"y2"===t?i.axis_y2_label=e:"x"===t&&(i.axis_x_label=e):n&&(n.text=e)},b.prototype.getLabelPosition=function(t,e){var i=this.getLabelOptionByAxisId(t),n=i&&"object"==typeof i&&i.position?i.position:e;return{isInner:n.indexOf("inner")>=0,isOuter:n.indexOf("outer")>=0,isLeft:n.indexOf("left")>=0,isCenter:n.indexOf("center")>=0,isRight:n.indexOf("right")>=0,isTop:n.indexOf("top")>=0,isMiddle:n.indexOf("middle")>=0,isBottom:n.indexOf("bottom")>=0}},b.prototype.getXAxisLabelPosition=function(){return this.getLabelPosition("x",this.owner.config.axis_rotated?"inner-top":"inner-right")},b.prototype.getYAxisLabelPosition=function(){return this.getLabelPosition("y",this.owner.config.axis_rotated?"inner-right":"inner-top")},b.prototype.getY2AxisLabelPosition=function(){return this.getLabelPosition("y2",this.owner.config.axis_rotated?"inner-right":"inner-top")},b.prototype.getLabelPositionById=function(t){return"y2"===t?this.getY2AxisLabelPosition():"y"===t?this.getYAxisLabelPosition():this.getXAxisLabelPosition()},b.prototype.textForXAxisLabel=function(){return this.getLabelText("x")},b.prototype.textForYAxisLabel=function(){return this.getLabelText("y")},b.prototype.textForY2AxisLabel=function(){return this.getLabelText("y2")},b.prototype.xForAxisLabel=function(t,e){var i=this.owner;return t?e.isLeft?0:e.isCenter?i.width/2:i.width:e.isBottom?-i.height:e.isMiddle?-i.height/2:0},b.prototype.dxForAxisLabel=function(t,e){return t?e.isLeft?"0.5em":e.isRight?"-0.5em":"0":e.isTop?"-0.5em":e.isBottom?"0.5em":"0"},b.prototype.textAnchorForAxisLabel=function(t,e){return t?e.isLeft?"start":e.isCenter?"middle":"end":e.isBottom?"start":e.isMiddle?"middle":"end"},b.prototype.xForXAxisLabel=function(){return this.xForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},b.prototype.xForYAxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},b.prototype.xForY2AxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},b.prototype.dxForXAxisLabel=function(){return this.dxForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},b.prototype.dxForYAxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},b.prototype.dxForY2AxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},b.prototype.dyForXAxisLabel=function(){var t=this.owner,e=t.config,i=this.getXAxisLabelPosition();return e.axis_rotated?i.isInner?"1.2em":-25-(t.config.axis_x_inner?0:this.getMaxTickWidth("x")):i.isInner?"-0.5em":t.getHorizontalAxisHeight("x")-10},b.prototype.dyForYAxisLabel=function(){var t=this.owner,e=this.getYAxisLabelPosition();return t.config.axis_rotated?e.isInner?"-0.5em":"3em":e.isInner?"1.2em":-10-(t.config.axis_y_inner?0:this.getMaxTickWidth("y")+10)},b.prototype.dyForY2AxisLabel=function(){var t=this.owner,e=this.getY2AxisLabelPosition();return t.config.axis_rotated?e.isInner?"1.2em":"-2.2em":e.isInner?"-0.5em":15+(t.config.axis_y2_inner?0:this.getMaxTickWidth("y2")+15)},b.prototype.textAnchorForXAxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(!t.config.axis_rotated,this.getXAxisLabelPosition())},b.prototype.textAnchorForYAxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(t.config.axis_rotated,this.getYAxisLabelPosition())},b.prototype.textAnchorForY2AxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(t.config.axis_rotated,this.getY2AxisLabelPosition())},b.prototype.getMaxTickWidth=function(t,e){var i,n,r,a,o=this.owner,s=0;return e&&o.currentMaxTickWidths[t]||(o.svg&&(i=o.filterTargetsToShow(o.data.targets),"y"===t?(n=o.y.copy().domain(o.getYDomain(i,"y")),r=this.getYAxis(t,n,o.yOrient,o.yAxisTickValues,!1,!0,!0)):"y2"===t?(n=o.y2.copy().domain(o.getYDomain(i,"y2")),r=this.getYAxis(t,n,o.y2Orient,o.y2AxisTickValues,!1,!0,!0)):(n=o.x.copy().domain(o.getXDomain(i)),r=this.getXAxis(n,o.xOrient,o.xAxisTickFormat,o.xAxisTickValues,!1,!0,!0),this.updateXAxisTickValues(i,r)),(a=o.d3.select("body").append("div").classed("c3",!0)).append("svg").style("visibility","hidden").style("position","fixed").style("top",0).style("left",0).append("g").call(r).each((function(){o.d3.select(this).selectAll("text").each((function(){var t=c(this);s<t.width&&(s=t.width)})),a.remove()}))),o.currentMaxTickWidths[t]=s<=0?o.currentMaxTickWidths[t]:s),o.currentMaxTickWidths[t]},b.prototype.updateLabels=function(t){var e=this.owner,i=e.main.select("."+w.axisX+" ."+w.axisXLabel),n=e.main.select("."+w.axisY+" ."+w.axisYLabel),r=e.main.select("."+w.axisY2+" ."+w.axisY2Label);(t?i.transition():i).attr("x",this.xForXAxisLabel.bind(this)).attr("dx",this.dxForXAxisLabel.bind(this)).attr("dy",this.dyForXAxisLabel.bind(this)).text(this.textForXAxisLabel.bind(this)),(t?n.transition():n).attr("x",this.xForYAxisLabel.bind(this)).attr("dx",this.dxForYAxisLabel.bind(this)).attr("dy",this.dyForYAxisLabel.bind(this)).text(this.textForYAxisLabel.bind(this)),(t?r.transition():r).attr("x",this.xForY2AxisLabel.bind(this)).attr("dx",this.dxForY2AxisLabel.bind(this)).attr("dy",this.dyForY2AxisLabel.bind(this)).text(this.textForY2AxisLabel.bind(this))},b.prototype.getPadding=function(t,e,i,n){var r="number"==typeof t?t:t[e];return _(r)?"ratio"===t.unit?t[e]*n:this.convertPixelsToAxisPadding(r,n):i},b.prototype.convertPixelsToAxisPadding=function(t,e){var i=this.owner;return e*(t/(i.config.axis_rotated?i.width:i.height))},b.prototype.generateTickValues=function(t,e,i){var n,r,a,o,s,c,d,l=t;if(e)if(1===(n=h(e)?e():e))l=[t[0]];else if(2===n)l=[t[0],t[t.length-1]];else if(n>2){for(o=n-2,r=t[0],s=((a=t[t.length-1])-r)/(o+1),l=[r],c=0;c<o;c++)d=+r+s*(c+1),l.push(i?new Date(d):d);l.push(a)}return i||(l=l.sort((function(t,e){return t-e}))),l},b.prototype.generateTransitions=function(t){var e=this.owner.axes;return{axisX:t?e.x.transition().duration(t):e.x,axisY:t?e.y.transition().duration(t):e.y,axisY2:t?e.y2.transition().duration(t):e.y2,axisSubX:t?e.subx.transition().duration(t):e.subx}},b.prototype.redraw=function(t,e){var i=this.owner,n=t?i.d3.transition().duration(t):null;i.axes.x.style("opacity",e?0:1).call(i.xAxis,n),i.axes.y.style("opacity",e?0:1).call(i.yAxis,n),i.axes.y2.style("opacity",e?0:1).call(i.y2Axis,n),i.axes.subx.style("opacity",e?0:1).call(i.subXAxis,n)};var T={version:"0.7.20",chart:{fn:e.prototype,internal:{fn:t.prototype,axis:{fn:v.prototype,internal:{fn:S.prototype}}}},generate:function(t){return new e(t)}};function A(t,e,i){var n=[.01,10];function r(t){return i(e(t))}return e||(e=t.scaleLinear()).range(n),i||((i=t.scaleLog()).domain(n),i.nice()),r.domain=function(t){return arguments.length?(e.domain(t),r):e.domain()},r.range=function(t){return arguments.length?(i.range(t),r):i.range()},r.ticks=function(t){return function(t,e,i){var n,r,a,o;if(arguments.length<3)i=10;else if(0===i)return[];o=(e-t)/(r=i-1),a=t,(n=new Array(i))[0]=Math.pow(10,a);for(var s=1;s<r;s++)a+=o,n[s]=Math.pow(10,a);return n[r]=Math.pow(10,e),n}(-2,1,t||10).map((function(t){return e.invert(t)}))},r.copy=function(){return A(t,e.copy(),i.copy())},r}function P(t){return t/Math.pow(10,Math.ceil(Math.log(t)/Math.LN10-1e-12))==1}t.prototype.beforeInit=function(){},t.prototype.afterInit=function(){},t.prototype.init=function(){var t=this,e=t.config;if(t.initParams(),e.data_url)t.convertUrlToData(e.data_url,e.data_mimeType,e.data_headers,e.data_keys,t.initWithData);else if(e.data_json)t.initWithData(t.convertJsonToData(e.data_json,e.data_keys));else if(e.data_rows)t.initWithData(t.convertRowsToData(e.data_rows));else{if(!e.data_columns)throw Error("url or json or rows or columns is required.");t.initWithData(t.convertColumnsToData(e.data_columns))}},t.prototype.initParams=function(){var t=this,e=t.d3,i=t.config;t.clipId="c3-"+(new Date).valueOf()+"-clip",t.clipIdForXAxis=t.clipId+"-xaxis",t.clipIdForYAxis=t.clipId+"-yaxis",t.clipIdForGrid=t.clipId+"-grid",t.clipIdForSubchart=t.clipId+"-subchart",t.clipPath=t.getClipPath(t.clipId),t.clipPathForXAxis=t.getClipPath(t.clipIdForXAxis),t.clipPathForYAxis=t.getClipPath(t.clipIdForYAxis),t.clipPathForGrid=t.getClipPath(t.clipIdForGrid),t.clipPathForSubchart=t.getClipPath(t.clipIdForSubchart),t.dragStart=null,t.dragging=!1,t.flowing=!1,t.cancelClick=!1,t.mouseover=void 0,t.transiting=!1,t.color=t.generateColor(),t.levelColor=t.generateLevelColor(),t.dataTimeParse=(i.data_xLocaltime?e.timeParse:e.utcParse)(t.config.data_xFormat),t.axisTimeFormat=i.axis_x_localtime?e.timeFormat:e.utcFormat,t.defaultAxisTimeFormat=function(t){return t.getMilliseconds()?e.timeFormat(".%L")(t):t.getSeconds()?e.timeFormat(":%S")(t):t.getMinutes()?e.timeFormat("%I:%M")(t):t.getHours()?e.timeFormat("%I %p")(t):t.getDay()&&1!==t.getDate()||1!==t.getDate()||t.getMonth()?e.timeFormat("%-m/%-d")(t):e.timeFormat("%Y/%-m/%-d")(t)},t.hiddenTargetIds=[],t.hiddenLegendIds=[],t.focusedTargetIds=[],t.defocusedTargetIds=[],t.xOrient=i.axis_rotated?i.axis_x_inner?"right":"left":i.axis_x_inner?"top":"bottom",t.yOrient=i.axis_rotated?i.axis_y_inner?"top":"bottom":i.axis_y_inner?"right":"left",t.y2Orient=i.axis_rotated?i.axis_y2_inner?"bottom":"top":i.axis_y2_inner?"left":"right",t.subXOrient=i.axis_rotated?"left":"bottom",t.isLegendRight="right"===i.legend_position,t.isLegendInset="inset"===i.legend_position,t.isLegendTop="top-left"===i.legend_inset_anchor||"top-right"===i.legend_inset_anchor,t.isLegendLeft="top-left"===i.legend_inset_anchor||"bottom-left"===i.legend_inset_anchor,t.legendStep=0,t.legendItemWidth=0,t.legendItemHeight=0,t.currentMaxTickWidths={x:0,y:0,y2:0},t.rotated_padding_left=30,t.rotated_padding_right=i.axis_rotated&&!i.axis_x_show?0:30,t.rotated_padding_top=5,t.withoutFadeIn={},t.intervalForObserveInserted=void 0,t.axes.subx=e.selectAll([])},t.prototype.initChartElements=function(){this.initBar&&this.initBar(),this.initLine&&this.initLine(),this.initArc&&this.initArc(),this.initGauge&&this.initGauge(),this.initText&&this.initText()},t.prototype.initWithData=function(t){var e,i,n=this,r=n.d3,a=n.config,o=!0;n.axis=new v(n),a.bindto?"function"==typeof a.bindto.node?n.selectChart=a.bindto:n.selectChart=r.select(a.bindto):n.selectChart=r.selectAll([]),n.selectChart.empty()&&(n.selectChart=r.select(document.createElement("div")).style("opacity",0),n.observeInserted(n.selectChart),o=!1),n.selectChart.html("").classed("c3",!0),n.data.xs={},n.data.targets=n.convertDataToTargets(t),a.data_filter&&(n.data.targets=n.data.targets.filter(a.data_filter)),a.data_hide&&n.addHiddenTargetIds(!0===a.data_hide?n.mapToIds(n.data.targets):a.data_hide),a.legend_hide&&n.addHiddenLegendIds(!0===a.legend_hide?n.mapToIds(n.data.targets):a.legend_hide),n.isStanfordGraphType()&&n.initStanfordData(),n.updateSizes(),n.updateScales(),n.x.domain(r.extent(n.getXDomain(n.data.targets))),n.y.domain(n.getYDomain(n.data.targets,"y")),n.y2.domain(n.getYDomain(n.data.targets,"y2")),n.subX.domain(n.x.domain()),n.subY.domain(n.y.domain()),n.subY2.domain(n.y2.domain()),n.orgXDomain=n.x.domain(),n.svg=n.selectChart.append("svg").style("overflow","hidden").on("mouseenter",(function(){return a.onmouseover.call(n)})).on("mouseleave",(function(){return a.onmouseout.call(n)})),n.config.svg_classname&&n.svg.attr("class",n.config.svg_classname),e=n.svg.append("defs"),n.clipChart=n.appendClip(e,n.clipId),n.clipXAxis=n.appendClip(e,n.clipIdForXAxis),n.clipYAxis=n.appendClip(e,n.clipIdForYAxis),n.clipGrid=n.appendClip(e,n.clipIdForGrid),n.clipSubchart=n.appendClip(e,n.clipIdForSubchart),n.updateSvgSize(),i=n.main=n.svg.append("g").attr("transform",n.getTranslate("main")),n.initPie&&n.initPie(),n.initDragZoom&&n.initDragZoom(),a.subchart_show&&n.initSubchart&&n.initSubchart(),n.initTooltip&&n.initTooltip(),n.initLegend&&n.initLegend(),n.initTitle&&n.initTitle(),n.initZoom&&n.initZoom(),n.isStanfordGraphType()&&n.drawColorScale(),a.subchart_show&&n.initSubchartBrush&&n.initSubchartBrush(),i.append("text").attr("class",w.text+" "+w.empty).attr("text-anchor","middle").attr("dominant-baseline","middle"),n.initRegion(),n.initGrid(),i.append("g").attr("clip-path",n.clipPath).attr("class",w.chart),a.grid_lines_front&&n.initGridLines(),n.initStanfordElements(),n.initEventRect(),n.initChartElements(),n.axis.init(),n.updateTargets(n.data.targets),a.axis_x_selection&&n.brush.selectionAsValue(n.getDefaultSelection()),o&&(n.updateDimension(),n.config.oninit.call(n),n.redraw({withTransition:!1,withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransitionForAxis:!1})),n.bindResize(),n.bindWindowFocus(),n.api.element=n.selectChart.node()},t.prototype.smoothLines=function(t,e){var i=this;"grid"===e&&t.each((function(){var t=i.d3.select(this),e=t.attr("x1"),n=t.attr("x2"),r=t.attr("y1"),a=t.attr("y2");t.attr({x1:Math.ceil(e),x2:Math.ceil(n),y1:Math.ceil(r),y2:Math.ceil(a)})}))},t.prototype.updateSizes=function(){var t=this,e=t.config,i=t.legend?t.getLegendHeight():0,n=t.legend?t.getLegendWidth():0,r=t.isLegendRight||t.isLegendInset?0:i,a=t.hasArcType(),o=e.axis_rotated||a?0:t.getHorizontalAxisHeight("x"),s=e.axis_rotated||a?0:t.getHorizontalAxisHeight("x",!0),c=e.subchart_show&&!a?e.subchart_size_height+s:0;t.currentWidth=t.getCurrentWidth(),t.currentHeight=t.getCurrentHeight(),t.margin=e.axis_rotated?{top:t.getHorizontalAxisHeight("y2")+t.getCurrentPaddingTop(),right:a?0:t.getCurrentPaddingRight(),bottom:t.getHorizontalAxisHeight("y")+r+t.getCurrentPaddingBottom(),left:c+(a?0:t.getCurrentPaddingLeft())}:{top:4+t.getCurrentPaddingTop(),right:a?0:t.getCurrentPaddingRight(),bottom:o+c+r+t.getCurrentPaddingBottom(),left:a?0:t.getCurrentPaddingLeft()},t.margin2=e.axis_rotated?{top:t.margin.top,right:NaN,bottom:20+r,left:t.rotated_padding_left}:{top:t.currentHeight-c-r,right:NaN,bottom:s+r,left:t.margin.left},t.margin3={top:0,right:NaN,bottom:0,left:0},t.updateSizeForLegend&&t.updateSizeForLegend(i,n),t.width=t.currentWidth-t.margin.left-t.margin.right,t.height=t.currentHeight-t.margin.top-t.margin.bottom,t.width<0&&(t.width=0),t.height<0&&(t.height=0),t.width2=e.axis_rotated?t.margin.left-t.rotated_padding_left-t.rotated_padding_right:t.width,t.height2=e.axis_rotated?t.height:t.currentHeight-t.margin2.top-t.margin2.bottom,t.width2<0&&(t.width2=0),t.height2<0&&(t.height2=0),t.arcWidth=t.width-(t.isLegendRight?n+10:0),t.arcHeight=t.height-(t.isLegendRight?0:10),t.hasType("gauge")&&!e.gauge_fullCircle&&(t.arcHeight+=t.height-t.getGaugeLabelHeight()),t.updateRadius&&t.updateRadius(),t.isLegendRight&&a&&(t.margin3.left=t.arcWidth/2+1.1*t.radiusExpanded)},t.prototype.updateTargets=function(t){var e=this,i=e.config;e.updateTargetsForText(t),e.updateTargetsForBar(t),e.updateTargetsForLine(t),e.hasArcType()&&e.updateTargetsForArc&&e.updateTargetsForArc(t),i.subchart_show&&e.updateTargetsForSubchart&&e.updateTargetsForSubchart(t),e.showTargets()},t.prototype.showTargets=function(){var t=this;t.svg.selectAll("."+w.target).filter((function(e){return t.isTargetToShow(e.id)})).transition().duration(t.config.transition_duration).style("opacity",1)},t.prototype.redraw=function(t,e){var i,n,r,a,s,c,d,l,u,h,g,p,f,_,x,y,m,S,v,b,T,A,P,C,L,V,G,E,O,I,R,k=this,D=k.main,F=k.d3,X=k.config,M=k.getShapeIndices(k.isAreaType),z=k.getShapeIndices(k.isBarType),H=k.getShapeIndices(k.isLineType),N=k.hasArcType(),B=k.filterTargetsToShow(k.data.targets),Y=k.xv.bind(k);if(i=o(t=t||{},"withY",!0),n=o(t,"withSubchart",!0),r=o(t,"withTransition",!0),c=o(t,"withTransform",!1),d=o(t,"withUpdateXDomain",!1),l=o(t,"withUpdateOrgXDomain",!1),u=o(t,"withTrimXDomain",!0),f=o(t,"withUpdateXAxis",d),h=o(t,"withLegend",!1),g=o(t,"withEventRect",!0),p=o(t,"withDimension",!0),a=o(t,"withTransitionForExit",r),s=o(t,"withTransitionForAxis",r),v=r?X.transition_duration:0,b=a?v:0,T=s?v:0,e=e||k.axis.generateTransitions(T),h&&X.legend_show?k.updateLegend(k.mapToIds(k.data.targets),t,e):p&&k.updateDimension(!0),k.isCategorized()&&0===B.length&&k.x.domain([0,k.axes.x.selectAll(".tick").size()]),B.length?(k.updateXDomain(B,d,l,u),X.axis_x_tick_values||(V=k.axis.updateXAxisTickValues(B))):(k.xAxis.tickValues([]),k.subXAxis.tickValues([])),X.zoom_rescale&&!t.flow&&(O=k.x.orgDomain()),k.y.domain(k.getYDomain(B,"y",O)),k.y2.domain(k.getYDomain(B,"y2",O)),!X.axis_y_tick_values&&X.axis_y_tick_count&&k.yAxis.tickValues(k.axis.generateTickValues(k.y.domain(),X.axis_y_tick_count)),!X.axis_y2_tick_values&&X.axis_y2_tick_count&&k.y2Axis.tickValues(k.axis.generateTickValues(k.y2.domain(),X.axis_y2_tick_count)),k.axis.redraw(T,N),k.axis.updateLabels(r),(d||f)&&B.length)if(X.axis_x_tick_culling&&V){for(G=1;G<V.length;G++)if(V.length/G<X.axis_x_tick_culling_max){E=G;break}k.svg.selectAll("."+w.axisX+" .tick text").each((function(t){var e=V.indexOf(t);e>=0&&F.select(this).style("display",e%E?"none":"block")}))}else k.svg.selectAll("."+w.axisX+" .tick text").style("display","block");_=k.generateDrawArea?k.generateDrawArea(M,!1):void 0,x=k.generateDrawBar?k.generateDrawBar(z):void 0,y=k.generateDrawLine?k.generateDrawLine(H,!1):void 0,m=k.generateXYForText(M,z,H,!0),S=k.generateXYForText(M,z,H,!1),k.updateCircleY(),I=(k.config.axis_rotated?k.circleY:k.circleX).bind(k),R=(k.config.axis_rotated?k.circleX:k.circleY).bind(k),i&&(k.subY.domain(k.getYDomain(B,"y")),k.subY2.domain(k.getYDomain(B,"y2"))),k.updateXgridFocus(),D.select("text."+w.text+"."+w.empty).attr("x",k.width/2).attr("y",k.height/2).text(X.data_empty_label_text).transition().style("opacity",B.length?0:1),g&&k.redrawEventRect(),k.updateGrid(v),k.updateStanfordElements(v),k.updateRegion(v),k.updateBar(b),k.updateLine(b),k.updateArea(b),k.updateCircle(I,R),k.hasDataLabel()&&k.updateText(m,S,b),k.redrawTitle&&k.redrawTitle(),k.redrawArc&&k.redrawArc(v,b,c),X.subchart_show&&k.redrawSubchart&&k.redrawSubchart(n,e,v,b,M,z,H),k.isStanfordGraphType()&&k.drawColorScale(),D.selectAll("."+w.selectedCircles).filter(k.isBarType.bind(k)).selectAll("circle").remove(),t.flow&&(C=k.generateFlow({targets:B,flow:t.flow,duration:t.flow.duration,drawBar:x,drawLine:y,drawArea:_,cx:I,cy:R,xv:Y,xForText:m,yForText:S})),v&&k.isTabVisible()?(L=F.transition().duration(v),A=[],[k.redrawBar(x,!0,L),k.redrawLine(y,!0,L),k.redrawArea(_,!0,L),k.redrawCircle(I,R,!0,L),k.redrawText(m,S,t.flow,!0,L),k.redrawRegion(!0,L),k.redrawGrid(!0,L)].forEach((function(t){t.forEach((function(t){A.push(t)}))})),P=k.generateWait(),A.forEach((function(t){P.add(t)})),P((function(){C&&C(),X.onrendered&&X.onrendered.call(k)}))):(k.redrawBar(x),k.redrawLine(y),k.redrawArea(_),k.redrawCircle(I,R),k.redrawText(m,S,t.flow),k.redrawRegion(),k.redrawGrid(),C&&C(),X.onrendered&&X.onrendered.call(k)),k.mapToIds(k.data.targets).forEach((function(t){k.withoutFadeIn[t]=!0}))},t.prototype.updateAndRedraw=function(t){var e,i=this,n=i.config;(t=t||{}).withTransition=o(t,"withTransition",!0),t.withTransform=o(t,"withTransform",!1),t.withLegend=o(t,"withLegend",!1),t.withUpdateXDomain=o(t,"withUpdateXDomain",!0),t.withUpdateOrgXDomain=o(t,"withUpdateOrgXDomain",!0),t.withTransitionForExit=!1,t.withTransitionForTransform=o(t,"withTransitionForTransform",t.withTransition),i.updateSizes(),t.withLegend&&n.legend_show||(e=i.axis.generateTransitions(t.withTransitionForAxis?n.transition_duration:0),i.updateScales(),i.updateSvgSize(),i.transformAll(t.withTransitionForTransform,e)),i.redraw(t,e)},t.prototype.redrawWithoutRescale=function(){this.redraw({withY:!1,withSubchart:!1,withEventRect:!1,withTransitionForAxis:!1})},t.prototype.isTimeSeries=function(){return"timeseries"===this.config.axis_x_type},t.prototype.isCategorized=function(){return this.config.axis_x_type.indexOf("categor")>=0},t.prototype.isCustomX=function(){var t=this.config;return!this.isTimeSeries()&&(t.data_x||x(t.data_xs))},t.prototype.isTimeSeriesY=function(){return"timeseries"===this.config.axis_y_type},t.prototype.getTranslate=function(t){var e,i,r=this,a=r.config;return"main"===t?(e=n(r.margin.left),i=n(r.margin.top)):"context"===t?(e=n(r.margin2.left),i=n(r.margin2.top)):"legend"===t?(e=r.margin3.left,i=r.margin3.top):"x"===t?(e=0,i=a.axis_rotated?0:r.height):"y"===t?(e=0,i=a.axis_rotated?r.height:0):"y2"===t?(e=a.axis_rotated?0:r.width,i=a.axis_rotated?1:0):"subx"===t?(e=0,i=a.axis_rotated?0:r.height2):"arc"===t&&(e=r.arcWidth/2,i=r.arcHeight/2-(r.hasType("gauge")?6:0)),"translate("+e+","+i+")"},t.prototype.initialOpacity=function(t){return null!==t.value&&this.withoutFadeIn[t.id]?1:0},t.prototype.initialOpacityForCircle=function(t){return null!==t.value&&this.withoutFadeIn[t.id]?this.opacityForCircle(t):0},t.prototype.opacityForCircle=function(t){var e=(h(this.config.point_show)?this.config.point_show(t):this.config.point_show)||this.isStanfordType(t)?1:0;return _(t.value)?this.isScatterType(t)?.5:e:0},t.prototype.opacityForText=function(){return this.hasDataLabel()?1:0},t.prototype.xx=function(t){return t?this.x(t.x):null},t.prototype.xvCustom=function(t,e){var i=this,n=e?t[e]:t.value;return i.isTimeSeries()?n=i.parseDate(t.value):i.isCategorized()&&"string"==typeof t.value&&(n=i.config.axis_x_categories.indexOf(t.value)),Math.ceil(i.x(n))},t.prototype.yvCustom=function(t,e){var i=t.axis&&"y2"===t.axis?this.y2:this.y,n=e?t[e]:t.value;return Math.ceil(i(n))},t.prototype.xv=function(t){var e=this,i=t.value;return e.isTimeSeries()?i=e.parseDate(t.value):e.isCategorized()&&"string"==typeof t.value&&(i=e.config.axis_x_categories.indexOf(t.value)),Math.ceil(e.x(i))},t.prototype.yv=function(t){var e=t.axis&&"y2"===t.axis?this.y2:this.y;return Math.ceil(e(t.value))},t.prototype.subxx=function(t){return t?this.subX(t.x):null},t.prototype.transformMain=function(t,e){var i,n,r,a=this;e&&e.axisX?i=e.axisX:(i=a.main.select("."+w.axisX),t&&(i=i.transition())),e&&e.axisY?n=e.axisY:(n=a.main.select("."+w.axisY),t&&(n=n.transition())),e&&e.axisY2?r=e.axisY2:(r=a.main.select("."+w.axisY2),t&&(r=r.transition())),(t?a.main.transition():a.main).attr("transform",a.getTranslate("main")),i.attr("transform",a.getTranslate("x")),n.attr("transform",a.getTranslate("y")),r.attr("transform",a.getTranslate("y2")),a.main.select("."+w.chartArcs).attr("transform",a.getTranslate("arc"))},t.prototype.transformAll=function(t,e){var i=this;i.transformMain(t,e),i.config.subchart_show&&i.transformContext(t,e),i.legend&&i.transformLegend(t)},t.prototype.updateSvgSize=function(){var t=this,e=t.svg.select("."+w.brush+" .overlay");t.svg.attr("width",t.currentWidth).attr("height",t.currentHeight),t.svg.selectAll(["#"+t.clipId,"#"+t.clipIdForGrid]).select("rect").attr("width",t.width).attr("height",t.height),t.svg.select("#"+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("#"+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("#"+t.clipIdForSubchart).select("rect").attr("width",t.width).attr("height",e.size()&&e.attr("height")||0),t.selectChart.style("max-height",t.currentHeight+"px")},t.prototype.updateDimension=function(t){var e=this;t||(e.config.axis_rotated?(e.axes.x.call(e.xAxis),e.axes.subx.call(e.subXAxis)):(e.axes.y.call(e.yAxis),e.axes.y2.call(e.y2Axis))),e.updateSizes(),e.updateScales(),e.updateSvgSize(),e.transformAll(!1)},t.prototype.observeInserted=function(t){var e,i=this;"undefined"!=typeof MutationObserver?(e=new MutationObserver((function(n){n.forEach((function(n){"childList"===n.type&&n.previousSibling&&(e.disconnect(),i.intervalForObserveInserted=window.setInterval((function(){t.node().parentNode&&(window.clearInterval(i.intervalForObserveInserted),i.updateDimension(),i.brush&&i.brush.update(),i.config.oninit.call(i),i.redraw({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransition:!1,withTransitionForTransform:!1,withLegend:!0}),t.transition().style("opacity",1))}),10))}))}))).observe(t.node(),{attributes:!0,childList:!0,characterData:!0}):window.console.error("MutationObserver not defined.")},t.prototype.bindResize=function(){var t=this,e=t.config;t.resizeFunction=t.generateResize(),t.resizeFunction.add((function(){e.onresize.call(t)})),e.resize_auto&&t.resizeFunction.add((function(){void 0!==t.resizeTimeout&&window.clearTimeout(t.resizeTimeout),t.resizeTimeout=window.setTimeout((function(){delete t.resizeTimeout,t.updateAndRedraw({withUpdateXDomain:!1,withUpdateOrgXDomain:!1,withTransition:!1,withTransitionForTransform:!1,withLegend:!0}),t.brush&&t.brush.update()}),100)})),t.resizeFunction.add((function(){e.onresized.call(t)})),t.resizeIfElementDisplayed=function(){null!=t.api&&t.api.element.offsetParent&&t.resizeFunction()},window.addEventListener("resize",t.resizeIfElementDisplayed,!1)},t.prototype.bindWindowFocus=function(){var t=this;this.windowFocusHandler||(this.windowFocusHandler=function(){t.redraw()},window.addEventListener("focus",this.windowFocusHandler))},t.prototype.unbindWindowFocus=function(){window.removeEventListener("focus",this.windowFocusHandler),delete this.windowFocusHandler},t.prototype.generateResize=function(){var t=[];function e(){t.forEach((function(t){t()}))}return e.add=function(e){t.push(e)},e.remove=function(e){for(var i=0;i<t.length;i++)if(t[i]===e){t.splice(i,1);break}},e},t.prototype.endall=function(t,e){var i=0;t.each((function(){++i})).on("end",(function(){--i||e.apply(this,arguments)}))},t.prototype.generateWait=function(){var t=this,e=[],i=function(i){var n=setInterval((function(){if(t.isTabVisible()){var r=0;e.forEach((function(t){if(t.empty())r+=1;else try{t.transition()}catch(e){r+=1}})),r===e.length&&(clearInterval(n),i&&i())}}),50)};return i.add=function(t){e.push(t)},i},t.prototype.parseDate=function(t){var e;return t instanceof Date?e=t:"string"==typeof t?e=this.dataTimeParse(t):"object"==typeof t?e=new Date(+t):"number"!=typeof t||isNaN(t)||(e=new Date(+t)),e&&!isNaN(+e)||window.console.error("Failed to parse x '"+t+"' to Date object"),e},t.prototype.isTabVisible=function(){return!document.hidden},t.prototype.getPathBox=s,t.prototype.CLASS=w,"SVGPathSeg"in window||(window.SVGPathSeg=function(t,e,i){this.pathSegType=t,this.pathSegTypeAsLetter=e,this._owningPathSegList=i},window.SVGPathSeg.prototype.classname="SVGPathSeg",window.SVGPathSeg.PATHSEG_UNKNOWN=0,window.SVGPathSeg.PATHSEG_CLOSEPATH=1,window.SVGPathSeg.PATHSEG_MOVETO_ABS=2,window.SVGPathSeg.PATHSEG_MOVETO_REL=3,window.SVGPathSeg.PATHSEG_LINETO_ABS=4,window.SVGPathSeg.PATHSEG_LINETO_REL=5,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS=6,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL=7,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS=8,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL=9,window.SVGPathSeg.PATHSEG_ARC_ABS=10,window.SVGPathSeg.PATHSEG_ARC_REL=11,window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS=12,window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL=13,window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS=14,window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL=15,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS=16,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL=17,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS=18,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL=19,window.SVGPathSeg.prototype._segmentChanged=function(){this._owningPathSegList&&this._owningPathSegList.segmentChanged(this)},window.SVGPathSegClosePath=function(t){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CLOSEPATH,"z",t)},window.SVGPathSegClosePath.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegClosePath.prototype.toString=function(){return"[object SVGPathSegClosePath]"},window.SVGPathSegClosePath.prototype._asPathString=function(){return this.pathSegTypeAsLetter},window.SVGPathSegClosePath.prototype.clone=function(){return new window.SVGPathSegClosePath(void 0)},window.SVGPathSegMovetoAbs=function(t,e,i){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_MOVETO_ABS,"M",t),this._x=e,this._y=i},window.SVGPathSegMovetoAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegMovetoAbs.prototype.toString=function(){return"[object SVGPathSegMovetoAbs]"},window.SVGPathSegMovetoAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},window.SVGPathSegMovetoAbs.prototype.clone=function(){return new window.SVGPathSegMovetoAbs(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegMovetoAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegMovetoAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegMovetoRel=function(t,e,i){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_MOVETO_REL,"m",t),this._x=e,this._y=i},window.SVGPathSegMovetoRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegMovetoRel.prototype.toString=function(){return"[object SVGPathSegMovetoRel]"},window.SVGPathSegMovetoRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},window.SVGPathSegMovetoRel.prototype.clone=function(){return new window.SVGPathSegMovetoRel(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegMovetoRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegMovetoRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoAbs=function(t,e,i){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_ABS,"L",t),this._x=e,this._y=i},window.SVGPathSegLinetoAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoAbs.prototype.toString=function(){return"[object SVGPathSegLinetoAbs]"},window.SVGPathSegLinetoAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},window.SVGPathSegLinetoAbs.prototype.clone=function(){return new window.SVGPathSegLinetoAbs(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegLinetoAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegLinetoAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoRel=function(t,e,i){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_REL,"l",t),this._x=e,this._y=i},window.SVGPathSegLinetoRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoRel.prototype.toString=function(){return"[object SVGPathSegLinetoRel]"},window.SVGPathSegLinetoRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},window.SVGPathSegLinetoRel.prototype.clone=function(){return new window.SVGPathSegLinetoRel(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegLinetoRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegLinetoRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoCubicAbs=function(t,e,i,n,r,a,o){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS,"C",t),this._x=e,this._y=i,this._x1=n,this._y1=r,this._x2=a,this._y2=o},window.SVGPathSegCurvetoCubicAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoCubicAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicAbs]"},window.SVGPathSegCurvetoCubicAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},window.SVGPathSegCurvetoCubicAbs.prototype.clone=function(){return new window.SVGPathSegCurvetoCubicAbs(void 0,this._x,this._y,this._x1,this._y1,this._x2,this._y2)},Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"x1",{get:function(){return this._x1},set:function(t){this._x1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"y1",{get:function(){return this._y1},set:function(t){this._y1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"x2",{get:function(){return this._x2},set:function(t){this._x2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"y2",{get:function(){return this._y2},set:function(t){this._y2=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoCubicRel=function(t,e,i,n,r,a,o){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL,"c",t),this._x=e,this._y=i,this._x1=n,this._y1=r,this._x2=a,this._y2=o},window.SVGPathSegCurvetoCubicRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoCubicRel.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicRel]"},window.SVGPathSegCurvetoCubicRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},window.SVGPathSegCurvetoCubicRel.prototype.clone=function(){return new window.SVGPathSegCurvetoCubicRel(void 0,this._x,this._y,this._x1,this._y1,this._x2,this._y2)},Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"x1",{get:function(){return this._x1},set:function(t){this._x1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"y1",{get:function(){return this._y1},set:function(t){this._y1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"x2",{get:function(){return this._x2},set:function(t){this._x2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"y2",{get:function(){return this._y2},set:function(t){this._y2=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoQuadraticAbs=function(t,e,i,n,r){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS,"Q",t),this._x=e,this._y=i,this._x1=n,this._y1=r},window.SVGPathSegCurvetoQuadraticAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoQuadraticAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticAbs]"},window.SVGPathSegCurvetoQuadraticAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x+" "+this._y},window.SVGPathSegCurvetoQuadraticAbs.prototype.clone=function(){return new window.SVGPathSegCurvetoQuadraticAbs(void 0,this._x,this._y,this._x1,this._y1)},Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype,"x1",{get:function(){return this._x1},set:function(t){this._x1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype,"y1",{get:function(){return this._y1},set:function(t){this._y1=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoQuadraticRel=function(t,e,i,n,r){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL,"q",t),this._x=e,this._y=i,this._x1=n,this._y1=r},window.SVGPathSegCurvetoQuadraticRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoQuadraticRel.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticRel]"},window.SVGPathSegCurvetoQuadraticRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x+" "+this._y},window.SVGPathSegCurvetoQuadraticRel.prototype.clone=function(){return new window.SVGPathSegCurvetoQuadraticRel(void 0,this._x,this._y,this._x1,this._y1)},Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype,"x1",{get:function(){return this._x1},set:function(t){this._x1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype,"y1",{get:function(){return this._y1},set:function(t){this._y1=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegArcAbs=function(t,e,i,n,r,a,o,s){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_ARC_ABS,"A",t),this._x=e,this._y=i,this._r1=n,this._r2=r,this._angle=a,this._largeArcFlag=o,this._sweepFlag=s},window.SVGPathSegArcAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegArcAbs.prototype.toString=function(){return"[object SVGPathSegArcAbs]"},window.SVGPathSegArcAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._r1+" "+this._r2+" "+this._angle+" "+(this._largeArcFlag?"1":"0")+" "+(this._sweepFlag?"1":"0")+" "+this._x+" "+this._y},window.SVGPathSegArcAbs.prototype.clone=function(){return new window.SVGPathSegArcAbs(void 0,this._x,this._y,this._r1,this._r2,this._angle,this._largeArcFlag,this._sweepFlag)},Object.defineProperty(window.SVGPathSegArcAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"r1",{get:function(){return this._r1},set:function(t){this._r1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"r2",{get:function(){return this._r2},set:function(t){this._r2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"angle",{get:function(){return this._angle},set:function(t){this._angle=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"largeArcFlag",{get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"sweepFlag",{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegArcRel=function(t,e,i,n,r,a,o,s){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_ARC_REL,"a",t),this._x=e,this._y=i,this._r1=n,this._r2=r,this._angle=a,this._largeArcFlag=o,this._sweepFlag=s},window.SVGPathSegArcRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegArcRel.prototype.toString=function(){return"[object SVGPathSegArcRel]"},window.SVGPathSegArcRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._r1+" "+this._r2+" "+this._angle+" "+(this._largeArcFlag?"1":"0")+" "+(this._sweepFlag?"1":"0")+" "+this._x+" "+this._y},window.SVGPathSegArcRel.prototype.clone=function(){return new window.SVGPathSegArcRel(void 0,this._x,this._y,this._r1,this._r2,this._angle,this._largeArcFlag,this._sweepFlag)},Object.defineProperty(window.SVGPathSegArcRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"r1",{get:function(){return this._r1},set:function(t){this._r1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"r2",{get:function(){return this._r2},set:function(t){this._r2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"angle",{get:function(){return this._angle},set:function(t){this._angle=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"largeArcFlag",{get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"sweepFlag",{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoHorizontalAbs=function(t,e){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS,"H",t),this._x=e},window.SVGPathSegLinetoHorizontalAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoHorizontalAbs.prototype.toString=function(){return"[object SVGPathSegLinetoHorizontalAbs]"},window.SVGPathSegLinetoHorizontalAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x},window.SVGPathSegLinetoHorizontalAbs.prototype.clone=function(){return new window.SVGPathSegLinetoHorizontalAbs(void 0,this._x)},Object.defineProperty(window.SVGPathSegLinetoHorizontalAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoHorizontalRel=function(t,e){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL,"h",t),this._x=e},window.SVGPathSegLinetoHorizontalRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoHorizontalRel.prototype.toString=function(){return"[object SVGPathSegLinetoHorizontalRel]"},window.SVGPathSegLinetoHorizontalRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x},window.SVGPathSegLinetoHorizontalRel.prototype.clone=function(){return new window.SVGPathSegLinetoHorizontalRel(void 0,this._x)},Object.defineProperty(window.SVGPathSegLinetoHorizontalRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoVerticalAbs=function(t,e){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS,"V",t),this._y=e},window.SVGPathSegLinetoVerticalAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoVerticalAbs.prototype.toString=function(){return"[object SVGPathSegLinetoVerticalAbs]"},window.SVGPathSegLinetoVerticalAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._y},window.SVGPathSegLinetoVerticalAbs.prototype.clone=function(){return new window.SVGPathSegLinetoVerticalAbs(void 0,this._y)},Object.defineProperty(window.SVGPathSegLinetoVerticalAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoVerticalRel=function(t,e){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL,"v",t),this._y=e},window.SVGPathSegLinetoVerticalRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoVerticalRel.prototype.toString=function(){return"[object SVGPathSegLinetoVerticalRel]"},window.SVGPathSegLinetoVerticalRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._y},window.SVGPathSegLinetoVerticalRel.prototype.clone=function(){return new window.SVGPathSegLinetoVerticalRel(void 0,this._y)},Object.defineProperty(window.SVGPathSegLinetoVerticalRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoCubicSmoothAbs=function(t,e,i,n,r){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS,"S",t),this._x=e,this._y=i,this._x2=n,this._y2=r},window.SVGPathSegCurvetoCubicSmoothAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoCubicSmoothAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicSmoothAbs]"},window.SVGPathSegCurvetoCubicSmoothAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},window.SVGPathSegCurvetoCubicSmoothAbs.prototype.clone=function(){return new window.SVGPathSegCurvetoCubicSmoothAbs(void 0,this._x,this._y,this._x2,this._y2)},Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype,"x2",{get:function(){return this._x2},set:function(t){this._x2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype,"y2",{get:function(){return this._y2},set:function(t){this._y2=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoCubicSmoothRel=function(t,e,i,n,r){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL,"s",t),this._x=e,this._y=i,this._x2=n,this._y2=r},window.SVGPathSegCurvetoCubicSmoothRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoCubicSmoothRel.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicSmoothRel]"},window.SVGPathSegCurvetoCubicSmoothRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},window.SVGPathSegCurvetoCubicSmoothRel.prototype.clone=function(){return new window.SVGPathSegCurvetoCubicSmoothRel(void 0,this._x,this._y,this._x2,this._y2)},Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype,"x2",{get:function(){return this._x2},set:function(t){this._x2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype,"y2",{get:function(){return this._y2},set:function(t){this._y2=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoQuadraticSmoothAbs=function(t,e,i){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS,"T",t),this._x=e,this._y=i},window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticSmoothAbs]"},window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype.clone=function(){return new window.SVGPathSegCurvetoQuadraticSmoothAbs(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoQuadraticSmoothRel=function(t,e,i){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL,"t",t),this._x=e,this._y=i},window.SVGPathSegCurvetoQuadraticSmoothRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoQuadraticSmoothRel.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticSmoothRel]"},window.SVGPathSegCurvetoQuadraticSmoothRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},window.SVGPathSegCurvetoQuadraticSmoothRel.prototype.clone=function(){return new window.SVGPathSegCurvetoQuadraticSmoothRel(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathElement.prototype.createSVGPathSegClosePath=function(){return new window.SVGPathSegClosePath(void 0)},window.SVGPathElement.prototype.createSVGPathSegMovetoAbs=function(t,e){return new window.SVGPathSegMovetoAbs(void 0,t,e)},window.SVGPathElement.prototype.createSVGPathSegMovetoRel=function(t,e){return new window.SVGPathSegMovetoRel(void 0,t,e)},window.SVGPathElement.prototype.createSVGPathSegLinetoAbs=function(t,e){return new window.SVGPathSegLinetoAbs(void 0,t,e)},window.SVGPathElement.prototype.createSVGPathSegLinetoRel=function(t,e){return new window.SVGPathSegLinetoRel(void 0,t,e)},window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicAbs=function(t,e,i,n,r,a){return new window.SVGPathSegCurvetoCubicAbs(void 0,t,e,i,n,r,a)},window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicRel=function(t,e,i,n,r,a){return new window.SVGPathSegCurvetoCubicRel(void 0,t,e,i,n,r,a)},window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticAbs=function(t,e,i,n){return new window.SVGPathSegCurvetoQuadraticAbs(void 0,t,e,i,n)},window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticRel=function(t,e,i,n){return new window.SVGPathSegCurvetoQuadraticRel(void 0,t,e,i,n)},window.SVGPathElement.prototype.createSVGPathSegArcAbs=function(t,e,i,n,r,a,o){return new window.SVGPathSegArcAbs(void 0,t,e,i,n,r,a,o)},window.SVGPathElement.prototype.createSVGPathSegArcRel=function(t,e,i,n,r,a,o){return new window.SVGPathSegArcRel(void 0,t,e,i,n,r,a,o)},window.SVGPathElement.prototype.createSVGPathSegLinetoHorizontalAbs=function(t){return new window.SVGPathSegLinetoHorizontalAbs(void 0,t)},window.SVGPathElement.prototype.createSVGPathSegLinetoHorizontalRel=function(t){return new window.SVGPathSegLinetoHorizontalRel(void 0,t)},window.SVGPathElement.prototype.createSVGPathSegLinetoVerticalAbs=function(t){return new window.SVGPathSegLinetoVerticalAbs(void 0,t)},window.SVGPathElement.prototype.createSVGPathSegLinetoVerticalRel=function(t){return new window.SVGPathSegLinetoVerticalRel(void 0,t)},window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothAbs=function(t,e,i,n){return new window.SVGPathSegCurvetoCubicSmoothAbs(void 0,t,e,i,n)},window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothRel=function(t,e,i,n){return new window.SVGPathSegCurvetoCubicSmoothRel(void 0,t,e,i,n)},window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothAbs=function(t,e){return new window.SVGPathSegCurvetoQuadraticSmoothAbs(void 0,t,e)},window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothRel=function(t,e){return new window.SVGPathSegCurvetoQuadraticSmoothRel(void 0,t,e)},"getPathSegAtLength"in window.SVGPathElement.prototype||(window.SVGPathElement.prototype.getPathSegAtLength=function(t){if(void 0===t||!isFinite(t))throw"Invalid arguments.";var e=document.createElementNS("http://www.w3.org/2000/svg","path");e.setAttribute("d",this.getAttribute("d"));var i=e.pathSegList.numberOfItems-1;if(i<=0)return 0;do{if(e.pathSegList.removeItem(i),t>e.getTotalLength())break;i--}while(i>0);return i})),"SVGPathSegList"in window||(window.SVGPathSegList=function(t){this._pathElement=t,this._list=this._parsePath(this._pathElement.getAttribute("d")),this._mutationObserverConfig={attributes:!0,attributeFilter:["d"]},this._pathElementMutationObserver=new MutationObserver(this._updateListFromPathMutations.bind(this)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)},window.SVGPathSegList.prototype.classname="SVGPathSegList",Object.defineProperty(window.SVGPathSegList.prototype,"numberOfItems",{get:function(){return this._checkPathSynchronizedToList(),this._list.length},enumerable:!0}),Object.defineProperty(window.SVGPathElement.prototype,"pathSegList",{get:function(){return this._pathSegList||(this._pathSegList=new window.SVGPathSegList(this)),this._pathSegList},enumerable:!0}),Object.defineProperty(window.SVGPathElement.prototype,"normalizedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),Object.defineProperty(window.SVGPathElement.prototype,"animatedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),Object.defineProperty(window.SVGPathElement.prototype,"animatedNormalizedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),window.SVGPathSegList.prototype._checkPathSynchronizedToList=function(){this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords())},window.SVGPathSegList.prototype._updateListFromPathMutations=function(t){if(this._pathElement){var e=!1;t.forEach((function(t){"d"==t.attributeName&&(e=!0)})),e&&(this._list=this._parsePath(this._pathElement.getAttribute("d")))}},window.SVGPathSegList.prototype._writeListToPath=function(){this._pathElementMutationObserver.disconnect(),this._pathElement.setAttribute("d",window.SVGPathSegList._pathSegArrayAsString(this._list)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)},window.SVGPathSegList.prototype.segmentChanged=function(t){this._writeListToPath()},window.SVGPathSegList.prototype.clear=function(){this._checkPathSynchronizedToList(),this._list.forEach((function(t){t._owningPathSegList=null})),this._list=[],this._writeListToPath()},window.SVGPathSegList.prototype.initialize=function(t){return this._checkPathSynchronizedToList(),this._list=[t],t._owningPathSegList=this,this._writeListToPath(),t},window.SVGPathSegList.prototype._checkValidIndex=function(t){if(isNaN(t)||t<0||t>=this.numberOfItems)throw"INDEX_SIZE_ERR"},window.SVGPathSegList.prototype.getItem=function(t){return this._checkPathSynchronizedToList(),this._checkValidIndex(t),this._list[t]},window.SVGPathSegList.prototype.insertItemBefore=function(t,e){return this._checkPathSynchronizedToList(),e>this.numberOfItems&&(e=this.numberOfItems),t._owningPathSegList&&(t=t.clone()),this._list.splice(e,0,t),t._owningPathSegList=this,this._writeListToPath(),t},window.SVGPathSegList.prototype.replaceItem=function(t,e){return this._checkPathSynchronizedToList(),t._owningPathSegList&&(t=t.clone()),this._checkValidIndex(e),this._list[e]=t,t._owningPathSegList=this,this._writeListToPath(),t},window.SVGPathSegList.prototype.removeItem=function(t){this._checkPathSynchronizedToList(),this._checkValidIndex(t);var e=this._list[t];return this._list.splice(t,1),this._writeListToPath(),e},window.SVGPathSegList.prototype.appendItem=function(t){return this._checkPathSynchronizedToList(),t._owningPathSegList&&(t=t.clone()),this._list.push(t),t._owningPathSegList=this,this._writeListToPath(),t},window.SVGPathSegList._pathSegArrayAsString=function(t){var e="",i=!0;return t.forEach((function(t){i?(i=!1,e+=t._asPathString()):e+=" "+t._asPathString()})),e},window.SVGPathSegList.prototype._parsePath=function(t){if(!t||0==t.length)return[];var e=this,i=function(){this.pathSegList=[]};i.prototype.appendSegment=function(t){this.pathSegList.push(t)};var n=function(t){this._string=t,this._currentIndex=0,this._endIndex=this._string.length,this._previousCommand=window.SVGPathSeg.PATHSEG_UNKNOWN,this._skipOptionalSpaces()};n.prototype._isCurrentSpace=function(){var t=this._string[this._currentIndex];return t<=" "&&(" "==t||"\n"==t||"\t"==t||"\r"==t||"\f"==t)},n.prototype._skipOptionalSpaces=function(){for(;this._currentIndex<this._endIndex&&this._isCurrentSpace();)this._currentIndex++;return this._currentIndex<this._endIndex},n.prototype._skipOptionalSpacesOrDelimiter=function(){return!(this._currentIndex<this._endIndex&&!this._isCurrentSpace()&&","!=this._string.charAt(this._currentIndex))&&(this._skipOptionalSpaces()&&this._currentIndex<this._endIndex&&","==this._string.charAt(this._currentIndex)&&(this._currentIndex++,this._skipOptionalSpaces()),this._currentIndex<this._endIndex)},n.prototype.hasMoreData=function(){return this._currentIndex<this._endIndex},n.prototype.peekSegmentType=function(){var t=this._string[this._currentIndex];return this._pathSegTypeFromChar(t)},n.prototype._pathSegTypeFromChar=function(t){switch(t){case"Z":case"z":return window.SVGPathSeg.PATHSEG_CLOSEPATH;case"M":return window.SVGPathSeg.PATHSEG_MOVETO_ABS;case"m":return window.SVGPathSeg.PATHSEG_MOVETO_REL;case"L":return window.SVGPathSeg.PATHSEG_LINETO_ABS;case"l":return window.SVGPathSeg.PATHSEG_LINETO_REL;case"C":return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS;case"c":return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL;case"Q":return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS;case"q":return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL;case"A":return window.SVGPathSeg.PATHSEG_ARC_ABS;case"a":return window.SVGPathSeg.PATHSEG_ARC_REL;case"H":return window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS;case"h":return window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL;case"V":return window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS;case"v":return window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL;case"S":return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;case"s":return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL;case"T":return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS;case"t":return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL;default:return window.SVGPathSeg.PATHSEG_UNKNOWN}},n.prototype._nextCommandHelper=function(t,e){return("+"==t||"-"==t||"."==t||t>="0"&&t<="9")&&e!=window.SVGPathSeg.PATHSEG_CLOSEPATH?e==window.SVGPathSeg.PATHSEG_MOVETO_ABS?window.SVGPathSeg.PATHSEG_LINETO_ABS:e==window.SVGPathSeg.PATHSEG_MOVETO_REL?window.SVGPathSeg.PATHSEG_LINETO_REL:e:window.SVGPathSeg.PATHSEG_UNKNOWN},n.prototype.initialCommandIsMoveTo=function(){if(!this.hasMoreData())return!0;var t=this.peekSegmentType();return t==window.SVGPathSeg.PATHSEG_MOVETO_ABS||t==window.SVGPathSeg.PATHSEG_MOVETO_REL},n.prototype._parseNumber=function(){var t=0,e=0,i=1,n=0,r=1,a=1,o=this._currentIndex;if(this._skipOptionalSpaces(),this._currentIndex<this._endIndex&&"+"==this._string.charAt(this._currentIndex)?this._currentIndex++:this._currentIndex<this._endIndex&&"-"==this._string.charAt(this._currentIndex)&&(this._currentIndex++,r=-1),!(this._currentIndex==this._endIndex||(this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")&&"."!=this._string.charAt(this._currentIndex))){for(var s=this._currentIndex;this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&this._string.charAt(this._currentIndex)<="9";)this._currentIndex++;if(this._currentIndex!=s)for(var c=this._currentIndex-1,d=1;c>=s;)e+=d*(this._string.charAt(c--)-"0"),d*=10;if(this._currentIndex<this._endIndex&&"."==this._string.charAt(this._currentIndex)){if(this._currentIndex++,this._currentIndex>=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&this._string.charAt(this._currentIndex)<="9";)i*=10,n+=(this._string.charAt(this._currentIndex)-"0")/i,this._currentIndex+=1}if(this._currentIndex!=o&&this._currentIndex+1<this._endIndex&&("e"==this._string.charAt(this._currentIndex)||"E"==this._string.charAt(this._currentIndex))&&"x"!=this._string.charAt(this._currentIndex+1)&&"m"!=this._string.charAt(this._currentIndex+1)){if(this._currentIndex++,"+"==this._string.charAt(this._currentIndex)?this._currentIndex++:"-"==this._string.charAt(this._currentIndex)&&(this._currentIndex++,a=-1),this._currentIndex>=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&this._string.charAt(this._currentIndex)<="9";)t*=10,t+=this._string.charAt(this._currentIndex)-"0",this._currentIndex++}var l=e+n;if(l*=r,t&&(l*=Math.pow(10,a*t)),o!=this._currentIndex)return this._skipOptionalSpacesOrDelimiter(),l}},n.prototype._parseArcFlag=function(){if(!(this._currentIndex>=this._endIndex)){var t=!1,e=this._string.charAt(this._currentIndex++);if("0"==e)t=!1;else{if("1"!=e)return;t=!0}return this._skipOptionalSpacesOrDelimiter(),t}},n.prototype.parseSegment=function(){var t=this._string[this._currentIndex],i=this._pathSegTypeFromChar(t);if(i==window.SVGPathSeg.PATHSEG_UNKNOWN){if(this._previousCommand==window.SVGPathSeg.PATHSEG_UNKNOWN)return null;if((i=this._nextCommandHelper(t,this._previousCommand))==window.SVGPathSeg.PATHSEG_UNKNOWN)return null}else this._currentIndex++;switch(this._previousCommand=i,i){case window.SVGPathSeg.PATHSEG_MOVETO_REL:return new window.SVGPathSegMovetoRel(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_MOVETO_ABS:return new window.SVGPathSegMovetoAbs(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_REL:return new window.SVGPathSegLinetoRel(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_ABS:return new window.SVGPathSegLinetoAbs(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:return new window.SVGPathSegLinetoHorizontalRel(e,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:return new window.SVGPathSegLinetoHorizontalAbs(e,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:return new window.SVGPathSegLinetoVerticalRel(e,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:return new window.SVGPathSegLinetoVerticalAbs(e,this._parseNumber());case window.SVGPathSeg.PATHSEG_CLOSEPATH:return this._skipOptionalSpaces(),new window.SVGPathSegClosePath(e);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL:var n={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new window.SVGPathSegCurvetoCubicRel(e,n.x,n.y,n.x1,n.y1,n.x2,n.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS:return n={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicAbs(e,n.x,n.y,n.x1,n.y1,n.x2,n.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:return n={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicSmoothRel(e,n.x,n.y,n.x2,n.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:return n={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoCubicSmoothAbs(e,n.x,n.y,n.x2,n.y2);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:return n={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoQuadraticRel(e,n.x,n.y,n.x1,n.y1);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:return n={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegCurvetoQuadraticAbs(e,n.x,n.y,n.x1,n.y1);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:return new window.SVGPathSegCurvetoQuadraticSmoothRel(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:return new window.SVGPathSegCurvetoQuadraticSmoothAbs(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_ARC_REL:return n={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegArcRel(e,n.x,n.y,n.x1,n.y1,n.arcAngle,n.arcLarge,n.arcSweep);case window.SVGPathSeg.PATHSEG_ARC_ABS:return n={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()},new window.SVGPathSegArcAbs(e,n.x,n.y,n.x1,n.y1,n.arcAngle,n.arcLarge,n.arcSweep);default:throw"Unknown path seg type."}};var r=new i,a=new n(t);if(!a.initialCommandIsMoveTo())return[];for(;a.hasMoreData();){var o=a.parseSegment();if(!o)return[];r.appendSegment(o)}return r.pathSegList}),String.prototype.padEnd||(String.prototype.padEnd=function(t,e){return t>>=0,e=String(void 0!==e?e:" "),this.length>t?String(this):((t-=this.length)>e.length&&(e+=e.repeat(t/e.length)),String(this)+e.slice(0,t))}),"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(i[a]=r[a])}return i},writable:!0,configurable:!0}),e.prototype.axis=function(){},e.prototype.axis.labels=function(t){var e=this.internal;arguments.length&&(Object.keys(t).forEach((function(i){e.axis.setLabelText(i,t[i])})),e.axis.updateLabels())},e.prototype.axis.max=function(t){var e=this.internal,i=e.config;if(!arguments.length)return{x:i.axis_x_max,y:i.axis_y_max,y2:i.axis_y2_max};"object"==typeof t?(_(t.x)&&(i.axis_x_max=t.x),_(t.y)&&(i.axis_y_max=t.y),_(t.y2)&&(i.axis_y2_max=t.y2)):i.axis_y_max=i.axis_y2_max=t,e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})},e.prototype.axis.min=function(t){var e=this.internal,i=e.config;if(!arguments.length)return{x:i.axis_x_min,y:i.axis_y_min,y2:i.axis_y2_min};"object"==typeof t?(_(t.x)&&(i.axis_x_min=t.x),_(t.y)&&(i.axis_y_min=t.y),_(t.y2)&&(i.axis_y2_min=t.y2)):i.axis_y_min=i.axis_y2_min=t,e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})},e.prototype.axis.range=function(t){if(!arguments.length)return{max:this.axis.max(),min:this.axis.min()};l(t.max)&&this.axis.max(t.max),l(t.min)&&this.axis.min(t.min)},e.prototype.axis.types=function(t){var e=this.internal;if(void 0===t)return{y:e.config.axis_y_type,y2:e.config.axis_y2_type};l(t.y)&&(e.config.axis_y_type=t.y),l(t.y2)&&(e.config.axis_y2_type=t.y2),e.updateScales(),e.redraw()},e.prototype.category=function(t,e){var i=this.internal,n=i.config;return arguments.length>1&&(n.axis_x_categories[t]=e,i.redraw()),n.axis_x_categories[t]},e.prototype.categories=function(t){var e=this.internal,i=e.config;return arguments.length?(i.axis_x_categories=t,e.redraw(),i.axis_x_categories):i.axis_x_categories},e.prototype.resize=function(t){var e=this.internal.config;e.size_width=t?t.width:null,e.size_height=t?t.height:null,this.flush()},e.prototype.flush=function(){this.internal.updateAndRedraw({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})},e.prototype.destroy=function(){var t=this.internal;return window.clearInterval(t.intervalForObserveInserted),void 0!==t.resizeTimeout&&window.clearTimeout(t.resizeTimeout),window.removeEventListener("resize",t.resizeIfElementDisplayed),t.resizeFunction.remove(),t.unbindWindowFocus(),t.selectChart.classed("c3",!1).html(""),Object.keys(t).forEach((function(e){t[e]=null})),null},e.prototype.color=function(t){return this.internal.color(t)},e.prototype.data=function(t){var e=this.internal.data.targets;return void 0===t?e:e.filter((function(e){return[].concat(t).indexOf(e.id)>=0}))},e.prototype.data.shown=function(t){return this.internal.filterTargetsToShow(this.data(t))},e.prototype.data.values=function(t,e){void 0===e&&(e=!0);var i=null;if(t){var n=this.data(t);n&&d(n)&&(i=n.reduce((function(t,i){var n=i.values.map((function(t){return t.value}));return e?t=t.concat(n):t.push(n),t}),[]))}return i},e.prototype.data.names=function(t){return this.internal.clearLegendItemTextBoxCache(),this.internal.updateDataAttributes("names",t)},e.prototype.data.colors=function(t){return this.internal.updateDataAttributes("colors",t)},e.prototype.data.axes=function(t){return this.internal.updateDataAttributes("axes",t)},e.prototype.data.stackNormalized=function(t){if(void 0===t)return this.internal.isStackNormalized();this.internal.config.data_stack_normalize=!!t,this.internal.redraw()},e.prototype.donut=function(){},e.prototype.donut.padAngle=function(t){if(void 0===t)return this.internal.config.donut_padAngle;this.internal.config.donut_padAngle=t,this.flush()},e.prototype.flow=function(t){var e,i,n,r,a,o,s,c=this.internal,d=[],u=c.getMaxDataCount(),h=0,g=0;if(t.json)i=c.convertJsonToData(t.json,t.keys);else if(t.rows)i=c.convertRowsToData(t.rows);else{if(!t.columns)return;i=c.convertColumnsToData(t.columns)}e=c.convertDataToTargets(i,!0),c.data.targets.forEach((function(t){var i,n,r=!1;for(i=0;i<e.length;i++)if(t.id===e[i].id){for(r=!0,t.values[t.values.length-1]&&(g=t.values[t.values.length-1].index+1),h=e[i].values.length,n=0;n<h;n++)e[i].values[n].index=g+n,c.isTimeSeries()||(e[i].values[n].x=g+n);t.values=t.values.concat(e[i].values),e.splice(i,1);break}r||d.push(t.id)})),c.data.targets.forEach((function(t){var e,i;for(e=0;e<d.length;e++)if(t.id===d[e])for(g=t.values[t.values.length-1].index+1,i=0;i<h;i++)t.values.push({id:t.id,index:g+i,x:c.isTimeSeries()?c.getOtherTargetX(g+i):g+i,value:null})})),c.data.targets.length&&e.forEach((function(t){var e,i=[];for(e=c.data.targets[0].values[0].index;e<g;e++)i.push({id:t.id,index:e,x:c.isTimeSeries()?c.getOtherTargetX(e):e,value:null});t.values.forEach((function(t){t.index+=g,c.isTimeSeries()||(t.x+=g)})),t.values=i.concat(t.values)})),c.data.targets=c.data.targets.concat(e),c.getMaxDataCount(),a=(r=c.data.targets[0]).values[0],l(t.to)?(h=0,s=c.isTimeSeries()?c.parseDate(t.to):t.to,r.values.forEach((function(t){t.x<s&&h++}))):l(t.length)&&(h=t.length),u?1===u&&c.isTimeSeries()&&(o=(r.values[r.values.length-1].x-a.x)/2,n=[new Date(+a.x-o),new Date(+a.x+o)],c.updateXDomain(null,!0,!0,!1,n)):(o=c.isTimeSeries()?r.values.length>1?r.values[r.values.length-1].x-a.x:a.x-c.getXDomain(c.data.targets)[0]:1,n=[a.x-o,a.x],c.updateXDomain(null,!0,!0,!1,n)),c.updateTargets(c.data.targets),c.redraw({flow:{index:a.index,length:h,duration:_(t.duration)?t.duration:c.config.transition_duration,done:t.done,orgDataCount:u},withLegend:!0,withTransition:u>1,withTrimXDomain:!1,withUpdateXAxis:!0})},t.prototype.generateFlow=function(t){var e=this,i=e.config,n=e.d3;return function(){var r,o,s,c,d,l,u,h,g,p,f,_=t.targets,x=t.flow,y=t.drawBar,m=t.drawLine,S=t.drawArea,v=t.cx,b=t.cy,T=t.xv,A=t.xForText,P=t.yForText,C=t.duration,L=x.index,V=x.length,G=e.getValueOnIndex(e.data.targets[0].values,L),E=e.getValueOnIndex(e.data.targets[0].values,L+V),O=e.x.domain(),I=x.duration||C,R=x.done||function(){},k=e.generateWait();e.flowing=!0,e.data.targets.forEach((function(t){t.values.splice(0,V)})),s=e.updateXDomain(_,!0,!0),e.updateXGrid&&e.updateXGrid(!0),c=e.xgrid||n.selectAll([]),d=e.xgridLines||n.selectAll([]),l=e.mainRegion||n.selectAll([]),u=e.mainText||n.selectAll([]),h=e.mainBar||n.selectAll([]),g=e.mainLine||n.selectAll([]),p=e.mainArea||n.selectAll([]),f=e.mainCircle||n.selectAll([]),x.orgDataCount?r=1===x.orgDataCount||(G&&G.x)===(E&&E.x)||e.isTimeSeries()?e.x(O[0])-e.x(s[0]):e.x(G.x)-e.x(E.x):1!==e.data.targets[0].values.length?r=e.x(O[0])-e.x(s[0]):e.isTimeSeries()?(G=e.getValueOnIndex(e.data.targets[0].values,0),E=e.getValueOnIndex(e.data.targets[0].values,e.data.targets[0].values.length-1),r=e.x(G.x)-e.x(E.x)):r=a(s)/2,o="translate("+r+",0) scale("+a(O)/a(s)+",1)",e.hideXGridFocus();var D=n.transition().ease(n.easeLinear).duration(I);k.add(e.xAxis(e.axes.x,D)),k.add(h.transition(D).attr("transform",o)),k.add(g.transition(D).attr("transform",o)),k.add(p.transition(D).attr("transform",o)),k.add(f.transition(D).attr("transform",o)),k.add(u.transition(D).attr("transform",o)),k.add(l.filter(e.isRegionOnX).transition(D).attr("transform",o)),k.add(c.transition(D).attr("transform",o)),k.add(d.transition(D).attr("transform",o)),k((function(){var t,n=[],r=[];if(V){for(t=0;t<V;t++)n.push("."+w.shape+"-"+(L+t)),r.push("."+w.text+"-"+(L+t));e.svg.selectAll("."+w.shapes).selectAll(n).remove(),e.svg.selectAll("."+w.texts).selectAll(r).remove(),e.svg.select("."+w.xgrid).remove()}c.attr("transform",null).attr("x1",e.xgridAttr.x1).attr("x2",e.xgridAttr.x2).attr("y1",e.xgridAttr.y1).attr("y2",e.xgridAttr.y2).style("opacity",e.xgridAttr.opacity),d.attr("transform",null),d.select("line").attr("x1",i.axis_rotated?0:T).attr("x2",i.axis_rotated?e.width:T),d.select("text").attr("x",i.axis_rotated?e.width:0).attr("y",T),h.attr("transform",null).attr("d",y),g.attr("transform",null).attr("d",m),p.attr("transform",null).attr("d",S),f.attr("transform",null).attr("cx",v).attr("cy",b),u.attr("transform",null).attr("x",A).attr("y",P).style("fill-opacity",e.opacityForText.bind(e)),l.attr("transform",null),l.filter(e.isRegionOnX).attr("x",e.regionX.bind(e)).attr("width",e.regionWidth.bind(e)),R(),e.flowing=!1}))}},e.prototype.focus=function(t){var e,i=this.internal;t=i.mapToTargetIds(t),e=i.svg.selectAll(i.selectorTargets(t.filter(i.isTargetToShow,i))),this.revert(),this.defocus(),e.classed(w.focused,!0).classed(w.defocused,!1),i.hasArcType()&&i.expandArc(t),i.toggleFocusLegend(t,!0),i.focusedTargetIds=t,i.defocusedTargetIds=i.defocusedTargetIds.filter((function(e){return t.indexOf(e)<0}))},e.prototype.defocus=function(t){var e=this.internal;t=e.mapToTargetIds(t),e.svg.selectAll(e.selectorTargets(t.filter(e.isTargetToShow,e))).classed(w.focused,!1).classed(w.defocused,!0),e.hasArcType()&&e.unexpandArc(t),e.toggleFocusLegend(t,!1),e.focusedTargetIds=e.focusedTargetIds.filter((function(e){return t.indexOf(e)<0})),e.defocusedTargetIds=t},e.prototype.revert=function(t){var e=this.internal;t=e.mapToTargetIds(t),e.svg.selectAll(e.selectorTargets(t)).classed(w.focused,!1).classed(w.defocused,!1),e.hasArcType()&&e.unexpandArc(t),e.config.legend_show&&(e.showLegend(t.filter(e.isLegendToShow.bind(e))),e.legend.selectAll(e.selectorLegends(t)).filter((function(){return e.d3.select(this).classed(w.legendItemFocused)})).classed(w.legendItemFocused,!1)),e.focusedTargetIds=[],e.defocusedTargetIds=[]},e.prototype.xgrids=function(t){var e=this.internal,i=e.config;return t?(i.grid_x_lines=t,e.redrawWithoutRescale(),i.grid_x_lines):i.grid_x_lines},e.prototype.xgrids.add=function(t){var e=this.internal;return this.xgrids(e.config.grid_x_lines.concat(t||[]))},e.prototype.xgrids.remove=function(t){this.internal.removeGridLines(t,!0)},e.prototype.ygrids=function(t){var e=this.internal,i=e.config;return t?(i.grid_y_lines=t,e.redrawWithoutRescale(),i.grid_y_lines):i.grid_y_lines},e.prototype.ygrids.add=function(t){var e=this.internal;return this.ygrids(e.config.grid_y_lines.concat(t||[]))},e.prototype.ygrids.remove=function(t){this.internal.removeGridLines(t,!1)},e.prototype.groups=function(t){var e=this.internal,i=e.config;return f(t)||(i.data_groups=t,e.redraw()),i.data_groups},e.prototype.legend=function(){},e.prototype.legend.show=function(t){var e=this.internal;e.showLegend(e.mapToTargetIds(t)),e.updateAndRedraw({withLegend:!0})},e.prototype.legend.hide=function(t){var e=this.internal;e.hideLegend(e.mapToTargetIds(t)),e.updateAndRedraw({withLegend:!1})},e.prototype.load=function(t){var i=this.internal,n=i.config;t.xs&&i.addXs(t.xs),"names"in t&&e.prototype.data.names.bind(this)(t.names),"classes"in t&&Object.keys(t.classes).forEach((function(e){n.data_classes[e]=t.classes[e]})),"categories"in t&&i.isCategorized()&&(n.axis_x_categories=t.categories),"axes"in t&&Object.keys(t.axes).forEach((function(e){n.data_axes[e]=t.axes[e]})),"colors"in t&&Object.keys(t.colors).forEach((function(e){n.data_colors[e]=t.colors[e]})),"cacheIds"in t&&i.hasCaches(t.cacheIds)?i.load(i.getCaches(t.cacheIds),t.done):t.unload?i.unload(i.mapToTargetIds(!0===t.unload?null:t.unload),(function(){i.loadFromArgs(t)})):i.loadFromArgs(t)},e.prototype.unload=function(t){var e=this.internal;(t=t||{})instanceof Array?t={ids:t}:"string"==typeof t&&(t={ids:[t]}),e.unload(e.mapToTargetIds(t.ids),(function(){e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),t.done&&t.done()}))},e.prototype.pie=function(){},e.prototype.pie.padAngle=function(t){if(void 0===t)return this.internal.config.pie_padAngle;this.internal.config.pie_padAngle=t,this.flush()},e.prototype.regions=function(t){var e=this.internal,i=e.config;return t?(i.regions=t,e.redrawWithoutRescale(),i.regions):i.regions},e.prototype.regions.add=function(t){var e=this.internal,i=e.config;return t?(i.regions=i.regions.concat(t),e.redrawWithoutRescale(),i.regions):i.regions},e.prototype.regions.remove=function(t){var e,i,n,r=this.internal,a=r.config;return e=o(t=t||{},"duration",a.transition_duration),i=o(t,"classes",[w.region]),n=r.main.select("."+w.regions).selectAll(i.map((function(t){return"."+t}))),(e?n.transition().duration(e):n).style("opacity",0).remove(),a.regions=a.regions.filter((function(t){var e=!1;return!t.class||(t.class.split(" ").forEach((function(t){i.indexOf(t)>=0&&(e=!0)})),!e)})),a.regions},e.prototype.selected=function(t){var e=this.internal,i=e.d3;return e.main.selectAll("."+w.shapes+e.getTargetSelectorSuffix(t)).selectAll("."+w.shape).filter((function(){return i.select(this).classed(w.SELECTED)})).nodes().map((function(t){var e=t.__data__;return e.data?e.data:e}))},e.prototype.select=function(t,e,i){var n=this.internal,r=n.d3,a=n.config;a.data_selection_enabled&&n.main.selectAll("."+w.shapes).selectAll("."+w.shape).each((function(o,s){var c=r.select(this),d=o.data?o.data.id:o.id,u=n.getToggle(this,o).bind(n),h=a.data_selection_grouped||!t||t.indexOf(d)>=0,g=!e||e.indexOf(s)>=0,p=c.classed(w.SELECTED);c.classed(w.line)||c.classed(w.area)||(h&&g?a.data_selection_isselectable(o)&&!p&&u(!0,c.classed(w.SELECTED,!0),o,s):l(i)&&i&&p&&u(!1,c.classed(w.SELECTED,!1),o,s))}))},e.prototype.unselect=function(t,e){var i=this.internal,n=i.d3,r=i.config;r.data_selection_enabled&&i.main.selectAll("."+w.shapes).selectAll("."+w.shape).each((function(a,o){var s=n.select(this),c=a.data?a.data.id:a.id,d=i.getToggle(this,a).bind(i),l=r.data_selection_grouped||!t||t.indexOf(c)>=0,u=!e||e.indexOf(o)>=0,h=s.classed(w.SELECTED);s.classed(w.line)||s.classed(w.area)||l&&u&&r.data_selection_isselectable(a)&&h&&d(!1,s.classed(w.SELECTED,!1),a,o)}))},e.prototype.show=function(t,e){var i,n=this.internal;t=n.mapToTargetIds(t),e=e||{},n.removeHiddenTargetIds(t),(i=n.svg.selectAll(n.selectorTargets(t))).transition().style("display",m()?"block":"initial","important").style("opacity",1,"important").call(n.endall,(function(){i.style("opacity",null).style("opacity",1)})),e.withLegend&&n.showLegend(t),n.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},e.prototype.hide=function(t,e){var i,n=this.internal;t=n.mapToTargetIds(t),e=e||{},n.addHiddenTargetIds(t),(i=n.svg.selectAll(n.selectorTargets(t))).transition().style("opacity",0,"important").call(n.endall,(function(){i.style("opacity",null).style("opacity",0),i.style("display","none")})),e.withLegend&&n.hideLegend(t),n.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},e.prototype.toggle=function(t,e){var i=this,n=this.internal;n.mapToTargetIds(t).forEach((function(t){n.isTargetToShow(t)?i.hide(t,e):i.show(t,e)}))},e.prototype.subchart=function(){},e.prototype.subchart.isShown=function(){return this.internal.config.subchart_show},e.prototype.subchart.show=function(){var t=this.internal;t.config.subchart_show||(t.config.subchart_show=!0,t.initSubchart(),t.updateDimension(),t.initSubchartBrush(),t.updateTargetsForSubchart(t.getTargets()),t.mapToIds(t.data.targets).forEach((function(e){t.withoutFadeIn[e]=!1})),t.updateAndRedraw(),t.showTargets())},e.prototype.subchart.hide=function(){var t=this.internal;t.config.subchart_show&&(t.config.subchart_show=!1,t.removeSubchart(),t.redraw())},e.prototype.tooltip=function(){},e.prototype.tooltip.show=function(t){var e,i,n=this.internal,r={};t.mouse?r=t.mouse:(t.data?i=t.data:void 0!==t.x&&(e=t.id?n.data.targets.filter((function(e){return e.id===t.id})):n.data.targets,i=n.filterByX(e,t.x).slice(0,1)[0]),r=i?n.getMousePosition(i):null),n.dispatchEvent("mousemove",r),n.config.tooltip_onshow.call(n,i)},e.prototype.tooltip.hide=function(){this.internal.dispatchEvent("mouseout",0),this.internal.config.tooltip_onhide.call(this)},e.prototype.transform=function(t,e){var i=this.internal,n=["pie","donut"].indexOf(t)>=0?{withTransform:!0}:null;i.transformTo(e,t,n)},t.prototype.transformTo=function(t,e,i){var n=this,r=!n.hasArcType(),a=i||{withTransitionForAxis:r};a.withTransitionForTransform=!1,n.transiting=!1,n.setTargetType(t,e),n.updateTargets(n.data.targets),n.updateAndRedraw(a)},e.prototype.x=function(t){var e=this.internal;return arguments.length&&(e.updateTargetX(e.data.targets,t),e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),e.data.xs},e.prototype.xs=function(t){var e=this.internal;return arguments.length&&(e.updateTargetXs(e.data.targets,t),e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),e.data.xs},e.prototype.zoom=function(t){var e=this.internal;return t?(e.isTimeSeries()&&(t=t.map((function(t){return e.parseDate(t)}))),e.config.subchart_show?e.brush.selectionAsValue(t,!0):(e.updateXDomain(null,!0,!1,!1,t),e.redraw({withY:e.config.zoom_rescale,withSubchart:!1})),e.config.zoom_onzoom.call(this,e.x.orgDomain()),t):e.x.domain()},e.prototype.zoom.enable=function(t){var e=this.internal;e.config.zoom_enabled=t,e.updateAndRedraw()},e.prototype.unzoom=function(){var t=this.internal;t.config.subchart_show?t.brush.clear():(t.updateXDomain(null,!0,!1,!1,t.subX.domain()),t.redraw({withY:t.config.zoom_rescale,withSubchart:!1}))},e.prototype.zoom.max=function(t){var e=this.internal,i=e.config,n=e.d3;if(0!==t&&!t)return i.zoom_x_max;i.zoom_x_max=n.max([e.orgXDomain[1],t])},e.prototype.zoom.min=function(t){var e=this.internal,i=e.config,n=e.d3;if(0!==t&&!t)return i.zoom_x_min;i.zoom_x_min=n.min([e.orgXDomain[0],t])},e.prototype.zoom.range=function(t){if(!arguments.length)return{max:this.domain.max(),min:this.domain.min()};l(t.max)&&this.domain.max(t.max),l(t.min)&&this.domain.min(t.min)},t.prototype.initPie=function(){var t=this,e=t.d3;t.pie=e.pie().padAngle(this.getPadAngle.bind(this)).value((function(t){return t.values.reduce((function(t,e){return t+e.value}),0)}));var i=t.getOrderFunction();if(i&&(t.isOrderAsc()||t.isOrderDesc())){var n=i;i=function(t,e){return-1*n(t,e)}}t.pie.sort(i||null)},t.prototype.updateRadius=function(){var t=this,e=t.config,i=e.gauge_width||e.donut_width,n=t.filterTargetsToShow(t.data.targets).length*t.config.gauge_arcs_minWidth;t.radiusExpanded=Math.min(t.arcWidth,t.arcHeight)/2*(t.hasType("gauge")?.85:1),t.radius=.95*t.radiusExpanded,t.innerRadiusRatio=i?(t.radius-i)/t.radius:.6,t.innerRadius=t.hasType("donut")||t.hasType("gauge")?t.radius*t.innerRadiusRatio:0,t.gaugeArcWidth=i||(n<=t.radius-t.innerRadius?t.radius-t.innerRadius:n<=t.radius?n:t.radius)},t.prototype.getPadAngle=function(){return this.hasType("pie")?this.config.pie_padAngle||0:this.hasType("donut")&&this.config.donut_padAngle||0},t.prototype.updateArc=function(){var t=this;t.svgArc=t.getSvgArc(),t.svgArcExpanded=t.getSvgArcExpanded(),t.svgArcExpandedSub=t.getSvgArcExpanded(.98)},t.prototype.updateAngle=function(t){var e,i,n,r,a=this,o=a.config,s=!1,c=0;return o?(a.pie(a.filterTargetsToShow(a.data.targets)).forEach((function(e){s||e.data.id!==t.data.id||(s=!0,(t=e).index=c),c++})),isNaN(t.startAngle)&&(t.startAngle=0),isNaN(t.endAngle)&&(t.endAngle=t.startAngle),a.isGaugeType(t.data)&&(e=o.gauge_min,i=o.gauge_max,n=Math.PI*(o.gauge_fullCircle?2:1)/(i-e),r=t.value<e?0:t.value<i?t.value-e:i-e,t.startAngle=o.gauge_startingAngle,t.endAngle=t.startAngle+n*r),s?t:null):null},t.prototype.getSvgArc=function(){var t=this,e=t.hasType("gauge"),i=t.gaugeArcWidth/t.filterTargetsToShow(t.data.targets).length,n=t.d3.arc().outerRadius((function(n){return e?t.radius-i*n.index:t.radius})).innerRadius((function(n){return e?t.radius-i*(n.index+1):t.innerRadius})),r=function(e,i){var r;return i?n(e):(r=t.updateAngle(e))?n(r):"M 0 0"};return r.centroid=n.centroid,r},t.prototype.getSvgArcExpanded=function(t){t=t||1;var e=this,i=e.hasType("gauge"),n=e.gaugeArcWidth/e.filterTargetsToShow(e.data.targets).length,r=Math.min(e.radiusExpanded*t-e.radius,.8*n-100*(1-t)),a=e.d3.arc().outerRadius((function(a){return i?e.radius-n*a.index+r:e.radiusExpanded*t})).innerRadius((function(t){return i?e.radius-n*(t.index+1):e.innerRadius}));return function(t){var i=e.updateAngle(t);return i?a(i):"M 0 0"}},t.prototype.getArc=function(t,e,i){return i||this.isArcType(t.data)?this.svgArc(t,e):"M 0 0"},t.prototype.transformForArcLabel=function(t){var e,i,n,r,a,o=this,s=o.config,c=o.updateAngle(t),d="",l=o.hasType("gauge");if(c&&!l)e=this.svgArc.centroid(c),i=isNaN(e[0])?0:e[0],n=isNaN(e[1])?0:e[1],r=Math.sqrt(i*i+n*n),d="translate("+i*(a=o.hasType("donut")&&s.donut_label_ratio?h(s.donut_label_ratio)?s.donut_label_ratio(t,o.radius,r):s.donut_label_ratio:o.hasType("pie")&&s.pie_label_ratio?h(s.pie_label_ratio)?s.pie_label_ratio(t,o.radius,r):s.pie_label_ratio:o.radius&&r?(36/o.radius>.375?1.175-36/o.radius:.8)*o.radius/r:0)+","+n*a+")";else if(c&&l&&o.filterTargetsToShow(o.data.targets).length>1){var u=Math.sin(c.endAngle-Math.PI/2);d="translate("+(i=Math.cos(c.endAngle-Math.PI/2)*(o.radiusExpanded+25))+","+(n=u*(o.radiusExpanded+15-Math.abs(10*u))+3)+")"}return d},t.prototype.getArcRatio=function(t){return this.getRatio("arc",t)},t.prototype.convertToArcData=function(t){return this.addName({id:t.data.id,value:t.value,ratio:this.getRatio("arc",t),index:t.index})},t.prototype.textForArcLabel=function(t){var e,i,n,r,a,o=this;return o.shouldShowArcLabel()?(i=(e=o.updateAngle(t))?e.value:null,n=o.getRatio("arc",e),r=t.data.id,o.hasType("gauge")||o.meetsArcLabelThreshold(n)?(a=o.getArcLabelFormat())?a(i,n,r):o.defaultArcValueFormat(i,n):""):""},t.prototype.textForGaugeMinMax=function(t,e){var i=this.getGaugeLabelExtents();return i?i(t,e):t},t.prototype.expandArc=function(t){var e,i=this;i.transiting?e=window.setInterval((function(){i.transiting||(window.clearInterval(e),i.legend.selectAll(".c3-legend-item-focused").size()>0&&i.expandArc(t))}),10):(t=i.mapToTargetIds(t),i.svg.selectAll(i.selectorTargets(t,"."+w.chartArc)).each((function(t){i.shouldExpand(t.data.id)&&i.d3.select(this).selectAll("path").transition().duration(i.expandDuration(t.data.id)).attr("d",i.svgArcExpanded).transition().duration(2*i.expandDuration(t.data.id)).attr("d",i.svgArcExpandedSub).each((function(t){i.isDonutType(t.data)}))})))},t.prototype.unexpandArc=function(t){var e=this;e.transiting||(t=e.mapToTargetIds(t),e.svg.selectAll(e.selectorTargets(t,"."+w.chartArc)).selectAll("path").transition().duration((function(t){return e.expandDuration(t.data.id)})).attr("d",e.svgArc),e.svg.selectAll("."+w.arc))},t.prototype.expandDuration=function(t){var e=this.config;return this.isDonutType(t)?e.donut_expand_duration:this.isGaugeType(t)?e.gauge_expand_duration:this.isPieType(t)?e.pie_expand_duration:50},t.prototype.shouldExpand=function(t){var e=this.config;return this.isDonutType(t)&&e.donut_expand||this.isGaugeType(t)&&e.gauge_expand||this.isPieType(t)&&e.pie_expand},t.prototype.shouldShowArcLabel=function(){var t=this.config,e=!0;return this.hasType("donut")?e=t.donut_label_show:this.hasType("pie")&&(e=t.pie_label_show),e},t.prototype.meetsArcLabelThreshold=function(t){var e=this.config;return t>=(this.hasType("donut")?e.donut_label_threshold:e.pie_label_threshold)},t.prototype.getArcLabelFormat=function(){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},t.prototype.getGaugeLabelExtents=function(){return this.config.gauge_label_extents},t.prototype.getArcTitle=function(){return this.hasType("donut")?this.config.donut_title:""},t.prototype.updateTargetsForArc=function(t){var e,i=this,n=i.main,r=i.classChartArc.bind(i),a=i.classArcs.bind(i),o=i.classFocus.bind(i);(e=n.select("."+w.chartArcs).selectAll("."+w.chartArc).data(i.pie(t)).attr("class",(function(t){return r(t)+o(t.data)})).enter().append("g").attr("class",r)).append("g").attr("class",a),e.append("text").attr("dy",i.hasType("gauge")?"-.1em":".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none")},t.prototype.initArc=function(){var t=this;t.arcs=t.main.select("."+w.chart).append("g").attr("class",w.chartArcs).attr("transform",t.getTranslate("arc")),t.arcs.append("text").attr("class",w.chartArcsTitle).style("text-anchor","middle").text(t.getArcTitle())},t.prototype.redrawArc=function(t,e,i){var n,r,a,o,s=this,c=s.d3,d=s.config,l=s.main,u=s.hasType("gauge");if(r=(n=l.selectAll("."+w.arcs).selectAll("."+w.arc).data(s.arcData.bind(s))).enter().append("path").attr("class",s.classArc.bind(s)).style("fill",(function(t){return s.color(t.data)})).style("cursor",(function(t){return d.interaction_enabled&&d.data_selection_isselectable(t)?"pointer":null})).each((function(t){s.isGaugeType(t.data)&&(t.startAngle=t.endAngle=d.gauge_startingAngle),this._current=t})).merge(n),u&&(o=(a=l.selectAll("."+w.arcs).selectAll("."+w.arcLabelLine).data(s.arcData.bind(s))).enter().append("rect").attr("class",(function(t){return w.arcLabelLine+" "+w.target+" "+w.target+"-"+t.data.id})).merge(a),1===s.filterTargetsToShow(s.data.targets).length?o.style("display","none"):o.style("fill",(function(t){return s.levelColor?s.levelColor(t.data.values.reduce((function(t,e){return t+e.value}),0)):s.color(t.data)})).style("display",d.gauge_labelLine_show?"":"none").each((function(t){var e=0,i=0,n=0,r="";if(s.hiddenTargetIds.indexOf(t.data.id)<0){var a=s.updateAngle(t),o=s.gaugeArcWidth/s.filterTargetsToShow(s.data.targets).length*(a.index+1),d=a.endAngle-Math.PI/2,l=s.radius-o,u=d-(0===l?0:1/l);e=s.radiusExpanded-s.radius+o,i=Math.cos(u)*l,n=Math.sin(u)*l,r="rotate("+180*d/Math.PI+", "+i+", "+n+")"}c.select(this).attr("x",i).attr("y",n).attr("width",e).attr("height",2).attr("transform",r).style("stroke-dasharray","0, "+(e+2)+", 0")}))),r.attr("transform",(function(t){return!s.isGaugeType(t.data)&&i?"scale(0)":""})).on("mouseover",d.interaction_enabled?function(t){var e,i;s.transiting||(e=s.updateAngle(t))&&(i=s.convertToArcData(e),s.expandArc(e.data.id),s.api.focus(e.data.id),s.toggleFocusLegend(e.data.id,!0),s.config.data_onmouseover(i,this))}:null).on("mousemove",d.interaction_enabled?function(t){var e,i=s.updateAngle(t);i&&(e=[s.convertToArcData(i)],s.showTooltip(e,this))}:null).on("mouseout",d.interaction_enabled?function(t){var e,i;s.transiting||(e=s.updateAngle(t))&&(i=s.convertToArcData(e),s.unexpandArc(e.data.id),s.api.revert(),s.revertLegend(),s.hideTooltip(),s.config.data_onmouseout(i,this))}:null).on("click",d.interaction_enabled?function(t,e){var i,n=s.updateAngle(t);n&&(i=s.convertToArcData(n),s.toggleShape&&s.toggleShape(this,i,e),s.config.data_onclick.call(s.api,i,this))}:null).each((function(){s.transiting=!0})).transition().duration(t).attrTween("d",(function(t){var e,i=s.updateAngle(t);return i?(isNaN(this._current.startAngle)&&(this._current.startAngle=0),isNaN(this._current.endAngle)&&(this._current.endAngle=this._current.startAngle),e=c.interpolate(this._current,i),this._current=e(0),function(i){if(null===s.config)return"M 0 0";var n=e(i);return n.data=t.data,s.getArc(n,!0)}):function(){return"M 0 0"}})).attr("transform",i?"scale(1)":"").style("fill",(function(t){return s.levelColor?s.levelColor(t.data.values.reduce((function(t,e){return t+e.value}),0)):s.color(t.data.id)})).call(s.endall,(function(){s.transiting=!1})),n.exit().transition().duration(e).style("opacity",0).remove(),l.selectAll("."+w.chartArc).select("text").style("opacity",0).attr("class",(function(t){return s.isGaugeType(t.data)?w.gaugeValue:""})).text(s.textForArcLabel.bind(s)).attr("transform",s.transformForArcLabel.bind(s)).style("font-size",(function(t){return s.isGaugeType(t.data)&&1===s.filterTargetsToShow(s.data.targets).length?Math.round(s.radius/5)+"px":""})).transition().duration(t).style("opacity",(function(t){return s.isTargetToShow(t.data.id)&&s.isArcType(t.data)?1:0})),l.select("."+w.chartArcsTitle).style("opacity",s.hasType("donut")||u?1:0),u){var h=0,g=s.arcs.select("g."+w.chartArcsBackground).selectAll("path."+w.chartArcsBackground).data(s.data.targets);g.enter().append("path").attr("class",(function(t,e){return w.chartArcsBackground+" "+w.chartArcsBackground+"-"+e})).merge(g).attr("d",(function(t){if(s.hiddenTargetIds.indexOf(t.id)>=0)return"M 0 0";var e={data:[{value:d.gauge_max}],startAngle:d.gauge_startingAngle,endAngle:-1*d.gauge_startingAngle*(d.gauge_fullCircle?Math.PI:1),index:h++};return s.getArc(e,!0,!0)})),g.exit().remove(),s.arcs.select("."+w.chartArcsGaugeUnit).attr("dy",".75em").text(d.gauge_label_show?d.gauge_units:""),s.arcs.select("."+w.chartArcsGaugeMin).attr("dx",-1*(s.innerRadius+(s.radius-s.innerRadius)/(d.gauge_fullCircle?1:2))+"px").attr("dy","1.2em").text(d.gauge_label_show?s.textForGaugeMinMax(d.gauge_min,!1):""),s.arcs.select("."+w.chartArcsGaugeMax).attr("dx",s.innerRadius+(s.radius-s.innerRadius)/(d.gauge_fullCircle?1:2)+"px").attr("dy","1.2em").text(d.gauge_label_show?s.textForGaugeMinMax(d.gauge_max,!0):"")}},t.prototype.initGauge=function(){var t=this.arcs;this.hasType("gauge")&&(t.append("g").attr("class",w.chartArcsBackground),t.append("text").attr("class",w.chartArcsGaugeUnit).style("text-anchor","middle").style("pointer-events","none"),t.append("text").attr("class",w.chartArcsGaugeMin).style("text-anchor","middle").style("pointer-events","none"),t.append("text").attr("class",w.chartArcsGaugeMax).style("text-anchor","middle").style("pointer-events","none"))},t.prototype.getGaugeLabelHeight=function(){return this.config.gauge_label_show?20:0},t.prototype.addToCache=function(t,e){this.cache["$"+t]=e},t.prototype.getFromCache=function(t){return this.cache["$"+t]},t.prototype.resetCache=function(){var t=this;Object.keys(this.cache).filter((function(t){return/^\$/.test(t)})).forEach((function(e){delete t.cache[e]}))},t.prototype.hasCaches=function(t){for(var e=0;e<t.length;e++)if(!(t[e]in this.cache))return!1;return!0},t.prototype.addCache=function(t,e){this.cache[t]=this.cloneTarget(e)},t.prototype.getCaches=function(t){var e,i=[];for(e=0;e<t.length;e++)t[e]in this.cache&&i.push(this.cloneTarget(this.cache[t[e]]));return i},t.prototype.categoryName=function(t){var e=this.config;return t<e.axis_x_categories.length?e.axis_x_categories[t]:t},t.prototype.generateTargetClass=function(t){return t||0===t?("-"+t).replace(/\s/g,"-"):""},t.prototype.generateClass=function(t,e){return" "+t+" "+t+this.generateTargetClass(e)},t.prototype.classText=function(t){return this.generateClass(w.text,t.index)},t.prototype.classTexts=function(t){return this.generateClass(w.texts,t.id)},t.prototype.classShape=function(t){return this.generateClass(w.shape,t.index)},t.prototype.classShapes=function(t){return this.generateClass(w.shapes,t.id)},t.prototype.classLine=function(t){return this.classShape(t)+this.generateClass(w.line,t.id)},t.prototype.classLines=function(t){return this.classShapes(t)+this.generateClass(w.lines,t.id)},t.prototype.classCircle=function(t){return this.classShape(t)+this.generateClass(w.circle,t.index)},t.prototype.classCircles=function(t){return this.classShapes(t)+this.generateClass(w.circles,t.id)},t.prototype.classBar=function(t){return this.classShape(t)+this.generateClass(w.bar,t.index)},t.prototype.classBars=function(t){return this.classShapes(t)+this.generateClass(w.bars,t.id)},t.prototype.classArc=function(t){return this.classShape(t.data)+this.generateClass(w.arc,t.data.id)},t.prototype.classArcs=function(t){return this.classShapes(t.data)+this.generateClass(w.arcs,t.data.id)},t.prototype.classArea=function(t){return this.classShape(t)+this.generateClass(w.area,t.id)},t.prototype.classAreas=function(t){return this.classShapes(t)+this.generateClass(w.areas,t.id)},t.prototype.classRegion=function(t,e){return this.generateClass(w.region,e)+" "+("class"in t?t.class:"")},t.prototype.classEvent=function(t){return this.generateClass(w.eventRect,t.index)},t.prototype.classTarget=function(t){var e=this.config.data_classes[t],i="";return e&&(i=" "+w.target+"-"+e),this.generateClass(w.target,t)+i},t.prototype.classFocus=function(t){return this.classFocused(t)+this.classDefocused(t)},t.prototype.classFocused=function(t){return" "+(this.focusedTargetIds.indexOf(t.id)>=0?w.focused:"")},t.prototype.classDefocused=function(t){return" "+(this.defocusedTargetIds.indexOf(t.id)>=0?w.defocused:"")},t.prototype.classChartText=function(t){return w.chartText+this.classTarget(t.id)},t.prototype.classChartLine=function(t){return w.chartLine+this.classTarget(t.id)},t.prototype.classChartBar=function(t){return w.chartBar+this.classTarget(t.id)},t.prototype.classChartArc=function(t){return w.chartArc+this.classTarget(t.data.id)},t.prototype.getTargetSelectorSuffix=function(t){var e=this.generateTargetClass(t);return window.CSS&&window.CSS.escape?window.CSS.escape(e):e.replace(/([?!@#$%^&*()=+,.<>'":;\[\]\/|~`{}\\])/g,"\\$1")},t.prototype.selectorTarget=function(t,e){return(e||"")+"."+w.target+this.getTargetSelectorSuffix(t)},t.prototype.selectorTargets=function(t,e){var i=this;return(t=t||[]).length?t.map((function(t){return i.selectorTarget(t,e)})):null},t.prototype.selectorLegend=function(t){return"."+w.legendItem+this.getTargetSelectorSuffix(t)},t.prototype.selectorLegends=function(t){var e=this;return t&&t.length?t.map((function(t){return e.selectorLegend(t)})):null},t.prototype.getClipPath=function(t){return"url("+(m(9)?"":document.URL.split("#")[0])+"#"+t+")"},t.prototype.appendClip=function(t,e){return t.append("clipPath").attr("id",e).append("rect")},t.prototype.getAxisClipX=function(t){var e=Math.max(30,this.margin.left);return t?-(1+e):-(e-1)},t.prototype.getAxisClipY=function(t){return t?-20:-this.margin.top},t.prototype.getXAxisClipX=function(){return this.getAxisClipX(!this.config.axis_rotated)},t.prototype.getXAxisClipY=function(){return this.getAxisClipY(!this.config.axis_rotated)},t.prototype.getYAxisClipX=function(){return this.config.axis_y_inner?-1:this.getAxisClipX(this.config.axis_rotated)},t.prototype.getYAxisClipY=function(){return this.getAxisClipY(this.config.axis_rotated)},t.prototype.getAxisClipWidth=function(t){var e=Math.max(30,this.margin.left),i=Math.max(30,this.margin.right);return t?this.width+2+e+i:this.margin.left+20},t.prototype.getAxisClipHeight=function(t){return(t?this.margin.bottom:this.margin.top+this.height)+20},t.prototype.getXAxisClipWidth=function(){return this.getAxisClipWidth(!this.config.axis_rotated)},t.prototype.getXAxisClipHeight=function(){return this.getAxisClipHeight(!this.config.axis_rotated)},t.prototype.getYAxisClipWidth=function(){return this.getAxisClipWidth(this.config.axis_rotated)+(this.config.axis_y_inner?20:0)},t.prototype.getYAxisClipHeight=function(){return this.getAxisClipHeight(this.config.axis_rotated)},t.prototype.generateColor=function(){var t=this.config,e=this.d3,i=t.data_colors,n=x(t.color_pattern)?t.color_pattern:e.schemeCategory10,r=t.data_color,a=[];return function(t){var e,o=t.id||t.data&&t.data.id||t;return i[o]instanceof Function?e=i[o](t):i[o]?e=i[o]:(a.indexOf(o)<0&&a.push(o),e=n[a.indexOf(o)%n.length],i[o]=e),r instanceof Function?r(e,t):e}},t.prototype.generateLevelColor=function(){var t=this.config,e=t.color_pattern,i=t.color_threshold,n="value"===i.unit,r=i.values&&i.values.length?i.values:[],a=i.max||100;return x(i)&&x(e)?function(t){var i,o=e[e.length-1];for(i=0;i<r.length;i++)if((n?t:100*t/a)<r[i]){o=e[i];break}return o}:null},t.prototype.getDefaultConfig=function(){var t={bindto:"#chart",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:!1,zoom_initialRange:void 0,zoom_type:"scroll",zoom_disableDefaultBehavior:!1,zoom_privileged:!1,zoom_rescale:!1,zoom_onzoom:function(){},zoom_onzoomstart:function(){},zoom_onzoomend:function(){},zoom_x_min:void 0,zoom_x_max:void 0,interaction_brighten:!0,interaction_enabled:!0,onmouseover:function(){},onmouseout:function(){},onresize:function(){},onresized:function(){},oninit:function(){},onrendered:function(){},transition_duration:350,data_epochs:"epochs",data_x:void 0,data_xs:{},data_xFormat:"%Y-%m-%d",data_xLocaltime:!0,data_xSort:!0,data_idConverter:function(t){return t},data_names:{},data_classes:{},data_groups:[],data_axes:{},data_type:void 0,data_types:{},data_labels:{},data_order:"desc",data_regions:{},data_color:void 0,data_colors:{},data_hide:!1,data_filter:void 0,data_selection_enabled:!1,data_selection_grouped:!1,data_selection_isselectable:function(){return!0},data_selection_multiple:!0,data_selection_draggable:!1,data_stack_normalize:!1,data_onclick:function(){},data_onmouseover:function(){},data_onmouseout:function(){},data_onselected:function(){},data_onunselected:function(){},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_onbrush:function(){},color_pattern:[],color_threshold:{},legend_show:!0,legend_hide:!1,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_onmouseover:void 0,legend_item_onmouseout:void 0,legend_equally:!1,legend_padding:0,legend_item_tile_width:10,legend_item_tile_height:10,axis_rotated:!1,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_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_multilineMax:0,axis_x_tick_width:null,axis_x_max:void 0,axis_x_min:void 0,axis_x_padding:{},axis_x_height:void 0,axis_x_selection:void 0,axis_x_label:{},axis_x_inner:void 0,axis_y_show:!0,axis_y_type:"linear",axis_y_max:void 0,axis_y_min:void 0,axis_y_inverted:!1,axis_y_center:void 0,axis_y_inner:void 0,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_time_type:void 0,axis_y_tick_time_interval:void 0,axis_y_padding:{},axis_y_default:void 0,axis_y2_show:!1,axis_y2_type:"linear",axis_y2_max:void 0,axis_y2_min:void 0,axis_y2_inverted:!1,axis_y2_center:void 0,axis_y2_inner:void 0,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_padding:{},axis_y2_default:void 0,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_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_select_r:void 0,line_connectNull:!1,line_step_type:"step",bar_width:void 0,bar_width_ratio:.6,bar_width_max:void 0,bar_zerobased:!0,bar_space:0,area_zerobased:!0,area_above:!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_padAngle:0,gauge_fullCircle:!1,gauge_label_show:!0,gauge_labelLine_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_units:void 0,gauge_width:void 0,gauge_arcs_minWidth:5,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",stanford_lines:[],stanford_regions:[],stanford_texts:[],stanford_scaleMin:void 0,stanford_scaleMax:void 0,stanford_scaleWidth:void 0,stanford_scaleFormat:void 0,stanford_scaleValues:void 0,stanford_colors:void 0,stanford_padding:{top:0,right:0,bottom:0,left:0},regions:[],tooltip_show:!0,tooltip_grouped:!0,tooltip_order:void 0,tooltip_format_title:void 0,tooltip_format_name:void 0,tooltip_format_value:void 0,tooltip_horizontal:void 0,tooltip_position:void 0,tooltip_contents:function(t,e,i,n){return this.getTooltipContent?this.getTooltipContent(t,e,i,n):""},tooltip_init_show:!1,tooltip_init_x:0,tooltip_init_position:{top:"0px",left:"50px"},tooltip_onshow:function(){},tooltip_onhide:function(){},title_text:void 0,title_padding:{top:0,right:0,bottom:0,left:0},title_position:"top-center"};return Object.keys(this.additionalConfig).forEach((function(e){t[e]=this.additionalConfig[e]}),this),t},t.prototype.additionalConfig={},t.prototype.loadConfig=function(t){var e,i,n,r=this.config;Object.keys(r).forEach((function(a){e=t,i=a.split("_"),n=function t(){var n=i.shift();return n&&e&&"object"==typeof e&&n in e?(e=e[n],t()):n?void 0:e}(),l(n)&&(r[a]=n)}))},t.prototype.convertUrlToData=function(t,e,i,n,r){var a,o,s=this,c=e||"csv";"json"===c?(a=s.d3.json,o=s.convertJsonToData):"tsv"===c?(a=s.d3.tsv,o=s.convertXsvToData):(a=s.d3.csv,o=s.convertXsvToData),a(t,i).then((function(t){r.call(s,o.call(s,t,n))})).catch((function(t){throw t}))},t.prototype.convertXsvToData=function(t){var e=t.columns;return 0===t.length?{keys:e,rows:[e.reduce((function(t,e){var i;return Object.assign(t,((i={})[e]=null,i))}),{})]}:{keys:e,rows:[].concat(t)}},t.prototype.convertJsonToData=function(t,e){var i,n,r=this,a=[];return e?(e.x?(i=e.value.concat(e.x),r.config.data_x=e.x):i=e.value,a.push(i),t.forEach((function(t){var e=[];i.forEach((function(i){var n=r.findValueInJson(t,i);f(n)&&(n=null),e.push(n)})),a.push(e)})),n=r.convertRowsToData(a)):(Object.keys(t).forEach((function(e){a.push([e].concat(t[e]))})),n=r.convertColumnsToData(a)),n},t.prototype.findValueInJson=function(t,e){if(e in t)return t[e];for(var i=(e=(e=e.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split("."),n=0;n<i.length;++n){var r=i[n];if(!(r in t))return;t=t[r]}return t},t.prototype.convertRowsToData=function(t){for(var e=[],i=t[0],n=1;n<t.length;n++){for(var r={},a=0;a<t[n].length;a++){if(f(t[n][a]))throw new Error("Source data is missing a component at ("+n+","+a+")!");r[i[a]]=t[n][a]}e.push(r)}return{keys:i,rows:e}},t.prototype.convertColumnsToData=function(t){for(var e=[],i=[],n=0;n<t.length;n++){for(var r=t[n][0],a=1;a<t[n].length;a++){if(f(e[a-1])&&(e[a-1]={}),f(t[n][a]))throw new Error("Source data is missing a component at ("+n+","+a+")!");e[a-1][r]=t[n][a]}i.push(r)}return{keys:i,rows:e}},t.prototype.convertDataToTargets=function(t,e){var i,n,r,a,o,s=this,c=s.config;if(d(t)?a=Object.keys(t[0]):(a=t.keys,t=t.rows),r=a.filter(s.isX,s),s.isStanfordGraphType()){if(o=a.filter(s.isEpochs,s),n=a.filter(s.isNotXAndNotEpochs,s),1!==r.length||1!==o.length||1!==n.length)throw new Error("You must define the 'x' key name and the 'epochs' for Stanford Diagrams")}else n=a.filter(s.isNotX,s);return n.forEach((function(i){var n=s.getXKey(i);s.isCustomX()||s.isTimeSeries()?r.indexOf(n)>=0?s.data.xs[i]=(e&&s.data.xs[i]?s.data.xs[i]:[]).concat(t.map((function(t){return t[n]})).filter(_).map((function(t,e){return s.generateTargetX(t,i,e)}))):c.data_x?s.data.xs[i]=s.getOtherTargetXs():x(c.data_xs)&&(s.data.xs[i]=s.getXValuesOfXKey(n,s.data.targets)):s.data.xs[i]=t.map((function(t,e){return e}))})),n.forEach((function(t){if(!s.data.xs[t])throw new Error('x is not defined for id = "'+t+'".')})),(i=n.map((function(e,i){var n=c.data_idConverter(e);return{id:n,id_org:e,values:t.map((function(t,r){var a,d,l=t[s.getXKey(e)],u=null===t[e]||isNaN(t[e])?null:+t[e];return s.isCustomX()&&s.isCategorized()&&!f(l)?(0===i&&0===r&&(c.axis_x_categories=[]),-1===(a=c.axis_x_categories.indexOf(l))&&(a=c.axis_x_categories.length,c.axis_x_categories.push(l))):a=s.generateTargetX(l,e,r),(f(t[e])||s.data.xs[e].length<=r)&&(a=void 0),d={x:a,value:u,id:n},s.isStanfordGraphType()&&(d.epochs=t[o]),d})).filter((function(t){return l(t.x)}))}}))).forEach((function(t){var e;c.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)}))),e=0,t.values.forEach((function(t){t.index=e++})),s.data.xs[t.id].sort((function(t,e){return t-e}))})),s.hasNegativeValue=s.hasNegativeValueInTargets(i),s.hasPositiveValue=s.hasPositiveValueInTargets(i),c.data_type&&s.setTargetType(s.mapToIds(i).filter((function(t){return!(t in c.data_types)})),c.data_type),i.forEach((function(t){s.addCache(t.id_org,t)})),i},t.prototype.isEpochs=function(t){var e=this.config;return e.data_epochs&&t===e.data_epochs},t.prototype.isX=function(t){var e,i,n,r=this.config;return r.data_x&&t===r.data_x||x(r.data_xs)&&(e=r.data_xs,i=t,n=!1,Object.keys(e).forEach((function(t){e[t]===i&&(n=!0)})),n)},t.prototype.isNotX=function(t){return!this.isX(t)},t.prototype.isNotXAndNotEpochs=function(t){return!this.isX(t)&&!this.isEpochs(t)},t.prototype.isStackNormalized=function(){return this.config.data_stack_normalize&&this.config.data_groups.length>0},t.prototype.isAxisNormalized=function(t){var e=this;return!!e.isStackNormalized()&&e.data.targets.filter((function(i){return e.axis.getId(i.id)===t})).some((function(t){return e.isTargetNormalized(t.id)}))},t.prototype.isTargetNormalized=function(t){return this.isStackNormalized()&&this.config.data_groups.some((function(e){return e.includes(t)}))},t.prototype.getXKey=function(t){var e=this.config;return e.data_x?e.data_x:x(e.data_xs)?e.data_xs[t]:null},t.prototype.getTotalPerIndex=function(t){var e=this;if(!e.isStackNormalized())return null;var i=e.getFromCache("getTotalPerIndex");if(void 0!==i)return i[t];var n={y:[],y2:[]};return e.data.targets.filter((function(t){return e.isTargetNormalized(t.id)})).filter((function(t){return e.isTargetToShow(t.id)})).forEach((function(t){var i=n[e.axis.getId(t.id)];t.values.forEach((function(t,e){i[e]||(i[e]=0),i[e]+=g(t.value)?t.value:0}))})),e.addToCache("getTotalPerIndex",n),n[t]},t.prototype.getTotalDataSum=function(){var t=this,e=t.getFromCache("getTotalDataSum");if(void 0!==e)return e;var i,n=(i=t.data.targets.filter((function(e){return t.isTargetToShow(e.id)})).map((function(t){return t.values})),Array.isArray(i)?[].concat.apply([],i):[]).map((function(t){return t.value})).reduce((function(t,e){return t+e}),0);return t.addToCache("getTotalDataSum",n),n},t.prototype.getXValuesOfXKey=function(t,e){var i,n=this;return(e&&x(e)?n.mapToIds(e):[]).forEach((function(e){n.getXKey(e)===t&&(i=n.data.xs[e])})),i},t.prototype.getXValue=function(t,e){return t in this.data.xs&&this.data.xs[t]&&_(this.data.xs[t][e])?this.data.xs[t][e]:e},t.prototype.getOtherTargetXs=function(){var t=Object.keys(this.data.xs);return t.length?this.data.xs[t[0]]:null},t.prototype.getOtherTargetX=function(t){var e=this.getOtherTargetXs();return e&&t<e.length?e[t]:null},t.prototype.addXs=function(t){var e=this;Object.keys(t).forEach((function(i){e.config.data_xs[i]=t[i]}))},t.prototype.addName=function(t){var e;return t&&(e=this.config.data_names[t.id],t.name=void 0!==e?e:t.id),t},t.prototype.getValueOnIndex=function(t,e){var i=t.filter((function(t){return t.index===e}));return i.length?i[0]:null},t.prototype.updateTargetX=function(t,e){var i=this;t.forEach((function(t){t.values.forEach((function(n,r){n.x=i.generateTargetX(e[r],t.id,r)})),i.data.xs[t.id]=e}))},t.prototype.updateTargetXs=function(t,e){var i=this;t.forEach((function(t){e[t.id]&&i.updateTargetX([t],e[t.id])}))},t.prototype.generateTargetX=function(t,e,i){var n=this;return n.isTimeSeries()?t?n.parseDate(t):n.parseDate(n.getXValue(e,i)):n.isCustomX()&&!n.isCategorized()?_(t)?+t:n.getXValue(e,i):i},t.prototype.cloneTarget=function(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}}))}},t.prototype.getMaxDataCount=function(){return this.d3.max(this.data.targets,(function(t){return t.values.length}))},t.prototype.mapToIds=function(t){return t.map((function(t){return t.id}))},t.prototype.mapToTargetIds=function(t){return t?[].concat(t):this.mapToIds(this.data.targets)},t.prototype.hasTarget=function(t,e){var i,n=this.mapToIds(t);for(i=0;i<n.length;i++)if(n[i]===e)return!0;return!1},t.prototype.isTargetToShow=function(t){return this.hiddenTargetIds.indexOf(t)<0},t.prototype.isLegendToShow=function(t){return this.hiddenLegendIds.indexOf(t)<0},t.prototype.getTargetsToShow=function(){return this.filterTargetsToShow(this.data.targets)},t.prototype.filterTargetsToShow=function(t){var e=this;return t.filter((function(t){return e.isTargetToShow(t.id)}))},t.prototype.getTargets=function(){return this.data.targets},t.prototype.mapTargetsToUniqueXs=function(t){var e=this.d3.set(this.d3.merge(t.map((function(t){return t.values.map((function(t){return+t.x}))})))).values();return(e=this.isTimeSeries()?e.map((function(t){return new Date(+t)})):e.map((function(t){return+t}))).sort((function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}))},t.prototype.addHiddenTargetIds=function(t){t=t instanceof Array?t:new Array(t);for(var e=0;e<t.length;e++)this.hiddenTargetIds.indexOf(t[e])<0&&(this.hiddenTargetIds=this.hiddenTargetIds.concat(t[e]));this.resetCache()},t.prototype.removeHiddenTargetIds=function(t){this.hiddenTargetIds=this.hiddenTargetIds.filter((function(e){return t.indexOf(e)<0})),this.resetCache()},t.prototype.addHiddenLegendIds=function(t){t=t instanceof Array?t:new Array(t);for(var e=0;e<t.length;e++)this.hiddenLegendIds.indexOf(t[e])<0&&(this.hiddenLegendIds=this.hiddenLegendIds.concat(t[e]))},t.prototype.removeHiddenLegendIds=function(t){this.hiddenLegendIds=this.hiddenLegendIds.filter((function(e){return t.indexOf(e)<0}))},t.prototype.getValuesAsIdKeyed=function(t){var e={};return t.forEach((function(t){e[t.id]=[],t.values.forEach((function(i){e[t.id].push(i.value)}))})),e},t.prototype.checkValueInTargets=function(t,e){var i,n,r,a=Object.keys(t);for(i=0;i<a.length;i++)for(r=t[a[i]].values,n=0;n<r.length;n++)if(e(r[n].value))return!0;return!1},t.prototype.hasNegativeValueInTargets=function(t){return this.checkValueInTargets(t,(function(t){return t<0}))},t.prototype.hasPositiveValueInTargets=function(t){return this.checkValueInTargets(t,(function(t){return t>0}))},t.prototype.isOrderDesc=function(){var t=this.config;return"string"==typeof t.data_order&&"desc"===t.data_order.toLowerCase()},t.prototype.isOrderAsc=function(){var t=this.config;return"string"==typeof t.data_order&&"asc"===t.data_order.toLowerCase()},t.prototype.getOrderFunction=function(){var t=this.config,e=this.isOrderAsc(),i=this.isOrderDesc();if(e||i){var n=function(t,e){return t+Math.abs(e.value)};return function(t,i){var r=t.values.reduce(n,0),a=i.values.reduce(n,0);return e?a-r:r-a}}if(h(t.data_order))return t.data_order;if(d(t.data_order)){var r=t.data_order;return function(t,e){return r.indexOf(t.id)-r.indexOf(e.id)}}},t.prototype.orderTargets=function(t){var e=this.getOrderFunction();return e&&t.sort(e),t},t.prototype.filterByIndex=function(t,e){return this.d3.merge(t.map((function(t){return t.values.filter((function(t){return t.index===e}))})))},t.prototype.filterByX=function(t,e){return this.d3.merge(t.map((function(t){return t.values}))).filter((function(t){return t.x-e==0}))},t.prototype.filterRemoveNull=function(t){return t.filter((function(t){return _(t.value)}))},t.prototype.filterByXDomain=function(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]}))}}))},t.prototype.hasDataLabel=function(){var t=this.config;return!("boolean"!=typeof t.data_labels||!t.data_labels)||!("object"!=typeof t.data_labels||!x(t.data_labels))},t.prototype.getDataLabelLength=function(t,e,i){var n=this,r=[0,0];return n.selectChart.select("svg").selectAll(".dummy").data([t,e]).enter().append("text").text((function(t){return n.dataLabelFormat(t.id)(t)})).each((function(t,e){r[e]=1.3*c(this)[i]})).remove(),r},t.prototype.isNoneArc=function(t){return this.hasTarget(this.data.targets,t.id)},t.prototype.isArc=function(t){return"data"in t&&this.hasTarget(this.data.targets,t.data.id)},t.prototype.findClosestFromTargets=function(t,e){var i=this,n=t.map((function(t){return i.findClosest(t.values,e,i.config.tooltip_horizontal?i.horizontalDistance.bind(i):i.dist.bind(i),i.config.point_sensitivity)})).filter((function(t){return t}));return 0===n.length?void 0:1===n.length?n[0]:i.findClosest(n,e,i.dist.bind(i))},t.prototype.findClosestFromTargetsByX=function(t,e){var i,n;return t.forEach((function(t){t.values.forEach((function(t){var r=Math.abs(e-t.x);(void 0===n||r<n)&&(i=t,n=r)}))})),i},t.prototype.findClosest=function(t,e,i,n){void 0===n&&(n=1/0);var r,a=this;return t.filter((function(t){return t&&a.isBarType(t.id)})).forEach((function(t){if(!r){var i=a.main.select("."+w.bars+a.getTargetSelectorSuffix(t.id)+" ."+w.bar+"-"+t.index).node();a.isWithinBar(e,i)&&(r=t)}})),t.filter((function(t){return t&&!a.isBarType(t.id)})).forEach((function(t){var a=i(t,e);a<n&&(n=a,r=t)})),r},t.prototype.dist=function(t,e){var i=this.config,n=i.axis_rotated?1:0,r=i.axis_rotated?0:1,a=this.circleY(t,t.index),o=this.x(t.x);return Math.sqrt(Math.pow(o-e[n],2)+Math.pow(a-e[r],2))},t.prototype.horizontalDistance=function(t,e){var i=this.config.axis_rotated?1:0,n=this.x(t.x);return Math.abs(n-e[i])},t.prototype.convertValuesToStep=function(t){var e,i=[].concat(t);if(!this.isCategorized())return t;for(e=t.length+1;0<e;e--)i[e]=i[e-1];return i[0]={x:i[0].x-1,value:i[0].value,id:i[0].id},i[t.length+1]={x:i[t.length].x+1,value:i[t.length].value,id:i[t.length].id},i},t.prototype.getRatio=function(t,e,i){void 0===i&&(i=!1);var n=this,r=n.api,a=0;if(e&&r.data.shown.call(r).length)if(a=e.ratio||e.value,"arc"===t)if(n.hasType("gauge"))a=(e.endAngle-e.startAngle)/(Math.PI*(n.config.gauge_fullCircle?2:1));else{var o=n.getTotalDataSum();a=e.value/o}else"index"===t&&(o=n.getTotalPerIndex(n.axis.getId(e.id)),e.ratio=g(e.value)&&o&&o[e.index]>0?e.value/o[e.index]:0,a=e.ratio);return i&&a?100*a:a},t.prototype.updateDataAttributes=function(t,e){var i=this.config["data_"+t];return void 0===e||(Object.keys(e).forEach((function(t){i[t]=e[t]})),this.redraw({withLegend:!0})),i},t.prototype.load=function(t,e){var i=this;t&&(e.filter&&(t=t.filter(e.filter)),(e.type||e.types)&&t.forEach((function(t){var n=e.types&&e.types[t.id]?e.types[t.id]:e.type;i.setTargetType(t.id,n)})),i.data.targets.forEach((function(e){for(var i=0;i<t.length;i++)if(e.id===t[i].id){e.values=t[i].values,t.splice(i,1);break}})),i.data.targets=i.data.targets.concat(t)),i.updateTargets(i.data.targets),i.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),e.done&&e.done()},t.prototype.loadFromArgs=function(t){var e=this;e.resetCache(),t.data?e.load(e.convertDataToTargets(t.data),t):t.url?e.convertUrlToData(t.url,t.mimeType,t.headers,t.keys,(function(i){e.load(e.convertDataToTargets(i),t)})):t.json?e.load(e.convertDataToTargets(e.convertJsonToData(t.json,t.keys)),t):t.rows?e.load(e.convertDataToTargets(e.convertRowsToData(t.rows)),t):t.columns?e.load(e.convertDataToTargets(e.convertColumnsToData(t.columns)),t):e.load(null,t)},t.prototype.unload=function(t,e){var i=this;i.resetCache(),e||(e=function(){}),(t=t.filter((function(t){return i.hasTarget(i.data.targets,t)})))&&0!==t.length?(i.svg.selectAll(t.map((function(t){return i.selectorTarget(t)}))).transition().style("opacity",0).remove().call(i.endall,e),t.forEach((function(t){i.withoutFadeIn[t]=!1,i.legend&&i.legend.selectAll("."+w.legendItem+i.getTargetSelectorSuffix(t)).remove(),i.data.targets=i.data.targets.filter((function(e){return e.id!==t}))}))):e()},t.prototype.getYDomainMin=function(t){var e,i,n,r,a,o,s=this,c=s.config,d=s.mapToIds(t),l=s.getValuesAsIdKeyed(t);if(c.data_groups.length>0)for(o=s.hasNegativeValueInTargets(t),e=0;e<c.data_groups.length;e++)if(0!==(r=c.data_groups[e].filter((function(t){return d.indexOf(t)>=0}))).length)for(n=r[0],o&&l[n]&&l[n].forEach((function(t,e){l[n][e]=t<0?t:0})),i=1;i<r.length;i++)a=r[i],l[a]&&l[a].forEach((function(t,e){s.axis.getId(a)!==s.axis.getId(n)||!l[n]||o&&+t>0||(l[n][e]+=+t)}));return s.d3.min(Object.keys(l).map((function(t){return s.d3.min(l[t])})))},t.prototype.getYDomainMax=function(t){var e,i,n,r,a,o,s=this,c=s.config,d=s.mapToIds(t),l=s.getValuesAsIdKeyed(t);if(c.data_groups.length>0)for(o=s.hasPositiveValueInTargets(t),e=0;e<c.data_groups.length;e++)if(0!==(r=c.data_groups[e].filter((function(t){return d.indexOf(t)>=0}))).length)for(n=r[0],o&&l[n]&&l[n].forEach((function(t,e){l[n][e]=t>0?t:0})),i=1;i<r.length;i++)a=r[i],l[a]&&l[a].forEach((function(t,e){s.axis.getId(a)!==s.axis.getId(n)||!l[n]||o&&+t<0||(l[n][e]+=+t)}));return s.d3.max(Object.keys(l).map((function(t){return s.d3.max(l[t])})))},t.prototype.getYDomain=function(t,e,i){var n=this,r=n.config;if(n.isAxisNormalized(e))return[0,100];var o,s,c,d,l,u,h,g,p,f,y=t.filter((function(t){return n.axis.getId(t.id)===e})),m=i?n.filterByXDomain(y,i):y,S="y2"===e?r.axis_y2_min:r.axis_y_min,w="y2"===e?r.axis_y2_max:r.axis_y_max,v=n.getYDomainMin(m),b=n.getYDomainMax(m),T="y2"===e?r.axis_y2_center:r.axis_y_center,A=n.hasType("bar",m)&&r.bar_zerobased||n.hasType("area",m)&&r.area_zerobased,P="y2"===e?r.axis_y2_inverted:r.axis_y_inverted,C=n.hasDataLabel()&&r.axis_rotated,L=n.hasDataLabel()&&!r.axis_rotated;if(v=_(S)?S:_(w)?v<w?v:w-10:v,b=_(w)?w:_(S)?S<b?b:S+10:b,0===m.length)return"y2"===e?n.y2.domain():n.y.domain();if(isNaN(v)&&(v=0),isNaN(b)&&(b=v),v===b&&(v<0?b=0:v=0),p=v>=0&&b>=0,f=v<=0&&b<=0,(_(S)&&p||_(w)&&f)&&(A=!1),A&&(p&&(v=0),f&&(b=0)),c=d=.1*(s=Math.abs(b-v)),void 0!==T&&(b=T+(l=Math.max(Math.abs(v),Math.abs(b))),v=T-l),C)u=n.getDataLabelLength(v,b,"width"),h=a(n.y.range()),c+=s*((g=[u[0]/h,u[1]/h])[1]/(1-g[0]-g[1])),d+=s*(g[0]/(1-g[0]-g[1]));else if(L){u=n.getDataLabelLength(v,b,"height");var V=n.getY(r["axis_"+e+"_type"],[0,r.axis_rotated?n.width:n.height],[0,s]);c+=V(u[1]),d+=V(u[0])}return"y"===e&&x(r.axis_y_padding)&&(c=n.axis.getPadding(r.axis_y_padding,"top",c,s),d=n.axis.getPadding(r.axis_y_padding,"bottom",d,s)),"y2"===e&&x(r.axis_y2_padding)&&(c=n.axis.getPadding(r.axis_y2_padding,"top",c,s),d=n.axis.getPadding(r.axis_y2_padding,"bottom",d,s)),A&&(p&&(d=v),f&&(c=-b)),o=[v-d,b+c],P?o.reverse():o},t.prototype.getXDomainMin=function(t){var e=this,i=e.config;return l(i.axis_x_min)?e.isTimeSeries()?this.parseDate(i.axis_x_min):i.axis_x_min:e.d3.min(t,(function(t){return e.d3.min(t.values,(function(t){return t.x}))}))},t.prototype.getXDomainMax=function(t){var e=this,i=e.config;return l(i.axis_x_max)?e.isTimeSeries()?this.parseDate(i.axis_x_max):i.axis_x_max:e.d3.max(t,(function(t){return e.d3.max(t.values,(function(t){return t.x}))}))},t.prototype.getXDomainPadding=function(t){var e,i,n,r,a=this.config,o=t[1]-t[0];return i=this.isCategorized()?0:this.hasType("bar")?(e=this.getMaxDataCount())>1?o/(e-1)/2:.5:.01*o,"object"==typeof a.axis_x_padding&&x(a.axis_x_padding)?(n=_(a.axis_x_padding.left)?a.axis_x_padding.left:i,r=_(a.axis_x_padding.right)?a.axis_x_padding.right:i):n=r="number"==typeof a.axis_x_padding?a.axis_x_padding:i,{left:n,right:r}},t.prototype.getXDomain=function(t){var e=this,i=[e.getXDomainMin(t),e.getXDomainMax(t)],n=i[0],r=i[1],a=e.getXDomainPadding(i),o=0,s=0;return n-r!=0||e.isCategorized()||(e.isTimeSeries()?(n=new Date(.5*n.getTime()),r=new Date(1.5*r.getTime())):(n=0===n?1:.5*n,r=0===r?-1:1.5*r)),(n||0===n)&&(o=e.isTimeSeries()?new Date(n.getTime()-a.left):n-a.left),(r||0===r)&&(s=e.isTimeSeries()?new Date(r.getTime()+a.right):r+a.right),[o,s]},t.prototype.updateXDomain=function(t,e,i,n,r){var a=this,o=a.config;return i&&(a.x.domain(r||a.d3.extent(a.getXDomain(t))),a.orgXDomain=a.x.domain(),o.zoom_enabled&&a.zoom.update(),a.subX.domain(a.x.domain()),a.brush&&a.brush.updateScale(a.subX)),e&&a.x.domain(r||(!a.brush||a.brush.empty()?a.orgXDomain:a.brush.selectionAsValue())),n&&a.x.domain(a.trimXDomain(a.x.orgDomain())),a.x.domain()},t.prototype.trimXDomain=function(t){var e=this.getZoomDomain(),i=e[0],n=e[1];return t[0]<=i&&(t[1]=+t[1]+(i-t[0]),t[0]=i),n<=t[1]&&(t[0]=+t[0]-(t[1]-n),t[1]=n),t},t.prototype.drag=function(t){var e,i,n,r,a,o,c,d,l=this,u=l.config,h=l.main,g=l.d3;l.hasArcType()||u.data_selection_enabled&&u.data_selection_multiple&&(e=l.dragStart[0],i=l.dragStart[1],n=t[0],r=t[1],a=Math.min(e,n),o=Math.max(e,n),c=u.data_selection_grouped?l.margin.top:Math.min(i,r),d=u.data_selection_grouped?l.height:Math.max(i,r),h.select("."+w.dragarea).attr("x",a).attr("y",c).attr("width",o-a).attr("height",d-c),h.selectAll("."+w.shapes).selectAll("."+w.shape).each((function(t,e){if(u.data_selection_isselectable(t)){var i,n,r,h,p,f,_=g.select(this),x=_.classed(w.SELECTED),y=_.classed(w.INCLUDED),m=!1;if(_.classed(w.circle))i=1*_.attr("cx"),n=1*_.attr("cy"),p=l.togglePoint,m=a<i&&i<o&&c<n&&n<d;else{if(!_.classed(w.bar))return;i=(f=s(this)).x,n=f.y,r=f.width,h=f.height,p=l.togglePath,m=!(o<i||i+r<a||d<n||n+h<c)}m^y&&(_.classed(w.INCLUDED,!y),_.classed(w.SELECTED,!x),p.call(l,!x,_,t,e))}})))},t.prototype.dragstart=function(t){var e=this,i=e.config;e.hasArcType()||i.data_selection_enabled&&(e.dragStart=t,e.main.select("."+w.chart).append("rect").attr("class",w.dragarea).style("opacity",.1),e.dragging=!0)},t.prototype.dragend=function(){var t=this,e=t.config;t.hasArcType()||e.data_selection_enabled&&(t.main.select("."+w.dragarea).transition().duration(100).style("opacity",0).remove(),t.main.selectAll("."+w.shape).classed(w.INCLUDED,!1),t.dragging=!1)},t.prototype.getYFormat=function(t){var e=this,i=t&&!e.hasType("gauge")?e.defaultArcValueFormat:e.yFormat,n=t&&!e.hasType("gauge")?e.defaultArcValueFormat:e.y2Format;return function(t,r,a){return("y2"===e.axis.getId(a)?n:i).call(e,t,r)}},t.prototype.yFormat=function(t){var e=this.config;return(e.axis_y_tick_format?e.axis_y_tick_format:this.defaultValueFormat)(t)},t.prototype.y2Format=function(t){var e=this.config;return(e.axis_y2_tick_format?e.axis_y2_tick_format:this.defaultValueFormat)(t)},t.prototype.defaultValueFormat=function(t){return _(t)?+t:""},t.prototype.defaultArcValueFormat=function(t,e){return(100*e).toFixed(1)+"%"},t.prototype.dataLabelFormat=function(t){var e=this.config.data_labels,i=function(t){return _(t)?+t:""};return"function"==typeof e.format?e.format:"object"==typeof e.format?e.format[t]?!0===e.format[t]?i:e.format[t]:function(){return""}:i},t.prototype.initGrid=function(){var t=this,e=t.config,i=t.d3;t.grid=t.main.append("g").attr("clip-path",t.clipPathForGrid).attr("class",w.grid),e.grid_x_show&&t.grid.append("g").attr("class",w.xgrids),e.grid_y_show&&t.grid.append("g").attr("class",w.ygrids),e.grid_focus_show&&t.grid.append("g").attr("class",w.xgridFocus).append("line").attr("class",w.xgridFocus),t.xgrid=i.selectAll([]),e.grid_lines_front||t.initGridLines()},t.prototype.initGridLines=function(){var t=this,e=t.d3;t.gridLines=t.main.append("g").attr("clip-path",t.clipPathForGrid).attr("class",w.grid+" "+w.gridLines),t.gridLines.append("g").attr("class",w.xgridLines),t.gridLines.append("g").attr("class",w.ygridLines),t.xgridLines=e.selectAll([])},t.prototype.updateXGrid=function(t){var e=this,i=e.config,n=e.d3,r=e.generateGridData(i.grid_x_type,e.x),a=e.isCategorized()?e.xAxis.tickOffset():0;e.xgridAttr=i.axis_rotated?{x1:0,x2:e.width,y1:function(t){return e.x(t)-a},y2:function(t){return e.x(t)-a}}:{x1:function(t){return e.x(t)+a},x2:function(t){return e.x(t)+a},y1:0,y2:e.height},e.xgridAttr.opacity=function(){return+n.select(this).attr(i.axis_rotated?"y1":"x1")===(i.axis_rotated?e.height:0)?0:1};var o=e.main.select("."+w.xgrids).selectAll("."+w.xgrid).data(r),s=o.enter().append("line").attr("class",w.xgrid).attr("x1",e.xgridAttr.x1).attr("x2",e.xgridAttr.x2).attr("y1",e.xgridAttr.y1).attr("y2",e.xgridAttr.y2).style("opacity",0);e.xgrid=s.merge(o),t||e.xgrid.attr("x1",e.xgridAttr.x1).attr("x2",e.xgridAttr.x2).attr("y1",e.xgridAttr.y1).attr("y2",e.xgridAttr.y2).style("opacity",e.xgridAttr.opacity),o.exit().remove()},t.prototype.updateYGrid=function(){var t=this,e=t.config,i=t.yAxis.tickValues()||t.y.ticks(e.grid_y_ticks),n=t.main.select("."+w.ygrids).selectAll("."+w.ygrid).data(i),r=n.enter().append("line").attr("class",w.ygrid);t.ygrid=r.merge(n),t.ygrid.attr("x1",e.axis_rotated?t.y:0).attr("x2",e.axis_rotated?t.y:t.width).attr("y1",e.axis_rotated?0:t.y).attr("y2",e.axis_rotated?t.height:t.y),n.exit().remove(),t.smoothLines(t.ygrid,"grid")},t.prototype.gridTextAnchor=function(t){return t.position?t.position:"end"},t.prototype.gridTextDx=function(t){return"start"===t.position?4:"middle"===t.position?0:-4},t.prototype.xGridTextX=function(t){return"start"===t.position?-this.height:"middle"===t.position?-this.height/2:0},t.prototype.yGridTextX=function(t){return"start"===t.position?0:"middle"===t.position?this.width/2:this.width},t.prototype.updateGrid=function(t){var e,i,n,r,a=this,o=a.main,s=a.config,c=a.xv.bind(a),d=a.yv.bind(a),l=a.xGridTextX.bind(a),u=a.yGridTextX.bind(a);a.grid.style("visibility",a.hasArcType()?"hidden":"visible"),o.select("line."+w.xgridFocus).style("visibility","hidden"),s.grid_x_show&&a.updateXGrid(),(i=(e=o.select("."+w.xgridLines).selectAll("."+w.xgridLine).data(s.grid_x_lines)).enter().append("g").attr("class",(function(t){return w.xgridLine+(t.class?" "+t.class:"")}))).append("line").attr("x1",s.axis_rotated?0:c).attr("x2",s.axis_rotated?a.width:c).attr("y1",s.axis_rotated?c:0).attr("y2",s.axis_rotated?c:a.height).style("opacity",0),i.append("text").attr("text-anchor",a.gridTextAnchor).attr("transform",s.axis_rotated?"":"rotate(-90)").attr("x",s.axis_rotated?u:l).attr("y",c).attr("dx",a.gridTextDx).attr("dy",-5).style("opacity",0),a.xgridLines=i.merge(e),e.exit().transition().duration(t).style("opacity",0).remove(),s.grid_y_show&&a.updateYGrid(),(r=(n=o.select("."+w.ygridLines).selectAll("."+w.ygridLine).data(s.grid_y_lines)).enter().append("g").attr("class",(function(t){return w.ygridLine+(t.class?" "+t.class:"")}))).append("line").attr("x1",s.axis_rotated?d:0).attr("x2",s.axis_rotated?d:a.width).attr("y1",s.axis_rotated?0:d).attr("y2",s.axis_rotated?a.height:d).style("opacity",0),r.append("text").attr("text-anchor",a.gridTextAnchor).attr("transform",s.axis_rotated?"rotate(-90)":"").attr("x",s.axis_rotated?l:u).attr("y",d).attr("dx",a.gridTextDx).attr("dy",-5).style("opacity",0),a.ygridLines=r.merge(n),a.ygridLines.select("line").transition().duration(t).attr("x1",s.axis_rotated?d:0).attr("x2",s.axis_rotated?d:a.width).attr("y1",s.axis_rotated?0:d).attr("y2",s.axis_rotated?a.height:d).style("opacity",1),a.ygridLines.select("text").transition().duration(t).attr("x",s.axis_rotated?a.xGridTextX.bind(a):a.yGridTextX.bind(a)).attr("y",d).text((function(t){return t.text})).style("opacity",1),n.exit().transition().duration(t).style("opacity",0).remove()},t.prototype.redrawGrid=function(t,e){var i=this,n=i.config,r=i.xv.bind(i),a=i.xgridLines.select("line"),o=i.xgridLines.select("text");return[(t?a.transition(e):a).attr("x1",n.axis_rotated?0:r).attr("x2",n.axis_rotated?i.width:r).attr("y1",n.axis_rotated?r:0).attr("y2",n.axis_rotated?r:i.height).style("opacity",1),(t?o.transition(e):o).attr("x",n.axis_rotated?i.yGridTextX.bind(i):i.xGridTextX.bind(i)).attr("y",r).text((function(t){return t.text})).style("opacity",1)]},t.prototype.showXGridFocus=function(t){var e=this,i=e.config,n=t.filter((function(t){return t&&_(t.value)})),r=e.main.selectAll("line."+w.xgridFocus),a=e.xx.bind(e);i.tooltip_show&&(e.hasType("stanford")||e.hasArcType()||(r.style("visibility","visible").data([n[0]]).attr(i.axis_rotated?"y1":"x1",a).attr(i.axis_rotated?"y2":"x2",a),e.smoothLines(r,"grid")))},t.prototype.hideXGridFocus=function(){this.main.select("line."+w.xgridFocus).style("visibility","hidden")},t.prototype.updateXgridFocus=function(){var t=this.config;this.main.select("line."+w.xgridFocus).attr("x1",t.axis_rotated?0:-10).attr("x2",t.axis_rotated?this.width:-10).attr("y1",t.axis_rotated?-10:0).attr("y2",t.axis_rotated?-10:this.height)},t.prototype.generateGridData=function(t,e){var i,n,r,a,o=[],s=this.main.select("."+w.axisX).selectAll(".tick").size();if("year"===t)for(n=(i=this.getXDomain())[0].getFullYear(),r=i[1].getFullYear(),a=n;a<=r;a++)o.push(new Date(a+"-01-01 00:00:00"));else(o=e.ticks(10)).length>s&&(o=o.filter((function(t){return(""+t).indexOf(".")<0})));return o},t.prototype.getGridFilterToRemove=function(t){return t?function(e){var i=!1;return[].concat(t).forEach((function(t){("value"in t&&e.value===t.value||"class"in t&&e.class===t.class)&&(i=!0)})),i}:function(){return!0}},t.prototype.removeGridLines=function(t,e){var i=this.config,n=this.getGridFilterToRemove(t),r=function(t){return!n(t)},a=e?w.xgridLines:w.ygridLines,o=e?w.xgridLine:w.ygridLine;this.main.select("."+a).selectAll("."+o).filter(n).transition().duration(i.transition_duration).style("opacity",0).remove(),e?i.grid_x_lines=i.grid_x_lines.filter(r):i.grid_y_lines=i.grid_y_lines.filter(r)},t.prototype.initEventRect=function(){var t=this,e=t.config;t.main.select("."+w.chart).append("g").attr("class",w.eventRects).style("fill-opacity",0),t.eventRect=t.main.select("."+w.eventRects).append("rect").attr("class",w.eventRect),e.zoom_enabled&&t.zoom&&(t.eventRect.call(t.zoom).on("dblclick.zoom",null),e.zoom_initialRange&&t.eventRect.transition().duration(0).call(t.zoom.transform,t.zoomTransform(e.zoom_initialRange)))},t.prototype.redrawEventRect=function(){var t=this,e=t.d3,i=t.config;function n(){t.svg.select("."+w.eventRect).style("cursor",null),t.hideXGridFocus(),t.hideTooltip(),t.unexpandCircles(),t.unexpandBars()}var r=function(e,n){return n&&(t.isBarType(n.id)||t.dist(n,e)<i.point_sensitivity)},a=function(e){return e?t.addName(Object.assign({},e)):null};t.main.select("."+w.eventRects).style("cursor",i.zoom_enabled?i.axis_rotated?"ns-resize":"ew-resize":null),t.eventRect.attr("x",0).attr("y",0).attr("width",t.width).attr("height",t.height).on("mouseout",i.interaction_enabled?function(){i&&(t.hasArcType()||(t.mouseover&&(i.data_onmouseout.call(t.api,t.mouseover),t.mouseover=void 0),n()))}:null).on("mousemove",i.interaction_enabled?function(){if(!t.dragging){var o=t.getTargetsToShow();if(!t.hasArcType(o)){var s,c=e.mouse(this),d=a(t.findClosestFromTargets(o,c)),l=r(c,d);if(!t.mouseover||d&&d.id===t.mouseover.id&&d.index===t.mouseover.index||(i.data_onmouseout.call(t.api,t.mouseover),t.mouseover=void 0),d&&!t.mouseover&&(i.data_onmouseover.call(t.api,d),t.mouseover=d),t.svg.select("."+w.eventRect).style("cursor",l?"pointer":null),!i.tooltip_grouped||t.hasType("stanford",o))d&&(s=[d]);else{var u=void 0;if(d)u=d;else{var h=i.axis_rotated?c[1]:c[0];u=t.findClosestFromTargetsByX(o,t.x.invert(h))}u&&(s=t.filterByX(o,u.x))}if(!s||0===s.length)return n();s=s.map(a),t.showTooltip(s,this),i.point_focus_expand_enabled&&(t.unexpandCircles(),s.forEach((function(e){t.expandCircles(e.index,e.id,!1)}))),t.unexpandBars(),s.forEach((function(e){t.expandBars(e.index,e.id,!1)})),t.showXGridFocus(s)}}}:null).on("click",i.interaction_enabled?function(){var n=t.getTargetsToShow();if(!t.hasArcType(n)){var o=e.mouse(this),s=a(t.findClosestFromTargets(n,o));if(r(o,s)&&((!i.data_selection_grouped||t.isStanfordType(s)?[s]:t.filterByX(n,s.x)).forEach((function(e){t.main.selectAll("."+w.shapes+t.getTargetSelectorSuffix(e.id)).selectAll("."+w.shape+"-"+e.index).each((function(){(i.data_selection_grouped||t.isWithinShape(this,e))&&t.toggleShape(this,e,e.index)}))})),s)){var c=t.main.selectAll("."+w.shapes+t.getTargetSelectorSuffix(s.id)).select("."+w.shape+"-"+s.index);i.data_onclick.call(t.api,s,c.node())}}}:null).call(i.interaction_enabled&&i.data_selection_draggable&&t.drag?e.drag().on("drag",(function(){t.drag(e.mouse(this))})).on("start",(function(){t.dragstart(e.mouse(this))})).on("end",(function(){t.dragend()})):function(){})},t.prototype.getMousePosition=function(t){return[this.x(t.x),this.getYScale(t.id)(t.value)]},t.prototype.dispatchEvent=function(t,e){var i="."+w.eventRect,n=this.main.select(i).node(),r=n.getBoundingClientRect(),a=r.left+(e?e[0]:0),o=r.top+(e?e[1]:0),s=document.createEvent("MouseEvents");s.initMouseEvent(t,!0,!0,window,0,a,o,a,o,!1,!1,!1,!1,0,null),n.dispatchEvent(s)},t.prototype.initLegend=function(){var t=this;if(t.legendItemTextBox={},t.legendHasRendered=!1,t.legend=t.svg.append("g").attr("transform",t.getTranslate("legend")),!t.config.legend_show)return t.legend.style("visibility","hidden"),void(t.hiddenLegendIds=t.mapToIds(t.data.targets));t.updateLegendWithDefaults()},t.prototype.updateLegendWithDefaults=function(){this.updateLegend(this.mapToIds(this.data.targets),{withTransform:!1,withTransitionForTransform:!1,withTransition:!1})},t.prototype.updateSizeForLegend=function(t,e){var i=this,n=i.config,r={top:i.isLegendTop?i.getCurrentPaddingTop()+n.legend_inset_y+5.5:i.currentHeight-t-i.getCurrentPaddingBottom()-n.legend_inset_y,left:i.isLegendLeft?i.getCurrentPaddingLeft()+n.legend_inset_x+.5:i.currentWidth-e-i.getCurrentPaddingRight()-n.legend_inset_x+.5};i.margin3={top:i.isLegendRight?0:i.isLegendInset?r.top:i.currentHeight-t,right:NaN,bottom:0,left:i.isLegendRight?i.currentWidth-e:i.isLegendInset?r.left:0}},t.prototype.transformLegend=function(t){(t?this.legend.transition():this.legend).attr("transform",this.getTranslate("legend"))},t.prototype.updateLegendStep=function(t){this.legendStep=t},t.prototype.updateLegendItemWidth=function(t){this.legendItemWidth=t},t.prototype.updateLegendItemHeight=function(t){this.legendItemHeight=t},t.prototype.getLegendWidth=function(){var t=this;return t.config.legend_show?t.isLegendRight||t.isLegendInset?t.legendItemWidth*(t.legendStep+1):t.currentWidth:0},t.prototype.getLegendHeight=function(){var t=this,e=0;return t.config.legend_show&&(e=t.isLegendRight?t.currentHeight:Math.max(20,t.legendItemHeight)*(t.legendStep+1)),e},t.prototype.opacityForLegend=function(t){return t.classed(w.legendItemHidden)?null:1},t.prototype.opacityForUnfocusedLegend=function(t){return t.classed(w.legendItemHidden)?null:.3},t.prototype.toggleFocusLegend=function(t,e){var i=this;t=i.mapToTargetIds(t),i.legend.selectAll("."+w.legendItem).filter((function(e){return t.indexOf(e)>=0})).classed(w.legendItemFocused,e).transition().duration(100).style("opacity",(function(){return(e?i.opacityForLegend:i.opacityForUnfocusedLegend).call(i,i.d3.select(this))}))},t.prototype.revertLegend=function(){var t=this,e=t.d3;t.legend.selectAll("."+w.legendItem).classed(w.legendItemFocused,!1).transition().duration(100).style("opacity",(function(){return t.opacityForLegend(e.select(this))}))},t.prototype.showLegend=function(t){var e=this,i=e.config;i.legend_show||(i.legend_show=!0,e.legend.style("visibility","visible"),e.legendHasRendered||e.updateLegendWithDefaults()),e.removeHiddenLegendIds(t),e.legend.selectAll(e.selectorLegends(t)).style("visibility","visible").transition().style("opacity",(function(){return e.opacityForLegend(e.d3.select(this))}))},t.prototype.hideLegend=function(t){var e=this,i=e.config;i.legend_show&&u(t)&&(i.legend_show=!1,e.legend.style("visibility","hidden")),e.addHiddenLegendIds(t),e.legend.selectAll(e.selectorLegends(t)).style("opacity",0).style("visibility","hidden")},t.prototype.clearLegendItemTextBoxCache=function(){this.legendItemTextBox={}},t.prototype.updateLegend=function(t,e,i){var n,r,a,s,c,d,u,h,g,p,f,_,x,y,m,S,v=this,b=v.config,T=0,A=0,P=b.legend_item_tile_width+5,C=0,L={},V={},G={},E=[0],O={},I=0;function R(e,i,n){var r,a,o=0===n,s=n===t.length-1,c=function(t,e){return v.legendItemTextBox[e]||(v.legendItemTextBox[e]=v.getTextRect(t.textContent,w.legendItem,t)),v.legendItemTextBox[e]}(e,i),d=c.width+P+(!s||v.isLegendRight||v.isLegendInset?10:0)+b.legend_padding,l=c.height+4,u=v.isLegendRight||v.isLegendInset?l:d,h=v.isLegendRight||v.isLegendInset?v.getLegendHeight():v.getLegendWidth();function g(t,e){e||(r=(h-C-u)/2)<10&&(r=(h-u)/2,C=0,I++),O[t]=I,E[I]=v.isLegendInset?10:r,L[t]=C,C+=u}o&&(C=0,I=0,T=0,A=0),!b.legend_show||v.isLegendToShow(i)?(V[i]=d,G[i]=l,(!T||d>=T)&&(T=d),(!A||l>=A)&&(A=l),a=v.isLegendRight||v.isLegendInset?A:T,b.legend_equally?(Object.keys(V).forEach((function(t){V[t]=T})),Object.keys(G).forEach((function(t){G[t]=A})),(r=(h-a*t.length)/2)<10?(C=0,I=0,t.forEach((function(t){g(t)}))):g(i,!0)):g(i)):V[i]=G[i]=O[i]=L[i]=0}t=t.filter((function(t){return!l(b.data_names[t])||null!==b.data_names[t]})),f=o(e=e||{},"withTransition",!0),_=o(e,"withTransitionForTransform",!0),v.isLegendInset&&(I=b.legend_inset_step?b.legend_inset_step:t.length,v.updateLegendStep(I)),v.isLegendRight?(n=function(t){return T*O[t]},s=function(t){return E[O[t]]+L[t]}):v.isLegendInset?(n=function(t){return T*O[t]+10},s=function(t){return E[O[t]]+L[t]}):(n=function(t){return E[O[t]]+L[t]},s=function(t){return A*O[t]}),r=function(t,e){return n(t,e)+4+b.legend_item_tile_width},c=function(t,e){return s(t,e)+9},a=function(t,e){return n(t,e)},d=function(t,e){return s(t,e)-5},u=function(t,e){return n(t,e)-2},h=function(t,e){return n(t,e)-2+b.legend_item_tile_width},g=function(t,e){return s(t,e)+4},(p=v.legend.selectAll("."+w.legendItem).data(t).enter().append("g").attr("class",(function(t){return v.generateClass(w.legendItem,t)})).style("visibility",(function(t){return v.isLegendToShow(t)?"visible":"hidden"})).style("cursor",(function(){return b.interaction_enabled?"pointer":"auto"})).on("click",b.interaction_enabled?function(t){b.legend_item_onclick?b.legend_item_onclick.call(v,t):v.d3.event.altKey?(v.api.hide(),v.api.show(t)):(v.api.toggle(t),v.isTargetToShow(t)?v.api.focus(t):v.api.revert())}:null).on("mouseover",b.interaction_enabled?function(t){b.legend_item_onmouseover?b.legend_item_onmouseover.call(v,t):(v.d3.select(this).classed(w.legendItemFocused,!0),!v.transiting&&v.isTargetToShow(t)&&v.api.focus(t))}:null).on("mouseout",b.interaction_enabled?function(t){b.legend_item_onmouseout?b.legend_item_onmouseout.call(v,t):(v.d3.select(this).classed(w.legendItemFocused,!1),v.api.revert())}:null)).append("text").text((function(t){return l(b.data_names[t])?b.data_names[t]:t})).each((function(t,e){R(this,t,e)})).style("pointer-events","none").attr("x",v.isLegendRight||v.isLegendInset?r:-200).attr("y",v.isLegendRight||v.isLegendInset?-200:c),p.append("rect").attr("class",w.legendItemEvent).style("fill-opacity",0).attr("x",v.isLegendRight||v.isLegendInset?a:-200).attr("y",v.isLegendRight||v.isLegendInset?-200:d),p.append("line").attr("class",w.legendItemTile).style("stroke",v.color).style("pointer-events","none").attr("x1",v.isLegendRight||v.isLegendInset?u:-200).attr("y1",v.isLegendRight||v.isLegendInset?-200:g).attr("x2",v.isLegendRight||v.isLegendInset?h:-200).attr("y2",v.isLegendRight||v.isLegendInset?-200:g).attr("stroke-width",b.legend_item_tile_height),S=v.legend.select("."+w.legendBackground+" rect"),v.isLegendInset&&T>0&&0===S.size()&&(S=v.legend.insert("g","."+w.legendItem).attr("class",w.legendBackground).append("rect")),x=v.legend.selectAll("text").data(t).text((function(t){return l(b.data_names[t])?b.data_names[t]:t})).each((function(t,e){R(this,t,e)})),(f?x.transition():x).attr("x",r).attr("y",c),y=v.legend.selectAll("rect."+w.legendItemEvent).data(t),(f?y.transition():y).attr("width",(function(t){return V[t]})).attr("height",(function(t){return G[t]})).attr("x",a).attr("y",d),m=v.legend.selectAll("line."+w.legendItemTile).data(t),(f?m.transition():m).style("stroke",v.levelColor?function(t){return v.levelColor(v.cache[t].values.reduce((function(t,e){return t+e.value}),0))}:v.color).attr("x1",u).attr("y1",g).attr("x2",h).attr("y2",g),S&&(f?S.transition():S).attr("height",v.getLegendHeight()-12).attr("width",T*(I+1)+10),v.legend.selectAll("."+w.legendItem).classed(w.legendItemHidden,(function(t){return!v.isTargetToShow(t)})),v.updateLegendItemWidth(T),v.updateLegendItemHeight(A),v.updateLegendStep(I),v.updateSizes(),v.updateScales(),v.updateSvgSize(),v.transformAll(_,i),v.legendHasRendered=!0},t.prototype.initRegion=function(){this.region=this.main.append("g").attr("clip-path",this.clipPath).attr("class",w.regions)},t.prototype.updateRegion=function(t){var e=this,i=e.config;e.region.style("visibility",e.hasArcType()?"hidden":"visible");var n=e.main.select("."+w.regions).selectAll("."+w.region).data(i.regions),r=n.enter().append("g");r.append("rect").attr("x",e.regionX.bind(e)).attr("y",e.regionY.bind(e)).attr("width",e.regionWidth.bind(e)).attr("height",e.regionHeight.bind(e)).style("fill-opacity",(function(t){return _(t.opacity)?t.opacity:.1})),r.append("text").text(e.labelRegion.bind(e)),e.mainRegion=r.merge(n).attr("class",e.classRegion.bind(e)),n.exit().transition().duration(t).style("opacity",0).remove()},t.prototype.redrawRegion=function(t,e){var i=this,n=i.mainRegion,r=i.mainRegion.selectAll("text");return[(t?n.transition(e):n).attr("x",i.regionX.bind(i)).attr("y",i.regionY.bind(i)).attr("width",i.regionWidth.bind(i)).attr("height",i.regionHeight.bind(i)).style("fill-opacity",(function(t){return _(t.opacity)?t.opacity:.1})),(t?r.transition(e):r).attr("x",i.labelOffsetX.bind(i)).attr("y",i.labelOffsetY.bind(i)).attr("transform",i.labelTransform.bind(i)).attr("style","text-anchor: left;")]},t.prototype.regionX=function(t){var e=this,i=e.config,n="y"===t.axis?e.y:e.y2;return"y"===t.axis||"y2"===t.axis?i.axis_rotated&&"start"in t?n(t.start):0:i.axis_rotated?0:"start"in t?e.x(e.isTimeSeries()?e.parseDate(t.start):t.start):0},t.prototype.regionY=function(t){var e=this,i=e.config,n="y"===t.axis?e.y:e.y2;return"y"===t.axis||"y2"===t.axis?i.axis_rotated?0:"end"in t?n(t.end):0:i.axis_rotated&&"start"in t?e.x(e.isTimeSeries()?e.parseDate(t.start):t.start):0},t.prototype.regionWidth=function(t){var e,i=this,n=i.config,r=i.regionX(t),a="y"===t.axis?i.y:i.y2;return(e="y"===t.axis||"y2"===t.axis?n.axis_rotated&&"end"in t?a(t.end):i.width:n.axis_rotated?i.width:"end"in t?i.x(i.isTimeSeries()?i.parseDate(t.end):t.end):i.width)<r?0:e-r},t.prototype.regionHeight=function(t){var e,i=this,n=i.config,r=this.regionY(t),a="y"===t.axis?i.y:i.y2;return(e="y"===t.axis||"y2"===t.axis?n.axis_rotated?i.height:"start"in t?a(t.start):i.height:n.axis_rotated&&"end"in t?i.x(i.isTimeSeries()?i.parseDate(t.end):t.end):i.height)<r?0:e-r},t.prototype.isRegionOnX=function(t){return!t.axis||"x"===t.axis},t.prototype.labelRegion=function(t){return"label"in t?t.label:""},t.prototype.labelTransform=function(t){return"vertical"in t&&t.vertical?"rotate(90)":""},t.prototype.labelOffsetX=function(t){var e="paddingX"in t?t.paddingX:3,i="paddingY"in t?t.paddingY:3;return"vertical"in t&&t.vertical?this.regionY(t)+i:this.regionX(t)+e},t.prototype.labelOffsetY=function(t){var e="paddingX"in t?t.paddingX:3,i="paddingY"in t?t.paddingY:3;return"vertical"in t&&t.vertical?-(this.regionX(t)+e):this.regionY(t)+10+i},t.prototype.getScale=function(t,e,i){return(i?this.d3.scaleTime():this.d3.scaleLinear()).range([t,e])},t.prototype.getX=function(t,e,i,n){var r,a=this.getScale(t,e,this.isTimeSeries()),o=i?a.domain(i):a;for(r in this.isCategorized()?(n=n||function(){return 0},a=function(t,e){var i=o(t)+n(t);return e?i:Math.ceil(i)}):a=function(t,e){var i=o(t);return e?i:Math.ceil(i)},o)a[r]=o[r];return a.orgDomain=function(){return o.domain()},this.isCategorized()&&(a.domain=function(t){return arguments.length?(o.domain(t),a):[(t=this.orgDomain())[0],t[1]+1]}),a},t.prototype.getY=function(t,e,i){var n;if("timeseries"===t||"time"===t)n=this.d3.scaleTime();else if("log"===t)n=A(this.d3);else{if("linear"!==t&&void 0!==t)throw new Error('Invalid Y axis type: "'+t+'"');n=this.d3.scaleLinear()}return e&&n.domain(e),i&&n.range(i),n},t.prototype.getYScale=function(t){return"y2"===this.axis.getId(t)?this.y2:this.y},t.prototype.getSubYScale=function(t){return"y2"===this.axis.getId(t)?this.subY2:this.subY},t.prototype.updateScales=function(){var t=this,e=t.config,i=!t.x;t.xMin=e.axis_rotated?1:0,t.xMax=e.axis_rotated?t.height:t.width,t.yMin=e.axis_rotated?0:t.height,t.yMax=e.axis_rotated?t.width:1,t.subXMin=t.xMin,t.subXMax=t.xMax,t.subYMin=e.axis_rotated?0:t.height2,t.subYMax=e.axis_rotated?t.width2:1,t.x=t.getX(t.xMin,t.xMax,i?void 0:t.x.orgDomain(),(function(){return t.xAxis.tickOffset()})),t.y=t.getY(e.axis_y_type,i?e.axis_y_default:t.y.domain(),[t.yMin,t.yMax]),t.y2=t.getY(e.axis_y2_type,i?e.axis_y2_default:t.y2.domain(),[t.yMin,t.yMax]),t.subX=t.getX(t.xMin,t.xMax,t.orgXDomain,(function(e){return e%1?0:t.subXAxis.tickOffset()})),t.subY=t.getY(e.axis_y_type,i?e.axis_y_default:t.subY.domain(),[t.subYMin,t.subYMax]),t.subY2=t.getY(e.axis_y2_type,i?e.axis_y2_default:t.subY2.domain(),[t.subYMin,t.subYMax]),t.xAxisTickFormat=t.axis.getXAxisTickFormat(),t.xAxisTickValues=t.axis.getXAxisTickValues(),t.yAxisTickValues=t.axis.getYAxisTickValues(),t.y2AxisTickValues=t.axis.getY2AxisTickValues(),t.xAxis=t.axis.getXAxis(t.x,t.xOrient,t.xAxisTickFormat,t.xAxisTickValues,e.axis_x_tick_outer),t.subXAxis=t.axis.getXAxis(t.subX,t.subXOrient,t.xAxisTickFormat,t.xAxisTickValues,e.axis_x_tick_outer),t.yAxis=t.axis.getYAxis("y",t.y,t.yOrient,t.yAxisTickValues,e.axis_y_tick_outer),t.y2Axis=t.axis.getYAxis("y2",t.y2,t.y2Orient,t.y2AxisTickValues,e.axis_y2_tick_outer),i||t.brush&&t.brush.updateScale(t.subX),t.updateArc&&t.updateArc()},t.prototype.selectPoint=function(t,e,i){var n=this,r=n.config,a=(r.axis_rotated?n.circleY:n.circleX).bind(n),o=(r.axis_rotated?n.circleX:n.circleY).bind(n),s=n.pointSelectR.bind(n);r.data_onselected.call(n.api,e,t.node()),n.main.select("."+w.selectedCircles+n.getTargetSelectorSuffix(e.id)).selectAll("."+w.selectedCircle+"-"+i).data([e]).enter().append("circle").attr("class",(function(){return n.generateClass(w.selectedCircle,i)})).attr("cx",a).attr("cy",o).attr("stroke",(function(){return n.color(e)})).attr("r",(function(t){return 1.4*n.pointSelectR(t)})).transition().duration(100).attr("r",s)},t.prototype.unselectPoint=function(t,e,i){this.config.data_onunselected.call(this.api,e,t.node()),this.main.select("."+w.selectedCircles+this.getTargetSelectorSuffix(e.id)).selectAll("."+w.selectedCircle+"-"+i).transition().duration(100).attr("r",0).remove()},t.prototype.togglePoint=function(t,e,i,n){t?this.selectPoint(e,i,n):this.unselectPoint(e,i,n)},t.prototype.selectPath=function(t,e){var i=this;i.config.data_onselected.call(i,e,t.node()),i.config.interaction_brighten&&t.transition().duration(100).style("fill",(function(){return i.d3.rgb(i.color(e)).brighter(.75)}))},t.prototype.unselectPath=function(t,e){var i=this;i.config.data_onunselected.call(i,e,t.node()),i.config.interaction_brighten&&t.transition().duration(100).style("fill",(function(){return i.color(e)}))},t.prototype.togglePath=function(t,e,i,n){t?this.selectPath(e,i,n):this.unselectPath(e,i,n)},t.prototype.getToggle=function(t,e){var i;return"circle"===t.nodeName?i=this.isStepType(e)?function(){}:this.togglePoint:"path"===t.nodeName&&(i=this.togglePath),i},t.prototype.toggleShape=function(t,e,i){var n=this,r=n.d3,a=n.config,o=r.select(t),s=o.classed(w.SELECTED),c=n.getToggle(t,e).bind(n);a.data_selection_enabled&&a.data_selection_isselectable(e)&&(a.data_selection_multiple||n.main.selectAll("."+w.shapes+(a.data_selection_grouped?n.getTargetSelectorSuffix(e.id):"")).selectAll("."+w.shape).each((function(t,e){var i=r.select(this);i.classed(w.SELECTED)&&c(!1,i.classed(w.SELECTED,!1),t,e)})),o.classed(w.SELECTED,!s),c(!s,o,e,i))},t.prototype.initBar=function(){this.main.select("."+w.chart).append("g").attr("class",w.chartBars)},t.prototype.updateTargetsForBar=function(t){var e=this,i=e.config,n=e.classChartBar.bind(e),r=e.classBars.bind(e),a=e.classFocus.bind(e);e.main.select("."+w.chartBars).selectAll("."+w.chartBar).data(t).attr("class",(function(t){return n(t)+a(t)})).enter().append("g").attr("class",n).style("pointer-events","none").append("g").attr("class",r).style("cursor",(function(t){return i.data_selection_isselectable(t)?"pointer":null}))},t.prototype.updateBar=function(t){var e=this,i=e.barData.bind(e),n=e.classBar.bind(e),r=e.initialOpacity.bind(e),a=function(t){return e.color(t.id)},o=e.main.selectAll("."+w.bars).selectAll("."+w.bar).data(i),s=o.enter().append("path").attr("class",n).style("stroke",a).style("fill",a);e.mainBar=s.merge(o).style("opacity",r),o.exit().transition().duration(t).style("opacity",0)},t.prototype.redrawBar=function(t,e,i){var n=this;return[(e?this.mainBar.transition(i):this.mainBar).attr("d",t).style("stroke",this.color).style("fill",this.color).style("opacity",(function(t){return n.isTargetToShow(t.id)?1:0}))]},t.prototype.getBarW=function(t,e){var i=this.config,n="number"==typeof i.bar_width?i.bar_width:e?t.tickInterval()*i.bar_width_ratio/e:0;return i.bar_width_max&&n>i.bar_width_max?i.bar_width_max:n},t.prototype.getBars=function(t,e){return(e?this.main.selectAll("."+w.bars+this.getTargetSelectorSuffix(e)):this.main).selectAll("."+w.bar+(_(t)?"-"+t:""))},t.prototype.expandBars=function(t,e,i){i&&this.unexpandBars(),this.getBars(t,e).classed(w.EXPANDED,!0)},t.prototype.unexpandBars=function(t){this.getBars(t).classed(w.EXPANDED,!1)},t.prototype.generateDrawBar=function(t,e){var i=this.config,n=this.generateGetBarPoints(t,e);return function(t,e){var r=n(t,e),a=i.axis_rotated?1:0,o=i.axis_rotated?0:1;return"M "+r[0][a]+","+r[0][o]+" L"+r[1][a]+","+r[1][o]+" L"+r[2][a]+","+r[2][o]+" L"+r[3][a]+","+r[3][o]+" z"}},t.prototype.generateGetBarPoints=function(t,e){var i=this,n=e?i.subXAxis:i.xAxis,r=t.__max__+1,a=i.getBarW(n,r),o=i.getShapeX(a,r,t,!!e),s=i.getShapeY(!!e),c=i.getShapeOffset(i.isBarType,t,!!e),d=a*(i.config.bar_space/2),l=e?i.getSubYScale:i.getYScale;return function(t,e){var n=l.call(i,t.id)(0),r=c(t,e)||n,u=o(t),h=s(t);return i.config.axis_rotated&&(0<t.value&&h<n||t.value<0&&n<h)&&(h=n),[[u+d,r],[u+d,h-=n-r],[u+a-d,h],[u+a-d,r]]}},t.prototype.isWithinBar=function(t,e){return function(t,e,i){void 0===i&&(i=0);var n=e.x-i,r=e.x+e.width+i,a=e.y+e.height+i,o=e.y-i;return n<t[0]&&t[0]<r&&o<t[1]&&t[1]<a}(t,c(e),2)},t.prototype.getShapeIndices=function(t){var e,i,n=this.config,r={},a=0;return this.filterTargetsToShow(this.data.targets.filter(t,this)).forEach((function(t){for(e=0;e<n.data_groups.length;e++)if(!(n.data_groups[e].indexOf(t.id)<0))for(i=0;i<n.data_groups[e].length;i++)if(n.data_groups[e][i]in r){r[t.id]=r[n.data_groups[e][i]];break}f(r[t.id])&&(r[t.id]=a++)})),r.__max__=a-1,r},t.prototype.getShapeX=function(t,e,i,n){var r=n?this.subX:this.x;return function(n){var a=n.id in i?i[n.id]:0;return n.x||0===n.x?r(n.x)-t*(e/2-a):0}},t.prototype.getShapeY=function(t){var e=this;return function(i){return(t?e.getSubYScale(i.id):e.getYScale(i.id))(e.isTargetNormalized(i.id)?e.getRatio("index",i,!0):i.value)}},t.prototype.getShapeOffset=function(t,e,i){var n=this,r=n.orderTargets(n.filterTargetsToShow(n.data.targets.filter(t,n))),a=r.map((function(t){return t.id}));return function(t,o){var s=i?n.getSubYScale(t.id):n.getYScale(t.id),c=s(0),d=c;return r.forEach((function(i){var r=n.isStepType(t)?n.convertValuesToStep(i.values):i.values,l=n.isTargetNormalized(t.id),u=r.map((function(t){return l?n.getRatio("index",t,!0):t.value}));i.id!==t.id&&e[i.id]===e[t.id]&&a.indexOf(i.id)<a.indexOf(t.id)&&((f(r[o])||+r[o].x!=+t.x)&&(o=-1,r.forEach((function(e,i){(e.x.constructor===Date?+e.x:e.x)===(t.x.constructor===Date?+t.x:t.x)&&(o=i)}))),o in r&&r[o].value*t.value>=0&&(d+=s(u[o])-c))})),d}},t.prototype.isWithinShape=function(t,e){var i,n=this,r=n.d3.select(t);return n.isTargetToShow(e.id)?"circle"===t.nodeName?i=n.isStepType(e)?n.isWithinStep(t,n.getYScale(e.id)(e.value)):n.isWithinCircle(t,1.5*n.pointSelectR(e)):"path"===t.nodeName&&(i=!r.classed(w.bar)||n.isWithinBar(n.d3.mouse(t),t)):i=!1,i},t.prototype.getInterpolate=function(t){var e=this,i=e.d3,n={linear:i.curveLinear,"linear-closed":i.curveLinearClosed,basis:i.curveBasis,"basis-open":i.curveBasisOpen,"basis-closed":i.curveBasisClosed,bundle:i.curveBundle,cardinal:i.curveCardinal,"cardinal-open":i.curveCardinalOpen,"cardinal-closed":i.curveCardinalClosed,monotone:i.curveMonotoneX,step:i.curveStep,"step-before":i.curveStepBefore,"step-after":i.curveStepAfter};return e.isSplineType(t)?n[e.config.spline_interpolation_type]||n.cardinal:e.isStepType(t)?n[e.config.line_step_type]:n.linear},t.prototype.initLine=function(){this.main.select("."+w.chart).append("g").attr("class",w.chartLines)},t.prototype.updateTargetsForLine=function(t){var e,i=this,n=i.config,r=i.classChartLine.bind(i),a=i.classLines.bind(i),o=i.classAreas.bind(i),s=i.classCircles.bind(i),c=i.classFocus.bind(i);(e=i.main.select("."+w.chartLines).selectAll("."+w.chartLine).data(t).attr("class",(function(t){return r(t)+c(t)})).enter().append("g").attr("class",r).style("opacity",0).style("pointer-events","none")).append("g").attr("class",a),e.append("g").attr("class",o),e.append("g").attr("class",(function(t){return i.generateClass(w.selectedCircles,t.id)})),e.append("g").attr("class",s).style("cursor",(function(t){return n.data_selection_isselectable(t)?"pointer":null})),t.forEach((function(t){i.main.selectAll("."+w.selectedCircles+i.getTargetSelectorSuffix(t.id)).selectAll("."+w.selectedCircle).each((function(e){e.value=t.values[e.index].value}))}))},t.prototype.updateLine=function(t){var e=this,i=e.main.selectAll("."+w.lines).selectAll("."+w.line).data(e.lineData.bind(e)),n=i.enter().append("path").attr("class",e.classLine.bind(e)).style("stroke",e.color);e.mainLine=n.merge(i).style("opacity",e.initialOpacity.bind(e)).style("shape-rendering",(function(t){return e.isStepType(t)?"crispEdges":""})).attr("transform",null),i.exit().transition().duration(t).style("opacity",0)},t.prototype.redrawLine=function(t,e,i){return[(e?this.mainLine.transition(i):this.mainLine).attr("d",t).style("stroke",this.color).style("opacity",1)]},t.prototype.generateDrawLine=function(t,e){var i=this,n=i.config,r=i.d3.line(),a=i.generateGetLinePoints(t,e),o=e?i.getSubYScale:i.getYScale,s=function(t){return(e?i.subxx:i.xx).call(i,t)},c=function(t,e){return n.data_groups.length>0?a(t,e)[0][1]:o.call(i,t.id)(t.value)};return r=n.axis_rotated?r.x(c).y(s):r.x(s).y(c),n.line_connectNull||(r=r.defined((function(t){return null!=t.value}))),function(t){var a,s=n.line_connectNull?i.filterRemoveNull(t.values):t.values,c=e?i.subX:i.x,d=o.call(i,t.id),l=0,u=0;return i.isLineType(t)?n.data_regions[t.id]?a=i.lineWithRegions(s,c,d,n.data_regions[t.id]):(i.isStepType(t)&&(s=i.convertValuesToStep(s)),a=r.curve(i.getInterpolate(t))(s)):(s[0]&&(l=c(s[0].x),u=d(s[0].value)),a=n.axis_rotated?"M "+u+" "+l:"M "+l+" "+u),a||"M 0 0"}},t.prototype.generateGetLinePoints=function(t,e){var i=this,n=i.config,r=t.__max__+1,a=i.getShapeX(0,r,t,!!e),o=i.getShapeY(!!e),s=i.getShapeOffset(i.isLineType,t,!!e),c=e?i.getSubYScale:i.getYScale;return function(t,e){var r=c.call(i,t.id)(0),d=s(t,e)||r,l=a(t),u=o(t);return n.axis_rotated&&(0<t.value&&u<r||t.value<0&&r<u)&&(u=r),[[l,u-(r-d)],[l,u-(r-d)],[l,u-(r-d)],[l,u-(r-d)]]}},t.prototype.lineWithRegions=function(t,e,i,n){var r,a,o,s,c,d,u,h,g,p,_,x=this,y=x.config,m="M",S=x.isCategorized()?.5:0,w=[];function v(t,e){var i;for(i=0;i<e.length;i++)if(e[i].start<t&&t<=e[i].end)return!0;return!1}if(l(n))for(r=0;r<n.length;r++)w[r]={},f(n[r].start)?w[r].start=t[0].x:w[r].start=x.isTimeSeries()?x.parseDate(n[r].start):n[r].start,f(n[r].end)?w[r].end=t[t.length-1].x:w[r].end=x.isTimeSeries()?x.parseDate(n[r].end):n[r].end;function b(t){return"M"+t[0][0]+" "+t[0][1]+" "+t[1][0]+" "+t[1][1]}for(p=y.axis_rotated?function(t){return i(t.value)}:function(t){return e(t.x)},_=y.axis_rotated?function(t){return e(t.x)}:function(t){return i(t.value)},o=x.isTimeSeries()?function(t,n,r,a){var o=t.x.getTime(),s=n.x-t.x,d=new Date(o+s*r),l=new Date(o+s*(r+a));return b(y.axis_rotated?[[i(c(r)),e(d)],[i(c(r+a)),e(l)]]:[[e(d),i(c(r))],[e(l),i(c(r+a))]])}:function(t,n,r,a){return b(y.axis_rotated?[[i(c(r),!0),e(s(r))],[i(c(r+a),!0),e(s(r+a))]]:[[e(s(r),!0),i(c(r))],[e(s(r+a),!0),i(c(r+a))]])},r=0;r<t.length;r++){if(f(w)||!v(t[r].x,w))m+=" "+p(t[r])+" "+_(t[r]);else for(s=x.getScale(t[r-1].x+S,t[r].x+S,x.isTimeSeries()),c=x.getScale(t[r-1].value,t[r].value),d=e(t[r].x)-e(t[r-1].x),u=i(t[r].value)-i(t[r-1].value),g=2*(h=2/Math.sqrt(Math.pow(d,2)+Math.pow(u,2))),a=h;a<=1;a+=g)m+=o(t[r-1],t[r],a,h);t[r].x}return m},t.prototype.updateArea=function(t){var e=this,i=e.d3,n=e.main.selectAll("."+w.areas).selectAll("."+w.area).data(e.lineData.bind(e)),r=n.enter().append("path").attr("class",e.classArea.bind(e)).style("fill",e.color).style("opacity",(function(){return e.orgAreaOpacity=+i.select(this).style("opacity"),0}));e.mainArea=r.merge(n).style("opacity",e.orgAreaOpacity),n.exit().transition().duration(t).style("opacity",0)},t.prototype.redrawArea=function(t,e,i){return[(e?this.mainArea.transition(i):this.mainArea).attr("d",t).style("fill",this.color).style("opacity",this.orgAreaOpacity)]},t.prototype.generateDrawArea=function(t,e){var i=this,n=i.config,r=i.d3.area(),a=i.generateGetAreaPoints(t,e),o=e?i.getSubYScale:i.getYScale,s=function(t){return(e?i.subxx:i.xx).call(i,t)},c=function(t,e){return n.data_groups.length>0?a(t,e)[0][1]:o.call(i,t.id)(i.getAreaBaseValue(t.id))},d=function(t,e){return n.data_groups.length>0?a(t,e)[1][1]:o.call(i,t.id)(t.value)};return r=n.axis_rotated?r.x0(c).x1(d).y(s):r.x(s).y0(n.area_above?0:c).y1(d),n.line_connectNull||(r=r.defined((function(t){return null!==t.value}))),function(t){var e,a=n.line_connectNull?i.filterRemoveNull(t.values):t.values,o=0,s=0;return i.isAreaType(t)?(i.isStepType(t)&&(a=i.convertValuesToStep(a)),e=r.curve(i.getInterpolate(t))(a)):(a[0]&&(o=i.x(a[0].x),s=i.getYScale(t.id)(a[0].value)),e=n.axis_rotated?"M "+s+" "+o:"M "+o+" "+s),e||"M 0 0"}},t.prototype.getAreaBaseValue=function(){return 0},t.prototype.generateGetAreaPoints=function(t,e){var i=this,n=i.config,r=t.__max__+1,a=i.getShapeX(0,r,t,!!e),o=i.getShapeY(!!e),s=i.getShapeOffset(i.isAreaType,t,!!e),c=e?i.getSubYScale:i.getYScale;return function(t,e){var r=c.call(i,t.id)(0),d=s(t,e)||r,l=a(t),u=o(t);return n.axis_rotated&&(0<t.value&&u<r||t.value<0&&r<u)&&(u=r),[[l,d],[l,u-(r-d)],[l,u-(r-d)],[l,d]]}},t.prototype.updateCircle=function(t,e){var i=this,n=i.main.selectAll("."+w.circles).selectAll("."+w.circle).data(i.lineOrScatterOrStanfordData.bind(i)),r=n.enter().append("circle").attr("shape-rendering",i.isStanfordGraphType()?"crispEdges":"").attr("class",i.classCircle.bind(i)).attr("cx",t).attr("cy",e).attr("r",i.pointR.bind(i)).style("color",i.isStanfordGraphType()?i.getStanfordPointColor.bind(i):i.color);i.mainCircle=r.merge(n).style("opacity",i.isStanfordGraphType()?1:i.initialOpacityForCircle.bind(i)),n.exit().style("opacity",0)},t.prototype.redrawCircle=function(t,e,i,n){var r=this,a=r.main.selectAll("."+w.selectedCircle);return[(i?r.mainCircle.transition(n):r.mainCircle).style("opacity",this.opacityForCircle.bind(r)).style("color",r.isStanfordGraphType()?r.getStanfordPointColor.bind(r):r.color).attr("cx",t).attr("cy",e),(i?a.transition(n):a).attr("cx",t).attr("cy",e)]},t.prototype.circleX=function(t){return t.x||0===t.x?this.x(t.x):null},t.prototype.updateCircleY=function(){var t,e,i=this;i.config.data_groups.length>0?(t=i.getShapeIndices(i.isLineType),e=i.generateGetLinePoints(t),i.circleY=function(t,i){return e(t,i)[0][1]}):i.circleY=function(t){return i.getYScale(t.id)(t.value)}},t.prototype.getCircles=function(t,e){return(e?this.main.selectAll("."+w.circles+this.getTargetSelectorSuffix(e)):this.main).selectAll("."+w.circle+(_(t)?"-"+t:""))},t.prototype.expandCircles=function(t,e,i){var n=this.pointExpandedR.bind(this);i&&this.unexpandCircles(),this.getCircles(t,e).classed(w.EXPANDED,!0).attr("r",n)},t.prototype.unexpandCircles=function(t){var e=this,i=e.pointR.bind(e);e.getCircles(t).filter((function(){return e.d3.select(this).classed(w.EXPANDED)})).classed(w.EXPANDED,!1).attr("r",i)},t.prototype.pointR=function(t){var e=this.config;return this.isStepType(t)?0:h(e.point_r)?e.point_r(t):e.point_r},t.prototype.pointExpandedR=function(t){var e=this.config;return e.point_focus_expand_enabled?h(e.point_focus_expand_r)?e.point_focus_expand_r(t):e.point_focus_expand_r?e.point_focus_expand_r:1.75*this.pointR(t):this.pointR(t)},t.prototype.pointSelectR=function(t){var e=this.config;return h(e.point_select_r)?e.point_select_r(t):e.point_select_r?e.point_select_r:4*this.pointR(t)},t.prototype.isWithinCircle=function(t,e){var i=this.d3,n=i.mouse(t),r=i.select(t),a=+r.attr("cx"),o=+r.attr("cy");return Math.sqrt(Math.pow(a-n[0],2)+Math.pow(o-n[1],2))<e},t.prototype.isWithinStep=function(t,e){return Math.abs(e-this.d3.mouse(t)[1])<30},t.prototype.getCurrentWidth=function(){var t=this.config;return t.size_width?t.size_width:this.getParentWidth()},t.prototype.getCurrentHeight=function(){var t=this.config,e=t.size_height?t.size_height:this.getParentHeight();return e>0?e:320/(this.hasType("gauge")&&!t.gauge_fullCircle?2:1)},t.prototype.getCurrentPaddingTop=function(){var t=this.config,e=_(t.padding_top)?t.padding_top:0;return this.title&&this.title.node()&&(e+=this.getTitlePadding()),e},t.prototype.getCurrentPaddingBottom=function(){var t=this.config;return _(t.padding_bottom)?t.padding_bottom:0},t.prototype.getCurrentPaddingLeft=function(t){var e=this.config;return _(e.padding_left)?e.padding_left:e.axis_rotated?!e.axis_x_show||e.axis_x_inner?1:Math.max(r(this.getAxisWidthByAxisId("x",t)),40):!e.axis_y_show||e.axis_y_inner?this.axis.getYAxisLabelPosition().isOuter?30:1:r(this.getAxisWidthByAxisId("y",t))},t.prototype.getCurrentPaddingRight=function(){var t=this,e=t.config,i=0,n=t.isLegendRight?t.getLegendWidth()+20:0;return i=_(e.padding_right)?e.padding_right+1:e.axis_rotated?10+n:!e.axis_y2_show||e.axis_y2_inner?2+n+(t.axis.getY2AxisLabelPosition().isOuter?20:0):r(t.getAxisWidthByAxisId("y2"))+n,t.colorScale&&t.colorScale.node()&&(i+=t.getColorScalePadding()),i},t.prototype.getParentRectValue=function(t){for(var e,i=this.selectChart.node();i&&"BODY"!==i.tagName;){try{e=i.getBoundingClientRect()[t]}catch(n){"width"===t&&(e=i.offsetWidth)}if(e)break;i=i.parentNode}return e},t.prototype.getParentWidth=function(){return this.getParentRectValue("width")},t.prototype.getParentHeight=function(){var t=this.selectChart.style("height");return t.indexOf("px")>0?+t.replace("px",""):0},t.prototype.getSvgLeft=function(t){var e=this,i=e.config,n=i.axis_rotated||!i.axis_rotated&&!i.axis_y_inner,r=i.axis_rotated?w.axisX:w.axisY,a=e.main.select("."+r).node(),o=a&&n?a.getBoundingClientRect():{right:0},s=e.selectChart.node().getBoundingClientRect(),c=e.hasArcType(),d=o.right-s.left-(c?0:e.getCurrentPaddingLeft(t));return d>0?d:0},t.prototype.getAxisWidthByAxisId=function(t,e){var i=this.axis.getLabelPositionById(t);return this.axis.getMaxTickWidth(t,e)+(i.isInner?20:40)},t.prototype.getHorizontalAxisHeight=function(t,e){var i=this,n=i.config,r=30;return"x"!==t||(l(e)&&e?n.subchart_axis_x_show:n.axis_x_show)?"x"===t&&n.axis_x_height?n.axis_x_height:"y"!==t||n.axis_y_show?"y2"!==t||n.axis_y2_show?("x"===t&&!n.axis_rotated&&n.axis_x_tick_rotate&&(r=30+i.axis.getMaxTickWidth(t)*Math.cos(Math.PI*(90-Math.abs(n.axis_x_tick_rotate))/180)),"y"===t&&n.axis_rotated&&n.axis_y_tick_rotate&&(r=30+i.axis.getMaxTickWidth(t)*Math.cos(Math.PI*(90-Math.abs(n.axis_y_tick_rotate))/180)),r+(i.axis.getLabelPositionById(t).isInner?0:10)+("y2"===t?-10:0)):i.rotated_padding_top:!n.legend_show||i.isLegendRight||i.isLegendInset?1:10:8},t.prototype.initBrush=function(t){var e=this,i=e.d3;return e.brush=(e.config.axis_rotated?i.brushY():i.brushX()).on("brush",(function(){var t=i.event.sourceEvent;t&&"zoom"===t.type||e.redrawForBrush()})).on("end",(function(){var t=i.event.sourceEvent;t&&"zoom"===t.type||e.brush.empty()&&t&&"end"!==t.type&&e.brush.clear()})),e.brush.updateExtent=function(){var t,i=this.scale.range();return t=e.config.axis_rotated?[[0,i[0]],[e.width2,i[1]]]:[[i[0],0],[i[1],e.height2]],this.extent(t),this},e.brush.updateScale=function(t){return this.scale=t,this},e.brush.update=function(t){this.updateScale(t||e.subX).updateExtent(),e.context.select("."+w.brush).call(this)},e.brush.clear=function(){e.context.select("."+w.brush).call(e.brush.move,null)},e.brush.selection=function(){return i.brushSelection(e.context.select("."+w.brush).node())},e.brush.selectionAsValue=function(t,i){var n,r;return t?(e.context&&(n=[this.scale(t[0]),this.scale(t[1])],r=e.context.select("."+w.brush),i&&(r=r.transition()),e.brush.move(r,n)),[]):(n=e.brush.selection()||[0,0],[this.scale.invert(n[0]),this.scale.invert(n[1])])},e.brush.empty=function(){var t=e.brush.selection();return!t||t[0]===t[1]},e.brush.updateScale(t)},t.prototype.initSubchart=function(){var t=this,e=t.config,i=t.context=t.svg.append("g").attr("transform",t.getTranslate("context"));i.style("visibility","visible"),i.append("g").attr("clip-path",t.clipPathForSubchart).attr("class",w.chart),i.select("."+w.chart).append("g").attr("class",w.chartBars),i.select("."+w.chart).append("g").attr("class",w.chartLines),i.append("g").attr("clip-path",t.clipPath).attr("class",w.brush),t.axes.subx=i.append("g").attr("class",w.axisX).attr("transform",t.getTranslate("subx")).attr("clip-path",e.axis_rotated?"":t.clipPathForXAxis).style("visibility",e.subchart_axis_x_show?"visible":"hidden")},t.prototype.initSubchartBrush=function(){this.initBrush(this.subX).updateExtent(),this.context.select("."+w.brush).call(this.brush)},t.prototype.updateTargetsForSubchart=function(t){var e,i,n,r,a=this,o=a.context,s=a.config,c=a.classChartBar.bind(a),d=a.classBars.bind(a),l=a.classChartLine.bind(a),u=a.classLines.bind(a),h=a.classAreas.bind(a);(n=(r=o.select("."+w.chartBars).selectAll("."+w.chartBar).data(t)).enter().append("g").style("opacity",0)).merge(r).attr("class",c),n.append("g").attr("class",d),(e=(i=o.select("."+w.chartLines).selectAll("."+w.chartLine).data(t)).enter().append("g").style("opacity",0)).merge(i).attr("class",l),e.append("g").attr("class",u),e.append("g").attr("class",h),o.selectAll("."+w.brush+" rect").attr(s.axis_rotated?"width":"height",s.axis_rotated?a.width2:a.height2)},t.prototype.updateBarForSubchart=function(t){var e=this,i=e.context.selectAll("."+w.bars).selectAll("."+w.bar).data(e.barData.bind(e)),n=i.enter().append("path").attr("class",e.classBar.bind(e)).style("stroke","none").style("fill",e.color);i.exit().transition().duration(t).style("opacity",0).remove(),e.contextBar=n.merge(i).style("opacity",e.initialOpacity.bind(e))},t.prototype.redrawBarForSubchart=function(t,e,i){(e?this.contextBar.transition(Math.random().toString()).duration(i):this.contextBar).attr("d",t).style("opacity",1)},t.prototype.updateLineForSubchart=function(t){var e=this,i=e.context.selectAll("."+w.lines).selectAll("."+w.line).data(e.lineData.bind(e)),n=i.enter().append("path").attr("class",e.classLine.bind(e)).style("stroke",e.color);i.exit().transition().duration(t).style("opacity",0).remove(),e.contextLine=n.merge(i).style("opacity",e.initialOpacity.bind(e))},t.prototype.redrawLineForSubchart=function(t,e,i){(e?this.contextLine.transition(Math.random().toString()).duration(i):this.contextLine).attr("d",t).style("opacity",1)},t.prototype.updateAreaForSubchart=function(t){var e=this,i=e.d3,n=e.context.selectAll("."+w.areas).selectAll("."+w.area).data(e.lineData.bind(e)),r=n.enter().append("path").attr("class",e.classArea.bind(e)).style("fill",e.color).style("opacity",(function(){return e.orgAreaOpacity=+i.select(this).style("opacity"),0}));n.exit().transition().duration(t).style("opacity",0).remove(),e.contextArea=r.merge(n).style("opacity",0)},t.prototype.redrawAreaForSubchart=function(t,e,i){(e?this.contextArea.transition(Math.random().toString()).duration(i):this.contextArea).attr("d",t).style("fill",this.color).style("opacity",this.orgAreaOpacity)},t.prototype.redrawSubchart=function(t,e,i,n,r,a,o){var s,c,d,l=this,u=l.d3;u.event&&"zoom"===u.event.type&&l.brush.selectionAsValue(l.x.orgDomain()),t&&(l.brush.empty()||l.brush.selectionAsValue(l.x.orgDomain()),s=l.generateDrawArea(r,!0),c=l.generateDrawBar(a,!0),d=l.generateDrawLine(o,!0),l.updateBarForSubchart(i),l.updateLineForSubchart(i),l.updateAreaForSubchart(i),l.redrawBarForSubchart(c,i,i),l.redrawLineForSubchart(d,i,i),l.redrawAreaForSubchart(s,i,i))},t.prototype.redrawForBrush=function(){var t,e=this,i=e.x,n=e.d3;e.redraw({withTransition:!1,withY:e.config.zoom_rescale,withSubchart:!1,withUpdateXDomain:!0,withEventRect:!1,withDimension:!1}),t=n.event.selection||e.brush.scale.range(),e.main.select("."+w.eventRect).call(e.zoom.transform,n.zoomIdentity.scale(e.width/(t[1]-t[0])).translate(-t[0],0)),e.config.subchart_onbrush.call(e.api,i.orgDomain())},t.prototype.transformContext=function(t,e){var i;e&&e.axisSubX?i=e.axisSubX:(i=this.context.select("."+w.axisX),t&&(i=i.transition())),this.context.attr("transform",this.getTranslate("context")),i.attr("transform",this.getTranslate("subx"))},t.prototype.getDefaultSelection=function(){var t=this,e=t.config,i=h(e.axis_x_selection)?e.axis_x_selection(t.getXDomain(t.data.targets)):e.axis_x_selection;return t.isTimeSeries()&&(i=[t.parseDate(i[0]),t.parseDate(i[1])]),i},t.prototype.removeSubchart=function(){this.brush=null,this.context.remove(),this.context=null},t.prototype.initText=function(){this.main.select("."+w.chart).append("g").attr("class",w.chartTexts),this.mainText=this.d3.selectAll([])},t.prototype.updateTargetsForText=function(t){var e=this,i=e.classChartText.bind(e),n=e.classTexts.bind(e),r=e.classFocus.bind(e),a=e.main.select("."+w.chartTexts).selectAll("."+w.chartText).data(t),o=a.enter().append("g").attr("class",i).style("opacity",0).style("pointer-events","none");o.append("g").attr("class",n),o.merge(a).attr("class",(function(t){return i(t)+r(t)}))},t.prototype.updateText=function(t,e,i){var n=this,r=n.config,a=n.barOrLineData.bind(n),o=n.classText.bind(n),s=n.main.selectAll("."+w.texts).selectAll("."+w.text).data(a),c=s.enter().append("text").attr("class",o).attr("text-anchor",(function(t){return r.axis_rotated?t.value<0?"end":"start":"middle"})).style("stroke","none").attr("x",t).attr("y",e).style("fill",(function(t){return n.color(t)})).style("fill-opacity",0);n.mainText=c.merge(s).text((function(t,e,i){return n.dataLabelFormat(t.id)(t.value,t.id,e,i)})),s.exit().transition().duration(i).style("fill-opacity",0).remove()},t.prototype.redrawText=function(t,e,i,n,r){return[(n?this.mainText.transition(r):this.mainText).attr("x",t).attr("y",e).style("fill",this.color).style("fill-opacity",i?0:this.opacityForText.bind(this))]},t.prototype.getTextRect=function(t,e,i){var n,r=this.d3.select("body").append("div").classed("c3",!0),a=r.append("svg").style("visibility","hidden").style("position","fixed").style("top",0).style("left",0),o=this.d3.select(i).style("font");return a.selectAll(".dummy").data([t]).enter().append("text").classed(e||"",!0).style("font",o).text(t).each((function(){n=c(this)})),r.remove(),n},t.prototype.generateXYForText=function(t,e,i,n){var r=this,a=r.generateGetAreaPoints(t,!1),o=r.generateGetBarPoints(e,!1),s=r.generateGetLinePoints(i,!1),c=n?r.getXForText:r.getYForText;return function(t,e){var i=r.isAreaType(t)?a:r.isBarType(t)?o:s;return c.call(r,i(t,e),t,this)}},t.prototype.getXForText=function(t,e,i){var n,r,a=this,o=c(i);return a.config.axis_rotated?(r=a.isBarType(e)?4:6,n=t[2][1]+r*(e.value<0?-1:1)):n=a.hasType("bar")?(t[2][0]+t[0][0])/2:t[0][0],null===e.value&&(n>a.width?n=a.width-o.width:n<0&&(n=4)),n},t.prototype.getYForText=function(t,e,i){var n,r=this,a=c(i);return r.config.axis_rotated?n=(t[0][0]+t[2][0]+.6*a.height)/2:(n=t[2][1],e.value<0||0===e.value&&!r.hasPositiveValue?(n+=a.height,r.isBarType(e)&&r.isSafari()?n-=3:!r.isBarType(e)&&r.isChrome()&&(n+=3)):n+=r.isBarType(e)?-3:-6),null!==e.value||r.config.axis_rotated||(n<a.height?n=a.height:n>this.height&&(n=this.height-4)),n},t.prototype.initTitle=function(){this.title=this.svg.append("text").text(this.config.title_text).attr("class",this.CLASS.title)},t.prototype.redrawTitle=function(){var t=this;t.title.attr("x",t.xForTitle.bind(t)).attr("y",t.yForTitle.bind(t))},t.prototype.xForTitle=function(){var t=this,e=t.config,i=e.title_position||"left";return i.indexOf("right")>=0?t.currentWidth-t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).width-e.title_padding.right:i.indexOf("center")>=0?Math.max((t.currentWidth-t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).width)/2,0):e.title_padding.left},t.prototype.yForTitle=function(){var t=this;return t.config.title_padding.top+t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).height},t.prototype.getTitlePadding=function(){return this.yForTitle()+this.config.title_padding.bottom},t.prototype.drawColorScale=function(){var t,e,i,n,r,a,o,s=this,c=s.d3,d=s.config,l=s.data.targets[0];if((t=isNaN(d.stanford_scaleWidth)?20:d.stanford_scaleWidth)<0)throw Error("Colorscale's barheight and barwidth must be greater than 0.");o=s.height-d.stanford_padding.bottom-d.stanford_padding.top,i=c.range(d.stanford_padding.bottom,o,5),a=c.scaleSequential(l.colors).domain([i[i.length-1],i[0]]),s.colorScale&&s.colorScale.remove(),s.colorScale=s.svg.append("g").attr("width",50).attr("height",o).attr("class",w.colorScale),s.colorScale.append("g").attr("transform","translate(0, "+d.stanford_padding.top+")").selectAll("bars").data(i).enter().append("rect").attr("y",(function(t,e){return 5*e})).attr("x",0).attr("width",t).attr("height",5).attr("fill",(function(t){return a(t)})),r=c.scaleLog().domain([l.minEpochs,l.maxEpochs]).range([i[0]+d.stanford_padding.top+i[i.length-1]+5-1,i[0]+d.stanford_padding.top]),n=c.axisRight(r),"pow10"===d.stanford_scaleFormat?n.tickValues([1,10,100,1e3,1e4,1e5,1e6,1e7]):h(d.stanford_scaleFormat)?n.tickFormat(d.stanford_scaleFormat):n.tickFormat(c.format("d")),h(d.stanford_scaleValues)&&n.tickValues(d.stanford_scaleValues(l.minEpochs,l.maxEpochs)),e=s.colorScale.append("g").attr("class","legend axis").attr("transform","translate("+t+",0)").call(n),"pow10"===d.stanford_scaleFormat&&e.selectAll(".tick text").text(null).filter(P).text(10).append("tspan").attr("dy","-.7em").text((function(t){return Math.round(Math.log(t)/Math.LN10)})),s.colorScale.attr("transform","translate("+(s.currentWidth-s.xForColorScale())+", 0)")},t.prototype.xForColorScale=function(){return this.config.stanford_padding.right+c(this.colorScale.node()).width},t.prototype.getColorScalePadding=function(){return this.xForColorScale()+this.config.stanford_padding.left+20},t.prototype.isStanfordGraphType=function(){return"stanford"===this.config.data_type},t.prototype.initStanfordData=function(){var t,e,i,n=this.d3,r=this.config,a=this.data.targets[0];if(a.values.sort(V),t=a.values.map((function(t){return t.epochs})),(i=isNaN(r.stanford_scaleMin)?n.min(t):r.stanford_scaleMin)>(e=isNaN(r.stanford_scaleMax)?n.max(t):r.stanford_scaleMax))throw Error("Number of minEpochs has to be smaller than maxEpochs");a.colors=h(r.stanford_colors)?r.stanford_colors:n.interpolateHslLong(n.hsl(250,1,.5),n.hsl(0,1,.5)),a.colorscale=n.scaleSequentialLog(a.colors).domain([i,e]),a.minEpochs=i,a.maxEpochs=e},t.prototype.getStanfordPointColor=function(t){return this.data.targets[0].colorscale(t.epochs)},t.prototype.getCentroid=function(t){var e,i,n,r,a,o=C(t),s=0,c=0;for(e=0,i=t.length-1;e<t.length;i=e,e+=1)r=t[e],a=t[i],n=r.x*a.y-a.x*r.y,s+=(r.x+a.x)*n,c+=(r.y+a.y)*n;return{x:s/(n=6*o),y:c/n}},t.prototype.getStanfordTooltipTitle=function(t){var e=this.axis.getLabelText("x"),i=this.axis.getLabelText("y");return"\n <tr><th>"+(e?y(e):"x")+"</th><th class='value'>"+t.x+"</th></tr>\n <tr><th>"+(i?y(i):"y")+"</th><th class='value'>"+t.value+"</th></tr>\n "},t.prototype.countEpochsInRegion=function(t){var e,i,n=this.data.targets[0];return e=n.values.reduce((function(t,e){return t+Number(e.epochs)}),0),{value:i=n.values.reduce((function(e,i){return L(i,t)?e+Number(i.epochs):e}),0),percentage:0!==i?(i/e*100).toFixed(1):0}};var C=function(t){var e,i,n,r,a=0;for(e=0,i=t.length-1;e<t.length;i=e,e+=1)n=t[e],r=t[i],a+=n.x*r.y,a-=n.y*r.x;return a/=2},L=function(t,e){for(var i,n,r,a,o=t.x,s=t.value,c=!1,d=0,l=e.length-1;d<e.length;l=d++)i=e[d].x,n=e[d].y,a=e[l].x,n>s!=(r=e[l].y)>s&&o<(a-i)*(s-n)/(r-n)+i&&(c=!c);return c},V=function(t,e){return t.epochs<e.epochs?-1:t.epochs>e.epochs?1:0};return t.prototype.initStanfordElements=function(){var t=this;t.stanfordElements=t.main.select("."+w.chart).append("g").attr("class",w.stanfordElements),t.stanfordElements.append("g").attr("class",w.stanfordLines),t.stanfordElements.append("g").attr("class",w.stanfordTexts),t.stanfordElements.append("g").attr("class",w.stanfordRegions)},t.prototype.updateStanfordElements=function(t){var e,i,n,r,a,o,s=this,c=s.main,d=s.config,l=s.xvCustom.bind(s),u=s.yvCustom.bind(s),h=s.countEpochsInRegion.bind(s);(i=(e=c.select("."+w.stanfordLines).style("shape-rendering","geometricprecision").selectAll("."+w.stanfordLine).data(d.stanford_lines)).enter().append("g").attr("class",(function(t){return w.stanfordLine+(t.class?" "+t.class:"")}))).append("line").attr("x1",(function(t){return d.axis_rotated?u(t,"value_y1"):l(t,"value_x1")})).attr("x2",(function(t){return d.axis_rotated?u(t,"value_y2"):l(t,"value_x2")})).attr("y1",(function(t){return d.axis_rotated?l(t,"value_x1"):u(t,"value_y1")})).attr("y2",(function(t){return d.axis_rotated?l(t,"value_x2"):u(t,"value_y2")})).style("opacity",0),s.stanfordLines=i.merge(e),s.stanfordLines.select("line").transition().duration(t).attr("x1",(function(t){return d.axis_rotated?u(t,"value_y1"):l(t,"value_x1")})).attr("x2",(function(t){return d.axis_rotated?u(t,"value_y2"):l(t,"value_x2")})).attr("y1",(function(t){return d.axis_rotated?l(t,"value_x1"):u(t,"value_y1")})).attr("y2",(function(t){return d.axis_rotated?l(t,"value_x2"):u(t,"value_y2")})).style("opacity",1),e.exit().transition().duration(t).style("opacity",0).remove(),(o=(a=c.select("."+w.stanfordTexts).selectAll("."+w.stanfordText).data(d.stanford_texts)).enter().append("g").attr("class",(function(t){return w.stanfordText+(t.class?" "+t.class:"")}))).append("text").attr("x",(function(t){return d.axis_rotated?u(t,"y"):l(t,"x")})).attr("y",(function(t){return d.axis_rotated?l(t,"x"):u(t,"y")})).style("opacity",0),s.stanfordTexts=o.merge(a),s.stanfordTexts.select("text").transition().duration(t).attr("x",(function(t){return d.axis_rotated?u(t,"y"):l(t,"x")})).attr("y",(function(t){return d.axis_rotated?l(t,"x"):u(t,"y")})).text((function(t){return t.content})).style("opacity",1),a.exit().transition().duration(t).style("opacity",0).remove(),(r=(n=c.select("."+w.stanfordRegions).selectAll("."+w.stanfordRegion).data(d.stanford_regions)).enter().append("g").attr("class",(function(t){return w.stanfordRegion+(t.class?" "+t.class:"")}))).append("polygon").attr("points",(function(t){return t.points.map((function(t){return[d.axis_rotated?u(t,"y"):l(t,"x"),d.axis_rotated?l(t,"x"):u(t,"y")].join(",")})).join(" ")})).style("opacity",0),r.append("text").attr("x",(function(t){return s.getCentroid(t.points).x})).attr("y",(function(t){return s.getCentroid(t.points).y})).style("opacity",0),s.stanfordRegions=r.merge(n),s.stanfordRegions.select("polygon").transition().duration(t).attr("points",(function(t){return t.points.map((function(t){return[d.axis_rotated?u(t,"y"):l(t,"x"),d.axis_rotated?l(t,"x"):u(t,"y")].join(",")})).join(" ")})).style("opacity",(function(t){return t.opacity?t.opacity:.2})),s.stanfordRegions.select("text").transition().duration(t).attr("x",(function(t){return d.axis_rotated?u(s.getCentroid(t.points),"y"):l(s.getCentroid(t.points),"x")})).attr("y",(function(t){return d.axis_rotated?l(s.getCentroid(t.points),"x"):u(s.getCentroid(t.points),"y")})).text((function(t){var e,i,n;return t.text?(s.isStanfordGraphType()&&(e=(n=h(t.points)).value,i=n.percentage),t.text(e,i)):""})).attr("text-anchor","middle").attr("dominant-baseline","middle").style("opacity",1),n.exit().transition().duration(t).style("opacity",0).remove()},t.prototype.initTooltip=function(){var t,e=this,i=e.config;if(e.tooltip=e.selectChart.style("position","relative").append("div").attr("class",w.tooltipContainer).style("position","absolute").style("pointer-events","none").style("display","none"),i.tooltip_init_show){if(e.isTimeSeries()&&p(i.tooltip_init_x)){for(i.tooltip_init_x=e.parseDate(i.tooltip_init_x),t=0;t<e.data.targets[0].values.length&&e.data.targets[0].values[t].x-i.tooltip_init_x!=0;t++);i.tooltip_init_x=t}e.tooltip.html(i.tooltip_contents.call(e,e.data.targets.map((function(t){return e.addName(t.values[i.tooltip_init_x])})),e.axis.getXAxisTickFormat(),e.getYFormat(e.hasArcType()),e.color)),e.tooltip.style("top",i.tooltip_init_position.top).style("left",i.tooltip_init_position.left).style("display","block")}},t.prototype.getTooltipSortFunction=function(){var t=this,e=t.config;if(0!==e.data_groups.length&&void 0===e.tooltip_order){var i=t.orderTargets(t.data.targets).map((function(t){return t.id}));return(t.isOrderAsc()||t.isOrderDesc())&&(i=i.reverse()),function(t,e){return i.indexOf(t.id)-i.indexOf(e.id)}}var n=e.tooltip_order;void 0===n&&(n=e.data_order);var r=function(t){return t?t.value:null};if(p(n)&&"asc"===n.toLowerCase())return function(t,e){return r(t)-r(e)};if(p(n)&&"desc"===n.toLowerCase())return function(t,e){return r(e)-r(t)};if(h(n)){var a=n;return void 0===e.tooltip_order&&(a=function(t,e){return n(t?{id:t.id,values:[t]}:null,e?{id:e.id,values:[e]}:null)}),a}return d(n)?function(t,e){return n.indexOf(t.id)-n.indexOf(e.id)}:void 0},t.prototype.getTooltipContent=function(t,e,i,n){var r,a,o,s,c,d,l=this,u=l.config,h=u.tooltip_format_title||e,g=u.tooltip_format_name||function(t){return t},p=u.tooltip_format_value;p||(p=l.isTargetNormalized(t.id)?function(t,e){return(100*e).toFixed(2)+"%"}:i);var f=this.getTooltipSortFunction();for(f&&t.sort(f),a=0;a<t.length;a++)if(t[a]&&(t[a].value||0===t[a].value)){if(l.isStanfordGraphType())r||(o=l.getStanfordTooltipTitle(t[a]),r="<table class='"+l.CLASS.tooltip+"'>"+o),d=l.getStanfordPointColor(t[a]),c=y(u.data_epochs),s=t[a].epochs;else if(r||(o=y(h?h(t[a].x,t[a].index):t[a].x),r="<table class='"+l.CLASS.tooltip+"'>"+(o||0===o?"<tr><th colspan='2'>"+o+"</th></tr>":"")),void 0!==(s=y(p(t[a].value,t[a].ratio,t[a].id,t[a].index,t)))){if(null===t[a].name)continue;c=y(g(t[a].name,t[a].ratio,t[a].id,t[a].index)),d=l.levelColor?l.levelColor(t[a].value):n(t[a].id)}void 0!==s&&(r+="<tr class='"+l.CLASS.tooltipName+"-"+l.getTargetSelectorSuffix(t[a].id)+"'>",r+="<td class='name'><span style='background-color:"+d+"'></span>"+c+"</td>",r+="<td class='value'>"+s+"</td>",r+="</tr>")}return r+"</table>"},t.prototype.tooltipPosition=function(t,e,i,n){var r,a,o,s,c,d=this,l=d.config,u=d.d3,h=d.hasArcType(),g=u.mouse(n);return h?(a=(d.width-(d.isLegendRight?d.getLegendWidth():0))/2+g[0],s=(d.hasType("gauge")?d.height:d.height/2)+g[1]+20):(r=d.getSvgLeft(!0),l.axis_rotated?(o=(a=r+g[0]+100)+e,c=d.currentWidth-d.getCurrentPaddingRight(),s=d.x(t[0].x)+20):(o=(a=r+d.getCurrentPaddingLeft(!0)+d.x(t[0].x)+20)+e,c=r+d.currentWidth-d.getCurrentPaddingRight(),s=g[1]+15),o>c&&(a-=o-c+20),s+i>d.currentHeight&&(s-=i+30)),s<0&&(s=0),{top:s,left:a}},t.prototype.showTooltip=function(e,i){var n,r,a,o=this,s=o.config,c=o.hasArcType(),d=e.filter((function(t){return t&&_(t.value)})),l=s.tooltip_position||t.prototype.tooltipPosition;0!==d.length&&s.tooltip_show?(o.tooltip.html(s.tooltip_contents.call(o,e,o.axis.getXAxisTickFormat(),o.getYFormat(c),o.color)).style("display","block"),n=o.tooltip.property("offsetWidth"),r=o.tooltip.property("offsetHeight"),a=l.call(this,d,n,r,i),o.tooltip.style("top",a.top+"px").style("left",a.left+"px")):o.hideTooltip()},t.prototype.hideTooltip=function(){this.tooltip.style("display","none")},t.prototype.setTargetType=function(t,e){var i=this,n=i.config;i.mapToTargetIds(t).forEach((function(t){i.withoutFadeIn[t]=e===n.data_types[t],n.data_types[t]=e})),t||(n.data_type=e)},t.prototype.hasType=function(t,e){var i=this.config.data_types,n=!1;return(e=e||this.data.targets)&&e.length?e.forEach((function(e){var r=i[e.id];(r&&r.indexOf(t)>=0||!r&&"line"===t)&&(n=!0)})):Object.keys(i).length?Object.keys(i).forEach((function(e){i[e]===t&&(n=!0)})):n=this.config.data_type===t,n},t.prototype.hasArcType=function(t){return this.hasType("pie",t)||this.hasType("donut",t)||this.hasType("gauge",t)},t.prototype.isLineType=function(t){var e=this.config,i=p(t)?t:t.id;return!e.data_types[i]||["line","spline","area","area-spline","step","area-step"].indexOf(e.data_types[i])>=0},t.prototype.isStepType=function(t){var e=p(t)?t:t.id;return["step","area-step"].indexOf(this.config.data_types[e])>=0},t.prototype.isSplineType=function(t){var e=p(t)?t:t.id;return["spline","area-spline"].indexOf(this.config.data_types[e])>=0},t.prototype.isAreaType=function(t){var e=p(t)?t:t.id;return["area","area-spline","area-step"].indexOf(this.config.data_types[e])>=0},t.prototype.isBarType=function(t){var e=p(t)?t:t.id;return"bar"===this.config.data_types[e]},t.prototype.isScatterType=function(t){var e=p(t)?t:t.id;return"scatter"===this.config.data_types[e]},t.prototype.isStanfordType=function(t){var e=p(t)?t:t.id;return"stanford"===this.config.data_types[e]},t.prototype.isPieType=function(t){var e=p(t)?t:t.id;return"pie"===this.config.data_types[e]},t.prototype.isGaugeType=function(t){var e=p(t)?t:t.id;return"gauge"===this.config.data_types[e]},t.prototype.isDonutType=function(t){var e=p(t)?t:t.id;return"donut"===this.config.data_types[e]},t.prototype.isArcType=function(t){return this.isPieType(t)||this.isDonutType(t)||this.isGaugeType(t)},t.prototype.lineData=function(t){return this.isLineType(t)?[t]:[]},t.prototype.arcData=function(t){return this.isArcType(t.data)?[t]:[]},t.prototype.barData=function(t){return this.isBarType(t)?t.values:[]},t.prototype.lineOrScatterOrStanfordData=function(t){return this.isLineType(t)||this.isScatterType(t)||this.isStanfordType(t)?t.values:[]},t.prototype.barOrLineData=function(t){return this.isBarType(t)||this.isLineType(t)?t.values:[]},t.prototype.isSafari=function(){var t=window.navigator.userAgent;return t.indexOf("Safari")>=0&&t.indexOf("Chrome")<0},t.prototype.isChrome=function(){return window.navigator.userAgent.indexOf("Chrome")>=0},t.prototype.initZoom=function(){var t,e=this,i=e.d3,n=e.config;return e.zoom=i.zoom().on("start",(function(){if("scroll"===n.zoom_type){var r=i.event.sourceEvent;r&&"brush"===r.type||(t=r,n.zoom_onzoomstart.call(e.api,r))}})).on("zoom",(function(){if("scroll"===n.zoom_type){var t=i.event.sourceEvent;t&&"brush"===t.type||(e.redrawForZoom(),n.zoom_onzoom.call(e.api,e.x.orgDomain()))}})).on("end",(function(){if("scroll"===n.zoom_type){var r=i.event.sourceEvent;r&&"brush"===r.type||r&&t.clientX===r.clientX&&t.clientY===r.clientY||n.zoom_onzoomend.call(e.api,e.x.orgDomain())}})),e.zoom.updateDomain=function(){return i.event&&i.event.transform&&(n.axis_rotated&&"scroll"===n.zoom_type&&"mousemove"===i.event.sourceEvent.type?e.x.domain(i.event.transform.rescaleY(e.subX).domain()):e.x.domain(i.event.transform.rescaleX(e.subX).domain())),this},e.zoom.updateExtent=function(){return this.scaleExtent([1,1/0]).translateExtent([[0,0],[e.width,e.height]]).extent([[0,0],[e.width,e.height]]),this},e.zoom.update=function(){return this.updateExtent().updateDomain()},e.zoom.updateExtent()},t.prototype.zoomTransform=function(t){var e=[this.x(t[0]),this.x(t[1])];return this.d3.zoomIdentity.scale(this.width/(e[1]-e[0])).translate(-e[0],0)},t.prototype.initDragZoom=function(){var t=this,e=t.d3,i=t.config,n=t.context=t.svg,r=t.margin.left+20.5,a=t.margin.top+.5;if("drag"===i.zoom_type&&i.zoom_enabled){var o=function(e){return e&&e.map((function(e){return t.x.invert(e)}))},s=t.dragZoomBrush=e.brushX().on("start",(function(){t.api.unzoom(),t.svg.select("."+w.dragZoom).classed("disabled",!1),i.zoom_onzoomstart.call(t.api,e.event.sourceEvent)})).on("brush",(function(){i.zoom_onzoom.call(t.api,o(e.event.selection))})).on("end",(function(){if(null!=e.event.selection){var n=o(e.event.selection);i.zoom_disableDefaultBehavior||t.api.zoom(n),t.svg.select("."+w.dragZoom).classed("disabled",!0),i.zoom_onzoomend.call(t.api,n)}}));n.append("g").classed(w.dragZoom,!0).attr("clip-path",t.clipPath).attr("transform","translate("+r+","+a+")").call(s)}},t.prototype.getZoomDomain=function(){var t=this.config,e=this.d3;return[e.min([this.orgXDomain[0],t.zoom_x_min]),e.max([this.orgXDomain[1],t.zoom_x_max])]},t.prototype.redrawForZoom=function(){var t=this,e=t.d3,i=t.config,n=t.zoom,r=t.x;i.zoom_enabled&&0!==t.filterTargetsToShow(t.data.targets).length&&(n.update(),i.zoom_disableDefaultBehavior||(t.isCategorized()&&r.orgDomain()[0]===t.orgXDomain[0]&&r.domain([t.orgXDomain[0]-1e-10,r.orgDomain()[1]]),t.redraw({withTransition:!1,withY:i.zoom_rescale,withSubchart:!1,withEventRect:!1,withDimension:!1}),e.event.sourceEvent&&"mousemove"===e.event.sourceEvent.type&&(t.cancelClick=!0)))},T}()}}]);