提交 76d8643c 编写于 作者: Q qiang

feat(App): getSystemInfo

上级 27867c21
......@@ -5213,6 +5213,35 @@ var serviceContext = (function (vue) {
}));
};
}
function isTabBarPage(path = '') {
if (!(__uniConfig.tabBar && Array.isArray(__uniConfig.tabBar.list))) {
return false;
}
try {
if (!path) {
const pages = getCurrentPages();
if (!pages.length) {
return false;
}
const page = pages[pages.length - 1];
if (!page) {
return false;
}
return page.$page.meta.isTabBar;
}
if (!/^\//.test(path)) {
path = '/' + path;
}
const route = getRouteOptions(path);
return route && route.meta.isTabBar;
}
catch (e) {
if ((process.env.NODE_ENV !== 'production')) {
console.error(formatLog('isTabBarPage', e));
}
}
return false;
}
const STORAGE_DATA_TYPE = '__TYPE';
const STORAGE_KEYS = 'uni-storage-keys';
......@@ -5396,6 +5425,325 @@ var serviceContext = (function (vue) {
});
}, OpenDocumentProtocol, OpenDocumentOptions);
const isIOS = plus.os.name === 'iOS';
let config;
/**
* tabbar显示状态
*/
let visible = true;
let tabBar;
/**
* 设置角标
* @param {string} type
* @param {number} index
* @param {string} text
*/
function setTabBarBadge(type, index, text) {
if (!tabBar) {
return;
}
if (type === 'none') {
tabBar.hideTabBarRedDot({
index,
});
tabBar.removeTabBarBadge({
index,
});
}
else if (type === 'text') {
tabBar.setTabBarBadge({
index,
text,
});
}
else if (type === 'redDot') {
tabBar.showTabBarRedDot({
index,
});
}
}
/**
* 动态设置 tabBar 某一项的内容
*/
function setTabBarItem(index, text, iconPath, selectedIconPath) {
const item = {
index,
};
if (text !== undefined) {
item.text = text;
}
if (iconPath) {
item.iconPath = getRealPath(iconPath);
}
if (selectedIconPath) {
item.selectedIconPath = getRealPath(selectedIconPath);
}
tabBar && tabBar.setTabBarItem(item);
}
/**
* 动态设置 tabBar 的整体样式
* @param {Object} style 样式
*/
function setTabBarStyle(style) {
tabBar && tabBar.setTabBarStyle(style);
}
/**
* 隐藏 tabBar
* @param {boolean} animation 是否需要动画效果
*/
function hideTabBar(animation) {
visible = false;
tabBar &&
tabBar.hideTabBar({
animation,
});
}
/**
* 显示 tabBar
* @param {boolean} animation 是否需要动画效果
*/
function showTabBar(animation) {
visible = true;
tabBar &&
tabBar.showTabBar({
animation,
});
}
const maskClickCallback = [];
var tabBar$1 = {
id: '0',
init(options, clickCallback) {
if (options && options.list.length) {
config = options;
}
try {
tabBar = weex.requireModule('uni-tabview');
}
catch (error) {
console.log(`uni.requireNativePlugin("uni-tabview") error ${error}`);
}
tabBar.onMaskClick(() => {
maskClickCallback.forEach((callback) => {
callback();
});
});
tabBar &&
tabBar.onClick(({ index }) => {
clickCallback(config.list[index], index);
});
tabBar &&
tabBar.onMidButtonClick(() => {
// publish('onTabBarMidButtonTap', {})
});
},
indexOf(page) {
const itemLength = config && config.list && config.list.length;
if (itemLength) {
for (let i = 0; i < itemLength; i++) {
if (config.list[i].pagePath === page ||
config.list[i].pagePath === `${page}.html`) {
return i;
}
}
}
return -1;
},
switchTab(page) {
const index = this.indexOf(page);
if (index >= 0) {
tabBar &&
tabBar.switchSelect({
index,
});
return true;
}
return false;
},
setTabBarBadge,
setTabBarItem,
setTabBarStyle,
hideTabBar,
showTabBar,
append(webview) {
tabBar &&
tabBar.append({
id: webview.id,
}, ({ code }) => {
if (code !== 0) {
setTimeout(() => {
this.append(webview);
}, 20);
}
});
},
get visible() {
return visible;
},
get height() {
return ((config && config.height ? parseFloat(config.height) : TABBAR_HEIGHT) +
plus.navigator.getSafeAreaInsets().deviceBottom);
},
// tabBar是否遮挡内容区域
get cover() {
const array = ['extralight', 'light', 'dark'];
return isIOS && array.indexOf(config.blurEffect) >= 0;
},
setStyle({ mask }) {
tabBar.setMask({
color: mask,
});
},
addEventListener(_name, callback) {
maskClickCallback.push(callback);
},
removeEventListener(_name, callback) {
const callbackIndex = maskClickCallback.indexOf(callback);
maskClickCallback.splice(callbackIndex, 1);
},
};
function getCurrentWebview() {
const page = getCurrentPage();
if (page) {
return page.$getAppWebview();
}
return null;
}
let pullDownRefreshWebview = null;
function getPullDownRefreshWebview() {
return pullDownRefreshWebview;
}
function setPullDownRefreshWebview(webview) {
pullDownRefreshWebview = webview;
}
function getStatusbarHeight() {
// 横屏时 iOS 获取的状态栏高度错误,进行纠正
return plus.navigator.isImmersedStatusbar()
? Math.round(plus.os.name === 'iOS'
? plus.navigator.getSafeAreaInsets().top
: plus.navigator.getStatusbarHeight())
: 0;
}
function getStatusBarStyle() {
let style = plus.navigator.getStatusBarStyle();
if (style === 'UIStatusBarStyleBlackTranslucent' ||
style === 'UIStatusBarStyleBlackOpaque' ||
style === 'null') {
style = 'light';
}
else if (style === 'UIStatusBarStyleDefault') {
style = 'dark';
}
return style;
}
let deviceId;
function deviceId$1 () {
deviceId = deviceId || plus.runtime.getDCloudId();
return deviceId;
}
function getScreenInfo() {
const { resolutionWidth, resolutionHeight } = plus.screen.getCurrentSize();
return {
screenWidth: Math.round(resolutionWidth),
screenHeight: Math.round(resolutionHeight),
};
}
const getSystemInfoSync = defineSyncApi('getSystemInfoSync', () => {
const platform = plus.os.name.toLowerCase();
const ios = platform === 'ios';
const isAndroid = platform === 'android';
const { screenWidth, screenHeight } = getScreenInfo();
const statusBarHeight = getStatusbarHeight();
let safeAreaInsets;
const titleNView = {
height: 0,
cover: false,
};
const webview = getCurrentWebview();
if (webview) {
const webStyle = webview.getStyle();
const style = webStyle && webStyle.titleNView;
if (style && style.type && style.type !== 'none') {
titleNView.height =
style.type === 'transparent' ? 0 : statusBarHeight + NAVBAR_HEIGHT;
titleNView.cover =
style.type === 'transparent' || style.type === 'float';
}
safeAreaInsets = webview.getSafeAreaInsets();
}
else {
safeAreaInsets = plus.navigator.getSafeAreaInsets();
}
const tabBarView = {
height: 0,
cover: false,
};
if (isTabBarPage()) {
tabBarView.height = tabBar$1.visible ? tabBar$1.height : 0;
tabBarView.cover = tabBar$1.cover;
}
const windowTop = titleNView.cover ? titleNView.height : 0;
const windowBottom = tabBarView.cover ? tabBarView.height : 0;
let windowHeight = screenHeight - titleNView.height - tabBarView.height;
let windowHeightReal = screenHeight -
(titleNView.cover ? 0 : titleNView.height) -
(tabBarView.cover ? 0 : tabBarView.height);
const windowWidth = screenWidth;
if ((!tabBarView.height || tabBarView.cover) &&
!safeAreaInsets.bottom &&
safeAreaInsets.deviceBottom) {
windowHeight -= safeAreaInsets.deviceBottom;
windowHeightReal -= safeAreaInsets.deviceBottom;
}
safeAreaInsets = ios
? safeAreaInsets
: {
left: 0,
right: 0,
top: titleNView.height && !titleNView.cover ? 0 : statusBarHeight,
bottom: 0,
};
const safeArea = {
left: safeAreaInsets.left,
right: windowWidth - safeAreaInsets.right,
top: safeAreaInsets.top,
bottom: windowHeightReal - safeAreaInsets.bottom,
width: windowWidth - safeAreaInsets.left - safeAreaInsets.right,
height: windowHeightReal - safeAreaInsets.top - safeAreaInsets.bottom,
};
return {
brand: plus.device.vendor,
model: plus.device.model,
pixelRatio: plus.screen.scale,
screenWidth,
screenHeight,
windowWidth,
windowHeight,
statusBarHeight,
language: plus.os.language,
system: `${ios ? 'iOS' : isAndroid ? 'Android' : ''} ${plus.os.version}`,
version: plus.runtime.innerVersion,
platform,
SDKVersion: '',
windowTop,
windowBottom,
safeArea,
safeAreaInsets: {
top: safeAreaInsets.top,
right: safeAreaInsets.right,
bottom: safeAreaInsets.bottom,
left: safeAreaInsets.left,
},
deviceId: deviceId$1(),
};
});
const getSystemInfo = defineAsyncApi('getSystemInfo', (_, { resolve }) => {
return resolve(getSystemInfoSync());
});
const DEVICE_FREQUENCY = 200;
const NETWORK_TYPES = [
'unknown',
......@@ -6076,27 +6424,6 @@ var serviceContext = (function (vue) {
return new Page(page);
}
function getStatusbarHeight() {
// 横屏时 iOS 获取的状态栏高度错误,进行纠正
return plus.navigator.isImmersedStatusbar()
? Math.round(plus.os.name === 'iOS'
? plus.navigator.getSafeAreaInsets().top
: plus.navigator.getStatusbarHeight())
: 0;
}
function getStatusBarStyle() {
let style = plus.navigator.getStatusBarStyle();
if (style === 'UIStatusBarStyleBlackTranslucent' ||
style === 'UIStatusBarStyleBlackOpaque' ||
style === 'null') {
style = 'light';
}
else if (style === 'UIStatusBarStyleDefault') {
style = 'dark';
}
return style;
}
const scanCode = defineAsyncApi(API_SCAN_CODE, (options, { resolve, reject }) => {
initI18nScanCodeMsgsOnce();
const { t } = useI18n();
......@@ -8105,21 +8432,6 @@ var serviceContext = (function (vue) {
return callbacks && callbacks.resolve();
}
function getCurrentWebview() {
const page = getCurrentPage();
if (page) {
return page.$getAppWebview();
}
return null;
}
let pullDownRefreshWebview = null;
function getPullDownRefreshWebview() {
return pullDownRefreshWebview;
}
function setPullDownRefreshWebview(webview) {
pullDownRefreshWebview = webview;
}
const startPullDownRefresh = defineAsyncApi(API_START_PULL_DOWN_REFRESH, (_args, { resolve, reject }) => {
let webview = getPullDownRefreshWebview();
if (webview) {
......@@ -8638,186 +8950,9 @@ var serviceContext = (function (vue) {
__uniConfig.realEntryPagePath =
__uniConfig.realEntryPagePath || __uniConfig.entryPagePath;
}
__uniConfig.entryPagePath = entryPagePath;
__uniConfig.entryPageQuery = entryPageQuery;
}
const isIOS = plus.os.name === 'iOS';
let config;
/**
* tabbar显示状态
*/
let visible = true;
let tabBar;
/**
* 设置角标
* @param {string} type
* @param {number} index
* @param {string} text
*/
function setTabBarBadge(type, index, text) {
if (!tabBar) {
return;
}
if (type === 'none') {
tabBar.hideTabBarRedDot({
index,
});
tabBar.removeTabBarBadge({
index,
});
}
else if (type === 'text') {
tabBar.setTabBarBadge({
index,
text,
});
}
else if (type === 'redDot') {
tabBar.showTabBarRedDot({
index,
});
}
}
/**
* 动态设置 tabBar 某一项的内容
*/
function setTabBarItem(index, text, iconPath, selectedIconPath) {
const item = {
index,
};
if (text !== undefined) {
item.text = text;
}
if (iconPath) {
item.iconPath = getRealPath(iconPath);
}
if (selectedIconPath) {
item.selectedIconPath = getRealPath(selectedIconPath);
}
tabBar && tabBar.setTabBarItem(item);
}
/**
* 动态设置 tabBar 的整体样式
* @param {Object} style 样式
*/
function setTabBarStyle(style) {
tabBar && tabBar.setTabBarStyle(style);
}
/**
* 隐藏 tabBar
* @param {boolean} animation 是否需要动画效果
*/
function hideTabBar(animation) {
visible = false;
tabBar &&
tabBar.hideTabBar({
animation,
});
}
/**
* 显示 tabBar
* @param {boolean} animation 是否需要动画效果
*/
function showTabBar(animation) {
visible = true;
tabBar &&
tabBar.showTabBar({
animation,
});
}
const maskClickCallback = [];
var tabBar$1 = {
id: '0',
init(options, clickCallback) {
if (options && options.list.length) {
config = options;
}
try {
tabBar = weex.requireModule('uni-tabview');
}
catch (error) {
console.log(`uni.requireNativePlugin("uni-tabview") error ${error}`);
}
tabBar.onMaskClick(() => {
maskClickCallback.forEach((callback) => {
callback();
});
});
tabBar &&
tabBar.onClick(({ index }) => {
clickCallback(config.list[index], index);
});
tabBar &&
tabBar.onMidButtonClick(() => {
// publish('onTabBarMidButtonTap', {})
});
},
indexOf(page) {
const itemLength = config && config.list && config.list.length;
if (itemLength) {
for (let i = 0; i < itemLength; i++) {
if (config.list[i].pagePath === page ||
config.list[i].pagePath === `${page}.html`) {
return i;
}
}
}
return -1;
},
switchTab(page) {
const index = this.indexOf(page);
if (index >= 0) {
tabBar &&
tabBar.switchSelect({
index,
});
return true;
}
return false;
},
setTabBarBadge,
setTabBarItem,
setTabBarStyle,
hideTabBar,
showTabBar,
append(webview) {
tabBar &&
tabBar.append({
id: webview.id,
}, ({ code }) => {
if (code !== 0) {
setTimeout(() => {
this.append(webview);
}, 20);
__uniConfig.entryPagePath = entryPagePath;
__uniConfig.entryPageQuery = entryPageQuery;
}
});
},
get visible() {
return visible;
},
get height() {
return ((config && config.height ? parseFloat(config.height) : TABBAR_HEIGHT) +
plus.navigator.getSafeAreaInsets().deviceBottom);
},
// tabBar是否遮挡内容区域
get cover() {
const array = ['extralight', 'light', 'dark'];
return isIOS && array.indexOf(config.blurEffect) >= 0;
},
setStyle({ mask }) {
tabBar.setMask({
color: mask,
});
},
addEventListener(_name, callback) {
maskClickCallback.push(callback);
},
removeEventListener(_name, callback) {
const callbackIndex = maskClickCallback.indexOf(callback);
maskClickCallback.splice(callbackIndex, 1);
},
};
function initTabBar() {
const { tabBar } = __uniConfig;
......@@ -10878,6 +11013,8 @@ var serviceContext = (function (vue) {
getStorageInfo: getStorageInfo,
getFileInfo: getFileInfo$1,
openDocument: openDocument,
getSystemInfoSync: getSystemInfoSync,
getSystemInfo: getSystemInfo,
onCompassChange: onCompassChange,
offCompassChange: offCompassChange,
startCompass: startCompass,
......@@ -11018,7 +11155,7 @@ var serviceContext = (function (vue) {
UniServiceJSBridge: UniServiceJSBridge$1,
};
/*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */
/*! pako 2.0.3 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
//
......@@ -11047,19 +11184,19 @@ var serviceContext = (function (vue) {
//const Z_FILTERED = 1;
//const Z_HUFFMAN_ONLY = 2;
//const Z_RLE = 3;
const Z_FIXED$1 = 4;
const Z_FIXED = 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$1 = 2;
const Z_UNKNOWN = 2;
/*============================================================================*/
function zero$1(buf) { let len = buf.length; while (--len >= 0) { buf[len] = 0; } }
function zero(buf) { let len = buf.length; while (--len >= 0) { buf[len] = 0; } }
// From zutil.h
......@@ -11068,8 +11205,8 @@ var serviceContext = (function (vue) {
const DYN_TREES = 2;
/* The three kinds of block type */
const MIN_MATCH$1 = 3;
const MAX_MATCH$1 = 258;
const MIN_MATCH = 3;
const MAX_MATCH = 258;
/* The minimum and maximum match lengths */
// From deflate.h
......@@ -11077,25 +11214,25 @@ var serviceContext = (function (vue) {
* Internal compression state.
*/
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 Buf_size = 16;
......@@ -11148,37 +11285,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$1 + 2) * 2);
zero$1(static_ltree);
const static_ltree = new Array((L_CODES + 2) * 2);
zero(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$1 * 2);
zero$1(static_dtree);
const static_dtree = new Array(D_CODES * 2);
zero(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$1(_dist_code);
zero(_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$1 - MIN_MATCH$1 + 1);
zero$1(_length_code);
const _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);
zero(_length_code);
/* length code for each normalized match length (0 == MIN_MATCH) */
const base_length = new Array(LENGTH_CODES$1);
zero$1(base_length);
const base_length = new Array(LENGTH_CODES);
zero(base_length);
/* First normalized length for each code (0 = MIN_MATCH) */
const base_dist = new Array(D_CODES$1);
zero$1(base_dist);
const base_dist = new Array(D_CODES);
zero(base_dist);
/* First normalized distance for each code (0 = distance of 1) */
......@@ -11313,7 +11450,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$1; bits++) {
for (bits = 0; bits <= MAX_BITS; bits++) {
s.bl_count[bits] = 0;
}
......@@ -11322,7 +11459,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$1; h++) {
for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {
n = s.heap[h];
bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;
if (bits > max_length) {
......@@ -11397,7 +11534,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 + 1); /* next code value for each bit length */
const next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */
let code = 0; /* running code value */
let bits; /* bit index */
let n; /* code index */
......@@ -11405,7 +11542,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$1; bits++) {
for (bits = 1; bits <= MAX_BITS; bits++) {
next_code[bits] = code = (code + bl_count[bits - 1]) << 1;
}
/* Check that the bit counts in bl_count are consistent. The last code
......@@ -11437,7 +11574,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 + 1);
const bl_count = new Array(MAX_BITS + 1);
/* number of codes at each bit length for an optimal tree */
// do check in _tr_init()
......@@ -11454,7 +11591,7 @@ var serviceContext = (function (vue) {
/* Initialize the mapping length (0..255) -> length code (0..28) */
length = 0;
for (code = 0; code < LENGTH_CODES$1 - 1; code++) {
for (code = 0; code < LENGTH_CODES - 1; code++) {
base_length[code] = length;
for (n = 0; n < (1 << extra_lbits[code]); n++) {
_length_code[length++] = code;
......@@ -11477,7 +11614,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$1; code++) {
for (; code < D_CODES; code++) {
base_dist[code] = dist << 7;
for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {
_dist_code[256 + dist++] = code;
......@@ -11486,7 +11623,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$1; bits++) {
for (bits = 0; bits <= MAX_BITS; bits++) {
bl_count[bits] = 0;
}
......@@ -11515,18 +11652,18 @@ var serviceContext = (function (vue) {
* tree construction to get a canonical Huffman tree (longest code
* all ones)
*/
gen_codes(static_ltree, L_CODES$1 + 1, bl_count);
gen_codes(static_ltree, L_CODES + 1, bl_count);
/* The static distance tree is trivial: */
for (n = 0; n < D_CODES$1; n++) {
for (n = 0; n < D_CODES; 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 + 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_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_init_done = true;
};
......@@ -11540,9 +11677,9 @@ var serviceContext = (function (vue) {
let n; /* iterates over tree elements */
/* Initialize the trees. */
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; }
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; }
s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;
s.opt_len = s.static_len = 0;
......@@ -11662,7 +11799,7 @@ var serviceContext = (function (vue) {
} else {
/* Here, lc is the match length - MIN_MATCH */
code = _length_code[lc];
send_code(s, code + LITERALS$1 + 1, ltree); /* send the length code */
send_code(s, code + LITERALS + 1, ltree); /* send the length code */
extra = extra_lbits[code];
if (extra !== 0) {
lc -= base_length[code];
......@@ -11716,7 +11853,7 @@ var serviceContext = (function (vue) {
* heap[0] is not used.
*/
s.heap_len = 0;
s.heap_max = HEAP_SIZE$1;
s.heap_max = HEAP_SIZE;
for (n = 0; n < elems; n++) {
if (tree[n * 2]/*.Freq*/ !== 0) {
......@@ -11950,7 +12087,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 - 1; max_blindex >= 3; max_blindex--) {
for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {
if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {
break;
}
......@@ -12029,7 +12166,7 @@ var serviceContext = (function (vue) {
s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {
return Z_TEXT;
}
for (n = 32; n < LITERALS$1; n++) {
for (n = 32; n < LITERALS; n++) {
if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {
return Z_TEXT;
}
......@@ -12047,7 +12184,7 @@ var serviceContext = (function (vue) {
/* ===========================================================================
* Initialize the tree data structures for a new zlib stream.
*/
const _tr_init$1 = (s) =>
const _tr_init = (s) =>
{
if (!static_init_done) {
......@@ -12070,7 +12207,7 @@ var serviceContext = (function (vue) {
/* ===========================================================================
* Send a stored block
*/
const _tr_stored_block$1 = (s, buf, stored_len, last) =>
const _tr_stored_block = (s, buf, stored_len, last) =>
//DeflateState *s;
//charf *buf; /* input block */
//ulg stored_len; /* length of input block */
......@@ -12085,7 +12222,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$1 = (s) => {
const _tr_align = (s) => {
send_bits(s, STATIC_TREES << 1, 3);
send_code(s, END_BLOCK, static_ltree);
bi_flush(s);
......@@ -12096,7 +12233,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$1 = (s, buf, stored_len, last) =>
const _tr_flush_block = (s, buf, stored_len, last) =>
//DeflateState *s;
//charf *buf; /* input block, or NULL if too old */
//ulg stored_len; /* length of input block */
......@@ -12109,7 +12246,7 @@ var serviceContext = (function (vue) {
if (s.level > 0) {
/* Check if the file is binary or text */
if (s.strm.data_type === Z_UNKNOWN$1) {
if (s.strm.data_type === Z_UNKNOWN) {
s.strm.data_type = detect_data_type(s);
}
......@@ -12154,9 +12291,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$1(s, buf, stored_len, last);
_tr_stored_block(s, buf, stored_len, last);
} else if (s.strategy === Z_FIXED$1 || static_lenb === opt_lenb) {
} else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {
send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);
compress_block(s, static_ltree, static_dtree);
......@@ -12183,7 +12320,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$1 = (s, dist, lc) =>
const _tr_tally = (s, dist, lc) =>
// deflate_state *s;
// unsigned dist; /* distance of matched string */
// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */
......@@ -12207,7 +12344,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 + 1) * 2]/*.Freq*/++;
s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;
s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;
}
......@@ -12241,11 +12378,11 @@ var serviceContext = (function (vue) {
*/
};
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 _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 trees = {
_tr_init: _tr_init_1,
......@@ -12413,7 +12550,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$2 = {
var constants = {
/* Allowed flush values; see deflate() and inflate() below for details */
Z_NO_FLUSH: 0,
......@@ -12480,7 +12617,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_stored_block, _tr_flush_block, _tr_tally, _tr_align } = trees;
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;
......@@ -12489,42 +12626,42 @@ var serviceContext = (function (vue) {
/* ===========================================================================*/
const {
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;
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;
/*============================================================================*/
const MAX_MEM_LEVEL = 9;
/* Maximum value for memLevel in deflateInit2 */
const MAX_WBITS$1 = 15;
const MAX_WBITS = 15;
/* 32K LZ77 window */
const DEF_MEM_LEVEL = 8;
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 MIN_MATCH = 3;
const MAX_MATCH = 258;
const MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);
const MIN_MATCH$1 = 3;
const MAX_MATCH$1 = 258;
const MIN_LOOKAHEAD = (MAX_MATCH$1 + MIN_MATCH$1 + 1);
const PRESET_DICT = 0x20;
......@@ -12552,7 +12689,7 @@ var serviceContext = (function (vue) {
return ((f) << 1) - ((f) > 4 ? 9 : 0);
};
const zero = (buf) => {
const zero$1 = (buf) => {
let len = buf.length; while (--len >= 0) { buf[len] = 0; }
};
......@@ -12593,7 +12730,7 @@ var serviceContext = (function (vue) {
const flush_block_only = (s, last) => {
_tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);
_tr_flush_block$1(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);
s.block_start = s.strstart;
flush_pending(s.strm);
};
......@@ -12680,7 +12817,7 @@ var serviceContext = (function (vue) {
* we prevent matches with the string of window index 0.
*/
const strend = s.strstart + MAX_MATCH;
const strend = s.strstart + MAX_MATCH$1;
let scan_end1 = _win[scan + best_len - 1];
let scan_end = _win[scan + best_len];
......@@ -12743,8 +12880,8 @@ var serviceContext = (function (vue) {
// Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
len = MAX_MATCH - (strend - scan);
scan = strend - MAX_MATCH;
len = MAX_MATCH$1 - (strend - scan);
scan = strend - MAX_MATCH$1;
if (len > best_len) {
s.match_start = cur_match;
......@@ -12858,7 +12995,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) {
if (s.lookahead + s.insert >= MIN_MATCH$1) {
str = s.strstart - s.insert;
s.ins_h = s.window[str];
......@@ -12869,13 +13006,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]);
s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH$1 - 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) {
if (s.lookahead + s.insert < MIN_MATCH$1) {
break;
}
}
......@@ -12957,7 +13094,7 @@ var serviceContext = (function (vue) {
// }
fill_window(s);
if (s.lookahead === 0 && flush === Z_NO_FLUSH$2) {
if (s.lookahead === 0 && flush === Z_NO_FLUSH) {
return BS_NEED_MORE;
}
......@@ -13003,7 +13140,7 @@ var serviceContext = (function (vue) {
s.insert = 0;
if (flush === Z_FINISH$3) {
if (flush === Z_FINISH) {
/*** FLUSH_BLOCK(s, 1); ***/
flush_block_only(s, true);
if (s.strm.avail_out === 0) {
......@@ -13045,7 +13182,7 @@ var serviceContext = (function (vue) {
*/
if (s.lookahead < MIN_LOOKAHEAD) {
fill_window(s);
if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH$2) {
if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
return BS_NEED_MORE;
}
if (s.lookahead === 0) {
......@@ -13057,9 +13194,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) {
if (s.lookahead >= MIN_MATCH$1) {
/*** INSERT_STRING(s, s.strstart, hash_head); ***/
s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);
s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]);
hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
s.head[s.ins_h] = s.strstart;
/***/
......@@ -13076,24 +13213,24 @@ var serviceContext = (function (vue) {
s.match_length = longest_match(s, hash_head);
/* longest_match() sets match_start */
}
if (s.match_length >= MIN_MATCH) {
if (s.match_length >= MIN_MATCH$1) {
// 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(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);
bflush = _tr_tally$1(s, s.strstart - s.match_start, s.match_length - MIN_MATCH$1);
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) {
if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH$1) {
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]);
s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]);
hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
s.head[s.ins_h] = s.strstart;
/***/
......@@ -13121,7 +13258,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(s, 0, s.window[s.strstart]);
bflush = _tr_tally$1(s, 0, s.window[s.strstart]);
s.lookahead--;
s.strstart++;
......@@ -13135,8 +13272,8 @@ var serviceContext = (function (vue) {
/***/
}
}
s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);
if (flush === Z_FINISH$3) {
s.insert = ((s.strstart < (MIN_MATCH$1 - 1)) ? s.strstart : MIN_MATCH$1 - 1);
if (flush === Z_FINISH) {
/*** FLUSH_BLOCK(s, 1); ***/
flush_block_only(s, true);
if (s.strm.avail_out === 0) {
......@@ -13177,7 +13314,7 @@ var serviceContext = (function (vue) {
*/
if (s.lookahead < MIN_LOOKAHEAD) {
fill_window(s);
if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH$2) {
if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
return BS_NEED_MORE;
}
if (s.lookahead === 0) { break; } /* flush the current block */
......@@ -13187,9 +13324,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) {
if (s.lookahead >= MIN_MATCH$1) {
/*** INSERT_STRING(s, s.strstart, hash_head); ***/
s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH - 1]);
s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]);
hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
s.head[s.ins_h] = s.strstart;
/***/
......@@ -13199,7 +13336,7 @@ var serviceContext = (function (vue) {
*/
s.prev_length = s.match_length;
s.prev_match = s.match_start;
s.match_length = MIN_MATCH - 1;
s.match_length = MIN_MATCH$1 - 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)*/) {
......@@ -13211,26 +13348,26 @@ var serviceContext = (function (vue) {
/* longest_match() sets match_start */
if (s.match_length <= 5 &&
(s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {
(s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH$1 && 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;
s.match_length = MIN_MATCH$1 - 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 && s.match_length <= s.prev_length) {
max_insert = s.strstart + s.lookahead - MIN_MATCH;
if (s.prev_length >= MIN_MATCH$1 && s.match_length <= s.prev_length) {
max_insert = s.strstart + s.lookahead - MIN_MATCH$1;
/* 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(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);
bflush = _tr_tally$1(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH$1);
/* 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
......@@ -13241,14 +13378,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]);
s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 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;
s.match_length = MIN_MATCH$1 - 1;
s.strstart++;
if (bflush) {
......@@ -13267,7 +13404,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(s, 0, s.window[s.strstart - 1]);
bflush = _tr_tally$1(s, 0, s.window[s.strstart - 1]);
if (bflush) {
/*** FLUSH_BLOCK_ONLY(s, 0) ***/
......@@ -13292,12 +13429,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(s, 0, s.window[s.strstart - 1]);
bflush = _tr_tally$1(s, 0, s.window[s.strstart - 1]);
s.match_available = 0;
}
s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;
if (flush === Z_FINISH$3) {
s.insert = s.strstart < MIN_MATCH$1 - 1 ? s.strstart : MIN_MATCH$1 - 1;
if (flush === Z_FINISH) {
/*** FLUSH_BLOCK(s, 1); ***/
flush_block_only(s, true);
if (s.strm.avail_out === 0) {
......@@ -13337,9 +13474,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) {
if (s.lookahead <= MAX_MATCH$1) {
fill_window(s);
if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH$2) {
if (s.lookahead <= MAX_MATCH$1 && flush === Z_NO_FLUSH) {
return BS_NEED_MORE;
}
if (s.lookahead === 0) { break; } /* flush the current block */
......@@ -13347,11 +13484,11 @@ var serviceContext = (function (vue) {
/* See how many times the previous byte repeats */
s.match_length = 0;
if (s.lookahead >= MIN_MATCH && s.strstart > 0) {
if (s.lookahead >= MIN_MATCH$1 && 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;
strend = s.strstart + MAX_MATCH$1;
do {
/*jshint noempty:false*/
} while (prev === _win[++scan] && prev === _win[++scan] &&
......@@ -13359,7 +13496,7 @@ var serviceContext = (function (vue) {
prev === _win[++scan] && prev === _win[++scan] &&
prev === _win[++scan] && prev === _win[++scan] &&
scan < strend);
s.match_length = MAX_MATCH - (strend - scan);
s.match_length = MAX_MATCH$1 - (strend - scan);
if (s.match_length > s.lookahead) {
s.match_length = s.lookahead;
}
......@@ -13368,11 +13505,11 @@ var serviceContext = (function (vue) {
}
/* Emit match if have run of MIN_MATCH or longer, else emit literal */
if (s.match_length >= MIN_MATCH) {
if (s.match_length >= MIN_MATCH$1) {
//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(s, 1, s.match_length - MIN_MATCH);
bflush = _tr_tally$1(s, 1, s.match_length - MIN_MATCH$1);
s.lookahead -= s.match_length;
s.strstart += s.match_length;
......@@ -13381,7 +13518,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(s, 0, s.window[s.strstart]);
bflush = _tr_tally$1(s, 0, s.window[s.strstart]);
s.lookahead--;
s.strstart++;
......@@ -13396,7 +13533,7 @@ var serviceContext = (function (vue) {
}
}
s.insert = 0;
if (flush === Z_FINISH$3) {
if (flush === Z_FINISH) {
/*** FLUSH_BLOCK(s, 1); ***/
flush_block_only(s, true);
if (s.strm.avail_out === 0) {
......@@ -13429,7 +13566,7 @@ var serviceContext = (function (vue) {
if (s.lookahead === 0) {
fill_window(s);
if (s.lookahead === 0) {
if (flush === Z_NO_FLUSH$2) {
if (flush === Z_NO_FLUSH) {
return BS_NEED_MORE;
}
break; /* flush the current block */
......@@ -13440,7 +13577,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(s, 0, s.window[s.strstart]);
bflush = _tr_tally$1(s, 0, s.window[s.strstart]);
s.lookahead--;
s.strstart++;
if (bflush) {
......@@ -13453,7 +13590,7 @@ var serviceContext = (function (vue) {
}
}
s.insert = 0;
if (flush === Z_FINISH$3) {
if (flush === Z_FINISH) {
/*** FLUSH_BLOCK(s, 1); ***/
flush_block_only(s, true);
if (s.strm.avail_out === 0) {
......@@ -13511,7 +13648,7 @@ var serviceContext = (function (vue) {
s.window_size = 2 * s.w_size;
/*** CLEAR_HASH(s); ***/
zero(s.head); // Fill with NIL (= 0);
zero$1(s.head); // Fill with NIL (= 0);
/* Set the default configuration parameters:
*/
......@@ -13524,7 +13661,7 @@ var serviceContext = (function (vue) {
s.block_start = 0;
s.lookahead = 0;
s.insert = 0;
s.match_length = s.prev_length = MIN_MATCH - 1;
s.match_length = s.prev_length = MIN_MATCH$1 - 1;
s.match_available = 0;
s.ins_h = 0;
};
......@@ -13540,7 +13677,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$2; /* can only be DEFLATED */
this.method = Z_DEFLATED; /* 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) */
......@@ -13633,24 +13770,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 * 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.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.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);
this.bl_count = new Uint16Array(MAX_BITS$1 + 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); /* heap used to build the Huffman trees */
zero(this.heap);
this.heap = new Uint16Array(2 * L_CODES$1 + 1); /* heap used to build the Huffman trees */
zero$1(this.heap);
this.heap_len = 0; /* number of elements in the heap */
this.heap_max = 0; /* element of largest frequency */
......@@ -13658,8 +13795,8 @@ var serviceContext = (function (vue) {
* The same heap array is used to build all trees.
*/
this.depth = new Uint16Array(2 * L_CODES + 1); //uch depth[2*L_CODES+1];
zero(this.depth);
this.depth = new Uint16Array(2 * L_CODES$1 + 1); //uch depth[2*L_CODES+1];
zero$1(this.depth);
/* Depth of each subtree used as tie breaker for trees of equal frequency
*/
......@@ -13722,11 +13859,11 @@ var serviceContext = (function (vue) {
const deflateResetKeep = (strm) => {
if (!strm || !strm.state) {
return err(strm, Z_STREAM_ERROR$2);
return err(strm, Z_STREAM_ERROR);
}
strm.total_in = strm.total_out = 0;
strm.data_type = Z_UNKNOWN;
strm.data_type = Z_UNKNOWN$1;
const s = strm.state;
s.pending = 0;
......@@ -13741,16 +13878,16 @@ var serviceContext = (function (vue) {
0 // crc32(0, Z_NULL, 0)
:
1; // adler32(0, Z_NULL, 0)
s.last_flush = Z_NO_FLUSH$2;
_tr_init(s);
return Z_OK$3;
s.last_flush = Z_NO_FLUSH;
_tr_init$1(s);
return Z_OK;
};
const deflateReset = (strm) => {
const ret = deflateResetKeep(strm);
if (ret === Z_OK$3) {
if (ret === Z_OK) {
lm_init(strm.state);
}
return ret;
......@@ -13759,21 +13896,21 @@ var serviceContext = (function (vue) {
const deflateSetHeader = (strm, head) => {
if (!strm || !strm.state) { return Z_STREAM_ERROR$2; }
if (strm.state.wrap !== 2) { return Z_STREAM_ERROR$2; }
if (!strm || !strm.state) { return Z_STREAM_ERROR; }
if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }
strm.state.gzhead = head;
return Z_OK$3;
return Z_OK;
};
const deflateInit2 = (strm, level, method, windowBits, memLevel, strategy) => {
if (!strm) { // === Z_NULL
return Z_STREAM_ERROR$2;
return Z_STREAM_ERROR;
}
let wrap = 1;
if (level === Z_DEFAULT_COMPRESSION$1) {
if (level === Z_DEFAULT_COMPRESSION) {
level = 6;
}
......@@ -13788,10 +13925,10 @@ var serviceContext = (function (vue) {
}
if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED$2 ||
if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||
windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
strategy < 0 || strategy > Z_FIXED) {
return err(strm, Z_STREAM_ERROR$2);
strategy < 0 || strategy > Z_FIXED$1) {
return err(strm, Z_STREAM_ERROR);
}
......@@ -13814,7 +13951,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) / MIN_MATCH);
s.hash_shift = ~~((s.hash_bits + MIN_MATCH$1 - 1) / MIN_MATCH$1);
s.window = new Uint8Array(s.w_size * 2);
s.head = new Uint16Array(s.hash_size);
......@@ -13847,25 +13984,25 @@ var serviceContext = (function (vue) {
const deflateInit = (strm, level) => {
return deflateInit2(strm, level, Z_DEFLATED$2, MAX_WBITS$1, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY$1);
return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);
};
const deflate$2 = (strm, flush) => {
const deflate = (strm, flush) => {
let beg, val; // for gzip header write only
if (!strm || !strm.state ||
flush > Z_BLOCK$1 || flush < 0) {
return strm ? err(strm, Z_STREAM_ERROR$2) : Z_STREAM_ERROR$2;
flush > Z_BLOCK || flush < 0) {
return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;
}
const s = strm.state;
if (!strm.output ||
(!strm.input && strm.avail_in !== 0) ||
(s.status === FINISH_STATE && flush !== Z_FINISH$3)) {
return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR$1 : Z_STREAM_ERROR$2);
(s.status === FINISH_STATE && flush !== Z_FINISH)) {
return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);
}
s.strm = strm; /* just in case */
......@@ -13920,7 +14057,7 @@ var serviceContext = (function (vue) {
}
else // DEFLATE header
{
let header = (Z_DEFLATED$2 + ((s.w_bits - 8) << 4)) << 8;
let header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;
let level_flags = -1;
if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {
......@@ -14083,7 +14220,7 @@ var serviceContext = (function (vue) {
* return OK instead of BUF_ERROR at next call of deflate:
*/
s.last_flush = -1;
return Z_OK$3;
return Z_OK;
}
/* Make sure there is something to do and avoid duplicate consecutive
......@@ -14091,19 +14228,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$3) {
return err(strm, Z_BUF_ERROR$1);
flush !== Z_FINISH) {
return err(strm, Z_BUF_ERROR);
}
/* 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$1);
return err(strm, Z_BUF_ERROR);
}
/* Start a new block or continue the current one.
*/
if (strm.avail_in !== 0 || s.lookahead !== 0 ||
(flush !== Z_NO_FLUSH$2 && s.status !== FINISH_STATE)) {
(flush !== Z_NO_FLUSH && 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));
......@@ -14116,7 +14253,7 @@ var serviceContext = (function (vue) {
s.last_flush = -1;
/* avoid BUF_ERROR next call, see above */
}
return Z_OK$3;
return Z_OK;
/* 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
......@@ -14127,17 +14264,17 @@ var serviceContext = (function (vue) {
}
if (bstate === BS_BLOCK_DONE) {
if (flush === Z_PARTIAL_FLUSH) {
_tr_align(s);
_tr_align$1(s);
}
else if (flush !== Z_BLOCK$1) { /* FULL_FLUSH or SYNC_FLUSH */
else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */
_tr_stored_block(s, 0, 0, false);
_tr_stored_block$1(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$1) {
if (flush === Z_FULL_FLUSH) {
/*** CLEAR_HASH(s); ***/ /* forget history */
zero(s.head); // Fill with NIL (= 0);
zero$1(s.head); // Fill with NIL (= 0);
if (s.lookahead === 0) {
s.strstart = 0;
......@@ -14149,15 +14286,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$3;
return Z_OK;
}
}
}
//Assert(strm->avail_out > 0, "bug2");
//if (strm.avail_out <= 0) { throw new Error("bug2");}
if (flush !== Z_FINISH$3) { return Z_OK$3; }
if (s.wrap <= 0) { return Z_STREAM_END$3; }
if (flush !== Z_FINISH) { return Z_OK; }
if (s.wrap <= 0) { return Z_STREAM_END; }
/* Write the trailer */
if (s.wrap === 2) {
......@@ -14182,14 +14319,14 @@ var serviceContext = (function (vue) {
*/
if (s.wrap > 0) { s.wrap = -s.wrap; }
/* write the trailer only once! */
return s.pending !== 0 ? Z_OK$3 : Z_STREAM_END$3;
return s.pending !== 0 ? Z_OK : Z_STREAM_END;
};
const deflateEnd = (strm) => {
if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {
return Z_STREAM_ERROR$2;
return Z_STREAM_ERROR;
}
const status = strm.state.status;
......@@ -14201,12 +14338,12 @@ var serviceContext = (function (vue) {
status !== BUSY_STATE &&
status !== FINISH_STATE
) {
return err(strm, Z_STREAM_ERROR$2);
return err(strm, Z_STREAM_ERROR);
}
strm.state = null;
return status === BUSY_STATE ? err(strm, Z_DATA_ERROR$2) : Z_OK$3;
return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;
};
......@@ -14219,14 +14356,14 @@ var serviceContext = (function (vue) {
let dictLength = dictionary.length;
if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {
return Z_STREAM_ERROR$2;
return Z_STREAM_ERROR;
}
const s = strm.state;
const wrap = s.wrap;
if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {
return Z_STREAM_ERROR$2;
return Z_STREAM_ERROR;
}
/* when using zlib wrappers, compute Adler-32 for provided dictionary */
......@@ -14241,7 +14378,7 @@ var serviceContext = (function (vue) {
if (dictLength >= s.w_size) {
if (wrap === 0) { /* already empty otherwise */
/*** CLEAR_HASH(s); ***/
zero(s.head); // Fill with NIL (= 0);
zero$1(s.head); // Fill with NIL (= 0);
s.strstart = 0;
s.block_start = 0;
s.insert = 0;
......@@ -14261,12 +14398,12 @@ var serviceContext = (function (vue) {
strm.next_in = 0;
strm.input = dictionary;
fill_window(s);
while (s.lookahead >= MIN_MATCH) {
while (s.lookahead >= MIN_MATCH$1) {
let str = s.strstart;
let n = s.lookahead - (MIN_MATCH - 1);
let n = s.lookahead - (MIN_MATCH$1 - 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]);
s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH$1 - 1]);
s.prev[str & s.w_mask] = s.head[s.ins_h];
......@@ -14274,20 +14411,20 @@ var serviceContext = (function (vue) {
str++;
} while (--n);
s.strstart = str;
s.lookahead = MIN_MATCH - 1;
s.lookahead = MIN_MATCH$1 - 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;
s.match_length = s.prev_length = MIN_MATCH$1 - 1;
s.match_available = 0;
strm.next_in = next;
strm.input = input;
strm.avail_in = avail;
s.wrap = wrap;
return Z_OK$3;
return Z_OK;
};
......@@ -14296,7 +14433,7 @@ var serviceContext = (function (vue) {
var deflateReset_1 = deflateReset;
var deflateResetKeep_1 = deflateResetKeep;
var deflateSetHeader_1 = deflateSetHeader;
var deflate_2$1 = deflate$2;
var deflate_2 = deflate;
var deflateEnd_1 = deflateEnd;
var deflateSetDictionary_1 = deflateSetDictionary;
var deflateInfo = 'pako deflate (from Nodeca project)';
......@@ -14310,13 +14447,13 @@ var serviceContext = (function (vue) {
module.exports.deflateTune = deflateTune;
*/
var deflate_1$2 = {
var deflate_1 = {
deflateInit: deflateInit_1,
deflateInit2: deflateInit2_1,
deflateReset: deflateReset_1,
deflateResetKeep: deflateResetKeep_1,
deflateSetHeader: deflateSetHeader_1,
deflate: deflate_2$1,
deflate: deflate_2,
deflateEnd: deflateEnd_1,
deflateSetDictionary: deflateSetDictionary_1,
deflateInfo: deflateInfo
......@@ -14398,10 +14535,6 @@ 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
......@@ -14475,13 +14608,8 @@ var serviceContext = (function (vue) {
// convert array to string
var buf2string = (buf, max) => {
const len = max || buf.length;
if (typeof TextDecoder === 'function' && TextDecoder.prototype.decode) {
return new TextDecoder().decode(buf.subarray(0, max));
}
let i, out;
const len = max || buf.length;
// Reserve max possible length (2 words per char)
// NB: by unknown reasons, Array is significantly faster for
......@@ -14599,18 +14727,18 @@ var serviceContext = (function (vue) {
var zstream = ZStream;
const toString$1 = Object.prototype.toString;
const toString = Object.prototype.toString;
/* Public constants ==========================================================*/
/* ===========================================================================*/
const {
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_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_DEFLATED: Z_DEFLATED$1
} = constants$2;
} = constants;
/* ===========================================================================*/
......@@ -14700,14 +14828,14 @@ var serviceContext = (function (vue) {
* console.log(deflate.result);
* ```
**/
function Deflate$1(options) {
function Deflate(options) {
this.options = common.assign({
level: Z_DEFAULT_COMPRESSION,
level: Z_DEFAULT_COMPRESSION$1,
method: Z_DEFLATED$1,
chunkSize: 16384,
windowBits: 15,
memLevel: 8,
strategy: Z_DEFAULT_STRATEGY
strategy: Z_DEFAULT_STRATEGY$1
}, options || {});
let opt = this.options;
......@@ -14728,7 +14856,7 @@ var serviceContext = (function (vue) {
this.strm = new zstream();
this.strm.avail_out = 0;
let status = deflate_1$2.deflateInit2(
let status = deflate_1.deflateInit2(
this.strm,
opt.level,
opt.method,
......@@ -14737,12 +14865,12 @@ var serviceContext = (function (vue) {
opt.strategy
);
if (status !== Z_OK$2) {
if (status !== Z_OK$1) {
throw new Error(messages[status]);
}
if (opt.header) {
deflate_1$2.deflateSetHeader(this.strm, opt.header);
deflate_1.deflateSetHeader(this.strm, opt.header);
}
if (opt.dictionary) {
......@@ -14751,15 +14879,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$1.call(opt.dictionary) === '[object ArrayBuffer]') {
} else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {
dict = new Uint8Array(opt.dictionary);
} else {
dict = opt.dictionary;
}
status = deflate_1$2.deflateSetDictionary(this.strm, dict);
status = deflate_1.deflateSetDictionary(this.strm, dict);
if (status !== Z_OK$2) {
if (status !== Z_OK$1) {
throw new Error(messages[status]);
}
......@@ -14789,7 +14917,7 @@ var serviceContext = (function (vue) {
* push(chunk, true); // push last chunk
* ```
**/
Deflate$1.prototype.push = function (data, flush_mode) {
Deflate.prototype.push = function (data, flush_mode) {
const strm = this.strm;
const chunkSize = this.options.chunkSize;
let status, _flush_mode;
......@@ -14797,13 +14925,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$2 : Z_NO_FLUSH$1;
else _flush_mode = flush_mode === true ? Z_FINISH$1 : 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$1.call(data) === '[object ArrayBuffer]') {
} else if (toString.call(data) === '[object ArrayBuffer]') {
strm.input = new Uint8Array(data);
} else {
strm.input = data;
......@@ -14820,23 +14948,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) && strm.avail_out <= 6) {
if ((_flush_mode === Z_SYNC_FLUSH || _flush_mode === Z_FULL_FLUSH$1) && strm.avail_out <= 6) {
this.onData(strm.output.subarray(0, strm.next_out));
strm.avail_out = 0;
continue;
}
status = deflate_1$2.deflate(strm, _flush_mode);
status = deflate_1.deflate(strm, _flush_mode);
// Ended => flush and finish
if (status === Z_STREAM_END$2) {
if (status === Z_STREAM_END$1) {
if (strm.next_out > 0) {
this.onData(strm.output.subarray(0, strm.next_out));
}
status = deflate_1$2.deflateEnd(this.strm);
status = deflate_1.deflateEnd(this.strm);
this.onEnd(status);
this.ended = true;
return status === Z_OK$2;
return status === Z_OK$1;
}
// Flush if out buffer full
......@@ -14866,7 +14994,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$1.prototype.onData = function (chunk) {
Deflate.prototype.onData = function (chunk) {
this.chunks.push(chunk);
};
......@@ -14880,9 +15008,9 @@ var serviceContext = (function (vue) {
* complete (Z_FINISH). By default - join collected chunks,
* free memory and fill `results` / `err` properties.
**/
Deflate$1.prototype.onEnd = function (status) {
Deflate.prototype.onEnd = function (status) {
// On success - join
if (status === Z_OK$2) {
if (status === Z_OK$1) {
this.result = common.flattenChunks(this.chunks);
}
this.chunks = [];
......@@ -14924,7 +15052,7 @@ var serviceContext = (function (vue) {
* ```
**/
function deflate$1(input, options) {
const deflator = new Deflate$1(options);
const deflator = new Deflate(options);
deflator.push(input, true);
......@@ -14943,7 +15071,7 @@ var serviceContext = (function (vue) {
* The same as [[deflate]], but creates raw data, without wrapper
* (header and adler32 crc).
**/
function deflateRaw$1(input, options) {
function deflateRaw(input, options) {
options = options || {};
options.raw = true;
return deflate$1(input, options);
......@@ -14958,24 +15086,24 @@ var serviceContext = (function (vue) {
* The same as [[deflate]], but create gzip wrapper instead of
* deflate one.
**/
function gzip$1(input, options) {
function gzip(input, options) {
options = options || {};
options.gzip = true;
return deflate$1(input, options);
}
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 = Deflate;
var deflate_2$1 = deflate$1;
var deflateRaw_1 = deflateRaw;
var gzip_1 = gzip;
var constants$1 = constants;
var deflate_1$1 = {
Deflate: Deflate_1$1,
deflate: deflate_2,
deflateRaw: deflateRaw_1$1,
gzip: gzip_1$1,
Deflate: Deflate_1,
deflate: deflate_2$1,
deflateRaw: deflateRaw_1,
gzip: gzip_1,
constants: constants$1
};
......@@ -14999,8 +15127,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$1 = 30; /* got a data error -- remain here until reset */
const TYPE$1 = 12; /* i: waiting for type bits, including last-flag bit */
const BAD = 30; /* got a data error -- remain here until reset */
const TYPE = 12; /* i: waiting for type bits, including last-flag bit */
/*
Decode literal, length, and distance codes and write out the resulting
......@@ -15162,7 +15290,7 @@ var serviceContext = (function (vue) {
//#ifdef INFLATE_STRICT
if (dist > dmax) {
strm.msg = 'invalid distance too far back';
state.mode = BAD$1;
state.mode = BAD;
break top;
}
//#endif
......@@ -15175,7 +15303,7 @@ var serviceContext = (function (vue) {
if (op > whave) {
if (state.sane) {
strm.msg = 'invalid distance too far back';
state.mode = BAD$1;
state.mode = BAD;
break top;
}
......@@ -15280,7 +15408,7 @@ var serviceContext = (function (vue) {
}
else {
strm.msg = 'invalid distance code';
state.mode = BAD$1;
state.mode = BAD;
break top;
}
......@@ -15293,12 +15421,12 @@ var serviceContext = (function (vue) {
}
else if (op & 32) { /* end-of-block */
//Tracevv((stderr, "inflate: end of block\n"));
state.mode = TYPE$1;
state.mode = TYPE;
break top;
}
else {
strm.msg = 'invalid literal/length code';
state.mode = BAD$1;
state.mode = BAD;
break top;
}
......@@ -15342,13 +15470,13 @@ var serviceContext = (function (vue) {
// 3. This notice may not be removed or altered from any source distribution.
const MAXBITS = 15;
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 CODES$1 = 0;
const LENS$1 = 1;
const DISTS$1 = 2;
const CODES = 0;
const LENS = 1;
const DISTS = 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,
......@@ -15480,7 +15608,7 @@ var serviceContext = (function (vue) {
return -1;
} /* over-subscribed */
}
if (left > 0 && (type === CODES$1 || max !== 1)) {
if (left > 0 && (type === CODES || max !== 1)) {
return -1; /* incomplete set */
}
......@@ -15531,11 +15659,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$1) {
if (type === CODES) {
base = extra = work; /* dummy value--not used */
end = 19;
} else if (type === LENS$1) {
} else if (type === LENS) {
base = lbase;
base_index -= 257;
extra = lext;
......@@ -15560,8 +15688,8 @@ var serviceContext = (function (vue) {
mask = used - 1; /* mask for comparing low */
/* check available table space */
if ((type === LENS$1 && used > ENOUGH_LENS$1) ||
(type === DISTS$1 && used > ENOUGH_DISTS$1)) {
if ((type === LENS && used > ENOUGH_LENS) ||
(type === DISTS && used > ENOUGH_DISTS)) {
return 1;
}
......@@ -15632,8 +15760,8 @@ var serviceContext = (function (vue) {
/* check for enough space */
used += 1 << curr;
if ((type === LENS$1 && used > ENOUGH_LENS$1) ||
(type === DISTS$1 && used > ENOUGH_DISTS$1)) {
if ((type === LENS && used > ENOUGH_LENS) ||
(type === DISTS && used > ENOUGH_DISTS)) {
return 1;
}
......@@ -15689,18 +15817,18 @@ var serviceContext = (function (vue) {
const CODES = 0;
const LENS = 1;
const DISTS = 2;
const CODES$1 = 0;
const LENS$1 = 1;
const DISTS$1 = 2;
/* Public constants ==========================================================*/
/* ===========================================================================*/
const {
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;
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;
/* STATES ====================================================================*/
......@@ -15718,7 +15846,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 = 12; /* i: waiting for type bits, including last-flag bit */
const TYPE$1 = 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 */
......@@ -15736,7 +15864,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 = 30; /* got a data error -- remain here until reset */
const BAD$1 = 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() */
......@@ -15744,13 +15872,13 @@ var serviceContext = (function (vue) {
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 MAX_WBITS = 15;
const MAX_WBITS$1 = 15;
/* 32K LZ77 window */
const DEF_WBITS = MAX_WBITS;
const DEF_WBITS = MAX_WBITS$1;
const zswap32 = (q) => {
......@@ -15838,13 +15966,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);
state.distcode = state.distdyn = new Int32Array(ENOUGH_DISTS);
state.lencode = state.lendyn = new Int32Array(ENOUGH_LENS$1);
state.distcode = state.distdyn = new Int32Array(ENOUGH_DISTS$1);
state.sane = 1;
state.back = -1;
//Tracev((stderr, "inflate: reset\n"));
return Z_OK$1;
return Z_OK$2;
};
......@@ -15906,7 +16034,7 @@ var serviceContext = (function (vue) {
strm.state = state;
state.window = null/*Z_NULL*/;
const ret = inflateReset2(strm, windowBits);
if (ret !== Z_OK$1) {
if (ret !== Z_OK$2) {
strm.state = null/*Z_NULL*/;
}
return ret;
......@@ -15948,13 +16076,13 @@ var serviceContext = (function (vue) {
while (sym < 280) { state.lens[sym++] = 7; }
while (sym < 288) { state.lens[sym++] = 8; }
inftrees(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });
inftrees(LENS$1, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });
/* distance table */
sym = 0;
while (sym < 32) { state.lens[sym++] = 5; }
inftrees(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });
inftrees(DISTS$1, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });
/* do this just once */
virgin = false;
......@@ -16025,7 +16153,7 @@ var serviceContext = (function (vue) {
};
const inflate$2 = (strm, flush) => {
const inflate = (strm, flush) => {
let state;
let input, output; // input/output buffers
......@@ -16059,7 +16187,7 @@ var serviceContext = (function (vue) {
}
state = strm.state;
if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */
if (state.mode === TYPE$1) { state.mode = TYPEDO; } /* skip check */
//--- LOAD() ---
......@@ -16075,7 +16203,7 @@ var serviceContext = (function (vue) {
_in = have;
_out = left;
ret = Z_OK$1;
ret = Z_OK$2;
inf_leave: // goto emulation
for (;;) {
......@@ -16115,12 +16243,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;
state.mode = BAD$1;
break;
}
if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {
if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED$2) {
strm.msg = 'unknown compression method';
state.mode = BAD;
state.mode = BAD$1;
break;
}
//--- DROPBITS(4) ---//
......@@ -16133,7 +16261,7 @@ var serviceContext = (function (vue) {
}
else if (len > state.wbits) {
strm.msg = 'invalid window size';
state.mode = BAD;
state.mode = BAD$1;
break;
}
......@@ -16144,7 +16272,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;
state.mode = hold & 0x200 ? DICTID : TYPE$1;
//=== INITBITS();
hold = 0;
bits = 0;
......@@ -16160,14 +16288,14 @@ var serviceContext = (function (vue) {
}
//===//
state.flags = hold;
if ((state.flags & 0xff) !== Z_DEFLATED) {
if ((state.flags & 0xff) !== Z_DEFLATED$2) {
strm.msg = 'unknown compression method';
state.mode = BAD;
state.mode = BAD$1;
break;
}
if (state.flags & 0xe000) {
strm.msg = 'unknown header flags set';
state.mode = BAD;
state.mode = BAD$1;
break;
}
if (state.head) {
......@@ -16370,7 +16498,7 @@ var serviceContext = (function (vue) {
//===//
if (hold !== (state.check & 0xffff)) {
strm.msg = 'header crc mismatch';
state.mode = BAD;
state.mode = BAD$1;
break;
}
//=== INITBITS();
......@@ -16383,7 +16511,7 @@ var serviceContext = (function (vue) {
state.head.done = true;
}
strm.adler = state.check = 0;
state.mode = TYPE;
state.mode = TYPE$1;
break;
case DICTID:
//=== NEEDBITS(32); */
......@@ -16411,13 +16539,13 @@ var serviceContext = (function (vue) {
state.hold = hold;
state.bits = bits;
//---
return Z_NEED_DICT$1;
return Z_NEED_DICT;
}
strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
state.mode = TYPE;
state.mode = TYPE$1;
/* falls through */
case TYPE:
if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }
case TYPE$1:
if (flush === Z_BLOCK$1 || flush === Z_TREES) { break inf_leave; }
/* falls through */
case TYPEDO:
if (state.last) {
......@@ -16468,7 +16596,7 @@ var serviceContext = (function (vue) {
break;
case 3:
strm.msg = 'invalid block type';
state.mode = BAD;
state.mode = BAD$1;
}
//--- DROPBITS(2) ---//
hold >>>= 2;
......@@ -16490,7 +16618,7 @@ var serviceContext = (function (vue) {
//===//
if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {
strm.msg = 'invalid stored block lengths';
state.mode = BAD;
state.mode = BAD$1;
break;
}
state.length = hold & 0xffff;
......@@ -16523,7 +16651,7 @@ var serviceContext = (function (vue) {
break;
}
//Tracev((stderr, "inflate: stored end\n"));
state.mode = TYPE;
state.mode = TYPE$1;
break;
case TABLE:
//=== NEEDBITS(14); */
......@@ -16552,7 +16680,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;
state.mode = BAD$1;
break;
}
//#endif
......@@ -16587,12 +16715,12 @@ var serviceContext = (function (vue) {
state.lenbits = 7;
opts = { bits: state.lenbits };
ret = inftrees(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);
ret = inftrees(CODES$1, 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;
state.mode = BAD$1;
break;
}
//Tracev((stderr, "inflate: code lengths ok\n"));
......@@ -16639,7 +16767,7 @@ var serviceContext = (function (vue) {
//---//
if (state.have === 0) {
strm.msg = 'invalid bit length repeat';
state.mode = BAD;
state.mode = BAD$1;
break;
}
len = state.lens[state.have - 1];
......@@ -16693,7 +16821,7 @@ var serviceContext = (function (vue) {
}
if (state.have + copy > state.nlen + state.ndist) {
strm.msg = 'invalid bit length repeat';
state.mode = BAD;
state.mode = BAD$1;
break;
}
while (copy--) {
......@@ -16703,12 +16831,12 @@ var serviceContext = (function (vue) {
}
/* handle error breaks in while */
if (state.mode === BAD) { break; }
if (state.mode === BAD$1) { 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;
state.mode = BAD$1;
break;
}
......@@ -16718,7 +16846,7 @@ var serviceContext = (function (vue) {
state.lenbits = 9;
opts = { bits: state.lenbits };
ret = inftrees(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);
ret = inftrees(LENS$1, 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;
......@@ -16726,7 +16854,7 @@ var serviceContext = (function (vue) {
if (ret) {
strm.msg = 'invalid literal/lengths set';
state.mode = BAD;
state.mode = BAD$1;
break;
}
......@@ -16735,7 +16863,7 @@ var serviceContext = (function (vue) {
// Switch to use dynamic table
state.distcode = state.distdyn;
opts = { bits: state.distbits };
ret = inftrees(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);
ret = inftrees(DISTS$1, 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;
......@@ -16743,7 +16871,7 @@ var serviceContext = (function (vue) {
if (ret) {
strm.msg = 'invalid distances set';
state.mode = BAD;
state.mode = BAD$1;
break;
}
//Tracev((stderr, 'inflate: codes ok\n'));
......@@ -16775,7 +16903,7 @@ var serviceContext = (function (vue) {
bits = state.bits;
//---
if (state.mode === TYPE) {
if (state.mode === TYPE$1) {
state.back = -1;
}
break;
......@@ -16836,12 +16964,12 @@ var serviceContext = (function (vue) {
if (here_op & 32) {
//Tracevv((stderr, "inflate: end of block\n"));
state.back = -1;
state.mode = TYPE;
state.mode = TYPE$1;
break;
}
if (here_op & 64) {
strm.msg = 'invalid literal/length code';
state.mode = BAD;
state.mode = BAD$1;
break;
}
state.extra = here_op & 15;
......@@ -16916,7 +17044,7 @@ var serviceContext = (function (vue) {
state.back += here_bits;
if (here_op & 64) {
strm.msg = 'invalid distance code';
state.mode = BAD;
state.mode = BAD$1;
break;
}
state.offset = here_val;
......@@ -16944,7 +17072,7 @@ var serviceContext = (function (vue) {
//#ifdef INFLATE_STRICT
if (state.offset > state.dmax) {
strm.msg = 'invalid distance too far back';
state.mode = BAD;
state.mode = BAD$1;
break;
}
//#endif
......@@ -16959,7 +17087,7 @@ var serviceContext = (function (vue) {
if (copy > state.whave) {
if (state.sane) {
strm.msg = 'invalid distance too far back';
state.mode = BAD;
state.mode = BAD$1;
break;
}
// (!) This block is disabled in zlib defaults,
......@@ -17031,7 +17159,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;
state.mode = BAD$1;
break;
}
//=== INITBITS();
......@@ -17054,7 +17182,7 @@ var serviceContext = (function (vue) {
//===//
if (hold !== (state.total & 0xffffffff)) {
strm.msg = 'incorrect length check';
state.mode = BAD;
state.mode = BAD$1;
break;
}
//=== INITBITS();
......@@ -17066,13 +17194,13 @@ var serviceContext = (function (vue) {
state.mode = DONE;
/* falls through */
case DONE:
ret = Z_STREAM_END$1;
ret = Z_STREAM_END$2;
break inf_leave;
case BAD:
case BAD$1:
ret = Z_DATA_ERROR$1;
break inf_leave;
case MEM:
return Z_MEM_ERROR$1;
return Z_MEM_ERROR;
case SYNC:
/* falls through */
default:
......@@ -17098,8 +17226,8 @@ var serviceContext = (function (vue) {
state.bits = bits;
//---
if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&
(state.mode < CHECK || flush !== Z_FINISH$1))) {
if (state.wsize || (_out !== strm.avail_out && state.mode < BAD$1 &&
(state.mode < CHECK || flush !== Z_FINISH$2))) {
if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) ;
}
_in -= strm.avail_in;
......@@ -17112,10 +17240,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 ? 128 : 0) +
(state.mode === TYPE$1 ? 128 : 0) +
(state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);
if (((_in === 0 && _out === 0) || flush === Z_FINISH$1) && ret === Z_OK$1) {
ret = Z_BUF_ERROR;
if (((_in === 0 && _out === 0) || flush === Z_FINISH$2) && ret === Z_OK$2) {
ret = Z_BUF_ERROR$1;
}
return ret;
};
......@@ -17132,7 +17260,7 @@ var serviceContext = (function (vue) {
state.window = null;
}
strm.state = null;
return Z_OK$1;
return Z_OK$2;
};
......@@ -17146,7 +17274,7 @@ var serviceContext = (function (vue) {
/* save header structure */
state.head = head;
head.done = false;
return Z_OK$1;
return Z_OK$2;
};
......@@ -17179,11 +17307,11 @@ var serviceContext = (function (vue) {
ret = updatewindow(strm, dictionary, dictLength, dictLength);
if (ret) {
state.mode = MEM;
return Z_MEM_ERROR$1;
return Z_MEM_ERROR;
}
state.havedict = 1;
// Tracev((stderr, "inflate: dictionary set\n"));
return Z_OK$1;
return Z_OK$2;
};
......@@ -17192,7 +17320,7 @@ var serviceContext = (function (vue) {
var inflateResetKeep_1 = inflateResetKeep;
var inflateInit_1 = inflateInit;
var inflateInit2_1 = inflateInit2;
var inflate_2$1 = inflate$2;
var inflate_2 = inflate;
var inflateEnd_1 = inflateEnd;
var inflateGetHeader_1 = inflateGetHeader;
var inflateSetDictionary_1 = inflateSetDictionary;
......@@ -17208,13 +17336,13 @@ var serviceContext = (function (vue) {
module.exports.inflateUndermine = inflateUndermine;
*/
var inflate_1$2 = {
var inflate_1 = {
inflateReset: inflateReset_1,
inflateReset2: inflateReset2_1,
inflateResetKeep: inflateResetKeep_1,
inflateInit: inflateInit_1,
inflateInit2: inflateInit2_1,
inflate: inflate_2$1,
inflate: inflate_2,
inflateEnd: inflateEnd_1,
inflateGetHeader: inflateGetHeader_1,
inflateSetDictionary: inflateSetDictionary_1,
......@@ -17278,15 +17406,15 @@ var serviceContext = (function (vue) {
var gzheader = GZheader;
const toString = Object.prototype.toString;
const toString$1 = Object.prototype.toString;
/* Public constants ==========================================================*/
/* ===========================================================================*/
const {
Z_NO_FLUSH, Z_FINISH,
Z_OK, Z_STREAM_END, Z_NEED_DICT, Z_STREAM_ERROR, Z_DATA_ERROR, Z_MEM_ERROR
} = constants$2;
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;
/* ===========================================================================*/
......@@ -17368,7 +17496,7 @@ var serviceContext = (function (vue) {
* console.log(inflate.result);
* ```
**/
function Inflate$1(options) {
function Inflate(options) {
this.options = common.assign({
chunkSize: 1024 * 64,
windowBits: 15,
......@@ -17408,30 +17536,30 @@ var serviceContext = (function (vue) {
this.strm = new zstream();
this.strm.avail_out = 0;
let status = inflate_1$2.inflateInit2(
let status = inflate_1.inflateInit2(
this.strm,
opt.windowBits
);
if (status !== Z_OK) {
if (status !== Z_OK$3) {
throw new Error(messages[status]);
}
this.header = new gzheader();
inflate_1$2.inflateGetHeader(this.strm, this.header);
inflate_1.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.call(opt.dictionary) === '[object ArrayBuffer]') {
} else if (toString$1.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$2.inflateSetDictionary(this.strm, opt.dictionary);
if (status !== Z_OK) {
status = inflate_1.inflateSetDictionary(this.strm, opt.dictionary);
if (status !== Z_OK$3) {
throw new Error(messages[status]);
}
}
......@@ -17463,7 +17591,7 @@ var serviceContext = (function (vue) {
* push(chunk, true); // push last chunk
* ```
**/
Inflate$1.prototype.push = function (data, flush_mode) {
Inflate.prototype.push = function (data, flush_mode) {
const strm = this.strm;
const chunkSize = this.options.chunkSize;
const dictionary = this.options.dictionary;
......@@ -17472,10 +17600,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 : Z_NO_FLUSH;
else _flush_mode = flush_mode === true ? Z_FINISH$3 : Z_NO_FLUSH$2;
// Convert data if needed
if (toString.call(data) === '[object ArrayBuffer]') {
if (toString$1.call(data) === '[object ArrayBuffer]') {
strm.input = new Uint8Array(data);
} else {
strm.input = data;
......@@ -17491,34 +17619,34 @@ var serviceContext = (function (vue) {
strm.avail_out = chunkSize;
}
status = inflate_1$2.inflate(strm, _flush_mode);
status = inflate_1.inflate(strm, _flush_mode);
if (status === Z_NEED_DICT && dictionary) {
status = inflate_1$2.inflateSetDictionary(strm, dictionary);
if (status === Z_NEED_DICT$1 && dictionary) {
status = inflate_1.inflateSetDictionary(strm, dictionary);
if (status === Z_OK) {
status = inflate_1$2.inflate(strm, _flush_mode);
} else if (status === Z_DATA_ERROR) {
if (status === Z_OK$3) {
status = inflate_1.inflate(strm, _flush_mode);
} else if (status === Z_DATA_ERROR$2) {
// Replace code with more verbose
status = Z_NEED_DICT;
status = Z_NEED_DICT$1;
}
}
// Skip snyc markers if more data follows and not raw mode
while (strm.avail_in > 0 &&
status === Z_STREAM_END &&
status === Z_STREAM_END$3 &&
strm.state.wrap > 0 &&
data[strm.next_in] !== 0)
{
inflate_1$2.inflateReset(strm);
status = inflate_1$2.inflate(strm, _flush_mode);
inflate_1.inflateReset(strm);
status = inflate_1.inflate(strm, _flush_mode);
}
switch (status) {
case Z_STREAM_ERROR:
case Z_DATA_ERROR:
case Z_NEED_DICT:
case Z_MEM_ERROR:
case Z_STREAM_ERROR$2:
case Z_DATA_ERROR$2:
case Z_NEED_DICT$1:
case Z_MEM_ERROR$1:
this.onEnd(status);
this.ended = true;
return false;
......@@ -17529,7 +17657,7 @@ var serviceContext = (function (vue) {
last_avail_out = strm.avail_out;
if (strm.next_out) {
if (strm.avail_out === 0 || status === Z_STREAM_END) {
if (strm.avail_out === 0 || status === Z_STREAM_END$3) {
if (this.options.to === 'string') {
......@@ -17552,11 +17680,11 @@ var serviceContext = (function (vue) {
}
// Must repeat iteration if out buffer is full
if (status === Z_OK && last_avail_out === 0) continue;
if (status === Z_OK$3 && last_avail_out === 0) continue;
// Finalize if end of stream reached.
if (status === Z_STREAM_END) {
status = inflate_1$2.inflateEnd(this.strm);
if (status === Z_STREAM_END$3) {
status = inflate_1.inflateEnd(this.strm);
this.onEnd(status);
this.ended = true;
return true;
......@@ -17577,7 +17705,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$1.prototype.onData = function (chunk) {
Inflate.prototype.onData = function (chunk) {
this.chunks.push(chunk);
};
......@@ -17591,9 +17719,9 @@ var serviceContext = (function (vue) {
* complete (Z_FINISH). By default - join collected chunks,
* free memory and fill `results` / `err` properties.
**/
Inflate$1.prototype.onEnd = function (status) {
Inflate.prototype.onEnd = function (status) {
// On success - join
if (status === Z_OK) {
if (status === Z_OK$3) {
if (this.options.to === 'string') {
this.result = this.chunks.join('');
} else {
......@@ -17640,13 +17768,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$1(options);
const inflator = new Inflate(options);
inflator.push(input);
......@@ -17665,7 +17793,7 @@ var serviceContext = (function (vue) {
* The same as [[inflate]], but creates raw data, without wrapper
* (header and adler32 crc).
**/
function inflateRaw$1(input, options) {
function inflateRaw(input, options) {
options = options || {};
options.raw = true;
return inflate$1(input, options);
......@@ -17682,59 +17810,59 @@ var serviceContext = (function (vue) {
**/
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 = Inflate;
var inflate_2$1 = inflate$1;
var inflateRaw_1 = inflateRaw;
var ungzip = inflate$1;
var constants$2 = constants;
var inflate_1$1 = {
Inflate: Inflate_1$1,
inflate: inflate_2,
inflateRaw: inflateRaw_1$1,
ungzip: ungzip$1,
constants: constants
Inflate: Inflate_1,
inflate: inflate_2$1,
inflateRaw: inflateRaw_1,
ungzip: ungzip,
constants: constants$2
};
const { Deflate, deflate, deflateRaw, gzip } = deflate_1$1;
const { Deflate: Deflate$1, deflate: deflate$2, deflateRaw: deflateRaw$1, gzip: gzip$1 } = deflate_1$1;
const { Inflate, inflate, inflateRaw, ungzip } = inflate_1$1;
const { Inflate: Inflate$1, inflate: inflate$2, inflateRaw: inflateRaw$1, ungzip: ungzip$1 } = inflate_1$1;
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 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 pako = {
Deflate: Deflate_1,
deflate: deflate_1,
deflateRaw: deflateRaw_1,
gzip: gzip_1,
Inflate: Inflate_1,
inflate: inflate_1,
inflateRaw: inflateRaw_1,
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,
ungzip: ungzip_1,
constants: constants_1
};
var pako_esm = /*#__PURE__*/Object.freeze({
__proto__: null,
Deflate: Deflate_1,
Inflate: Inflate_1,
constants: constants_1,
'default': pako,
deflate: deflate_1,
deflateRaw: deflateRaw_1,
gzip: gzip_1,
inflate: inflate_1,
inflateRaw: inflateRaw_1,
Deflate: Deflate_1$1,
Inflate: Inflate_1$1,
constants: constants_1,
deflate: deflate_1$2,
deflateRaw: deflateRaw_1$1,
gzip: gzip_1$1,
inflate: inflate_1$2,
inflateRaw: inflateRaw_1$1,
ungzip: ungzip_1
});
......
import { NAVBAR_HEIGHT } from '@dcloudio/uni-shared'
import { defineAsyncApi, defineSyncApi } from '@dcloudio/uni-api'
import tabBar from '../../framework/app/tabBar'
import { getCurrentWebview } from '../../utils'
import { getStatusbarHeight } from '../../../helpers/statusBar'
import { isTabBarPage } from '../../../helpers/plus'
import deviceId from '../../../helpers/uuid'
type SafeAreaInsets = Required<PlusNavigatorSafeAreaInsets>
function getScreenInfo() {
const { resolutionWidth, resolutionHeight } = plus.screen.getCurrentSize()
return {
screenWidth: Math.round(resolutionWidth),
screenHeight: Math.round(resolutionHeight),
}
}
export const getSystemInfoSync = defineSyncApi<typeof uni.getSystemInfoSync>(
'getSystemInfoSync',
() => {
const platform = plus.os.name!.toLowerCase()
const ios = platform === 'ios'
const isAndroid = platform === 'android'
const { screenWidth, screenHeight } = getScreenInfo()
const statusBarHeight = getStatusbarHeight()
let safeAreaInsets: SafeAreaInsets
const titleNView = {
height: 0,
cover: false,
}
const webview = getCurrentWebview()
if (webview) {
const webStyle = webview.getStyle()
const style = webStyle && webStyle.titleNView
if (style && style.type && (style as any).type !== 'none') {
titleNView.height =
style.type === 'transparent' ? 0 : statusBarHeight + NAVBAR_HEIGHT
titleNView.cover =
style.type === 'transparent' || style.type === 'float'
}
safeAreaInsets = webview.getSafeAreaInsets() as SafeAreaInsets
} else {
safeAreaInsets = plus.navigator.getSafeAreaInsets() as SafeAreaInsets
}
const tabBarView = {
height: 0,
cover: false,
}
if (isTabBarPage()) {
tabBarView.height = tabBar.visible ? tabBar.height : 0
tabBarView.cover = tabBar.cover
}
const windowTop = titleNView.cover ? titleNView.height : 0
const windowBottom = tabBarView.cover ? tabBarView.height : 0
let windowHeight = screenHeight - titleNView.height - tabBarView.height
let windowHeightReal =
screenHeight -
(titleNView.cover ? 0 : titleNView.height) -
(tabBarView.cover ? 0 : tabBarView.height)
const windowWidth = screenWidth
if (
(!tabBarView.height || tabBarView.cover) &&
!safeAreaInsets.bottom &&
safeAreaInsets.deviceBottom
) {
windowHeight -= safeAreaInsets.deviceBottom
windowHeightReal -= safeAreaInsets.deviceBottom
}
safeAreaInsets = ios
? safeAreaInsets
: ({
left: 0,
right: 0,
top: titleNView.height && !titleNView.cover ? 0 : statusBarHeight,
bottom: 0,
} as SafeAreaInsets)
const safeArea = {
left: safeAreaInsets.left,
right: windowWidth - safeAreaInsets.right,
top: safeAreaInsets.top,
bottom: windowHeightReal - safeAreaInsets.bottom,
width: windowWidth - safeAreaInsets.left - safeAreaInsets.right,
height: windowHeightReal - safeAreaInsets.top - safeAreaInsets.bottom,
}
return {
brand: plus.device.vendor!,
model: plus.device.model!,
pixelRatio: plus.screen.scale!,
screenWidth,
screenHeight,
windowWidth,
windowHeight,
statusBarHeight,
language: plus.os.language!,
system: `${ios ? 'iOS' : isAndroid ? 'Android' : ''} ${plus.os.version!}`,
version: plus.runtime.innerVersion!,
platform,
SDKVersion: '',
windowTop,
windowBottom,
safeArea,
safeAreaInsets: {
top: safeAreaInsets.top,
right: safeAreaInsets.right,
bottom: safeAreaInsets.bottom,
left: safeAreaInsets.left,
},
deviceId: deviceId(),
}
}
)
export const getSystemInfo = defineAsyncApi<typeof uni.getSystemInfo>(
'getSystemInfo',
(_, { resolve }) => {
return resolve(getSystemInfoSync())
}
)
......@@ -2,6 +2,7 @@ export * from './storage/storage'
export * from './file/getFileInfo'
export * from './file/openDocument'
export * from './device/systemInfo'
export * from './device/compass'
export * from './device/vibrate'
export * from './device/accelerometer'
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册