febs-browser 1.2.13 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1910 +1,1360 @@
1
- module.exports =
2
- /******/ (function(modules) { // webpackBootstrap
3
- /******/ // The module cache
4
- /******/ var installedModules = {};
5
- /******/
6
- /******/ // The require function
7
- /******/ function __webpack_require__(moduleId) {
8
- /******/
9
- /******/ // Check if module is in cache
10
- /******/ if(installedModules[moduleId]) {
11
- /******/ return installedModules[moduleId].exports;
12
- /******/ }
13
- /******/ // Create a new module (and put it into the cache)
14
- /******/ var module = installedModules[moduleId] = {
15
- /******/ i: moduleId,
16
- /******/ l: false,
17
- /******/ exports: {}
18
- /******/ };
19
- /******/
20
- /******/ // Execute the module function
21
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22
- /******/
23
- /******/ // Flag the module as loaded
24
- /******/ module.l = true;
25
- /******/
26
- /******/ // Return the exports of the module
27
- /******/ return module.exports;
28
- /******/ }
29
- /******/
30
- /******/
31
- /******/ // expose the modules object (__webpack_modules__)
32
- /******/ __webpack_require__.m = modules;
33
- /******/
34
- /******/ // expose the module cache
35
- /******/ __webpack_require__.c = installedModules;
36
- /******/
37
- /******/ // identity function for calling harmony imports with the correct context
38
- /******/ __webpack_require__.i = function(value) { return value; };
39
- /******/
40
- /******/ // define getter function for harmony exports
41
- /******/ __webpack_require__.d = function(exports, name, getter) {
42
- /******/ if(!__webpack_require__.o(exports, name)) {
43
- /******/ Object.defineProperty(exports, name, {
44
- /******/ configurable: false,
45
- /******/ enumerable: true,
46
- /******/ get: getter
47
- /******/ });
48
- /******/ }
49
- /******/ };
50
- /******/
51
- /******/ // getDefaultExport function for compatibility with non-harmony modules
52
- /******/ __webpack_require__.n = function(module) {
53
- /******/ var getter = module && module.__esModule ?
54
- /******/ function getDefault() { return module['default']; } :
55
- /******/ function getModuleExports() { return module; };
56
- /******/ __webpack_require__.d(getter, 'a', getter);
57
- /******/ return getter;
58
- /******/ };
59
- /******/
60
- /******/ // Object.prototype.hasOwnProperty.call
61
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
62
- /******/
63
- /******/ // __webpack_public_path__
64
- /******/ __webpack_require__.p = "";
65
- /******/
66
- /******/ // Load entry module and return exports
67
- /******/ return __webpack_require__(__webpack_require__.s = 14);
68
- /******/ })
69
- /************************************************************************/
70
- /******/ ([
71
- /* 0 */
72
- /***/ (function(module, exports, __webpack_require__) {
73
-
74
- "use strict";
75
-
76
-
77
- /**
78
- * Copyright (c) 2017 Copyright brainpoint All Rights Reserved.
79
- * Author: lipengxiang
80
- * Desc:
81
- */
82
-
83
- /**
84
- * @desc: 判断是否是手机号码.
85
- * @return: boolean.
1
+ /*!
2
+ * febs-browser v1.3.2
3
+ * Copyright (c) 2026 bpoint.lee@gmail.com All Rights Reserved.
4
+ * Released under the MIT License.
86
5
  */
87
-
88
- exports.isPhoneMobile = function (str) {
89
- if (!str) return false;
90
- if (/^(1[2-9][0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89]|98[0-9]|99[0-9])\d{8}$/.test(str)) {
91
- return true;
92
- }
93
- return false;
6
+ var __defProp = Object.defineProperty;
7
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
8
+ var __getOwnPropNames = Object.getOwnPropertyNames;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __esm = (fn, res) => function __init() {
11
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
94
12
  };
95
-
96
- /**
97
- * @desc: 判断是否是email.
98
- * @return: boolean.
99
- */
100
- exports.isEmail = function (str) {
101
- if (!str) return false;
102
- if (/^(([A-Za-z0-9\u4e00-\u9fa5_-]|\.)+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+)$/.test(str)) {
103
- return true;
104
- }
105
- return false;
13
+ var __commonJS = (cb, mod) => function __require() {
14
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
106
15
  };
107
-
108
- /**
109
- * @desc: 判断是否是英文数字组合.
110
- * @return: boolean.
111
- */
112
- exports.isAlphaOrDigit = function (str) {
113
- if (!str) return false;
114
- if (/^[A-Za-z0-9]+$/.test(str)) {
115
- return true;
116
- }
117
- return false;
16
+ var __export = (target, all) => {
17
+ for (var name in all)
18
+ __defProp(target, name, { get: all[name], enumerable: true });
118
19
  };
119
-
120
- /**
121
- * @desc: 判断是否是中文.
122
- * @return: boolean.
123
- */
124
- exports.isChinese = function (str) {
125
- if (!str) return false;
126
- if (/^[\u4e00-\u9fa5]{0,}$/.test(str)) {
127
- return true;
20
+ var __copyProps = (to, from, except, desc) => {
21
+ if (from && typeof from === "object" || typeof from === "function") {
22
+ for (let key of __getOwnPropNames(from))
23
+ if (!__hasOwnProp.call(to, key) && key !== except)
24
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
128
25
  }
129
- return false;
26
+ return to;
130
27
  };
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
131
29
 
132
- /**
133
- * @desc: 是否为空串.
134
- * @return: boolean.
135
- */
136
- exports.isEmpty = function (s) {
137
-
138
- if (!s) {
139
- return true;
140
- }
141
-
142
- if (typeof s !== 'string') {
143
- return true;
30
+ // common/promise-finally-polyfill.js
31
+ var require_promise_finally_polyfill = __commonJS({
32
+ "common/promise-finally-polyfill.js"() {
33
+ (function() {
34
+ if (typeof Promise.prototype.finally === "function") {
35
+ return;
36
+ }
37
+ Promise.prototype.finally = function(fn) {
38
+ return this.then(function(value) {
39
+ return this.constructor.resolve(fn()).then(function() {
40
+ return value;
41
+ });
42
+ }).catch(function(reason) {
43
+ return this.constructor.resolve(fn()).then(function() {
44
+ throw reason;
45
+ });
46
+ });
47
+ };
48
+ })();
144
49
  }
145
-
146
- if (s.length == 0) return true;
147
-
148
- return false;
149
- };
150
-
151
- /**
152
- * @desc: 获得字符串utf8编码后的字节长度.
153
- * @return: u32.
154
- */
155
- exports.getByteSize = function (s) {
156
- if (!s) return 0;
157
-
158
- var totalLength = 0;
159
- var i;
160
- var charCode;
161
- for (i = 0; i < s.length; i++) {
162
- charCode = s.charCodeAt(i);
163
- if (charCode < 0x007f) {
164
- totalLength = totalLength + 1;
165
- } else if (0x0080 <= charCode && charCode <= 0x07ff) {
166
- totalLength += 2;
167
- } else if (0x0800 <= charCode && charCode <= 0xffff) {
168
- totalLength += 3;
169
- } else if (0x10000 <= charCode) {
170
- totalLength += 4;
50
+ });
51
+
52
+ // common/date.js
53
+ var require_date = __commonJS({
54
+ "common/date.js"(exports) {
55
+ "use strict";
56
+ exports.isValidate = function(date2) {
57
+ if (isNaN(date2) || !date2 || date2.toString() == "Invalid Date")
58
+ return false;
59
+ return date2 instanceof Date;
60
+ };
61
+ function getTimeString(time, fmt, weekFmt) {
62
+ if (typeof time !== "number")
63
+ return "";
64
+ fmt = fmt || "HH:mm:ss";
65
+ var t = new Date(time);
66
+ var o = {
67
+ "M+": t.getMonth() + 1,
68
+ //月份
69
+ "d+": t.getDate(),
70
+ //日
71
+ "h+": t.getHours() % 12 == 0 ? 12 : t.getHours() % 12,
72
+ //小时
73
+ "H+": t.getHours(),
74
+ //小时
75
+ "m+": t.getMinutes(),
76
+ //分
77
+ "s+": t.getSeconds(),
78
+ //秒
79
+ "q+": Math.floor((t.getMonth() + 3) / 3),
80
+ //季度
81
+ "S": t.getMilliseconds()
82
+ //毫秒
83
+ };
84
+ var week = weekFmt || {
85
+ "0": "\u661F\u671F\u5929",
86
+ "1": "\u661F\u671F\u4E00",
87
+ "2": "\u661F\u671F\u4E8C",
88
+ "3": "\u661F\u671F\u4E09",
89
+ "4": "\u661F\u671F\u56DB",
90
+ "5": "\u661F\u671F\u4E94",
91
+ "6": "\u661F\u671F\u516D"
92
+ };
93
+ if (/(y+)/.test(fmt)) {
94
+ fmt = fmt.replace(RegExp.$1, (t.getFullYear() + "").substr(4 - RegExp.$1.length));
95
+ }
96
+ if (/(E+)/.test(fmt)) {
97
+ fmt = fmt.replace(RegExp.$1, week[t.getDay() + ""]);
98
+ }
99
+ for (var k in o) {
100
+ if (new RegExp("(" + k + ")").test(fmt)) {
101
+ fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
102
+ }
103
+ }
104
+ return fmt;
171
105
  }
106
+ exports.getTimeString = getTimeString;
107
+ exports.getTimeStringFromNow = function(time, strFmt) {
108
+ strFmt = strFmt || {};
109
+ strFmt.now = strFmt.now || "\u521A\u521A";
110
+ strFmt.second = strFmt.second || "\u79D2\u524D";
111
+ strFmt.minute = strFmt.minute || "\u5206\u949F\u524D";
112
+ strFmt.hour = strFmt.hour || "\u5C0F\u65F6\u524D";
113
+ strFmt.day_yesterday = strFmt.day_yesterday || "\u6628\u5929";
114
+ strFmt.day = strFmt.day || "\u5929\u524D";
115
+ strFmt.month = strFmt.month || "\u4E2A\u6708\u524D";
116
+ strFmt.time = strFmt.time || "yyyy-M-d h:m:s";
117
+ var now = Math.ceil(Date.now() / 1e3);
118
+ time = Math.ceil(time / 1e3);
119
+ if (now > time) {
120
+ var s = now - time;
121
+ if (s < 3) {
122
+ return strFmt.now;
123
+ }
124
+ if (s < 60) {
125
+ return s.toString() + strFmt.second;
126
+ }
127
+ if (s < 60 * 60) {
128
+ return Math.ceil(s / 60).toString() + strFmt.minute;
129
+ }
130
+ if (s < 60 * 60 * 24) {
131
+ return Math.ceil(s / 60 / 60).toString() + strFmt.hour;
132
+ }
133
+ if (s < 60 * 60 * 24 * 30) {
134
+ var dNow = new Date(now * 1e3);
135
+ dNow.setHours(0, 0, 1);
136
+ if (dNow.getTime() - time <= 60 * 60 * 24) {
137
+ return strFmt.day_yesterday;
138
+ }
139
+ return Math.ceil(s / 60 / 60 / 24).toString() + strFmt.day;
140
+ }
141
+ if (s < 60 * 60 * 24 * 30 * 6) {
142
+ return Math.ceil(s / 60 / 60 / 24 / 30).toString() + strFmt.month;
143
+ }
144
+ return getTimeString(time, strFmt.time);
145
+ }
146
+ return strFmt.now;
147
+ };
148
+ exports.getTime = function(strTime) {
149
+ var date2 = /* @__PURE__ */ new Date();
150
+ date2.setFullYear(
151
+ parseInt(strTime.substr(0, 4)),
152
+ parseInt(strTime.substr(5, 2), 10) - 1,
153
+ parseInt(strTime.substr(8, 2))
154
+ );
155
+ date2.setHours(
156
+ parseInt(strTime.substr(11, 2)) || 0,
157
+ parseInt(strTime.substr(14, 2)) || 0,
158
+ parseInt(strTime.substr(17, 2)) || 0,
159
+ 0
160
+ );
161
+ return date2;
162
+ };
163
+ exports.getTime2 = function(strTime) {
164
+ var date2 = /* @__PURE__ */ new Date();
165
+ date2.setFullYear(
166
+ parseInt(strTime.substr(0, 4)),
167
+ parseInt(strTime.substr(4, 2), 10) - 1,
168
+ parseInt(strTime.substr(6, 2))
169
+ );
170
+ date2.setHours(
171
+ parseInt(strTime.substr(8, 2)) || 0,
172
+ parseInt(strTime.substr(10, 2)) || 0,
173
+ parseInt(strTime.substr(12, 2)) || 0,
174
+ 0
175
+ );
176
+ return date2;
177
+ };
178
+ exports.getDate = function(strDate) {
179
+ var date2 = new Date(
180
+ parseInt(strDate.substr(0, 4)),
181
+ parseInt(strDate.substr(5, 2), 10) - 1,
182
+ parseInt(strDate.substr(8, 2))
183
+ );
184
+ return date2;
185
+ };
186
+ exports.getDate2 = function(strDate) {
187
+ var date2 = new Date(
188
+ parseInt(strDate.substr(0, 4)),
189
+ parseInt(strDate.substr(4, 2), 10) - 1,
190
+ parseInt(strDate.substr(6, 2))
191
+ );
192
+ return date2;
193
+ };
194
+ exports.getUTCTimeString = function(time, fmt, weekFmt) {
195
+ if (typeof time !== "number")
196
+ return "";
197
+ fmt = fmt || "HH:mm:ss";
198
+ var t = new Date(time);
199
+ var o = {
200
+ "M+": t.getUTCMonth() + 1,
201
+ //月份
202
+ "d+": t.getUTCDate(),
203
+ //日
204
+ "h+": t.getUTCHours() % 12 == 0 ? 12 : t.getUTCHours() % 12,
205
+ //小时
206
+ "H+": t.getUTCHours(),
207
+ //小时
208
+ "m+": t.getUTCMinutes(),
209
+ //分
210
+ "s+": t.getUTCSeconds(),
211
+ //秒
212
+ "q+": Math.floor((t.getUTCMonth() + 3) / 3),
213
+ //季度
214
+ "S": t.getUTCMilliseconds()
215
+ //毫秒
216
+ };
217
+ var week = weekFmt || {
218
+ "0": "\u661F\u671F\u5929",
219
+ "1": "\u661F\u671F\u4E00",
220
+ "2": "\u661F\u671F\u4E8C",
221
+ "3": "\u661F\u671F\u4E09",
222
+ "4": "\u661F\u671F\u56DB",
223
+ "5": "\u661F\u671F\u4E94",
224
+ "6": "\u661F\u671F\u516D"
225
+ };
226
+ if (/(y+)/.test(fmt)) {
227
+ fmt = fmt.replace(RegExp.$1, (t.getUTCFullYear() + "").substr(4 - RegExp.$1.length));
228
+ }
229
+ if (/(E+)/.test(fmt)) {
230
+ fmt = fmt.replace(RegExp.$1, week[t.getUTCDay() + ""]);
231
+ }
232
+ for (var k in o) {
233
+ if (new RegExp("(" + k + ")").test(fmt)) {
234
+ fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
235
+ }
236
+ }
237
+ return fmt;
238
+ };
239
+ exports.getDateFromUTC = function(strDateUTC) {
240
+ var date2 = /* @__PURE__ */ new Date();
241
+ date2.setUTCFullYear(
242
+ parseInt(strDateUTC.substr(0, 4)),
243
+ parseInt(strDateUTC.substr(5, 2), 10) - 1,
244
+ parseInt(strDateUTC.substr(8, 2))
245
+ );
246
+ date2.setUTCHours(0, 0, 0, 0);
247
+ return date2;
248
+ };
249
+ exports.getDate2FromUTC = function(strDateUTC) {
250
+ var date2 = /* @__PURE__ */ new Date();
251
+ date2.setUTCFullYear(
252
+ parseInt(strDateUTC.substr(0, 4)),
253
+ parseInt(strDateUTC.substr(4, 2), 10) - 1,
254
+ parseInt(strDateUTC.substr(6, 2))
255
+ );
256
+ date2.setUTCHours(0, 0, 0, 0);
257
+ return date2;
258
+ };
259
+ exports.getTimeFromUTC = function(strTimeUTC) {
260
+ var date2 = /* @__PURE__ */ new Date();
261
+ date2.setUTCFullYear(
262
+ parseInt(strTimeUTC.substr(0, 4)),
263
+ parseInt(strTimeUTC.substr(5, 2), 10) - 1,
264
+ parseInt(strTimeUTC.substr(8, 2))
265
+ );
266
+ date2.setUTCHours(
267
+ parseInt(strTimeUTC.substr(11, 2)) || 0,
268
+ parseInt(strTimeUTC.substr(14, 2)) || 0,
269
+ parseInt(strTimeUTC.substr(17, 2)) || 0,
270
+ 0
271
+ );
272
+ return date2;
273
+ };
274
+ exports.getTime2FromUTC = function(strTimeUTC) {
275
+ var date2 = /* @__PURE__ */ new Date();
276
+ date2.setUTCFullYear(
277
+ parseInt(strTimeUTC.substr(0, 4)),
278
+ parseInt(strTimeUTC.substr(4, 2), 10) - 1,
279
+ parseInt(strTimeUTC.substr(6, 2))
280
+ );
281
+ date2.setUTCHours(
282
+ parseInt(strTimeUTC.substr(8, 2)) || 0,
283
+ parseInt(strTimeUTC.substr(10, 2)) || 0,
284
+ parseInt(strTimeUTC.substr(12, 2)) || 0,
285
+ 0
286
+ );
287
+ return date2;
288
+ };
172
289
  }
173
- //alert(totalLength);
174
- return totalLength;
175
- };
176
-
177
- /**
178
- * @desc: 替换字符串中所有的strSrc->strDest.
179
- * @return: string.
180
- */
181
- exports.replace = function (str, strSrc, strDest) {
182
- if (!str || !strSrc) return str;
183
-
184
- if (str.length == 0) return str;
185
-
186
- var s = '';
187
-
188
- var endPos = str.length;
189
- var i = 0;
190
- var j = 0;
191
- do {
192
- i = str.indexOf(strSrc, j);
193
- if (-1 != i && i < endPos) {
194
- if (i != j) s += str.slice(j, i);
195
-
196
- s += strDest;
197
- j = i + strSrc.length;
198
- } else {
199
- s += str.slice(j);
200
- break;
201
- }
202
- } while (i < endPos); // while
203
-
204
- return s;
205
- };
206
-
207
- exports.utf8ToBytes = function (str) {
208
- if (!str) {
209
- return new Array();
290
+ });
291
+
292
+ // common/utils.js
293
+ var require_utils = __commonJS({
294
+ "common/utils.js"(exports) {
295
+ "use strict";
296
+ var PromiseLib = Promise;
297
+ var utilsDate = require_date();
298
+ exports.sleep = function(ms) {
299
+ return new PromiseLib(function(resolve, reject) {
300
+ try {
301
+ setTimeout(function() {
302
+ resolve();
303
+ }, ms);
304
+ } catch (err) {
305
+ reject(err);
306
+ }
307
+ });
308
+ };
309
+ exports.mergeMap = function() {
310
+ var map0 = {};
311
+ var map2;
312
+ for (var i = 0; i < arguments.length; i++) {
313
+ map2 = arguments[i];
314
+ if (map2) {
315
+ for (var k in map2) {
316
+ map0[k] = map2[k];
317
+ }
318
+ }
319
+ }
320
+ return map0;
321
+ };
322
+ exports.isNull = function(e) {
323
+ return e === null || e === void 0 || Number.isNaN(e);
324
+ };
325
+ exports.getTimeString = utilsDate.getTimeString;
326
+ exports.getTimeStringFromNow = utilsDate.getTimeStringFromNow;
327
+ exports.getDate = utilsDate.getDate;
328
+ exports.getDate2 = utilsDate.getDate2;
329
+ exports.denodeify = function(fn, self, argumentCount) {
330
+ argumentCount = argumentCount || Infinity;
331
+ return function() {
332
+ var args = Array.prototype.slice.call(
333
+ arguments,
334
+ 0,
335
+ argumentCount > 0 ? argumentCount : 0
336
+ );
337
+ return new PromiseLib(function(resolve, reject) {
338
+ args.push(function(err, res2) {
339
+ if (err) reject(err);
340
+ else resolve(res2);
341
+ });
342
+ var res = fn.apply(self, args);
343
+ if (res && (typeof res === "object" || typeof res === "function") && typeof res.then === "function") {
344
+ resolve(res);
345
+ }
346
+ });
347
+ };
348
+ };
349
+ exports.promisify = exports.denodeify;
210
350
  }
211
- var bytes = new Array();
212
- var len, c;
213
- len = str.length;
214
- for (var i = 0; i < len; i++) {
215
- c = str.charCodeAt(i);
216
- if (c >= 0x010000 && c <= 0x10FFFF) {
217
- bytes.push(c >> 18 & 0x07 | 0xF0);
218
- bytes.push(c >> 12 & 0x3F | 0x80);
219
- bytes.push(c >> 6 & 0x3F | 0x80);
220
- bytes.push(c & 0x3F | 0x80);
221
- } else if (c >= 0x000800 && c <= 0x00FFFF) {
222
- bytes.push(c >> 12 & 0x0F | 0xE0);
223
- bytes.push(c >> 6 & 0x3F | 0x80);
224
- bytes.push(c & 0x3F | 0x80);
225
- } else if (c >= 0x000080 && c <= 0x0007FF) {
226
- bytes.push(c >> 6 & 0x1F | 0xC0);
227
- bytes.push(c & 0x3F | 0x80);
228
- } else {
229
- bytes.push(c & 0xFF);
230
- }
351
+ });
352
+
353
+ // wxmini/libs/utils.js
354
+ var require_utils2 = __commonJS({
355
+ "wxmini/libs/utils.js"(exports) {
356
+ "use strict";
357
+ var utils2 = require_utils();
358
+ exports.sleep = utils2.sleep;
359
+ exports.getTimeString = utils2.getTimeString;
360
+ exports.getTimeStringFromNow = utils2.getTimeStringFromNow;
361
+ exports.getDate = utils2.getDate;
362
+ exports.getDate2 = utils2.getDate2;
363
+ exports.mergeMap = utils2.mergeMap;
364
+ exports.isNull = utils2.isNull;
365
+ exports.denodeify = utils2.denodeify;
366
+ exports.promisify = utils2.promisify;
367
+ exports.browserIsIE = function() {
368
+ return false;
369
+ };
370
+ exports.browserIEVer = function() {
371
+ return Number.MAX_SAFE_INTEGER;
372
+ };
373
+ exports.browserIsSupportHtml5 = function() {
374
+ if (typeof Worker !== "undefined") {
375
+ return true;
376
+ } else {
377
+ return false;
378
+ }
379
+ };
380
+ exports.browserIsMobile = function(userAgent) {
381
+ return true;
382
+ };
383
+ exports.browserIsIOS = function() {
384
+ let systemInfo = wx.getSystemInfoSync();
385
+ if (systemInfo && systemInfo.platform == "ios") {
386
+ return true;
387
+ }
388
+ return false;
389
+ };
390
+ exports.browserIsPhone = function(userAgent) {
391
+ let systemInfo = wx.getSystemInfoSync();
392
+ if (systemInfo && systemInfo.windowWidth <= 767) {
393
+ return true;
394
+ }
395
+ return false;
396
+ };
397
+ exports.browserIsWeixin = function(userAgent) {
398
+ return true;
399
+ };
400
+ exports.platformIsWindows = function(userAgent) {
401
+ return false;
402
+ };
403
+ exports.platformIsMac = function(userAgent) {
404
+ return false;
405
+ };
231
406
  }
232
- return bytes;
233
- };
234
-
235
- exports.bytesToUtf8 = function (utf8Bytes) {
236
- var unicodeStr = "";
237
- for (var pos = 0; pos < utf8Bytes.length;) {
238
- var flag = utf8Bytes[pos];
239
- var unicode = 0;
240
- if (flag >>> 7 === 0) {
241
- unicodeStr += String.fromCharCode(utf8Bytes[pos]);
242
- pos += 1;
243
- } else if ((flag & 0xFC) === 0xFC) {
244
- unicode = (utf8Bytes[pos] & 0x3) << 30;
245
- unicode |= (utf8Bytes[pos + 1] & 0x3F) << 24;
246
- unicode |= (utf8Bytes[pos + 2] & 0x3F) << 18;
247
- unicode |= (utf8Bytes[pos + 3] & 0x3F) << 12;
248
- unicode |= (utf8Bytes[pos + 4] & 0x3F) << 6;
249
- unicode |= utf8Bytes[pos + 5] & 0x3F;
250
- unicodeStr += String.fromCharCode(unicode);
251
- pos += 6;
252
- } else if ((flag & 0xF8) === 0xF8) {
253
- unicode = (utf8Bytes[pos] & 0x7) << 24;
254
- unicode |= (utf8Bytes[pos + 1] & 0x3F) << 18;
255
- unicode |= (utf8Bytes[pos + 2] & 0x3F) << 12;
256
- unicode |= (utf8Bytes[pos + 3] & 0x3F) << 6;
257
- unicode |= utf8Bytes[pos + 4] & 0x3F;
258
- unicodeStr += String.fromCharCode(unicode);
259
- pos += 5;
260
- } else if ((flag & 0xF0) === 0xF0) {
261
- unicode = (utf8Bytes[pos] & 0xF) << 18;
262
- unicode |= (utf8Bytes[pos + 1] & 0x3F) << 12;
263
- unicode |= (utf8Bytes[pos + 2] & 0x3F) << 6;
264
- unicode |= utf8Bytes[pos + 3] & 0x3F;
265
- unicodeStr += String.fromCharCode(unicode);
266
- pos += 4;
267
- } else if ((flag & 0xE0) === 0xE0) {
268
- unicode = (utf8Bytes[pos] & 0x1F) << 12;;
269
- unicode |= (utf8Bytes[pos + 1] & 0x3F) << 6;
270
- unicode |= utf8Bytes[pos + 2] & 0x3F;
271
- unicodeStr += String.fromCharCode(unicode);
272
- pos += 3;
273
- } else if ((flag & 0xC0) === 0xC0) {
274
- //110
275
- unicode = (utf8Bytes[pos] & 0x3F) << 6;
276
- unicode |= utf8Bytes[pos + 1] & 0x3F;
277
- unicodeStr += String.fromCharCode(unicode);
278
- pos += 2;
279
- } else {
280
- unicodeStr += String.fromCharCode(utf8Bytes[pos]);
281
- pos += 1;
282
- }
407
+ });
408
+
409
+ // common/string.js
410
+ var require_string = __commonJS({
411
+ "common/string.js"(exports) {
412
+ "use strict";
413
+ exports.isPhoneMobile = function(str) {
414
+ if (!str) return false;
415
+ if (/^(1[2-9][0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89]|98[0-9]|99[0-9])\d{8}$/.test(str)) {
416
+ return true;
417
+ }
418
+ return false;
419
+ };
420
+ exports.isEmail = function(str) {
421
+ if (!str) return false;
422
+ if (/^(([A-Za-z0-9\u4e00-\u9fa5_-]|\.)+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+)$/.test(str)) {
423
+ return true;
424
+ }
425
+ return false;
426
+ };
427
+ exports.isAlphaOrDigit = function(str) {
428
+ if (!str) return false;
429
+ if (/^[A-Za-z0-9]+$/.test(str)) {
430
+ return true;
431
+ }
432
+ return false;
433
+ };
434
+ exports.isChinese = function(str) {
435
+ if (!str) return false;
436
+ if (/^[\u4e00-\u9fa5]{0,}$/.test(str)) {
437
+ return true;
438
+ }
439
+ return false;
440
+ };
441
+ exports.isEmpty = function(s) {
442
+ if (!s) {
443
+ return true;
444
+ }
445
+ if (typeof s !== "string") {
446
+ return true;
447
+ }
448
+ if (s.length == 0)
449
+ return true;
450
+ return false;
451
+ };
452
+ exports.getByteSize = function(s) {
453
+ if (!s)
454
+ return 0;
455
+ var totalLength = 0;
456
+ var i;
457
+ var charCode;
458
+ for (i = 0; i < s.length; i++) {
459
+ charCode = s.charCodeAt(i);
460
+ if (charCode < 128) {
461
+ totalLength = totalLength + 1;
462
+ } else if (charCode < 2048) {
463
+ totalLength += 2;
464
+ } else if (charCode >= 55296 && charCode <= 56319) {
465
+ var next = s.charCodeAt(i + 1);
466
+ if (next >= 56320 && next <= 57343) {
467
+ totalLength += 4;
468
+ i++;
469
+ } else {
470
+ totalLength += 3;
471
+ }
472
+ } else {
473
+ totalLength += 3;
474
+ }
475
+ }
476
+ return totalLength;
477
+ };
478
+ exports.replace = function(str, strSrc, strDest) {
479
+ if (!str || !strSrc)
480
+ return str;
481
+ if (str.length == 0)
482
+ return str;
483
+ var s = "";
484
+ var endPos = str.length;
485
+ var i = 0;
486
+ var j = 0;
487
+ do {
488
+ i = str.indexOf(strSrc, j);
489
+ if (-1 != i && i < endPos) {
490
+ if (i != j)
491
+ s += str.slice(j, i);
492
+ s += strDest;
493
+ j = i + strSrc.length;
494
+ } else {
495
+ s += str.slice(j);
496
+ break;
497
+ }
498
+ } while (i < endPos);
499
+ return s;
500
+ };
501
+ exports.utf8ToBytes = function(str) {
502
+ if (!str) {
503
+ return new Array();
504
+ }
505
+ var bytes = new Array();
506
+ var c;
507
+ for (var i = 0; i < str.length; i++) {
508
+ c = str.charCodeAt(i);
509
+ if (c >= 55296 && c <= 56319) {
510
+ var next = str.charCodeAt(i + 1);
511
+ if (next >= 56320 && next <= 57343) {
512
+ c = 65536 + (c - 55296 << 10) + (next - 56320);
513
+ i++;
514
+ }
515
+ }
516
+ if (c <= 127) {
517
+ bytes.push(c & 255);
518
+ } else if (c <= 2047) {
519
+ bytes.push(c >> 6 & 31 | 192);
520
+ bytes.push(c & 63 | 128);
521
+ } else if (c <= 65535) {
522
+ bytes.push(c >> 12 & 15 | 224);
523
+ bytes.push(c >> 6 & 63 | 128);
524
+ bytes.push(c & 63 | 128);
525
+ } else {
526
+ bytes.push(c >> 18 & 7 | 240);
527
+ bytes.push(c >> 12 & 63 | 128);
528
+ bytes.push(c >> 6 & 63 | 128);
529
+ bytes.push(c & 63 | 128);
530
+ }
531
+ }
532
+ return bytes;
533
+ };
534
+ exports.bytesToUtf8 = function(utf8Bytes) {
535
+ var unicodeStr = "";
536
+ for (var pos = 0; pos < utf8Bytes.length; ) {
537
+ var flag = utf8Bytes[pos];
538
+ var unicode = 0;
539
+ if (flag >>> 7 === 0) {
540
+ unicodeStr += String.fromCharCode(utf8Bytes[pos]);
541
+ pos += 1;
542
+ } else if ((flag & 252) === 252) {
543
+ unicode = (utf8Bytes[pos] & 3) << 30;
544
+ unicode |= (utf8Bytes[pos + 1] & 63) << 24;
545
+ unicode |= (utf8Bytes[pos + 2] & 63) << 18;
546
+ unicode |= (utf8Bytes[pos + 3] & 63) << 12;
547
+ unicode |= (utf8Bytes[pos + 4] & 63) << 6;
548
+ unicode |= utf8Bytes[pos + 5] & 63;
549
+ unicodeStr += String.fromCharCode(unicode);
550
+ pos += 6;
551
+ } else if ((flag & 248) === 248) {
552
+ unicode = (utf8Bytes[pos] & 7) << 24;
553
+ unicode |= (utf8Bytes[pos + 1] & 63) << 18;
554
+ unicode |= (utf8Bytes[pos + 2] & 63) << 12;
555
+ unicode |= (utf8Bytes[pos + 3] & 63) << 6;
556
+ unicode |= utf8Bytes[pos + 4] & 63;
557
+ unicodeStr += String.fromCharCode(unicode);
558
+ pos += 5;
559
+ } else if ((flag & 240) === 240) {
560
+ unicode = (utf8Bytes[pos] & 15) << 18;
561
+ unicode |= (utf8Bytes[pos + 1] & 63) << 12;
562
+ unicode |= (utf8Bytes[pos + 2] & 63) << 6;
563
+ unicode |= utf8Bytes[pos + 3] & 63;
564
+ if (unicode > 65535) {
565
+ unicode -= 65536;
566
+ unicodeStr += String.fromCharCode(55296 + (unicode >> 10), 56320 + (unicode & 1023));
567
+ } else {
568
+ unicodeStr += String.fromCharCode(unicode);
569
+ }
570
+ pos += 4;
571
+ } else if ((flag & 224) === 224) {
572
+ unicode = (utf8Bytes[pos] & 31) << 12;
573
+ ;
574
+ unicode |= (utf8Bytes[pos + 1] & 63) << 6;
575
+ unicode |= utf8Bytes[pos + 2] & 63;
576
+ unicodeStr += String.fromCharCode(unicode);
577
+ pos += 3;
578
+ } else if ((flag & 192) === 192) {
579
+ unicode = (utf8Bytes[pos] & 63) << 6;
580
+ unicode |= utf8Bytes[pos + 1] & 63;
581
+ unicodeStr += String.fromCharCode(unicode);
582
+ pos += 2;
583
+ } else {
584
+ unicodeStr += String.fromCharCode(utf8Bytes[pos]);
585
+ pos += 1;
586
+ }
587
+ }
588
+ return unicodeStr;
589
+ };
590
+ exports.utf8Encode = function utf8Encode(str) {
591
+ var x, y, output = "", i = -1, l;
592
+ if (str && str.length) {
593
+ l = str.length;
594
+ while ((i += 1) < l) {
595
+ x = str.charCodeAt(i);
596
+ y = i + 1 < l ? str.charCodeAt(i + 1) : 0;
597
+ if (55296 <= x && x <= 56319 && 56320 <= y && y <= 57343) {
598
+ x = 65536 + ((x & 1023) << 10) + (y & 1023);
599
+ i += 1;
600
+ }
601
+ if (x <= 127) {
602
+ output += String.fromCharCode(x);
603
+ } else if (x <= 2047) {
604
+ output += String.fromCharCode(
605
+ 192 | x >>> 6 & 31,
606
+ 128 | x & 63
607
+ );
608
+ } else if (x <= 65535) {
609
+ output += String.fromCharCode(
610
+ 224 | x >>> 12 & 15,
611
+ 128 | x >>> 6 & 63,
612
+ 128 | x & 63
613
+ );
614
+ } else if (x <= 2097151) {
615
+ output += String.fromCharCode(
616
+ 240 | x >>> 18 & 7,
617
+ 128 | x >>> 12 & 63,
618
+ 128 | x >>> 6 & 63,
619
+ 128 | x & 63
620
+ );
621
+ }
622
+ }
623
+ }
624
+ return output;
625
+ };
626
+ exports.utf8Decode = function utf8Decode(str) {
627
+ var i, ac, c1, c2, c3, arr = [], l;
628
+ i = ac = c1 = c2 = c3 = 0;
629
+ if (str && str.length) {
630
+ l = str.length;
631
+ str += "";
632
+ while (i < l) {
633
+ c1 = str.charCodeAt(i);
634
+ ac += 1;
635
+ if (c1 < 128) {
636
+ arr[ac] = String.fromCharCode(c1);
637
+ i += 1;
638
+ } else if (c1 > 191 && c1 < 224) {
639
+ c2 = str.charCodeAt(i + 1);
640
+ arr[ac] = String.fromCharCode((c1 & 31) << 6 | c2 & 63);
641
+ i += 2;
642
+ } else {
643
+ c2 = str.charCodeAt(i + 1);
644
+ c3 = str.charCodeAt(i + 2);
645
+ arr[ac] = String.fromCharCode((c1 & 15) << 12 | (c2 & 63) << 6 | c3 & 63);
646
+ i += 3;
647
+ }
648
+ }
649
+ }
650
+ return arr.join("");
651
+ };
652
+ exports.trim = function(str) {
653
+ if (!str)
654
+ return str;
655
+ return str.replace(/(^\s*)|(\s*$)/g, "");
656
+ };
657
+ exports.escapeHtml = function(str) {
658
+ if (str) {
659
+ str = exports.replace(str, "&", "&amp;");
660
+ str = exports.replace(str, "<", "&lt;");
661
+ str = exports.replace(str, ">", "&gt;");
662
+ str = exports.replace(str, " ", "&nbsp;");
663
+ str = exports.replace(str, '"', "&quot;");
664
+ }
665
+ return str || "";
666
+ };
283
667
  }
284
- return unicodeStr;
285
- };
286
-
287
- exports.utf8Encode = function utf8Encode(str) {
288
- var x,
289
- y,
290
- output = '',
291
- i = -1,
292
- l;
293
-
294
- if (str && str.length) {
295
- l = str.length;
296
- while ((i += 1) < l) {
297
- /* Decode utf-16 surrogate pairs */
298
- x = str.charCodeAt(i);
299
- y = i + 1 < l ? str.charCodeAt(i + 1) : 0;
300
- if (0xD800 <= x && x <= 0xDBFF && 0xDC00 <= y && y <= 0xDFFF) {
301
- x = 0x10000 + ((x & 0x03FF) << 10) + (y & 0x03FF);
302
- i += 1;
668
+ });
669
+
670
+ // common/crypt.js
671
+ var require_crypt = __commonJS({
672
+ "common/crypt.js"(exports) {
673
+ var utilsString = require_string();
674
+ var crc32_table = [0, 1996959894, 3993919788, 2567524794, 124634137, 1886057615, 3915621685, 2657392035, 249268274, 2044508324, 3772115230, 2547177864, 162941995, 2125561021, 3887607047, 2428444049, 498536548, 1789927666, 4089016648, 2227061214, 450548861, 1843258603, 4107580753, 2211677639, 325883990, 1684777152, 4251122042, 2321926636, 335633487, 1661365465, 4195302755, 2366115317, 997073096, 1281953886, 3579855332, 2724688242, 1006888145, 1258607687, 3524101629, 2768942443, 901097722, 1119000684, 3686517206, 2898065728, 853044451, 1172266101, 3705015759, 2882616665, 651767980, 1373503546, 3369554304, 3218104598, 565507253, 1454621731, 3485111705, 3099436303, 671266974, 1594198024, 3322730930, 2970347812, 795835527, 1483230225, 3244367275, 3060149565, 1994146192, 31158534, 2563907772, 4023717930, 1907459465, 112637215, 2680153253, 3904427059, 2013776290, 251722036, 2517215374, 3775830040, 2137656763, 141376813, 2439277719, 3865271297, 1802195444, 476864866, 2238001368, 4066508878, 1812370925, 453092731, 2181625025, 4111451223, 1706088902, 314042704, 2344532202, 4240017532, 1658658271, 366619977, 2362670323, 4224994405, 1303535960, 984961486, 2747007092, 3569037538, 1256170817, 1037604311, 2765210733, 3554079995, 1131014506, 879679996, 2909243462, 3663771856, 1141124467, 855842277, 2852801631, 3708648649, 1342533948, 654459306, 3188396048, 3373015174, 1466479909, 544179635, 3110523913, 3462522015, 1591671054, 702138776, 2966460450, 3352799412, 1504918807, 783551873, 3082640443, 3233442989, 3988292384, 2596254646, 62317068, 1957810842, 3939845945, 2647816111, 81470997, 1943803523, 3814918930, 2489596804, 225274430, 2053790376, 3826175755, 2466906013, 167816743, 2097651377, 4027552580, 2265490386, 503444072, 1762050814, 4150417245, 2154129355, 426522225, 1852507879, 4275313526, 2312317920, 282753626, 1742555852, 4189708143, 2394877945, 397917763, 1622183637, 3604390888, 2714866558, 953729732, 1340076626, 3518719985, 2797360999, 1068828381, 1219638859, 3624741850, 2936675148, 906185462, 1090812512, 3747672003, 2825379669, 829329135, 1181335161, 3412177804, 3160834842, 628085408, 1382605366, 3423369109, 3138078467, 570562233, 1426400815, 3317316542, 2998733608, 733239954, 1555261956, 3268935591, 3050360625, 752459403, 1541320221, 2607071920, 3965973030, 1969922972, 40735498, 2617837225, 3943577151, 1913087877, 83908371, 2512341634, 3803740692, 2075208622, 213261112, 2463272603, 3855990285, 2094854071, 198958881, 2262029012, 4057260610, 1759359992, 534414190, 2176718541, 4139329115, 1873836001, 414664567, 2282248934, 4279200368, 1711684554, 285281116, 2405801727, 4167216745, 1634467795, 376229701, 2685067896, 3608007406, 1308918612, 956543938, 2808555105, 3495958263, 1231636301, 1047427035, 2932959818, 3654703836, 1088359270, 936918e3, 2847714899, 3736837829, 1202900863, 817233897, 3183342108, 3401237130, 1404277552, 615818150, 3134207493, 3453421203, 1423857449, 601450431, 3009837614, 3294710456, 1567103746, 711928724, 3020668471, 3272380065, 1510334235, 755167117];
675
+ exports.crc32_table = crc32_table;
676
+ exports.base64_encode = function(arrByte) {
677
+ if (!arrByte) {
678
+ return "";
303
679
  }
304
- /* Encode output as utf-8 */
305
- if (x <= 0x7F) {
306
- output += String.fromCharCode(x);
307
- } else if (x <= 0x7FF) {
308
- output += String.fromCharCode(0xC0 | x >>> 6 & 0x1F, 0x80 | x & 0x3F);
309
- } else if (x <= 0xFFFF) {
310
- output += String.fromCharCode(0xE0 | x >>> 12 & 0x0F, 0x80 | x >>> 6 & 0x3F, 0x80 | x & 0x3F);
311
- } else if (x <= 0x1FFFFF) {
312
- output += String.fromCharCode(0xF0 | x >>> 18 & 0x07, 0x80 | x >>> 12 & 0x3F, 0x80 | x >>> 6 & 0x3F, 0x80 | x & 0x3F);
680
+ if (typeof arrByte === "string") {
681
+ arrByte = utilsString.utf8ToBytes(arrByte);
313
682
  }
314
- }
683
+ var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
684
+ var out, i, len;
685
+ var c1, c2, c3;
686
+ len = arrByte.length;
687
+ i = 0;
688
+ out = "";
689
+ while (i < len) {
690
+ c1 = arrByte[i++] & 255;
691
+ if (i == len) {
692
+ out += base64EncodeChars.charAt(c1 >> 2);
693
+ out += base64EncodeChars.charAt((c1 & 3) << 4);
694
+ out += "==";
695
+ break;
696
+ }
697
+ c2 = arrByte[i++];
698
+ if (i == len) {
699
+ out += base64EncodeChars.charAt(c1 >> 2);
700
+ out += base64EncodeChars.charAt((c1 & 3) << 4 | (c2 & 240) >> 4);
701
+ out += base64EncodeChars.charAt((c2 & 15) << 2);
702
+ out += "=";
703
+ break;
704
+ }
705
+ c3 = arrByte[i++];
706
+ out += base64EncodeChars.charAt(c1 >> 2);
707
+ out += base64EncodeChars.charAt((c1 & 3) << 4 | (c2 & 240) >> 4);
708
+ out += base64EncodeChars.charAt((c2 & 15) << 2 | (c3 & 192) >> 6);
709
+ out += base64EncodeChars.charAt(c3 & 63);
710
+ }
711
+ return out;
712
+ };
315
713
  }
316
- return output;
317
- };
318
-
319
- exports.utf8Decode = function utf8Decode(str) {
320
- var i,
321
- ac,
322
- c1,
323
- c2,
324
- c3,
325
- arr = [],
326
- l;
327
- i = ac = c1 = c2 = c3 = 0;
328
-
329
- if (str && str.length) {
330
- l = str.length;
331
- str += '';
332
-
333
- while (i < l) {
334
- c1 = str.charCodeAt(i);
335
- ac += 1;
336
- if (c1 < 128) {
337
- arr[ac] = String.fromCharCode(c1);
338
- i += 1;
339
- } else if (c1 > 191 && c1 < 224) {
340
- c2 = str.charCodeAt(i + 1);
341
- arr[ac] = String.fromCharCode((c1 & 31) << 6 | c2 & 63);
342
- i += 2;
343
- } else {
344
- c2 = str.charCodeAt(i + 1);
345
- c3 = str.charCodeAt(i + 2);
346
- arr[ac] = String.fromCharCode((c1 & 15) << 12 | (c2 & 63) << 6 | c3 & 63);
347
- i += 3;
714
+ });
715
+
716
+ // libs/crypt.js
717
+ var require_crypt2 = __commonJS({
718
+ "libs/crypt.js"(exports) {
719
+ var crypt2 = require_crypt();
720
+ function crc32(str, crc) {
721
+ if (!crc) crc = 0;
722
+ crc = crc ^ -1;
723
+ for (var i = 0, iTop = str.length; i < iTop; i++) {
724
+ crc = crc >>> 8 ^ crypt2.crc32_table[(crc ^ str.charCodeAt(i)) & 255];
348
725
  }
726
+ return crc ^ -1;
349
727
  }
350
- }
351
- return arr.join('');
352
- };
353
-
354
- exports.trim = function (str) {
355
- if (!str) return str;
356
-
357
- return str.replace(/(^\s*)|(\s*$)/g, "");
358
- };
359
-
360
- /**
361
- * @desc: 对字符串中的 <>空格"& 标签进行转义为 &lt;, &gt;
362
- * @return: string.
363
- */
364
- exports.escapeHtml = function (str) {
365
- // 转义.
366
- if (str) {
367
- str = exports.replace(str, '&', '&amp;');
368
- str = exports.replace(str, '<', '&lt;');
369
- str = exports.replace(str, '>', '&gt;');
370
- str = exports.replace(str, ' ', '&nbsp;');
371
- str = exports.replace(str, '"', '&quot;');
372
- }
373
- return str || '';
374
- };
375
-
376
- /***/ }),
377
- /* 1 */
378
- /***/ (function(module, exports, __webpack_require__) {
379
-
380
- "use strict";
381
-
382
-
383
- /**
384
- * Copyright (c) 2017 Copyright brainpoint All Rights Reserved.
385
- * Author: lipengxiang
386
- * Desc:
387
- */
388
-
389
- var PromiseLib = Promise;
390
-
391
- /**
392
- * @desc: 判断是否是有效时间.
393
- */
394
- exports.isValidate = function (date /*:Date*/) /*:boolean*/{
395
- if (isNaN(date) || !date || date.toString() == 'Invalid Date') return false;
396
- return date instanceof Date;
397
- };
398
-
399
- /**
400
- * @desc: 获取时间的string.
401
- * @param time: ms.
402
- * @param fmt: 格式化, 默认为 'HH:mm:ss'
403
- * 年(y)、月(M)、日(d)、12小时(h)、24小时(H)、分(m)、秒(s)、周(E)、季度(q)
404
- * 'yyyy-MM-dd hh:mm:ss.S' ==> 2006-07-02 08:09:04.423
405
- * 'yyyy-MM-dd E HH:mm:ss' ==> 2009-03-10 星期二 20:09:04
406
- * 'yyyy-M-d h:m:s.S' ==> 2006-7-2 8:9:4.18
407
- * @param weekFmt: 星期的文字格式, 默认为 {'0':'星期天', '1': '星期一', ..., '6':'星期六'}
408
- * @return: string.
409
- */
410
- function getTimeString(time, fmt, weekFmt) {
411
- if (typeof time !== "number") return "";
412
-
413
- fmt = fmt || 'HH:mm:ss';
414
-
415
- var t = new Date(time);
416
- var o = {
417
- "M+": t.getMonth() + 1, //月份
418
- "d+": t.getDate(), //日
419
- "h+": t.getHours() % 12 == 0 ? 12 : t.getHours() % 12, //小时
420
- "H+": t.getHours(), //小时
421
- "m+": t.getMinutes(), //分
422
- "s+": t.getSeconds(), //秒
423
- "q+": Math.floor((t.getMonth() + 3) / 3), //季度
424
- "S": t.getMilliseconds() //毫秒
425
- };
426
- var week = weekFmt || {
427
- "0": "星期天",
428
- "1": "星期一",
429
- "2": "星期二",
430
- "3": "星期三",
431
- "4": "星期四",
432
- "5": "星期五",
433
- "6": "星期六"
434
- };
435
- if (/(y+)/.test(fmt)) {
436
- fmt = fmt.replace(RegExp.$1, (t.getFullYear() + "").substr(4 - RegExp.$1.length));
437
- }
438
- if (/(E+)/.test(fmt)) {
439
- fmt = fmt.replace(RegExp.$1, week[t.getDay() + ""]);
440
- }
441
- for (var k in o) {
442
- if (new RegExp("(" + k + ")").test(fmt)) {
443
- fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
728
+ exports.crc32 = crc32;
729
+ function crc32_fileSegment(file, offset, length, cb) {
730
+ if (!file || !cb) {
731
+ if (cb) cb(0);
732
+ return;
733
+ }
734
+ if (offset >= file.size || offset < 0 || length == 0) {
735
+ if (cb) cb(0);
736
+ return;
737
+ }
738
+ if (length < 0) {
739
+ length = file.size;
740
+ }
741
+ var blobSlice = File.prototype.mozSlice || File.prototype.webkitSlice || File.prototype.slice;
742
+ var fileReader = new FileReader();
743
+ if (file.size - offset < length) {
744
+ length = file.size - offset;
745
+ }
746
+ var chunkSize = 1024 * 1024 * 2;
747
+ var chunks = Math.ceil(length / chunkSize);
748
+ var currentChunk = 0;
749
+ var loadNext = function() {
750
+ var start = currentChunk * chunkSize + offset, end = start + chunkSize >= length + offset ? length + offset : start + chunkSize;
751
+ fileReader.readAsBinaryString(blobSlice.call(file, start, end));
752
+ };
753
+ var crc = 0;
754
+ fileReader.onload = function(e) {
755
+ crc = crc32(e.target.result, crc);
756
+ currentChunk++;
757
+ if (currentChunk < chunks) {
758
+ loadNext();
759
+ } else {
760
+ cb(crc);
761
+ }
762
+ };
763
+ loadNext();
444
764
  }
765
+ exports.crc32_fileSegment = crc32_fileSegment;
766
+ exports.crc32_file = function(file, cb) {
767
+ crc32_fileSegment(file, 0, file.size, cb);
768
+ };
769
+ exports.base64_encode = crypt2.base64_encode;
770
+ exports.base64_decode = function(strBase64) {
771
+ var c1, c2, c3, c4;
772
+ var base64DecodeChars = new Array(
773
+ -1,
774
+ -1,
775
+ -1,
776
+ -1,
777
+ -1,
778
+ -1,
779
+ -1,
780
+ -1,
781
+ -1,
782
+ -1,
783
+ -1,
784
+ -1,
785
+ -1,
786
+ -1,
787
+ -1,
788
+ -1,
789
+ -1,
790
+ -1,
791
+ -1,
792
+ -1,
793
+ -1,
794
+ -1,
795
+ -1,
796
+ -1,
797
+ -1,
798
+ -1,
799
+ -1,
800
+ -1,
801
+ -1,
802
+ -1,
803
+ -1,
804
+ -1,
805
+ -1,
806
+ -1,
807
+ -1,
808
+ -1,
809
+ -1,
810
+ -1,
811
+ -1,
812
+ -1,
813
+ -1,
814
+ -1,
815
+ -1,
816
+ 62,
817
+ -1,
818
+ -1,
819
+ -1,
820
+ 63,
821
+ 52,
822
+ 53,
823
+ 54,
824
+ 55,
825
+ 56,
826
+ 57,
827
+ 58,
828
+ 59,
829
+ 60,
830
+ 61,
831
+ -1,
832
+ -1,
833
+ -1,
834
+ -1,
835
+ -1,
836
+ -1,
837
+ -1,
838
+ 0,
839
+ 1,
840
+ 2,
841
+ 3,
842
+ 4,
843
+ 5,
844
+ 6,
845
+ 7,
846
+ 8,
847
+ 9,
848
+ 10,
849
+ 11,
850
+ 12,
851
+ 13,
852
+ 14,
853
+ 15,
854
+ 16,
855
+ 17,
856
+ 18,
857
+ 19,
858
+ 20,
859
+ 21,
860
+ 22,
861
+ 23,
862
+ 24,
863
+ 25,
864
+ -1,
865
+ -1,
866
+ -1,
867
+ -1,
868
+ -1,
869
+ -1,
870
+ 26,
871
+ 27,
872
+ 28,
873
+ 29,
874
+ 30,
875
+ 31,
876
+ 32,
877
+ 33,
878
+ 34,
879
+ 35,
880
+ 36,
881
+ 37,
882
+ 38,
883
+ 39,
884
+ 40,
885
+ 41,
886
+ 42,
887
+ 43,
888
+ 44,
889
+ 45,
890
+ 46,
891
+ 47,
892
+ 48,
893
+ 49,
894
+ 50,
895
+ 51,
896
+ -1,
897
+ -1,
898
+ -1,
899
+ -1,
900
+ -1
901
+ );
902
+ var i = 0, len = strBase64.length, out = [];
903
+ while (i < len) {
904
+ do {
905
+ c1 = base64DecodeChars[strBase64.charCodeAt(i++) & 255];
906
+ } while (i < len && c1 == -1);
907
+ if (c1 == -1) break;
908
+ do {
909
+ c2 = base64DecodeChars[strBase64.charCodeAt(i++) & 255];
910
+ } while (i < len && c2 == -1);
911
+ if (c2 == -1) break;
912
+ out.push(c1 << 2 | (c2 & 48) >> 4);
913
+ do {
914
+ c3 = strBase64.charCodeAt(i++) & 255;
915
+ if (c3 == 61)
916
+ return out;
917
+ c3 = base64DecodeChars[c3];
918
+ } while (i < len && c3 == -1);
919
+ if (c3 == -1) break;
920
+ out.push((c2 & 15) << 4 | (c3 & 60) >> 2);
921
+ do {
922
+ c4 = strBase64.charCodeAt(i++) & 255;
923
+ if (c4 == 61) return out;
924
+ c4 = base64DecodeChars[c4];
925
+ } while (i < len && c4 == -1);
926
+ if (c4 == -1) break;
927
+ out.push((c3 & 3) << 6 | c4);
928
+ }
929
+ return out;
930
+ };
931
+ exports.uuid = function() {
932
+ var s = [];
933
+ var hexDigits = "0123456789abcdef";
934
+ for (var i = 0; i < 36; i++) {
935
+ s[i] = hexDigits.substr(Math.floor(Math.random() * 16), 1);
936
+ }
937
+ s[14] = "4";
938
+ s[19] = hexDigits.substr(s[19] & 3 | 8, 1);
939
+ s[8] = s[13] = s[18] = s[23] = "-";
940
+ var uuid = s.join("");
941
+ return uuid;
942
+ };
445
943
  }
446
- return fmt;
447
- };
448
- exports.getTimeString = getTimeString;
449
-
450
- /**
451
- * @desc: 获取指定时间距离现在的时间描述.
452
- * 例如, 昨天, 1小时前等.
453
- * @param time: ms. 小于当前时间, 大于当前时间将显示为 '刚刚';
454
- * @param strFmt: 需要显示的文字.
455
- * 默认为 {
456
- * now: '刚刚', // 3秒钟以内将显示此信息.
457
- * second: '秒前',
458
- * minute: '分钟前',
459
- * hour: '小时前',
460
- * day_yesterday: '昨天',
461
- * day: '天前',
462
- * month: '个月前', // 6个月内将显示此信息.
463
- * time: 'yyyy-M-d h:m:s' // 超过6个月将使用此格式格式化时间
464
- * }
465
- * @return: string.
466
- */
467
- exports.getTimeStringFromNow = function (time, strFmt) {
468
- strFmt = strFmt || {};
469
- strFmt.now = strFmt.now || '刚刚';
470
- strFmt.second = strFmt.second || '秒前';
471
- strFmt.minute = strFmt.minute || '分钟前';
472
- strFmt.hour = strFmt.hour || '小时前';
473
- strFmt.day_yesterday = strFmt.day_yesterday || '昨天';
474
- strFmt.day = strFmt.day || '天前';
475
- strFmt.month = strFmt.month || '个月前';
476
- strFmt.time = strFmt.time || 'yyyy-M-d h:m:s';
477
-
478
- var now = Math.ceil(Date.now() / 1000);
479
- time = Math.ceil(time / 1000);
480
-
481
- if (now > time) {
482
- var s = now - time;
483
- if (s < 3) {
484
- return strFmt.now;
944
+ });
945
+
946
+ // libs/crypt.md5.js
947
+ var require_crypt_md5 = __commonJS({
948
+ "libs/crypt.md5.js"(exports) {
949
+ var stringUtils = require_string();
950
+ function binl2rstr(input) {
951
+ var i, l = input.length * 32, output = "";
952
+ for (i = 0; i < l; i += 8) {
953
+ output += String.fromCharCode(input[i >> 5] >>> i % 32 & 255);
954
+ }
955
+ return output;
485
956
  }
486
-
487
- if (s < 60) {
488
- return s.toString() + strFmt.second;
957
+ function bit_rol(num, cnt) {
958
+ return num << cnt | num >>> 32 - cnt;
489
959
  }
490
-
491
- if (s < 60 * 60) {
492
- return Math.ceil(s / 60).toString() + strFmt.minute;
960
+ function rstr2binl(input) {
961
+ var i, l = input.length * 8, output = Array(input.length >> 2), lo = output.length;
962
+ for (i = 0; i < lo; i += 1) {
963
+ output[i] = 0;
964
+ }
965
+ for (i = 0; i < l; i += 8) {
966
+ output[i >> 5] |= (input.charCodeAt(i / 8) & 255) << i % 32;
967
+ }
968
+ return output;
493
969
  }
494
-
495
- if (s < 60 * 60 * 24) {
496
- return Math.ceil(s / 60 / 60).toString() + strFmt.hour;
970
+ function safe_add(x, y) {
971
+ var lsw = (x & 65535) + (y & 65535), msw = (x >> 16) + (y >> 16) + (lsw >> 16);
972
+ return msw << 16 | lsw & 65535;
497
973
  }
498
-
499
- if (s < 60 * 60 * 24 * 30) {
500
- var dNow = new Date(now * 1000);
501
-
502
- dNow.setHours(0, 0, 1);
503
- if (dNow.getTime() - time <= 60 * 60 * 24) {
504
- return strFmt.day_yesterday;
974
+ function hex(s) {
975
+ var input = binl2rstr(binl(rstr2binl(s), s.length * 8));
976
+ var hex_tab = "0123456789abcdef", output = "", x, i = 0, l = input.length;
977
+ for (; i < l; i += 1) {
978
+ x = input.charCodeAt(i);
979
+ output += hex_tab.charAt(x >>> 4 & 15) + hex_tab.charAt(x & 15);
505
980
  }
506
-
507
- return Math.ceil(s / 60 / 60 / 24).toString() + strFmt.day;
981
+ return output;
508
982
  }
509
-
510
- if (s < 60 * 60 * 24 * 30 * 6) {
511
- return Math.ceil(s / 60 / 60 / 24 / 30).toString() + strFmt.month;
983
+ function binl(x, len) {
984
+ var i, olda, oldb, oldc, oldd, a = 1732584193, b = -271733879, c = -1732584194, d = 271733878;
985
+ x[len >> 5] |= 128 << len % 32;
986
+ x[(len + 64 >>> 9 << 4) + 14] = len;
987
+ for (i = 0; i < x.length; i += 16) {
988
+ olda = a;
989
+ oldb = b;
990
+ oldc = c;
991
+ oldd = d;
992
+ a = md5_ff(a, b, c, d, x[i + 0], 7, -680876936);
993
+ d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586);
994
+ c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819);
995
+ b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330);
996
+ a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897);
997
+ d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426);
998
+ c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341);
999
+ b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983);
1000
+ a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416);
1001
+ d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417);
1002
+ c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);
1003
+ b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);
1004
+ a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682);
1005
+ d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);
1006
+ c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);
1007
+ b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329);
1008
+ a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510);
1009
+ d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632);
1010
+ c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713);
1011
+ b = md5_gg(b, c, d, a, x[i + 0], 20, -373897302);
1012
+ a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691);
1013
+ d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083);
1014
+ c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);
1015
+ b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848);
1016
+ a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438);
1017
+ d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690);
1018
+ c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961);
1019
+ b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501);
1020
+ a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467);
1021
+ d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784);
1022
+ c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473);
1023
+ b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);
1024
+ a = md5_hh(a, b, c, d, x[i + 5], 4, -378558);
1025
+ d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463);
1026
+ c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562);
1027
+ b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);
1028
+ a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060);
1029
+ d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353);
1030
+ c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632);
1031
+ b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);
1032
+ a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174);
1033
+ d = md5_hh(d, a, b, c, x[i + 0], 11, -358537222);
1034
+ c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979);
1035
+ b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189);
1036
+ a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487);
1037
+ d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);
1038
+ c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520);
1039
+ b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651);
1040
+ a = md5_ii(a, b, c, d, x[i + 0], 6, -198630844);
1041
+ d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415);
1042
+ c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);
1043
+ b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055);
1044
+ a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571);
1045
+ d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606);
1046
+ c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);
1047
+ b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799);
1048
+ a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359);
1049
+ d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);
1050
+ c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380);
1051
+ b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649);
1052
+ a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070);
1053
+ d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);
1054
+ c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259);
1055
+ b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551);
1056
+ a = safe_add(a, olda);
1057
+ b = safe_add(b, oldb);
1058
+ c = safe_add(c, oldc);
1059
+ d = safe_add(d, oldd);
1060
+ }
1061
+ return Array(a, b, c, d);
512
1062
  }
