var saveAs=saveAs||function(n){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var s=n.document,r=function(){return n.URL||n.webkitURL||n},i=s.createElementNS("http://www.w3.org/1999/xhtml","a"),v="download"in i,y=function(t){var i=s.createEvent("MouseEvents");i.initMouseEvent("click",!0,!1,n,0,0,0,0,0,!1,!1,!1,!1,0,null);t.dispatchEvent(i)},u=n.webkitRequestFileSystem,h=n.requestFileSystem||u||n.mozRequestFileSystem,p=function(t){(n.setImmediate||n.setTimeout)(function(){throw t;},0)},f="application/octet-stream",c=0,w=500,e=function(t){var i=function(){"string"==typeof t?r().revokeObjectURL(t):t.remove()};n.chrome?i():setTimeout(i,w)},o=function(n,t,i){var r,u;for(t=[].concat(t),r=t.length;r--;)if(u=n["on"+t[r]],"function"==typeof u)try{u.call(n,i||n)}catch(f){p(f)}},l=function(n){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(n.type)?new Blob(["﻿",n],{type:n.type}):n},a=function(t,s){t=l(t);var p,k,g,a=this,d=t.type,nt=!1,tt=function(){o(a,"writestart progress write writeend".split(" "))},w=function(){if((nt||!p)&&(p=r().createObjectURL(t)),k)k.location.href=p;else{var i=n.open(p,"_blank");void 0==i&&"undefined"!=typeof safari&&(n.location.href=p)}a.readyState=a.DONE;tt();e(p)},b=function(n){return function(){if(a.readyState!==a.DONE)return n.apply(this,arguments)}},it={create:!0,exclusive:!1};return a.readyState=a.INIT,s||(s="download"),v?(p=r().createObjectURL(t),i.href=p,i.download=s,y(i),a.readyState=a.DONE,tt(),void e(p)):(n.chrome&&d&&d!==f&&(g=t.slice||t.webkitSlice,t=g.call(t,0,t.size,f),nt=!0),u&&"download"!==s&&(s+=".download"),(d===f||u)&&(k=n),h?(c+=t.size,void h(n.TEMPORARY,c,b(function(n){n.root.getDirectory("saved",it,b(function(n){var i=function(){n.getFile(s,it,b(function(n){n.createWriter(b(function(i){i.onwriteend=function(t){k.location.href=n.toURL();a.readyState=a.DONE;o(a,"writeend",t);e(n)};i.onerror=function(){var n=i.error;n.code!==n.ABORT_ERR&&w()};"writestart progress write abort".split(" ").forEach(function(n){i["on"+n]=a["on"+n]});i.write(t);a.abort=function(){i.abort();a.readyState=a.DONE};a.readyState=a.WRITING}),w)}),w)};n.getFile(s,{create:!1},b(function(n){n.remove();i()}),b(function(n){n.code===n.NOT_FOUND_ERR?i():w()}))}),w)}),w)):void w())},t=a.prototype,b=function(n,t){return new a(n,t)};return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(n,t){return navigator.msSaveOrOpenBlob(l(n),t)}:(t.abort=function(){var n=this;n.readyState=n.DONE;o(n,"abort")},t.readyState=t.INIT=0,t.WRITING=1,t.DONE=2,t.error=t.onwritestart=t.onprogress=t.onwrite=t.onabort=t.onerror=t.onwriteend=null,b)}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);"undefined"!=typeof module&&module.exports?module.exports.saveAs=saveAs:"undefined"!=typeof define&&null!==define&&null!=define.amd&&define([],function(){return saveAs})