/*
 * Copyright (c) 2020 aureliancnx
 *
 * MIT LICENSE
 *
 * This project is part of aureliancnx.
 * See https://github.com/aureliancnx/Bubulle-Norminette for further info.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE. */
!function(e,t){"function"==typeof define&&define.amd?define("Chartist",[],function(){return e.Chartist=t()}):"object"==typeof module&&module.exports?module.exports=t():e.Chartist=t()}(this,function(){var e={version:"0.11.0"};return function(u,m,f){"use strict";f.namespaces={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",ct:"http://gionkunz.github.com/chartist-js/ct"},f.noop=function(e){return e},f.alphaNumerate=function(e){return String.fromCharCode(97+e%26)},f.extend=function(e){var t,i,n;for(e=e||{},t=1;t<arguments.length;t++)for(var s in i=arguments[t])"object"!=typeof(n=i[s])||null===n||n instanceof Array?e[s]=n:e[s]=f.extend(e[s],n);return e},f.replaceAll=function(e,t,i){return e.replace(new RegExp(t,"g"),i)},f.ensureUnit=function(e,t){return"number"==typeof e&&(e+=t),e},f.quantity=function(e){if("string"!=typeof e)return{value:e};var t=/^(\d+)\s*(.*)$/g.exec(e);return{value:+t[1],unit:t[2]||void 0}},f.querySelector=function(e){return e instanceof Node?e:m.querySelector(e)},f.times=function(e){return Array.apply(null,new Array(e))},f.sum=function(e,t){return e+(t||0)},f.mapMultiply=function(t){return function(e){return e*t}},f.mapAdd=function(t){return function(e){return e+t}},f.serialMap=function(n,s){var r=[],e=Math.max.apply(null,n.map(function(e){return e.length}));return f.times(e).forEach(function(e,t){var i=n.map(function(e){return e[t]});r[t]=s.apply(null,i)}),r},f.roundWithPrecision=function(e,t){var i=Math.pow(10,t||f.precision);return Math.round(e*i)/i},f.precision=8,f.escapingMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"},f.serialize=function(e){return null==e?e:("number"==typeof e?e=""+e:"object"==typeof e&&(e=JSON.stringify({data:e})),Object.keys(f.escapingMap).reduce(function(e,t){return f.replaceAll(e,t,f.escapingMap[t])},e))},f.deserialize=function(e){if("string"!=typeof e)return e;e=Object.keys(f.escapingMap).reduce(function(e,t){return f.replaceAll(e,f.escapingMap[t],t)},e);try{e=void 0!==(e=JSON.parse(e)).data?e.data:e}catch(e){}return e},f.createSvg=function(t,e,i,n){var s;return e=e||"100%",i=i||"100%",Array.prototype.slice.call(t.querySelectorAll("svg")).filter(function(e){return e.getAttributeNS(f.namespaces.xmlns,"ct")}).forEach(function(e){t.removeChild(e)}),(s=new f.Svg("svg").attr({width:e,height:i}).addClass(n))._node.style.width=e,s._node.style.height=i,t.appendChild(s._node),s},f.normalizeData=function(e,t,i){var n,s={raw:e,normalized:{}};return s.normalized.series=f.getDataArray({series:e.series||[]},t,i),n=s.normalized.series.every(function(e){return e instanceof Array})?Math.max.apply(null,s.normalized.series.map(function(e){return e.length})):s.normalized.series.length,s.normalized.labels=(e.labels||[]).slice(),Array.prototype.push.apply(s.normalized.labels,f.times(Math.max(0,n-s.normalized.labels.length)).map(function(){return""})),t&&f.reverseData(s.normalized),s},f.safeHasProperty=function(e,t){return null!==e&&"object"==typeof e&&e.hasOwnProperty(t)},f.isDataHoleValue=function(e){return null==e||"number"==typeof e&&isNaN(e)},f.reverseData=function(e){e.labels.reverse(),e.series.reverse();for(var t=0;t<e.series.length;t++)"object"==typeof e.series[t]&&void 0!==e.series[t].data?e.series[t].data.reverse():e.series[t]instanceof Array&&e.series[t].reverse()},f.getDataArray=function(e,t,n){return e.series.map(function e(t){if(f.safeHasProperty(t,"value"))return e(t.value);if(f.safeHasProperty(t,"data"))return e(t.data);if(t instanceof Array)return t.map(e);if(!f.isDataHoleValue(t)){if(n){var i={};return"string"==typeof n?i[n]=f.getNumberOrUndefined(t):i.y=f.getNumberOrUndefined(t),i.x=t.hasOwnProperty("x")?f.getNumberOrUndefined(t.x):i.x,i.y=t.hasOwnProperty("y")?f.getNumberOrUndefined(t.y):i.y,i}return f.getNumberOrUndefined(t)}})},f.normalizePadding=function(e,t){return t=t||0,"number"==typeof e?{top:e,right:e,bottom:e,left:e}:{top:"number"==typeof e.top?e.top:t,right:"number"==typeof e.right?e.right:t,bottom:"number"==typeof e.bottom?e.bottom:t,left:"number"==typeof e.left?e.left:t}},f.getMetaData=function(e,t){var i=e.data?e.data[t]:e[t];return i?i.meta:void 0},f.orderOfMagnitude=function(e){return Math.floor(Math.log(Math.abs(e))/Math.LN10)},f.projectLength=function(e,t,i){return t/i.range*e},f.getAvailableHeight=function(e,t){return Math.max((f.quantity(t.height).value||e.height())-(t.chartPadding.top+t.chartPadding.bottom)-t.axisX.offset,0)},f.getHighLow=function(e,t,s){var r={high:void 0===(t=f.extend({},t,s?t["axis"+s.toUpperCase()]:{})).high?-Number.MAX_VALUE:+t.high,low:void 0===t.low?Number.MAX_VALUE:+t.low},a=void 0===t.high,o=void 0===t.low;return(a||o)&&function e(t){if(void 0!==t)if(t instanceof Array)for(var i=0;i<t.length;i++)e(t[i]);else{var n=s?+t[s]:+t;a&&n>r.high&&(r.high=n),o&&n<r.low&&(r.low=n)}}(e),!t.referenceValue&&0!==t.referenceValue||(r.high=Math.max(t.referenceValue,r.high),r.low=Math.min(t.referenceValue,r.low)),r.high<=r.low&&(0===r.low?r.high=1:r.low<0?r.high=0:(0<r.high||(r.high=1),r.low=0)),r},f.isNumeric=function(e){return null!==e&&isFinite(e)},f.isFalseyButZero=function(e){return!e&&0!==e},f.getNumberOrUndefined=function(e){return f.isNumeric(e)?+e:void 0},f.isMultiValue=function(e){return"object"==typeof e&&("x"in e||"y"in e)},f.getMultiValue=function(e,t){return f.isMultiValue(e)?f.getNumberOrUndefined(e[t||"y"]):f.getNumberOrUndefined(e)},f.rho=function(e){if(1===e)return e;function t(e){return e*e+1}var i,n=2,s=2;if(e%2==0)return 2;for(;n=t(n)%e,s=t(t(s))%e,1===(i=function e(t,i){return t%i==0?i:e(i,t%i)}(Math.abs(n-s),e)););return i},f.getBounds=function(e,t,i,n){var s,r,a=0,o={high:t.high,low:t.low};o.valueRange=o.high-o.low,o.oom=f.orderOfMagnitude(o.valueRange),o.step=Math.pow(10,o.oom),o.min=Math.floor(o.low/o.step)*o.step,o.max=Math.ceil(o.high/o.step)*o.step,o.range=o.max-o.min,o.numberOfSteps=Math.round(o.range/o.step);var l=f.projectLength(e,o.step,o)<i,u=n?f.rho(o.range):0;if(n&&f.projectLength(e,1,o)>=i)o.step=1;else if(n&&u<o.step&&f.projectLength(e,u,o)>=i)o.step=u;else for(;;){if(l&&f.projectLength(e,o.step,o)<=i)o.step*=2;else{if(l||!(f.projectLength(e,o.step/2,o)>=i))break;if(o.step/=2,n&&o.step%1!=0){o.step*=2;break}}if(1e3<a++)throw new Error("Exceeded maximum number of iterations while optimizing scale step!")}var c=2221e-19;function h(e,t){return e===(e+=t)&&(e*=1+(0<t?c:-c)),e}for(o.step=Math.max(o.step,c),s=o.min,r=o.max;s+o.step<=o.low;)s=h(s,o.step);for(;r-o.step>=o.high;)r=h(r,-o.step);o.min=s,o.max=r,o.range=o.max-o.min;for(var d=[],p=o.min;p<=o.max;p=h(p,o.step)){var m=f.roundWithPrecision(p);m!==d[d.length-1]&&d.push(m)}return o.values=d,o},f.polarToCartesian=function(e,t,i,n){var s=(n-90)*Math.PI/180;return{x:e+i*Math.cos(s),y:t+i*Math.sin(s)}},f.createChartRect=function(e,t,i){var n=!(!t.axisX&&!t.axisY),s=n?t.axisY.offset:0,r=n?t.axisX.offset:0,a=e.width()||f.quantity(t.width).value||0,o=e.height()||f.quantity(t.height).value||0,l=f.normalizePadding(t.chartPadding,i),a=Math.max(a,s+l.left+l.right),o=Math.max(o,r+l.top+l.bottom),u={padding:l,width:function(){return this.x2-this.x1},height:function(){return this.y1-this.y2}};return n?("start"===t.axisX.position?(u.y2=l.top+r,u.y1=Math.max(o-l.bottom,u.y2+1)):(u.y2=l.top,u.y1=Math.max(o-l.bottom-r,u.y2+1)),"start"===t.axisY.position?(u.x1=l.left+s,u.x2=Math.max(a-l.right,u.x1+1)):(u.x1=l.left,u.x2=Math.max(a-l.right-s,u.x1+1))):(u.x1=l.left,u.x2=Math.max(a-l.right,u.x1+1),u.y2=l.top,u.y1=Math.max(o-l.bottom,u.y2+1)),u},f.createGrid=function(e,t,i,n,s,r,a,o){var l={};l[i.units.pos+"1"]=e,l[i.units.pos+"2"]=e,l[i.counterUnits.pos+"1"]=n,l[i.counterUnits.pos+"2"]=n+s;var u=r.elem("line",l,a.join(" "));o.emit("draw",f.extend({type:"grid",axis:i,index:t,group:r,element:u},l))},f.createGridBackground=function(e,t,i,n){var s=e.elem("rect",{x:t.x1,y:t.y2,width:t.width(),height:t.height()},i,!0);n.emit("draw",{type:"gridBackground",group:e,element:s})},f.createLabel=function(e,t,i,n,s,r,a,o,l,u,c){var h,d,p={};p[s.units.pos]=e+a[s.units.pos],p[s.counterUnits.pos]=a[s.counterUnits.pos],p[s.units.len]=t,p[s.counterUnits.len]=Math.max(0,r-10),h=u?((d=m.createElement("span")).className=l.join(" "),d.setAttribute("xmlns",f.namespaces.xhtml),d.innerText=n[i],d.style[s.units.len]=Math.round(p[s.units.len])+"px",d.style[s.counterUnits.len]=Math.round(p[s.counterUnits.len])+"px",o.foreignObject(d,f.extend({style:"overflow: visible;"},p))):o.elem("text",p,l.join(" ")).text(n[i]),c.emit("draw",f.extend({type:"label",axis:s,index:i,group:o,element:h,text:n[i]},p))},f.getSeriesOption=function(e,t,i){if(e.name&&t.series&&t.series[e.name]){var n=t.series[e.name];return n.hasOwnProperty(i)?n[i]:t[i]}return t[i]},f.optionsProvider=function(e,i,n){var s,r,a=f.extend({},e),t=[];function o(e){var t=s;if(s=f.extend({},a),i)for(r=0;r<i.length;r++){u.matchMedia(i[r][0]).matches&&(s=f.extend(s,i[r][1]))}n&&e&&n.emit("optionsChanged",{previousOptions:t,currentOptions:s})}if(!u.matchMedia)throw"window.matchMedia not found! Make sure you're using a polyfill.";if(i)for(r=0;r<i.length;r++){var l=u.matchMedia(i[r][0]);l.addListener(o),t.push(l)}return o(),{removeMediaQueryListeners:function(){t.forEach(function(e){e.removeListener(o)})},getCurrentOptions:function(){return f.extend({},s)}}},f.splitIntoSegments=function(e,t,i){i=f.extend({},{increasingX:!1,fillHoles:!1},i);for(var n=[],s=!0,r=0;r<e.length;r+=2)void 0===f.getMultiValue(t[r/2].value)?i.fillHoles||(s=!0):(i.increasingX&&2<=r&&e[r]<=e[r-2]&&(s=!0),s&&(n.push({pathCoordinates:[],valueData:[]}),s=!1),n[n.length-1].pathCoordinates.push(e[r],e[r+1]),n[n.length-1].valueData.push(t[r/2]));return n}}(window,document,e),function(f){"use strict";f.Interpolation={},f.Interpolation.none=function(l){return l=f.extend({},{fillHoles:!1},l),function(e,t){for(var i=new f.Svg.Path,n=!0,s=0;s<e.length;s+=2){var r=e[s],a=e[s+1],o=t[s/2];void 0!==f.getMultiValue(o.value)?(n?i.move(r,a,!1,o):i.line(r,a,!1,o),n=!1):l.fillHoles||(n=!0)}return i}},f.Interpolation.simple=function(h){h=f.extend({},{divisor:2,fillHoles:!1},h);var d=1/Math.max(1,h.divisor);return function(e,t){for(var i,n,s,r=new f.Svg.Path,a=0;a<e.length;a+=2){var o=e[a],l=e[a+1],u=(o-i)*d,c=t[a/2];void 0!==c.value?(void 0===s?r.move(o,l,!1,c):r.curve(i+u,n,o-u,l,o,l,!1,c),i=o,n=l,s=c):h.fillHoles||(i=o=s=void 0)}return r}},f.Interpolation.cardinal=function(u){u=f.extend({},{tension:1,fillHoles:!1},u);var c=Math.min(1,Math.max(0,u.tension)),h=1-c;return function t(e,i){var n=f.splitIntoSegments(e,i,{fillHoles:u.fillHoles});if(n.length){if(1<n.length){var s=[];return n.forEach(function(e){s.push(t(e.pathCoordinates,e.valueData))}),f.Svg.Path.join(s)}if(e=n[0].pathCoordinates,i=n[0].valueData,e.length<=4)return f.Interpolation.none()(e,i);for(var r=(new f.Svg.Path).move(e[0],e[1],!1,i[0]),a=0,o=e.length;a<o-2;a+=2){var l=[{x:+e[a-2],y:+e[a-1]},{x:+e[a],y:+e[a+1]},{x:+e[a+2],y:+e[a+3]},{x:+e[a+4],y:+e[a+5]}];o-4===a?l[3]=l[2]:a||(l[0]={x:+e[a],y:+e[a+1]}),r.curve(c*(-l[0].x+6*l[1].x+l[2].x)/6+h*l[2].x,c*(-l[0].y+6*l[1].y+l[2].y)/6+h*l[2].y,c*(l[1].x+6*l[2].x-l[3].x)/6+h*l[2].x,c*(l[1].y+6*l[2].y-l[3].y)/6+h*l[2].y,l[2].x,l[2].y,!1,i[(a+2)/2])}return r}return f.Interpolation.none()([])}},f.Interpolation.monotoneCubic=function(m){return m=f.extend({},{fillHoles:!1},m),function t(e,i){var n=f.splitIntoSegments(e,i,{fillHoles:m.fillHoles,increasingX:!0});if(n.length){if(1<n.length){var s=[];return n.forEach(function(e){s.push(t(e.pathCoordinates,e.valueData))}),f.Svg.Path.join(s)}if(e=n[0].pathCoordinates,i=n[0].valueData,e.length<=4)return f.Interpolation.none()(e,i);for(var r,a=[],o=[],l=e.length/2,u=[],c=[],h=[],d=[],p=0;p<l;p++)a[p]=e[2*p],o[p]=e[2*p+1];for(p=0;p<l-1;p++)h[p]=o[p+1]-o[p],d[p]=a[p+1]-a[p],c[p]=h[p]/d[p];for(u[0]=c[0],u[l-1]=c[l-2],p=1;p<l-1;p++)0===c[p]||0===c[p-1]||0<c[p-1]!=0<c[p]?u[p]=0:(u[p]=3*(d[p-1]+d[p])/((2*d[p]+d[p-1])/c[p-1]+(d[p]+2*d[p-1])/c[p]),isFinite(u[p])||(u[p]=0));for(r=(new f.Svg.Path).move(a[0],o[0],!1,i[0]),p=0;p<l-1;p++)r.curve(a[p]+d[p]/3,o[p]+u[p]*d[p]/3,a[p+1]-d[p]/3,o[p+1]-u[p+1]*d[p]/3,a[p+1],o[p+1],!1,i[p+1]);return r}return f.Interpolation.none()([])}},f.Interpolation.step=function(c){return c=f.extend({},{postpone:!0,fillHoles:!1},c),function(e,t){for(var i,n,s,r=new f.Svg.Path,a=0;a<e.length;a+=2){var o=e[a],l=e[a+1],u=t[a/2];void 0!==u.value?(void 0===s?r.move(o,l,!1,u):(c.postpone?r.line(o,n,!1,s):r.line(i,l,!1,u),r.line(o,l,!1,u)),i=o,n=l,s=u):c.fillHoles||(i=n=s=void 0)}return r}}}((window,document,e)),function(){"use strict";e.EventEmitter=function(){var n=[];return{addEventHandler:function(e,t){n[e]=n[e]||[],n[e].push(t)},removeEventHandler:function(e,t){n[e]&&(t?(n[e].splice(n[e].indexOf(t),1),0===n[e].length&&delete n[e]):delete n[e])},emit:function(t,i){n[t]&&n[t].forEach(function(e){e(i)}),n["*"]&&n["*"].forEach(function(e){e(t,i)})}}}}((window,document)),function(r){"use strict";r.Class={extend:function(e,t){var i=t||this.prototype||r.Class,n=Object.create(i);function s(){var e=n.constructor||function(){},t=this===r?Object.create(n):this;return e.apply(t,Array.prototype.slice.call(arguments,0)),t}return r.Class.cloneDefinitions(n,e),s.prototype=n,s.super=i,s.extend=this.extend,s},cloneDefinitions:function(){var e=function(e){var t=[];if(e.length)for(var i=0;i<e.length;i++)t.push(e[i]);return t}(arguments),i=e[0];return e.splice(1,e.length-1).forEach(function(t){Object.getOwnPropertyNames(t).forEach(function(e){delete i[e],Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(t,e))})}),i}}}((window,document,e)),function(r,a){"use strict";a.Base=a.Class.extend({constructor:function(e,t,i,n,s){this.container=a.querySelector(e),this.data=t||{},this.data.labels=this.data.labels||[],this.data.series=this.data.series||[],this.defaultOptions=i,this.options=n,this.responsiveOptions=s,this.eventEmitter=a.EventEmitter(),this.supportsForeignObject=a.Svg.isSupported("Extensibility"),this.supportsAnimations=a.Svg.isSupported("AnimationEventsAttribute"),this.resizeListener=function(){this.update()}.bind(this),this.container&&(this.container.__chartist__&&this.container.__chartist__.detach(),this.container.__chartist__=this),this.initializeTimeoutId=setTimeout(function(){r.addEventListener("resize",this.resizeListener),this.optionsProvider=a.optionsProvider(this.options,this.responsiveOptions,this.eventEmitter),this.eventEmitter.addEventHandler("optionsChanged",function(){this.update()}.bind(this)),this.options.plugins&&this.options.plugins.forEach(function(e){e instanceof Array?e[0](this,e[1]):e(this)}.bind(this)),this.eventEmitter.emit("data",{type:"initial",data:this.data}),this.createChart(this.optionsProvider.getCurrentOptions()),this.initializeTimeoutId=void 0}.bind(this),0)},optionsProvider:void 0,container:void 0,svg:void 0,eventEmitter:void 0,createChart:function(){throw new Error("Base chart type can't be instantiated!")},update:function(e,t,i){return e&&(this.data=e||{},this.data.labels=this.data.labels||[],this.data.series=this.data.series||[],this.eventEmitter.emit("data",{type:"update",data:this.data})),t&&(this.options=a.extend({},i?this.options:this.defaultOptions,t),this.initializeTimeoutId||(this.optionsProvider.removeMediaQueryListeners(),this.optionsProvider=a.optionsProvider(this.options,this.responsiveOptions,this.eventEmitter))),this.initializeTimeoutId||this.createChart(this.optionsProvider.getCurrentOptions()),this},detach:function(){return this.initializeTimeoutId?r.clearTimeout(this.initializeTimeoutId):(r.removeEventListener("resize",this.resizeListener),this.optionsProvider.removeMediaQueryListeners()),this},on:function(e,t){return this.eventEmitter.addEventHandler(e,t),this},off:function(e,t){return this.eventEmitter.removeEventHandler(e,t),this},version:a.version,supportsForeignObject:!1})}(window,(document,e)),function(a,l){"use strict";l.Svg=l.Class.extend({constructor:function(e,t,i,n,s){e instanceof Element?this._node=e:(this._node=a.createElementNS(l.namespaces.svg,e),"svg"===e&&this.attr({"xmlns:ct":l.namespaces.ct})),t&&this.attr(t),i&&this.addClass(i),n&&(s&&n._node.firstChild?n._node.insertBefore(this._node,n._node.firstChild):n._node.appendChild(this._node))},attr:function(i,e){return"string"==typeof i?e?this._node.getAttributeNS(e,i):this._node.getAttribute(i):(Object.keys(i).forEach(function(e){var t;void 0!==i[e]&&(-1!==e.indexOf(":")?(t=e.split(":"),this._node.setAttributeNS(l.namespaces[t[0]],e,i[e])):this._node.setAttribute(e,i[e]))}.bind(this)),this)},elem:function(e,t,i,n){return new l.Svg(e,t,i,this,n)},parent:function(){return this._node.parentNode instanceof SVGElement?new l.Svg(this._node.parentNode):null},root:function(){for(var e=this._node;"svg"!==e.nodeName;)e=e.parentNode;return new l.Svg(e)},querySelector:function(e){var t=this._node.querySelector(e);return t?new l.Svg(t):null},querySelectorAll:function(e){var t=this._node.querySelectorAll(e);return t.length?new l.Svg.List(t):null},getNode:function(){return this._node},foreignObject:function(e,t,i,n){var s;"string"==typeof e&&((s=a.createElement("div")).innerHTML=e,e=s.firstChild),e.setAttribute("xmlns",l.namespaces.xmlns);var r=this.elem("foreignObject",t,i,n);return r._node.appendChild(e),r},text:function(e){return this._node.appendChild(a.createTextNode(e)),this},empty:function(){for(;this._node.firstChild;)this._node.removeChild(this._node.firstChild);return this},remove:function(){return this._node.parentNode.removeChild(this._node),this.parent()},replace:function(e){return this._node.parentNode.replaceChild(e._node,this._node),e},append:function(e,t){return t&&this._node.firstChild?this._node.insertBefore(e._node,this._node.firstChild):this._node.appendChild(e._node),this},classes:function(){return this._node.getAttribute("class")?this._node.getAttribute("class").trim().split(/\s+/):[]},addClass:function(e){return this._node.setAttribute("class",this.classes(this._node).concat(e.trim().split(/\s+/)).filter(function(e,t,i){return i.indexOf(e)===t}).join(" ")),this},removeClass:function(e){var t=e.trim().split(/\s+/);return this._node.setAttribute("class",this.classes(this._node).filter(function(e){return-1===t.indexOf(e)}).join(" ")),this},removeAllClasses:function(){return this._node.setAttribute("class",""),this},height:function(){return this._node.getBoundingClientRect().height},width:function(){return this._node.getBoundingClientRect().width},animate:function(e,i,o){return void 0===i&&(i=!0),Object.keys(e).forEach(function(a){function t(t,e){var i,n,s,r={};t.easing&&(s=t.easing instanceof Array?t.easing:l.Svg.Easing[t.easing],delete t.easing),t.begin=l.ensureUnit(t.begin,"ms"),t.dur=l.ensureUnit(t.dur,"ms"),s&&(t.calcMode="spline",t.keySplines=s.join(" "),t.keyTimes="0;1"),e&&(t.fill="freeze",r[a]=t.from,this.attr(r),n=l.quantity(t.begin||0).value,t.begin="indefinite"),i=this.elem("animate",l.extend({attributeName:a},t)),e&&setTimeout(function(){try{i._node.beginElement()}catch(e){r[a]=t.to,this.attr(r),i.remove()}}.bind(this),n),o&&i._node.addEventListener("beginEvent",function(){o.emit("animationBegin",{element:this,animate:i._node,params:t})}.bind(this)),i._node.addEventListener("endEvent",function(){o&&o.emit("animationEnd",{element:this,animate:i._node,params:t}),e&&(r[a]=t.to,this.attr(r),i.remove())}.bind(this))}e[a]instanceof Array?e[a].forEach(function(e){t.bind(this)(e,!1)}.bind(this)):t.bind(this)(e[a],i)}.bind(this)),this}}),l.Svg.isSupported=function(e){return a.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#"+e,"1.1")};l.Svg.Easing={easeInSine:[.47,0,.745,.715],easeOutSine:[.39,.575,.565,1],easeInOutSine:[.445,.05,.55,.95],easeInQuad:[.55,.085,.68,.53],easeOutQuad:[.25,.46,.45,.94],easeInOutQuad:[.455,.03,.515,.955],easeInCubic:[.55,.055,.675,.19],easeOutCubic:[.215,.61,.355,1],easeInOutCubic:[.645,.045,.355,1],easeInQuart:[.895,.03,.685,.22],easeOutQuart:[.165,.84,.44,1],easeInOutQuart:[.77,0,.175,1],easeInQuint:[.755,.05,.855,.06],easeOutQuint:[.23,1,.32,1],easeInOutQuint:[.86,0,.07,1],easeInExpo:[.95,.05,.795,.035],easeOutExpo:[.19,1,.22,1],easeInOutExpo:[1,0,0,1],easeInCirc:[.6,.04,.98,.335],easeOutCirc:[.075,.82,.165,1],easeInOutCirc:[.785,.135,.15,.86],easeInBack:[.6,-.28,.735,.045],easeOutBack:[.175,.885,.32,1.275],easeInOutBack:[.68,-.55,.265,1.55]},l.Svg.List=l.Class.extend({constructor:function(e){var n=this;this.svgElements=[];for(var t=0;t<e.length;t++)this.svgElements.push(new l.Svg(e[t]));Object.keys(l.Svg.prototype).filter(function(e){return-1===["constructor","parent","querySelector","querySelectorAll","replace","append","classes","height","width"].indexOf(e)}).forEach(function(i){n[i]=function(){var t=Array.prototype.slice.call(arguments,0);return n.svgElements.forEach(function(e){l.Svg.prototype[i].apply(e,t)}),n}})}})}((window,document),e),function(o){"use strict";var a={m:["x","y"],l:["x","y"],c:["x1","y1","x2","y2","x","y"],a:["rx","ry","xAr","lAf","sf","x","y"]},i={accuracy:3};function u(e,t,i,n,s,r){var a=o.extend({command:s?e.toLowerCase():e.toUpperCase()},t,r?{data:r}:{});i.splice(n,0,a)}function e(s,r){s.forEach(function(i,n){a[i.command.toLowerCase()].forEach(function(e,t){r(i,e,n,t,s)})})}o.Svg.Path=o.Class.extend({constructor:function(e,t){this.pathElements=[],this.pos=0,this.close=e,this.options=o.extend({},i,t)},position:function(e){return void 0!==e?(this.pos=Math.max(0,Math.min(this.pathElements.length,e)),this):this.pos},remove:function(e){return this.pathElements.splice(this.pos,e),this},move:function(e,t,i,n){return u("M",{x:+e,y:+t},this.pathElements,this.pos++,i,n),this},line:function(e,t,i,n){return u("L",{x:+e,y:+t},this.pathElements,this.pos++,i,n),this},curve:function(e,t,i,n,s,r,a,o){return u("C",{x1:+e,y1:+t,x2:+i,y2:+n,x:+s,y:+r},this.pathElements,this.pos++,a,o),this},arc:function(e,t,i,n,s,r,a,o,l){return u("A",{rx:+e,ry:+t,xAr:+i,lAf:+n,sf:+s,x:+r,y:+a},this.pathElements,this.pos++,o,l),this},scale:function(i,n){return e(this.pathElements,function(e,t){e[t]*="x"===t[0]?i:n}),this},translate:function(i,n){return e(this.pathElements,function(e,t){e[t]+="x"===t[0]?i:n}),this},transform:function(a){return e(this.pathElements,function(e,t,i,n,s){var r=a(e,t,i,n,s);!r&&0!==r||(e[t]=r)}),this},parse:function(e){var t=e.replace(/([A-Za-z])([0-9])/g,"$1 $2").replace(/([0-9])([A-Za-z])/g,"$1 $2").split(/[\s,]+/).reduce(function(e,t){return t.match(/[A-Za-z]/)&&e.push([]),e[e.length-1].push(t),e},[]);"Z"===t[t.length-1][0].toUpperCase()&&t.pop();var i=t.map(function(n){var e=n.shift(),t=a[e.toLowerCase()];return o.extend({command:e},t.reduce(function(e,t,i){return e[t]=+n[i],e},{}))}),n=[this.pos,0];return Array.prototype.push.apply(n,i),Array.prototype.splice.apply(this.pathElements,n),this.pos+=i.length,this},stringify:function(){var n=Math.pow(10,this.options.accuracy);return this.pathElements.reduce(function(e,t){var i=a[t.command.toLowerCase()].map(function(e){return this.options.accuracy?Math.round(t[e]*n)/n:t[e]}.bind(this));return e+t.command+i.join(",")}.bind(this),"")+(this.close?"Z":"")},clone:function(e){var t=new o.Svg.Path(e||this.close);return t.pos=this.pos,t.pathElements=this.pathElements.slice().map(function(e){return o.extend({},e)}),t.options=o.extend({},this.options),t},splitByCommand:function(t){var i=[new o.Svg.Path];return this.pathElements.forEach(function(e){e.command===t.toUpperCase()&&0!==i[i.length-1].pathElements.length&&i.push(new o.Svg.Path),i[i.length-1].pathElements.push(e)}),i}}),o.Svg.Path.elementDescriptions=a,o.Svg.Path.join=function(e,t,i){for(var n=new o.Svg.Path(t,i),s=0;s<e.length;s++)for(var r=e[s],a=0;a<r.pathElements.length;a++)n.pathElements.push(r.pathElements[a]);return n}}((window,document,e)),function(d){"use strict";var s={x:{pos:"x",len:"width",dir:"horizontal",rectStart:"x1",rectEnd:"x2",rectOffset:"y2"},y:{pos:"y",len:"height",dir:"vertical",rectStart:"y2",rectEnd:"y1",rectOffset:"x1"}};d.Axis=d.Class.extend({constructor:function(e,t,i,n){this.units=e,this.counterUnits=e===s.x?s.y:s.x,this.chartRect=t,this.axisLength=t[e.rectEnd]-t[e.rectStart],this.gridOffset=t[e.rectOffset],this.ticks=i,this.options=n},createGridAndLabels:function(s,r,a,o,l){var u=o["axis"+this.units.pos.toUpperCase()],c=this.ticks.map(this.projectValue.bind(this)),h=this.ticks.map(u.labelInterpolationFnc);c.forEach(function(e,t){var i={x:0,y:0},n=c[t+1]?c[t+1]-e:Math.max(this.axisLength-e,30);d.isFalseyButZero(h[t])&&""!==h[t]||("x"===this.units.pos?(e=this.chartRect.x1+e,i.x=o.axisX.labelOffset.x,"start"===o.axisX.position?i.y=this.chartRect.padding.top+o.axisX.labelOffset.y+(a?5:20):i.y=this.chartRect.y1+o.axisX.labelOffset.y+(a?5:20)):(e=this.chartRect.y1-e,i.y=o.axisY.labelOffset.y-(a?n:0),"start"===o.axisY.position?i.x=a?this.chartRect.padding.left+o.axisY.labelOffset.x:this.chartRect.x1-10:i.x=this.chartRect.x2+o.axisY.labelOffset.x+10),u.showGrid&&d.createGrid(e,t,this,this.gridOffset,this.chartRect[this.counterUnits.len](),s,[o.classNames.grid,o.classNames[this.units.dir]],l),u.showLabel&&d.createLabel(e,n,t,h,this,u.offset,i,r,[o.classNames.label,o.classNames[this.units.dir],"start"===u.position?o.classNames[u.position]:o.classNames.end],a,l))}.bind(this))},projectValue:function(e,t,i){throw new Error("Base axis can't be instantiated!")}}),d.Axis.units=s}((window,document,e)),function(r){"use strict";r.AutoScaleAxis=r.Axis.extend({constructor:function(e,t,i,n){var s=n.highLow||r.getHighLow(t,n,e.pos);this.bounds=r.getBounds(i[e.rectEnd]-i[e.rectStart],s,n.scaleMinSpace||20,n.onlyInteger),this.range={min:this.bounds.min,max:this.bounds.max},r.AutoScaleAxis.super.constructor.call(this,e,i,this.bounds.values,n)},projectValue:function(e){return this.axisLength*(r.getMultiValue(e,this.units.pos)-this.bounds.min)/this.bounds.range}})}((window,document,e)),function(r){"use strict";r.FixedScaleAxis=r.Axis.extend({constructor:function(e,t,i,n){var s=n.highLow||r.getHighLow(t,n,e.pos);this.divisor=n.divisor||1,this.ticks=n.ticks||r.times(this.divisor).map(function(e,t){return s.low+(s.high-s.low)/this.divisor*t}.bind(this)),this.ticks.sort(function(e,t){return e-t}),this.range={min:s.low,max:s.high},r.FixedScaleAxis.super.constructor.call(this,e,i,this.ticks,n),this.stepLength=this.axisLength/this.divisor},projectValue:function(e){return this.axisLength*(r.getMultiValue(e,this.units.pos)-this.range.min)/(this.range.max-this.range.min)}})}((window,document,e)),function(r){"use strict";r.StepAxis=r.Axis.extend({constructor:function(e,t,i,n){r.StepAxis.super.constructor.call(this,e,i,n.ticks,n);var s=Math.max(1,n.ticks.length-(n.stretch?1:0));this.stepLength=this.axisLength/s},projectValue:function(e,t){return this.stepLength*t}})}((window,document,e)),function(g){"use strict";var s={axisX:{offset:30,position:"end",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:g.noop,type:void 0},axisY:{offset:40,position:"start",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:g.noop,type:void 0,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,showLine:!0,showPoint:!0,showArea:!1,areaBase:0,lineSmooth:!0,showGridBackground:!1,low:void 0,high:void 0,chartPadding:{top:15,right:15,bottom:5,left:10},fullWidth:!1,reverseData:!1,classNames:{chart:"ct-chart-line",label:"ct-label",labelGroup:"ct-labels",series:"ct-series",line:"ct-line",point:"ct-point",area:"ct-area",grid:"ct-grid",gridGroup:"ct-grids",gridBackground:"ct-grid-background",vertical:"ct-vertical",horizontal:"ct-horizontal",start:"ct-start",end:"ct-end"}};g.Line=g.Base.extend({constructor:function(e,t,i,n){g.Line.super.constructor.call(this,e,t,s,g.extend({},s,i),n)},createChart:function(c){var h=g.normalizeData(this.data,c.reverseData,!0);this.svg=g.createSvg(this.container,c.width,c.height,c.classNames.chart);var e=this.svg.elem("g").addClass(c.classNames.gridGroup),d=this.svg.elem("g"),t=this.svg.elem("g").addClass(c.classNames.labelGroup),p=g.createChartRect(this.svg,c,s.padding),m=void 0===c.axisX.type?new g.StepAxis(g.Axis.units.x,h.normalized.series,p,g.extend({},c.axisX,{ticks:h.normalized.labels,stretch:c.fullWidth})):c.axisX.type.call(g,g.Axis.units.x,h.normalized.series,p,c.axisX),f=void 0===c.axisY.type?new g.AutoScaleAxis(g.Axis.units.y,h.normalized.series,p,g.extend({},c.axisY,{high:g.isNumeric(c.high)?c.high:c.axisY.high,low:g.isNumeric(c.low)?c.low:c.axisY.low})):c.axisY.type.call(g,g.Axis.units.y,h.normalized.series,p,c.axisY);m.createGridAndLabels(e,t,this.supportsForeignObject,c,this.eventEmitter),f.createGridAndLabels(e,t,this.supportsForeignObject,c,this.eventEmitter),c.showGridBackground&&g.createGridBackground(e,p,c.classNames.gridBackground,this.eventEmitter),h.raw.series.forEach(function(n,s){var i=d.elem("g");i.attr({"ct:series-name":n.name,"ct:meta":g.serialize(n.meta)}),i.addClass([c.classNames.series,n.className||c.classNames.series+"-"+g.alphaNumerate(s)].join(" "));var r=[],a=[];h.normalized.series[s].forEach(function(e,t){var i={x:p.x1+m.projectValue(e,t,h.normalized.series[s]),y:p.y1-f.projectValue(e,t,h.normalized.series[s])};r.push(i.x,i.y),a.push({value:e,valueIndex:t,meta:g.getMetaData(n,t)})}.bind(this));var e,t,o,l={lineSmooth:g.getSeriesOption(n,c,"lineSmooth"),showPoint:g.getSeriesOption(n,c,"showPoint"),showLine:g.getSeriesOption(n,c,"showLine"),showArea:g.getSeriesOption(n,c,"showArea"),areaBase:g.getSeriesOption(n,c,"areaBase")},u=("function"==typeof l.lineSmooth?l.lineSmooth:l.lineSmooth?g.Interpolation.monotoneCubic():g.Interpolation.none())(r,a);l.showPoint&&u.pathElements.forEach(function(e){var t=i.elem("line",{x1:e.x,y1:e.y,x2:e.x+.01,y2:e.y},c.classNames.point).attr({"ct:value":[e.data.value.x,e.data.value.y].filter(g.isNumeric).join(","),"ct:meta":g.serialize(e.data.meta)});this.eventEmitter.emit("draw",{type:"point",value:e.data.value,index:e.data.valueIndex,meta:e.data.meta,series:n,seriesIndex:s,axisX:m,axisY:f,group:i,element:t,x:e.x,y:e.y})}.bind(this)),l.showLine&&(e=i.elem("path",{d:u.stringify()},c.classNames.line,!0),this.eventEmitter.emit("draw",{type:"line",values:h.normalized.series[s],path:u.clone(),chartRect:p,index:s,series:n,seriesIndex:s,seriesMeta:n.meta,axisX:m,axisY:f,group:i,element:e})),l.showArea&&f.range&&(t=Math.max(Math.min(l.areaBase,f.range.max),f.range.min),o=p.y1-f.projectValue(t),u.splitByCommand("M").filter(function(e){return 1<e.pathElements.length}).map(function(e){var t=e.pathElements[0],i=e.pathElements[e.pathElements.length-1];return e.clone(!0).position(0).remove(1).move(t.x,o).line(t.x,t.y).position(e.pathElements.length+1).line(i.x,o)}).forEach(function(e){var t=i.elem("path",{d:e.stringify()},c.classNames.area,!0);this.eventEmitter.emit("draw",{type:"area",values:h.normalized.series[s],path:e.clone(),series:n,seriesIndex:s,axisX:m,axisY:f,chartRect:p,index:s,group:i,element:t})}.bind(this)))}.bind(this)),this.eventEmitter.emit("created",{bounds:f.bounds,chartRect:p,axisX:m,axisY:f,svg:this.svg,options:c})}})}((window,document,e)),function(E){"use strict";var a={axisX:{offset:30,position:"end",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:E.noop,scaleMinSpace:30,onlyInteger:!1},axisY:{offset:40,position:"start",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:E.noop,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,high:void 0,low:void 0,referenceValue:0,chartPadding:{top:15,right:15,bottom:5,left:10},seriesBarDistance:15,stackBars:!1,stackMode:"accumulate",horizontalBars:!1,distributeSeries:!1,reverseData:!1,showGridBackground:!1,classNames:{chart:"ct-chart-bar",horizontalBars:"ct-horizontal-bars",label:"ct-label",labelGroup:"ct-labels",series:"ct-series",bar:"ct-bar",grid:"ct-grid",gridGroup:"ct-grids",gridBackground:"ct-grid-background",vertical:"ct-vertical",horizontal:"ct-horizontal",start:"ct-start",end:"ct-end"}};E.Bar=E.Base.extend({constructor:function(e,t,i,n){E.Bar.super.constructor.call(this,e,t,a,E.extend({},a,i),n)},createChart:function(p){var m;p.distributeSeries?(m=E.normalizeData(this.data,p.reverseData,p.horizontalBars?"x":"y")).normalized.series=m.normalized.series.map(function(e){return[e]}):m=E.normalizeData(this.data,p.reverseData,p.horizontalBars?"x":"y"),this.svg=E.createSvg(this.container,p.width,p.height,p.classNames.chart+(p.horizontalBars?" "+p.classNames.horizontalBars:""));var e,t,i=this.svg.elem("g").addClass(p.classNames.gridGroup),n=this.svg.elem("g"),s=this.svg.elem("g").addClass(p.classNames.labelGroup);(t=p.stackBars&&0!==m.normalized.series.length?(e=E.serialMap(m.normalized.series,function(){return Array.prototype.slice.call(arguments).map(function(e){return e}).reduce(function(e,t){return{x:e.x+(t&&t.x)||0,y:e.y+(t&&t.y)||0}},{x:0,y:0})}),E.getHighLow([e],p,p.horizontalBars?"x":"y")):E.getHighLow(m.normalized.series,p,p.horizontalBars?"x":"y")).high=+p.high||(0===p.high?0:t.high),t.low=+p.low||(0===p.low?0:t.low);var f,g,x,v,y=E.createChartRect(this.svg,p,a.padding),r=p.distributeSeries&&p.stackBars?m.normalized.labels.slice(0,1):m.normalized.labels;p.horizontalBars?(f=x=void 0===p.axisX.type?new E.AutoScaleAxis(E.Axis.units.x,m.normalized.series,y,E.extend({},p.axisX,{highLow:t,referenceValue:0})):p.axisX.type.call(E,E.Axis.units.x,m.normalized.series,y,E.extend({},p.axisX,{highLow:t,referenceValue:0})),g=v=void 0===p.axisY.type?new E.StepAxis(E.Axis.units.y,m.normalized.series,y,{ticks:r}):p.axisY.type.call(E,E.Axis.units.y,m.normalized.series,y,p.axisY)):(g=x=void 0===p.axisX.type?new E.StepAxis(E.Axis.units.x,m.normalized.series,y,{ticks:r}):p.axisX.type.call(E,E.Axis.units.x,m.normalized.series,y,p.axisX),f=v=void 0===p.axisY.type?new E.AutoScaleAxis(E.Axis.units.y,m.normalized.series,y,E.extend({},p.axisY,{highLow:t,referenceValue:0})):p.axisY.type.call(E,E.Axis.units.y,m.normalized.series,y,E.extend({},p.axisY,{highLow:t,referenceValue:0})));var b=p.horizontalBars?y.x1+f.projectValue(0):y.y1-f.projectValue(0),w=[];g.createGridAndLabels(i,s,this.supportsForeignObject,p,this.eventEmitter),f.createGridAndLabels(i,s,this.supportsForeignObject,p,this.eventEmitter),p.showGridBackground&&E.createGridBackground(i,y,p.classNames.gridBackground,this.eventEmitter),m.raw.series.forEach(function(l,u){var c=u-(m.raw.series.length-1)/2,h=p.distributeSeries&&!p.stackBars?g.axisLength/m.normalized.series.length/2:p.distributeSeries&&p.stackBars?g.axisLength/2:g.axisLength/m.normalized.series[u].length/2,d=n.elem("g");d.attr({"ct:series-name":l.name,"ct:meta":E.serialize(l.meta)}),d.addClass([p.classNames.series,l.className||p.classNames.series+"-"+E.alphaNumerate(u)].join(" ")),m.normalized.series[u].forEach(function(e,t){var i,n,s,r,a=p.distributeSeries&&!p.stackBars?u:p.distributeSeries&&p.stackBars?0:t,o=p.horizontalBars?{x:y.x1+f.projectValue(e&&e.x?e.x:0,t,m.normalized.series[u]),y:y.y1-g.projectValue(e&&e.y?e.y:0,a,m.normalized.series[u])}:{x:y.x1+g.projectValue(e&&e.x?e.x:0,a,m.normalized.series[u]),y:y.y1-f.projectValue(e&&e.y?e.y:0,t,m.normalized.series[u])};g instanceof E.StepAxis&&(g.options.stretch||(o[g.units.pos]+=h*(p.horizontalBars?-1:1)),o[g.units.pos]+=p.stackBars||p.distributeSeries?0:c*p.seriesBarDistance*(p.horizontalBars?-1:1)),i=w[t]||b,w[t]=i-(b-o[g.counterUnits.pos]),void 0!==e&&((n={})[g.units.pos+"1"]=o[g.units.pos],n[g.units.pos+"2"]=o[g.units.pos],!p.stackBars||"accumulate"!==p.stackMode&&p.stackMode?(n[g.counterUnits.pos+"1"]=b,n[g.counterUnits.pos+"2"]=o[g.counterUnits.pos]):(n[g.counterUnits.pos+"1"]=i,n[g.counterUnits.pos+"2"]=w[t]),n.x1=Math.min(Math.max(n.x1,y.x1),y.x2),n.x2=Math.min(Math.max(n.x2,y.x1),y.x2),n.y1=Math.min(Math.max(n.y1,y.y2),y.y1),n.y2=Math.min(Math.max(n.y2,y.y2),y.y1),s=E.getMetaData(l,t),r=d.elem("line",n,p.classNames.bar).attr({"ct:value":[e.x,e.y].filter(E.isNumeric).join(","),"ct:meta":E.serialize(s)}),this.eventEmitter.emit("draw",E.extend({type:"bar",value:e,index:t,meta:s,series:l,seriesIndex:u,axisX:x,axisY:v,chartRect:y,group:d,element:r},n)))}.bind(this))}.bind(this)),this.eventEmitter.emit("created",{bounds:f.bounds,chartRect:y,axisX:x,axisY:v,svg:this.svg,options:p})}})}((window,document,e)),function(O){"use strict";var s={width:void 0,height:void 0,chartPadding:5,classNames:{chartPie:"ct-chart-pie",chartDonut:"ct-chart-donut",series:"ct-series",slicePie:"ct-slice-pie",sliceDonut:"ct-slice-donut",sliceDonutSolid:"ct-slice-donut-solid",label:"ct-label"},startAngle:0,total:void 0,donut:!1,donutSolid:!1,donutWidth:60,showLabel:!0,labelOffset:0,labelPosition:"inside",labelInterpolationFnc:O.noop,labelDirection:"neutral",reverseData:!1,ignoreEmptyValues:!1};function C(e,t,i){var n=t.x>e.x;return n&&"explode"===i||!n&&"implode"===i?"start":n&&"implode"===i||!n&&"explode"===i?"end":"middle"}O.Pie=O.Base.extend({constructor:function(e,t,i,n){O.Pie.super.constructor.call(this,e,t,s,O.extend({},s,i),n)},createChart:function(g){var x,e,v,y,b,w=O.normalizeData(this.data),E=[],S=g.startAngle;this.svg=O.createSvg(this.container,g.width,g.height,g.donut?g.classNames.chartDonut:g.classNames.chartPie),e=O.createChartRect(this.svg,g,s.padding),v=Math.min(e.width()/2,e.height()/2),b=g.total||w.normalized.series.reduce(function(e,t){return e+t},0);var A=O.quantity(g.donutWidth);"%"===A.unit&&(A.value*=v/100),v-=g.donut&&!g.donutSolid?A.value/2:0,y="outside"===g.labelPosition||g.donut&&!g.donutSolid?v:"center"===g.labelPosition?0:g.donutSolid?v-A.value/2:v/2,y+=g.labelOffset;var z={x:e.x1+e.width()/2,y:e.y2+e.height()/2},M=1===w.raw.series.filter(function(e){return e.hasOwnProperty("value")?0!==e.value:0!==e}).length;w.raw.series.forEach(function(e,t){E[t]=this.svg.elem("g",null,null)}.bind(this)),g.showLabel&&(x=this.svg.elem("g",null,null)),w.raw.series.forEach(function(e,t){var i,n,s,r,a,o,l,u,c,h,d,p,m,f;0===w.normalized.series[t]&&g.ignoreEmptyValues||(E[t].attr({"ct:series-name":e.name}),E[t].addClass([g.classNames.series,e.className||g.classNames.series+"-"+O.alphaNumerate(t)].join(" ")),359.99<=(i=0<b?S+w.normalized.series[t]/b*360:0)-(n=Math.max(0,S-(0===t||M?0:.2)))&&(i=n+359.99),s=O.polarToCartesian(z.x,z.y,v,n),r=O.polarToCartesian(z.x,z.y,v,i),u=new O.Svg.Path(!g.donut||g.donutSolid).move(r.x,r.y).arc(v,v,0,180<i-S,0,s.x,s.y),g.donut?g.donutSolid&&(l=v-A.value,a=O.polarToCartesian(z.x,z.y,l,S-(0===t||M?0:.2)),o=O.polarToCartesian(z.x,z.y,l,i),u.line(a.x,a.y),u.arc(l,l,0,180<i-S,1,o.x,o.y)):u.line(z.x,z.y),c=g.classNames.slicePie,g.donut&&(c=g.classNames.sliceDonut,g.donutSolid&&(c=g.classNames.sliceDonutSolid)),(h=E[t].elem("path",{d:u.stringify()},c)).attr({"ct:value":w.normalized.series[t],"ct:meta":O.serialize(e.meta)}),g.donut&&!g.donutSolid&&(h._node.style.strokeWidth=A.value+"px"),this.eventEmitter.emit("draw",{type:"slice",value:w.normalized.series[t],totalDataSum:b,index:t,meta:e.meta,series:e,group:E[t],element:h,path:u.clone(),center:z,radius:v,startAngle:S,endAngle:i}),g.showLabel&&(d=1===w.raw.series.length?{x:z.x,y:z.y}:O.polarToCartesian(z.x,z.y,y,S+(i-S)/2),p=w.normalized.labels&&!O.isFalseyButZero(w.normalized.labels[t])?w.normalized.labels[t]:w.normalized.series[t],!(m=g.labelInterpolationFnc(p,t))&&0!==m||(f=x.elem("text",{dx:d.x,dy:d.y,"text-anchor":C(z,d,g.labelDirection)},g.classNames.label).text(""+m),this.eventEmitter.emit("draw",{type:"label",index:t,group:x,element:f,text:""+m,x:d.x,y:d.y}))),S=i)}.bind(this)),this.eventEmitter.emit("created",{chartRect:e,svg:this.svg,options:g})},determineAnchorPosition:C})}((window,document,e)),e});