/*
 Highcharts JS v6.0.1 (2017-10-05)
 Exporting module

 (c) 2010-2017 Torstein Honsi

 License: www.highcharts.com/license
*/
(function(r){"object"===typeof module&&module.exports?module.exports=r:r(Highcharts)})(function(r){(function(b){var u=b.each,r=b.pick,h=b.win,m=h.document,d=b.seriesTypes,x=void 0!==m.createElement("a").download;b.setOptions({exporting:{csv:{columnHeaderFormatter:null,dateFormat:"%Y-%m-%d %H:%M:%S",itemDelimiter:",",lineDelimiter:"\n"},showTable:!1},lang:{downloadCSV:"Download CSV",downloadXLS:"Download XLS",viewData:"View data table"}});b.Chart.prototype.callbacks.push(function(k){b.addEvent(k,"render",
function(){k.options.exporting.showTable&&k.viewData()})});b.Chart.prototype.setUpKeyToAxis=function(){d.arearange&&(d.arearange.prototype.keyToAxis={low:"y",high:"y"})};b.Chart.prototype.getDataRows=function(){var k=this.options.exporting&&this.options.exporting.csv||{},c,f=this.xAxis,g={},t=[],l,e=[],n,v,d=function(a,c,g){if(k.columnHeaderFormatter){var e=k.columnHeaderFormatter(a,c,g);if(!1!==e)return e}return a instanceof b.Axis?a.options.title&&a.options.title.text||(a.isDatetimeAxis?"DateTime":
"Category"):a?a.name+(1<g?" ("+c+")":""):"Category"},p=[];n=0;this.setUpKeyToAxis();u(this.series,function(a){var c=a.options.keys||a.pointArrayMap||["y"],l=c.length,v=!a.requireSorting&&{},h={},t={},m=b.inArray(a.xAxis,f),q;u(c,function(c){var b=(a.keyToAxis&&a.keyToAxis[c]||c)+"Axis";h[c]=a[b]&&a[b].categories||[];t[c]=a[b]&&a[b].isDatetimeAxis});if(!1!==a.options.includeInCSVExport&&!1!==a.visible){b.find(p,function(a){return a[0]===m})||p.push([m,n]);for(q=0;q<l;)e.push(d(a,c[q],c.length)),q++;
u(a.points,function(e,f){var d=e.x,p;v&&(v[d]&&(d+="|"+f),v[d]=!0);q=0;g[d]||(g[d]=[],g[d].xValues=[]);g[d].x=e.x;g[d].xValues[m]=e.x;a.xAxis&&"name"!==a.exportKey||(g[d].name=e.name);for(;q<l;)f=c[q],p=e[f],g[d][n+q]=r(h[f][p],t[f]?b.dateFormat(k.dateFormat,p):null,p),q++});n+=q}});for(l in g)g.hasOwnProperty(l)&&t.push(g[l]);var h,m;l=[e];for(n=p.length;n--;)h=p[n][0],m=p[n][1],c=f[h],t.sort(function(a,c){return a.xValues[h]-c.xValues[h]}),v=d(c),l[0].splice(m,0,v),u(t,function(a){var e=a.name;
e||(c.isDatetimeAxis?(a.x instanceof Date&&(a.x=a.x.getTime()),e=b.dateFormat(k.dateFormat,a.x)):e=c.categories?r(c.names[a.x],c.categories[a.x],a.x):a.x);a.splice(m,0,e)});return l=l.concat(t)};b.Chart.prototype.getCSV=function(b){var c="",d=this.getDataRows(),g=this.options.exporting.csv,k=g.itemDelimiter,l=g.lineDelimiter;u(d,function(e,g){for(var f,h=e.length,n=b?(1.1).toLocaleString()[1]:".";h--;)f=e[h],"string"===typeof f&&(f='"'+f+'"'),"number"===typeof f&&","===n&&(f=f.toString().replace(".",
",")),e[h]=f;c+=e.join(k);g<d.length-1&&(c+=l)});return c};b.Chart.prototype.getTable=function(b){var c="\x3ctable\x3e\x3cthead\x3e",f=this.getDataRows();u(f,function(f,d){var g=d?"td":"th",e,k,h=b?(1.1).toLocaleString()[1]:".";c+="\x3ctr\x3e";for(k=0;k<f.length;k+=1)e=f[k],"number"===typeof e?(e=e.toString(),","===h&&(e=e.replace(".",h)),c+="\x3c"+g+' class\x3d"number"\x3e'+e+"\x3c/"+g+"\x3e"):c+="\x3c"+g+' class\x3d"text"\x3e'+(void 0===e?"":e)+"\x3c/"+g+"\x3e";c+="\x3c/tr\x3e";d||(c+="\x3c/thead\x3e\x3ctbody\x3e")});
return c+="\x3c/tbody\x3e\x3c/table\x3e"};b.Chart.prototype.fileDownload=function(d,c,f){var g;g=this.options.exporting.filename?this.options.exporting.filename:this.title?this.title.textStr.replace(/ /g,"-").toLowerCase():"chart";h.Blob&&h.navigator.msSaveOrOpenBlob?(d=new h.Blob(["\ufeff"+f],{type:"text/csv"}),h.navigator.msSaveOrOpenBlob(d,g+"."+c)):x?(f=m.createElement("a"),f.href=d,f.download=g+"."+c,this.container.appendChild(f),f.click(),f.remove()):b.error("The browser doesn't support downloading files")};
b.Chart.prototype.downloadCSV=function(){var b=this.getCSV(!0);this.fileDownload("data:text/csv,\ufeff"+encodeURIComponent(b),"csv",b,"text/csv")};b.Chart.prototype.downloadXLS=function(){var b='\x3chtml xmlns:o\x3d"urn:schemas-microsoft-com:office:office" xmlns:x\x3d"urn:schemas-microsoft-com:office:excel" xmlns\x3d"http://www.w3.org/TR/REC-html40"\x3e\x3chead\x3e\x3c!--[if gte mso 9]\x3e\x3cxml\x3e\x3cx:ExcelWorkbook\x3e\x3cx:ExcelWorksheets\x3e\x3cx:ExcelWorksheet\x3e\x3cx:Name\x3eArk1\x3c/x:Name\x3e\x3cx:WorksheetOptions\x3e\x3cx:DisplayGridlines/\x3e\x3c/x:WorksheetOptions\x3e\x3c/x:ExcelWorksheet\x3e\x3c/x:ExcelWorksheets\x3e\x3c/x:ExcelWorkbook\x3e\x3c/xml\x3e\x3c![endif]--\x3e\x3cstyle\x3etd{border:none;font-family: Calibri, sans-serif;} .number{mso-number-format:"0.00";} .text{ mso-number-format:"@";}\x3c/style\x3e\x3cmeta name\x3dProgId content\x3dExcel.Sheet\x3e\x3cmeta charset\x3dUTF-8\x3e\x3c/head\x3e\x3cbody\x3e'+
this.getTable(!0)+"\x3c/body\x3e\x3c/html\x3e";this.fileDownload("data:application/vnd.ms-excel;base64,"+h.btoa(unescape(encodeURIComponent(b))),"xls",b,"application/vnd.ms-excel")};b.Chart.prototype.viewData=function(){this.dataTableDiv||(this.dataTableDiv=m.createElement("div"),this.dataTableDiv.className="highcharts-data-table",this.renderTo.parentNode.insertBefore(this.dataTableDiv,this.renderTo.nextSibling));this.dataTableDiv.innerHTML=this.getTable()};var w=b.getOptions().exporting;w&&(b.extend(w.menuItemDefinitions,
{downloadCSV:{textKey:"downloadCSV",onclick:function(){this.downloadCSV()}},downloadXLS:{textKey:"downloadXLS",onclick:function(){this.downloadXLS()}},viewData:{textKey:"viewData",onclick:function(){this.viewData()}}}),w.buttons.contextButton.menuItems.push("separator","downloadCSV","downloadXLS","viewData"));d.map&&(d.map.prototype.exportKey="name");d.mapbubble&&(d.mapbubble.prototype.exportKey="name");d.treemap&&(d.treemap.prototype.exportKey="name")})(r)});
