拓恒飞手平台小程序
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.

332 lines
14KB

  1. module.exports = (function() {
  2. var __MODS__ = {};
  3. var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
  4. var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
  5. var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
  6. var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
  7. __DEFINE__(1667285643071, function(require, module, exports) {
  8. //
  9. // THIS FILE IS AUTOMATICALLY GENERATED! DO NOT EDIT BY HAND!
  10. //
  11. ;
  12. (function (global, factory) {
  13. typeof exports === 'object' && typeof module !== 'undefined'
  14. ? module.exports = factory()
  15. : typeof define === 'function' && define.amd
  16. ? define(factory) :
  17. // cf. https://github.com/dankogai/js-base64/issues/119
  18. (function () {
  19. // existing version for noConflict()
  20. var _Base64 = global.Base64;
  21. var gBase64 = factory();
  22. gBase64.noConflict = function () {
  23. global.Base64 = _Base64;
  24. return gBase64;
  25. };
  26. if (global.Meteor) { // Meteor.js
  27. Base64 = gBase64;
  28. }
  29. global.Base64 = gBase64;
  30. })();
  31. }((typeof self !== 'undefined' ? self
  32. : typeof window !== 'undefined' ? window
  33. : typeof global !== 'undefined' ? global
  34. : this), function () {
  35. /**
  36. * base64.ts
  37. *
  38. * Licensed under the BSD 3-Clause License.
  39. * http://opensource.org/licenses/BSD-3-Clause
  40. *
  41. * References:
  42. * http://en.wikipedia.org/wiki/Base64
  43. *
  44. * @author Dan Kogai (https://github.com/dankogai)
  45. */
  46. var version = '3.7.2';
  47. /**
  48. * @deprecated use lowercase `version`.
  49. */
  50. var VERSION = version;
  51. var _hasatob = typeof atob === 'function';
  52. var _hasbtoa = typeof btoa === 'function';
  53. var _hasBuffer = typeof Buffer === 'function';
  54. var _TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined;
  55. var _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;
  56. var b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  57. var b64chs = Array.prototype.slice.call(b64ch);
  58. var b64tab = (function (a) {
  59. var tab = {};
  60. a.forEach(function (c, i) { return tab[c] = i; });
  61. return tab;
  62. })(b64chs);
  63. var b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
  64. var _fromCC = String.fromCharCode.bind(String);
  65. var _U8Afrom = typeof Uint8Array.from === 'function'
  66. ? Uint8Array.from.bind(Uint8Array)
  67. : function (it, fn) {
  68. if (fn === void 0) { fn = function (x) { return x; }; }
  69. return new Uint8Array(Array.prototype.slice.call(it, 0).map(fn));
  70. };
  71. var _mkUriSafe = function (src) { return src
  72. .replace(/=/g, '').replace(/[+\/]/g, function (m0) { return m0 == '+' ? '-' : '_'; }); };
  73. var _tidyB64 = function (s) { return s.replace(/[^A-Za-z0-9\+\/]/g, ''); };
  74. /**
  75. * polyfill version of `btoa`
  76. */
  77. var btoaPolyfill = function (bin) {
  78. // console.log('polyfilled');
  79. var u32, c0, c1, c2, asc = '';
  80. var pad = bin.length % 3;
  81. for (var i = 0; i < bin.length;) {
  82. if ((c0 = bin.charCodeAt(i++)) > 255 ||
  83. (c1 = bin.charCodeAt(i++)) > 255 ||
  84. (c2 = bin.charCodeAt(i++)) > 255)
  85. throw new TypeError('invalid character found');
  86. u32 = (c0 << 16) | (c1 << 8) | c2;
  87. asc += b64chs[u32 >> 18 & 63]
  88. + b64chs[u32 >> 12 & 63]
  89. + b64chs[u32 >> 6 & 63]
  90. + b64chs[u32 & 63];
  91. }
  92. return pad ? asc.slice(0, pad - 3) + "===".substring(pad) : asc;
  93. };
  94. /**
  95. * does what `window.btoa` of web browsers do.
  96. * @param {String} bin binary string
  97. * @returns {string} Base64-encoded string
  98. */
  99. var _btoa = _hasbtoa ? function (bin) { return btoa(bin); }
  100. : _hasBuffer ? function (bin) { return Buffer.from(bin, 'binary').toString('base64'); }
  101. : btoaPolyfill;
  102. var _fromUint8Array = _hasBuffer
  103. ? function (u8a) { return Buffer.from(u8a).toString('base64'); }
  104. : function (u8a) {
  105. // cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326
  106. var maxargs = 0x1000;
  107. var strs = [];
  108. for (var i = 0, l = u8a.length; i < l; i += maxargs) {
  109. strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));
  110. }
  111. return _btoa(strs.join(''));
  112. };
  113. /**
  114. * converts a Uint8Array to a Base64 string.
  115. * @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5
  116. * @returns {string} Base64 string
  117. */
  118. var fromUint8Array = function (u8a, urlsafe) {
  119. if (urlsafe === void 0) { urlsafe = false; }
  120. return urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);
  121. };
  122. // This trick is found broken https://github.com/dankogai/js-base64/issues/130
  123. // const utob = (src: string) => unescape(encodeURIComponent(src));
  124. // reverting good old fationed regexp
  125. var cb_utob = function (c) {
  126. if (c.length < 2) {
  127. var cc = c.charCodeAt(0);
  128. return cc < 0x80 ? c
  129. : cc < 0x800 ? (_fromCC(0xc0 | (cc >>> 6))
  130. + _fromCC(0x80 | (cc & 0x3f)))
  131. : (_fromCC(0xe0 | ((cc >>> 12) & 0x0f))
  132. + _fromCC(0x80 | ((cc >>> 6) & 0x3f))
  133. + _fromCC(0x80 | (cc & 0x3f)));
  134. }
  135. else {
  136. var cc = 0x10000
  137. + (c.charCodeAt(0) - 0xD800) * 0x400
  138. + (c.charCodeAt(1) - 0xDC00);
  139. return (_fromCC(0xf0 | ((cc >>> 18) & 0x07))
  140. + _fromCC(0x80 | ((cc >>> 12) & 0x3f))
  141. + _fromCC(0x80 | ((cc >>> 6) & 0x3f))
  142. + _fromCC(0x80 | (cc & 0x3f)));
  143. }
  144. };
  145. var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
  146. /**
  147. * @deprecated should have been internal use only.
  148. * @param {string} src UTF-8 string
  149. * @returns {string} UTF-16 string
  150. */
  151. var utob = function (u) { return u.replace(re_utob, cb_utob); };
  152. //
  153. var _encode = _hasBuffer
  154. ? function (s) { return Buffer.from(s, 'utf8').toString('base64'); }
  155. : _TE
  156. ? function (s) { return _fromUint8Array(_TE.encode(s)); }
  157. : function (s) { return _btoa(utob(s)); };
  158. /**
  159. * converts a UTF-8-encoded string to a Base64 string.
  160. * @param {boolean} [urlsafe] if `true` make the result URL-safe
  161. * @returns {string} Base64 string
  162. */
  163. var encode = function (src, urlsafe) {
  164. if (urlsafe === void 0) { urlsafe = false; }
  165. return urlsafe
  166. ? _mkUriSafe(_encode(src))
  167. : _encode(src);
  168. };
  169. /**
  170. * converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5.
  171. * @returns {string} Base64 string
  172. */
  173. var encodeURI = function (src) { return encode(src, true); };
  174. // This trick is found broken https://github.com/dankogai/js-base64/issues/130
  175. // const btou = (src: string) => decodeURIComponent(escape(src));
  176. // reverting good old fationed regexp
  177. var re_btou = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
  178. var cb_btou = function (cccc) {
  179. switch (cccc.length) {
  180. case 4:
  181. var cp = ((0x07 & cccc.charCodeAt(0)) << 18)
  182. | ((0x3f & cccc.charCodeAt(1)) << 12)
  183. | ((0x3f & cccc.charCodeAt(2)) << 6)
  184. | (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000;
  185. return (_fromCC((offset >>> 10) + 0xD800)
  186. + _fromCC((offset & 0x3FF) + 0xDC00));
  187. case 3:
  188. return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12)
  189. | ((0x3f & cccc.charCodeAt(1)) << 6)
  190. | (0x3f & cccc.charCodeAt(2)));
  191. default:
  192. return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6)
  193. | (0x3f & cccc.charCodeAt(1)));
  194. }
  195. };
  196. /**
  197. * @deprecated should have been internal use only.
  198. * @param {string} src UTF-16 string
  199. * @returns {string} UTF-8 string
  200. */
  201. var btou = function (b) { return b.replace(re_btou, cb_btou); };
  202. /**
  203. * polyfill version of `atob`
  204. */
  205. var atobPolyfill = function (asc) {
  206. // console.log('polyfilled');
  207. asc = asc.replace(/\s+/g, '');
  208. if (!b64re.test(asc))
  209. throw new TypeError('malformed base64.');
  210. asc += '=='.slice(2 - (asc.length & 3));
  211. var u24, bin = '', r1, r2;
  212. for (var i = 0; i < asc.length;) {
  213. u24 = b64tab[asc.charAt(i++)] << 18
  214. | b64tab[asc.charAt(i++)] << 12
  215. | (r1 = b64tab[asc.charAt(i++)]) << 6
  216. | (r2 = b64tab[asc.charAt(i++)]);
  217. bin += r1 === 64 ? _fromCC(u24 >> 16 & 255)
  218. : r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255)
  219. : _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255);
  220. }
  221. return bin;
  222. };
  223. /**
  224. * does what `window.atob` of web browsers do.
  225. * @param {String} asc Base64-encoded string
  226. * @returns {string} binary string
  227. */
  228. var _atob = _hasatob ? function (asc) { return atob(_tidyB64(asc)); }
  229. : _hasBuffer ? function (asc) { return Buffer.from(asc, 'base64').toString('binary'); }
  230. : atobPolyfill;
  231. //
  232. var _toUint8Array = _hasBuffer
  233. ? function (a) { return _U8Afrom(Buffer.from(a, 'base64')); }
  234. : function (a) { return _U8Afrom(_atob(a), function (c) { return c.charCodeAt(0); }); };
  235. /**
  236. * converts a Base64 string to a Uint8Array.
  237. */
  238. var toUint8Array = function (a) { return _toUint8Array(_unURI(a)); };
  239. //
  240. var _decode = _hasBuffer
  241. ? function (a) { return Buffer.from(a, 'base64').toString('utf8'); }
  242. : _TD
  243. ? function (a) { return _TD.decode(_toUint8Array(a)); }
  244. : function (a) { return btou(_atob(a)); };
  245. var _unURI = function (a) { return _tidyB64(a.replace(/[-_]/g, function (m0) { return m0 == '-' ? '+' : '/'; })); };
  246. /**
  247. * converts a Base64 string to a UTF-8 string.
  248. * @param {String} src Base64 string. Both normal and URL-safe are supported
  249. * @returns {string} UTF-8 string
  250. */
  251. var decode = function (src) { return _decode(_unURI(src)); };
  252. /**
  253. * check if a value is a valid Base64 string
  254. * @param {String} src a value to check
  255. */
  256. var isValid = function (src) {
  257. if (typeof src !== 'string')
  258. return false;
  259. var s = src.replace(/\s+/g, '').replace(/={0,2}$/, '');
  260. return !/[^\s0-9a-zA-Z\+/]/.test(s) || !/[^\s0-9a-zA-Z\-_]/.test(s);
  261. };
  262. //
  263. var _noEnum = function (v) {
  264. return {
  265. value: v, enumerable: false, writable: true, configurable: true
  266. };
  267. };
  268. /**
  269. * extend String.prototype with relevant methods
  270. */
  271. var extendString = function () {
  272. var _add = function (name, body) { return Object.defineProperty(String.prototype, name, _noEnum(body)); };
  273. _add('fromBase64', function () { return decode(this); });
  274. _add('toBase64', function (urlsafe) { return encode(this, urlsafe); });
  275. _add('toBase64URI', function () { return encode(this, true); });
  276. _add('toBase64URL', function () { return encode(this, true); });
  277. _add('toUint8Array', function () { return toUint8Array(this); });
  278. };
  279. /**
  280. * extend Uint8Array.prototype with relevant methods
  281. */
  282. var extendUint8Array = function () {
  283. var _add = function (name, body) { return Object.defineProperty(Uint8Array.prototype, name, _noEnum(body)); };
  284. _add('toBase64', function (urlsafe) { return fromUint8Array(this, urlsafe); });
  285. _add('toBase64URI', function () { return fromUint8Array(this, true); });
  286. _add('toBase64URL', function () { return fromUint8Array(this, true); });
  287. };
  288. /**
  289. * extend Builtin prototypes with relevant methods
  290. */
  291. var extendBuiltins = function () {
  292. extendString();
  293. extendUint8Array();
  294. };
  295. var gBase64 = {
  296. version: version,
  297. VERSION: VERSION,
  298. atob: _atob,
  299. atobPolyfill: atobPolyfill,
  300. btoa: _btoa,
  301. btoaPolyfill: btoaPolyfill,
  302. fromBase64: decode,
  303. toBase64: encode,
  304. encode: encode,
  305. encodeURI: encodeURI,
  306. encodeURL: encodeURI,
  307. utob: utob,
  308. btou: btou,
  309. decode: decode,
  310. isValid: isValid,
  311. fromUint8Array: fromUint8Array,
  312. toUint8Array: toUint8Array,
  313. extendString: extendString,
  314. extendUint8Array: extendUint8Array,
  315. extendBuiltins: extendBuiltins
  316. };
  317. //
  318. // export Base64 to the namespace
  319. //
  320. // ES5 is yet to have Object.assign() that may make transpilers unhappy.
  321. // gBase64.Base64 = Object.assign({}, gBase64);
  322. gBase64.Base64 = {};
  323. Object.keys(gBase64).forEach(function (k) { return gBase64.Base64[k] = gBase64[k]; });
  324. return gBase64;
  325. }));
  326. }, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); })
  327. return __REQUIRE__(1667285643071);
  328. })()
  329. //miniprogram-npm-outsideDeps=[]
  330. //# sourceMappingURL=index.js.map