ui-widget-toolkit
Version:
UI widgets built on top of D3, Pixi.js and ag-grid-community
1 lines • 572 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("d3"),require("pixi.js"),require("es6-promise")):"function"==typeof define&&define.amd?define("UWT",["d3","pixi.js","es6-promise"],e):"object"==typeof exports?exports.UWT=e(require("d3"),require("pixi.js"),require("es6-promise")):t.UWT=e(t.d3,t.PIXI,t["es6-promise"])}(window,(function(t,e,n){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=42)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.Left=1]="Left",t[t.Right=2]="Right",t[t.Top=4]="Top",t[t.Bottom=8]="Bottom",t[t.None=0]="None"}(e.Alignment||(e.Alignment={})),function(t){t[t.CursorStart=0]="CursorStart",t[t.CursorMove=1]="CursorMove",t[t.CursorEnd=2]="CursorEnd",t[t.BrushStart=3]="BrushStart",t[t.BrushMove=4]="BrushMove",t[t.BrushEnd=5]="BrushEnd",t[t.HoverStart=6]="HoverStart",t[t.HoverEnd=7]="HoverEnd",t[t.HoverClear=8]="HoverClear",t[t.FocusStart=6]="FocusStart",t[t.FocusEnd=7]="FocusEnd",t[t.FocusClear=8]="FocusClear",t[t.SelectAdd=9]="SelectAdd",t[t.SelectRemove=10]="SelectRemove",t[t.SelectStart=9]="SelectStart",t[t.SelectEnd=10]="SelectEnd",t[t.SelectClear=11]="SelectClear",t[t.Zoom=12]="Zoom",t[t.Click=13]="Click",t[t.DoubleClick=14]="DoubleClick",t[t.RangeUpdate=15]="RangeUpdate"}(e.EventType||(e.EventType={})),function(t){t[t.Unrendered=0]="Unrendered",t[t.Cartesian=1]="Cartesian",t[t.Pie=2]="Pie",t[t.Grid=3]="Grid",t[t.FlowDiagram=4]="FlowDiagram",t[t.ForceDirectedGraph=5]="ForceDirectedGraph",t[t.Sunburst=6]="Sunburst",t[t.HierarchyGraph=7]="HierarchyGraph",t[t.PortDiagram=8]="PortDiagram",t[t.SimpleGraph=9]="SimpleGraph",t[t.TreeMap=10]="TreeMap",t[t.Axis=11]="Axis",t[t.Radar=12]="Radar"}(e.UIType||(e.UIType={})),function(t){t[t.Discrete=0]="Discrete",t[t.Gradient=1]="Gradient"}(e.LegendType||(e.LegendType={})),function(t){t[t.Vertical=0]="Vertical",t[t.Horizontal=1]="Horizontal"}(e.LegendOrientation||(e.LegendOrientation={})),function(t){t[t.Rectangle=0]="Rectangle",t[t.Line=1]="Line",t[t.Circle=2]="Circle"}(e.LegendItemShape||(e.LegendItemShape={}));e.Rect=class{constructor(t,e,n,r){this.x=0,this.y=0,this.width=0,this.height=0,this.x=t,this.y=e,this.width=n,this.height=r}contains(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height}};e.Css=class{constructor(t,e){t?this.addClasses(t):this.classes={},this.style=e||{}}addClasses(t){let e=t.split(" ");for(let t=0;t<e.length;++t)this.classes[e[t]]=!0;return this}addStyles(t){for(let e in t)this.style[e]=t[e];return this}setColor(t){return this.addStyles({color:t}),this}setOpacity(t){return this.addStyles({opacity:t}),this}removeClass(t){return delete this.classes[t],this}removeStyle(t){return delete this.style[t],this}getClasses(){return Object.keys(this.classes)}getClassString(){let t="";for(let e in this.classes)t+=e+" ";return t}getStyles(){return this.style}getStyleString(){return JSON.stringify(this.style)}};e.Range=class{constructor(t,e){this.min=t,this.max=e}setMin(t){return this.min=t,this}getMin(){return this.min}setMax(t){return this.max=t,this}getMax(){return this.max}}},function(t,e,n){"use strict";function r(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function i(t){return function(e,n){return r(t(e),n)}}function a(t){return t||(t=r),1===t.length&&(t=i(t)),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var a=r+i>>>1;t(e[a],n)<0?r=a+1:i=a}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var a=r+i>>>1;t(e[a],n)>0?i=a:r=a+1}return r}}}Object.defineProperty(e,"__esModule",{value:!0}),e.getSelectionName=function(t){return"number"==typeof t?"n"+t:t?(t.length>0&&!isNaN(Number(t[0]))&&(t="z"+t),t=t.replace(/[\*\%\#\[\]\/\>\<\s\+\(\)\;\@\:\?\"=.,]/g,"-")):""},e.removeFromList=function(t,e){if(t){let n=e.indexOf(t);-1!==n&&e.splice(n,1)}},e.bisect=a,e.bucketData=function(t,e,n){let r=a().right,i=[];for(let t=0;t<e.length-1;++t)i[t]=[];let o=e[0],s=e[e.length-1],u=e.slice(1);for(let e=0;e<t.length;++e){let a=n(t[e]);a<o||a>s||i[r(u,a)].push(t[e])}let l={};for(let t=0;t<e.length-1;++t){l[e[t]+"-"+e[t+1]]=i[t]}return l},e.copy=function(t){let e={};for(let n in t)e[n]=t[n];return e},e.merge=function(t,e){for(let n in e)t[n]=e[n]},e.convertTraceToTrees=function(t){let e=[],n=[],r=[];for(let i=0;i<t.length;i++){let a=t[i],o=n[n.length-1];for(;n.length&&a.x>o.x+o.dx;)--n.length,--r.length,o=n[n.length-1];let s=r[r.length-1],u={key:a.key,value:a.dx,children:[],parent:s};a.name&&(u.name=a.name),s?s.children.push(u):e.push(u),n.push(a),r.push(u)}return e};e.SimpleBuffer=class{constructor(t){this._data=t||[]}push(t){this._data.push(t)}get(t){return this._data[t]}length(){return this._data.length}getData(){return this._data}};e.RingBuffer=class{constructor(t){this._data=new Array(t),this._startIdx=0,this._count=0,this._isRotating=!1}push(t){this._isRotating?(this._data[this._startIdx]=t,++this._startIdx,this._startIdx===this._count&&(this._startIdx=0),this._isRotating=!0):this._count===this._data.length-1?(this._data[this._count]=t,++this._count,this._isRotating=!0):(this._data[this._count]=t,++this._count)}get(t){return this._isRotating&&(t+=this._startIdx)>=this._count&&(t-=this._count),this._data[t]}length(){return this._count}getData(){if(this._isRotating){let t=[];for(let e=this._startIdx;e<this._data.length;++e)t.push(this._data[e]);for(let e=0;e<this._startIdx;++e)t.push(this._data[e]);return t}return this._data}},e.bisectBuffer=function(t){return t||(t=r),1===t.length&&(t=i(t)),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length());r<i;){var a=r+i>>>1;t(e.get(a),n)<0?r=a+1:i=a}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length());r<i;){var a=r+i>>>1;t(e.get(a),n)>0?i=a:r=a+1}return r}}},e.transposeKeys=function(t){let e={};function n(t,r,i,a){let o=[];for(let t=0;t<r.length;++t)o[t]=r[t];if(o.push(i.key),Array.isArray(i.data))for(let e=0;e<i.data.length;++e)n(t,o,i.data[e],a+1);else{let n=t;for(let t=o.length-1;t>=0;--t){let r,a=o[t];e.hasOwnProperty(a)?r=e[a]:(r=n.length,e[a]=r),n[r]||(n[r]={key:a,data:[]}),0===t?n[r].data=i.data:n=n[r].data}}}let r=[];for(let e=0;e<t.length;++e)n(r,[],t[e],0);return r},e.runFunctionOnLeaf=function t(e,n){if(e&&e.children&&e.children.length>0)for(let r=0;r<e.children.length;++r)t(e.children[r],n);else n(e)},e.isOverlapping=function(t,e){return t.x<=e.right&&t.right>=e.x&&t.y<=e.bottom&&t.bottom>=e.y}},function(e,n){e.exports=t},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(1),i=n(0),a=n(7),o=n(19),s=n(29),u=n(4),l=n(2);function c(t,e,n){return n=n&&"none"!==n?n:void 0,e.has(t.node())||e.set(t.node(),n),e.get(t.node())}function h(t,e,n){let r=t.style("fill");if(r=c(t,e,r),r){let e=o.InteractionState.getFocusColor(r);t.style("fill",e)}if(!t.classed("selected")){let e=t.style("stroke");if(e=c(t,n,e),e){let n=o.InteractionState.getFocusColor(e);t.style("stroke",n)}}t.classed("hover",!0)}function f(t,e,n){let r=c(t,e);if(r&&t.style("fill",r),!t.classed("selected")){let e=t.style("stroke");e&&(e=c(t,n),e&&t.style("stroke",e))}t.classed("hover",!1)}function d(t,e,n){let r=t.style("fill");r=c(t,e,r);let i=!r||"none"===r,a=t.style("stroke");a=c(t,n,a),(a||i)&&t.style("stroke",null),t.classed("selected",!0)}function g(t,e,n){let r=c(t,n);r&&t.style("stroke",r),t.classed("selected",!1)}function p(t,e,n){let r={caller:t,data:e,event:i.EventType.SelectClear},a={caller:t,event:i.EventType.SelectAdd,data:e,selection:n};t.api.select(r),t.api.select(a),t.onClick&&(t.onClick(r),t.onClick(a))}function _(t,e,n){if(t.getScreenCTM&&t.getScreenCTM()){let e=t.getScreenCTM().inverse();return n.matrixTransform(e)}return{x:n.x,y:n.y}}function m(t,e){let n=e.node().getBoundingClientRect(),r=t.node(),i=(e.node(),r.createSVGPoint());i.x=n.left,i.y=n.top;let a=_(r,0,i);i.x=n.right,i.y=n.bottom;let o=_(r,0,i);return{x:a.x,y:a.y,width:o.x-a.x,height:o.y-a.y,right:o.x,bottom:o.y}}e.getStyle=function(t){let e=t.node();return window.getComputedStyle(e)},e.mergeKeys=function(t,e){let n={};for(let e=0;e<t.length;++e)n[t[e]]=!0;for(let r=0;r<e.length;++r)n.hasOwnProperty(e[r])||t.push(e[r])},e.getKeys=function(t,e){let n={},r=[];for(let i=0;i<t.length;++i){let a=e(t[i]);for(let t=0;t<a.length;++t)"string"!=typeof a[t]&&"number"!=typeof a[t]||n.hasOwnProperty(a[t])||(n[a[t]]=!0,r.push(a[t]))}return r},e.focus=h,e.unfocus=f,e.select=d,e.unselect=g,e.onSelectHelper=p,e.addClickHelper=function(t,e,n,r,o,s,u,c,h){let f;t.on("click",(function(t){void 0!==c&&(t=c),r?f=setTimeout((function(){f&&(e.disableSelection||p(u,c,h),n&&n({caller:u,event:i.EventType.Click,data:t}),f=null)}),300):(e.disableSelection||p(u,c,h),n&&n({caller:u,event:i.EventType.Click,data:t}))})),r&&t.on("dblclick",(function(t){void 0!==c&&(t=c),window.clearTimeout(f),f=null,r({caller:u,event:i.EventType.DoubleClick,data:t})})),o&&o.length&&t.on("contextmenu",(function(t){event||(event=l.event),a.showContextMenu(l.event,c,o)}))},e.convertToSVGCoords=m,e.getTextRect=function(t,e){let n=t.append("text").text(e),r=m(t,n);return n.remove(),r},e.animatePath=function(t,e){let n=t.node().getTotalLength();t.attr("stroke-dasharray",n).attr("stroke-dashoffset",n).transition("add").duration(e).attr("stroke-dashoffset",0)};class y{static getAngle(t,e){return 180*Math.atan2(e.y-t.y,e.x-t.x)/Math.PI}static translateArrow(t){return function(e,n,r){return function(e){var n=t.getTotalLength(),r=t.getPointAtLength(e*n),i=t.getPointAtLength(Math.max(n-.01,0)*e),a=t.getPointAtLength((n+.01)*e);return"translate("+r.x+", "+r.y+") rotate( "+y.getAngle(i,a)+")"}}}static createArrow(t,e=4){let n=2*e;return t.append("path").attr("d",`M -${n}, -${e} L0,0 L-${n},${e} z`)}static animateArrow(t,e,n){e.transition().duration(n).attrTween("transform",y.translateArrow(t.node()))}}e.Arrow=y;e.Spinner=class{constructor(t,e){let n=this,r=Math.min(e.width,e.height)/2,i=2*Math.PI;n._svg=t;let a=l.arc().innerRadius(.5*r).outerRadius(.9*r).startAngle(0);n._svg.append("path").classed("spinner",!0).datum({endAngle:.66*i}).style("fill","rgb(0,113,197)").attr("d",a).call((function t(e,r){e.transition().ease(l.easeLinear).duration(r).attrTween("transform",(function(){return l.interpolateString("rotate(0)","rotate(360)")})),setTimeout((function(){n._svg&&t(e,r)}),r)}),1500)}};e.Brush=class{constructor(){let t=this;t._isXY=!1,this.onBrushStart=function(e){if(t._onStartCallback){let e=l.brushSelection(this);t._onStartCallback.call(this,e)}},this.onBrushMove=function(e){if(t._onMoveCallback){let e=l.brushSelection(this);t._onMoveCallback.call(this,e)}},this.onBrushEnd=function(e){if(t._onEndCallback){let e=l.brushSelection(this);t._onEndCallback.call(this,e)}}}moveToFront(){this._brushTargetGraph.each((function(){this.parentNode.appendChild(this)}))}moveToBack(){this._brushTargetGraph.each((function(){let t=this.parentNode.firstChild;t&&this.parentNode.insertBefore(this,t)}))}enableCallbacks(){return this._brush.on("start",this.onBrushStart).on("brush",this.onBrushMove).on("end",this.onBrushEnd),this}disableCallbacks(){return this._brush.on("start",void 0).on("brush",void 0).on("end",void 0),this}brushStart(t){this._brushTargetGraph.call(this._brush.move,null)}brushMove(t){this._brushTargetGraph.call(this._brush.move,t)}brushEnd(){this._brushTargetGraph.call(this._brush.move,null)}setXY(t){return this._isXY=t,this}setTarget(t){return this._brushTargetGraph=t,this}setStartCallback(t){return this._onStartCallback=t,this}setMoveCallback(t){return this._onMoveCallback=t,this}setEndCallback(t){return this._onEndCallback=t,this}setRect(t){return this._rect=t,this}ready(){return this._isXY?this._brush=l.brush().on("start",this.onBrushStart).on("brush",this.onBrushMove).on("end",this.onBrushEnd):this._brush=l.brushX().extent([[0,0],[this._rect.width,this._rect.height]]).on("start",this.onBrushStart).on("brush",this.onBrushMove).on("end",this.onBrushEnd),this._brushTargetGraph.call(this._brush),this}static releaseListeners(t){t.on("brush",null).on("brushend",null).on("brushstart",null)}};e.D3Legend=class{constructor(t,e,n,r){if(this._title=n||"",this._legend=e,this._itemMap={},this._items=[],e.definition){let t=[];for(let n=0;n<e.definition.items.length;++n){let r=e.definition.items[n];t.push({key:r.key,name:r.name?r.name:r.key,color:r.color,shape:this.getShapeString(r.shape),opacity:""})}this.addItems(t)}let a="ordinal";this._legend.definition&&this._legend.definition.type===i.LegendType.Gradient&&(a="gradient"),this._classes=`legend ${a} ${this._title} align-${this._legend.alignment}`,this._legendSvg=t.append("g").classed(this._classes,!0),this.setPosition(r)}getShapeString(t){if("string"==typeof t)return t;switch(t){case i.LegendItemShape.Rectangle:return"rect";case i.LegendItemShape.Line:return"line";case i.LegendItemShape.Circle:return"circle"}}setPosition(t){this._position=t}getPosition(){return this._position}setItems(t){this._items=[],this._itemMap={},this.addItems(t)}addItems(t){for(let e=0;e<t.length;++e){let n=t[e];this._itemMap.hasOwnProperty(n.key)?(this._itemMap[n.key].color=n.color,this._itemMap[n.key].opacity=n.opacity):(n.name||(n.name=n.key,this._legend.showValue&&void 0!==n.value&&(n.name+=": "+n.value,void 0!==n.units&&(n.name+=n.units))),this._itemMap[n.key]=n,this._items.push(n))}}getAlignment(){return this._legend.alignment}getRenderedRect(){return this._renderedRect}getRows(){return this._legend.orientation===i.LegendOrientation.Vertical?this._items.length:this._legendSvg.selectAll(".legendCells").size()}renderDiscreteLegend(t){let e=[],n=[];for(let t=0;t<this._items.length;++t){this._items[t].name;let r=this._items[t].color,i=this._items[t].opacity;i&&r.startsWith("rgb")&&(r="rgba"+r.substr(3,r.length-4)+" , "+i+")"),e.push(this._items[t].name),n.push(r)}let r=2,o=0,u=this,c=function(e,n,o){let c=l.scaleOrdinal().domain(n).range(o),h=s.legendColor();h.on("cellover",(function(t){this.setAttribute("title",t)})).orient(t).labelPosition("right").shape("rect").shapeWidth(10).shapeHeight(10).shapePadding(r).scale(c),u._legend.onClick&&h.on("cellclick",(function(t){u._legend.onClick({event:i.EventType.Click,data:t})})),u._legend.contextMenuItems&&h.on("cellcontextmenu",(function(t){a.showContextMenu(l.event,t,u._legend.contextMenuItems)})),e.call(h)};c(this._legendSvg,e,n);let h=this._position.x;if((this._legend.alignment===i.Alignment.Top||this._legend.alignment===i.Alignment.Bottom)&&this._legend.orientation!==i.LegendOrientation.Vertical){r=0;this._legendSvg.select(".legendCells").selectAll(".cell").each((function(){let t=this.getBBox();r=Math.max(r,t.width)}));o=r+10,this._legendSvg.selectAll("*").remove();let t=Math.max(1,Math.min(e.length,Math.floor(this._position.width/o)));Math.ceil(e.length/t),h=this._position.x+this._position.width/2-o*t/2;let i=0;for(let r=0;r<e.length;r+=t){let a=this._legendSvg.append("g").classed(this._classes,!0);c(a,e.slice(r,r+t),n.slice(r,r+t)),i&&a.attr("transform","translate(0,"+i+")"),i+=a.node().getBoundingClientRect().height}}h=Math.max(0,h),this._legendSvg.attr("transform","translate("+h+","+this._position.y+")")}renderGradientLegend(){this._legendSvg.selectAll("*").remove();let t=this._legend.definition.items,e=r.getSelectionName(`${this._title}align-${this._legend.alignment}`),n=this._legendSvg.append("linearGradient").attr("id",e).attr("x1","0%").attr("y1","0%");t.forEach(t=>{n.append("stop").attr("offset",`${t.key}%`).attr("style",`stop-color:${t.color};stop-opacity:${t.opacity}`)});let a,o=l.scaleLinear().domain(l.extent(t,t=>Number(t.key))),s=this._legendSvg.append("rect"),u=this._legendSvg.append("g");switch(this._legend.alignment){case i.Alignment.Left:n.attr("x2","0%").attr("y2","100%"),s.attr("x",30).attr("width",40).attr("y",0).attr("height",this._position.height),o.range([0,this._position.height]),u.attr("transform","translate(30, 0)"),a=l.axisLeft(o);break;case i.Alignment.Right:n.attr("x2","0%").attr("y2","100%"),s.attr("x",5).attr("width",40).attr("y",0).attr("height",this._position.height),o.range([0,this._position.height]),u.attr("transform","translate(45, 0)"),a=l.axisRight(o);break;case i.Alignment.Top:n.attr("x2","100%").attr("y2","0%"),s.attr("x",0).attr("width",this._position.width).attr("y",10).attr("height",40),o.range([0,this._position.width]),u.attr("transform","translate(0, 10)"),a=l.axisTop(o);break;case i.Alignment.Bottom:n.attr("x2","100%").attr("y2","0%"),s.attr("x",0).attr("width",this._position.width).attr("y",5).attr("height",40),o.range([0,this._position.width]),u.attr("transform","translate(0, 45)"),a=l.axisBottom(o)}s.attr("fill",`url(#${e})`),u.call(a),this._legendSvg.attr("transform","translate("+this._position.x+","+this._position.y+")")}render(){let t;if(t=this._legend.orientation===i.LegendOrientation.Vertical?"vertical":this._legend.orientation===i.LegendOrientation.Horizontal?"horizontal":this._legend.alignment===i.Alignment.Left||this._legend.alignment===i.Alignment.Right?"vertical":"horizontal",this._legendSvg.selectAll("*").remove(),this._legend.definition&&this._legend.definition.type&&this._legend.definition.type===i.LegendType.Gradient){this.renderGradientLegend();let t=this._legendSvg.node().getBoundingClientRect();this._renderedRect=new i.Rect(t.left,t.top,t.right-t.left+40,t.bottom-t.top)}else{this.renderDiscreteLegend(t);let e=this._legendSvg.node().getBoundingClientRect();this._renderedRect=new i.Rect(e.left,e.top,e.right-e.left,e.bottom-e.top)}}};class v extends u.UIElementRenderer{constructor(){super(),this.MIN_MARGIN={TOP:0,BOTTOM:10,LEFT:0,RIGHT:10},this.LEGEND_PADDING={X:10,Y:{TOP:10,BOTTOM:10}},this.AXIS_PADDING={X:10,Y:{TOP:10,BOTTOM:10}},this._fillColors=new WeakMap,this._strokeColors=new WeakMap;let t=this;this._options={},this._minSvgWidth=0,this._maxGraphWidth=Number.MAX_VALUE,this._maxSvgWidth=Number.MAX_VALUE,this._interactionState=new o.InteractionState((function(e){t._focus(e)}),(function(e){t._unfocus(e)}),!1,(function(e){t._select(e)}),(function(e){t._unselect(e)}))}cursorChange(t){}zoom(t){}brush(t){}render(t){}configureTooltip(){}createLayout(){}setColorManager(t){this._colorMgr=t}initialize(t,e,n){this._element=t,this._renderer=e,this._tooltipId="d3-tooltip",this._tooltipAnalyticsName="d3-ui-widget-toolkit",this._parent=n;let r=n.node();r&&(this._options.width||(this._options.width=r.getBoundingClientRect().width),this._svgRect=new i.Rect(0,0,this._options.width,0),this._svg=n.append("svg")),this._handleWidth=10,this._graphRect=new i.Rect(0,0,0,this.DEFAULT_GRAPH_HEIGHT),this._requiresRelayout=!0}loadOptions(t){void 0!==t&&(t.width&&t.width!==this._options.width&&(this._requiresRelayout=!0),t.height&&t.height!==this._options.height&&(this._requiresRelayout=!0),t.topMargin&&t.topMargin!==this._options.topMargin&&(this._requiresRelayout=!0),t.bottomMargin&&t.bottomMargin!==this._options.bottomMargin&&(this._requiresRelayout=!0),t.leftMargin&&t.leftMargin!==this._options.leftMargin&&(this._requiresRelayout=!0),t.rightMargin&&t.rightMargin!==this._options.rightMargin&&(this._requiresRelayout=!0),r.merge(this._options,t))}getElement(){return this._element}getOptions(){return this._options}getAnimateDuration(){return void 0!==this._options.animateDuration?this._options.animateDuration:1e3}getRenderedCss(){return new i.Css}getTooltipData(t){return[{source:this._element,group:"",metrics:{}}]}hover(t){this.focus(t)}focus(t){this._interactionState.focus(t)}select(t){this._interactionState.select(t)}_focus(t){let e=this;t&&e._svg.selectAll("."+t).each((function(){h(l.select(this),e._fillColors,e._strokeColors)}))}_unfocus(t){let e=this;t.length>0&&e._svg.selectAll("."+t).each((function(){f(l.select(this),e._fillColors,e._strokeColors)}))}_select(t){let e=this;t&&e._svg.selectAll("."+t).each((function(){d(l.select(this),e._fillColors,e._strokeColors)}))}_unselect(t){let e=this;t.length>0&&e._svg.selectAll("."+t).each((function(){g(l.select(this),e._fillColors,e._strokeColors)}))}invalidate(t){this.loadOptions(t),this.createLayout(),t.disableResize||this.createHandles(),this.configureTooltip(),this.render(t)}updateHandles(){this._svg.select(".chart-handle.bottom").attr("x",this._graphRect.x).attr("y",this._graphRect.y+this._graphRect.height).attr("width",this._graphRect.width),this._svg.select(".chart-handle.left").attr("x",this._graphRect.x-this._handleWidth-1).attr("y",this._graphRect.y).attr("height",this._graphRect.height),this._svg.select(".chart-handle.right").attr("x",this._graphRect.x+this._graphRect.width+1).attr("y",this._graphRect.y).attr("height",this._graphRect.height)}createHandles(){let t=this;t._options.disableResizeLeft||t._svg.append("rect").attr("opacity",0).attr("width",t._handleWidth).attr("cursor","ew-resize").classed("chart-handle vertical left",!0).call(l.drag().on("start",(function(){v.IS_RESIZING=!0})).on("drag",(function(){if(0===l.event.dx)return;let e=Math.min(t._options.leftMargin+t._graphRect.width,Math.max(t.MIN_MARGIN.LEFT,t._options.leftMargin+l.event.dx)),n={width:t._svg.node().getBoundingClientRect().width,leftMargin:e,xStart:t._options.xStart,xEnd:t._options.xEnd,animateDuration:0};t._element.handleUpdate?t._element.handleUpdate(t._element,n):t.render(n)})).on("end",(function(){v.IS_RESIZING=!1}))),t._options.disableResizeRight||t._svg.append("rect").attr("opacity",0).attr("width",t._handleWidth).attr("cursor","ew-resize").classed("chart-handle vertical right",!0).call(l.drag().on("start",(function(){v.IS_RESIZING=!0})).on("drag",(function(){if(0===l.event.dx)return;t._svg.node();let e=t._options.width+l.event.dx;e=Math.max(t._minSvgWidth,e),e=Math.min(t._maxSvgWidth,e);let n={width:e,xStart:t._options.xStart,xEnd:t._options.xEnd,animateDuration:0};t._element.handleUpdate?t._element.handleUpdate(t._element,n):t.render(n)})).on("end",(function(){v.IS_RESIZING=!1})))}createImage(){let t=this;return new Promise((function(e,n){let r=t._svg,i=Number(r.attr("width")),a=Number(r.attr("height")),o=function(t){t.setAttribute("xlink","http://www.w3.org/1999/xlink"),function(t,e){let n=document.createElement("style");n.setAttribute("type","text/css"),n.innerHTML=t;let r=e.hasChildNodes()?e.children[0]:null;e.insertBefore(n,r)}(function(t){let e=[];e.push("#"+t.id);for(let n=0;n<t.classList.length;n++)i("."+t.classList[n],e)||e.push("."+t.classList[n]);let n=t.getElementsByTagName("*");for(let t=0;t<n.length;t++){let r=n[t].id;i("#"+r,e)||e.push("#"+r);let a=n[t].classList;for(let t=0;t<a.length;t++)i("."+a[t],e)||e.push("."+a[t])}let r="";for(let t=0;t<document.styleSheets.length;t++){let n=document.styleSheets[t];try{if(!n.cssRules)continue}catch(t){if("SecurityError"!==t.name)throw t;continue}let a=n.cssRules;for(let t=0;t<a.length;t++)i(a[t].selectorText,e)&&(r+=a[t].cssText)}return r;function i(t,e){return-1!==e.indexOf(t)}}(t),t);let e=(new XMLSerializer).serializeToString(t);return e=e.replace(/(\w+)?:?xlink=/g,"xmlns:xlink="),e=e.replace(/NS\d+:href/g,"xlink:href"),e}(r.node()),s="data:image/svg+xml;base64,"+btoa(o),u=new Image;u.src=s,u.onload=function(){let t=document.createElement("canvas");t.height=a,t.width=i,t.getContext("2d").drawImage(u,0,0,i,a);let n=t.toDataURL("image/png");e({image:n,type:"image/png",height:a,width:i})}}))}saveImage(){this.createImage().then((function(t){let e=`<img src="${t.image}" height="${t.height}" width="${t.width}">`;l.select("#pngdataurl").html(e);let n=document.createElement("a");n.download="chart.png",n.href=t.image,n.click()}))}}e.SVGRenderer=v},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(0),i=n(8),a=n(2);let o,s={};"undefined"!=typeof document&&(o=document.createElement("canvas").getContext("2d")),e.getTextWidth=function(t,e,n){return o.font=n+"px "+e,o.measureText(t).width};e.UIElementRenderer=class{getOptions(){return this._options}getColorManager(){return this._colorMgr}setColorManager(t){this._colorMgr=t}};class u{constructor(t,e=new i.ColorManager){t&&(this._parentId=t,this._parent=a.select("body").select(t)),e&&(this._colorMgr=e),this._rendererMap=new WeakMap}static register(t,e){s[t]=e}setOnRenderCallback(t){this.onRender=t}clearDiv(t){if(t)for(;t.firstChild;)t.removeChild(t.firstChild)}setDiv(t){this._parent=a.select(t)}getRenderedCss(t){return this._rendererMap.has(t)?this._rendererMap.get(t).getRenderedCss():new r.Css}hover(t,e){this.focus(t,e)}focus(t,e){if(this._rendererMap.has(t))return this._rendererMap.get(t).focus||this._rendererMap.get(t).hover(e),this._rendererMap.get(t).focus(e)}select(t,e){this._rendererMap.has(t)&&this._rendererMap.get(t).select(e)}zoom(t,e){this._rendererMap.has(t)&&this._rendererMap.get(t).zoom(e)}getTooltipData(t,e){return this._rendererMap.has(t)?this._rendererMap.get(t).getTooltipData(e):[{source:t,group:"",metrics:{}}]}cursorChange(t,e){if(this._rendererMap.has(t))return this._rendererMap.get(t).cursorChange(e)}brush(t,e){if(this._rendererMap.has(t))return this._rendererMap.get(t).brush(e)}configureElement(t){if(t.renderer=this,!this._rendererMap.has(t)){this._parent.node()||(this._parent=a.select(this._parentId));let e=s[t.type];if(e){let n=new e(t,this,this._parent);n.setColorManager(this._colorMgr),this._rendererMap.set(t,n)}}}render(t,e={}){t.renderer=this,this.configureElement(t),this._rendererMap.has(t)&&(this._rendererMap.get(t).render(e),t.onRender&&t.onRender(e),this.onRender&&this.onRender(t,e))}invalidate(t,e={}){t.renderer=this,this.configureElement(t),this._rendererMap.has(t)&&(this._rendererMap.get(t).invalidate(e),t.onRender&&t.onRender(e),this.onRender&&this.onRender(t,e))}setColorManager(t){this._colorMgr=t}getColorManager(){return this._colorMgr}destroy(t){this._rendererMap.delete(t)}getOptions(t){if(this._rendererMap.has(t))return this._rendererMap.get(t).getOptions()}}e.D3Renderer=u,e.D3ChartRenderer=u,e.D3GraphRenderer=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(0),i=n(21),a=n(6),o=n(1),s=n(3),u=n(4),l=n(13),c=n(7),h=n(9),f=n(27),d=n(2);function g(t,e){return Math.floor(Math.min(Math.max(t,0),e))}e.getBoundedPixelValue=g;class p{static finalize(t){let e,n;l.addCallbacks(t),t.axes||(t.axes=[]);for(let n=0;n<t.axes.length;++n)if(t.axes[n].alignment===r.Alignment.Bottom||t.axes[n].alignment===r.Alignment.Top){e=n;break}if(void 0===e){let n={type:r.UIType.Axis,axisDesc:{scaleType:i.AxisType.Linear,label:"Values1",scalingInfo:new f.ScalingInfo(1,"")},alignment:r.Alignment.Bottom};e=t.axes.length,t.axes.push(n)}for(let e=0;e<t.axes.length;++e)if(t.axes[e].alignment===r.Alignment.Left||t.axes[e].alignment===r.Alignment.Right){n=e;break}if(void 0===n){let e={type:r.UIType.Axis,axisDesc:{scaleType:i.AxisType.Linear,label:"",scalingInfo:new f.ScalingInfo(1,"")},alignment:r.Alignment.Left};n=t.axes.length,t.axes.push(e)}let a=t.dataSets;for(let t=0;t<a.length;++t){let r=a[t];r.xAxisIdx&&-1!==r.xAxisIdx||(r.xAxisIdx=e),r.yAxisIdx&&-1!==r.yAxisIdx||(r.yAxisIdx=n)}return!0}static mergeCharts(t,e,n,i){if(n.isXContinuous!==i.isXContinuous)throw"Merge chart error - charts mix ordinal and continuous axes";let a={type:r.UIType.Cartesian,category:t,title:e,dataSets:n.dataSets.concat(i.dataSets),axes:n.axes,isXContinuous:n.isXContinuous};return p.finalize(a),a}}e.Chart=p;e.ChartGroup=class{static handleChartUpdate(t,e,n,i){if(t){let a=[],o=[];if(i)for(let t=0;t<i.length;++t){let e=i[t];e.alignment===r.Alignment.Top?a.push(e):e.alignment===r.Alignment.Bottom&&o.push(e)}n.elemManager||(n.elemManager=new l.ElementManager),e.length=0;for(let i=0;i<t.length;++i){let a=t[i];p.finalize(a);for(let e=0;e<a.axes.length;++e)a.axes[e].alignment===r.Alignment.Bottom&&(i!==t.length-1?a.axes[e].hidden=!0:a.axes[e].hidden=!1);if(a.legends)for(let t=0;t<a.legends.length;++t){let e=a.legends[t];e.alignment!==r.Alignment.Top&&e.alignment!==r.Alignment.Bottom||a.legends.splice(t,1)}e[i]=n.sharedOptions,a.manager||n.elemManager.addElement(a,void 0,"default","default")}if(t.length>0){let r=t.length-1;e[r]=n.bottomOptions,a.length>0&&(t[0].legends||(t[0].legends=[]),t[0].legends=t[0].legends.concat(a)),o.length>0&&(t[r].legends||(t[r].legends=[]),t[r].legends=t[r].legends.concat(o))}}}static handleRenderOptionsUpdate(t,e,n){if(t.sharedOptions=o.copy(e),t.sharedOptions.topMargin=1,t.sharedOptions.bottomMargin=1,t.sharedOptions.disableAutoResizeWidth=!0,t.bottomOptions=o.copy(e),t.bottomOptions.topMargin=1,t.bottomOptions.bottomMargin=15,t.bottomOptions.disableAutoResizeWidth=!0,n&&0!==n.length){let e=n.length-1;for(let r=0;r<e;++r)n[r]=t.sharedOptions;n[e]=t.bottomOptions}}static handleRemoveChart(t){t.renderer&&t.renderer.destroy(t),t.manager&&t.manager.removeElement(t)}};class _{constructor(t,e,n,i){if(this._title=e,this._position=i,this._className=o.getSelectionName(n),this._title&&this._title.length>0){this._titleSvg=t.append("text").classed(this._className,!0).text(this._title);let e=this._titleSvg.node().getBoundingClientRect();this._renderedRect=new r.Rect(e.left,e.top,e.width,e.height)}}getPosition(){return this._position}setPosition(t){this._position=t}getRenderedRect(){return this._renderedRect}render(){if(this._titleSvg){let t=this._position.x,e=this._position.y+this._position.height/2;this._titleSvg.attr("transform","translate("+t+","+e+")");let n=this._titleSvg.node().getBoundingClientRect();this._renderedRect=new r.Rect(n.left,n.top,n.width,n.height)}}}class m extends s.SVGRenderer{constructor(t,e,n){super(),this._ignoreZoomHack=!1,this._handleWidth=10,this._hasBottomHandle=!0,this.DEFAULT_GRAPH_HEIGHT=150,this._options.topMargin=0,this._options.bottomMargin=0,this._minGraphHeight=0,this._xMin=Number.MAX_VALUE,this._xMax=-Number.MAX_VALUE,this._zoomMenuItem={title:"Zoom",submenu:[]},this.initialize(t,e,n),this._requiresRelayout=!0,this._brushTooltip=new h.OneLineTooltip("brush","tooltip-t"),this._brushTooltip.setPlaceTooltipLeftRight().alwaysRecalcWidth(!0).setDelay(0);let i,a=this;function u(t){let e=g(d.mouse(a.getGraphGroup().node())[0],a._graphRect.width),n=a._scaleAxis.mapCoordinateToValue(e);if(a._scaleAxis.isBanded()){let e=o.getSelectionName(n);t.event===r.EventType.CursorEnd&&void 0!==i?(a.onHover({caller:a._element,event:r.EventType.HoverEnd,selection:i}),i=void 0):e!==i&&(i&&a.onHover({caller:a._element,event:r.EventType.HoverEnd,selection:i}),a.onHover({caller:a._element,event:r.EventType.HoverStart,selection:e}),i=e)}else t.xEnd=n,function(t){if(!s.SVGRenderer.IS_RESIZING)a.cursorChange(t),a._element.onCursorChanged&&a._element.onCursorChanged(t)}(t);return!0}this.onHover=function(t){if(!s.SVGRenderer.IS_RESIZING)return a.focus(t),a._element.onHover&&a._element.onHover(t),!0},this.cursorEnter=function(){return u({caller:a._element,event:r.EventType.CursorStart})},this.cursorMove=function(){return u({caller:a._element,event:r.EventType.CursorMove})},this.cursorExit=function(){return u({caller:a._element,event:r.EventType.CursorEnd})},this._element.api||(this._element.api={}),this._element.api.getOptions=function(){return a.getOptions()}}getContextMenuItems(){return this._contextMenuItems}getTooltip(){return this._dataTooltip}getTitle(){return this._element.title}getRenderer(){return this._renderer}contextMenu(t,e){let n=this;var r;return"function"==typeof e?r=e:(r=(e=e||{}).onOpen,e.onClose),function(e,i){n._element.brushContextMenuItems&&n._brush&&n._brush.brushEnd(),r&&r();let a=d.mouse(n.getGraphGroup().node()),o=g(a[0],n._graphRect.width),s=a[1],u=n._scaleAxis.mapCoordinateToValue(o);if(n._axes[1]){let e=n._axes[1].mapCoordinateToValue(s);c.showContextMenu(d.event,{x:u,y:e},t)}else c.showContextMenu(d.event,{x:u},t)}}cursorChange(t){if(!this._options.disableHover)switch(t.event){case r.EventType.CursorStart:this._hoverLine&&this._hoverLine.style("display","");break;case r.EventType.CursorMove:this.updateHover(t);break;case r.EventType.CursorEnd:this._hoverLine&&this._hoverLine.style("display","none")}}onZoomChanged(t){this.zoom(t);let e=this._element;e.onZoom&&e.onZoom(t)}updateZoomHelper(t,e,n,r,i){let a=(this._defaultXScale(this._defaultXScale.domain()[1])-this._defaultXScale(this._defaultXScale.domain()[0]))/(this._defaultXScale(n)-this._defaultXScale(e)),o=-this._defaultXScale(e)*a;if(t.call(d.zoom().transform,d.zoomIdentity.translate(o,0).scale(a)),this._options.enableXYZoom){let e=(this._defaultYScale(this._defaultYScale.domain()[1])-this._defaultYScale(this._defaultYScale.domain()[0]))/(this._defaultYScale(i)-this._defaultYScale(r)),n=-this._defaultYScale(r)*e;t.call(d.zoom().transform,d.zoomIdentity.translate(0,n).scale(e))}}updateZoom(t,e,n,r){this._ignoreZoomHack||this.updateZoomHelper(this.getGraphGroup(),t,e,n,r)}zoom(t){if(t.event!==r.EventType.Zoom&&t.event!==r.EventType.RangeUpdate)throw"Error passing a non zoom event to zoom function";if(!this._scaleAxis.isBanded())if(t.event===r.EventType.RangeUpdate)void 0===t.xStart&&void 0===t.xEnd?(this._xMin=this._xMinLimit,this._xMax=this._xMaxLimit):(this._xMin=t.xStart?t.xStart:this._xMinLimit,this._xMax=t.xEnd?t.xEnd:this._xMaxLimit),this._scaleAxis.setDomain([this._xMin,this._xMax]),this.zoom({event:r.EventType.Zoom,xStart:this._options.xStart,xEnd:this._options.xEnd});else if(t.event===r.EventType.Zoom){if(this._options.disableZoomViewUpdate){let e=this._scaleAxis.getScale();if(this._brush.disableCallbacks(),this._options.enableXYZoom){let n=this._axes[1].getScale();this._brush.brushMove([[e(t.xStart),n(t.yStart)],[e(t.xEnd),n(t.yEnd)]])}else this._brush.brushMove([e(t.xStart),e(t.xEnd)]);this._brush.enableCallbacks()}else t.xStart=t.xStart<this._xMin?this._xMin:t.xStart,t.xEnd=t.xEnd>this._xMax?this._xMax:t.xEnd,this.updateZoom(t.xStart,t.xEnd,t.yStart,t.yEnd),this.render(t);this._options.xStart=t.xStart,this._options.xEnd=t.xEnd,this._options.yStart=t.yStart,this._options.yEnd=t.yEnd}}brush(t){let e;if(this._options.enableXYZoom){let n=this._axes[1],r=this._scaleAxis.getScale()(t.xStart),i=this._scaleAxis.getScale()(t.xEnd);e=[[r,t.yStart?n.getScale()(t.yStart):0],[i,t.yEnd?n.getScale()(t.yEnd):n.getRangePixels()]]}else{e=[this._scaleAxis.getScale()(t.xStart),this._scaleAxis.getScale()(t.xEnd)]}if(this._brush)switch(t.event){case r.EventType.BrushStart:t.caller!==this._element&&(this._brush.disableCallbacks(),this._brush.brushStart(e),this._brush.enableCallbacks()),this._brush.moveToFront();break;case r.EventType.BrushMove:t.caller!==this._element&&(this._brush.disableCallbacks(),this._brush.brushMove(e),this._brush.enableCallbacks());break;case r.EventType.BrushEnd:this._options.showSelectionAsOverlay||(this._options.forceBrushToFront||this._brush.moveToBack(),this._brush.disableCallbacks(),this._brush.brushEnd(),this._brush.enableCallbacks())}}getGraphGroup(){return this._svg.select(".graphGroup")}getTooltipData(t){let e=this._element,n=[],r={};for(let i=0;i<e.dataSets.length;++i){let a=e.dataSets[i],o=this._seriesMap.get(a);if(o){let e=o.getTooltipMetrics(this._element,t);for(let t=0;t<e.length;++t){let i=e[t];if(r.hasOwnProperty(i.group)){let t=r[i.group];for(let e in i.metrics)t.metrics[e]=i.metrics[e]}else r[i.group]=i,n.push(i)}}}return n}populateTooltip(t,e){let n,r=this._element,i=r.title?r.title:"",a=this._scaleAxis.mapCoordinateToValue(t),o=0,s=0;if(this._axes[1]&&(o=this._axes[1].mapCoordinateToValue(e),s=this._axes[1].mapCoordinateToValue(e-1)),this._scaleAxis.isBanded()){if(void 0===a)return;i+=" for "+a}else if(n=this._scaleAxis.mapCoordinateToValue(t-1),this._scaleAxis.getAxis().options&&this._scaleAxis.getAxis().options.tickMappingFunc)i+=" at "+this._scaleAxis.getAxis().options.tickMappingFunc(a)+this._scaleAxis.getAxis().axisDesc.scalingInfo.baseScale.units;else{let t=this._scaleAxis.getScale().domain(),e=f.getScalar(this._scaleAxis.getAxis().axisDesc.scalingInfo,t[1]-t[0]);i+=" at "+(a*e.scalar).toLocaleString()+e.units}let u=[];if(u=this._scaleAxis.isBanded()?this.getTooltipData({selection:a}):this.getTooltipData({xEnd:a}),r.onTooltip){let t={tooltip:this._dataTooltip,defaultData:u};this._dataTooltip.setData(i,[]),this._scaleAxis.isBanded()?r.onTooltip({caller:this._element,selection:a,data:t,defaultTitle:i,defaultClass:this}):r.onTooltip({caller:this._element,xStart:n,xEnd:a,yStart:o,yEnd:s,data:t,defaultTitle:i,defaultClass:this})}else this._dataTooltip.setData(i,u)}configureZoomHelper(t){let e=this;if(!(e._scaleAxis.isBanded()||(e._defaultXScale=e._scaleAxis.getScale().copy(),this._options.disableZoomViewUpdate||e._options.disableZoomMouseWheel||this._options.enableXYZoom))){let n=function(){let t=d.event.transform.rescaleX(e._defaultXScale),n={event:r.EventType.Zoom,xStart:t.domain()[0],xEnd:t.domain()[1],caller:e._element};e._ignoreZoomHack=!0,e.onZoomChanged(n),e._ignoreZoomHack=!1};e._zoom=d.zoom().scaleExtent([1,Number.MAX_SAFE_INTEGER]).on("zoom",n),t.call(e._zoom)}}configureZoom(){this.configureZoomHelper(this.getGraphGroup())}configureBrushHelper(t){let e=this,n=e._axes[1];function i(t){return e._options.enableXYZoom?t[0][0]:t[0]}function a(t){return e._options.enableXYZoom?t[1][0]:t[1]}function o(t){return e._options.enableXYZoom?t[0][1]:void 0}function u(t){return e._options.enableXYZoom?t[1][1]:void 0}function l(t,r){let s=e._element,l={event:r,caller:s};return t&&(l.xStart=e._scaleAxis.mapCoordinateToValue(i(t)),l.xEnd=e._scaleAxis.mapCoordinateToValue(a(t)),n&&(l.yStart=n.mapCoordinateToValue(o(t)),l.yEnd=n.mapCoordinateToValue(u(t)))),e.brush(l),s.onBrush&&s.onBrush(l),null!==t}let h=function(t){if(null!==t)if(e._options.enableXYZoom&&!n.isBanded())if(e._scaleAxis.getAxis().options&&e._scaleAxis.getAxis().options.tickMappingFunc){let r=e._scaleAxis.getAxis().options.tickMappingFunc;e._brushTooltip.setData("Selection","("+r(e._scaleAxis.mapCoordinateToValue(i(t)))+", "+n.mapCoordinateToValue(o(t))+") - ("+r(e._scaleAxis.mapCoordinateToValue(a(t)))+", "+n.mapCoordinateToValue(u(t))+")")}else{let r=e._scaleAxis.getScale().domain(),s=f.getScalar(e._scaleAxis.getAxis().axisDesc.scalingInfo,r[1]-r[0]),l=e._scaleAxis.mapCoordinateToValue(i(t)),c=e._scaleAxis.mapCoordinateToValue(a(t)),h=n.mapCoordinateToValue(o(t)),d=n.mapCoordinateToValue(u(t));e._brushTooltip.setData("Selection","("+(l*s.scalar).toLocaleString()+s.units+", "+h.toLocaleString()+") - ("+(c*s.scalar).toLocaleString()+s.units+", "+d.toLocaleString()+")")}else if(e._scaleAxis.getAxis().options&&e._scaleAxis.getAxis().options.tickMappingFunc){let n=e._scaleAxis.getAxis().options.tickMappingFunc;e._brushTooltip.setData("Selection",n(e._scaleAxis.mapCoordinateToValue(i(t)))+" - "+n(e._scaleAxis.mapCoordinateToValue(a(t))))}else{let n=e._scaleAxis.getScale().domain(),r=f.getScalar(e._scaleAxis.getAxis().axisDesc.scalingInfo,n[1]-n[0]),o=e._scaleAxis.mapCoordinateToValue(i(t)),s=e._scaleAxis.mapCoordinateToValue(a(t));e._brushTooltip.setData("Selection",(o*r.scalar).toLocaleString()+r.units+" - "+(s*r.scalar).toLocaleString()+r.units+" = "+((s-o)*r.scalar).toLocaleString()+r.units)}},g=function(t,r){let s={event:t,xStart:e._scaleAxis.mapCoordinateToValue(i(r)),xEnd:e._scaleAxis.mapCoordinateToValue(a(r)),caller:e._element};return n&&(s.yStart=n.mapCoordinateToValue(o(r)),s.yEnd=n.mapCoordinateToValue(u(r))),s},p=function(t){return e._brush.moveToFront(),h(t),e._dataTooltip.onMouseLeave(d.event),e._brushTooltip.onMouseEnter(d.event),e._brushTooltip.onMouseMove(d.event),l(t,r.EventType.BrushStart)},_=function(t){return h(t),e._dataTooltip.onMouseLeave(d.event),e._brushTooltip.onMouseMove(d.event),e._options.disableZoomViewUpdate?(l(t,r.EventType.BrushMove)&&e.onZoomChanged(g(r.EventType.Zoom,t)),!0):l(t,r.EventType.BrushMove)},m=function(t){e._brushTooltip.onMouseLeave(d.event);let n=e._element.brushContextMenuItems;if(t&&n){let i=[];e._scaleAxis.isBanded()||i.push({title:"Zoom",action(n,i,a){e.onZoomChanged({event:r.EventType.Zoom,xStart:i.xStart,xEnd:i.xEnd,caller:i.caller}),l(t,r.EventType.BrushEnd)}});for(let e=0;e<n.length;++e){let a=n[e];i.push({title:a.title,action(e,n,i){a.action(e,n,i),l(t,r.EventType.BrushEnd)}})}c.showContextMenu(d.event.sourceEvent,g(r.EventType.BrushEnd,t),i)}else if(l(t,r.EventType.BrushEnd)&&!e._scaleAxis.isBanded())e.onZoomChanged(g(r.EventType.Zoom,t));else{let t=document.getElementsByClassName("context-menu");t.length>0&&(t[0].style.display="none")}return e._options.showSelectionAsOverlay&&(e._options.forceBrushToFront||e._brush.moveToBack()),!0},y=e._scaleAxis.getAxis().options&&e._scaleAxis.getAxis().options.enableOrdinalBrushSelection;e._scaleAxis.isBanded()&&!y||(t.select(".brush").remove(),e._brush=(new s.Brush).setXY(e._options.enableXYZoom).setTarget(t.append("g").attr("class","brush")).setStartCallback(p).setMoveCallback(_).setEndCallback(m).setRect(new r.Rect(0,0,e._graphRect.width,e._svgRect.height)).ready(),e._brush.moveToBack())}configureBrush(){this.configureBrushHelper(this.getGraphGroup())}configureContextMenu(){this.getGraphGroup().on("contextmenu",this.contextMenu(this._contextMenuItems,this._dataTooltip?this._dataTooltip.onMouseLeave:void 0))}configureTooltip(){let t=this;return this._dataTooltip=new h.CustomDivTooltip(t._tooltipId,"tooltip-t"),this._dataTooltip.setTarget(t.getGraphGroup()).setTarget(t._bottomHandle).setAnalyticsName(t._tooltipAnalyticsName).setPlaceTooltipLeftRight().alwaysRecalcWidth(!0).setDelay(t._options.tooltipDelay?t._options.tooltipDelay:0),void(this._options.disableTooltip||this._dataTooltip.setEnterCallback(e).setMoveCallback(e));function e(){if(s.SVGRenderer.IS_RESIZING)return;let e=d.mouse(t.getGraphGroup().node()),n=g(e[0],t._graphRect.width),r=e[1];return t.populateTooltip(n,r),!0}}_focus(t){t&&this._seriesMap.forEach((function(e){e.focus(t)}))}_unfocus(t){this._seriesMap.forEach((function(e){e.unfocus(t)}))}_select(t){t&&this._seriesMap.forEach((function(e){e.select(t)}))}_unselect(t){this._seriesMap.forEach((function(e){e.unselect(t)}))}updateHover(t){if(this._hoverLine){let e=this._scaleAxis.getScale();if(!this._scaleAxis.isBanded()){let n=t.xEnd,r=e(n)+this._options.leftMargin;isNaN(r)||("number"!=typeof n&&(r+=e.bandwidth()/2),this._hoverLine.attr("transform",(function(){return"translate("+r+",0)"})))}}}configureCursorTracking(){let t=this.getGraphGroup();if(!t.select(".overlay").node()){let n=t.append("rect").attr("class","overlay").attr("fill","none").attr("pointer-events","all");var e=n.node().parentNode.firstChild;e&&n.node().parentNode.insertBefore(n.node(),e)}t.select(".overlay").attr("width",this._graphRect.width).attr("height",this._graphRect.height)}getLegendPositions(){let t={},e=this._element.legends;if(e)for(let n=0;n<e.length;++n){let r=e[n];t[r.alignment]=r}return t}static register(t){m.SERIES_RENDERERS.push(t)}addToD3SeriesMap(t,e){let n,r=this._element,i=this._axes[t.xAxisIdx],a=this._axes[t.yAxisIdx],o=r.isXContinuous;for(let r=0;r<m.SERIES_RENDERERS.length;++r){let s=m.SERIES_RENDERERS[r];if(s.canRender(t)){n=new s(this,t,e,i,a,o);break}}return n&&this._seriesMap.set(t,n),n}createHandles(){super.createHandles();let t=this;t.hasBottomHandle()&&(t._bottomHandle=t._svg.append("rect").attr("opacity",0).attr("height",t._handleWidth).attr("cursor","ns-resize").classed("chart-handle horizontal bottom",!0).call(d.drag().on("start",(function(){s.SVGRenderer.IS_RESIZING=!0})).on("drag",(function(){if(0===d.event.dy)return;let e={height:Math.max(0,t._options.height+d.event.dy),xStart:t._options.xStart,xEnd:t._options.xEnd,animateDuration:0};t.render(e)})).on("end",(function(){s.SVGRenderer.IS_RESIZING=!1}))))}updateGraphRect(){if(this._options.width)this._svgRect.width=this._options.width;else{let t=this._parent.node();t&&(this._svgRect.width=t.getBoundingClientRect().width)}if(this._options.height)this._graphRect.height=this._options.height;else{let t=this._parent.node();if(t){let e=t.getBoundingClientRect(),n=e.height;e.height?(this._options.fitToWindow=!0,this._options.height=e.height):n=this.DEFAULT_GRAPH_HEIGHT,this._graphRect.height=n-this._options.topMargin-this._options.bottomMargin}}let t=this._options.leftMargin?this._options.leftMargin:0;this._graphRect.x=t,this._graphRect.y=this._options.topMargin;let e=t+(this._options.rightMargin?this._options.rightMargin:0);this._graphRect.width=this._svgRect.width-e,this._svgRect.width<this._options.leftMargin+this._options.rightMargin&&console.log("Error margins too wide for graph"),this._minGraphHeight&&(this._graphRect.height=Math.max(this._minGraphHeight,this._graphRect.height),this._options.height=this._graphRect.height)}createLayout(){let t=this,e=t._element;t._requiresRelayout=!1,this._svg&&this._svg.selectAll("*").remove(),this.updateGraphRect(),t._legends=[],t._axes=[],t._seriesMap=new Map;let n=[],o=0;if(!t._options.hideRowTitle){let n=e.title?e.title:"";t._title=new _(t._svg,n,"lane-title");let r=t._title.getRenderedRect();o=r?r.width:0}t._options.disableBackground||(t._backgroundSVG=this._svg.append("rect").classed("chart-background",!0));for(let t=0;t<e.axes.length;++t){let i=e.axes[t],a=new f.D3Axis(this._svg,i,new r.Rect(this._options.leftMargin,0,0,0));this._axes[t]=a,i.alignment!==r.Alignment.Left&&i.alignment!==r.Alignment.Right||n.push(a)}let u=t.getLegendPositions();for(let n in u){let r=new s.D3Legend(t._svg,u[n],e.title);t._legends.push(r)}let l,c,h=!1,d=e.dataSets;if(void 0!==d){t._graphSvg=this._svg.append("g").attr("class","graphGroup").append("svg");for(let n=0;n<d.length;++n){let r=d[n],o=0!=(r.renderType&a.RenderType.Stacked);if(o&&r.renderType-a.RenderType.Stacked==0){console.warn("Error RenderType.Stacked must be used with a line, area or bar type");continue}let u=t._axes[r.xAxisIdx],l=t.addToD3SeriesMap(r,t._graphSvg);if(!l)continue;if(!l.isXContinuousSeries()){if(e.isXContinuous)throw"Error cannot render continuous and banded data in one chart";h=!0}if(t._minGraphHeight=Math.max(l.getRequiredHeight(),t._minGraphHeight),h){let t=l.getDiscreteXValues(o),e=l;if(e.getBarsPerDomain&&e.getLevelKeys){u.setKeysPerDomain(e.getBarsPerDomain(o));let t=e.getLevelKeys();for(let e=0;e<t.length;++e)u.appendDomain(t[e],e)}else u.appendDomain(t);u.setBanded(!0);let n=e.getRequiredWidth();0!==n&&this._graphRect.width<n&&(this._options.width=n+this._options.leftMargin+this._options.rightMargin,this._requiresRelayout=!0)}else{let e=l.getXMinMax(),n=u.getDomain();n?(n[0]=Math.min(n[0],e[0]?e[0]:Number.MAX_VALUE),n[1]=Math.max(n[1],e[1]?e[1]:-Number.MAX_VALUE),u.setDomain(n),t._xMin=Math.min(n[0],t._xMin),t._xMax=Math.max(n[1],t._xMax)):(u.setDomain([e[0],e[1]]),t._xMin=Math.min(e[0],t._xMin),t._xMax=Math.max(e[1],t._xMax)),t._xMinLimit=t._xMin,t._xMaxLimit=t._xMax}let c=t._axes[r.yAxisIdx];if(e.axes[r.yAxisIdx].axisDesc.scaleType!==i.AxisType.Ordinal&&l.isYContinuousSeries()){let t=l.getYMinMax(),e=c.getDomain();e?c.setDomain([Math.min(e[0],t[0]?t[0]:Number.MAX_VALUE),Math.max(e[1],t[1]?t[1]:-Number.MAX_VALUE)]):c.setDomain(t),e=c.getDomain(),c.getAxis().options&&c.getAxis().options.enableZeroOffset&&(e[0]>0&&e[1]>0?e[0]=0:e[0]<0&&e[1]<0&&(e[1]=0))}else{let t=l.getDiscreteYValues(),e=c.getDomain();e?s.mergeKeys(e,t):c.setDomain(t),c.setBanded(!0)}}t._minGraphHeight&&(t._options.height=t._minGraphHeight,t._hasBottomHandle=!1);for(let e in t._axes){let n=t._axes[e].getAxis().alignment;if(n===r.Alignment.Top||n===r.Alignment.Bottom){let i=t._axes[e];i.commitRange(t._graphRect.width),n!==r.Alignment.Bottom||l||(l=i),n!==r.Alignment.Top||c||(c=i)}}l?t._scaleAxis=l:c&&(t._scaleAxis=c),t._graphRect.width=t._scaleAxis.getRangePixels(),t._scaleAxis.isBanded()&&(t._maxGraphWidth=t._graphRect.width);for(let t=0;t<n.length;++t){let e=n[t],r=e.getAxis().axisDesc.range;r&&void 0!==r.min&&e.setDomain([r.min,r.max])}if(!this._options.disableAutoResizeWidth){let e=0,i=0;for(let a=0;a<n.length;++a){let o=n[a];o.commitRange(t._options.height),o.render();let s=0;o.getRenderedRect()&&(s=o.getRenderedRect().width+t.AXIS_PADDING.X),o.getAxis().alignment===r.Alignment.Right?i+=s:e+=s}let a=i,s=e;a+=this._handleWidth+this.MIN_MARGIN.RIGHT,s+=this._handleWidth;let l="";for(let e=0;e<d.length;++e){let n=d[e],r="";n.decimator&&(r=n.decimator.getName());let i=t._seriesMap.get(n);if(void 0!==i)for(let t=0;t<n.data.length;++t){let t=i.getName()+r;l=t.length>l.length?t:l,void 0!==i.getMaxName&&(t=i.getMaxName()+r,l=t.length>l.length?t:l)}}for(let e=0;e<t._legends.length;++e){let n=t._legends[e];n.setItems([{key:l}]),n.setPosition(new r.Rect(0,0,0,0)),n.render(),n.setItems([]);let i=n.getRenderedRect().width;n.getAlignment()===r.Alignment.Left&&(s+=Math.max(i,o)),n.getAlignment()===r.Alignment.Right&&(a+=i)}if(u.hasOwnProperty(r.Alignment.Left.toString())||(s+=o),void 0===t._options.leftMargin||void 0===t._options.rightMargin||s>t._options.leftMargin||a>t._options.rightMargin){let e=void 0!==t._options.leftMargin?t._options.leftMargin:0,n=void 0!==t._options.rightMargin?t._options.rightMargin:0;t._options.leftMargin=Math.max(s,e),t._options.rightMargin=Math.max(a,n),t._minSvgWidth=t._options.leftMargin+t._options.rightMargin,t._maxSvgWidth=t._maxGraphWidth+t._options.leftMargin+t._options.rightMargin,t._options.width=Math.min(t._options.width,t._maxSvgWidth),t._requiresRelayout=!0}if(t._requiresRelayout)return void t.createLayout()}t.configureZoom()}else console.log("Error: No Layers defined in chart")}updateAxes(t){let e=this,n=e._scaleAxis.getScale();if(e._scaleAxis.getAxis().axisDesc.scaleType===i.AxisType.Logarithmic&&e._options.xStart<1&&(e._options.xStart=1,n.domain([e._options.xStart,e._options.xEnd])),!this._options.disableZoomViewUpdate&&e._options.hasOwnProperty("xStart")&&void 0!==e._options.xStart&&e._options.hasOwnProperty("xEnd")&&void 0!==e._options.xEnd?n.domain([e._options.xStart,e._options.xEnd]):n.domain(e._scaleAxis.getDomain()),this._options.enableXYZoom){let n=e._axes[1],r=n.getScale();n.getAxis().axisDesc.scaleType===i.AxisType.Logarithmic&&e._options.yStart<1&&(e._options.yStart=1,r.domain([e._options.yEnd,e._options.yStart])),!this._options.disableZoomViewUpdate&&e._options.hasOwnProperty("yStart")&&void 0!==e._options.yStart&&e._options.hasOwnProperty("yEnd")&&void 0!==e._options.yEnd&&r.domain([t.yEnd,t.yStart])}}addHoverline(){this._hoverLine&&this._hoverLine.remove(),this._hoverLine=this._svg.append("line").attr("class","hover-line").attr("x1",0).attr("x2",0).attr("y1",this._graphRect.y-this._options.topMargin).attr("y2",this._graphRect.y+this._graphRect.height+this._options.bottomMargin).attr("stroke","#222222").attr("stroke-width",1).attr("pointer-events","none").style("display","none"),this.getGraphGroup().on("mouseover",this.cursorEnter).on("mousemove",this.cursorMove).on("mouseout",this.cursorExit)}configureSVG(t){this._graphSvg.attr("width",this._graphRect.width).attr("height",this._graphRect.height),this._svg.attr("width",this._svgRect.width).attr("height",this._svgRect.height),this._svg.attr("width",this._svgRect.width).attr("height",this._svgRect.height),this._backgroundSVG&&this._backgroundSVG.attr("x",t).attr("y",0).attr("width",this._svgRect.x+this._svgRect.width-t).attr("height",this._svgRect.height)}hasBottomHandle(){return!this._options.disableResizeBottom&&this._hasBottomHandle}updateLayout(t){let e=this;if(e.updateGraphRect(),e._options.rightMargin=e._svgRect.width-(e._graphRect.x+e._graphRect.width),this._legends)for(let t=0;t<this._legends.length;++t){let n=this._legends[t];n.getAlignment()===r.Alignment.Top&&(n.setPosition(new r.Rect(e._graphRect.x,e._options.topMargin,e._graphRect.width,0)),n.getRenderedRect()||(n.setItems([{key:"dummy",color:"white",opacity:"1",shape:"rect"}]),n.render(),n.setItems([])),e._graphRect.y+=n.getRenderedRect().height)}for(let t in e._axes){let n=e._axes[t];n.getAxis().alignment===r.Alignment.Top&&(n.commitRange(e._graphRect.width),n.getAxis().hidden||(n.setPosition(new r.Rect(e._graphRect.x,e._graphRect.y)),n.render(),e._graphRect.y+=n.getRenderedRect().height,n.setPosition(new r.Rect(e._graphRect.x,e._graphRect.y)),n.render()))}e.getGraphGroup().attr("transform","translate("+e._graphRect.x+","+e._graphRect.y+")"),e._svgRect.height=e._graphRect.y+e._graphRect.height;let n=e._graphRect.x,i=0,a=0,o=!1;for(let t in e._axes){let s,u=e._axes[t];switch(u.getAxis().alignment){case r.Alignment.Left:s=new r.Rect(e._graphRect.x-i,e._graphRect.y),u.commitRange(e._graphRect.height);break;case r.Alignment.Right:s=new r.Rect(e._graphRect.x+e._graphRect.width+a,e._graphRect.y),u.commitRange(e._graphRect.height);break;case r.Alignment.Bottom:s=new r.Rect(e._graphRect.x,e._graphRect.y+e._graphRect.height),u.commitRange(e._graphRect.width)}if(!u.getAxis().hidden&&u.getAxis().alignment!==r.Alignment.Top){u.setPosition(s),u.render();let t=u.getRenderedRect().width;switch(u.getAxis().alignment){case r.Alignment.Left:i+=t+e.AXIS_PADDING.X,n-=t;break;case r.Alignment.Right:a+=t+e.AXIS_PADDING.X;break;case r.Alignment.Bottom:o=!0,e._svgRect.height+=u.getRenderedRect().height}}}if(e._title&&e._title.getRenderedRect()){let t=e._graphRect.x-i-e._title.getRenderedRect().width-10;t=Math.max(0,t),e._title.setPosition(new r.Rect(t,e._graphRect.y,0,e._graphRect.height)),e._title.render()}if(this._legends)for(let t=0;t<this._legends.length;++t){let n=this._legends[t];switch(n.getAlignment()){case r.Alignment.Left:n.setPosition(new r.Rect(0,e._graphRect.y,0,e._graphRect.height));break;case r.Alignment.Right:n.setPosition(new r.Rect(e._graphRect.x+e._graphRect.width+a+e.LEGEND_PADDING.X,e._graphRect.y,0,e._graphRect.height));break;case r.Alignment.Bottom:o=!0,n.setPosition(new r.Rect(e._graphRect.x,e._svgRect.height+e.LEGEND_PADDING.Y.BOTTOM,e._graphRect.width,0)),n.getRenderedRect()?(n.render(),e._svgRect.height+=e.LEGEND_PADDING.Y.BOTTOM+n.getRenderedRect().height):(n.setItems([{key:"dummy",color:"white",opacity:"1",shape:"rect"}]),n.render(),e._svgRect.height+=e.LEGEND_PADDING.Y.BOTTOM+n.getRenderedRect().height,n.setItems([]))}}e._svgRect.height+=e._options.bottomMargin,!o&&e.hasBottomHandle()&&(e._svgRect.height=Math.max(e._handleWidth,e._svgRect.height)),e.addHoverline(),e.configureSVG(n),e.updateHandles(),o||e._svg.select(".chart-handle.bottom").attr("y",e._graphRect.y+e._graphRect.height-e._handleWidth)}updateLayoutToFit(t){let e=this;if(e.updateGraphRect(),e._svgRect.height=this._options.height,e._graphRect.height-=e._options.topMargin,e._graphRect.height-=e._options.bottomMargin,this._legends)for(let t=0;t<this._legends.length;++t){let n=this._legends[t];n.getAlignment()===r.Alignment.Top&&(n.setPosition(new r.Rect(e._graphRect.x,e._options.topMargin,e._graphRect.width,0)),n.getRenderedRect()||(n.setItems([{key:"dummy",color:"white",opacity:"1",shape:"rect"}]),n.render(),n.setItems([])),e._graphRect.y+=n.getRenderedRect().height,e._graphRect.height-=n.getRenderedRect().height)}for(let t in e._axes){let n=e._axes[t];n.getAxis().alignment===r.Alignment.Top&&(n.commitRange(e._graphRect.width),n.getAxis().hidden||(n.setPosition(new r.Rect(e._graphRect.x,e._graphRect.y)),n.render(),e._graphRect.y+=n.getRenderedRect().height,n.setPosition(new r.Rect(e._graphRect.x,e._graphRect.y)),n.render(),e._graphRect.height-=n.getRenderedRect().height))}e.getGraphGroup().attr("transform","translate("+e._graphRect.x+","+e._graphRect.y+")");let n=!1;for(let t=0;t<this._legends.length;++t){let i=this._legends[t];i.getAlignment()===r.Alignment.Bottom&&(n=!0,i.setPosition(new r.Rect(e._graphRect.x,e._svgRect.height+e.LEGEND_PADDING.Y.BOTTOM,e._graphRect.width,0)),i.getRenderedRect()?i.render():(i.setItems([{key:"dummy",color:"white",opacity:"1",shape:"rect"}]),i.render(),i.setItems([])),e._graphRect.height-=e.LEGEND_PADDING.Y.BOTTOM+i.getRenderedRect().height,i.setPosition(new r.Rect(e._graphRect.x,e._svgRect.height-i.getRenderedRect().height-e.LEGEND_PADDING.Y.BOTTOM,e._graphRect.width,0)),i.render())}for(let t in e._axes){let i,a=e._axes[t];if(a.getAxis().alignment===r.Alignment.Bottom&&(n=!0,i=new r.Rect(e._graphRect.x,e._graphRect.y+e._graphRect.height),a.commitRange(e._graphRect.width),!a.getAxis().hidden)){a.setPosition(i),a.render(),a.getRenderedRect().width,e._graphRect.height-=a.getRenderedRect().height,i=new r.Rect(e._graphRect.x,e._graphRect.y+e._graphRect.height),a.setPosition(i),a.render();break}}let i=e._graphRect.x,a=0,o=0;for(let t in e._axes){let n,s,u=e._axes[t];switch(u.getAxis().alignment){case r.Alignment.Left:n=new r.Rect(e._graphRect.x,e._graphRect.y),u.commitRange(e._graphRect.height),u.setPosition(n),u.render(),s=u.getRenderedRect().width,a+=s,i-=s;break;case r.Alignment.Right:n=new r.Rect(e._graphRect.x+e._graphRect.width,e._graphRect.y),u.commitRange(e._graphRect.height),u.setPosition(n),u.render(),s=u.getRenderedRect().width,o+=s}}if(e._title.getRenderedRect()){let t=e._graphRect.x-a-e._title.getRenderedRect().width-10;t=Math.max(0,t),e._title.setPosition(new r.Rect(t,e._graphRect.y,0,e._graphRect.height)),e._title.render()}for(let t=0;t<this._legends.length;++t){let n=this._legends[t];switch(n.getAlignment()){case r.Alignment.Left:n.setPosition(new r.Rect(0,e._graphRect.y,0,0));break;case r.Alignment.Right:n.setPosition(new r.Rect(e._graphRect.x+e._graphRect.width+o+e.LEGEND_PADDING.X,e._graphRect.y,0,0))}}e.addHoverline(),e.configureSVG(i),e.updateHandles(),n||e._svg.select(".chart-handle.bottom").attr("y",e._graphRect.y+e._graphRect.height-e._handleWidth)}addZoomContextMenuItem(t,e){let n={title:t,action:function(t,n,r){e()},disabled:!1};this._contextMenuItems.indexOf(this._zoomMenuItem)&&this._contextMenuItems.push(this._zoomMenuItem),this._zoomMenuItem.submenu.push(n)}updateZoomFunctions(){let t=this,e=t._options.xStart?t._options.xStart:t._xMin,n=t._options.xEnd?t._options.xEnd:t._xMax,i=n-e,a=t._element;a.api||(a.api={}),a.api.zoomReset=function(){let e={caller:t._element,event:r.EventType.Zoom,xStart:t._xMin?t._xMin:void 0,xEnd:t._xMax?t._xMax:void 0,yStart:void 0,yEnd:void 0};t.onZoomChanged(e)};let o=e+.3*i,s=n-.3*i;a.api.zoomIn=function(){let e={caller:t._element,event:r.EventType.Zoom,xStart:o,xEnd:s,yStart:t._options.yStart,yEnd:t._options.yEnd};t.onZoomChanged(e)};let u=e-i*(.3/.4),l=n+i*(.3/.4);a.api.zoomOut=function(){let e={caller:t._element,event:r.EventType.Zoom,xStart:t._xMin>u?t._xMin:u,xEnd:t._xMax<l?t._xMax:l,yStart:t._options.yStart,yEnd:t._options.yEnd};t.onZoomChanged(e)},a.api.rangeUpdate=function(e){e.event=r.EventType.RangeUpdate,t.onZoomChanged(e)},a.api.rangeReset=function(){let e={caller:t._element,event:r.EventType.RangeUpdate};t.onZoomChanged(e)}}createZoomMenuItems(){let t=this,e=t._element;e.api||(e.api={}),this._zoomMenuItem.submenu=[];let n=!(void 0===t._options.xStart&&void 0===t._options.xEnd)&&(t._options.xStart&&t._options.xStart!==t._xMin||t._options.xEnd&&t._options.xEnd!==t._xMax);t._options.disableZoomViewUpdate||t.addZoomContextMenuItem("Zoom In",e.api.zoomIn),n&&(t.addZoomContextMenuItem("Zoom Out",e.api.zoomOut),t.addZoomContextMenuItem("Reset",e.api.zoomReset))}updatePanFunctions(){let t=this,e=t._element;if(e.api||(e.api={}),e.api.panLeft=function(){console.log("Either start or end is undefined for pannning")},e.api.panRight=function(){console.log("Either start or end is undefined for pannning")},t._options.xStart&&t._options.xEnd){let n=t._options.xStart?t._options.xStart:t._xMin,i=(t._options.xEnd?t._options.xEnd:t._xMax)-n,a=i/10,o=t._options.xStart-a,s=t._options.xEnd-a;o<t._xMin&&(o=t._xMin,s=t._xMin+i),e.api.panLeft=function(){let e={caller:t._element,event:r.EventType.Zoom,xStart:o,xEnd:s};t.onZoomChanged(e)};let u=t._options.xStart+a,l=t._options.xEnd+a;l>t._xMax&&(u=t._xMax-i,l=t._xMax),e.api.panRight=function(){let e={caller:t._element,event:r.EventType.Zoom,xStart:u,xEnd:l};t.onZoomChanged(e)}}}render(t){let e=this,n=e._element;if(0===n.axes.length&&(n.dataSets&&0===n.dataSets.length||0===this._seriesMap.size))return void console.warn("Error no data in the chart");if(e.loadOptions(t),e.updateAxes(t),this._options.fitToWindow?e.updateLayoutToFit(t):e.updateLayout(t),e._contextMenuItems=[],!e._scaleAxis.isBanded()){e.updatePanFunctions(),e.updateZoomFunctions(),e.createZoomMenuItems();let t,n=e._scaleAxis.getScale();t=e._axes[1]?e._axes[1].getScale().domain():[0,0],this.updateZoom(n.domain()[0],n.domain()[1],t[0],t[1])}if(e._scaleAxis.render(),n.contextMenuItems)for(let t=0;t<n.contextMenuItems.length;++t)e._contextMenuItems.push(n.contextMenuItems[t]);if(e._options.enableSaveAsImage){let t={title:"Save As Image",action:function(t,n,r){e.saveImage()},disabled:!1};e._contextMenuItems.push(t)}e._element.api.saveImage=e.saveImage,e._element.api.createImage=e.createImage,e._contextMenuItems.length>0&&this.configureContextMenu(),e._options.disableBrush||e.configureBrush(),e.configureCursorTracking();let i=[];e._loadingView&&e._loadingView.remove();e._loadingView=e._svg.append("g").classed("progress-group",!0).attr("transform","translate("+(e._graphRect.x+10)+","+(e._graphRect.y+10)+")").attr("pointer-events","none"),e._options.enableWebWorkers&&new s.Spinner(e._loadingView,new r.Rect(e._graphRect.x,e._graphRect.y,20,20)),e._loadingView.append("text").attr("x",10).attr("y",2).text("Loading...");for(let t=0;t<e._legends.length;++t){e._legends[t].render()}let a=e._element.dataSets;for(let t=0;t<a.length;++t){let e=a[t],n=this._seriesMap.get(e);n&&(n.setData(e),e.enableWebWorkers&&n.render())}let o=[];for(let t=0;t<a.length;++t){let n=a[t],r=this._seriesMap.get(n);r&&o.push(r.decimateData(e._options.xStart,e._options.xEnd,this._axes[n.xAxisIdx],this._axes[n.yAxisIdx]))}Promise.all(o).then((function(){for(let t=0;t<a.length;++t){let n=a[t],r=e._seriesMap.get(n);if(r){if(void 0!==n.yAxisIdx){let t=e._axes[n.yAxisIdx];if(t&&t.getAxis().enableDynamicRange){let e=t.getScale();if(r instanceof v.XYSeries||r instanceof x.XYGroupSeries){let n=r.getRenderedYRange();e.domain(n),t.setDomain(n),t.render()}}}r.render(),n.hideInLegend||(i=i.concat(r.getLegendInfo()))}}for(let n=0;n<e._legends.length;++n){let a=e._legends[n];if(a.getAlignment()===r.Alignment.Top||a.getAlignment()===r.Alignment.Bottom){let n=a.getRows();if(a.addItems(i),a.render(),n!==a.getRows()){if(e._options.fitToWindow)return void e.render(t);e.updateLayout(t)}}else a.addItems(i),a.render()}e._interactionState.onRedraw(),e._options.forceBrushToFront&&e._brush.moveToFront(),e._loadingView&&(e._loadingView.remove(),e._loadingView=void 0)}))}}e.D3Chart=m,m.SERIES_RENDERERS=[];const y=n(44),v=n(22),x=n(31);e.createDecimatorWorker=function(t,e,n,r,i,a,s,u,l){let c;try{c=new y}catch(t){c=new Worker("ui-widget-toolkit-decimator-worker.js")}let h={decimatorName:t.getKey(),xDomain:r.getScale().domain(),xRange:r.getRangePixels(),xAxis:o.copy(r.getAxis()),xStart:e,xEnd:n,values:a,names:s};return delete h.xAxis.options,void 0!==i&&(h.yDomain=i.getScale().domain(),h.yRange=i.getRangePixels(),h.yAxis=o.copy(i.getAxis()),delete h.yAxis.options),c.postMessage(h),c.addEventListener("message",(function(t){c.terminate(),u(t.data)})),c.onerror=function(t){c.terminate(),l(t)},c},u.D3Renderer.register(r.UIType.Cartesian,m)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.Line=1]="Line",t[t.Area=2]="Area",t[t.Scatter=4]="Scatter",t[t.Bar=8]="Bar",t[t.Stacked=16]="Stacked",t[t.MinMaxValue=32]="MinMaxValue",t[t.FlameChart=64]="FlameChart",t[t.Marker=128]="Marker",t[t.DirectionalArrow=256]="DirectionalArrow",t[t.BoxPlot=512]="BoxPlot",t[t.HeatMap=1024]="HeatMap",t[t.Raw=2048]="Raw"}(e.RenderType||(e.RenderType={})),function(t){t[t.Linear=0]="Linear",t[t.StepBefore=1]="StepBefore",t[t.StepAfter=2]="StepAfter"}(e.InterpolateType||(e.InterpolateType={}))},function(t,e,n){"use strict";function r(t,e,n,o,s){let u;if(u=document.createElement("div"),u.setAttribute("class","context-menu"),u.oncontextmenu=function(t){a(),t.preventDefault()},document.body.appendChild(u),n.length>0){let l=document.createElement("ul");u.appendChild(l);for(let o=0;o<n.length;++o){let u=n[o],c=document.createElement("li");u.divider?(c.className+=" is-divider",c.innerHTML="<hr>"):(u.title||console.error("No title attribute set. Check the spelling of your options."),u.disabled&&(c.className+=" is-disabled"),u.action||u.submenu||(c.className+=" is-header"),u.submenu?c.innerHTML=`<span><text>${u.title}</text>`+'<text style="width: 5px; float: right; color: #000000A0">►</text></span>':c.innerHTML=u.title,c.onclick=function(t){u.disabled||u.action&&(u.action(c,e,o),a())},c.onmouseenter=function(){if(i(n),u.submenu){let n=c.getBoundingClientRect(),i={top:n.top+window.scrollY,bottom:n.bottom+window.scrollY,left:n.left+window.scrollX,right:n.right+window.scrollX,height:n.height,width:n.width};u.submenuDiv=r(t,e,u.submenu,i,s)}}),l.appendChild(c)}u.style.display="block",function(t,e){let n=document.body.clientWidth,r=document.body.clientHeight,i=e.left,a=e.top;i=e.right+t.clientWidth<n?e.right:e.left-t.clientWidth,e.top+t.clientHeight>r&&(a=e.top-t.clientHeight),t.style.left=i-2+"px",t.style.top=a-2+"px"}(u,o),s||t.stopPropagation()}return u}function i(t){t.forEach((function(t,e,n){!function(t){t.submenuDiv&&(document.body.removeChild(t.submenuDiv),delete t.submenuDiv),t.submenu&&i(t.submenu)}(t)}))}function a(){i(o);let t=document.getElementsByClassName("context-menu");for(;t.length;)document.body.removeChild(t[0])}Object.defineProperty(e,"__esModule",{value:!0});let o=[];e.showContextMenu=function(t,e,n,i=!1){t&&(window.onkeyup=function(t){27===t.keyCode&&a()},a(),o=n,r(t,e,n,{left:t.pageX,top:t.pageY,right:t.pageX,bottom:t.pageY,height:0,width:0},i),t.preventDefault())}},function(t,e,n){"use strict";function r(t){var e=Number(t).toString(16);return 1==e.length?"0"+e:e}function i(t){let e=t.substring(t.indexOf("(")+1,t.indexOf(")")).split(",");return r(e[0])+r(e[1])+r(e[2])}Object.defineProperty(e,"__esModule",{value:!0});class a{constructor(t){this._colorMap={},this.getRandomColor=t||function(){for(var t="#",e=0;e<6;e++)t+="0123456789ABCDEF"[Math.floor(16*Math.random())];return t}}hasColor(t){return this._colorMap.hasOwnProperty(t)}setColor(t,e){0===e.indexOf("rgb")&&(e=a.RgbToHex(e)),this._colorMap[t]=e}getColor(t){return this.hasColor(t)||(this._colorMap[t]=this.getRandomColor()),this._colorMap[t]}static IntToHex(t){return"#"+t.toString(16).padStart(6,"0")}static RgbToHex(t){return"#"+i(t)}static RgbToInt(t){return parseInt(i(t),16)}}e.ColorManager=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(2);class i{constructor(t,e="tooltip-t"){if(document.getElementById(t)){let e=t;"#"!==t.charAt(0)&&(e="#"+t),this._tooltipDiv=document.querySelector(e)}else this._tooltipDiv=document.createElement("div"),this._tooltipDiv.style.overflow="auto",this._tooltipDiv.id=t,document.querySelector("body").appendChild(this._tooltipDiv);this._targets=[],this._analyticsName="",this._disabled=!1,this._visibilityTimeoutSecs=0,this._visibilityTimeoutCallLeaveFunction=!0,this._delayMS=i._defaultDelayMS,this._tooltipPlacementFunc=this.defaultTooltipPlacement,this._alwaysRecalcWidth=!1,this._tooltipLeftOfMouse=!0,this._lastShowTs=Date.now(),this._counter=i._counter,i._counter++,this._hide="none",this._tooltipOffset=0,this._tooltipHeight=0,this._tooltipWidth=0,this._windowWidth=0,this._windowHeight=0,this._tooltipDiv.classList.add(e),this._tooltipBackgroundColor=null,this._tooltipFontColor=null,this._tooltipFontType=null,this._tooltipFontSize=null;let n=this;this.onMouseEnter=function(t){n._disabled||(void 0===n._enterfunc||n._enterfunc.call(this,t)?(n.displayTooltip(n._delayMS),n._tooltipHeight=0,n._tooltipWidth=0,n._windowWidth=0,n._windowHeight=0):n.onMouseLeave.call(this,t))},this.onMouseLeave=function(t){if(null!=n._timerId&&window.clearTimeout(n._timerId),n._timerId=void 0,null!=n._visibilityTimerId&&window.clearTimeout(n._visibilityTimerId),void 0!==n._leavefunc){let e=!0;null===t&&(e=n._visibilityTimeoutCallLeaveFunction),e&&n._leavefunc.call(this,t)}n.hideTooltip()},this.onMouseMove=function(t,e){if(!n._disabled){if(void 0!==n._movefunc&&n._movefunc.call(this,t),n._alwaysRecalcWidth||0===n._tooltipWidth){n._tooltipWidth=n._tooltipDiv.offsetWidth;let t=n._tooltipDiv.offsetHeight,e=parseInt(n._tooltipDiv.style.marginTop),r=parseInt(n._tooltipDiv.style.marginBottom);e&&(t+=e),r&&(t+=r),n._tooltipHeight=t}0==n._windowWidth&&(n._windowWidth=window.innerWidth,n._windowHeight=window.innerHeight),e&&e.clientY||(e=r.event.clientY?r.event:r.event.sourceEvent),n._tooltipPlacementFunc(e)}}}adjustVerticalPosition(t,e){(t-=this._tooltipHeight/2)<window.pageYOffset&&(t=window.pageYOffset),(e=t+this._tooltipHeight)>this._windowHeight+window.pageYOffset&&(t-=e-(this._windowHeight+window.pageYOffset)),t<0&&(t=0),this._tooltipDiv.style.top=t+"px"}placeTooltipLeft(t){let e,n;e=window.pageYOffset+t.clientY,n=window.pageXOffset+t.clientX,n-=this._tooltipWidth+10,n<window.pageXOffset&&(n=window.pageXOffset),this._tooltipDiv.style.left=n+"px",this.adjustVerticalPosition(e,void 0)}placeTooltipLeftRight(t){let e,n;e=window.pageYOffset+t.clientY,n=window.pageXOffset+t.clientX,n<this._windowWidth/3&&(this._tooltipLeftOfMouse=!1),n>this._windowWidth/3*2&&(this._tooltipLeftOfMouse=!0),this._tooltipLeftOfMouse?n-=this._tooltipWidth+10:n+=10,n<window.pageXOffset&&(n=window.pageXOffset),this._tooltipDiv.style.left=n+"px",this.adjustVerticalPosition(e,void 0)}defaultTooltipPlacement(t){let e,n,r,i;if(e=window.pageYOffset+t.clientY,i=window.pageXOffset+t.clientX,t.y<this._windowHeight/2){if(e+=20+this._tooltipOffset,n=e+this._tooltipHeight,n<this._windowHeight+window.pageYOffset)return i-=this._tooltipWidth/2,r=i+this._tooltipWidth,r>this._windowWidth&&(i-=r-this._windowWidth),i<window.pageXOffset&&(i=window.pageXOffset),this._tooltipDiv.style.left=i+"px",void this.adjustVerticalPosition(e,n)}else if(e-=this._tooltipHeight+10+this._tooltipOffset,e>=window.pageYOffset)return i-=this._tooltipWidth/2,r=i+this._tooltipWidth,r>this._windowWidth&&(i-=r-this._windowWidth),i<window.pageXOffset&&(i=window.pageXOffset),this._tooltipDiv.style.left=i+"px",void this.adjustVerticalPosition(e,n);t.clientX>this._windowWidth/2?(i-=this._tooltipWidth+10,i<window.pageXOffset&&(i=window.pageXOffset)):(i+=10,r=i+this._tooltipWidth,r>this._windowWidth&&(i-=r-this._windowWidth)),this._tooltipDiv.style.left=i+"px",this.adjustVerticalPosition(e,n)}setOffset(t){return this._tooltipOffset=t,this}setEnabled(t){return this._disabled=!t,this}setHideDisplayValue(t){return this._hide=t,this}setDelay(t){return this._delayMS=t,this}setPlaceTooltipLeft(){return this._tooltipPlacementFunc=this.placeTooltipLeft,this}setPlaceTooltipLeftRight(){return this._tooltipPlacementFunc=this.placeTooltipLeftRight,this}releaseListeners(){this._targets.forEach(t=>{t.on("mouseenter.tooltip",null).on("mouseleave.tooltip",null).on("mousemove.tooltip",null)}),this._targets=[]}setVisibilityTimeout(t,e=!0){return this._visibilityTimeoutSecs=t,this._visibilityTimeoutCallLeaveFunction=e,this}alwaysRecalcWidth(t){return this._alwaysRecalcWidth=t,this}setBackgroundColor(t){return this._tooltipBackgroundColor=t,this._tooltipDiv.style["background-color"]=this._tooltipBackgroundColor,this}setFontColor(t){return this._tooltipFontColor=t,this._tooltipDiv.style.color=this._tooltipFontColor,this}setFontType(t){return this._tooltipFontType=t,this._tooltipDiv.style.font=this._tooltipFontType,this}setFontSize(t){return this._tooltipFontSize=t,this._tooltipDiv.style.font=this._tooltipFontSize,this}setAnalyticsName(t){return this._analyticsName=t,this}setCssClass(t){return this._tooltipDiv.classList.add(t),this}setTarget(t){return t&&(t.on("mouseenter.tooltip",this.onMouseEnter).on("mouseleave.tooltip",this.onMouseLeave).on("mousemove.tooltip",this.onMouseMove),this._targets.push(t)),this}setEnterCallback(t){return this._enterfunc=t,this}setLeaveCallback(t){return this._leavefunc=t,this}setMoveCallback(t){return this._movefunc=t,this}displayTooltip(t){if(this._disabled)return this;let e=this;return 0===t?(n(),this):void 0!==this._timerId?this:(this._timerId=window.setTimeout(n,t),this);function n(){e._disabled||(e._tooltipDiv.style.display="block",e._visibilityTimeoutSecs>0&&(e._visibilityTimerId=window.setTimeout((function(){e.onMouseLeave(null)}),1e3*e._visibilityTimeoutSecs)))}}hideTooltip(){return this._timerId&&window.clearTimeout(this._timerId),this._timerId=void 0,this._tooltipDiv.style.display=this._hide,this}}e.BaseTooltip=i,i._defaultDelayMS=500,i._counter=0;e.OneLineTooltip=class extends i{constructor(t,e="tooltip-t"){super(t,e)}getTitle(){return this._title}setData(t,e){for(;this._tooltipDiv.hasChildNodes();)this._tooltipDiv.removeChild(this._tooltipDiv.lastChild);this._title=t;let n=document.createElement("table");n.classList.add("tooltip-table"),this._tooltipDiv.appendChild(n);let r=document.createElement("tr");n.appendChild(r);let i=document.createElement("td");i.classList.add("tooltip-title"),i.setAttribute("colspan","2"),i.textContent=t,r.appendChild(i),null!=e&&(r=document.createElement("tr"),n.appendChild(r),i=document.createElement("td"),i.setAttribute("colspan","2"),i.textContent=e,r.appendChild(i))}};class a extends i{constructor(t,e="tooltip-t"){super(t,e)}getTitle(){return this._title}setData(t,e){for(;this._tooltipDiv.hasChildNodes();)this._tooltipDiv.removeChild(this._tooltipDiv.lastChild);this._title=t;let n=document.createElement("table");n.classList.add("tooltip-table"),this._tooltipDiv.appendChild(n);let r=document.createElement("tr");n.appendChild(r);let i=document.createElement("td");i.classList.add("tooltip-title"),i.setAttribute("colspan","2"),i.textContent=t,r.appendChild(i);let a=!1;if(e.length>0){let t=e[0].source;for(let n=1;n<e.length;++n)e[n].source!==t&&(a=!0)}for(let t=0;t<e.length;++t){let r=e[t];if(Object.keys(r.metrics).length>0){let t=r.source;if(t&&t.title&&a){let e=document.createElement("tr");n.appendChild(e);let r=document.createElement("td");r.classList.add("tooltip-group-title"),r.setAttribute("colspan","2"),r.textContent=t.title,e.appendChild(r)}if(r.group&&r.group.length>0){let t=document.createElement("tr");n.appendChild(t);let e=document.createElement("td");e.classList.add("tooltip-group-title"),e.setAttribute("colspan","2"),e.textContent=r.group,t.appendChild(e)}for(let t in r.metrics){let e=document.createElement("tr");n.appendChild(e);let i=document.createElement("td");i.classList.add("tooltip-metric-name"),i.textContent=t,e.appendChild(i),i=document.createElement("td"),i.classList.add("tooltip-metric-value"),i.textContent=r.metrics[t],e.appendChild(i)}}}}}e.MetricListTooltip=a;e.CustomDivTooltip=class extends a{constructor(t,e="tooltip-t"){super(t,e)}clearTooltip(){for(;this._tooltipDiv.hasChildNodes();)this._tooltipDiv.removeChild(this._tooltipDiv.lastChild)}getTooltipDiv(){return this._tooltipDiv}}},function(t,n){t.exports=e},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(23),i=n(1);e.findFirstInsertionIdx=i.bisectBuffer((function(t){return t.x})).left,e.findLastInsertionIdx=i.bisectBuffer((function(t){return t.x})).right;e.XYDummyDecimator=class{constructor(){this._values=[]}initialize(t,e,n){}getKey(){return""}getName(){return""}getValues(){return this._values}decimateValues(t,e,n){return Array.isArray(n)?n.forEach(t=>{this._values.push(t.getData())}):this._values=n.getData(),this._values}};class a{constructor(){this._name="Simple Unimplemented Decimator"}initialize(t,e,n){this._xValueToCoord=t,this._xCoordToValue=e,this._yValueToCoord=n}getKey(){return this._key}getName(){return this._name}getValues(){return this._decimatedValues}decimateValues(t,n,r){if(this._decimatedValues=[],0===r.length())return this._decimatedValues;let i,a,o=e.findFirstInsertionIdx(r,t),s=e.findLastInsertionIdx(r,n);o>0&&--o,s<r.length()&&++s,o<r.length()&&(i=Math.floor(this._xValueToCoord(r.get(o).x)),--i),a=t?Math.floor(this._xValueToCoord(t)):Math.floor(this._xValueToCoord(r.get(o).x));let u,l=o;for(let t=o;t<s;++t){let e=r.get(t),n=Math.floor(this._xValueToCoord(e.x));u=t,n!==i&&(this._decimatedValues=this._decimatedValues.concat(this._customFunc(r,l,u,this._yValueToCoord,this._xValueToCoord,this._xCoordToValue(a),this._xCoordToValue(n))),a=n,i=n,l=u)}return l!==r.length()&&(this._decimatedValues=this._decimatedValues.concat(this._customFunc(r,l,u+1,this._yValueToCoord,this._xValueToCoord,this._xCoordToValue(a),Number.MAX_VALUE))),this._decimatedValues}}e.CustomPointXYDecimator=a;class o extends a{constructor(){super(),this._key=o.KEY,this._name="Min",this._customFunc=function(t,e,n,r){if(t.length()>0&&e!==n){let r,i=Number.MAX_VALUE;for(let a=e;a<n;++a){let e=t.get(a),n=e.y;n<i&&(r=e,i=n)}return[r]}return[]}}}function s(t,e,n,i){if(t.length()>0&&e!==n){let i=0;for(let r=e;r<n;++r){i+=t.get(r).y}return[new r.XYValue(t.get(n-1).x,i/(n-e))]}return[]}e.MinPointDecimator=o,o.KEY="MinPointDecimator";class u extends a{constructor(){super(),this._key=u.KEY,this._name="Avg",this._customFunc=s}}e.AvgPointDecimator=u,u.KEY="AvgPointDecimator";class l extends a{constructor(){super(),this._key=l.KEY,this._name="Max",this._customFunc=function(t,e,n,r){if(t.length()>0&&e!==n){let r,i=-Number.MAX_VALUE;for(let a=e;a<n;++a){let e=t.get(a),n=e.y;n>i&&(r=e,i=n)}return[r]}return[]}}}e.MaxPointDecimator=l,l.KEY="MaxPointDecimator";class c extends a{constructor(){super(),this._key=c.KEY,this._name="XYPointDecimator",this._customFunc=function(t,e,n,r){let i={},a=[];for(let o=e;o<n;++o){let e=t.get(o),n=Math.floor(r(e.y));i.hasOwnProperty(n.toString())||(a.push(e),i[n]=!0)}return a}}}e.XYPointDecimator=c,c.KEY="XYPointDecimator";class h{constructor(){this._name="Simple Unimplemented Decimator"}initialize(t,e,n){this._xValueToCoord=t,this._xCoordToValue=e,this._yValueToCoord=n}getKey(){return this._key}getName(){return this._name}getValues(){return this._decimatedValues}decimateValues(t,n,r){if(this._decimatedValues=[],0===r.length())return this._decimatedValues;let i,a,o=e.findFirstInsertionIdx(r,t),s=e.findLastInsertionIdx(r,n);o>0&&--o,s<r.length()&&++s,o<r.length()&&(i=Math.floor(this._xValueToCoord(r.get(o).x)),--i),a=t?this._xValueToCoord(t):o;let u=o;for(let t=o;t<s;++t){let e=r.get(t),n=Math.floor(this._xValueToCoord(e.x)),o=t+1;n!==i&&(this._decimatedValues=this._decimatedValues.concat(this._customFunc(r,u,o,this._yValueToCoord,this._xValueToCoord,this._xCoordToValue(a),this._xCoordToValue(n))),a=n,i=n,u=o)}return u!==r.length()&&(this._decimatedValues=this._decimatedValues.concat(this._customFunc(r,u,u+1,this._yValueToCoord,this._xValueToCoord,this._xCoordToValue(a),Number.MAX_VALUE))),this._decimatedValues}}e.CustomContinuousXYDecimator=h;class f extends h{constructor(){super(),this._key=f.KEY,this._name="Avg",this._customFunc=s}}function d(t,n,r,i,a,o){let s=[],u=[],l=Math.ceil(t(Number.MAX_VALUE));if(l<0)return;let c=[];for(let t=0;t<=l+1;++t)c.push(n(t));for(let n=0;n<o.length;++n){let r,h,f=o[n],d=e.findFirstInsertionIdx(o[n],i),g=e.findLastInsertionIdx(o[n],a);d>0&&--d,g===f.length()&&--g,u[n]=Array.apply(null,Array(l)).map(Number.prototype.valueOf,0);for(let e=d;e<g;++e){r=f.get(e),h=f.get(e+1);let o=Math.floor(t(r.x)),s=Math.floor(t(h.x)),l=h.x-r.x,d=0===l?0:h.y/l;if(o===s)if(void 0===i||r.x>i&&h.x<a)u[n][o]+=d;else{let t=1/(c[o+1]-c[o]);h.x<a?u[n][o]+=(h.x-c[o])*d*t:u[n][o]+=(c[o+1]-r.x)*d*t}else{let t=1/(c[o+1]-c[o]),e=i?Math.max(i,r.x):r.x,l=c[o+1];u[n][o]+=(l-e)*d*t;for(let t=o+1;t<s;++t)u[n][t]+=d;t=1/(c[s]-c[s-1]);let f=a?Math.min(a,h.x):h.x,g=c[s];u[n][s]+=(f-g)*d*t}}s[n]=[];let p=u[n];for(let t=0;t<p.length;++t)s[n][t]={x:c[t],y:u[n][t]}}return s}e.AvgContinuousDecimator=f,f.KEY="AvgContinuousDecimator",e.sumMultiXYSeriesValues=d;class g{constructor(){}initialize(t,e,n){this._xValueToCoord=t,this._xCoordToValue=e,this._yValueToCoord=n}getKey(){return g.KEY}getName(){return""}getValues(){return this._decimatedValues}decimateValues(t,e,n){return this._decimatedValues=d(this._xValueToCoord,this._xCoordToValue,this._yValueToCoord,t,e,n),this._decimatedValues}}e.SummedValueMultiXYSeriesDecimator=g,g.KEY="SummedValueMultiXYSeriesDecimator";class p extends g{constructor(){super()}getKey(){return p.KEY}getName(){return""}decimateValues(t,e,n){this._decimatedValues=d(this._xValueToCoord,this._xCoordToValue,this._yValueToCoord,t,e,n);for(let t=0;t<this._decimatedValues[0].length;++t){let e=0;for(let n=0;n<this._decimatedValues.length;++n)this._decimatedValues[n][t].y&&(e+=this._decimatedValues[n][t].y);if(e>0){let r=100/e;for(let e=0;e<n.length;++e)this._decimatedValues[e][t].y&&(this._decimatedValues[e][t].y=this._decimatedValues[e][t].y*r)}}return this._decimatedValues}}e.ResidencyDecimator=p,p.KEY="ResidencyDecimator";class _{constructor(){}initialize(t,e,n){this._xValueToCoord=t,this._xCoordToValue=e,this._yValueToCoord=n}getKey(){return _.KEY}getName(){return""}getValues(){return this._decimatedValues}decimateValues(t,e,n){return this._decimatedValues=d(this._xValueToCoord,this._xCoordToValue,this._yValueToCoord,t,e,[n])[0],this._decimatedValues}}e.SummedValueXYSeriesDecimator=_,_.KEY="SummedValueXYSeriesDecimator";class m extends r.CandlestickValue{constructor(t){super(t,void 0,void 0,void 0,void 0),this._bucketPts=0}}e.NEWSDecimationValue=m;class y{initialize(t,e,n){this._xValueToCoord=t,this._xCoordToValue=e,this._yValueToCoord=n}getKey(){return this._key}getName(){return""}getValues(){return this._buckets}_dumpBucket(t,e,n){let r="valuesInBucket = "+n.toFixed(0)+", ";return r+="([avg]Time delta, avgValue) = ("+(e.x-t).toFixed(2)+", "+e.y.toFixed(2)+"), ",r+="(entry, min, max, exit) = ("+e.entry.toFixed(2)+", "+e.min.toFixed(2)+", "+e.max.toFixed(2)+", "+e.exit.toFixed(2)+")",r}decimateValues(t,e,n){throw"Error need to implement decimate code"}}e.NEWSBaseDecimator=y;class v extends y{constructor(){super(),this._key=v.KEY}createNewBucket(t,e){t.entry=e.y,t.exit=e.y,t.min=e.y,t.max=e.y,t.x=0,t.y=0,t._bucketPts=0,this.addToBucket(t,e)}addToBucket(t,e){t.x+=e.x,t.y+=e.y,t.min=Math.min(t.min,e.y),t.max=Math.max(t.max,e.y),t.exit=e.y,t._bucketPts++}finalizeBucket(t,e){void 0!==e&&e!==t._bucketPts&&console.log("AverageTime: mismatching pt calculation"),0===t._bucketPts&&console.log("AverageTime: 0 points"),t.x=t.x/t._bucketPts,t.y=t.y/t._bucketPts}decimateValues(t,n,r){if(this._buckets=[],0===r.length())return this._buckets;let i,a=e.findFirstInsertionIdx(r,t),o=e.findLastInsertionIdx(r,n);a>0&&--a,o<r.length()&&++o;let s=0;a<r.length()&&(s=Math.floor(this._xValueToCoord(r.get(a).x)),--s);for(let t=a;t<o;++t){let e=r.get(t),n=Math.floor(this._xValueToCoord(e.x));n!==s?(i&&(this.finalizeBucket(i),this._buckets.push(i)),i=new m,this.createNewBucket(i,e),s=n):this.addToBucket(i,e)}return i&&(this.finalizeBucket(i),this._buckets.push(i)),this._buckets}}e.NEWSPointDecimator=v,v.KEY="NEWSPointDecimator";class x extends y{constructor(t){super(),this._weightedSums={},this._prevX=0,this._prevX=0,this._key=x.KEY,t&&(this._states=t)}createNewBucket(t,e){let n;this._weightedSums={},t._bucketPts=0,this._isYObject||(n=e.y,t.x=0,t.y=n,t.entry=n,t.exit=n,t.min=n,t.max=n),this.addToBucket(t,e)}addToStateValueToBucket(t,e){0!==e&&(this._weightedSums[t]||(this._weightedSums[t]=0),this._weightedSums[t]+=e)}addToBucket(t,e){if(this._isYObject)if(this._states)for(let t in e.y)this.addToStateValueToBucket(this._states[t],(e.x-this._prevX)*e.y[t]);else for(let t in e.y)this.addToStateValueToBucket(t,(e.x-this._prevX)*e.y[t]);else{let n;n=this._states?this._states[e.y]:e.y,t.exit=n,this.addToStateValueToBucket(n,e.x-this._prevX)}t.x+=e.x,t._bucketPts++,this._prevX=e.x}finalizeBucket(t,e){var n;void 0!==e&&e!==t._bucketPts&&console.log("AverageTime: mismatching pt calculation"),0===t._bucketPts&&console.log("AverageTime: 0 points"),t.x=t.x/t._bucketPts;var r=-Number.MAX_VALUE;let i=-Number.MAX_VALUE,a=Number.MAX_VALUE;for(let e in this._weightedSums){if(void 0!==this._weightedSums[e]){let t=this._weightedSums[e];t>r&&(n=e,r=t)}let o=this._yValueToCoord(e);o>i&&(t.min=e,i=o),o<a&&(t.max=e,a=o)}void 0!==n?t.y=n:this._isYObject||(t.min=t.y,t.max=t.y)}decimateValues(t,n,r){if(this._buckets=[],0===r.length())return this._buckets;let i,a=e.findFirstInsertionIdx(r,t),o=e.findLastInsertionIdx(r,n);a>0&&--a,o<r.length()&&++o;let s=0;a<r.length()&&(this._isYObject="object"==typeof r.get(a).y,s=Math.floor(this._xValueToCoord(r.get(a).x)),--s);for(let t=a;t<o;++t){let e=r.get(t),n=Math.floor(this._xValueToCoord(e.x));if(n!==s){if(i&&(this.finalizeBucket(i),this._buckets.push(i)),s+1<n){let t=new m;this.createNewBucket(t,e),this.finalizeBucket(t),t.x=this._xCoordToValue(n-1),this._buckets.push(t),this._prevX=t.x}i=new m,this.createNewBucket(i,e),s=n}else this.addToBucket(i,e)}return i&&(this.finalizeBucket(i),this._buckets.push(i)),this._buckets}}e.NEWSStateDecimator=x,x.KEY="NEWSStateDecimator";class b{initialize(t,e,n){this._data=[],this._xValueToCoord=t,this._xCoordToValue=e,this._yValueToCoord=n}getKey(){return b.KEY}getName(){return""}getValues(){return this._data}setRectLimit(t){return this._rectLimit=t,this}decimateValues(t,e,n){this._data=[];let r=n.getData();for(let t=0;t<r.length;++t)this._data=this._data.concat(r[t]);return this._rectLimit&&(this._data.sort((function(t,e){return t.traceValue.dx>e.traceValue.dx?-1:t.traceValue.dx<e.traceValue.dx?1:0})),this._data=this._data.splice(0,this._rectLimit)),this._data}}e.FlameChartRectLimitDecimator=b,b.KEY="FlameChartRectLimitDecimator";class w{constructor(){this._minRectDelta=1}initialize(t,e,n){this._data=[],this._xValueToCoord=t,this._xCoordToValue=e,this._yValueToCoord=n}getKey(){return w.KEY}getName(){return""}getValues(){return this._data}setPixelWidth(t){return this._minRectDelta=t-1,this}setUserPixelFunction(t){this._userPixelFunction=t}mergeRects(t){let e=[],n=Math.ceil(this._xValueToCoord(Number.MAX_VALUE))+1,r=[];for(let t=0;t<=n;++t)r.push(this._xCoordToValue(t));let i=0;n>1&&(i=this._xCoordToValue(1)-this._xCoordToValue(0));for(let n=0;n<t.length;++n){let a=t[n];if(void 0===a)continue;let o,s,u,l=[],c=-Number.MAX_VALUE,h=a.length;for(let t=0;t<h;t++){let e,n=a[t];if(o&&o.traceValue.key===n.traceValue.key&&o.traceValue.x+o.traceValue.dx===n.traceValue.x)o.traceValue.dx+=n.traceValue.dx;else{if(s=Math.floor(this._xValueToCoord(n.traceValue.x)),c>s&&(s=c),u=Math.floor(this._xValueToCoord(n.traceValue.x+n.traceValue.dx)),u-s>this._minRectDelta)e={traceValue:{x:r[s],dx:r[u]-r[s],key:n.traceValue.key,name:n.traceValue.name,desc:n.traceValue.desc},decimatedValues:[n.traceValue],depth:n.depth};else{let o={},l=[];for(c=s+this._minRectDelta,n.traceValue.x<r[s]?o[n.traceValue.name]=n.traceValue.x+n.traceValue.dx-r[s]:o[n.traceValue.name]=n.traceValue.dx,l.push(n.traceValue),++t;t<h;++t){if(n=a[t],Math.floor(this._xValueToCoord(n.traceValue.x))>=c){--t;break}if(l.push(n.traceValue),o.hasOwnProperty(n.traceValue.name)||(o[n.traceValue.name]=0),n.traceValue.x+n.traceValue.dx>r[c]){o[n.traceValue.name]+=r[c]-n.traceValue.x,--t;break}o[n.traceValue.name]+=n.traceValue.dx}let f=l[l.length-1];if(1===l.length)e={traceValue:{x:r[s],dx:r[u]-r[s],key:f.key,name:f.name,desc:f.desc},decimatedValues:l,depth:n.depth};else{let t,a=0;for(let e in o){let n=o[e];n>a&&(t=e,a=n)}e={traceValue:{x:r[s],dx:c<r.length?r[c]-r[s]:r[s]+i,key:"merged",name:t,desc:f.desc},decimatedValues:l,depth:n.depth}}}l.push(e),o=e}}o=void 0;let f=0,d=!0;for(let t=0;t<l.length;++t){d=!0;let n=l[t];n.traceValue.dx<i&&(n.traceValue.dx=i),this._userPixelFunction&&(n=this._userPixelFunction(n)),o&&o.traceValue.key===n.traceValue.key&&o.traceValue.name===n.traceValue.name&&(f=o.traceValue.x+o.traceValue.dx,f>=n.traceValue.x&&(o.traceValue.dx=n.traceValue.x+n.traceValue.dx-o.traceValue.x,o.decimatedValues.concat(n.decimatedValues),d=!1)),d&&(e.push(n),o=n)}}return e}decimateValues(t,e,n){return this._data=this.mergeRects(n.getData()),this._data}}e.FlameChartMergeRectDecimator=w,w.KEY="FlameChartMergeRectDecimator";class M{initialize(t,e,n,r){this._decimatedValues=[],this._xValueToCoord=t,this._xCoordToValue=e,this._yValueToCoord=n,this._states=r}getKey(){return M.KEY}getName(){return""}getValues(){return this._decimatedValues}decimateValues(t,n,r){this._decimatedValues=new Array(this._states.length).fill(0).map(()=>new Array);let i=Math.ceil(this._xValueToCoord(Number.MAX_VALUE));if(i<0)return;let a,o,s={},u={};this._states.forEach((t,e)=>{u[t]=e,s[t]=Array.apply(null,Array(i)).map(Number.prototype.valueOf,0)});let l=e.findFirstInsertionIdx(r,t),c=e.findLastInsertionIdx(r,n);l>0&&--l;let h=[];for(let t=0;t<=i;++t)h.push(this._xCoordToValue(t));let f=1/(h[1]-h[0]);for(let e=l;e<c;++e){a=r.get(e),o=a.x+a.dx;let i=Math.floor(this._xValueToCoord(a.x)),u=Math.floor(this._xValueToCoord(o));if(i===u)s[a.name][i]+=a.dx*f;else{let e=t?Math.max(t,a.x):a.x,r=h[i+1];s[a.name][i]+=(r-e)*f;for(let t=i+1;t<u;++t)s[a.name][t]+=1;let l=n?Math.min(n,o):o,c=h[u];s[a.name][u]+=(l-c)*f}}let d=[];for(let t=0;t<i;++t)d[t]={x:h[t],y:0};for(let t=0;t<this._states.length;++t){let e=s[this._states[t]];if(e)for(let n=0;n<e.length;++n){let e=s[this._states[t]][n]?s[this._states[t]][n]:0;this._decimatedValues[t][n]={x:h[n],y:100*e}}else this._decimatedValues[t]=d}return this._decimatedValues}}e.TraceResidencyDecimator=M,M.KEY="TraceResidencyDecimator";class T{initialize(t,e,n,r){this._decimatedValues=[],this._xValueToCoord=t,this._xCoordToValue=e,this._yValueToCoord=n,this._states=r}getKey(){return T.KEY}getName(){return""}getValues(){return this._decimatedValues}decimateValues(t,n,r){let i,a,o=Math.ceil(this._xValueToCoord(Number.MAX_VALUE));if(o<0)return;let s=e.findFirstInsertionIdx(r,t),u=e.findLastInsertionIdx(r,n);s>0&&--s,this._decimatedValues=[];for(let t=0;t<=o;++t)this._decimatedValues[t]=new m(this._xCoordToValue(t));let l={};this._states.forEach((t,e)=>{l[t]=e});for(let t=s;t<u;++t){i=r.get(t),a=i.x+i.dx;let e=Math.floor(this._xValueToCoord(i.x)),n=Math.floor(this._xValueToCoord(a));if(this._decimatedValues[e].entry||(this._decimatedValues[e].entry=l[i.name],this._decimatedValues[e].exit=l[i.name],this._decimatedValues[e].min=l[i.name],this._decimatedValues[e].max=l[i.name]),e===n)this._decimatedValues[e].exit=l[i.name],this._decimatedValues[e].min=Math.min(this._decimatedValues[e].min,l[i.name]),this._decimatedValues[e].max=Math.max(this._decimatedValues[e].max,l[i.name]);else{this._decimatedValues[e].exit=l[i.name],this._decimatedValues[e].min=Math.min(this._decimatedValues[e].min,l[i.name]),this._decimatedValues[e].max=Math.max(this._decimatedValues[e].max,l[i.name]);for(let t=e+1;t<=n;++t)this._decimatedValues[t].entry=l[i.name],this._decimatedValues[t].exit=l[i.name],this._decimatedValues[t].min=l[i.name],this._decimatedValues[t].max=l[i.name]}}for(let t=0;t<this._decimatedValues.length;++t){let e=this._decimatedValues[t],n=e.exit;e.entry=this._states[e.entry],e.exit=this._states[n],e.y=this._states[n],e.min=this._states[e.min],e.max=this._states[e.max]}return this._decimatedValues}}e.TraceStateDecimator=T,T.KEY="TraceStateDecimator";class S{initialize(t,e,n){this._data=[],this._xValueToCoord=t,this._xCoordToValue=e,this._yValueToCoord=n}getKey(){return S.KEY}getName(){return""}getValues(){return this._data}mergeMarkers(t){let e=[],n=-Number.MAX_VALUE;for(let r=0;r<t.length;++r){let i=t[r],a=this._xValueToCoord(i.x);a!==n&&(e.push(i),n=a)}return e}decimateValues(t,e,n){let r=n.getData();if(void 0!==t&&void 0!==e){let n=[];for(let i=0;i<r.length;++i){let a=r[i];a.x<e&&a.x>t?n.push(a):a.dx&&a.x+a.dx<e&&a.x+a.dx>t&&n.push(a)}this._data=this.mergeMarkers(n)}else this._data=this.mergeMarkers(r);return this._data}}e.SimpleMarkerDecimator=S,S.KEY="SimpleMarkerDecimator";class C{constructor(){}initialize(t,e,n){this._xValueToCoord=t,this._xCoordToValue=e,this._yValueToCoord=n}getKey(){return g.KEY}getName(){return""}getValues(){return this._decimatedValues}decimateValues(t,n,r){this._decimatedValues=[];let i=[],a=Math.ceil(this._xValueToCoord(Number.MAX_VALUE));if(a<0)return;let o=[];for(let t=0;t<=a+1;++t)o.push(this._xCoordToValue(t));for(let s=0;s<r.length;++s){let u,l,c=r[s],h=e.findFirstInsertionIdx(r[s],t),f=e.findLastInsertionIdx(r[s],n);h>0&&--h,f===c.length()&&--f,i[s]=Array.apply(null,Array(a)).map(Number.prototype.valueOf,0);for(let e=h;e<f;++e){u=c.get(e),l=c.get(e+1);let r=Math.floor(this._xValueToCoord(u.x)),a=Math.floor(this._xValueToCoord(l.x)),h=l.x-u.x,f=0===h?0:l.y/h;if(r===a)if(void 0===t||u.x>t&&l.x<n)i[s][r]+=f;else{let t=1/(o[r+1]-o[r]);l.x<n?i[s][r]+=(l.x-o[r])*f*t:i[s][r]+=(o[r+1]-u.x)*f*t}else{let e=1/(o[r+1]-o[r]),c=t?Math.max(t,u.x):u.x,h=o[r+1];i[s][r]+=(h-c)*f*e;for(let t=r+1;t<a;++t)i[s][t]+=f;e=1/(o[a]-o[a-1]);let d=n?Math.min(n,l.x):l.x,g=o[a];i[s][a]+=(d-g)*f*e}}this._decimatedValues[s]=[];let d=i[s];for(let t=0;t<d.length;++t)this._decimatedValues[s][t]={x:o[t],y:i[s][t]?i[s][t]:0}}return this._decimatedValues}}e.XYHeatMapDecimator=C,C.KEY="XYHeatMapDecimator";let k=[new p,new o,new u,new l,new f,new w,new b,new v,new x,new S,new c,new _,new g,new M];e.InternalDecimatorMap={},k.forEach((function(t){e.InternalDecimatorMap[t.getKey()]=t}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(0),i=n(1),a=n(3),o=n(7),s=n(2);e.BaseSeries=class{constructor(t,e,n,r,a,o){this._fillColors=new WeakMap,this._strokeColors=new WeakMap,this._d3svg=o,this._d3Chart=t,this._layer=e,this._d3XAxis=n,this._d3YAxis=r,this._d3Elems=[],this._isXContinuous=a,this._outputData=new i.SimpleBuffer([]),this._contextMenuItems=[],e.xScalingInfo?this._xScalingInfo=e.xScalingInfo:this._xScalingInfo={baseScale:{maxRange:Number.MAX_VALUE,scalar:1,units:""}},e.yScalingInfo?this._yScalingInfo=e.yScalingInfo:this._yScalingInfo={baseScale:{maxRange:Number.MAX_VALUE,scalar:1,units:""}}}initializeContextMenuItems(){this._contextMenuItems=this._layer.contextMenuItems?this._d3Chart.getContextMenuItems().concat(this._layer.contextMenuItems):this._d3Chart.getContextMenuItems()}applyStyles(){if(this._layer.css){let t=this._layer.css.style;if(t)for(let e=0;e<this._d3Elems.length;++e)for(let n in t)this._d3Elems[e].style(n,t[n])}}getMaxNameLength(){return this.getName().length}isXContinuousSeries(){return this._isXContinuous}getXScalingInfo(){return this._xScalingInfo}getYScalingInfo(){return this._yScalingInfo}getName(){return""}getDecimationName(){return""}getClassNames(t,e){let n=` ${t}`;e||(e=this.getName());let r=i.getSelectionName(e);r&&r.length>0&&(n+=" "+i.getSelectionName(e));let a=this._d3Chart.getTitle();a&&a.length>0&&(n+=" "+i.getSelectionName(a));let o=this.getDecimationName();return o&&o.length>0&&(n+=" "+o),n}getRequiredHeight(){return 0}getRequiredWidth(){return 0}getSelectionClasses(t){return this.getClassNames(t).replace(/\s+/g,".")}focus(t){let e=this;if(this._d3Elems){let n=i.getSelectionName(t);for(let t=0;t<e._d3Elems.length;++t){let r=e._d3Elems[t];if(r.classed&&r.classed(n)){let t=e._d3Chart.getOptions().focusRadiusDelta?e._d3Chart.getOptions().focusRadiusDelta:e._d3Chart.getOptions().hoverRadiusDelta,n=r.attr("r");if(void 0!==n&&void 0!==t){let e=t||0;return void r.attr("r",parseInt(n)+e)}a.focus(r,e._fillColors,e._strokeColors)}}}}unfocus(t){let e=this;if(this._d3svg){let n=i.getSelectionName(t);for(let t=0;t<e._d3Elems.length;++t){let r=e._d3Elems[t];if(r.classed&&r.classed(n)){let t=e._d3Chart.getOptions().focusRadiusDelta?e._d3Chart.getOptions().focusRadiusDelta:e._d3Chart.getOptions().hoverRadiusDelta,n=r.attr("r");if(void 0!==n&&void 0!==t){let e=t||0;return void r.attr("r",parseInt(n)-e)}a.unfocus(r,e._fillColors,e._strokeColors)}}}}select(t){let e=this;if(this._d3Elems&&t){let n=i.getSelectionName(t);for(let t=0;t<e._d3Elems.length;++t){let r=e._d3Elems[t];r.classed&&r.classed(n)&&a.select(r,e._fillColors,e._strokeColors)}}}unselect(t){let e=this;if(this._d3svg&&t){let n=i.getSelectionName(t);for(let t=0;t<e._d3Elems.length;++t){let r=e._d3Elems[t];r.classed&&r.classed(n)&&a.unselect(r,e._fillColors,e._strokeColors)}}}setOutputData(t){Array.isArray(t)?this._outputData=new i.SimpleBuffer(t):this._outputData=t}getOutputData(){return this._outputData}getMinHeight(){return 0}clickCallback(t,e){let n=this;return function(r){if(e){let i={caller:n._d3Chart.getElement(),event:r.event};t?i.data=t:void 0!==r.data&&(isNaN(r.data)?i.data=r.data:i.data=n.getOutputData().get(r.data)),e(i)}}}onClick(t){return this.clickCallback(t,this._layer.onClick)}onDoubleClick(t){return this.clickCallback(t,this._layer.onDoubleClick)}clickExecute(t,e){let n=this;if(t){let i=this._d3Chart.getElement();if(this._layer.onDoubleClick){if(this._dblClickWait){return window.clearTimeout(this._dblClickWait),this._dblClickWait=null,void this.clickCallback(t,this._layer.onDoubleClick)({caller:i,event:r.EventType.DoubleClick,data:t})}this._dblClickWait=setTimeout(()=>{if(this._dblClickWait){n._d3Chart.getOptions().disableSelection||a.onSelectHelper(i,t,e),this.clickCallback(t,this._layer.onClick)({caller:i,event:r.EventType.Click,data:t}),this._dblClickWait=null}},300)}else{n._d3Chart.getOptions().disableSelection||a.onSelectHelper(i,t,e),this.clickCallback(t,this._layer.onClick)({caller:i,event:r.EventType.Click,data:t})}}}configureItemInteraction(t,e,n){let r=this;r._d3Chart.getOptions().disableBrush?(t.attr("cursor","pointer"),a.addClickHelper(t,r._d3Chart.getOptions(),r._layer.onClick?this.onClick(e):void 0,r._layer.onDoubleClick?this.onDoubleClick(e):void 0,r._contextMenuItems,r._d3Chart.getTooltip(),r._d3Chart.getElement(),e,n)):(t.attr("cursor","crosshair"),t.on("contextmenu",(function(t){o.showContextMenu(s.event,e,r._contextMenuItems)})).on("mousedown touchstart",(function(t){r.clickExecute(e,n);let i=r._d3Chart.getGraphGroup().select(".brush"),a=i.on("mousedown.brush"),o=new MouseEvent("mousedown touchstart",s.event);o.changedTouches=s.event.changedTouches,o.touches=s.event.touches;let u=i.select(".overlay").node();Object.defineProperty(o,"target",{value:u,enumerable:!0}),u.dispatchEvent(o),s.customEvent(o,a,i.node()),s.event.preventDefault(),s.event.stopPropagation()})))}configureBandedItemInteration(t,e,n){let r=this;t.node().__data__=e,t.on("mouseenter",(function(){r._d3Chart.cursorEnter()})).on("mouseleave",(function(){r._d3Chart.cursorExit()})),a.addClickHelper(t,r._d3Chart.getOptions(),r._layer.onClick,r._layer.onDoubleClick,r._contextMenuItems,r._d3Chart.getTooltip(),r._d3Chart.getElement(),e,n)}configureItemInteractionPIXI(t,e,n){let r=this;t.interactive=!0,r._d3Chart.getOptions().disableBrush?a.addClickHelper(t,r._d3Chart.getOptions(),r._layer.onClick?this.onClick(e):void 0,r._layer.onDoubleClick?this.onDoubleClick(e):void 0,r._contextMenuItems,r._d3Chart.getTooltip(),r._d3Chart.getElement(),e):(r._d3Chart.getGraphGroup().attr("cursor","crosshair"),t.on("mousedown",(function(t){r.clickExecute(e,n)})))}clear(){this._d3Elems.forEach(t=>{t.remove()})}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(1),i=n(0);var a;!function(t){t[t.Tooltip=0]="Tooltip",t[t.Highlight=1]="Highlight",t[t.Render=2]="Render",t[t.Focus=3]="Focus",t[t.Select=4]="Select",t[t.None=5]="None"}(a||(a={}));class o{constructor(){this._nameMap={},this._objectMap=new Map}}function s(t){t.getTooltip||(t.getTooltip=function(e){return t.renderer&&t.renderer.getTooltipData?t.renderer.getTooltipData(t,e):[{source:t,group:"",metrics:{}}]})}function u(t){t.api||(t.api={}),t.api.select||(t.api.select=function(e){if(t.renderer&&t.renderer.select)return t.renderer.select(t,e)})}function l(t){t.api||(t.api={}),t.api.cursorChange||(t.api.cursorChange=function(e){if(t.renderer&&t.renderer.cursorChange)return t.renderer.cursorChange(t,e)}),t.api.focus||(t.api.focus=function(e){return t.renderer&&!t.renderer.focus&&t.renderer.hover?t.renderer.hover(t,e):t.renderer&&t.renderer.focus?t.renderer.focus(t,e):void 0},t.api.hover=t.api.focus),t.api.brush||(t.api.brush=function(e){if(t.renderer&&t.renderer.brush)return t.renderer.brush(t,e)}),t.api.zoom||(t.api.zoom=function(e){if(t.renderer&&t.renderer.zoom)return t.renderer.zoom(t,e)})}function c(t){t.api||(t.api={}),t.api.brush||(t.api.brush=function(e){if(t.renderer&&t.renderer.brush)return t.renderer.brush(t,e)}),t.api.render||(t.api.render=function(e,n){return e?t.renderer=e:e=t.renderer,new Promise((function(r,i){e&&(t.renderer.render(t,n),r("Ok")),i("No renderer available")}))})}function h(t){s(t),l(t),u(t),c(t)}e.GroupInfo=o,e.addCallbacks=h;e.ElementManager=class{constructor(){this._elems=[];let t=this;this._groupInfo=[];for(let t=0;t<5;++t)this._groupInfo.push(new o);this._onHoverCallback=function(e){e.caller||console.warn("Warning no caller specified for this event, cannot propoate changes",e);let n=t._groupInfo[3]._objectMap.get(e.caller);if(n)if(t._hoverCallback)t._hoverCallback(n,e);else for(let t=0;t<n.length;++t){let r=n[t];e.caller!==r&&r.api&&!r.api.focus&&r.api.hover&&r.api.hover(e),e.caller!==r&&r.api&&r.api.focus&&r.api.focus(e)}};let e=function(e,n,r){return function(i){i.caller||console.warn("Warning no caller specified for this event, cannot propagate changes",i);let a=t._groupInfo[e]._objectMap.get(i.caller);if(a)if(n)n(a,i);else for(let t=0;t<a.length;++t){let e=a[t];i.caller!==e&&e.api&&e.api[r]&&e.api[r](i)}}};this._onZoomCallback=e(1,this._zoomCallback,"zoom"),this._onCursorChangeCallback=e(1,this._cursorChangeCallback,"cursorChange"),this._onBrushCallback=e(1,this._brushCallback,"brush"),this._onClickCallback=e(4,this._clickCallback,"select"),this._onTooltipCallback=function(e){e.caller||console.warn("Warning no caller specified for this event, cannot propoate changes",e);let n=[],r=t._groupInfo[0]._objectMap.get(e.caller);if(r){if(t._tooltipCallback)n=n.concat(t._tooltipCallback(r,e));else for(let t=0;t<r.length;++t){let i=r[t].getTooltip(e);n=n.concat(i)}return e.data&&e.data.tooltip&&e.data.tooltip.setData(e.data.tooltip.getTitle(),n),n}},this._onUpdateCallback=function(e,n){e||console.warn("Warning no caller specified for this event, cannot propoate changes");let r=t._groupInfo[2]._objectMap.get(e);if(r)for(let t=0;t<r.length;++t){let e=r[t];e.renderer&&e.renderer.render(e,n)}}}removeFromGroup(t,e){let n=this._groupInfo[e]._objectMap.get(t);n&&r.removeFromList(t,n)}addToGroup(t,e,n){this._groupInfo[n]._nameMap.hasOwnProperty(e)||(this._groupInfo[n]._nameMap[e]=[]),this._groupInfo[n]._nameMap[e].push(t),this._groupInfo[n]._objectMap.set(t,this._groupInfo[n]._nameMap[e])}addElement(t,e,n,r){if(!t)return this;if(-1!==this._elems.indexOf(t))throw"Element already exists in this manager";{let i;h(t),this._elems.push(t),t.getElements||(t.getElements=function(){return[t]}),i=t.getElements();for(let t=0;t<i.length;++t){let a=i[t];e&&this.addToTooltipGroup(a,e),n&&this.addToHighlightGroup(a,n),r&&this.addToRenderGroup(a,r)}}return t.manager=this,this}removeElement(t){if(!t)return this;let e;e=t.getElements?t.getElements():[t];for(let t=0;t<e.length;++t){let n=e[t];this.removeFromTooltipGroup(n),this.removeFromHighlightGroup(n),this.removeFromRenderGroup(n)}return r.removeFromList(t,this._elems),delete t.manager,this}getElements(){return this._elems}setZoomCallback(t){return this._zoomCallback=t,this}setHoverCallback(t){return this._hoverCallback=t,this}setClickCallback(t){return this._clickCallback=t,this}setTooltipCallback(t){return this._tooltipCallback=t,this}setBrushCallback(t){return this._brushCallback=t,this}addToTooltipGroup(t,e){s(t),this.removeFromTooltipGroup(t),this.addToGroup(t,e,0);let n=this;if(t.onTooltip){let e=t.onTooltip;t.onTooltip=function(t){n._onTooltipCallback(t),e(t)}}else t.onTooltip=this._onTooltipCallback;return this}removeFromTooltipGroup(t){return this.removeFromGroup(t,0),this}addToFocusGroup(t,e){l(t),this.removeFromFocusGroup(t);let n=this;if(t.onHover){let e=t.onHover;t.onHover=function(t){n._onHoverCallback(t),e(t)}}else t.onHover=n._onHoverCallback;return this.addToGroup(t,e,3),this}removeFromFocusGroup(t){return this.removeFromGroup(t,3),this}addToSelectGroup(t,e){u(t),this.removeFromSelectGroup(t);let n=this;if(t.onClick){let e=t.onClick;t.onClick=function(t){n._onClickCallback(t),e(t)}}else t.onClick=n._onClickCallback;return this.addToGroup(t,e,4),this}removeFromSelectGroup(t){return this.removeFromGroup(t,4),this}addToHighlightGroup(t,e){l(t),this.removeFromHighlightGroup(t),this.addToFocusGroup(t,e),this.addToSelectGroup(t,e);let n=this;if(t.onBrush){let e=t.onBrush;t.onBrush=function(t){n._onBrushCallback(t),e(t)}}else t.onBrush=n._onBrushCallback;if(t.onCursorChanged){let e=t.onCursorChanged;t.onCursorChanged=function(t){n._onCursorChangeCallback(t),e(t)}}else t.onCursorChanged=this._onCursorChangeCallback;if(t.onZoom){let e=t.onZoom;t.onZoom=function(t){n._onZoomCallback(t),e(t)}}else t.onZoom=this._onZoomCallback;let a=this._groupInfo[1]._nameMap[e];if(a&&a.length){let e=a[0];if(e.api.getOptions&&t.api&&t.api.zoom){let n=e.api.getOptions(),a=r.copy(n);a.event=i.EventType.Zoom,setTimeout(()=>{t.api.zoom(a)})}}return this.addToGroup(t,e,1),this}removeFromHighlightGroup(t){return this.removeFromFocusGroup(t),this.removeFromSelectGroup(t),this.removeFromGroup(t,1),this}addToRenderGroup(t,e){c(t),this.removeFromRenderGroup(t),this.addToGroup(t,e,2);let n=this;if(t.handleUpdate){let e=t.handleUpdate;t.handleUpdate=function(t,r){n._onUpdateCallback(t,r),e(t,r)}}else t.handleUpdate=this._onUpdateCallback;return this}removeFromRenderGroup(t){return this.removeFromGroup(t,2),this}clear(){this._elems.length=0,this._groupInfo.length=0;for(let t=0;t<5;++t)this._groupInfo.push(new o)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(0),i=n(3),a=n(7),o=n(10);class s{constructor(t){this._graphicsMap={},this._renderer=t}add(t,e,n,r,i){let a;return t?(this._graphicsMap[t]||(this._graphicsMap[t]=this._renderer.generateTexture(i(),n,r)),a=new o.Sprite(this._graphicsMap[t])):(this._graphicsMap[e]||(this._graphicsMap[e]=this._renderer.generateTexture(i(),n,r)),a=new o.Sprite(this._graphicsMap[e])),a}}e.GraphicsManager=s;e.PIXIHelper=class{constructor(t=!0){this._selectionItems={},o.utils.skipHello(),this._renderer=t?new o.Renderer({transparent:!0,antialias:!0}):new o.CanvasRenderer({transparent:!0,antialias:!0});let e=new o.Graphics;e.beginFill(16777215),e.drawRect(0,0,1,1),e.endFill(),this._rectTexture=this._renderer.generateTexture(e,o.SCALE_MODES.LINEAR,128)}getRenderer(){return this._renderer}createGraphicsManager(){return new s(this._renderer)}addPixiSvg(t,e,n,r){let i=t.node().getElementsByClassName(e);for(let t=0;t<i.length;++t){let e=i[t];e.parentNode.removeChild(e)}let a=t.append("foreignObject").attr("class",e).attr("width",n).attr("height",r),o=a.node().appendChild(this._renderer.view),s=function(){let t=navigator.userAgent.match(/Chrom(?:e|ium)\/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/);if(null==t||5!=t.length)return;let e=t.map(t=>parseInt(t,10));return{major:e[1],minor:e[2],build:e[3]}}();if(void 0!==s&&s.major<75){o.style.position="fixed",o.style.top=-window.scrollY+"px";let t=-window.scrollY,e=window.scrollY;document.addEventListener("scroll",(function(){t-=window.scrollY-e,o.style.top=t+"px",e=window.scrollY}))}return this._renderer.resize(n,r),a}createRectange(t,e,n){var r=new o.Sprite(this._rectTexture);return r.width=t,r.height=e,r.tint=n,r}createRectangleContainer(t,e,n,r,i){var a=new o.Container;let s=this.createRectange(n,r,i);return a.addChild(s),a.position.x=t,a.position.y=e,a}renderText(t,e,n=0,r=2,i=.5){this._useWebGLRenderer||(r=1,i=1);let a=e.style("font-size");a=Number(a.substring(0,a.length-2))*r+"px";let s=new o.Text(t,{fill:n,fontFamily:e.style("font-family"),fontSize:a,fontWeight:e.style("font-weight")});return s.scale=new o.Point(i,i),s}addInteractionHelper(t,e,n,o,s,u,l,c,h,f,d){t.interactive=!0;let g,p=this;function _(t){t.stopPropagation(),c&&c.onMouseLeave(t),a.showContextMenu(t.data.originalEvent,f,s)}(n||o)&&t.on("click",(function(t){t.stopPropagation(),o?g?(window.clearTimeout(g),g=null,o({caller:h,event:r.EventType.DoubleClick,data:f})):g=setTimeout((function(){g&&(e.disableSelection||i.onSelectHelper(h,f,d||f),n({caller:h,event:r.EventType.Click,data:f}),g=null)}),300):(e.disableSelection||i.onSelectHelper(h,f,d||f),n({caller:h,event:r.EventType.Click,data:f}))})),s&&s.length&&t.on("rightupoutside",_).on("rightup",_),u&&t.on("mouseover",(function(t){t.target&&(this.__data__=f,u.call(this),c&&(p._tooltipTarget=t.target,c.onMouseEnter(f),c.onMouseMove(f,t.data.originalEvent)))})),l&&t.on("mouseout",(function(t){l.call(this),c&&t.currentTarget===p._tooltipTarget&&c.onMouseLeave(f)}))}clearSelections(){this._selectionItems={}}addSelection(t,e){this._selectionItems.hasOwnProperty(t)||(this._selectionItems[t]=[]),this._selectionItems[t].push(e)}getSelection(t){return this._selectionItems[t]}getStage(){return this._stage}render(t){t?(this._stage=t,this._renderer.render(t)):this._stage&&this._renderer.render(this._stage)}}},,,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(18);function i(){let t=window.navigator.userAgent,e=t.indexOf("MSIE ");if(e>0)return r.polyfill(),String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return e=e||0,this.substr(e,t.length)===t}),parseInt(t.substring(e+5,t.indexOf(".",e)),10);if(t.indexOf("Trident/")>0){r.polyfill(),String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return e=e||0,this.substr(e,t.length)===t});let e=t.indexOf("rv:");return parseInt(t.substring(e+3,t.indexOf(".",e)),10)}let n=t.indexOf("Edge/");return n>0&&parseInt(t.substring(n+5,t.indexOf(".",n)),10)}e.detectIE=i,document.addEventListener("DOMContentLoaded",(function(){i()}),!1),e.useIEPolyfill=function(t){try{new CustomEvent("test")}catch(e){let n=function(e,n){n=n||{bubbles:!1,cancelable:!1};var r=document.createEvent("MouseEvent");return r.initMouseEvent(e,n.bubbles,n.cancelable,t,0,0,0,0,0,!1,!1,!1,!1,0,null),r};n.prototype=Event.prototype,t.MouseEvent=n}}},function(t,e){t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(1),i=n(0),a=n(2);class o{constructor(t,e,n=!1,r,i){this._currFocus=[],this._currSelection=[],this._focus=t,this._unfocus=e,this._select=r,this._unselect=i,this._doBlink=n}static getFocusColor(t){let e=a.color(t),n=a.color(e).darker(2).toString();return n===e.toString()&&(e.opacity=.6*e.opacity,n=e.toString()),n}_addFocusHelper(t){let e=this;this._focus(t),e._doBlink&&(clearTimeout(this._highlightTimer),this._highlightTimer=setTimeout((function(){e._unfocusHelper(t,!0)}),500))}_unfocusHelper(t,e=!1){let n=this;this._unfocus(t),this._doBlink&&e&&(clearTimeout(this._highlightTimer),this._highlightTimer=setTimeout((function(){n._addFocusHelper(t)}),500))}_addSelectionHelper(t){let e=this;this._select(t),e._doBlink&&(clearTimeout(this._highlightTimer),this._highlightTimer=setTimeout((function(){e._removeSelectionHelper(t,!0)}),500))}_removeSelectionHelper(t,e=!1){let n=this;this._unselect(t),this._doBlink&&e&&(clearTimeout(this._highlightTimer),this._highlightTimer=setTimeout((function(){n._addSelectionHelper(t)}),500))}focus(t){if(!isNaN(Number(t.selection)))return void(void 0===t.selection?console.debug("Chart unable to fire focus event with undefined selection"):0===t.selection.length?console.debug("Chart unable to fire focus event with an empty string selection"):console.debug("Chart unable to fire focus event using a number as the selection class due to CSS limitations"));let e=r.getSelectionName(t.selection),n=this._currFocus.indexOf(e);switch(t.event){case i.EventType.SelectAdd:case i.EventType.HoverStart:case i.EventType.FocusStart:-1===n&&(this._currFocus.push(e),this._addFocusHelper(e));break;case i.EventType.SelectRemove:case i.EventType.HoverEnd:case i.EventType.FocusEnd:-1!==n&&(clearTimeout(this._highlightTimer),this._currFocus.splice(n,1),this._unfocusHelper(e));break;case i.EventType.SelectClear:case i.EventType.HoverClear:case i.EventType.FocusClear:clearTimeout(this._highlightTimer);for(let t=0;t<this._currFocus.length;++t)this._unfocusHelper(this._currFocus[t]);this._currFocus=[]}}select(t){if(!isNaN(Number(t.selection)))return void(void 0===t.selection?console.debug("Chart unable to fire focus event with undefined selection"):0===t.selection.length?console.debug("Chart unable to fire focus event with an empty string selection"):console.debug("Chart unable to fire focus event using a number as the selection class due to CSS limitations"));let e=r.getSelectionName(t.selection),n=this._currSelection.indexOf(e);switch(t.event){case i.EventType.SelectAdd:-1===n&&(this._currSelection.push(e),this._addSelectionHelper(e));break;case i.EventType.SelectRemove:-1!==n&&(clearTimeout(this._highlightTimer),this._currSelection.splice(n,1),this._removeSelectionHelper(e));break;case i.EventType.SelectClear:clearTimeout(this._highlightTimer);for(let t=0;t<this._currSelection.length;++t)this._removeSelectionHelper(this._currSelection[t]);this._currSelection=[]}}onRedraw(){this._currFocus.forEach(t=>{this._addFocusHelper(t)}),this._currSelection.forEach(t=>{this._addSelectionHelper(t)})}}e.InteractionState=o,e.SelectionHelper=o},,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.Linear=0]="Linear",t[t.Logarithmic=1]="Logarithmic",t[t.Ordinal=2]="Ordinal"}(e.AxisType||(e.AxisType={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(0),i=n(6),a=n(11),o=n(1),s=n(8),u=n(3),l=n(14),c=n(5),h=n(12),f=n(2),d=n(10);class g extends h.BaseSeries{constructor(t,e,n,r,i,a){super(t,e,r,i,a,n),this._colors=e.colors,this.setData(e)}static canRender(t){return 0!==(t.renderType&i.RenderType.Line||t.renderType&i.RenderType.Area||t.renderType&i.RenderType.Scatter||t.renderType&i.RenderType.DirectionalArrow)&&1===t.data.length&&!(t.renderType&i.RenderType.Stacked)&&t.data[0]&&t.data[0].hasOwnProperty("values")}initializeClasses(){let t;this._layer.renderType&i.RenderType.Scatter?t="chart-scatter":this._layer.renderType&i.RenderType.Line?t="chart-line":this._layer.renderType&i.RenderType.Area?t="chart-area":this._layer.renderType&i.RenderType.DirectionalArrow&&(t="chart-arrow"),this._classes=this.getClassNames(t),this._selectionClasses=this.getSelectionClasses(t),this._layer.renderType&i.RenderType.Stacked&&(this._classes+=" chart-stacked")}setData(t,e=0){this._data=t.data[e],Array.isArray(this._data.values)?this._values=new o.SimpleBuffer(this._data.values):this._values=this._data.values,this.initializeClasses()}applyStyles(){if(super.applyStyles(),this._data.css){let t=this._data.css.style;if(t)for(let e=0;e<this._d3Elems.length;++e)for(let n in t)this._d3Elems[e].style(n,t[n])}}getDecimationName(){return this._layer.decimator?o.getSelectionName(this._layer.decimator.getName()):""}getInterpolateType(){let t=f.curveLinear;switch(this._layer.interpolateType){case i.InterpolateType.StepBefore:t=f.curveStepBefore;break;case i.InterpolateType.StepAfter:t=f.curveStepAfter}return t}getName(){return this._data.name?this._data.name:""}isYContinuousSeries(){if(Array.isArray(this._data.values)){if(this._data.values.length)return!isNaN(this._data.values[0].y)}else{let t=this._data.values;if(t.length()>0)return!isNaN(t.get(0).y)}return!0}getCss(){return this._data.css}getDiscreteXValues(t){return u.getKeys(this._data.values,(function(t){return[t.x]}))}getDiscreteYValues(){return u.getKeys(this._data.values,(function(t){return[t.y]})).reverse()}getXMinMax(){let t=[Number.MAX_VALUE,Number.MIN_VALUE],e=this._values.length();for(let n=0;n<e;++n)t[0]=Math.min(t[0],this._values.get(n).x),t[1]=Math.max(t[1],this._values.get(n).x);let n=this.getXScalingInfo().baseScale.scalar;if(t[0]=t[0]*n,t[1]=t[1]*n,this._layer.renderType&i.RenderType.Scatter&&this._d3Chart.getOptions().disableZoomViewUpdate){let e=3;this._layer.css&&this._layer.css.style&&this._layer.css.style.r&&(e=this._layer.css.style.r);let n=t[1]-t[0],r=e/this._d3Chart.getOptions().width*n;t[0]=t[0]-r,t[1]=t[1]+r}return t}getYMinMax(){let t=[Number.MAX_VALUE,Number.MIN_VALUE],e=this._values.length();for(let n=0;n<e;++n)t[0]=Math.min(t[0],this._values.get(n).y),t[1]=Math.max(t[1],this._values.get(n).y);if(this._layer.renderType&i.RenderType.Scatter&&this._d3Chart.getOptions().disableZoomViewUpdate){let e=3;this._layer.css&&this._layer.css.style&&this._layer.css.style.r&&(e=this._layer.css.style.r);let n=t[1]-t[0],r=e/this._d3Chart.getOptions().height*n;t[0]=t[0]-r,t[1]=t[1]+r}return t}decimateData(t,e,n,r){let o=this;if(o._worker&&(o._worker.terminate(),o._worker=null),o.isXContinuousSeries()){let s;if(o._layer.decimator)s=o._layer.decimator;else if(o._layer.renderType&i.RenderType.Raw)s=new a.XYDummyDecimator;else if(o._layer.renderType&i.RenderType.Line)s=o._d3YAxis.isBanded()?new a.NEWSStateDecimator:new a.NEWSPointDecimator;else if(o._layer.renderType&i.RenderType.Area)s=o._d3YAxis.isBanded()?new a.NEWSStateDecimator:new a.AvgContinuousDecimator;else{if(!(o._layer.renderType&i.RenderType.Scatter)){if(o._layer.renderType&i.RenderType.DirectionalArrow)return new Promise((function(t,e){o.setOutputData(o._values),t()}));throw"Unexpected that there is no way to decimate the given data"}s=new a.XYPointDecimator}let u=n.getScale(),l=r.getScale();return(o._layer.enableWebWorkers||o._d3Chart.getOptions().enableWebWorkers)&&a.InternalDecimatorMap[s.getKey()]?new Promise((function(n,r){o._worker=c.createDecimatorWorker(s,t,e,o._d3XAxis,o._d3YAxis,o._values.getData(),void 0,(function(t){o._worker=null,o.setOutputData(t),n()}),(function(r){o._worker=null,s.initialize(u,u.invert,l),o.setOutputData(s.decimateValues(t,e,o._values)),n()}))})):new Promise((function(n,r){s.initialize(u,u.invert,l),o.setOutputData(s.decimateValues(t,e,o._values)),n()}))}return new Promise((function(t,e){o.setOutputData(o._values),t()}))}getTooltipText(t){return isNaN(t)?t:(t*this.getYScalingInfo().baseScale.scalar).toFixed(2)+this.getYScalingInfo().baseScale.units}getTooltipMetrics(t,e){let n={source:t,group:"",metrics:{}};if(this._layer.renderType&i.RenderType.Raw);else if(this._outputData&&this._outputData.length()>0&&e.xEnd)if(this._layer.renderType&i.RenderType.Line||this._layer.renderType&i.RenderType.Area){if(!this._d3XAxis.isBanded()){let t=o.bisectBuffer((function(t){return t.x})).left(this._outputData,e.xEnd);t>=this._outputData.length()&&(t=this._outputData.length()-1),this._layer.interpolateType&&this._layer.interpolateType===i.InterpolateType.StepAfter&&--t,t=c.getBoundedPixelValue(t,this._outputData.length()-1);let r=this._data.name?this._data.name:"";n.metrics[r]=this.getTooltipText(this._outputData.get(t).y),void 0!==this._outputData.get(t).min&&void 0!==this._outputData.get(t).max&&this._outputData.get(t).max!==this._outputData.get(t).min&&(n.metrics[r+" Min"]=this.getTooltipText(this._outputData.get(t).min),n.metrics[r+" Max"]=this.getTooltipText(this._outputData.get(t).max))}}else this._layer.renderType,i.RenderType.Scatter;else if(e.selection){let t=this.getYScalingInfo().baseScale.scalar,r=this.getYScalingInfo().baseScale.units;for(let i=0;i<this._values.length();++i){let a=this._values.get(i).x,o=this._values.get(i).y;if(a==e.selection){n.metrics[this._data.name]=(o*t).toFixed(2)+r;break}}}return[n]}getLegendInfo(){let t=[];if(this._layer.renderType===i.RenderType.DirectionalArrow)return t;for(let e=0;e<this._d3Elems.length;++e){let n=this._data.name;this._layer.decimator&&(n+=" "+this._layer.decimator.getName());let r="fill",a="rect";this._layer.renderType&i.RenderType.Line?(r="stroke",a="line"):this._layer.renderType&i.RenderType.Scatter&&(a="circle");try{let i=this._d3Elems[e].style(r);t.push({key:n,color:i,opacity:this._d3Elems[e].style("opacity"),shape:a}),""!==i&&this._d3Chart.getRenderer().getColorManager().setColor(n,t[t.length-1].color)}catch(e){t.push({key:n,color:this._d3Chart.getRenderer().getColorManager().getColor(n),opacity:"1",shape:a})}}return t}getAngle(t,e){return 180*Math.atan2(e.y-t.y,e.x-t.x)/Math.PI}getAnimateDuration(){return void 0!==this._d3Chart.getOptions().animateDuration?this._d3Chart.getOptions().animateDuration:1e3}renderArrows(t,e){let n,r=this,i=r._d3svg.selectAll(r._selectionClasses+".line"),a=r._d3svg.selectAll(r._selectionClasses+".arrow");if(i.empty()){if(i=this._d3svg.append("path").classed(this._classes,!0).classed("line",!0).attr("fill","none").attr("stroke-width",1).attr("stroke",e),a=u.Arrow.createArrow(r._d3svg,4).classed(this._classes,!0).classed("arrow",!0).attr("fill",e),this._data.css)for(let t in this._data.css.classes)i.classed(t,!0);this._d3Elems.push(i),this._d3Elems.push(a)}n=f.line().x(r.xIndexMap).y(r.yIndexMap),n.curve(this.getInterpolateType()),this.getOutputData().length()>0&&(i.attr("d",n(t)),u.animatePath(i,r.getAnimateDuration()),u.Arrow.animateArrow(i,a,r.getAnimateDuration()))}optimizeLinePath(t){let e=[],n=this.getOutputData().length();if(n>0){let r={x:this.xIndexMap(0),y:Math.round(t(0))};e.push(r);for(let i=1;i<n;++i){let a={x:this.xIndexMap(i),y:Math.round(t(i))};a.y===r.y&&i!==n-1||(e[e.length-1]!==r&&e.push(r),e.push(a)),r=a}}return e}renderLines(t){let e=this,n=(this._layer.renderType&i.RenderType.Stacked)===i.RenderType.Stacked,a=e._d3svg.select(e._selectionClasses);if(a.empty()){let n=function(){e.configureItemInteraction(f.select(this),void 0,void 0),(e._layer.renderType&i.RenderType.Raw||e._layer.onHover)&&f.select(this).on("mouseenter",(function(){let t={caller:e._d3Chart.getElement(),selection:e.getName(),event:r.EventType.HoverStart,data:e.getName(),tooltip:e._d3Chart.getTooltip()};e._d3Chart.onHover(t),e._layer.onHover&&e._layer.onHover(t)})).on("mouseleave",(function(){let t={caller:e._d3Chart.getElement(),selection:e.getName(),event:r.EventType.HoverEnd,tooltip:e._d3Chart.getTooltip(),data:e.getName()};e._d3Chart.onHover(t),e._layer.onHover&&e._layer.onHover(t)}))};if(a=this._d3svg.append("path").classed(this._classes,!0).attr("id",e._classes).attr("fill","none").attr("stroke-width",1).attr("stroke",t).each(n),this._data.css)for(let t in this._data.css.classes)a.classed(t,!0);if(this._data.description){let n="0%",i="-.5em";e._data.description.text&&(n=e._data.description.percentage?`${e._data.description.percentage}%`:"0%",i=e._data.description.alignment===r.Alignment.Bottom?"1em":"-.5em"),this._d3svg.append("text").classed(e._classes,!0).classed("title",!0).attr("dy",i).attr("fill",t).append("textPath").attr("startOffset",n).attr("xlink:href","#"+e._classes).text(this._data.description.text)}}if(!n&&this._outputData.length()>0&&this._outputData.get(0).hasOwnProperty("min")&&this._outputData.get(0).hasOwnProperty("max")&&this._outputData.get(0).hasOwnProperty("entry")&&this._outputData.get(0).hasOwnProperty("exit")){let t=[];for(let e=0;e<this._outputData.length();++e){let n=this._outputData.get(e),r=n.entry;t.push({x:n.x,y:n.entry}),r!==n.min&&(t.push({x:n.x,y:n.min}),r=n.min),r!==n.max&&(t.push({x:n.x,y:n.max}),r=n.max),r!==n.exit&&t.push({x:n.x,y:n.exit})}let n=f.line().x((function(t){return e.xMap(t.x)})).y((function(t){return e.yMap(t.y)})).curve(this.getInterpolateType());a.attr("d",n(t))}else{let t;t=n?e.optimizeLinePath(e.yIndexPostStackMap):e.optimizeLinePath(e.yIndexMap);let r=f.line().x(t=>t.x).y(t=>t.y).curve(this.getInterpolateType());a.attr("d",r(t))}this._d3Elems.push(a)}optimizeAreaPath(t,e){let n=[],r=this.getOutputData().length();if(r>0){let i={x:this.xIndexMap(0),y0:Math.round(t(0)),y1:Math.round(e(0))};n.push(i);for(let a=1;a<r;++a){let o={x:this.xIndexMap(a),y0:Math.round(t(a)),y1:Math.round(e(a))};o.y0===i.y0&&o.y1===i.y1&&a!==r-1||(n[n.length-1]!==i&&n.push(i),n.push(o)),i=o}}return n}renderAreas(t,e){let n,o=this,s=(this._layer.renderType&i.RenderType.Stacked)===i.RenderType.Stacked,u=o._d3svg.select(this._selectionClasses);if(u.empty()&&(u=this._d3svg.append("path").classed(this._classes,!0).attr("id",o._classes).attr("fill",e),this._data.description)){let t="0%",n="-.5em";o._data.description&&(t=o._data.description.percentage?`${o._data.description.percentage}%`:"0%",n=o._data.description.alignment===r.Alignment.Bottom?"1em":"-.5em"),this._d3svg.append("text").classed(o._classes,!0).classed("title",!0).attr("dy",n).attr("fill",e).append("textPath").attr("startOffset",t).attr("xlink:href","#"+o._classes).text(this._data.description.text)}this.configureItemInteraction(u,void 0,void 0),s?n=this.optimizeAreaPath(o.yIndexPreStackMap,o.yIndexPostStackMap):this._outputData.length()>0&&this._outputData.get(0)instanceof a.NEWSDecimationValue?(u.attr("stroke",e),n=this.optimizeAreaPath((function(t){return o.yMap(o._outputData.get(t).min)}),(function(t){return o.yMap(o._outputData.get(t).max)}))):n=this.optimizeAreaPath((function(t){return o.yMap(0)}),o.yIndexMap);let l=f.area().x(t=>t.x).y0(t=>t.y0).y1(t=>t.y1).curve(this.getInterpolateType());u.attr("d",l(n)),this._d3Elems.push(u)}renderCirclePoints(t,e,n){}render(t){let e=this;if(this._d3Elems=[],this._layer.forceUpdate){let t=this._classes.replace(/ /g,".");this._d3svg.selectAll(t).remove(),this.initializeClasses(),this._layer.forceUpdate=!1}let n=e._d3XAxis.getScale().copy();n.clamp&&n.clamp(!1);let r=e._d3YAxis.getScale().copy();r.clamp&&r.clamp(!1);let a=n.bandwidth?n.bandwidth()/2:0,o=r.bandwidth?r.bandwidth()/2:0,s=f.range(0,this._outputData.length());e.xMap=function(t){return n(t)+a},e.yMap=function(t){let e=r(t);return void 0===e&&(e=0),e+o},e.xIndexMap=function(t){return e.xMap(e._outputData.get(t).x)},e.yIndexMap=function(t){return e.yMap(e._outputData.get(t).y)},e.yIndexPreStackMap=function(n){return e.yMap(t[n])},e.yIndexPostStackMap=function(n){return t[n]+=e._outputData.get(n).y,e.yMap(t[n])};let u,l=e._d3Chart.getGraphGroup();e._layer.getAbsolutePosition=function(t){let n=l.node().getBoundingClientRect();return n?{x:n.left+e.xMap(t.x),y:n.top+e.yMap(t.y)}:{x:void 0,y:void 0}},e._data.css&&(u=e._data.css.style.color),u||(u=e._colors&&e._colors[e.getName()]?e._colors[e.getName()]:e._d3Chart.getRenderer().getColorManager().getColor(e.getName())),this.initializeContextMenuItems(),e._layer.renderType&i.RenderType.Line?e.renderLines(u):e._layer.renderType&i.RenderType.Area?e.renderAreas(s,u):e._layer.renderType&i.RenderType.Scatter&&(e._d3Chart.getOptions().forceSvgRenderer?this.renderCirclePoints=p.prototype.renderCirclePoints.bind(this):(this.renderCirclePoints=_.prototype.renderCirclePoints.bind(this),this.focus=_.prototype.focus.bind(this),this.unfocus=_.prototype.unfocus.bind(this),this.select=_.prototype.select.bind(this),this.unselect=_.prototype.unselect.bind(this)),e.renderCirclePoints(s,u,3)),e._layer.renderType&i.RenderType.DirectionalArrow&&e.renderArrows(s,u),e.applyStyles()}getRenderedYRange(){let t=[Number.MAX_VALUE,-Number.MAX_VALUE];for(let e=0;e<this.getOutputData().length();++e){let n=this.getOutputData().get(e);n.min?t[0]=Math.min(n.min,t[0]):t[0]=Math.min(n.y,t[0]),n.max?t[1]=Math.max(n.max,t[1]):t[1]=Math.max(n.y,t[1])}return t}}e.XYSeries=g,c.D3Chart.register(g);class p extends g{renderCirclePoints(t,e,n){let i=this,a=function(t){let n=i._outputData.get(t);if(n.info&&n.info.colorKey)return i._d3Chart.getRenderer().getColorManager().getColor(n.info.colorKey);let r=n.y;return i._colors&&i._colors[r]?i._colors[r]:e},s=function(t){let e=i._outputData.get(t),n="";e.info&&e.info.title&&(n=e.info.title),i.configureItemInteraction(f.select(this),i.getOutputData().get(t),n),i._layer.onHover&&f.select(this).on("mouseenter",(function(){let t={caller:i._d3Chart.getElement(),selection:n,event:r.EventType.HoverStart,tooltip:i._d3Chart.getTooltip(),data:e};i._d3Chart.onHover(t),i._layer.onHover(t),i._d3Chart.getTooltip().displayTooltip(0)})).on("mousemove",(function(){f.event.stopPropagation()})).on("mouseleave",(function(){let t={caller:i._d3Chart.getElement(),selection:n,event:r.EventType.HoverEnd,tooltip:i._d3Chart.getTooltip(),data:e};i._d3Chart.onHover(t),i._layer.onHover(t),i._d3Chart.getTooltip().hideTooltip()}))},u=function(t){let e=i._outputData.get(t),n=f.select(this);e.info&&(e.info.colorKey&&n.classed(o.getSelectionName(e.info.colorKey),!0),e.info.title&&n.classed(o.getSelectionName(e.info.title),!0))};if(this._data.showTitleText){let e=this._outputData.getData();e=e.sort((t,e)=>t.x*t.x+t.y*t.y-(e.x*e.x+e.y*e.y)),this._outputData=new o.SimpleBuffer(e);let n,r,s=this._d3Chart.getGraphGroup().node().getBoundingClientRect(),l=[],c=function(t,e,i){let a;a=i?-e-10:10;let u=f.select(t);u.attr("dx",`${a}px`);let h=t.getBoundingClientRect();if(h.left<s.left){if(n){let r=Number(u.attr("y"));return u.attr("y",r-1-(h.height-(n.y-h.y))),c(t,e,!i)}t.remove()}else if(h.y<s.y)console.log("Unable to render XY Scatter text in graph area");else for(let a=0;a<l.length;++a){let s=l[a];if(o.isOverlapping(s,h)){if(!i&&Math.round(h.x)===Math.round(s.x)&&Math.round(h.y)===Math.round(s.y)){let r=Number(u.attr("x")),i=u.text();return i.length>0&&0!==i[0].localeCompare(",")&&u.text(","+i),u.attr("x",r+1+s.width),n=s,c(t,e,!1)}let a=Number(u.attr("y"));return i?(r=s,u.attr("y",a-1-(h.height-(n.y-h.y)))):(n=s,r&&u.attr("y",a-1-(h.height-(r.y-h.y)))),c(t,e,!i)}}l.push(h)},h=function(){r=void 0,n=void 0;let t=this.getBoundingClientRect();c(this,t.width,!1)},d=i._d3svg.selectAll(i.getSelectionClasses("chart-scatter")).filter("text").data(t);d.exit().remove(),d.enter().append("text").classed(i._classes,!0).text((function(t){return i._outputData.get(t).info.title})).attr("x",i.xIndexMap).attr("y",i.yIndexMap).attr("dy",.5).attr("fill",a).each(u).each(h),d.classed(i._classes,!0).text((function(t){return i._outputData.get(t).info.title})).attr("x",i.xIndexMap).attr("y",i.yIndexMap).each(u).each(h)}let l=function(t){if(i._layer.useValueWhenRendering){let e=i.getOutputData().get(t);return f.max([e.value,n])}return n},c=i._d3svg.selectAll(i._selectionClasses).filter("circle").data(t);c.exit().remove(),c.enter().append("circle").classed(this._classes,!0).attr("r",l).attr("cx",i.xIndexMap).attr("cy",i.yIndexMap).attr("fill",a).attr("stroke",a).each(u).each(s).each((function(){i._d3Elems.push(f.select(this))})),c.classed(this._classes,!0).attr("r",l).attr("cx",i.xIndexMap).attr("cy",i.yIndexMap).attr("fill",a).attr("stroke",a).each(u).each(s).each((function(){i._d3Elems.push(f.select(this))}))}}class _ extends g{select(t){if(t){let e=this,n=this._d3svg.classed("selected",!0);n.classed("selected",!0);let r=s.ColorManager.RgbToInt(n.style("stroke")),i=parseInt(n.style("stroke-width"),10);this._d3svg.classed("selected",!1);let a=function(t){let n=t.width/2,a=n/2+i,o=e._graphicsMgr.add(e.getName()+a,e.getName()+a,d.SCALE_MODES.LINEAR,1,(function(){let t=new d.Graphics;return t.beginFill(16777215),t.drawCircle(0,0,a),t.endFill(),t}));return o.x=t.x+n-a,o.y=t.y+n-a,o.tint=r,o.__data__=t.__data__,o},o=this._pixiHelper.getSelection(t);o&&(e._selectTempItems||(e._selectTempItems={}),o.forEach((function(n,r){let i=a(n);e._selectTempItems[`${t}Select${r}`]=i,e._stage.addChildAt(i,0)}))),this._pixiHelper.render()}}unselect(t){this._d3svg.select(".segments").classed("selected",!1);let e=this._pixiHelper.getSelection(t);if(e){let n=this;e.forEach((function(e,r){let i=n._selectTempItems[`${t}Select${r}`];n._stage.removeChild(i),delete n._selectTempItems[`${t}Select${r}`]})),this._pixiHelper.render()}}renderCirclePoints(t,e,n){let i=this,a=this._d3Chart.getElement();this._stage=new d.Container,this._pixiHelper||(this._pixiHelper=new l.PIXIHelper(!this._d3Chart.getOptions().forceCanvasRenderer),this._pixi=this._pixiHelper.getRenderer());let s=this._pixiHelper.addPixiSvg(i._d3svg,this._classes,this._d3XAxis.getRangePixels(),this._d3YAxis.getRangePixels());this._pixiHelper.clearSelections(),s.attr("fill",e).style("fill",e),this._d3Elems.push(s),i.configureItemInteraction(s,void 0,void 0),this._graphicsMgr=new l.GraphicsManager(this._pixi);let u=function(t){if(i._layer.useValueWhenRendering){let e=i.getOutputData().get(t);return f.max([e.value,n])}return n};t.forEach((function(t){let n=u(t),s=i._graphicsMgr.add(i.getName()+n,i.getName()+n,d.SCALE_MODES.LINEAR,1,(function(){let t=new d.Graphics;return t.beginFill(16777215),t.drawCircle(0,0,n),t.endFill(),t}));s.x=i.xIndexMap(t)-n,s.y=i.yIndexMap(t)-n,s.tint=parseInt(function(t){let n=i._outputData.get(t);if(n.info&&n.info.colorKey)return i._d3Chart.getRenderer().getColorManager().getColor(n.info.colorKey);let r=n.y;return i._colors&&i._colors[r]?i._colors[r]:e}(t).substring(1),16),function(t,e){let n=i._outputData.get(e),s="";i._layer.onHover&&n.info&&n.info.title&&(s=n.info.title,i._pixiHelper.addSelection(o.getSelectionName(n.info.title),t)),i._pixiHelper.addInteractionHelper(t,i._d3Chart.getOptions(),void 0,void 0,i._contextMenuItems,i._layer.onHover?()=>{let t={caller:i._d3Chart.getElement(),selection:s,event:r.EventType.HoverStart,data:n,tooltip:i._d3Chart.getTooltip()};i._d3Chart.onHover(t),i._layer.onHover(t),i._d3Chart.getTooltip().displayTooltip(0)}:void 0,i._layer.onHover?()=>{let t={caller:i._d3Chart.getElement(),selection:s,event:r.EventType.HoverEnd,data:n,tooltip:i._d3Chart.getTooltip()};i._d3Chart.onHover(t),i._layer.onHover(t),i._d3Chart.getTooltip().hideTooltip()}:void 0,void 0,a,n,n),i.configureItemInteractionPIXI(t,n,s),n.info&&n.info.title&&i._pixiHelper.addSelection(o.getSelectionName(n.info.title),t)}(s,t),i._stage.addChild(s)})),this._data.showTitleText,this._pixiHelper.render(this._stage)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.XYValue=class{constructor(t,e){this.x=t,this.y=e}};e.MinMaxValue=class{constructor(t,e,n,r){this.x=t,this.min=e,this.max=n,this.y=r}};e.CandlestickValue=class{constructor(t,e,n,r,i){this.x=t,this.min=e,this.max=n,this.entry=r,this.exit=i}};e.SummaryValue=class{constructor(t,e={}){this.key=t,this.data=e}addValue(t,e){let n=this.data;return n.hasOwnProperty(t)?n[t]+=e:n[t]=e,this}}},,,,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(0),i=n(21),a=n(3),o=n(4),s=n(9),u=n(5),l=n(2);e.MAX_DISCRETE_WIDTH=50;class c{constructor(t=1,e="",n=Number.MAX_VALUE){this.baseScale={maxRange:Number.MAX_VALUE,scalar:t,units:e},this.scalars=[]}getBaseUnit(){return this.baseScale.units}getBaseScalar(){return this.baseScale.scalar}addScalar(t){this.scalars.push(t)}getScalars(){return this.scalars}}function h(t,e){if(!t)return{scalar:1,units:"",maxRange:0};let n,r=[t.baseScale];if(t.scalars)for(let e=0;e<t.scalars.length;++e)r.push(t.scalars[e]);for(r.sort((function(t,e){return e.maxRange-t.maxRange})),n=0;n<r.length&&!(r[n].maxRange<e);++n);return r[n-1]}e.ScalingInfo=c,e.getScalar=h;e.D3Axis=class{constructor(t,e,n){switch(this.cache={pixels:-1,domain:new Array},this._axis=e,this._position=n,this._keysPerDomain=1,this._axisPixels=0,this._position=new r.Rect(0,0,0,0),this._d3axes=[],this._axis.alignment){case r.Alignment.Left:this._d3axes.push(l.axisLeft(l.scaleLinear()));break;case r.Alignment.Right:this._d3axes.push(l.axisRight(l.scaleLinear()));break;case r.Alignment.Top:this._d3axes.push(l.axisTop(l.scaleLinear()));break;case r.Alignment.Bottom:this._d3axes.push(l.axisBottom(l.scaleLinear()))}if(this._axis.axisDesc.scaleType===i.AxisType.Ordinal||this._axis.axisDesc.keys&&this._axis.axisDesc.keys.length>0)this._domain=[this._axis.axisDesc.keys],this._isBanded=!0;else{this._domain=[];let t=e.axisDesc.range;t&&void 0!==t.min&&void 0!==t.max&&this.setDomain([t.min,t.max])}this._d3svg=t;let a="axis";if(this._axis.css)for(let t in this._axis.css.classes)a+=" "+t;this._axis.hidden||(this._axisSVG=this._d3svg.append("g").classed(a,!0),this._axis.axisDesc.label&&this._axis.axisDesc.label.length>0&&(this._axisLabel=this._d3svg.append("text").classed("lane-axis-label",!0).style("text-anchor","middle").text(this._axis.axisDesc.label))),this._formatter=function(t){return t}}setRangePixels(t){return this._axisPixels=t,this.getScale().range([0,t]),this}getRangePixels(){return this._axisPixels}setDomain(t,e=0){return this._domain[e]=t,this.getScale().domain(t),this}appendDomain(t,e=0){return this._domain.length<=e&&(this._domain[e]=[]),a.mergeKeys(this._domain[e],t),this}getDomain(t=0){return this._domain[t]}getLevelCount(){return this._domain.length}setKeysPerDomain(t){this._keysPerDomain=t}getAxis(){return this._axis}getPosition(){return this._position}setPosition(t){this._position=t}getRenderedRect(){return this._renderedRect}setScale(t,e=0){return this._d3axes[e].scale(t)}getScale(t=0){return this._d3axes[t].scale()}getCurrentBand(t){let e=this.getScale(),n=e.domain(),r=e.range(),i=r[1]-r[0],a=i/n.length;if(t<=i){return n[Math.round(t/a-.5)]}}mapCoordinateToValue(t){return this._isBanded?this.getCurrentBand(t):this.getScale().invert(t)}setBanded(t){this._isBanded=t}isBanded(){return this._isBanded}setLinearCommitRange(t){this._axisPixels=t;let e=this._d3axes[0].scale().domain(),n=e?e[0]:0,i=e?e[1]:0;n===i&&(i>0?n=0:i=0),n>i&&(console.log("Error minimum axis value is greater than maximum axis value"),n=0,i=1);let a=l.scaleLinear().domain([n,i]).clamp(!0);switch(this._axis.alignment){case r.Alignment.Left:case r.Alignment.Right:this.setScale(a.range([this._axisPixels,0]));break;case r.Alignment.Top:case r.Alignment.Bottom:this.setScale(a.range([0,this._axisPixels]))}return this}setLogrithmicCommitRange(t){this._axisPixels=t;let e=this._d3axes[0].scale().domain(),n=e?e[0]:0,i=e?e[1]:0;this.setDomain([Math.max(1e-9,n),i]),n=this.getDomain()[0],i=this.getDomain()[1],n>i&&(console.log("Error no data for axis"),n=1,i=2);let a=l.scaleLog().base(10).domain([n,i]).clamp(!0);switch(this._axis.alignment){case r.Alignment.Left:case r.Alignment.Right:this.setScale(a.range([this._axisPixels,0]));break;case r.Alignment.Top:case r.Alignment.Bottom:this.setScale(a.range([0,this._axisPixels]))}return this}setBandCommitRange(t){let n=this;this._axisPixels=Math.min(n.getDomain().length*n._keysPerDomain*e.MAX_DISCRETE_WIDTH,t);let r=l.scaleBand().range([0,this._axisPixels]).padding(.1).align(.5).domain(n.getDomain());this.setScale(r);for(let t=1;t<n._domain.length;++t)this._d3axes[t]=l.axisBottom(l.scaleBand().domain(n.getDomain(t)).range([0,n.getScale(t-1).bandwidth()]));return this}commitRange(t){if(this.isBanded())this.setBandCommitRange(t);else switch(this._axis.axisDesc.scaleType){case i.AxisType.Logarithmic:this.setLogrithmicCommitRange(t);break;case i.AxisType.Linear:default:this.setLinearCommitRange(t)}return this}renderNestedAxes(t,e){switch(this._axis.alignment){case r.Alignment.Bottom:if(t===this._d3axes.length-1)return;let n=this._position.y+30*(this._d3axes.length-t-2),i=this.getScale(t-1),a=i.domain();for(let r=0;r<a.length;++r){let o=i(a[r])+e,s=this._d3svg.append("g").classed("nested-axis",!0).attr("transform","translate("+o+", "+n+")");s.call(this._d3axes[t]),this._nestedAxes.push(s),this.renderNestedAxes(t+1,o)}}}addTooltipToHiddenYTicks(){let t=this;this._axisSVG.selectAll(".tick").append("title").text((function(e){let n=e,r=t._axis.axisDesc.scalingInfo;return r&&r.baseScale&&(n+=r.baseScale.units),n}))}removeOverlappingTicksAsc(t,e){let n=this._axisSVG.selectAll(".tick").selectAll("text").nodes();if(n.length>0){let r={},i=0,a=n[i];for(;i<n.length&&0===a.textContent.length;++i)a=n[i];for(r[a.__data__]=!0;i<n.length;){let t=a.getBoundingClientRect();for(++i;i<n.length;++i){let r=n[i],a=r.getBoundingClientRect();if(0!==r.textContent.length&&e(t,a))break}a=n[i],a&&(r[a.__data__]=!0)}Object.keys(r).length!==n.length&&(t.tickFormat(t=>{if(r[t])return this._formatter(t)}),this._axisSVG.call(t),t.tickFormat(this._formatter))}}removeOverlappingTicksDesc(t,e){let n=this._axisSVG.selectAll(".tick").selectAll("text").nodes();if(n.length>0){let r={},i=n.length-1,a=n[i];for(;i>=0&&0===a.textContent.length;--i)a=n[i];for(r[a.__data__]=!0;i>=0;){let t=a.getBoundingClientRect();for(--i;i>=0;--i){let r=n[i],a=r.getBoundingClientRect();if(0!==r.textContent.length&&e(t,a))break}a=n[i],a&&(r[a.__data__]=!0)}Object.keys(r).length!==n.length&&(t.tickFormat(t=>{if(r[t])return this._formatter(t)}),this._axisSVG.call(t),t.tickFormat(this._formatter))}}removeYOverlappingTicks(t){let e=(t,e)=>t.bottom<e.top+2;this.isBanded()?this.removeOverlappingTicksAsc(t,e):this.removeOverlappingTicksDesc(t,e)}removeXOverlappingTicks(t){this.removeOverlappingTicksDesc(t,(t,e)=>t.left>e.right+5)}saveState(){this.cache.pixels=this.getRangePixels(),this.cache.domain=this.getScale().domain()}render(){let t=this;if(t._axis.hidden)return void(t._axisSVG&&t._axisSVG.remove());let e,n,a,o=t._axis.alignment,s=this.getRangePixels(),u=this._d3axes[0].scale().domain(),f=this.cache.pixels!==s||JSON.stringify(this.cache.domain)!==JSON.stringify(u);if(t._nestedAxes=[],e=t._axis.axisDesc.scalingInfo?t._axis.axisDesc.scalingInfo:new c,t._axis.axisDesc.scaleType===i.AxisType.Ordinal)this._formatter=function(t){let n=t;return n+=e.baseScale.units,n};else{let n=t.getScale().domain(),r=n[1]-n[0];if(!isNaN(r)){let n=h(e,r);switch(t._axis.axisDesc.scaleType){case i.AxisType.Linear:this._formatter=function(e){return t._axis.axisDesc.precision?l.format(",."+t._axis.axisDesc.precision+"f")(e*n.scalar)+n.units:l.format(",")(e*n.scalar)+n.units},t._d3axes[0].tickFormat(this._formatter)}}}t._axis.options&&(void 0!==t._axis.options.tickCount&&t._d3axes[0].ticks(t._axis.options.tickCount),void 0!==t._axis.options.tickSizeInner&&t._d3axes[0].tickSizeInner(t._axis.options.tickSizeInner),void 0!==t._axis.options.tickSizeOuter&&t._d3axes[0].tickSizeOuter(t._axis.options.tickSizeOuter),t._axis.options.tickMappingFunc&&(this._formatter=t._axis.options.tickMappingFunc,t._d3axes[0].tickFormat(this._formatter)));let d=0;switch(o){case r.Alignment.Left:case r.Alignment.Right:if(o===r.Alignment.Left?t._axisSVG.attr("transform","translate("+(t._position.x-1)+", "+t._position.y+")"):t._axisSVG.attr("transform","translate("+t._position.x+", "+t._position.y+")"),f&&(t._axisSVG.call(t._d3axes[0]),t.removeYOverlappingTicks(t._d3axes[0])),n=t._axisSVG.node(),a=n.getBoundingClientRect(),t._axisLabel){let e=-t._axisPixels/2,n=-90,i=-a.width-10;o===r.Alignment.Right&&(n=-n,e=-e),t._axisLabel.attr("transform","translate("+t._position.x+", "+t._position.y+") rotate("+n+")").attr("x",e).attr("y",0).attr("dy",i+"px")}t.addTooltipToHiddenYTicks();break;case r.Alignment.Top:t._axisSVG.attr("transform","translate("+t._position.x+", "+t._position.y+")"),f&&(t._axisSVG.call(t._d3axes[0]),t.removeXOverlappingTicks(t._d3axes[0])),n=t._axisSVG.node(),a=n.getBoundingClientRect(),t._axisLabel&&t._axisLabel.attr("x",t._position.x).attr("y",t._position.y-a.height-20).attr("dx",t._axisPixels/2);break;case r.Alignment.Bottom:let e=t.getLevelCount();if(e>1&&(f=!0,t._d3svg.selectAll(".nested-axis").remove(),t.renderNestedAxes(1,t._position.x),d=30*(e-2)),t._axisSVG.attr("transform","translate("+t._position.x+", "+(t._position.y+d)+")"),f)if(t._axisSVG.call(t._d3axes[0]),t._axis.options&&(t._axis.options.rotateText||t._axis.options.rotateTextDegrees)){let e=t._axis.options.rotateTextDegrees?t._axis.options.rotateTextDegrees:65;t._axisSVG.selectAll("text").style("text-anchor","end").attr("dx","-.8em").attr("dy",".15em").attr("transform","rotate(-"+e+")")}else this.removeXOverlappingTicks(t._d3axes[0]);n=t._axisSVG.node(),a=n.getBoundingClientRect(),t._axisLabel&&t._axisLabel.attr("x",t._position.x).attr("y",t._position.y+a.height+20).attr("dx",t._axisPixels/2)}let g=a.left,p=a.right,_=a.top,m=a.bottom;if(t._axisLabel){let e=t._axisLabel.node().getBoundingClientRect();g=Math.min(e.left,g),p=Math.max(e.right,p),_=Math.min(e.top,_),m=Math.max(e.bottom,m)}t._renderedRect=new r.Rect(g,_,p-g,m-_+d),this.saveState()}};class f extends u.D3Chart{constructor(t,e,n){let i=t;i.axes=[t],i.dataSets=[],t.alignment===r.Alignment.Left||t.alignment===r.Alignment.Right?console.log("Error: cannot render standalone left/right axes"):(super(t,e,n),this._hasBottomHandle=!1,this._options.bottomMargin=this._options.bottomMargin?this._options.bottomMargin:1,this._options.height=0,t.axisDesc.range?(this._xMin=t.axisDesc.range.min,this._xMax=t.axisDesc.range.max):(console.log("Error: standalone axis must have a specified range, defaulting to 0-100"),this._xMin=0,this._xMax=100))}updateHandles(){this._svg.select(".chart-handle.bottom").attr("x",this._options.leftMargin+this._handleWidth).attr("y",this._graphRect.y+this._graphRect.height).attr("width",this._graphRect.width-this._handleWidth-this._handleWidth),this._svg.select(".chart-handle.left").attr("x",this._options.leftMargin).attr("y",0).attr("height",this._svgRect.height),this._svg.select(".chart-handle.right").attr("x",this._svgRect.width-this._options.rightMargin-this._handleWidth).attr("y",0).attr("height",this._svgRect.height)}configureCursorTracking(){let t=this._svg;if(!t.select(".overlay").node()){let n=t.append("rect").attr("class","overlay").attr("fill","none").attr("pointer-events","all");var e=n.node().parentNode.firstChild;e&&n.node().parentNode.insertBefore(n.node(),e)}t.select(".overlay").attr("width",this._svgRect.width).attr("height",this._svgRect.height)}addHoverline(){this._hoverLine&&this._hoverLine.remove(),this._hoverLine=this._svg.append("line").attr("class","hover-line").attr("x1",0).attr("x2",0).attr("y1",0).attr("y2",this._svgRect.height).attr("stroke","#222222").attr("stroke-width",1).attr("pointer-events","none").style("display","none"),this._svg.on("mouseover",this.cursorEnter).on("mousemove",this.cursorMove).on("mouseout",this.cursorExit)}configureBrush(){this.configureBrushHelper(this._svg),this._svg.select(".brush").attr("transform",`translate(${this._options.leftMargin}, 0)`)}configureZoom(){this.configureZoomHelper(this._svg)}configureContextMenu(){this._svg.on("contextmenu",this.contextMenu(this._contextMenuItems,this._dataTooltip?this._dataTooltip.onMouseLeave:void 0))}configureTooltip(){let t=this;return this._dataTooltip=new s.CustomDivTooltip(t._tooltipId,"tooltip-t"),this._dataTooltip.setTarget(t._svg).setAnalyticsName(t._tooltipAnalyticsName).setPlaceTooltipLeftRight().alwaysRecalcWidth(!0).setDelay(t._options.tooltipDelay?t._options.tooltipDelay:0),void(this._options.disableTooltip||this._dataTooltip.setEnterCallback(e).setMoveCallback(e));function e(){if(a.SVGRenderer.IS_RESIZING)return;let e=l.mouse(t.getGraphGroup().node()),n=u.getBoundedPixelValue(e[0],t._graphRect.width),r=e[1];return t.populateTooltip(n,r),!0}}}o.D3Renderer.register(r.UIType.Axis,f)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(0),i=n(1),a=n(9),o=n(3),s=n(2);class u extends o.SVGRenderer{constructor(t,e,n){super();let r=this;r.DEFAULT_GRAPH_HEIGHT=250,r.MIN_MARGIN={TOP:10,BOTTOM:10,LEFT:10,RIGHT:10},r._options.height=r.DEFAULT_GRAPH_HEIGHT,r._options.topMargin=r.MIN_MARGIN.TOP,r._options.leftMargin=r.MIN_MARGIN.LEFT,r._options.rightMargin=r.MIN_MARGIN.RIGHT,r._options.bottomMargin=r.MIN_MARGIN.BOTTOM,r.initialize(t,e,n),r.getDataKey=function(t){return t?t.key:""},r.getDataName=function(t){return t&&t.name?t.name:r.getDataKey(t).toString()},r.getDataValue=function(t){return t.value},r.getDataDisplayValue=function(t){return t.displayValue?t.displayValue:t.value},r.arc=s.arc().innerRadius((function(t){return Math.max(0,t.innerRadius)*r._radius})).outerRadius((function(t){return Math.max(0,t.outerRadius)*r._radius})).startAngle((function(t){return t.startAngle})).endAngle((function(t){return t.endAngle}))}createLayout(){let t=this;t._svg.selectAll("*").remove(),t._graphArea=t._svg.append("g").attr("class","graphArea");let e=t._element.legend;e&&(t._legend=new o.D3Legend(t._svg,e,""))}getSegmentClasses(t){let e=i.getSelectionName(this.getDataKey(t).toString()),n=i.getSelectionName(this.getDataName(t));return e===n?" chart-data arc "+e:" chart-data arc "+e+" "+n}configureItemInteraction(t,e,n){let i=this,a=i._element;t.on("mouseenter",(function(){if(i._hoverItem=e,i._hoverItem)return l({caller:i._element,event:r.EventType.HoverStart,data:e,selection:n});return!1})).on("mouseleave",(function(){if(i._hoverItem){let t=l({caller:i._element,event:r.EventType.HoverEnd,data:e,selection:n});return i._hoverItem=void 0,t}return!1}));let s=i._element,u=s.contextMenuItems;if(i._options.enableSaveAsImage){let t={title:"Save As Image",action:function(t,e,n){i.saveImage()},disabled:!1};u=s.contextMenuItems?s.contextMenuItems.slice(0):[],u.push(t)}return void o.addClickHelper(t,i.getOptions(),s.onClick,s.onDoubleClick,u,i._dataTooltip,s,e,n);function l(t){if(!o.SVGRenderer.IS_RESIZING)return i._renderer.focus(a,t),a.onHover&&a.onHover(t),!0}}configureTooltip(t){if(void 0===t)return;let e=this;return this._dataTooltip=new a.CustomDivTooltip(e._tooltipId,"tooltip-t"),void this._dataTooltip.setAnalyticsName(e._tooltipAnalyticsName).setTarget(t).setEnterCallback(n).setMoveCallback(n).setPlaceTooltipLeftRight().alwaysRecalcWidth(!0).setDelay(e._options.tooltipDelay?e._options.tooltipDelay:0);function n(t){if(o.SVGRenderer.IS_RESIZING)return;let n=e._element,r=e.getDataName(t.rawData);if(n.onTooltip){let i={tooltip:e._dataTooltip};e._dataTooltip.setData(n.title+" for "+e.getDataName(t.rawData),[]),n.onTooltip({caller:n,selection:r,data:i})}else{let r=t.rawData,i=n.units?n.units:"",a={};a[e.getDataName(r)]=e.getDataDisplayValue(r)+i;let o=[{source:n,group:"",metrics:a}],s=e._dataTooltip;n.title?s.setData(n.title+" for "+e.getDataName(r),o):s.setData("",o)}return!0}}renderData(){throw"Please override renderData for D3Polar in subclass"}getLegendData(){throw"Please override getLegendData for D3Polar in subclass"}renderLegend(t,e,n){let a=this,o=this._element,s=o.legend;if(s){let u=this.getLegendData(),l=t,c=e;switch(s.alignment){case r.Alignment.Bottom:c+=n+10;break;case r.Alignment.Right:l+=n+10}a._legend.setPosition(new r.Rect(l,c,a._graphRect.width,a._graphRect.height));let h=a._renderer.getColorManager(),f=[];for(let t=0;t<u.length;++t){let e=u[t],n=a.getDataName(e),r=i.getSelectionName(n),s=a._svg.selectAll("."+r);try{f.push({key:n,color:s.attr("fill"),opacity:s.attr("opacity"),shape:"rect",value:a.getDataValue(e),units:o.units})}catch(t){f.push({key:n,color:h.getColor(n),opacity:"1",shape:"rect",value:a.getDataValue(e),units:o.units})}}a._legend.setItems(f),a._legend.render();let d=a._legend.getRenderedRect();a._options.width=Math.max(a._options.width,l+d.width),a._options.height=Math.max(a._options.height,c+d.height)}}render(t){this.loadOptions(t),this._svgRect.width=this._options.width;let e=this._options.topMargin,n=this._options.height-this._options.bottomMargin,r=this._options.leftMargin,i=this._svgRect.width-this._options.rightMargin,a=Math.min(n-e,i-r);this._radius=a/2,this._graphRect.x=r,this._graphRect.y=e,this._graphRect.width=a,this._graphRect.height=a,this._center={x:this._radius+this._options.leftMargin,y:this._radius+this._options.topMargin},this._graphArea.attr("transform","translate("+this._center.x+","+this._center.y+")"),this.renderData(),this._options.width=r+a+this._options.rightMargin,this._options.height=e+a+this._options.bottomMargin,this.renderLegend(r,e,a),this._svg.attr("width",this._options.width).attr("height",this._options.height)}}e.D3Polar=u},function(t,e,n){"use strict";function r(){}n.r(e);var i=function(t){return null==t?r:function(){return this.querySelector(t)}};function a(){return[]}var o=function(t){return new Array(t.length)};function s(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}s.prototype={constructor:s,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function u(t,e,n,r,i,a){for(var o,u=0,l=e.length,c=a.length;u<c;++u)(o=e[u])?(o.__data__=a[u],r[u]=o):n[u]=new s(t,a[u]);for(;u<l;++u)(o=e[u])&&(i[u]=o)}function l(t,e,n,r,i,a,o){var u,l,c,h={},f=e.length,d=a.length,g=new Array(f);for(u=0;u<f;++u)(l=e[u])&&(g[u]=c="$"+o.call(l,l.__data__,u,e),c in h?i[u]=l:h[c]=l);for(u=0;u<d;++u)(l=h[c="$"+o.call(t,a[u],u,a)])?(r[u]=l,l.__data__=a[u],h[c]=null):n[u]=new s(t,a[u]);for(u=0;u<f;++u)(l=e[u])&&h[g[u]]===l&&(i[u]=l)}function c(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}var h="http://www.w3.org/1999/xhtml",f={svg:"http://www.w3.org/2000/svg",xhtml:h,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},d=function(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),f.hasOwnProperty(e)?{space:f[e],local:t}:t};function g(t){return function(){this.removeAttribute(t)}}function p(t){return function(){this.removeAttributeNS(t.space,t.local)}}function _(t,e){return function(){this.setAttribute(t,e)}}function m(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function y(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function v(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}var x=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function b(t){return function(){this.style.removeProperty(t)}}function w(t,e,n){return function(){this.style.setProperty(t,e,n)}}function M(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function T(t,e){return t.style.getPropertyValue(e)||x(t).getComputedStyle(t,null).getPropertyValue(e)}function S(t){return function(){delete this[t]}}function C(t,e){return function(){this[t]=e}}function k(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function A(t){return t.trim().split(/^|\s+/)}function D(t){return t.classList||new E(t)}function E(t){this._node=t,this._names=A(t.getAttribute("class")||"")}function R(t,e){for(var n=D(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function N(t,e){for(var n=D(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function V(t){return function(){R(this,t)}}function I(t){return function(){N(this,t)}}function L(t,e){return function(){(e.apply(this,arguments)?R:N)(this,t)}}E.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function P(){this.textContent=""}function O(t){return function(){this.textContent=t}}function B(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function H(){this.innerHTML=""}function F(t){return function(){this.innerHTML=t}}function Y(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function z(){this.nextSibling&&this.parentNode.appendChild(this)}function X(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function U(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===h&&e.documentElement.namespaceURI===h?e.createElement(t):e.createElementNS(n,t)}}function G(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}var q=function(t){var e=d(t);return(e.local?G:U)(e)};function W(){return null}function j(){var t=this.parentNode;t&&t.removeChild(this)}function K(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Z(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}var $={},Q=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||($={mouseenter:"mouseover",mouseleave:"mouseout"}));function J(t,e,n){return t=tt(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function tt(t,e,n){return function(r){var i=Q;Q=r;try{t.call(this,this.__data__,e,n)}finally{Q=i}}}function et(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function nt(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,a=e.length;r<a;++r)n=e[r],t.type&&n.type!==t.type||n.name!==t.name?e[++i]=n:this.removeEventListener(n.type,n.listener,n.capture);++i?e.length=i:delete this.__on}}}function rt(t,e,n){var r=$.hasOwnProperty(t.type)?J:tt;return function(i,a,o){var s,u=this.__on,l=r(e,a,o);if(u)for(var c=0,h=u.length;c<h;++c)if((s=u[c]).type===t.type&&s.name===t.name)return this.removeEventListener(s.type,s.listener,s.capture),this.addEventListener(s.type,s.listener=l,s.capture=n),void(s.value=e);this.addEventListener(t.type,l,n),s={type:t.type,name:t.name,value:e,listener:l,capture:n},u?u.push(s):this.__on=[s]}}function it(t,e,n){var r=x(t),i=r.CustomEvent;"function"==typeof i?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function at(t,e){return function(){return it(this,t,e)}}function ot(t,e){return function(){return it(this,t,e.apply(this,arguments))}}var st=[null];function ut(t,e){this._groups=t,this._parents=e}function lt(){return new ut([[document.documentElement]],st)}ut.prototype=lt.prototype={constructor:ut,select:function(t){"function"!=typeof t&&(t=i(t));for(var e=this._groups,n=e.length,r=new Array(n),a=0;a<n;++a)for(var o,s,u=e[a],l=u.length,c=r[a]=new Array(l),h=0;h<l;++h)(o=u[h])&&(s=t.call(o,o.__data__,h,u))&&("__data__"in o&&(s.__data__=o.__data__),c[h]=s);return new ut(r,this._parents)},selectAll:function(t){var e;"function"!=typeof t&&(t=null==(e=t)?a:function(){return this.querySelectorAll(e)});for(var n=this._groups,r=n.length,i=[],o=[],s=0;s<r;++s)for(var u,l=n[s],c=l.length,h=0;h<c;++h)(u=l[h])&&(i.push(t.call(u,u.__data__,h,l)),o.push(u));return new ut(i,o)},filter:function(t){var e;"function"!=typeof t&&(e=t,t=function(){return this.matches(e)});for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a)for(var o,s=n[a],u=s.length,l=i[a]=[],c=0;c<u;++c)(o=s[c])&&t.call(o,o.__data__,c,s)&&l.push(o);return new ut(i,this._parents)},data:function(t,e){if(!t)return _=new Array(this.size()),f=-1,this.each((function(t){_[++f]=t})),_;var n,r=e?l:u,i=this._parents,a=this._groups;"function"!=typeof t&&(n=t,t=function(){return n});for(var o=a.length,s=new Array(o),c=new Array(o),h=new Array(o),f=0;f<o;++f){var d=i[f],g=a[f],p=g.length,_=t.call(d,d&&d.__data__,f,i),m=_.length,y=c[f]=new Array(m),v=s[f]=new Array(m);r(d,g,y,v,h[f]=new Array(p),_,e);for(var x,b,w=0,M=0;w<m;++w)if(x=y[w]){for(w>=M&&(M=w+1);!(b=v[M])&&++M<m;);x._next=b||null}}return(s=new ut(s,i))._enter=c,s._exit=h,s},enter:function(){return new ut(this._enter||this._groups.map(o),this._parents)},exit:function(){return new ut(this._exit||this._groups.map(o),this._parents)},join:function(t,e,n){var r=this.enter(),i=this,a=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=e&&(i=e(i)),null==n?a.remove():n(a),r&&i?r.merge(i).order():i},merge:function(t){for(var e=this._groups,n=t._groups,r=e.length,i=n.length,a=Math.min(r,i),o=new Array(r),s=0;s<a;++s)for(var u,l=e[s],c=n[s],h=l.length,f=o[s]=new Array(h),d=0;d<h;++d)(u=l[d]||c[d])&&(f[d]=u);for(;s<r;++s)o[s]=e[s];return new ut(o,this._parents)},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,i=t[e],a=i.length-1,o=i[a];--a>=0;)(r=i[a])&&(o&&4^r.compareDocumentPosition(o)&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=c);for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o,s=n[a],u=s.length,l=i[a]=new Array(u),h=0;h<u;++h)(o=s[h])&&(l[h]=o);l.sort(e)}return new ut(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),e=-1;return this.each((function(){t[++e]=this})),t},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null},size:function(){var t=0;return this.each((function(){++t})),t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i,a=e[n],o=0,s=a.length;o<s;++o)(i=a[o])&&t.call(i,i.__data__,o,a);return this},attr:function(t,e){var n=d(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?p:g:"function"==typeof e?n.local?v:y:n.local?m:_)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?b:"function"==typeof e?M:w)(t,e,null==n?"":n)):T(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?S:"function"==typeof e?k:C)(t,e)):this.node()[t]},classed:function(t,e){var n=A(t+"");if(arguments.length<2){for(var r=D(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each(("function"==typeof e?L:e?V:I)(n,e))},text:function(t){return arguments.length?this.each(null==t?P:("function"==typeof t?B:O)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?H:("function"==typeof t?Y:F)(t)):this.node().innerHTML},raise:function(){return this.each(z)},lower:function(){return this.each(X)},append:function(t){var e="function"==typeof t?t:q(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:q(t),r=null==e?W:"function"==typeof e?e:i(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(j)},clone:function(t){return this.select(t?Z:K)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,i,a=et(t+""),o=a.length;if(!(arguments.length<2)){for(s=e?rt:nt,null==n&&(n=!1),r=0;r<o;++r)this.each(s(a[r],e,n));return this}var s=this.node().__on;if(s)for(var u,l=0,c=s.length;l<c;++l)for(r=0,u=s[l];r<o;++r)if((i=a[r]).type===u.type&&i.name===u.name)return u.value},dispatch:function(t,e){return this.each(("function"==typeof e?ot:at)(t,e))}};var ct=function(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]},ht=function(t){return(t=ct(Math.abs(t)))?t[1]:NaN},ft=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function dt(t){if(!(e=ft.exec(t)))throw new Error("invalid format: "+t);var e;return new gt({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function gt(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}dt.prototype=gt.prototype,gt.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var pt,_t,mt,yt,vt=function(t,e){var n=ct(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},xt={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return vt(100*t,e)},r:vt,s:function(t,e){var n=ct(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(pt=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+ct(t,Math.max(0,e+a-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},bt=function(t){return t},wt=Array.prototype.map,Mt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],Tt=function(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?bt:(e=wt.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,a=[],o=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),a.push(t.substring(i-=s,i+s)),!((u+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",a=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?bt:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(wt.call(t.numerals,String)),u=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"-":t.minus+"",c=void 0===t.nan?"NaN":t.nan+"";function h(t){var e=(t=dt(t)).fill,n=t.align,h=t.sign,f=t.symbol,d=t.zero,g=t.width,p=t.comma,_=t.precision,m=t.trim,y=t.type;"n"===y?(p=!0,y="g"):xt[y]||(void 0===_&&(_=12),m=!0,y="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var v="$"===f?i:"#"===f&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",x="$"===f?a:/[%p]/.test(y)?u:"",b=xt[y],w=/[defgprs%]/.test(y);function M(t){var i,a,u,f=v,M=x;if("c"===y)M=b(t)+M,t="";else{var T=(t=+t)<0;if(t=isNaN(t)?c:b(Math.abs(t),_),m&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),T&&0==+t&&(T=!1),f=(T?"("===h?h:l:"-"===h||"("===h?"":h)+f,M=("s"===y?Mt[8+pt/3]:"")+M+(T&&"("===h?")":""),w)for(i=-1,a=t.length;++i<a;)if(48>(u=t.charCodeAt(i))||u>57){M=(46===u?o+t.slice(i+1):t.slice(i))+M,t=t.slice(0,i);break}}p&&!d&&(t=r(t,1/0));var S=f.length+t.length+M.length,C=S<g?new Array(g-S+1).join(e):"";switch(p&&d&&(t=r(C+t,C.length?g-M.length:1/0),C=""),n){case"<":t=f+t+M+C;break;case"=":t=f+C+t+M;break;case"^":t=C.slice(0,S=C.length>>1)+f+t+M+C.slice(S);break;default:t=C+f+t+M}return s(t)}return _=void 0===_?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_)),M.toString=function(){return t+""},M}return{format:h,formatPrefix:function(t,e){var n=h(((t=dt(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(ht(e)/3))),i=Math.pow(10,-r),a=Mt[8+r/3];return function(t){return n(i*t)+a}}}};_t=Tt({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),mt=_t.format,yt=_t.formatPrefix;var St={value:function(){}};function Ct(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new kt(r)}function kt(t){this._=t}function At(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function Dt(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function Et(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=St,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}kt.prototype=Ct.prototype={constructor:kt,on:function(t,e){var n,r=this._,i=At(t+"",r),a=-1,o=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<o;)if(n=(t=i[a]).type)r[n]=Et(r[n],t.name,e);else if(null==e)for(n in r)r[n]=Et(r[n],t.name,null);return this}for(;++a<o;)if((n=(t=i[a]).type)&&(n=Dt(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new kt(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),a=0;a<n;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=0,n=(r=this._[t]).length;a<n;++a)r[a].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}};var Rt=Ct,Nt=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN},Vt=function(t){var e;return 1===t.length&&(e=t,t=function(t,n){return Nt(e(t),n)}),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var a=r+i>>>1;t(e[a],n)<0?r=a+1:i=a}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var a=r+i>>>1;t(e[a],n)>0?i=a:r=a+1}return r}}};var It=Vt(Nt),Lt=It.right,Pt=(It.left,Lt);var Ot=Array.prototype,Bt=(Ot.slice,Ot.map,Math.sqrt(50)),Ht=Math.sqrt(10),Ft=Math.sqrt(2),Yt=function(t,e,n){var r,i,a,o,s=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if((r=e<t)&&(i=t,t=e,e=i),0===(o=zt(t,e,n))||!isFinite(o))return[];if(o>0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++s<i;)a[s]=(t+s)*o;else for(t=Math.floor(t*o),e=Math.ceil(e*o),a=new Array(i=Math.ceil(t-e+1));++s<i;)a[s]=(t-s)/o;return r&&a.reverse(),a};function zt(t,e,n){var r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),a=r/Math.pow(10,i);return i>=0?(a>=Bt?10:a>=Ht?5:a>=Ft?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=Bt?10:a>=Ht?5:a>=Ft?2:1)}function Xt(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),a=r/i;return a>=Bt?i*=10:a>=Ht?i*=5:a>=Ft&&(i*=2),e<t?-i:i}var Ut=function(t,e){var n,r,i=t.length,a=-1;if(null==e){for(;++a<i;)if(null!=(n=t[a])&&n>=n)for(r=n;++a<i;)null!=(n=t[a])&&n>r&&(r=n)}else for(;++a<i;)if(null!=(n=e(t[a],a,t))&&n>=n)for(r=n;++a<i;)null!=(n=e(t[a],a,t))&&n>r&&(r=n);return r},Gt=function(t,e){var n,r=t.length,i=-1,a=0;if(null==e)for(;++i<r;)(n=+t[i])&&(a+=n);else for(;++i<r;)(n=+e(t[i],i,t))&&(a+=n);return a};function qt(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function Wt(){}function jt(t,e){var n=new Wt;if(t instanceof Wt)t.each((function(t,e){n.set(e,t)}));else if(Array.isArray(t)){var r,i=-1,a=t.length;if(null==e)for(;++i<a;)n.set(i,t[i]);else for(;++i<a;)n.set(e(r=t[i],i,t),r)}else if(t)for(var o in t)n.set(o,t[o]);return n}Wt.prototype=jt.prototype={constructor:Wt,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,e){return this["$"+t]=e,this},remove:function(t){var e="$"+t;return e in this&&delete this[e]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var e in this)"$"===e[0]&&t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)"$"===e[0]&&t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)"$"===e[0]&&t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)"$"===e[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var e in this)"$"===e[0]&&t(this[e],e.slice(1),this)}};var Kt=jt;function Zt(){}var $t=Kt.prototype;function Qt(t,e){var n=new Zt;if(t instanceof Zt)t.each((function(t){n.add(t)}));else if(t){var r=-1,i=t.length;if(null==e)for(;++r<i;)n.add(t[r]);else for(;++r<i;)n.add(e(t[r],r,t))}return n}Zt.prototype=Qt.prototype={constructor:Zt,has:$t.has,add:function(t){return this["$"+(t+="")]=t,this},remove:$t.remove,clear:$t.clear,values:$t.keys,size:$t.size,empty:$t.empty,each:$t.each};var Jt=Array.prototype,te=Jt.map,ee=Jt.slice;var ne=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function re(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function ie(){}var ae="\\s*([+-]?\\d+)\\s*",oe="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",se="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ue=/^#([0-9a-f]{3,8})$/,le=new RegExp("^rgb\\("+[ae,ae,ae]+"\\)$"),ce=new RegExp("^rgb\\("+[se,se,se]+"\\)$"),he=new RegExp("^rgba\\("+[ae,ae,ae,oe]+"\\)$"),fe=new RegExp("^rgba\\("+[se,se,se,oe]+"\\)$"),de=new RegExp("^hsl\\("+[oe,se,se]+"\\)$"),ge=new RegExp("^hsla\\("+[oe,se,se,oe]+"\\)$"),pe={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function _e(){return this.rgb().formatHex()}function me(){return this.rgb().formatRgb()}function ye(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=ue.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?ve(e):3===n?new Me(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?new Me(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?new Me(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=le.exec(t))?new Me(e[1],e[2],e[3],1):(e=ce.exec(t))?new Me(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=he.exec(t))?xe(e[1],e[2],e[3],e[4]):(e=fe.exec(t))?xe(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=de.exec(t))?ke(e[1],e[2]/100,e[3]/100,1):(e=ge.exec(t))?ke(e[1],e[2]/100,e[3]/100,e[4]):pe.hasOwnProperty(t)?ve(pe[t]):"transparent"===t?new Me(NaN,NaN,NaN,0):null}function ve(t){return new Me(t>>16&255,t>>8&255,255&t,1)}function xe(t,e,n,r){return r<=0&&(t=e=n=NaN),new Me(t,e,n,r)}function be(t){return t instanceof ie||(t=ye(t)),t?new Me((t=t.rgb()).r,t.g,t.b,t.opacity):new Me}function we(t,e,n,r){return 1===arguments.length?be(t):new Me(t,e,n,null==r?1:r)}function Me(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Te(){return"#"+Ce(this.r)+Ce(this.g)+Ce(this.b)}function Se(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Ce(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function ke(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new De(t,e,n,r)}function Ae(t){if(t instanceof De)return new De(t.h,t.s,t.l,t.opacity);if(t instanceof ie||(t=ye(t)),!t)return new De;if(t instanceof De)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,u=(a+i)/2;return s?(o=e===a?(n-r)/s+6*(n<r):n===a?(r-e)/s+2:(e-n)/s+4,s/=u<.5?a+i:2-a-i,o*=60):s=u>0&&u<1?0:o,new De(o,s,u,t.opacity)}function De(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Ee(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Re(t,e,n,r,i){var a=t*t,o=a*t;return((1-3*t+3*a-o)*e+(4-6*a+3*o)*n+(1+3*t+3*a-3*o)*r+o*i)/6}ne(ie,ye,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:_e,formatHex:_e,formatHsl:function(){return Ae(this).formatHsl()},formatRgb:me,toString:me}),ne(Me,we,re(ie,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Me(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Me(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Te,formatHex:Te,formatRgb:Se,toString:Se})),ne(De,(function(t,e,n,r){return 1===arguments.length?Ae(t):new De(t,e,n,null==r?1:r)}),re(ie,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new De(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new De(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Me(Ee(t>=240?t-240:t+120,i,r),Ee(t,i,r),Ee(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var Ne=function(t){return function(){return t}};function Ve(t,e){return function(n){return t+n*e}}function Ie(t){return 1==(t=+t)?Le:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Ne(isNaN(e)?n:e)}}function Le(t,e){var n=e-t;return n?Ve(t,n):Ne(isNaN(t)?e:t)}var Pe=function t(e){var n=Ie(e);function r(t,e){var r=n((t=we(t)).r,(e=we(e)).r),i=n(t.g,e.g),a=n(t.b,e.b),o=Le(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=a(e),t.opacity=o(e),t+""}}return r.gamma=t,r}(1);function Oe(t){return function(e){var n,r,i=e.length,a=new Array(i),o=new Array(i),s=new Array(i);for(n=0;n<i;++n)r=we(e[n]),a[n]=r.r||0,o[n]=r.g||0,s[n]=r.b||0;return a=t(a),o=t(o),s=t(s),r.opacity=1,function(t){return r.r=a(t),r.g=o(t),r.b=s(t),r+""}}}Oe((function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],a=t[r+1],o=r>0?t[r-1]:2*i-a,s=r<e-1?t[r+2]:2*a-i;return Re((n-r/e)*e,o,i,a,s)}})),Oe((function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],a=t[r%e],o=t[(r+1)%e],s=t[(r+2)%e];return Re((n-r/e)*e,i,a,o,s)}}));var Be=function(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(a){for(n=0;n<r;++n)i[n]=t[n]*(1-a)+e[n]*a;return i}};function He(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Fe(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,a=new Array(i),o=new Array(r);for(n=0;n<i;++n)a[n]=We(t[n],e[n]);for(;n<r;++n)o[n]=e[n];return function(t){for(n=0;n<i;++n)o[n]=a[n](t);return o}}var Ye=function(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}},ze=function(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}},Xe=function(t,e){var n,r={},i={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?r[n]=We(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}},Ue=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ge=new RegExp(Ue.source,"g");var qe=function(t,e){var n,r,i,a=Ue.lastIndex=Ge.lastIndex=0,o=-1,s=[],u=[];for(t+="",e+="";(n=Ue.exec(t))&&(r=Ge.exec(e));)(i=r.index)>a&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(n=n[0])===(r=r[0])?s[o]?s[o]+=r:s[++o]=r:(s[++o]=null,u.push({i:o,x:ze(n,r)})),a=Ge.lastIndex;return a<e.length&&(i=e.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?u[0]?function(t){return function(e){return t(e)+""}}(u[0].x):function(t){return function(){return t}}(e):(e=u.length,function(t){for(var n,r=0;r<e;++r)s[(n=u[r]).i]=n.x(t);return s.join("")})},We=function(t,e){var n,r=typeof e;return null==e||"boolean"===r?Ne(e):("number"===r?ze:"string"===r?(n=ye(e))?(e=n,Pe):qe:e instanceof ye?Pe:e instanceof Date?Ye:He(e)?Be:Array.isArray(e)?Fe:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Xe:ze)(t,e)},je=function(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}},Ke=function(t){return+t},Ze=[0,1];function $e(t){return t}function Qe(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:(n=isNaN(e)?NaN:.5,function(){return n});var n}function Je(t){var e,n=t[0],r=t[t.length-1];return n>r&&(e=n,n=r,r=e),function(t){return Math.max(n,Math.min(r,t))}}function tn(t,e,n){var r=t[0],i=t[1],a=e[0],o=e[1];return i<r?(r=Qe(i,r),a=n(o,a)):(r=Qe(r,i),a=n(a,o)),function(t){return a(r(t))}}function en(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),a=new Array(r),o=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<r;)i[o]=Qe(t[o],t[o+1]),a[o]=n(e[o],e[o+1]);return function(e){var n=Pt(t,e,1,r)-1;return a[n](i[n](e))}}function nn(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function rn(){var t,e,n,r,i,a,o=Ze,s=Ze,u=We,l=$e;function c(){return r=Math.min(o.length,s.length)>2?en:tn,i=a=null,h}function h(e){return isNaN(e=+e)?n:(i||(i=r(o.map(t),s,u)))(t(l(e)))}return h.invert=function(n){return l(e((a||(a=r(s,o.map(t),ze)))(n)))},h.domain=function(t){return arguments.length?(o=te.call(t,Ke),l===$e||(l=Je(o)),c()):o.slice()},h.range=function(t){return arguments.length?(s=ee.call(t),c()):s.slice()},h.rangeRound=function(t){return s=ee.call(t),u=je,c()},h.clamp=function(t){return arguments.length?(l=t?Je(o):$e,h):l!==$e},h.interpolate=function(t){return arguments.length?(u=t,c()):u},h.unknown=function(t){return arguments.length?(n=t,h):n},function(n,r){return t=n,e=r,c()}}function an(t,e){return rn()(t,e)}var on=function(t,e,n,r){var i,a=Xt(t,e,n);switch((r=dt(null==r?",f":r)).type){case"s":var o=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(ht(e)/3)))-ht(Math.abs(t)))}(a,o))||(r.precision=i),yt(r,o);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,ht(e)-ht(t))+1}(a,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(t){return Math.max(0,-ht(Math.abs(t)))}(a))||(r.precision=i-2*("%"===r.type))}return mt(r)};function sn(t){var e=t.domain;return t.ticks=function(t){var n=e();return Yt(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return on(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i=e(),a=0,o=i.length-1,s=i[a],u=i[o];return u<s&&(r=s,s=u,u=r,r=a,a=o,o=r),(r=zt(s,u,n))>0?r=zt(s=Math.floor(s/r)*r,u=Math.ceil(u/r)*r,n):r<0&&(r=zt(s=Math.ceil(s*r)/r,u=Math.floor(u*r)/r,n)),r>0?(i[a]=Math.floor(s/r)*r,i[o]=Math.ceil(u/r)*r,e(i)):r<0&&(i[a]=Math.ceil(s*r)/r,i[o]=Math.floor(u*r)/r,e(i)),t},t}function un(){var t=an($e,$e);return t.copy=function(){return nn(t,un())},qt.apply(t,arguments),sn(t)}var ln=new Date,cn=new Date;function hn(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=function(e){return t(e=new Date(+e)),e},i.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},i.round=function(t){var e=i(t),n=i.ceil(t);return t-e<n-t?e:n},i.offset=function(t,n){return e(t=new Date(+t),null==n?1:Math.floor(n)),t},i.range=function(n,r,a){var o,s=[];if(n=i.ceil(n),a=null==a?1:Math.floor(a),!(n<r&&a>0))return s;do{s.push(o=new Date(+n)),e(n,a),t(n)}while(o<n&&n<r);return s},i.filter=function(n){return hn((function(e){if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););}))},n&&(i.count=function(e,r){return ln.setTime(+e),cn.setTime(+r),t(ln),t(cn),Math.floor(n(ln,cn))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(e){return r(e)%t==0}:function(e){return i.count(0,e)%t==0}):i:null}),i}var fn=hn((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));fn.every=function(t){return isFinite(t=Math.floor(t))&&t>0?hn((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};var dn=fn,gn=(fn.range,hn((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})));gn.range;function pn(t){return hn((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var _n=pn(0),mn=pn(1),yn=pn(2),vn=pn(3),xn=pn(4),bn=pn(5),wn=pn(6),Mn=(_n.range,mn.range,yn.range,vn.range,xn.range,bn.range,wn.range,hn((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5}),(function(t){return t.getDate()-1}))),Tn=Mn,Sn=(Mn.range,hn((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()}))),Cn=(Sn.range,hn((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()}))),kn=(Cn.range,hn((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()}))),An=(kn.range,hn((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t})));An.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?hn((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):An:null};An.range;function Dn(t){return hn((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var En=Dn(0),Rn=Dn(1),Nn=Dn(2),Vn=Dn(3),In=Dn(4),Ln=Dn(5),Pn=Dn(6),On=(En.range,Rn.range,Nn.range,Vn.range,In.range,Ln.range,Pn.range,hn((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1}))),Bn=On,Hn=(On.range,hn((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()})));Hn.every=function(t){return isFinite(t=Math.floor(t))&&t>0?hn((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};var Fn=Hn;Hn.range;function Yn(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function zn(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Xn(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}var Un,Gn={"-":"",_:" ",0:"0"},qn=/^\s*\d+/,Wn=/^%/,jn=/[\\^$*+?|[\]().{}]/g;function Kn(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(e)+i:i)}function Zn(t){return t.replace(jn,"\\$&")}function $n(t){return new RegExp("^(?:"+t.map(Zn).join("|")+")","i")}function Qn(t){for(var e={},n=-1,r=t.length;++n<r;)e[t[n].toLowerCase()]=n;return e}function Jn(t,e,n){var r=qn.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function tr(t,e,n){var r=qn.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function er(t,e,n){var r=qn.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function nr(t,e,n){var r=qn.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function rr(t,e,n){var r=qn.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ir(t,e,n){var r=qn.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function ar(t,e,n){var r=qn.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function or(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function sr(t,e,n){var r=qn.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function ur(t,e,n){var r=qn.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function lr(t,e,n){var r=qn.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function cr(t,e,n){var r=qn.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function hr(t,e,n){var r=qn.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function fr(t,e,n){var r=qn.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function dr(t,e,n){var r=qn.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function gr(t,e,n){var r=qn.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function pr(t,e,n){var r=qn.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function _r(t,e,n){var r=Wn.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function mr(t,e,n){var r=qn.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function yr(t,e,n){var r=qn.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function vr(t,e){return Kn(t.getDate(),e,2)}function xr(t,e){return Kn(t.getHours(),e,2)}function br(t,e){return Kn(t.getHours()%12||12,e,2)}function wr(t,e){return Kn(1+Tn.count(dn(t),t),e,3)}function Mr(t,e){return Kn(t.getMilliseconds(),e,3)}function Tr(t,e){return Mr(t,e)+"000"}function Sr(t,e){return Kn(t.getMonth()+1,e,2)}function Cr(t,e){return Kn(t.getMinutes(),e,2)}function kr(t,e){return Kn(t.getSeconds(),e,2)}function Ar(t){var e=t.getDay();return 0===e?7:e}function Dr(t,e){return Kn(_n.count(dn(t)-1,t),e,2)}function Er(t,e){var n=t.getDay();return t=n>=4||0===n?xn(t):xn.ceil(t),Kn(xn.count(dn(t),t)+(4===dn(t).getDay()),e,2)}function Rr(t){return t.getDay()}function Nr(t,e){return Kn(mn.count(dn(t)-1,t),e,2)}function Vr(t,e){return Kn(t.getFullYear()%100,e,2)}function Ir(t,e){return Kn(t.getFullYear()%1e4,e,4)}function Lr(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Kn(e/60|0,"0",2)+Kn(e%60,"0",2)}function Pr(t,e){return Kn(t.getUTCDate(),e,2)}function Or(t,e){return Kn(t.getUTCHours(),e,2)}function Br(t,e){return Kn(t.getUTCHours()%12||12,e,2)}function Hr(t,e){return Kn(1+Bn.count(Fn(t),t),e,3)}function Fr(t,e){return Kn(t.getUTCMilliseconds(),e,3)}function Yr(t,e){return Fr(t,e)+"000"}function zr(t,e){return Kn(t.getUTCMonth()+1,e,2)}function Xr(t,e){return Kn(t.getUTCMinutes(),e,2)}function Ur(t,e){return Kn(t.getUTCSeconds(),e,2)}function Gr(t){var e=t.getUTCDay();return 0===e?7:e}function qr(t,e){return Kn(En.count(Fn(t)-1,t),e,2)}function Wr(t,e){var n=t.getUTCDay();return t=n>=4||0===n?In(t):In.ceil(t),Kn(In.count(Fn(t),t)+(4===Fn(t).getUTCDay()),e,2)}function jr(t){return t.getUTCDay()}function Kr(t,e){return Kn(Rn.count(Fn(t)-1,t),e,2)}function Zr(t,e){return Kn(t.getUTCFullYear()%100,e,2)}function $r(t,e){return Kn(t.getUTCFullYear()%1e4,e,4)}function Qr(){return"+0000"}function Jr(){return"%"}function ti(t){return+t}function ei(t){return Math.floor(+t/1e3)}!function(t){Un=function(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,a=t.days,o=t.shortDays,s=t.months,u=t.shortMonths,l=$n(i),c=Qn(i),h=$n(a),f=Qn(a),d=$n(o),g=Qn(o),p=$n(s),_=Qn(s),m=$n(u),y=Qn(u),v={a:function(t){return o[t.getDay()]},A:function(t){return a[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:vr,e:vr,f:Tr,H:xr,I:br,j:wr,L:Mr,m:Sr,M:Cr,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:ti,s:ei,S:kr,u:Ar,U:Dr,V:Er,w:Rr,W:Nr,x:null,X:null,y:Vr,Y:Ir,Z:Lr,"%":Jr},x={a:function(t){return o[t.getUTCDay()]},A:function(t){return a[t.getUTCDay()]},b:function(t){return u[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:Pr,e:Pr,f:Yr,H:Or,I:Br,j:Hr,L:Fr,m:zr,M:Xr,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:ti,s:ei,S:Ur,u:Gr,U:qr,V:Wr,w:jr,W:Kr,x:null,X:null,y:Zr,Y:$r,Z:Qr,"%":Jr},b={a:function(t,e,n){var r=d.exec(e.slice(n));return r?(t.w=g[r[0].toLowerCase()],n+r[0].length):-1},A:function(t,e,n){var r=h.exec(e.slice(n));return r?(t.w=f[r[0].toLowerCase()],n+r[0].length):-1},b:function(t,e,n){var r=m.exec(e.slice(n));return r?(t.m=y[r[0].toLowerCase()],n+r[0].length):-1},B:function(t,e,n){var r=p.exec(e.slice(n));return r?(t.m=_[r[0].toLowerCase()],n+r[0].length):-1},c:function(t,n,r){return T(t,e,n,r)},d:lr,e:lr,f:pr,H:hr,I:hr,j:cr,L:gr,m:ur,M:fr,p:function(t,e,n){var r=l.exec(e.slice(n));return r?(t.p=c[r[0].toLowerCase()],n+r[0].length):-1},q:sr,Q:mr,s:yr,S:dr,u:tr,U:er,V:nr,w:Jn,W:rr,x:function(t,e,r){return T(t,n,e,r)},X:function(t,e,n){return T(t,r,e,n)},y:ar,Y:ir,Z:or,"%":_r};function w(t,e){return function(n){var r,i,a,o=[],s=-1,u=0,l=t.length;for(n instanceof Date||(n=new Date(+n));++s<l;)37===t.charCodeAt(s)&&(o.push(t.slice(u,s)),null!=(i=Gn[r=t.charAt(++s)])?r=t.charAt(++s):i="e"===r?" ":"0",(a=e[r])&&(r=a(n,i)),o.push(r),u=s+1);return o.push(t.slice(u,s)),o.join("")}}function M(t,e){return function(n){var r,i,a=Xn(1900,void 0,1);if(T(a,t,n+="",0)!=n.length)return null;if("Q"in a)return new Date(a.Q);if("s"in a)return new Date(1e3*a.s+("L"in a?a.L:0));if(!e||"Z"in a||(a.Z=0),"p"in a&&(a.H=a.H%12+12*a.p),void 0===a.m&&(a.m="q"in a?a.q:0),"V"in a){if(a.V<1||a.V>53)return null;"w"in a||(a.w=1),"Z"in a?(i=(r=zn(Xn(a.y,0,1))).getUTCDay(),r=i>4||0===i?Rn.ceil(r):Rn(r),r=Bn.offset(r,7*(a.V-1)),a.y=r.getUTCFullYear(),a.m=r.getUTCMonth(),a.d=r.getUTCDate()+(a.w+6)%7):(i=(r=Yn(Xn(a.y,0,1))).getDay(),r=i>4||0===i?mn.ceil(r):mn(r),r=Tn.offset(r,7*(a.V-1)),a.y=r.getFullYear(),a.m=r.getMonth(),a.d=r.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),i="Z"in a?zn(Xn(a.y,0,1)).getUTCDay():Yn(Xn(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(i+5)%7:a.w+7*a.U-(i+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,zn(a)):Yn(a)}}function T(t,e,n,r){for(var i,a,o=0,s=e.length,u=n.length;o<s;){if(r>=u)return-1;if(37===(i=e.charCodeAt(o++))){if(i=e.charAt(o++),!(a=b[i in Gn?e.charAt(o++):i])||(r=a(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return(v.x=w(n,v),v.X=w(r,v),v.c=w(e,v),x.x=w(n,x),x.X=w(r,x),x.c=w(e,x),{format:function(t){var e=w(t+="",v);return e.toString=function(){return t},e},parse:function(t){var e=M(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",x);return e.toString=function(){return t},e},utcParse:function(t){var e=M(t+="",!0);return e.toString=function(){return t},e}})}(t),Un.format,Un.parse,Un.utcFormat,Un.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var ni=hn((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),ri=(ni.range,hn((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getUTCHours()}))),ii=(ri.range,hn((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getUTCMinutes()})));ii.range;n.d(e,"legendColor",(function(){return ci})),n.d(e,"legendSize",(function(){return hi})),n.d(e,"legendSymbol",(function(){return fi})),n.d(e,"legendHelpers",(function(){return di}));var ai="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oi=function(t){return t},si=function(t){for(var e=[],n=0,r=t.length;n<r;n++)e[n]=t[r-n-1];return e},ui=function(t,e){t.each((function(){for(var t,n,r="string"==typeof(n=this)?new ut([[document.querySelector(n)]],[document.documentElement]):new ut([[n]],st),i=r.text().split(/\s+/).reverse(),a=[],o=(r.attr("y"),parseFloat(r.attr("dy"))||0),s=r.text(null).append("tspan").attr("x",0).attr("dy",o+"em");t=i.pop();)a.push(t),s.text(a.join(" ")),s.node().getComputedTextLength()>e&&a.length>1&&(a.pop(),s.text(a.join(" ")),a=[t],s=r.append("tspan").attr("x",0).attr("dy",1.2+o+"em").text(t))}))},li={d3_drawShapes:function(t,e,n,r,i,a){"rect"===t?e.attr("height",n).attr("width",r):"circle"===t?e.attr("r",i):"line"===t?e.attr("x1",0).attr("x2",r).attr("y1",0).attr("y2",0):"path"===t&&e.attr("d",a)},d3_addText:function(t,e,n,r,i){e.append("text").attr("class",r+"label");var a=t.selectAll("g."+r+"cell text."+r+"label").data(n).text(oi);return i&&t.selectAll("g."+r+"cell text."+r+"label").call(ui,i),a},d3_calcType:function(t,e,n,r,i,a){var o=t.invertExtent?function(t,e,n){var r=t.range().map((function(r){var i=t.invertExtent(r);return e(i[0])+" "+n+" "+e(i[1])}));return{data:t.range(),labels:r,feature:oi}}(t,i,a):t.ticks?function(t,e,n){var r=[];if(e.length>1)r=e;else for(var i=t.domain(),a=(i[i.length-1]-i[0])/(e-1),o=0;o<e;o++)r.push(i[0]+o*a);var s=r.map(n);return{data:r,labels:s,feature:function(e){return t(e)}}}(t,n,i):function(t){return{data:t.domain(),labels:t.domain(),feature:function(e){return t(e)}}}(t),s=t.range&&t.range()||t.domain();return o.labels=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments[1],n=arguments[2],r=arguments[3],i=arguments[4];if("object"===(void 0===e?"undefined":ai(e))){if(0===e.length)return t;for(var a=e.length;a<t.length;a++)e.push(t[a]);return e}if("function"==typeof e){for(var o=[],s=t.length,u=0;u<s;u++)o.push(e({i:u,genLength:s,generatedLabels:t,domain:n,range:r,labelDelimiter:i}));return o}return t}(o.labels,r,t.domain(),s,a),e&&(o.labels=si(o.labels),o.data=si(o.data)),o},d3_filterCells:function(t,e){var n=t.data.map((function(e,n){return{data:e,label:t.labels[n]}})).filter(e),r=n.map((function(t){return t.data})),i=n.map((function(t){return t.label}));return t.data=t.data.filter((function(t){return-1!==r.indexOf(t)})),t.labels=t.labels.filter((function(t){return-1!==i.indexOf(t)})),t},d3_placement:function(t,e,n,r,i,a,o){e.attr("transform",n),r.attr("transform",i),"horizontal"===t&&"below"===o&&r.style("text-anchor",a)},d3_addEvents:function(t,e){t.on("mouseover.legend",(function(t){!function(t,e,n){t.call("cellover",n,e)}(e,t,this)})).on("mouseout.legend",(function(t){!function(t,e,n){t.call("cellout",n,e)}(e,t,this)})).on("click.legend",(function(t){!function(t,e,n){t.call("cellclick",n,e)}(e,t,this)})).on("contextmenu.legend",(function(t){!function(t,e,n){t.call("cellcontextmenu",n,e)}(e,t,this)}))},d3_title:function(t,e,n,r){if(""!==e){t.selectAll("text."+n+"legendTitle").data([e]).enter().append("text").attr("class",n+"legendTitle"),t.selectAll("text."+n+"legendTitle").text(e),r&&t.selectAll("text."+n+"legendTitle").call(ui,r);var i=t.select("."+n+"legendCells"),a=t.select("."+n+"legendTitle").nodes().map((function(t){return t.getBBox().height}))[0],o=-i.nodes().map((function(t){return t.getBBox().x}))[0];i.attr("transform","translate("+o+","+a+")")}},d3_defaultLocale:{format:mt,formatPrefix:yt},d3_defaultFormatSpecifier:".01f",d3_defaultDelimiter:"to"};function ci(){var t=un(),e="rect",n=15,r=15,i=10,a=2,o=[5],s=void 0,u=[],l="",c=!1,h="",f=li.d3_defaultLocale,d=li.d3_defaultFormatSpecifier,g=10,p="middle",_="below",m=li.d3_defaultDelimiter,y=void 0,v="vertical",x=!1,b=void 0,w=void 0,M=Rt("cellover","cellout","cellclick","cellcontextmenu");function T(T){var S=li.d3_calcType(t,x,o,u,f.format(d),m);T.selectAll("g").data([t]).enter().append("g").attr("class",l+"legendCells"),s&&li.d3_filterCells(S,s);var C=T.select("."+l+"legendCells").selectAll("."+l+"cell").data(S.data),k=C.enter().append("g").attr("class",l+"cell");k.append(e).attr("class",l+"swatch");var A=T.selectAll("g."+l+"cell "+e+"."+l+"swatch").data(S.data);li.d3_addEvents(k,M),C.exit().transition().style("opacity",0).remove(),A.exit().transition().style("opacity",0).remove(),A=A.merge(A),li.d3_drawShapes(e,A,r,n,i,b);var D=li.d3_addText(T,k,S.labels,l,y);C=k.merge(C);var E=D.nodes().map((function(t){return t.getBBox()})),R=A.nodes().map((function(t){return t.getBBox()}));c?A.attr("class",(function(t){return l+"swatch "+S.feature(t)})):"line"==e?A.style("stroke",S.feature):A.style("fill",S.feature);var N=void 0,V=void 0,I="start"==p?0:"middle"==p?.5:1;if("vertical"===v){var L=E.map((function(t,e){return Math.max(t.height,R[e].height)}));N=function(t,e){return"translate(0, "+(Gt(L.slice(0,e))+e*a)+")"},V=function(t,e){return"translate( "+(R[e].width+R[e].x+g)+", "+(R[e].y+R[e].height/2+5)+")"}}else"horizontal"===v&&(N=function(t,e){return"translate("+e*(R[e].width+a)+",0)"},"below"===_?V=function(t,e){return"translate("+(R[e].width*I+R[e].x)+",\n "+(R[e].height+R[e].y+g+8)+")"}:"right"===_&&(V=function(t,e){return"translate("+(R[e].width+R[e].x+4)+",\n "+(R[e].height+R[e].y)+")"}));li.d3_placement(v,C,N,D,V,p,_),li.d3_title(T,h,l,w),C.transition().style("opacity",1)}return T.scale=function(e){return arguments.length?(t=e,T):t},T.cells=function(t){return arguments.length?((t.length>1||t>=2)&&(o=t),T):o},T.cellFilter=function(t){return arguments.length?(s=t,T):s},T.shape=function(t,n){return arguments.length?(("rect"==t||"circle"==t||"line"==t||"path"==t&&"string"==typeof n)&&(e=t,b=n),T):e},T.shapeWidth=function(t){return arguments.length?(n=+t,T):n},T.shapeHeight=function(t){return arguments.length?(r=+t,T):r},T.shapeRadius=function(t){return arguments.length?(i=+t,T):i},T.shapePadding=function(t){return arguments.length?(a=+t,T):a},T.labels=function(t){return arguments.length?(u=t,T):u},T.labelAlign=function(t){return arguments.length?("start"!=t&&"end"!=t&&"middle"!=t||(p=t),T):p},T.labelPosition=function(t){return arguments.length?("below"!=t&&"right"!=t||(_=t),T):_},T.locale=function(t){return arguments.length?(f=Tt(t),T):f},T.labelFormat=function(t){return arguments.length?(d=dt(t),T):T.locale().format(d)},T.labelOffset=function(t){return arguments.length?(g=+t,T):g},T.labelDelimiter=function(t){return arguments.length?(m=t,T):m},T.labelWrap=function(t){return arguments.length?(y=t,T):y},T.useClass=function(t){return arguments.length?(!0!==t&&!1!==t||(c=t),T):c},T.orient=function(t){return arguments.length?("horizontal"!=(t=t.toLowerCase())&&"vertical"!=t||(v=t),T):v},T.ascending=function(t){return arguments.length?(x=!!t,T):x},T.classPrefix=function(t){return arguments.length?(l=t,T):l},T.title=function(t){return arguments.length?(h=t,T):h},T.titleWidth=function(t){return arguments.length?(w=t,T):w},T.textWrap=function(t){return arguments.length?(textWrap=t,T):textWrap},T.on=function(){var t=M.on.apply(M,arguments);return t===M?T:t},T}function hi(){var t=un(),e="rect",n=15,r=2,i=[5],a=void 0,o=[],s="",u="",l=li.d3_defaultLocale,c=li.d3_defaultFormatSpecifier,h=10,f="middle",d=li.d3_defaultDelimiter,g=void 0,p="vertical",_=!1,m=void 0,y=void 0,v=Rt("cellover","cellout","cellclick","cellcontextmenu");function x(x){var b=li.d3_calcType(t,_,i,o,l.format(c),d),w=x.selectAll("g").data([t]);a&&li.d3_filterCells(b,a),w.enter().append("g").attr("class",s+"legendCells");var M=x.select("."+s+"legendCells").selectAll("."+s+"cell").data(b.data),T=M.enter().append("g").attr("class",s+"cell");T.append(e).attr("class",s+"swatch");var S=x.selectAll("g."+s+"cell "+e+"."+s+"swatch");li.d3_addEvents(T,v),M.exit().transition().style("opacity",0).remove(),S.exit().transition().style("opacity",0).remove(),S=S.merge(S),"line"===e?(li.d3_drawShapes(e,S,0,n),S.attr("stroke-width",b.feature)):li.d3_drawShapes(e,S,b.feature,b.feature,b.feature,m);var C=li.d3_addText(x,T,b.labels,s,g);M=T.merge(M);var k=C.nodes().map((function(t){return t.getBBox()})),A=S.nodes().map((function(n,r){var i=n.getBBox(),a=t(b.data[r]);return"line"===e&&"horizontal"===p?i.height=i.height+a:"line"===e&&"vertical"===p&&(i.width=i.width),i})),D=Ut(A,(function(t){return t.height+t.y})),E=Ut(A,(function(t){return t.width+t.x})),R=void 0,N=void 0,V="start"==f?0:"middle"==f?.5:1;if("vertical"===p){var I=k.map((function(t,e){return Math.max(t.height,A[e].height)})),L="circle"==e||"line"==e?A[0].height/2:0;R=function(t,e){var n=Gt(I.slice(0,e));return"translate(0, "+(L+n+e*r)+")"},N=function(t,e){return"translate( "+(E+h)+",\n "+(A[e].y+A[e].height/2+5)+")"}}else if("horizontal"===p){R=function(t,n){return"translate("+(Gt(A.slice(0,n),(function(t){return t.width}))+n*r)+", "+("circle"==e||"line"==e?D/2:0)+")"};var P="line"==e?D/2:D;N=function(t,e){return"translate( "+(A[e].width*V+A[e].x)+",\n "+(P+h)+")"}}li.d3_placement(p,M,R,C,N,f),li.d3_title(x,u,s,y),M.transition().style("opacity",1)}return x.scale=function(e){return arguments.length?(t=e,x):t},x.cells=function(t){return arguments.length?((t.length>1||t>=2)&&(i=t),x):i},x.cellFilter=function(t){return arguments.length?(a=t,x):a},x.shape=function(t,n){return arguments.length?("rect"!=t&&"circle"!=t&&"line"!=t||(e=t,m=n),x):e},x.shapeWidth=function(t){return arguments.length?(n=+t,x):n},x.shapePadding=function(t){return arguments.length?(r=+t,x):r},x.labels=function(t){return arguments.length?(o=t,x):o},x.labelAlign=function(t){return arguments.length?("start"!=t&&"end"!=t&&"middle"!=t||(f=t),x):f},x.locale=function(t){return arguments.length?(l=Tt(t),x):l},x.labelFormat=function(t){return arguments.length?(c=dt(t),x):x.locale().format(c)},x.labelOffset=function(t){return arguments.length?(h=+t,x):h},x.labelDelimiter=function(t){return arguments.length?(d=t,x):d},x.labelWrap=function(t){return arguments.length?(g=t,x):g},x.orient=function(t){return arguments.length?("horizontal"!=(t=t.toLowerCase())&&"vertical"!=t||(p=t),x):p},x.ascending=function(t){return arguments.length?(_=!!t,x):_},x.classPrefix=function(t){return arguments.length?(s=t,x):s},x.title=function(t){return arguments.length?(u=t,x):u},x.titleWidth=function(t){return arguments.length?(y=t,x):y},x.on=function(){var t=v.on.apply(v,arguments);return t===v?x:t},x}function fi(){var t=un(),e=5,n=[5],r=void 0,i=[],a="",o="",s=li.d3_defaultLocale,u=li.d3_defaultFormatSpecifier,l="middle",c=10,h=li.d3_defaultDelimiter,f=void 0,d="vertical",g=!1,p=void 0,_=Rt("cellover","cellout","cellclick","cellcontextmenu");function m(m){var y=li.d3_calcType(t,g,n,i,s.format(u),h),v=m.selectAll("g").data([t]);r&&li.d3_filterCells(y,r),v.enter().append("g").attr("class",a+"legendCells");var x=m.select("."+a+"legendCells").selectAll("."+a+"cell").data(y.data),b=x.enter().append("g").attr("class",a+"cell");b.append("path").attr("class",a+"swatch");var w=m.selectAll("g."+a+"cell path."+a+"swatch");li.d3_addEvents(b,_),x.exit().transition().style("opacity",0).remove(),w.exit().transition().style("opacity",0).remove(),w=w.merge(w),li.d3_drawShapes("path",w,15,15,10,y.feature);var M=li.d3_addText(m,b,y.labels,a,f);x=b.merge(x);var T=M.nodes().map((function(t){return t.getBBox()})),S=w.nodes().map((function(t){return t.getBBox()})),C=Ut(S,(function(t){return t.height})),k=Ut(S,(function(t){return t.width})),A=void 0,D=void 0,E="start"==l?0:"middle"==l?.5:1;if("vertical"===d){var R=T.map((function(t,e){return Math.max(C,t.height)}));A=function(t,n){return"translate(0, "+(Gt(R.slice(0,n))+n*e)+" )"},D=function(t,e){return"translate( "+(k+c)+",\n "+(S[e].y+S[e].height/2+5)+")"}}else"horizontal"===d&&(A=function(t,n){return"translate( "+n*(k+e)+",0)"},D=function(t,e){return"translate( "+(S[e].width*E+S[e].x)+",\n "+(C+c)+")"});li.d3_placement(d,x,A,M,D,l),li.d3_title(m,o,a,p),x.transition().style("opacity",1)}return m.scale=function(e){return arguments.length?(t=e,m):t},m.cells=function(t){return arguments.length?((t.length>1||t>=2)&&(n=t),m):n},m.cellFilter=function(t){return arguments.length?(r=t,m):r},m.shapePadding=function(t){return arguments.length?(e=+t,m):e},m.labels=function(t){return arguments.length?(i=t,m):i},m.labelAlign=function(t){return arguments.length?("start"!=t&&"end"!=t&&"middle"!=t||(l=t),m):l},m.locale=function(t){return arguments.length?(s=Tt(t),m):s},m.labelFormat=function(t){return arguments.length?(u=dt(t),m):m.locale().format(u)},m.labelOffset=function(t){return arguments.length?(c=+t,m):c},m.labelDelimiter=function(t){return arguments.length?(h=t,m):h},m.labelWrap=function(t){return arguments.length?(f=t,m):f},m.orient=function(t){return arguments.length?("horizontal"!=(t=t.toLowerCase())&&"vertical"!=t||(d=t),m):d},m.ascending=function(t){return arguments.length?(g=!!t,m):g},m.classPrefix=function(t){return arguments.length?(a=t,m):a},m.title=function(t){return arguments.length?(o=t,m):o},m.titleWidth=function(t){return arguments.length?(p=t,m):p},m.on=function(){var t=_.on.apply(_,arguments);return t===_?m:t},m}var di={thresholdLabels:function(t){var e=t.i,n=t.genLength,r=t.generatedLabels,i=t.labelDelimiter;return 0===e?"Less than "+r[e].split(" "+i+" ")[1]:e===n-1?r[e].split(" "+i+" ")[0]+" or more":r[e]}},gi={legendColor:ci,legendSize:hi,legendSymbol:fi,legendHelpers:di};e.default=gi},,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(6),i=n(11),a=n(1),o=n(5),s=n(22);class u{constructor(t,e,n,r,i,a){this._d3Chart=t,this._isXContinuous=a,this._svg=n,this._xAxis=r,this._yAxis=i,this._d3SeriesList=[],this.setData(e)}static canRender(t){let e=t.renderType&r.RenderType.Line||t.renderType&r.RenderType.Area||t.renderType&r.RenderType.Scatter||t.renderType&r.RenderType.DirectionalArrow,n=!0;return t.data.forEach(t=>{n=n&&t.hasOwnProperty("values")}),e&&n&&t.data.length>1}setData(t){this._layer=t;for(let t=0;t<this._d3SeriesList.length;++t)this._d3SeriesList[t].clear();if(t.data.length!==this._d3SeriesList.length){this._d3SeriesList=[];for(let e=0;e<t.data.length;++e){let e=new s.XYSeries(this._d3Chart,t,this._svg,this._xAxis,this._yAxis,this._isXContinuous);this._d3SeriesList.push(e)}}for(let e=0;e<this._d3SeriesList.length;++e)this._d3SeriesList[e].setData(t,e)}getName(){return""}getMaxName(){let t="";for(let e=0;e<this._d3SeriesList.length;++e){let n=this._d3SeriesList[e].getName();t=n.length>t.length?n:t}return t}isXContinuousSeries(){return this._isXContinuous}isYContinuousSeries(){for(let t=0;t<this._d3SeriesList.length;++t)if(!this._d3SeriesList[t].isYContinuousSeries())return!1;return!0}getDiscreteXValues(t){let e={};for(let n=0;n<this._d3SeriesList.length;++n){let r=this._d3SeriesList[n].getDiscreteXValues(t);for(let t=0;t<r.length;++t)e[r[t]]=!0}return Object.keys(e)}getDiscreteYValues(){let t={};for(let e=0;e<this._d3SeriesList.length;++e){let n=this._d3SeriesList[e].getDiscreteYValues();for(let e=0;e<n.length;++e)t[n[e]]=!0}return Object.keys(t)}getXMinMax(){let t=[Number.MAX_VALUE,-Number.MAX_VALUE];for(let e=0;e<this._layer.data.length;++e){let n=this._d3SeriesList[e].getXMinMax();isNaN(n[0])||(t[0]=Math.min(n[0],t[0])),isNaN(n[1])||(t[1]=Math.max(n[1],t[1]))}return t}getYMinMax(){let t=[Number.MAX_VALUE,0];for(let e=0;e<this._d3SeriesList.length;++e){let n=this._d3SeriesList[e].getYMinMax();t[0]=Math.min(n[0],t[0]),this._layer.renderType&r.RenderType.Stacked?t[1]=n[1]+t[1]:t[1]=Math.max(n[1],t[1])}return t}getRequiredHeight(){return 0}getXScalingInfo(){if(this._d3SeriesList.length>0)return this._d3SeriesList[0].getXScalingInfo()}getYScalingInfo(){if(this._d3SeriesList.length>0)return this._d3SeriesList[0].getXScalingInfo()}decimateData(t,e,n,r){let s=this;s._worker&&(s._worker.terminate(),s._worker=null);let u=n.getScale(),l=r.getScale();if(this.isXContinuousSeries()&&this._layer.decimator){let c=[],h=[];for(let t=0;t<this._layer.data.length;++t){let e,n=this._layer.data[t];c.push(n.name),e=Array.isArray(n.values)?new a.SimpleBuffer(n.values):n.values,h.push(e)}let f=this._layer.decimator;return(s._layer.enableWebWorkers||s._d3Chart.getOptions().enableWebWorkers)&&i.InternalDecimatorMap[f.getKey()]?new Promise((function(i,a){let d=[];for(let t=0;t<h.length;++t)d[t]=h[t].getData();s._worker=o.createDecimatorWorker(f,t,e,n,r,d,c,(function(t){s._worker=null;for(let e=0;e<s._d3SeriesList.length;++e)s._d3SeriesList[e].setOutputData(t[e]);i()}),(function(n){s._worker=null,f.initialize(u,u.invert,l,c);let r=f.decimateValues(t,e,h);for(let t=0;t<s._d3SeriesList.length;++t)s._d3SeriesList[t].setOutputData(r[t]);i()}))})):new Promise((function(n,r){f.initialize(u,u.invert,l,c);let i=f.decimateValues(t,e,h);for(let t=0;t<s._d3SeriesList.length;++t)s._d3SeriesList[t].setOutputData(i[t]);n()}))}{let i=[];for(let a=0;a<this._d3SeriesList.length;++a)i.push(this._d3SeriesList[a].decimateData(t,e,n,r));return Promise.all(i)}}getTooltipMetrics(t,e){let n={source:t,group:"",metrics:{}};for(let r=0;r<this._d3SeriesList.length;++r){let i=this._d3SeriesList[r].getTooltipMetrics(t,e);for(let t=0;t<i.length;++t)for(let e in i[t].metrics)n.metrics[e]=i[t].metrics[e]}return[n]}getLegendInfo(){let t=[];for(let e=0;e<this._d3SeriesList.length;++e)t=t.concat(this._d3SeriesList[e].getLegendInfo());return t}focus(t){for(let e=0;e<this._d3SeriesList.length;++e)this._d3SeriesList[e].focus(t)}unfocus(t){for(let e=0;e<this._d3SeriesList.length;++e)this._d3SeriesList[e].unfocus(t)}select(t){for(let e=0;e<this._d3SeriesList.length;++e)this._d3SeriesList[e].select(t)}unselect(t){for(let e=0;e<this._d3SeriesList.length;++e)this._d3SeriesList[e].unselect(t)}render(t){if(this._d3SeriesList.length>0){let e=0;this._d3SeriesList.forEach(t=>{e=Math.max(e,t.getOutputData().length())}),t=Array.apply(null,Array(e)).map(Number.prototype.valueOf,0);for(let e=0;e<this._d3SeriesList.length;++e)this._d3SeriesList[e].render(t)}}getRenderedYRange(){let t=[0,-Number.MAX_VALUE];if(this._d3SeriesList.length>0){let e=this._d3SeriesList[0].getOutputData().length();for(let n=0;n<e;++n){let e=0;for(let t=0;t<this._d3SeriesList.length;++t){e+=this._d3SeriesList[t].getOutputData().get(n).y}t[0]=Math.min(e,t[0]),t[1]=Math.max(e,t[1])}}return t}}e.XYGroupSeries=u,o.D3Chart.register(u)},,,,,,,,,,,function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),r(n(21)),r(n(6)),r(n(0)),r(n(1)),r(n(17)),r(n(13)),r(n(8)),r(n(43)),r(n(23)),r(n(3)),r(n(11)),r(n(27)),r(n(5)),r(n(46)),r(n(47)),r(n(48)),r(n(49)),r(n(50)),r(n(51)),r(n(52)),r(n(53)),r(n(54)),r(n(22)),r(n(31)),r(n(55)),r(n(56)),r(n(57)),r(n(4))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(0),i=n(7),a=n(9),o=n(3),s=n(4),u=n(2);function l(t,e){if(e.data.color)return e.data.color;if(t){if(t.hasColor(e.data.id))return t.getColor(e.data.id);if(t.hasColor(e.data.type))return t.getColor(e.data.type)}return"gray"}function c(t){let e=t.data()[0],n=s.getTextWidth(e.data.name,t.node().style["font-family"],t.node().style["font-size"]);e.y1-e.y0>15&&n<e.x1-e.x0&&t.append("text").attr("class","label").attr("y",14).text(e.data.name)}class h extends o.SVGRenderer{constructor(t,e,n){super();let i,s=this;function u(t){let e={tooltip:s._dataTooltip,data:t};return s._element.onTooltip?s._element.onTooltip({caller:s._element,data:e}):s._dataTooltip.setData(t.id,[]),!0}s.DEFAULT_GRAPH_HEIGHT=250,s.MIN_MARGIN={TOP:10,BOTTOM:10,LEFT:10,RIGHT:10},s._options.height=s.DEFAULT_GRAPH_HEIGHT,s.initialize(t,e,n),this._options.animateDuration=1e3,s._dataTooltip=new a.CustomDivTooltip(s._tooltipId,"tooltip-t"),s._dataTooltip.setAnalyticsName(s._tooltipAnalyticsName).setEnterCallback(u).setMoveCallback(u).setPlaceTooltipLeftRight().alwaysRecalcWidth(!0).setDelay(0),s._onHoverChanged=function(t){if(!o.SVGRenderer.IS_RESIZING)return s.focus(t),s._element.onHover&&s._element.onHover(t),!0},s._hoverStart=function(){let t=this.__data__.data.id;return i=t,s._onHoverChanged({caller:s._element,event:r.EventType.HoverStart,selection:t})},s._hoverEnd=function(){let t=s._onHoverChanged({caller:s._element,event:r.EventType.HoverEnd,selection:i});return i=void 0,t}}_showChildMap(t,e){let n,r=this;r._graphArea.selectAll(".childmap").remove();let i=r._graphArea.append("g").attr("class","childmap").on("mousemove",(function(t){r._dataTooltip.onMouseMove(n)})).on("mouseleave",(function(t){i.remove(),r._dataTooltip.onMouseLeave(n)})).on("click",(function(e){t.node().dispatchEvent(new MouseEvent("click"))})),a=i.selectAll(".tnodes").data([e].concat(e.children)).enter().each((function(t){t.data.id||(t.data.id=t.data.name)})).append("g").attr("class","tnode").attr("transform",(function(t){return"translate("+t.x0+","+(t.y0+r._navBarHeight)+")"})).on("mouseenter",(function(t){n=t.data,r._dataTooltip.onMouseEnter(n),r._dataTooltip.onMouseMove(n,t.evt),r._hoverStart.call(this)})).on("mouseleave",(function(t){r._hoverEnd.call(this)}));return a.append("rect").attr("class",(function(t){return"trect level-"+t.depth+" "+t.data.id})).attr("title",(function(t){return t.data.name})).style("stroke","white").style("fill",(function(t){return l(r._colorMgr,t)})).attr("width",(function(t){return t.x1-t.x0+"px"})).attr("height",(function(t){return t.y1-t.y0+"px"})),a.each((function(){c(u.select(this))})),i}_hasChildMap(t){return this._element.showChildrenOnHover&&t!==this._currentRoot&&t.children}_addInteractionHelper(t,e,n,a){let s,l=this;t.on("click",(function(t){n?s=setTimeout((function(){s&&(t!==l._currentRoot&&t.children&&(l._childMap&&l._childMap.remove(),l._hoverEnd(t),l._navBarText+="."+t.data.name,l._renderTreeMap(l._currentRoot,t)),l.getOptions().disableSelection||o.onSelectHelper(l._element,t.data,t.data.id),e&&(e({caller:l._element,event:r.EventType.Click,data:t.data,selection:t.data.id}),s=null))}),300):(t!==l._currentRoot&&t.children&&(l._childMap&&l._childMap.remove(),l._hoverEnd(t),l._navBarText+="."+t.data.name,l._renderTreeMap(l._currentRoot,t)),e&&(l.getOptions().disableSelection||o.onSelectHelper(l._element,t.data,t.data.id),e({caller:l._element,event:r.EventType.Click,data:t.data,selection:t.data.id})))})),n&&t.on("dblclick",(function(t){window.clearTimeout(s),s=null,n({caller:l._element,event:r.EventType.DoubleClick,data:t.data,selection:t.data.id})})),a&&a.length&&t.on("contextmenu",(function(t){l._dataTooltip.onMouseLeave(u.event),i.showContextMenu(u.event,t.data,a)})),t.on("mouseenter",(function(e){l._hasChildMap(e)?l._childMap=l._showChildMap(t,e):(l._hoverStart.call(this),l._dataTooltip.onMouseEnter(e.data),l._dataTooltip.onMouseMove(e.data,e.evt))})).on("mousemove",(function(t){l._dataTooltip.onMouseMove(t.data,t.evt)})).on("mouseleave",(function(t){l._hasChildMap(t)||(l._hoverEnd.call(this),l._dataTooltip.onMouseLeave(t.data))}))}_renderTreeMap(t,e){let n=this,r=n._element;function i(t,e){n.getAnimateDuration()?(t.transition().duration(n.getAnimateDuration()).on("end",(function(){e(u.select(this))})).attr("transform",(function(t){return"translate("+t.x0+","+(t.y0+n._navBarHeight)+")"})),t.each((function(t){u.select(this).selectAll("rect").transition().duration(n.getAnimateDuration()).attr("width",(function(e){return t.x1-t.x0+"px"})).attr("height",(function(e){return t.y1-t.y0+"px"}))}))):t.attr("transform",(function(t){return"translate("+t.x0+","+(t.y0+n._navBarHeight)+")"})).each((function(t){let n=u.select(this);n.selectAll("rect").attr("width",(function(e){return t.x1-t.x0+"px"})).attr("height",(function(e){return t.y1-t.y0+"px"})),e(n)}))}let a,o=n._graphArea.selectAll(".treemap"),s=t===e.parent;if(a=s?n._graphArea.append("g"):n._graphArea.insert("g",":first-child"),a.attr("class","treemap").selectAll(".tnode").data([e].concat(e.children)).enter().each((function(t){t.data.id||(t.data.id=t.data.name)})).append("g").attr("class","tnode").attr("transform",(function(t){return"translate("+t.x0+","+(t.y0+n._navBarHeight)+")"})).append("rect").attr("class",(function(t){return"trect level-"+t.depth+" "+t.data.id})).attr("title",(function(t){return t.data.name})).style("stroke","white").style("fill",(function(t){return l(n._colorMgr,t)})).attr("width",(function(t){return t.x1-t.x0+"px"})).attr("height",(function(t){return t.y1-t.y0+"px"})),s){let t=t=>t.value,s=u.hierarchy(e.data).sum(t);n._treemap(s),i(a.selectAll(".tnode").data([s].concat(s.children)),(function(t){c(t),n._addInteractionHelper(t,r.onClick,r.onDoubleClick,r.contextMenuItems),o.remove()})),n._currentRoot=s}else{if(t){let n;for(let r=0;r<e.children.length;++r)if(e.children[r].data===t.data){n=e.children[r];break}i(o.selectAll(".tnode").data([n].concat(n.children)),(function(){o.remove()}))}i(a.selectAll(".tnode"),(function(t){c(t),n._addInteractionHelper(t,r.onClick,r.onDoubleClick,r.contextMenuItems)})),n._currentRoot=e}n._navBarSvg.text(n._navBarText)}createLayout(){this._svg.selectAll("*").remove(),this._graphArea=this._svg.append("g").attr("class","graphArea")}render(t){let e=this,n=e._element;this.loadOptions(t),e._navBarHeight=20;let r=e._svgRect.width=e._options.width?e._options.width:400,i=(e._svgRect.height=e._options.height?e._options.height:400)-e._navBarHeight;e._navBarText=n.root.name,function t(e){e.children&&e.children.forEach((function(n){n.parent=e,t(n)}))}(n.root),e._currentRoot||(e._currentRoot=u.hierarchy(n.root).sum((function(t){return t.value})).sort((function(t,e){return e.height-t.height||e.value-t.value}))),e._treemap=u.treemap().paddingInner(1).round(!0).tile(u.treemapResquarify).size([r,i]),e._treemap(e._currentRoot);let a=e._graphArea.append("g");function o(){if(e._currentRoot.data.parent){e._navBarText=e._navBarText.substring(0,e._navBarText.lastIndexOf("."));let t=u.hierarchy(e._currentRoot.data.parent).sum((function(t){return t.value})).sort((function(t,e){return e.height-t.height||e.value-t.value}));e._treemap(t),e._renderTreeMap(e._currentRoot,t)}}a.append("rect").attr("width",r).attr("height",e._navBarHeight).style("fill","orange").on("mousedown touchstart",(function(){o()})),e._navBarSvg=a.append("text").attr("class","header").attr("y",14).text(e._navBarText).on("mousedown touchstart",(function(){o()})),e._renderTreeMap(void 0,e._currentRoot),e._svg.attr("width",e._svgRect.width).attr("height",e._svgRect.height),e._options.rightMargin=e._svgRect.width-(e._graphRect.x+e._graphRect.width),e.updateHandles()}}e.TreeMap=h,s.D3Renderer.register(r.UIType.TreeMap,h)},function(t,e,n){t.exports=function(){return n(45)('!function(t){var n={};function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var i in t)e.d(r,i,function(n){return t[n]}.bind(null,i));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=1)}([function(t,n,e){"use strict";function r(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function i(t){return function(n,e){return r(t(n),e)}}function u(t){return t||(t=r),1===t.length&&(t=i(t)),{left:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r<i;){var u=r+i>>>1;t(n[u],e)<0?r=u+1:i=u}return r},right:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r<i;){var u=r+i>>>1;t(n[u],e)>0?i=u:r=u+1}return r}}}Object.defineProperty(n,"__esModule",{value:!0}),n.getSelectionName=function(t){return"number"==typeof t?"n"+t:t?(t.length>0&&!isNaN(Number(t[0]))&&(t="z"+t),t=t.replace(/[\\*\\%\\#\\[\\]\\/\\>\\<\\s\\+\\(\\)\\;\\@\\:\\?\\"=.,]/g,"-")):""},n.removeFromList=function(t,n){if(t){let e=n.indexOf(t);-1!==e&&n.splice(e,1)}},n.bisect=u,n.bucketData=function(t,n,e){let r=u().right,i=[];for(let t=0;t<n.length-1;++t)i[t]=[];let o=n[0],a=n[n.length-1],c=n.slice(1);for(let n=0;n<t.length;++n){let u=e(t[n]);u<o||u>a||i[r(c,u)].push(t[n])}let f={};for(let t=0;t<n.length-1;++t){f[n[t]+"-"+n[t+1]]=i[t]}return f},n.copy=function(t){let n={};for(let e in t)n[e]=t[e];return n},n.merge=function(t,n){for(let e in n)t[e]=n[e]},n.convertTraceToTrees=function(t){let n=[],e=[],r=[];for(let i=0;i<t.length;i++){let u=t[i],o=e[e.length-1];for(;e.length&&u.x>o.x+o.dx;)--e.length,--r.length,o=e[e.length-1];let a=r[r.length-1],c={key:u.key,value:u.dx,children:[],parent:a};u.name&&(c.name=u.name),a?a.children.push(c):n.push(c),e.push(u),r.push(c)}return n};n.SimpleBuffer=class{constructor(t){this._data=t||[]}push(t){this._data.push(t)}get(t){return this._data[t]}length(){return this._data.length}getData(){return this._data}};n.RingBuffer=class{constructor(t){this._data=new Array(t),this._startIdx=0,this._count=0,this._isRotating=!1}push(t){this._isRotating?(this._data[this._startIdx]=t,++this._startIdx,this._startIdx===this._count&&(this._startIdx=0),this._isRotating=!0):this._count===this._data.length-1?(this._data[this._count]=t,++this._count,this._isRotating=!0):(this._data[this._count]=t,++this._count)}get(t){return this._isRotating&&(t+=this._startIdx)>=this._count&&(t-=this._count),this._data[t]}length(){return this._count}getData(){if(this._isRotating){let t=[];for(let n=this._startIdx;n<this._data.length;++n)t.push(this._data[n]);for(let n=0;n<this._startIdx;++n)t.push(this._data[n]);return t}return this._data}},n.bisectBuffer=function(t){return t||(t=r),1===t.length&&(t=i(t)),{left:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length());r<i;){var u=r+i>>>1;t(n.get(u),e)<0?r=u+1:i=u}return r},right:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length());r<i;){var u=r+i>>>1;t(n.get(u),e)>0?i=u:r=u+1}return r}}},n.transposeKeys=function(t){let n={};function e(t,r,i,u){let o=[];for(let t=0;t<r.length;++t)o[t]=r[t];if(o.push(i.key),Array.isArray(i.data))for(let n=0;n<i.data.length;++n)e(t,o,i.data[n],u+1);else{let e=t;for(let t=o.length-1;t>=0;--t){let r,u=o[t];n.hasOwnProperty(u)?r=n[u]:(r=e.length,n[u]=r),e[r]||(e[r]={key:u,data:[]}),0===t?e[r].data=i.data:e=e[r].data}}}let r=[];for(let n=0;n<t.length;++n)e(r,[],t[n],0);return r},n.runFunctionOnLeaf=function t(n,e){if(n&&n.children&&n.children.length>0)for(let r=0;r<n.children.length;++r)t(n.children[r],e);else e(n)},n.isOverlapping=function(t,n){return t.x<=n.right&&t.right>=n.x&&t.y<=n.bottom&&t.bottom>=n.y}},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});const r=e(2),i=e(0),u=e(3),o=e(5),a=self;a.addEventListener("message",t=>{let n,e,c=t.data;c.xAxis.axisDesc.scaleType===r.AxisType.Ordinal?n=o.scaleBand().range([0,c.xRange]).padding(.1).align(.5).domain(c.xDomain):(c.xAxis.axisDesc.scaleType===r.AxisType.Linear?n=o.scaleLinear().domain(c.xDomain).clamp(!0):c.xAxis.axisDesc.scaleType===r.AxisType.Logarithmic&&(n=o.scaleLog().domain(c.xDomain).clamp(!0)),n.range([0,c.xRange])),c.yAxis&&(c.yAxis.axisDesc.scaleType===r.AxisType.Ordinal?e=o.scaleBand().range([0,c.yRange]).padding(.1).align(.5).domain(c.yDomain):(c.yAxis.axisDesc.scaleType===r.AxisType.Linear?e=o.scaleLinear().domain(c.yDomain).clamp(!0):c.yAxis.axisDesc.scaleType===r.AxisType.Logarithmic&&(e=o.scaleLog().domain(c.yDomain).clamp(!0)),e.range([c.yRange,0])));let f,s=u.InternalDecimatorMap[c.decimatorName];if(s.initialize(n,n.invert,e,c.names),c.names){f=[];for(let t=0;t<c.values.length;++t)f[t]=new i.SimpleBuffer(c.values[t])}else f=new i.SimpleBuffer(c.values);let l=s.decimateValues(c.xStart,c.xEnd,f);a.postMessage(l,void 0)})},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),function(t){t[t.Linear=0]="Linear",t[t.Logarithmic=1]="Logarithmic",t[t.Ordinal=2]="Ordinal"}(n.AxisType||(n.AxisType={}))},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});const r=e(4),i=e(0);n.findFirstInsertionIdx=i.bisectBuffer((function(t){return t.x})).left,n.findLastInsertionIdx=i.bisectBuffer((function(t){return t.x})).right;n.XYDummyDecimator=class{constructor(){this._values=[]}initialize(t,n,e){}getKey(){return""}getName(){return""}getValues(){return this._values}decimateValues(t,n,e){return Array.isArray(e)?e.forEach(t=>{this._values.push(t.getData())}):this._values=e.getData(),this._values}};class u{constructor(){this._name="Simple Unimplemented Decimator"}initialize(t,n,e){this._xValueToCoord=t,this._xCoordToValue=n,this._yValueToCoord=e}getKey(){return this._key}getName(){return this._name}getValues(){return this._decimatedValues}decimateValues(t,e,r){if(this._decimatedValues=[],0===r.length())return this._decimatedValues;let i,u,o=n.findFirstInsertionIdx(r,t),a=n.findLastInsertionIdx(r,e);o>0&&--o,a<r.length()&&++a,o<r.length()&&(i=Math.floor(this._xValueToCoord(r.get(o).x)),--i),u=t?Math.floor(this._xValueToCoord(t)):Math.floor(this._xValueToCoord(r.get(o).x));let c,f=o;for(let t=o;t<a;++t){let n=r.get(t),e=Math.floor(this._xValueToCoord(n.x));c=t,e!==i&&(this._decimatedValues=this._decimatedValues.concat(this._customFunc(r,f,c,this._yValueToCoord,this._xValueToCoord,this._xCoordToValue(u),this._xCoordToValue(e))),u=e,i=e,f=c)}return f!==r.length()&&(this._decimatedValues=this._decimatedValues.concat(this._customFunc(r,f,c+1,this._yValueToCoord,this._xValueToCoord,this._xCoordToValue(u),Number.MAX_VALUE))),this._decimatedValues}}n.CustomPointXYDecimator=u;class o extends u{constructor(){super(),this._key=o.KEY,this._name="Min",this._customFunc=function(t,n,e,r){if(t.length()>0&&n!==e){let r,i=Number.MAX_VALUE;for(let u=n;u<e;++u){let n=t.get(u),e=n.y;e<i&&(r=n,i=e)}return[r]}return[]}}}function a(t,n,e,i){if(t.length()>0&&n!==e){let i=0;for(let r=n;r<e;++r){i+=t.get(r).y}return[new r.XYValue(t.get(e-1).x,i/(e-n))]}return[]}n.MinPointDecimator=o,o.KEY="MinPointDecimator";class c extends u{constructor(){super(),this._key=c.KEY,this._name="Avg",this._customFunc=a}}n.AvgPointDecimator=c,c.KEY="AvgPointDecimator";class f extends u{constructor(){super(),this._key=f.KEY,this._name="Max",this._customFunc=function(t,n,e,r){if(t.length()>0&&n!==e){let r,i=-Number.MAX_VALUE;for(let u=n;u<e;++u){let n=t.get(u),e=n.y;e>i&&(r=n,i=e)}return[r]}return[]}}}n.MaxPointDecimator=f,f.KEY="MaxPointDecimator";class s extends u{constructor(){super(),this._key=s.KEY,this._name="XYPointDecimator",this._customFunc=function(t,n,e,r){let i={},u=[];for(let o=n;o<e;++o){let n=t.get(o),e=Math.floor(r(n.y));i.hasOwnProperty(e.toString())||(u.push(n),i[e]=!0)}return u}}}n.XYPointDecimator=s,s.KEY="XYPointDecimator";class l{constructor(){this._name="Simple Unimplemented Decimator"}initialize(t,n,e){this._xValueToCoord=t,this._xCoordToValue=n,this._yValueToCoord=e}getKey(){return this._key}getName(){return this._name}getValues(){return this._decimatedValues}decimateValues(t,e,r){if(this._decimatedValues=[],0===r.length())return this._decimatedValues;let i,u,o=n.findFirstInsertionIdx(r,t),a=n.findLastInsertionIdx(r,e);o>0&&--o,a<r.length()&&++a,o<r.length()&&(i=Math.floor(this._xValueToCoord(r.get(o).x)),--i),u=t?this._xValueToCoord(t):o;let c=o;for(let t=o;t<a;++t){let n=r.get(t),e=Math.floor(this._xValueToCoord(n.x)),o=t+1;e!==i&&(this._decimatedValues=this._decimatedValues.concat(this._customFunc(r,c,o,this._yValueToCoord,this._xValueToCoord,this._xCoordToValue(u),this._xCoordToValue(e))),u=e,i=e,c=o)}return c!==r.length()&&(this._decimatedValues=this._decimatedValues.concat(this._customFunc(r,c,c+1,this._yValueToCoord,this._xValueToCoord,this._xCoordToValue(u),Number.MAX_VALUE))),this._decimatedValues}}n.CustomContinuousXYDecimator=l;class h extends l{constructor(){super(),this._key=h.KEY,this._name="Avg",this._customFunc=a}}function d(t,e,r,i,u,o){let a=[],c=[],f=Math.ceil(t(Number.MAX_VALUE));if(f<0)return;let s=[];for(let t=0;t<=f+1;++t)s.push(e(t));for(let e=0;e<o.length;++e){let r,l,h=o[e],d=n.findFirstInsertionIdx(o[e],i),p=n.findLastInsertionIdx(o[e],u);d>0&&--d,p===h.length()&&--p,c[e]=Array.apply(null,Array(f)).map(Number.prototype.valueOf,0);for(let n=d;n<p;++n){r=h.get(n),l=h.get(n+1);let o=Math.floor(t(r.x)),a=Math.floor(t(l.x)),f=l.x-r.x,d=0===f?0:l.y/f;if(o===a)if(void 0===i||r.x>i&&l.x<u)c[e][o]+=d;else{let t=1/(s[o+1]-s[o]);l.x<u?c[e][o]+=(l.x-s[o])*d*t:c[e][o]+=(s[o+1]-r.x)*d*t}else{let t=1/(s[o+1]-s[o]),n=i?Math.max(i,r.x):r.x,f=s[o+1];c[e][o]+=(f-n)*d*t;for(let t=o+1;t<a;++t)c[e][t]+=d;t=1/(s[a]-s[a-1]);let h=u?Math.min(u,l.x):l.x,p=s[a];c[e][a]+=(h-p)*d*t}}a[e]=[];let g=c[e];for(let t=0;t<g.length;++t)a[e][t]={x:s[t],y:c[e][t]}}return a}n.AvgContinuousDecimator=h,h.KEY="AvgContinuousDecimator",n.sumMultiXYSeriesValues=d;class p{constructor(){}initialize(t,n,e){this._xValueToCoord=t,this._xCoordToValue=n,this._yValueToCoord=e}getKey(){return p.KEY}getName(){return""}getValues(){return this._decimatedValues}decimateValues(t,n,e){return this._decimatedValues=d(this._xValueToCoord,this._xCoordToValue,this._yValueToCoord,t,n,e),this._decimatedValues}}n.SummedValueMultiXYSeriesDecimator=p,p.KEY="SummedValueMultiXYSeriesDecimator";class g extends p{constructor(){super()}getKey(){return g.KEY}getName(){return""}decimateValues(t,n,e){this._decimatedValues=d(this._xValueToCoord,this._xCoordToValue,this._yValueToCoord,t,n,e);for(let t=0;t<this._decimatedValues[0].length;++t){let n=0;for(let e=0;e<this._decimatedValues.length;++e)this._decimatedValues[e][t].y&&(n+=this._decimatedValues[e][t].y);if(n>0){let r=100/n;for(let n=0;n<e.length;++n)this._decimatedValues[n][t].y&&(this._decimatedValues[n][t].y=this._decimatedValues[n][t].y*r)}}return this._decimatedValues}}n.ResidencyDecimator=g,g.KEY="ResidencyDecimator";class _{constructor(){}initialize(t,n,e){this._xValueToCoord=t,this._xCoordToValue=n,this._yValueToCoord=e}getKey(){return _.KEY}getName(){return""}getValues(){return this._decimatedValues}decimateValues(t,n,e){return this._decimatedValues=d(this._xValueToCoord,this._xCoordToValue,this._yValueToCoord,t,n,[e])[0],this._decimatedValues}}n.SummedValueXYSeriesDecimator=_,_.KEY="SummedValueXYSeriesDecimator";class v extends r.CandlestickValue{constructor(t){super(t,void 0,void 0,void 0,void 0),this._bucketPts=0}}n.NEWSDecimationValue=v;class y{initialize(t,n,e){this._xValueToCoord=t,this._xCoordToValue=n,this._yValueToCoord=e}getKey(){return this._key}getName(){return""}getValues(){return this._buckets}_dumpBucket(t,n,e){let r="valuesInBucket = "+e.toFixed(0)+", ";return r+="([avg]Time delta, avgValue) = ("+(n.x-t).toFixed(2)+", "+n.y.toFixed(2)+"), ",r+="(entry, min, max, exit) = ("+n.entry.toFixed(2)+", "+n.min.toFixed(2)+", "+n.max.toFixed(2)+", "+n.exit.toFixed(2)+")",r}decimateValues(t,n,e){throw"Error need to implement decimate code"}}n.NEWSBaseDecimator=y;class m extends y{constructor(){super(),this._key=m.KEY}createNewBucket(t,n){t.entry=n.y,t.exit=n.y,t.min=n.y,t.max=n.y,t.x=0,t.y=0,t._bucketPts=0,this.addToBucket(t,n)}addToBucket(t,n){t.x+=n.x,t.y+=n.y,t.min=Math.min(t.min,n.y),t.max=Math.max(t.max,n.y),t.exit=n.y,t._bucketPts++}finalizeBucket(t,n){void 0!==n&&n!==t._bucketPts&&console.log("AverageTime: mismatching pt calculation"),0===t._bucketPts&&console.log("AverageTime: 0 points"),t.x=t.x/t._bucketPts,t.y=t.y/t._bucketPts}decimateValues(t,e,r){if(this._buckets=[],0===r.length())return this._buckets;let i,u=n.findFirstInsertionIdx(r,t),o=n.findLastInsertionIdx(r,e);u>0&&--u,o<r.length()&&++o;let a=0;u<r.length()&&(a=Math.floor(this._xValueToCoord(r.get(u).x)),--a);for(let t=u;t<o;++t){let n=r.get(t),e=Math.floor(this._xValueToCoord(n.x));e!==a?(i&&(this.finalizeBucket(i),this._buckets.push(i)),i=new v,this.createNewBucket(i,n),a=e):this.addToBucket(i,n)}return i&&(this.finalizeBucket(i),this._buckets.push(i)),this._buckets}}n.NEWSPointDecimator=m,m.KEY="NEWSPointDecimator";class b extends y{constructor(t){super(),this._weightedSums={},this._prevX=0,this._prevX=0,this._key=b.KEY,t&&(this._states=t)}createNewBucket(t,n){let e;this._weightedSums={},t._bucketPts=0,this._isYObject||(e=n.y,t.x=0,t.y=e,t.entry=e,t.exit=e,t.min=e,t.max=e),this.addToBucket(t,n)}addToStateValueToBucket(t,n){0!==n&&(this._weightedSums[t]||(this._weightedSums[t]=0),this._weightedSums[t]+=n)}addToBucket(t,n){if(this._isYObject)if(this._states)for(let t in n.y)this.addToStateValueToBucket(this._states[t],(n.x-this._prevX)*n.y[t]);else for(let t in n.y)this.addToStateValueToBucket(t,(n.x-this._prevX)*n.y[t]);else{let e;e=this._states?this._states[n.y]:n.y,t.exit=e,this.addToStateValueToBucket(e,n.x-this._prevX)}t.x+=n.x,t._bucketPts++,this._prevX=n.x}finalizeBucket(t,n){var e;void 0!==n&&n!==t._bucketPts&&console.log("AverageTime: mismatching pt calculation"),0===t._bucketPts&&console.log("AverageTime: 0 points"),t.x=t.x/t._bucketPts;var r=-Number.MAX_VALUE;let i=-Number.MAX_VALUE,u=Number.MAX_VALUE;for(let n in this._weightedSums){if(void 0!==this._weightedSums[n]){let t=this._weightedSums[n];t>r&&(e=n,r=t)}let o=this._yValueToCoord(n);o>i&&(t.min=n,i=o),o<u&&(t.max=n,u=o)}void 0!==e?t.y=e:this._isYObject||(t.min=t.y,t.max=t.y)}decimateValues(t,e,r){if(this._buckets=[],0===r.length())return this._buckets;let i,u=n.findFirstInsertionIdx(r,t),o=n.findLastInsertionIdx(r,e);u>0&&--u,o<r.length()&&++o;let a=0;u<r.length()&&(this._isYObject="object"==typeof r.get(u).y,a=Math.floor(this._xValueToCoord(r.get(u).x)),--a);for(let t=u;t<o;++t){let n=r.get(t),e=Math.floor(this._xValueToCoord(n.x));if(e!==a){if(i&&(this.finalizeBucket(i),this._buckets.push(i)),a+1<e){let t=new v;this.createNewBucket(t,n),this.finalizeBucket(t),t.x=this._xCoordToValue(e-1),this._buckets.push(t),this._prevX=t.x}i=new v,this.createNewBucket(i,n),a=e}else this.addToBucket(i,n)}return i&&(this.finalizeBucket(i),this._buckets.push(i)),this._buckets}}n.NEWSStateDecimator=b,b.KEY="NEWSStateDecimator";class x{initialize(t,n,e){this._data=[],this._xValueToCoord=t,this._xCoordToValue=n,this._yValueToCoord=e}getKey(){return x.KEY}getName(){return""}getValues(){return this._data}setRectLimit(t){return this._rectLimit=t,this}decimateValues(t,n,e){this._data=[];let r=e.getData();for(let t=0;t<r.length;++t)this._data=this._data.concat(r[t]);return this._rectLimit&&(this._data.sort((function(t,n){return t.traceValue.dx>n.traceValue.dx?-1:t.traceValue.dx<n.traceValue.dx?1:0})),this._data=this._data.splice(0,this._rectLimit)),this._data}}n.FlameChartRectLimitDecimator=x,x.KEY="FlameChartRectLimitDecimator";class w{constructor(){this._minRectDelta=1}initialize(t,n,e){this._data=[],this._xValueToCoord=t,this._xCoordToValue=n,this._yValueToCoord=e}getKey(){return w.KEY}getName(){return""}getValues(){return this._data}setPixelWidth(t){return this._minRectDelta=t-1,this}setUserPixelFunction(t){this._userPixelFunction=t}mergeRects(t){let n=[],e=Math.ceil(this._xValueToCoord(Number.MAX_VALUE))+1,r=[];for(let t=0;t<=e;++t)r.push(this._xCoordToValue(t));let i=0;e>1&&(i=this._xCoordToValue(1)-this._xCoordToValue(0));for(let e=0;e<t.length;++e){let u=t[e];if(void 0===u)continue;let o,a,c,f=[],s=-Number.MAX_VALUE,l=u.length;for(let t=0;t<l;t++){let n,e=u[t];if(o&&o.traceValue.key===e.traceValue.key&&o.traceValue.x+o.traceValue.dx===e.traceValue.x)o.traceValue.dx+=e.traceValue.dx;else{if(a=Math.floor(this._xValueToCoord(e.traceValue.x)),s>a&&(a=s),c=Math.floor(this._xValueToCoord(e.traceValue.x+e.traceValue.dx)),c-a>this._minRectDelta)n={traceValue:{x:r[a],dx:r[c]-r[a],key:e.traceValue.key,name:e.traceValue.name,desc:e.traceValue.desc},decimatedValues:[e.traceValue],depth:e.depth};else{let o={},f=[];for(s=a+this._minRectDelta,e.traceValue.x<r[a]?o[e.traceValue.name]=e.traceValue.x+e.traceValue.dx-r[a]:o[e.traceValue.name]=e.traceValue.dx,f.push(e.traceValue),++t;t<l;++t){if(e=u[t],Math.floor(this._xValueToCoord(e.traceValue.x))>=s){--t;break}if(f.push(e.traceValue),o.hasOwnProperty(e.traceValue.name)||(o[e.traceValue.name]=0),e.traceValue.x+e.traceValue.dx>r[s]){o[e.traceValue.name]+=r[s]-e.traceValue.x,--t;break}o[e.traceValue.name]+=e.traceValue.dx}let h=f[f.length-1];if(1===f.length)n={traceValue:{x:r[a],dx:r[c]-r[a],key:h.key,name:h.name,desc:h.desc},decimatedValues:f,depth:e.depth};else{let t,u=0;for(let n in o){let e=o[n];e>u&&(t=n,u=e)}n={traceValue:{x:r[a],dx:s<r.length?r[s]-r[a]:r[a]+i,key:"merged",name:t,desc:h.desc},decimatedValues:f,depth:e.depth}}}f.push(n),o=n}}o=void 0;let h=0,d=!0;for(let t=0;t<f.length;++t){d=!0;let e=f[t];e.traceValue.dx<i&&(e.traceValue.dx=i),this._userPixelFunction&&(e=this._userPixelFunction(e)),o&&o.traceValue.key===e.traceValue.key&&o.traceValue.name===e.traceValue.name&&(h=o.traceValue.x+o.traceValue.dx,h>=e.traceValue.x&&(o.traceValue.dx=e.traceValue.x+e.traceValue.dx-o.traceValue.x,o.decimatedValues.concat(e.decimatedValues),d=!1)),d&&(n.push(e),o=e)}}return n}decimateValues(t,n,e){return this._data=this.mergeRects(e.getData()),this._data}}n.FlameChartMergeRectDecimator=w,w.KEY="FlameChartMergeRectDecimator";class M{initialize(t,n,e,r){this._decimatedValues=[],this._xValueToCoord=t,this._xCoordToValue=n,this._yValueToCoord=e,this._states=r}getKey(){return M.KEY}getName(){return""}getValues(){return this._decimatedValues}decimateValues(t,e,r){this._decimatedValues=new Array(this._states.length).fill(0).map(()=>new Array);let i=Math.ceil(this._xValueToCoord(Number.MAX_VALUE));if(i<0)return;let u,o,a={},c={};this._states.forEach((t,n)=>{c[t]=n,a[t]=Array.apply(null,Array(i)).map(Number.prototype.valueOf,0)});let f=n.findFirstInsertionIdx(r,t),s=n.findLastInsertionIdx(r,e);f>0&&--f;let l=[];for(let t=0;t<=i;++t)l.push(this._xCoordToValue(t));let h=1/(l[1]-l[0]);for(let n=f;n<s;++n){u=r.get(n),o=u.x+u.dx;let i=Math.floor(this._xValueToCoord(u.x)),c=Math.floor(this._xValueToCoord(o));if(i===c)a[u.name][i]+=u.dx*h;else{let n=t?Math.max(t,u.x):u.x,r=l[i+1];a[u.name][i]+=(r-n)*h;for(let t=i+1;t<c;++t)a[u.name][t]+=1;let f=e?Math.min(e,o):o,s=l[c];a[u.name][c]+=(f-s)*h}}let d=[];for(let t=0;t<i;++t)d[t]={x:l[t],y:0};for(let t=0;t<this._states.length;++t){let n=a[this._states[t]];if(n)for(let e=0;e<n.length;++e){let n=a[this._states[t]][e]?a[this._states[t]][e]:0;this._decimatedValues[t][e]={x:l[e],y:100*n}}else this._decimatedValues[t]=d}return this._decimatedValues}}n.TraceResidencyDecimator=M,M.KEY="TraceResidencyDecimator";class T{initialize(t,n,e,r){this._decimatedValues=[],this._xValueToCoord=t,this._xCoordToValue=n,this._yValueToCoord=e,this._states=r}getKey(){return T.KEY}getName(){return""}getValues(){return this._decimatedValues}decimateValues(t,e,r){let i,u,o=Math.ceil(this._xValueToCoord(Number.MAX_VALUE));if(o<0)return;let a=n.findFirstInsertionIdx(r,t),c=n.findLastInsertionIdx(r,e);a>0&&--a,this._decimatedValues=[];for(let t=0;t<=o;++t)this._decimatedValues[t]=new v(this._xCoordToValue(t));let f={};this._states.forEach((t,n)=>{f[t]=n});for(let t=a;t<c;++t){i=r.get(t),u=i.x+i.dx;let n=Math.floor(this._xValueToCoord(i.x)),e=Math.floor(this._xValueToCoord(u));if(this._decimatedValues[n].entry||(this._decimatedValues[n].entry=f[i.name],this._decimatedValues[n].exit=f[i.name],this._decimatedValues[n].min=f[i.name],this._decimatedValues[n].max=f[i.name]),n===e)this._decimatedValues[n].exit=f[i.name],this._decimatedValues[n].min=Math.min(this._decimatedValues[n].min,f[i.name]),this._decimatedValues[n].max=Math.max(this._decimatedValues[n].max,f[i.name]);else{this._decimatedValues[n].exit=f[i.name],this._decimatedValues[n].min=Math.min(this._decimatedValues[n].min,f[i.name]),this._decimatedValues[n].max=Math.max(this._decimatedValues[n].max,f[i.name]);for(let t=n+1;t<=e;++t)this._decimatedValues[t].entry=f[i.name],this._decimatedValues[t].exit=f[i.name],this._decimatedValues[t].min=f[i.name],this._decimatedValues[t].max=f[i.name]}}for(let t=0;t<this._decimatedValues.length;++t){let n=this._decimatedValues[t],e=n.exit;n.entry=this._states[n.entry],n.exit=this._states[e],n.y=this._states[e],n.min=this._states[n.min],n.max=this._states[n.max]}return this._decimatedValues}}n.TraceStateDecimator=T,T.KEY="TraceStateDecimator";class k{initialize(t,n,e){this._data=[],this._xValueToCoord=t,this._xCoordToValue=n,this._yValueToCoord=e}getKey(){return k.KEY}getName(){return""}getValues(){return this._data}mergeMarkers(t){let n=[],e=-Number.MAX_VALUE;for(let r=0;r<t.length;++r){let i=t[r],u=this._xValueToCoord(i.x);u!==e&&(n.push(i),e=u)}return n}decimateValues(t,n,e){let r=e.getData();if(void 0!==t&&void 0!==n){let e=[];for(let i=0;i<r.length;++i){let u=r[i];u.x<n&&u.x>t?e.push(u):u.dx&&u.x+u.dx<n&&u.x+u.dx>t&&e.push(u)}this._data=this.mergeMarkers(e)}else this._data=this.mergeMarkers(r);return this._data}}n.SimpleMarkerDecimator=k,k.KEY="SimpleMarkerDecimator";class A{constructor(){}initialize(t,n,e){this._xValueToCoord=t,this._xCoordToValue=n,this._yValueToCoord=e}getKey(){return p.KEY}getName(){return""}getValues(){return this._decimatedValues}decimateValues(t,e,r){this._decimatedValues=[];let i=[],u=Math.ceil(this._xValueToCoord(Number.MAX_VALUE));if(u<0)return;let o=[];for(let t=0;t<=u+1;++t)o.push(this._xCoordToValue(t));for(let a=0;a<r.length;++a){let c,f,s=r[a],l=n.findFirstInsertionIdx(r[a],t),h=n.findLastInsertionIdx(r[a],e);l>0&&--l,h===s.length()&&--h,i[a]=Array.apply(null,Array(u)).map(Number.prototype.valueOf,0);for(let n=l;n<h;++n){c=s.get(n),f=s.get(n+1);let r=Math.floor(this._xValueToCoord(c.x)),u=Math.floor(this._xValueToCoord(f.x)),l=f.x-c.x,h=0===l?0:f.y/l;if(r===u)if(void 0===t||c.x>t&&f.x<e)i[a][r]+=h;else{let t=1/(o[r+1]-o[r]);f.x<e?i[a][r]+=(f.x-o[r])*h*t:i[a][r]+=(o[r+1]-c.x)*h*t}else{let n=1/(o[r+1]-o[r]),s=t?Math.max(t,c.x):c.x,l=o[r+1];i[a][r]+=(l-s)*h*n;for(let t=r+1;t<u;++t)i[a][t]+=h;n=1/(o[u]-o[u-1]);let d=e?Math.min(e,f.x):f.x,p=o[u];i[a][u]+=(d-p)*h*n}}this._decimatedValues[a]=[];let d=i[a];for(let t=0;t<d.length;++t)this._decimatedValues[a][t]={x:o[t],y:i[a][t]?i[a][t]:0}}return this._decimatedValues}}n.XYHeatMapDecimator=A,A.KEY="XYHeatMapDecimator";let N=[new g,new o,new c,new f,new h,new w,new x,new m,new b,new k,new s,new _,new p,new M];n.InternalDecimatorMap={},N.forEach((function(t){n.InternalDecimatorMap[t.getKey()]=t}))},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.XYValue=class{constructor(t,n){this.x=t,this.y=n}};n.MinMaxValue=class{constructor(t,n,e,r){this.x=t,this.min=n,this.max=e,this.y=r}};n.CandlestickValue=class{constructor(t,n,e,r,i){this.x=t,this.min=n,this.max=e,this.entry=r,this.exit=i}};n.SummaryValue=class{constructor(t,n={}){this.key=t,this.data=n}addValue(t,n){let e=this.data;return e.hasOwnProperty(t)?e[t]+=n:e[t]=n,this}}},function(t,n,e){"use strict";e.r(n);var r=function(t,n){return t<n?-1:t>n?1:t>=n?0:NaN},i=function(t){var n;return 1===t.length&&(n=t,t=function(t,e){return r(n(t),e)}),{left:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r<i;){var u=r+i>>>1;t(n[u],e)<0?r=u+1:i=u}return r},right:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r<i;){var u=r+i>>>1;t(n[u],e)>0?i=u:r=u+1}return r}}};var u=i(r),o=u.right,a=u.left,c=o,f=function(t,n){null==n&&(n=s);for(var e=0,r=t.length-1,i=t[0],u=new Array(r<0?0:r);e<r;)u[e]=n(i,i=t[++e]);return u};function s(t,n){return[t,n]}var l=function(t,n,e){var r,i,u,o,a=t.length,c=n.length,f=new Array(a*c);for(null==e&&(e=s),r=u=0;r<a;++r)for(o=t[r],i=0;i<c;++i,++u)f[u]=e(o,n[i]);return f},h=function(t,n){return n<t?-1:n>t?1:n>=t?0:NaN},d=function(t){return null===t?NaN:+t},p=function(t,n){var e,r,i=t.length,u=0,o=-1,a=0,c=0;if(null==n)for(;++o<i;)isNaN(e=d(t[o]))||(c+=(r=e-a)*(e-(a+=r/++u)));else for(;++o<i;)isNaN(e=d(n(t[o],o,t)))||(c+=(r=e-a)*(e-(a+=r/++u)));if(u>1)return c/(u-1)},g=function(t,n){var e=p(t,n);return e?Math.sqrt(e):e},_=function(t,n){var e,r,i,u=t.length,o=-1;if(null==n){for(;++o<u;)if(null!=(e=t[o])&&e>=e)for(r=i=e;++o<u;)null!=(e=t[o])&&(r>e&&(r=e),i<e&&(i=e))}else for(;++o<u;)if(null!=(e=n(t[o],o,t))&&e>=e)for(r=i=e;++o<u;)null!=(e=n(t[o],o,t))&&(r>e&&(r=e),i<e&&(i=e));return[r,i]},v=Array.prototype,y=v.slice,m=v.map,b=function(t){return function(){return t}},x=function(t){return t},w=function(t,n,e){t=+t,n=+n,e=(i=arguments.length)<2?(n=t,t=0,1):i<3?1:+e;for(var r=-1,i=0|Math.max(0,Math.ceil((n-t)/e)),u=new Array(i);++r<i;)u[r]=t+r*e;return u},M=Math.sqrt(50),T=Math.sqrt(10),k=Math.sqrt(2),A=function(t,n,e){var r,i,u,o,a=-1;if(e=+e,(t=+t)===(n=+n)&&e>0)return[t];if((r=n<t)&&(i=t,t=n,n=i),0===(o=N(t,n,e))||!isFinite(o))return[];if(o>0)for(t=Math.ceil(t/o),n=Math.floor(n/o),u=new Array(i=Math.ceil(n-t+1));++a<i;)u[a]=(t+a)*o;else for(t=Math.floor(t*o),n=Math.ceil(n*o),u=new Array(i=Math.ceil(t-n+1));++a<i;)u[a]=(t-a)/o;return r&&u.reverse(),u};function N(t,n,e){var r=(n-t)/Math.max(0,e),i=Math.floor(Math.log(r)/Math.LN10),u=r/Math.pow(10,i);return i>=0?(u>=M?10:u>=T?5:u>=k?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(u>=M?10:u>=T?5:u>=k?2:1)}function C(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),u=r/i;return u>=M?i*=10:u>=T?i*=5:u>=k&&(i*=2),n<t?-i:i}var S=function(t){return Math.ceil(Math.log(t.length)/Math.LN2)+1},E=function(){var t=x,n=_,e=S;function r(r){var i,u,o=r.length,a=new Array(o);for(i=0;i<o;++i)a[i]=t(r[i],i,r);var f=n(a),s=f[0],l=f[1],h=e(a,s,l);Array.isArray(h)||(h=C(s,l,h),h=w(Math.ceil(s/h)*h,l,h));for(var d=h.length;h[0]<=s;)h.shift(),--d;for(;h[d-1]>l;)h.pop(),--d;var p,g=new Array(d+1);for(i=0;i<=d;++i)(p=g[i]=[]).x0=i>0?h[i-1]:s,p.x1=i<d?h[i]:l;for(i=0;i<o;++i)s<=(u=a[i])&&u<=l&&g[c(h,u,0,d)].push(r[i]);return g}return r.value=function(n){return arguments.length?(t="function"==typeof n?n:b(n),r):t},r.domain=function(t){return arguments.length?(n="function"==typeof t?t:b([t[0],t[1]]),r):n},r.thresholds=function(t){return arguments.length?(e="function"==typeof t?t:Array.isArray(t)?b(y.call(t)):b(t),r):e},r},V=function(t,n,e){if(null==e&&(e=d),r=t.length){if((n=+n)<=0||r<2)return+e(t[0],0,t);if(n>=1)return+e(t[r-1],r-1,t);var r,i=(r-1)*n,u=Math.floor(i),o=+e(t[u],u,t);return o+(+e(t[u+1],u+1,t)-o)*(i-u)}},P=function(t,n,e){return t=m.call(t,d).sort(r),Math.ceil((e-n)/(2*(V(t,.75)-V(t,.25))*Math.pow(t.length,-1/3)))},D=function(t,n,e){return Math.ceil((e-n)/(3.5*g(t)*Math.pow(t.length,-1/3)))},z=function(t,n){var e,r,i=t.length,u=-1;if(null==n){for(;++u<i;)if(null!=(e=t[u])&&e>=e)for(r=e;++u<i;)null!=(e=t[u])&&e>r&&(r=e)}else for(;++u<i;)if(null!=(e=n(t[u],u,t))&&e>=e)for(r=e;++u<i;)null!=(e=n(t[u],u,t))&&e>r&&(r=e);return r},R=function(t,n){var e,r=t.length,i=r,u=-1,o=0;if(null==n)for(;++u<r;)isNaN(e=d(t[u]))?--i:o+=e;else for(;++u<r;)isNaN(e=d(n(t[u],u,t)))?--i:o+=e;if(i)return o/i},L=function(t,n){var e,i=t.length,u=-1,o=[];if(null==n)for(;++u<i;)isNaN(e=d(t[u]))||o.push(e);else for(;++u<i;)isNaN(e=d(n(t[u],u,t)))||o.push(e);return V(o.sort(r),.5)},Y=function(t){for(var n,e,r,i=t.length,u=-1,o=0;++u<i;)o+=t[u].length;for(e=new Array(o);--i>=0;)for(n=(r=t[i]).length;--n>=0;)e[--o]=r[n];return e},U=function(t,n){var e,r,i=t.length,u=-1;if(null==n){for(;++u<i;)if(null!=(e=t[u])&&e>=e)for(r=e;++u<i;)null!=(e=t[u])&&r>e&&(r=e)}else for(;++u<i;)if(null!=(e=n(t[u],u,t))&&e>=e)for(r=e;++u<i;)null!=(e=n(t[u],u,t))&&r>e&&(r=e);return r},B=function(t,n){for(var e=n.length,r=new Array(e);e--;)r[e]=t[n[e]];return r},I=function(t,n){if(e=t.length){var e,i,u=0,o=0,a=t[o];for(null==n&&(n=r);++u<e;)(n(i=t[u],a)<0||0!==n(a,a))&&(a=i,o=u);return 0===n(a,a)?o:void 0}},O=function(t,n,e){for(var r,i,u=(null==e?t.length:e)-(n=null==n?0:+n);u;)i=Math.random()*u--|0,r=t[u+n],t[u+n]=t[i+n],t[i+n]=r;return t},F=function(t,n){var e,r=t.length,i=-1,u=0;if(null==n)for(;++i<r;)(e=+t[i])&&(u+=e);else for(;++i<r;)(e=+n(t[i],i,t))&&(u+=e);return u},q=function(t){if(!(i=t.length))return[];for(var n=-1,e=U(t,X),r=new Array(e);++n<e;)for(var i,u=-1,o=r[n]=new Array(i);++u<i;)o[u]=t[u][n];return r};function X(t){return t.length}var j=function(){return q(arguments)},H=Array.prototype.slice,K=function(t){return t};function G(t){return"translate("+(t+.5)+",0)"}function W(t){return"translate(0,"+(t+.5)+")"}function $(t){return function(n){return+t(n)}}function Z(t){var n=Math.max(0,t.bandwidth()-1)/2;return t.round()&&(n=Math.round(n)),function(e){return+t(e)+n}}function Q(){return!this.__axis}function J(t,n){var e=[],r=null,i=null,u=6,o=6,a=3,c=1===t||4===t?-1:1,f=4===t||2===t?"x":"y",s=1===t||3===t?G:W;function l(l){var h=null==r?n.ticks?n.ticks.apply(n,e):n.domain():r,d=null==i?n.tickFormat?n.tickFormat.apply(n,e):K:i,p=Math.max(u,0)+a,g=n.range(),_=+g[0]+.5,v=+g[g.length-1]+.5,y=(n.bandwidth?Z:$)(n.copy()),m=l.selection?l.selection():l,b=m.selectAll(".domain").data([null]),x=m.selectAll(".tick").data(h,n).order(),w=x.exit(),M=x.enter().append("g").attr("class","tick"),T=x.select("line"),k=x.select("text");b=b.merge(b.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),x=x.merge(M),T=T.merge(M.append("line").attr("stroke","currentColor").attr(f+"2",c*u)),k=k.merge(M.append("text").attr("fill","currentColor").attr(f,c*p).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),l!==m&&(b=b.transition(l),x=x.transition(l),T=T.transition(l),k=k.transition(l),w=w.transition(l).attr("opacity",1e-6).attr("transform",(function(t){return isFinite(t=y(t))?s(t):this.getAttribute("transform")})),M.attr("opacity",1e-6).attr("transform",(function(t){var n=this.parentNode.__axis;return s(n&&isFinite(n=n(t))?n:y(t))}))),w.remove(),b.attr("d",4===t||2==t?o?"M"+c*o+","+_+"H0.5V"+v+"H"+c*o:"M0.5,"+_+"V"+v:o?"M"+_+","+c*o+"V0.5H"+v+"V"+c*o:"M"+_+",0.5H"+v),x.attr("opacity",1).attr("transform",(function(t){return s(y(t))})),T.attr(f+"2",c*u),k.attr(f,c*p).text(d),m.filter(Q).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),m.each((function(){this.__axis=y}))}return l.scale=function(t){return arguments.length?(n=t,l):n},l.ticks=function(){return e=H.call(arguments),l},l.tickArguments=function(t){return arguments.length?(e=null==t?[]:H.call(t),l):e.slice()},l.tickValues=function(t){return arguments.length?(r=null==t?null:H.call(t),l):r&&r.slice()},l.tickFormat=function(t){return arguments.length?(i=t,l):i},l.tickSize=function(t){return arguments.length?(u=o=+t,l):u},l.tickSizeInner=function(t){return arguments.length?(u=+t,l):u},l.tickSizeOuter=function(t){return arguments.length?(o=+t,l):o},l.tickPadding=function(t){return arguments.length?(a=+t,l):a},l}function tt(t){return J(1,t)}function nt(t){return J(2,t)}function et(t){return J(3,t)}function rt(t){return J(4,t)}var it={value:function(){}};function ut(){for(var t,n=0,e=arguments.length,r={};n<e;++n){if(!(t=arguments[n]+"")||t in r||/[\\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new ot(r)}function ot(t){this._=t}function at(t,n){return t.trim().split(/^|\\s+/).map((function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))}function ct(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function ft(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=it,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}ot.prototype=ut.prototype={constructor:ot,on:function(t,n){var e,r=this._,i=at(t+"",r),u=-1,o=i.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++u<o;)if(e=(t=i[u]).type)r[e]=ft(r[e],t.name,n);else if(null==n)for(e in r)r[e]=ft(r[e],t.name,null);return this}for(;++u<o;)if((e=(t=i[u]).type)&&(e=ct(r[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new ot(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),u=0;u<e;++u)i[u]=arguments[u+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(u=0,e=(r=this._[t]).length;u<e;++u)r[u].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,u=r.length;i<u;++i)r[i].value.apply(n,e)}};var st=ut;function lt(){}var ht=function(t){return null==t?lt:function(){return this.querySelector(t)}};function dt(){return[]}var pt=function(t){return null==t?dt:function(){return this.querySelectorAll(t)}},gt=function(t){return function(){return this.matches(t)}},_t=function(t){return new Array(t.length)};function vt(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}vt.prototype={constructor:vt,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function yt(t,n,e,r,i,u){for(var o,a=0,c=n.length,f=u.length;a<f;++a)(o=n[a])?(o.__data__=u[a],r[a]=o):e[a]=new vt(t,u[a]);for(;a<c;++a)(o=n[a])&&(i[a]=o)}function mt(t,n,e,r,i,u,o){var a,c,f,s={},l=n.length,h=u.length,d=new Array(l);for(a=0;a<l;++a)(c=n[a])&&(d[a]=f="$"+o.call(c,c.__data__,a,n),f in s?i[a]=c:s[f]=c);for(a=0;a<h;++a)(c=s[f="$"+o.call(t,u[a],a,u)])?(r[a]=c,c.__data__=u[a],s[f]=null):e[a]=new vt(t,u[a]);for(a=0;a<l;++a)(c=n[a])&&s[d[a]]===c&&(i[a]=c)}function bt(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}var xt="http://www.w3.org/1999/xhtml",wt={svg:"http://www.w3.org/2000/svg",xhtml:xt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},Mt=function(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),wt.hasOwnProperty(n)?{space:wt[n],local:t}:t};function Tt(t){return function(){this.removeAttribute(t)}}function kt(t){return function(){this.removeAttributeNS(t.space,t.local)}}function At(t,n){return function(){this.setAttribute(t,n)}}function Nt(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function Ct(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function St(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}var Et=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function Vt(t){return function(){this.style.removeProperty(t)}}function Pt(t,n,e){return function(){this.style.setProperty(t,n,e)}}function Dt(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function zt(t,n){return t.style.getPropertyValue(n)||Et(t).getComputedStyle(t,null).getPropertyValue(n)}function Rt(t){return function(){delete this[t]}}function Lt(t,n){return function(){this[t]=n}}function Yt(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function Ut(t){return t.trim().split(/^|\\s+/)}function Bt(t){return t.classList||new It(t)}function It(t){this._node=t,this._names=Ut(t.getAttribute("class")||"")}function Ot(t,n){for(var e=Bt(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function Ft(t,n){for(var e=Bt(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function qt(t){return function(){Ot(this,t)}}function Xt(t){return function(){Ft(this,t)}}function jt(t,n){return function(){(n.apply(this,arguments)?Ot:Ft)(this,t)}}It.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Ht(){this.textContent=""}function Kt(t){return function(){this.textContent=t}}function Gt(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function Wt(){this.innerHTML=""}function $t(t){return function(){this.innerHTML=t}}function Zt(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function Qt(){this.nextSibling&&this.parentNode.appendChild(this)}function Jt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function tn(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===xt&&n.documentElement.namespaceURI===xt?n.createElement(t):n.createElementNS(e,t)}}function nn(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}var en=function(t){var n=Mt(t);return(n.local?nn:tn)(n)};function rn(){return null}function un(){var t=this.parentNode;t&&t.removeChild(this)}function on(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function an(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}var cn={},fn=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(cn={mouseenter:"mouseover",mouseleave:"mouseout"}));function sn(t,n,e){return t=ln(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function ln(t,n,e){return function(r){var i=fn;fn=r;try{t.call(this,this.__data__,n,e)}finally{fn=i}}}function hn(t){return t.trim().split(/^|\\s+/).map((function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}function dn(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,u=n.length;r<u;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.capture);++i?n.length=i:delete this.__on}}}function pn(t,n,e){var r=cn.hasOwnProperty(t.type)?sn:ln;return function(i,u,o){var a,c=this.__on,f=r(n,u,o);if(c)for(var s=0,l=c.length;s<l;++s)if((a=c[s]).type===t.type&&a.name===t.name)return this.removeEventListener(a.type,a.listener,a.capture),this.addEventListener(a.type,a.listener=f,a.capture=e),void(a.value=n);this.addEventListener(t.type,f,e),a={type:t.type,name:t.name,value:n,listener:f,capture:e},c?c.push(a):this.__on=[a]}}function gn(t,n,e,r){var i=fn;t.sourceEvent=fn,fn=t;try{return n.apply(e,r)}finally{fn=i}}function _n(t,n,e){var r=Et(t),i=r.CustomEvent;"function"==typeof i?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}function vn(t,n){return function(){return _n(this,t,n)}}function yn(t,n){return function(){return _n(this,t,n.apply(this,arguments))}}var mn=[null];function bn(t,n){this._groups=t,this._parents=n}function xn(){return new bn([[document.documentElement]],mn)}bn.prototype=xn.prototype={constructor:bn,select:function(t){"function"!=typeof t&&(t=ht(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var u,o,a=n[i],c=a.length,f=r[i]=new Array(c),s=0;s<c;++s)(u=a[s])&&(o=t.call(u,u.__data__,s,a))&&("__data__"in u&&(o.__data__=u.__data__),f[s]=o);return new bn(r,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=pt(t));for(var n=this._groups,e=n.length,r=[],i=[],u=0;u<e;++u)for(var o,a=n[u],c=a.length,f=0;f<c;++f)(o=a[f])&&(r.push(t.call(o,o.__data__,f,a)),i.push(o));return new bn(r,i)},filter:function(t){"function"!=typeof t&&(t=gt(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var u,o=n[i],a=o.length,c=r[i]=[],f=0;f<a;++f)(u=o[f])&&t.call(u,u.__data__,f,o)&&c.push(u);return new bn(r,this._parents)},data:function(t,n){if(!t)return p=new Array(this.size()),s=-1,this.each((function(t){p[++s]=t})),p;var e,r=n?mt:yt,i=this._parents,u=this._groups;"function"!=typeof t&&(e=t,t=function(){return e});for(var o=u.length,a=new Array(o),c=new Array(o),f=new Array(o),s=0;s<o;++s){var l=i[s],h=u[s],d=h.length,p=t.call(l,l&&l.__data__,s,i),g=p.length,_=c[s]=new Array(g),v=a[s]=new Array(g);r(l,h,_,v,f[s]=new Array(d),p,n);for(var y,m,b=0,x=0;b<g;++b)if(y=_[b]){for(b>=x&&(x=b+1);!(m=v[x])&&++x<g;);y._next=m||null}}return(a=new bn(a,i))._enter=c,a._exit=f,a},enter:function(){return new bn(this._enter||this._groups.map(_t),this._parents)},exit:function(){return new bn(this._exit||this._groups.map(_t),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,u=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=n&&(i=n(i)),null==e?u.remove():e(u),r&&i?r.merge(i).order():i},merge:function(t){for(var n=this._groups,e=t._groups,r=n.length,i=e.length,u=Math.min(r,i),o=new Array(r),a=0;a<u;++a)for(var c,f=n[a],s=e[a],l=f.length,h=o[a]=new Array(l),d=0;d<l;++d)(c=f[d]||s[d])&&(h[d]=c);for(;a<r;++a)o[a]=n[a];return new bn(o,this._parents)},order:function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],u=i.length-1,o=i[u];--u>=0;)(r=i[u])&&(o&&4^r.compareDocumentPosition(o)&&o.parentNode.insertBefore(r,o),o=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=bt);for(var e=this._groups,r=e.length,i=new Array(r),u=0;u<r;++u){for(var o,a=e[u],c=a.length,f=i[u]=new Array(c),s=0;s<c;++s)(o=a[s])&&(f[s]=o);f.sort(n)}return new bn(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),n=-1;return this.each((function(){t[++n]=this})),t},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,u=r.length;i<u;++i){var o=r[i];if(o)return o}return null},size:function(){var t=0;return this.each((function(){++t})),t},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,u=n[e],o=0,a=u.length;o<a;++o)(i=u[o])&&t.call(i,i.__data__,o,u);return this},attr:function(t,n){var e=Mt(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==n?e.local?kt:Tt:"function"==typeof n?e.local?St:Ct:e.local?Nt:At)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?Vt:"function"==typeof n?Dt:Pt)(t,n,null==e?"":e)):zt(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?Rt:"function"==typeof n?Yt:Lt)(t,n)):this.node()[t]},classed:function(t,n){var e=Ut(t+"");if(arguments.length<2){for(var r=Bt(this.node()),i=-1,u=e.length;++i<u;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?jt:n?qt:Xt)(e,n))},text:function(t){return arguments.length?this.each(null==t?Ht:("function"==typeof t?Gt:Kt)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?Wt:("function"==typeof t?Zt:$t)(t)):this.node().innerHTML},raise:function(){return this.each(Qt)},lower:function(){return this.each(Jt)},append:function(t){var n="function"==typeof t?t:en(t);return this.select((function(){return this.appendChild(n.apply(this,arguments))}))},insert:function(t,n){var e="function"==typeof t?t:en(t),r=null==n?rn:"function"==typeof n?n:ht(n);return this.select((function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(un)},clone:function(t){return this.select(t?an:on)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,u=hn(t+""),o=u.length;if(!(arguments.length<2)){for(a=n?pn:dn,null==e&&(e=!1),r=0;r<o;++r)this.each(a(u[r],n,e));return this}var a=this.node().__on;if(a)for(var c,f=0,s=a.length;f<s;++f)for(r=0,c=a[f];r<o;++r)if((i=u[r]).type===c.type&&i.name===c.name)return c.value},dispatch:function(t,n){return this.each(("function"==typeof n?yn:vn)(t,n))}};var wn=xn,Mn=function(t){return"string"==typeof t?new bn([[document.querySelector(t)]],[document.documentElement]):new bn([[t]],mn)};function Tn(){fn.stopImmediatePropagation()}var kn=function(){fn.preventDefault(),fn.stopImmediatePropagation()},An=function(t){var n=t.document.documentElement,e=Mn(t).on("dragstart.drag",kn,!0);"onselectstart"in n?e.on("selectstart.drag",kn,!0):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")};function Nn(t,n){var e=t.document.documentElement,r=Mn(t).on("dragstart.drag",null);n&&(r.on("click.drag",kn,!0),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in e?r.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}var Cn=function(t,n,e){t.prototype=n.prototype=e,e.constructor=t};function Sn(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function En(){}var Vn="\\\\s*([+-]?\\\\d+)\\\\s*",Pn="\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*",Dn="\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*",zn=/^#([0-9a-f]{3,8})$/,Rn=new RegExp("^rgb\\\\("+[Vn,Vn,Vn]+"\\\\)$"),Ln=new RegExp("^rgb\\\\("+[Dn,Dn,Dn]+"\\\\)$"),Yn=new RegExp("^rgba\\\\("+[Vn,Vn,Vn,Pn]+"\\\\)$"),Un=new RegExp("^rgba\\\\("+[Dn,Dn,Dn,Pn]+"\\\\)$"),Bn=new RegExp("^hsl\\\\("+[Pn,Dn,Dn]+"\\\\)$"),In=new RegExp("^hsla\\\\("+[Pn,Dn,Dn,Pn]+"\\\\)$"),On={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Fn(){return this.rgb().formatHex()}function qn(){return this.rgb().formatRgb()}function Xn(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=zn.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?jn(n):3===e?new Wn(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?new Wn(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?new Wn(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=Rn.exec(t))?new Wn(n[1],n[2],n[3],1):(n=Ln.exec(t))?new Wn(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=Yn.exec(t))?Hn(n[1],n[2],n[3],n[4]):(n=Un.exec(t))?Hn(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=Bn.exec(t))?Jn(n[1],n[2]/100,n[3]/100,1):(n=In.exec(t))?Jn(n[1],n[2]/100,n[3]/100,n[4]):On.hasOwnProperty(t)?jn(On[t]):"transparent"===t?new Wn(NaN,NaN,NaN,0):null}function jn(t){return new Wn(t>>16&255,t>>8&255,255&t,1)}function Hn(t,n,e,r){return r<=0&&(t=n=e=NaN),new Wn(t,n,e,r)}function Kn(t){return t instanceof En||(t=Xn(t)),t?new Wn((t=t.rgb()).r,t.g,t.b,t.opacity):new Wn}function Gn(t,n,e,r){return 1===arguments.length?Kn(t):new Wn(t,n,e,null==r?1:r)}function Wn(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function $n(){return"#"+Qn(this.r)+Qn(this.g)+Qn(this.b)}function Zn(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Qn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Jn(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new ee(t,n,e,r)}function te(t){if(t instanceof ee)return new ee(t.h,t.s,t.l,t.opacity);if(t instanceof En||(t=Xn(t)),!t)return new ee;if(t instanceof ee)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),u=Math.max(n,e,r),o=NaN,a=u-i,c=(u+i)/2;return a?(o=n===u?(e-r)/a+6*(e<r):e===u?(r-n)/a+2:(n-e)/a+4,a/=c<.5?u+i:2-u-i,o*=60):a=c>0&&c<1?0:o,new ee(o,a,c,t.opacity)}function ne(t,n,e,r){return 1===arguments.length?te(t):new ee(t,n,e,null==r?1:r)}function ee(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function re(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}function ie(t,n,e,r,i){var u=t*t,o=u*t;return((1-3*t+3*u-o)*n+(4-6*u+3*o)*e+(1+3*t+3*u-3*o)*r+o*i)/6}Cn(En,Xn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Fn,formatHex:Fn,formatHsl:function(){return te(this).formatHsl()},formatRgb:qn,toString:qn}),Cn(Wn,Gn,Sn(En,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Wn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Wn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:$n,formatHex:$n,formatRgb:Zn,toString:Zn})),Cn(ee,ne,Sn(En,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new ee(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new ee(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new Wn(re(t>=240?t-240:t+120,i,r),re(t,i,r),re(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var ue=function(t){var n=t.length-1;return function(e){var r=e<=0?e=0:e>=1?(e=1,n-1):Math.floor(e*n),i=t[r],u=t[r+1],o=r>0?t[r-1]:2*i-u,a=r<n-1?t[r+2]:2*u-i;return ie((e-r/n)*n,o,i,u,a)}},oe=function(t){var n=t.length;return function(e){var r=Math.floor(((e%=1)<0?++e:e)*n),i=t[(r+n-1)%n],u=t[r%n],o=t[(r+1)%n],a=t[(r+2)%n];return ie((e-r/n)*n,i,u,o,a)}},ae=function(t){return function(){return t}};function ce(t,n){return function(e){return t+e*n}}function fe(t,n){var e=n-t;return e?ce(t,e>180||e<-180?e-360*Math.round(e/360):e):ae(isNaN(t)?n:t)}function se(t){return 1==(t=+t)?le:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):ae(isNaN(n)?e:n)}}function le(t,n){var e=n-t;return e?ce(t,e):ae(isNaN(t)?n:t)}var he=function t(n){var e=se(n);function r(t,n){var r=e((t=Gn(t)).r,(n=Gn(n)).r),i=e(t.g,n.g),u=e(t.b,n.b),o=le(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=u(n),t.opacity=o(n),t+""}}return r.gamma=t,r}(1);function de(t){return function(n){var e,r,i=n.length,u=new Array(i),o=new Array(i),a=new Array(i);for(e=0;e<i;++e)r=Gn(n[e]),u[e]=r.r||0,o[e]=r.g||0,a[e]=r.b||0;return u=t(u),o=t(o),a=t(a),r.opacity=1,function(t){return r.r=u(t),r.g=o(t),r.b=a(t),r+""}}}var pe=de(ue),ge=de(oe),_e=function(t,n){n||(n=[]);var e,r=t?Math.min(n.length,t.length):0,i=n.slice();return function(u){for(e=0;e<r;++e)i[e]=t[e]*(1-u)+n[e]*u;return i}};function ve(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}var ye=function(t,n){return(ve(n)?_e:me)(t,n)};function me(t,n){var e,r=n?n.length:0,i=t?Math.min(r,t.length):0,u=new Array(i),o=new Array(r);for(e=0;e<i;++e)u[e]=Ce(t[e],n[e]);for(;e<r;++e)o[e]=n[e];return function(t){for(e=0;e<i;++e)o[e]=u[e](t);return o}}var be=function(t,n){var e=new Date;return t=+t,n=+n,function(r){return e.setTime(t*(1-r)+n*r),e}},xe=function(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}},we=function(t,n){var e,r={},i={};for(e in null!==t&&"object"==typeof t||(t={}),null!==n&&"object"==typeof n||(n={}),n)e in t?r[e]=Ce(t[e],n[e]):i[e]=n[e];return function(t){for(e in r)i[e]=r[e](t);return i}},Me=/[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,Te=new RegExp(Me.source,"g");var ke,Ae,Ne=function(t,n){var e,r,i,u=Me.lastIndex=Te.lastIndex=0,o=-1,a=[],c=[];for(t+="",n+="";(e=Me.exec(t))&&(r=Te.exec(n));)(i=r.index)>u&&(i=n.slice(u,i),a[o]?a[o]+=i:a[++o]=i),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,c.push({i:o,x:xe(e,r)})),u=Te.lastIndex;return u<n.length&&(i=n.slice(u),a[o]?a[o]+=i:a[++o]=i),a.length<2?c[0]?function(t){return function(n){return t(n)+""}}(c[0].x):function(t){return function(){return t}}(n):(n=c.length,function(t){for(var e,r=0;r<n;++r)a[(e=c[r]).i]=e.x(t);return a.join("")})},Ce=function(t,n){var e,r=typeof n;return null==n||"boolean"===r?ae(n):("number"===r?xe:"string"===r?(e=Xn(n))?(n=e,he):Ne:n instanceof Xn?he:n instanceof Date?be:ve(n)?_e:Array.isArray(n)?me:"function"!=typeof n.valueOf&&"function"!=typeof n.toString||isNaN(n)?we:xe)(t,n)},Se=function(){for(var t,n=fn;t=n.sourceEvent;)n=t;return n},Ee=function(t,n){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=n.clientX,r.y=n.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}var i=t.getBoundingClientRect();return[n.clientX-i.left-t.clientLeft,n.clientY-i.top-t.clientTop]},Ve=function(t,n,e){arguments.length<3&&(e=n,n=Se().changedTouches);for(var r,i=0,u=n?n.length:0;i<u;++i)if((r=n[i]).identifier===e)return Ee(t,r);return null},Pe=function(t){var n=Se();return n.changedTouches&&(n=n.changedTouches[0]),Ee(t,n)},De=0,ze=0,Re=0,Le=0,Ye=0,Ue=0,Be="object"==typeof performance&&performance.now?performance:Date,Ie="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Oe(){return Ye||(Ie(Fe),Ye=Be.now()+Ue)}function Fe(){Ye=0}function qe(){this._call=this._time=this._next=null}function Xe(t,n,e){var r=new qe;return r.restart(t,n,e),r}function je(){Oe(),++De;for(var t,n=ke;n;)(t=Ye-n._time)>=0&&n._call.call(null,t),n=n._next;--De}function He(){Ye=(Le=Be.now())+Ue,De=ze=0;try{je()}finally{De=0,function(){var t,n,e=ke,r=1/0;for(;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:ke=n);Ae=t,Ge(r)}(),Ye=0}}function Ke(){var t=Be.now(),n=t-Le;n>1e3&&(Ue-=n,Le=t)}function Ge(t){De||(ze&&(ze=clearTimeout(ze)),t-Ye>24?(t<1/0&&(ze=setTimeout(He,t-Be.now()-Ue)),Re&&(Re=clearInterval(Re))):(Re||(Le=Be.now(),Re=setInterval(Ke,1e3)),De=1,Ie(He)))}qe.prototype=Xe.prototype={constructor:qe,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?Oe():+e)+(null==n?0:+n),this._next||Ae===this||(Ae?Ae._next=this:ke=this,Ae=this),this._call=t,this._time=e,Ge()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ge())}};var We=function(t,n,e){var r=new qe;return n=null==n?0:+n,r.restart((function(e){r.stop(),t(e+n)}),n,e),r},$e=st("start","end","cancel","interrupt"),Ze=[],Qe=function(t,n,e,r,i,u){var o=t.__transition;if(o){if(e in o)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function u(c){var f,s,l,h;if(1!==e.state)return a();for(f in i)if((h=i[f]).name===e.name){if(3===h.state)return We(u);4===h.state?(h.state=6,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[f]):+f<n&&(h.state=6,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete i[f])}if(We((function(){3===e.state&&(e.state=4,e.timer.restart(o,e.delay,e.time),o(c))})),e.state=2,e.on.call("start",t,t.__data__,e.index,e.group),2===e.state){for(e.state=3,r=new Array(l=e.tween.length),f=0,s=-1;f<l;++f)(h=e.tween[f].value.call(t,t.__data__,e.index,e.group))&&(r[++s]=h);r.length=s+1}}function o(n){for(var i=n<e.duration?e.ease.call(null,n/e.duration):(e.timer.restart(a),e.state=5,1),u=-1,o=r.length;++u<o;)r[u].call(t,i);5===e.state&&(e.on.call("end",t,t.__data__,e.index,e.group),a())}function a(){for(var r in e.state=6,e.timer.stop(),delete i[n],i)return;delete t.__transition}i[n]=e,e.timer=Xe((function(t){e.state=1,e.timer.restart(u,e.delay,e.time),e.delay<=t&&u(t-e.delay)}),0,e.time)}(t,e,{name:n,index:r,group:i,on:$e,tween:Ze,time:u.time,delay:u.delay,duration:u.duration,ease:u.ease,timer:null,state:0})};function Je(t,n){var e=nr(t,n);if(e.state>0)throw new Error("too late; already scheduled");return e}function tr(t,n){var e=nr(t,n);if(e.state>3)throw new Error("too late; already running");return e}function nr(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}var er,rr,ir,ur,or=function(t,n){var e,r,i,u=t.__transition,o=!0;if(u){for(i in n=null==n?null:n+"",u)(e=u[i]).name===n?(r=e.state>2&&e.state<5,e.state=6,e.timer.stop(),e.on.call(r?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete u[i]):o=!1;o&&delete t.__transition}},ar=180/Math.PI,cr={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},fr=function(t,n,e,r,i,u){var o,a,c;return(o=Math.sqrt(t*t+n*n))&&(t/=o,n/=o),(c=t*e+n*r)&&(e-=t*c,r-=n*c),(a=Math.sqrt(e*e+r*r))&&(e/=a,r/=a,c/=a),t*r<n*e&&(t=-t,n=-n,c=-c,o=-o),{translateX:i,translateY:u,rotate:Math.atan2(n,t)*ar,skewX:Math.atan(c)*ar,scaleX:o,scaleY:a}};function sr(t,n,e,r){function i(t){return t.length?t.pop()+" ":""}return function(u,o){var a=[],c=[];return u=t(u),o=t(o),function(t,r,i,u,o,a){if(t!==i||r!==u){var c=o.push("translate(",null,n,null,e);a.push({i:c-4,x:xe(t,i)},{i:c-2,x:xe(r,u)})}else(i||u)&&o.push("translate("+i+n+u+e)}(u.translateX,u.translateY,o.translateX,o.translateY,a,c),function(t,n,e,u){t!==n?(t-n>180?n+=360:n-t>180&&(t+=360),u.push({i:e.push(i(e)+"rotate(",null,r)-2,x:xe(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(u.rotate,o.rotate,a,c),function(t,n,e,u){t!==n?u.push({i:e.push(i(e)+"skewX(",null,r)-2,x:xe(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(u.skewX,o.skewX,a,c),function(t,n,e,r,u,o){if(t!==e||n!==r){var a=u.push(i(u)+"scale(",null,",",null,")");o.push({i:a-4,x:xe(t,e)},{i:a-2,x:xe(n,r)})}else 1===e&&1===r||u.push(i(u)+"scale("+e+","+r+")")}(u.scaleX,u.scaleY,o.scaleX,o.scaleY,a,c),u=o=null,function(t){for(var n,e=-1,r=c.length;++e<r;)a[(n=c[e]).i]=n.x(t);return a.join("")}}}var lr=sr((function(t){return"none"===t?cr:(er||(er=document.createElement("DIV"),rr=document.documentElement,ir=document.defaultView),er.style.transform=t,t=ir.getComputedStyle(rr.appendChild(er),null).getPropertyValue("transform"),rr.removeChild(er),t=t.slice(7,-1).split(","),fr(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),"px, ","px)","deg)"),hr=sr((function(t){return null==t?cr:(ur||(ur=document.createElementNS("http://www.w3.org/2000/svg","g")),ur.setAttribute("transform",t),(t=ur.transform.baseVal.consolidate())?(t=t.matrix,fr(t.a,t.b,t.c,t.d,t.e,t.f)):cr)}),", ",")",")");function dr(t,n){var e,r;return function(){var i=tr(this,t),u=i.tween;if(u!==e)for(var o=0,a=(r=e=u).length;o<a;++o)if(r[o].name===n){(r=r.slice()).splice(o,1);break}i.tween=r}}function pr(t,n,e){var r,i;if("function"!=typeof e)throw new Error;return function(){var u=tr(this,t),o=u.tween;if(o!==r){i=(r=o).slice();for(var a={name:n,value:e},c=0,f=i.length;c<f;++c)if(i[c].name===n){i[c]=a;break}c===f&&i.push(a)}u.tween=i}}function gr(t,n,e){var r=t._id;return t.each((function(){var t=tr(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)})),function(t){return nr(t,r).value[n]}}var _r=function(t,n){var e;return("number"==typeof n?xe:n instanceof Xn?he:(e=Xn(n))?(n=e,he):Ne)(t,n)};function vr(t){return function(){this.removeAttribute(t)}}function yr(t){return function(){this.removeAttributeNS(t.space,t.local)}}function mr(t,n,e){var r,i,u=e+"";return function(){var o=this.getAttribute(t);return o===u?null:o===r?i:i=n(r=o,e)}}function br(t,n,e){var r,i,u=e+"";return function(){var o=this.getAttributeNS(t.space,t.local);return o===u?null:o===r?i:i=n(r=o,e)}}function xr(t,n,e){var r,i,u;return function(){var o,a,c=e(this);if(null!=c)return(o=this.getAttribute(t))===(a=c+"")?null:o===r&&a===i?u:(i=a,u=n(r=o,c));this.removeAttribute(t)}}function wr(t,n,e){var r,i,u;return function(){var o,a,c=e(this);if(null!=c)return(o=this.getAttributeNS(t.space,t.local))===(a=c+"")?null:o===r&&a===i?u:(i=a,u=n(r=o,c));this.removeAttributeNS(t.space,t.local)}}function Mr(t,n){return function(e){this.setAttribute(t,n.call(this,e))}}function Tr(t,n){return function(e){this.setAttributeNS(t.space,t.local,n.call(this,e))}}function kr(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&Tr(t,i)),e}return i._value=n,i}function Ar(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&Mr(t,i)),e}return i._value=n,i}function Nr(t,n){return function(){Je(this,t).delay=+n.apply(this,arguments)}}function Cr(t,n){return n=+n,function(){Je(this,t).delay=n}}function Sr(t,n){return function(){tr(this,t).duration=+n.apply(this,arguments)}}function Er(t,n){return n=+n,function(){tr(this,t).duration=n}}function Vr(t,n){if("function"!=typeof n)throw new Error;return function(){tr(this,t).ease=n}}function Pr(t,n,e){var r,i,u=function(t){return(t+"").trim().split(/^|\\s+/).every((function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?Je:tr;return function(){var o=u(this,t),a=o.on;a!==r&&(i=(r=a).copy()).on(n,e),o.on=i}}var Dr=wn.prototype.constructor;function zr(t){return function(){this.style.removeProperty(t)}}function Rr(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}function Lr(t,n,e){var r,i;function u(){var u=n.apply(this,arguments);return u!==i&&(r=(i=u)&&Rr(t,u,e)),r}return u._value=n,u}function Yr(t){return function(n){this.textContent=t.call(this,n)}}function Ur(t){var n,e;function r(){var r=t.apply(this,arguments);return r!==e&&(n=(e=r)&&Yr(r)),n}return r._value=t,r}var Br=0;function Ir(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function Or(t){return wn().transition(t)}function Fr(){return++Br}var qr=wn.prototype;function Xr(t){return t*t*t}function jr(t){return--t*t*t+1}function Hr(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}Ir.prototype=Or.prototype={constructor:Ir,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=ht(t));for(var r=this._groups,i=r.length,u=new Array(i),o=0;o<i;++o)for(var a,c,f=r[o],s=f.length,l=u[o]=new Array(s),h=0;h<s;++h)(a=f[h])&&(c=t.call(a,a.__data__,h,f))&&("__data__"in a&&(c.__data__=a.__data__),l[h]=c,Qe(l[h],n,e,h,l,nr(a,e)));return new Ir(u,this._parents,n,e)},selectAll:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=pt(t));for(var r=this._groups,i=r.length,u=[],o=[],a=0;a<i;++a)for(var c,f=r[a],s=f.length,l=0;l<s;++l)if(c=f[l]){for(var h,d=t.call(c,c.__data__,l,f),p=nr(c,e),g=0,_=d.length;g<_;++g)(h=d[g])&&Qe(h,n,e,g,d,p);u.push(d),o.push(c)}return new Ir(u,o,n,e)},filter:function(t){"function"!=typeof t&&(t=gt(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var u,o=n[i],a=o.length,c=r[i]=[],f=0;f<a;++f)(u=o[f])&&t.call(u,u.__data__,f,o)&&c.push(u);return new Ir(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,r=n.length,i=e.length,u=Math.min(r,i),o=new Array(r),a=0;a<u;++a)for(var c,f=n[a],s=e[a],l=f.length,h=o[a]=new Array(l),d=0;d<l;++d)(c=f[d]||s[d])&&(h[d]=c);for(;a<r;++a)o[a]=n[a];return new Ir(o,this._parents,this._name,this._id)},selection:function(){return new Dr(this._groups,this._parents)},transition:function(){for(var t=this._name,n=this._id,e=Fr(),r=this._groups,i=r.length,u=0;u<i;++u)for(var o,a=r[u],c=a.length,f=0;f<c;++f)if(o=a[f]){var s=nr(o,n);Qe(o,t,e,f,a,{time:s.time+s.delay+s.duration,delay:0,duration:s.duration,ease:s.ease})}return new Ir(r,this._parents,t,e)},call:qr.call,nodes:qr.nodes,node:qr.node,size:qr.size,empty:qr.empty,each:qr.each,on:function(t,n){var e=this._id;return arguments.length<2?nr(this.node(),e).on.on(t):this.each(Pr(e,t,n))},attr:function(t,n){var e=Mt(t),r="transform"===e?hr:_r;return this.attrTween(t,"function"==typeof n?(e.local?wr:xr)(e,r,gr(this,"attr."+t,n)):null==n?(e.local?yr:vr)(e):(e.local?br:mr)(e,r,n))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=Mt(t);return this.tween(e,(r.local?kr:Ar)(r,n))},style:function(t,n,e){var r="transform"==(t+="")?lr:_r;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var u=zt(this,t),o=(this.style.removeProperty(t),zt(this,t));return u===o?null:u===e&&o===r?i:i=n(e=u,r=o)}}(t,r)).on("end.style."+t,zr(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var r,i,u;return function(){var o=zt(this,t),a=e(this),c=a+"";return null==a&&(this.style.removeProperty(t),c=a=zt(this,t)),o===c?null:o===r&&c===i?u:(i=c,u=n(r=o,a))}}(t,r,gr(this,"style."+t,n))).each(function(t,n){var e,r,i,u,o="style."+n,a="end."+o;return function(){var c=tr(this,t),f=c.on,s=null==c.value[o]?u||(u=zr(n)):void 0;f===e&&i===s||(r=(e=f).copy()).on(a,i=s),c.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,i,u=e+"";return function(){var o=zt(this,t);return o===u?null:o===r?i:i=n(r=o,e)}}(t,r,n),e).on("end.style."+t,null)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,Lr(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(gr(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;return this.tween(n,Ur(t))},remove:function(){return this.on("end.remove",(t=this._id,function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}));var t},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=nr(this.node(),e).tween,u=0,o=i.length;u<o;++u)if((r=i[u]).name===t)return r.value;return null}return this.each((null==n?dr:pr)(e,t,n))},delay:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?Nr:Cr)(n,t)):nr(this.node(),n).delay},duration:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?Sr:Er)(n,t)):nr(this.node(),n).duration},ease:function(t){var n=this._id;return arguments.length?this.each(Vr(n,t)):nr(this.node(),n).ease},end:function(){var t,n,e=this,r=e._id,i=e.size();return new Promise((function(u,o){var a={value:o},c={value:function(){0==--i&&u()}};e.each((function(){var e=tr(this,r),i=e.on;i!==t&&((n=(t=i).copy())._.cancel.push(a),n._.interrupt.push(a),n._.end.push(c)),e.on=n}))}))}};var Kr={time:null,delay:0,duration:250,ease:Hr};function Gr(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))return Kr.time=Oe(),Kr;return e}wn.prototype.interrupt=function(t){return this.each((function(){or(this,t)}))},wn.prototype.transition=function(t){var n,e;t instanceof Ir?(n=t._id,t=t._name):(n=Fr(),(e=Kr).time=Oe(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,u=0;u<i;++u)for(var o,a=r[u],c=a.length,f=0;f<c;++f)(o=a[f])&&Qe(o,t,n,f,a,e||Gr(o,n));return new Ir(r,this._parents,t,n)};var Wr=[null],$r=function(t,n){var e,r,i=t.__transition;if(i)for(r in n=null==n?null:n+"",i)if((e=i[r]).state>1&&e.name===n)return new Ir([[t]],Wr,n,+r);return null},Zr=function(t){return function(){return t}},Qr=function(t,n,e){this.target=t,this.type=n,this.selection=e};function Jr(){fn.stopImmediatePropagation()}var ti=function(){fn.preventDefault(),fn.stopImmediatePropagation()},ni={name:"drag"},ei={name:"space"},ri={name:"handle"},ii={name:"center"};function ui(t){return[+t[0],+t[1]]}function oi(t){return[ui(t[0]),ui(t[1])]}function ai(t){return function(n){return Ve(n,fn.touches,t)}}var ci={name:"x",handles:["w","e"].map(_i),input:function(t,n){return null==t?null:[[+t[0],n[0][1]],[+t[1],n[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},fi={name:"y",handles:["n","s"].map(_i),input:function(t,n){return null==t?null:[[n[0][0],+t[0]],[n[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},si={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(_i),input:function(t){return null==t?null:oi(t)},output:function(t){return t}},li={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},hi={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},di={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},pi={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},gi={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function _i(t){return{type:t}}function vi(){return!fn.ctrlKey&&!fn.button}function yi(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function mi(){return navigator.maxTouchPoints||"ontouchstart"in this}function bi(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function xi(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function wi(t){var n=t.__brush;return n?n.dim.output(n.selection):null}function Mi(){return Ai(ci)}function Ti(){return Ai(fi)}var ki=function(){return Ai(si)};function Ai(t){var n,e=yi,r=vi,i=mi,u=!0,o=st("start","brush","end"),a=6;function c(n){var e=n.property("__brush",g).selectAll(".overlay").data([_i("overlay")]);e.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",li.overlay).merge(e).each((function(){var t=bi(this).extent;Mn(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])})),n.selectAll(".selection").data([_i("selection")]).enter().append("rect").attr("class","selection").attr("cursor",li.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=n.selectAll(".handle").data(t.handles,(function(t){return t.type}));r.exit().remove(),r.enter().append("rect").attr("class",(function(t){return"handle handle--"+t.type})).attr("cursor",(function(t){return li[t.type]})),n.each(f).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(i).on("touchstart.brush",h).on("touchmove.brush",d).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(){var t=Mn(this),n=bi(this).selection;n?(t.selectAll(".selection").style("display",null).attr("x",n[0][0]).attr("y",n[0][1]).attr("width",n[1][0]-n[0][0]).attr("height",n[1][1]-n[0][1]),t.selectAll(".handle").style("display",null).attr("x",(function(t){return"e"===t.type[t.type.length-1]?n[1][0]-a/2:n[0][0]-a/2})).attr("y",(function(t){return"s"===t.type[0]?n[1][1]-a/2:n[0][1]-a/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?n[1][0]-n[0][0]+a:a})).attr("height",(function(t){return"e"===t.type||"w"===t.type?n[1][1]-n[0][1]+a:a}))):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function s(t,n,e){return!e&&t.__brush.emitter||new l(t,n)}function l(t,n){this.that=t,this.args=n,this.state=t.__brush,this.active=0}function h(){if((!n||fn.touches)&&r.apply(this,arguments)){var e,i,o,a,c,l,h,d,p,g,_,v=this,y=fn.target.__data__.type,m="selection"===(u&&fn.metaKey?y="overlay":y)?ni:u&&fn.altKey?ii:ri,b=t===fi?null:pi[y],x=t===ci?null:gi[y],w=bi(v),M=w.extent,T=w.selection,k=M[0][0],A=M[0][1],N=M[1][0],C=M[1][1],S=0,E=0,V=b&&x&&u&&fn.shiftKey,P=fn.touches?ai(fn.changedTouches[0].identifier):Pe,D=P(v),z=D,R=s(v,arguments,!0).beforestart();"overlay"===y?(T&&(p=!0),w.selection=T=[[e=t===fi?k:D[0],o=t===ci?A:D[1]],[c=t===fi?N:e,h=t===ci?C:o]]):(e=T[0][0],o=T[0][1],c=T[1][0],h=T[1][1]),i=e,a=o,l=c,d=h;var L=Mn(v).attr("pointer-events","none"),Y=L.selectAll(".overlay").attr("cursor",li[y]);if(fn.touches)R.moved=B,R.ended=O;else{var U=Mn(fn.view).on("mousemove.brush",B,!0).on("mouseup.brush",O,!0);u&&U.on("keydown.brush",F,!0).on("keyup.brush",q,!0),An(fn.view)}Jr(),or(v),f.call(v),R.start()}function B(){var t=P(v);!V||g||_||(Math.abs(t[0]-z[0])>Math.abs(t[1]-z[1])?_=!0:g=!0),z=t,p=!0,ti(),I()}function I(){var t;switch(S=z[0]-D[0],E=z[1]-D[1],m){case ei:case ni:b&&(S=Math.max(k-e,Math.min(N-c,S)),i=e+S,l=c+S),x&&(E=Math.max(A-o,Math.min(C-h,E)),a=o+E,d=h+E);break;case ri:b<0?(S=Math.max(k-e,Math.min(N-e,S)),i=e+S,l=c):b>0&&(S=Math.max(k-c,Math.min(N-c,S)),i=e,l=c+S),x<0?(E=Math.max(A-o,Math.min(C-o,E)),a=o+E,d=h):x>0&&(E=Math.max(A-h,Math.min(C-h,E)),a=o,d=h+E);break;case ii:b&&(i=Math.max(k,Math.min(N,e-S*b)),l=Math.max(k,Math.min(N,c+S*b))),x&&(a=Math.max(A,Math.min(C,o-E*x)),d=Math.max(A,Math.min(C,h+E*x)))}l<i&&(b*=-1,t=e,e=c,c=t,t=i,i=l,l=t,y in hi&&Y.attr("cursor",li[y=hi[y]])),d<a&&(x*=-1,t=o,o=h,h=t,t=a,a=d,d=t,y in di&&Y.attr("cursor",li[y=di[y]])),w.selection&&(T=w.selection),g&&(i=T[0][0],l=T[1][0]),_&&(a=T[0][1],d=T[1][1]),T[0][0]===i&&T[0][1]===a&&T[1][0]===l&&T[1][1]===d||(w.selection=[[i,a],[l,d]],f.call(v),R.brush())}function O(){if(Jr(),fn.touches){if(fn.touches.length)return;n&&clearTimeout(n),n=setTimeout((function(){n=null}),500)}else Nn(fn.view,p),U.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);L.attr("pointer-events","all"),Y.attr("cursor",li.overlay),w.selection&&(T=w.selection),xi(T)&&(w.selection=null,f.call(v)),R.end()}function F(){switch(fn.keyCode){case 16:V=b&&x;break;case 18:m===ri&&(b&&(c=l-S*b,e=i+S*b),x&&(h=d-E*x,o=a+E*x),m=ii,I());break;case 32:m!==ri&&m!==ii||(b<0?c=l-S:b>0&&(e=i-S),x<0?h=d-E:x>0&&(o=a-E),m=ei,Y.attr("cursor",li.selection),I());break;default:return}ti()}function q(){switch(fn.keyCode){case 16:V&&(g=_=V=!1,I());break;case 18:m===ii&&(b<0?c=l:b>0&&(e=i),x<0?h=d:x>0&&(o=a),m=ri,I());break;case 32:m===ei&&(fn.altKey?(b&&(c=l-S*b,e=i+S*b),x&&(h=d-E*x,o=a+E*x),m=ii):(b<0?c=l:b>0&&(e=i),x<0?h=d:x>0&&(o=a),m=ri),Y.attr("cursor",li[y]),I());break;default:return}ti()}}function d(){s(this,arguments).moved()}function p(){s(this,arguments).ended()}function g(){var n=this.__brush||{selection:null};return n.extent=oi(e.apply(this,arguments)),n.dim=t,n}return c.move=function(n,e){n.selection?n.on("start.brush",(function(){s(this,arguments).beforestart().start()})).on("interrupt.brush end.brush",(function(){s(this,arguments).end()})).tween("brush",(function(){var n=this,r=n.__brush,i=s(n,arguments),u=r.selection,o=t.input("function"==typeof e?e.apply(this,arguments):e,r.extent),a=Ce(u,o);function c(t){r.selection=1===t&&null===o?null:a(t),f.call(n),i.brush()}return null!==u&&null!==o?c:c(1)})):n.each((function(){var n=this,r=arguments,i=n.__brush,u=t.input("function"==typeof e?e.apply(n,r):e,i.extent),o=s(n,r).beforestart();or(n),i.selection=null===u?null:u,f.call(n),o.start().brush().end()}))},c.clear=function(t){c.move(t,null)},l.prototype={beforestart:function(){return 1==++this.active&&(this.state.emitter=this,this.starting=!0),this},start:function(){return this.starting?(this.starting=!1,this.emit("start")):this.emit("brush"),this},brush:function(){return this.emit("brush"),this},end:function(){return 0==--this.active&&(delete this.state.emitter,this.emit("end")),this},emit:function(n){gn(new Qr(c,n,t.output(this.state.selection)),o.apply,o,[n,this.that,this.args])}},c.extent=function(t){return arguments.length?(e="function"==typeof t?t:Zr(oi(t)),c):e},c.filter=function(t){return arguments.length?(r="function"==typeof t?t:Zr(!!t),c):r},c.touchable=function(t){return arguments.length?(i="function"==typeof t?t:Zr(!!t),c):i},c.handleSize=function(t){return arguments.length?(a=+t,c):a},c.keyModifiers=function(t){return arguments.length?(u=!!t,c):u},c.on=function(){var t=o.on.apply(o,arguments);return t===o?c:t},c}var Ni=Math.cos,Ci=Math.sin,Si=Math.PI,Ei=Si/2,Vi=2*Si,Pi=Math.max;function Di(t){return function(n,e){return t(n.source.value+n.target.value,e.source.value+e.target.value)}}var zi=function(){var t=0,n=null,e=null,r=null;function i(i){var u,o,a,c,f,s,l=i.length,h=[],d=w(l),p=[],g=[],_=g.groups=new Array(l),v=new Array(l*l);for(u=0,f=-1;++f<l;){for(o=0,s=-1;++s<l;)o+=i[f][s];h.push(o),p.push(w(l)),u+=o}for(n&&d.sort((function(t,e){return n(h[t],h[e])})),e&&p.forEach((function(t,n){t.sort((function(t,r){return e(i[n][t],i[n][r])}))})),c=(u=Pi(0,Vi-t*l)/u)?t:Vi/l,o=0,f=-1;++f<l;){for(a=o,s=-1;++s<l;){var y=d[f],m=p[y][s],b=i[y][m],x=o,M=o+=b*u;v[m*l+y]={index:y,subindex:m,startAngle:x,endAngle:M,value:b}}_[y]={index:y,startAngle:a,endAngle:o,value:h[y]},o+=c}for(f=-1;++f<l;)for(s=f-1;++s<l;){var T=v[s*l+f],k=v[f*l+s];(T.value||k.value)&&g.push(T.value<k.value?{source:k,target:T}:{source:T,target:k})}return r?g.sort(r):g}return i.padAngle=function(n){return arguments.length?(t=Pi(0,n),i):t},i.sortGroups=function(t){return arguments.length?(n=t,i):n},i.sortSubgroups=function(t){return arguments.length?(e=t,i):e},i.sortChords=function(t){return arguments.length?(null==t?r=null:(r=Di(t))._=t,i):r&&r._},i},Ri=Array.prototype.slice,Li=function(t){return function(){return t}},Yi=Math.PI,Ui=2*Yi,Bi=Ui-1e-6;function Ii(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Oi(){return new Ii}Ii.prototype=Oi.prototype={constructor:Ii,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,e,r){this._+="Q"+ +t+","+ +n+","+(this._x1=+e)+","+(this._y1=+r)},bezierCurveTo:function(t,n,e,r,i,u){this._+="C"+ +t+","+ +n+","+ +e+","+ +r+","+(this._x1=+i)+","+(this._y1=+u)},arcTo:function(t,n,e,r,i){t=+t,n=+n,e=+e,r=+r,i=+i;var u=this._x1,o=this._y1,a=e-t,c=r-n,f=u-t,s=o-n,l=f*f+s*s;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(l>1e-6)if(Math.abs(s*a-c*f)>1e-6&&i){var h=e-u,d=r-o,p=a*a+c*c,g=h*h+d*d,_=Math.sqrt(p),v=Math.sqrt(l),y=i*Math.tan((Yi-Math.acos((p+l-g)/(2*_*v)))/2),m=y/v,b=y/_;Math.abs(m-1)>1e-6&&(this._+="L"+(t+m*f)+","+(n+m*s)),this._+="A"+i+","+i+",0,0,"+ +(s*h>f*d)+","+(this._x1=t+b*a)+","+(this._y1=n+b*c)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,e,r,i,u){t=+t,n=+n,u=!!u;var o=(e=+e)*Math.cos(r),a=e*Math.sin(r),c=t+o,f=n+a,s=1^u,l=u?r-i:i-r;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+c+","+f:(Math.abs(this._x1-c)>1e-6||Math.abs(this._y1-f)>1e-6)&&(this._+="L"+c+","+f),e&&(l<0&&(l=l%Ui+Ui),l>Bi?this._+="A"+e+","+e+",0,1,"+s+","+(t-o)+","+(n-a)+"A"+e+","+e+",0,1,"+s+","+(this._x1=c)+","+(this._y1=f):l>1e-6&&(this._+="A"+e+","+e+",0,"+ +(l>=Yi)+","+s+","+(this._x1=t+e*Math.cos(i))+","+(this._y1=n+e*Math.sin(i))))},rect:function(t,n,e,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +r+"h"+-e+"Z"},toString:function(){return this._}};var Fi=Oi;function qi(t){return t.source}function Xi(t){return t.target}function ji(t){return t.radius}function Hi(t){return t.startAngle}function Ki(t){return t.endAngle}var Gi=function(){var t=qi,n=Xi,e=ji,r=Hi,i=Ki,u=null;function o(){var o,a=Ri.call(arguments),c=t.apply(this,a),f=n.apply(this,a),s=+e.apply(this,(a[0]=c,a)),l=r.apply(this,a)-Ei,h=i.apply(this,a)-Ei,d=s*Ni(l),p=s*Ci(l),g=+e.apply(this,(a[0]=f,a)),_=r.apply(this,a)-Ei,v=i.apply(this,a)-Ei;if(u||(u=o=Fi()),u.moveTo(d,p),u.arc(0,0,s,l,h),l===_&&h===v||(u.quadraticCurveTo(0,0,g*Ni(_),g*Ci(_)),u.arc(0,0,g,_,v)),u.quadraticCurveTo(0,0,d,p),u.closePath(),o)return u=null,o+""||null}return o.radius=function(t){return arguments.length?(e="function"==typeof t?t:Li(+t),o):e},o.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:Li(+t),o):r},o.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:Li(+t),o):i},o.source=function(n){return arguments.length?(t=n,o):t},o.target=function(t){return arguments.length?(n=t,o):n},o.context=function(t){return arguments.length?(u=null==t?null:t,o):u},o};function Wi(){}function $i(t,n){var e=new Wi;if(t instanceof Wi)t.each((function(t,n){e.set(n,t)}));else if(Array.isArray(t)){var r,i=-1,u=t.length;if(null==n)for(;++i<u;)e.set(i,t[i]);else for(;++i<u;)e.set(n(r=t[i],i,t),r)}else if(t)for(var o in t)e.set(o,t[o]);return e}Wi.prototype=$i.prototype={constructor:Wi,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,n){return this["$"+t]=n,this},remove:function(t){var n="$"+t;return n in this&&delete this[n]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(n.slice(1));return t},values:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(this[n]);return t},entries:function(){var t=[];for(var n in this)"$"===n[0]&&t.push({key:n.slice(1),value:this[n]});return t},size:function(){var t=0;for(var n in this)"$"===n[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var n in this)"$"===n[0]&&t(this[n],n.slice(1),this)}};var Zi=$i,Qi=function(){var t,n,e,r=[],i=[];function u(e,i,o,a){if(i>=r.length)return null!=t&&e.sort(t),null!=n?n(e):e;for(var c,f,s,l=-1,h=e.length,d=r[i++],p=Zi(),g=o();++l<h;)(s=p.get(c=d(f=e[l])+""))?s.push(f):p.set(c,[f]);return p.each((function(t,n){a(g,n,u(t,i,o,a))})),g}return e={object:function(t){return u(t,0,Ji,tu)},map:function(t){return u(t,0,nu,eu)},entries:function(t){return function t(e,u){if(++u>r.length)return e;var o,a=i[u-1];return null!=n&&u>=r.length?o=e.entries():(o=[],e.each((function(n,e){o.push({key:e,values:t(n,u)})}))),null!=a?o.sort((function(t,n){return a(t.key,n.key)})):o}(u(t,0,nu,eu),0)},key:function(t){return r.push(t),e},sortKeys:function(t){return i[r.length-1]=t,e},sortValues:function(n){return t=n,e},rollup:function(t){return n=t,e}}};function Ji(){return{}}function tu(t,n,e){t[n]=e}function nu(){return Zi()}function eu(t,n,e){t.set(n,e)}function ru(){}var iu=Zi.prototype;function uu(t,n){var e=new ru;if(t instanceof ru)t.each((function(t){e.add(t)}));else if(t){var r=-1,i=t.length;if(null==n)for(;++r<i;)e.add(t[r]);else for(;++r<i;)e.add(n(t[r],r,t))}return e}ru.prototype=uu.prototype={constructor:ru,has:iu.has,add:function(t){return this["$"+(t+="")]=t,this},remove:iu.remove,clear:iu.clear,values:iu.keys,size:iu.size,empty:iu.empty,each:iu.each};var ou=uu,au=function(t){var n=[];for(var e in t)n.push(e);return n},cu=function(t){var n=[];for(var e in t)n.push(t[e]);return n},fu=function(t){var n=[];for(var e in t)n.push({key:e,value:t[e]});return n},su=Math.PI/180,lu=180/Math.PI;function hu(t){if(t instanceof gu)return new gu(t.l,t.a,t.b,t.opacity);if(t instanceof Mu)return Tu(t);t instanceof Wn||(t=Kn(t));var n,e,r=mu(t.r),i=mu(t.g),u=mu(t.b),o=_u((.2225045*r+.7168786*i+.0606169*u)/1);return r===i&&i===u?n=e=o:(n=_u((.4360747*r+.3850649*i+.1430804*u)/.96422),e=_u((.0139322*r+.0971045*i+.7141733*u)/.82521)),new gu(116*o-16,500*(n-o),200*(o-e),t.opacity)}function du(t,n){return new gu(t,0,0,null==n?1:n)}function pu(t,n,e,r){return 1===arguments.length?hu(t):new gu(t,n,e,null==r?1:r)}function gu(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function _u(t){return t>6/29*(6/29)*(6/29)?Math.pow(t,1/3):t/(6/29*3*(6/29))+4/29}function vu(t){return t>6/29?t*t*t:6/29*3*(6/29)*(t-4/29)}function yu(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function mu(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function bu(t){if(t instanceof Mu)return new Mu(t.h,t.c,t.l,t.opacity);if(t instanceof gu||(t=hu(t)),0===t.a&&0===t.b)return new Mu(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var n=Math.atan2(t.b,t.a)*lu;return new Mu(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function xu(t,n,e,r){return 1===arguments.length?bu(t):new Mu(e,n,t,null==r?1:r)}function wu(t,n,e,r){return 1===arguments.length?bu(t):new Mu(t,n,e,null==r?1:r)}function Mu(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}function Tu(t){if(isNaN(t.h))return new gu(t.l,0,0,t.opacity);var n=t.h*su;return new gu(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}Cn(gu,pu,Sn(En,{brighter:function(t){return new gu(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new gu(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return new Wn(yu(3.1338561*(n=.96422*vu(n))-1.6168667*(t=1*vu(t))-.4906146*(e=.82521*vu(e))),yu(-.9787684*n+1.9161415*t+.033454*e),yu(.0719453*n-.2289914*t+1.4052427*e),this.opacity)}})),Cn(Mu,wu,Sn(En,{brighter:function(t){return new Mu(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new Mu(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return Tu(this).rgb()}}));var ku=-.29227,Au=-1.7884503806,Nu=3.5172982438,Cu=-.6557636667999999;function Su(t){if(t instanceof Vu)return new Vu(t.h,t.s,t.l,t.opacity);t instanceof Wn||(t=Kn(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(Cu*r+Au*n-Nu*e)/(Cu+Au-Nu),u=r-i,o=(1.97294*(e-i)-ku*u)/-.90649,a=Math.sqrt(o*o+u*u)/(1.97294*i*(1-i)),c=a?Math.atan2(o,u)*lu-120:NaN;return new Vu(c<0?c+360:c,a,i,t.opacity)}function Eu(t,n,e,r){return 1===arguments.length?Su(t):new Vu(t,n,e,null==r?1:r)}function Vu(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}Cn(Vu,Eu,Sn(En,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Vu(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Vu(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*su,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new Wn(255*(n+e*(-.14861*r+1.78277*i)),255*(n+e*(ku*r+-.90649*i)),255*(n+e*(1.97294*r)),this.opacity)}}));var Pu=Array.prototype.slice,Du=function(t,n){return t-n},zu=function(t){return function(){return t}},Ru=function(t,n){for(var e,r=-1,i=n.length;++r<i;)if(e=Lu(t,n[r]))return e;return 0};function Lu(t,n){for(var e=n[0],r=n[1],i=-1,u=0,o=t.length,a=o-1;u<o;a=u++){var c=t[u],f=c[0],s=c[1],l=t[a],h=l[0],d=l[1];if(Yu(c,l,n))return 0;s>r!=d>r&&e<(h-f)*(r-s)/(d-s)+f&&(i=-i)}return i}function Yu(t,n,e){var r,i,u,o;return function(t,n,e){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])}(t,n,e)&&(i=t[r=+(t[0]===n[0])],u=e[r],o=n[r],i<=u&&u<=o||o<=u&&u<=i)}var Uu=function(){},Bu=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]],Iu=function(){var t=1,n=1,e=S,r=a;function i(t){var n=e(t);if(Array.isArray(n))n=n.slice().sort(Du);else{var r=_(t),i=r[0],o=r[1];n=C(i,o,n),n=w(Math.floor(i/n)*n,Math.floor(o/n)*n,n)}return n.map((function(n){return u(t,n)}))}function u(e,i){var u=[],a=[];return function(e,r,i){var u,a,c,f,s,l,h=new Array,d=new Array;u=a=-1,f=e[0]>=r,Bu[f<<1].forEach(p);for(;++u<t-1;)c=f,f=e[u+1]>=r,Bu[c|f<<1].forEach(p);Bu[f<<0].forEach(p);for(;++a<n-1;){for(u=-1,f=e[a*t+t]>=r,s=e[a*t]>=r,Bu[f<<1|s<<2].forEach(p);++u<t-1;)c=f,f=e[a*t+t+u+1]>=r,l=s,s=e[a*t+u+1]>=r,Bu[c|f<<1|s<<2|l<<3].forEach(p);Bu[f|s<<3].forEach(p)}u=-1,s=e[a*t]>=r,Bu[s<<2].forEach(p);for(;++u<t-1;)l=s,s=e[a*t+u+1]>=r,Bu[s<<2|l<<3].forEach(p);function p(t){var n,e,r=[t[0][0]+u,t[0][1]+a],c=[t[1][0]+u,t[1][1]+a],f=o(r),s=o(c);(n=d[f])?(e=h[s])?(delete d[n.end],delete h[e.start],n===e?(n.ring.push(c),i(n.ring)):h[n.start]=d[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete d[n.end],n.ring.push(c),d[n.end=s]=n):(n=h[s])?(e=d[f])?(delete h[n.start],delete d[e.end],n===e?(n.ring.push(c),i(n.ring)):h[e.start]=d[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete h[n.start],n.ring.unshift(r),h[n.start=f]=n):h[f]=d[s]={start:f,end:s,ring:[r,c]}}Bu[s<<3].forEach(p)}(e,i,(function(t){r(t,e,i),function(t){for(var n=0,e=t.length,r=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++n<e;)r+=t[n-1][1]*t[n][0]-t[n-1][0]*t[n][1];return r}(t)>0?u.push([t]):a.push(t)})),a.forEach((function(t){for(var n,e=0,r=u.length;e<r;++e)if(-1!==Ru((n=u[e])[0],t))return void n.push(t)})),{type:"MultiPolygon",value:i,coordinates:u}}function o(n){return 2*n[0]+n[1]*(t+1)*4}function a(e,r,i){e.forEach((function(e){var u,o=e[0],a=e[1],c=0|o,f=0|a,s=r[f*t+c];o>0&&o<t&&c===o&&(u=r[f*t+c-1],e[0]=o+(i-u)/(s-u)-.5),a>0&&a<n&&f===a&&(u=r[(f-1)*t+c],e[1]=a+(i-u)/(s-u)-.5)}))}return i.contour=u,i.size=function(e){if(!arguments.length)return[t,n];var r=Math.ceil(e[0]),u=Math.ceil(e[1]);if(!(r>0&&u>0))throw new Error("invalid size");return t=r,n=u,i},i.thresholds=function(t){return arguments.length?(e="function"==typeof t?t:Array.isArray(t)?zu(Pu.call(t)):zu(t),i):e},i.smooth=function(t){return arguments.length?(r=t?a:Uu,i):r===a},i};function Ou(t,n,e){for(var r=t.width,i=t.height,u=1+(e<<1),o=0;o<i;++o)for(var a=0,c=0;a<r+e;++a)a<r&&(c+=t.data[a+o*r]),a>=e&&(a>=u&&(c-=t.data[a-u+o*r]),n.data[a-e+o*r]=c/Math.min(a+1,r-1+u-a,u))}function Fu(t,n,e){for(var r=t.width,i=t.height,u=1+(e<<1),o=0;o<r;++o)for(var a=0,c=0;a<i+e;++a)a<i&&(c+=t.data[o+a*r]),a>=e&&(a>=u&&(c-=t.data[o+(a-u)*r]),n.data[o+(a-e)*r]=c/Math.min(a+1,i-1+u-a,u))}function qu(t){return t[0]}function Xu(t){return t[1]}function ju(){return 1}var Hu=function(){var t=qu,n=Xu,e=ju,r=960,i=500,u=20,o=2,a=3*u,c=r+2*a>>o,f=i+2*a>>o,s=zu(20);function l(r){var i=new Float32Array(c*f),l=new Float32Array(c*f);r.forEach((function(r,u,s){var l=+t(r,u,s)+a>>o,h=+n(r,u,s)+a>>o,d=+e(r,u,s);l>=0&&l<c&&h>=0&&h<f&&(i[l+h*c]+=d)})),Ou({width:c,height:f,data:i},{width:c,height:f,data:l},u>>o),Fu({width:c,height:f,data:l},{width:c,height:f,data:i},u>>o),Ou({width:c,height:f,data:i},{width:c,height:f,data:l},u>>o),Fu({width:c,height:f,data:l},{width:c,height:f,data:i},u>>o),Ou({width:c,height:f,data:i},{width:c,height:f,data:l},u>>o),Fu({width:c,height:f,data:l},{width:c,height:f,data:i},u>>o);var d=s(i);if(!Array.isArray(d)){var p=z(i);d=C(0,p,d),(d=w(0,Math.floor(p/d)*d,d)).shift()}return Iu().thresholds(d).size([c,f])(i).map(h)}function h(t){return t.value*=Math.pow(2,-2*o),t.coordinates.forEach(d),t}function d(t){t.forEach(p)}function p(t){t.forEach(g)}function g(t){t[0]=t[0]*Math.pow(2,o)-a,t[1]=t[1]*Math.pow(2,o)-a}function _(){return c=r+2*(a=3*u)>>o,f=i+2*a>>o,l}return l.x=function(n){return arguments.length?(t="function"==typeof n?n:zu(+n),l):t},l.y=function(t){return arguments.length?(n="function"==typeof t?t:zu(+t),l):n},l.weight=function(t){return arguments.length?(e="function"==typeof t?t:zu(+t),l):e},l.size=function(t){if(!arguments.length)return[r,i];var n=Math.ceil(t[0]),e=Math.ceil(t[1]);if(!(n>=0||n>=0))throw new Error("invalid size");return r=n,i=e,_()},l.cellSize=function(t){if(!arguments.length)return 1<<o;if(!((t=+t)>=1))throw new Error("invalid cell size");return o=Math.floor(Math.log(t)/Math.LN2),_()},l.thresholds=function(t){return arguments.length?(s="function"==typeof t?t:Array.isArray(t)?zu(Pu.call(t)):zu(t),l):s},l.bandwidth=function(t){if(!arguments.length)return Math.sqrt(u*(u+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return u=Math.round((Math.sqrt(4*t*t+1)-1)/2),_()},l},Ku=function(t){return function(){return t}};function Gu(t,n,e,r,i,u,o,a,c,f){this.target=t,this.type=n,this.subject=e,this.identifier=r,this.active=i,this.x=u,this.y=o,this.dx=a,this.dy=c,this._=f}function Wu(){return!fn.ctrlKey&&!fn.button}function $u(){return this.parentNode}function Zu(t){return null==t?{x:fn.x,y:fn.y}:t}function Qu(){return navigator.maxTouchPoints||"ontouchstart"in this}Gu.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var Ju=function(){var t,n,e,r,i=Wu,u=$u,o=Zu,a=Qu,c={},f=st("start","drag","end"),s=0,l=0;function h(t){t.on("mousedown.drag",d).filter(a).on("touchstart.drag",_).on("touchmove.drag",v).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(){if(!r&&i.apply(this,arguments)){var o=m("mouse",u.apply(this,arguments),Pe,this,arguments);o&&(Mn(fn.view).on("mousemove.drag",p,!0).on("mouseup.drag",g,!0),An(fn.view),Tn(),e=!1,t=fn.clientX,n=fn.clientY,o("start"))}}function p(){if(kn(),!e){var r=fn.clientX-t,i=fn.clientY-n;e=r*r+i*i>l}c.mouse("drag")}function g(){Mn(fn.view).on("mousemove.drag mouseup.drag",null),Nn(fn.view,e),kn(),c.mouse("end")}function _(){if(i.apply(this,arguments)){var t,n,e=fn.changedTouches,r=u.apply(this,arguments),o=e.length;for(t=0;t<o;++t)(n=m(e[t].identifier,r,Ve,this,arguments))&&(Tn(),n("start"))}}function v(){var t,n,e=fn.changedTouches,r=e.length;for(t=0;t<r;++t)(n=c[e[t].identifier])&&(kn(),n("drag"))}function y(){var t,n,e=fn.changedTouches,i=e.length;for(r&&clearTimeout(r),r=setTimeout((function(){r=null}),500),t=0;t<i;++t)(n=c[e[t].identifier])&&(Tn(),n("end"))}function m(t,n,e,r,i){var u,a,l,d=e(n,t),p=f.copy();if(gn(new Gu(h,"beforestart",u,t,s,d[0],d[1],0,0,p),(function(){return null!=(fn.subject=u=o.apply(r,i))&&(a=u.x-d[0]||0,l=u.y-d[1]||0,!0)})))return function o(f){var g,_=d;switch(f){case"start":c[t]=o,g=s++;break;case"end":delete c[t],--s;case"drag":d=e(n,t),g=s}gn(new Gu(h,f,u,t,g,d[0]+a,d[1]+l,d[0]-_[0],d[1]-_[1],p),p.apply,p,[f,r,i])}}return h.filter=function(t){return arguments.length?(i="function"==typeof t?t:Ku(!!t),h):i},h.container=function(t){return arguments.length?(u="function"==typeof t?t:Ku(t),h):u},h.subject=function(t){return arguments.length?(o="function"==typeof t?t:Ku(t),h):o},h.touchable=function(t){return arguments.length?(a="function"==typeof t?t:Ku(!!t),h):a},h.on=function(){var t=f.on.apply(f,arguments);return t===f?h:t},h.clickDistance=function(t){return arguments.length?(l=(t=+t)*t,h):Math.sqrt(l)},h},to={},no={};function eo(t){return new Function("d","return {"+t.map((function(t,n){return JSON.stringify(t)+": d["+n+\'] || ""\'})).join(",")+"}")}function ro(t){var n=Object.create(null),e=[];return t.forEach((function(t){for(var r in t)r in n||e.push(n[r]=r)})),e}function io(t,n){var e=t+"",r=e.length;return r<n?new Array(n-r+1).join(0)+e:e}function uo(t){var n,e=t.getUTCHours(),r=t.getUTCMinutes(),i=t.getUTCSeconds(),u=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((n=t.getUTCFullYear())<0?"-"+io(-n,6):n>9999?"+"+io(n,6):io(n,4))+"-"+io(t.getUTCMonth()+1,2)+"-"+io(t.getUTCDate(),2)+(u?"T"+io(e,2)+":"+io(r,2)+":"+io(i,2)+"."+io(u,3)+"Z":i?"T"+io(e,2)+":"+io(r,2)+":"+io(i,2)+"Z":r||e?"T"+io(e,2)+":"+io(r,2)+"Z":"")}var oo=function(t){var n=new RegExp(\'["\'+t+"\\n\\r]"),e=t.charCodeAt(0);function r(t,n){var r,i=[],u=t.length,o=0,a=0,c=u<=0,f=!1;function s(){if(c)return no;if(f)return f=!1,to;var n,r,i=o;if(34===t.charCodeAt(i)){for(;o++<u&&34!==t.charCodeAt(o)||34===t.charCodeAt(++o););return(n=o)>=u?c=!0:10===(r=t.charCodeAt(o++))?f=!0:13===r&&(f=!0,10===t.charCodeAt(o)&&++o),t.slice(i+1,n-1).replace(/""/g,\'"\')}for(;o<u;){if(10===(r=t.charCodeAt(n=o++)))f=!0;else if(13===r)f=!0,10===t.charCodeAt(o)&&++o;else if(r!==e)continue;return t.slice(i,n)}return c=!0,t.slice(i,u)}for(10===t.charCodeAt(u-1)&&--u,13===t.charCodeAt(u-1)&&--u;(r=s())!==no;){for(var l=[];r!==to&&r!==no;)l.push(r),r=s();n&&null==(l=n(l,a++))||i.push(l)}return i}function i(n,e){return n.map((function(n){return e.map((function(t){return o(n[t])})).join(t)}))}function u(n){return n.map(o).join(t)}function o(t){return null==t?"":t instanceof Date?uo(t):n.test(t+="")?\'"\'+t.replace(/"/g,\'""\')+\'"\':t}return{parse:function(t,n){var e,i,u=r(t,(function(t,r){if(e)return e(t,r-1);i=t,e=n?function(t,n){var e=eo(t);return function(r,i){return n(e(r),i,t)}}(t,n):eo(t)}));return u.columns=i||[],u},parseRows:r,format:function(n,e){return null==e&&(e=ro(n)),[e.map(o).join(t)].concat(i(n,e)).join("\\n")},formatBody:function(t,n){return null==n&&(n=ro(t)),i(t,n).join("\\n")},formatRows:function(t){return t.map(u).join("\\n")},formatRow:u,formatValue:o}},ao=oo(","),co=ao.parse,fo=ao.parseRows,so=ao.format,lo=ao.formatBody,ho=ao.formatRows,po=ao.formatRow,go=ao.formatValue,_o=oo("\\t"),vo=_o.parse,yo=_o.parseRows,mo=_o.format,bo=_o.formatBody,xo=_o.formatRows,wo=_o.formatRow,Mo=_o.formatValue;function To(t){for(var n in t){var e,r,i=t[n].trim();if(i)if("true"===i)i=!0;else if("false"===i)i=!1;else if("NaN"===i)i=NaN;else if(isNaN(e=+i)){if(!(r=i.match(/^([-+]\\d{2})?\\d{4}(-\\d{2}(-\\d{2})?)?(T\\d{2}:\\d{2}(:\\d{2}(\\.\\d{3})?)?(Z|[-+]\\d{2}:\\d{2})?)?$/)))continue;ko&&r[4]&&!r[7]&&(i=i.replace(/-/g,"/").replace(/T/," ")),i=new Date(i)}else i=e;else i=null;t[n]=i}return t}var ko=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours();function Ao(t){return+t}function No(t){return t*t}function Co(t){return t*(2-t)}function So(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}var Eo=function t(n){function e(t){return Math.pow(t,n)}return n=+n,e.exponent=t,e}(3),Vo=function t(n){function e(t){return 1-Math.pow(1-t,n)}return n=+n,e.exponent=t,e}(3),Po=function t(n){function e(t){return((t*=2)<=1?Math.pow(t,n):2-Math.pow(2-t,n))/2}return n=+n,e.exponent=t,e}(3),Do=Math.PI,zo=Do/2;function Ro(t){return 1-Math.cos(t*zo)}function Lo(t){return Math.sin(t*zo)}function Yo(t){return(1-Math.cos(Do*t))/2}function Uo(t){return Math.pow(2,10*t-10)}function Bo(t){return 1-Math.pow(2,-10*t)}function Io(t){return((t*=2)<=1?Math.pow(2,10*t-10):2-Math.pow(2,10-10*t))/2}function Oo(t){return 1-Math.sqrt(1-t*t)}function Fo(t){return Math.sqrt(1- --t*t)}function qo(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}function Xo(t){return 1-jo(1-t)}function jo(t){return(t=+t)<4/11?7.5625*t*t:t<8/11?7.5625*(t-=6/11)*t+.75:t<10/11?7.5625*(t-=9/11)*t+.9375:7.5625*(t-=21/22)*t+63/64}function Ho(t){return((t*=2)<=1?1-jo(1-t):jo(t-1)+1)/2}var Ko=function t(n){function e(t){return t*t*((n+1)*t-n)}return n=+n,e.overshoot=t,e}(1.70158),Go=function t(n){function e(t){return--t*t*((n+1)*t+n)+1}return n=+n,e.overshoot=t,e}(1.70158),Wo=function t(n){function e(t){return((t*=2)<1?t*t*((n+1)*t-n):(t-=2)*t*((n+1)*t+n)+2)/2}return n=+n,e.overshoot=t,e}(1.70158),$o=2*Math.PI,Zo=function t(n,e){var r=Math.asin(1/(n=Math.max(1,n)))*(e/=$o);function i(t){return n*Math.pow(2,10*--t)*Math.sin((r-t)/e)}return i.amplitude=function(n){return t(n,e*$o)},i.period=function(e){return t(n,e)},i}(1,.3),Qo=function t(n,e){var r=Math.asin(1/(n=Math.max(1,n)))*(e/=$o);function i(t){return 1-n*Math.pow(2,-10*(t=+t))*Math.sin((t+r)/e)}return i.amplitude=function(n){return t(n,e*$o)},i.period=function(e){return t(n,e)},i}(1,.3),Jo=function t(n,e){var r=Math.asin(1/(n=Math.max(1,n)))*(e/=$o);function i(t){return((t=2*t-1)<0?n*Math.pow(2,10*t)*Math.sin((r-t)/e):2-n*Math.pow(2,-10*t)*Math.sin((r+t)/e))/2}return i.amplitude=function(n){return t(n,e*$o)},i.period=function(e){return t(n,e)},i}(1,.3);function ta(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.blob()}var na=function(t,n){return fetch(t,n).then(ta)};function ea(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.arrayBuffer()}var ra=function(t,n){return fetch(t,n).then(ea)};function ia(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}var ua=function(t,n){return fetch(t,n).then(ia)};function oa(t){return function(n,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=void 0),ua(n,e).then((function(n){return t(n,r)}))}}function aa(t,n,e,r){3===arguments.length&&"function"==typeof e&&(r=e,e=void 0);var i=oo(t);return ua(n,e).then((function(t){return i.parse(t,r)}))}var ca=oa(co),fa=oa(vo),sa=function(t,n){return new Promise((function(e,r){var i=new Image;for(var u in n)i[u]=n[u];i.onerror=r,i.onload=function(){e(i)},i.src=t}))};function la(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.json()}var ha=function(t,n){return fetch(t,n).then(la)};function da(t){return function(n,e){return ua(n,e).then((function(n){return(new DOMParser).parseFromString(n,t)}))}}var pa=da("application/xml"),ga=da("text/html"),_a=da("image/svg+xml"),va=function(t,n){var e;function r(){var r,i,u=e.length,o=0,a=0;for(r=0;r<u;++r)o+=(i=e[r]).x,a+=i.y;for(o=o/u-t,a=a/u-n,r=0;r<u;++r)(i=e[r]).x-=o,i.y-=a}return null==t&&(t=0),null==n&&(n=0),r.initialize=function(t){e=t},r.x=function(n){return arguments.length?(t=+n,r):t},r.y=function(t){return arguments.length?(n=+t,r):n},r},ya=function(t){return function(){return t}},ma=function(){return 1e-6*(Math.random()-.5)};function ba(t,n,e,r){if(isNaN(n)||isNaN(e))return t;var i,u,o,a,c,f,s,l,h,d=t._root,p={data:r},g=t._x0,_=t._y0,v=t._x1,y=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((f=n>=(u=(g+v)/2))?g=u:v=u,(s=e>=(o=(_+y)/2))?_=o:y=o,i=d,!(d=d[l=s<<1|f]))return i[l]=p,t;if(a=+t._x.call(null,d.data),c=+t._y.call(null,d.data),n===a&&e===c)return p.next=d,i?i[l]=p:t._root=p,t;do{i=i?i[l]=new Array(4):t._root=new Array(4),(f=n>=(u=(g+v)/2))?g=u:v=u,(s=e>=(o=(_+y)/2))?_=o:y=o}while((l=s<<1|f)==(h=(c>=o)<<1|a>=u));return i[h]=d,i[l]=p,t}var xa=function(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i};function wa(t){return t[0]}function Ma(t){return t[1]}function Ta(t,n,e){var r=new ka(null==n?wa:n,null==e?Ma:e,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function ka(t,n,e,r,i,u){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=u,this._root=void 0}function Aa(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}var Na=Ta.prototype=ka.prototype;function Ca(t){return t.x+t.vx}function Sa(t){return t.y+t.vy}Na.copy=function(){var t,n,e=new ka(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=Aa(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=Aa(n));return e},Na.add=function(t){var n=+this._x.call(null,t),e=+this._y.call(null,t);return ba(this.cover(n,e),n,e,t)},Na.addAll=function(t){var n,e,r,i,u=t.length,o=new Array(u),a=new Array(u),c=1/0,f=1/0,s=-1/0,l=-1/0;for(e=0;e<u;++e)isNaN(r=+this._x.call(null,n=t[e]))||isNaN(i=+this._y.call(null,n))||(o[e]=r,a[e]=i,r<c&&(c=r),r>s&&(s=r),i<f&&(f=i),i>l&&(l=i));if(c>s||f>l)return this;for(this.cover(c,f).cover(s,l),e=0;e<u;++e)ba(this,o[e],a[e],t[e]);return this},Na.cover=function(t,n){if(isNaN(t=+t)||isNaN(n=+n))return this;var e=this._x0,r=this._y0,i=this._x1,u=this._y1;if(isNaN(e))i=(e=Math.floor(t))+1,u=(r=Math.floor(n))+1;else{for(var o,a,c=i-e,f=this._root;e>t||t>=i||r>n||n>=u;)switch(a=(n<r)<<1|t<e,(o=new Array(4))[a]=f,f=o,c*=2,a){case 0:i=e+c,u=r+c;break;case 1:e=i-c,u=r+c;break;case 2:i=e+c,r=u-c;break;case 3:e=i-c,r=u-c}this._root&&this._root.length&&(this._root=f)}return this._x0=e,this._y0=r,this._x1=i,this._y1=u,this},Na.data=function(){var t=[];return this.visit((function(n){if(!n.length)do{t.push(n.data)}while(n=n.next)})),t},Na.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},Na.find=function(t,n,e){var r,i,u,o,a,c,f,s=this._x0,l=this._y0,h=this._x1,d=this._y1,p=[],g=this._root;for(g&&p.push(new xa(g,s,l,h,d)),null==e?e=1/0:(s=t-e,l=n-e,h=t+e,d=n+e,e*=e);c=p.pop();)if(!(!(g=c.node)||(i=c.x0)>h||(u=c.y0)>d||(o=c.x1)<s||(a=c.y1)<l))if(g.length){var _=(i+o)/2,v=(u+a)/2;p.push(new xa(g[3],_,v,o,a),new xa(g[2],i,v,_,a),new xa(g[1],_,u,o,v),new xa(g[0],i,u,_,v)),(f=(n>=v)<<1|t>=_)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-f],p[p.length-1-f]=c)}else{var y=t-+this._x.call(null,g.data),m=n-+this._y.call(null,g.data),b=y*y+m*m;if(b<e){var x=Math.sqrt(e=b);s=t-x,l=n-x,h=t+x,d=n+x,r=g.data}}return r},Na.remove=function(t){if(isNaN(u=+this._x.call(null,t))||isNaN(o=+this._y.call(null,t)))return this;var n,e,r,i,u,o,a,c,f,s,l,h,d=this._root,p=this._x0,g=this._y0,_=this._x1,v=this._y1;if(!d)return this;if(d.length)for(;;){if((f=u>=(a=(p+_)/2))?p=a:_=a,(s=o>=(c=(g+v)/2))?g=c:v=c,n=d,!(d=d[l=s<<1|f]))return this;if(!d.length)break;(n[l+1&3]||n[l+2&3]||n[l+3&3])&&(e=n,h=l)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):n?(i?n[l]=i:delete n[l],(d=n[0]||n[1]||n[2]||n[3])&&d===(n[3]||n[2]||n[1]||n[0])&&!d.length&&(e?e[h]=d:this._root=d),this):(this._root=i,this)},Na.removeAll=function(t){for(var n=0,e=t.length;n<e;++n)this.remove(t[n]);return this},Na.root=function(){return this._root},Na.size=function(){var t=0;return this.visit((function(n){if(!n.length)do{++t}while(n=n.next)})),t},Na.visit=function(t){var n,e,r,i,u,o,a=[],c=this._root;for(c&&a.push(new xa(c,this._x0,this._y0,this._x1,this._y1));n=a.pop();)if(!t(c=n.node,r=n.x0,i=n.y0,u=n.x1,o=n.y1)&&c.length){var f=(r+u)/2,s=(i+o)/2;(e=c[3])&&a.push(new xa(e,f,s,u,o)),(e=c[2])&&a.push(new xa(e,r,s,f,o)),(e=c[1])&&a.push(new xa(e,f,i,u,s)),(e=c[0])&&a.push(new xa(e,r,i,f,s))}return this},Na.visitAfter=function(t){var n,e=[],r=[];for(this._root&&e.push(new xa(this._root,this._x0,this._y0,this._x1,this._y1));n=e.pop();){var i=n.node;if(i.length){var u,o=n.x0,a=n.y0,c=n.x1,f=n.y1,s=(o+c)/2,l=(a+f)/2;(u=i[0])&&e.push(new xa(u,o,a,s,l)),(u=i[1])&&e.push(new xa(u,s,a,c,l)),(u=i[2])&&e.push(new xa(u,o,l,s,f)),(u=i[3])&&e.push(new xa(u,s,l,c,f))}r.push(n)}for(;n=r.pop();)t(n.node,n.x0,n.y0,n.x1,n.y1);return this},Na.x=function(t){return arguments.length?(this._x=t,this):this._x},Na.y=function(t){return arguments.length?(this._y=t,this):this._y};var Ea=function(t){var n,e,r=1,i=1;function u(){for(var t,u,a,c,f,s,l,h=n.length,d=0;d<i;++d)for(u=Ta(n,Ca,Sa).visitAfter(o),t=0;t<h;++t)a=n[t],s=e[a.index],l=s*s,c=a.x+a.vx,f=a.y+a.vy,u.visit(p);function p(t,n,e,i,u){var o=t.data,h=t.r,d=s+h;if(!o)return n>c+d||i<c-d||e>f+d||u<f-d;if(o.index>a.index){var p=c-o.x-o.vx,g=f-o.y-o.vy,_=p*p+g*g;_<d*d&&(0===p&&(_+=(p=ma())*p),0===g&&(_+=(g=ma())*g),_=(d-(_=Math.sqrt(_)))/_*r,a.vx+=(p*=_)*(d=(h*=h)/(l+h)),a.vy+=(g*=_)*d,o.vx-=p*(d=1-d),o.vy-=g*d)}}}function o(t){if(t.data)return t.r=e[t.data.index];for(var n=t.r=0;n<4;++n)t[n]&&t[n].r>t.r&&(t.r=t[n].r)}function a(){if(n){var r,i,u=n.length;for(e=new Array(u),r=0;r<u;++r)i=n[r],e[i.index]=+t(i,r,n)}}return"function"!=typeof t&&(t=ya(null==t?1:+t)),u.initialize=function(t){n=t,a()},u.iterations=function(t){return arguments.length?(i=+t,u):i},u.strength=function(t){return arguments.length?(r=+t,u):r},u.radius=function(n){return arguments.length?(t="function"==typeof n?n:ya(+n),a(),u):t},u};function Va(t){return t.index}function Pa(t,n){var e=t.get(n);if(!e)throw new Error("missing: "+n);return e}var Da=function(t){var n,e,r,i,u,o=Va,a=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},c=ya(30),f=1;function s(r){for(var i=0,o=t.length;i<f;++i)for(var a,c,s,l,h,d,p,g=0;g<o;++g)c=(a=t[g]).source,l=(s=a.target).x+s.vx-c.x-c.vx||ma(),h=s.y+s.vy-c.y-c.vy||ma(),l*=d=((d=Math.sqrt(l*l+h*h))-e[g])/d*r*n[g],h*=d,s.vx-=l*(p=u[g]),s.vy-=h*p,c.vx+=l*(p=1-p),c.vy+=h*p}function l(){if(r){var a,c,f=r.length,s=t.length,l=Zi(r,o);for(a=0,i=new Array(f);a<s;++a)(c=t[a]).index=a,"object"!=typeof c.source&&(c.source=Pa(l,c.source)),"object"!=typeof c.target&&(c.target=Pa(l,c.target)),i[c.source.index]=(i[c.source.index]||0)+1,i[c.target.index]=(i[c.target.index]||0)+1;for(a=0,u=new Array(s);a<s;++a)c=t[a],u[a]=i[c.source.index]/(i[c.source.index]+i[c.target.index]);n=new Array(s),h(),e=new Array(s),d()}}function h(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+a(t[e],e,t)}function d(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+c(t[n],n,t)}return null==t&&(t=[]),s.initialize=function(t){r=t,l()},s.links=function(n){return arguments.length?(t=n,l(),s):t},s.id=function(t){return arguments.length?(o=t,s):o},s.iterations=function(t){return arguments.length?(f=+t,s):f},s.strength=function(t){return arguments.length?(a="function"==typeof t?t:ya(+t),h(),s):a},s.distance=function(t){return arguments.length?(c="function"==typeof t?t:ya(+t),d(),s):c},s};function za(t){return t.x}function Ra(t){return t.y}var La=Math.PI*(3-Math.sqrt(5)),Ya=function(t){var n,e=1,r=.001,i=1-Math.pow(r,1/300),u=0,o=.6,a=Zi(),c=Xe(s),f=st("tick","end");function s(){l(),f.call("tick",n),e<r&&(c.stop(),f.call("end",n))}function l(r){var c,f,s=t.length;void 0===r&&(r=1);for(var l=0;l<r;++l)for(e+=(u-e)*i,a.each((function(t){t(e)})),c=0;c<s;++c)null==(f=t[c]).fx?f.x+=f.vx*=o:(f.x=f.fx,f.vx=0),null==f.fy?f.y+=f.vy*=o:(f.y=f.fy,f.vy=0);return n}function h(){for(var n,e=0,r=t.length;e<r;++e){if((n=t[e]).index=e,null!=n.fx&&(n.x=n.fx),null!=n.fy&&(n.y=n.fy),isNaN(n.x)||isNaN(n.y)){var i=10*Math.sqrt(e),u=e*La;n.x=i*Math.cos(u),n.y=i*Math.sin(u)}(isNaN(n.vx)||isNaN(n.vy))&&(n.vx=n.vy=0)}}function d(n){return n.initialize&&n.initialize(t),n}return null==t&&(t=[]),h(),n={tick:l,restart:function(){return c.restart(s),n},stop:function(){return c.stop(),n},nodes:function(e){return arguments.length?(t=e,h(),a.each(d),n):t},alpha:function(t){return arguments.length?(e=+t,n):e},alphaMin:function(t){return arguments.length?(r=+t,n):r},alphaDecay:function(t){return arguments.length?(i=+t,n):+i},alphaTarget:function(t){return arguments.length?(u=+t,n):u},velocityDecay:function(t){return arguments.length?(o=1-t,n):1-o},force:function(t,e){return arguments.length>1?(null==e?a.remove(t):a.set(t,d(e)),n):a.get(t)},find:function(n,e,r){var i,u,o,a,c,f=0,s=t.length;for(null==r?r=1/0:r*=r,f=0;f<s;++f)(o=(i=n-(a=t[f]).x)*i+(u=e-a.y)*u)<r&&(c=a,r=o);return c},on:function(t,e){return arguments.length>1?(f.on(t,e),n):f.on(t)}}},Ua=function(){var t,n,e,r,i=ya(-30),u=1,o=1/0,a=.81;function c(r){var i,u=t.length,o=Ta(t,za,Ra).visitAfter(s);for(e=r,i=0;i<u;++i)n=t[i],o.visit(l)}function f(){if(t){var n,e,u=t.length;for(r=new Array(u),n=0;n<u;++n)e=t[n],r[e.index]=+i(e,n,t)}}function s(t){var n,e,i,u,o,a=0,c=0;if(t.length){for(i=u=o=0;o<4;++o)(n=t[o])&&(e=Math.abs(n.value))&&(a+=n.value,c+=e,i+=e*n.x,u+=e*n.y);t.x=i/c,t.y=u/c}else{(n=t).x=n.data.x,n.y=n.data.y;do{a+=r[n.data.index]}while(n=n.next)}t.value=a}function l(t,i,c,f){if(!t.value)return!0;var s=t.x-n.x,l=t.y-n.y,h=f-i,d=s*s+l*l;if(h*h/a<d)return d<o&&(0===s&&(d+=(s=ma())*s),0===l&&(d+=(l=ma())*l),d<u&&(d=Math.sqrt(u*d)),n.vx+=s*t.value*e/d,n.vy+=l*t.value*e/d),!0;if(!(t.length||d>=o)){(t.data!==n||t.next)&&(0===s&&(d+=(s=ma())*s),0===l&&(d+=(l=ma())*l),d<u&&(d=Math.sqrt(u*d)));do{t.data!==n&&(h=r[t.data.index]*e/d,n.vx+=s*h,n.vy+=l*h)}while(t=t.next)}}return c.initialize=function(n){t=n,f()},c.strength=function(t){return arguments.length?(i="function"==typeof t?t:ya(+t),f(),c):i},c.distanceMin=function(t){return arguments.length?(u=t*t,c):Math.sqrt(u)},c.distanceMax=function(t){return arguments.length?(o=t*t,c):Math.sqrt(o)},c.theta=function(t){return arguments.length?(a=t*t,c):Math.sqrt(a)},c},Ba=function(t,n,e){var r,i,u,o=ya(.1);function a(t){for(var o=0,a=r.length;o<a;++o){var c=r[o],f=c.x-n||1e-6,s=c.y-e||1e-6,l=Math.sqrt(f*f+s*s),h=(u[o]-l)*i[o]*t/l;c.vx+=f*h,c.vy+=s*h}}function c(){if(r){var n,e=r.length;for(i=new Array(e),u=new Array(e),n=0;n<e;++n)u[n]=+t(r[n],n,r),i[n]=isNaN(u[n])?0:+o(r[n],n,r)}}return"function"!=typeof t&&(t=ya(+t)),null==n&&(n=0),null==e&&(e=0),a.initialize=function(t){r=t,c()},a.strength=function(t){return arguments.length?(o="function"==typeof t?t:ya(+t),c(),a):o},a.radius=function(n){return arguments.length?(t="function"==typeof n?n:ya(+n),c(),a):t},a.x=function(t){return arguments.length?(n=+t,a):n},a.y=function(t){return arguments.length?(e=+t,a):e},a},Ia=function(t){var n,e,r,i=ya(.1);function u(t){for(var i,u=0,o=n.length;u<o;++u)(i=n[u]).vx+=(r[u]-i.x)*e[u]*t}function o(){if(n){var u,o=n.length;for(e=new Array(o),r=new Array(o),u=0;u<o;++u)e[u]=isNaN(r[u]=+t(n[u],u,n))?0:+i(n[u],u,n)}}return"function"!=typeof t&&(t=ya(null==t?0:+t)),u.initialize=function(t){n=t,o()},u.strength=function(t){return arguments.length?(i="function"==typeof t?t:ya(+t),o(),u):i},u.x=function(n){return arguments.length?(t="function"==typeof n?n:ya(+n),o(),u):t},u},Oa=function(t){var n,e,r,i=ya(.1);function u(t){for(var i,u=0,o=n.length;u<o;++u)(i=n[u]).vy+=(r[u]-i.y)*e[u]*t}function o(){if(n){var u,o=n.length;for(e=new Array(o),r=new Array(o),u=0;u<o;++u)e[u]=isNaN(r[u]=+t(n[u],u,n))?0:+i(n[u],u,n)}}return"function"!=typeof t&&(t=ya(null==t?0:+t)),u.initialize=function(t){n=t,o()},u.strength=function(t){return arguments.length?(i="function"==typeof t?t:ya(+t),o(),u):i},u.y=function(n){return arguments.length?(t="function"==typeof n?n:ya(+n),o(),u):t},u},Fa=function(t,n){if((e=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"))<0)return null;var e,r=t.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+t.slice(e+1)]},qa=function(t){return(t=Fa(Math.abs(t)))?t[1]:NaN},Xa=/^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;function ja(t){if(!(n=Xa.exec(t)))throw new Error("invalid format: "+t);var n;return new Ha({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}function Ha(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}ja.prototype=Ha.prototype,Ha.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Ka,Ga,Wa,$a,Za=function(t,n){var e=Fa(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},Qa={"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return Za(100*t,n)},r:Za,s:function(t,n){var e=Fa(t,n);if(!e)return t+"";var r=e[0],i=e[1],u=i-(Ka=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return u===o?r:u>o?r+new Array(u-o+1).join("0"):u>0?r.slice(0,u)+"."+r.slice(u):"0."+new Array(1-u).join("0")+Fa(t,Math.max(0,n+u-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},Ja=function(t){return t},tc=Array.prototype.map,nc=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],ec=function(t){var n,e,r=void 0===t.grouping||void 0===t.thousands?Ja:(n=tc.call(t.grouping,Number),e=t.thousands+"",function(t,r){for(var i=t.length,u=[],o=0,a=n[0],c=0;i>0&&a>0&&(c+a+1>r&&(a=Math.max(1,r-c)),u.push(t.substring(i-=a,i+a)),!((c+=a+1)>r));)a=n[o=(o+1)%n.length];return u.reverse().join(e)}),i=void 0===t.currency?"":t.currency[0]+"",u=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",a=void 0===t.numerals?Ja:function(t){return function(n){return n.replace(/[0-9]/g,(function(n){return t[+n]}))}}(tc.call(t.numerals,String)),c=void 0===t.percent?"%":t.percent+"",f=void 0===t.minus?"-":t.minus+"",s=void 0===t.nan?"NaN":t.nan+"";function l(t){var n=(t=ja(t)).fill,e=t.align,l=t.sign,h=t.symbol,d=t.zero,p=t.width,g=t.comma,_=t.precision,v=t.trim,y=t.type;"n"===y?(g=!0,y="g"):Qa[y]||(void 0===_&&(_=12),v=!0,y="g"),(d||"0"===n&&"="===e)&&(d=!0,n="0",e="=");var m="$"===h?i:"#"===h&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",b="$"===h?u:/[%p]/.test(y)?c:"",x=Qa[y],w=/[defgprs%]/.test(y);function M(t){var i,u,c,h=m,M=b;if("c"===y)M=x(t)+M,t="";else{var T=(t=+t)<0;if(t=isNaN(t)?s:x(Math.abs(t),_),v&&(t=function(t){t:for(var n,e=t.length,r=1,i=-1;r<e;++r)switch(t[r]){case".":i=n=r;break;case"0":0===i&&(i=r),n=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(n+1):t}(t)),T&&0==+t&&(T=!1),h=(T?"("===l?l:f:"-"===l||"("===l?"":l)+h,M=("s"===y?nc[8+Ka/3]:"")+M+(T&&"("===l?")":""),w)for(i=-1,u=t.length;++i<u;)if(48>(c=t.charCodeAt(i))||c>57){M=(46===c?o+t.slice(i+1):t.slice(i))+M,t=t.slice(0,i);break}}g&&!d&&(t=r(t,1/0));var k=h.length+t.length+M.length,A=k<p?new Array(p-k+1).join(n):"";switch(g&&d&&(t=r(A+t,A.length?p-M.length:1/0),A=""),e){case"<":t=h+t+M+A;break;case"=":t=h+A+t+M;break;case"^":t=A.slice(0,k=A.length>>1)+h+t+M+A.slice(k);break;default:t=A+h+t+M}return a(t)}return _=void 0===_?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_)),M.toString=function(){return t+""},M}return{format:l,formatPrefix:function(t,n){var e=l(((t=ja(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(qa(n)/3))),i=Math.pow(10,-r),u=nc[8+r/3];return function(t){return e(i*t)+u}}}};function rc(t){return Ga=ec(t),Wa=Ga.format,$a=Ga.formatPrefix,Ga}rc({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});var ic=function(t){return Math.max(0,-qa(Math.abs(t)))},uc=function(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(qa(n)/3)))-qa(Math.abs(t)))},oc=function(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,qa(n)-qa(t))+1},ac=function(){return new cc};function cc(){this.reset()}cc.prototype={constructor:cc,reset:function(){this.s=this.t=0},add:function(t){sc(fc,t,this.t),sc(this,fc.s,this.s),this.s?this.t+=fc.t:this.s=fc.t},valueOf:function(){return this.s}};var fc=new cc;function sc(t,n,e){var r=t.s=n+e,i=r-n,u=r-i;t.t=n-u+(e-i)}var lc=Math.PI,hc=lc/2,dc=lc/4,pc=2*lc,gc=180/lc,_c=lc/180,vc=Math.abs,yc=Math.atan,mc=Math.atan2,bc=Math.cos,xc=Math.ceil,wc=Math.exp,Mc=(Math.floor,Math.log),Tc=Math.pow,kc=Math.sin,Ac=Math.sign||function(t){return t>0?1:t<0?-1:0},Nc=Math.sqrt,Cc=Math.tan;function Sc(t){return t>1?0:t<-1?lc:Math.acos(t)}function Ec(t){return t>1?hc:t<-1?-hc:Math.asin(t)}function Vc(t){return(t=kc(t/2))*t}function Pc(){}function Dc(t,n){t&&Rc.hasOwnProperty(t.type)&&Rc[t.type](t,n)}var zc={Feature:function(t,n){Dc(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r<i;)Dc(e[r].geometry,n)}},Rc={Sphere:function(t,n){n.sphere()},Point:function(t,n){t=t.coordinates,n.point(t[0],t[1],t[2])},MultiPoint:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)t=e[r],n.point(t[0],t[1],t[2])},LineString:function(t,n){Lc(t.coordinates,n,0)},MultiLineString:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)Lc(e[r],n,0)},Polygon:function(t,n){Yc(t.coordinates,n)},MultiPolygon:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)Yc(e[r],n)},GeometryCollection:function(t,n){for(var e=t.geometries,r=-1,i=e.length;++r<i;)Dc(e[r],n)}};function Lc(t,n,e){var r,i=-1,u=t.length-e;for(n.lineStart();++i<u;)r=t[i],n.point(r[0],r[1],r[2]);n.lineEnd()}function Yc(t,n){var e=-1,r=t.length;for(n.polygonStart();++e<r;)Lc(t[e],n,1);n.polygonEnd()}var Uc,Bc,Ic,Oc,Fc,qc=function(t,n){t&&zc.hasOwnProperty(t.type)?zc[t.type](t,n):Dc(t,n)},Xc=ac(),jc=ac(),Hc={point:Pc,lineStart:Pc,lineEnd:Pc,polygonStart:function(){Xc.reset(),Hc.lineStart=Kc,Hc.lineEnd=Gc},polygonEnd:function(){var t=+Xc;jc.add(t<0?pc+t:t),this.lineStart=this.lineEnd=this.point=Pc},sphere:function(){jc.add(pc)}};function Kc(){Hc.point=Wc}function Gc(){$c(Uc,Bc)}function Wc(t,n){Hc.point=$c,Uc=t,Bc=n,Ic=t*=_c,Oc=bc(n=(n*=_c)/2+dc),Fc=kc(n)}function $c(t,n){var e=(t*=_c)-Ic,r=e>=0?1:-1,i=r*e,u=bc(n=(n*=_c)/2+dc),o=kc(n),a=Fc*o,c=Oc*u+a*bc(i),f=a*r*kc(i);Xc.add(mc(f,c)),Ic=t,Oc=u,Fc=o}var Zc=function(t){return jc.reset(),qc(t,Hc),2*jc};function Qc(t){return[mc(t[1],t[0]),Ec(t[2])]}function Jc(t){var n=t[0],e=t[1],r=bc(e);return[r*bc(n),r*kc(n),kc(e)]}function tf(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function nf(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function ef(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function rf(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function uf(t){var n=Nc(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}var of,af,cf,ff,sf,lf,hf,df,pf,gf,_f=ac(),vf={point:yf,lineStart:bf,lineEnd:xf,polygonStart:function(){vf.point=wf,vf.lineStart=Mf,vf.lineEnd=Tf,_f.reset(),Hc.polygonStart()},polygonEnd:function(){Hc.polygonEnd(),vf.point=yf,vf.lineStart=bf,vf.lineEnd=xf,Xc<0?(of=-(cf=180),af=-(ff=90)):_f>1e-6?ff=90:_f<-1e-6&&(af=-90),gf[0]=of,gf[1]=cf},sphere:function(){of=-(cf=180),af=-(ff=90)}};function yf(t,n){pf.push(gf=[of=t,cf=t]),n<af&&(af=n),n>ff&&(ff=n)}function mf(t,n){var e=Jc([t*_c,n*_c]);if(df){var r=nf(df,e),i=nf([r[1],-r[0],0],r);uf(i),i=Qc(i);var u,o=t-sf,a=o>0?1:-1,c=i[0]*gc*a,f=vc(o)>180;f^(a*sf<c&&c<a*t)?(u=i[1]*gc)>ff&&(ff=u):f^(a*sf<(c=(c+360)%360-180)&&c<a*t)?(u=-i[1]*gc)<af&&(af=u):(n<af&&(af=n),n>ff&&(ff=n)),f?t<sf?kf(of,t)>kf(of,cf)&&(cf=t):kf(t,cf)>kf(of,cf)&&(of=t):cf>=of?(t<of&&(of=t),t>cf&&(cf=t)):t>sf?kf(of,t)>kf(of,cf)&&(cf=t):kf(t,cf)>kf(of,cf)&&(of=t)}else pf.push(gf=[of=t,cf=t]);n<af&&(af=n),n>ff&&(ff=n),df=e,sf=t}function bf(){vf.point=mf}function xf(){gf[0]=of,gf[1]=cf,vf.point=yf,df=null}function wf(t,n){if(df){var e=t-sf;_f.add(vc(e)>180?e+(e>0?360:-360):e)}else lf=t,hf=n;Hc.point(t,n),mf(t,n)}function Mf(){Hc.lineStart()}function Tf(){wf(lf,hf),Hc.lineEnd(),vc(_f)>1e-6&&(of=-(cf=180)),gf[0]=of,gf[1]=cf,df=null}function kf(t,n){return(n-=t)<0?n+360:n}function Af(t,n){return t[0]-n[0]}function Nf(t,n){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:n<t[0]||t[1]<n}var Cf,Sf,Ef,Vf,Pf,Df,zf,Rf,Lf,Yf,Uf,Bf,If,Of,Ff,qf,Xf=function(t){var n,e,r,i,u,o,a;if(ff=cf=-(of=af=1/0),pf=[],qc(t,vf),e=pf.length){for(pf.sort(Af),n=1,u=[r=pf[0]];n<e;++n)Nf(r,(i=pf[n])[0])||Nf(r,i[1])?(kf(r[0],i[1])>kf(r[0],r[1])&&(r[1]=i[1]),kf(i[0],r[1])>kf(r[0],r[1])&&(r[0]=i[0])):u.push(r=i);for(o=-1/0,n=0,r=u[e=u.length-1];n<=e;r=i,++n)i=u[n],(a=kf(r[1],i[0]))>o&&(o=a,of=i[0],cf=r[1])}return pf=gf=null,of===1/0||af===1/0?[[NaN,NaN],[NaN,NaN]]:[[of,af],[cf,ff]]},jf={sphere:Pc,point:Hf,lineStart:Gf,lineEnd:Zf,polygonStart:function(){jf.lineStart=Qf,jf.lineEnd=Jf},polygonEnd:function(){jf.lineStart=Gf,jf.lineEnd=Zf}};function Hf(t,n){t*=_c;var e=bc(n*=_c);Kf(e*bc(t),e*kc(t),kc(n))}function Kf(t,n,e){++Cf,Ef+=(t-Ef)/Cf,Vf+=(n-Vf)/Cf,Pf+=(e-Pf)/Cf}function Gf(){jf.point=Wf}function Wf(t,n){t*=_c;var e=bc(n*=_c);Of=e*bc(t),Ff=e*kc(t),qf=kc(n),jf.point=$f,Kf(Of,Ff,qf)}function $f(t,n){t*=_c;var e=bc(n*=_c),r=e*bc(t),i=e*kc(t),u=kc(n),o=mc(Nc((o=Ff*u-qf*i)*o+(o=qf*r-Of*u)*o+(o=Of*i-Ff*r)*o),Of*r+Ff*i+qf*u);Sf+=o,Df+=o*(Of+(Of=r)),zf+=o*(Ff+(Ff=i)),Rf+=o*(qf+(qf=u)),Kf(Of,Ff,qf)}function Zf(){jf.point=Hf}function Qf(){jf.point=ts}function Jf(){ns(Bf,If),jf.point=Hf}function ts(t,n){Bf=t,If=n,t*=_c,n*=_c,jf.point=ns;var e=bc(n);Of=e*bc(t),Ff=e*kc(t),qf=kc(n),Kf(Of,Ff,qf)}function ns(t,n){t*=_c;var e=bc(n*=_c),r=e*bc(t),i=e*kc(t),u=kc(n),o=Ff*u-qf*i,a=qf*r-Of*u,c=Of*i-Ff*r,f=Nc(o*o+a*a+c*c),s=Ec(f),l=f&&-s/f;Lf+=l*o,Yf+=l*a,Uf+=l*c,Sf+=s,Df+=s*(Of+(Of=r)),zf+=s*(Ff+(Ff=i)),Rf+=s*(qf+(qf=u)),Kf(Of,Ff,qf)}var es=function(t){Cf=Sf=Ef=Vf=Pf=Df=zf=Rf=Lf=Yf=Uf=0,qc(t,jf);var n=Lf,e=Yf,r=Uf,i=n*n+e*e+r*r;return i<1e-12&&(n=Df,e=zf,r=Rf,Sf<1e-6&&(n=Ef,e=Vf,r=Pf),(i=n*n+e*e+r*r)<1e-12)?[NaN,NaN]:[mc(e,n)*gc,Ec(r/Nc(i))*gc]},rs=function(t){return function(){return t}},is=function(t,n){function e(e,r){return e=t(e,r),n(e[0],e[1])}return t.invert&&n.invert&&(e.invert=function(e,r){return(e=n.invert(e,r))&&t.invert(e[0],e[1])}),e};function us(t,n){return[vc(t)>lc?t+Math.round(-t/pc)*pc:t,n]}function os(t,n,e){return(t%=pc)?n||e?is(cs(t),fs(n,e)):cs(t):n||e?fs(n,e):us}function as(t){return function(n,e){return[(n+=t)>lc?n-pc:n<-lc?n+pc:n,e]}}function cs(t){var n=as(t);return n.invert=as(-t),n}function fs(t,n){var e=bc(t),r=kc(t),i=bc(n),u=kc(n);function o(t,n){var o=bc(n),a=bc(t)*o,c=kc(t)*o,f=kc(n),s=f*e+a*r;return[mc(c*i-s*u,a*e-f*r),Ec(s*i+c*u)]}return o.invert=function(t,n){var o=bc(n),a=bc(t)*o,c=kc(t)*o,f=kc(n),s=f*i-c*u;return[mc(c*i+f*u,a*e+s*r),Ec(s*e-a*r)]},o}us.invert=us;var ss=function(t){function n(n){return(n=t(n[0]*_c,n[1]*_c))[0]*=gc,n[1]*=gc,n}return t=os(t[0]*_c,t[1]*_c,t.length>2?t[2]*_c:0),n.invert=function(n){return(n=t.invert(n[0]*_c,n[1]*_c))[0]*=gc,n[1]*=gc,n},n};function ls(t,n,e,r,i,u){if(e){var o=bc(n),a=kc(n),c=r*e;null==i?(i=n+r*pc,u=n-c/2):(i=hs(o,i),u=hs(o,u),(r>0?i<u:i>u)&&(i+=r*pc));for(var f,s=i;r>0?s>u:s<u;s-=c)f=Qc([o,-a*bc(s),-a*kc(s)]),t.point(f[0],f[1])}}function hs(t,n){(n=Jc(n))[0]-=t,uf(n);var e=Sc(-n[1]);return((-n[2]<0?-e:e)+pc-1e-6)%pc}var ds=function(){var t,n,e=rs([0,0]),r=rs(90),i=rs(6),u={point:function(e,r){t.push(e=n(e,r)),e[0]*=gc,e[1]*=gc}};function o(){var o=e.apply(this,arguments),a=r.apply(this,arguments)*_c,c=i.apply(this,arguments)*_c;return t=[],n=os(-o[0]*_c,-o[1]*_c,0).invert,ls(u,a,c,1),o={type:"Polygon",coordinates:[t]},t=n=null,o}return o.center=function(t){return arguments.length?(e="function"==typeof t?t:rs([+t[0],+t[1]]),o):e},o.radius=function(t){return arguments.length?(r="function"==typeof t?t:rs(+t),o):r},o.precision=function(t){return arguments.length?(i="function"==typeof t?t:rs(+t),o):i},o},ps=function(){var t,n=[];return{point:function(n,e){t.push([n,e])},lineStart:function(){n.push(t=[])},lineEnd:Pc,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}},gs=function(t,n){return vc(t[0]-n[0])<1e-6&&vc(t[1]-n[1])<1e-6};function _s(t,n,e,r){this.x=t,this.z=n,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}var vs=function(t,n,e,r,i){var u,o,a=[],c=[];if(t.forEach((function(t){if(!((n=t.length-1)<=0)){var n,e,r=t[0],o=t[n];if(gs(r,o)){for(i.lineStart(),u=0;u<n;++u)i.point((r=t[u])[0],r[1]);i.lineEnd()}else a.push(e=new _s(r,t,null,!0)),c.push(e.o=new _s(r,null,e,!1)),a.push(e=new _s(o,t,null,!1)),c.push(e.o=new _s(o,null,e,!0))}})),a.length){for(c.sort(n),ys(a),ys(c),u=0,o=c.length;u<o;++u)c[u].e=e=!e;for(var f,s,l=a[0];;){for(var h=l,d=!0;h.v;)if((h=h.n)===l)return;f=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(d)for(u=0,o=f.length;u<o;++u)i.point((s=f[u])[0],s[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(d)for(f=h.p.z,u=f.length-1;u>=0;--u)i.point((s=f[u])[0],s[1]);else r(h.x,h.p.x,-1,i);h=h.p}f=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}};function ys(t){if(n=t.length){for(var n,e,r=0,i=t[0];++r<n;)i.n=e=t[r],e.p=i,i=e;i.n=e=t[0],e.p=i}}var ms=ac();function bs(t){return vc(t[0])<=lc?t[0]:Ac(t[0])*((vc(t[0])+lc)%pc-lc)}var xs=function(t,n){var e=bs(n),r=n[1],i=kc(r),u=[kc(e),-bc(e),0],o=0,a=0;ms.reset(),1===i?r=hc+1e-6:-1===i&&(r=-hc-1e-6);for(var c=0,f=t.length;c<f;++c)if(l=(s=t[c]).length)for(var s,l,h=s[l-1],d=bs(h),p=h[1]/2+dc,g=kc(p),_=bc(p),v=0;v<l;++v,d=m,g=x,_=w,h=y){var y=s[v],m=bs(y),b=y[1]/2+dc,x=kc(b),w=bc(b),M=m-d,T=M>=0?1:-1,k=T*M,A=k>lc,N=g*x;if(ms.add(mc(N*T*kc(k),_*w+N*bc(k))),o+=A?M+T*pc:M,A^d>=e^m>=e){var C=nf(Jc(h),Jc(y));uf(C);var S=nf(u,C);uf(S);var E=(A^M>=0?-1:1)*Ec(S[2]);(r>E||r===E&&(C[0]||C[1]))&&(a+=A^M>=0?1:-1)}}return(o<-1e-6||o<1e-6&&ms<-1e-6)^1&a},ws=function(t,n,e,r){return function(i){var u,o,a,c=n(i),f=ps(),s=n(f),l=!1,h={point:d,lineStart:g,lineEnd:_,polygonStart:function(){h.point=v,h.lineStart=y,h.lineEnd=m,o=[],u=[]},polygonEnd:function(){h.point=d,h.lineStart=g,h.lineEnd=_,o=Y(o);var t=xs(u,r);o.length?(l||(i.polygonStart(),l=!0),vs(o,Ts,t,e,i)):t&&(l||(i.polygonStart(),l=!0),i.lineStart(),e(null,null,1,i),i.lineEnd()),l&&(i.polygonEnd(),l=!1),o=u=null},sphere:function(){i.polygonStart(),i.lineStart(),e(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function d(n,e){t(n,e)&&i.point(n,e)}function p(t,n){c.point(t,n)}function g(){h.point=p,c.lineStart()}function _(){h.point=d,c.lineEnd()}function v(t,n){a.push([t,n]),s.point(t,n)}function y(){s.lineStart(),a=[]}function m(){v(a[0][0],a[0][1]),s.lineEnd();var t,n,e,r,c=s.clean(),h=f.result(),d=h.length;if(a.pop(),u.push(a),a=null,d)if(1&c){if((n=(e=h[0]).length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),t=0;t<n;++t)i.point((r=e[t])[0],r[1]);i.lineEnd()}}else d>1&&2&c&&h.push(h.pop().concat(h.shift())),o.push(h.filter(Ms))}return h}};function Ms(t){return t.length>1}function Ts(t,n){return((t=t.x)[0]<0?t[1]-hc-1e-6:hc-t[1])-((n=n.x)[0]<0?n[1]-hc-1e-6:hc-n[1])}var ks=ws((function(){return!0}),(function(t){var n,e=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),n=1},point:function(u,o){var a=u>0?lc:-lc,c=vc(u-e);vc(c-lc)<1e-6?(t.point(e,r=(r+o)/2>0?hc:-hc),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),t.point(u,r),n=0):i!==a&&c>=lc&&(vc(e-i)<1e-6&&(e-=1e-6*i),vc(u-a)<1e-6&&(u-=1e-6*a),r=function(t,n,e,r){var i,u,o=kc(t-e);return vc(o)>1e-6?yc((kc(n)*(u=bc(r))*kc(e)-kc(r)*(i=bc(n))*kc(t))/(i*u*o)):(n+r)/2}(e,r,u,o),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),n=0),t.point(e=u,r=o),i=a},lineEnd:function(){t.lineEnd(),e=r=NaN},clean:function(){return 2-n}}}),(function(t,n,e,r){var i;if(null==t)i=e*hc,r.point(-lc,i),r.point(0,i),r.point(lc,i),r.point(lc,0),r.point(lc,-i),r.point(0,-i),r.point(-lc,-i),r.point(-lc,0),r.point(-lc,i);else if(vc(t[0]-n[0])>1e-6){var u=t[0]<n[0]?lc:-lc;i=e*u/2,r.point(-u,i),r.point(0,i),r.point(u,i)}else r.point(n[0],n[1])}),[-lc,-hc]);var As=function(t){var n=bc(t),e=6*_c,r=n>0,i=vc(n)>1e-6;function u(t,e){return bc(t)*bc(e)>n}function o(t,e,r){var i=[1,0,0],u=nf(Jc(t),Jc(e)),o=tf(u,u),a=u[0],c=o-a*a;if(!c)return!r&&t;var f=n*o/c,s=-n*a/c,l=nf(i,u),h=rf(i,f);ef(h,rf(u,s));var d=l,p=tf(h,d),g=tf(d,d),_=p*p-g*(tf(h,h)-1);if(!(_<0)){var v=Nc(_),y=rf(d,(-p-v)/g);if(ef(y,h),y=Qc(y),!r)return y;var m,b=t[0],x=e[0],w=t[1],M=e[1];x<b&&(m=b,b=x,x=m);var T=x-b,k=vc(T-lc)<1e-6;if(!k&&M<w&&(m=w,w=M,M=m),k||T<1e-6?k?w+M>0^y[1]<(vc(y[0]-b)<1e-6?w:M):w<=y[1]&&y[1]<=M:T>lc^(b<=y[0]&&y[0]<=x)){var A=rf(d,(-p+v)/g);return ef(A,h),[y,Qc(A)]}}}function a(n,e){var i=r?t:lc-t,u=0;return n<-i?u|=1:n>i&&(u|=2),e<-i?u|=4:e>i&&(u|=8),u}return ws(u,(function(t){var n,e,c,f,s;return{lineStart:function(){f=c=!1,s=1},point:function(l,h){var d,p=[l,h],g=u(l,h),_=r?g?0:a(l,h):g?a(l+(l<0?lc:-lc),h):0;if(!n&&(f=c=g)&&t.lineStart(),g!==c&&(!(d=o(n,p))||gs(n,d)||gs(p,d))&&(p[0]+=1e-6,p[1]+=1e-6,g=u(p[0],p[1])),g!==c)s=0,g?(t.lineStart(),d=o(p,n),t.point(d[0],d[1])):(d=o(n,p),t.point(d[0],d[1]),t.lineEnd()),n=d;else if(i&&n&&r^g){var v;_&e||!(v=o(p,n,!0))||(s=0,r?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!g||n&&gs(n,p)||t.point(p[0],p[1]),n=p,c=g,e=_},lineEnd:function(){c&&t.lineEnd(),n=null},clean:function(){return s|(f&&c)<<1}}}),(function(n,r,i,u){ls(u,t,e,i,n,r)}),r?[0,-t]:[-lc,t-lc])};function Ns(t,n,e,r){function i(i,u){return t<=i&&i<=e&&n<=u&&u<=r}function u(i,u,a,f){var s=0,l=0;if(null==i||(s=o(i,a))!==(l=o(u,a))||c(i,u)<0^a>0)do{f.point(0===s||3===s?t:e,s>1?r:n)}while((s=(s+a+4)%4)!==l);else f.point(u[0],u[1])}function o(r,i){return vc(r[0]-t)<1e-6?i>0?0:3:vc(r[0]-e)<1e-6?i>0?2:1:vc(r[1]-n)<1e-6?i>0?1:0:i>0?3:2}function a(t,n){return c(t.x,n.x)}function c(t,n){var e=o(t,1),r=o(n,1);return e!==r?e-r:0===e?n[1]-t[1]:1===e?t[0]-n[0]:2===e?t[1]-n[1]:n[0]-t[0]}return function(o){var c,f,s,l,h,d,p,g,_,v,y,m=o,b=ps(),x={point:w,lineStart:function(){x.point=M,f&&f.push(s=[]);v=!0,_=!1,p=g=NaN},lineEnd:function(){c&&(M(l,h),d&&_&&b.rejoin(),c.push(b.result()));x.point=w,_&&m.lineEnd()},polygonStart:function(){m=b,c=[],f=[],y=!0},polygonEnd:function(){var n=function(){for(var n=0,e=0,i=f.length;e<i;++e)for(var u,o,a=f[e],c=1,s=a.length,l=a[0],h=l[0],d=l[1];c<s;++c)u=h,o=d,l=a[c],h=l[0],d=l[1],o<=r?d>r&&(h-u)*(r-o)>(d-o)*(t-u)&&++n:d<=r&&(h-u)*(r-o)<(d-o)*(t-u)&&--n;return n}(),e=y&&n,i=(c=Y(c)).length;(e||i)&&(o.polygonStart(),e&&(o.lineStart(),u(null,null,1,o),o.lineEnd()),i&&vs(c,a,n,u,o),o.polygonEnd());m=o,c=f=s=null}};function w(t,n){i(t,n)&&m.point(t,n)}function M(u,o){var a=i(u,o);if(f&&s.push([u,o]),v)l=u,h=o,d=a,v=!1,a&&(m.lineStart(),m.point(u,o));else if(a&&_)m.point(u,o);else{var c=[p=Math.max(-1e9,Math.min(1e9,p)),g=Math.max(-1e9,Math.min(1e9,g))],b=[u=Math.max(-1e9,Math.min(1e9,u)),o=Math.max(-1e9,Math.min(1e9,o))];!function(t,n,e,r,i,u){var o,a=t[0],c=t[1],f=0,s=1,l=n[0]-a,h=n[1]-c;if(o=e-a,l||!(o>0)){if(o/=l,l<0){if(o<f)return;o<s&&(s=o)}else if(l>0){if(o>s)return;o>f&&(f=o)}if(o=i-a,l||!(o<0)){if(o/=l,l<0){if(o>s)return;o>f&&(f=o)}else if(l>0){if(o<f)return;o<s&&(s=o)}if(o=r-c,h||!(o>0)){if(o/=h,h<0){if(o<f)return;o<s&&(s=o)}else if(h>0){if(o>s)return;o>f&&(f=o)}if(o=u-c,h||!(o<0)){if(o/=h,h<0){if(o>s)return;o>f&&(f=o)}else if(h>0){if(o<f)return;o<s&&(s=o)}return f>0&&(t[0]=a+f*l,t[1]=c+f*h),s<1&&(n[0]=a+s*l,n[1]=c+s*h),!0}}}}}(c,b,t,n,e,r)?a&&(m.lineStart(),m.point(u,o),y=!1):(_||(m.lineStart(),m.point(c[0],c[1])),m.point(b[0],b[1]),a||m.lineEnd(),y=!1)}p=u,g=o,_=a}return x}}var Cs,Ss,Es,Vs=function(){var t,n,e,r=0,i=0,u=960,o=500;return e={stream:function(e){return t&&n===e?t:t=Ns(r,i,u,o)(n=e)},extent:function(a){return arguments.length?(r=+a[0][0],i=+a[0][1],u=+a[1][0],o=+a[1][1],t=n=null,e):[[r,i],[u,o]]}}},Ps=ac(),Ds={sphere:Pc,point:Pc,lineStart:function(){Ds.point=Rs,Ds.lineEnd=zs},lineEnd:Pc,polygonStart:Pc,polygonEnd:Pc};function zs(){Ds.point=Ds.lineEnd=Pc}function Rs(t,n){Cs=t*=_c,Ss=kc(n*=_c),Es=bc(n),Ds.point=Ls}function Ls(t,n){t*=_c;var e=kc(n*=_c),r=bc(n),i=vc(t-Cs),u=bc(i),o=r*kc(i),a=Es*e-Ss*r*u,c=Ss*e+Es*r*u;Ps.add(mc(Nc(o*o+a*a),c)),Cs=t,Ss=e,Es=r}var Ys=function(t){return Ps.reset(),qc(t,Ds),+Ps},Us=[null,null],Bs={type:"LineString",coordinates:Us},Is=function(t,n){return Us[0]=t,Us[1]=n,Ys(Bs)},Os={Feature:function(t,n){return qs(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r<i;)if(qs(e[r].geometry,n))return!0;return!1}},Fs={Sphere:function(){return!0},Point:function(t,n){return Xs(t.coordinates,n)},MultiPoint:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)if(Xs(e[r],n))return!0;return!1},LineString:function(t,n){return js(t.coordinates,n)},MultiLineString:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)if(js(e[r],n))return!0;return!1},Polygon:function(t,n){return Hs(t.coordinates,n)},MultiPolygon:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)if(Hs(e[r],n))return!0;return!1},GeometryCollection:function(t,n){for(var e=t.geometries,r=-1,i=e.length;++r<i;)if(qs(e[r],n))return!0;return!1}};function qs(t,n){return!(!t||!Fs.hasOwnProperty(t.type))&&Fs[t.type](t,n)}function Xs(t,n){return 0===Is(t,n)}function js(t,n){for(var e,r,i,u=0,o=t.length;u<o;u++){if(0===(r=Is(t[u],n)))return!0;if(u>0&&(i=Is(t[u],t[u-1]))>0&&e<=i&&r<=i&&(e+r-i)*(1-Math.pow((e-r)/i,2))<1e-12*i)return!0;e=r}return!1}function Hs(t,n){return!!xs(t.map(Ks),Gs(n))}function Ks(t){return(t=t.map(Gs)).pop(),t}function Gs(t){return[t[0]*_c,t[1]*_c]}var Ws=function(t,n){return(t&&Os.hasOwnProperty(t.type)?Os[t.type]:qs)(t,n)};function $s(t,n,e){var r=w(t,n-1e-6,e).concat(n);return function(t){return r.map((function(n){return[t,n]}))}}function Zs(t,n,e){var r=w(t,n-1e-6,e).concat(n);return function(t){return r.map((function(n){return[n,t]}))}}function Qs(){var t,n,e,r,i,u,o,a,c,f,s,l,h=10,d=h,p=90,g=360,_=2.5;function v(){return{type:"MultiLineString",coordinates:y()}}function y(){return w(xc(r/p)*p,e,p).map(s).concat(w(xc(a/g)*g,o,g).map(l)).concat(w(xc(n/h)*h,t,h).filter((function(t){return vc(t%p)>1e-6})).map(c)).concat(w(xc(u/d)*d,i,d).filter((function(t){return vc(t%g)>1e-6})).map(f))}return v.lines=function(){return y().map((function(t){return{type:"LineString",coordinates:t}}))},v.outline=function(){return{type:"Polygon",coordinates:[s(r).concat(l(o).slice(1),s(e).reverse().slice(1),l(a).reverse().slice(1))]}},v.extent=function(t){return arguments.length?v.extentMajor(t).extentMinor(t):v.extentMinor()},v.extentMajor=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],a=+t[0][1],o=+t[1][1],r>e&&(t=r,r=e,e=t),a>o&&(t=a,a=o,o=t),v.precision(_)):[[r,a],[e,o]]},v.extentMinor=function(e){return arguments.length?(n=+e[0][0],t=+e[1][0],u=+e[0][1],i=+e[1][1],n>t&&(e=n,n=t,t=e),u>i&&(e=u,u=i,i=e),v.precision(_)):[[n,u],[t,i]]},v.step=function(t){return arguments.length?v.stepMajor(t).stepMinor(t):v.stepMinor()},v.stepMajor=function(t){return arguments.length?(p=+t[0],g=+t[1],v):[p,g]},v.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],v):[h,d]},v.precision=function(h){return arguments.length?(_=+h,c=$s(u,i,90),f=Zs(n,t,_),s=$s(a,o,90),l=Zs(r,e,_),v):_},v.extentMajor([[-180,1e-6-90],[180,90-1e-6]]).extentMinor([[-180,-80-1e-6],[180,80+1e-6]])}function Js(){return Qs()()}var tl,nl,el,rl,il=function(t,n){var e=t[0]*_c,r=t[1]*_c,i=n[0]*_c,u=n[1]*_c,o=bc(r),a=kc(r),c=bc(u),f=kc(u),s=o*bc(e),l=o*kc(e),h=c*bc(i),d=c*kc(i),p=2*Ec(Nc(Vc(u-r)+o*c*Vc(i-e))),g=kc(p),_=p?function(t){var n=kc(t*=p)/g,e=kc(p-t)/g,r=e*s+n*h,i=e*l+n*d,u=e*a+n*f;return[mc(i,r)*gc,mc(u,Nc(r*r+i*i))*gc]}:function(){return[e*gc,r*gc]};return _.distance=p,_},ul=function(t){return t},ol=ac(),al=ac(),cl={point:Pc,lineStart:Pc,lineEnd:Pc,polygonStart:function(){cl.lineStart=fl,cl.lineEnd=hl},polygonEnd:function(){cl.lineStart=cl.lineEnd=cl.point=Pc,ol.add(vc(al)),al.reset()},result:function(){var t=ol/2;return ol.reset(),t}};function fl(){cl.point=sl}function sl(t,n){cl.point=ll,tl=el=t,nl=rl=n}function ll(t,n){al.add(rl*t-el*n),el=t,rl=n}function hl(){ll(tl,nl)}var dl=cl,pl=1/0,gl=pl,_l=-pl,vl=_l;var yl,ml,bl,xl,wl={point:function(t,n){t<pl&&(pl=t);t>_l&&(_l=t);n<gl&&(gl=n);n>vl&&(vl=n)},lineStart:Pc,lineEnd:Pc,polygonStart:Pc,polygonEnd:Pc,result:function(){var t=[[pl,gl],[_l,vl]];return _l=vl=-(gl=pl=1/0),t}},Ml=0,Tl=0,kl=0,Al=0,Nl=0,Cl=0,Sl=0,El=0,Vl=0,Pl={point:Dl,lineStart:zl,lineEnd:Yl,polygonStart:function(){Pl.lineStart=Ul,Pl.lineEnd=Bl},polygonEnd:function(){Pl.point=Dl,Pl.lineStart=zl,Pl.lineEnd=Yl},result:function(){var t=Vl?[Sl/Vl,El/Vl]:Cl?[Al/Cl,Nl/Cl]:kl?[Ml/kl,Tl/kl]:[NaN,NaN];return Ml=Tl=kl=Al=Nl=Cl=Sl=El=Vl=0,t}};function Dl(t,n){Ml+=t,Tl+=n,++kl}function zl(){Pl.point=Rl}function Rl(t,n){Pl.point=Ll,Dl(bl=t,xl=n)}function Ll(t,n){var e=t-bl,r=n-xl,i=Nc(e*e+r*r);Al+=i*(bl+t)/2,Nl+=i*(xl+n)/2,Cl+=i,Dl(bl=t,xl=n)}function Yl(){Pl.point=Dl}function Ul(){Pl.point=Il}function Bl(){Ol(yl,ml)}function Il(t,n){Pl.point=Ol,Dl(yl=bl=t,ml=xl=n)}function Ol(t,n){var e=t-bl,r=n-xl,i=Nc(e*e+r*r);Al+=i*(bl+t)/2,Nl+=i*(xl+n)/2,Cl+=i,Sl+=(i=xl*t-bl*n)*(bl+t),El+=i*(xl+n),Vl+=3*i,Dl(bl=t,xl=n)}var Fl=Pl;function ql(t){this._context=t}ql.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._context.moveTo(t,n),this._point=1;break;case 1:this._context.lineTo(t,n);break;default:this._context.moveTo(t+this._radius,n),this._context.arc(t,n,this._radius,0,pc)}},result:Pc};var Xl,jl,Hl,Kl,Gl,Wl=ac(),$l={point:Pc,lineStart:function(){$l.point=Zl},lineEnd:function(){Xl&&Ql(jl,Hl),$l.point=Pc},polygonStart:function(){Xl=!0},polygonEnd:function(){Xl=null},result:function(){var t=+Wl;return Wl.reset(),t}};function Zl(t,n){$l.point=Ql,jl=Kl=t,Hl=Gl=n}function Ql(t,n){Kl-=t,Gl-=n,Wl.add(Nc(Kl*Kl+Gl*Gl)),Kl=t,Gl=n}var Jl=$l;function th(){this._string=[]}function nh(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}th.prototype={_radius:4.5,_circle:nh(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._string.push("M",t,",",n),this._point=1;break;case 1:this._string.push("L",t,",",n);break;default:null==this._circle&&(this._circle=nh(this._radius)),this._string.push("M",t,",",n,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var eh=function(t,n){var e,r,i=4.5;function u(t){return t&&("function"==typeof i&&r.pointRadius(+i.apply(this,arguments)),qc(t,e(r))),r.result()}return u.area=function(t){return qc(t,e(dl)),dl.result()},u.measure=function(t){return qc(t,e(Jl)),Jl.result()},u.bounds=function(t){return qc(t,e(wl)),wl.result()},u.centroid=function(t){return qc(t,e(Fl)),Fl.result()},u.projection=function(n){return arguments.length?(e=null==n?(t=null,ul):(t=n).stream,u):t},u.context=function(t){return arguments.length?(r=null==t?(n=null,new th):new ql(n=t),"function"!=typeof i&&r.pointRadius(i),u):n},u.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(r.pointRadius(+t),+t),u):i},u.projection(t).context(n)},rh=function(t){return{stream:ih(t)}};function ih(t){return function(n){var e=new uh;for(var r in t)e[r]=t[r];return e.stream=n,e}}function uh(){}function oh(t,n,e){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),qc(e,t.stream(wl)),n(wl.result()),null!=r&&t.clipExtent(r),t}function ah(t,n,e){return oh(t,(function(e){var r=n[1][0]-n[0][0],i=n[1][1]-n[0][1],u=Math.min(r/(e[1][0]-e[0][0]),i/(e[1][1]-e[0][1])),o=+n[0][0]+(r-u*(e[1][0]+e[0][0]))/2,a=+n[0][1]+(i-u*(e[1][1]+e[0][1]))/2;t.scale(150*u).translate([o,a])}),e)}function ch(t,n,e){return ah(t,[[0,0],n],e)}function fh(t,n,e){return oh(t,(function(e){var r=+n,i=r/(e[1][0]-e[0][0]),u=(r-i*(e[1][0]+e[0][0]))/2,o=-i*e[0][1];t.scale(150*i).translate([u,o])}),e)}function sh(t,n,e){return oh(t,(function(e){var r=+n,i=r/(e[1][1]-e[0][1]),u=-i*e[0][0],o=(r-i*(e[1][1]+e[0][1]))/2;t.scale(150*i).translate([u,o])}),e)}uh.prototype={constructor:uh,point:function(t,n){this.stream.point(t,n)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var lh=bc(30*_c),hh=function(t,n){return+n?function(t,n){function e(r,i,u,o,a,c,f,s,l,h,d,p,g,_){var v=f-r,y=s-i,m=v*v+y*y;if(m>4*n&&g--){var b=o+h,x=a+d,w=c+p,M=Nc(b*b+x*x+w*w),T=Ec(w/=M),k=vc(vc(w)-1)<1e-6||vc(u-l)<1e-6?(u+l)/2:mc(x,b),A=t(k,T),N=A[0],C=A[1],S=N-r,E=C-i,V=y*S-v*E;(V*V/m>n||vc((v*S+y*E)/m-.5)>.3||o*h+a*d+c*p<lh)&&(e(r,i,u,o,a,c,N,C,k,b/=M,x/=M,w,g,_),_.point(N,C),e(N,C,k,b,x,w,f,s,l,h,d,p,g,_))}}return function(n){var r,i,u,o,a,c,f,s,l,h,d,p,g={point:_,lineStart:v,lineEnd:m,polygonStart:function(){n.polygonStart(),g.lineStart=b},polygonEnd:function(){n.polygonEnd(),g.lineStart=v}};function _(e,r){e=t(e,r),n.point(e[0],e[1])}function v(){s=NaN,g.point=y,n.lineStart()}function y(r,i){var u=Jc([r,i]),o=t(r,i);e(s,l,f,h,d,p,s=o[0],l=o[1],f=r,h=u[0],d=u[1],p=u[2],16,n),n.point(s,l)}function m(){g.point=_,n.lineEnd()}function b(){v(),g.point=x,g.lineEnd=w}function x(t,n){y(r=t,n),i=s,u=l,o=h,a=d,c=p,g.point=y}function w(){e(s,l,f,h,d,p,i,u,r,o,a,c,16,n),g.lineEnd=m,m()}return g}}(t,n):function(t){return ih({point:function(n,e){n=t(n,e),this.stream.point(n[0],n[1])}})}(t)};var dh=ih({point:function(t,n){this.stream.point(t*_c,n*_c)}});function ph(t,n,e){function r(r,i){return[n+t*r,e-t*i]}return r.invert=function(r,i){return[(r-n)/t,(e-i)/t]},r}function gh(t,n,e,r){var i=bc(r),u=kc(r),o=i*t,a=u*t,c=i/t,f=u/t,s=(u*e-i*n)/t,l=(u*n+i*e)/t;function h(t,r){return[o*t-a*r+n,e-a*t-o*r]}return h.invert=function(t,n){return[c*t-f*n+s,l-f*t-c*n]},h}function _h(t){return vh((function(){return t}))()}function vh(t){var n,e,r,i,u,o,a,c,f,s,l=150,h=480,d=250,p=0,g=0,_=0,v=0,y=0,m=0,b=null,x=ks,w=null,M=ul,T=.5;function k(t){return c(t[0]*_c,t[1]*_c)}function A(t){return(t=c.invert(t[0],t[1]))&&[t[0]*gc,t[1]*gc]}function N(){var t=gh(l,0,0,m).apply(null,n(p,g)),r=(m?gh:ph)(l,h-t[0],d-t[1],m);return e=os(_,v,y),a=is(n,r),c=is(e,a),o=hh(a,T),C()}function C(){return f=s=null,k}return k.stream=function(t){return f&&s===t?f:f=dh(function(t){return ih({point:function(n,e){var r=t(n,e);return this.stream.point(r[0],r[1])}})}(e)(x(o(M(s=t)))))},k.preclip=function(t){return arguments.length?(x=t,b=void 0,C()):x},k.postclip=function(t){return arguments.length?(M=t,w=r=i=u=null,C()):M},k.clipAngle=function(t){return arguments.length?(x=+t?As(b=t*_c):(b=null,ks),C()):b*gc},k.clipExtent=function(t){return arguments.length?(M=null==t?(w=r=i=u=null,ul):Ns(w=+t[0][0],r=+t[0][1],i=+t[1][0],u=+t[1][1]),C()):null==w?null:[[w,r],[i,u]]},k.scale=function(t){return arguments.length?(l=+t,N()):l},k.translate=function(t){return arguments.length?(h=+t[0],d=+t[1],N()):[h,d]},k.center=function(t){return arguments.length?(p=t[0]%360*_c,g=t[1]%360*_c,N()):[p*gc,g*gc]},k.rotate=function(t){return arguments.length?(_=t[0]%360*_c,v=t[1]%360*_c,y=t.length>2?t[2]%360*_c:0,N()):[_*gc,v*gc,y*gc]},k.angle=function(t){return arguments.length?(m=t%360*_c,N()):m*gc},k.precision=function(t){return arguments.length?(o=hh(a,T=t*t),C()):Nc(T)},k.fitExtent=function(t,n){return ah(k,t,n)},k.fitSize=function(t,n){return ch(k,t,n)},k.fitWidth=function(t,n){return fh(k,t,n)},k.fitHeight=function(t,n){return sh(k,t,n)},function(){return n=t.apply(this,arguments),k.invert=n.invert&&A,N()}}function yh(t){var n=0,e=lc/3,r=vh(t),i=r(n,e);return i.parallels=function(t){return arguments.length?r(n=t[0]*_c,e=t[1]*_c):[n*gc,e*gc]},i}function mh(t,n){var e=kc(t),r=(e+kc(n))/2;if(vc(r)<1e-6)return function(t){var n=bc(t);function e(t,e){return[t*n,kc(e)/n]}return e.invert=function(t,e){return[t/n,Ec(e*n)]},e}(t);var i=1+e*(2*r-e),u=Nc(i)/r;function o(t,n){var e=Nc(i-2*r*kc(n))/r;return[e*kc(t*=r),u-e*bc(t)]}return o.invert=function(t,n){var e=u-n;return[mc(t,vc(e))/r*Ac(e),Ec((i-(t*t+e*e)*r*r)/(2*r))]},o}var bh=function(){return yh(mh).scale(155.424).center([0,33.6442])},xh=function(){return bh().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])};var wh=function(){var t,n,e,r,i,u,o=xh(),a=bh().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=bh().rotate([157,0]).center([-3,19.9]).parallels([8,18]),f={point:function(t,n){u=[t,n]}};function s(t){var n=t[0],o=t[1];return u=null,e.point(n,o),u||(r.point(n,o),u)||(i.point(n,o),u)}function l(){return t=n=null,s}return s.invert=function(t){var n=o.scale(),e=o.translate(),r=(t[0]-e[0])/n,i=(t[1]-e[1])/n;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?a:i>=.166&&i<.234&&r>=-.214&&r<-.115?c:o).invert(t)},s.stream=function(e){return t&&n===e?t:(r=[o.stream(n=e),a.stream(e),c.stream(e)],i=r.length,t={point:function(t,n){for(var e=-1;++e<i;)r[e].point(t,n)},sphere:function(){for(var t=-1;++t<i;)r[t].sphere()},lineStart:function(){for(var t=-1;++t<i;)r[t].lineStart()},lineEnd:function(){for(var t=-1;++t<i;)r[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<i;)r[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<i;)r[t].polygonEnd()}});var r,i},s.precision=function(t){return arguments.length?(o.precision(t),a.precision(t),c.precision(t),l()):o.precision()},s.scale=function(t){return arguments.length?(o.scale(t),a.scale(.35*t),c.scale(t),s.translate(o.translate())):o.scale()},s.translate=function(t){if(!arguments.length)return o.translate();var n=o.scale(),u=+t[0],s=+t[1];return e=o.translate(t).clipExtent([[u-.455*n,s-.238*n],[u+.455*n,s+.238*n]]).stream(f),r=a.translate([u-.307*n,s+.201*n]).clipExtent([[u-.425*n+1e-6,s+.12*n+1e-6],[u-.214*n-1e-6,s+.234*n-1e-6]]).stream(f),i=c.translate([u-.205*n,s+.212*n]).clipExtent([[u-.214*n+1e-6,s+.166*n+1e-6],[u-.115*n-1e-6,s+.234*n-1e-6]]).stream(f),l()},s.fitExtent=function(t,n){return ah(s,t,n)},s.fitSize=function(t,n){return ch(s,t,n)},s.fitWidth=function(t,n){return fh(s,t,n)},s.fitHeight=function(t,n){return sh(s,t,n)},s.scale(1070)};function Mh(t){return function(n,e){var r=bc(n),i=bc(e),u=t(r*i);return[u*i*kc(n),u*kc(e)]}}function Th(t){return function(n,e){var r=Nc(n*n+e*e),i=t(r),u=kc(i),o=bc(i);return[mc(n*u,r*o),Ec(r&&e*u/r)]}}var kh=Mh((function(t){return Nc(2/(1+t))}));kh.invert=Th((function(t){return 2*Ec(t/2)}));var Ah=function(){return _h(kh).scale(124.75).clipAngle(179.999)},Nh=Mh((function(t){return(t=Sc(t))&&t/kc(t)}));Nh.invert=Th((function(t){return t}));var Ch=function(){return _h(Nh).scale(79.4188).clipAngle(179.999)};function Sh(t,n){return[t,Mc(Cc((hc+n)/2))]}Sh.invert=function(t,n){return[t,2*yc(wc(n))-hc]};var Eh=function(){return Vh(Sh).scale(961/pc)};function Vh(t){var n,e,r,i=_h(t),u=i.center,o=i.scale,a=i.translate,c=i.clipExtent,f=null;function s(){var u=lc*o(),a=i(ss(i.rotate()).invert([0,0]));return c(null==f?[[a[0]-u,a[1]-u],[a[0]+u,a[1]+u]]:t===Sh?[[Math.max(a[0]-u,f),n],[Math.min(a[0]+u,e),r]]:[[f,Math.max(a[1]-u,n)],[e,Math.min(a[1]+u,r)]])}return i.scale=function(t){return arguments.length?(o(t),s()):o()},i.translate=function(t){return arguments.length?(a(t),s()):a()},i.center=function(t){return arguments.length?(u(t),s()):u()},i.clipExtent=function(t){return arguments.length?(null==t?f=n=e=r=null:(f=+t[0][0],n=+t[0][1],e=+t[1][0],r=+t[1][1]),s()):null==f?null:[[f,n],[e,r]]},s()}function Ph(t){return Cc((hc+t)/2)}function Dh(t,n){var e=bc(t),r=t===n?kc(t):Mc(e/bc(n))/Mc(Ph(n)/Ph(t)),i=e*Tc(Ph(t),r)/r;if(!r)return Sh;function u(t,n){i>0?n<1e-6-hc&&(n=1e-6-hc):n>hc-1e-6&&(n=hc-1e-6);var e=i/Tc(Ph(n),r);return[e*kc(r*t),i-e*bc(r*t)]}return u.invert=function(t,n){var e=i-n,u=Ac(r)*Nc(t*t+e*e);return[mc(t,vc(e))/r*Ac(e),2*yc(Tc(i/u,1/r))-hc]},u}var zh=function(){return yh(Dh).scale(109.5).parallels([30,30])};function Rh(t,n){return[t,n]}Rh.invert=Rh;var Lh=function(){return _h(Rh).scale(152.63)};function Yh(t,n){var e=bc(t),r=t===n?kc(t):(e-bc(n))/(n-t),i=e/r+t;if(vc(r)<1e-6)return Rh;function u(t,n){var e=i-n,u=r*t;return[e*kc(u),i-e*bc(u)]}return u.invert=function(t,n){var e=i-n;return[mc(t,vc(e))/r*Ac(e),i-Ac(r)*Nc(t*t+e*e)]},u}var Uh=function(){return yh(Yh).scale(131.154).center([0,13.9389])},Bh=1.340264,Ih=-.081106,Oh=893e-6,Fh=.003796,qh=Nc(3)/2;function Xh(t,n){var e=Ec(qh*kc(n)),r=e*e,i=r*r*r;return[t*bc(e)/(qh*(Bh+3*Ih*r+i*(7*Oh+9*Fh*r))),e*(Bh+Ih*r+i*(Oh+Fh*r))]}Xh.invert=function(t,n){for(var e,r=n,i=r*r,u=i*i*i,o=0;o<12&&(u=(i=(r-=e=(r*(Bh+Ih*i+u*(Oh+Fh*i))-n)/(Bh+3*Ih*i+u*(7*Oh+9*Fh*i)))*r)*i*i,!(vc(e)<1e-12));++o);return[qh*t*(Bh+3*Ih*i+u*(7*Oh+9*Fh*i))/bc(r),Ec(kc(r)/qh)]};var jh=function(){return _h(Xh).scale(177.158)};function Hh(t,n){var e=bc(n),r=bc(t)*e;return[e*kc(t)/r,kc(n)/r]}Hh.invert=Th(yc);var Kh=function(){return _h(Hh).scale(144.049).clipAngle(60)};function Gh(t,n,e,r){return 1===t&&1===n&&0===e&&0===r?ul:ih({point:function(i,u){this.stream.point(i*t+e,u*n+r)}})}var Wh=function(){var t,n,e,r,i,u,o=1,a=0,c=0,f=1,s=1,l=ul,h=null,d=ul;function p(){return r=i=null,u}return u={stream:function(t){return r&&i===t?r:r=l(d(i=t))},postclip:function(r){return arguments.length?(d=r,h=t=n=e=null,p()):d},clipExtent:function(r){return arguments.length?(d=null==r?(h=t=n=e=null,ul):Ns(h=+r[0][0],t=+r[0][1],n=+r[1][0],e=+r[1][1]),p()):null==h?null:[[h,t],[n,e]]},scale:function(t){return arguments.length?(l=Gh((o=+t)*f,o*s,a,c),p()):o},translate:function(t){return arguments.length?(l=Gh(o*f,o*s,a=+t[0],c=+t[1]),p()):[a,c]},reflectX:function(t){return arguments.length?(l=Gh(o*(f=t?-1:1),o*s,a,c),p()):f<0},reflectY:function(t){return arguments.length?(l=Gh(o*f,o*(s=t?-1:1),a,c),p()):s<0},fitExtent:function(t,n){return ah(u,t,n)},fitSize:function(t,n){return ch(u,t,n)},fitWidth:function(t,n){return fh(u,t,n)},fitHeight:function(t,n){return sh(u,t,n)}}};function $h(t,n){var e=n*n,r=e*e;return[t*(.8707-.131979*e+r*(r*(.003971*e-.001529*r)-.013791)),n*(1.007226+e*(.015085+r*(.028874*e-.044475-.005916*r)))]}$h.invert=function(t,n){var e,r=n,i=25;do{var u=r*r,o=u*u;r-=e=(r*(1.007226+u*(.015085+o*(.028874*u-.044475-.005916*o)))-n)/(1.007226+u*(.045255+o*(.259866*u-.311325-.005916*11*o)))}while(vc(e)>1e-6&&--i>0);return[t/(.8707+(u=r*r)*(u*(u*u*u*(.003971-.001529*u)-.013791)-.131979)),r]};var Zh=function(){return _h($h).scale(175.295)};function Qh(t,n){return[bc(n)*kc(t),kc(n)]}Qh.invert=Th(Ec);var Jh=function(){return _h(Qh).scale(249.5).clipAngle(90+1e-6)};function td(t,n){var e=bc(n),r=1+bc(t)*e;return[e*kc(t)/r,kc(n)/r]}td.invert=Th((function(t){return 2*yc(t)}));var nd=function(){return _h(td).scale(250).clipAngle(142)};function ed(t,n){return[Mc(Cc((hc+n)/2)),-t]}ed.invert=function(t,n){return[-n,2*yc(wc(t))-hc]};var rd=function(){var t=Vh(ed),n=t.center,e=t.rotate;return t.center=function(t){return arguments.length?n([-t[1],t[0]]):[(t=n())[1],-t[0]]},t.rotate=function(t){return arguments.length?e([t[0],t[1],t.length>2?t[2]+90:90]):[(t=e())[0],t[1],t[2]-90]},e([0,0,90]).scale(159.155)};function id(t,n){return t.parent===n.parent?1:2}function ud(t,n){return t+n.x}function od(t,n){return Math.max(t,n.y)}var ad=function(){var t=id,n=1,e=1,r=!1;function i(i){var u,o=0;i.eachAfter((function(n){var e=n.children;e?(n.x=function(t){return t.reduce(ud,0)/t.length}(e),n.y=function(t){return 1+t.reduce(od,0)}(e)):(n.x=u?o+=t(n,u):0,n.y=0,u=n)}));var a=function(t){for(var n;n=t.children;)t=n[0];return t}(i),c=function(t){for(var n;n=t.children;)t=n[n.length-1];return t}(i),f=a.x-t(a,c)/2,s=c.x+t(c,a)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*n,t.y=(i.y-t.y)*e}:function(t){t.x=(t.x-f)/(s-f)*n,t.y=(1-(i.y?t.y/i.y:1))*e})}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i};function cd(t){var n=0,e=t.children,r=e&&e.length;if(r)for(;--r>=0;)n+=e[r].value;else n=1;t.value=n}function fd(t,n){var e,r,i,u,o,a=new dd(t),c=+t.value&&(a.value=t.value),f=[a];for(null==n&&(n=sd);e=f.pop();)if(c&&(e.value=+e.data.value),(i=n(e.data))&&(o=i.length))for(e.children=new Array(o),u=o-1;u>=0;--u)f.push(r=e.children[u]=new dd(i[u])),r.parent=e,r.depth=e.depth+1;return a.eachBefore(hd)}function sd(t){return t.children}function ld(t){t.data=t.data.data}function hd(t){var n=0;do{t.height=n}while((t=t.parent)&&t.height<++n)}function dd(t){this.data=t,this.depth=this.height=0,this.parent=null}dd.prototype=fd.prototype={constructor:dd,count:function(){return this.eachAfter(cd)},each:function(t){var n,e,r,i,u=this,o=[u];do{for(n=o.reverse(),o=[];u=n.pop();)if(t(u),e=u.children)for(r=0,i=e.length;r<i;++r)o.push(e[r])}while(o.length);return this},eachAfter:function(t){for(var n,e,r,i=this,u=[i],o=[];i=u.pop();)if(o.push(i),n=i.children)for(e=0,r=n.length;e<r;++e)u.push(n[e]);for(;i=o.pop();)t(i);return this},eachBefore:function(t){for(var n,e,r=this,i=[r];r=i.pop();)if(t(r),n=r.children)for(e=n.length-1;e>=0;--e)i.push(n[e]);return this},sum:function(t){return this.eachAfter((function(n){for(var e=+t(n.data)||0,r=n.children,i=r&&r.length;--i>=0;)e+=r[i].value;n.value=e}))},sort:function(t){return this.eachBefore((function(n){n.children&&n.children.sort(t)}))},path:function(t){for(var n=this,e=function(t,n){if(t===n)return t;var e=t.ancestors(),r=n.ancestors(),i=null;t=e.pop(),n=r.pop();for(;t===n;)i=t,t=e.pop(),n=r.pop();return i}(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var i=r.length;t!==e;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},descendants:function(){var t=[];return this.each((function(n){t.push(n)})),t},leaves:function(){var t=[];return this.eachBefore((function(n){n.children||t.push(n)})),t},links:function(){var t=this,n=[];return t.each((function(e){e!==t&&n.push({source:e.parent,target:e})})),n},copy:function(){return fd(this).eachBefore(ld)}};var pd=Array.prototype.slice;var gd=function(t){for(var n,e,r=0,i=(t=function(t){for(var n,e,r=t.length;r;)e=Math.random()*r--|0,n=t[r],t[r]=t[e],t[e]=n;return t}(pd.call(t))).length,u=[];r<i;)n=t[r],e&&yd(e,n)?++r:(e=bd(u=_d(u,n)),r=0);return e};function _d(t,n){var e,r;if(md(n,t))return[n];for(e=0;e<t.length;++e)if(vd(n,t[e])&&md(xd(t[e],n),t))return[t[e],n];for(e=0;e<t.length-1;++e)for(r=e+1;r<t.length;++r)if(vd(xd(t[e],t[r]),n)&&vd(xd(t[e],n),t[r])&&vd(xd(t[r],n),t[e])&&md(wd(t[e],t[r],n),t))return[t[e],t[r],n];throw new Error}function vd(t,n){var e=t.r-n.r,r=n.x-t.x,i=n.y-t.y;return e<0||e*e<r*r+i*i}function yd(t,n){var e=t.r-n.r+1e-6,r=n.x-t.x,i=n.y-t.y;return e>0&&e*e>r*r+i*i}function md(t,n){for(var e=0;e<n.length;++e)if(!yd(t,n[e]))return!1;return!0}function bd(t){switch(t.length){case 1:return{x:(n=t[0]).x,y:n.y,r:n.r};case 2:return xd(t[0],t[1]);case 3:return wd(t[0],t[1],t[2])}var n}function xd(t,n){var e=t.x,r=t.y,i=t.r,u=n.x,o=n.y,a=n.r,c=u-e,f=o-r,s=a-i,l=Math.sqrt(c*c+f*f);return{x:(e+u+c/l*s)/2,y:(r+o+f/l*s)/2,r:(l+i+a)/2}}function wd(t,n,e){var r=t.x,i=t.y,u=t.r,o=n.x,a=n.y,c=n.r,f=e.x,s=e.y,l=e.r,h=r-o,d=r-f,p=i-a,g=i-s,_=c-u,v=l-u,y=r*r+i*i-u*u,m=y-o*o-a*a+c*c,b=y-f*f-s*s+l*l,x=d*p-h*g,w=(p*b-g*m)/(2*x)-r,M=(g*_-p*v)/x,T=(d*m-h*b)/(2*x)-i,k=(h*v-d*_)/x,A=M*M+k*k-1,N=2*(u+w*M+T*k),C=w*w+T*T-u*u,S=-(A?(N+Math.sqrt(N*N-4*A*C))/(2*A):C/N);return{x:r+w+M*S,y:i+T+k*S,r:S}}function Md(t,n,e){var r,i,u,o,a=t.x-n.x,c=t.y-n.y,f=a*a+c*c;f?(i=n.r+e.r,i*=i,o=t.r+e.r,i>(o*=o)?(r=(f+o-i)/(2*f),u=Math.sqrt(Math.max(0,o/f-r*r)),e.x=t.x-r*a-u*c,e.y=t.y-r*c+u*a):(r=(f+i-o)/(2*f),u=Math.sqrt(Math.max(0,i/f-r*r)),e.x=n.x+r*a-u*c,e.y=n.y+r*c+u*a)):(e.x=n.x+e.r,e.y=n.y)}function Td(t,n){var e=t.r+n.r-1e-6,r=n.x-t.x,i=n.y-t.y;return e>0&&e*e>r*r+i*i}function kd(t){var n=t._,e=t.next._,r=n.r+e.r,i=(n.x*e.r+e.x*n.r)/r,u=(n.y*e.r+e.y*n.r)/r;return i*i+u*u}function Ad(t){this._=t,this.next=null,this.previous=null}function Nd(t){if(!(i=t.length))return 0;var n,e,r,i,u,o,a,c,f,s,l;if((n=t[0]).x=0,n.y=0,!(i>1))return n.r;if(e=t[1],n.x=-e.r,e.x=n.r,e.y=0,!(i>2))return n.r+e.r;Md(e,n,r=t[2]),n=new Ad(n),e=new Ad(e),r=new Ad(r),n.next=r.previous=e,e.next=n.previous=r,r.next=e.previous=n;t:for(a=3;a<i;++a){Md(n._,e._,r=t[a]),r=new Ad(r),c=e.next,f=n.previous,s=e._.r,l=n._.r;do{if(s<=l){if(Td(c._,r._)){e=c,n.next=e,e.previous=n,--a;continue t}s+=c._.r,c=c.next}else{if(Td(f._,r._)){(n=f).next=e,e.previous=n,--a;continue t}l+=f._.r,f=f.previous}}while(c!==f.next);for(r.previous=n,r.next=e,n.next=e.previous=e=r,u=kd(n);(r=r.next)!==e;)(o=kd(r))<u&&(n=r,u=o);e=n.next}for(n=[e._],r=e;(r=r.next)!==e;)n.push(r._);for(r=gd(n),a=0;a<i;++a)(n=t[a]).x-=r.x,n.y-=r.y;return r.r}var Cd=function(t){return Nd(t),t};function Sd(t){return null==t?null:Ed(t)}function Ed(t){if("function"!=typeof t)throw new Error;return t}function Vd(){return 0}var Pd=function(t){return function(){return t}};function Dd(t){return Math.sqrt(t.value)}var zd=function(){var t=null,n=1,e=1,r=Vd;function i(i){return i.x=n/2,i.y=e/2,t?i.eachBefore(Rd(t)).eachAfter(Ld(r,.5)).eachBefore(Yd(1)):i.eachBefore(Rd(Dd)).eachAfter(Ld(Vd,1)).eachAfter(Ld(r,i.r/Math.min(n,e))).eachBefore(Yd(Math.min(n,e)/(2*i.r))),i}return i.radius=function(n){return arguments.length?(t=Sd(n),i):t},i.size=function(t){return arguments.length?(n=+t[0],e=+t[1],i):[n,e]},i.padding=function(t){return arguments.length?(r="function"==typeof t?t:Pd(+t),i):r},i};function Rd(t){return function(n){n.children||(n.r=Math.max(0,+t(n)||0))}}function Ld(t,n){return function(e){if(r=e.children){var r,i,u,o=r.length,a=t(e)*n||0;if(a)for(i=0;i<o;++i)r[i].r+=a;if(u=Nd(r),a)for(i=0;i<o;++i)r[i].r-=a;e.r=u+a}}}function Yd(t){return function(n){var e=n.parent;n.r*=t,e&&(n.x=e.x+t*n.x,n.y=e.y+t*n.y)}}var Ud=function(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)},Bd=function(t,n,e,r,i){for(var u,o=t.children,a=-1,c=o.length,f=t.value&&(r-n)/t.value;++a<c;)(u=o[a]).y0=e,u.y1=i,u.x0=n,u.x1=n+=u.value*f},Id=function(){var t=1,n=1,e=0,r=!1;function i(i){var u=i.height+1;return i.x0=i.y0=e,i.x1=t,i.y1=n/u,i.eachBefore(function(t,n){return function(r){r.children&&Bd(r,r.x0,t*(r.depth+1)/n,r.x1,t*(r.depth+2)/n);var i=r.x0,u=r.y0,o=r.x1-e,a=r.y1-e;o<i&&(i=o=(i+o)/2),a<u&&(u=a=(u+a)/2),r.x0=i,r.y0=u,r.x1=o,r.y1=a}}(n,u)),r&&i.eachBefore(Ud),i}return i.round=function(t){return arguments.length?(r=!!t,i):r},i.size=function(e){return arguments.length?(t=+e[0],n=+e[1],i):[t,n]},i.padding=function(t){return arguments.length?(e=+t,i):e},i},Od={depth:-1},Fd={};function qd(t){return t.id}function Xd(t){return t.parentId}var jd=function(){var t=qd,n=Xd;function e(e){var r,i,u,o,a,c,f,s=e.length,l=new Array(s),h={};for(i=0;i<s;++i)r=e[i],a=l[i]=new dd(r),null!=(c=t(r,i,e))&&(c+="")&&(h[f="$"+(a.id=c)]=f in h?Fd:a);for(i=0;i<s;++i)if(a=l[i],null!=(c=n(e[i],i,e))&&(c+="")){if(!(o=h["$"+c]))throw new Error("missing: "+c);if(o===Fd)throw new Error("ambiguous: "+c);o.children?o.children.push(a):o.children=[a],a.parent=o}else{if(u)throw new Error("multiple roots");u=a}if(!u)throw new Error("no root");if(u.parent=Od,u.eachBefore((function(t){t.depth=t.parent.depth+1,--s})).eachBefore(hd),u.parent=null,s>0)throw new Error("cycle");return u}return e.id=function(n){return arguments.length?(t=Ed(n),e):t},e.parentId=function(t){return arguments.length?(n=Ed(t),e):n},e};function Hd(t,n){return t.parent===n.parent?1:2}function Kd(t){var n=t.children;return n?n[0]:t.t}function Gd(t){var n=t.children;return n?n[n.length-1]:t.t}function Wd(t,n,e){var r=e/(n.i-t.i);n.c-=r,n.s+=e,t.c+=r,n.z+=e,n.m+=e}function $d(t,n,e){return t.a.parent===n.parent?t.a:e}function Zd(t,n){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=n}Zd.prototype=Object.create(dd.prototype);var Qd=function(){var t=Hd,n=1,e=1,r=null;function i(i){var c=function(t){for(var n,e,r,i,u,o=new Zd(t,0),a=[o];n=a.pop();)if(r=n._.children)for(n.children=new Array(u=r.length),i=u-1;i>=0;--i)a.push(e=n.children[i]=new Zd(r[i],i)),e.parent=n;return(o.parent=new Zd(null,0)).children=[o],o}(i);if(c.eachAfter(u),c.parent.m=-c.z,c.eachBefore(o),r)i.eachBefore(a);else{var f=i,s=i,l=i;i.eachBefore((function(t){t.x<f.x&&(f=t),t.x>s.x&&(s=t),t.depth>l.depth&&(l=t)}));var h=f===s?1:t(f,s)/2,d=h-f.x,p=n/(s.x+h+d),g=e/(l.depth||1);i.eachBefore((function(t){t.x=(t.x+d)*p,t.y=t.depth*g}))}return i}function u(n){var e=n.children,r=n.parent.children,i=n.i?r[n.i-1]:null;if(e){!function(t){for(var n,e=0,r=0,i=t.children,u=i.length;--u>=0;)(n=i[u]).z+=e,n.m+=e,e+=n.s+(r+=n.c)}(n);var u=(e[0].z+e[e.length-1].z)/2;i?(n.z=i.z+t(n._,i._),n.m=n.z-u):n.z=u}else i&&(n.z=i.z+t(n._,i._));n.parent.A=function(n,e,r){if(e){for(var i,u=n,o=n,a=e,c=u.parent.children[0],f=u.m,s=o.m,l=a.m,h=c.m;a=Gd(a),u=Kd(u),a&&u;)c=Kd(c),(o=Gd(o)).a=n,(i=a.z+l-u.z-f+t(a._,u._))>0&&(Wd($d(a,n,r),n,i),f+=i,s+=i),l+=a.m,f+=u.m,h+=c.m,s+=o.m;a&&!Gd(o)&&(o.t=a,o.m+=l-s),u&&!Kd(c)&&(c.t=u,c.m+=f-h,r=n)}return r}(n,i,n.parent.A||r[0])}function o(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function a(t){t.x*=n,t.y=t.depth*e}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i},Jd=function(t,n,e,r,i){for(var u,o=t.children,a=-1,c=o.length,f=t.value&&(i-e)/t.value;++a<c;)(u=o[a]).x0=n,u.x1=r,u.y0=e,u.y1=e+=u.value*f},tp=(1+Math.sqrt(5))/2;function np(t,n,e,r,i,u){for(var o,a,c,f,s,l,h,d,p,g,_,v=[],y=n.children,m=0,b=0,x=y.length,w=n.value;m<x;){c=i-e,f=u-r;do{s=y[b++].value}while(!s&&b<x);for(l=h=s,_=s*s*(g=Math.max(f/c,c/f)/(w*t)),p=Math.max(h/_,_/l);b<x;++b){if(s+=a=y[b].value,a<l&&(l=a),a>h&&(h=a),_=s*s*g,(d=Math.max(h/_,_/l))>p){s-=a;break}p=d}v.push(o={value:s,dice:c<f,children:y.slice(m,b)}),o.dice?Bd(o,e,r,i,w?r+=f*s/w:u):Jd(o,e,r,w?e+=c*s/w:i,u),w-=s,m=b}return v}var ep=function t(n){function e(t,e,r,i,u){np(n,t,e,r,i,u)}return e.ratio=function(n){return t((n=+n)>1?n:1)},e}(tp),rp=function(){var t=ep,n=!1,e=1,r=1,i=[0],u=Vd,o=Vd,a=Vd,c=Vd,f=Vd;function s(t){return t.x0=t.y0=0,t.x1=e,t.y1=r,t.eachBefore(l),i=[0],n&&t.eachBefore(Ud),t}function l(n){var e=i[n.depth],r=n.x0+e,s=n.y0+e,l=n.x1-e,h=n.y1-e;l<r&&(r=l=(r+l)/2),h<s&&(s=h=(s+h)/2),n.x0=r,n.y0=s,n.x1=l,n.y1=h,n.children&&(e=i[n.depth+1]=u(n)/2,r+=f(n)-e,s+=o(n)-e,(l-=a(n)-e)<r&&(r=l=(r+l)/2),(h-=c(n)-e)<s&&(s=h=(s+h)/2),t(n,r,s,l,h))}return s.round=function(t){return arguments.length?(n=!!t,s):n},s.size=function(t){return arguments.length?(e=+t[0],r=+t[1],s):[e,r]},s.tile=function(n){return arguments.length?(t=Ed(n),s):t},s.padding=function(t){return arguments.length?s.paddingInner(t).paddingOuter(t):s.paddingInner()},s.paddingInner=function(t){return arguments.length?(u="function"==typeof t?t:Pd(+t),s):u},s.paddingOuter=function(t){return arguments.length?s.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):s.paddingTop()},s.paddingTop=function(t){return arguments.length?(o="function"==typeof t?t:Pd(+t),s):o},s.paddingRight=function(t){return arguments.length?(a="function"==typeof t?t:Pd(+t),s):a},s.paddingBottom=function(t){return arguments.length?(c="function"==typeof t?t:Pd(+t),s):c},s.paddingLeft=function(t){return arguments.length?(f="function"==typeof t?t:Pd(+t),s):f},s},ip=function(t,n,e,r,i){var u,o,a=t.children,c=a.length,f=new Array(c+1);for(f[0]=o=u=0;u<c;++u)f[u+1]=o+=a[u].value;!function t(n,e,r,i,u,o,c){if(n>=e-1){var s=a[n];return s.x0=i,s.y0=u,s.x1=o,void(s.y1=c)}var l=f[n],h=r/2+l,d=n+1,p=e-1;for(;d<p;){var g=d+p>>>1;f[g]<h?d=g+1:p=g}h-f[d-1]<f[d]-h&&n+1<d&&--d;var _=f[d]-l,v=r-_;if(o-i>c-u){var y=(i*v+o*_)/r;t(n,d,_,i,u,y,c),t(d,e,v,y,u,o,c)}else{var m=(u*v+c*_)/r;t(n,d,_,i,u,o,m),t(d,e,v,i,m,o,c)}}(0,c,t.value,n,e,r,i)},up=function(t,n,e,r,i){(1&t.depth?Jd:Bd)(t,n,e,r,i)},op=function t(n){function e(t,e,r,i,u){if((o=t._squarify)&&o.ratio===n)for(var o,a,c,f,s,l=-1,h=o.length,d=t.value;++l<h;){for(c=(a=o[l]).children,f=a.value=0,s=c.length;f<s;++f)a.value+=c[f].value;a.dice?Bd(a,e,r,i,r+=(u-r)*a.value/d):Jd(a,e,r,e+=(i-e)*a.value/d,u),d-=a.value}else t._squarify=o=np(n,t,e,r,i,u),o.ratio=n}return e.ratio=function(n){return t((n=+n)>1?n:1)},e}(tp),ap=function(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}},cp=function(t,n){var e=fe(+t,+n);return function(t){var n=e(t);return n-360*Math.floor(n/360)}},fp=function(t,n){return t=+t,n=+n,function(e){return Math.round(t*(1-e)+n*e)}},sp=Math.SQRT2;function lp(t){return((t=Math.exp(t))+1/t)/2}var hp=function(t,n){var e,r,i=t[0],u=t[1],o=t[2],a=n[0],c=n[1],f=n[2],s=a-i,l=c-u,h=s*s+l*l;if(h<1e-12)r=Math.log(f/o)/sp,e=function(t){return[i+t*s,u+t*l,o*Math.exp(sp*t*r)]};else{var d=Math.sqrt(h),p=(f*f-o*o+4*h)/(2*o*2*d),g=(f*f-o*o-4*h)/(2*f*2*d),_=Math.log(Math.sqrt(p*p+1)-p),v=Math.log(Math.sqrt(g*g+1)-g);r=(v-_)/sp,e=function(t){var n,e=t*r,a=lp(_),c=o/(2*d)*(a*(n=sp*e+_,((n=Math.exp(2*n))-1)/(n+1))-function(t){return((t=Math.exp(t))-1/t)/2}(_));return[i+c*s,u+c*l,o*a/lp(sp*e+_)]}}return e.duration=1e3*r,e};function dp(t){return function(n,e){var r=t((n=ne(n)).h,(e=ne(e)).h),i=le(n.s,e.s),u=le(n.l,e.l),o=le(n.opacity,e.opacity);return function(t){return n.h=r(t),n.s=i(t),n.l=u(t),n.opacity=o(t),n+""}}}var pp=dp(fe),gp=dp(le);function _p(t,n){var e=le((t=pu(t)).l,(n=pu(n)).l),r=le(t.a,n.a),i=le(t.b,n.b),u=le(t.opacity,n.opacity);return function(n){return t.l=e(n),t.a=r(n),t.b=i(n),t.opacity=u(n),t+""}}function vp(t){return function(n,e){var r=t((n=wu(n)).h,(e=wu(e)).h),i=le(n.c,e.c),u=le(n.l,e.l),o=le(n.opacity,e.opacity);return function(t){return n.h=r(t),n.c=i(t),n.l=u(t),n.opacity=o(t),n+""}}}var yp=vp(fe),mp=vp(le);function bp(t){return function n(e){function r(n,r){var i=t((n=Eu(n)).h,(r=Eu(r)).h),u=le(n.s,r.s),o=le(n.l,r.l),a=le(n.opacity,r.opacity);return function(t){return n.h=i(t),n.s=u(t),n.l=o(Math.pow(t,e)),n.opacity=a(t),n+""}}return e=+e,r.gamma=n,r}(1)}var xp=bp(fe),wp=bp(le);function Mp(t,n){for(var e=0,r=n.length-1,i=n[0],u=new Array(r<0?0:r);e<r;)u[e]=t(i,i=n[++e]);return function(t){var n=Math.max(0,Math.min(r-1,Math.floor(t*=r)));return u[n](t-n)}}var Tp=function(t,n){for(var e=new Array(n),r=0;r<n;++r)e[r]=t(r/(n-1));return e},kp=function(t){for(var n,e=-1,r=t.length,i=t[r-1],u=0;++e<r;)n=i,i=t[e],u+=n[1]*i[0]-n[0]*i[1];return u/2},Ap=function(t){for(var n,e,r=-1,i=t.length,u=0,o=0,a=t[i-1],c=0;++r<i;)n=a,a=t[r],c+=e=n[0]*a[1]-a[0]*n[1],u+=(n[0]+a[0])*e,o+=(n[1]+a[1])*e;return[u/(c*=3),o/c]};function Np(t,n){return t[0]-n[0]||t[1]-n[1]}function Cp(t){for(var n,e,r,i=t.length,u=[0,1],o=2,a=2;a<i;++a){for(;o>1&&(n=t[u[o-2]],e=t[u[o-1]],r=t[a],(e[0]-n[0])*(r[1]-n[1])-(e[1]-n[1])*(r[0]-n[0])<=0);)--o;u[o++]=a}return u.slice(0,o)}var Sp=function(t){if((e=t.length)<3)return null;var n,e,r=new Array(e),i=new Array(e);for(n=0;n<e;++n)r[n]=[+t[n][0],+t[n][1],n];for(r.sort(Np),n=0;n<e;++n)i[n]=[r[n][0],-r[n][1]];var u=Cp(r),o=Cp(i),a=o[0]===u[0],c=o[o.length-1]===u[u.length-1],f=[];for(n=u.length-1;n>=0;--n)f.push(t[r[u[n]][2]]);for(n=+a;n<o.length-c;++n)f.push(t[r[o[n]][2]]);return f},Ep=function(t,n){for(var e,r,i=t.length,u=t[i-1],o=n[0],a=n[1],c=u[0],f=u[1],s=!1,l=0;l<i;++l)e=(u=t[l])[0],(r=u[1])>a!=f>a&&o<(c-e)*(a-r)/(f-r)+e&&(s=!s),c=e,f=r;return s},Vp=function(t){for(var n,e,r=-1,i=t.length,u=t[i-1],o=u[0],a=u[1],c=0;++r<i;)n=o,e=a,n-=o=(u=t[r])[0],e-=a=u[1],c+=Math.sqrt(n*n+e*e);return c},Pp=function(){return Math.random()},Dp=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,1===arguments.length?(e=t,t=0):e-=t,function(){return n()*e+t}}return e.source=t,e}(Pp),zp=function t(n){function e(t,e){var r,i;return t=null==t?0:+t,e=null==e?1:+e,function(){var u;if(null!=r)u=r,r=null;else do{r=2*n()-1,u=2*n()-1,i=r*r+u*u}while(!i||i>1);return t+e*u*Math.sqrt(-2*Math.log(i)/i)}}return e.source=t,e}(Pp),Rp=function t(n){function e(){var t=zp.source(n).apply(this,arguments);return function(){return Math.exp(t())}}return e.source=t,e}(Pp),Lp=function t(n){function e(t){return function(){for(var e=0,r=0;r<t;++r)e+=n();return e}}return e.source=t,e}(Pp),Yp=function t(n){function e(t){var e=Lp.source(n)(t);return function(){return e()/t}}return e.source=t,e}(Pp),Up=function t(n){function e(t){return function(){return-Math.log(1-n())/t}}return e.source=t,e}(Pp);function Bp(t,n){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(n).domain(t)}return this}function Ip(t,n){switch(arguments.length){case 0:break;case 1:this.interpolator(t);break;default:this.interpolator(n).domain(t)}return this}var Op=Array.prototype,Fp=Op.map,qp=Op.slice,Xp={name:"implicit"};function jp(){var t=Zi(),n=[],e=[],r=Xp;function i(i){var u=i+"",o=t.get(u);if(!o){if(r!==Xp)return r;t.set(u,o=n.push(i))}return e[(o-1)%e.length]}return i.domain=function(e){if(!arguments.length)return n.slice();n=[],t=Zi();for(var r,u,o=-1,a=e.length;++o<a;)t.has(u=(r=e[o])+"")||t.set(u,n.push(r));return i},i.range=function(t){return arguments.length?(e=qp.call(t),i):e.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return jp(n,e).unknown(r)},Bp.apply(i,arguments),i}function Hp(){var t,n,e=jp().unknown(void 0),r=e.domain,i=e.range,u=[0,1],o=!1,a=0,c=0,f=.5;function s(){var e=r().length,s=u[1]<u[0],l=u[s-0],h=u[1-s];t=(h-l)/Math.max(1,e-a+2*c),o&&(t=Math.floor(t)),l+=(h-l-t*(e-a))*f,n=t*(1-a),o&&(l=Math.round(l),n=Math.round(n));var d=w(e).map((function(n){return l+t*n}));return i(s?d.reverse():d)}return delete e.unknown,e.domain=function(t){return arguments.length?(r(t),s()):r()},e.range=function(t){return arguments.length?(u=[+t[0],+t[1]],s()):u.slice()},e.rangeRound=function(t){return u=[+t[0],+t[1]],o=!0,s()},e.bandwidth=function(){return n},e.step=function(){return t},e.round=function(t){return arguments.length?(o=!!t,s()):o},e.padding=function(t){return arguments.length?(a=Math.min(1,c=+t),s()):a},e.paddingInner=function(t){return arguments.length?(a=Math.min(1,t),s()):a},e.paddingOuter=function(t){return arguments.length?(c=+t,s()):c},e.align=function(t){return arguments.length?(f=Math.max(0,Math.min(1,t)),s()):f},e.copy=function(){return Hp(r(),u).round(o).paddingInner(a).paddingOuter(c).align(f)},Bp.apply(s(),arguments)}function Kp(t){var n=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return Kp(n())},t}function Gp(){return Kp(Hp.apply(null,arguments).paddingInner(1))}var Wp=function(t){return+t},$p=[0,1];function Zp(t){return t}function Qp(t,n){return(n-=t=+t)?function(e){return(e-t)/n}:(e=isNaN(n)?NaN:.5,function(){return e});var e}function Jp(t){var n,e=t[0],r=t[t.length-1];return e>r&&(n=e,e=r,r=n),function(t){return Math.max(e,Math.min(r,t))}}function tg(t,n,e){var r=t[0],i=t[1],u=n[0],o=n[1];return i<r?(r=Qp(i,r),u=e(o,u)):(r=Qp(r,i),u=e(u,o)),function(t){return u(r(t))}}function ng(t,n,e){var r=Math.min(t.length,n.length)-1,i=new Array(r),u=new Array(r),o=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());++o<r;)i[o]=Qp(t[o],t[o+1]),u[o]=e(n[o],n[o+1]);return function(n){var e=c(t,n,1,r)-1;return u[e](i[e](n))}}function eg(t,n){return n.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function rg(){var t,n,e,r,i,u,o=$p,a=$p,c=Ce,f=Zp;function s(){return r=Math.min(o.length,a.length)>2?ng:tg,i=u=null,l}function l(n){return isNaN(n=+n)?e:(i||(i=r(o.map(t),a,c)))(t(f(n)))}return l.invert=function(e){return f(n((u||(u=r(a,o.map(t),xe)))(e)))},l.domain=function(t){return arguments.length?(o=Fp.call(t,Wp),f===Zp||(f=Jp(o)),s()):o.slice()},l.range=function(t){return arguments.length?(a=qp.call(t),s()):a.slice()},l.rangeRound=function(t){return a=qp.call(t),c=fp,s()},l.clamp=function(t){return arguments.length?(f=t?Jp(o):Zp,l):f!==Zp},l.interpolate=function(t){return arguments.length?(c=t,s()):c},l.unknown=function(t){return arguments.length?(e=t,l):e},function(e,r){return t=e,n=r,s()}}function ig(t,n){return rg()(t,n)}var ug=function(t,n,e,r){var i,u=C(t,n,e);switch((r=ja(null==r?",f":r)).type){case"s":var o=Math.max(Math.abs(t),Math.abs(n));return null!=r.precision||isNaN(i=uc(u,o))||(r.precision=i),$a(r,o);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=oc(u,Math.max(Math.abs(t),Math.abs(n))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=ic(u))||(r.precision=i-2*("%"===r.type))}return Wa(r)};function og(t){var n=t.domain;return t.ticks=function(t){var e=n();return A(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){var r=n();return ug(r[0],r[r.length-1],null==t?10:t,e)},t.nice=function(e){null==e&&(e=10);var r,i=n(),u=0,o=i.length-1,a=i[u],c=i[o];return c<a&&(r=a,a=c,c=r,r=u,u=o,o=r),(r=N(a,c,e))>0?r=N(a=Math.floor(a/r)*r,c=Math.ceil(c/r)*r,e):r<0&&(r=N(a=Math.ceil(a*r)/r,c=Math.floor(c*r)/r,e)),r>0?(i[u]=Math.floor(a/r)*r,i[o]=Math.ceil(c/r)*r,n(i)):r<0&&(i[u]=Math.ceil(a*r)/r,i[o]=Math.floor(c*r)/r,n(i)),t},t}function ag(){var t=ig(Zp,Zp);return t.copy=function(){return eg(t,ag())},Bp.apply(t,arguments),og(t)}function cg(t){var n;function e(t){return isNaN(t=+t)?n:t}return e.invert=e,e.domain=e.range=function(n){return arguments.length?(t=Fp.call(n,Wp),e):t.slice()},e.unknown=function(t){return arguments.length?(n=t,e):n},e.copy=function(){return cg(t).unknown(n)},t=arguments.length?Fp.call(t,Wp):[0,1],og(e)}var fg=function(t,n){var e,r=0,i=(t=t.slice()).length-1,u=t[r],o=t[i];return o<u&&(e=r,r=i,i=e,e=u,u=o,o=e),t[r]=n.floor(u),t[i]=n.ceil(o),t};function sg(t){return Math.log(t)}function lg(t){return Math.exp(t)}function hg(t){return-Math.log(-t)}function dg(t){return-Math.exp(-t)}function pg(t){return isFinite(t)?+("1e"+t):t<0?0:t}function gg(t){return function(n){return-t(-n)}}function _g(t){var n,e,r=t(sg,lg),i=r.domain,u=10;function o(){return n=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),function(n){return Math.log(n)/t})}(u),e=function(t){return 10===t?pg:t===Math.E?Math.exp:function(n){return Math.pow(t,n)}}(u),i()[0]<0?(n=gg(n),e=gg(e),t(hg,dg)):t(sg,lg),r}return r.base=function(t){return arguments.length?(u=+t,o()):u},r.domain=function(t){return arguments.length?(i(t),o()):i()},r.ticks=function(t){var r,o=i(),a=o[0],c=o[o.length-1];(r=c<a)&&(h=a,a=c,c=h);var f,s,l,h=n(a),d=n(c),p=null==t?10:+t,g=[];if(!(u%1)&&d-h<p){if(h=Math.round(h)-1,d=Math.round(d)+1,a>0){for(;h<d;++h)for(s=1,f=e(h);s<u;++s)if(!((l=f*s)<a)){if(l>c)break;g.push(l)}}else for(;h<d;++h)for(s=u-1,f=e(h);s>=1;--s)if(!((l=f*s)<a)){if(l>c)break;g.push(l)}}else g=A(h,d,Math.min(d-h,p)).map(e);return r?g.reverse():g},r.tickFormat=function(t,i){if(null==i&&(i=10===u?".0e":","),"function"!=typeof i&&(i=Wa(i)),t===1/0)return i;null==t&&(t=10);var o=Math.max(1,u*t/r.ticks().length);return function(t){var r=t/e(Math.round(n(t)));return r*u<u-.5&&(r*=u),r<=o?i(t):""}},r.nice=function(){return i(fg(i(),{floor:function(t){return e(Math.floor(n(t)))},ceil:function(t){return e(Math.ceil(n(t)))}}))},r}function vg(){var t=_g(rg()).domain([1,10]);return t.copy=function(){return eg(t,vg()).base(t.base())},Bp.apply(t,arguments),t}function yg(t){return function(n){return Math.sign(n)*Math.log1p(Math.abs(n/t))}}function mg(t){return function(n){return Math.sign(n)*Math.expm1(Math.abs(n))*t}}function bg(t){var n=1,e=t(yg(n),mg(n));return e.constant=function(e){return arguments.length?t(yg(n=+e),mg(n)):n},og(e)}function xg(){var t=bg(rg());return t.copy=function(){return eg(t,xg()).constant(t.constant())},Bp.apply(t,arguments)}function wg(t){return function(n){return n<0?-Math.pow(-n,t):Math.pow(n,t)}}function Mg(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function Tg(t){return t<0?-t*t:t*t}function kg(t){var n=t(Zp,Zp),e=1;function r(){return 1===e?t(Zp,Zp):.5===e?t(Mg,Tg):t(wg(e),wg(1/e))}return n.exponent=function(t){return arguments.length?(e=+t,r()):e},og(n)}function Ag(){var t=kg(rg());return t.copy=function(){return eg(t,Ag()).exponent(t.exponent())},Bp.apply(t,arguments),t}function Ng(){return Ag.apply(null,arguments).exponent(.5)}function Cg(){var t,n=[],e=[],i=[];function u(){var t=0,r=Math.max(1,e.length);for(i=new Array(r-1);++t<r;)i[t-1]=V(n,t/r);return o}function o(n){return isNaN(n=+n)?t:e[c(i,n)]}return o.invertExtent=function(t){var r=e.indexOf(t);return r<0?[NaN,NaN]:[r>0?i[r-1]:n[0],r<i.length?i[r]:n[n.length-1]]},o.domain=function(t){if(!arguments.length)return n.slice();n=[];for(var e,i=0,o=t.length;i<o;++i)null==(e=t[i])||isNaN(e=+e)||n.push(e);return n.sort(r),u()},o.range=function(t){return arguments.length?(e=qp.call(t),u()):e.slice()},o.unknown=function(n){return arguments.length?(t=n,o):t},o.quantiles=function(){return i.slice()},o.copy=function(){return Cg().domain(n).range(e).unknown(t)},Bp.apply(o,arguments)}function Sg(){var t,n=0,e=1,r=1,i=[.5],u=[0,1];function o(n){return n<=n?u[c(i,n,0,r)]:t}function a(){var t=-1;for(i=new Array(r);++t<r;)i[t]=((t+1)*e-(t-r)*n)/(r+1);return o}return o.domain=function(t){return arguments.length?(n=+t[0],e=+t[1],a()):[n,e]},o.range=function(t){return arguments.length?(r=(u=qp.call(t)).length-1,a()):u.slice()},o.invertExtent=function(t){var o=u.indexOf(t);return o<0?[NaN,NaN]:o<1?[n,i[0]]:o>=r?[i[r-1],e]:[i[o-1],i[o]]},o.unknown=function(n){return arguments.length?(t=n,o):o},o.thresholds=function(){return i.slice()},o.copy=function(){return Sg().domain([n,e]).range(u).unknown(t)},Bp.apply(og(o),arguments)}function Eg(){var t,n=[.5],e=[0,1],r=1;function i(i){return i<=i?e[c(n,i,0,r)]:t}return i.domain=function(t){return arguments.length?(n=qp.call(t),r=Math.min(n.length,e.length-1),i):n.slice()},i.range=function(t){return arguments.length?(e=qp.call(t),r=Math.min(n.length,e.length-1),i):e.slice()},i.invertExtent=function(t){var r=e.indexOf(t);return[n[r-1],n[r]]},i.unknown=function(n){return arguments.length?(t=n,i):t},i.copy=function(){return Eg().domain(n).range(e).unknown(t)},Bp.apply(i,arguments)}var Vg=new Date,Pg=new Date;function Dg(t,n,e,r){function i(n){return t(n=0===arguments.length?new Date:new Date(+n)),n}return i.floor=function(n){return t(n=new Date(+n)),n},i.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},i.round=function(t){var n=i(t),e=i.ceil(t);return t-n<e-t?n:e},i.offset=function(t,e){return n(t=new Date(+t),null==e?1:Math.floor(e)),t},i.range=function(e,r,u){var o,a=[];if(e=i.ceil(e),u=null==u?1:Math.floor(u),!(e<r&&u>0))return a;do{a.push(o=new Date(+e)),n(e,u),t(e)}while(o<e&&e<r);return a},i.filter=function(e){return Dg((function(n){if(n>=n)for(;t(n),!e(n);)n.setTime(n-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;n(t,-1),!e(t););else for(;--r>=0;)for(;n(t,1),!e(t););}))},e&&(i.count=function(n,r){return Vg.setTime(+n),Pg.setTime(+r),t(Vg),t(Pg),Math.floor(e(Vg,Pg))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(n){return r(n)%t==0}:function(n){return i.count(0,n)%t==0}):i:null}),i}var zg=Dg((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n)}),(function(t,n){return n.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));zg.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Dg((function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)}),(function(n,e){n.setFullYear(n.getFullYear()+e*t)})):null};var Rg=zg,Lg=zg.range,Yg=Dg((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,n){t.setMonth(t.getMonth()+n)}),(function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),Ug=Yg,Bg=Yg.range;function Ig(t){return Dg((function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)}),(function(t,n){t.setDate(t.getDate()+7*n)}),(function(t,n){return(n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var Og=Ig(0),Fg=Ig(1),qg=Ig(2),Xg=Ig(3),jg=Ig(4),Hg=Ig(5),Kg=Ig(6),Gg=Og.range,Wg=Fg.range,$g=qg.range,Zg=Xg.range,Qg=jg.range,Jg=Hg.range,t_=Kg.range,n_=Dg((function(t){t.setHours(0,0,0,0)}),(function(t,n){t.setDate(t.getDate()+n)}),(function(t,n){return(n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5}),(function(t){return t.getDate()-1})),e_=n_,r_=n_.range,i_=Dg((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,n){t.setTime(+t+36e5*n)}),(function(t,n){return(n-t)/36e5}),(function(t){return t.getHours()})),u_=i_,o_=i_.range,a_=Dg((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,n){t.setTime(+t+6e4*n)}),(function(t,n){return(n-t)/6e4}),(function(t){return t.getMinutes()})),c_=a_,f_=a_.range,s_=Dg((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,n){t.setTime(+t+1e3*n)}),(function(t,n){return(n-t)/1e3}),(function(t){return t.getUTCSeconds()})),l_=s_,h_=s_.range,d_=Dg((function(){}),(function(t,n){t.setTime(+t+n)}),(function(t,n){return n-t}));d_.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?Dg((function(n){n.setTime(Math.floor(n/t)*t)}),(function(n,e){n.setTime(+n+e*t)}),(function(n,e){return(e-n)/t})):d_:null};var p_=d_,g_=d_.range;function __(t){return Dg((function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+7*n)}),(function(t,n){return(n-t)/6048e5}))}var v_=__(0),y_=__(1),m_=__(2),b_=__(3),x_=__(4),w_=__(5),M_=__(6),T_=v_.range,k_=y_.range,A_=m_.range,N_=b_.range,C_=x_.range,S_=w_.range,E_=M_.range,V_=Dg((function(t){t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+n)}),(function(t,n){return(n-t)/864e5}),(function(t){return t.getUTCDate()-1})),P_=V_,D_=V_.range,z_=Dg((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)}),(function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));z_.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Dg((function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)}),(function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)})):null};var R_=z_,L_=z_.range;function Y_(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function U_(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function B_(t,n,e){return{y:t,m:n,d:e,H:0,M:0,S:0,L:0}}function I_(t){var n=t.dateTime,e=t.date,r=t.time,i=t.periods,u=t.days,o=t.shortDays,a=t.months,c=t.shortMonths,f=Q_(i),s=J_(i),l=Q_(u),h=J_(u),d=Q_(o),p=J_(o),g=Q_(a),_=J_(a),v=Q_(c),y=J_(c),m={a:function(t){return o[t.getDay()]},A:function(t){return u[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return a[t.getMonth()]},c:null,d:bv,e:bv,f:kv,H:xv,I:wv,j:Mv,L:Tv,m:Av,M:Nv,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:ny,s:ey,S:Cv,u:Sv,U:Ev,V:Vv,w:Pv,W:Dv,x:null,X:null,y:zv,Y:Rv,Z:Lv,"%":ty},b={a:function(t){return o[t.getUTCDay()]},A:function(t){return u[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return a[t.getUTCMonth()]},c:null,d:Yv,e:Yv,f:Fv,H:Uv,I:Bv,j:Iv,L:Ov,m:qv,M:Xv,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:ny,s:ey,S:jv,u:Hv,U:Kv,V:Gv,w:Wv,W:$v,x:null,X:null,y:Zv,Y:Qv,Z:Jv,"%":ty},x={a:function(t,n,e){var r=d.exec(n.slice(e));return r?(t.w=p[r[0].toLowerCase()],e+r[0].length):-1},A:function(t,n,e){var r=l.exec(n.slice(e));return r?(t.w=h[r[0].toLowerCase()],e+r[0].length):-1},b:function(t,n,e){var r=v.exec(n.slice(e));return r?(t.m=y[r[0].toLowerCase()],e+r[0].length):-1},B:function(t,n,e){var r=g.exec(n.slice(e));return r?(t.m=_[r[0].toLowerCase()],e+r[0].length):-1},c:function(t,e,r){return T(t,n,e,r)},d:sv,e:sv,f:_v,H:hv,I:hv,j:lv,L:gv,m:fv,M:dv,p:function(t,n,e){var r=f.exec(n.slice(e));return r?(t.p=s[r[0].toLowerCase()],e+r[0].length):-1},q:cv,Q:yv,s:mv,S:pv,u:nv,U:ev,V:rv,w:tv,W:iv,x:function(t,n,r){return T(t,e,n,r)},X:function(t,n,e){return T(t,r,n,e)},y:ov,Y:uv,Z:av,"%":vv};function w(t,n){return function(e){var r,i,u,o=[],a=-1,c=0,f=t.length;for(e instanceof Date||(e=new Date(+e));++a<f;)37===t.charCodeAt(a)&&(o.push(t.slice(c,a)),null!=(i=H_[r=t.charAt(++a)])?r=t.charAt(++a):i="e"===r?" ":"0",(u=n[r])&&(r=u(e,i)),o.push(r),c=a+1);return o.push(t.slice(c,a)),o.join("")}}function M(t,n){return function(e){var r,i,u=B_(1900,void 0,1);if(T(u,t,e+="",0)!=e.length)return null;if("Q"in u)return new Date(u.Q);if("s"in u)return new Date(1e3*u.s+("L"in u?u.L:0));if(!n||"Z"in u||(u.Z=0),"p"in u&&(u.H=u.H%12+12*u.p),void 0===u.m&&(u.m="q"in u?u.q:0),"V"in u){if(u.V<1||u.V>53)return null;"w"in u||(u.w=1),"Z"in u?(i=(r=U_(B_(u.y,0,1))).getUTCDay(),r=i>4||0===i?y_.ceil(r):y_(r),r=P_.offset(r,7*(u.V-1)),u.y=r.getUTCFullYear(),u.m=r.getUTCMonth(),u.d=r.getUTCDate()+(u.w+6)%7):(i=(r=Y_(B_(u.y,0,1))).getDay(),r=i>4||0===i?Fg.ceil(r):Fg(r),r=e_.offset(r,7*(u.V-1)),u.y=r.getFullYear(),u.m=r.getMonth(),u.d=r.getDate()+(u.w+6)%7)}else("W"in u||"U"in u)&&("w"in u||(u.w="u"in u?u.u%7:"W"in u?1:0),i="Z"in u?U_(B_(u.y,0,1)).getUTCDay():Y_(B_(u.y,0,1)).getDay(),u.m=0,u.d="W"in u?(u.w+6)%7+7*u.W-(i+5)%7:u.w+7*u.U-(i+6)%7);return"Z"in u?(u.H+=u.Z/100|0,u.M+=u.Z%100,U_(u)):Y_(u)}}function T(t,n,e,r){for(var i,u,o=0,a=n.length,c=e.length;o<a;){if(r>=c)return-1;if(37===(i=n.charCodeAt(o++))){if(i=n.charAt(o++),!(u=x[i in H_?n.charAt(o++):i])||(r=u(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}return(m.x=w(e,m),m.X=w(r,m),m.c=w(n,m),b.x=w(e,b),b.X=w(r,b),b.c=w(n,b),{format:function(t){var n=w(t+="",m);return n.toString=function(){return t},n},parse:function(t){var n=M(t+="",!1);return n.toString=function(){return t},n},utcFormat:function(t){var n=w(t+="",b);return n.toString=function(){return t},n},utcParse:function(t){var n=M(t+="",!0);return n.toString=function(){return t},n}})}var O_,F_,q_,X_,j_,H_={"-":"",_:" ",0:"0"},K_=/^\\s*\\d+/,G_=/^%/,W_=/[\\\\^$*+?|[\\]().{}]/g;function $_(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",u=i.length;return r+(u<e?new Array(e-u+1).join(n)+i:i)}function Z_(t){return t.replace(W_,"\\\\$&")}function Q_(t){return new RegExp("^(?:"+t.map(Z_).join("|")+")","i")}function J_(t){for(var n={},e=-1,r=t.length;++e<r;)n[t[e].toLowerCase()]=e;return n}function tv(t,n,e){var r=K_.exec(n.slice(e,e+1));return r?(t.w=+r[0],e+r[0].length):-1}function nv(t,n,e){var r=K_.exec(n.slice(e,e+1));return r?(t.u=+r[0],e+r[0].length):-1}function ev(t,n,e){var r=K_.exec(n.slice(e,e+2));return r?(t.U=+r[0],e+r[0].length):-1}function rv(t,n,e){var r=K_.exec(n.slice(e,e+2));return r?(t.V=+r[0],e+r[0].length):-1}function iv(t,n,e){var r=K_.exec(n.slice(e,e+2));return r?(t.W=+r[0],e+r[0].length):-1}function uv(t,n,e){var r=K_.exec(n.slice(e,e+4));return r?(t.y=+r[0],e+r[0].length):-1}function ov(t,n,e){var r=K_.exec(n.slice(e,e+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),e+r[0].length):-1}function av(t,n,e){var r=/^(Z)|([+-]\\d\\d)(?::?(\\d\\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function cv(t,n,e){var r=K_.exec(n.slice(e,e+1));return r?(t.q=3*r[0]-3,e+r[0].length):-1}function fv(t,n,e){var r=K_.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function sv(t,n,e){var r=K_.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function lv(t,n,e){var r=K_.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function hv(t,n,e){var r=K_.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function dv(t,n,e){var r=K_.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function pv(t,n,e){var r=K_.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function gv(t,n,e){var r=K_.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function _v(t,n,e){var r=K_.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function vv(t,n,e){var r=G_.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function yv(t,n,e){var r=K_.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function mv(t,n,e){var r=K_.exec(n.slice(e));return r?(t.s=+r[0],e+r[0].length):-1}function bv(t,n){return $_(t.getDate(),n,2)}function xv(t,n){return $_(t.getHours(),n,2)}function wv(t,n){return $_(t.getHours()%12||12,n,2)}function Mv(t,n){return $_(1+e_.count(Rg(t),t),n,3)}function Tv(t,n){return $_(t.getMilliseconds(),n,3)}function kv(t,n){return Tv(t,n)+"000"}function Av(t,n){return $_(t.getMonth()+1,n,2)}function Nv(t,n){return $_(t.getMinutes(),n,2)}function Cv(t,n){return $_(t.getSeconds(),n,2)}function Sv(t){var n=t.getDay();return 0===n?7:n}function Ev(t,n){return $_(Og.count(Rg(t)-1,t),n,2)}function Vv(t,n){var e=t.getDay();return t=e>=4||0===e?jg(t):jg.ceil(t),$_(jg.count(Rg(t),t)+(4===Rg(t).getDay()),n,2)}function Pv(t){return t.getDay()}function Dv(t,n){return $_(Fg.count(Rg(t)-1,t),n,2)}function zv(t,n){return $_(t.getFullYear()%100,n,2)}function Rv(t,n){return $_(t.getFullYear()%1e4,n,4)}function Lv(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+$_(n/60|0,"0",2)+$_(n%60,"0",2)}function Yv(t,n){return $_(t.getUTCDate(),n,2)}function Uv(t,n){return $_(t.getUTCHours(),n,2)}function Bv(t,n){return $_(t.getUTCHours()%12||12,n,2)}function Iv(t,n){return $_(1+P_.count(R_(t),t),n,3)}function Ov(t,n){return $_(t.getUTCMilliseconds(),n,3)}function Fv(t,n){return Ov(t,n)+"000"}function qv(t,n){return $_(t.getUTCMonth()+1,n,2)}function Xv(t,n){return $_(t.getUTCMinutes(),n,2)}function jv(t,n){return $_(t.getUTCSeconds(),n,2)}function Hv(t){var n=t.getUTCDay();return 0===n?7:n}function Kv(t,n){return $_(v_.count(R_(t)-1,t),n,2)}function Gv(t,n){var e=t.getUTCDay();return t=e>=4||0===e?x_(t):x_.ceil(t),$_(x_.count(R_(t),t)+(4===R_(t).getUTCDay()),n,2)}function Wv(t){return t.getUTCDay()}function $v(t,n){return $_(y_.count(R_(t)-1,t),n,2)}function Zv(t,n){return $_(t.getUTCFullYear()%100,n,2)}function Qv(t,n){return $_(t.getUTCFullYear()%1e4,n,4)}function Jv(){return"+0000"}function ty(){return"%"}function ny(t){return+t}function ey(t){return Math.floor(+t/1e3)}function ry(t){return O_=I_(t),F_=O_.format,q_=O_.parse,X_=O_.utcFormat,j_=O_.utcParse,O_}ry({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function iy(t){return new Date(t)}function uy(t){return t instanceof Date?+t:+new Date(+t)}function oy(t,n,e,r,u,o,a,c,f){var s=ig(Zp,Zp),l=s.invert,h=s.domain,d=f(".%L"),p=f(":%S"),g=f("%I:%M"),_=f("%I %p"),v=f("%a %d"),y=f("%b %d"),m=f("%B"),b=f("%Y"),x=[[a,1,1e3],[a,5,5e3],[a,15,15e3],[a,30,3e4],[o,1,6e4],[o,5,3e5],[o,15,9e5],[o,30,18e5],[u,1,36e5],[u,3,108e5],[u,6,216e5],[u,12,432e5],[r,1,864e5],[r,2,1728e5],[e,1,6048e5],[n,1,2592e6],[n,3,7776e6],[t,1,31536e6]];function w(i){return(a(i)<i?d:o(i)<i?p:u(i)<i?g:r(i)<i?_:n(i)<i?e(i)<i?v:y:t(i)<i?m:b)(i)}function M(n,e,r,u){if(null==n&&(n=10),"number"==typeof n){var o=Math.abs(r-e)/n,a=i((function(t){return t[2]})).right(x,o);a===x.length?(u=C(e/31536e6,r/31536e6,n),n=t):a?(u=(a=x[o/x[a-1][2]<x[a][2]/o?a-1:a])[1],n=a[0]):(u=Math.max(C(e,r,n),1),n=c)}return null==u?n:n.every(u)}return s.invert=function(t){return new Date(l(t))},s.domain=function(t){return arguments.length?h(Fp.call(t,uy)):h().map(iy)},s.ticks=function(t,n){var e,r=h(),i=r[0],u=r[r.length-1],o=u<i;return o&&(e=i,i=u,u=e),e=(e=M(t,i,u,n))?e.range(i,u+1):[],o?e.reverse():e},s.tickFormat=function(t,n){return null==n?w:f(n)},s.nice=function(t,n){var e=h();return(t=M(t,e[0],e[e.length-1],n))?h(fg(e,t)):s},s.copy=function(){return eg(s,oy(t,n,e,r,u,o,a,c,f))},s}var ay=function(){return Bp.apply(oy(Rg,Ug,Og,e_,u_,c_,l_,p_,F_).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)},cy=Dg((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCMonth(t.getUTCMonth()+n)}),(function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),fy=cy,sy=cy.range,ly=Dg((function(t){t.setUTCMinutes(0,0,0)}),(function(t,n){t.setTime(+t+36e5*n)}),(function(t,n){return(n-t)/36e5}),(function(t){return t.getUTCHours()})),hy=ly,dy=ly.range,py=Dg((function(t){t.setUTCSeconds(0,0)}),(function(t,n){t.setTime(+t+6e4*n)}),(function(t,n){return(n-t)/6e4}),(function(t){return t.getUTCMinutes()})),gy=py,_y=py.range,vy=function(){return Bp.apply(oy(R_,fy,v_,P_,hy,gy,l_,p_,X_).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)};function yy(){var t,n,e,r,i,u=0,o=1,a=Zp,c=!1;function f(n){return isNaN(n=+n)?i:a(0===e?.5:(n=(r(n)-t)*e,c?Math.max(0,Math.min(1,n)):n))}return f.domain=function(i){return arguments.length?(t=r(u=+i[0]),n=r(o=+i[1]),e=t===n?0:1/(n-t),f):[u,o]},f.clamp=function(t){return arguments.length?(c=!!t,f):c},f.interpolator=function(t){return arguments.length?(a=t,f):a},f.unknown=function(t){return arguments.length?(i=t,f):i},function(i){return r=i,t=i(u),n=i(o),e=t===n?0:1/(n-t),f}}function my(t,n){return n.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function by(){var t=og(yy()(Zp));return t.copy=function(){return my(t,by())},Ip.apply(t,arguments)}function xy(){var t=_g(yy()).domain([1,10]);return t.copy=function(){return my(t,xy()).base(t.base())},Ip.apply(t,arguments)}function wy(){var t=bg(yy());return t.copy=function(){return my(t,wy()).constant(t.constant())},Ip.apply(t,arguments)}function My(){var t=kg(yy());return t.copy=function(){return my(t,My()).exponent(t.exponent())},Ip.apply(t,arguments)}function Ty(){return My.apply(null,arguments).exponent(.5)}function ky(){var t=[],n=Zp;function e(e){if(!isNaN(e=+e))return n((c(t,e)-1)/(t.length-1))}return e.domain=function(n){if(!arguments.length)return t.slice();t=[];for(var i,u=0,o=n.length;u<o;++u)null==(i=n[u])||isNaN(i=+i)||t.push(i);return t.sort(r),e},e.interpolator=function(t){return arguments.length?(n=t,e):n},e.copy=function(){return ky(n).domain(t)},Ip.apply(e,arguments)}function Ay(){var t,n,e,r,i,u,o,a=0,c=.5,f=1,s=Zp,l=!1;function h(t){return isNaN(t=+t)?o:(t=.5+((t=+u(t))-n)*(t<n?r:i),s(l?Math.max(0,Math.min(1,t)):t))}return h.domain=function(o){return arguments.length?(t=u(a=+o[0]),n=u(c=+o[1]),e=u(f=+o[2]),r=t===n?0:.5/(n-t),i=n===e?0:.5/(e-n),h):[a,c,f]},h.clamp=function(t){return arguments.length?(l=!!t,h):l},h.interpolator=function(t){return arguments.length?(s=t,h):s},h.unknown=function(t){return arguments.length?(o=t,h):o},function(o){return u=o,t=o(a),n=o(c),e=o(f),r=t===n?0:.5/(n-t),i=n===e?0:.5/(e-n),h}}function Ny(){var t=og(Ay()(Zp));return t.copy=function(){return my(t,Ny())},Ip.apply(t,arguments)}function Cy(){var t=_g(Ay()).domain([.1,1,10]);return t.copy=function(){return my(t,Cy()).base(t.base())},Ip.apply(t,arguments)}function Sy(){var t=bg(Ay());return t.copy=function(){return my(t,Sy()).constant(t.constant())},Ip.apply(t,arguments)}function Ey(){var t=kg(Ay());return t.copy=function(){return my(t,Ey()).exponent(t.exponent())},Ip.apply(t,arguments)}function Vy(){return Ey.apply(null,arguments).exponent(.5)}var Py=function(t){for(var n=t.length/6|0,e=new Array(n),r=0;r<n;)e[r]="#"+t.slice(6*r,6*++r);return e},Dy=Py("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),zy=Py("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),Ry=Py("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),Ly=Py("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),Yy=Py("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),Uy=Py("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),By=Py("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),Iy=Py("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),Oy=Py("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),Fy=Py("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"),qy=function(t){return pe(t[t.length-1])},Xy=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Py),jy=qy(Xy),Hy=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Py),Ky=qy(Hy),Gy=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Py),Wy=qy(Gy),$y=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Py),Zy=qy($y),Qy=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Py),Jy=qy(Qy),tm=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Py),nm=qy(tm),em=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Py),rm=qy(em),im=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Py),um=qy(im),om=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Py),am=qy(om),cm=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Py),fm=qy(cm),sm=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Py),lm=qy(sm),hm=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Py),dm=qy(hm),pm=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Py),gm=qy(pm),_m=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Py),vm=qy(_m),ym=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Py),mm=qy(ym),bm=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Py),xm=qy(bm),wm=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Py),Mm=qy(wm),Tm=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Py),km=qy(Tm),Am=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Py),Nm=qy(Am),Cm=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Py),Sm=qy(Cm),Em=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Py),Vm=qy(Em),Pm=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Py),Dm=qy(Pm),zm=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Py),Rm=qy(zm),Lm=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Py),Ym=qy(Lm),Um=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Py),Bm=qy(Um),Im=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Py),Om=qy(Im),Fm=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Py),qm=qy(Fm),Xm=function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"},jm=wp(Eu(300,.5,0),Eu(-240,.5,1)),Hm=wp(Eu(-100,.75,.35),Eu(80,1.5,.8)),Km=wp(Eu(260,.75,.35),Eu(80,1.5,.8)),Gm=Eu(),Wm=function(t){(t<0||t>1)&&(t-=Math.floor(t));var n=Math.abs(t-.5);return Gm.h=360*t-100,Gm.s=1.5-1.5*n,Gm.l=.8-.9*n,Gm+""},$m=Gn(),Zm=Math.PI/3,Qm=2*Math.PI/3,Jm=function(t){var n;return t=(.5-t)*Math.PI,$m.r=255*(n=Math.sin(t))*n,$m.g=255*(n=Math.sin(t+Zm))*n,$m.b=255*(n=Math.sin(t+Qm))*n,$m+""},tb=function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"};function nb(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}}var eb=nb(Py("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),rb=nb(Py("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),ib=nb(Py("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),ub=nb(Py("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),ob=function(t){return Mn(en(t).call(document.documentElement))},ab=0;function cb(){return new fb}function fb(){this._="@"+(++ab).toString(36)}fb.prototype=cb.prototype={constructor:fb,get:function(t){for(var n=this._;!(n in t);)if(!(t=t.parentNode))return;return t[n]},set:function(t,n){return t[this._]=n},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};var sb=function(t){return"string"==typeof t?new bn([document.querySelectorAll(t)],[document.documentElement]):new bn([null==t?[]:t],mn)},lb=function(t,n){null==n&&(n=Se().touches);for(var e=0,r=n?n.length:0,i=new Array(r);e<r;++e)i[e]=Ee(t,n[e]);return i},hb=function(t){return function(){return t}},db=Math.abs,pb=Math.atan2,gb=Math.cos,_b=Math.max,vb=Math.min,yb=Math.sin,mb=Math.sqrt,bb=Math.PI,xb=bb/2,wb=2*bb;function Mb(t){return t>1?0:t<-1?bb:Math.acos(t)}function Tb(t){return t>=1?xb:t<=-1?-xb:Math.asin(t)}function kb(t){return t.innerRadius}function Ab(t){return t.outerRadius}function Nb(t){return t.startAngle}function Cb(t){return t.endAngle}function Sb(t){return t&&t.padAngle}function Eb(t,n,e,r,i,u,o,a){var c=e-t,f=r-n,s=o-i,l=a-u,h=l*c-s*f;if(!(h*h<1e-12))return[t+(h=(s*(n-u)-l*(t-i))/h)*c,n+h*f]}function Vb(t,n,e,r,i,u,o){var a=t-e,c=n-r,f=(o?u:-u)/mb(a*a+c*c),s=f*c,l=-f*a,h=t+s,d=n+l,p=e+s,g=r+l,_=(h+p)/2,v=(d+g)/2,y=p-h,m=g-d,b=y*y+m*m,x=i-u,w=h*g-p*d,M=(m<0?-1:1)*mb(_b(0,x*x*b-w*w)),T=(w*m-y*M)/b,k=(-w*y-m*M)/b,A=(w*m+y*M)/b,N=(-w*y+m*M)/b,C=T-_,S=k-v,E=A-_,V=N-v;return C*C+S*S>E*E+V*V&&(T=A,k=N),{cx:T,cy:k,x01:-s,y01:-l,x11:T*(i/x-1),y11:k*(i/x-1)}}var Pb=function(){var t=kb,n=Ab,e=hb(0),r=null,i=Nb,u=Cb,o=Sb,a=null;function c(){var c,f,s=+t.apply(this,arguments),l=+n.apply(this,arguments),h=i.apply(this,arguments)-xb,d=u.apply(this,arguments)-xb,p=db(d-h),g=d>h;if(a||(a=c=Fi()),l<s&&(f=l,l=s,s=f),l>1e-12)if(p>wb-1e-12)a.moveTo(l*gb(h),l*yb(h)),a.arc(0,0,l,h,d,!g),s>1e-12&&(a.moveTo(s*gb(d),s*yb(d)),a.arc(0,0,s,d,h,g));else{var _,v,y=h,m=d,b=h,x=d,w=p,M=p,T=o.apply(this,arguments)/2,k=T>1e-12&&(r?+r.apply(this,arguments):mb(s*s+l*l)),A=vb(db(l-s)/2,+e.apply(this,arguments)),N=A,C=A;if(k>1e-12){var S=Tb(k/s*yb(T)),E=Tb(k/l*yb(T));(w-=2*S)>1e-12?(b+=S*=g?1:-1,x-=S):(w=0,b=x=(h+d)/2),(M-=2*E)>1e-12?(y+=E*=g?1:-1,m-=E):(M=0,y=m=(h+d)/2)}var V=l*gb(y),P=l*yb(y),D=s*gb(x),z=s*yb(x);if(A>1e-12){var R,L=l*gb(m),Y=l*yb(m),U=s*gb(b),B=s*yb(b);if(p<bb&&(R=Eb(V,P,U,B,L,Y,D,z))){var I=V-R[0],O=P-R[1],F=L-R[0],q=Y-R[1],X=1/yb(Mb((I*F+O*q)/(mb(I*I+O*O)*mb(F*F+q*q)))/2),j=mb(R[0]*R[0]+R[1]*R[1]);N=vb(A,(s-j)/(X-1)),C=vb(A,(l-j)/(X+1))}}M>1e-12?C>1e-12?(_=Vb(U,B,V,P,l,C,g),v=Vb(L,Y,D,z,l,C,g),a.moveTo(_.cx+_.x01,_.cy+_.y01),C<A?a.arc(_.cx,_.cy,C,pb(_.y01,_.x01),pb(v.y01,v.x01),!g):(a.arc(_.cx,_.cy,C,pb(_.y01,_.x01),pb(_.y11,_.x11),!g),a.arc(0,0,l,pb(_.cy+_.y11,_.cx+_.x11),pb(v.cy+v.y11,v.cx+v.x11),!g),a.arc(v.cx,v.cy,C,pb(v.y11,v.x11),pb(v.y01,v.x01),!g))):(a.moveTo(V,P),a.arc(0,0,l,y,m,!g)):a.moveTo(V,P),s>1e-12&&w>1e-12?N>1e-12?(_=Vb(D,z,L,Y,s,-N,g),v=Vb(V,P,U,B,s,-N,g),a.lineTo(_.cx+_.x01,_.cy+_.y01),N<A?a.arc(_.cx,_.cy,N,pb(_.y01,_.x01),pb(v.y01,v.x01),!g):(a.arc(_.cx,_.cy,N,pb(_.y01,_.x01),pb(_.y11,_.x11),!g),a.arc(0,0,s,pb(_.cy+_.y11,_.cx+_.x11),pb(v.cy+v.y11,v.cx+v.x11),g),a.arc(v.cx,v.cy,N,pb(v.y11,v.x11),pb(v.y01,v.x01),!g))):a.arc(0,0,s,x,b,g):a.lineTo(D,z)}else a.moveTo(0,0);if(a.closePath(),c)return a=null,c+""||null}return c.centroid=function(){var e=(+t.apply(this,arguments)+ +n.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +u.apply(this,arguments))/2-bb/2;return[gb(r)*e,yb(r)*e]},c.innerRadius=function(n){return arguments.length?(t="function"==typeof n?n:hb(+n),c):t},c.outerRadius=function(t){return arguments.length?(n="function"==typeof t?t:hb(+t),c):n},c.cornerRadius=function(t){return arguments.length?(e="function"==typeof t?t:hb(+t),c):e},c.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:hb(+t),c):r},c.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:hb(+t),c):i},c.endAngle=function(t){return arguments.length?(u="function"==typeof t?t:hb(+t),c):u},c.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:hb(+t),c):o},c.context=function(t){return arguments.length?(a=null==t?null:t,c):a},c};function Db(t){this._context=t}Db.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n)}}};var zb=function(t){return new Db(t)};function Rb(t){return t[0]}function Lb(t){return t[1]}var Yb=function(){var t=Rb,n=Lb,e=hb(!0),r=null,i=zb,u=null;function o(o){var a,c,f,s=o.length,l=!1;for(null==r&&(u=i(f=Fi())),a=0;a<=s;++a)!(a<s&&e(c=o[a],a,o))===l&&((l=!l)?u.lineStart():u.lineEnd()),l&&u.point(+t(c,a,o),+n(c,a,o));if(f)return u=null,f+""||null}return o.x=function(n){return arguments.length?(t="function"==typeof n?n:hb(+n),o):t},o.y=function(t){return arguments.length?(n="function"==typeof t?t:hb(+t),o):n},o.defined=function(t){return arguments.length?(e="function"==typeof t?t:hb(!!t),o):e},o.curve=function(t){return arguments.length?(i=t,null!=r&&(u=i(r)),o):i},o.context=function(t){return arguments.length?(null==t?r=u=null:u=i(r=t),o):r},o},Ub=function(){var t=Rb,n=null,e=hb(0),r=Lb,i=hb(!0),u=null,o=zb,a=null;function c(c){var f,s,l,h,d,p=c.length,g=!1,_=new Array(p),v=new Array(p);for(null==u&&(a=o(d=Fi())),f=0;f<=p;++f){if(!(f<p&&i(h=c[f],f,c))===g)if(g=!g)s=f,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),l=f-1;l>=s;--l)a.point(_[l],v[l]);a.lineEnd(),a.areaEnd()}g&&(_[f]=+t(h,f,c),v[f]=+e(h,f,c),a.point(n?+n(h,f,c):_[f],r?+r(h,f,c):v[f]))}if(d)return a=null,d+""||null}function f(){return Yb().defined(i).curve(o).context(u)}return c.x=function(e){return arguments.length?(t="function"==typeof e?e:hb(+e),n=null,c):t},c.x0=function(n){return arguments.length?(t="function"==typeof n?n:hb(+n),c):t},c.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:hb(+t),c):n},c.y=function(t){return arguments.length?(e="function"==typeof t?t:hb(+t),r=null,c):e},c.y0=function(t){return arguments.length?(e="function"==typeof t?t:hb(+t),c):e},c.y1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:hb(+t),c):r},c.lineX0=c.lineY0=function(){return f().x(t).y(e)},c.lineY1=function(){return f().x(t).y(r)},c.lineX1=function(){return f().x(n).y(e)},c.defined=function(t){return arguments.length?(i="function"==typeof t?t:hb(!!t),c):i},c.curve=function(t){return arguments.length?(o=t,null!=u&&(a=o(u)),c):o},c.context=function(t){return arguments.length?(null==t?u=a=null:a=o(u=t),c):u},c},Bb=function(t,n){return n<t?-1:n>t?1:n>=t?0:NaN},Ib=function(t){return t},Ob=function(){var t=Ib,n=Bb,e=null,r=hb(0),i=hb(wb),u=hb(0);function o(o){var a,c,f,s,l,h=o.length,d=0,p=new Array(h),g=new Array(h),_=+r.apply(this,arguments),v=Math.min(wb,Math.max(-wb,i.apply(this,arguments)-_)),y=Math.min(Math.abs(v)/h,u.apply(this,arguments)),m=y*(v<0?-1:1);for(a=0;a<h;++a)(l=g[p[a]=a]=+t(o[a],a,o))>0&&(d+=l);for(null!=n?p.sort((function(t,e){return n(g[t],g[e])})):null!=e&&p.sort((function(t,n){return e(o[t],o[n])})),a=0,f=d?(v-h*m)/d:0;a<h;++a,_=s)c=p[a],s=_+((l=g[c])>0?l*f:0)+m,g[c]={data:o[c],index:a,value:l,startAngle:_,endAngle:s,padAngle:y};return g}return o.value=function(n){return arguments.length?(t="function"==typeof n?n:hb(+n),o):t},o.sortValues=function(t){return arguments.length?(n=t,e=null,o):n},o.sort=function(t){return arguments.length?(e=t,n=null,o):e},o.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:hb(+t),o):r},o.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:hb(+t),o):i},o.padAngle=function(t){return arguments.length?(u="function"==typeof t?t:hb(+t),o):u},o},Fb=Xb(zb);function qb(t){this._curve=t}function Xb(t){function n(n){return new qb(t(n))}return n._curve=t,n}function jb(t){var n=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?n(Xb(t)):n()._curve},t}qb.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}};var Hb=function(){return jb(Yb().curve(Fb))},Kb=function(){var t=Ub().curve(Fb),n=t.curve,e=t.lineX0,r=t.lineX1,i=t.lineY0,u=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return jb(e())},delete t.lineX0,t.lineEndAngle=function(){return jb(r())},delete t.lineX1,t.lineInnerRadius=function(){return jb(i())},delete t.lineY0,t.lineOuterRadius=function(){return jb(u())},delete t.lineY1,t.curve=function(t){return arguments.length?n(Xb(t)):n()._curve},t},Gb=function(t,n){return[(n=+n)*Math.cos(t-=Math.PI/2),n*Math.sin(t)]},Wb=Array.prototype.slice;function $b(t){return t.source}function Zb(t){return t.target}function Qb(t){var n=$b,e=Zb,r=Rb,i=Lb,u=null;function o(){var o,a=Wb.call(arguments),c=n.apply(this,a),f=e.apply(this,a);if(u||(u=o=Fi()),t(u,+r.apply(this,(a[0]=c,a)),+i.apply(this,a),+r.apply(this,(a[0]=f,a)),+i.apply(this,a)),o)return u=null,o+""||null}return o.source=function(t){return arguments.length?(n=t,o):n},o.target=function(t){return arguments.length?(e=t,o):e},o.x=function(t){return arguments.length?(r="function"==typeof t?t:hb(+t),o):r},o.y=function(t){return arguments.length?(i="function"==typeof t?t:hb(+t),o):i},o.context=function(t){return arguments.length?(u=null==t?null:t,o):u},o}function Jb(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n=(n+r)/2,e,n,i,r,i)}function tx(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n,e=(e+i)/2,r,e,r,i)}function nx(t,n,e,r,i){var u=Gb(n,e),o=Gb(n,e=(e+i)/2),a=Gb(r,e),c=Gb(r,i);t.moveTo(u[0],u[1]),t.bezierCurveTo(o[0],o[1],a[0],a[1],c[0],c[1])}function ex(){return Qb(Jb)}function rx(){return Qb(tx)}function ix(){var t=Qb(nx);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}var ux={draw:function(t,n){var e=Math.sqrt(n/bb);t.moveTo(e,0),t.arc(0,0,e,0,wb)}},ox={draw:function(t,n){var e=Math.sqrt(n/5)/2;t.moveTo(-3*e,-e),t.lineTo(-e,-e),t.lineTo(-e,-3*e),t.lineTo(e,-3*e),t.lineTo(e,-e),t.lineTo(3*e,-e),t.lineTo(3*e,e),t.lineTo(e,e),t.lineTo(e,3*e),t.lineTo(-e,3*e),t.lineTo(-e,e),t.lineTo(-3*e,e),t.closePath()}},ax=Math.sqrt(1/3),cx=2*ax,fx={draw:function(t,n){var e=Math.sqrt(n/cx),r=e*ax;t.moveTo(0,-e),t.lineTo(r,0),t.lineTo(0,e),t.lineTo(-r,0),t.closePath()}},sx=Math.sin(bb/10)/Math.sin(7*bb/10),lx=Math.sin(wb/10)*sx,hx=-Math.cos(wb/10)*sx,dx={draw:function(t,n){var e=Math.sqrt(.8908130915292852*n),r=lx*e,i=hx*e;t.moveTo(0,-e),t.lineTo(r,i);for(var u=1;u<5;++u){var o=wb*u/5,a=Math.cos(o),c=Math.sin(o);t.lineTo(c*e,-a*e),t.lineTo(a*r-c*i,c*r+a*i)}t.closePath()}},px={draw:function(t,n){var e=Math.sqrt(n),r=-e/2;t.rect(r,r,e,e)}},gx=Math.sqrt(3),_x={draw:function(t,n){var e=-Math.sqrt(n/(3*gx));t.moveTo(0,2*e),t.lineTo(-gx*e,-e),t.lineTo(gx*e,-e),t.closePath()}},vx=Math.sqrt(3)/2,yx=1/Math.sqrt(12),mx=3*(yx/2+1),bx={draw:function(t,n){var e=Math.sqrt(n/mx),r=e/2,i=e*yx,u=r,o=e*yx+e,a=-u,c=o;t.moveTo(r,i),t.lineTo(u,o),t.lineTo(a,c),t.lineTo(-.5*r-vx*i,vx*r+-.5*i),t.lineTo(-.5*u-vx*o,vx*u+-.5*o),t.lineTo(-.5*a-vx*c,vx*a+-.5*c),t.lineTo(-.5*r+vx*i,-.5*i-vx*r),t.lineTo(-.5*u+vx*o,-.5*o-vx*u),t.lineTo(-.5*a+vx*c,-.5*c-vx*a),t.closePath()}},xx=[ux,ox,fx,px,dx,_x,bx],wx=function(){var t=hb(ux),n=hb(64),e=null;function r(){var r;if(e||(e=r=Fi()),t.apply(this,arguments).draw(e,+n.apply(this,arguments)),r)return e=null,r+""||null}return r.type=function(n){return arguments.length?(t="function"==typeof n?n:hb(n),r):t},r.size=function(t){return arguments.length?(n="function"==typeof t?t:hb(+t),r):n},r.context=function(t){return arguments.length?(e=null==t?null:t,r):e},r},Mx=function(){};function Tx(t,n,e){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+e)/6)}function kx(t){this._context=t}kx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Tx(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Tx(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var Ax=function(t){return new kx(t)};function Nx(t){this._context=t}Nx.prototype={areaStart:Mx,areaEnd:Mx,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:Tx(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var Cx=function(t){return new Nx(t)};function Sx(t){this._context=t}Sx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var e=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break;case 3:this._point=4;default:Tx(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var Ex=function(t){return new Sx(t)};function Vx(t,n){this._basis=new kx(t),this._beta=n}Vx.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,e=t.length-1;if(e>0)for(var r,i=t[0],u=n[0],o=t[e]-i,a=n[e]-u,c=-1;++c<=e;)r=c/e,this._basis.point(this._beta*t[c]+(1-this._beta)*(i+r*o),this._beta*n[c]+(1-this._beta)*(u+r*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var Px=function t(n){function e(t){return 1===n?new kx(t):new Vx(t,n)}return e.beta=function(n){return t(+n)},e}(.85);function Dx(t,n,e){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-e),t._x2,t._y2)}function zx(t,n){this._context=t,this._k=(1-n)/6}zx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Dx(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:Dx(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Rx=function t(n){function e(t){return new zx(t,n)}return e.tension=function(n){return t(+n)},e}(0);function Lx(t,n){this._context=t,this._k=(1-n)/6}Lx.prototype={areaStart:Mx,areaEnd:Mx,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:Dx(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Yx=function t(n){function e(t){return new Lx(t,n)}return e.tension=function(n){return t(+n)},e}(0);function Ux(t,n){this._context=t,this._k=(1-n)/6}Ux.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Dx(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Bx=function t(n){function e(t){return new Ux(t,n)}return e.tension=function(n){return t(+n)},e}(0);function Ix(t,n,e){var r=t._x1,i=t._y1,u=t._x2,o=t._y2;if(t._l01_a>1e-12){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>1e-12){var f=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,s=3*t._l23_a*(t._l23_a+t._l12_a);u=(u*f+t._x1*t._l23_2a-n*t._l12_2a)/s,o=(o*f+t._y1*t._l23_2a-e*t._l12_2a)/s}t._context.bezierCurveTo(r,i,u,o,t._x2,t._y2)}function Ox(t,n){this._context=t,this._alpha=n}Ox.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:Ix(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Fx=function t(n){function e(t){return n?new Ox(t,n):new zx(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function qx(t,n){this._context=t,this._alpha=n}qx.prototype={areaStart:Mx,areaEnd:Mx,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:Ix(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Xx=function t(n){function e(t){return n?new qx(t,n):new Lx(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function jx(t,n){this._context=t,this._alpha=n}jx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ix(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Hx=function t(n){function e(t){return n?new jx(t,n):new Ux(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function Kx(t){this._context=t}Kx.prototype={areaStart:Mx,areaEnd:Mx,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,n){t=+t,n=+n,this._point?this._context.lineTo(t,n):(this._point=1,this._context.moveTo(t,n))}};var Gx=function(t){return new Kx(t)};function Wx(t){return t<0?-1:1}function $x(t,n,e){var r=t._x1-t._x0,i=n-t._x1,u=(t._y1-t._y0)/(r||i<0&&-0),o=(e-t._y1)/(i||r<0&&-0),a=(u*i+o*r)/(r+i);return(Wx(u)+Wx(o))*Math.min(Math.abs(u),Math.abs(o),.5*Math.abs(a))||0}function Zx(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function Qx(t,n,e){var r=t._x0,i=t._y0,u=t._x1,o=t._y1,a=(u-r)/3;t._context.bezierCurveTo(r+a,i+a*n,u-a,o-a*e,u,o)}function Jx(t){this._context=t}function tw(t){this._context=new nw(t)}function nw(t){this._context=t}function ew(t){return new Jx(t)}function rw(t){return new tw(t)}function iw(t){this._context=t}function uw(t){var n,e,r=t.length-1,i=new Array(r),u=new Array(r),o=new Array(r);for(i[0]=0,u[0]=2,o[0]=t[0]+2*t[1],n=1;n<r-1;++n)i[n]=1,u[n]=4,o[n]=4*t[n]+2*t[n+1];for(i[r-1]=2,u[r-1]=7,o[r-1]=8*t[r-1]+t[r],n=1;n<r;++n)e=i[n]/u[n-1],u[n]-=e,o[n]-=e*o[n-1];for(i[r-1]=o[r-1]/u[r-1],n=r-2;n>=0;--n)i[n]=(o[n]-i[n+1])/u[n];for(u[r-1]=(t[r]+i[r-1])/2,n=0;n<r-1;++n)u[n]=2*t[n+1]-i[n+1];return[i,u]}Jx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Qx(this,this._t0,Zx(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){var e=NaN;if(n=+n,(t=+t)!==this._x1||n!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,Qx(this,Zx(this,e=$x(this,t,n)),e);break;default:Qx(this,this._t0,e=$x(this,t,n))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n,this._t0=e}}},(tw.prototype=Object.create(Jx.prototype)).point=function(t,n){Jx.prototype.point.call(this,n,t)},nw.prototype={moveTo:function(t,n){this._context.moveTo(n,t)},closePath:function(){this._context.closePath()},lineTo:function(t,n){this._context.lineTo(n,t)},bezierCurveTo:function(t,n,e,r,i,u){this._context.bezierCurveTo(n,t,r,e,u,i)}},iw.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,n=this._y,e=t.length;if(e)if(this._line?this._context.lineTo(t[0],n[0]):this._context.moveTo(t[0],n[0]),2===e)this._context.lineTo(t[1],n[1]);else for(var r=uw(t),i=uw(n),u=0,o=1;o<e;++u,++o)this._context.bezierCurveTo(r[0][u],i[0][u],r[1][u],i[1][u],t[o],n[o]);(this._line||0!==this._line&&1===e)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var ow=function(t){return new iw(t)};function aw(t,n){this._context=t,this._t=n}aw.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,n)}}this._x=t,this._y=n}};var cw=function(t){return new aw(t,.5)};function fw(t){return new aw(t,0)}function sw(t){return new aw(t,1)}var lw=function(t,n){if((i=t.length)>1)for(var e,r,i,u=1,o=t[n[0]],a=o.length;u<i;++u)for(r=o,o=t[n[u]],e=0;e<a;++e)o[e][1]+=o[e][0]=isNaN(r[e][1])?r[e][0]:r[e][1]},hw=function(t){for(var n=t.length,e=new Array(n);--n>=0;)e[n]=n;return e};function dw(t,n){return t[n]}var pw=function(){var t=hb([]),n=hw,e=lw,r=dw;function i(i){var u,o,a=t.apply(this,arguments),c=i.length,f=a.length,s=new Array(f);for(u=0;u<f;++u){for(var l,h=a[u],d=s[u]=new Array(c),p=0;p<c;++p)d[p]=l=[0,+r(i[p],h,p,i)],l.data=i[p];d.key=h}for(u=0,o=n(s);u<f;++u)s[o[u]].index=u;return e(s,o),s}return i.keys=function(n){return arguments.length?(t="function"==typeof n?n:hb(Wb.call(n)),i):t},i.value=function(t){return arguments.length?(r="function"==typeof t?t:hb(+t),i):r},i.order=function(t){return arguments.length?(n=null==t?hw:"function"==typeof t?t:hb(Wb.call(t)),i):n},i.offset=function(t){return arguments.length?(e=null==t?lw:t,i):e},i},gw=function(t,n){if((r=t.length)>0){for(var e,r,i,u=0,o=t[0].length;u<o;++u){for(i=e=0;e<r;++e)i+=t[e][u][1]||0;if(i)for(e=0;e<r;++e)t[e][u][1]/=i}lw(t,n)}},_w=function(t,n){if((a=t.length)>0)for(var e,r,i,u,o,a,c=0,f=t[n[0]].length;c<f;++c)for(u=o=0,e=0;e<a;++e)(i=(r=t[n[e]][c])[1]-r[0])>0?(r[0]=u,r[1]=u+=i):i<0?(r[1]=o,r[0]=o+=i):(r[0]=0,r[1]=i)},vw=function(t,n){if((e=t.length)>0){for(var e,r=0,i=t[n[0]],u=i.length;r<u;++r){for(var o=0,a=0;o<e;++o)a+=t[o][r][1]||0;i[r][1]+=i[r][0]=-a/2}lw(t,n)}},yw=function(t,n){if((i=t.length)>0&&(r=(e=t[n[0]]).length)>0){for(var e,r,i,u=0,o=1;o<r;++o){for(var a=0,c=0,f=0;a<i;++a){for(var s=t[n[a]],l=s[o][1]||0,h=(l-(s[o-1][1]||0))/2,d=0;d<a;++d){var p=t[n[d]];h+=(p[o][1]||0)-(p[o-1][1]||0)}c+=l,f+=h*l}e[o-1][1]+=e[o-1][0]=u,c&&(u-=f/c)}e[o-1][1]+=e[o-1][0]=u,lw(t,n)}},mw=function(t){var n=t.map(bw);return hw(t).sort((function(t,e){return n[t]-n[e]}))};function bw(t){for(var n,e=-1,r=0,i=t.length,u=-1/0;++e<i;)(n=+t[e][1])>u&&(u=n,r=e);return r}var xw=function(t){var n=t.map(ww);return hw(t).sort((function(t,e){return n[t]-n[e]}))};function ww(t){for(var n,e=0,r=-1,i=t.length;++r<i;)(n=+t[r][1])&&(e+=n);return e}var Mw=function(t){return xw(t).reverse()},Tw=function(t){var n,e,r=t.length,i=t.map(ww),u=mw(t),o=0,a=0,c=[],f=[];for(n=0;n<r;++n)e=u[n],o<a?(o+=i[e],c.push(e)):(a+=i[e],f.push(e));return f.reverse().concat(c)},kw=function(t){return hw(t).reverse()};var Aw=Date.prototype.toISOString?function(t){return t.toISOString()}:X_("%Y-%m-%dT%H:%M:%S.%LZ");var Nw=+new Date("2000-01-01T00:00:00.000Z")?function(t){var n=new Date(t);return isNaN(n)?null:n}:j_("%Y-%m-%dT%H:%M:%S.%LZ"),Cw=function(t,n,e){var r=new qe,i=n;return null==n?(r.restart(t,n,e),r):(n=+n,e=null==e?Oe():+e,r.restart((function u(o){o+=i,r.restart(u,i+=n,e),t(o)}),n,e),r)},Sw=function(t){return function(){return t}};function Ew(t){return t[0]}function Vw(t){return t[1]}function Pw(){this._=null}function Dw(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function zw(t,n){var e=n,r=n.R,i=e.U;i?i.L===e?i.L=r:i.R=r:t._=r,r.U=i,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function Rw(t,n){var e=n,r=n.L,i=e.U;i?i.L===e?i.L=r:i.R=r:t._=r,r.U=i,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function Lw(t){for(;t.L;)t=t.L;return t}Pw.prototype={constructor:Pw,insert:function(t,n){var e,r,i;if(t){if(n.P=t,n.N=t.N,t.N&&(t.N.P=n),t.N=n,t.R){for(t=t.R;t.L;)t=t.L;t.L=n}else t.R=n;e=t}else this._?(t=Lw(this._),n.P=null,n.N=t,t.P=t.L=n,e=t):(n.P=n.N=null,this._=n,e=null);for(n.L=n.R=null,n.U=e,n.C=!0,t=n;e&&e.C;)e===(r=e.U).L?(i=r.R)&&i.C?(e.C=i.C=!1,r.C=!0,t=r):(t===e.R&&(zw(this,e),e=(t=e).U),e.C=!1,r.C=!0,Rw(this,r)):(i=r.L)&&i.C?(e.C=i.C=!1,r.C=!0,t=r):(t===e.L&&(Rw(this,e),e=(t=e).U),e.C=!1,r.C=!0,zw(this,r)),e=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var n,e,r,i=t.U,u=t.L,o=t.R;if(e=u?o?Lw(o):u:o,i?i.L===t?i.L=e:i.R=e:this._=e,u&&o?(r=e.C,e.C=t.C,e.L=u,u.U=e,e!==o?(i=e.U,e.U=t.U,t=e.R,i.L=t,e.R=o,o.U=e):(e.U=i,i=e,t=e.R)):(r=t.C,t=e),t&&(t.U=i),!r)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===i.L){if((n=i.R).C&&(n.C=!1,i.C=!0,zw(this,i),n=i.R),n.L&&n.L.C||n.R&&n.R.C){n.R&&n.R.C||(n.L.C=!1,n.C=!0,Rw(this,n),n=i.R),n.C=i.C,i.C=n.R.C=!1,zw(this,i),t=this._;break}}else if((n=i.L).C&&(n.C=!1,i.C=!0,Rw(this,i),n=i.L),n.L&&n.L.C||n.R&&n.R.C){n.L&&n.L.C||(n.R.C=!1,n.C=!0,zw(this,n),n=i.L),n.C=i.C,i.C=n.L.C=!1,Rw(this,i),t=this._;break}n.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}};var Yw=Pw;function Uw(t,n,e,r){var i=[null,null],u=cM.push(i)-1;return i.left=t,i.right=n,e&&Iw(i,t,n,e),r&&Iw(i,n,t,r),oM[t.index].halfedges.push(u),oM[n.index].halfedges.push(u),i}function Bw(t,n,e){var r=[n,e];return r.left=t,r}function Iw(t,n,e,r){t[0]||t[1]?t.left===e?t[1]=r:t[0]=r:(t[0]=r,t.left=n,t.right=e)}function Ow(t,n,e,r,i){var u,o=t[0],a=t[1],c=o[0],f=o[1],s=0,l=1,h=a[0]-c,d=a[1]-f;if(u=n-c,h||!(u>0)){if(u/=h,h<0){if(u<s)return;u<l&&(l=u)}else if(h>0){if(u>l)return;u>s&&(s=u)}if(u=r-c,h||!(u<0)){if(u/=h,h<0){if(u>l)return;u>s&&(s=u)}else if(h>0){if(u<s)return;u<l&&(l=u)}if(u=e-f,d||!(u>0)){if(u/=d,d<0){if(u<s)return;u<l&&(l=u)}else if(d>0){if(u>l)return;u>s&&(s=u)}if(u=i-f,d||!(u<0)){if(u/=d,d<0){if(u>l)return;u>s&&(s=u)}else if(d>0){if(u<s)return;u<l&&(l=u)}return!(s>0||l<1)||(s>0&&(t[0]=[c+s*h,f+s*d]),l<1&&(t[1]=[c+l*h,f+l*d]),!0)}}}}}function Fw(t,n,e,r,i){var u=t[1];if(u)return!0;var o,a,c=t[0],f=t.left,s=t.right,l=f[0],h=f[1],d=s[0],p=s[1],g=(l+d)/2,_=(h+p)/2;if(p===h){if(g<n||g>=r)return;if(l>d){if(c){if(c[1]>=i)return}else c=[g,e];u=[g,i]}else{if(c){if(c[1]<e)return}else c=[g,i];u=[g,e]}}else if(a=_-(o=(l-d)/(p-h))*g,o<-1||o>1)if(l>d){if(c){if(c[1]>=i)return}else c=[(e-a)/o,e];u=[(i-a)/o,i]}else{if(c){if(c[1]<e)return}else c=[(i-a)/o,i];u=[(e-a)/o,e]}else if(h<p){if(c){if(c[0]>=r)return}else c=[n,o*n+a];u=[r,o*r+a]}else{if(c){if(c[0]<n)return}else c=[r,o*r+a];u=[n,o*n+a]}return t[0]=c,t[1]=u,!0}function qw(t,n){var e=t.site,r=n.left,i=n.right;return e===i&&(i=r,r=e),i?Math.atan2(i[1]-r[1],i[0]-r[0]):(e===r?(r=n[1],i=n[0]):(r=n[0],i=n[1]),Math.atan2(r[0]-i[0],i[1]-r[1]))}function Xw(t,n){return n[+(n.left!==t.site)]}function jw(t,n){return n[+(n.left===t.site)]}var Hw,Kw=[];function Gw(){Dw(this),this.x=this.y=this.arc=this.site=this.cy=null}function Ww(t){var n=t.P,e=t.N;if(n&&e){var r=n.site,i=t.site,u=e.site;if(r!==u){var o=i[0],a=i[1],c=r[0]-o,f=r[1]-a,s=u[0]-o,l=u[1]-a,h=2*(c*l-f*s);if(!(h>=-sM)){var d=c*c+f*f,p=s*s+l*l,g=(l*d-f*p)/h,_=(c*p-s*d)/h,v=Kw.pop()||new Gw;v.arc=t,v.site=i,v.x=g+o,v.y=(v.cy=_+a)+Math.sqrt(g*g+_*_),t.circle=v;for(var y=null,m=aM._;m;)if(v.y<m.y||v.y===m.y&&v.x<=m.x){if(!m.L){y=m.P;break}m=m.L}else{if(!m.R){y=m;break}m=m.R}aM.insert(y,v),y||(Hw=v)}}}}function $w(t){var n=t.circle;n&&(n.P||(Hw=n.N),aM.remove(n),Kw.push(n),Dw(n),t.circle=null)}var Zw=[];function Qw(){Dw(this),this.edge=this.site=this.circle=null}function Jw(t){var n=Zw.pop()||new Qw;return n.site=t,n}function tM(t){$w(t),uM.remove(t),Zw.push(t),Dw(t)}function nM(t){var n=t.circle,e=n.x,r=n.cy,i=[e,r],u=t.P,o=t.N,a=[t];tM(t);for(var c=u;c.circle&&Math.abs(e-c.circle.x)<fM&&Math.abs(r-c.circle.cy)<fM;)u=c.P,a.unshift(c),tM(c),c=u;a.unshift(c),$w(c);for(var f=o;f.circle&&Math.abs(e-f.circle.x)<fM&&Math.abs(r-f.circle.cy)<fM;)o=f.N,a.push(f),tM(f),f=o;a.push(f),$w(f);var s,l=a.length;for(s=1;s<l;++s)f=a[s],c=a[s-1],Iw(f.edge,c.site,f.site,i);c=a[0],(f=a[l-1]).edge=Uw(c.site,f.site,null,i),Ww(c),Ww(f)}function eM(t){for(var n,e,r,i,u=t[0],o=t[1],a=uM._;a;)if((r=rM(a,o)-u)>fM)a=a.L;else{if(!((i=u-iM(a,o))>fM)){r>-fM?(n=a.P,e=a):i>-fM?(n=a,e=a.N):n=e=a;break}if(!a.R){n=a;break}a=a.R}!function(t){oM[t.index]={site:t,halfedges:[]}}(t);var c=Jw(t);if(uM.insert(n,c),n||e){if(n===e)return $w(n),e=Jw(n.site),uM.insert(c,e),c.edge=e.edge=Uw(n.site,c.site),Ww(n),void Ww(e);if(e){$w(n),$w(e);var f=n.site,s=f[0],l=f[1],h=t[0]-s,d=t[1]-l,p=e.site,g=p[0]-s,_=p[1]-l,v=2*(h*_-d*g),y=h*h+d*d,m=g*g+_*_,b=[(_*y-d*m)/v+s,(h*m-g*y)/v+l];Iw(e.edge,f,p,b),c.edge=Uw(f,t,null,b),e.edge=Uw(t,p,null,b),Ww(n),Ww(e)}else c.edge=Uw(n.site,c.site)}}function rM(t,n){var e=t.site,r=e[0],i=e[1],u=i-n;if(!u)return r;var o=t.P;if(!o)return-1/0;var a=(e=o.site)[0],c=e[1],f=c-n;if(!f)return a;var s=a-r,l=1/u-1/f,h=s/f;return l?(-h+Math.sqrt(h*h-2*l*(s*s/(-2*f)-c+f/2+i-u/2)))/l+r:(r+a)/2}function iM(t,n){var e=t.N;if(e)return rM(e,n);var r=t.site;return r[1]===n?r[0]:1/0}var uM,oM,aM,cM,fM=1e-6,sM=1e-12;function lM(t,n){return n[1]-t[1]||n[0]-t[0]}function hM(t,n){var e,r,i,u=t.sort(lM).pop();for(cM=[],oM=new Array(t.length),uM=new Yw,aM=new Yw;;)if(i=Hw,u&&(!i||u[1]<i.y||u[1]===i.y&&u[0]<i.x))u[0]===e&&u[1]===r||(eM(u),e=u[0],r=u[1]),u=t.pop();else{if(!i)break;nM(i.arc)}if(function(){for(var t,n,e,r,i=0,u=oM.length;i<u;++i)if((t=oM[i])&&(r=(n=t.halfedges).length)){var o=new Array(r),a=new Array(r);for(e=0;e<r;++e)o[e]=e,a[e]=qw(t,cM[n[e]]);for(o.sort((function(t,n){return a[n]-a[t]})),e=0;e<r;++e)a[e]=n[o[e]];for(e=0;e<r;++e)n[e]=a[e]}}(),n){var o=+n[0][0],a=+n[0][1],c=+n[1][0],f=+n[1][1];!function(t,n,e,r){for(var i,u=cM.length;u--;)Fw(i=cM[u],t,n,e,r)&&Ow(i,t,n,e,r)&&(Math.abs(i[0][0]-i[1][0])>fM||Math.abs(i[0][1]-i[1][1])>fM)||delete cM[u]}(o,a,c,f),function(t,n,e,r){var i,u,o,a,c,f,s,l,h,d,p,g,_=oM.length,v=!0;for(i=0;i<_;++i)if(u=oM[i]){for(o=u.site,a=(c=u.halfedges).length;a--;)cM[c[a]]||c.splice(a,1);for(a=0,f=c.length;a<f;)p=(d=jw(u,cM[c[a]]))[0],g=d[1],l=(s=Xw(u,cM[c[++a%f]]))[0],h=s[1],(Math.abs(p-l)>fM||Math.abs(g-h)>fM)&&(c.splice(a,0,cM.push(Bw(o,d,Math.abs(p-t)<fM&&r-g>fM?[t,Math.abs(l-t)<fM?h:r]:Math.abs(g-r)<fM&&e-p>fM?[Math.abs(h-r)<fM?l:e,r]:Math.abs(p-e)<fM&&g-n>fM?[e,Math.abs(l-e)<fM?h:n]:Math.abs(g-n)<fM&&p-t>fM?[Math.abs(h-n)<fM?l:t,n]:null))-1),++f);f&&(v=!1)}if(v){var y,m,b,x=1/0;for(i=0,v=null;i<_;++i)(u=oM[i])&&(b=(y=(o=u.site)[0]-t)*y+(m=o[1]-n)*m)<x&&(x=b,v=u);if(v){var w=[t,n],M=[t,r],T=[e,r],k=[e,n];v.halfedges.push(cM.push(Bw(o=v.site,w,M))-1,cM.push(Bw(o,M,T))-1,cM.push(Bw(o,T,k))-1,cM.push(Bw(o,k,w))-1)}}for(i=0;i<_;++i)(u=oM[i])&&(u.halfedges.length||delete oM[i])}(o,a,c,f)}this.edges=cM,this.cells=oM,uM=aM=cM=oM=null}hM.prototype={constructor:hM,polygons:function(){var t=this.edges;return this.cells.map((function(n){var e=n.halfedges.map((function(e){return Xw(n,t[e])}));return e.data=n.site.data,e}))},triangles:function(){var t=[],n=this.edges;return this.cells.forEach((function(e,r){if(u=(i=e.halfedges).length)for(var i,u,o,a,c,f,s=e.site,l=-1,h=n[i[u-1]],d=h.left===s?h.right:h.left;++l<u;)o=d,d=(h=n[i[l]]).left===s?h.right:h.left,o&&d&&r<o.index&&r<d.index&&(c=o,f=d,((a=s)[0]-f[0])*(c[1]-a[1])-(a[0]-c[0])*(f[1]-a[1])<0)&&t.push([s.data,o.data,d.data])})),t},links:function(){return this.edges.filter((function(t){return t.right})).map((function(t){return{source:t.left.data,target:t.right.data}}))},find:function(t,n,e){for(var r,i,u=this,o=u._found||0,a=u.cells.length;!(i=u.cells[o]);)if(++o>=a)return null;var c=t-i.site[0],f=n-i.site[1],s=c*c+f*f;do{i=u.cells[r=o],o=null,i.halfedges.forEach((function(e){var r=u.edges[e],a=r.left;if(a!==i.site&&a||(a=r.right)){var c=t-a[0],f=n-a[1],l=c*c+f*f;l<s&&(s=l,o=a.index)}}))}while(null!==o);return u._found=r,null==e||s<=e*e?i.site:null}};var dM=function(){var t=Ew,n=Vw,e=null;function r(r){return new hM(r.map((function(e,i){var u=[Math.round(t(e,i,r)/fM)*fM,Math.round(n(e,i,r)/fM)*fM];return u.index=i,u.data=e,u})),e)}return r.polygons=function(t){return r(t).polygons()},r.links=function(t){return r(t).links()},r.triangles=function(t){return r(t).triangles()},r.x=function(n){return arguments.length?(t="function"==typeof n?n:Sw(+n),r):t},r.y=function(t){return arguments.length?(n="function"==typeof t?t:Sw(+t),r):n},r.extent=function(t){return arguments.length?(e=null==t?null:[[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]],r):e&&[[e[0][0],e[0][1]],[e[1][0],e[1][1]]]},r.size=function(t){return arguments.length?(e=null==t?null:[[0,0],[+t[0],+t[1]]],r):e&&[e[1][0]-e[0][0],e[1][1]-e[0][1]]},r},pM=function(t){return function(){return t}};function gM(t,n,e){this.target=t,this.type=n,this.transform=e}function _M(t,n,e){this.k=t,this.x=n,this.y=e}_M.prototype={constructor:_M,scale:function(t){return 1===t?this:new _M(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new _M(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var vM=new _M(1,0,0);function yM(t){for(;!t.__zoom;)if(!(t=t.parentNode))return vM;return t.__zoom}function mM(){fn.stopImmediatePropagation()}yM.prototype=_M.prototype;var bM=function(){fn.preventDefault(),fn.stopImmediatePropagation()};function xM(){return!fn.ctrlKey&&!fn.button}function wM(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function MM(){return this.__zoom||vM}function TM(){return-fn.deltaY*(1===fn.deltaMode?.05:fn.deltaMode?1:.002)}function kM(){return navigator.maxTouchPoints||"ontouchstart"in this}function AM(t,n,e){var r=t.invertX(n[0][0])-e[0][0],i=t.invertX(n[1][0])-e[1][0],u=t.invertY(n[0][1])-e[0][1],o=t.invertY(n[1][1])-e[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>u?(u+o)/2:Math.min(0,u)||Math.max(0,o))}var NM=function(){var t,n,e=xM,r=wM,i=AM,u=TM,o=kM,a=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],f=250,s=hp,l=st("start","zoom","end"),h=0;function d(t){t.property("__zoom",MM).on("wheel.zoom",b).on("mousedown.zoom",x).on("dblclick.zoom",w).filter(o).on("touchstart.zoom",M).on("touchmove.zoom",T).on("touchend.zoom touchcancel.zoom",k).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(t,n){return(n=Math.max(a[0],Math.min(a[1],n)))===t.k?t:new _M(n,t.x,t.y)}function g(t,n,e){var r=n[0]-e[0]*t.k,i=n[1]-e[1]*t.k;return r===t.x&&i===t.y?t:new _M(t.k,r,i)}function _(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function v(t,n,e){t.on("start.zoom",(function(){y(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){y(this,arguments).end()})).tween("zoom",(function(){var t=this,i=arguments,u=y(t,i),o=r.apply(t,i),a=null==e?_(o):"function"==typeof e?e.apply(t,i):e,c=Math.max(o[1][0]-o[0][0],o[1][1]-o[0][1]),f=t.__zoom,l="function"==typeof n?n.apply(t,i):n,h=s(f.invert(a).concat(c/f.k),l.invert(a).concat(c/l.k));return function(t){if(1===t)t=l;else{var n=h(t),e=c/n[2];t=new _M(e,a[0]-n[0]*e,a[1]-n[1]*e)}u.zoom(null,t)}}))}function y(t,n,e){return!e&&t.__zooming||new m(t,n)}function m(t,n){this.that=t,this.args=n,this.active=0,this.extent=r.apply(t,n),this.taps=0}function b(){if(e.apply(this,arguments)){var t=y(this,arguments),n=this.__zoom,r=Math.max(a[0],Math.min(a[1],n.k*Math.pow(2,u.apply(this,arguments)))),o=Pe(this);if(t.wheel)t.mouse[0][0]===o[0]&&t.mouse[0][1]===o[1]||(t.mouse[1]=n.invert(t.mouse[0]=o)),clearTimeout(t.wheel);else{if(n.k===r)return;t.mouse=[o,n.invert(o)],or(this),t.start()}bM(),t.wheel=setTimeout(f,150),t.zoom("mouse",i(g(p(n,r),t.mouse[0],t.mouse[1]),t.extent,c))}function f(){t.wheel=null,t.end()}}function x(){if(!n&&e.apply(this,arguments)){var t=y(this,arguments,!0),r=Mn(fn.view).on("mousemove.zoom",f,!0).on("mouseup.zoom",s,!0),u=Pe(this),o=fn.clientX,a=fn.clientY;An(fn.view),mM(),t.mouse=[u,this.__zoom.invert(u)],or(this),t.start()}function f(){if(bM(),!t.moved){var n=fn.clientX-o,e=fn.clientY-a;t.moved=n*n+e*e>h}t.zoom("mouse",i(g(t.that.__zoom,t.mouse[0]=Pe(t.that),t.mouse[1]),t.extent,c))}function s(){r.on("mousemove.zoom mouseup.zoom",null),Nn(fn.view,t.moved),bM(),t.end()}}function w(){if(e.apply(this,arguments)){var t=this.__zoom,n=Pe(this),u=t.invert(n),o=t.k*(fn.shiftKey?.5:2),a=i(g(p(t,o),n,u),r.apply(this,arguments),c);bM(),f>0?Mn(this).transition().duration(f).call(v,a,n):Mn(this).call(d.transform,a)}}function M(){if(e.apply(this,arguments)){var n,r,i,u,o=fn.touches,a=o.length,c=y(this,arguments,fn.changedTouches.length===a);for(mM(),r=0;r<a;++r)i=o[r],u=[u=Ve(this,o,i.identifier),this.__zoom.invert(u),i.identifier],c.touch0?c.touch1||c.touch0[2]===u[2]||(c.touch1=u,c.taps=0):(c.touch0=u,n=!0,c.taps=1+!!t);t&&(t=clearTimeout(t)),n&&(c.taps<2&&(t=setTimeout((function(){t=null}),500)),or(this),c.start())}}function T(){if(this.__zooming){var n,e,r,u,o=y(this,arguments),a=fn.changedTouches,f=a.length;for(bM(),t&&(t=clearTimeout(t)),o.taps=0,n=0;n<f;++n)e=a[n],r=Ve(this,a,e.identifier),o.touch0&&o.touch0[2]===e.identifier?o.touch0[0]=r:o.touch1&&o.touch1[2]===e.identifier&&(o.touch1[0]=r);if(e=o.that.__zoom,o.touch1){var s=o.touch0[0],l=o.touch0[1],h=o.touch1[0],d=o.touch1[1],_=(_=h[0]-s[0])*_+(_=h[1]-s[1])*_,v=(v=d[0]-l[0])*v+(v=d[1]-l[1])*v;e=p(e,Math.sqrt(_/v)),r=[(s[0]+h[0])/2,(s[1]+h[1])/2],u=[(l[0]+d[0])/2,(l[1]+d[1])/2]}else{if(!o.touch0)return;r=o.touch0[0],u=o.touch0[1]}o.zoom("touch",i(g(e,r,u),o.extent,c))}}function k(){if(this.__zooming){var t,e,r=y(this,arguments),i=fn.changedTouches,u=i.length;for(mM(),n&&clearTimeout(n),n=setTimeout((function(){n=null}),500),t=0;t<u;++t)e=i[t],r.touch0&&r.touch0[2]===e.identifier?delete r.touch0:r.touch1&&r.touch1[2]===e.identifier&&delete r.touch1;if(r.touch1&&!r.touch0&&(r.touch0=r.touch1,delete r.touch1),r.touch0)r.touch0[1]=this.__zoom.invert(r.touch0[0]);else if(r.end(),2===r.taps){var o=Mn(this).on("dblclick.zoom");o&&o.apply(this,arguments)}}}return d.transform=function(t,n,e){var r=t.selection?t.selection():t;r.property("__zoom",MM),t!==r?v(t,n,e):r.interrupt().each((function(){y(this,arguments).start().zoom(null,"function"==typeof n?n.apply(this,arguments):n).end()}))},d.scaleBy=function(t,n,e){d.scaleTo(t,(function(){var t=this.__zoom.k,e="function"==typeof n?n.apply(this,arguments):n;return t*e}),e)},d.scaleTo=function(t,n,e){d.transform(t,(function(){var t=r.apply(this,arguments),u=this.__zoom,o=null==e?_(t):"function"==typeof e?e.apply(this,arguments):e,a=u.invert(o),f="function"==typeof n?n.apply(this,arguments):n;return i(g(p(u,f),o,a),t,c)}),e)},d.translateBy=function(t,n,e){d.transform(t,(function(){return i(this.__zoom.translate("function"==typeof n?n.apply(this,arguments):n,"function"==typeof e?e.apply(this,arguments):e),r.apply(this,arguments),c)}))},d.translateTo=function(t,n,e,u){d.transform(t,(function(){var t=r.apply(this,arguments),o=this.__zoom,a=null==u?_(t):"function"==typeof u?u.apply(this,arguments):u;return i(vM.translate(a[0],a[1]).scale(o.k).translate("function"==typeof n?-n.apply(this,arguments):-n,"function"==typeof e?-e.apply(this,arguments):-e),t,c)}),u)},m.prototype={start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,n){return this.mouse&&"mouse"!==t&&(this.mouse[1]=n.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=n.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=n.invert(this.touch1[0])),this.that.__zoom=n,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){gn(new gM(d,t,this.that.__zoom),l.apply,l,[t,this.that,this.args])}},d.wheelDelta=function(t){return arguments.length?(u="function"==typeof t?t:pM(+t),d):u},d.filter=function(t){return arguments.length?(e="function"==typeof t?t:pM(!!t),d):e},d.touchable=function(t){return arguments.length?(o="function"==typeof t?t:pM(!!t),d):o},d.extent=function(t){return arguments.length?(r="function"==typeof t?t:pM([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),d):r},d.scaleExtent=function(t){return arguments.length?(a[0]=+t[0],a[1]=+t[1],d):[a[0],a[1]]},d.translateExtent=function(t){return arguments.length?(c[0][0]=+t[0][0],c[1][0]=+t[1][0],c[0][1]=+t[0][1],c[1][1]=+t[1][1],d):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},d.constrain=function(t){return arguments.length?(i=t,d):i},d.duration=function(t){return arguments.length?(f=+t,d):f},d.interpolate=function(t){return arguments.length?(s=t,d):s},d.on=function(){var t=l.on.apply(l,arguments);return t===l?d:t},d.clickDistance=function(t){return arguments.length?(h=(t=+t)*t,d):Math.sqrt(h)},d};e.d(n,"version",(function(){return"5.15.0"})),e.d(n,"bisect",(function(){return c})),e.d(n,"bisectRight",(function(){return o})),e.d(n,"bisectLeft",(function(){return a})),e.d(n,"ascending",(function(){return r})),e.d(n,"bisector",(function(){return i})),e.d(n,"cross",(function(){return l})),e.d(n,"descending",(function(){return h})),e.d(n,"deviation",(function(){return g})),e.d(n,"extent",(function(){return _})),e.d(n,"histogram",(function(){return E})),e.d(n,"thresholdFreedmanDiaconis",(function(){return P})),e.d(n,"thresholdScott",(function(){return D})),e.d(n,"thresholdSturges",(function(){return S})),e.d(n,"max",(function(){return z})),e.d(n,"mean",(function(){return R})),e.d(n,"median",(function(){return L})),e.d(n,"merge",(function(){return Y})),e.d(n,"min",(function(){return U})),e.d(n,"pairs",(function(){return f})),e.d(n,"permute",(function(){return B})),e.d(n,"quantile",(function(){return V})),e.d(n,"range",(function(){return w})),e.d(n,"scan",(function(){return I})),e.d(n,"shuffle",(function(){return O})),e.d(n,"sum",(function(){return F})),e.d(n,"ticks",(function(){return A})),e.d(n,"tickIncrement",(function(){return N})),e.d(n,"tickStep",(function(){return C})),e.d(n,"transpose",(function(){return q})),e.d(n,"variance",(function(){return p})),e.d(n,"zip",(function(){return j})),e.d(n,"axisTop",(function(){return tt})),e.d(n,"axisRight",(function(){return nt})),e.d(n,"axisBottom",(function(){return et})),e.d(n,"axisLeft",(function(){return rt})),e.d(n,"brush",(function(){return ki})),e.d(n,"brushX",(function(){return Mi})),e.d(n,"brushY",(function(){return Ti})),e.d(n,"brushSelection",(function(){return wi})),e.d(n,"chord",(function(){return zi})),e.d(n,"ribbon",(function(){return Gi})),e.d(n,"nest",(function(){return Qi})),e.d(n,"set",(function(){return ou})),e.d(n,"map",(function(){return Zi})),e.d(n,"keys",(function(){return au})),e.d(n,"values",(function(){return cu})),e.d(n,"entries",(function(){return fu})),e.d(n,"color",(function(){return Xn})),e.d(n,"rgb",(function(){return Gn})),e.d(n,"hsl",(function(){return ne})),e.d(n,"lab",(function(){return pu})),e.d(n,"hcl",(function(){return wu})),e.d(n,"lch",(function(){return xu})),e.d(n,"gray",(function(){return du})),e.d(n,"cubehelix",(function(){return Eu})),e.d(n,"contours",(function(){return Iu})),e.d(n,"contourDensity",(function(){return Hu})),e.d(n,"dispatch",(function(){return st})),e.d(n,"drag",(function(){return Ju})),e.d(n,"dragDisable",(function(){return An})),e.d(n,"dragEnable",(function(){return Nn})),e.d(n,"dsvFormat",(function(){return oo})),e.d(n,"csvParse",(function(){return co})),e.d(n,"csvParseRows",(function(){return fo})),e.d(n,"csvFormat",(function(){return so})),e.d(n,"csvFormatBody",(function(){return lo})),e.d(n,"csvFormatRows",(function(){return ho})),e.d(n,"csvFormatRow",(function(){return po})),e.d(n,"csvFormatValue",(function(){return go})),e.d(n,"tsvParse",(function(){return vo})),e.d(n,"tsvParseRows",(function(){return yo})),e.d(n,"tsvFormat",(function(){return mo})),e.d(n,"tsvFormatBody",(function(){return bo})),e.d(n,"tsvFormatRows",(function(){return xo})),e.d(n,"tsvFormatRow",(function(){return wo})),e.d(n,"tsvFormatValue",(function(){return Mo})),e.d(n,"autoType",(function(){return To})),e.d(n,"easeLinear",(function(){return Ao})),e.d(n,"easeQuad",(function(){return So})),e.d(n,"easeQuadIn",(function(){return No})),e.d(n,"easeQuadOut",(function(){return Co})),e.d(n,"easeQuadInOut",(function(){return So})),e.d(n,"easeCubic",(function(){return Hr})),e.d(n,"easeCubicIn",(function(){return Xr})),e.d(n,"easeCubicOut",(function(){return jr})),e.d(n,"easeCubicInOut",(function(){return Hr})),e.d(n,"easePoly",(function(){return Po})),e.d(n,"easePolyIn",(function(){return Eo})),e.d(n,"easePolyOut",(function(){return Vo})),e.d(n,"easePolyInOut",(function(){return Po})),e.d(n,"easeSin",(function(){return Yo})),e.d(n,"easeSinIn",(function(){return Ro})),e.d(n,"easeSinOut",(function(){return Lo})),e.d(n,"easeSinInOut",(function(){return Yo})),e.d(n,"easeExp",(function(){return Io})),e.d(n,"easeExpIn",(function(){return Uo})),e.d(n,"easeExpOut",(function(){return Bo})),e.d(n,"easeExpInOut",(function(){return Io})),e.d(n,"easeCircle",(function(){return qo})),e.d(n,"easeCircleIn",(function(){return Oo})),e.d(n,"easeCircleOut",(function(){return Fo})),e.d(n,"easeCircleInOut",(function(){return qo})),e.d(n,"easeBounce",(function(){return jo})),e.d(n,"easeBounceIn",(function(){return Xo})),e.d(n,"easeBounceOut",(function(){return jo})),e.d(n,"easeBounceInOut",(function(){return Ho})),e.d(n,"easeBack",(function(){return Wo})),e.d(n,"easeBackIn",(function(){return Ko})),e.d(n,"easeBackOut",(function(){return Go})),e.d(n,"easeBackInOut",(function(){return Wo})),e.d(n,"easeElastic",(function(){return Qo})),e.d(n,"easeElasticIn",(function(){return Zo})),e.d(n,"easeElasticOut",(function(){return Qo})),e.d(n,"easeElasticInOut",(function(){return Jo})),e.d(n,"blob",(function(){return na})),e.d(n,"buffer",(function(){return ra})),e.d(n,"dsv",(function(){return aa})),e.d(n,"csv",(function(){return ca})),e.d(n,"tsv",(function(){return fa})),e.d(n,"image",(function(){return sa})),e.d(n,"json",(function(){return ha})),e.d(n,"text",(function(){return ua})),e.d(n,"xml",(function(){return pa})),e.d(n,"html",(function(){return ga})),e.d(n,"svg",(function(){return _a})),e.d(n,"forceCenter",(function(){return va})),e.d(n,"forceCollide",(function(){return Ea})),e.d(n,"forceLink",(function(){return Da})),e.d(n,"forceManyBody",(function(){return Ua})),e.d(n,"forceRadial",(function(){return Ba})),e.d(n,"forceSimulation",(function(){return Ya})),e.d(n,"forceX",(function(){return Ia})),e.d(n,"forceY",(function(){return Oa})),e.d(n,"formatDefaultLocale",(function(){return rc})),e.d(n,"format",(function(){return Wa})),e.d(n,"formatPrefix",(function(){return $a})),e.d(n,"formatLocale",(function(){return ec})),e.d(n,"formatSpecifier",(function(){return ja})),e.d(n,"FormatSpecifier",(function(){return Ha})),e.d(n,"precisionFixed",(function(){return ic})),e.d(n,"precisionPrefix",(function(){return uc})),e.d(n,"precisionRound",(function(){return oc})),e.d(n,"geoArea",(function(){return Zc})),e.d(n,"geoBounds",(function(){return Xf})),e.d(n,"geoCentroid",(function(){return es})),e.d(n,"geoCircle",(function(){return ds})),e.d(n,"geoClipAntimeridian",(function(){return ks})),e.d(n,"geoClipCircle",(function(){return As})),e.d(n,"geoClipExtent",(function(){return Vs})),e.d(n,"geoClipRectangle",(function(){return Ns})),e.d(n,"geoContains",(function(){return Ws})),e.d(n,"geoDistance",(function(){return Is})),e.d(n,"geoGraticule",(function(){return Qs})),e.d(n,"geoGraticule10",(function(){return Js})),e.d(n,"geoInterpolate",(function(){return il})),e.d(n,"geoLength",(function(){return Ys})),e.d(n,"geoPath",(function(){return eh})),e.d(n,"geoAlbers",(function(){return xh})),e.d(n,"geoAlbersUsa",(function(){return wh})),e.d(n,"geoAzimuthalEqualArea",(function(){return Ah})),e.d(n,"geoAzimuthalEqualAreaRaw",(function(){return kh})),e.d(n,"geoAzimuthalEquidistant",(function(){return Ch})),e.d(n,"geoAzimuthalEquidistantRaw",(function(){return Nh})),e.d(n,"geoConicConformal",(function(){return zh})),e.d(n,"geoConicConformalRaw",(function(){return Dh})),e.d(n,"geoConicEqualArea",(function(){return bh})),e.d(n,"geoConicEqualAreaRaw",(function(){return mh})),e.d(n,"geoConicEquidistant",(function(){return Uh})),e.d(n,"geoConicEquidistantRaw",(function(){return Yh})),e.d(n,"geoEqualEarth",(function(){return jh})),e.d(n,"geoEqualEarthRaw",(function(){return Xh})),e.d(n,"geoEquirectangular",(function(){return Lh})),e.d(n,"geoEquirectangularRaw",(function(){return Rh})),e.d(n,"geoGnomonic",(function(){return Kh})),e.d(n,"geoGnomonicRaw",(function(){return Hh})),e.d(n,"geoIdentity",(function(){return Wh})),e.d(n,"geoProjection",(function(){return _h})),e.d(n,"geoProjectionMutator",(function(){return vh})),e.d(n,"geoMercator",(function(){return Eh})),e.d(n,"geoMercatorRaw",(function(){return Sh})),e.d(n,"geoNaturalEarth1",(function(){return Zh})),e.d(n,"geoNaturalEarth1Raw",(function(){return $h})),e.d(n,"geoOrthographic",(function(){return Jh})),e.d(n,"geoOrthographicRaw",(function(){return Qh})),e.d(n,"geoStereographic",(function(){return nd})),e.d(n,"geoStereographicRaw",(function(){return td})),e.d(n,"geoTransverseMercator",(function(){return rd})),e.d(n,"geoTransverseMercatorRaw",(function(){return ed})),e.d(n,"geoRotation",(function(){return ss})),e.d(n,"geoStream",(function(){return qc})),e.d(n,"geoTransform",(function(){return rh})),e.d(n,"cluster",(function(){return ad})),e.d(n,"hierarchy",(function(){return fd})),e.d(n,"pack",(function(){return zd})),e.d(n,"packSiblings",(function(){return Cd})),e.d(n,"packEnclose",(function(){return gd})),e.d(n,"partition",(function(){return Id})),e.d(n,"stratify",(function(){return jd})),e.d(n,"tree",(function(){return Qd})),e.d(n,"treemap",(function(){return rp})),e.d(n,"treemapBinary",(function(){return ip})),e.d(n,"treemapDice",(function(){return Bd})),e.d(n,"treemapSlice",(function(){return Jd})),e.d(n,"treemapSliceDice",(function(){return up})),e.d(n,"treemapSquarify",(function(){return ep})),e.d(n,"treemapResquarify",(function(){return op})),e.d(n,"interpolate",(function(){return Ce})),e.d(n,"interpolateArray",(function(){return ye})),e.d(n,"interpolateBasis",(function(){return ue})),e.d(n,"interpolateBasisClosed",(function(){return oe})),e.d(n,"interpolateDate",(function(){return be})),e.d(n,"interpolateDiscrete",(function(){return ap})),e.d(n,"interpolateHue",(function(){return cp})),e.d(n,"interpolateNumber",(function(){return xe})),e.d(n,"interpolateNumberArray",(function(){return _e})),e.d(n,"interpolateObject",(function(){return we})),e.d(n,"interpolateRound",(function(){return fp})),e.d(n,"interpolateString",(function(){return Ne})),e.d(n,"interpolateTransformCss",(function(){return lr})),e.d(n,"interpolateTransformSvg",(function(){return hr})),e.d(n,"interpolateZoom",(function(){return hp})),e.d(n,"interpolateRgb",(function(){return he})),e.d(n,"interpolateRgbBasis",(function(){return pe})),e.d(n,"interpolateRgbBasisClosed",(function(){return ge})),e.d(n,"interpolateHsl",(function(){return pp})),e.d(n,"interpolateHslLong",(function(){return gp})),e.d(n,"interpolateLab",(function(){return _p})),e.d(n,"interpolateHcl",(function(){return yp})),e.d(n,"interpolateHclLong",(function(){return mp})),e.d(n,"interpolateCubehelix",(function(){return xp})),e.d(n,"interpolateCubehelixLong",(function(){return wp})),e.d(n,"piecewise",(function(){return Mp})),e.d(n,"quantize",(function(){return Tp})),e.d(n,"path",(function(){return Fi})),e.d(n,"polygonArea",(function(){return kp})),e.d(n,"polygonCentroid",(function(){return Ap})),e.d(n,"polygonHull",(function(){return Sp})),e.d(n,"polygonContains",(function(){return Ep})),e.d(n,"polygonLength",(function(){return Vp})),e.d(n,"quadtree",(function(){return Ta})),e.d(n,"randomUniform",(function(){return Dp})),e.d(n,"randomNormal",(function(){return zp})),e.d(n,"randomLogNormal",(function(){return Rp})),e.d(n,"randomBates",(function(){return Yp})),e.d(n,"randomIrwinHall",(function(){return Lp})),e.d(n,"randomExponential",(function(){return Up})),e.d(n,"scaleBand",(function(){return Hp})),e.d(n,"scalePoint",(function(){return Gp})),e.d(n,"scaleIdentity",(function(){return cg})),e.d(n,"scaleLinear",(function(){return ag})),e.d(n,"scaleLog",(function(){return vg})),e.d(n,"scaleSymlog",(function(){return xg})),e.d(n,"scaleOrdinal",(function(){return jp})),e.d(n,"scaleImplicit",(function(){return Xp})),e.d(n,"scalePow",(function(){return Ag})),e.d(n,"scaleSqrt",(function(){return Ng})),e.d(n,"scaleQuantile",(function(){return Cg})),e.d(n,"scaleQuantize",(function(){return Sg})),e.d(n,"scaleThreshold",(function(){return Eg})),e.d(n,"scaleTime",(function(){return ay})),e.d(n,"scaleUtc",(function(){return vy})),e.d(n,"scaleSequential",(function(){return by})),e.d(n,"scaleSequentialLog",(function(){return xy})),e.d(n,"scaleSequentialPow",(function(){return My})),e.d(n,"scaleSequentialSqrt",(function(){return Ty})),e.d(n,"scaleSequentialSymlog",(function(){return wy})),e.d(n,"scaleSequentialQuantile",(function(){return ky})),e.d(n,"scaleDiverging",(function(){return Ny})),e.d(n,"scaleDivergingLog",(function(){return Cy})),e.d(n,"scaleDivergingPow",(function(){return Ey})),e.d(n,"scaleDivergingSqrt",(function(){return Vy})),e.d(n,"scaleDivergingSymlog",(function(){return Sy})),e.d(n,"tickFormat",(function(){return ug})),e.d(n,"schemeCategory10",(function(){return Dy})),e.d(n,"schemeAccent",(function(){return zy})),e.d(n,"schemeDark2",(function(){return Ry})),e.d(n,"schemePaired",(function(){return Ly})),e.d(n,"schemePastel1",(function(){return Yy})),e.d(n,"schemePastel2",(function(){return Uy})),e.d(n,"schemeSet1",(function(){return By})),e.d(n,"schemeSet2",(function(){return Iy})),e.d(n,"schemeSet3",(function(){return Oy})),e.d(n,"schemeTableau10",(function(){return Fy})),e.d(n,"interpolateBrBG",(function(){return jy})),e.d(n,"schemeBrBG",(function(){return Xy})),e.d(n,"interpolatePRGn",(function(){return Ky})),e.d(n,"schemePRGn",(function(){return Hy})),e.d(n,"interpolatePiYG",(function(){return Wy})),e.d(n,"schemePiYG",(function(){return Gy})),e.d(n,"interpolatePuOr",(function(){return Zy})),e.d(n,"schemePuOr",(function(){return $y})),e.d(n,"interpolateRdBu",(function(){return Jy})),e.d(n,"schemeRdBu",(function(){return Qy})),e.d(n,"interpolateRdGy",(function(){return nm})),e.d(n,"schemeRdGy",(function(){return tm})),e.d(n,"interpolateRdYlBu",(function(){return rm})),e.d(n,"schemeRdYlBu",(function(){return em})),e.d(n,"interpolateRdYlGn",(function(){return um})),e.d(n,"schemeRdYlGn",(function(){return im})),e.d(n,"interpolateSpectral",(function(){return am})),e.d(n,"schemeSpectral",(function(){return om})),e.d(n,"interpolateBuGn",(function(){return fm})),e.d(n,"schemeBuGn",(function(){return cm})),e.d(n,"interpolateBuPu",(function(){return lm})),e.d(n,"schemeBuPu",(function(){return sm})),e.d(n,"interpolateGnBu",(function(){return dm})),e.d(n,"schemeGnBu",(function(){return hm})),e.d(n,"interpolateOrRd",(function(){return gm})),e.d(n,"schemeOrRd",(function(){return pm})),e.d(n,"interpolatePuBuGn",(function(){return vm})),e.d(n,"schemePuBuGn",(function(){return _m})),e.d(n,"interpolatePuBu",(function(){return mm})),e.d(n,"schemePuBu",(function(){return ym})),e.d(n,"interpolatePuRd",(function(){return xm})),e.d(n,"schemePuRd",(function(){return bm})),e.d(n,"interpolateRdPu",(function(){return Mm})),e.d(n,"schemeRdPu",(function(){return wm})),e.d(n,"interpolateYlGnBu",(function(){return km})),e.d(n,"schemeYlGnBu",(function(){return Tm})),e.d(n,"interpolateYlGn",(function(){return Nm})),e.d(n,"schemeYlGn",(function(){return Am})),e.d(n,"interpolateYlOrBr",(function(){return Sm})),e.d(n,"schemeYlOrBr",(function(){return Cm})),e.d(n,"interpolateYlOrRd",(function(){return Vm})),e.d(n,"schemeYlOrRd",(function(){return Em})),e.d(n,"interpolateBlues",(function(){return Dm})),e.d(n,"schemeBlues",(function(){return Pm})),e.d(n,"interpolateGreens",(function(){return Rm})),e.d(n,"schemeGreens",(function(){return zm})),e.d(n,"interpolateGreys",(function(){return Ym})),e.d(n,"schemeGreys",(function(){return Lm})),e.d(n,"interpolatePurples",(function(){return Bm})),e.d(n,"schemePurples",(function(){return Um})),e.d(n,"interpolateReds",(function(){return Om})),e.d(n,"schemeReds",(function(){return Im})),e.d(n,"interpolateOranges",(function(){return qm})),e.d(n,"schemeOranges",(function(){return Fm})),e.d(n,"interpolateCividis",(function(){return Xm})),e.d(n,"interpolateCubehelixDefault",(function(){return jm})),e.d(n,"interpolateRainbow",(function(){return Wm})),e.d(n,"interpolateWarm",(function(){return Hm})),e.d(n,"interpolateCool",(function(){return Km})),e.d(n,"interpolateSinebow",(function(){return Jm})),e.d(n,"interpolateTurbo",(function(){return tb})),e.d(n,"interpolateViridis",(function(){return eb})),e.d(n,"interpolateMagma",(function(){return rb})),e.d(n,"interpolateInferno",(function(){return ib})),e.d(n,"interpolatePlasma",(function(){return ub})),e.d(n,"create",(function(){return ob})),e.d(n,"creator",(function(){return en})),e.d(n,"local",(function(){return cb})),e.d(n,"matcher",(function(){return gt})),e.d(n,"mouse",(function(){return Pe})),e.d(n,"namespace",(function(){return Mt})),e.d(n,"namespaces",(function(){return wt})),e.d(n,"clientPoint",(function(){return Ee})),e.d(n,"select",(function(){return Mn})),e.d(n,"selectAll",(function(){return sb})),e.d(n,"selection",(function(){return wn})),e.d(n,"selector",(function(){return ht})),e.d(n,"selectorAll",(function(){return pt})),e.d(n,"style",(function(){return zt})),e.d(n,"touch",(function(){return Ve})),e.d(n,"touches",(function(){return lb})),e.d(n,"window",(function(){return Et})),e.d(n,"event",(function(){return fn})),e.d(n,"customEvent",(function(){return gn})),e.d(n,"arc",(function(){return Pb})),e.d(n,"area",(function(){return Ub})),e.d(n,"line",(function(){return Yb})),e.d(n,"pie",(function(){return Ob})),e.d(n,"areaRadial",(function(){return Kb})),e.d(n,"radialArea",(function(){return Kb})),e.d(n,"lineRadial",(function(){return Hb})),e.d(n,"radialLine",(function(){return Hb})),e.d(n,"pointRadial",(function(){return Gb})),e.d(n,"linkHorizontal",(function(){return ex})),e.d(n,"linkVertical",(function(){return rx})),e.d(n,"linkRadial",(function(){return ix})),e.d(n,"symbol",(function(){return wx})),e.d(n,"symbols",(function(){return xx})),e.d(n,"symbolCircle",(function(){return ux})),e.d(n,"symbolCross",(function(){return ox})),e.d(n,"symbolDiamond",(function(){return fx})),e.d(n,"symbolSquare",(function(){return px})),e.d(n,"symbolStar",(function(){return dx})),e.d(n,"symbolTriangle",(function(){return _x})),e.d(n,"symbolWye",(function(){return bx})),e.d(n,"curveBasisClosed",(function(){return Cx})),e.d(n,"curveBasisOpen",(function(){return Ex})),e.d(n,"curveBasis",(function(){return Ax})),e.d(n,"curveBundle",(function(){return Px})),e.d(n,"curveCardinalClosed",(function(){return Yx})),e.d(n,"curveCardinalOpen",(function(){return Bx})),e.d(n,"curveCardinal",(function(){return Rx})),e.d(n,"curveCatmullRomClosed",(function(){return Xx})),e.d(n,"curveCatmullRomOpen",(function(){return Hx})),e.d(n,"curveCatmullRom",(function(){return Fx})),e.d(n,"curveLinearClosed",(function(){return Gx})),e.d(n,"curveLinear",(function(){return zb})),e.d(n,"curveMonotoneX",(function(){return ew})),e.d(n,"curveMonotoneY",(function(){return rw})),e.d(n,"curveNatural",(function(){return ow})),e.d(n,"curveStep",(function(){return cw})),e.d(n,"curveStepAfter",(function(){return sw})),e.d(n,"curveStepBefore",(function(){return fw})),e.d(n,"stack",(function(){return pw})),e.d(n,"stackOffsetExpand",(function(){return gw})),e.d(n,"stackOffsetDiverging",(function(){return _w})),e.d(n,"stackOffsetNone",(function(){return lw})),e.d(n,"stackOffsetSilhouette",(function(){return vw})),e.d(n,"stackOffsetWiggle",(function(){return yw})),e.d(n,"stackOrderAppearance",(function(){return mw})),e.d(n,"stackOrderAscending",(function(){return xw})),e.d(n,"stackOrderDescending",(function(){return Mw})),e.d(n,"stackOrderInsideOut",(function(){return Tw})),e.d(n,"stackOrderNone",(function(){return hw})),e.d(n,"stackOrderReverse",(function(){return kw})),e.d(n,"timeInterval",(function(){return Dg})),e.d(n,"timeMillisecond",(function(){return p_})),e.d(n,"timeMilliseconds",(function(){return g_})),e.d(n,"utcMillisecond",(function(){return p_})),e.d(n,"utcMilliseconds",(function(){return g_})),e.d(n,"timeSecond",(function(){return l_})),e.d(n,"timeSeconds",(function(){return h_})),e.d(n,"utcSecond",(function(){return l_})),e.d(n,"utcSeconds",(function(){return h_})),e.d(n,"timeMinute",(function(){return c_})),e.d(n,"timeMinutes",(function(){return f_})),e.d(n,"timeHour",(function(){return u_})),e.d(n,"timeHours",(function(){return o_})),e.d(n,"timeDay",(function(){return e_})),e.d(n,"timeDays",(function(){return r_})),e.d(n,"timeWeek",(function(){return Og})),e.d(n,"timeWeeks",(function(){return Gg})),e.d(n,"timeSunday",(function(){return Og})),e.d(n,"timeSundays",(function(){return Gg})),e.d(n,"timeMonday",(function(){return Fg})),e.d(n,"timeMondays",(function(){return Wg})),e.d(n,"timeTuesday",(function(){return qg})),e.d(n,"timeTuesdays",(function(){return $g})),e.d(n,"timeWednesday",(function(){return Xg})),e.d(n,"timeWednesdays",(function(){return Zg})),e.d(n,"timeThursday",(function(){return jg})),e.d(n,"timeThursdays",(function(){return Qg})),e.d(n,"timeFriday",(function(){return Hg})),e.d(n,"timeFridays",(function(){return Jg})),e.d(n,"timeSaturday",(function(){return Kg})),e.d(n,"timeSaturdays",(function(){return t_})),e.d(n,"timeMonth",(function(){return Ug})),e.d(n,"timeMonths",(function(){return Bg})),e.d(n,"timeYear",(function(){return Rg})),e.d(n,"timeYears",(function(){return Lg})),e.d(n,"utcMinute",(function(){return gy})),e.d(n,"utcMinutes",(function(){return _y})),e.d(n,"utcHour",(function(){return hy})),e.d(n,"utcHours",(function(){return dy})),e.d(n,"utcDay",(function(){return P_})),e.d(n,"utcDays",(function(){return D_})),e.d(n,"utcWeek",(function(){return v_})),e.d(n,"utcWeeks",(function(){return T_})),e.d(n,"utcSunday",(function(){return v_})),e.d(n,"utcSundays",(function(){return T_})),e.d(n,"utcMonday",(function(){return y_})),e.d(n,"utcMondays",(function(){return k_})),e.d(n,"utcTuesday",(function(){return m_})),e.d(n,"utcTuesdays",(function(){return A_})),e.d(n,"utcWednesday",(function(){return b_})),e.d(n,"utcWednesdays",(function(){return N_})),e.d(n,"utcThursday",(function(){return x_})),e.d(n,"utcThursdays",(function(){return C_})),e.d(n,"utcFriday",(function(){return w_})),e.d(n,"utcFridays",(function(){return S_})),e.d(n,"utcSaturday",(function(){return M_})),e.d(n,"utcSaturdays",(function(){return E_})),e.d(n,"utcMonth",(function(){return fy})),e.d(n,"utcMonths",(function(){return sy})),e.d(n,"utcYear",(function(){return R_})),e.d(n,"utcYears",(function(){return L_})),e.d(n,"timeFormatDefaultLocale",(function(){return ry})),e.d(n,"timeFormat",(function(){return F_})),e.d(n,"timeParse",(function(){return q_})),e.d(n,"utcFormat",(function(){return X_})),e.d(n,"utcParse",(function(){return j_})),e.d(n,"timeFormatLocale",(function(){return I_})),e.d(n,"isoFormat",(function(){return Aw})),e.d(n,"isoParse",(function(){return Nw})),e.d(n,"now",(function(){return Oe})),e.d(n,"timer",(function(){return Xe})),e.d(n,"timerFlush",(function(){return je})),e.d(n,"timeout",(function(){return We})),e.d(n,"interval",(function(){return Cw})),e.d(n,"transition",(function(){return Or})),e.d(n,"active",(function(){return $r})),e.d(n,"interrupt",(function(){return or})),e.d(n,"voronoi",(function(){return dM})),e.d(n,"zoom",(function(){return NM})),e.d(n,"zoomTransform",(function(){return yM})),e.d(n,"zoomIdentity",(function(){return vM}))}]);',null)}},function(t,e,n){"use strict";var r=window.URL||window.webkitURL;t.exports=function(t,e){try{try{var n;try{(n=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder)).append(t),n=n.getBlob()}catch(e){n=new Blob([t])}return new Worker(r.createObjectURL(n))}catch(e){return new Worker("data:application/javascript,"+encodeURIComponent(t))}}catch(t){if(!e)throw Error("Inline worker is not supported");return new Worker(e)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(6),i=n(1),a=n(5),o=n(12),s=n(2);class u extends o.BaseSeries{constructor(t,e,n,r,i,a){super(t,e,r,i,!1,n),this.setData(e)}static canRender(t){return 0!=(t.renderType&r.RenderType.BoxPlot)}setData(t){this._data=t.data}isYContinuousSeries(){return!0}getCss(){}getDiscreteXValues(){let t={};for(let e=0;e<this._data.length;++e)t[this._data[e].x]=!0;return Object.keys(t)}getDiscreteYValues(){return[]}getXMinMax(){return[]}getYMinMax(){let t=[0,0];return this._data.length>0&&(t[0]=s.min(this._data,(function(t){return t.min})),t[1]=s.max(this._data,(function(t){return t.max})),t[0]=t[0]>0?0:t[0]),t}decimateData(t,e,n,r){let i=this;return new Promise((function(t,e){i.setOutputData(i._data),t()}))}getLegendInfo(){return[]}getTooltipMetrics(t,e){let n={source:t,group:"",metrics:{}},r=this.getYScalingInfo().baseScale.scalar,i=this.getYScalingInfo().baseScale.units;for(let t=0;t<this._data.length;++t){let a=this._data[t];a.x===e.selection&&(a.min&&(n.metrics.Min=(a.min*r).toFixed(2)+i),a.max&&(n.metrics.Max=(a.max*r).toFixed(2)+i),a.y&&(n.metrics.y=(a.y*r).toFixed(2)+i),a.entry&&(n.metrics.entry=(a.entry*r).toFixed(2)+i),a.exit&&(n.metrics.exit=(a.exit*r).toFixed(2)+i))}return[n]}render(){let t=this;this._d3Chart.getOptions().disableBrush=!0;for(let t=0;t<this._d3Elems.length;++t)this._d3Elems[t].remove();this._d3Elems=[],this.initializeContextMenuItems();let e=t._d3XAxis.getScale(),n=t._d3YAxis.getScale(),r=this.getClassNames("chart-box-plot");if(this._layer.css)for(let t in this._layer.css.classes)r+=t+" ";let a=t._d3Chart.getRenderer().getColorManager().getColor(t.getName());this._layer.css&&this._layer.css.style&&this._layer.css.style.hasOwnProperty("color")&&(a=this._layer.css.style.color);let o=function(t){return i.getSelectionName(t.x)},s=t._d3Chart.getAnimateDuration(),u=e.bandwidth()/2,l=e.bandwidth()/4;this._data.forEach(i=>{let c=e(i.x),h=c+u,f=n(i.y),d=t._d3svg.append("line").attr("class",o(i)).classed(r+" chart-box-plot-line",!0).attr("x1",h).attr("x2",h).attr("fill",a).attr("stroke",a).attr("stroke-width",1).attr("y1",f).attr("y2",f);d.transition().duration(s).attr("y1",n(i.min)).attr("y2",n(i.max)),this._d3Elems.push(d),this.configureBandedItemInteration(d,i,i.x);let g=t._d3svg.append("rect").attr("x",c).attr("width",e.bandwidth).attr("class",o(i)+" chart-box").classed(r,!0).attr("stroke",a).attr("fill","white").attr("y",f).attr("height",0),p=n(i.entry),_=n(i.exit),m=i.entry>i.exit?p:_;g.transition().duration(s).attr("y",m).attr("height",Math.abs(p-_)),this._d3Elems.push(g),this.configureBandedItemInteration(g,i,i.x);let y=(e,u)=>{let l=t._d3svg.append("line").attr("class",o(i)).classed(r+" chart-box-plot-line",!0).attr("x1",h-u).attr("x2",h+u).attr("fill",a).attr("stroke",a).attr("stroke-width",1).attr("y1",f).attr("y2",f);l.transition().duration(s).attr("y1",n(e)).attr("y2",n(e)),this._d3Elems.push(l),this.configureBandedItemInteration(l,i,i.x)};y(i.min,l),y(i.max,l),y(i.y,u)}),this._d3Chart.getOptions().disableBrush=!0,this.applyStyles()}}e.BoxPlotSeries=u,a.D3Chart.register(u)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(0),i=n(6),a=n(11),o=n(1),s=n(14),u=n(8),l=n(19),c=n(5),h=n(12),f=n(2),d=n(10);class g extends h.BaseSeries{constructor(t,e,n,r,i,a){super(t,e,r,void 0,!0,n),this._allRects=[],this._minHeight=0,this._stackHeight=20;let o=this;o.setData(e),o.getDataKey=function(t){return t.key},o.getDataName=function(t){return t&&t.name?t.name:o.getDataKey(t).toString()},o.getDataStart=function(t){return t.x},o.getDataDuration=function(t){return t.dx};let s=o.getClassNames("chart-flame");o._d3svg.append("path").classed(s,!0).classed("background",!0).attr("fill","black").attr("opacity",.2).attr("stroke","black"),o._d3svg.append("g").attr("class",s).classed("segments",!0),o._d3svg.append("g").attr("class",s).classed("labels",!0),t.getOptions().forceSvgRenderer?o.render=p.prototype.render.bind(this):(o.render=_.prototype.render.bind(this),o.focus=_.prototype.focus.bind(this),o.unfocus=_.prototype.unfocus.bind(this),o.select=_.prototype.select.bind(this),o.unselect=_.prototype.unselect.bind(this))}static canRender(t){return t.renderType===i.RenderType.FlameChart}getEventDataValue(t){if(t&&t.decimatedValues)return t.decimatedValues.length>1?t.decimatedValues:t.decimatedValues[0]}generateRects(t){let e=[],n=[],r=t.length(),i=-Number.MAX_VALUE;for(let a=0;a<r;a++){let r=t.get(a);r.x=Number(r.x);let o=n[n.length-1];for(;n.length&&Number(r.x)>=o.x+o.dx;)--n.length,o=n[n.length-1];let s={traceValue:r,depth:n.length};n.push(r),s.depth>=e.length&&(e[s.depth]=[]),e[s.depth].push(s),console.assert(i<=r.x,"Error flame chart start times are not sorted: "+i+" and "+r.x),i=r.x}return e}getVisibleRects(t,e){if(!t||!e)return this._allRects;let n=o.bisectBuffer((function(t){return t.traceValue.x})).left,r=o.bisectBuffer((function(t){return t.traceValue.x})).right,i=[];return this._allRects.forEach(a=>{let s=new o.SimpleBuffer(a),u=n(s,t),l=r(s,e);u>0&&--u;let c=a[u].traceValue;c.x+c.dx<t&&++u,u<l&&i.push(a.slice(u,l))}),i}generateBackground(t,e){let n=[],r=[],i=0;for(let a=0;a<e.length;a++){let o=e[a],s=r[r.length-1];for(;r.length&&o.traceValue.x>=s.traceValue.x+s.traceValue.dx;){--r.length;let e=s.traceValue.x+s.traceValue.dx,a=t(e);if(a!==i)n.push({x:e,min:0,max:r.length}),i=a;else{let t=n[n.length-1];r.length>t.max&&(t.max=r.length)}s=r[r.length-1]}r.push(o);let u=t(o.traceValue.x),l=n[n.length-1];u!==i||void 0===l?(n.push({x:o.traceValue.x,min:0,max:r.length}),i=u):r.length>l.max&&(l.max=r.length)}let a=r[r.length-1];for(;r.length;){--r.length;let e=a.traceValue.x+a.traceValue.dx,o=t(e);if(o!==i)n.push({x:e,min:0,max:r.length}),i=o;else{let t=n[n.length-1];r.length>t.max&&(t.max=r.length)}a=r[r.length-1]}return n}setData(t){if(t.data&&t.data.length>0&&void 0!==t.data[0].depth){this._data=t.data,this._allRects=[];for(let e=0;e<t.data.length;++e){let n=t.data[e];this._allRects[n.depth]||(this._allRects[n.depth]=[]),this._allRects[n.depth].push(n)}}else t.data!=this._data&&(this._data=t.data,this._allRects=this.generateRects(new o.SimpleBuffer(this._data)))}getDecimationName(){return this._layer.decimator?o.getSelectionName(this._layer.decimator.getName()):""}isYContinuousSeries(){return!1}getCss(){}getDiscreteXValues(t){return[]}getDiscreteYValues(){return[]}getXMinMax(){let t=this,e=[Number.MAX_VALUE,-Number.MAX_VALUE];return this._allRects.length>0&&this._allRects.forEach(n=>{e[0]=Math.min(t.getDataStart(n[0].traceValue),e[0]),e[1]=f.max(n,(function(e,n,r){return t.getDataStart(e.traceValue)+t.getDataDuration(e.traceValue)}))}),e}getYMinMax(){return[]}decimateData(t,e,n,r){let i=this;i._worker&&(i._worker.terminate(),i._worker=null),i._layer.decimator&&(i._decimator=i._layer.decimator);let s=n.getScale(),u=r.getScale(),l=i.getVisibleRects(t,e);if(i._layer.enableBackground){let t=[];l.forEach(e=>{t=t.concat(e)}),t.sort((t,e)=>t.traceValue.x-e.traceValue.x),i._backgroundData=i.generateBackground(s,t)}return i._decimator||(i._decimator=new a.FlameChartMergeRectDecimator),i._layer.enableWebWorkers||i._d3Chart.getOptions().enableWebWorkers?new Promise((function(n,r){i._worker=c.createDecimatorWorker(i._decimator,t,e,i._d3XAxis,i._d3YAxis,l,void 0,(function(t){i.setOutputData(t),i._worker=null,n()}),(function(r){i._worker=null;let a=i._decimator.decimateValues(t,e,new o.SimpleBuffer(l));i.setOutputData(a),n()}))})):new Promise((function(n,r){i._decimator.initialize(s,s.invert,u);let a=i._decimator.decimateValues(t,e,new o.SimpleBuffer(l));i.setOutputData(a),n()}))}getLegendInfo(){return[]}getTooltipMetrics(t,e){let n=[];if(this._selection){let e={};e[this.getDataName(this._selection)]=this.getDataDuration(this._selection),n.push({source:t,group:"",metrics:e})}if(this._allRects.length>1){let r={source:t,group:"Stack",metrics:{}};this._allRects.forEach(t=>{for(let n=0;n<t.length;++n){let i=t[n].traceValue,a=this.getDataStart(i);if(!(e.xEnd>a))break;e.xEnd<=a+this.getDataDuration(i)&&(r.metrics[this.getDataName(i)]="")}}),n.push(r)}return n}getRequiredHeight(){if(this._minHeight)return this._minHeight;let t=0;for(let e in this._allRects)t=Math.max(t,Number(e))+1;return this._minHeight=(t+1)*this._stackHeight,this._minHeight}configureSegmentInteraction(t,e){let n=this;n._layer.disableHover||t.on("mouseenter",(function(){n._selection=e.traceValue,e&&n._d3Chart.onHover({caller:n._d3Chart.getElement(),event:r.EventType.HoverStart,data:n.getEventDataValue(e),selection:o.getSelectionName(n.getDataName(e.traceValue))})})).on("mouseleave",(function(){e&&n._d3Chart.onHover({caller:n._d3Chart.getElement(),event:r.EventType.HoverEnd,data:n.getEventDataValue(e),selection:o.getSelectionName(n.getDataName(e.traceValue))}),n._selection=void 0})),this._d3Elems.push(t),n.configureItemInteraction(t,n.getEventDataValue(e),e?o.getSelectionName(n.getDataName(e.traceValue)):void 0)}getSegmentClasses(t){let e=o.getSelectionName(this.getDataKey(t).toString()),n=o.getSelectionName(this.getDataName(t));return e===n?e:e+" "+n}renderBackground(){let t=this,e=t._d3XAxis.getScale(),n=f.area().curve(f.curveStepAfter).x((function(t){return e(t.x)})).y0((function(t){return 0})).y1((function(e){return e.max*t._stackHeight}));if(this._backgroundData){let e=t._d3svg.select(this.getSelectionClasses("chart-flame")+".background").attr("d",n(this._backgroundData));this.configureItemInteraction(e,void 0,void 0)}}render(){}}e.FlameChartSeries=g;class p extends g{render(){let t=this;this.renderBackground(),this.initializeContextMenuItems();let e=t._d3XAxis.getScale(),n=this.getClassNames("chart-flame");if(this._layer.css)for(let t in this._layer.css.classes)n+=t+" ";let r=t._d3svg.select(".segments");r.selectAll("*").remove();let i=t._d3svg.select(".labels");i.selectAll("*").remove();let a=this.getOutputData(),o=a.length();for(let s=0;s<o;s++){let o=a.get(s),u=o.traceValue,l=t.getDataKey(u).toString(),c=t.getDataName(u),h=o.depth*this._stackHeight,f=e(t.getDataStart(u)),d=e(t.getDataStart(u)+t.getDataDuration(u))-f,g=r.append("rect").attr("class",n).classed(t.getSegmentClasses(u),!0).attr("fill",t._d3Chart.getRenderer().getColorManager().getColor(c)).attr("x",f).attr("width",d).attr("y",h).attr("height",this._stackHeight);if(this.configureSegmentInteraction(g,o),d>50&&"merged"!==l){let t=i.append("svg").attr("x",f).attr("width",d).attr("y",h).attr("height",this._stackHeight);this.configureSegmentInteraction(t,o),t.append("text").text(c).attr("fill","black").attr("text-anchor","middle").attr("alignment-baseline","central").attr("x",d/2).attr("y",this._stackHeight/2)}}this.applyStyles()}}class _ extends g{focus(t){if(t){let e=this._pixiHelper.getSelection(t);e&&e.forEach((function(t){t._prevTint=t.tint,t.tint&&(t.tint=u.ColorManager.RgbToInt(l.SelectionHelper.getFocusColor(u.ColorManager.IntToHex(t.tint)))),t.alpha=136})),this._pixiHelper.render()}}unfocus(t){let e=this._pixiHelper.getSelection(t);e&&e.forEach((function(t){t.tint=t._prevTint,t.alpha=255})),this._pixiHelper.render()}select(t){if(t){let e=this,n=this._d3svg.select(".segments");n.classed("selected",!0);let r=u.ColorManager.RgbToInt(n.style("stroke")),i=parseInt(n.style("stroke-width"),10),a=function(t){return e._pixiHelper.createRectange(t.width,t.height,r)},o=this._pixiHelper.getSelection(t);o&&o.forEach((function(t){let e=a(t);t.parent.getChildAt(0);let n=2*i;t.width=t.width-n,t.height=t.height-n,t.x=i,t.y=i,t.parent.addChildAt(e,0)})),this._pixiHelper.render()}}unselect(t){this._d3svg.select(".segments").classed("selected",!1);let e=this._pixiHelper.getSelection(t);e&&e.forEach((function(t){let e=t.parent.removeChildAt(0);t.width=e.width,t.height=e.height,t.x=e.x,t.y=e.y})),this._pixiHelper.render()}render(){this._textMap||(this._textMap={}),this.initializeContextMenuItems(),this.renderBackground();let t=this._d3svg.select(".segments");t.selectAll("*").remove();let e=this._d3svg.select(".labels");e.selectAll("*").remove();let n=this.getClassNames("chart-flame");if(this._layer.css)for(let t in this._layer.css.classes)n+=t+" ";this._pixiHelper||(this._pixiHelper=new s.PIXIHelper(!this._d3Chart.getOptions().forceCanvasRenderer),this._pixi=this._pixiHelper.getRenderer());let i=this._pixiHelper.addPixiSvg(t,n,this._d3XAxis.getRangePixels(),this.getRequiredHeight());this._pixiHelper.clearSelections(),this._d3Elems.push(i),this.configureItemInteraction(i,void 0,void 0);let a=this._d3XAxis.getScale(),u=new d.Container,l=a(Number.MAX_VALUE),c=this._pixiHelper.createRectangleContainer(0,0,l,this.getRequiredHeight(),0);c.alpha=0,this.configureItemInteractionPIXI(c,void 0,void 0),u.addChild(c);let h=this.getOutputData(),f=h.length(),g=this._d3Chart.getElement();for(let t=0;t<f;t++){let n=h.get(t),i=n.traceValue,s=this.getDataKey(i).toString(),l=this.getDataName(i),c=n.depth*this._stackHeight,f=a(this.getDataStart(i)),p=a(this.getDataStart(i)+this.getDataDuration(i))-f,_=this._pixiHelper.createRectangleContainer(f,c,p,this._stackHeight,parseInt(this._d3Chart.getRenderer().getColorManager().getColor(l).substring(1),16)),m=_.children[0];if(this._pixiHelper.addSelection(o.getSelectionName(l),m),this._pixiHelper.addSelection(o.getSelectionName(s),m),this._pixiHelper.addInteractionHelper(m,this._d3Chart.getOptions(),void 0,void 0,this._contextMenuItems,this._layer.disableHover?void 0:()=>{this._selection=i,i&&this._d3Chart.onHover({caller:g,event:r.EventType.HoverStart,selection:o.getSelectionName(l)})},this._layer.disableHover?void 0:()=>{i&&this._d3Chart.onHover({caller:g,event:r.EventType.HoverEnd,selection:o.getSelectionName(l)}),this._selection=void 0},void 0,g,this.getEventDataValue(n.decimatedValues),n.traceValue),this.configureItemInteractionPIXI(m,this.getEventDataValue(n),o.getSelectionName(s)),"merged"!==s){let t=this._textMap[l];if(t||(t=this._pixiHelper.renderText(l,e),this._textMap[l]=t),t.width<_.width){let e=new d.Sprite(this._pixi.generateTexture(t,d.SCALE_MODES.LINEAR,1));e.x=.5*(_.width-t.width),e.y=.5*this._stackHeight-.5*t.height,_.addChild(e)}}u.addChild(_)}this._pixi.resize(this._d3XAxis.getRangePixels(),this.getRequiredHeight()),this._pixiHelper.render(u)}}c.D3Chart.register(g)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(0),i=n(6),a=n(1),o=n(3),s=n(14),u=n(5),l=n(12),c=n(2),h=n(10);class f extends l.BaseSeries{getXMinMax(){throw"Error please override this function"}getYMinMax(){throw"Error please override this function"}isXContinuousSeries(){throw"Error please override this function"}isYContinuousSeries(){throw"Error please override this function"}decimateData(t,e,n,r){throw"Error please override this function"}setData(t,e=0){throw"Error please override this function"}getTooltipMetrics(t,e){throw"Error please override this function"}getName(){throw"Error please override this function"}initializeClasses(){this._classes=this.getClassNames("chart-heat-map"),this._selectionClasses=this.getSelectionClasses("chart-heat-map")}applyStyles(){if(super.applyStyles(),this._layer.css){let t=this._layer.css.style;if(t)for(let e=0;e<this._d3Elems.length;++e)for(let n in t)this._d3Elems[e].style(n,t[n])}}getLegendInfo(){return[]}configureTooltip(t){let e=this;function n(t){return e._d3Chart.getTooltip().setData(`${t.y}: ${t.x} ${t.value}`,[]),!0}e._d3Chart.getTooltip().setTarget(t),this._d3Chart.getTooltip().setEnterCallback(n).setMoveCallback(n)}render(){let t=this;this._d3Elems=[],this.initializeContextMenuItems(),this.isXContinuousSeries()||(t._d3XAxis.getScale().padding(0),t._d3XAxis.render());let e=t._d3XAxis.getScale().copy();e.clamp&&e.clamp(!1);let n=t._d3YAxis;if(!this.isYContinuousSeries()){let t=this._d3Chart.getOptions().height;n.getScale().padding(0),n.getRangePixels()<t&&n.setRangePixels(t),n.render()}let i=n.getScale().copy();i.clamp&&i.clamp(!1);let o=[];this._layer.gradient.forEach(t=>{o.push(parseInt(t.color.substring(1),16))});let u,l=c.scaleQuantize().domain(c.extent(this._layer.gradient,t=>t.key)).range(o),f=t._d3Chart.getGraphGroup(),d=this.getClassNames("chart-heat-map");if(this._layer.css)for(let t in this._layer.css.classes)d+=t+" ";let g,p,_,m=i.bandwidth?i.bandwidth():void 0,y=e.bandwidth?e.bandwidth():void 0,v=(t,n)=>{void 0===t.y1?u=i(t.y):(u=i(t.y),m=i(t.y1)-u),void 0===t.x1?g=e(t.x):(g=e(t.x),y=e(t.x1)-g),n.x=g,n.y=u,n.width=y,n.height=m},x=this.getOutputData(),b=x.length(),w=!0;if(this._pixiHelper&&(_=f.select(this._selectionClasses),p=this._pixiHelper.getStage(),p)){let t=this._pixiHelper.getStage().children;if(t.length===b){for(let e=0;e<b;e++){v(x.get(e),t[e])}w=!1}}if(w){if(!this._pixiHelper){this._pixiHelper=new s.PIXIHelper(!this._d3Chart.getOptions().forceCanvasRenderer),this._pixi=this._pixiHelper.getRenderer();let t=new h.Graphics;t.beginFill(16777215),t.drawRect(0,0,1,1),t.endFill(),this._rectTexture=this._pixi.generateTexture(t,h.SCALE_MODES.LINEAR,8)}_=this._pixiHelper.addPixiSvg(f,d,this._d3XAxis.getRangePixels(),this._d3YAxis.getRangePixels()),_.attr("cursor","pointer"),this._pixiHelper.clearSelections(),p=new h.Container;let e=t._d3Chart.getElement();this._d3Chart.getTooltip().releaseListeners();for(let n=0;n<b;n++){let i=x.get(n),o=l(i.value);var M=new h.Sprite(this._rectTexture);M.tint=o,M.x=g,M.y=u,M.width=y,M.height=m;let s=M;this._pixiHelper.addInteractionHelper(s,this._d3Chart.getOptions(),this._layer.onClick,this._layer.onDoubleClick,t._contextMenuItems,()=>{this._selection=i,i&&this._d3Chart.onHover({caller:e,event:r.EventType.HoverStart,data:i,selection:a.getSelectionName(i.y)})},()=>{i&&this._d3Chart.onHover({caller:e,event:r.EventType.HoverEnd,data:i,selection:a.getSelectionName(i.y)}),this._selection=void 0},t._d3Chart.getTooltip(),e,i,i),p.addChild(M),this.configureTooltip(M),v(i,M)}}let T=this._d3XAxis.getRangePixels(),S=this._d3YAxis.getRangePixels();_.attr("width",T).attr("height",S),this._pixi.resize(T,S),this._pixiHelper.render(p),t.applyStyles()}}e.BaseHeatMap=f;class d extends f{constructor(t,e,n,r,i,a){super(t,e,r,i,!1,n),this.setData(e)}static canRender(t){return 0!=(t.renderType&i.RenderType.HeatMap)&&t.data[0]&&t.data[0].hasOwnProperty("values")}setData(t,e=0){this._data=t.data[e],Array.isArray(this._data.values)?this._values=new a.SimpleBuffer(this._data.values):this._values=this._data.values,this.initializeClasses()}applyStyles(){if(super.applyStyles(),this._data.css){let t=this._data.css.style;if(t)for(let e=0;e<this._d3Elems.length;++e)for(let n in t)this._d3Elems[e].style(n,t[n])}}getDecimationName(){return this._layer.decimator?a.getSelectionName(this._layer.decimator.getName()):""}getName(){return this._data.name?this._data.name:""}isXContinuousSeries(){return!1}isYContinuousSeries(){return!1}getCss(){return this._data.css}getDiscreteXValues(t){return o.getKeys(this._data.values,(function(t){return[t.x]}))}getDiscreteYValues(){return o.getKeys(this._data.values,(function(t){return[t.y]})).reverse()}decimateData(t,e,n,r){let i=this;i._worker&&(i._worker.terminate(),i._worker=null),i._layer.decimator&&(i._decimator=i._layer.decimator);n.getScale(),r.getScale();return i._decimator,i._layer.enableWebWorkers||i._d3Chart.getOptions().enableWebWorkers?new Promise((function(n,r){i._worker=u.createDecimatorWorker(i._decimator,t,e,i._d3XAxis,i._d3YAxis,i._values.getData(),void 0,(function(t){i.setOutputData(t),i._worker=null,n()}),(function(r){i._worker=null;let a=i._decimator.decimateValues(t,e,i._values);i.setOutputData(a),n()}))})):new Promise((function(t,e){let n=i._values;i.setOutputData(n),t()}))}getTooltipMetrics(t,e){return[{source:t,group:"",metrics:{}}]}}e.XYHeatMapSeries=d,u.D3Chart.register(d);class g extends f{constructor(t,e,n,r,i,a){super(t,e,r,i,!0,n),this.setData(e)}static canRender(t){return 0!=(t.renderType&i.RenderType.HeatMap)&&t.data[0]&&t.data[0].hasOwnProperty("dx")}setData(t,e=0){Array.isArray(this._layer.data)?this._values=new a.SimpleBuffer(this._layer.data):this._values=this._layer.data,this.initializeClasses()}getName(){return""}getDecimationName(){return this._layer.decimator?a.getSelectionName(this._layer.decimator.getName()):""}isXContinuousSeries(){return!0}isYContinuousSeries(){return!1}getCss(){return this._layer.css}getDiscreteYValues(){return o.getKeys(this._layer.data,(function(t){return[t.y]})).reverse()}getXMinMax(){let t=[];return this._layer.data.length>0&&(t.push(this._layer.data[0].x),t.push(c.max(this._layer.data,(function(t,e,n){return t.x+t.dx})))),t}decimateData(t,e,n,r){let i=this;i._worker&&(i._worker.terminate(),i._worker=null),i._layer.decimator&&(i._decimator=i._layer.decimator);n.getScale(),r.getScale();return i._decimator,i._layer.enableWebWorkers||i._d3Chart.getOptions().enableWebWorkers?new Promise((function(n,r){i._worker=u.createDecimatorWorker(i._decimator,t,e,i._d3XAxis,i._d3YAxis,i._values.getData(),void 0,(function(t){i.setOutputData(t),i._worker=null,n()}),(function(r){i._worker=null;let a=i._decimator.decimateValues(t,e,i._values);i.setOutputData(a),n()}))})):new Promise((function(t,e){let n=i._layer.data;i.setOutputData(n),t()}))}getTooltipMetrics(t,e){return[{source:t,group:"",metrics:{}}]}}e.TraceHeatMapSeries=g,u.D3Chart.register(g)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(6),i=n(11),a=n(1),o=n(5),s=n(22);class u{constructor(t,e,n,r,i,a){this._d3Chart=t,this._isXContinuous=!0,this._svg=n,this._xAxis=r,this._yAxis=i,this._d3SeriesList=[],this.setData(e)}static canRender(t){return t.data[0]&&t.data[0].hasOwnProperty("dx")&&(0!=(t.renderType&r.RenderType.Area)||0!=(t.renderType&r.RenderType.Line)||0!=(t.renderType&r.RenderType.Stacked))}setData(t){if(this._layer&&this._data&&this._data===this._layer.data)return;this._layer=t;let e={};this._data=this._layer.data;for(let t=0;t<this._data.length;++t)e[this._data[t].name]=!0;if(this._states=Object.keys(e).sort((t,e)=>t.localeCompare(e)),1===this._states.length&&"undefined"===this._states[0]&&console.warn("Warning ITraceData does not have the name property: This is used for when rendering trace data"),this._isStackedArea=0!=(this._layer.renderType&r.RenderType.Area)||0!=(this._layer.renderType&r.RenderType.Stacked),this._d3SeriesList=[],this._isStackedArea)for(let e=0;e<this._states.length;++e){let n={renderType:t.renderType|r.RenderType.Area,interpolateType:t.interpolateType,data:[{name:this._states[e]}]},i=new s.XYSeries(this._d3Chart,n,this._svg,this._xAxis,this._yAxis,this._isXContinuous);this._d3SeriesList.push(i)}else{let e={renderType:r.RenderType.Line,interpolateType:t.interpolateType,data:[{name:this._d3Chart.getTitle()}]},n=new s.XYSeries(this._d3Chart,e,this._svg,this._xAxis,this._yAxis,this._isXContinuous);this._d3SeriesList.push(n)}}getName(){return""}getMaxNameLength(){let t=0;for(let e=0;e<this._d3SeriesList.length;++e)t=Math.max(t,this._d3SeriesList[e].getName().length);return t}isXContinuousSeries(){return!0}isYContinuousSeries(){return this._isStackedArea}getDiscreteXValues(t){return[]}getDiscreteYValues(){return this._states}getXMinMax(){let t=[Number.MAX_VALUE,-Number.MAX_VALUE],e=this._layer.data;if(e.length>0){let n=e[e.length-1];t=[e[0].x,n.x+n.dx]}return t}getYMinMax(){return[0,100]}getRequiredHeight(){return 0}getXScalingInfo(){if(this._d3SeriesList.length>0)return this._d3SeriesList[0].getXScalingInfo()}getYScalingInfo(){if(this._d3SeriesList.length>0)return this._d3SeriesList[0].getXScalingInfo()}decimateData(t,e,n,r){let s=this;s._worker&&(s._worker.terminate(),s._worker=null);let u,l=n.getScale(),c=r.getScale();u=this._layer.decimator?this._layer.decimator:this._isStackedArea?new i.TraceResidencyDecimator:new i.TraceStateDecimator;let h=t=>{if(this._isStackedArea)for(let e=0;e<s._d3SeriesList.length;++e)s._d3SeriesList[e].setOutputData(t[e]);else s._d3SeriesList[0].setOutputData(t)};return(s._layer.enableWebWorkers||s._d3Chart.getOptions().enableWebWorkers)&&i.InternalDecimatorMap[u.getKey()]?new Promise((function(i,f){s._worker=o.createDecimatorWorker(u,t,e,n,r,s._layer.data,s._states,(function(t){s._worker=null,h(t),i()}),(function(n){s._worker=null,u.initialize(l,l.invert,c,s._states);let r=u.decimateValues(t,e,new a.SimpleBuffer(s._layer.data));h(r),i()}))})):new Promise((function(n,r){u.initialize(l,l.invert,c,s._states);let i=u.decimateValues(t,e,new a.SimpleBuffer(s._layer.data));h(i),n()}))}getTooltipMetrics(t,e){let n={source:t,group:"",metrics:{}};for(let r=0;r<this._d3SeriesList.length;++r){let i=this._d3SeriesList[r].getTooltipMetrics(t,e);for(let t=0;t<i.length;++t)for(let e in i[t].metrics)n.metrics[e]=i[t].metrics[e]}return[n]}getLegendInfo(){let t=[];for(let e=0;e<this._d3SeriesList.length;++e)t=t.concat(this._d3SeriesList[e].getLegendInfo());return t}focus(t){for(let e=0;e<this._d3SeriesList.length;++e)this._d3SeriesList[e].focus(t)}unfocus(t){for(let e=0;e<this._d3SeriesList.length;++e)this._d3SeriesList[e].unfocus(t)}select(t){for(let e=0;e<this._d3SeriesList.length;++e)this._d3SeriesList[e].select(t)}unselect(t){for(let e=0;e<this._d3SeriesList.length;++e)this._d3SeriesList[e].unselect(t)}render(t){if(this._d3SeriesList.length>0){let e=0;this._d3SeriesList.forEach(t=>{e=Math.max(e,t.getOutputData().length())}),t=Array.apply(null,Array(e)).map(Number.prototype.valueOf,0);for(let e=0;e<this._d3SeriesList.length;++e)this._d3SeriesList[e].render(t)}}}e.TraceSeries=u,o.D3Chart.register(u)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(5),i=n(22);class a extends i.XYSeries{constructor(t,e,n,r,i,a){super(t,e,n,r,i,a),this.setData(e)}static canRender(t){return t.data[0]&&t.data[0].hasOwnProperty("functionMap")}setData(t){super.setData(t)}isYContinuousSeries(){return!0}getCss(){return this._data.css}getDiscreteXValues(t){}getDiscreteYValues(){}getXMinMax(){return[this._data.functionMap.xMin,this._data.functionMap.xMax]}getYMinMax(){return[this._data.functionMap.yMin,this._data.functionMap.yMax]}decimateData(t,e,n,r){let i=this;return new Promise((function(n,r){let a=i._d3XAxis.getDomain(),o=i._d3XAxis.getRangePixels();if(t||(t=a[0]),e||(e=a[1]),o>0){let n=[],r=(e-t)/o,a=t,s=i._data.functionMap.y;for(let t=0;t<o;++t)n.push({x:a,y:s(a)}),a+=r;i.setOutputData(n)}n()}))}}e.FunctionSeries=a,r.D3Chart.register(a)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(6),i=n(1),a=n(5),o=n(12),s=n(2);class u extends o.BaseSeries{constructor(t,e,n,r,i,a){super(t,e,r,i,!1,n),this.setData(e)}static canRender(t){return 0!=(t.renderType&r.RenderType.MinMaxValue)}setData(t){this._data=t.data}isYContinuousSeries(){return!0}getCss(){}getDiscreteXValues(t){let e={};for(let t=0;t<this._data.length;++t)e[this._data[t].x]=!0;return Object.keys(e)}getDiscreteYValues(){return[]}getXMinMax(){return[]}getYMinMax(){let t=[0,0];return this._data.length>0&&(t[0]=s.min(this._data,(function(t){return t.min})),t[1]=s.max(this._data,(function(t){return t.max})),t[0]=t[0]>0?0:t[0]),t}decimateData(t,e,n,r){let i=this;return new Promise((function(t,e){i.setOutputData(i._data),t()}))}getLegendInfo(){return[]}getTooltipMetrics(t,e){let n={source:t,group:"",metrics:{}},r=this.getYScalingInfo().baseScale.scalar,i=this.getYScalingInfo().baseScale.units;for(let t=0;t<this._data.length;++t){let a=this._data[t];a.x===e.selection&&(a.min&&(n.metrics.Min=(a.min*r).toFixed(2)+i),a.max&&(n.metrics.Max=(a.max*r).toFixed(2)+i),a.y&&(n.metrics.Avg=(a.y*r).toFixed(2)+i))}return[n]}render(){let t=this;for(let t=0;t<this._d3Elems.length;++t)this._d3Elems[t].remove();this._d3Elems=[],this.initializeContextMenuItems();let e=t._d3XAxis.getScale(),n=t._d3YAxis.getScale(),r=this.getClassNames("chart-min-max-value");if(this._layer.css)for(let t in this._layer.css.classes)r+=t+" ";let a=t._d3Chart.getRenderer().getColorManager().getColor(t.getName());function o(t){return e(t.x)+e.bandwidth()/2}function u(t){return void 0===t.y?t.y:n(t.y)}this._layer.css&&this._layer.css.style&&this._layer.css.style.hasOwnProperty("color")&&(a=this._layer.css.style.color);let l=function(t){return i.getSelectionName(t.x)},c=t._d3svg.selectAll(this.getSelectionClasses("chart-min-max-value")).data(this._data);c.enter().append("circle").attr("class",l).classed(r+" chart-min-max-value",!0).attr("r",(function(t){return t.y?2.5:0})).attr("cx",o).attr("cy",u).attr("fill",a).attr("stroke",a).each((function(e,n){t._d3Elems.push(s.select(this)),t.configureBandedItemInteration(s.select(this),e,e.x)}));let h=t._d3Chart.getAnimateDuration();c=t._d3svg.selectAll(".chart-min-max-value-line"+this.getSelectionClasses("chart-min-max-value")).data(this._data).enter().append("line").attr("class",l).classed(r+" chart-min-max-value-line",!0).attr("x1",o).attr("x2",o).attr("fill",a).attr("stroke",a).attr("stroke-width",1).attr("y1",u).attr("y2",u).each((function(e,n){t._d3Elems.push(s.select(this)),t.configureBandedItemInteration(s.select(this),e,e.x)})),c.transition().duration(h).attr("y1",(function(t){return void 0===t.min?t.min:n(t.min)})).attr("y2",(function(t){return void 0===t.max?t.max:n(t.max)})),this.applyStyles()}}e.MinMaxSeries=u,a.D3Chart.register(u)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(0),i=n(6),a=n(1),o=n(3),s=n(5),u=n(12),l=n(2);class c extends u.BaseSeries{constructor(t,e,n,r,i,a){super(t,e,r,i,a,n),this.setData(e)}static canRender(t){return t.data[0]&&t.data[0].hasOwnProperty("rects")}setData(t){this._data=t.data[0],this._description=t.data[0].description,this._values=new a.SimpleBuffer(this._data.rects),this._classes=this.getClassNames("chart-rect")}applyStyles(){if(super.applyStyles(),this._data.css){let t=this._data.css.style;if(t)for(let e=0;e<this._d3Elems.length;++e)for(let n in t)this._d3Elems[e].style(n,t[n])}}getName(){return this._data.name?this._data.name:""}isYContinuousSeries(){return!this._data.rects.length||!(isNaN(this._data.rects[0].y)||isNaN(this._data.rects[0].y1))}getCss(){return this._data.css}getDiscreteXValues(t){return o.getKeys(this._data.rects,(function(t){return[t.x,t.x1]}))}getDiscreteYValues(){return o.getKeys(this._data.rects,(function(t){return[t.y,t.y1]})).reverse()}getXMinMax(){let t=[Number.MAX_VALUE,Number.MIN_VALUE],e=this._values.length();for(let n=0;n<e;++n)t[0]=Math.min(t[0],this._values.get(n).x),t[1]=Math.max(t[1],this._values.get(n).x),t[0]=Math.min(t[0],this._values.get(n).x1),t[1]=Math.max(t[1],this._values.get(n).x1);let n=this.getXScalingInfo().baseScale.scalar;return t[0]=t[0]*n,t[1]=t[1]*n,t}getYMinMax(){let t=[Number.MAX_VALUE,Number.MIN_VALUE],e=this._values.length();for(let n=0;n<e;++n)t[0]=Math.min(t[0],this._values.get(n).y),t[1]=Math.max(t[1],this._values.get(n).y),t[0]=Math.min(t[0],this._values.get(n).y1),t[1]=Math.max(t[1],this._values.get(n).y1);return t}decimateData(t,e,n,r){return new Promise((function(t,e){t()}))}getTooltipMetrics(t,e){return[]}getLegendInfo(){return[]}render(){let t=this;t._d3Elems=[],this.initializeContextMenuItems();let e=t._d3XAxis.getScale(),n=t._d3YAxis.getScale(),a=e.bandwidth?e.bandwidth()/2:0,o=n.bandwidth?n.bandwidth()/2:0;t.xMap=function(t){return e(t)+a},t.yMap=function(t){let e=n(t);return void 0===e&&(e=0),e+o};let s,u=this.getSelectionClasses("chart-rect");t._data.css&&(s=t._data.css.style.color),s||(s=t._d3Chart.getRenderer().getColorManager().getColor(t.getName()));let c=t._d3svg.selectAll(u).data(this._data.rects);if(c.enter().append("rect").classed(this._classes,!0).attr("fill",t._layer.renderType===i.RenderType.Area?s:"none").attr("stroke",s).attr("x",(function(e){return t.xMap(e.x)})).attr("width",(function(e){return t.xMap(e.x1)-t.xMap(e.x)})).attr("y",(function(e){return t.yMap(e.y1)})).attr("height",(function(e){return t.yMap(e.y)-t.yMap(e.y1)})).each((function(e){t._d3Elems.push(l.select(this)),t.configureItemInteraction(l.select(this),e.value,e.value)})),c.attr("x",(function(e){return t.xMap(e.x)})).attr("width",(function(e){return t.xMap(e.x1)-t.xMap(e.x)})).attr("y",(function(e){return t.yMap(e.y1)})).attr("height",(function(e){return t.yMap(e.y)-t.yMap(e.y1)})),this._description){let e=t._d3svg.selectAll(t.getSelectionClasses("chart-rect")+"."+t._layer.data[0].name).filter("text").data(this._data.rects);e.exit().remove();let n=e=>{switch(t._description.alignment){case r.Alignment.Top:return`translate(${t.xMap(e.x)}, ${t.yMap(e.y1)})`;case r.Alignment.Bottom:return`translate(${t.xMap(e.x)}, ${t.yMap(e.y)})`;case r.Alignment.Left:return`translate(${t.xMap(e.x)}, ${t.yMap(e.y)}) rotate(-90)`;case r.Alignment.Right:default:return`translate(${t.xMap(e.x1)}, ${t.yMap(e.y1)}) rotate(90)`}};e.enter().append("text").classed(t._classes,!0).classed(t._layer.data[0].name,!0).text((function(e){return t._description.text})).attr("dy","-.5em").attr("fill",s).attr("transform",n),e.attr("transform",n)}t.applyStyles()}}e.RectSeries=c,s.D3Chart.register(c)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(0),i=n(6),a=n(11),o=n(1),s=n(5),u=n(12),l=n(2);class c extends u.BaseSeries{constructor(t,e,n,r){super(t,e,r,void 0,!0,n);let i=this;this.setData(e),i.getDataKey=function(t){return t.key},i.getDataName=function(t){return t&&t.name?t.name:i.getDataKey(t).toString()},i.getDataStart=function(t){return t.x},i.getDataDuration=function(t){return t.dx?t.dx:0}}static canRender(t){return 0!=(t.renderType&i.RenderType.Marker)}setData(t){this._data=t.data}getDecimationName(){return this._layer.decimator?o.getSelectionName(this._layer.decimator.getName()):""}isYContinuousSeries(){return!1}getCss(){}getDiscreteXValues(t){return[]}getDiscreteYValues(){return[]}getXMinMax(){let t=this,e=[];return this._data.length>0&&(e.push(t.getDataStart(this._data[0])),e.push(l.max(this._data,(function(e,n,r){return t.getDataStart(e)+t.getDataDuration(e)})))),e}getYMinMax(){return[]}decimateData(t,e,n,r){let i=this;i._worker&&(i._worker.terminate(),i._worker=null),i._layer.decimator?i._decimator=i._layer.decimator:i._decimator=new a.SimpleMarkerDecimator;let u=n.getScale(),l=r.getScale();return!i._layer.enableWebWorkers&&!i._d3Chart.getOptions().enableWebWorkers||i._decimator?new Promise((function(n,r){i._decimator.initialize(u,u.invert,l);let a=i._decimator.decimateValues(t,e,new o.SimpleBuffer(i._data));i.setOutputData(a),n()})):new Promise((function(n,r){i._worker=s.createDecimatorWorker(i._decimator,t,e,i._d3XAxis,i._d3YAxis,i._data,void 0,(function(t){i.setOutputData(t),i._worker=null,n()}),(function(r){i._worker=null,i._decimator.initialize(u,u.invert,l);let a=i._decimator.decimateValues(t,e,new o.SimpleBuffer(i._data));i.setOutputData(a),n()}))}))}getLegendInfo(){return[]}getTooltipMetrics(t,e){let n=[];if(this._selection){let e={};e[this.getDataName(this._selection)]=this.getDataDuration(this._selection),n.push({source:t,group:"",metrics:e})}let r={source:t,group:"Stack",metrics:{}};for(let t=0;t<this._data.length;++t){let n=this._data[t],i=this.getDataStart(n);if(!(e.xEnd>i))break;e.xEnd<=i+this.getDataDuration(n)&&(r.metrics[this.getDataName(n)]="")}return n.push(r),n}configureMarkerInteraction(t,e){let n=this;t.on("mouseenter",(function(){n._selection=e,e&&n._d3Chart.onHover({event:r.EventType.HoverStart,data:e,selection:o.getSelectionName(n.getDataName(e))})})).on("mouseleave",(function(){e&&n._d3Chart.onHover({event:r.EventType.HoverEnd,data:e,selection:o.getSelectionName(n.getDataName(e))}),n._selection=void 0})),n.configureItemInteraction(t,e,e.key.toString())}render(){let t=this,e=t._d3XAxis.getScale();this.initializeContextMenuItems();let n=this.getClassNames("chart-marker");if(this._layer.css)for(let t in this._layer.css.classes)n+=t+" ";t._d3svg.selectAll(this.getSelectionClasses("chart-marker")).remove();let r=this.getOutputData(),i=r.length();for(let a=0;a<i;a++){let i=r.get(a),o=e(t.getDataStart(i)),s=0,u=t._d3svg.append("svg:image").attr("xlink:href",t._layer.image).attr("class",n).classed(t.getDataKey(i).toString(),!0).classed(t.getDataName(i),!0).attr("x",o).attr("y",s);this.configureMarkerInteraction(u,i)}this.applyStyles()}}e.MarkerSeries=c,s.D3Chart.register(c)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(6),i=n(1),a=n(27),o=n(5),s=n(12),u=n(2);class l extends s.BaseSeries{constructor(t,e,n,r,i,a){super(t,e,r,i,!1,n),e.colors?this._colors=e.colors:this._colors={},this._levelKeys=[],this._levelKeyList=[],this._leafData={},this.setData(e)}static canRender(t){return 0!=(t.renderType&r.RenderType.Bar)}setData(t){this._data=t.data}isYContinuousSeries(){return!0}getCss(){}getMaxName(){let t="";return this._levelKeyList.forEach(e=>{e.forEach(e=>{t=e.length>t.length?e:t})}),t}getLevelKeys(){return this._levelKeyList}getRequiredWidth(){let t=this._layer;if(t.min_width){let e=0;if(t.renderType&r.RenderType.Stacked)for(let t=0;t<this._stackData.length&&0===e;++t){let n=this._stackData[t];for(let t=0;t<n.length&&0===e;++t)for(let r=0;r<n[t].length&&0===e;++r)e=n[t].length*n[t][r].length}else if(this._hasLevels){let t=this._levelKeyList[this._levelKeyList.length-1];e=this._data.length/t.length}else e=Object.keys(this._data[0].data).length;return t.min_width*e}return 0}static formatDataPerLevelHelper(t,e,n,r,i,a){t.length<=a&&(t[a]={},e[a]=[]);let o=[];for(let t=0;t<r.length;++t)o[t]=r[t];if(i.key&&(o.push(i.key),t[a].hasOwnProperty(i.key)||(t[a][i.key]=!0,e[a].push(i.key))),Array.isArray(i.data))for(let r=0;r<i.data.length;++r)l.formatDataPerLevelHelper(t,e,n,o,i.data[r],a+1);else{let r=a+1;t.length<=r&&(t[r]={},e[r]=[]);let s=i.data;for(let n in s)"key"===n||"keys"===n||t[r].hasOwnProperty(n)||(t[r][n]=!0,e[r].push(n));s.keys=o,s.key=i.key,n[i.key]||(n[i.key]=[]),n[i.key].push(s)}}formatDataPerLevel(){this._levelKeys=[],this._levelKeyList=[],this._leafData={};for(let t=0;t<this._data.length;++t)l.formatDataPerLevelHelper(this._levelKeys,this._levelKeyList,this._leafData,[],this._data[t],0);this._stackData=[];let t=this._levelKeyList[this._levelKeyList.length-1],e=u.stack().keys(t);for(let t in this._leafData)this._stackData.push(e(this._leafData[t]))}getDiscreteXValues(t){let e={};if(this._hasLevels=!0,1===this._data.length){let t=this._data[0].data,e=Object.keys(t).length;this._hasLevels=1===e,this._hasLevels=this._hasLevels||3===e&&this._data[0].data.hasOwnProperty("key")&&this._data[0].data.hasOwnProperty("keys")}if(this._hasLevels||this._layer.renderType&r.RenderType.Stacked){this.formatDataPerLevel();for(let t=0;t<this._data.length;++t)e[this._data[t].key]=!0}else{this._levelKeyList[0]=[];for(let t=0;t<this._data.length;++t)for(let n in this._data[t].data)"key"!==n&&"keys"!==n&&(e[n]=!0,this._levelKeyList[0].push(n));this._levelKeys[0]=e}return Object.keys(e)}static getBarsPerDomainHelper(t,e){let n=0;if(Array.isArray(t.data))for(let r=0;r<t.data.length;++r)n+=l.getBarsPerDomainHelper(t.data[r],e);else{let r=t.data;if(e)n=1;else for(let t in r)"key"!==t&&"keys"!==t&&++n}return n}getBarsPerDomain(t){let e=0;if(1!==this._data.length||t)for(let n=0;n<this._data.length;++n)e=Math.max(e,l.getBarsPerDomainHelper(this._data[n],t));else e=1;return e}getDiscreteYValues(){return[]}getXMinMax(){return[]}static getYMinMaxHelper(t,e,n){if(Array.isArray(e.data))for(let r=0;r<e.data.length;++r)l.getYMinMaxHelper(t,e.data[r],n);else{let r=e.data;if(n){let e=0;for(let t in r)"key"!==t&&"keys"!==t&&(e+=r[t]);t[0]=Math.min(e,t[0]),t[1]=Math.max(e,t[1])}else for(let e in r)"key"!==e&&"keys"!==e&&(t[0]=Math.min(r[e],t[0]),t[1]=Math.max(r[e],t[1]))}}getYMinMax(){let t=0!=(this._layer.renderType&r.RenderType.Stacked),e=[0,0];for(let n=0;n<this._data.length;++n)l.getYMinMaxHelper(e,this._data[n],t);return e}decimateData(t,e,n,r){let i=this;return new Promise((function(t,e){i.setOutputData(i._data),t()}))}getTooltipMetricHelper(t,e,n,r){if(Array.isArray(r.data))for(let i=0;i<r.data.length;++i)this.getTooltipMetricHelper(t,e,n,r.data[i]);else{let i=this.getYScalingInfo().baseScale.scalar,a=this.getYScalingInfo().baseScale.units,o=r.data;if(o.keys[0]===n.selection){let n="";for(let t=1;t<o.keys.length;++t)n+=o.keys[t]+"-";n.length>0&&(n=n.substring(0,n.length-1));let r={source:e,group:n,metrics:{}};for(let t in o)"key"!==t&&"keys"!==t&&(r.metrics[t]=(o[t]*i).toFixed(2)+a);t.push(r)}}}getTooltipMetrics(t,e){let n=[],i=this.getYScalingInfo().baseScale.scalar,a=this.getYScalingInfo().baseScale.units;if(this._hasLevels||this._layer.renderType&r.RenderType.Stacked)for(let r=0;r<this._data.length;++r)this.getTooltipMetricHelper(n,t,e,this._data[r]);else{let r={source:t,group:"",metrics:{}};for(let t=0;t<this._data.length;++t){let n=this._data[t].data;for(let t in n)t===e.selection&&(r.metrics[t]=(n[t]*i).toFixed(2)+a)}n.push(r)}return n}static getLegendInfoHelper(t={},e){if(Array.isArray(e.data))for(let n=0;n<e.data.length;++n)l.getLegendInfoHelper(t,e.data[n]);else{let n=e.data;for(let e in n)"key"!==e&&"keys"!==e&&(t[e]=!0)}}getLegendInfo(){let t=[],e={};for(let t=0;t<this._data.length;++t)l.getLegendInfoHelper(e,this._data[t]);for(let n in e){let e=this._d3svg.selectAll("."+i.getSelectionName(n));t.push({key:n,color:e.style("fill")?e.style("fill"):e.attr("fill"),opacity:e.style("opacity")?e.style("opacity"):e.attr("opacity"),shape:"rect"})}return t}render(){let t=this;for(let e=0;e<t._d3Elems.length;++e)t._d3Elems[e].remove();this.initializeContextMenuItems(),t._d3Elems=[];let e=t._d3YAxis.getScale(),n=e.domain(),o=this._d3XAxis.getLevelCount(),s=[];for(let e=0;e<o;++e)s.push(t._d3XAxis.getScale(e));let u=t.getClassNames("chart-bar");if(t._layer.css)for(let e in t._layer.css.classes)u+=e+" ";let l=!1;t._layer.renderType&r.RenderType.Stacked&&(u+=" chart-stacked",l=!0);let c=t._d3Chart.getRenderer().getColorManager().getColor(t.getName());t._layer.css&&t._layer.css.style&&t._layer.css.style.hasOwnProperty("color")&&(c=t._layer.css.style.color);let h=t._d3XAxis.getAxis(),f=t._d3Chart.getAnimateDuration();if(t._data.length>0){let r,o=Math.min(s[0].bandwidth(),a.MAX_DISCRETE_WIDTH);n[0]>=0?r=e(n[0]):n[1]<=0?r=e(n[1]):n[0]<0&&n[1]>0&&(r=e(0));let d=function(e,n,r){h.options&&h.options.enableOrdinalBrushSelection?t.configureItemInteraction(e,n,r):t.configureBandedItemInteration(e,n,r),t._d3Elems.push(e)};if(l)for(let r=0;r<this._stackData.length;++r){let a=this._stackData[r];for(let r=0;r<a.length;++r){let o=a[r].key,l=i.getSelectionName(o);t._colors&&t._colors.hasOwnProperty(o)||(t._colors[o]=t._d3Chart.getRenderer().getColorManager().getColor(o));for(let c=0;c<a[r].length;++c){let h=a[r][c],g=e(h[0]);if(isNaN(h[1]))continue;let p=e(h[1]),_="";for(let t=0;t<h.data.keys.length;++t)_+=" "+i.getSelectionName(h.data.keys[t]);let m=0;for(let t=0;t<h.data.keys.length;++t)m+=s[t](h.data.keys[t]);let y=t._d3svg.append("rect").attr("x",m).attr("width",s[h.data.keys.length-1].bandwidth()-1).attr("class",_+" "+l).classed(u,!0).attr("fill",t._colors[o]).attr("y",e(n[0])).attr("height",0);y.transition("add").duration(f).attr("y",p).attr("height",g-p),d(y,h.data,_.trim())}}}else{let n=(t,n)=>{let i=e(n),a=0,o=0;n>0?(a=i,o=r-i):(a=r,o=i-r),t.transition("add").duration(f).attr("y",a).attr("height",o)};if(this._hasLevels){let e=this._levelKeyList[this._levelKeyList.length-1];for(let a=0;a<e.length;++a){let o=e[a],l=i.getSelectionName(o);t._colors&&t._colors.hasOwnProperty(o)||(t._colors[o]=t._d3Chart.getRenderer().getColorManager().getColor(o));for(let e=0;e<t._data.length;++e){let a=t._data[e],c=a.key,h=i.getSelectionName(c);if(!a.data.hasOwnProperty(o))continue;let f=0;for(let t=0;t<a.data.keys.length;++t)f+=s[t](a.data.keys[t]);f+=s[s.length-1](o);let g=t._d3svg.append("rect").attr("x",f).attr("width",s[s.length-1].bandwidth()).attr("class",h+" "+l).classed(u,!0).attr("fill",t._colors[o]).attr("y",r).attr("height",0);n(g,a.data[o]),d(g,a,a.key)}}}else{let e=t._data[0].data;for(let a in e)if("key"!==a&&"keys"!==a){let l=c;t._colors&&t._colors.hasOwnProperty(a)&&(l=t._colors[a]);let h=t._d3svg.append("rect").attr("x",s[0](a)).attr("width",o).attr("class",i.getSelectionName(a)).attr("fill",l).classed(u,!0).attr("y",r).attr("height",0),f={};f[a]=e[a],n(h,e[a]),d(h,f,a)}}}}t.applyStyles()}}e.VerticalBarSeries=l,o.D3Chart.register(l)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(0),i=n(1),a=n(2),o=n(4),s=n(28);class u extends s.D3Polar{getTooltipData(t){let e=this._element;if(e.data&&e.data.hasOwnProperty(t.selection)){let n=this._element.units?this._element.units:"",r={};return r[t.selection]=e.data[t.selection]+n,[{source:e,group:"",metrics:r}]}return[]}getRenderData(){if(!this._renderData){let t=this;this._renderData=Array.prototype.slice.call(this.createArcData()).sort((function(e,n){return t.getDataValue(e)>t.getDataValue(n)?-1:t.getDataValue(e)<t.getDataValue(n)?1:0}));let e=0;for(let t=0;t<this._renderData.length;++t)e+=this._renderData[t].rawData.value;if(e>0){let t=2*Math.PI,n=0,r=1/e;for(let e=0;e<this._renderData.length;++e){let i=this._renderData[e].rawData.value*r;this._renderData[e].startAngle=n*t,this._renderData[e].endAngle=(i+n)*t,n=i+n}}}return this._renderData}createArcData(){if(!this._arcData){let t=this._element;if(t.colors)for(let e in t.colors)this._renderer.getColorManager().setColor(e,t.colors[e]);this._arcData=[];for(let e in t.data)this._arcData.push({outerRadius:1,innerRadius:t.innerRadius?t.innerRadius:0,startAngle:0,endAngle:0,depth:1,rawData:{key:e,value:t.data[e]}})}return this._arcData}getLegendData(){return this.createArcData().map((function(t){return t.rawData}))}renderData(){let t=this,e=this._element,n=this.getRenderData(),r=t._renderer.getColorManager(),o=t.getAnimateDuration(),s=t._graphArea.selectAll(".arc").data(n);s.enter().append("path").attr("class",(function(n){let r=t.getSegmentClasses(n.rawData);return e.category&&(r=i.getSelectionName(e.category)+" "+r),e.title&&(r=i.getSelectionName(e.title)+" "+r),r})).attr("stroke","black").attr("stroke-opacity",.5).attr("fill",(function(e){return r.getColor(t.getDataName(e.rawData))})).transition("open").duration(o).attrTween("d",(function(e){let n=a.interpolate(0,e.startAngle),r=a.interpolate(0,e.endAngle);return function(i){return e.startAngle=n(i),e.endAngle=r(i),t.arc(e)}})).each((function(e){t.configureItemInteraction(a.select(this),e.rawData,e.rawData?e.rawData.key:e.rawData)})),s.attr("d",(function(e){return t.arc(e)}))}render(t){super.render(t);let e=this._svg.selectAll(".arc");this._options.disableTooltip||this.configureTooltip(e)}}e.D3Pie=u,o.D3Renderer.register(r.UIType.Pie,u)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(0),i=n(1),a=n(9),o=n(3),s=n(4),u=n(2),l=n(28);class c{constructor(){this._maxDepth=0,this.reset()}reset(){this._data={arcs:void 0,renderedArcs:void 0,background:void 0}}getKey(){return c.KEY}getName(){return""}getValues(){return this._data}addArc(t,e,n,r){this._maxDepth=Math.max(this._maxDepth,e);let i=r+t.value*n*c.VALUE_TO_ANGLE;this._data.arcs.push({outerRadius:void 0,innerRadius:void 0,startAngle:r,endAngle:i,depth:e,rawData:t}),t.children.sort((function(t,e){return t.value>e.value?-1:t.value<e.value?1:0}));for(let i=0;i<t.children.length;++i)r=this.addArc(t.children[i],e+1,n,r);return i}getArcs(t){if(!this._data.arcs){this._data.arcs=[],0!==t.value&&this.addArc(t,2,1/t.value,0);let e=1/this._maxDepth;for(let t=0;t<this._data.arcs.length;++t){let n=this._data.arcs[t];n.outerRadius=n.depth*e,n.innerRadius=(n.depth-1)*e}}return this._data.arcs}decimateArcs(t,e){this._data.arcs=this.getArcs(t),this._sortedArcs=Array.prototype.slice.call(this._data.arcs).sort((function(t,e){return t.rawData.value>e.rawData.value?-1:t.rawData.value<e.rawData.value?1:0})),this._data.renderedArcs=e?this._sortedArcs.splice(0,e):this._sortedArcs;let n={outerRadius:1/this._maxDepth,innerRadius:0,startAngle:0,endAngle:c.VALUE_TO_ANGLE,depth:0,rawData:t.parent};this._data.arcs.push(n),this._data.renderedArcs.push(n)}generateBackground(t){if(!this._data.background){this.getArcs(t);let e=[];for(let t=0;t<this._data.arcs.length;++t){let n=this._data.arcs[t];e.push({isStart:!0,angle:n.startAngle,radius:n.outerRadius}),e.push({isStart:!1,angle:n.endAngle,radius:n.outerRadius})}e.sort((function(t,e){return t.angle<e.angle?-1:t.angle>e.angle?1:0})),this._data.background=[],this._data.background.push({angle:0,radius:0});for(let t=0;t<e.length;++t){let n=e[t].angle,r=0,i=0;for(;t<e.length&&e[t].angle===n;++t)e[t].isStart?r=Math.max(r,e[t].radius):i=Math.max(i,e[t].radius);i&&(this._data.background.push({angle:this._data.background[this._data.background.length-1].angle,radius:i}),this._data.background.push({angle:n,radius:i})),r&&this._data.background.push({angle:n,radius:r})}}}setArcLimit(t){return this._arcLimit=t,this}decimateValues(t){return this.decimateArcs(t,this._arcLimit),this.generateBackground(t),this._data}}e.SunburstDecimator=c,c.KEY="SunburstDecimator",c.VALUE_TO_ANGLE=2*Math.PI;class h extends l.D3Polar{constructor(t,e,n){super(t,e,n),this._options.height=400;let r=this;this.renderBackground=u.radialArea().angle((function(t){return t.angle})).innerRadius((function(t){return 0})).outerRadius((function(t){return t.radius*r._radius}))}createLayout(){super.createLayout(),this._svg.select(".graphArea").append("path").classed("background",!0).attr("fill","black").attr("stroke","black")}getLegendData(){return[]}configureHoverLine(){let t=this,e=1.1*t._radius;return void t._svg.on("mouseover",(function(){t._hoverLine=t._svg.select("g").append("path").attr("class","polar-hover-line").attr("stroke","#222222").attr("stroke-width",1).attr("pointer-events","none")})).on("mousemove",(function(){let n=u.mouse(t._svg.node()),r=Math.atan2(n[0]-t._center.x,t._center.y-n[1]),i=[{length:0,angle:r},{length:1,angle:r}],a=u.radialLine().angle((function(t){return t.angle})).radius((function(t){return t.length*e}));t._hoverLine.attr("d",a(i))})).on("mouseout",(function(){t._hoverLine&&(t._hoverLine.remove(),t._hoverLine=void 0)}))}configureTooltip(){let t=this;return this._dataTooltip=new a.CustomDivTooltip(t._tooltipId,"tooltip-t"),void this._dataTooltip.setAnalyticsName(t._tooltipAnalyticsName).setTarget(t._svg).setEnterCallback(n).setMoveCallback(n).setPlaceTooltipLeftRight().alwaysRecalcWidth(!0).setDelay(t._options.tooltipDelay?t._options.tooltipDelay:0);function e(e){let n={},r=t._decimator.getValues().arcs;for(let i=0;i<r.length;++i){let a=r[i];a.startAngle<e&&a.endAngle>e&&(n[t.getDataName(a.rawData)]="")}return n}function n(){let n=t._hoverItem,r=u.mouse(t._svg.node()),i=Math.atan2(r[0]-t._center.x,t._center.y-r[1]);if(i<0&&(i+=h.TWO_PI),o.SVGRenderer.IS_RESIZING)return;let a=t._element,s=[];if(n){let e=a.units?a.units:"",r={};r[t.getDataName(n)]=n.value+e,s.push({source:a,group:"",metrics:r})}if(s.push({source:a,group:"Stack",metrics:e(i)}),n){let e=t.getDataName(n);if(a.onTooltip){let n={tooltip:t._dataTooltip};a.onTooltip({caller:a,selection:e,data:n})}}return a.title?t._dataTooltip.setData(a.title+" for "+t.getDataName(n),s):t._dataTooltip.setData("",s),!0}}renderData(){let t=this,e=this._element;if(!e.data&&0!==e.data.length)return;let n=2*Math.PI,r=t._decimator.getValues().arcs;t._decimator.reset();let a,o,s,l=e.data[0],c=t._decimator.decimateValues(e.data[0]),h=c.arcs,f=c.renderedArcs,d={},g=0,p={};if(r){o=r[0];for(let e=0;e<r.length;++e){let n=r[e];p[t.getDataKey(n.rawData)]=n,n.rawData===l&&(a=n)}for(let e=0;e<h.length;++e){let n=h[e];d[t.getDataKey(n.rawData)]=n}let e=t.getDataKey(o.rawData);for(let n=0;n<f.length;++n){let r=f[n];if(t.getDataKey(r.rawData)===e){s=r;break}}g=(a.startAngle+a.endAngle)/2}let _=t._element,m=t._renderer.getColorManager(),y=super.getAnimateDuration(),v=function(e){let n=p[t.getDataKey(e.rawData)],r=d[t.getDataKey(e.rawData)];if(n&&r){let e=u.interpolate(n.startAngle,r.startAngle),i=u.interpolate(n.endAngle,r.endAngle),a=u.interpolate(n.innerRadius,r.innerRadius),o=u.interpolate(n.outerRadius,r.outerRadius);return function(n){let s={startAngle:e(n),endAngle:i(n),innerRadius:a(n),outerRadius:o(n),depth:r.depth,rawData:r.rawData};return t.arc(s)}}},x=t._svg.select(".graphArea"),b=x.selectAll(".arc").data(f,(function(e){if(e)return t.getDataKey(e.rawData).toString()}));b.exit().transition("remove").duration(y).attrTween("d",(function(e){let r,i,a,o,s=v(e);return s||(r=e.startAngle>g?u.interpolate(e.startAngle,n):u.interpolate(e.startAngle,0),i=e.endAngle>g?u.interpolate(e.endAngle,n):u.interpolate(e.endAngle,0),a=u.interpolate(e.innerRadius,0),o=u.interpolate(e.outerRadius,0),function(n){let s={startAngle:r(n),endAngle:i(n),innerRadius:a(n),outerRadius:o(n),depth:e.depth,rawData:e.rawData};return t.arc(s)})})).remove(),b.transition("update").duration(y).attrTween("d",(function(t){return v(t)}));b.enter().append("path").attr("class",(function(e){let n=t.getSegmentClasses(e.rawData);return _.category&&(n=i.getSelectionName(_.category)+" "+n),_.title&&(n=i.getSelectionName(_.title)+" "+n),n})).attr("stroke","black").attr("stroke-opacity",.5).attr("fill",(function(e){return e.rawData?m.getColor(t.getDataName(e.rawData)):"white"})).on("click",(function(e){e.rawData&&(t._element.data=[e.rawData],t.renderData())})).transition("add").duration(y).attrTween("d",(function(e){let r,i,a,l,c=v(e);return c||(s?0===e.innerRadius?(r=u.interpolate(0,0),i=u.interpolate(n,n),a=u.interpolate(0,e.innerRadius),l=u.interpolate(0,e.outerRadius)):(e.startAngle>=s.endAngle?(r=u.interpolate(n,e.startAngle),i=u.interpolate(n,e.endAngle)):(r=u.interpolate(0,e.startAngle),i=u.interpolate(0,e.endAngle)),a=u.interpolate(o.innerRadius,e.innerRadius),l=u.interpolate(o.innerRadius,e.outerRadius)):(r=u.interpolate(0,e.startAngle),i=u.interpolate(0,e.endAngle),a=u.interpolate(0,e.innerRadius),l=u.interpolate(0,e.outerRadius)),function(n){let o={startAngle:r(n),endAngle:i(n),innerRadius:a(n),outerRadius:l(n),depth:e.depth,rawData:e.rawData};return t.arc(o)})})).each((function(e){t.configureItemInteraction(u.select(this),e.rawData,e.rawData?e.rawData.name:e.rawData)}));x.select(".background").style("opacity",1e-6).attr("d",t.renderBackground(t._decimator.getValues().background)).transition("backgroundShow").duration(y).style("opacity",.2)}render(t){let e=this._element;e.decimator&&(this._decimator=e.decimator),this._decimator||(this._decimator=new c),super.render(t),this.configureHoverLine()}}e.D3Sunburst=h,h.TWO_PI=2*Math.PI,s.D3Renderer.register(r.UIType.Sunburst,h)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(0),i=n(28),a=n(4),o=n(3),s=n(1),u=n(9),l=n(2);class c extends i.D3Polar{hover(t){this.focus(t)}focus(t){let e=this._svg.selectAll(".radar-area."+t.selection),n=this._svg.selectAll(".radar-circle."+t.selection);switch(t.event){case r.EventType.FocusStart:this._svg.selectAll(".radar-circle").transition().duration(200).attr("fill-opacity",.1),this._svg.selectAll(".radar-area").transition().duration(200).attr("fill-opacity",.1).attr("stroke-opacity",.1),e.transition().duration(200).attr("fill-opacity",.7).attr("stroke-opacity",.8),n.transition().duration(200).attr("fill-opacity",.7);break;case r.EventType.FocusEnd:this._svg.selectAll(".radar-circle").transition().duration(200).attr("fill-opacity",1),this._svg.selectAll(".radar-area").transition().duration(200).attr("fill-opacity",.35).attr("stroke-opacity",.8)}}getTooltipData(t){let e=this._element;for(let n=0;n<e.data.length;++n)if(e.data&&e.data[n].key.localeCompare(t.selection)){let t=e.data[n].units?e.data[n].units:"",r={};return e.data[n].data.forEach(e=>{e.units?r[e.key]=e.data+e.units:r[e.key]=e.data+t}),[{source:e,group:"",metrics:r}]}return[]}configureTooltip(t,e){if(void 0===t)return;let n=this;return this._dataTooltip=new u.CustomDivTooltip(n._tooltipId,"tooltip-t"),void this._dataTooltip.setAnalyticsName(n._tooltipAnalyticsName).setTarget(t).setEnterCallback(r).setMoveCallback(r).setPlaceTooltipLeftRight().alwaysRecalcWidth(!0).setDelay(n._options.tooltipDelay?n._options.tooltipDelay:0);function r(t){if(o.SVGRenderer.IS_RESIZING)return;let r=n._element;if(r.onTooltip){let t={tooltip:n._dataTooltip};n._dataTooltip.setData(r.title+" for "+e.key,[]),r.onTooltip({caller:r,selection:e.key,data:t})}else{let t=e.data,i={},a=e.units?e.units:"";t.forEach(t=>{t.units?i[t.key]=t.data+t.units:i[t.key]=t.data+a});let o=[{source:r,group:"",metrics:i}];r.title?n._dataTooltip.setData(r.title+" for "+e.key,o):n._dataTooltip.setData("",o)}return!0}}getLegendData(){return this._element.data}renderData(){let t=this,e=this._element.data,n=e[0].data.map((function(t){return t.key})),r=n.length,i=2*Math.PI/r,a=l.scaleLinear().range([0,this._radius]).domain([0,100]),o=this._graphArea.append("defs").append("filter").attr("id","glow"),u=(o.append("feGaussianBlur").attr("stdDeviation","2.5").attr("result","coloredBlur"),o.append("feMerge")),c=(u.append("feMergeNode").attr("in","coloredBlur"),u.append("feMergeNode").attr("in","SourceGraphic"),this._graphArea.append("g").attr("class","axis-wrapper"));c.selectAll(".levels").data(l.range(1,6).reverse()).enter().append("circle").attr("class","axis-circle").attr("r",(function(e,n){return t._radius/5*e})).style("fill","#CDCDCD").style("stroke","#CDCDCD").style("fill-opacity",.1).style("filter","url(#glow)");let h=c.selectAll(".axis").data(n).enter().append("g").attr("class","axis-line");h.append("line").attr("x1",0).attr("y1",0).attr("x2",(function(t,e){return a(100*1.1)*Math.cos(i*e-Math.PI/2)})).attr("y2",(function(t,e){return a(100*1.1)*Math.sin(i*e-Math.PI/2)})).attr("class","line").style("stroke","white").style("stroke-width","2px"),h.append("text").attr("class","axis-text").style("font-size","11px").attr("text-anchor","middle").attr("dy","0.35em").attr("x",(function(t,e){return a(125)*Math.cos(i*e-Math.PI/2)})).attr("y",(function(t,e){return a(125)*Math.sin(i*e-Math.PI/2)})).text((function(t){return t})).call((function(t,e){t.each((function(){let t,n=l.select(this),r=n.text().split(/\s+/).reverse(),i=[],a=0,o=n.attr("y"),s=n.attr("x"),u=parseFloat(n.attr("dy")),c=n.text(null).append("tspan").attr("x",s).attr("y",o).attr("dy",u+"em");for(;t=r.pop();)i.push(t),c.text(i.join(" ")),c.node().getComputedTextLength()>e&&(i.pop(),c.text(i.join(" ")),i=[t],c=n.append("tspan").attr("x",s).attr("y",o).attr("dy",1.4*++a+u+"em").text(t))}))}),60);let f=function(t){return t.range?a((t.data-t.range.min)*(t.range.max-t.range.min)*100):a(t.data)},d=l.radialLine().curve(l.curveLinearClosed).radius(f).angle((function(t,e){return e*i}));e.forEach(e=>{let n,r=t._renderer.getColorManager().getColor(e.key),a=this._graphArea.append("g").attr("fill",r).attr("class","radar-blob").classed(this.getDataKey(e).toString(),!0);if(!this._options.disableBackground){let t=a.append("path").attr("class","radar-area").classed(this.getDataKey(e).toString(),!0).attr("d",(function(){return d(e.data)})).attr("fill",r).attr("fill-opacity",.35);this.configureItemInteraction(t,e,e.key),this.configureTooltip(t,e)}n=a.append("path").attr("class","radar-area").classed(this.getDataKey(e).toString(),!0).attr("d",(function(){return d(e.data)})).attr("stroke-width","1px").attr("stroke",r).attr("fill","none").attr("filter","url(#glow)"),this.configureItemInteraction(n,e,e.key),this.configureTooltip(n,e);let o=[];e.data.forEach(t=>{let n=s.copy(t);n.parent=e.key,o.push(n)});let u=a.selectAll(".radar-circle").data(o).enter().append("circle").attr("class","radar-circle").attr("r",4).attr("cx",(function(t,e){return f(t)*Math.cos(i*e-Math.PI/2)})).attr("cy",(function(t,e){return f(t)*Math.sin(i*e-Math.PI/2)})).attr("stroke",r).attr("fill",r).attr("fill-opacity",.8).classed(this.getDataKey(e).toString(),!0);this.configureItemInteraction(u,e,e.key),this.configureTooltip(u,e)}),this._svg.attr("width",this._options.width).attr("height",this._options.height).attr("class","chart-radar")}}e.D3Radar=c,a.D3Renderer.register(r.UIType.Radar,c)}])}));