/*
 Highcharts JS v7.1.3 (2019-08-14)

 Client side exporting module

 (c) 2015-2019 Torstein Honsi / Oystein Moseng

 License: www.highcharts.com/license
*/
(function(b){"object"===typeof module&&module.exports?(b["default"]=b,module.exports=b):"function"===typeof define&&define.amd?define("highcharts/modules/offline-exporting",["highcharts","highcharts/modules/exporting"],function(r){b(r);b.Highcharts=r;return b}):b("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(b){function r(a,d,b,n){a.hasOwnProperty(d)||(a[d]=n.apply(null,b))}b=b?b._modules:{};r(b,"mixins/download-url.js",[b["parts/Globals.js"]],function(a){var d=a.win,b=d.navigator,
n=d.document,e=d.URL||d.webkitURL||d,q=/Edge\/\d+/.test(b.userAgent);a.dataURLtoBlob=function(a){if((a=a.match(/data:([^;]*)(;base64)?,([0-9A-Za-z+/]+)/))&&3<a.length&&d.atob&&d.ArrayBuffer&&d.Uint8Array&&d.Blob&&e.createObjectURL){var b=d.atob(a[3]),f=new d.ArrayBuffer(b.length);f=new d.Uint8Array(f);for(var m=0;m<f.length;++m)f[m]=b.charCodeAt(m);a=new d.Blob([f],{type:a[1]});return e.createObjectURL(a)}};a.downloadURL=function(f,e){var k=n.createElement("a");if("string"===typeof f||f instanceof
String||!b.msSaveOrOpenBlob){if(q||2E6<f.length)if(f=a.dataURLtoBlob(f),!f)throw Error("Failed to convert to blob");if(void 0!==k.download)k.href=f,k.download=e,n.body.appendChild(k),k.click(),n.body.removeChild(k);else try{var m=d.open(f,"chart");if(void 0===m||null===m)throw Error("Failed to open window");}catch(l){d.location.href=f}}else b.msSaveOrOpenBlob(f,e)}});r(b,"modules/offline-exporting.src.js",[b["parts/Globals.js"]],function(a){function b(b,t){var g=f.getElementsByTagName("head")[0],
c=f.createElement("script");c.type="text/javascript";c.src=b;c.onload=t;c.onerror=function(){a.error("Error loading script "+b)};g.appendChild(c)}var r=a.addEvent,n=a.merge,e=a.win,q=e.navigator,f=e.document,z=e.URL||e.webkitURL||e,k=/Edge\/|Trident\/|MSIE /.test(q.userAgent),m=k?150:0;a.CanVGRenderer={};a.svgToDataUrl=function(a){var b=-1<q.userAgent.indexOf("WebKit")&&0>q.userAgent.indexOf("Chrome");try{if(!b&&0>q.userAgent.toLowerCase().indexOf("firefox"))return z.createObjectURL(new e.Blob([a],
{type:"image/svg+xml;charset-utf-16"}))}catch(g){}return"data:image/svg+xml;charset=UTF-8,"+encodeURIComponent(a)};a.imageToDataUrl=function(a,b,g,c,d,x,k,u,p){var h=new e.Image,l=function(){setTimeout(function(){var e=f.createElement("canvas"),l=e.getContext&&e.getContext("2d");try{if(l){e.height=h.height*c;e.width=h.width*c;l.drawImage(h,0,0,e.width,e.height);try{var y=e.toDataURL(b);d(y,b,g,c)}catch(A){t(a,b,g,c)}}else k(a,b,g,c)}finally{p&&p(a,b,g,c)}},m)},w=function(){u(a,b,g,c);p&&p(a,b,g,c)};
var t=function(){h=new e.Image;t=x;h.crossOrigin="Anonymous";h.onload=l;h.onerror=w;h.src=a};h.onload=l;h.onerror=w;h.src=a};a.downloadSVGLocal=function(l,d,g,c){function w(a,b){b=new e.jsPDF("l","pt",[a.width.baseVal.value+2*b,a.height.baseVal.value+2*b]);[].forEach.call(a.querySelectorAll('*[visibility="hidden"]'),function(a){a.parentNode.removeChild(a)});e.svg2pdf(a,b,{removeInvalid:!0});return b.output("datauristring")}function x(){p.innerHTML=l;var b=p.getElementsByTagName("text"),e;[].forEach.call(b,
function(a){["font-family","font-size"].forEach(function(b){for(var c=a;c&&c!==p;){if(c.style[b]){a.style[b]=c.style[b];break}c=c.parentNode}});a.style["font-family"]=a.style["font-family"]&&a.style["font-family"].split(" ").splice(-1);e=a.getElementsByTagName("title");[].forEach.call(e,function(b){a.removeChild(b)})});b=w(p.firstChild,0);try{a.downloadURL(b,m),c&&c()}catch(B){g(B)}}var k=!0,u=d.libURL||a.getOptions().exporting.libURL,p=f.createElement("div"),h=d.type||"image/png",m=(d.filename||
"chart")+"."+("image/svg+xml"===h?"svg":h.split("/")[1]),r=d.scale||1;u="/"!==u.slice(-1)?u+"/":u;if("image/svg+xml"===h)try{if(q.msSaveOrOpenBlob){var t=new MSBlobBuilder;t.append(l);var v=t.getBlob("image/svg+xml")}else v=a.svgToDataUrl(l);a.downloadURL(v,m);c&&c()}catch(y){g(y)}else if("application/pdf"===h)e.jsPDF&&e.svg2pdf?x():(k=!0,b(u+"jspdf.js",function(){b(u+"svg2pdf.js",function(){x()})}));else{v=a.svgToDataUrl(l);var n=function(){try{z.revokeObjectURL(v)}catch(y){}};a.imageToDataUrl(v,
h,{},r,function(b){try{a.downloadURL(b,m),c&&c()}catch(A){g(A)}},function(){var d=f.createElement("canvas"),x=d.getContext("2d"),w=l.match(/^<svg[^>]*width\s*=\s*"?(\d+)"?[^>]*>/)[1]*r,p=l.match(/^<svg[^>]*height\s*=\s*"?(\d+)"?[^>]*>/)[1]*r,t=function(){x.drawSvg(l,0,0,w,p);try{a.downloadURL(q.msSaveOrOpenBlob?d.msToBlob():d.toDataURL(h),m),c&&c()}catch(C){g(C)}finally{n()}};d.width=w;d.height=p;e.canvg?t():(k=!0,b(u+"rgbcolor.js",function(){b(u+"canvg.js",function(){t()})}))},g,g,function(){k&&
n()})}};a.Chart.prototype.getSVGForLocalExport=function(b,d,e,c){var g=this,f=0,l,k,p,h,m=function(){f===n.length&&c(g.sanitizeSVG(l.innerHTML,k))},t=function(a,b,c){++f;c.imageElement.setAttributeNS("http://www.w3.org/1999/xlink","href",a);m()};g.unbindGetSVG=r(g,"getSVG",function(a){k=a.chartCopy.options;l=a.chartCopy.container.cloneNode(!0)});g.getSVGForExport(b,d);var n=l.getElementsByTagName("image");try{if(!n.length){c(g.sanitizeSVG(l.innerHTML,k));return}var v=0;for(p=n.length;v<p;++v){var q=
n[v];(h=q.getAttributeNS("http://www.w3.org/1999/xlink","href"))?a.imageToDataUrl(h,"image/png",{imageElement:q},b.scale,t,e,e,e):(++f,q.parentNode.removeChild(q),m())}}catch(y){e(y)}g.unbindGetSVG()};a.Chart.prototype.exportChartLocal=function(b,e){var d=this,c=a.merge(d.options.exporting,b),f=function(b){!1===c.fallbackToExportServer?c.error?c.error(c,b):a.error(28,!0):d.exportChart(c)};b=function(){return[].some.call(d.container.getElementsByTagName("image"),function(a){a=a.getAttribute("href");
return""!==a&&0!==a.indexOf("data:")})};k&&d.styledMode&&(a.SVGRenderer.prototype.inlineWhitelist=[/^blockSize/,/^border/,/^caretColor/,/^color/,/^columnRule/,/^columnRuleColor/,/^cssFloat/,/^cursor/,/^fill$/,/^fillOpacity/,/^font/,/^inlineSize/,/^length/,/^lineHeight/,/^opacity/,/^outline/,/^parentRule/,/^rx$/,/^ry$/,/^stroke/,/^textAlign/,/^textAnchor/,/^textDecoration/,/^transform/,/^vectorEffect/,/^visibility/,/^x$/,/^y$/]);k&&("application/pdf"===c.type||d.container.getElementsByTagName("image").length&&
"image/svg+xml"!==c.type)||"application/pdf"===c.type&&b()?f("Image type not supported for this chart/browser."):d.getSVGForLocalExport(c,e,f,function(b){-1<b.indexOf("<foreignObject")&&"image/svg+xml"!==c.type?f("Image type not supported for charts with embedded HTML"):a.downloadSVGLocal(b,a.extend({filename:d.getFilename()},c),f)})};n(!0,a.getOptions().exporting,{libURL:"https://code.highcharts.com/7.1.3/lib/",menuItemDefinitions:{downloadPNG:{textKey:"downloadPNG",onclick:function(){this.exportChartLocal()}},
downloadJPEG:{textKey:"downloadJPEG",onclick:function(){this.exportChartLocal({type:"image/jpeg"})}},downloadSVG:{textKey:"downloadSVG",onclick:function(){this.exportChartLocal({type:"image/svg+xml"})}},downloadPDF:{textKey:"downloadPDF",onclick:function(){this.exportChartLocal({type:"application/pdf"})}}}})});r(b,"masters/modules/offline-exporting.src.js",[],function(){})});
//# sourceMappingURL=offline-exporting.js.map