| 12345678910111213141516171819202122232425 |
- /*
- Highcharts JS v9.1.0 (2021-05-03)
- Client side exporting module
- (c) 2015-2021 Torstein Honsi / Oystein Moseng
- License: www.highcharts.com/license
- */
- (function(a){"object"===typeof module&&module.exports?(a["default"]=a,module.exports=a):"function"===typeof define&&define.amd?define("highcharts/modules/offline-exporting",["highcharts","highcharts/modules/exporting"],function(d){a(d);a.Highcharts=d;return a}):a("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(a){function d(a,b,D,d){a.hasOwnProperty(b)||(a[b]=d.apply(null,D))}a=a?a._modules:{};d(a,"Extensions/DownloadURL.js",[a["Core/Globals.js"]],function(a){var b=a.win,d=b.document,
- z=b.URL||b.webkitURL||b,l=a.dataURLtoBlob=function(a){if((a=a.replace(/filename=.*;/,"").match(/data:([^;]*)(;base64)?,([0-9A-Za-z+/]+)/))&&3<a.length&&b.atob&&b.ArrayBuffer&&b.Uint8Array&&b.Blob&&z.createObjectURL){var A=b.atob(a[3]),d=new b.ArrayBuffer(A.length);d=new b.Uint8Array(d);for(var k=0;k<d.length;++k)d[k]=A.charCodeAt(k);a=new b.Blob([d],{type:a[1]});return z.createObjectURL(a)}};a=a.downloadURL=function(a,q){var w=b.navigator,k=d.createElement("a");if("string"===typeof a||a instanceof
- String||!w.msSaveOrOpenBlob){a=""+a;if(/Edge\/\d+/.test(w.userAgent)||2E6<a.length)if(a=l(a)||"",!a)throw Error("Failed to convert to blob");if("undefined"!==typeof k.download)k.href=a,k.download=q,d.body.appendChild(k),k.click(),d.body.removeChild(k);else try{var n=b.open(a,"chart");if("undefined"===typeof n||null===n)throw Error("Failed to open window");}catch(h){b.location.href=a}}else w.msSaveOrOpenBlob(a,q)};return{dataURLtoBlob:l,downloadURL:a}});d(a,"Extensions/OfflineExporting.js",[a["Core/Chart/Chart.js"],
- a["Core/Globals.js"],a["Core/Options.js"],a["Core/Renderer/SVG/SVGRenderer.js"],a["Core/Utilities.js"],a["Extensions/DownloadURL.js"]],function(a,b,d,z,l,A){function q(a,b){var f=y.getElementsByTagName("head")[0],c=y.createElement("script");c.type="text/javascript";c.src=a;c.onload=b;c.onerror=function(){E("Error loading script "+a)};f.appendChild(c)}function w(a){var e=h.navigator.userAgent;e=-1<e.indexOf("WebKit")&&0>e.indexOf("Chrome");try{if(!e&&!b.isFirefox)return F.createObjectURL(new h.Blob([a],
- {type:"image/svg+xml;charset-utf-16"}))}catch(f){}return"data:image/svg+xml;charset=UTF-8,"+encodeURIComponent(a)}function k(a,b,f,c,d,u,k,m,r){var g=new h.Image,e=function(){setTimeout(function(){var e=y.createElement("canvas"),u=e.getContext&&e.getContext("2d");try{if(u){e.height=g.height*c;e.width=g.width*c;u.drawImage(g,0,0,e.width,e.height);try{var x=e.toDataURL(b);d(x,b,f,c)}catch(H){p(a,b,f,c)}}else k(a,b,f,c)}finally{r&&r(a,b,f,c)}},K)},G=function(){m(a,b,f,c);r&&r(a,b,f,c)};var p=function(){g=
- new h.Image;p=u;g.crossOrigin="Anonymous";g.onload=e;g.onerror=G;g.src=a};g.onload=e;g.onerror=G;g.src=a}function n(a,b,f,c){function d(a,b){var c=a.width.baseVal.value+2*b;b=a.height.baseVal.value+2*b;c=new h.jsPDF(b>c?"p":"l","pt",[c,b]);[].forEach.call(a.querySelectorAll('*[visibility="hidden"]'),function(a){a.parentNode.removeChild(a)});b=a.querySelectorAll("linearGradient");for(var f=0;f<b.length;f++)for(var e=b[f].querySelectorAll("stop"),d=0;d<e.length&&"0"===e[d].getAttribute("offset")&&"0"===
- e[d+1].getAttribute("offset");)e[d].remove(),d++;[].forEach.call(a.querySelectorAll("tspan"),function(a){"\u200b"===a.textContent&&(a.textContent=" ",a.setAttribute("dx",-5))});h.svg2pdf(a,c,{removeInvalid:!0});return c.output("datauristring")}function e(){r.innerHTML=a;var b=r.getElementsByTagName("text"),e;[].forEach.call(b,function(a){["font-family","font-size"].forEach(function(b){for(var c=a;c&&c!==r;){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=d(r.firstChild,0);try{C(b,B),c&&c()}catch(L){f(L)}}var l=!0,m=b.libURL||I().exporting.libURL,r=y.createElement("div"),g=b.type||"image/png",B=(b.filename||"chart")+"."+("image/svg+xml"===g?"svg":g.split("/")[1]),n=b.scale||1;m="/"!==m.slice(-1)?m+"/":m;if("image/svg+xml"===g)try{if("undefined"!==typeof h.navigator.msSaveOrOpenBlob){var p=new MSBlobBuilder;p.append(a);
- var t=p.getBlob("image/svg+xml")}else t=w(a);C(t,B);c&&c()}catch(x){f(x)}else if("application/pdf"===g)h.jsPDF&&h.svg2pdf?e():(l=!0,q(m+"jspdf.js",function(){q(m+"svg2pdf.js",function(){e()})}));else{t=w(a);var v=function(){try{F.revokeObjectURL(t)}catch(x){}};k(t,g,{},n,function(a){try{C(a,B),c&&c()}catch(H){f(H)}},function(){var b=y.createElement("canvas"),e=b.getContext("2d"),d=a.match(/^<svg[^>]*width\s*=\s*"?(\d+)"?[^>]*>/)[1]*n,u=a.match(/^<svg[^>]*height\s*=\s*"?(\d+)"?[^>]*>/)[1]*n,k=function(){e.drawSvg(a,
- 0,0,d,u);try{C(h.navigator.msSaveOrOpenBlob?b.msToBlob():b.toDataURL(g),B),c&&c()}catch(M){f(M)}finally{v()}};b.width=d;b.height=u;h.canvg?k():(l=!0,q(m+"rgbcolor.js",function(){q(m+"canvg.js",function(){k()})}))},f,f,function(){l&&v()})}}var h=b.win,y=b.doc,I=d.getOptions,D=l.addEvent,E=l.error,N=l.extend,O=l.fireEvent,J=l.merge,C=A.downloadURL,F=h.URL||h.webkitURL||h,K=b.isMS?150:0;b.CanVGRenderer={};a.prototype.getSVGForLocalExport=function(a,b,f,c){var d=this,e=0,h,m,l,g,n=function(){e===p.length&&
- c(d.sanitizeSVG(h.innerHTML,m))},q=function(a,b,c){++e;c.imageElement.setAttributeNS("http://www.w3.org/1999/xlink","href",a);n()};d.unbindGetSVG=D(d,"getSVG",function(a){m=a.chartCopy.options;h=a.chartCopy.container.cloneNode(!0)});d.getSVGForExport(a,b);var p=h.getElementsByTagName("image");try{if(!p.length){c(d.sanitizeSVG(h.innerHTML,m));return}var t=0;for(l=p.length;t<l;++t){var v=p[t];(g=v.getAttributeNS("http://www.w3.org/1999/xlink","href"))?k(g,"image/png",{imageElement:v},a.scale,q,f,f,
- f):(++e,v.parentNode.removeChild(v),n())}}catch(x){f(x)}d.unbindGetSVG()};a.prototype.exportChartLocal=function(a,d){var f=this,c=J(f.options.exporting,a),e=function(a){!1===c.fallbackToExportServer?c.error?c.error(c,a):E(28,!0):f.exportChart(c)};a=function(){return[].some.call(f.container.getElementsByTagName("image"),function(a){a=a.getAttribute("href");return""!==a&&0!==a.indexOf("data:")})};b.isMS&&f.styledMode&&(z.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$/]);b.isMS&&("application/pdf"===c.type||f.container.getElementsByTagName("image").length&&"image/svg+xml"!==c.type)||"application/pdf"===c.type&&a()?e("Image type not supported for this chart/browser."):f.getSVGForLocalExport(c,d||
- {},e,function(a){-1<a.indexOf("<foreignObject")&&"image/svg+xml"!==c.type?e("Image type not supportedfor charts with embedded HTML"):n(a,N({filename:f.getFilename()},c),e,function(){return O(f,"exportChartLocalSuccess")})})};J(!0,I().exporting,{libURL:"https://code.highcharts.com/9.1.0/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"})}}}});b.downloadSVGLocal=n});d(a,"masters/modules/offline-exporting.src.js",[],function(){})});
- //# sourceMappingURL=offline-exporting.js.map
|