513
-
514
- return getTimeString(time, strFmt.time);
515
- }
516
-
517
- return strFmt.now;
518
- };
519
-
520
- /**
521
- * @desc: 通过字符串获取date. getTime('2012-05-09 11:10:12')
522
- * @param strTime: 时间字符串. '2012-05-09 11:10:12'
523
- * @return: Date.
524
- */
525
- exports.getTime = function (strTime) {
526
- var date = new Date();
527
- date.setFullYear(parseInt(strTime.substr(0, 4)), parseInt(strTime.substr(5, 2), 10) - 1, parseInt(strTime.substr(8, 2)));
528
- date.setHours(parseInt(strTime.substr(11, 2)) || 0, parseInt(strTime.substr(14, 2)) || 0, parseInt(strTime.substr(17, 2)) || 0, 0);
529
- return date;
530
- };
531
-
532
- /**
533
- * @desc: 通过时间获取date. getTime2('20120509111012')
534
- * @param strTime: 时间字符串. '20120509111012'
535
- * @return: Date.
536
- */
537
- exports.getTime2 = function (strTime) {
538
- var date = new Date();
539
-
540
- date.setFullYear(parseInt(strTime.substr(0, 4)), parseInt(strTime.substr(4, 2), 10) - 1, parseInt(strTime.substr(6, 2)));
541
- date.setHours(parseInt(strTime.substr(8, 2)) || 0, parseInt(strTime.substr(10, 2)) || 0, parseInt(strTime.substr(12, 2)) || 0, 0);
542
-
543
- return date;
544
- };
545
-
546
- /**
547
- * @desc: getDate('2012-05-09')
548
- * @return: Date.
549
- */
550
- exports.getDate = function (strDate) {
551
- var date = new Date(parseInt(strDate.substr(0, 4)), parseInt(strDate.substr(5, 2), 10) - 1, parseInt(strDate.substr(8, 2)));
552
- return date;
553
- };
554
-
555
- /**
556
- * @desc: getDate2('20120509')
557
- * @return: Date.
558
- */
559
- exports.getDate2 = function (strDate) {
560
- var date = new Date(parseInt(strDate.substr(0, 4)), parseInt(strDate.substr(4, 2), 10) - 1, parseInt(strDate.substr(6, 2)));
561
- return date;
562
- };
563
-
564
- /**
565
- * @desc: 获取时间的协调世界时间 string.
566
- * @param time: ms. (本地时间)
567
- * @param fmt: 格式化, 默认为 'HH:mm:ss'
568
- * 年(y)、月(M)、日(d)、12小时(h)、24小时(H)、分(m)、秒(s)、周(E)、季度(q)
569
- * 'yyyy-MM-dd hh:mm:ss.S' ==> 2006-07-02 08:09:04.423
570
- * 'yyyy-MM-dd E HH:mm:ss' ==> 2009-03-10 星期二 20:09:04
571
- * 'yyyy-M-d h:m:s.S' ==> 2006-7-2 8:9:4.18
572
- * @param weekFmt: 星期的文字格式, 默认为 {'0':'星期天', '1': '星期一', ..., '6':'星期六'}
573
- * @return: string.
574
- */
575
- exports.getUTCTimeString = function (time, fmt, weekFmt) {
576
- if (typeof time !== "number") return "";
577
-
578
- fmt = fmt || 'HH:mm:ss';
579
-
580
- var t = new Date(time);
581
- var o = {
582
- "M+": t.getUTCMonth() + 1, //月份
583
- "d+": t.getUTCDate(), //日
584
- "h+": t.getUTCHours() % 12 == 0 ? 12 : t.getUTCHours() % 12, //小时
585
- "H+": t.getUTCHours(), //小时
586
- "m+": t.getUTCMinutes(), //分
587
- "s+": t.getUTCSeconds(), //秒
588
- "q+": Math.floor((t.getUTCMonth() + 3) / 3), //季度
589
- "S": t.getUTCMilliseconds() //毫秒
590
- };
591
- var week = weekFmt || {
592
- "0": "星期天",
593
- "1": "星期一",
594
- "2": "星期二",
595
- "3": "星期三",
596
- "4": "星期四",
597
- "5": "星期五",
598
- "6": "星期六"
599
- };
600
- if (/(y+)/.test(fmt)) {
601
- fmt = fmt.replace(RegExp.$1, (t.getUTCFullYear() + "").substr(4 - RegExp.$1.length));
602
- }
603
- if (/(E+)/.test(fmt)) {
604
- fmt = fmt.replace(RegExp.$1, week[t.getUTCDay() + ""]);
605
- }
606
- for (var k in o) {
607
- if (new RegExp("(" + k + ")").test(fmt)) {
608
- fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
1063
+ function md5_cmn(q, a, b, x, s, t) {
1064
+ return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);
1065
+ }
1066
+ function md5_ff(a, b, c, d, x, s, t) {
1067
+ return md5_cmn(b & c | ~b & d, a, b, x, s, t);
1068
+ }
1069
+ function md5_gg(a, b, c, d, x, s, t) {
1070
+ return md5_cmn(b & d | c & ~d, a, b, x, s, t);
1071
+ }
1072
+ function md5_hh(a, b, c, d, x, s, t) {
1073
+ return md5_cmn(b ^ c ^ d, a, b, x, s, t);
609
1074
  }
1075
+ function md5_ii(a, b, c, d, x, s, t) {
1076
+ return md5_cmn(c ^ (b | ~d), a, b, x, s, t);
1077
+ }
1078
+ exports.md5 = function(str) {
1079
+ return hex(stringUtils.utf8Encode(str));
1080
+ };
610
1081
  }
611
- return fmt;
612
- };
613
-
614
- /**
615
- * @desc: 通过世界时间获取date. getDateFromUTC('2012-05-09')
616
- * @param strDateUTC: 世界日期字符串. '2012-05-09'
617
- * @return: Date.
618
- */
619
- exports.getDateFromUTC = function (strDateUTC) {
620
- var date = new Date();
621
- date.setUTCFullYear(parseInt(strDateUTC.substr(0, 4)), parseInt(strDateUTC.substr(5, 2), 10) - 1, parseInt(strDateUTC.substr(8, 2)));
622
- date.setUTCHours(0, 0, 0, 0);
623
- return date;
624
- };
625
-
626
- /**
627
- * @desc: 通过世界时间获取date. getDate2FromUTC('20120509')
628
- * @param strDateUTC: 世界日期字符串. '20120509'
629
- * @return: Date.
630
- */
631
- exports.getDate2FromUTC = function (strDateUTC) {
632
- var date = new Date();
633
-
634
- date.setUTCFullYear(parseInt(strDateUTC.substr(0, 4)), parseInt(strDateUTC.substr(4, 2), 10) - 1, parseInt(strDateUTC.substr(6, 2)));
635
- date.setUTCHours(0, 0, 0, 0);
636
-
637
- return date;
638
- };
639
-
640
- /**
641
- * @desc: 通过世界时间获取date. getTimeFromUTC('2012-05-09 11:10:12')
642
- * @param strTimeUTC: 世界时间字符串. '2012-05-09 11:10:12'
643
- * @return: Date.
644
- */
645
- exports.getTimeFromUTC = function (strTimeUTC) {
646
- var date = new Date();
647
- date.setUTCFullYear(parseInt(strTimeUTC.substr(0, 4)), parseInt(strTimeUTC.substr(5, 2), 10) - 1, parseInt(strTimeUTC.substr(8, 2)));
648
- date.setUTCHours(parseInt(strTimeUTC.substr(11, 2)) || 0, parseInt(strTimeUTC.substr(14, 2)) || 0, parseInt(strTimeUTC.substr(17, 2)) || 0, 0);
649
- return date;
650
- };
651
-
652
- /**
653
- * @desc: 通过世界时间获取date. getTime2FromUTC('20120509111012')
654
- * @param strTimeUTC: 世界日期字符串. '20120509111012'
655
- * @return: Date.
656
- */
657
- exports.getTime2FromUTC = function (strTimeUTC) {
658
- var date = new Date();
659
-
660
- date.setUTCFullYear(parseInt(strTimeUTC.substr(0, 4)), parseInt(strTimeUTC.substr(4, 2), 10) - 1, parseInt(strTimeUTC.substr(6, 2)));
661
- date.setUTCHours(parseInt(strTimeUTC.substr(8, 2)) || 0, parseInt(strTimeUTC.substr(10, 2)) || 0, parseInt(strTimeUTC.substr(12, 2)) || 0, 0);
662
-
663
- return date;
664
- };
665
-
666
- /***/ }),
667
- /* 2 */
668
- /***/ (function(module, exports, __webpack_require__) {
669
-
670
- "use strict";
671
-
672
-
673
- /**
674
- * Copyright (c) 2017 Copyright brainpoint All Rights Reserved.
675
- * Author: lipengxiang
676
- * Desc:
677
- */
678
-
679
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
680
-
681
- var _createClass = function () {
682
- function defineProperties(target, props) {
683
- for (var i = 0; i < props.length; i++) {
684
- var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);
685
- }
686
- }return function (Constructor, protoProps, staticProps) {
687
- if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;
688
- };
689
- }();
690
-
691
- function _classCallCheck(instance, Constructor) {
692
- if (!(instance instanceof Constructor)) {
693
- throw new TypeError("Cannot call a class as a function");
694
- }
695
- }
696
-
697
- function _possibleConstructorReturn(self, call) {
698
- if (!self) {
699
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
700
- }return call && ((typeof call === "undefined" ? "undefined" : _typeof(call)) === "object" || typeof call === "function") ? call : self;
701
- }
702
-
703
- function _inherits(subClass, superClass) {
704
- if (typeof superClass !== "function" && superClass !== null) {
705
- throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : _typeof(superClass)));
706
- }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
707
- }
708
-
709
- module.exports = function (_Error) {
710
- _inherits(_class, _Error);
711
-
712
- /**
713
- * @desc: 构造异常对象.
714
- * @param msg: 异常消息
715
- * @param code: 异常代码
716
- * @param filename: 异常文件名
717
- * @param line: 异常文件所在行
718
- * @param column: 异常文件所在列
719
- * @return:
720
- */
721
- function _class(msg, code, filename, line, column) {
722
- _classCallCheck(this, _class);
723
-
724
- var _this = _possibleConstructorReturn(this, _Error.call(this, code + " " + msg));
725
-
726
- _this.__tag = 'febs.exception';
727
- _this.code = code;
728
- _this.msg = msg;
729
- _this.filename = filename;
730
- _this.line = line;
731
- _this.column = column || 0;
732
- return _this;
733
- }
734
-
735
- /**
736
- * 判断是否是febs.exception异常实例.
737
- */
738
-
739
- _class.isInstance = function isInstance(e) {
740
- return e && e.__tag === 'febs.exception';
741
- };
742
-
743
- /**
744
- * @desc: 一般错误.
745
- */
746
-
747
- _createClass(_class, null, [{
748
- key: 'ERROR',
749
- get: function get() {
750
- return "error";
1082
+ });
1083
+
1084
+ // libs/crypt.sha1.js
1085
+ var require_crypt_sha1 = __commonJS({
1086
+ "libs/crypt.sha1.js"(exports) {
1087
+ var stringUtils = require_string();
1088
+ function binb2rstr(input) {
1089
+ var i, l = input.length * 32, output = "";
1090
+ for (i = 0; i < l; i += 8) {
1091
+ output += String.fromCharCode(input[i >> 5] >>> 24 - i % 32 & 255);
1092
+ }
1093
+ return output;
751
1094
  }
752
-
753
- /**
754
- * @desc: 参数错误.
755
- */
756
-
757
- }, {
758
- key: 'PARAM',
759
- get: function get() {
760
- return "param error";
1095
+ function bit_rol(num, cnt) {
1096
+ return num << cnt | num >>> 32 - cnt;
761
1097
  }
762
-
763
- /**
764
- * @desc: 越界
765
- * @return:
766
- */
767
-
768
- }, {
769
- key: 'OUT_OF_RANGE',
770
- get: function get() {
771
- return "out of range";
1098
+ function safe_add(x, y) {
1099
+ var lsw = (x & 65535) + (y & 65535), msw = (x >> 16) + (y >> 16) + (lsw >> 16);
1100
+ return msw << 16 | lsw & 65535;
772
1101
  }
773
- }]);
774
-
775
- return _class;
776
- }(Error);
777
-
778
- /***/ }),
779
- /* 3 */
780
- /***/ (function(module, exports, __webpack_require__) {
781
-
782
- "use strict";
783
-
784
-
785
- (function () {
786
- if (typeof Promise.prototype['finally'] === 'function') {
787
- return;
788
- }
789
- Promise.prototype['finally'] = function (fn) {
790
- return this.then(function (value) {
791
- return this.constructor.resolve(fn()).then(function () {
792
- return value;
793
- });
794
- })['catch'](function (reason) {
795
- return this.constructor.resolve(fn()).then(function () {
796
- throw reason;
797
- });
798
- });
799
- };
800
- })();
801
-
802
- /***/ }),
803
- /* 4 */
804
- /***/ (function(module, exports, __webpack_require__) {
805
-
806
- "use strict";
807
-
808
-
809
- /**
810
- * Copyright (c) 2017 Copyright brainpoint All Rights Reserved.
811
- * Author: lipengxiang
812
- * Desc:
813
- * crc32(str, crc=null);
814
- * crc32_file(file, function(crc32Value) {})
815
- */
816
-
817
- var crypt = __webpack_require__(12);
818
-
819
- /**
820
- * @desc: 计算字符串的crc32值
821
- * @param crc: 可以在这个值得基础上继续计算
822
- * @return: number.
823
- */
824
- function crc32( /* String */str, /* Number */crc) {
825
- if (!crc) crc = 0;
826
- crc = crc ^ -1;
827
-
828
- for (var i = 0, iTop = str.length; i < iTop; i++) {
829
- crc = crc >>> 8 ^ crypt.crc32_table[(crc ^ str.charCodeAt(i)) & 0xFF];
830
- }
831
- return crc ^ -1;
832
- }
833
- exports.crc32 = crc32;
834
-
835
- /**
836
- * @desc:
837
- * @param cb: cb(crc32)
838
- * @return:
839
- */
840
- function crc32_fileSegment(file, offset, length, cb) {
841
- if (!file || !cb) {
842
- if (cb) cb(0);
843
- return;
1102
+ function sha1_ft(t, b, c, d) {
1103
+ if (t < 20) {
1104
+ return b & c | ~b & d;
1105
+ }
1106
+ if (t < 40) {
1107
+ return b ^ c ^ d;
1108
+ }
1109
+ if (t < 60) {
1110
+ return b & c | b & d | c & d;
1111
+ }
1112
+ return b ^ c ^ d;
844
1113
  }
845
-
846
- if (offset >= file.size || offset < 0 || length == 0) {
847
- if (cb) cb(0);
848
- return;
1114
+ function sha1_kt(t) {
1115
+ return t < 20 ? 1518500249 : t < 40 ? 1859775393 : t < 60 ? -1894007588 : -899497514;
849
1116
  }
850
-
851
- if (length < 0) {
852
- length = file.size;
1117
+ function rstr2binb(input) {
1118
+ var i, l = input.length * 8, output = Array(input.length >> 2), lo = output.length;
1119
+ for (i = 0; i < lo; i += 1) {
1120
+ output[i] = 0;
1121
+ }
1122
+ for (i = 0; i < l; i += 8) {
1123
+ output[i >> 5] |= (input.charCodeAt(i / 8) & 255) << 24 - i % 32;
1124
+ }
1125
+ return output;
853
1126
  }
854
-
855
- var blobSlice = File.prototype.mozSlice || File.prototype.webkitSlice || File.prototype.slice;
856
- var fileReader = new FileReader();
857
-
858
- if (file.size - offset < length) {
859
- length = file.size - offset;
1127
+ function hex(s) {
1128
+ var input = binb2rstr(binb(rstr2binb(s), s.length * 8));
1129
+ var hex_tab = "0123456789abcdef", output = "", x, i = 0, l = input.length;
1130
+ for (; i < l; i += 1) {
1131
+ x = input.charCodeAt(i);
1132
+ output += hex_tab.charAt(x >>> 4 & 15) + hex_tab.charAt(x & 15);
1133
+ }
1134
+ return output;
860
1135
  }
861
-
862
- var chunkSize = 1024 * 1024 * 2;
863
- var chunks = Math.ceil(length / chunkSize);
864
- var currentChunk = 0;
865
-
866
- var loadNext = function loadNext() {
867
- var start = currentChunk * chunkSize + offset,
868
- end = start + chunkSize >= length + offset ? length + offset : start + chunkSize;
869
- fileReader.readAsBinaryString(blobSlice.call(file, start, end));
870
- };
871
-
872
- var crc = 0;
873
-
874
- //每块文件读取完毕之后的处理.
875
- fileReader.onload = function (e) {
876
- crc = crc32(e.target.result, crc);
877
- // append binary string
878
- currentChunk++;
879
-
880
- if (currentChunk < chunks) {
881
- loadNext();
882
- } else {
883
- cb(crc);
1136
+ function binb(x, len) {
1137
+ var i, j, t, olda, oldb, oldc, oldd, olde, w = Array(80), a = 1732584193, b = -271733879, c = -1732584194, d = 271733878, e = -1009589776;
1138
+ x[len >> 5] |= 128 << 24 - len % 32;
1139
+ x[(len + 64 >> 9 << 4) + 15] = len;
1140
+ for (i = 0; i < x.length; i += 16) {
1141
+ olda = a;
1142
+ oldb = b;
1143
+ oldc = c;
1144
+ oldd = d;
1145
+ olde = e;
1146
+ for (j = 0; j < 80; j += 1) {
1147
+ if (j < 16) {
1148
+ w[j] = x[i + j];
1149
+ } else {
1150
+ w[j] = bit_rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1);
1151
+ }
1152
+ t = safe_add(
1153
+ safe_add(bit_rol(a, 5), sha1_ft(j, b, c, d)),
1154
+ safe_add(safe_add(e, w[j]), sha1_kt(j))
1155
+ );
1156
+ e = d;
1157
+ d = c;
1158
+ c = bit_rol(b, 30);
1159
+ b = a;
1160
+ a = t;
884
1161
  }
885
- };
886
-
887
- loadNext();
888
- }
889
- exports.crc32_fileSegment = crc32_fileSegment;
890
-
891
- /**
892
- * @desc:
893
- * @param cb: cb(crc32)
894
- * @return:
895
- */
896
- exports.crc32_file = function (file, cb) {
897
- crc32_fileSegment(file, 0, file.size, cb);
898
- };
899
-
900
- /**
901
- * @desc: base64编码.
902
- * @param arrByte: 字节数组.
903
- * @return: string.
904
- */
905
- exports.base64_encode = crypt.base64_encode;
906
-
907
- /**
908
- * @desc: base64解码.
909
- * @return: 字节数组.
910
- */
911
- exports.base64_decode = function (strBase64) {
912
- var c1, c2, c3, c4;
913
- var base64DecodeChars = new Array(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1);
914
- var i = 0,
915
- len = strBase64.length,
916
- out = [];
917
-
918
- while (i < len) {
919
- do {
920
- c1 = base64DecodeChars[strBase64.charCodeAt(i++) & 0xff];
921
- } while (i < len && c1 == -1);
922
-
923
- if (c1 == -1) break;
924
-
925
- do {
926
- c2 = base64DecodeChars[strBase64.charCodeAt(i++) & 0xff];
927
- } while (i < len && c2 == -1);
928
-
929
- if (c2 == -1) break;
930
-
931
- out.push(c1 << 2 | (c2 & 0x30) >> 4);
932
-
933
- do {
934
- c3 = strBase64.charCodeAt(i++) & 0xff;
935
- if (c3 == 61) return out;
936
-
937
- c3 = base64DecodeChars[c3];
938
- } while (i < len && c3 == -1);
939
-
940
- if (c3 == -1) break;
941
-
942
- out.push((c2 & 0XF) << 4 | (c3 & 0x3C) >> 2);
943
-
944
- do {
945
- c4 = strBase64.charCodeAt(i++) & 0xff;
946
- if (c4 == 61) return out;
947
- c4 = base64DecodeChars[c4];
948
- } while (i < len && c4 == -1);
949
-
950
- if (c4 == -1) break;
951
-
952
- out.push((c3 & 0x03) << 6 | c4);
953
- }
954
- return out;
955
- };
956
-
957
- /**
958
- * @desc: 生成一个uuid (v4 random).
959
- * @return:
960
- */
961
- exports.uuid = function () {
962
- var s = [];
963
- var hexDigits = "0123456789abcdef";
964
- for (var i = 0; i < 36; i++) {
965
- s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
966
- }
967
- s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010
968
- s[19] = hexDigits.substr(s[19] & 0x3 | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
969
- s[8] = s[13] = s[18] = s[23] = "-";
970
-
971
- var uuid = s.join("");
972
- return uuid;
973
- };
974
-
975
- /***/ }),
976
- /* 5 */
977
- /***/ (function(module, exports, __webpack_require__) {
978
-
979
- "use strict";
980
-
981
-
982
- /**
983
- * Copyright (c) 2017 Copyright brainpoint All Rights Reserved.
984
- * Author: lipengxiang
985
- * Desc:
986
- */
987
-
988
- var stringUtils = __webpack_require__(0);
989
-
990
- function binl2rstr(input) {
991
- var i,
992
- l = input.length * 32,
993
- output = '';
994
- for (i = 0; i < l; i += 8) {
995
- output += String.fromCharCode(input[i >> 5] >>> i % 32 & 0xFF);
996
- }
997
- return output;
998
- }
999
-
1000
- function bit_rol(num, cnt) {
1001
- return num << cnt | num >>> 32 - cnt;
1002
- }
1003
-
1004
- function rstr2binl(input) {
1005
- var i,
1006
- l = input.length * 8,
1007
- output = Array(input.length >> 2),
1008
- lo = output.length;
1009
- for (i = 0; i < lo; i += 1) {
1010
- output[i] = 0;
1011
- }
1012
- for (i = 0; i < l; i += 8) {
1013
- output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << i % 32;
1014
- }
1015
- return output;
1016
- }
1017
-
1018
- function safe_add(x, y) {
1019
- var lsw = (x & 0xFFFF) + (y & 0xFFFF),
1020
- msw = (x >> 16) + (y >> 16) + (lsw >> 16);
1021
- return msw << 16 | lsw & 0xFFFF;
1022
- }
1023
-
1024
- function hex(s) {
1025
- var input = binl2rstr(binl(rstr2binl(s), s.length * 8));
1026
- var hex_tab = '0123456789abcdef',
1027
- output = '',
1028
- x,
1029
- i = 0,
1030
- l = input.length;
1031
- for (; i < l; i += 1) {
1032
- x = input.charCodeAt(i);
1033
- output += hex_tab.charAt(x >>> 4 & 0x0f) + hex_tab.charAt(x & 0x0f);
1034
- }
1035
- return output;
1036
- }
1037
-
1038
- /**
1039
- * Calculate the MD5 of an array of little-endian words, and a bit length.
1040
- */
1041
-
1042
- function binl(x, len) {
1043
- var i,
1044
- olda,
1045
- oldb,
1046
- oldc,
1047
- oldd,
1048
- a = 1732584193,
1049
- b = -271733879,
1050
- c = -1732584194,
1051
- d = 271733878;
1052
-
1053
- /* append padding */
1054
- x[len >> 5] |= 0x80 << len % 32;
1055
- x[(len + 64 >>> 9 << 4) + 14] = len;
1056
-
1057
- for (i = 0; i < x.length; i += 16) {
1058
- olda = a;
1059
- oldb = b;
1060
- oldc = c;
1061
- oldd = d;
1062
-
1063
- a = md5_ff(a, b, c, d, x[i + 0], 7, -680876936);
1064
- d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586);
1065
- c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819);
1066
- b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330);
1067
- a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897);
1068
- d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426);
1069
- c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341);
1070
- b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983);
1071
- a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416);
1072
- d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417);
1073
- c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);
1074
- b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);
1075
- a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682);
1076
- d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);
1077
- c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);
1078
- b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329);
1079
-
1080
- a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510);
1081
- d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632);
1082
- c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713);
1083
- b = md5_gg(b, c, d, a, x[i + 0], 20, -373897302);
1084
- a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691);
1085
- d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083);
1086
- c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);
1087
- b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848);
1088
- a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438);
1089
- d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690);
1090
- c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961);
1091
- b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501);
1092
- a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467);
1093
- d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784);
1094
- c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473);
1095
- b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);
1096
-
1097
- a = md5_hh(a, b, c, d, x[i + 5], 4, -378558);
1098
- d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463);
1099
- c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562);
1100
- b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);
1101
- a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060);
1102
- d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353);
1103
- c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632);
1104
- b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);
1105
- a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174);
1106
- d = md5_hh(d, a, b, c, x[i + 0], 11, -358537222);
1107
- c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979);
1108
- b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189);
1109
- a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487);
1110
- d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);
1111
- c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520);
1112
- b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651);
1113
-
1114
- a = md5_ii(a, b, c, d, x[i + 0], 6, -198630844);
1115
- d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415);
1116
- c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);
1117
- b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055);
1118
- a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571);
1119
- d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606);
1120
- c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);
1121
- b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799);
1122
- a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359);
1123
- d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);
1124
- c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380);
1125
- b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649);
1126
- a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070);
1127
- d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);
1128
- c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259);
1129
- b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551);
1130
-
1131
- a = safe_add(a, olda);
1132
- b = safe_add(b, oldb);
1133
- c = safe_add(c, oldc);
1134
- d = safe_add(d, oldd);
1135
- }
1136
- return Array(a, b, c, d);
1137
- }
1138
-
1139
- /**
1140
- * These functions implement the four basic operations the algorithm uses.
1141
- */
1142
-
1143
- function md5_cmn(q, a, b, x, s, t) {
1144
- return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);
1145
- }
1146
-
1147
- function md5_ff(a, b, c, d, x, s, t) {
1148
- return md5_cmn(b & c | ~b & d, a, b, x, s, t);
1149
- }
1150
-
1151
- function md5_gg(a, b, c, d, x, s, t) {
1152
- return md5_cmn(b & d | c & ~d, a, b, x, s, t);
1153
- }
1154
-
1155
- function md5_hh(a, b, c, d, x, s, t) {
1156
- return md5_cmn(b ^ c ^ d, a, b, x, s, t);
1157
- }
1158
-
1159
- function md5_ii(a, b, c, d, x, s, t) {
1160
- return md5_cmn(c ^ (b | ~d), a, b, x, s, t);
1161
- }
1162
-
1163
- exports.md5 = function (str) {
1164
- return hex(stringUtils.utf8Encode(str));
1165
- };
1166
-
1167
- /***/ }),
1168
- /* 6 */
1169
- /***/ (function(module, exports, __webpack_require__) {
1170
-
1171
- "use strict";
1172
-
1173
-
1174
- /**
1175
- * Copyright (c) 2017 Copyright brainpoint All Rights Reserved.
1176
- * Author: lipengxiang
1177
- * Desc:
1178
- */
1179
-
1180
- var stringUtils = __webpack_require__(0);
1181
-
1182
- function binb2rstr(input) {
1183
- var i,
1184
- l = input.length * 32,
1185
- output = '';
1186
- for (i = 0; i < l; i += 8) {
1187
- output += String.fromCharCode(input[i >> 5] >>> 24 - i % 32 & 0xff);
1188
- }
1189
- return output;
1190
- }
1191
-
1192
- function bit_rol(num, cnt) {
1193
- return num << cnt | num >>> 32 - cnt;
1194
- }
1195
-
1196
- function safe_add(x, y) {
1197
- var lsw = (x & 0xffff) + (y & 0xffff),
1198
- msw = (x >> 16) + (y >> 16) + (lsw >> 16);
1199
- return msw << 16 | lsw & 0xffff;
1200
- }
1201
-
1202
- function sha1_ft(t, b, c, d) {
1203
- if (t < 20) {
1204
- return b & c | ~b & d;
1205
- }
1206
- if (t < 40) {
1207
- return b ^ c ^ d;
1208
- }
1209
- if (t < 60) {
1210
- return b & c | b & d | c & d;
1211
- }
1212
- return b ^ c ^ d;
1213
- }
1214
-
1215
- function sha1_kt(t) {
1216
- return t < 20 ? 1518500249 : t < 40 ? 1859775393 : t < 60 ? -1894007588 : -899497514;
1217
- }
1218
-
1219
- function rstr2binb(input) {
1220
- var i,
1221
- l = input.length * 8,
1222
- output = Array(input.length >> 2),
1223
- lo = output.length;
1224
- for (i = 0; i < lo; i += 1) {
1225
- output[i] = 0;
1226
- }
1227
- for (i = 0; i < l; i += 8) {
1228
- output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << 24 - i % 32;
1229
- }
1230
- return output;
1231
- }
1232
-
1233
- function hex(s) {
1234
- var input = binb2rstr(binb(rstr2binb(s), s.length * 8));
1235
- var hex_tab = '0123456789abcdef',
1236
- output = '',
1237
- x,
1238
- i = 0,
1239
- l = input.length;
1240
- for (; i < l; i += 1) {
1241
- x = input.charCodeAt(i);
1242
- output += hex_tab.charAt(x >>> 4 & 0x0f) + hex_tab.charAt(x & 0x0f);
1243
- }
1244
- return output;
1245
- }
1246
-
1247
- function binb(x, len) {
1248
- var i,
1249
- j,
1250
- t,
1251
- olda,
1252
- oldb,
1253
- oldc,
1254
- oldd,
1255
- olde,
1256
- w = Array(80),
1257
- a = 1732584193,
1258
- b = -271733879,
1259
- c = -1732584194,
1260
- d = 271733878,
1261
- e = -1009589776;
1262
-
1263
- /* append padding */
1264
- x[len >> 5] |= 0x80 << 24 - len % 32;
1265
- x[(len + 64 >> 9 << 4) + 15] = len;
1266
-
1267
- for (i = 0; i < x.length; i += 16) {
1268
- olda = a;
1269
- oldb = b;
1270
- oldc = c;
1271
- oldd = d;
1272
- olde = e;
1273
-
1274
- for (j = 0; j < 80; j += 1) {
1275
- if (j < 16) {
1276
- w[j] = x[i + j];
1277
- } else {
1278
- w[j] = bit_rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1);
1162
+ a = safe_add(a, olda);
1163
+ b = safe_add(b, oldb);
1164
+ c = safe_add(c, oldc);
1165
+ d = safe_add(d, oldd);
1166
+ e = safe_add(e, olde);
1279
1167
  }
1280
- t = safe_add(safe_add(bit_rol(a, 5), sha1_ft(j, b, c, d)), safe_add(safe_add(e, w[j]), sha1_kt(j)));
1281
- e = d;
1282
- d = c;
1283
- c = bit_rol(b, 30);
1284
- b = a;
1285
- a = t;
1168
+ return Array(a, b, c, d, e);
1286
1169
  }
1287
-
1288
- a = safe_add(a, olda);
1289
- b = safe_add(b, oldb);
1290
- c = safe_add(c, oldc);
1291
- d = safe_add(d, oldd);
1292
- e = safe_add(e, olde);
1293
- }
1294
- return Array(a, b, c, d, e);
1295
- }
1296
-
1297
- exports.sha1 = function (str) {
1298
- return hex(stringUtils.utf8Encode(str));
1299
- };
1300
-
1301
- /***/ }),
1302
- /* 7 */
1303
- /***/ (function(module, exports, __webpack_require__) {
1304
-
1305
- "use strict";
1306
-
1307
-
1308
- /**
1309
- * Copyright (c) 2017 Copyright tj All Rights Reserved.
1310
- * Author: lipengxiang
1311
- * Date: 2018-06-02 17:39
1312
- * Desc:
1313
- */
1314
-
1315
- var date = __webpack_require__(1);
1316
-
1317
- exports.isValidate = date.isValidate;
1318
- exports.getDate = date.getDate;
1319
- exports.getDate2 = date.getDate2;
1320
- exports.getDate2FromUTC = date.getDate2FromUTC;
1321
- exports.getDateFromUTC = date.getDateFromUTC;
1322
- exports.getTime2FromUTC = date.getTime2FromUTC;
1323
- exports.getTimeString = date.getTimeString;
1324
- exports.getUTCTimeString = date.getUTCTimeString;
1325
- exports.getTimeStringFromNow = date.getTimeStringFromNow;
1326
- exports.getTimeFromUTC = date.getTimeFromUTC;
1327
- exports.getTime = date.getTime;
1328
- exports.getTime2 = date.getTime2;
1329
-
1330
- /***/ }),
1331
- /* 8 */
1332
- /***/ (function(module, exports, __webpack_require__) {
1333
-
1334
- "use strict";
1335
-
1336
-
1337
- /**
1338
- * Copyright (c) 2017 Copyright brainpoint All Rights Reserved.
1339
- * Author: lipengxiang
1340
- * Desc:
1341
- */
1342
-
1343
- var string = __webpack_require__(0);
1344
-
1345
- /**
1346
- * @desc: 判断是否是手机号码.
1347
- * @return: boolean.
1348
- */
1349
- exports.isPhoneMobile = string.isPhoneMobile;
1350
-
1351
- /**
1352
- * @desc: 是否为空串.
1353
- * @return: boolean.
1354
- */
1355
- exports.isEmpty = string.isEmpty;
1356
-
1357
- /**
1358
- * @desc: 判断是否是email.
1359
- * @return: boolean.
1360
- */
1361
- exports.isEmail = string.isEmail;
1362
-
1363
- /**
1364
- * @desc: 判断是否是英文数字组合.
1365
- * @return: boolean.
1366
- */
1367
- exports.isAlphaOrDigit = string.isAlphaOrDigit;
1368
-
1369
- /**
1370
- * @desc: 判断是否是中文.
1371
- * @return: boolean.
1372
- */
1373
- exports.isChinese = string.isChinese;
1374
-
1375
- /**
1376
- * @desc: 获得字符串utf8编码后的字节长度.
1377
- * @return: u32.
1378
- */
1379
- exports.getByteSize = string.getByteSize;
1380
-
1381
- /**
1382
- * @desc: 替换字符串中所有的strSrc->strDest.
1383
- * @return: string.
1384
- */
1385
- exports.replace = string.replace;
1386
-
1387
- exports.utf8ToBytes = string.utf8ToBytes;
1388
- exports.bytesToUtf8 = string.bytesToUtf8;
1389
-
1390
- exports.utf8Encode = string.utf8Encode;
1391
- exports.utf8Decode = string.utf8Decode;
1392
-
1393
- exports.trim = string.trim;
1394
-
1395
- /**
1396
- * @desc: 对字符串中的 <> 标签进行转义为 &lt;, &gt;
1397
- * @return: string.
1398
- */
1399
- exports.escapeHtml = string.escapeHtml;
1400
-
1401
- /***/ }),
1402
- /* 9 */
1403
- /***/ (function(module, exports) {
1404
-
1405
- var g;
1406
-
1407
- // This works in non-strict mode
1408
- g = (function() {
1409
- return this;
1410
- })();
1411
-
1412
- try {
1413
- // This works if eval is allowed (see CSP)
1414
- g = g || Function("return this")() || (1,eval)("this");
1415
- } catch(e) {
1416
- // This works if the window reference is available
1417
- if(typeof window === "object")
1418
- g = window;
1419
- }
1420
-
1421
- // g can still be undefined, but nothing to do about it...
1422
- // We return undefined, instead of nothing here, so it's
1423
- // easier to handle this case. if(!global) { ...}
1424
-
1425
- module.exports = g;
1426
-
1427
-
1428
- /***/ }),
1429
- /* 10 */
1430
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1431
-
1432
- "use strict";
1433
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
1434
- /* harmony export (immutable) */ __webpack_exports__["fetch"] = fetch;
1435
- /**
1436
- * Copyright (c) 2017 Copyright brainpoint All Rights Reserved.
1437
- * Author: lipengxiang
1438
- * Desc:
1439
- */
1440
-
1441
-
1442
- class FetchResponse {
1443
- constructor(data, headers, status) {
1444
- this.data = data;
1445
- this.headers = headers;
1446
- this.status = status;
1447
- }
1448
- get statusText() { return this.status.toString(); }
1449
- blob() {
1450
- return new Promise((resolve, reject)=>{
1451
- reject(new Error('unsupport fetch.blob'));
1452
- });
1453
- }
1454
-
1455
- json() {
1456
- return new Promise((resolve, reject) => {
1457
- let data;
1458
- try {
1459
- data = JSON.parse(this.data);
1460
- } catch (e) {
1461
- reject(e);
1462
- return;
1463
- }
1464
- resolve(data);
1465
- });
1466
- }
1467
-
1468
- text() {
1469
- return new Promise((resolve, reject)=>{
1470
- resolve(this.data);
1471
- });
1170
+ exports.sha1 = function(str) {
1171
+ return hex(stringUtils.utf8Encode(str));
1172
+ };
1472
1173
  }
1473
- }
1474
-
1475
- function fetch(url, option/*: {
1476
- method?: string, // 请求方法 get, post, delete 等.
1477
- mode?: string | 'no-cors' | 'cors' | 'same-origin', // 'no-cors', 'same-origin'等; (可忽略)
1478
- headers?: any, // 请求header, 例如:
1479
- // {
1480
- // "Content-Type": "application/json",
1481
- // "Accept": 'application/json',
1482
- // }
1483
- body?: string, // 请求内容.
1484
- timeout?: number, // 超时 (ms), 默认为5000,
1485
- credentials?: 'include' | null | undefined, // 携带了credentials='include'则服务器需设置Access-Control-Allow-Credentials
1486
- }*/) /*: Promise<any>*/ {
1487
-
1488
- option = option||{};
1489
-
1490
- return new Promise((resolve, reject)=>{
1174
+ });
1175
+
1176
+ // wxmini/libs/fetch.js
1177
+ var fetch_exports = {};
1178
+ __export(fetch_exports, {
1179
+ fetch: () => fetch
1180
+ });
1181
+ function fetch(url, option) {
1182
+ option = option || {};
1183
+ return new Promise((resolve, reject) => {
1491
1184
  wx.request({
1492
1185
  url,
1493
1186
  header: option.headers,
1494
1187
  timeout: option.timeout,
1495
1188
  data: option.body,
1496
- method: option.method?option.method.toUpperCase():undefined,
1497
- success: (res)=>{
1498
- resolve( new FetchResponse(res.data, res.header, res.status) );
1189
+ method: option.method ? option.method.toUpperCase() : void 0,
1190
+ success: (res) => {
1191
+ resolve(new FetchResponse(res.data, res.header, res.status));
1499
1192
  },
1500
1193
  fail: (err) => {
1501
1194
  reject(err);
1502
1195
  }
1503
- })
1196
+ });
1504
1197
  });
1505
1198
  }
