MindMap/frontend/node_modules/vditor/dist/js/plantuml/plantuml-encoder.min.js

1 line
29 KiB
JavaScript
Raw Permalink Normal View History

!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.plantumlEncoder=t()}}(function(){return function t(e,a,n){function r(s,h){if(!a[s]){if(!e[s]){var o="function"==typeof require&&require;if(!h&&o)return o(s,!0);if(i)return i(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var _=a[s]={exports:{}};e[s][0].call(_.exports,function(t){var a=e[s][1][t];return r(a?a:t)},_,_.exports,t,e,a,n)}return a[s].exports}for(var i="function"==typeof require&&require,s=0;s<n.length;s++)r(n[s]);return r}({1:[function(t,e,a){e.exports=t("./lib/plantuml-encoder")},{"./lib/plantuml-encoder":3}],2:[function(t,e,a){"use strict";function n(t){return t<10?String.fromCharCode(48+t):(t-=10,t<26?String.fromCharCode(65+t):(t-=26,t<26?String.fromCharCode(97+t):(t-=26,0===t?"-":1===t?"_":"?")))}function r(t,e,a){var r=t>>2,i=(3&t)<<4|e>>4,s=(15&e)<<2|a>>6,h=63&a,o="";return o+=n(63&r),o+=n(63&i),o+=n(63&s),o+=n(63&h)}e.exports.encode=function(t){for(var e="",a=0;a<t.length;a+=3)e+=a+2===t.length?r(t.charCodeAt(a),t.charCodeAt(a+1),0):a+1===t.length?r(t.charCodeAt(a),0,0):r(t.charCodeAt(a),t.charCodeAt(a+1),t.charCodeAt(a+2));return e}},{}],3:[function(t,e,a){"use strict";var n=t("utf8-bytes"),r=t("pako/lib/deflate.js"),i=t("./encode64");e.exports.encode=function(t){var e=n(t),a=r.deflate(e,{level:9,to:"string"});return i.encode(a)}},{"./encode64":2,"pako/lib/deflate.js":4,"utf8-bytes":13}],4:[function(t,e,a){"use strict";function n(t){if(!(this instanceof n))return new n(t);this.options=o.assign({level:b,method:w,chunkSize:16384,windowBits:15,memLevel:8,strategy:v,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var a=h.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==p)throw new Error(_[a]);if(e.header&&h.deflateSetHeader(this.strm,e.header),e.dictionary){var r;if(r="string"==typeof e.dictionary?l.string2buf(e.dictionary):"[object ArrayBuffer]"===u.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,a=h.deflateSetDictionary(this.strm,r),a!==p)throw new Error(_[a]);this._dict_set=!0}}function r(t,e){var a=new n(e);if(a.push(t,!0),a.err)throw a.msg;return a.result}function i(t,e){return e=e||{},e.raw=!0,r(t,e)}function s(t,e){return e=e||{},e.gzip=!0,r(t,e)}var h=t("./zlib/deflate"),o=t("./utils/common"),l=t("./utils/strings"),_=t("./zlib/messages"),d=t("./zlib/zstream"),u=Object.prototype.toString,f=0,c=4,p=0,g=1,m=2,b=-1,v=0,w=8;n.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;n=e===~~e?e:e===!0?c:f,"string"==typeof t?r.input=l.string2buf(t):"[object ArrayBuffer]"===u.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(0===r.avail_out&&(r.output=new o.Buf8(i),r.next_out=0,r.avail_out=i),a=h.deflate(r,n),a!==g&&a!==p)return this.onEnd(a),this.ended=!0,!1;0!==r.avail_out&&(0!==r.avail_in||n!==c&&n!==m)||("string"===this.options.to?this.onData(l.buf2binstring(o.shrinkBuf(r.output,r.next_out))):this.onData(o.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||0===r.avail_out)&&a!==g);return n===c?(a=h.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===p):n!==m||(this.onEnd(p),r.avail_out=0,!0)},n.prototype.onData=function(t){this.chunks.push(t)},n.prototype.onEnd=function(t){t===p&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},a.Deflate=n,a.deflate=r,a.deflateRaw=i,a.gzip=s},{"./utils/common":5,"./utils/strings":6,"./zlib/deflate":9,"./zlib/messages":10,"./zlib/zstream":12}],5:[function(t,e,a){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typ