/* Highcharts JS v5.0.2 (2016-10-26) 3D features for Highcharts JS @license: www.highcharts.com/license */ (function(E){"object"===typeof module&&module.exports?module.exports=E:E(Highcharts)})(function(E){(function(a){var r=a.deg2rad,g=a.pick;a.perspective=function(t,n,v){var k=n.options.chart.options3d,p=v?n.inverted:!1,h=n.plotWidth/2,m=n.plotHeight/2,f=k.depth/2,d=g(k.depth,1)*g(k.viewDistance,0),e=n.scale3d||1,b=r*k.beta*(p?-1:1),k=r*k.alpha*(p?-1:1),c=Math.cos(k),q=Math.cos(-b),x=Math.sin(k),y=Math.sin(-b);v||(h+=n.plotLeft,m+=n.plotTop);return a.map(t,function(b){var a,k;k=(p?b.y:b.x)-h;var g=(p? b.x:b.y)-m,n=(b.z||0)-f;a=q*k-y*n;b=-x*y*k+c*g-q*x*n;k=c*y*k+x*g+c*q*n;g=0e&&d-e>Math.PI/2+.0001?(G=G.concat(t(b,a,l,c,e,e+Math.PI/2,D,f)), G=G.concat(t(b,a,l,c,e+Math.PI/2,d,D,f))):dMath.PI/2+.0001?(G=G.concat(t(b,a,l,c,e,e-Math.PI/2,D,f)),G=G.concat(t(b,a,l,c,e-Math.PI/2,d,D,f))):["C",b+l*Math.cos(e)-l*B*C*Math.sin(e)+D,a+c*Math.sin(e)+c*B*C*Math.cos(e)+f,b+l*Math.cos(d)+l*B*C*Math.sin(d)+D,a+c*Math.sin(d)-c*B*C*Math.cos(d)+f,b+l*Math.cos(d)+D,a+c*Math.sin(d)+f]}var n=Math.cos,v=Math.PI,k=Math.sin,p=a.animObject,h=a.charts,m=a.color,f=a.defined,d=a.deg2rad,e=a.each,b=a.extend,c=a.inArray,q=a.map,x=a.merge,y=a.perspective,F= a.pick,z=a.SVGElement,A=a.SVGRenderer,w=a.wrap,B=4*(Math.sqrt(2)-1)/3/(v/2);A.prototype.toLinePath=function(b,a){var l=[];e(b,function(b){l.push("L",b.x,b.y)});b.length&&(l[0]="M",a&&l.push("Z"));return l};A.prototype.cuboid=function(b){var c=this.g();b=this.cuboidPath(b);c.attr({"stroke-linejoin":"round"});c.front=this.path(b[0]).attr({"class":"highcharts-3d-front",zIndex:b[3]}).add(c);c.top=this.path(b[1]).attr({"class":"highcharts-3d-top",zIndex:b[4]}).add(c);c.side=this.path(b[2]).attr({"class":"highcharts-3d-side", zIndex:b[5]}).add(c);c.fillSetter=function(b){this.front.attr({fill:b});this.top.attr({fill:m(b).brighten(.1).get()});this.side.attr({fill:m(b).brighten(-.1).get()});this.color=b;return this};c.opacitySetter=function(b){this.front.attr({opacity:b});this.top.attr({opacity:b});this.side.attr({opacity:b});return this};c.attr=function(b){if(b.shapeArgs||f(b.x))b=this.renderer.cuboidPath(b.shapeArgs||b),this.front.attr({d:b[0],zIndex:b[3]}),this.top.attr({d:b[1],zIndex:b[4]}),this.side.attr({d:b[2],zIndex:b[5]}); else return a.SVGElement.prototype.attr.call(this,b);return this};c.animate=function(b,c,a){f(b.x)&&f(b.y)?(b=this.renderer.cuboidPath(b),this.front.attr({zIndex:b[3]}).animate({d:b[0]},c,a),this.top.attr({zIndex:b[4]}).animate({d:b[1]},c,a),this.side.attr({zIndex:b[5]}).animate({d:b[2]},c,a),this.attr({zIndex:-b[6]})):b.opacity?(this.front.animate(b,c,a),this.top.animate(b,c,a),this.side.animate(b,c,a)):z.prototype.animate.call(this,b,c,a);return this};c.destroy=function(){this.front.destroy();this.top.destroy(); this.side.destroy();return null};c.attr({zIndex:-b[6]});return c};A.prototype.cuboidPath=function(b){function c(b){return k[b]}var a=b.x,e=b.y,d=b.z,f=b.height,D=b.width,m=b.depth,k=[{x:a,y:e,z:d},{x:a+D,y:e,z:d},{x:a+D,y:e+f,z:d},{x:a,y:e+f,z:d},{x:a,y:e+f,z:d+m},{x:a+D,y:e+f,z:d+m},{x:a+D,y:e,z:d+m},{x:a,y:e,z:d+m}],k=y(k,h[this.chartIndex],b.insidePlotArea),d=function(b,a){var e=[];b=q(b,c);a=q(a,c);0>r(b)?e=b:0>r(a)&&(e=a);return e};b=d([3,2,1,0],[7,6,5,4]);a=[4,5,2,3];e=d([1,6,7,0],a);d=d([1, 2,5,6],[0,7,4,3]);return[this.toLinePath(b,!0),this.toLinePath(e,!0),this.toLinePath(d,!0),g(b),g(e),g(d),9E9*g(q(a,c))]};a.SVGRenderer.prototype.arc3d=function(a){function f(b){var a=!1,e={},d;for(d in b)-1!==c(d,h)&&(e[d]=b[d],delete b[d],a=!0);return a?e:!1}var l=this.g(),k=l.renderer,h="x y r innerR start end".split(" ");a=x(a);a.alpha*=d;a.beta*=d;l.top=k.path();l.side1=k.path();l.side2=k.path();l.inn=k.path();l.out=k.path();l.onAdd=function(){var b=l.parentGroup,a=l.attr("class");l.top.add(l); e(["out","inn","side1","side2"],function(c){l[c].addClass(a+" highcharts-3d-side").add(b)})};l.setPaths=function(b){var a=l.renderer.arc3dPath(b),c=100*a.zTop;l.attribs=b;l.top.attr({d:a.top,zIndex:a.zTop});l.inn.attr({d:a.inn,zIndex:a.zInn});l.out.attr({d:a.out,zIndex:a.zOut});l.side1.attr({d:a.side1,zIndex:a.zSide1});l.side2.attr({d:a.side2,zIndex:a.zSide2});l.zIndex=c;l.attr({zIndex:c});b.center&&(l.top.setRadialReference(b.center),delete b.center)};l.setPaths(a);l.fillSetter=function(b){var a= m(b).brighten(-.1).get();this.fill=b;this.side1.attr({fill:a});this.side2.attr({fill:a});this.inn.attr({fill:a});this.out.attr({fill:a});this.top.attr({fill:b});return this};e(["opacity","translateX","translateY","visibility"],function(b){l[b+"Setter"]=function(b,a){l[a]=b;e(["out","inn","side1","side2","top"],function(c){l[c].attr(a,b)})}});w(l,"attr",function(a,c,e){var d;"object"===typeof c&&(d=f(c))&&(b(l.attribs,d),l.setPaths(l.attribs));return a.call(this,c,e)});w(l,"animate",function(b,a,c, e){var d,l=this.attribs,k;delete a.center;delete a.z;delete a.depth;delete a.alpha;delete a.beta;k=p(F(c,this.renderer.globalAnimation));k.duration&&(a=x(a),d=f(a),a.dummy=1,d&&(k.step=function(b,a){function c(b){return l[b]+(F(d[b],l[b])-l[b])*a.pos}"dummy"===a.prop&&a.elem.setPaths(x(l,{x:c("x"),y:c("y"),r:c("r"),innerR:c("innerR"),start:c("start"),end:c("end")}))}),c=k);return b.call(this,a,c,e)});l.destroy=function(){this.top.destroy();this.out.destroy();this.inn.destroy();this.side1.destroy(); this.side2.destroy();z.prototype.destroy.call(this)};l.hide=function(){this.top.hide();this.out.hide();this.inn.hide();this.side1.hide();this.side2.hide()};l.show=function(){this.top.show();this.out.show();this.inn.show();this.side1.show();this.side2.show()};return l};A.prototype.arc3dPath=function(b){function a(b){b%=2*Math.PI;b>Math.PI&&(b=2*Math.PI-b);return b}var c=b.x,e=b.y,d=b.start,f=b.end-.00001,m=b.r,h=b.innerR,p=b.depth,q=b.alpha,g=b.beta,x=Math.cos(d),r=Math.sin(d);b=Math.cos(f);var y= Math.sin(f),u=m*Math.cos(g),m=m*Math.cos(q),B=h*Math.cos(g),C=h*Math.cos(q),h=p*Math.sin(g),w=p*Math.sin(q),p=["M",c+u*x,e+m*r],p=p.concat(t(c,e,u,m,d,f,0,0)),p=p.concat(["L",c+B*b,e+C*y]),p=p.concat(t(c,e,B,C,f,d,0,0)),p=p.concat(["Z"]),F=0-F?d:f>-F?-F:d,z=fA&&dv-g&&dh&&(r=Math.min(r,1-Math.abs((d+q)/(h+q))%1));eg&&(r=0>g?Math.min(r,(b+m)/(-g+b+m)):Math.min(r,1-(b+m)/(g+m)%1));c=k.min&&m<=k.max:!1,p.push({x:h.plotX,y:h.plotY,z:h.plotZ});n=r(p,n,!0);for(f=0;f