diff --git a/packages/uni-app-plus/dist/uni-app-service.es.js b/packages/uni-app-plus/dist/uni-app-service.es.js index 71d91714c2acc9541bfb7fc80bfe48ad028986f4..dc9c9c26510e6798f232fcdc6a3e78de865b8ef9 100644 --- a/packages/uni-app-plus/dist/uni-app-service.es.js +++ b/packages/uni-app-plus/dist/uni-app-service.es.js @@ -1738,9 +1738,6 @@ var serviceContext = (function (vue) { emitter.off(`${subscribeNamespace}.${event}`, callback); }, subscribeHandler(event, args, pageId) { - if ((process.env.NODE_ENV !== 'production')) { - console.log(formatLog(subscribeNamespace, 'subscribeHandler', pageId, event, args)); - } emitter.emit(`${subscribeNamespace}.${event}`, args, pageId); }, }; @@ -1959,9 +1956,6 @@ var serviceContext = (function (vue) { } else { publish({}); - if ((process.env.NODE_ENV !== 'production')) { - console.error(formatLog('invokeViewMethod', name, 'not register')); - } } } @@ -2465,8 +2459,8 @@ var serviceContext = (function (vue) { getCenterLocation(options) { operateMapWrap(this.id, this.pageId, 'getCenterLocation', options); } - moveToLocation() { - operateMapWrap(this.id, this.pageId, 'moveToLocation'); + moveToLocation(options) { + operateMapWrap(this.id, this.pageId, 'moveToLocation', options); } getScale(options) { operateMapWrap(this.id, this.pageId, 'getScale', options); @@ -6441,20 +6435,19 @@ var serviceContext = (function (vue) { }, }), style: { - // @ts-ignore + // @ts-expect-error animationType: options.animationType || 'pop-in', titleNView: { autoBackButton: true, - // @ts-ignore type: 'float', - // @ts-ignore + // @ts-expect-error titleText: options.titleText || t('uni.scanCode.title'), titleColor: '#ffffff', backgroundColor: 'rgba(0,0,0,0)', buttons: !options.onlyFromCamera ? [ { - // @ts-ignore + // @ts-expect-error text: options.albumText || t('uni.scanCode.album'), fontSize: '17px', width: '60px', @@ -8241,8 +8234,7 @@ var serviceContext = (function (vue) { style: { // @ts-ignore animationType: options.animationType || 'slide-in-bottom', - // @ts-ignore - titleNView: false, + titleNView: undefined, popGesture: 'close', scrollIndicator: 'none', }, @@ -8606,7 +8598,6 @@ var serviceContext = (function (vue) { province: wechatUserInfo.province, country: wechatUserInfo.country, avatarUrl: wechatUserInfo.headimgurl, - // @ts-ignore unionId: wechatUserInfo.unionid, }; } @@ -8988,6 +8979,7 @@ var serviceContext = (function (vue) { function backbuttonListener() { uni.navigateBack({ from: 'backbutton', + success() { }, // 传入空方法,避免返回Promise,因为onBackPress可能导致fail }); } @@ -11155,7 +11147,7 @@ var serviceContext = (function (vue) { UniServiceJSBridge: UniServiceJSBridge$1, }; - /*! pako 2.0.3 https://github.com/nodeca/pako @license (MIT AND Zlib) */ + /*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */ // (C) 1995-2013 Jean-loup Gailly and Mark Adler // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin // @@ -11184,19 +11176,19 @@ var serviceContext = (function (vue) { //const Z_FILTERED = 1; //const Z_HUFFMAN_ONLY = 2; //const Z_RLE = 3; - const Z_FIXED = 4; + const Z_FIXED$1 = 4; //const Z_DEFAULT_STRATEGY = 0; /* Possible values of the data_type field (though see inflate()) */ const Z_BINARY = 0; const Z_TEXT = 1; //const Z_ASCII = 1; // = Z_TEXT - const Z_UNKNOWN = 2; + const Z_UNKNOWN$1 = 2; /*============================================================================*/ - function zero(buf) { let len = buf.length; while (--len >= 0) { buf[len] = 0; } } + function zero$1(buf) { let len = buf.length; while (--len >= 0) { buf[len] = 0; } } // From zutil.h @@ -11205,8 +11197,8 @@ var serviceContext = (function (vue) { const DYN_TREES = 2; /* The three kinds of block type */ - const MIN_MATCH = 3; - const MAX_MATCH = 258; + const MIN_MATCH$1 = 3; + const MAX_MATCH$1 = 258; /* The minimum and maximum match lengths */ // From deflate.h @@ -11214,25 +11206,25 @@ var serviceContext = (function (vue) { * Internal compression state. */ - const LENGTH_CODES = 29; + const LENGTH_CODES$1 = 29; /* number of length codes, not counting the special END_BLOCK code */ - const LITERALS = 256; + const LITERALS$1 = 256; /* number of literal bytes 0..255 */ - const L_CODES = LITERALS + 1 + LENGTH_CODES; + const L_CODES$1 = LITERALS$1 + 1 + LENGTH_CODES$1; /* number of Literal or Length codes, including the END_BLOCK code */ - const D_CODES = 30; + const D_CODES$1 = 30; /* number of distance codes */ - const BL_CODES = 19; + const BL_CODES$1 = 19; /* number of codes used to transfer the bit lengths */ - const HEAP_SIZE = 2 * L_CODES + 1; + const HEAP_SIZE$1 = 2 * L_CODES$1 + 1; /* maximum heap size */ - const MAX_BITS = 15; + const MAX_BITS$1 = 15; /* All codes must not exceed MAX_BITS bits */ const Buf_size = 16; @@ -11285,37 +11277,37 @@ var serviceContext = (function (vue) { const DIST_CODE_LEN = 512; /* see definition of array dist_code below */ // !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1 - const static_ltree = new Array((L_CODES + 2) * 2); - zero(static_ltree); + const static_ltree = new Array((L_CODES$1 + 2) * 2); + zero$1(static_ltree); /* The static literal tree. Since the bit lengths are imposed, there is no * need for the L_CODES extra codes used during heap construction. However * The codes 286 and 287 are needed to build a canonical tree (see _tr_init * below). */ - const static_dtree = new Array(D_CODES * 2); - zero(static_dtree); + const static_dtree = new Array(D_CODES$1 * 2); + zero$1(static_dtree); /* The static distance tree. (Actually a trivial tree since all codes use * 5 bits.) */ const _dist_code = new Array(DIST_CODE_LEN); - zero(_dist_code); + zero$1(_dist_code); /* Distance codes. The first 256 values correspond to the distances * 3 .. 258, the last 256 values correspond to the top 8 bits of * the 15 bit distances. */ - const _length_code = new Array(MAX_MATCH - MIN_MATCH + 1); - zero(_length_code); + const _length_code = new Array(MAX_MATCH$1 - MIN_MATCH$1 + 1); + zero$1(_length_code); /* length code for each normalized match length (0 == MIN_MATCH) */ - const base_length = new Array(LENGTH_CODES); - zero(base_length); + const base_length = new Array(LENGTH_CODES$1); + zero$1(base_length); /* First normalized length for each code (0 = MIN_MATCH) */ - const base_dist = new Array(D_CODES); - zero(base_dist); + const base_dist = new Array(D_CODES$1); + zero$1(base_dist); /* First normalized distance for each code (0 = distance of 1) */ @@ -11450,7 +11442,7 @@ var serviceContext = (function (vue) { let f; /* frequency */ let overflow = 0; /* number of elements with bit length too large */ - for (bits = 0; bits <= MAX_BITS; bits++) { + for (bits = 0; bits <= MAX_BITS$1; bits++) { s.bl_count[bits] = 0; } @@ -11459,7 +11451,7 @@ var serviceContext = (function (vue) { */ tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */ - for (h = s.heap_max + 1; h < HEAP_SIZE; h++) { + for (h = s.heap_max + 1; h < HEAP_SIZE$1; h++) { n = s.heap[h]; bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1; if (bits > max_length) { @@ -11534,7 +11526,7 @@ var serviceContext = (function (vue) { // int max_code; /* largest code with non zero frequency */ // ushf *bl_count; /* number of codes at each bit length */ { - const next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */ + const next_code = new Array(MAX_BITS$1 + 1); /* next code value for each bit length */ let code = 0; /* running code value */ let bits; /* bit index */ let n; /* code index */ @@ -11542,7 +11534,7 @@ var serviceContext = (function (vue) { /* The distribution counts are first used to generate the code values * without bit reversal. */ - for (bits = 1; bits <= MAX_BITS; bits++) { + for (bits = 1; bits <= MAX_BITS$1; bits++) { next_code[bits] = code = (code + bl_count[bits - 1]) << 1; } /* Check that the bit counts in bl_count are consistent. The last code @@ -11574,7 +11566,7 @@ var serviceContext = (function (vue) { let length; /* length value */ let code; /* code value */ let dist; /* distance index */ - const bl_count = new Array(MAX_BITS + 1); + const bl_count = new Array(MAX_BITS$1 + 1); /* number of codes at each bit length for an optimal tree */ // do check in _tr_init() @@ -11591,7 +11583,7 @@ var serviceContext = (function (vue) { /* Initialize the mapping length (0..255) -> length code (0..28) */ length = 0; - for (code = 0; code < LENGTH_CODES - 1; code++) { + for (code = 0; code < LENGTH_CODES$1 - 1; code++) { base_length[code] = length; for (n = 0; n < (1 << extra_lbits[code]); n++) { _length_code[length++] = code; @@ -11614,7 +11606,7 @@ var serviceContext = (function (vue) { } //Assert (dist == 256, "tr_static_init: dist != 256"); dist >>= 7; /* from now on, all distances are divided by 128 */ - for (; code < D_CODES; code++) { + for (; code < D_CODES$1; code++) { base_dist[code] = dist << 7; for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) { _dist_code[256 + dist++] = code; @@ -11623,7 +11615,7 @@ var serviceContext = (function (vue) { //Assert (dist == 256, "tr_static_init: 256+dist != 512"); /* Construct the codes of the static literal tree */ - for (bits = 0; bits <= MAX_BITS; bits++) { + for (bits = 0; bits <= MAX_BITS$1; bits++) { bl_count[bits] = 0; } @@ -11652,18 +11644,18 @@ var serviceContext = (function (vue) { * tree construction to get a canonical Huffman tree (longest code * all ones) */ - gen_codes(static_ltree, L_CODES + 1, bl_count); + gen_codes(static_ltree, L_CODES$1 + 1, bl_count); /* The static distance tree is trivial: */ - for (n = 0; n < D_CODES; n++) { + for (n = 0; n < D_CODES$1; n++) { static_dtree[n * 2 + 1]/*.Len*/ = 5; static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5); } // Now data ready and we can init static trees - static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS); - static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS); - static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); + static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS$1 + 1, L_CODES$1, MAX_BITS$1); + static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES$1, MAX_BITS$1); + static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES$1, MAX_BL_BITS); //static_init_done = true; }; @@ -11677,9 +11669,9 @@ var serviceContext = (function (vue) { let n; /* iterates over tree elements */ /* Initialize the trees. */ - for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; } - for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; } - for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; } + for (n = 0; n < L_CODES$1; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; } + for (n = 0; n < D_CODES$1; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; } + for (n = 0; n < BL_CODES$1; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; } s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1; s.opt_len = s.static_len = 0; @@ -11799,7 +11791,7 @@ var serviceContext = (function (vue) { } else { /* Here, lc is the match length - MIN_MATCH */ code = _length_code[lc]; - send_code(s, code + LITERALS + 1, ltree); /* send the length code */ + send_code(s, code + LITERALS$1 + 1, ltree); /* send the length code */ extra = extra_lbits[code]; if (extra !== 0) { lc -= base_length[code]; @@ -11853,7 +11845,7 @@ var serviceContext = (function (vue) { * heap[0] is not used. */ s.heap_len = 0; - s.heap_max = HEAP_SIZE; + s.heap_max = HEAP_SIZE$1; for (n = 0; n < elems; n++) { if (tree[n * 2]/*.Freq*/ !== 0) { @@ -12087,7 +12079,7 @@ var serviceContext = (function (vue) { * requires that at least 4 bit length codes be sent. (appnote.txt says * 3 but the actual value used is 4.) */ - for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) { + for (max_blindex = BL_CODES$1 - 1; max_blindex >= 3; max_blindex--) { if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) { break; } @@ -12166,7 +12158,7 @@ var serviceContext = (function (vue) { s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) { return Z_TEXT; } - for (n = 32; n < LITERALS; n++) { + for (n = 32; n < LITERALS$1; n++) { if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) { return Z_TEXT; } @@ -12184,7 +12176,7 @@ var serviceContext = (function (vue) { /* =========================================================================== * Initialize the tree data structures for a new zlib stream. */ - const _tr_init = (s) => + const _tr_init$1 = (s) => { if (!static_init_done) { @@ -12207,7 +12199,7 @@ var serviceContext = (function (vue) { /* =========================================================================== * Send a stored block */ - const _tr_stored_block = (s, buf, stored_len, last) => + const _tr_stored_block$1 = (s, buf, stored_len, last) => //DeflateState *s; //charf *buf; /* input block */ //ulg stored_len; /* length of input block */ @@ -12222,7 +12214,7 @@ var serviceContext = (function (vue) { * Send one empty static block to give enough lookahead for inflate. * This takes 10 bits, of which 7 may remain in the bit buffer. */ - const _tr_align = (s) => { + const _tr_align$1 = (s) => { send_bits(s, STATIC_TREES << 1, 3); send_code(s, END_BLOCK, static_ltree); bi_flush(s); @@ -12233,7 +12225,7 @@ var serviceContext = (function (vue) { * Determine the best encoding for the current block: dynamic trees, static * trees or store, and output the encoded block to the zip file. */ - const _tr_flush_block = (s, buf, stored_len, last) => + const _tr_flush_block$1 = (s, buf, stored_len, last) => //DeflateState *s; //charf *buf; /* input block, or NULL if too old */ //ulg stored_len; /* length of input block */ @@ -12246,7 +12238,7 @@ var serviceContext = (function (vue) { if (s.level > 0) { /* Check if the file is binary or text */ - if (s.strm.data_type === Z_UNKNOWN) { + if (s.strm.data_type === Z_UNKNOWN$1) { s.strm.data_type = detect_data_type(s); } @@ -12291,9 +12283,9 @@ var serviceContext = (function (vue) { * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to * transform a block into a stored block. */ - _tr_stored_block(s, buf, stored_len, last); + _tr_stored_block$1(s, buf, stored_len, last); - } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) { + } else if (s.strategy === Z_FIXED$1 || static_lenb === opt_lenb) { send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3); compress_block(s, static_ltree, static_dtree); @@ -12320,7 +12312,7 @@ var serviceContext = (function (vue) { * Save the match info and tally the frequency counts. Return true if * the current block must be flushed. */ - const _tr_tally = (s, dist, lc) => + const _tr_tally$1 = (s, dist, lc) => // deflate_state *s; // unsigned dist; /* distance of matched string */ // unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ @@ -12344,7 +12336,7 @@ var serviceContext = (function (vue) { // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && // (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); - s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++; + s.dyn_ltree[(_length_code[lc] + LITERALS$1 + 1) * 2]/*.Freq*/++; s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++; } @@ -12378,11 +12370,11 @@ var serviceContext = (function (vue) { */ }; - var _tr_init_1 = _tr_init; - var _tr_stored_block_1 = _tr_stored_block; - var _tr_flush_block_1 = _tr_flush_block; - var _tr_tally_1 = _tr_tally; - var _tr_align_1 = _tr_align; + var _tr_init_1 = _tr_init$1; + var _tr_stored_block_1 = _tr_stored_block$1; + var _tr_flush_block_1 = _tr_flush_block$1; + var _tr_tally_1 = _tr_tally$1; + var _tr_align_1 = _tr_align$1; var trees = { _tr_init: _tr_init_1, @@ -12550,7 +12542,7 @@ var serviceContext = (function (vue) { // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. - var constants = { + var constants$2 = { /* Allowed flush values; see deflate() and inflate() below for details */ Z_NO_FLUSH: 0, @@ -12617,7 +12609,7 @@ var serviceContext = (function (vue) { // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. - const { _tr_init: _tr_init$1, _tr_stored_block: _tr_stored_block$1, _tr_flush_block: _tr_flush_block$1, _tr_tally: _tr_tally$1, _tr_align: _tr_align$1 } = trees; + const { _tr_init, _tr_stored_block, _tr_flush_block, _tr_tally, _tr_align } = trees; @@ -12626,42 +12618,42 @@ var serviceContext = (function (vue) { /* ===========================================================================*/ const { - Z_NO_FLUSH, Z_PARTIAL_FLUSH, Z_FULL_FLUSH, Z_FINISH, Z_BLOCK, - Z_OK, Z_STREAM_END, Z_STREAM_ERROR, Z_DATA_ERROR, Z_BUF_ERROR, - Z_DEFAULT_COMPRESSION, - Z_FILTERED, Z_HUFFMAN_ONLY, Z_RLE, Z_FIXED: Z_FIXED$1, Z_DEFAULT_STRATEGY, - Z_UNKNOWN: Z_UNKNOWN$1, - Z_DEFLATED - } = constants; + Z_NO_FLUSH: Z_NO_FLUSH$2, Z_PARTIAL_FLUSH, Z_FULL_FLUSH: Z_FULL_FLUSH$1, Z_FINISH: Z_FINISH$3, Z_BLOCK: Z_BLOCK$1, + Z_OK: Z_OK$3, Z_STREAM_END: Z_STREAM_END$3, Z_STREAM_ERROR: Z_STREAM_ERROR$2, Z_DATA_ERROR: Z_DATA_ERROR$2, Z_BUF_ERROR: Z_BUF_ERROR$1, + Z_DEFAULT_COMPRESSION: Z_DEFAULT_COMPRESSION$1, + Z_FILTERED, Z_HUFFMAN_ONLY, Z_RLE, Z_FIXED, Z_DEFAULT_STRATEGY: Z_DEFAULT_STRATEGY$1, + Z_UNKNOWN, + Z_DEFLATED: Z_DEFLATED$2 + } = constants$2; /*============================================================================*/ const MAX_MEM_LEVEL = 9; /* Maximum value for memLevel in deflateInit2 */ - const MAX_WBITS = 15; + const MAX_WBITS$1 = 15; /* 32K LZ77 window */ const DEF_MEM_LEVEL = 8; - const LENGTH_CODES$1 = 29; + const LENGTH_CODES = 29; /* number of length codes, not counting the special END_BLOCK code */ - const LITERALS$1 = 256; + const LITERALS = 256; /* number of literal bytes 0..255 */ - const L_CODES$1 = LITERALS$1 + 1 + LENGTH_CODES$1; + const L_CODES = LITERALS + 1 + LENGTH_CODES; /* number of Literal or Length codes, including the END_BLOCK code */ - const D_CODES$1 = 30; + const D_CODES = 30; /* number of distance codes */ - const BL_CODES$1 = 19; + const BL_CODES = 19; /* number of codes used to transfer the bit lengths */ - const HEAP_SIZE$1 = 2 * L_CODES$1 + 1; + const HEAP_SIZE = 2 * L_CODES + 1; /* maximum heap size */ - const MAX_BITS$1 = 15; + const MAX_BITS = 15; /* All codes must not exceed MAX_BITS bits */ - const MIN_MATCH$1 = 3; - const MAX_MATCH$1 = 258; - const MIN_LOOKAHEAD = (MAX_MATCH$1 + MIN_MATCH$1 + 1); + const MIN_MATCH = 3; + const MAX_MATCH = 258; + const MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1); const PRESET_DICT = 0x20; @@ -12689,7 +12681,7 @@ var serviceContext = (function (vue) { return ((f) << 1) - ((f) > 4 ? 9 : 0); }; - const zero$1 = (buf) => { + const zero = (buf) => { let len = buf.length; while (--len >= 0) { buf[len] = 0; } }; @@ -12730,7 +12722,7 @@ var serviceContext = (function (vue) { const flush_block_only = (s, last) => { - _tr_flush_block$1(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last); + _tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last); s.block_start = s.strstart; flush_pending(s.strm); }; @@ -12817,7 +12809,7 @@ var serviceContext = (function (vue) { * we prevent matches with the string of window index 0. */ - const strend = s.strstart + MAX_MATCH$1; + const strend = s.strstart + MAX_MATCH; let scan_end1 = _win[scan + best_len - 1]; let scan_end = _win[scan + best_len]; @@ -12880,8 +12872,8 @@ var serviceContext = (function (vue) { // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); - len = MAX_MATCH$1 - (strend - scan); - scan = strend - MAX_MATCH$1; + len = MAX_MATCH - (strend - scan); + scan = strend - MAX_MATCH; if (len > best_len) { s.match_start = cur_match; @@ -12995,7 +12987,7 @@ var serviceContext = (function (vue) { s.lookahead += n; /* Initialize the hash value now that we have some input: */ - if (s.lookahead + s.insert >= MIN_MATCH$1) { + if (s.lookahead + s.insert >= MIN_MATCH) { str = s.strstart - s.insert; s.ins_h = s.window[str]; @@ -13006,13 +12998,13 @@ var serviceContext = (function (vue) { //#endif while (s.insert) { /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ - s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]); s.prev[str & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = str; str++; s.insert--; - if (s.lookahead + s.insert < MIN_MATCH$1) { + if (s.lookahead + s.insert < MIN_MATCH) { break; } } @@ -13094,7 +13086,7 @@ var serviceContext = (function (vue) { // } fill_window(s); - if (s.lookahead === 0 && flush === Z_NO_FLUSH) { + if (s.lookahead === 0 && flush === Z_NO_FLUSH$2) { return BS_NEED_MORE; } @@ -13140,7 +13132,7 @@ var serviceContext = (function (vue) { s.insert = 0; - if (flush === Z_FINISH) { + if (flush === Z_FINISH$3) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { @@ -13182,7 +13174,7 @@ var serviceContext = (function (vue) { */ if (s.lookahead < MIN_LOOKAHEAD) { fill_window(s); - if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH$2) { return BS_NEED_MORE; } if (s.lookahead === 0) { @@ -13194,9 +13186,9 @@ var serviceContext = (function (vue) { * dictionary, and set hash_head to the head of the hash chain: */ hash_head = 0/*NIL*/; - if (s.lookahead >= MIN_MATCH$1) { + if (s.lookahead >= MIN_MATCH) { /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ @@ -13213,24 +13205,24 @@ var serviceContext = (function (vue) { s.match_length = longest_match(s, hash_head); /* longest_match() sets match_start */ } - if (s.match_length >= MIN_MATCH$1) { + if (s.match_length >= MIN_MATCH) { // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only /*** _tr_tally_dist(s, s.strstart - s.match_start, s.match_length - MIN_MATCH, bflush); ***/ - bflush = _tr_tally$1(s, s.strstart - s.match_start, s.match_length - MIN_MATCH$1); + bflush = _tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH); s.lookahead -= s.match_length; /* Insert new strings in the hash table only if the match length * is not too large. This saves time but degrades compression. */ - if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH$1) { + if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) { s.match_length--; /* string at strstart already in table */ do { s.strstart++; /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ @@ -13258,7 +13250,7 @@ var serviceContext = (function (vue) { /* No match, output a literal byte */ //Tracevv((stderr,"%c", s.window[s.strstart])); /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart]); + bflush = _tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; @@ -13272,8 +13264,8 @@ var serviceContext = (function (vue) { /***/ } } - s.insert = ((s.strstart < (MIN_MATCH$1 - 1)) ? s.strstart : MIN_MATCH$1 - 1); - if (flush === Z_FINISH) { + s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1); + if (flush === Z_FINISH$3) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { @@ -13314,7 +13306,7 @@ var serviceContext = (function (vue) { */ if (s.lookahead < MIN_LOOKAHEAD) { fill_window(s); - if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH$2) { return BS_NEED_MORE; } if (s.lookahead === 0) { break; } /* flush the current block */ @@ -13324,9 +13316,9 @@ var serviceContext = (function (vue) { * dictionary, and set hash_head to the head of the hash chain: */ hash_head = 0/*NIL*/; - if (s.lookahead >= MIN_MATCH$1) { + if (s.lookahead >= MIN_MATCH) { /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ @@ -13336,7 +13328,7 @@ var serviceContext = (function (vue) { */ s.prev_length = s.match_length; s.prev_match = s.match_start; - s.match_length = MIN_MATCH$1 - 1; + s.match_length = MIN_MATCH - 1; if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) { @@ -13348,26 +13340,26 @@ var serviceContext = (function (vue) { /* longest_match() sets match_start */ if (s.match_length <= 5 && - (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH$1 && s.strstart - s.match_start > 4096/*TOO_FAR*/))) { + (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) { /* If prev_match is also MIN_MATCH, match_start is garbage * but we will ignore the current match anyway. */ - s.match_length = MIN_MATCH$1 - 1; + s.match_length = MIN_MATCH - 1; } } /* If there was a match at the previous step and the current * match is not better, output the previous match: */ - if (s.prev_length >= MIN_MATCH$1 && s.match_length <= s.prev_length) { - max_insert = s.strstart + s.lookahead - MIN_MATCH$1; + if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) { + max_insert = s.strstart + s.lookahead - MIN_MATCH; /* Do not insert strings in hash table beyond this. */ //check_match(s, s.strstart-1, s.prev_match, s.prev_length); /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH, bflush);***/ - bflush = _tr_tally$1(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH$1); + bflush = _tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH); /* Insert in hash table all strings up to the end of the match. * strstart-1 and strstart are already inserted. If there is not * enough lookahead, the last two strings are not inserted in @@ -13378,14 +13370,14 @@ var serviceContext = (function (vue) { do { if (++s.strstart <= max_insert) { /*** INSERT_STRING(s, s.strstart, hash_head); ***/ - s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]); hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; s.head[s.ins_h] = s.strstart; /***/ } } while (--s.prev_length !== 0); s.match_available = 0; - s.match_length = MIN_MATCH$1 - 1; + s.match_length = MIN_MATCH - 1; s.strstart++; if (bflush) { @@ -13404,7 +13396,7 @@ var serviceContext = (function (vue) { */ //Tracevv((stderr,"%c", s->window[s->strstart-1])); /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart - 1]); + bflush = _tr_tally(s, 0, s.window[s.strstart - 1]); if (bflush) { /*** FLUSH_BLOCK_ONLY(s, 0) ***/ @@ -13429,12 +13421,12 @@ var serviceContext = (function (vue) { if (s.match_available) { //Tracevv((stderr,"%c", s->window[s->strstart-1])); /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart - 1]); + bflush = _tr_tally(s, 0, s.window[s.strstart - 1]); s.match_available = 0; } - s.insert = s.strstart < MIN_MATCH$1 - 1 ? s.strstart : MIN_MATCH$1 - 1; - if (flush === Z_FINISH) { + s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1; + if (flush === Z_FINISH$3) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { @@ -13474,9 +13466,9 @@ var serviceContext = (function (vue) { * at the end of the input file. We need MAX_MATCH bytes * for the longest run, plus one for the unrolled loop. */ - if (s.lookahead <= MAX_MATCH$1) { + if (s.lookahead <= MAX_MATCH) { fill_window(s); - if (s.lookahead <= MAX_MATCH$1 && flush === Z_NO_FLUSH) { + if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH$2) { return BS_NEED_MORE; } if (s.lookahead === 0) { break; } /* flush the current block */ @@ -13484,11 +13476,11 @@ var serviceContext = (function (vue) { /* See how many times the previous byte repeats */ s.match_length = 0; - if (s.lookahead >= MIN_MATCH$1 && s.strstart > 0) { + if (s.lookahead >= MIN_MATCH && s.strstart > 0) { scan = s.strstart - 1; prev = _win[scan]; if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) { - strend = s.strstart + MAX_MATCH$1; + strend = s.strstart + MAX_MATCH; do { /*jshint noempty:false*/ } while (prev === _win[++scan] && prev === _win[++scan] && @@ -13496,7 +13488,7 @@ var serviceContext = (function (vue) { prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend); - s.match_length = MAX_MATCH$1 - (strend - scan); + s.match_length = MAX_MATCH - (strend - scan); if (s.match_length > s.lookahead) { s.match_length = s.lookahead; } @@ -13505,11 +13497,11 @@ var serviceContext = (function (vue) { } /* Emit match if have run of MIN_MATCH or longer, else emit literal */ - if (s.match_length >= MIN_MATCH$1) { + if (s.match_length >= MIN_MATCH) { //check_match(s, s.strstart, s.strstart - 1, s.match_length); /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/ - bflush = _tr_tally$1(s, 1, s.match_length - MIN_MATCH$1); + bflush = _tr_tally(s, 1, s.match_length - MIN_MATCH); s.lookahead -= s.match_length; s.strstart += s.match_length; @@ -13518,7 +13510,7 @@ var serviceContext = (function (vue) { /* No match, output a literal byte */ //Tracevv((stderr,"%c", s->window[s->strstart])); /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart]); + bflush = _tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; @@ -13533,7 +13525,7 @@ var serviceContext = (function (vue) { } } s.insert = 0; - if (flush === Z_FINISH) { + if (flush === Z_FINISH$3) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { @@ -13566,7 +13558,7 @@ var serviceContext = (function (vue) { if (s.lookahead === 0) { fill_window(s); if (s.lookahead === 0) { - if (flush === Z_NO_FLUSH) { + if (flush === Z_NO_FLUSH$2) { return BS_NEED_MORE; } break; /* flush the current block */ @@ -13577,7 +13569,7 @@ var serviceContext = (function (vue) { s.match_length = 0; //Tracevv((stderr,"%c", s->window[s->strstart])); /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ - bflush = _tr_tally$1(s, 0, s.window[s.strstart]); + bflush = _tr_tally(s, 0, s.window[s.strstart]); s.lookahead--; s.strstart++; if (bflush) { @@ -13590,7 +13582,7 @@ var serviceContext = (function (vue) { } } s.insert = 0; - if (flush === Z_FINISH) { + if (flush === Z_FINISH$3) { /*** FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true); if (s.strm.avail_out === 0) { @@ -13648,7 +13640,7 @@ var serviceContext = (function (vue) { s.window_size = 2 * s.w_size; /*** CLEAR_HASH(s); ***/ - zero$1(s.head); // Fill with NIL (= 0); + zero(s.head); // Fill with NIL (= 0); /* Set the default configuration parameters: */ @@ -13661,7 +13653,7 @@ var serviceContext = (function (vue) { s.block_start = 0; s.lookahead = 0; s.insert = 0; - s.match_length = s.prev_length = MIN_MATCH$1 - 1; + s.match_length = s.prev_length = MIN_MATCH - 1; s.match_available = 0; s.ins_h = 0; }; @@ -13677,7 +13669,7 @@ var serviceContext = (function (vue) { this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */ this.gzhead = null; /* gzip header information to write */ this.gzindex = 0; /* where in extra, name, or comment */ - this.method = Z_DEFLATED; /* can only be DEFLATED */ + this.method = Z_DEFLATED$2; /* can only be DEFLATED */ this.last_flush = -1; /* value of flush param for previous deflate call */ this.w_size = 0; /* LZ77 window size (32K by default) */ @@ -13770,24 +13762,24 @@ var serviceContext = (function (vue) { // Use flat array of DOUBLE size, with interleaved fata, // because JS does not support effective - this.dyn_ltree = new Uint16Array(HEAP_SIZE$1 * 2); - this.dyn_dtree = new Uint16Array((2 * D_CODES$1 + 1) * 2); - this.bl_tree = new Uint16Array((2 * BL_CODES$1 + 1) * 2); - zero$1(this.dyn_ltree); - zero$1(this.dyn_dtree); - zero$1(this.bl_tree); + this.dyn_ltree = new Uint16Array(HEAP_SIZE * 2); + this.dyn_dtree = new Uint16Array((2 * D_CODES + 1) * 2); + this.bl_tree = new Uint16Array((2 * BL_CODES + 1) * 2); + zero(this.dyn_ltree); + zero(this.dyn_dtree); + zero(this.bl_tree); this.l_desc = null; /* desc. for literal tree */ this.d_desc = null; /* desc. for distance tree */ this.bl_desc = null; /* desc. for bit length tree */ //ush bl_count[MAX_BITS+1]; - this.bl_count = new Uint16Array(MAX_BITS$1 + 1); + this.bl_count = new Uint16Array(MAX_BITS + 1); /* number of codes at each bit length for an optimal tree */ //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ - this.heap = new Uint16Array(2 * L_CODES$1 + 1); /* heap used to build the Huffman trees */ - zero$1(this.heap); + this.heap = new Uint16Array(2 * L_CODES + 1); /* heap used to build the Huffman trees */ + zero(this.heap); this.heap_len = 0; /* number of elements in the heap */ this.heap_max = 0; /* element of largest frequency */ @@ -13795,8 +13787,8 @@ var serviceContext = (function (vue) { * The same heap array is used to build all trees. */ - this.depth = new Uint16Array(2 * L_CODES$1 + 1); //uch depth[2*L_CODES+1]; - zero$1(this.depth); + this.depth = new Uint16Array(2 * L_CODES + 1); //uch depth[2*L_CODES+1]; + zero(this.depth); /* Depth of each subtree used as tie breaker for trees of equal frequency */ @@ -13859,11 +13851,11 @@ var serviceContext = (function (vue) { const deflateResetKeep = (strm) => { if (!strm || !strm.state) { - return err(strm, Z_STREAM_ERROR); + return err(strm, Z_STREAM_ERROR$2); } strm.total_in = strm.total_out = 0; - strm.data_type = Z_UNKNOWN$1; + strm.data_type = Z_UNKNOWN; const s = strm.state; s.pending = 0; @@ -13878,16 +13870,16 @@ var serviceContext = (function (vue) { 0 // crc32(0, Z_NULL, 0) : 1; // adler32(0, Z_NULL, 0) - s.last_flush = Z_NO_FLUSH; - _tr_init$1(s); - return Z_OK; + s.last_flush = Z_NO_FLUSH$2; + _tr_init(s); + return Z_OK$3; }; const deflateReset = (strm) => { const ret = deflateResetKeep(strm); - if (ret === Z_OK) { + if (ret === Z_OK$3) { lm_init(strm.state); } return ret; @@ -13896,21 +13888,21 @@ var serviceContext = (function (vue) { const deflateSetHeader = (strm, head) => { - if (!strm || !strm.state) { return Z_STREAM_ERROR; } - if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; } + if (!strm || !strm.state) { return Z_STREAM_ERROR$2; } + if (strm.state.wrap !== 2) { return Z_STREAM_ERROR$2; } strm.state.gzhead = head; - return Z_OK; + return Z_OK$3; }; const deflateInit2 = (strm, level, method, windowBits, memLevel, strategy) => { if (!strm) { // === Z_NULL - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$2; } let wrap = 1; - if (level === Z_DEFAULT_COMPRESSION) { + if (level === Z_DEFAULT_COMPRESSION$1) { level = 6; } @@ -13925,10 +13917,10 @@ var serviceContext = (function (vue) { } - if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || + if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED$2 || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || - strategy < 0 || strategy > Z_FIXED$1) { - return err(strm, Z_STREAM_ERROR); + strategy < 0 || strategy > Z_FIXED) { + return err(strm, Z_STREAM_ERROR$2); } @@ -13951,7 +13943,7 @@ var serviceContext = (function (vue) { s.hash_bits = memLevel + 7; s.hash_size = 1 << s.hash_bits; s.hash_mask = s.hash_size - 1; - s.hash_shift = ~~((s.hash_bits + MIN_MATCH$1 - 1) / MIN_MATCH$1); + s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH); s.window = new Uint8Array(s.w_size * 2); s.head = new Uint16Array(s.hash_size); @@ -13984,25 +13976,25 @@ var serviceContext = (function (vue) { const deflateInit = (strm, level) => { - return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY); + return deflateInit2(strm, level, Z_DEFLATED$2, MAX_WBITS$1, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY$1); }; - const deflate = (strm, flush) => { + const deflate$2 = (strm, flush) => { let beg, val; // for gzip header write only if (!strm || !strm.state || - flush > Z_BLOCK || flush < 0) { - return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR; + flush > Z_BLOCK$1 || flush < 0) { + return strm ? err(strm, Z_STREAM_ERROR$2) : Z_STREAM_ERROR$2; } const s = strm.state; if (!strm.output || (!strm.input && strm.avail_in !== 0) || - (s.status === FINISH_STATE && flush !== Z_FINISH)) { - return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR); + (s.status === FINISH_STATE && flush !== Z_FINISH$3)) { + return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR$1 : Z_STREAM_ERROR$2); } s.strm = strm; /* just in case */ @@ -14057,7 +14049,7 @@ var serviceContext = (function (vue) { } else // DEFLATE header { - let header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8; + let header = (Z_DEFLATED$2 + ((s.w_bits - 8) << 4)) << 8; let level_flags = -1; if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) { @@ -14220,7 +14212,7 @@ var serviceContext = (function (vue) { * return OK instead of BUF_ERROR at next call of deflate: */ s.last_flush = -1; - return Z_OK; + return Z_OK$3; } /* Make sure there is something to do and avoid duplicate consecutive @@ -14228,19 +14220,19 @@ var serviceContext = (function (vue) { * returning Z_STREAM_END instead of Z_BUF_ERROR. */ } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && - flush !== Z_FINISH) { - return err(strm, Z_BUF_ERROR); + flush !== Z_FINISH$3) { + return err(strm, Z_BUF_ERROR$1); } /* User must not provide more input after the first FINISH: */ if (s.status === FINISH_STATE && strm.avail_in !== 0) { - return err(strm, Z_BUF_ERROR); + return err(strm, Z_BUF_ERROR$1); } /* Start a new block or continue the current one. */ if (strm.avail_in !== 0 || s.lookahead !== 0 || - (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) { + (flush !== Z_NO_FLUSH$2 && s.status !== FINISH_STATE)) { let bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) : (s.strategy === Z_RLE ? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush)); @@ -14253,7 +14245,7 @@ var serviceContext = (function (vue) { s.last_flush = -1; /* avoid BUF_ERROR next call, see above */ } - return Z_OK; + return Z_OK$3; /* If flush != Z_NO_FLUSH && avail_out == 0, the next call * of deflate should use the same flush parameter to make sure * that the flush is complete. So we don't have to output an @@ -14264,17 +14256,17 @@ var serviceContext = (function (vue) { } if (bstate === BS_BLOCK_DONE) { if (flush === Z_PARTIAL_FLUSH) { - _tr_align$1(s); + _tr_align(s); } - else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */ + else if (flush !== Z_BLOCK$1) { /* FULL_FLUSH or SYNC_FLUSH */ - _tr_stored_block$1(s, 0, 0, false); + _tr_stored_block(s, 0, 0, false); /* For a full flush, this empty block will be recognized * as a special marker by inflate_sync(). */ - if (flush === Z_FULL_FLUSH) { + if (flush === Z_FULL_FLUSH$1) { /*** CLEAR_HASH(s); ***/ /* forget history */ - zero$1(s.head); // Fill with NIL (= 0); + zero(s.head); // Fill with NIL (= 0); if (s.lookahead === 0) { s.strstart = 0; @@ -14286,15 +14278,15 @@ var serviceContext = (function (vue) { flush_pending(strm); if (strm.avail_out === 0) { s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */ - return Z_OK; + return Z_OK$3; } } } //Assert(strm->avail_out > 0, "bug2"); //if (strm.avail_out <= 0) { throw new Error("bug2");} - if (flush !== Z_FINISH) { return Z_OK; } - if (s.wrap <= 0) { return Z_STREAM_END; } + if (flush !== Z_FINISH$3) { return Z_OK$3; } + if (s.wrap <= 0) { return Z_STREAM_END$3; } /* Write the trailer */ if (s.wrap === 2) { @@ -14319,14 +14311,14 @@ var serviceContext = (function (vue) { */ if (s.wrap > 0) { s.wrap = -s.wrap; } /* write the trailer only once! */ - return s.pending !== 0 ? Z_OK : Z_STREAM_END; + return s.pending !== 0 ? Z_OK$3 : Z_STREAM_END$3; }; const deflateEnd = (strm) => { if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$2; } const status = strm.state.status; @@ -14338,12 +14330,12 @@ var serviceContext = (function (vue) { status !== BUSY_STATE && status !== FINISH_STATE ) { - return err(strm, Z_STREAM_ERROR); + return err(strm, Z_STREAM_ERROR$2); } strm.state = null; - return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK; + return status === BUSY_STATE ? err(strm, Z_DATA_ERROR$2) : Z_OK$3; }; @@ -14356,14 +14348,14 @@ var serviceContext = (function (vue) { let dictLength = dictionary.length; if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$2; } const s = strm.state; const wrap = s.wrap; if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) { - return Z_STREAM_ERROR; + return Z_STREAM_ERROR$2; } /* when using zlib wrappers, compute Adler-32 for provided dictionary */ @@ -14378,7 +14370,7 @@ var serviceContext = (function (vue) { if (dictLength >= s.w_size) { if (wrap === 0) { /* already empty otherwise */ /*** CLEAR_HASH(s); ***/ - zero$1(s.head); // Fill with NIL (= 0); + zero(s.head); // Fill with NIL (= 0); s.strstart = 0; s.block_start = 0; s.insert = 0; @@ -14398,12 +14390,12 @@ var serviceContext = (function (vue) { strm.next_in = 0; strm.input = dictionary; fill_window(s); - while (s.lookahead >= MIN_MATCH$1) { + while (s.lookahead >= MIN_MATCH) { let str = s.strstart; - let n = s.lookahead - (MIN_MATCH$1 - 1); + let n = s.lookahead - (MIN_MATCH - 1); do { /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ - s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH$1 - 1]); + s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH - 1]); s.prev[str & s.w_mask] = s.head[s.ins_h]; @@ -14411,20 +14403,20 @@ var serviceContext = (function (vue) { str++; } while (--n); s.strstart = str; - s.lookahead = MIN_MATCH$1 - 1; + s.lookahead = MIN_MATCH - 1; fill_window(s); } s.strstart += s.lookahead; s.block_start = s.strstart; s.insert = s.lookahead; s.lookahead = 0; - s.match_length = s.prev_length = MIN_MATCH$1 - 1; + s.match_length = s.prev_length = MIN_MATCH - 1; s.match_available = 0; strm.next_in = next; strm.input = input; strm.avail_in = avail; s.wrap = wrap; - return Z_OK; + return Z_OK$3; }; @@ -14433,7 +14425,7 @@ var serviceContext = (function (vue) { var deflateReset_1 = deflateReset; var deflateResetKeep_1 = deflateResetKeep; var deflateSetHeader_1 = deflateSetHeader; - var deflate_2 = deflate; + var deflate_2$1 = deflate$2; var deflateEnd_1 = deflateEnd; var deflateSetDictionary_1 = deflateSetDictionary; var deflateInfo = 'pako deflate (from Nodeca project)'; @@ -14447,13 +14439,13 @@ var serviceContext = (function (vue) { module.exports.deflateTune = deflateTune; */ - var deflate_1 = { + var deflate_1$2 = { deflateInit: deflateInit_1, deflateInit2: deflateInit2_1, deflateReset: deflateReset_1, deflateResetKeep: deflateResetKeep_1, deflateSetHeader: deflateSetHeader_1, - deflate: deflate_2, + deflate: deflate_2$1, deflateEnd: deflateEnd_1, deflateSetDictionary: deflateSetDictionary_1, deflateInfo: deflateInfo @@ -14535,6 +14527,10 @@ var serviceContext = (function (vue) { // convert string to array (typed, when possible) var string2buf = (str) => { + if (typeof TextEncoder === 'function' && TextEncoder.prototype.encode) { + return new TextEncoder().encode(str); + } + let buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; // count binary size @@ -14608,9 +14604,14 @@ var serviceContext = (function (vue) { // convert array to string var buf2string = (buf, max) => { - let i, out; const len = max || buf.length; + if (typeof TextDecoder === 'function' && TextDecoder.prototype.decode) { + return new TextDecoder().decode(buf.subarray(0, max)); + } + + let i, out; + // Reserve max possible length (2 words per char) // NB: by unknown reasons, Array is significantly faster for // String.fromCharCode.apply than Uint16Array. @@ -14727,18 +14728,18 @@ var serviceContext = (function (vue) { var zstream = ZStream; - const toString = Object.prototype.toString; + const toString$1 = Object.prototype.toString; /* Public constants ==========================================================*/ /* ===========================================================================*/ const { - Z_NO_FLUSH: Z_NO_FLUSH$1, Z_SYNC_FLUSH, Z_FULL_FLUSH: Z_FULL_FLUSH$1, Z_FINISH: Z_FINISH$1, - Z_OK: Z_OK$1, Z_STREAM_END: Z_STREAM_END$1, - Z_DEFAULT_COMPRESSION: Z_DEFAULT_COMPRESSION$1, - Z_DEFAULT_STRATEGY: Z_DEFAULT_STRATEGY$1, + Z_NO_FLUSH: Z_NO_FLUSH$1, Z_SYNC_FLUSH, Z_FULL_FLUSH, Z_FINISH: Z_FINISH$2, + Z_OK: Z_OK$2, Z_STREAM_END: Z_STREAM_END$2, + Z_DEFAULT_COMPRESSION, + Z_DEFAULT_STRATEGY, Z_DEFLATED: Z_DEFLATED$1 - } = constants; + } = constants$2; /* ===========================================================================*/ @@ -14828,14 +14829,14 @@ var serviceContext = (function (vue) { * console.log(deflate.result); * ``` **/ - function Deflate(options) { + function Deflate$1(options) { this.options = common.assign({ - level: Z_DEFAULT_COMPRESSION$1, + level: Z_DEFAULT_COMPRESSION, method: Z_DEFLATED$1, chunkSize: 16384, windowBits: 15, memLevel: 8, - strategy: Z_DEFAULT_STRATEGY$1 + strategy: Z_DEFAULT_STRATEGY }, options || {}); let opt = this.options; @@ -14856,7 +14857,7 @@ var serviceContext = (function (vue) { this.strm = new zstream(); this.strm.avail_out = 0; - let status = deflate_1.deflateInit2( + let status = deflate_1$2.deflateInit2( this.strm, opt.level, opt.method, @@ -14865,12 +14866,12 @@ var serviceContext = (function (vue) { opt.strategy ); - if (status !== Z_OK$1) { + if (status !== Z_OK$2) { throw new Error(messages[status]); } if (opt.header) { - deflate_1.deflateSetHeader(this.strm, opt.header); + deflate_1$2.deflateSetHeader(this.strm, opt.header); } if (opt.dictionary) { @@ -14879,15 +14880,15 @@ var serviceContext = (function (vue) { if (typeof opt.dictionary === 'string') { // If we need to compress text, change encoding to utf8. dict = strings.string2buf(opt.dictionary); - } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') { + } else if (toString$1.call(opt.dictionary) === '[object ArrayBuffer]') { dict = new Uint8Array(opt.dictionary); } else { dict = opt.dictionary; } - status = deflate_1.deflateSetDictionary(this.strm, dict); + status = deflate_1$2.deflateSetDictionary(this.strm, dict); - if (status !== Z_OK$1) { + if (status !== Z_OK$2) { throw new Error(messages[status]); } @@ -14917,7 +14918,7 @@ var serviceContext = (function (vue) { * push(chunk, true); // push last chunk * ``` **/ - Deflate.prototype.push = function (data, flush_mode) { + Deflate$1.prototype.push = function (data, flush_mode) { const strm = this.strm; const chunkSize = this.options.chunkSize; let status, _flush_mode; @@ -14925,13 +14926,13 @@ var serviceContext = (function (vue) { if (this.ended) { return false; } if (flush_mode === ~~flush_mode) _flush_mode = flush_mode; - else _flush_mode = flush_mode === true ? Z_FINISH$1 : Z_NO_FLUSH$1; + else _flush_mode = flush_mode === true ? Z_FINISH$2 : Z_NO_FLUSH$1; // Convert data if needed if (typeof data === 'string') { // If we need to compress text, change encoding to utf8. strm.input = strings.string2buf(data); - } else if (toString.call(data) === '[object ArrayBuffer]') { + } else if (toString$1.call(data) === '[object ArrayBuffer]') { strm.input = new Uint8Array(data); } else { strm.input = data; @@ -14948,23 +14949,23 @@ var serviceContext = (function (vue) { } // Make sure avail_out > 6 to avoid repeating markers - if ((_flush_mode === Z_SYNC_FLUSH || _flush_mode === Z_FULL_FLUSH$1) && strm.avail_out <= 6) { + if ((_flush_mode === Z_SYNC_FLUSH || _flush_mode === Z_FULL_FLUSH) && strm.avail_out <= 6) { this.onData(strm.output.subarray(0, strm.next_out)); strm.avail_out = 0; continue; } - status = deflate_1.deflate(strm, _flush_mode); + status = deflate_1$2.deflate(strm, _flush_mode); // Ended => flush and finish - if (status === Z_STREAM_END$1) { + if (status === Z_STREAM_END$2) { if (strm.next_out > 0) { this.onData(strm.output.subarray(0, strm.next_out)); } - status = deflate_1.deflateEnd(this.strm); + status = deflate_1$2.deflateEnd(this.strm); this.onEnd(status); this.ended = true; - return status === Z_OK$1; + return status === Z_OK$2; } // Flush if out buffer full @@ -14994,7 +14995,7 @@ var serviceContext = (function (vue) { * By default, stores data blocks in `chunks[]` property and glue * those in `onEnd`. Override this handler, if you need another behaviour. **/ - Deflate.prototype.onData = function (chunk) { + Deflate$1.prototype.onData = function (chunk) { this.chunks.push(chunk); }; @@ -15008,9 +15009,9 @@ var serviceContext = (function (vue) { * complete (Z_FINISH). By default - join collected chunks, * free memory and fill `results` / `err` properties. **/ - Deflate.prototype.onEnd = function (status) { + Deflate$1.prototype.onEnd = function (status) { // On success - join - if (status === Z_OK$1) { + if (status === Z_OK$2) { this.result = common.flattenChunks(this.chunks); } this.chunks = []; @@ -15052,7 +15053,7 @@ var serviceContext = (function (vue) { * ``` **/ function deflate$1(input, options) { - const deflator = new Deflate(options); + const deflator = new Deflate$1(options); deflator.push(input, true); @@ -15071,7 +15072,7 @@ var serviceContext = (function (vue) { * The same as [[deflate]], but creates raw data, without wrapper * (header and adler32 crc). **/ - function deflateRaw(input, options) { + function deflateRaw$1(input, options) { options = options || {}; options.raw = true; return deflate$1(input, options); @@ -15086,24 +15087,24 @@ var serviceContext = (function (vue) { * The same as [[deflate]], but create gzip wrapper instead of * deflate one. **/ - function gzip(input, options) { + function gzip$1(input, options) { options = options || {}; options.gzip = true; return deflate$1(input, options); } - var Deflate_1 = Deflate; - var deflate_2$1 = deflate$1; - var deflateRaw_1 = deflateRaw; - var gzip_1 = gzip; - var constants$1 = constants; + var Deflate_1$1 = Deflate$1; + var deflate_2 = deflate$1; + var deflateRaw_1$1 = deflateRaw$1; + var gzip_1$1 = gzip$1; + var constants$1 = constants$2; var deflate_1$1 = { - Deflate: Deflate_1, - deflate: deflate_2$1, - deflateRaw: deflateRaw_1, - gzip: gzip_1, + Deflate: Deflate_1$1, + deflate: deflate_2, + deflateRaw: deflateRaw_1$1, + gzip: gzip_1$1, constants: constants$1 }; @@ -15127,8 +15128,8 @@ var serviceContext = (function (vue) { // 3. This notice may not be removed or altered from any source distribution. // See state defs from inflate.js - const BAD = 30; /* got a data error -- remain here until reset */ - const TYPE = 12; /* i: waiting for type bits, including last-flag bit */ + const BAD$1 = 30; /* got a data error -- remain here until reset */ + const TYPE$1 = 12; /* i: waiting for type bits, including last-flag bit */ /* Decode literal, length, and distance codes and write out the resulting @@ -15290,7 +15291,7 @@ var serviceContext = (function (vue) { //#ifdef INFLATE_STRICT if (dist > dmax) { strm.msg = 'invalid distance too far back'; - state.mode = BAD; + state.mode = BAD$1; break top; } //#endif @@ -15303,7 +15304,7 @@ var serviceContext = (function (vue) { if (op > whave) { if (state.sane) { strm.msg = 'invalid distance too far back'; - state.mode = BAD; + state.mode = BAD$1; break top; } @@ -15408,7 +15409,7 @@ var serviceContext = (function (vue) { } else { strm.msg = 'invalid distance code'; - state.mode = BAD; + state.mode = BAD$1; break top; } @@ -15421,12 +15422,12 @@ var serviceContext = (function (vue) { } else if (op & 32) { /* end-of-block */ //Tracevv((stderr, "inflate: end of block\n")); - state.mode = TYPE; + state.mode = TYPE$1; break top; } else { strm.msg = 'invalid literal/length code'; - state.mode = BAD; + state.mode = BAD$1; break top; } @@ -15470,13 +15471,13 @@ var serviceContext = (function (vue) { // 3. This notice may not be removed or altered from any source distribution. const MAXBITS = 15; - const ENOUGH_LENS = 852; - const ENOUGH_DISTS = 592; + const ENOUGH_LENS$1 = 852; + const ENOUGH_DISTS$1 = 592; //const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); - const CODES = 0; - const LENS = 1; - const DISTS = 2; + const CODES$1 = 0; + const LENS$1 = 1; + const DISTS$1 = 2; const lbase = new Uint16Array([ /* Length codes 257..285 base */ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, @@ -15608,7 +15609,7 @@ var serviceContext = (function (vue) { return -1; } /* over-subscribed */ } - if (left > 0 && (type === CODES || max !== 1)) { + if (left > 0 && (type === CODES$1 || max !== 1)) { return -1; /* incomplete set */ } @@ -15659,11 +15660,11 @@ var serviceContext = (function (vue) { /* set up for code type */ // poor man optimization - use if-else instead of switch, // to avoid deopts in old v8 - if (type === CODES) { + if (type === CODES$1) { base = extra = work; /* dummy value--not used */ end = 19; - } else if (type === LENS) { + } else if (type === LENS$1) { base = lbase; base_index -= 257; extra = lext; @@ -15688,8 +15689,8 @@ var serviceContext = (function (vue) { mask = used - 1; /* mask for comparing low */ /* check available table space */ - if ((type === LENS && used > ENOUGH_LENS) || - (type === DISTS && used > ENOUGH_DISTS)) { + if ((type === LENS$1 && used > ENOUGH_LENS$1) || + (type === DISTS$1 && used > ENOUGH_DISTS$1)) { return 1; } @@ -15760,8 +15761,8 @@ var serviceContext = (function (vue) { /* check for enough space */ used += 1 << curr; - if ((type === LENS && used > ENOUGH_LENS) || - (type === DISTS && used > ENOUGH_DISTS)) { + if ((type === LENS$1 && used > ENOUGH_LENS$1) || + (type === DISTS$1 && used > ENOUGH_DISTS$1)) { return 1; } @@ -15817,18 +15818,18 @@ var serviceContext = (function (vue) { - const CODES$1 = 0; - const LENS$1 = 1; - const DISTS$1 = 2; + const CODES = 0; + const LENS = 1; + const DISTS = 2; /* Public constants ==========================================================*/ /* ===========================================================================*/ const { - Z_FINISH: Z_FINISH$2, Z_BLOCK: Z_BLOCK$1, Z_TREES, - Z_OK: Z_OK$2, Z_STREAM_END: Z_STREAM_END$2, Z_NEED_DICT, Z_STREAM_ERROR: Z_STREAM_ERROR$1, Z_DATA_ERROR: Z_DATA_ERROR$1, Z_MEM_ERROR, Z_BUF_ERROR: Z_BUF_ERROR$1, - Z_DEFLATED: Z_DEFLATED$2 - } = constants; + Z_FINISH: Z_FINISH$1, Z_BLOCK, Z_TREES, + Z_OK: Z_OK$1, Z_STREAM_END: Z_STREAM_END$1, Z_NEED_DICT: Z_NEED_DICT$1, Z_STREAM_ERROR: Z_STREAM_ERROR$1, Z_DATA_ERROR: Z_DATA_ERROR$1, Z_MEM_ERROR: Z_MEM_ERROR$1, Z_BUF_ERROR, + Z_DEFLATED + } = constants$2; /* STATES ====================================================================*/ @@ -15846,7 +15847,7 @@ var serviceContext = (function (vue) { const HCRC = 9; /* i: waiting for header crc (gzip) */ const DICTID = 10; /* i: waiting for dictionary check value */ const DICT = 11; /* waiting for inflateSetDictionary() call */ - const TYPE$1 = 12; /* i: waiting for type bits, including last-flag bit */ + const TYPE = 12; /* i: waiting for type bits, including last-flag bit */ const TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */ const STORED = 14; /* i: waiting for stored size (length and complement) */ const COPY_ = 15; /* i/o: same as COPY below, but only first time in */ @@ -15864,7 +15865,7 @@ var serviceContext = (function (vue) { const CHECK = 27; /* i: waiting for 32-bit check value */ const LENGTH = 28; /* i: waiting for 32-bit length (gzip) */ const DONE = 29; /* finished check, done -- remain here until reset */ - const BAD$1 = 30; /* got a data error -- remain here until reset */ + const BAD = 30; /* got a data error -- remain here until reset */ const MEM = 31; /* got an inflate() memory error -- remain here until reset */ const SYNC = 32; /* looking for synchronization bytes to restart inflate() */ @@ -15872,13 +15873,13 @@ var serviceContext = (function (vue) { - const ENOUGH_LENS$1 = 852; - const ENOUGH_DISTS$1 = 592; + const ENOUGH_LENS = 852; + const ENOUGH_DISTS = 592; //const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); - const MAX_WBITS$1 = 15; + const MAX_WBITS = 15; /* 32K LZ77 window */ - const DEF_WBITS = MAX_WBITS$1; + const DEF_WBITS = MAX_WBITS; const zswap32 = (q) => { @@ -15966,13 +15967,13 @@ var serviceContext = (function (vue) { state.hold = 0; state.bits = 0; //state.lencode = state.distcode = state.next = state.codes; - state.lencode = state.lendyn = new Int32Array(ENOUGH_LENS$1); - state.distcode = state.distdyn = new Int32Array(ENOUGH_DISTS$1); + state.lencode = state.lendyn = new Int32Array(ENOUGH_LENS); + state.distcode = state.distdyn = new Int32Array(ENOUGH_DISTS); state.sane = 1; state.back = -1; //Tracev((stderr, "inflate: reset\n")); - return Z_OK$2; + return Z_OK$1; }; @@ -16034,7 +16035,7 @@ var serviceContext = (function (vue) { strm.state = state; state.window = null/*Z_NULL*/; const ret = inflateReset2(strm, windowBits); - if (ret !== Z_OK$2) { + if (ret !== Z_OK$1) { strm.state = null/*Z_NULL*/; } return ret; @@ -16076,13 +16077,13 @@ var serviceContext = (function (vue) { while (sym < 280) { state.lens[sym++] = 7; } while (sym < 288) { state.lens[sym++] = 8; } - inftrees(LENS$1, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 }); + inftrees(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 }); /* distance table */ sym = 0; while (sym < 32) { state.lens[sym++] = 5; } - inftrees(DISTS$1, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 }); + inftrees(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 }); /* do this just once */ virgin = false; @@ -16153,7 +16154,7 @@ var serviceContext = (function (vue) { }; - const inflate = (strm, flush) => { + const inflate$2 = (strm, flush) => { let state; let input, output; // input/output buffers @@ -16187,7 +16188,7 @@ var serviceContext = (function (vue) { } state = strm.state; - if (state.mode === TYPE$1) { state.mode = TYPEDO; } /* skip check */ + if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */ //--- LOAD() --- @@ -16203,7 +16204,7 @@ var serviceContext = (function (vue) { _in = have; _out = left; - ret = Z_OK$2; + ret = Z_OK$1; inf_leave: // goto emulation for (;;) { @@ -16243,12 +16244,12 @@ var serviceContext = (function (vue) { if (!(state.wrap & 1) || /* check if zlib header allowed */ (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) { strm.msg = 'incorrect header check'; - state.mode = BAD$1; + state.mode = BAD; break; } - if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED$2) { + if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) { strm.msg = 'unknown compression method'; - state.mode = BAD$1; + state.mode = BAD; break; } //--- DROPBITS(4) ---// @@ -16261,7 +16262,7 @@ var serviceContext = (function (vue) { } else if (len > state.wbits) { strm.msg = 'invalid window size'; - state.mode = BAD$1; + state.mode = BAD; break; } @@ -16272,7 +16273,7 @@ var serviceContext = (function (vue) { //Tracev((stderr, "inflate: zlib header ok\n")); strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; - state.mode = hold & 0x200 ? DICTID : TYPE$1; + state.mode = hold & 0x200 ? DICTID : TYPE; //=== INITBITS(); hold = 0; bits = 0; @@ -16288,14 +16289,14 @@ var serviceContext = (function (vue) { } //===// state.flags = hold; - if ((state.flags & 0xff) !== Z_DEFLATED$2) { + if ((state.flags & 0xff) !== Z_DEFLATED) { strm.msg = 'unknown compression method'; - state.mode = BAD$1; + state.mode = BAD; break; } if (state.flags & 0xe000) { strm.msg = 'unknown header flags set'; - state.mode = BAD$1; + state.mode = BAD; break; } if (state.head) { @@ -16498,7 +16499,7 @@ var serviceContext = (function (vue) { //===// if (hold !== (state.check & 0xffff)) { strm.msg = 'header crc mismatch'; - state.mode = BAD$1; + state.mode = BAD; break; } //=== INITBITS(); @@ -16511,7 +16512,7 @@ var serviceContext = (function (vue) { state.head.done = true; } strm.adler = state.check = 0; - state.mode = TYPE$1; + state.mode = TYPE; break; case DICTID: //=== NEEDBITS(32); */ @@ -16539,13 +16540,13 @@ var serviceContext = (function (vue) { state.hold = hold; state.bits = bits; //--- - return Z_NEED_DICT; + return Z_NEED_DICT$1; } strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/; - state.mode = TYPE$1; + state.mode = TYPE; /* falls through */ - case TYPE$1: - if (flush === Z_BLOCK$1 || flush === Z_TREES) { break inf_leave; } + case TYPE: + if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; } /* falls through */ case TYPEDO: if (state.last) { @@ -16596,7 +16597,7 @@ var serviceContext = (function (vue) { break; case 3: strm.msg = 'invalid block type'; - state.mode = BAD$1; + state.mode = BAD; } //--- DROPBITS(2) ---// hold >>>= 2; @@ -16618,7 +16619,7 @@ var serviceContext = (function (vue) { //===// if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) { strm.msg = 'invalid stored block lengths'; - state.mode = BAD$1; + state.mode = BAD; break; } state.length = hold & 0xffff; @@ -16651,7 +16652,7 @@ var serviceContext = (function (vue) { break; } //Tracev((stderr, "inflate: stored end\n")); - state.mode = TYPE$1; + state.mode = TYPE; break; case TABLE: //=== NEEDBITS(14); */ @@ -16680,7 +16681,7 @@ var serviceContext = (function (vue) { //#ifndef PKZIP_BUG_WORKAROUND if (state.nlen > 286 || state.ndist > 30) { strm.msg = 'too many length or distance symbols'; - state.mode = BAD$1; + state.mode = BAD; break; } //#endif @@ -16715,12 +16716,12 @@ var serviceContext = (function (vue) { state.lenbits = 7; opts = { bits: state.lenbits }; - ret = inftrees(CODES$1, state.lens, 0, 19, state.lencode, 0, state.work, opts); + ret = inftrees(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts); state.lenbits = opts.bits; if (ret) { strm.msg = 'invalid code lengths set'; - state.mode = BAD$1; + state.mode = BAD; break; } //Tracev((stderr, "inflate: code lengths ok\n")); @@ -16767,7 +16768,7 @@ var serviceContext = (function (vue) { //---// if (state.have === 0) { strm.msg = 'invalid bit length repeat'; - state.mode = BAD$1; + state.mode = BAD; break; } len = state.lens[state.have - 1]; @@ -16821,7 +16822,7 @@ var serviceContext = (function (vue) { } if (state.have + copy > state.nlen + state.ndist) { strm.msg = 'invalid bit length repeat'; - state.mode = BAD$1; + state.mode = BAD; break; } while (copy--) { @@ -16831,12 +16832,12 @@ var serviceContext = (function (vue) { } /* handle error breaks in while */ - if (state.mode === BAD$1) { break; } + if (state.mode === BAD) { break; } /* check for end-of-block code (better have one) */ if (state.lens[256] === 0) { strm.msg = 'invalid code -- missing end-of-block'; - state.mode = BAD$1; + state.mode = BAD; break; } @@ -16846,7 +16847,7 @@ var serviceContext = (function (vue) { state.lenbits = 9; opts = { bits: state.lenbits }; - ret = inftrees(LENS$1, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); + ret = inftrees(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); // We have separate tables & no pointers. 2 commented lines below not needed. // state.next_index = opts.table_index; state.lenbits = opts.bits; @@ -16854,7 +16855,7 @@ var serviceContext = (function (vue) { if (ret) { strm.msg = 'invalid literal/lengths set'; - state.mode = BAD$1; + state.mode = BAD; break; } @@ -16863,7 +16864,7 @@ var serviceContext = (function (vue) { // Switch to use dynamic table state.distcode = state.distdyn; opts = { bits: state.distbits }; - ret = inftrees(DISTS$1, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); + ret = inftrees(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); // We have separate tables & no pointers. 2 commented lines below not needed. // state.next_index = opts.table_index; state.distbits = opts.bits; @@ -16871,7 +16872,7 @@ var serviceContext = (function (vue) { if (ret) { strm.msg = 'invalid distances set'; - state.mode = BAD$1; + state.mode = BAD; break; } //Tracev((stderr, 'inflate: codes ok\n')); @@ -16903,7 +16904,7 @@ var serviceContext = (function (vue) { bits = state.bits; //--- - if (state.mode === TYPE$1) { + if (state.mode === TYPE) { state.back = -1; } break; @@ -16964,12 +16965,12 @@ var serviceContext = (function (vue) { if (here_op & 32) { //Tracevv((stderr, "inflate: end of block\n")); state.back = -1; - state.mode = TYPE$1; + state.mode = TYPE; break; } if (here_op & 64) { strm.msg = 'invalid literal/length code'; - state.mode = BAD$1; + state.mode = BAD; break; } state.extra = here_op & 15; @@ -17044,7 +17045,7 @@ var serviceContext = (function (vue) { state.back += here_bits; if (here_op & 64) { strm.msg = 'invalid distance code'; - state.mode = BAD$1; + state.mode = BAD; break; } state.offset = here_val; @@ -17072,7 +17073,7 @@ var serviceContext = (function (vue) { //#ifdef INFLATE_STRICT if (state.offset > state.dmax) { strm.msg = 'invalid distance too far back'; - state.mode = BAD$1; + state.mode = BAD; break; } //#endif @@ -17087,7 +17088,7 @@ var serviceContext = (function (vue) { if (copy > state.whave) { if (state.sane) { strm.msg = 'invalid distance too far back'; - state.mode = BAD$1; + state.mode = BAD; break; } // (!) This block is disabled in zlib defaults, @@ -17159,7 +17160,7 @@ var serviceContext = (function (vue) { // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too if ((state.flags ? hold : zswap32(hold)) !== state.check) { strm.msg = 'incorrect data check'; - state.mode = BAD$1; + state.mode = BAD; break; } //=== INITBITS(); @@ -17182,7 +17183,7 @@ var serviceContext = (function (vue) { //===// if (hold !== (state.total & 0xffffffff)) { strm.msg = 'incorrect length check'; - state.mode = BAD$1; + state.mode = BAD; break; } //=== INITBITS(); @@ -17194,13 +17195,13 @@ var serviceContext = (function (vue) { state.mode = DONE; /* falls through */ case DONE: - ret = Z_STREAM_END$2; + ret = Z_STREAM_END$1; break inf_leave; - case BAD$1: + case BAD: ret = Z_DATA_ERROR$1; break inf_leave; case MEM: - return Z_MEM_ERROR; + return Z_MEM_ERROR$1; case SYNC: /* falls through */ default: @@ -17226,8 +17227,8 @@ var serviceContext = (function (vue) { state.bits = bits; //--- - if (state.wsize || (_out !== strm.avail_out && state.mode < BAD$1 && - (state.mode < CHECK || flush !== Z_FINISH$2))) { + if (state.wsize || (_out !== strm.avail_out && state.mode < BAD && + (state.mode < CHECK || flush !== Z_FINISH$1))) { if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) ; } _in -= strm.avail_in; @@ -17240,10 +17241,10 @@ var serviceContext = (function (vue) { (state.flags ? crc32_1(state.check, output, _out, strm.next_out - _out) : adler32_1(state.check, output, _out, strm.next_out - _out)); } strm.data_type = state.bits + (state.last ? 64 : 0) + - (state.mode === TYPE$1 ? 128 : 0) + + (state.mode === TYPE ? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); - if (((_in === 0 && _out === 0) || flush === Z_FINISH$2) && ret === Z_OK$2) { - ret = Z_BUF_ERROR$1; + if (((_in === 0 && _out === 0) || flush === Z_FINISH$1) && ret === Z_OK$1) { + ret = Z_BUF_ERROR; } return ret; }; @@ -17260,7 +17261,7 @@ var serviceContext = (function (vue) { state.window = null; } strm.state = null; - return Z_OK$2; + return Z_OK$1; }; @@ -17274,7 +17275,7 @@ var serviceContext = (function (vue) { /* save header structure */ state.head = head; head.done = false; - return Z_OK$2; + return Z_OK$1; }; @@ -17307,11 +17308,11 @@ var serviceContext = (function (vue) { ret = updatewindow(strm, dictionary, dictLength, dictLength); if (ret) { state.mode = MEM; - return Z_MEM_ERROR; + return Z_MEM_ERROR$1; } state.havedict = 1; // Tracev((stderr, "inflate: dictionary set\n")); - return Z_OK$2; + return Z_OK$1; }; @@ -17320,7 +17321,7 @@ var serviceContext = (function (vue) { var inflateResetKeep_1 = inflateResetKeep; var inflateInit_1 = inflateInit; var inflateInit2_1 = inflateInit2; - var inflate_2 = inflate; + var inflate_2$1 = inflate$2; var inflateEnd_1 = inflateEnd; var inflateGetHeader_1 = inflateGetHeader; var inflateSetDictionary_1 = inflateSetDictionary; @@ -17336,13 +17337,13 @@ var serviceContext = (function (vue) { module.exports.inflateUndermine = inflateUndermine; */ - var inflate_1 = { + var inflate_1$2 = { inflateReset: inflateReset_1, inflateReset2: inflateReset2_1, inflateResetKeep: inflateResetKeep_1, inflateInit: inflateInit_1, inflateInit2: inflateInit2_1, - inflate: inflate_2, + inflate: inflate_2$1, inflateEnd: inflateEnd_1, inflateGetHeader: inflateGetHeader_1, inflateSetDictionary: inflateSetDictionary_1, @@ -17406,15 +17407,15 @@ var serviceContext = (function (vue) { var gzheader = GZheader; - const toString$1 = Object.prototype.toString; + const toString = Object.prototype.toString; /* Public constants ==========================================================*/ /* ===========================================================================*/ const { - Z_NO_FLUSH: Z_NO_FLUSH$2, Z_FINISH: Z_FINISH$3, - Z_OK: Z_OK$3, Z_STREAM_END: Z_STREAM_END$3, Z_NEED_DICT: Z_NEED_DICT$1, Z_STREAM_ERROR: Z_STREAM_ERROR$2, Z_DATA_ERROR: Z_DATA_ERROR$2, Z_MEM_ERROR: Z_MEM_ERROR$1 - } = constants; + Z_NO_FLUSH, Z_FINISH, + Z_OK, Z_STREAM_END, Z_NEED_DICT, Z_STREAM_ERROR, Z_DATA_ERROR, Z_MEM_ERROR + } = constants$2; /* ===========================================================================*/ @@ -17496,7 +17497,7 @@ var serviceContext = (function (vue) { * console.log(inflate.result); * ``` **/ - function Inflate(options) { + function Inflate$1(options) { this.options = common.assign({ chunkSize: 1024 * 64, windowBits: 15, @@ -17536,30 +17537,30 @@ var serviceContext = (function (vue) { this.strm = new zstream(); this.strm.avail_out = 0; - let status = inflate_1.inflateInit2( + let status = inflate_1$2.inflateInit2( this.strm, opt.windowBits ); - if (status !== Z_OK$3) { + if (status !== Z_OK) { throw new Error(messages[status]); } this.header = new gzheader(); - inflate_1.inflateGetHeader(this.strm, this.header); + inflate_1$2.inflateGetHeader(this.strm, this.header); // Setup dictionary if (opt.dictionary) { // Convert data if needed if (typeof opt.dictionary === 'string') { opt.dictionary = strings.string2buf(opt.dictionary); - } else if (toString$1.call(opt.dictionary) === '[object ArrayBuffer]') { + } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') { opt.dictionary = new Uint8Array(opt.dictionary); } if (opt.raw) { //In raw mode we need to set the dictionary early - status = inflate_1.inflateSetDictionary(this.strm, opt.dictionary); - if (status !== Z_OK$3) { + status = inflate_1$2.inflateSetDictionary(this.strm, opt.dictionary); + if (status !== Z_OK) { throw new Error(messages[status]); } } @@ -17591,7 +17592,7 @@ var serviceContext = (function (vue) { * push(chunk, true); // push last chunk * ``` **/ - Inflate.prototype.push = function (data, flush_mode) { + Inflate$1.prototype.push = function (data, flush_mode) { const strm = this.strm; const chunkSize = this.options.chunkSize; const dictionary = this.options.dictionary; @@ -17600,10 +17601,10 @@ var serviceContext = (function (vue) { if (this.ended) return false; if (flush_mode === ~~flush_mode) _flush_mode = flush_mode; - else _flush_mode = flush_mode === true ? Z_FINISH$3 : Z_NO_FLUSH$2; + else _flush_mode = flush_mode === true ? Z_FINISH : Z_NO_FLUSH; // Convert data if needed - if (toString$1.call(data) === '[object ArrayBuffer]') { + if (toString.call(data) === '[object ArrayBuffer]') { strm.input = new Uint8Array(data); } else { strm.input = data; @@ -17619,34 +17620,34 @@ var serviceContext = (function (vue) { strm.avail_out = chunkSize; } - status = inflate_1.inflate(strm, _flush_mode); + status = inflate_1$2.inflate(strm, _flush_mode); - if (status === Z_NEED_DICT$1 && dictionary) { - status = inflate_1.inflateSetDictionary(strm, dictionary); + if (status === Z_NEED_DICT && dictionary) { + status = inflate_1$2.inflateSetDictionary(strm, dictionary); - if (status === Z_OK$3) { - status = inflate_1.inflate(strm, _flush_mode); - } else if (status === Z_DATA_ERROR$2) { + if (status === Z_OK) { + status = inflate_1$2.inflate(strm, _flush_mode); + } else if (status === Z_DATA_ERROR) { // Replace code with more verbose - status = Z_NEED_DICT$1; + status = Z_NEED_DICT; } } // Skip snyc markers if more data follows and not raw mode while (strm.avail_in > 0 && - status === Z_STREAM_END$3 && + status === Z_STREAM_END && strm.state.wrap > 0 && data[strm.next_in] !== 0) { - inflate_1.inflateReset(strm); - status = inflate_1.inflate(strm, _flush_mode); + inflate_1$2.inflateReset(strm); + status = inflate_1$2.inflate(strm, _flush_mode); } switch (status) { - case Z_STREAM_ERROR$2: - case Z_DATA_ERROR$2: - case Z_NEED_DICT$1: - case Z_MEM_ERROR$1: + case Z_STREAM_ERROR: + case Z_DATA_ERROR: + case Z_NEED_DICT: + case Z_MEM_ERROR: this.onEnd(status); this.ended = true; return false; @@ -17657,7 +17658,7 @@ var serviceContext = (function (vue) { last_avail_out = strm.avail_out; if (strm.next_out) { - if (strm.avail_out === 0 || status === Z_STREAM_END$3) { + if (strm.avail_out === 0 || status === Z_STREAM_END) { if (this.options.to === 'string') { @@ -17680,11 +17681,11 @@ var serviceContext = (function (vue) { } // Must repeat iteration if out buffer is full - if (status === Z_OK$3 && last_avail_out === 0) continue; + if (status === Z_OK && last_avail_out === 0) continue; // Finalize if end of stream reached. - if (status === Z_STREAM_END$3) { - status = inflate_1.inflateEnd(this.strm); + if (status === Z_STREAM_END) { + status = inflate_1$2.inflateEnd(this.strm); this.onEnd(status); this.ended = true; return true; @@ -17705,7 +17706,7 @@ var serviceContext = (function (vue) { * By default, stores data blocks in `chunks[]` property and glue * those in `onEnd`. Override this handler, if you need another behaviour. **/ - Inflate.prototype.onData = function (chunk) { + Inflate$1.prototype.onData = function (chunk) { this.chunks.push(chunk); }; @@ -17719,9 +17720,9 @@ var serviceContext = (function (vue) { * complete (Z_FINISH). By default - join collected chunks, * free memory and fill `results` / `err` properties. **/ - Inflate.prototype.onEnd = function (status) { + Inflate$1.prototype.onEnd = function (status) { // On success - join - if (status === Z_OK$3) { + if (status === Z_OK) { if (this.options.to === 'string') { this.result = this.chunks.join(''); } else { @@ -17768,13 +17769,13 @@ var serviceContext = (function (vue) { * * try { * output = pako.inflate(input); - * } catch (err) + * } catch (err) { * console.log(err); * } * ``` **/ function inflate$1(input, options) { - const inflator = new Inflate(options); + const inflator = new Inflate$1(options); inflator.push(input); @@ -17793,7 +17794,7 @@ var serviceContext = (function (vue) { * The same as [[inflate]], but creates raw data, without wrapper * (header and adler32 crc). **/ - function inflateRaw(input, options) { + function inflateRaw$1(input, options) { options = options || {}; options.raw = true; return inflate$1(input, options); @@ -17810,59 +17811,59 @@ var serviceContext = (function (vue) { **/ - var Inflate_1 = Inflate; - var inflate_2$1 = inflate$1; - var inflateRaw_1 = inflateRaw; - var ungzip = inflate$1; - var constants$2 = constants; + var Inflate_1$1 = Inflate$1; + var inflate_2 = inflate$1; + var inflateRaw_1$1 = inflateRaw$1; + var ungzip$1 = inflate$1; + var constants = constants$2; var inflate_1$1 = { - Inflate: Inflate_1, - inflate: inflate_2$1, - inflateRaw: inflateRaw_1, - ungzip: ungzip, - constants: constants$2 + Inflate: Inflate_1$1, + inflate: inflate_2, + inflateRaw: inflateRaw_1$1, + ungzip: ungzip$1, + constants: constants }; - const { Deflate: Deflate$1, deflate: deflate$2, deflateRaw: deflateRaw$1, gzip: gzip$1 } = deflate_1$1; + const { Deflate, deflate, deflateRaw, gzip } = deflate_1$1; - const { Inflate: Inflate$1, inflate: inflate$2, inflateRaw: inflateRaw$1, ungzip: ungzip$1 } = inflate_1$1; + const { Inflate, inflate, inflateRaw, ungzip } = inflate_1$1; - var Deflate_1$1 = Deflate$1; - var deflate_1$2 = deflate$2; - var deflateRaw_1$1 = deflateRaw$1; - var gzip_1$1 = gzip$1; - var Inflate_1$1 = Inflate$1; - var inflate_1$2 = inflate$2; - var inflateRaw_1$1 = inflateRaw$1; - var ungzip_1 = ungzip$1; - var constants_1 = constants; + var Deflate_1 = Deflate; + var deflate_1 = deflate; + var deflateRaw_1 = deflateRaw; + var gzip_1 = gzip; + var Inflate_1 = Inflate; + var inflate_1 = inflate; + var inflateRaw_1 = inflateRaw; + var ungzip_1 = ungzip; + var constants_1 = constants$2; var pako = { - Deflate: Deflate_1$1, - deflate: deflate_1$2, - deflateRaw: deflateRaw_1$1, - gzip: gzip_1$1, - Inflate: Inflate_1$1, - inflate: inflate_1$2, - inflateRaw: inflateRaw_1$1, + Deflate: Deflate_1, + deflate: deflate_1, + deflateRaw: deflateRaw_1, + gzip: gzip_1, + Inflate: Inflate_1, + inflate: inflate_1, + inflateRaw: inflateRaw_1, ungzip: ungzip_1, constants: constants_1 }; var pako_esm = /*#__PURE__*/Object.freeze({ __proto__: null, - 'default': pako, - Deflate: Deflate_1$1, - Inflate: Inflate_1$1, + Deflate: Deflate_1, + Inflate: Inflate_1, constants: constants_1, - deflate: deflate_1$2, - deflateRaw: deflateRaw_1$1, - gzip: gzip_1$1, - inflate: inflate_1$2, - inflateRaw: inflateRaw_1$1, + 'default': pako, + deflate: deflate_1, + deflateRaw: deflateRaw_1, + gzip: gzip_1, + inflate: inflate_1, + inflateRaw: inflateRaw_1, ungzip: ungzip_1 }); diff --git a/packages/uni-app-plus/dist/uni-app-view.umd.js b/packages/uni-app-plus/dist/uni-app-view.umd.js index 7166c2877af8d7742808b9ba700c14d437ce0971..9d34267ee2e196086b26cabad6235e6a42f9f5c9 100644 --- a/packages/uni-app-plus/dist/uni-app-view.umd.js +++ b/packages/uni-app-plus/dist/uni-app-view.umd.js @@ -183,7 +183,7 @@ fonts.add(fontFace); }); } - return new Promise((resolve2) => { + return new Promise((resolve) => { const style = document.createElement("style"); const values = []; if (desc) { @@ -197,7 +197,7 @@ } style.innerText = `@font-face{font-family:"${family}";src:${source};${values.join(";")}}`; document.head.appendChild(style); - resolve2(); + resolve(); }); } function scrollTo(scrollTop, duration) { @@ -715,9 +715,6 @@ emitter.off(`${subscribeNamespace}.${event}`, callback); }, subscribeHandler(event, args, pageId) { - { - console.log(formatLog(subscribeNamespace, "subscribeHandler", pageId, event, args)); - } emitter.emit(`${subscribeNamespace}.${event}`, args, pageId); } }; @@ -762,9 +759,6 @@ handler(args, publish); } else { publish({}); - { - console.error(formatLog("invokeViewMethod", name, "not register")); - } } } const ViewJSBridge = /* @__PURE__ */ extend(initBridge("service"), { @@ -4055,31 +4049,7 @@ return result; } const isTeleport = (type) => type.__isTeleport; - const COMPONENTS = "components"; - function resolveComponent(name, maybeSelfReference) { - return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name; - } const NULL_DYNAMIC_COMPONENT = Symbol(); - function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) { - const instance = currentRenderingInstance || currentInstance; - if (instance) { - const Component = instance.type; - if (type === COMPONENTS) { - const selfName = getComponentName(Component); - if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) { - return Component; - } - } - const res = resolve(instance[type] || Component[type], name) || resolve(instance.appContext[type], name); - if (!res && maybeSelfReference) { - return Component; - } - return res; - } - } - function resolve(registry, name) { - return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]); - } const Fragment = Symbol(void 0); const Text$1 = Symbol(void 0); const Comment$1 = Symbol(void 0); @@ -7271,7 +7241,7 @@ function actionsChanged({ actions, reserve - }, resolve2) { + }, resolve) { if (!actions) { return; } @@ -7322,7 +7292,7 @@ }); color = LinearGradient; } else if (data[0] === "pattern") { - const loaded = checkImageLoaded(data[1], actions.slice(index2 + 1), resolve2, function(image2) { + const loaded = checkImageLoaded(data[1], actions.slice(index2 + 1), resolve, function(image2) { if (image2) { c2d[method1] = c2d.createPattern(image2, data[2]); } @@ -7371,7 +7341,7 @@ var url = dataArray[0]; var otherData = dataArray.slice(1); _images = _images || {}; - if (checkImageLoaded(url, actions.slice(index2 + 1), resolve2, function(image2) { + if (checkImageLoaded(url, actions.slice(index2 + 1), resolve, function(image2) { if (image2) { c2d.drawImage.apply(c2d, [image2].concat([...otherData.slice(4, 8)], [...otherData.slice(0, 4)])); } @@ -7393,7 +7363,7 @@ } } if (!actionsWaiting.value) { - resolve2({ + resolve({ errMsg: "drawCanvas:ok" }); } @@ -7435,7 +7405,7 @@ } }); } - function checkImageLoaded(src, actions, resolve2, fn) { + function checkImageLoaded(src, actions, resolve, fn) { var image2 = _images[src]; if (image2.ready) { fn(image2); @@ -7453,7 +7423,7 @@ actionsChanged({ actions: action[0], reserve: action[1] - }, resolve2); + }, resolve); action = actions2.shift(); } }; @@ -7471,7 +7441,7 @@ dataType, quality = 1, type = "png" - }, resolve2) { + }, resolve) { const canvas2 = canvasRef.value; let data; const maxWidth = canvas2.offsetWidth - x; @@ -7528,10 +7498,10 @@ } newCanvas.height = newCanvas.width = 0; context.__hidpi__ = false; - if (!resolve2) { + if (!resolve) { return result; } else { - resolve2(result); + resolve(result); } } function putImageData({ @@ -7541,7 +7511,7 @@ width, height, compressed - }, resolve2) { + }, resolve) { try { if (!height) { height = Math.round(data.length / 4 / width); @@ -7556,12 +7526,12 @@ canvasRef.value.getContext("2d").drawImage(canvas2, x, y, width, height); canvas2.height = canvas2.width = 0; } catch (error) { - resolve2({ + resolve({ errMsg: "canvasPutImageData:fail" }); return; } - resolve2({ + resolve({ errMsg: "canvasPutImageData:ok" }); } @@ -7575,7 +7545,7 @@ fileType, quality, dirname - }, resolve2) { + }, resolve) { const res = getImageData({ x, y, @@ -7589,7 +7559,7 @@ quality }); if (!res.data || !res.data.length) { - resolve2({ + resolve({ errMsg: res.errMsg.replace("canvasPutImageData", "toTempFilePath") }); return; @@ -7602,10 +7572,10 @@ putImageData, toTempFilePath }; - function _handleSubscribe(type, data, resolve2) { + function _handleSubscribe(type, data, resolve) { let method = methods2[type]; if (type.indexOf("_") !== 0 && typeof method === "function") { - method(data, resolve2); + method(data, resolve); } } return extend(methods2, { @@ -8524,7 +8494,7 @@ }); }); const id2 = useContextInfo(); - useSubscribe((type, data, resolve2) => { + useSubscribe((type, data, resolve) => { const { options, callbackId } = data; let res; let range; @@ -8661,7 +8631,7 @@ errMsg = "not ready"; } if (callbackId) { - resolve2({ + resolve({ callbackId, data: extend({}, res, { errMsg: `${type}:${errMsg ? "fail " + errMsg : "ok"}` @@ -9107,17 +9077,17 @@ uniForm.removeField(ctx); }); } - function getSelectedTextRange(_, resolve2) { + function getSelectedTextRange(_, resolve) { const activeElement = document.activeElement; if (!activeElement) { - return resolve2({}); + return resolve({}); } const data = {}; if (["input", "textarea"].includes(activeElement.tagName.toLowerCase())) { data.start = activeElement.selectionStart; data.end = activeElement.selectionEnd; } - resolve2(data); + resolve(data); } const UniViewJSBridgeSubscribe = function() { registerViewMethod(getCurrentPageId(), "getSelectedTextRange", getSelectedTextRange); @@ -14253,8 +14223,8 @@ if (!name) { return; } - registerViewMethod(pageId || getCurrentPageId(), name, ({ type, data }, resolve2) => { - callback(type, data, resolve2); + registerViewMethod(pageId || getCurrentPageId(), name, ({ type, data }, resolve) => { + callback(type, data, resolve); }); } function removeSubscribe(name) { @@ -15315,9 +15285,14 @@ _setMap } = useMapMethods(props2, trigger2); onParentReady(() => { - map2 = extend(plus.maps.create(getCurrentPageId() + "-map-" + (props2.id || Date.now()), Object.assign({}, attrs2.value, position)), { + map2 = extend(plus.maps.create(getCurrentPageId() + "-map-" + (props2.id || Date.now()), Object.assign({}, attrs2.value, position, (() => { + if (props2.latitude && props2.longitude) { + return { + center: new plus.maps.Point(Number(props2.longitude), Number(props2.latitude)) + }; + } + })())), { __markers__: [], - __markers_map__: {}, __lines__: [], __circles__: [] }); @@ -15342,7 +15317,7 @@ watch(() => position, (position2) => map2 && map2.setStyles(position2), { deep: true }); - watch(() => hidden.value, (val) => { + watch(hidden, (val) => { map2 && map2[val ? "hide" : "show"](); }); watch(() => props2.scale, (val) => { @@ -15355,12 +15330,18 @@ }); watch(() => props2.markers, (val) => { _addMarkers(val, true); + }, { + deep: true }); watch(() => props2.polyline, (val) => { _addMapLines(val); + }, { + deep: true }); watch(() => props2.circles, (val) => { _addMapCircles(val); + }, { + deep: true }); }); const mapControls = computed$1(() => props2.controls.map((control) => { @@ -15375,7 +15356,8 @@ return { id: control.id, iconPath: getRealPath(control.iconPath), - position: position2 + position: position2, + clickable: control.clickable }; })); onBeforeUnmount(() => { @@ -15392,12 +15374,12 @@ default: () => [createVNode("div", { "ref": containerRef, "class": "uni-map-container" - }, null, 512), mapControls.value.map((control, index2) => createVNode(resolveComponent("v-uni-cover-image"), { + }, null, 512), mapControls.value.map((control, index2) => createVNode(CoverImage, { "key": index2, "src": control.iconPath, "style": control.position, "auto-size": true, - "onClick": () => trigger2("controltap", {}, { + "onClick": () => control.clickable && trigger2("controltap", {}, { controlId: control.id }) }, null, 8, ["src", "style", "auto-size", "onClick"])), createVNode("div", { @@ -15410,42 +15392,42 @@ }); function useMapMethods(props2, trigger2) { let map2; - function moveToLocation(resolve2, { + function moveToLocation(resolve, { longitude, latitude } = {}) { if (!map2) return; map2.setCenter(new plus.maps.Point(Number(longitude || props2.longitude), Number(latitude || props2.latitude))); - resolve2({ + resolve({ errMsg: "moveToLocation:ok" }); } - function getCenterLocation(resolve2) { + function getCenterLocation(resolve) { if (!map2) return; map2.getCurrentCenter((state, point) => { - resolve2({ + resolve({ longitude: point.getLng(), latitude: point.getLat(), errMsg: "getCenterLocation:ok" }); }); } - function getRegion(resolve2) { + function getRegion(resolve) { if (!map2) return; const rect = map2.getBounds(); - resolve2({ + resolve({ southwest: rect.getSouthWest(), northeast: rect.getNorthEast(), errMsg: "getRegion:ok" }); } - function getScale(resolve2) { + function getScale(resolve) { if (!map2) return; - resolve2({ + resolve({ scale: map2.getZoom(), errMsg: "getScale:ok" }); @@ -15496,7 +15478,6 @@ } map2 == null ? void 0 : map2.addOverlay(nativeMarker); map2.__markers__.push(nativeMarker); - map2 && (map2.__markers_map__[id2 + ""] = nativeMarker); }); } function _clearMarkers() { @@ -15507,7 +15488,6 @@ map2 == null ? void 0 : map2.removeOverlay(marker); }); map2.__markers__ = []; - map2.__markers_map__ = {}; } function _addMarkers(markers, clear2) { if (clear2) { @@ -15587,8 +15567,8 @@ getRegion, getScale }; - useSubscribe((type, data, resolve2) => { - methods2[type] && methods2[type](resolve2, data); + useSubscribe((type, data, resolve) => { + methods2[type] && methods2[type](resolve, data); }, useContextInfo(), true); return { _addMarkers, diff --git a/packages/uni-app-plus/src/service/framework/app/utils.ts b/packages/uni-app-plus/src/service/framework/app/utils.ts index 4c55ba0cb7bea4505b3df4c29e47fcc8d49d671d..b33c6a3402b5340f0d512cbb6f3a0fc4b06c1653 100644 --- a/packages/uni-app-plus/src/service/framework/app/utils.ts +++ b/packages/uni-app-plus/src/service/framework/app/utils.ts @@ -1,8 +1,7 @@ export const EVENT_BACKBUTTON = 'backbutton' export function backbuttonListener() { - uni - .navigateBack({ - from: 'backbutton', - } as UniApp.NavigateBackOptions) - .catch(() => {}) + uni.navigateBack({ + from: 'backbutton', + success() {}, // 传入空方法,避免返回Promise,因为onBackPress可能导致fail + } as UniApp.NavigateBackOptions) } diff --git a/packages/uni-cli-nvue/dist/index.js b/packages/uni-cli-nvue/dist/index.js index 6addd80ed0a6ccf2586af82706b3e5fb28ab414a..45afc34db04485f0e4614dc7272000955b51685a 100644 --- a/packages/uni-cli-nvue/dist/index.js +++ b/packages/uni-cli-nvue/dist/index.js @@ -11,6 +11,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) { }; Object.defineProperty(exports, "__esModule", { value: true }); /** - * 注意:该包的依赖包含了 lib 中的 vue-loader,weex-styler,weex-template-compiler + * 注意:该包的依赖包含了 lib 中的 weex-template-compiler 依赖的 de-indent */ __exportStar(require("./webpack"), exports); diff --git a/packages/uni-cli-nvue/dist/utils.js b/packages/uni-cli-nvue/dist/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..70d9b648be15a41dc0f93b5c3f1adbc531e82b49 --- /dev/null +++ b/packages/uni-cli-nvue/dist/utils.js @@ -0,0 +1,11 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveLib = void 0; +const path_1 = __importDefault(require("path")); +function resolveLib(filepath) { + return path_1.default.resolve(__dirname, '../lib', filepath); +} +exports.resolveLib = resolveLib; diff --git a/packages/uni-cli-nvue/dist/webpack/alias.js b/packages/uni-cli-nvue/dist/webpack/alias.js new file mode 100644 index 0000000000000000000000000000000000000000..247387525f288a335d28597e8dc924270cae3b57 --- /dev/null +++ b/packages/uni-cli-nvue/dist/webpack/alias.js @@ -0,0 +1,18 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.initModuleAlias = void 0; +const module_alias_1 = __importDefault(require("module-alias")); +const utils_1 = require("../utils"); +const MODULES = [ + 'weex-styler', + 'weex-template-compiler', + '@vue/component-compiler-utils', + '@vue/component-compiler-utils/package.json', +]; +function initModuleAlias() { + MODULES.forEach((name) => module_alias_1.default.addAlias(name, utils_1.resolveLib(name))); +} +exports.initModuleAlias = initModuleAlias; diff --git a/packages/uni-cli-nvue/dist/webpack/config/index.js b/packages/uni-cli-nvue/dist/webpack/config/index.js index 008309b092cf41b301a06cf19308a63834e1baf9..f094257ebc2a92f5d29a06fece2df1b328c4d9a9 100644 --- a/packages/uni-cli-nvue/dist/webpack/config/index.js +++ b/packages/uni-cli-nvue/dist/webpack/config/index.js @@ -16,10 +16,10 @@ function createConfig(mode) { externals: { vue: 'Vue', }, - optimization: optimization_1.optimization, - output: output_1.output, - module: module_1.module, - plugins: plugins_1.plugins, + optimization: optimization_1.createOptimization(), + output: output_1.createOutput(), + module: module_1.createModule(), + plugins: plugins_1.createPlugins(), }; } exports.createConfig = createConfig; diff --git a/packages/uni-cli-nvue/dist/webpack/config/module/index.js b/packages/uni-cli-nvue/dist/webpack/config/module/index.js index 5a803fbd838251a0eebbf5edd17f99670ee9eabe..fb5103deee547cb6bac042843f4d658721dd3693 100644 --- a/packages/uni-cli-nvue/dist/webpack/config/module/index.js +++ b/packages/uni-cli-nvue/dist/webpack/config/module/index.js @@ -1,7 +1,10 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.module = void 0; +exports.createModule = void 0; const rules_1 = require("./rules"); -exports.module = { - rules: rules_1.rules, -}; +function createModule() { + return { + rules: rules_1.createRules(), + }; +} +exports.createModule = createModule; diff --git a/packages/uni-cli-nvue/dist/webpack/config/module/rules/babelLoader.js b/packages/uni-cli-nvue/dist/webpack/config/module/rules/babelLoader.js index 711a3c318209583efcf8b161239e2a6e842e9b47..b6f85e5d0a0950201a178bfd60c3e3b3e9e27cab 100644 --- a/packages/uni-cli-nvue/dist/webpack/config/module/rules/babelLoader.js +++ b/packages/uni-cli-nvue/dist/webpack/config/module/rules/babelLoader.js @@ -1,14 +1,17 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.babelLoader = void 0; -exports.babelLoader = { - test: /\.js$/, - use: [ - { - loader: 'babel-loader', - options: { - babelrc: false, +exports.createBabelLoader = void 0; +function createBabelLoader() { + return { + test: /\.js$/, + use: [ + { + loader: 'babel-loader', + options: { + babelrc: false, + }, }, - }, - ], -}; + ], + }; +} +exports.createBabelLoader = createBabelLoader; diff --git a/packages/uni-cli-nvue/dist/webpack/config/module/rules/index.js b/packages/uni-cli-nvue/dist/webpack/config/module/rules/index.js index 8dce87f64656ddddd78be93620ee9571fd11b929..0d5694f3fe6351c3908bb52c884cc32a85d2fd24 100644 --- a/packages/uni-cli-nvue/dist/webpack/config/module/rules/index.js +++ b/packages/uni-cli-nvue/dist/webpack/config/module/rules/index.js @@ -1,6 +1,9 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.rules = void 0; +exports.createRules = void 0; const babelLoader_1 = require("./babelLoader"); const vueLoader_1 = require("./vueLoader"); -exports.rules = [vueLoader_1.vueLoader, babelLoader_1.babelLoader]; +function createRules() { + return [vueLoader_1.createVueLoader(), babelLoader_1.createBabelLoader()]; +} +exports.createRules = createRules; diff --git a/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader.js b/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader.js deleted file mode 100644 index 4a81d23c918ab450faa1ca16e4838cba6d4f5c34..0000000000000000000000000000000000000000 --- a/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.vueLoader = void 0; -exports.vueLoader = { - test: [/\.nvue(\?[^?]+)?$/, /\.vue(\?[^?]+)?$/], - use: [ - { - loader: 'vue-loader', - options: { - hotReload: false, - compiler: require('../../../../../lib/weex-template-compiler'), - }, - }, - ], -}; diff --git a/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader/compilerOptions/index.js b/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader/compilerOptions/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c05f03a69fdc67592168c85a00719f1adf451414 --- /dev/null +++ b/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader/compilerOptions/index.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createCompilerOptions = void 0; +const modules_1 = require("./modules"); +function createCompilerOptions() { + return { + modules: modules_1.createModules(), + }; +} +exports.createCompilerOptions = createCompilerOptions; diff --git a/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader/compilerOptions/modules/assetUrl.js b/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader/compilerOptions/modules/assetUrl.js new file mode 100644 index 0000000000000000000000000000000000000000..ec5383b4113c3ba263eafa67d0f2cefd7331f43e --- /dev/null +++ b/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader/compilerOptions/modules/assetUrl.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createAssetUrlModule = void 0; +function createAssetUrlModule() { + return {}; +} +exports.createAssetUrlModule = createAssetUrlModule; diff --git a/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader/compilerOptions/modules/boolAttr.js b/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader/compilerOptions/modules/boolAttr.js new file mode 100644 index 0000000000000000000000000000000000000000..a453193973c0cbfb03c2e3bc51a02493e9244636 --- /dev/null +++ b/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader/compilerOptions/modules/boolAttr.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createBoolAttrModule = void 0; +function createBoolAttrModule() { + return {}; +} +exports.createBoolAttrModule = createBoolAttrModule; diff --git a/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader/compilerOptions/modules/easycom.js b/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader/compilerOptions/modules/easycom.js new file mode 100644 index 0000000000000000000000000000000000000000..d0a93675885bf992ec4e573ec078c5b20b32b984 --- /dev/null +++ b/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader/compilerOptions/modules/easycom.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createEasycomModule = void 0; +const uni_shared_1 = require("@dcloudio/uni-shared"); +function createEasycomModule() { + return { + preTransformNode(el, options) { + if (uni_shared_1.isBuiltInComponent(el.tag) && el.tag !== 'App') { + // 挂在 isUnaryTag 上边,可以保证外部访问到 + ; + (options.isUnaryTag.autoComponents || + (options.isUnaryTag.autoComponents = new Set())).add(el.tag); + } + }, + }; +} +exports.createEasycomModule = createEasycomModule; diff --git a/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader/compilerOptions/modules/index.js b/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader/compilerOptions/modules/index.js new file mode 100644 index 0000000000000000000000000000000000000000..7496c742acedb19a62f72fcf859328f476f89774 --- /dev/null +++ b/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader/compilerOptions/modules/index.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createModules = void 0; +const assetUrl_1 = require("./assetUrl"); +const boolAttr_1 = require("./boolAttr"); +const easycom_1 = require("./easycom"); +const renderWhole_1 = require("./renderWhole"); +const tags_1 = require("./tags"); +function createModules() { + // 先处理 easycom + const modules = [easycom_1.createEasycomModule(), renderWhole_1.createRenderWholeModule()]; + if (process.env.UNI_NVUE_COMPILER === 'uni-app') { + modules.push(tags_1.createTagsModule()); + } + modules.push(assetUrl_1.createAssetUrlModule()); + modules.push(boolAttr_1.createBoolAttrModule()); + return modules; +} +exports.createModules = createModules; diff --git a/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader/compilerOptions/modules/renderWhole.js b/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader/compilerOptions/modules/renderWhole.js new file mode 100644 index 0000000000000000000000000000000000000000..db7292cbd0d6152f208bca8b063af4dcc293f121 --- /dev/null +++ b/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader/compilerOptions/modules/renderWhole.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createRenderWholeModule = void 0; +// render-whole => append="tree" +function createRenderWholeModule() { + return { + preTransformNode(el) { + if (!Object.hasOwnProperty.call(el.attrsMap, 'append')) { + const name = 'render-whole'; + const value = el.attrsMap[name]; + if (value === true || value === 'true') { + // remove + delete el.attrsMap.append; + const index = el.attrsList.findIndex((item) => item.name === name); + const attr = el.attrsList[index]; + el.attrsList.splice(index, 1); + el.appendAsTree = true; + el.attrsMap.append = 'tree'; + el.attrsList.push({ + name: 'append', + value: 'tree', + bool: false, + start: attr.start, + end: attr.end, + }); + } + } + return el; + }, + }; +} +exports.createRenderWholeModule = createRenderWholeModule; diff --git a/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader/compilerOptions/modules/tags.js b/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader/compilerOptions/modules/tags.js new file mode 100644 index 0000000000000000000000000000000000000000..16a85b714e65fcbf0dc8a4539aabfdeeaa7c6b94 --- /dev/null +++ b/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader/compilerOptions/modules/tags.js @@ -0,0 +1,109 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createTagsModule = void 0; +function createTagsModule() { + return { + postTransformNode(el) { + rewriteText(el); + rewriteTag(el); + rewriteEvents(el); + rewriteVideo(el); + }, + }; +} +exports.createTagsModule = createTagsModule; +function rewriteText(el) { + const tag = el.tag; + if (tag === 'text' || tag === 'u-text' || tag === 'button') { + return; + } + const children = el.children; + children.forEach((child, index) => { + if (child.text) { + children.splice(index, 1, { + type: 1, + tag: 'u-text', + attrsList: [], + attrsMap: {}, + rawAttrsMap: {}, + parent: el, + children: [child], + plain: true, + }); + } + }); +} +const TAGS = [ + 'text', + 'image', + 'input', + 'textarea', + 'video', + 'web-view', + // 'switch', + 'slider', +]; +function rewriteTag(el) { + if (TAGS.includes(el.tag)) { + el.tag = 'u-' + el.tag; + } + else if (el.tag === 'match-media') { + el.tag = 'uni-match-media'; + } +} +const deprecated = { + events: { + tap: 'click', + }, +}; +function rewriteEvents(el) { + if (!el.events) { + return; + } + const { events: eventsMap } = deprecated; + Object.keys(el.events).forEach((name) => { + // 过时事件类型转换 + const eventType = eventsMap[name]; + if (eventType) { + if (!(name === 'tap' && el.tag === 'map')) { + // map 的 tap 事件不做转换 + el.events[eventType] = el.events[name]; + delete el.events[name]; + } + } + }); +} +function rewriteVideo(el) { + if (el.tag !== 'u-video') { + return; + } + if (!Array.isArray(el.children)) { + return; + } + if (!el.children.length) { + return; + } + if (el.children[0].tag === 'u-scalable') { + return; + } + el.children = [ + { + type: 1, + tag: 'u-scalable', + attrsList: [], + attrsMap: { + style: 'position: absolute;left: 0;right: 0;top: 0;bottom: 0;', + }, + rawAttrsMap: { + style: { + name: 'style', + value: 'position: absolute;left: 0;right: 0;top: 0;bottom: 0;', + }, + }, + parent: el, + plain: false, + staticStyle: '{position:"absolute",left:"0",right:"0",top:"0",bottom:"0"}', + children: el.children, + }, + ]; +} diff --git a/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader/easycom.js b/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader/easycom.js new file mode 100644 index 0000000000000000000000000000000000000000..e1093607c83cdd47726a312ff7722fcc95c2e1a3 --- /dev/null +++ b/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader/easycom.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.generateEasycomCode = void 0; +const uni_cli_shared_1 = require("@dcloudio/uni-cli-shared"); +function generateEasycomCode(names) { + const components = []; + resolveEasycom(names).forEach(({ name, source }) => { + // 统一转换为驼峰命名 + name = name.replace(/-(\w)/g, (_, str) => str.toUpperCase()); + components.push(`'${name}': require('${source}').default`); + }); + if (process.env.NODE_ENV === 'production') { + return `var components = {${components.join(',')}}`; + } + return `var components; +try{ + components = {${components.join(',')}} +}catch(e){ + if(e.message.indexOf('Cannot find module') !== -1 && e.message.indexOf('.vue') !== -1){ + console.error(e.message) + console.error('1. 排查组件名称拼写是否正确') + console.error('2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom') + console.error('3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件') + } else { + throw e + } +}`; +} +exports.generateEasycomCode = generateEasycomCode; +function resolveEasycom(names) { + return names.reduce((coms, name) => { + const source = uni_cli_shared_1.matchEasycom(name); + if (source) { + coms.push({ + name, + source, + }); + } + return coms; + }, []); +} diff --git a/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader/index.js b/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader/index.js new file mode 100644 index 0000000000000000000000000000000000000000..1c8a37fb9888addcc3425c8ea305ea32135b0084 --- /dev/null +++ b/packages/uni-cli-nvue/dist/webpack/config/module/rules/vueLoader/index.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createVueLoader = void 0; +const shared_1 = require("@vue/shared"); +const uni_cli_shared_1 = require("@dcloudio/uni-cli-shared"); +const compilerOptions_1 = require("./compilerOptions"); +const utils_1 = require("../../../../../utils"); +const easycom_1 = require("./easycom"); +function createVueLoader() { + uni_cli_shared_1.initEasycomsOnce(process.env.UNI_INPUT_DIR, process.env.UNI_PLATFORM); + return { + test: [/\.nvue(\?[^?]+)?$/, /\.vue(\?[^?]+)?$/], + use: [ + { + loader: utils_1.resolveLib('vue-loader'), + options: { + hotReload: false, + compiler: createCompiler(), + compilerOptions: compilerOptions_1.createCompilerOptions(), + }, + }, + ], + }; +} +exports.createVueLoader = createVueLoader; +const isUnaryTag = shared_1.makeMap('image,area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' + + 'link,meta,param,source,track,wbr'); +function compileTemplate(source, options, compile) { + const res = compile(source, options); + res.components = easycom_1.generateEasycomCode([ + ...(options.isUnaryTag.autoComponents || []), + ]); + return res; +} +function createCompiler() { + const compiler = require(utils_1.resolveLib('weex-template-compiler')); + const oldCompile = compiler.compile; + compiler.compile = function (source, options = {}) { + ; + options.isUnaryTag = isUnaryTag; + options.isUnaryTag.autoComponents = new Set(); + options.preserveWhitespace = false; + return compileTemplate(source, options, oldCompile); + }; + return compiler; +} diff --git a/packages/uni-cli-nvue/dist/webpack/config/optimization.js b/packages/uni-cli-nvue/dist/webpack/config/optimization.js index c040721a732ef3e2b642afa4a0b19db26fa138ce..6d977d2bcac6525de84c8a111d99f57e3b3ce011 100644 --- a/packages/uni-cli-nvue/dist/webpack/config/optimization.js +++ b/packages/uni-cli-nvue/dist/webpack/config/optimization.js @@ -3,17 +3,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.optimization = void 0; +exports.createOptimization = void 0; const terser_webpack_plugin_1 = __importDefault(require("terser-webpack-plugin")); -exports.optimization = { - nodeEnv: false, - minimizer: [ - new terser_webpack_plugin_1.default({ - terserOptions: { - output: { - ascii_only: true, +function createOptimization() { + return { + nodeEnv: false, + minimizer: [ + new terser_webpack_plugin_1.default({ + terserOptions: { + output: { + ascii_only: true, + }, }, - }, - }), - ], -}; + }), + ], + }; +} +exports.createOptimization = createOptimization; diff --git a/packages/uni-cli-nvue/dist/webpack/config/output.js b/packages/uni-cli-nvue/dist/webpack/config/output.js index d78d48bbeba38075b5ef31cbab160a80557600ef..aef9b581028a5fc883df1309ec3a993947424fd6 100644 --- a/packages/uni-cli-nvue/dist/webpack/config/output.js +++ b/packages/uni-cli-nvue/dist/webpack/config/output.js @@ -1,7 +1,10 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.output = void 0; -exports.output = { - path: process.env.UNI_OUTPUT_DIR, - filename: '[name].js', -}; +exports.createOutput = void 0; +function createOutput() { + return { + path: process.env.UNI_OUTPUT_DIR, + filename: '[name].js', + }; +} +exports.createOutput = createOutput; diff --git a/packages/uni-cli-nvue/dist/webpack/config/plugins/banner.js b/packages/uni-cli-nvue/dist/webpack/config/plugins/banner.js index 45ca00c4745a81ef7a4a045fe4f98c1aaf5382ce..6409bf8b36256cfb3ec6ff17420e61526b6bcc83 100644 --- a/packages/uni-cli-nvue/dist/webpack/config/plugins/banner.js +++ b/packages/uni-cli-nvue/dist/webpack/config/plugins/banner.js @@ -1,9 +1,12 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.banner = void 0; +exports.createBannerPlugin = void 0; const webpack_1 = require("webpack"); -exports.banner = new webpack_1.BannerPlugin({ - banner: '"use weex:vue";', - raw: true, - exclude: 'Vue', -}); +function createBannerPlugin() { + return new webpack_1.BannerPlugin({ + banner: '"use weex:vue";', + raw: true, + exclude: 'Vue', + }); +} +exports.createBannerPlugin = createBannerPlugin; diff --git a/packages/uni-cli-nvue/dist/webpack/config/plugins/define.js b/packages/uni-cli-nvue/dist/webpack/config/plugins/define.js index 011c2f3acc1e2a2a2a8309fa8ee107ab4af6a67b..7d845ea966552f26496039089da28336366fe7e4 100644 --- a/packages/uni-cli-nvue/dist/webpack/config/plugins/define.js +++ b/packages/uni-cli-nvue/dist/webpack/config/plugins/define.js @@ -1,10 +1,13 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.define = void 0; +exports.createDefinePlugin = void 0; const webpack_1 = require("webpack"); const shared_1 = require("@vue/shared"); const uni_cli_shared_1 = require("@dcloudio/uni-cli-shared"); -exports.define = new webpack_1.DefinePlugin(shared_1.extend({ - 'process.env.UNI_CLOUD_PROVIDER': process.env.UNI_CLOUD_PROVIDER, - 'process.env.HBX_USER_TOKEN': JSON.stringify(process.env.HBX_USER_TOKEN || ''), -}, uni_cli_shared_1.initDefine())); +function createDefinePlugin() { + return new webpack_1.DefinePlugin(shared_1.extend({ + 'process.env.UNI_CLOUD_PROVIDER': process.env.UNI_CLOUD_PROVIDER, + 'process.env.HBX_USER_TOKEN': JSON.stringify(process.env.HBX_USER_TOKEN || ''), + }, uni_cli_shared_1.initDefine())); +} +exports.createDefinePlugin = createDefinePlugin; diff --git a/packages/uni-cli-nvue/dist/webpack/config/plugins/index.js b/packages/uni-cli-nvue/dist/webpack/config/plugins/index.js index 40d1b003c48a8165cf7a3a8ad2e53979a7858933..8ebddf279b8898555a71c489ab72c80c7578d59b 100644 --- a/packages/uni-cli-nvue/dist/webpack/config/plugins/index.js +++ b/packages/uni-cli-nvue/dist/webpack/config/plugins/index.js @@ -1,13 +1,16 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.plugins = void 0; +exports.createPlugins = void 0; const define_1 = require("./define"); const banner_1 = require("./banner"); const provide_1 = require("./provide"); const vueLoader_1 = require("./vueLoader"); -exports.plugins = [ - define_1.define, - banner_1.banner, - provide_1.provide, - vueLoader_1.vueLoaderPlugin, -]; +function createPlugins() { + return [ + define_1.createDefinePlugin(), + banner_1.createBannerPlugin(), + provide_1.createProvidePlugin(), + vueLoader_1.createVueLoaderPlugin(), + ]; +} +exports.createPlugins = createPlugins; diff --git a/packages/uni-cli-nvue/dist/webpack/config/plugins/provide.js b/packages/uni-cli-nvue/dist/webpack/config/plugins/provide.js index c9889748f2beb746b57264f23f97d3f1bfa4c057..28ab0a5655ba72f12b8cbcc7695fe58f4897710e 100644 --- a/packages/uni-cli-nvue/dist/webpack/config/plugins/provide.js +++ b/packages/uni-cli-nvue/dist/webpack/config/plugins/provide.js @@ -1,21 +1,16 @@ "use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; Object.defineProperty(exports, "__esModule", { value: true }); -exports.provide = void 0; -const path_1 = __importDefault(require("path")); +exports.createProvidePlugin = void 0; const webpack_1 = require("webpack"); const uni_cli_shared_1 = require("@dcloudio/uni-cli-shared"); -const libDir = path_1.default.resolve(__dirname, '../../../../lib'); -const definitions = Object.assign({ uniCloud: [ - require.resolve('@dcloudio/uni-cloud/dist/uni-cloud.es.js'), - 'default', - ], 'uni.getCurrentSubNVue': [ - path_1.default.join(libDir, 'get-current-sub-nvue.js'), - 'default', - ], 'uni.requireNativePlugin': [ - path_1.default.join(libDir, 'require-native-plugin.js'), - 'default', - ] }, uni_cli_shared_1.initProvide()); -exports.provide = new webpack_1.ProvidePlugin(definitions); +const utils_1 = require("../../../utils"); +function createProvidePlugin() { + return new webpack_1.ProvidePlugin(Object.assign({ uniCloud: [ + require.resolve('@dcloudio/uni-cloud/dist/uni-cloud.es.js'), + 'default', + ], 'uni.getCurrentSubNVue': [utils_1.resolveLib('get-current-sub-nvue.js'), 'default'], 'uni.requireNativePlugin': [ + utils_1.resolveLib('require-native-plugin.js'), + 'default', + ] }, uni_cli_shared_1.initProvide())); +} +exports.createProvidePlugin = createProvidePlugin; diff --git a/packages/uni-cli-nvue/dist/webpack/config/plugins/vueLoader.js b/packages/uni-cli-nvue/dist/webpack/config/plugins/vueLoader.js index 22824e891000975faa69d7ac8c5a065bd319c783..7dfeaa4b18dba9cd3722c755f14dcd1e9d4ed404 100644 --- a/packages/uni-cli-nvue/dist/webpack/config/plugins/vueLoader.js +++ b/packages/uni-cli-nvue/dist/webpack/config/plugins/vueLoader.js @@ -1,5 +1,8 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.vueLoaderPlugin = void 0; -const { VueLoaderPlugin } = require('../../../../lib/vue-loader'); -exports.vueLoaderPlugin = new VueLoaderPlugin(); +exports.createVueLoaderPlugin = void 0; +function createVueLoaderPlugin() { + const { VueLoaderPlugin } = require('../../../../lib/vue-loader'); + return new VueLoaderPlugin(); +} +exports.createVueLoaderPlugin = createVueLoaderPlugin; diff --git a/packages/uni-cli-nvue/dist/webpack/index.js b/packages/uni-cli-nvue/dist/webpack/index.js index 5827755d40052e4ff53e081584cef0f520823ebd..7f888207b2dbe45814c4ba57caccdd6a93d23194 100644 --- a/packages/uni-cli-nvue/dist/webpack/index.js +++ b/packages/uni-cli-nvue/dist/webpack/index.js @@ -5,8 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); exports.runWebpackDev = exports.runWebpackBuild = void 0; const webpack_1 = __importDefault(require("webpack")); +const uni_shared_1 = require("@dcloudio/uni-shared"); const config_1 = require("./config"); +const alias_1 = require("./alias"); +const initModuleAliasOnce = uni_shared_1.once(alias_1.initModuleAlias); function runWebpack(mode) { + initModuleAliasOnce(); return new Promise((resolve, reject) => { webpack_1.default(config_1.createConfig(mode), (err, stats) => { if (err) { diff --git a/packages/uni-cli-nvue/lib/vue-loader/lib/index.d.ts b/packages/uni-cli-nvue/lib/vue-loader/lib/index.d.ts index 28a4e3c5f28785cac7ac2644c6056e0e35a22b3f..030832c5bb9e7472040fc4b0373725e49e0cfb5c 100644 --- a/packages/uni-cli-nvue/lib/vue-loader/lib/index.d.ts +++ b/packages/uni-cli-nvue/lib/vue-loader/lib/index.d.ts @@ -1,4 +1,4 @@ -import { Plugin } from 'webpack' +// import { Plugin } from 'webpack' // fixed by xxxxxx import { VueTemplateCompiler } from '@vue/component-compiler-utils/dist/types' import { CompilerOptions } from 'vue-template-compiler' diff --git a/packages/uni-cli-nvue/src/webpack/config/module/rules/vueLoader/index.ts b/packages/uni-cli-nvue/src/webpack/config/module/rules/vueLoader/index.ts index ea879a86ded08c55b839621211922df86341f85a..c039c8dd8c73c45393ceea6c97d3f14a56ba3bba 100644 --- a/packages/uni-cli-nvue/src/webpack/config/module/rules/vueLoader/index.ts +++ b/packages/uni-cli-nvue/src/webpack/config/module/rules/vueLoader/index.ts @@ -1,11 +1,11 @@ import { RuleSetRule } from 'webpack' -import { VueLoaderOptions } from 'vue-loader' import { makeMap } from '@vue/shared' import type { CompilerOptions, CompiledResult } from 'vue-template-compiler' import { initEasycomsOnce } from '@dcloudio/uni-cli-shared' import { createCompilerOptions } from './compilerOptions' import { resolveLib } from '../../../../../utils' import { generateEasycomCode } from './easycom' +import { VueLoaderOptions } from '../../../../../../lib/vue-loader' export function createVueLoader(): RuleSetRule { initEasycomsOnce(process.env.UNI_INPUT_DIR, process.env.UNI_PLATFORM) diff --git a/packages/uni-core/src/helpers/bridge.ts b/packages/uni-core/src/helpers/bridge.ts index 567b03b03e2968a25bcae07fcd8695c5854b14d3..1842078e76d54eaa96bfc54decf09785f95890f8 100644 --- a/packages/uni-core/src/helpers/bridge.ts +++ b/packages/uni-core/src/helpers/bridge.ts @@ -1,5 +1,4 @@ // TODO 等待 vue3 的兼容模式自带emitter -import { formatLog } from '@dcloudio/uni-shared' import E from './TinyEmitter' export function initBridge( diff --git a/packages/uni-core/src/service/bridge/subscribeServiceMethod.ts b/packages/uni-core/src/service/bridge/subscribeServiceMethod.ts index 812185f1322907b9f9aa49136a47d25a65f6354b..7940a138c8c7b471f4131e565bac3ca048bdbe12 100644 --- a/packages/uni-core/src/service/bridge/subscribeServiceMethod.ts +++ b/packages/uni-core/src/service/bridge/subscribeServiceMethod.ts @@ -1,4 +1,3 @@ -import { formatLog } from '@dcloudio/uni-shared' import { INVOKE_SERVICE_API } from '../../constants' type ServiceMethod = ( diff --git a/packages/uni-core/src/view/bridge/subscribeViewMethod.ts b/packages/uni-core/src/view/bridge/subscribeViewMethod.ts index 71e7162f06b07bfad84ba7e05dee51613823ec4d..034ff526d2f5098d55cc07bde33e46890236fbc1 100644 --- a/packages/uni-core/src/view/bridge/subscribeViewMethod.ts +++ b/packages/uni-core/src/view/bridge/subscribeViewMethod.ts @@ -1,4 +1,3 @@ -import { formatLog } from '@dcloudio/uni-shared' import { INVOKE_VIEW_API } from '../../constants' type ViewMethod = ( diff --git a/packages/uni-h5/dist/uni-h5.cjs.js b/packages/uni-h5/dist/uni-h5.cjs.js index e4adfd7a58c8ba2d567ba1b0f2a8c6a1bd4de630..2ae8e8534c8f74d963b11eafe0ca0ecfe8a0ec43 100644 --- a/packages/uni-h5/dist/uni-h5.cjs.js +++ b/packages/uni-h5/dist/uni-h5.cjs.js @@ -10583,8 +10583,9 @@ function onPageHeadBackButton() { }); } else { uni.navigateBack({ - from: "backbutton" - }).catch(() => { + from: "backbutton", + success() { + } }); } } diff --git a/packages/uni-h5/dist/uni-h5.es.js b/packages/uni-h5/dist/uni-h5.es.js index 02b0841f7c0050ffdd16e8c6d32eb1640afcc9a1..efb1ab7fa6c819a3565342474e6a64f091e0c8a0 100644 --- a/packages/uni-h5/dist/uni-h5.es.js +++ b/packages/uni-h5/dist/uni-h5.es.js @@ -20796,8 +20796,9 @@ function onPageHeadBackButton() { }); } else { uni.navigateBack({ - from: "backbutton" - }).catch(() => { + from: "backbutton", + success() { + } }); } } diff --git a/packages/uni-h5/src/framework/components/page/pageHead.tsx b/packages/uni-h5/src/framework/components/page/pageHead.tsx index b12965da58fbca9db1a359d5cd065aab1c3feeb6..47ff0940783c0701294ea4c8e49df8539d9c024f 100644 --- a/packages/uni-h5/src/framework/components/page/pageHead.tsx +++ b/packages/uni-h5/src/framework/components/page/pageHead.tsx @@ -248,9 +248,10 @@ function onPageHeadBackButton() { url: '/', }) } else { - ;(uni.navigateBack as Function)({ + uni.navigateBack({ from: 'backbutton', - }).catch(() => {}) + success() {}, // 传入空方法,避免返回Promise,因为onBackPress可能导致fail + } as UniApp.NavigateBackOptions) } }