1 line
7.6 KiB
JavaScript
1 line
7.6 KiB
JavaScript
!function e(t,n,r){function o(a,c){if(!n[a]){if(!t[a]){var s="function"==typeof require&&require;if(!c&&s)return s(a,!0);if(i)return i(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var f=n[a]={exports:{}};t[a][0].call(f.exports,function(e){var n=t[a][1][e];return o(n?n:e)},f,f.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e,t,n){!function(e){"use strict";if(e.URL=e.URL||e.webkitURL,e.Blob&&e.URL)try{return void new Blob}catch(t){}var n=e.BlobBuilder||e.WebKitBlobBuilder||e.MozBlobBuilder||function(e){var t=function(e){return Object.prototype.toString.call(e).match(/^\[object\s(.*)\]$/)[1]},n=function(){this.data=[]},r=function(e,t,n){this.data=e,this.size=e.length,this.type=t,this.encoding=n},o=n.prototype,i=r.prototype,a=e.FileReaderSync,c=function(e){this.code=this[this.name=e]},s="NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR".split(" "),u=s.length,f=e.URL||e.webkitURL||e,l=f.createObjectURL,d=f.revokeObjectURL,p=f,v=e.btoa,b=e.atob,h=e.ArrayBuffer,w=e.Uint8Array,g=/^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/;for(r.fake=i.fake=!0;u--;)c.prototype[s[u]]=u+1;return f.createObjectURL||(p=e.URL=function(e){var t,n=document.createElementNS("http://www.w3.org/1999/xhtml","a");return n.href=e,"origin"in n||("data:"===n.protocol.toLowerCase()?n.origin=null:(t=e.match(g),n.origin=t&&t[1])),n}),p.createObjectURL=function(e){var t,n=e.type;return null===n&&(n="application/octet-stream"),e instanceof r?(t="data:"+n,"base64"===e.encoding?t+";base64,"+e.data:"URI"===e.encoding?t+","+decodeURIComponent(e.data):v?t+";base64,"+v(e.data):t+","+encodeURIComponent(e.data)):l?l.call(f,e):void 0},p.revokeObjectURL=function(e){"data:"!==e.substring(0,5)&&d&&d.call(f,e)},o.append=function(e){var n=this.data;if(w&&(e instanceof h||e instanceof w)){for(var o="",i=new w(e),s=0,u=i.length;u>s;s++)o+=String.fromCharCode(i[s]);n.push(o)}else if("Blob"===t(e)||"File"===t(e)){if(!a)throw new c("NOT_READABLE_ERR");var f=new a;n.push(f.readAsBinaryString(e))}else e instanceof r?"base64"===e.encoding&&b?n.push(b(e.data)):"URI"===e.encoding?n.push(decodeURIComponent(e.data)):"raw"===e.encoding&&n.push(e.data):("string"!=typeof e&&(e+=""),n.push(unescape(encodeURIComponent(e))))},o.getBlob=function(e){return arguments.length||(e=null),new r(this.data.join(""),e,"raw")},o.toString=function(){return"[object BlobBuilder]"},i.slice=function(e,t,n){var o=arguments.length;return 3>o&&(n=null),new r(this.data.slice(e,o>1?t:this.data.length),n,this.encoding)},i.toString=function(){return"[object Blob]"},i.close=function(){this.size=0,delete this.data},n}(e);e.Blob=function(e,t){var r=t?t.type||"":"",o=new n;if(e)for(var i=0,a=e.length;a>i;i++)Uint8Array&&e[i]instanceof Uint8Array?o.append(e[i].buffer):o.append(e[i]);var c=o.getBlob(r);return!c.slice&&c.webkitSlice&&(c.slice=c.webkitSlice),c};var r=Object.getPrototypeOf||function(e){return e.__proto__};e.Blob.prototype=r(new e.Blob)}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content||this)},{}],2:[function(e,t,n){var r=r||function(e){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),o="download"in r,i=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},a=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),c=e.webkitRequestFileSystem,s=e.requestFileSystem||c||e.mozRequestFileSystem,u=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},f="application/octet-stream",l=0,d=500,p=function(t){var r=function(){"string"==typeof t?n().revokeObjectURL(t):t.remove()};e.chrome?r():setTimeout(r,d)},v=function(e,t,n){t=[].concat(t);for(var r=t.length;r--;){var o=e["on"+t[r]];if("function"==typeof o)try{o.call(e,n||e)}catch(i){u(i)}}},b=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e},h=function(t,u,d){d||(t=b(t));var h,w,g,R=this,y=t.type,S=!1,m=function(){v(R,"writestart progress write writeend".split(" "))},E=function(){if(w&&a&&"undefined"!=typeof FileReader){var r=new FileReader;return r.onloadend=function(){var e=r.result;w.location.href="data:attachment/file"+e.slice(e.search(/[,;]/)),R.readyState=R.DONE,m()},r.readAsDataURL(t),void(R.readyState=R.INIT)}if((S||!h)&&(h=n().createObjectURL(t)),w)w.location.href=h;else{var o=e.open(h,"_blank");void 0==o&&a&&(e.location.href=h)}R.readyState=R.DONE,m(),p(h)},O=function(e){return function(){return R.readyState!==R.DONE?e.apply(this,arguments):void 0}},U={create:!0,exclusive:!1};return R.readyState=R.INIT,u||(u="download"),o?(h=n().createObjectURL(t),r.href=h,r.download=u,void setTimeout(function(){i(r),m(),p(h),R.readyState=R.DONE})):(e.chrome&&y&&y!==f&&(g=t.slice||t.webkitSlice,t=g.call(t,0,t.size,f),S=!0),c&&"download"!==u&&(u+=".download"),(y===f||c)&&(w=e),s?(l+=t.size,void s(e.TEMPORARY,l,O(function(e){e.root.getDirectory("saved",U,O(function(e){var n=function(){e.getFile(u,U,O(function(e){e.createWriter(O(function(n){n.onwriteend=function(t){w.location.href=e.toURL(),R.readyState=R.DONE,v(R,"writeend",t),p(e)},n.onerror=function(){var e=n.error;e.code!==e.ABORT_ERR&&E()},"writestart progress write abort".split(" ").forEach(function(e){n["on"+e]=R["on"+e]}),n.write(t),R.abort=function(){n.abort(),R.readyState=R.DONE},R.readyState=R.WRITING}),E)}),E)};e.getFile(u,{create:!1},O(function(e){e.remove(),n()}),O(function(e){e.code===e.NOT_FOUND_ERR?n():E()}))}),E)}),E)):void E())},w=h.prototype,g=function(e,t,n){return new h(e,t,n)};return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t,n){return n||(e=b(e)),navigator.msSaveOrOpenBlob(e,t||"download")}:(w.abort=function(){var e=this;e.readyState=e.DONE,v(e,"abort")},w.readyState=w.INIT=0,w.WRITING=1,w.DONE=2,w.error=w.onwritestart=w.onprogress=w.onwrite=w.onabort=w.onerror=w.onwriteend=null,g)}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);"undefined"!=typeof t&&t.exports?t.exports.saveAs=r:"undefined"!=typeof define&&null!==define&&null!=define.amd&&define([],function(){return r})},{}],3:[function(e,t,n){"use strict";angular.module("ngFileSaver",[]).factory("FileSaver",["Blob","SaveAs","FileSaverUtils",e("./angular-file-saver.service")]).factory("FileSaverUtils",[e("./utils/utils.service.js")]).factory("Blob",["$window",e("./dependencies/blob-bundle.service.js")]).factory("SaveAs",[e("./dependencies/file-saver-bundle.service.js")])},{"./angular-file-saver.service":4,"./dependencies/blob-bundle.service.js":5,"./dependencies/file-saver-bundle.service.js":6,"./utils/utils.service.js":7}],4:[function(e,t,n){"use strict";t.exports=function(e,t,n){function r(e,r){try{t(e,r)}catch(o){n.handleErrors(o.message)}}return{saveAs:function(e){e=angular.extend({},e);var t=e.data,o=e.filename;return n.isBlobInstance(t)||n.handleErrors("Data argument should be a blob instance"),n.isString(o)||n.handleErrors("Filename argument should be a string"),r(t,o)}}}},{}],5:[function(e,t,n){"use strict";e("Blob.js"),t.exports=function(e){return e.Blob}},{"Blob.js":1}],6:[function(e,t,n){"use strict";t.exports=function(){return e("FileSaver.js").saveAs||function(){}}},{"FileSaver.js":2}],7:[function(e,t,n){"use strict";t.exports=function(){return{handleErrors:function(e){throw new Error(e)},isString:function(e){return"string"==typeof e||e instanceof String},isUndefined:function(e){return"undefined"==typeof e},isBlobInstance:function(e){return e instanceof Blob}}}},{}]},{},[3]); |