(function(v,a){"function"===typeof define&&define.amd?define([],a):"object"===typeof exports?module.exports=a():v.download=a()})(this,function(){return function m(a,c,g){function h(b){var e=b.split(/[:;,]/);b=e[1];e=("base64"==e[2]?atob:decodeURIComponent)(e.pop());var n=e.length,r=0,w=new Uint8Array(n);for(r;r<n;++r)w[r]=e.charCodeAt(r);return new l([w],{type:b})}function p(b,e){if("download"in d)return d.href=b,d.setAttribute("download",t),d.className="download-js-link",d.innerHTML="downloading...",
d.style.display="none",document.body.appendChild(d),setTimeout(function(){d.click();document.body.removeChild(d);!0===e&&setTimeout(function(){k.URL.revokeObjectURL(d.href)},250)},66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return b=b.replace(/^data:([\w\/\-\+]+)/,"application/octet-stream"),!window.open(b)&&confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=b),!0;var n=document.createElement("iframe");
document.body.appendChild(n);e||(b="data:"+b.replace(/^data:([\w\/\-\+]+)/,"application/octet-stream"));n.src=b;setTimeout(function(){document.body.removeChild(n)},333)}var k=window,f=g||"application/octet-stream",q=!c&&!g&&a,d=document.createElement("a");g=function(b){return String(b)};var l=k.Blob||k.MozBlob||k.WebKitBlob||g,t=c||"download";l=l.call?l.bind(k):Blob;"true"===String(this)&&(a=[a,f],f=a[0],a=a[1]);if(q&&2048>q.length&&(t=q.split("/").pop().split("?")[0],d.href=q,-1!==d.href.indexOf(q))){var u=
new XMLHttpRequest;u.open("GET",q,!0);u.responseType="blob";u.onload=function(b){m(b.target.response,t,"application/octet-stream")};setTimeout(function(){u.send()},0);return u}if(/^data:[\w+\-]+\/[\w+\-]+[,;]/.test(a))if(2096103.424<a.length&&l!==g)a=h(a),f=a.type||"application/octet-stream";else return navigator.msSaveBlob?navigator.msSaveBlob(h(a),t):p(a);c=a instanceof l?a:new l([a],{type:f});if(navigator.msSaveBlob)return navigator.msSaveBlob(c,t);if(k.URL)p(k.URL.createObjectURL(c),!0);else{if("string"===
typeof c||c.constructor===g)try{return p("data:"+f+";base64,"+k.btoa(c))}catch(b){return p("data:"+f+","+encodeURIComponent(c))}f=new FileReader;f.onload=function(b){p(this.result)};f.readAsDataURL(c)}return!0}});PrimeFaces.download||(PrimeFaces.download=function(v,a,c,g){var m=PrimeFaces.settings.contextPath;m&&""!==m||(m="/");var h=new XMLHttpRequest;h.open("GET",v,!0);h.responseType="blob";h.onload=function(p){window.download(h.response,c,a);PrimeFaces.setCookie(g,"true",{path:m})};h.send()});