拓恒飞手平台小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
15KB

  1. {"version":3,"sources":["base64.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["//\n// THIS FILE IS AUTOMATICALLY GENERATED! DO NOT EDIT BY HAND!\n//\n;\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n ? module.exports = factory()\n : typeof define === 'function' && define.amd\n ? define(factory) :\n // cf. https://github.com/dankogai/js-base64/issues/119\n (function () {\n // existing version for noConflict()\n var _Base64 = global.Base64;\n var gBase64 = factory();\n gBase64.noConflict = function () {\n global.Base64 = _Base64;\n return gBase64;\n };\n if (global.Meteor) { // Meteor.js\n Base64 = gBase64;\n }\n global.Base64 = gBase64;\n })();\n}((typeof self !== 'undefined' ? self\n : typeof window !== 'undefined' ? window\n : typeof global !== 'undefined' ? global\n : this), function () {\n \n /**\n * base64.ts\n *\n * Licensed under the BSD 3-Clause License.\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * References:\n * http://en.wikipedia.org/wiki/Base64\n *\n * @author Dan Kogai (https://github.com/dankogai)\n */\n var version = '3.7.2';\n /**\n * @deprecated use lowercase `version`.\n */\n var VERSION = version;\n var _hasatob = typeof atob === 'function';\n var _hasbtoa = typeof btoa === 'function';\n var _hasBuffer = typeof Buffer === 'function';\n var _TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined;\n var _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;\n var b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n var b64chs = Array.prototype.slice.call(b64ch);\n var b64tab = (function (a) {\n var tab = {};\n a.forEach(function (c, i) { return tab[c] = i; });\n return tab;\n })(b64chs);\n var b64re = /^(?:[A-Za-z\\d+\\/]{4})*?(?:[A-Za-z\\d+\\/]{2}(?:==)?|[A-Za-z\\d+\\/]{3}=?)?$/;\n var _fromCC = String.fromCharCode.bind(String);\n var _U8Afrom = typeof Uint8Array.from === 'function'\n ? Uint8Array.from.bind(Uint8Array)\n : function (it, fn) {\n if (fn === void 0) { fn = function (x) { return x; }; }\n return new Uint8Array(Array.prototype.slice.call(it, 0).map(fn));\n };\n var _mkUriSafe = function (src) { return src\n .replace(/=/g, '').replace(/[+\\/]/g, function (m0) { return m0 == '+' ? '-' : '_'; }); };\n var _tidyB64 = function (s) { return s.replace(/[^A-Za-z0-9\\+\\/]/g, ''); };\n /**\n * polyfill version of `btoa`\n */\n var btoaPolyfill = function (bin) {\n // console.log('polyfilled');\n var u32, c0, c1, c2, asc = '';\n var pad = bin.length % 3;\n for (var i = 0; i < bin.length;) {\n if ((c0 = bin.charCodeAt(i++)) > 255 ||\n (c1 = bin.charCodeAt(i++)) > 255 ||\n (c2 = bin.charCodeAt(i++)) > 255)\n throw new TypeError('invalid character found');\n u32 = (c0 << 16) | (c1 << 8) | c2;\n asc += b64chs[u32 >> 18 & 63]\n + b64chs[u32 >> 12 & 63]\n + b64chs[u32 >> 6 & 63]\n + b64chs[u32 & 63];\n }\n return pad ? asc.slice(0, pad - 3) + \"===\".substring(pad) : asc;\n };\n /**\n * does what `window.btoa` of web browsers do.\n * @param {String} bin binary string\n * @returns {string} Base64-encoded string\n */\n var _btoa = _hasbtoa ? function (bin) { return btoa(bin); }\n : _hasBuffer ? function (bin) { return Buffer.from(bin, 'binary').toString('base64'); }\n : btoaPolyfill;\n var _fromUint8Array = _hasBuffer\n ? function (u8a) { return Buffer.from(u8a).toString('base64'); }\n : function (u8a) {\n // cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326\n var maxargs = 0x1000;\n var strs = [];\n for (var i = 0, l = u8a.length; i < l; i += maxargs) {\n strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));\n }\n return _btoa(strs.join(''));\n };\n /**\n * converts a Uint8Array to a Base64 string.\n * @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5\n * @returns {string} Base64 string\n */\n var fromUint8Array = function (u8a, urlsafe) {\n if (urlsafe === void 0) { urlsafe = false; }\n return urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);\n };\n // This trick is found broken https://github.com/dankogai/js-base64/issues/130\n // const utob = (src: string) => unescape(encodeURIComponent(src));\n // reverting good old fationed regexp\n var cb_utob = function (c) {\n if (c.length < 2) {\n var cc = c.charCodeAt(0);\n return cc < 0x80 ? c\n : cc < 0x800 ? (_fromCC(0xc0 | (cc >>> 6))\n + _fromCC(0x80 | (cc & 0x3f)))\n : (_fromCC(0xe0 | ((cc >>> 12) & 0x0f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n else {\n var cc = 0x10000\n + (c.charCodeAt(0) - 0xD800) * 0x400\n + (c.charCodeAt(1) - 0xDC00);\n return (_fromCC(0xf0 | ((cc >>> 18) & 0x07))\n + _fromCC(0x80 | ((cc >>> 12) & 0x3f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n };\n var re_utob = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFFF]|[^\\x00-\\x7F]/g;\n /**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-8 string\n * @returns {string} UTF-16 string\n */\n var utob = function (u) { return u.replace(re_utob, cb_utob); };\n //\n var _encode = _hasBuffer\n ? function (s) { return Buffer.from(s, 'utf8').toString('base64'); }\n : _TE\n ? function (s) { return _fromUint8Array(_TE.encode(s)); }\n : function (s) { return _btoa(utob(s)); };\n /**\n * converts a UTF-8-encoded string to a Base64 string.\n * @param {boolean} [urlsafe] if `true` make the result URL-safe\n * @returns {string} Base64 string\n */\n var encode = function (src, urlsafe) {\n if (urlsafe === void 0) { urlsafe = false; }\n return urlsafe\n ? _mkUriSafe(_encode(src))\n : _encode(src);\n };\n /**\n * converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5.\n * @returns {string} Base64 string\n */\n var encodeURI = function (src) { return encode(src, true); };\n // This trick is found broken https://github.com/dankogai/js-base64/issues/130\n // const btou = (src: string) => decodeURIComponent(escape(src));\n // reverting good old fationed regexp\n var re_btou = /[\\xC0-\\xDF][\\x80-\\xBF]|[\\xE0-\\xEF][\\x80-\\xBF]{2}|[\\xF0-\\xF7][\\x80-\\xBF]{3}/g;\n var cb_btou = function (cccc) {\n switch (cccc.length) {\n case 4:\n var cp = ((0x07 & cccc.charCodeAt(0)) << 18)\n | ((0x3f & cccc.charCodeAt(1)) << 12)\n | ((0x3f & cccc.charCodeAt(2)) << 6)\n | (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000;\n return (_fromCC((offset >>> 10) + 0xD800)\n + _fromCC((offset & 0x3FF) + 0xDC00));\n case 3:\n return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12)\n | ((0x3f & cccc.charCodeAt(1)) << 6)\n | (0x3f & cccc.charCodeAt(2)));\n default:\n return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6)\n | (0x3f & cccc.charCodeAt(1)));\n }\n };\n /**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-16 string\n * @returns {string} UTF-8 string\n */\n var btou = function (b) { return b.replace(re_btou, cb_btou); };\n /**\n * polyfill version of `atob`\n */\n var atobPolyfill = function (asc) {\n // console.log('polyfilled');\n asc = asc.replace(/\\s+/g, '');\n if (!b64re.test(asc))\n throw new TypeError('malformed base64.');\n asc += '=='.slice(2 - (asc.length & 3));\n var u24, bin = '', r1, r2;\n for (var i = 0; i < asc.length;) {\n u24 = b64tab[asc.charAt(i++)] << 18\n | b64tab[asc.charAt(i++)] << 12\n | (r1 = b64tab[asc.charAt(i++)]) << 6\n | (r2 = b64tab[asc.charAt(i++)]);\n bin += r1 === 64 ? _fromCC(u24 >> 16 & 255)\n : r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255)\n : _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255);\n }\n return bin;\n };\n /**\n * does what `window.atob` of web browsers do.\n * @param {String} asc Base64-encoded string\n * @returns {string} binary string\n */\n var _atob = _hasatob ? function (asc) { return atob(_tidyB64(asc)); }\n : _hasBuffer ? function (asc) { return Buffer.from(asc, 'base64').toString('binary'); }\n : atobPolyfill;\n //\n var _toUint8Array = _hasBuffer\n ? function (a) { return _U8Afrom(Buffer.from(a, 'base64')); }\n : function (a) { return _U8Afrom(_atob(a), function (c) { return c.charCodeAt(0); }); };\n /**\n * converts a Base64 string to a Uint8Array.\n */\n var toUint8Array = function (a) { return _toUint8Array(_unURI(a)); };\n //\n var _decode = _hasBuffer\n ? function (a) { return Buffer.from(a, 'base64').toString('utf8'); }\n : _TD\n ? function (a) { return _TD.decode(_toUint8Array(a)); }\n : function (a) { return btou(_atob(a)); };\n var _unURI = function (a) { return _tidyB64(a.replace(/[-_]/g, function (m0) { return m0 == '-' ? '+' : '/'; })); };\n /**\n * converts a Base64 string to a UTF-8 string.\n * @param {String} src Base64 string. Both normal and URL-safe are supported\n * @returns {string} UTF-8 string\n */\n var decode = function (src) { return _decode(_unURI(src)); };\n /**\n * check if a value is a valid Base64 string\n * @param {String} src a value to check\n */\n var isValid = function (src) {\n if (typeof src !== 'string')\n return false;\n var s = src.replace(/\\s+/g, '').replace(/={0,2}$/, '');\n return !/[^\\s0-9a-zA-Z\\+/]/.test(s) || !/[^\\s0-9a-zA-Z\\-_]/.test(s);\n };\n //\n var _noEnum = function (v) {\n return {\n value: v, enumerable: false, writable: true, configurable: true\n };\n };\n /**\n * extend String.prototype with relevant methods\n */\n var extendString = function () {\n var _add = function (name, body) { return Object.defineProperty(String.prototype, name, _noEnum(body)); };\n _add('fromBase64', function () { return decode(this); });\n _add('toBase64', function (urlsafe) { return encode(this, urlsafe); });\n _add('toBase64URI', function () { return encode(this, true); });\n _add('toBase64URL', function () { return encode(this, true); });\n _add('toUint8Array', function () { return toUint8Array(this); });\n };\n /**\n * extend Uint8Array.prototype with relevant methods\n */\n var extendUint8Array = function () {\n var _add = function (name, body) { return Object.defineProperty(Uint8Array.prototype, name, _noEnum(body)); };\n _add('toBase64', function (urlsafe) { return fromUint8Array(this, urlsafe); });\n _add('toBase64URI', function () { return fromUint8Array(this, true); });\n _add('toBase64URL', function () { return fromUint8Array(this, true); });\n };\n /**\n * extend Builtin prototypes with relevant methods\n */\n var extendBuiltins = function () {\n extendString();\n extendUint8Array();\n };\n var gBase64 = {\n version: version,\n VERSION: VERSION,\n atob: _atob,\n atobPolyfill: atobPolyfill,\n btoa: _btoa,\n btoaPolyfill: btoaPolyfill,\n fromBase64: decode,\n toBase64: encode,\n encode: encode,\n encodeURI: encodeURI,\n encodeURL: encodeURI,\n utob: utob,\n btou: btou,\n decode: decode,\n isValid: isValid,\n fromUint8Array: fromUint8Array,\n toUint8Array: toUint8Array,\n extendString: extendString,\n extendUint8Array: extendUint8Array,\n extendBuiltins: extendBuiltins\n };\n //\n // export Base64 to the namespace\n //\n // ES5 is yet to have Object.assign() that may make transpilers unhappy.\n // gBase64.Base64 = Object.assign({}, gBase64);\n gBase64.Base64 = {};\n Object.keys(gBase64).forEach(function (k) { return gBase64.Base64[k] = gBase64[k]; });\n return gBase64;\n}));\n"]}