1506
-
1507
- /***/ }),
1508
- /* 11 */
1509
- /***/ (function(module, exports, __webpack_require__) {
1510
-
1511
- "use strict";
1512
-
1513
-
1514
- /**
1515
- * Copyright (c) 2017 Copyright brainpoint All Rights Reserved.
1516
- * Author: lipengxiang
1517
- * Desc:
1518
- */
1519
-
1520
- var utils = __webpack_require__(13);
1521
-
1522
- /**
1523
- * @desc: 模拟sleep.
1524
- * @return: Promise.
1525
- * 在ms时间后执行.
1526
- * @e.g.
1527
- * febs.utils.sleep(1000).then(()=>{
1528
- //1000ms之后resolve.
1529
- });
1530
- */
1531
- exports.sleep = utils.sleep;
1532
-
1533
-
1534
- /**
1535
- * @desc: 获取时间的string.
1536
- * @param time: ms.
1537
- * @param fmt: 格式化, 默认为 'HH:mm:ss'
1538
- * 年(y)、月(M)、日(d)、12小时(h)、24小时(H)、分(m)、秒(s)、周(E)、季度(q)
1539
- * 'yyyy-MM-dd hh:mm:ss.S' ==> 2006-07-02 08:09:04.423
1540
- * 'yyyy-MM-dd E HH:mm:ss' ==> 2009-03-10 星期二 20:09:04
1541
- * 'yyyy-M-d h:m:s.S' ==> 2006-7-2 8:9:4.18
1542
- * @param weekFmt: 星期的文字格式, 默认为 {'0':'星期天', '1': '星期一', ..., '6':'星期六'}
1543
- * @return: string.
1544
- */
1545
- exports.getTimeString = utils.getTimeString;
1546
-
1547
- /**
1548
- * @desc: 获取指定时间距离现在的时间描述.
1549
- * 例如, 昨天, 1小时前等.
1550
- * @param time: ms. 小于当前时间, 大于当前时间将显示为 '刚刚';
1551
- * @param strFmt: 需要显示的文字.
1552
- * 默认为 {
1553
- * now: '刚刚', // 3秒钟以内将显示此信息.
1554
- * second: '秒前',
1555
- * minute: '分钟前',
1556
- * hour: '小时前',
1557
- * day_yesterday: '昨天',
1558
- * day: '天前',
1559
- * month: '个月前', // 6个月内将显示此信息.
1560
- * time: 'yyyy-M-d h:m:s' // 超过6个月将使用此格式格式化时间
1561
- * }
1562
- * @return: string.
1563
- */
1564
- exports.getTimeStringFromNow = utils.getTimeStringFromNow;
1565
-
1566
- /**
1567
- * @desc: getDate('2012-05-09')
1568
- * @return: Date.
1569
- */
1570
- exports.getDate = utils.getDate;
1571
-
1572
-
1573
- /**
1574
- * @desc: getDate2('20120509')
1575
- * @return: Date.
1576
- */
1577
- exports.getDate2 = utils.getDate2;
1578
-
1579
-
1580
- /**
1581
- * @desc: 合并多个map.
1582
- * @return: {}
1583
- */
1584
- exports.mergeMap = utils.mergeMap;
1585
-
1586
-
1587
- /**
1588
- * @desc: 判断参数是否是null,undefined,NaN
1589
- * @return: boolean
1590
- */
1591
- exports.isNull = utils.isNull;
1592
-
1593
- /**
1594
- * @desc: 创建promise,但函数中的this可以为指定值.
1595
- * 例如: yield denodeify(fs.exists)(path);
1596
- * @param self: 指定的对象.s
1597
- * @return: promise.
1598
- */
1599
- exports.denodeify = utils.denodeify;
1600
- exports.promisify = utils.promisify;
1601
-
1602
- /**
1603
- * @desc: 判断是否是ie.
1604
- */
1605
- exports.browserIsIE =
1606
- function () {
1607
- return false;
1608
- }
1609
-
1610
- /**
1611
- * @desc: 判断ie版本号.
1612
- * @return number. 非ie返回Number.MAX_SAFE_INTEGER.
1613
- * 如果是 edge 返回 'edge'
1614
- */
1615
- exports.browserIEVer =
1616
- function () {
1617
- return Number.MAX_SAFE_INTEGER;
1618
- }
1619
-
1620
-
1621
- /**
1622
- * @desc: the browser is support html5.
1623
- */
1624
- exports.browserIsSupportHtml5 =
1625
- function () {
1626
- if (typeof (Worker) !== "undefined") {
1627
- return true;
1628
- } else {
1629
- return false;
1630
- }
1631
- }
1632
-
1633
-
1634
- /**
1635
- * @desc: the browser is mobile.
1636
- * @param userAgent: the browser user agent string.
1637
- */
1638
- exports.browserIsMobile = function(userAgent) {
1639
- return true;
1640
- }
1641
-
1642
- /**
1643
- * @desc: the browser is ios.
1644
- */
1645
- exports.browserIsIOS = function() {
1646
- let systemInfo = wx.getSystemInfoSync();
1647
- if (systemInfo && systemInfo.platform == 'ios') {
1648
- return true;
1649
- }
1650
- return false;
1651
- }
1652
-
1653
-
1654
- /**
1655
- * @desc: the browser is phone.
1656
- * @param userAgent: the browser user agent string.
1657
- */
1658
- exports.browserIsPhone = function(userAgent) {
1659
-
1660
- let systemInfo = wx.getSystemInfoSync();
1661
- if (systemInfo && systemInfo.windowWidth <= 767) {
1662
- return true;
1663
- }
1664
- return false;
1665
- }
1666
-
1667
-
1668
- /**
1669
- * @desc: the browser is weixin.
1670
- */
1671
- exports.browserIsWeixin = function(userAgent) {
1672
- return true;
1673
- }
1674
-
1675
- /**
1676
- * @desc: the platform is Windows.
1677
- */
1678
- exports.platformIsWindows = function(userAgent) {
1679
- return false;
1680
- }
1681
-
1682
-
1683
- /**
1684
- * @desc: the platform is Mac.
1685
- */
1686
- exports.platformIsMac = function(userAgent) {
1687
- return false;
1688
- }
1689
-
1690
-
1691
- /***/ }),
1692
- /* 12 */
1693
- /***/ (function(module, exports, __webpack_require__) {
1694
-
1695
- "use strict";
1696
-
1697
-
1698
- /**
1699
- * Copyright (c) 2017 Copyright brainpoint All Rights Reserved.
1700
- * Author: lipengxiang
1701
- * Desc:
1702
- */
1703
-
1704
- var utilsString = __webpack_require__(0);
1705
-
1706
- var crc32_table = [0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D];
1707
- exports.crc32_table = crc32_table;
1708
-
1709
- /**
1710
- * @desc: base64编码.
1711
- * @param arrByte: 字节数组.
1712
- * @return: string.
1713
- */
1714
- exports.base64_encode = function (arrByte) {
1715
-
1716
- if (!arrByte) {
1717
- return '';
1199
+ var FetchResponse;
1200
+ var init_fetch = __esm({
1201
+ "wxmini/libs/fetch.js"() {
1202
+ FetchResponse = class {
1203
+ constructor(data, headers, status) {
1204
+ this.data = data;
1205
+ this.headers = headers;
1206
+ this.status = status;
1207
+ }
1208
+ get statusText() {
1209
+ return this.status.toString();
1210
+ }
1211
+ blob() {
1212
+ return new Promise((resolve, reject) => {
1213
+ reject(new Error("unsupport fetch.blob"));
1214
+ });
1215
+ }
1216
+ json() {
1217
+ return new Promise((resolve, reject) => {
1218
+ let data;
1219
+ try {
1220
+ data = JSON.parse(this.data);
1221
+ } catch (e) {
1222
+ reject(e);
1223
+ return;
1224
+ }
1225
+ resolve(data);
1226
+ });
1227
+ }
1228
+ text() {
1229
+ return new Promise((resolve, reject) => {
1230
+ resolve(this.data);
1231
+ });
1232
+ }
1233
+ };
1718
1234
  }
1719
-
1720
- if (typeof arrByte === 'string') {
1721
- arrByte = utilsString.utf8ToBytes(arrByte);
1235
+ });
1236
+
1237
+ // libs/date.js
1238
+ var require_date2 = __commonJS({
1239
+ "libs/date.js"(exports) {
1240
+ "use strict";
1241
+ var date2 = require_date();
1242
+ exports.isValidate = date2.isValidate;
1243
+ exports.getDate = date2.getDate;
1244
+ exports.getDate2 = date2.getDate2;
1245
+ exports.getDate2FromUTC = date2.getDate2FromUTC;
1246
+ exports.getDateFromUTC = date2.getDateFromUTC;
1247
+ exports.getTime2FromUTC = date2.getTime2FromUTC;
1248
+ exports.getTimeString = date2.getTimeString;
1249
+ exports.getUTCTimeString = date2.getUTCTimeString;
1250
+ exports.getTimeStringFromNow = date2.getTimeStringFromNow;
1251
+ exports.getTimeFromUTC = date2.getTimeFromUTC;
1252
+ exports.getTime = date2.getTime;
1253
+ exports.getTime2 = date2.getTime2;
1722
1254
  }
1723
-
1724
- var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
1725
- var out, i, len;
1726
- var c1, c2, c3;
1727
- len = arrByte.length;
1728
- i = 0;
1729
- out = "";
1730
- while (i < len) {
1731
- c1 = arrByte[i++] & 0xff;
1732
- if (i == len) {
1733
- out += base64EncodeChars.charAt(c1 >> 2);
1734
- out += base64EncodeChars.charAt((c1 & 0x3) << 4);
1735
- out += "==";
1736
- break;
1737
- }
1738
- c2 = arrByte[i++];
1739
- if (i == len) {
1740
- out += base64EncodeChars.charAt(c1 >> 2);
1741
- out += base64EncodeChars.charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4);
1742
- out += base64EncodeChars.charAt((c2 & 0xF) << 2);
1743
- out += "=";
1744
- break;
1745
- }
1746
- c3 = arrByte[i++];
1747
- out += base64EncodeChars.charAt(c1 >> 2);
1748
- out += base64EncodeChars.charAt((c1 & 0x3) << 4 | (c2 & 0xF0) >> 4);
1749
- out += base64EncodeChars.charAt((c2 & 0xF) << 2 | (c3 & 0xC0) >> 6);
1750
- out += base64EncodeChars.charAt(c3 & 0x3F);
1255
+ });
1256
+
1257
+ // libs/string.js
1258
+ var require_string2 = __commonJS({
1259
+ "libs/string.js"(exports) {
1260
+ "use strict";
1261
+ var string2 = require_string();
1262
+ exports.isPhoneMobile = string2.isPhoneMobile;
1263
+ exports.isEmpty = string2.isEmpty;
1264
+ exports.isEmail = string2.isEmail;
1265
+ exports.isAlphaOrDigit = string2.isAlphaOrDigit;
1266
+ exports.isChinese = string2.isChinese;
1267
+ exports.getByteSize = string2.getByteSize;
1268
+ exports.replace = string2.replace;
1269
+ exports.utf8ToBytes = string2.utf8ToBytes;
1270
+ exports.bytesToUtf8 = string2.bytesToUtf8;
1271
+ exports.utf8Encode = string2.utf8Encode;
1272
+ exports.utf8Decode = string2.utf8Decode;
1273
+ exports.trim = string2.trim;
1274
+ exports.escapeHtml = string2.escapeHtml;
1751
1275
  }
1752
- return out;
1753
- };
1754
-
1755
- /***/ }),
1756
- /* 13 */
1757
- /***/ (function(module, exports, __webpack_require__) {
1758
-
1759
- "use strict";
1760
-
1761
-
1762
- /**
1763
- * Copyright (c) 2017 Copyright brainpoint All Rights Reserved.
1764
- * Author: lipengxiang
1765
- * Desc:
1766
- */
1767
-
1768
- var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
1769
-
1770
- var _typeof = typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol" ? function (obj) {
1771
- return typeof obj === "undefined" ? "undefined" : _typeof2(obj);
1772
- } : function (obj) {
1773
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof2(obj);
1774
- };
1775
-
1776
- var PromiseLib = Promise;
1777
- var utilsDate = __webpack_require__(1);
1778
-
1779
- /**
1780
- * @desc: 模拟sleep.
1781
- * @return: Promise.
1782
- * 在ms时间后执行.
1783
- * @e.g.
1784
- * febs.utils.sleep(1000).then(()=>{
1785
- //1000ms之后resolve.
1786
- });
1787
- */
1788
- exports.sleep = function (ms) {
1789
- return new PromiseLib(function (resolve, reject) {
1790
- try {
1791
- setTimeout(function () {
1792
- resolve();
1793
- }, ms);
1794
- } catch (err) {
1795
- reject(err);
1796
- }
1797
- });
1798
- };
1799
-
1800
- /**
1801
- * @desc: 合并多个map (浅拷贝).
1802
- * @return: {}
1803
- */
1804
- exports.mergeMap = function () {
1805
- var map0 = {};
1806
- var map2;
1807
- for (var i = 0; i < arguments.length; i++) {
1808
- map2 = arguments[i];
1809
- if (map2) {
1810
- for (var k in map2) {
1811
- map0[k] = map2[k];
1276
+ });
1277
+
1278
+ // common/exception.js
1279
+ var require_exception = __commonJS({
1280
+ "common/exception.js"(exports, module2) {
1281
+ "use strict";
1282
+ module2.exports = class extends Error {
1283
+ /**
1284
+ * @desc: 构造异常对象.
1285
+ * @param msg: 异常消息
1286
+ * @param code: 异常代码
1287
+ * @param filename: 异常文件名
1288
+ * @param line: 异常文件所在行
1289
+ * @param column: 异常文件所在列
1290
+ * @return:
1291
+ */
1292
+ constructor(msg, code, filename, line, column) {
1293
+ super(code + " " + msg);
1294
+ this.__tag = "febs.exception";
1295
+ this.code = code;
1296
+ this.msg = msg;
1297
+ this.filename = filename;
1298
+ this.line = line;
1299
+ this.column = column || 0;
1812
1300
  }
1813
- }
1814
- }
1815
-
1816
- return map0;
1817
- };
1818
- /**
1819
- * @desc: 判断参数是否是null,undefined,NaN
1820
- * @return: boolean
1821
- */
1822
- exports.isNull = function (e) {
1823
- return e === null || e === undefined || Number.isNaN(e);
1824
- };
1825
-
1826
- /**
1827
- * date.
1828
- */
1829
- exports.getTimeString = utilsDate.getTimeString;
1830
- exports.getTimeStringFromNow = utilsDate.getTimeStringFromNow;
1831
- exports.getDate = utilsDate.getDate;
1832
- exports.getDate2 = utilsDate.getDate2;
1833
-
1834
- /**
1835
- * @desc: 创建promise,但函数中的this可以为指定值.
1836
- * 例如: yield denodeify(fs.exists)(path);
1837
- * @param self: 指定的对象.s
1838
- * @return: promise.
1839
- */
1840
- exports.denodeify = function (fn, self, argumentCount) {
1841
- argumentCount = argumentCount || Infinity;
1842
- return function () {
1843
- var args = Array.prototype.slice.call(arguments, 0, argumentCount > 0 ? argumentCount : 0);
1844
- return new PromiseLib(function (resolve, reject) {
1845
- args.push(function (err, res) {
1846
- if (err) reject(err);else resolve(res);
1847
- });
1848
- var res = fn.apply(self, args);
1849
- if (res && ((typeof res === 'undefined' ? 'undefined' : _typeof(res)) === 'object' || typeof res === 'function') && typeof res.then === 'function') {
1850
- resolve(res);
1301
+ /**
1302
+ * 判断是否是febs.exception异常实例.
1303
+ */
1304
+ static isInstance(e) {
1305
+ return e && e.__tag === "febs.exception";
1851
1306
  }
1852
- });
1853
- };
1854
- };
1855
-
1856
- exports.promisify = exports.denodeify;
1857
-
1858
- /***/ }),
1859
- /* 14 */
1860
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1861
-
1862
- "use strict";
1863
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
1864
- /* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__debug", function() { return __debug; });
1865
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "crypt", function() { return crypt; });
1866
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "utils", function() { return utils; });
1867
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "net", function() { return net; });
1868
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "date", function() { return date; });
1869
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "string", function() { return string; });
1870
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exception", function() { return exception; });
1871
-
1872
-
1307
+ /**
1308
+ * @desc: 一般错误.
1309
+ */
1310
+ static get ERROR() {
1311
+ return "error";
1312
+ }
1313
+ /**
1314
+ * @desc: 参数错误.
1315
+ */
1316
+ static get PARAM() {
1317
+ return "param error";
1318
+ }
1319
+ /**
1320
+ * @desc: 越界
1321
+ * @return:
1322
+ */
1323
+ static get OUT_OF_RANGE() {
1324
+ return "out of range";
1325
+ }
1326
+ };
1327
+ }
1328
+ });
1329
+
1330
+ // wxmini/index.js
1331
+ var wxmini_exports = {};
1332
+ __export(wxmini_exports, {
1333
+ __debug: () => __debug,
1334
+ crypt: () => crypt,
1335
+ date: () => date,
1336
+ exception: () => exception,
1337
+ net: () => net,
1338
+ string: () => string,
1339
+ utils: () => utils
1340
+ });
1341
+ module.exports = __toCommonJS(wxmini_exports);
1873
1342
  if (!global.__line) {
1874
- global.__line = undefined;
1875
- global.__column = undefined;
1343
+ global.__line = void 0;
1344
+ global.__column = void 0;
1876
1345
  }
1877
-
1878
- // require('es5-shim');
1879
- // require('es5-shim/es5-sham');
1880
- // require('console-polyfill');
1881
- __webpack_require__(3);
1882
- // require('babel-polyfill');
1883
- // require('../third-party/bluebird.min.js');
1884
- // require('../third-party/bignumber.min.js');
1885
-
1886
- // var utilsBig = require('../common/utils.bigint.native');
1887
- var febsutils = __webpack_require__(11);
1888
- var febscrypt = __webpack_require__(4);
1889
- var cryptMd5 = __webpack_require__(5);
1890
- var cryptSha1 = __webpack_require__(6);
1891
- var fetch = __webpack_require__(10);
1892
- var date = __webpack_require__(7);
1893
- var string = __webpack_require__(8);
1894
- var exception = __webpack_require__(2);
1895
-
1896
- const __debug = false;
1897
- const crypt = febsutils.mergeMap(febscrypt, cryptMd5, cryptSha1);
1898
- const utils = febsutils.mergeMap(febsutils);
1899
- const net = {
1900
- fetch: fetch.fetch,
1346
+ require_promise_finally_polyfill();
1347
+ var febsutils = require_utils2();
1348
+ var febscrypt = require_crypt2();
1349
+ var cryptMd5 = require_crypt_md5();
1350
+ var cryptSha1 = require_crypt_sha1();
1351
+ var fetch2 = (init_fetch(), __toCommonJS(fetch_exports));
1352
+ var date = require_date2();
1353
+ var string = require_string2();
1354
+ var exception = require_exception();
1355
+ var __debug = false;
1356
+ var crypt = febsutils.mergeMap(febscrypt, cryptMd5, cryptSha1);
1357
+ var utils = febsutils.mergeMap(febsutils);
1358
+ var net = {
1359
+ fetch: fetch2.fetch
1901
1360
  };
1902
-
1903
- // const BigNumber = BigInt;
1904
-
1905
-
1906
-
1907
- /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(9)))
1908
-
1909
- /***/ })
1910
- /******/ ]);