zmp-sdk 2.18.5-rc.0 → 2.18.6
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.
- package/dist/browser.min.js +21 -953
- package/dist/index.es.js +250 -956
- package/dist/index.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/types/src/utils/debug.d.ts +1 -0
- package/package.json +1 -3
package/dist/index.es.js
CHANGED
|
@@ -2078,949 +2078,17 @@ var _ = {
|
|
|
2078
2078
|
set: set_1
|
|
2079
2079
|
};
|
|
2080
2080
|
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
}
|
|
2091
|
-
function defaultClearTimeout () {
|
|
2092
|
-
throw new Error('clearTimeout has not been defined');
|
|
2093
|
-
}
|
|
2094
|
-
var cachedSetTimeout = defaultSetTimout;
|
|
2095
|
-
var cachedClearTimeout = defaultClearTimeout;
|
|
2096
|
-
if (typeof global$1.setTimeout === 'function') {
|
|
2097
|
-
cachedSetTimeout = setTimeout;
|
|
2098
|
-
}
|
|
2099
|
-
if (typeof global$1.clearTimeout === 'function') {
|
|
2100
|
-
cachedClearTimeout = clearTimeout;
|
|
2101
|
-
}
|
|
2102
|
-
|
|
2103
|
-
function runTimeout(fun) {
|
|
2104
|
-
if (cachedSetTimeout === setTimeout) {
|
|
2105
|
-
//normal enviroments in sane situations
|
|
2106
|
-
return setTimeout(fun, 0);
|
|
2107
|
-
}
|
|
2108
|
-
// if setTimeout wasn't available but was latter defined
|
|
2109
|
-
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
|
2110
|
-
cachedSetTimeout = setTimeout;
|
|
2111
|
-
return setTimeout(fun, 0);
|
|
2112
|
-
}
|
|
2113
|
-
try {
|
|
2114
|
-
// when when somebody has screwed with setTimeout but no I.E. maddness
|
|
2115
|
-
return cachedSetTimeout(fun, 0);
|
|
2116
|
-
} catch(e){
|
|
2117
|
-
try {
|
|
2118
|
-
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
|
2119
|
-
return cachedSetTimeout.call(null, fun, 0);
|
|
2120
|
-
} catch(e){
|
|
2121
|
-
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
|
|
2122
|
-
return cachedSetTimeout.call(this, fun, 0);
|
|
2123
|
-
}
|
|
2124
|
-
}
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
}
|
|
2128
|
-
function runClearTimeout(marker) {
|
|
2129
|
-
if (cachedClearTimeout === clearTimeout) {
|
|
2130
|
-
//normal enviroments in sane situations
|
|
2131
|
-
return clearTimeout(marker);
|
|
2132
|
-
}
|
|
2133
|
-
// if clearTimeout wasn't available but was latter defined
|
|
2134
|
-
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
|
2135
|
-
cachedClearTimeout = clearTimeout;
|
|
2136
|
-
return clearTimeout(marker);
|
|
2137
|
-
}
|
|
2138
|
-
try {
|
|
2139
|
-
// when when somebody has screwed with setTimeout but no I.E. maddness
|
|
2140
|
-
return cachedClearTimeout(marker);
|
|
2141
|
-
} catch (e){
|
|
2142
|
-
try {
|
|
2143
|
-
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
|
2144
|
-
return cachedClearTimeout.call(null, marker);
|
|
2145
|
-
} catch (e){
|
|
2146
|
-
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
|
|
2147
|
-
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
|
|
2148
|
-
return cachedClearTimeout.call(this, marker);
|
|
2149
|
-
}
|
|
2150
|
-
}
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
}
|
|
2155
|
-
var queue = [];
|
|
2156
|
-
var draining = false;
|
|
2157
|
-
var currentQueue;
|
|
2158
|
-
var queueIndex = -1;
|
|
2159
|
-
|
|
2160
|
-
function cleanUpNextTick() {
|
|
2161
|
-
if (!draining || !currentQueue) {
|
|
2162
|
-
return;
|
|
2163
|
-
}
|
|
2164
|
-
draining = false;
|
|
2165
|
-
if (currentQueue.length) {
|
|
2166
|
-
queue = currentQueue.concat(queue);
|
|
2167
|
-
} else {
|
|
2168
|
-
queueIndex = -1;
|
|
2169
|
-
}
|
|
2170
|
-
if (queue.length) {
|
|
2171
|
-
drainQueue();
|
|
2172
|
-
}
|
|
2173
|
-
}
|
|
2174
|
-
|
|
2175
|
-
function drainQueue() {
|
|
2176
|
-
if (draining) {
|
|
2177
|
-
return;
|
|
2178
|
-
}
|
|
2179
|
-
var timeout = runTimeout(cleanUpNextTick);
|
|
2180
|
-
draining = true;
|
|
2181
|
-
|
|
2182
|
-
var len = queue.length;
|
|
2183
|
-
while(len) {
|
|
2184
|
-
currentQueue = queue;
|
|
2185
|
-
queue = [];
|
|
2186
|
-
while (++queueIndex < len) {
|
|
2187
|
-
if (currentQueue) {
|
|
2188
|
-
currentQueue[queueIndex].run();
|
|
2189
|
-
}
|
|
2190
|
-
}
|
|
2191
|
-
queueIndex = -1;
|
|
2192
|
-
len = queue.length;
|
|
2193
|
-
}
|
|
2194
|
-
currentQueue = null;
|
|
2195
|
-
draining = false;
|
|
2196
|
-
runClearTimeout(timeout);
|
|
2197
|
-
}
|
|
2198
|
-
function nextTick(fun) {
|
|
2199
|
-
var args = new Array(arguments.length - 1);
|
|
2200
|
-
if (arguments.length > 1) {
|
|
2201
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
2202
|
-
args[i - 1] = arguments[i];
|
|
2203
|
-
}
|
|
2204
|
-
}
|
|
2205
|
-
queue.push(new Item(fun, args));
|
|
2206
|
-
if (queue.length === 1 && !draining) {
|
|
2207
|
-
runTimeout(drainQueue);
|
|
2208
|
-
}
|
|
2209
|
-
}
|
|
2210
|
-
// v8 likes predictible objects
|
|
2211
|
-
function Item(fun, array) {
|
|
2212
|
-
this.fun = fun;
|
|
2213
|
-
this.array = array;
|
|
2214
|
-
}
|
|
2215
|
-
Item.prototype.run = function () {
|
|
2216
|
-
this.fun.apply(null, this.array);
|
|
2217
|
-
};
|
|
2218
|
-
var title = 'browser';
|
|
2219
|
-
var platform$1 = 'browser';
|
|
2220
|
-
var browser$1 = true;
|
|
2221
|
-
var env = {};
|
|
2222
|
-
var argv = [];
|
|
2223
|
-
var version$1 = ''; // empty string to avoid regexp issues
|
|
2224
|
-
var versions = {};
|
|
2225
|
-
var release = {};
|
|
2226
|
-
var config = {};
|
|
2227
|
-
|
|
2228
|
-
function noop() {}
|
|
2229
|
-
|
|
2230
|
-
var on = noop;
|
|
2231
|
-
var addListener = noop;
|
|
2232
|
-
var once = noop;
|
|
2233
|
-
var off = noop;
|
|
2234
|
-
var removeListener = noop;
|
|
2235
|
-
var removeAllListeners = noop;
|
|
2236
|
-
var emit = noop;
|
|
2237
|
-
|
|
2238
|
-
function binding(name) {
|
|
2239
|
-
throw new Error('process.binding is not supported');
|
|
2240
|
-
}
|
|
2241
|
-
|
|
2242
|
-
function cwd () { return '/' }
|
|
2243
|
-
function chdir (dir) {
|
|
2244
|
-
throw new Error('process.chdir is not supported');
|
|
2245
|
-
}function umask() { return 0; }
|
|
2246
|
-
|
|
2247
|
-
// from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js
|
|
2248
|
-
var performance = global$1.performance || {};
|
|
2249
|
-
var performanceNow =
|
|
2250
|
-
performance.now ||
|
|
2251
|
-
performance.mozNow ||
|
|
2252
|
-
performance.msNow ||
|
|
2253
|
-
performance.oNow ||
|
|
2254
|
-
performance.webkitNow ||
|
|
2255
|
-
function(){ return (new Date()).getTime() };
|
|
2256
|
-
|
|
2257
|
-
// generate timestamp or delta
|
|
2258
|
-
// see http://nodejs.org/api/process.html#process_process_hrtime
|
|
2259
|
-
function hrtime(previousTimestamp){
|
|
2260
|
-
var clocktime = performanceNow.call(performance)*1e-3;
|
|
2261
|
-
var seconds = Math.floor(clocktime);
|
|
2262
|
-
var nanoseconds = Math.floor((clocktime%1)*1e9);
|
|
2263
|
-
if (previousTimestamp) {
|
|
2264
|
-
seconds = seconds - previousTimestamp[0];
|
|
2265
|
-
nanoseconds = nanoseconds - previousTimestamp[1];
|
|
2266
|
-
if (nanoseconds<0) {
|
|
2267
|
-
seconds--;
|
|
2268
|
-
nanoseconds += 1e9;
|
|
2269
|
-
}
|
|
2270
|
-
}
|
|
2271
|
-
return [seconds,nanoseconds]
|
|
2272
|
-
}
|
|
2273
|
-
|
|
2274
|
-
var startTime = new Date();
|
|
2275
|
-
function uptime() {
|
|
2276
|
-
var currentTime = new Date();
|
|
2277
|
-
var dif = currentTime - startTime;
|
|
2278
|
-
return dif / 1000;
|
|
2279
|
-
}
|
|
2280
|
-
|
|
2281
|
-
var browser$1$1 = {
|
|
2282
|
-
nextTick: nextTick,
|
|
2283
|
-
title: title,
|
|
2284
|
-
browser: browser$1,
|
|
2285
|
-
env: env,
|
|
2286
|
-
argv: argv,
|
|
2287
|
-
version: version$1,
|
|
2288
|
-
versions: versions,
|
|
2289
|
-
on: on,
|
|
2290
|
-
addListener: addListener,
|
|
2291
|
-
once: once,
|
|
2292
|
-
off: off,
|
|
2293
|
-
removeListener: removeListener,
|
|
2294
|
-
removeAllListeners: removeAllListeners,
|
|
2295
|
-
emit: emit,
|
|
2296
|
-
binding: binding,
|
|
2297
|
-
cwd: cwd,
|
|
2298
|
-
chdir: chdir,
|
|
2299
|
-
umask: umask,
|
|
2300
|
-
hrtime: hrtime,
|
|
2301
|
-
platform: platform$1,
|
|
2302
|
-
release: release,
|
|
2303
|
-
config: config,
|
|
2304
|
-
uptime: uptime
|
|
2305
|
-
};
|
|
2306
|
-
|
|
2307
|
-
/**
|
|
2308
|
-
* Helpers.
|
|
2309
|
-
*/
|
|
2310
|
-
|
|
2311
|
-
var s = 1000;
|
|
2312
|
-
var m = s * 60;
|
|
2313
|
-
var h = m * 60;
|
|
2314
|
-
var d = h * 24;
|
|
2315
|
-
var w = d * 7;
|
|
2316
|
-
var y = d * 365.25;
|
|
2317
|
-
|
|
2318
|
-
/**
|
|
2319
|
-
* Parse or format the given `val`.
|
|
2320
|
-
*
|
|
2321
|
-
* Options:
|
|
2322
|
-
*
|
|
2323
|
-
* - `long` verbose formatting [false]
|
|
2324
|
-
*
|
|
2325
|
-
* @param {String|Number} val
|
|
2326
|
-
* @param {Object} [options]
|
|
2327
|
-
* @throws {Error} throw an error if val is not a non-empty string or a number
|
|
2328
|
-
* @return {String|Number}
|
|
2329
|
-
* @api public
|
|
2330
|
-
*/
|
|
2331
|
-
|
|
2332
|
-
var ms = function(val, options) {
|
|
2333
|
-
options = options || {};
|
|
2334
|
-
var type = typeof val;
|
|
2335
|
-
if (type === 'string' && val.length > 0) {
|
|
2336
|
-
return parse(val);
|
|
2337
|
-
} else if (type === 'number' && isFinite(val)) {
|
|
2338
|
-
return options.long ? fmtLong(val) : fmtShort(val);
|
|
2339
|
-
}
|
|
2340
|
-
throw new Error(
|
|
2341
|
-
'val is not a non-empty string or a valid number. val=' +
|
|
2342
|
-
JSON.stringify(val)
|
|
2343
|
-
);
|
|
2344
|
-
};
|
|
2345
|
-
|
|
2346
|
-
/**
|
|
2347
|
-
* Parse the given `str` and return milliseconds.
|
|
2348
|
-
*
|
|
2349
|
-
* @param {String} str
|
|
2350
|
-
* @return {Number}
|
|
2351
|
-
* @api private
|
|
2352
|
-
*/
|
|
2353
|
-
|
|
2354
|
-
function parse(str) {
|
|
2355
|
-
str = String(str);
|
|
2356
|
-
if (str.length > 100) {
|
|
2357
|
-
return;
|
|
2358
|
-
}
|
|
2359
|
-
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
|
2360
|
-
str
|
|
2361
|
-
);
|
|
2362
|
-
if (!match) {
|
|
2363
|
-
return;
|
|
2364
|
-
}
|
|
2365
|
-
var n = parseFloat(match[1]);
|
|
2366
|
-
var type = (match[2] || 'ms').toLowerCase();
|
|
2367
|
-
switch (type) {
|
|
2368
|
-
case 'years':
|
|
2369
|
-
case 'year':
|
|
2370
|
-
case 'yrs':
|
|
2371
|
-
case 'yr':
|
|
2372
|
-
case 'y':
|
|
2373
|
-
return n * y;
|
|
2374
|
-
case 'weeks':
|
|
2375
|
-
case 'week':
|
|
2376
|
-
case 'w':
|
|
2377
|
-
return n * w;
|
|
2378
|
-
case 'days':
|
|
2379
|
-
case 'day':
|
|
2380
|
-
case 'd':
|
|
2381
|
-
return n * d;
|
|
2382
|
-
case 'hours':
|
|
2383
|
-
case 'hour':
|
|
2384
|
-
case 'hrs':
|
|
2385
|
-
case 'hr':
|
|
2386
|
-
case 'h':
|
|
2387
|
-
return n * h;
|
|
2388
|
-
case 'minutes':
|
|
2389
|
-
case 'minute':
|
|
2390
|
-
case 'mins':
|
|
2391
|
-
case 'min':
|
|
2392
|
-
case 'm':
|
|
2393
|
-
return n * m;
|
|
2394
|
-
case 'seconds':
|
|
2395
|
-
case 'second':
|
|
2396
|
-
case 'secs':
|
|
2397
|
-
case 'sec':
|
|
2398
|
-
case 's':
|
|
2399
|
-
return n * s;
|
|
2400
|
-
case 'milliseconds':
|
|
2401
|
-
case 'millisecond':
|
|
2402
|
-
case 'msecs':
|
|
2403
|
-
case 'msec':
|
|
2404
|
-
case 'ms':
|
|
2405
|
-
return n;
|
|
2406
|
-
default:
|
|
2407
|
-
return undefined;
|
|
2408
|
-
}
|
|
2409
|
-
}
|
|
2410
|
-
|
|
2411
|
-
/**
|
|
2412
|
-
* Short format for `ms`.
|
|
2413
|
-
*
|
|
2414
|
-
* @param {Number} ms
|
|
2415
|
-
* @return {String}
|
|
2416
|
-
* @api private
|
|
2417
|
-
*/
|
|
2418
|
-
|
|
2419
|
-
function fmtShort(ms) {
|
|
2420
|
-
var msAbs = Math.abs(ms);
|
|
2421
|
-
if (msAbs >= d) {
|
|
2422
|
-
return Math.round(ms / d) + 'd';
|
|
2423
|
-
}
|
|
2424
|
-
if (msAbs >= h) {
|
|
2425
|
-
return Math.round(ms / h) + 'h';
|
|
2426
|
-
}
|
|
2427
|
-
if (msAbs >= m) {
|
|
2428
|
-
return Math.round(ms / m) + 'm';
|
|
2429
|
-
}
|
|
2430
|
-
if (msAbs >= s) {
|
|
2431
|
-
return Math.round(ms / s) + 's';
|
|
2432
|
-
}
|
|
2433
|
-
return ms + 'ms';
|
|
2434
|
-
}
|
|
2435
|
-
|
|
2436
|
-
/**
|
|
2437
|
-
* Long format for `ms`.
|
|
2438
|
-
*
|
|
2439
|
-
* @param {Number} ms
|
|
2440
|
-
* @return {String}
|
|
2441
|
-
* @api private
|
|
2442
|
-
*/
|
|
2443
|
-
|
|
2444
|
-
function fmtLong(ms) {
|
|
2445
|
-
var msAbs = Math.abs(ms);
|
|
2446
|
-
if (msAbs >= d) {
|
|
2447
|
-
return plural(ms, msAbs, d, 'day');
|
|
2448
|
-
}
|
|
2449
|
-
if (msAbs >= h) {
|
|
2450
|
-
return plural(ms, msAbs, h, 'hour');
|
|
2451
|
-
}
|
|
2452
|
-
if (msAbs >= m) {
|
|
2453
|
-
return plural(ms, msAbs, m, 'minute');
|
|
2454
|
-
}
|
|
2455
|
-
if (msAbs >= s) {
|
|
2456
|
-
return plural(ms, msAbs, s, 'second');
|
|
2457
|
-
}
|
|
2458
|
-
return ms + ' ms';
|
|
2459
|
-
}
|
|
2460
|
-
|
|
2461
|
-
/**
|
|
2462
|
-
* Pluralization helper.
|
|
2463
|
-
*/
|
|
2464
|
-
|
|
2465
|
-
function plural(ms, msAbs, n, name) {
|
|
2466
|
-
var isPlural = msAbs >= n * 1.5;
|
|
2467
|
-
return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
|
|
2468
|
-
}
|
|
2469
|
-
|
|
2470
|
-
/**
|
|
2471
|
-
* This is the common logic for both the Node.js and web browser
|
|
2472
|
-
* implementations of `debug()`.
|
|
2473
|
-
*/
|
|
2474
|
-
|
|
2475
|
-
function setup(env) {
|
|
2476
|
-
createDebug.debug = createDebug;
|
|
2477
|
-
createDebug.default = createDebug;
|
|
2478
|
-
createDebug.coerce = coerce;
|
|
2479
|
-
createDebug.disable = disable;
|
|
2480
|
-
createDebug.enable = enable;
|
|
2481
|
-
createDebug.enabled = enabled;
|
|
2482
|
-
createDebug.humanize = ms;
|
|
2483
|
-
createDebug.destroy = destroy;
|
|
2484
|
-
|
|
2485
|
-
Object.keys(env).forEach(key => {
|
|
2486
|
-
createDebug[key] = env[key];
|
|
2487
|
-
});
|
|
2488
|
-
|
|
2489
|
-
/**
|
|
2490
|
-
* The currently active debug mode names, and names to skip.
|
|
2491
|
-
*/
|
|
2492
|
-
|
|
2493
|
-
createDebug.names = [];
|
|
2494
|
-
createDebug.skips = [];
|
|
2495
|
-
|
|
2496
|
-
/**
|
|
2497
|
-
* Map of special "%n" handling functions, for the debug "format" argument.
|
|
2498
|
-
*
|
|
2499
|
-
* Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
|
|
2500
|
-
*/
|
|
2501
|
-
createDebug.formatters = {};
|
|
2502
|
-
|
|
2503
|
-
/**
|
|
2504
|
-
* Selects a color for a debug namespace
|
|
2505
|
-
* @param {String} namespace The namespace string for the debug instance to be colored
|
|
2506
|
-
* @return {Number|String} An ANSI color code for the given namespace
|
|
2507
|
-
* @api private
|
|
2508
|
-
*/
|
|
2509
|
-
function selectColor(namespace) {
|
|
2510
|
-
let hash = 0;
|
|
2511
|
-
|
|
2512
|
-
for (let i = 0; i < namespace.length; i++) {
|
|
2513
|
-
hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
|
|
2514
|
-
hash |= 0; // Convert to 32bit integer
|
|
2515
|
-
}
|
|
2516
|
-
|
|
2517
|
-
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
|
2518
|
-
}
|
|
2519
|
-
createDebug.selectColor = selectColor;
|
|
2520
|
-
|
|
2521
|
-
/**
|
|
2522
|
-
* Create a debugger with the given `namespace`.
|
|
2523
|
-
*
|
|
2524
|
-
* @param {String} namespace
|
|
2525
|
-
* @return {Function}
|
|
2526
|
-
* @api public
|
|
2527
|
-
*/
|
|
2528
|
-
function createDebug(namespace) {
|
|
2529
|
-
let prevTime;
|
|
2530
|
-
let enableOverride = null;
|
|
2531
|
-
let namespacesCache;
|
|
2532
|
-
let enabledCache;
|
|
2533
|
-
|
|
2534
|
-
function debug(...args) {
|
|
2535
|
-
// Disabled?
|
|
2536
|
-
if (!debug.enabled) {
|
|
2537
|
-
return;
|
|
2538
|
-
}
|
|
2539
|
-
|
|
2540
|
-
const self = debug;
|
|
2541
|
-
|
|
2542
|
-
// Set `diff` timestamp
|
|
2543
|
-
const curr = Number(new Date());
|
|
2544
|
-
const ms = curr - (prevTime || curr);
|
|
2545
|
-
self.diff = ms;
|
|
2546
|
-
self.prev = prevTime;
|
|
2547
|
-
self.curr = curr;
|
|
2548
|
-
prevTime = curr;
|
|
2549
|
-
|
|
2550
|
-
args[0] = createDebug.coerce(args[0]);
|
|
2551
|
-
|
|
2552
|
-
if (typeof args[0] !== 'string') {
|
|
2553
|
-
// Anything else let's inspect with %O
|
|
2554
|
-
args.unshift('%O');
|
|
2555
|
-
}
|
|
2556
|
-
|
|
2557
|
-
// Apply any `formatters` transformations
|
|
2558
|
-
let index = 0;
|
|
2559
|
-
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
|
|
2560
|
-
// If we encounter an escaped % then don't increase the array index
|
|
2561
|
-
if (match === '%%') {
|
|
2562
|
-
return '%';
|
|
2563
|
-
}
|
|
2564
|
-
index++;
|
|
2565
|
-
const formatter = createDebug.formatters[format];
|
|
2566
|
-
if (typeof formatter === 'function') {
|
|
2567
|
-
const val = args[index];
|
|
2568
|
-
match = formatter.call(self, val);
|
|
2569
|
-
|
|
2570
|
-
// Now we need to remove `args[index]` since it's inlined in the `format`
|
|
2571
|
-
args.splice(index, 1);
|
|
2572
|
-
index--;
|
|
2573
|
-
}
|
|
2574
|
-
return match;
|
|
2575
|
-
});
|
|
2576
|
-
|
|
2577
|
-
// Apply env-specific formatting (colors, etc.)
|
|
2578
|
-
createDebug.formatArgs.call(self, args);
|
|
2579
|
-
|
|
2580
|
-
const logFn = self.log || createDebug.log;
|
|
2581
|
-
logFn.apply(self, args);
|
|
2582
|
-
}
|
|
2583
|
-
|
|
2584
|
-
debug.namespace = namespace;
|
|
2585
|
-
debug.useColors = createDebug.useColors();
|
|
2586
|
-
debug.color = createDebug.selectColor(namespace);
|
|
2587
|
-
debug.extend = extend;
|
|
2588
|
-
debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
|
|
2589
|
-
|
|
2590
|
-
Object.defineProperty(debug, 'enabled', {
|
|
2591
|
-
enumerable: true,
|
|
2592
|
-
configurable: false,
|
|
2593
|
-
get: () => {
|
|
2594
|
-
if (enableOverride !== null) {
|
|
2595
|
-
return enableOverride;
|
|
2596
|
-
}
|
|
2597
|
-
if (namespacesCache !== createDebug.namespaces) {
|
|
2598
|
-
namespacesCache = createDebug.namespaces;
|
|
2599
|
-
enabledCache = createDebug.enabled(namespace);
|
|
2600
|
-
}
|
|
2601
|
-
|
|
2602
|
-
return enabledCache;
|
|
2603
|
-
},
|
|
2604
|
-
set: v => {
|
|
2605
|
-
enableOverride = v;
|
|
2606
|
-
}
|
|
2607
|
-
});
|
|
2608
|
-
|
|
2609
|
-
// Env-specific initialization logic for debug instances
|
|
2610
|
-
if (typeof createDebug.init === 'function') {
|
|
2611
|
-
createDebug.init(debug);
|
|
2612
|
-
}
|
|
2613
|
-
|
|
2614
|
-
return debug;
|
|
2615
|
-
}
|
|
2616
|
-
|
|
2617
|
-
function extend(namespace, delimiter) {
|
|
2618
|
-
const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
|
|
2619
|
-
newDebug.log = this.log;
|
|
2620
|
-
return newDebug;
|
|
2621
|
-
}
|
|
2622
|
-
|
|
2623
|
-
/**
|
|
2624
|
-
* Enables a debug mode by namespaces. This can include modes
|
|
2625
|
-
* separated by a colon and wildcards.
|
|
2626
|
-
*
|
|
2627
|
-
* @param {String} namespaces
|
|
2628
|
-
* @api public
|
|
2629
|
-
*/
|
|
2630
|
-
function enable(namespaces) {
|
|
2631
|
-
createDebug.save(namespaces);
|
|
2632
|
-
createDebug.namespaces = namespaces;
|
|
2633
|
-
|
|
2634
|
-
createDebug.names = [];
|
|
2635
|
-
createDebug.skips = [];
|
|
2636
|
-
|
|
2637
|
-
let i;
|
|
2638
|
-
const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
|
|
2639
|
-
const len = split.length;
|
|
2640
|
-
|
|
2641
|
-
for (i = 0; i < len; i++) {
|
|
2642
|
-
if (!split[i]) {
|
|
2643
|
-
// ignore empty strings
|
|
2644
|
-
continue;
|
|
2645
|
-
}
|
|
2646
|
-
|
|
2647
|
-
namespaces = split[i].replace(/\*/g, '.*?');
|
|
2648
|
-
|
|
2649
|
-
if (namespaces[0] === '-') {
|
|
2650
|
-
createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
|
|
2651
|
-
} else {
|
|
2652
|
-
createDebug.names.push(new RegExp('^' + namespaces + '$'));
|
|
2653
|
-
}
|
|
2654
|
-
}
|
|
2655
|
-
}
|
|
2656
|
-
|
|
2657
|
-
/**
|
|
2658
|
-
* Disable debug output.
|
|
2659
|
-
*
|
|
2660
|
-
* @return {String} namespaces
|
|
2661
|
-
* @api public
|
|
2662
|
-
*/
|
|
2663
|
-
function disable() {
|
|
2664
|
-
const namespaces = [
|
|
2665
|
-
...createDebug.names.map(toNamespace),
|
|
2666
|
-
...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
|
|
2667
|
-
].join(',');
|
|
2668
|
-
createDebug.enable('');
|
|
2669
|
-
return namespaces;
|
|
2670
|
-
}
|
|
2671
|
-
|
|
2672
|
-
/**
|
|
2673
|
-
* Returns true if the given mode name is enabled, false otherwise.
|
|
2674
|
-
*
|
|
2675
|
-
* @param {String} name
|
|
2676
|
-
* @return {Boolean}
|
|
2677
|
-
* @api public
|
|
2678
|
-
*/
|
|
2679
|
-
function enabled(name) {
|
|
2680
|
-
if (name[name.length - 1] === '*') {
|
|
2681
|
-
return true;
|
|
2682
|
-
}
|
|
2683
|
-
|
|
2684
|
-
let i;
|
|
2685
|
-
let len;
|
|
2686
|
-
|
|
2687
|
-
for (i = 0, len = createDebug.skips.length; i < len; i++) {
|
|
2688
|
-
if (createDebug.skips[i].test(name)) {
|
|
2689
|
-
return false;
|
|
2690
|
-
}
|
|
2691
|
-
}
|
|
2692
|
-
|
|
2693
|
-
for (i = 0, len = createDebug.names.length; i < len; i++) {
|
|
2694
|
-
if (createDebug.names[i].test(name)) {
|
|
2695
|
-
return true;
|
|
2696
|
-
}
|
|
2697
|
-
}
|
|
2698
|
-
|
|
2699
|
-
return false;
|
|
2700
|
-
}
|
|
2701
|
-
|
|
2702
|
-
/**
|
|
2703
|
-
* Convert regexp to namespace
|
|
2704
|
-
*
|
|
2705
|
-
* @param {RegExp} regxep
|
|
2706
|
-
* @return {String} namespace
|
|
2707
|
-
* @api private
|
|
2708
|
-
*/
|
|
2709
|
-
function toNamespace(regexp) {
|
|
2710
|
-
return regexp.toString()
|
|
2711
|
-
.substring(2, regexp.toString().length - 2)
|
|
2712
|
-
.replace(/\.\*\?$/, '*');
|
|
2713
|
-
}
|
|
2714
|
-
|
|
2715
|
-
/**
|
|
2716
|
-
* Coerce `val`.
|
|
2717
|
-
*
|
|
2718
|
-
* @param {Mixed} val
|
|
2719
|
-
* @return {Mixed}
|
|
2720
|
-
* @api private
|
|
2721
|
-
*/
|
|
2722
|
-
function coerce(val) {
|
|
2723
|
-
if (val instanceof Error) {
|
|
2724
|
-
return val.stack || val.message;
|
|
2725
|
-
}
|
|
2726
|
-
return val;
|
|
2727
|
-
}
|
|
2728
|
-
|
|
2729
|
-
/**
|
|
2730
|
-
* XXX DO NOT USE. This is a temporary stub function.
|
|
2731
|
-
* XXX It WILL be removed in the next major release.
|
|
2732
|
-
*/
|
|
2733
|
-
function destroy() {
|
|
2734
|
-
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
2735
|
-
}
|
|
2736
|
-
|
|
2737
|
-
createDebug.enable(createDebug.load());
|
|
2738
|
-
|
|
2739
|
-
return createDebug;
|
|
2740
|
-
}
|
|
2741
|
-
|
|
2742
|
-
var common = setup;
|
|
2743
|
-
|
|
2744
|
-
var browser = createCommonjsModule(function (module, exports) {
|
|
2745
|
-
/* eslint-env browser */
|
|
2746
|
-
|
|
2747
|
-
/**
|
|
2748
|
-
* This is the web browser implementation of `debug()`.
|
|
2749
|
-
*/
|
|
2750
|
-
|
|
2751
|
-
exports.formatArgs = formatArgs;
|
|
2752
|
-
exports.save = save;
|
|
2753
|
-
exports.load = load;
|
|
2754
|
-
exports.useColors = useColors;
|
|
2755
|
-
exports.storage = localstorage();
|
|
2756
|
-
exports.destroy = (() => {
|
|
2757
|
-
let warned = false;
|
|
2758
|
-
|
|
2759
|
-
return () => {
|
|
2760
|
-
if (!warned) {
|
|
2761
|
-
warned = true;
|
|
2762
|
-
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
2763
|
-
}
|
|
2764
|
-
};
|
|
2765
|
-
})();
|
|
2766
|
-
|
|
2767
|
-
/**
|
|
2768
|
-
* Colors.
|
|
2769
|
-
*/
|
|
2770
|
-
|
|
2771
|
-
exports.colors = [
|
|
2772
|
-
'#0000CC',
|
|
2773
|
-
'#0000FF',
|
|
2774
|
-
'#0033CC',
|
|
2775
|
-
'#0033FF',
|
|
2776
|
-
'#0066CC',
|
|
2777
|
-
'#0066FF',
|
|
2778
|
-
'#0099CC',
|
|
2779
|
-
'#0099FF',
|
|
2780
|
-
'#00CC00',
|
|
2781
|
-
'#00CC33',
|
|
2782
|
-
'#00CC66',
|
|
2783
|
-
'#00CC99',
|
|
2784
|
-
'#00CCCC',
|
|
2785
|
-
'#00CCFF',
|
|
2786
|
-
'#3300CC',
|
|
2787
|
-
'#3300FF',
|
|
2788
|
-
'#3333CC',
|
|
2789
|
-
'#3333FF',
|
|
2790
|
-
'#3366CC',
|
|
2791
|
-
'#3366FF',
|
|
2792
|
-
'#3399CC',
|
|
2793
|
-
'#3399FF',
|
|
2794
|
-
'#33CC00',
|
|
2795
|
-
'#33CC33',
|
|
2796
|
-
'#33CC66',
|
|
2797
|
-
'#33CC99',
|
|
2798
|
-
'#33CCCC',
|
|
2799
|
-
'#33CCFF',
|
|
2800
|
-
'#6600CC',
|
|
2801
|
-
'#6600FF',
|
|
2802
|
-
'#6633CC',
|
|
2803
|
-
'#6633FF',
|
|
2804
|
-
'#66CC00',
|
|
2805
|
-
'#66CC33',
|
|
2806
|
-
'#9900CC',
|
|
2807
|
-
'#9900FF',
|
|
2808
|
-
'#9933CC',
|
|
2809
|
-
'#9933FF',
|
|
2810
|
-
'#99CC00',
|
|
2811
|
-
'#99CC33',
|
|
2812
|
-
'#CC0000',
|
|
2813
|
-
'#CC0033',
|
|
2814
|
-
'#CC0066',
|
|
2815
|
-
'#CC0099',
|
|
2816
|
-
'#CC00CC',
|
|
2817
|
-
'#CC00FF',
|
|
2818
|
-
'#CC3300',
|
|
2819
|
-
'#CC3333',
|
|
2820
|
-
'#CC3366',
|
|
2821
|
-
'#CC3399',
|
|
2822
|
-
'#CC33CC',
|
|
2823
|
-
'#CC33FF',
|
|
2824
|
-
'#CC6600',
|
|
2825
|
-
'#CC6633',
|
|
2826
|
-
'#CC9900',
|
|
2827
|
-
'#CC9933',
|
|
2828
|
-
'#CCCC00',
|
|
2829
|
-
'#CCCC33',
|
|
2830
|
-
'#FF0000',
|
|
2831
|
-
'#FF0033',
|
|
2832
|
-
'#FF0066',
|
|
2833
|
-
'#FF0099',
|
|
2834
|
-
'#FF00CC',
|
|
2835
|
-
'#FF00FF',
|
|
2836
|
-
'#FF3300',
|
|
2837
|
-
'#FF3333',
|
|
2838
|
-
'#FF3366',
|
|
2839
|
-
'#FF3399',
|
|
2840
|
-
'#FF33CC',
|
|
2841
|
-
'#FF33FF',
|
|
2842
|
-
'#FF6600',
|
|
2843
|
-
'#FF6633',
|
|
2844
|
-
'#FF9900',
|
|
2845
|
-
'#FF9933',
|
|
2846
|
-
'#FFCC00',
|
|
2847
|
-
'#FFCC33'
|
|
2848
|
-
];
|
|
2849
|
-
|
|
2850
|
-
/**
|
|
2851
|
-
* Currently only WebKit-based Web Inspectors, Firefox >= v31,
|
|
2852
|
-
* and the Firebug extension (any Firefox version) are known
|
|
2853
|
-
* to support "%c" CSS customizations.
|
|
2854
|
-
*
|
|
2855
|
-
* TODO: add a `localStorage` variable to explicitly enable/disable colors
|
|
2856
|
-
*/
|
|
2857
|
-
|
|
2858
|
-
// eslint-disable-next-line complexity
|
|
2859
|
-
function useColors() {
|
|
2860
|
-
// NB: In an Electron preload script, document will be defined but not fully
|
|
2861
|
-
// initialized. Since we know we're in Chrome, we'll just detect this case
|
|
2862
|
-
// explicitly
|
|
2863
|
-
if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
|
|
2864
|
-
return true;
|
|
2865
|
-
}
|
|
2866
|
-
|
|
2867
|
-
// Internet Explorer and Edge do not support colors.
|
|
2868
|
-
if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
2869
|
-
return false;
|
|
2870
|
-
}
|
|
2871
|
-
|
|
2872
|
-
// Is webkit? http://stackoverflow.com/a/16459606/376773
|
|
2873
|
-
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
|
2874
|
-
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
|
|
2875
|
-
// Is firebug? http://stackoverflow.com/a/398120/376773
|
|
2876
|
-
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
|
|
2877
|
-
// Is firefox >= v31?
|
|
2878
|
-
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
2879
|
-
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
|
|
2880
|
-
// Double check webkit in userAgent just in case we are in a worker
|
|
2881
|
-
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
|
|
2882
|
-
}
|
|
2883
|
-
|
|
2884
|
-
/**
|
|
2885
|
-
* Colorize log arguments if enabled.
|
|
2886
|
-
*
|
|
2887
|
-
* @api public
|
|
2888
|
-
*/
|
|
2889
|
-
|
|
2890
|
-
function formatArgs(args) {
|
|
2891
|
-
args[0] = (this.useColors ? '%c' : '') +
|
|
2892
|
-
this.namespace +
|
|
2893
|
-
(this.useColors ? ' %c' : ' ') +
|
|
2894
|
-
args[0] +
|
|
2895
|
-
(this.useColors ? '%c ' : ' ') +
|
|
2896
|
-
'+' + module.exports.humanize(this.diff);
|
|
2897
|
-
|
|
2898
|
-
if (!this.useColors) {
|
|
2899
|
-
return;
|
|
2900
|
-
}
|
|
2901
|
-
|
|
2902
|
-
const c = 'color: ' + this.color;
|
|
2903
|
-
args.splice(1, 0, c, 'color: inherit');
|
|
2904
|
-
|
|
2905
|
-
// The final "%c" is somewhat tricky, because there could be other
|
|
2906
|
-
// arguments passed either before or after the %c, so we need to
|
|
2907
|
-
// figure out the correct index to insert the CSS into
|
|
2908
|
-
let index = 0;
|
|
2909
|
-
let lastC = 0;
|
|
2910
|
-
args[0].replace(/%[a-zA-Z%]/g, match => {
|
|
2911
|
-
if (match === '%%') {
|
|
2912
|
-
return;
|
|
2913
|
-
}
|
|
2914
|
-
index++;
|
|
2915
|
-
if (match === '%c') {
|
|
2916
|
-
// We only are interested in the *last* %c
|
|
2917
|
-
// (the user may have provided their own)
|
|
2918
|
-
lastC = index;
|
|
2919
|
-
}
|
|
2920
|
-
});
|
|
2921
|
-
|
|
2922
|
-
args.splice(lastC, 0, c);
|
|
2923
|
-
}
|
|
2924
|
-
|
|
2925
|
-
/**
|
|
2926
|
-
* Invokes `console.debug()` when available.
|
|
2927
|
-
* No-op when `console.debug` is not a "function".
|
|
2928
|
-
* If `console.debug` is not available, falls back
|
|
2929
|
-
* to `console.log`.
|
|
2930
|
-
*
|
|
2931
|
-
* @api public
|
|
2932
|
-
*/
|
|
2933
|
-
exports.log = console.debug || console.log || (() => {});
|
|
2934
|
-
|
|
2935
|
-
/**
|
|
2936
|
-
* Save `namespaces`.
|
|
2937
|
-
*
|
|
2938
|
-
* @param {String} namespaces
|
|
2939
|
-
* @api private
|
|
2940
|
-
*/
|
|
2941
|
-
function save(namespaces) {
|
|
2942
|
-
try {
|
|
2943
|
-
if (namespaces) {
|
|
2944
|
-
exports.storage.setItem('debug', namespaces);
|
|
2945
|
-
} else {
|
|
2946
|
-
exports.storage.removeItem('debug');
|
|
2947
|
-
}
|
|
2948
|
-
} catch (error) {
|
|
2949
|
-
// Swallow
|
|
2950
|
-
// XXX (@Qix-) should we be logging these?
|
|
2951
|
-
}
|
|
2952
|
-
}
|
|
2953
|
-
|
|
2954
|
-
/**
|
|
2955
|
-
* Load `namespaces`.
|
|
2956
|
-
*
|
|
2957
|
-
* @return {String} returns the previously persisted debug modes
|
|
2958
|
-
* @api private
|
|
2959
|
-
*/
|
|
2960
|
-
function load() {
|
|
2961
|
-
let r;
|
|
2962
|
-
try {
|
|
2963
|
-
r = exports.storage.getItem('debug');
|
|
2964
|
-
} catch (error) {
|
|
2965
|
-
// Swallow
|
|
2966
|
-
// XXX (@Qix-) should we be logging these?
|
|
2967
|
-
}
|
|
2968
|
-
|
|
2969
|
-
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
|
|
2970
|
-
if (!r && typeof browser$1$1 !== 'undefined' && 'env' in browser$1$1) {
|
|
2971
|
-
r = browser$1$1.env.DEBUG;
|
|
2972
|
-
}
|
|
2973
|
-
|
|
2974
|
-
return r;
|
|
2975
|
-
}
|
|
2976
|
-
|
|
2977
|
-
/**
|
|
2978
|
-
* Localstorage attempts to return the localstorage.
|
|
2979
|
-
*
|
|
2980
|
-
* This is necessary because safari throws
|
|
2981
|
-
* when a user disables cookies/localstorage
|
|
2982
|
-
* and you attempt to access it.
|
|
2983
|
-
*
|
|
2984
|
-
* @return {LocalStorage}
|
|
2985
|
-
* @api private
|
|
2986
|
-
*/
|
|
2987
|
-
|
|
2988
|
-
function localstorage() {
|
|
2989
|
-
try {
|
|
2990
|
-
// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
|
|
2991
|
-
// The Browser also has localStorage in the global context.
|
|
2992
|
-
return localStorage;
|
|
2993
|
-
} catch (error) {
|
|
2994
|
-
// Swallow
|
|
2995
|
-
// XXX (@Qix-) should we be logging these?
|
|
2996
|
-
}
|
|
2081
|
+
function Debug(name) {
|
|
2082
|
+
if (typeof window.Debug === 'function') {
|
|
2083
|
+
return window.Debug(name);
|
|
2084
|
+
}
|
|
2085
|
+
return function (...args) {
|
|
2086
|
+
if (process.env.NODE_ENV === 'development') {
|
|
2087
|
+
console.log(name, ...args);
|
|
2088
|
+
}
|
|
2089
|
+
};
|
|
2997
2090
|
}
|
|
2998
2091
|
|
|
2999
|
-
module.exports = common(exports);
|
|
3000
|
-
|
|
3001
|
-
const {formatters} = module.exports;
|
|
3002
|
-
|
|
3003
|
-
/**
|
|
3004
|
-
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
|
|
3005
|
-
*/
|
|
3006
|
-
|
|
3007
|
-
formatters.j = function (v) {
|
|
3008
|
-
try {
|
|
3009
|
-
return JSON.stringify(v);
|
|
3010
|
-
} catch (error) {
|
|
3011
|
-
return '[UnexpectedJSONParseError]: ' + error.message;
|
|
3012
|
-
}
|
|
3013
|
-
};
|
|
3014
|
-
});
|
|
3015
|
-
browser.formatArgs;
|
|
3016
|
-
browser.save;
|
|
3017
|
-
browser.load;
|
|
3018
|
-
browser.useColors;
|
|
3019
|
-
browser.storage;
|
|
3020
|
-
browser.destroy;
|
|
3021
|
-
browser.colors;
|
|
3022
|
-
browser.log;
|
|
3023
|
-
|
|
3024
2092
|
/**
|
|
3025
2093
|
* @typedef {"none" | "wifi" | "cellular" | "unknown"} NetworkType
|
|
3026
2094
|
*/
|
|
@@ -3875,7 +2943,7 @@ const QueryString = {
|
|
|
3875
2943
|
const REGEXP_SPECIAL_UNICODE = new RegExp('[\\u0300-\\u036f]', 'g');
|
|
3876
2944
|
const REGEXP_ACCENT_D = new RegExp('[đ|Đ]', 'g');
|
|
3877
2945
|
const REGEXP_SPACES = new RegExp('\\s', 'g');
|
|
3878
|
-
const debug =
|
|
2946
|
+
const debug = Debug('zmp:utils:common');
|
|
3879
2947
|
/**
|
|
3880
2948
|
* Checks if a url is valid
|
|
3881
2949
|
* @param {string} string URL
|
|
@@ -4555,7 +3623,7 @@ EventEmitter.EventEmitter = EventEmitter;
|
|
|
4555
3623
|
class ZMPEEmitter extends eventemitter3 {
|
|
4556
3624
|
constructor() {
|
|
4557
3625
|
super();
|
|
4558
|
-
this.debug =
|
|
3626
|
+
this.debug = Debug("zmp:event-emitter");
|
|
4559
3627
|
}
|
|
4560
3628
|
static getInstance() {
|
|
4561
3629
|
if (!ZMPEEmitter.instance) {
|
|
@@ -4702,7 +3770,7 @@ var CORSRequest = {
|
|
|
4702
3770
|
class ZaloJSBridge extends eventemitter3 {
|
|
4703
3771
|
constructor() {
|
|
4704
3772
|
super();
|
|
4705
|
-
this.debug =
|
|
3773
|
+
this.debug = Debug('zmp:ZaloJSBridge');
|
|
4706
3774
|
this.events = ZMPEEmitter.getInstance();
|
|
4707
3775
|
this._accessTk = getToken('zacc_session') || 'DEFAULT_ACCESS_TOKEN';
|
|
4708
3776
|
this._jsAccessTk = getToken('zlink3rd') || 'DEFAULT_JS_TOKEN';
|
|
@@ -4929,7 +3997,7 @@ var _ZJSBridgeProvider_bridge;
|
|
|
4929
3997
|
class ZJSBridgeProvider {
|
|
4930
3998
|
/** @ignore */
|
|
4931
3999
|
constructor() {
|
|
4932
|
-
this.debug =
|
|
4000
|
+
this.debug = Debug('zmp:ZJSBridgeProvider');
|
|
4933
4001
|
_ZJSBridgeProvider_bridge.set(this, void 0);
|
|
4934
4002
|
__classPrivateFieldSet(this, _ZJSBridgeProvider_bridge, ZaloJSBridge.getInstance(), "f");
|
|
4935
4003
|
}
|
|
@@ -4991,7 +4059,7 @@ class ZJSBridgeProvider {
|
|
|
4991
4059
|
}
|
|
4992
4060
|
_ZJSBridgeProvider_bridge = new WeakMap();
|
|
4993
4061
|
|
|
4994
|
-
var version = "2.18.
|
|
4062
|
+
var version$1 = "2.18.6";
|
|
4995
4063
|
|
|
4996
4064
|
class Basics {
|
|
4997
4065
|
/**
|
|
@@ -5002,7 +4070,7 @@ class Basics {
|
|
|
5002
4070
|
* @returns {string} Version hiện tại của Zalo Mini Program SDK.
|
|
5003
4071
|
*/
|
|
5004
4072
|
static getVersion() {
|
|
5005
|
-
return version;
|
|
4073
|
+
return version$1;
|
|
5006
4074
|
}
|
|
5007
4075
|
/**
|
|
5008
4076
|
* Gets system information.
|
|
@@ -5016,7 +4084,7 @@ class Basics {
|
|
|
5016
4084
|
static getSystemInfo() {
|
|
5017
4085
|
const system = {
|
|
5018
4086
|
version: getMetaValue('version-id') || '',
|
|
5019
|
-
apiVersion: version,
|
|
4087
|
+
apiVersion: version$1,
|
|
5020
4088
|
zaloVersion: getZaloVersion(),
|
|
5021
4089
|
platform: getPlatform(),
|
|
5022
4090
|
language: navigator.language,
|
|
@@ -7642,6 +6710,232 @@ class MockSDKService {
|
|
|
7642
6710
|
}
|
|
7643
6711
|
_MockSDKService_appId = new WeakMap(), _MockSDKService_appConfig = new WeakMap(), _MockSDKService_zOAuth = new WeakMap(), _MockSDKService_accessToken = new WeakMap(), _MockSDKService_cache = new WeakMap(), _MockSDKService_loggedId = new WeakMap();
|
|
7644
6712
|
|
|
6713
|
+
var global$1 = (typeof global !== "undefined" ? global :
|
|
6714
|
+
typeof self !== "undefined" ? self :
|
|
6715
|
+
typeof window !== "undefined" ? window : {});
|
|
6716
|
+
|
|
6717
|
+
// shim for using process in browser
|
|
6718
|
+
// based off https://github.com/defunctzombie/node-process/blob/master/browser.js
|
|
6719
|
+
|
|
6720
|
+
function defaultSetTimout() {
|
|
6721
|
+
throw new Error('setTimeout has not been defined');
|
|
6722
|
+
}
|
|
6723
|
+
function defaultClearTimeout () {
|
|
6724
|
+
throw new Error('clearTimeout has not been defined');
|
|
6725
|
+
}
|
|
6726
|
+
var cachedSetTimeout = defaultSetTimout;
|
|
6727
|
+
var cachedClearTimeout = defaultClearTimeout;
|
|
6728
|
+
if (typeof global$1.setTimeout === 'function') {
|
|
6729
|
+
cachedSetTimeout = setTimeout;
|
|
6730
|
+
}
|
|
6731
|
+
if (typeof global$1.clearTimeout === 'function') {
|
|
6732
|
+
cachedClearTimeout = clearTimeout;
|
|
6733
|
+
}
|
|
6734
|
+
|
|
6735
|
+
function runTimeout(fun) {
|
|
6736
|
+
if (cachedSetTimeout === setTimeout) {
|
|
6737
|
+
//normal enviroments in sane situations
|
|
6738
|
+
return setTimeout(fun, 0);
|
|
6739
|
+
}
|
|
6740
|
+
// if setTimeout wasn't available but was latter defined
|
|
6741
|
+
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
|
6742
|
+
cachedSetTimeout = setTimeout;
|
|
6743
|
+
return setTimeout(fun, 0);
|
|
6744
|
+
}
|
|
6745
|
+
try {
|
|
6746
|
+
// when when somebody has screwed with setTimeout but no I.E. maddness
|
|
6747
|
+
return cachedSetTimeout(fun, 0);
|
|
6748
|
+
} catch(e){
|
|
6749
|
+
try {
|
|
6750
|
+
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
|
6751
|
+
return cachedSetTimeout.call(null, fun, 0);
|
|
6752
|
+
} catch(e){
|
|
6753
|
+
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
|
|
6754
|
+
return cachedSetTimeout.call(this, fun, 0);
|
|
6755
|
+
}
|
|
6756
|
+
}
|
|
6757
|
+
|
|
6758
|
+
|
|
6759
|
+
}
|
|
6760
|
+
function runClearTimeout(marker) {
|
|
6761
|
+
if (cachedClearTimeout === clearTimeout) {
|
|
6762
|
+
//normal enviroments in sane situations
|
|
6763
|
+
return clearTimeout(marker);
|
|
6764
|
+
}
|
|
6765
|
+
// if clearTimeout wasn't available but was latter defined
|
|
6766
|
+
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
|
6767
|
+
cachedClearTimeout = clearTimeout;
|
|
6768
|
+
return clearTimeout(marker);
|
|
6769
|
+
}
|
|
6770
|
+
try {
|
|
6771
|
+
// when when somebody has screwed with setTimeout but no I.E. maddness
|
|
6772
|
+
return cachedClearTimeout(marker);
|
|
6773
|
+
} catch (e){
|
|
6774
|
+
try {
|
|
6775
|
+
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
|
6776
|
+
return cachedClearTimeout.call(null, marker);
|
|
6777
|
+
} catch (e){
|
|
6778
|
+
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
|
|
6779
|
+
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
|
|
6780
|
+
return cachedClearTimeout.call(this, marker);
|
|
6781
|
+
}
|
|
6782
|
+
}
|
|
6783
|
+
|
|
6784
|
+
|
|
6785
|
+
|
|
6786
|
+
}
|
|
6787
|
+
var queue = [];
|
|
6788
|
+
var draining = false;
|
|
6789
|
+
var currentQueue;
|
|
6790
|
+
var queueIndex = -1;
|
|
6791
|
+
|
|
6792
|
+
function cleanUpNextTick() {
|
|
6793
|
+
if (!draining || !currentQueue) {
|
|
6794
|
+
return;
|
|
6795
|
+
}
|
|
6796
|
+
draining = false;
|
|
6797
|
+
if (currentQueue.length) {
|
|
6798
|
+
queue = currentQueue.concat(queue);
|
|
6799
|
+
} else {
|
|
6800
|
+
queueIndex = -1;
|
|
6801
|
+
}
|
|
6802
|
+
if (queue.length) {
|
|
6803
|
+
drainQueue();
|
|
6804
|
+
}
|
|
6805
|
+
}
|
|
6806
|
+
|
|
6807
|
+
function drainQueue() {
|
|
6808
|
+
if (draining) {
|
|
6809
|
+
return;
|
|
6810
|
+
}
|
|
6811
|
+
var timeout = runTimeout(cleanUpNextTick);
|
|
6812
|
+
draining = true;
|
|
6813
|
+
|
|
6814
|
+
var len = queue.length;
|
|
6815
|
+
while(len) {
|
|
6816
|
+
currentQueue = queue;
|
|
6817
|
+
queue = [];
|
|
6818
|
+
while (++queueIndex < len) {
|
|
6819
|
+
if (currentQueue) {
|
|
6820
|
+
currentQueue[queueIndex].run();
|
|
6821
|
+
}
|
|
6822
|
+
}
|
|
6823
|
+
queueIndex = -1;
|
|
6824
|
+
len = queue.length;
|
|
6825
|
+
}
|
|
6826
|
+
currentQueue = null;
|
|
6827
|
+
draining = false;
|
|
6828
|
+
runClearTimeout(timeout);
|
|
6829
|
+
}
|
|
6830
|
+
function nextTick(fun) {
|
|
6831
|
+
var args = new Array(arguments.length - 1);
|
|
6832
|
+
if (arguments.length > 1) {
|
|
6833
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
6834
|
+
args[i - 1] = arguments[i];
|
|
6835
|
+
}
|
|
6836
|
+
}
|
|
6837
|
+
queue.push(new Item(fun, args));
|
|
6838
|
+
if (queue.length === 1 && !draining) {
|
|
6839
|
+
runTimeout(drainQueue);
|
|
6840
|
+
}
|
|
6841
|
+
}
|
|
6842
|
+
// v8 likes predictible objects
|
|
6843
|
+
function Item(fun, array) {
|
|
6844
|
+
this.fun = fun;
|
|
6845
|
+
this.array = array;
|
|
6846
|
+
}
|
|
6847
|
+
Item.prototype.run = function () {
|
|
6848
|
+
this.fun.apply(null, this.array);
|
|
6849
|
+
};
|
|
6850
|
+
var title = 'browser';
|
|
6851
|
+
var platform$1 = 'browser';
|
|
6852
|
+
var browser = true;
|
|
6853
|
+
var env = {};
|
|
6854
|
+
var argv = [];
|
|
6855
|
+
var version = ''; // empty string to avoid regexp issues
|
|
6856
|
+
var versions = {};
|
|
6857
|
+
var release = {};
|
|
6858
|
+
var config = {};
|
|
6859
|
+
|
|
6860
|
+
function noop() {}
|
|
6861
|
+
|
|
6862
|
+
var on = noop;
|
|
6863
|
+
var addListener = noop;
|
|
6864
|
+
var once = noop;
|
|
6865
|
+
var off = noop;
|
|
6866
|
+
var removeListener = noop;
|
|
6867
|
+
var removeAllListeners = noop;
|
|
6868
|
+
var emit = noop;
|
|
6869
|
+
|
|
6870
|
+
function binding(name) {
|
|
6871
|
+
throw new Error('process.binding is not supported');
|
|
6872
|
+
}
|
|
6873
|
+
|
|
6874
|
+
function cwd () { return '/' }
|
|
6875
|
+
function chdir (dir) {
|
|
6876
|
+
throw new Error('process.chdir is not supported');
|
|
6877
|
+
}function umask() { return 0; }
|
|
6878
|
+
|
|
6879
|
+
// from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js
|
|
6880
|
+
var performance = global$1.performance || {};
|
|
6881
|
+
var performanceNow =
|
|
6882
|
+
performance.now ||
|
|
6883
|
+
performance.mozNow ||
|
|
6884
|
+
performance.msNow ||
|
|
6885
|
+
performance.oNow ||
|
|
6886
|
+
performance.webkitNow ||
|
|
6887
|
+
function(){ return (new Date()).getTime() };
|
|
6888
|
+
|
|
6889
|
+
// generate timestamp or delta
|
|
6890
|
+
// see http://nodejs.org/api/process.html#process_process_hrtime
|
|
6891
|
+
function hrtime(previousTimestamp){
|
|
6892
|
+
var clocktime = performanceNow.call(performance)*1e-3;
|
|
6893
|
+
var seconds = Math.floor(clocktime);
|
|
6894
|
+
var nanoseconds = Math.floor((clocktime%1)*1e9);
|
|
6895
|
+
if (previousTimestamp) {
|
|
6896
|
+
seconds = seconds - previousTimestamp[0];
|
|
6897
|
+
nanoseconds = nanoseconds - previousTimestamp[1];
|
|
6898
|
+
if (nanoseconds<0) {
|
|
6899
|
+
seconds--;
|
|
6900
|
+
nanoseconds += 1e9;
|
|
6901
|
+
}
|
|
6902
|
+
}
|
|
6903
|
+
return [seconds,nanoseconds]
|
|
6904
|
+
}
|
|
6905
|
+
|
|
6906
|
+
var startTime = new Date();
|
|
6907
|
+
function uptime() {
|
|
6908
|
+
var currentTime = new Date();
|
|
6909
|
+
var dif = currentTime - startTime;
|
|
6910
|
+
return dif / 1000;
|
|
6911
|
+
}
|
|
6912
|
+
|
|
6913
|
+
var browser$1 = {
|
|
6914
|
+
nextTick: nextTick,
|
|
6915
|
+
title: title,
|
|
6916
|
+
browser: browser,
|
|
6917
|
+
env: env,
|
|
6918
|
+
argv: argv,
|
|
6919
|
+
version: version,
|
|
6920
|
+
versions: versions,
|
|
6921
|
+
on: on,
|
|
6922
|
+
addListener: addListener,
|
|
6923
|
+
once: once,
|
|
6924
|
+
off: off,
|
|
6925
|
+
removeListener: removeListener,
|
|
6926
|
+
removeAllListeners: removeAllListeners,
|
|
6927
|
+
emit: emit,
|
|
6928
|
+
binding: binding,
|
|
6929
|
+
cwd: cwd,
|
|
6930
|
+
chdir: chdir,
|
|
6931
|
+
umask: umask,
|
|
6932
|
+
hrtime: hrtime,
|
|
6933
|
+
platform: platform$1,
|
|
6934
|
+
release: release,
|
|
6935
|
+
config: config,
|
|
6936
|
+
uptime: uptime
|
|
6937
|
+
};
|
|
6938
|
+
|
|
7645
6939
|
/*! *****************************************************************************
|
|
7646
6940
|
Copyright (C) Microsoft. All rights reserved.
|
|
7647
6941
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
@@ -7707,7 +7001,7 @@ var Reflect$1;
|
|
|
7707
7001
|
};
|
|
7708
7002
|
// Load global or shim versions of Map, Set, and WeakMap
|
|
7709
7003
|
var functionPrototype = Object.getPrototypeOf(Function);
|
|
7710
|
-
var usePolyfill = typeof browser$1
|
|
7004
|
+
var usePolyfill = typeof browser$1 === "object" && browser$1.env && browser$1.env["REFLECT_METADATA_USE_MAP_POLYFILL"] === "true";
|
|
7711
7005
|
var _Map = !usePolyfill && typeof Map === "function" && typeof Map.prototype.entries === "function" ? Map : CreateMapPolyfill();
|
|
7712
7006
|
var _Set = !usePolyfill && typeof Set === "function" && typeof Set.prototype.entries === "function" ? Set : CreateSetPolyfill();
|
|
7713
7007
|
var _WeakMap = !usePolyfill && typeof WeakMap === "function" ? WeakMap : CreateWeakMapPolyfill();
|
|
@@ -9278,17 +8572,17 @@ class SDKCreator {
|
|
|
9278
8572
|
const resData = yield response.json();
|
|
9279
8573
|
if (resData.error === 0 && resData.data) {
|
|
9280
8574
|
users = uIds.map((item) => {
|
|
9281
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
8575
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
9282
8576
|
return {
|
|
9283
|
-
id: item,
|
|
8577
|
+
id: ((_b = (_a = resData.data[item]) === null || _a === void 0 ? void 0 : _a.user_info) === null || _b === void 0 ? void 0 : _b.user_id_by_app) || "",
|
|
9284
8578
|
profile: {
|
|
9285
|
-
name: (
|
|
9286
|
-
avatar: (
|
|
8579
|
+
name: (_d = (_c = resData.data[item]) === null || _c === void 0 ? void 0 : _c.user_info) === null || _d === void 0 ? void 0 : _d.name,
|
|
8580
|
+
avatar: (_h = (_g = (_f = (_e = resData.data[item]) === null || _e === void 0 ? void 0 : _e.user_info) === null || _f === void 0 ? void 0 : _f.picture) === null || _g === void 0 ? void 0 : _g.data) === null || _h === void 0 ? void 0 : _h.url
|
|
9287
8581
|
},
|
|
9288
|
-
code: ((
|
|
9289
|
-
message: `Get profile: ${_.isUndefined((
|
|
8582
|
+
code: ((_j = resData.data[item]) === null || _j === void 0 ? void 0 : _j.error) !== 0 ? -1 : 0,
|
|
8583
|
+
message: `Get profile: ${_.isUndefined((_k = resData.data[item]) === null || _k === void 0 ? void 0 : _k.message)
|
|
9290
8584
|
? 'Unknown error'
|
|
9291
|
-
: (
|
|
8585
|
+
: (_l = resData.data[item]) === null || _l === void 0 ? void 0 : _l.message}`
|
|
9292
8586
|
};
|
|
9293
8587
|
});
|
|
9294
8588
|
}
|