@vitessce/export-utils 3.5.12 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +559 -579
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -191,8 +191,7 @@ class Utils {
|
|
|
191
191
|
static getMacOSVersionName(version) {
|
|
192
192
|
const v = version.split(".").splice(0, 2).map((s) => parseInt(s, 10) || 0);
|
|
193
193
|
v.push(0);
|
|
194
|
-
if (v[0] !== 10)
|
|
195
|
-
return void 0;
|
|
194
|
+
if (v[0] !== 10) return void 0;
|
|
196
195
|
switch (v[1]) {
|
|
197
196
|
case 5:
|
|
198
197
|
return "Leopard";
|
|
@@ -247,36 +246,21 @@ class Utils {
|
|
|
247
246
|
static getAndroidVersionName(version) {
|
|
248
247
|
const v = version.split(".").splice(0, 2).map((s) => parseInt(s, 10) || 0);
|
|
249
248
|
v.push(0);
|
|
250
|
-
if (v[0] === 1 && v[1] < 5)
|
|
251
|
-
|
|
252
|
-
if (v[0] === 1 && v[1]
|
|
253
|
-
|
|
254
|
-
if (v[0] ===
|
|
255
|
-
|
|
256
|
-
if (v[0] ===
|
|
257
|
-
|
|
258
|
-
if (v[0] ===
|
|
259
|
-
|
|
260
|
-
if (v[0] ===
|
|
261
|
-
|
|
262
|
-
if (v[0] ===
|
|
263
|
-
|
|
264
|
-
if (v[0] ===
|
|
265
|
-
return "Ice Cream Sandwich";
|
|
266
|
-
if (v[0] === 4 && v[1] < 4)
|
|
267
|
-
return "Jelly Bean";
|
|
268
|
-
if (v[0] === 4 && v[1] >= 4)
|
|
269
|
-
return "KitKat";
|
|
270
|
-
if (v[0] === 5)
|
|
271
|
-
return "Lollipop";
|
|
272
|
-
if (v[0] === 6)
|
|
273
|
-
return "Marshmallow";
|
|
274
|
-
if (v[0] === 7)
|
|
275
|
-
return "Nougat";
|
|
276
|
-
if (v[0] === 8)
|
|
277
|
-
return "Oreo";
|
|
278
|
-
if (v[0] === 9)
|
|
279
|
-
return "Pie";
|
|
249
|
+
if (v[0] === 1 && v[1] < 5) return void 0;
|
|
250
|
+
if (v[0] === 1 && v[1] < 6) return "Cupcake";
|
|
251
|
+
if (v[0] === 1 && v[1] >= 6) return "Donut";
|
|
252
|
+
if (v[0] === 2 && v[1] < 2) return "Eclair";
|
|
253
|
+
if (v[0] === 2 && v[1] === 2) return "Froyo";
|
|
254
|
+
if (v[0] === 2 && v[1] > 2) return "Gingerbread";
|
|
255
|
+
if (v[0] === 3) return "Honeycomb";
|
|
256
|
+
if (v[0] === 4 && v[1] < 1) return "Ice Cream Sandwich";
|
|
257
|
+
if (v[0] === 4 && v[1] < 4) return "Jelly Bean";
|
|
258
|
+
if (v[0] === 4 && v[1] >= 4) return "KitKat";
|
|
259
|
+
if (v[0] === 5) return "Lollipop";
|
|
260
|
+
if (v[0] === 6) return "Marshmallow";
|
|
261
|
+
if (v[0] === 7) return "Nougat";
|
|
262
|
+
if (v[0] === 8) return "Oreo";
|
|
263
|
+
if (v[0] === 9) return "Pie";
|
|
280
264
|
return void 0;
|
|
281
265
|
}
|
|
282
266
|
/**
|
|
@@ -1942,136 +1926,210 @@ class Bowser {
|
|
|
1942
1926
|
return PLATFORMS_MAP;
|
|
1943
1927
|
}
|
|
1944
1928
|
}
|
|
1945
|
-
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
1946
1929
|
function getDefaultExportFromCjs(x) {
|
|
1947
1930
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
1948
1931
|
}
|
|
1949
1932
|
var lzString = { exports: {} };
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
var
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1933
|
+
var hasRequiredLzString;
|
|
1934
|
+
function requireLzString() {
|
|
1935
|
+
if (hasRequiredLzString) return lzString.exports;
|
|
1936
|
+
hasRequiredLzString = 1;
|
|
1937
|
+
(function(module) {
|
|
1938
|
+
var LZString = function() {
|
|
1939
|
+
var f = String.fromCharCode;
|
|
1940
|
+
var keyStrBase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
|
1941
|
+
var keyStrUriSafe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$";
|
|
1942
|
+
var baseReverseDic = {};
|
|
1943
|
+
function getBaseValue(alphabet, character) {
|
|
1944
|
+
if (!baseReverseDic[alphabet]) {
|
|
1945
|
+
baseReverseDic[alphabet] = {};
|
|
1946
|
+
for (var i = 0; i < alphabet.length; i++) {
|
|
1947
|
+
baseReverseDic[alphabet][alphabet.charAt(i)] = i;
|
|
1948
|
+
}
|
|
1962
1949
|
}
|
|
1950
|
+
return baseReverseDic[alphabet][character];
|
|
1963
1951
|
}
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
return res + "=";
|
|
1983
|
-
}
|
|
1984
|
-
},
|
|
1985
|
-
decompressFromBase64: function(input) {
|
|
1986
|
-
if (input == null)
|
|
1987
|
-
return "";
|
|
1988
|
-
if (input == "")
|
|
1989
|
-
return null;
|
|
1990
|
-
return LZString2._decompress(input.length, 32, function(index) {
|
|
1991
|
-
return getBaseValue(keyStrBase64, input.charAt(index));
|
|
1992
|
-
});
|
|
1993
|
-
},
|
|
1994
|
-
compressToUTF16: function(input) {
|
|
1995
|
-
if (input == null)
|
|
1996
|
-
return "";
|
|
1997
|
-
return LZString2._compress(input, 15, function(a) {
|
|
1998
|
-
return f(a + 32);
|
|
1999
|
-
}) + " ";
|
|
2000
|
-
},
|
|
2001
|
-
decompressFromUTF16: function(compressed) {
|
|
2002
|
-
if (compressed == null)
|
|
2003
|
-
return "";
|
|
2004
|
-
if (compressed == "")
|
|
2005
|
-
return null;
|
|
2006
|
-
return LZString2._decompress(compressed.length, 16384, function(index) {
|
|
2007
|
-
return compressed.charCodeAt(index) - 32;
|
|
2008
|
-
});
|
|
2009
|
-
},
|
|
2010
|
-
//compress into uint8array (UCS-2 big endian format)
|
|
2011
|
-
compressToUint8Array: function(uncompressed) {
|
|
2012
|
-
var compressed = LZString2.compress(uncompressed);
|
|
2013
|
-
var buf = new Uint8Array(compressed.length * 2);
|
|
2014
|
-
for (var i = 0, TotalLen = compressed.length; i < TotalLen; i++) {
|
|
2015
|
-
var current_value = compressed.charCodeAt(i);
|
|
2016
|
-
buf[i * 2] = current_value >>> 8;
|
|
2017
|
-
buf[i * 2 + 1] = current_value % 256;
|
|
2018
|
-
}
|
|
2019
|
-
return buf;
|
|
2020
|
-
},
|
|
2021
|
-
//decompress from uint8array (UCS-2 big endian format)
|
|
2022
|
-
decompressFromUint8Array: function(compressed) {
|
|
2023
|
-
if (compressed === null || compressed === void 0) {
|
|
2024
|
-
return LZString2.decompress(compressed);
|
|
2025
|
-
} else {
|
|
2026
|
-
var buf = new Array(compressed.length / 2);
|
|
2027
|
-
for (var i = 0, TotalLen = buf.length; i < TotalLen; i++) {
|
|
2028
|
-
buf[i] = compressed[i * 2] * 256 + compressed[i * 2 + 1];
|
|
1952
|
+
var LZString2 = {
|
|
1953
|
+
compressToBase64: function(input) {
|
|
1954
|
+
if (input == null) return "";
|
|
1955
|
+
var res = LZString2._compress(input, 6, function(a) {
|
|
1956
|
+
return keyStrBase64.charAt(a);
|
|
1957
|
+
});
|
|
1958
|
+
switch (res.length % 4) {
|
|
1959
|
+
// To produce valid Base64
|
|
1960
|
+
default:
|
|
1961
|
+
// When could this happen ?
|
|
1962
|
+
case 0:
|
|
1963
|
+
return res;
|
|
1964
|
+
case 1:
|
|
1965
|
+
return res + "===";
|
|
1966
|
+
case 2:
|
|
1967
|
+
return res + "==";
|
|
1968
|
+
case 3:
|
|
1969
|
+
return res + "=";
|
|
2029
1970
|
}
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
1971
|
+
},
|
|
1972
|
+
decompressFromBase64: function(input) {
|
|
1973
|
+
if (input == null) return "";
|
|
1974
|
+
if (input == "") return null;
|
|
1975
|
+
return LZString2._decompress(input.length, 32, function(index) {
|
|
1976
|
+
return getBaseValue(keyStrBase64, input.charAt(index));
|
|
2033
1977
|
});
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
compress: function(uncompressed) {
|
|
2057
|
-
return LZString2._compress(uncompressed, 16, function(a) {
|
|
2058
|
-
return f(a);
|
|
2059
|
-
});
|
|
2060
|
-
},
|
|
2061
|
-
_compress: function(uncompressed, bitsPerChar, getCharFromInt) {
|
|
2062
|
-
if (uncompressed == null)
|
|
2063
|
-
return "";
|
|
2064
|
-
var i, value, context_dictionary = {}, context_dictionaryToCreate = {}, context_c = "", context_wc = "", context_w = "", context_enlargeIn = 2, context_dictSize = 3, context_numBits = 2, context_data = [], context_data_val = 0, context_data_position = 0, ii;
|
|
2065
|
-
for (ii = 0; ii < uncompressed.length; ii += 1) {
|
|
2066
|
-
context_c = uncompressed.charAt(ii);
|
|
2067
|
-
if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {
|
|
2068
|
-
context_dictionary[context_c] = context_dictSize++;
|
|
2069
|
-
context_dictionaryToCreate[context_c] = true;
|
|
1978
|
+
},
|
|
1979
|
+
compressToUTF16: function(input) {
|
|
1980
|
+
if (input == null) return "";
|
|
1981
|
+
return LZString2._compress(input, 15, function(a) {
|
|
1982
|
+
return f(a + 32);
|
|
1983
|
+
}) + " ";
|
|
1984
|
+
},
|
|
1985
|
+
decompressFromUTF16: function(compressed) {
|
|
1986
|
+
if (compressed == null) return "";
|
|
1987
|
+
if (compressed == "") return null;
|
|
1988
|
+
return LZString2._decompress(compressed.length, 16384, function(index) {
|
|
1989
|
+
return compressed.charCodeAt(index) - 32;
|
|
1990
|
+
});
|
|
1991
|
+
},
|
|
1992
|
+
//compress into uint8array (UCS-2 big endian format)
|
|
1993
|
+
compressToUint8Array: function(uncompressed) {
|
|
1994
|
+
var compressed = LZString2.compress(uncompressed);
|
|
1995
|
+
var buf = new Uint8Array(compressed.length * 2);
|
|
1996
|
+
for (var i = 0, TotalLen = compressed.length; i < TotalLen; i++) {
|
|
1997
|
+
var current_value = compressed.charCodeAt(i);
|
|
1998
|
+
buf[i * 2] = current_value >>> 8;
|
|
1999
|
+
buf[i * 2 + 1] = current_value % 256;
|
|
2070
2000
|
}
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2001
|
+
return buf;
|
|
2002
|
+
},
|
|
2003
|
+
//decompress from uint8array (UCS-2 big endian format)
|
|
2004
|
+
decompressFromUint8Array: function(compressed) {
|
|
2005
|
+
if (compressed === null || compressed === void 0) {
|
|
2006
|
+
return LZString2.decompress(compressed);
|
|
2074
2007
|
} else {
|
|
2008
|
+
var buf = new Array(compressed.length / 2);
|
|
2009
|
+
for (var i = 0, TotalLen = buf.length; i < TotalLen; i++) {
|
|
2010
|
+
buf[i] = compressed[i * 2] * 256 + compressed[i * 2 + 1];
|
|
2011
|
+
}
|
|
2012
|
+
var result = [];
|
|
2013
|
+
buf.forEach(function(c) {
|
|
2014
|
+
result.push(f(c));
|
|
2015
|
+
});
|
|
2016
|
+
return LZString2.decompress(result.join(""));
|
|
2017
|
+
}
|
|
2018
|
+
},
|
|
2019
|
+
//compress into a string that is already URI encoded
|
|
2020
|
+
compressToEncodedURIComponent: function(input) {
|
|
2021
|
+
if (input == null) return "";
|
|
2022
|
+
return LZString2._compress(input, 6, function(a) {
|
|
2023
|
+
return keyStrUriSafe.charAt(a);
|
|
2024
|
+
});
|
|
2025
|
+
},
|
|
2026
|
+
//decompress from an output of compressToEncodedURIComponent
|
|
2027
|
+
decompressFromEncodedURIComponent: function(input) {
|
|
2028
|
+
if (input == null) return "";
|
|
2029
|
+
if (input == "") return null;
|
|
2030
|
+
input = input.replace(/ /g, "+");
|
|
2031
|
+
return LZString2._decompress(input.length, 32, function(index) {
|
|
2032
|
+
return getBaseValue(keyStrUriSafe, input.charAt(index));
|
|
2033
|
+
});
|
|
2034
|
+
},
|
|
2035
|
+
compress: function(uncompressed) {
|
|
2036
|
+
return LZString2._compress(uncompressed, 16, function(a) {
|
|
2037
|
+
return f(a);
|
|
2038
|
+
});
|
|
2039
|
+
},
|
|
2040
|
+
_compress: function(uncompressed, bitsPerChar, getCharFromInt) {
|
|
2041
|
+
if (uncompressed == null) return "";
|
|
2042
|
+
var i, value, context_dictionary = {}, context_dictionaryToCreate = {}, context_c = "", context_wc = "", context_w = "", context_enlargeIn = 2, context_dictSize = 3, context_numBits = 2, context_data = [], context_data_val = 0, context_data_position = 0, ii;
|
|
2043
|
+
for (ii = 0; ii < uncompressed.length; ii += 1) {
|
|
2044
|
+
context_c = uncompressed.charAt(ii);
|
|
2045
|
+
if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {
|
|
2046
|
+
context_dictionary[context_c] = context_dictSize++;
|
|
2047
|
+
context_dictionaryToCreate[context_c] = true;
|
|
2048
|
+
}
|
|
2049
|
+
context_wc = context_w + context_c;
|
|
2050
|
+
if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {
|
|
2051
|
+
context_w = context_wc;
|
|
2052
|
+
} else {
|
|
2053
|
+
if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {
|
|
2054
|
+
if (context_w.charCodeAt(0) < 256) {
|
|
2055
|
+
for (i = 0; i < context_numBits; i++) {
|
|
2056
|
+
context_data_val = context_data_val << 1;
|
|
2057
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
2058
|
+
context_data_position = 0;
|
|
2059
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
2060
|
+
context_data_val = 0;
|
|
2061
|
+
} else {
|
|
2062
|
+
context_data_position++;
|
|
2063
|
+
}
|
|
2064
|
+
}
|
|
2065
|
+
value = context_w.charCodeAt(0);
|
|
2066
|
+
for (i = 0; i < 8; i++) {
|
|
2067
|
+
context_data_val = context_data_val << 1 | value & 1;
|
|
2068
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
2069
|
+
context_data_position = 0;
|
|
2070
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
2071
|
+
context_data_val = 0;
|
|
2072
|
+
} else {
|
|
2073
|
+
context_data_position++;
|
|
2074
|
+
}
|
|
2075
|
+
value = value >> 1;
|
|
2076
|
+
}
|
|
2077
|
+
} else {
|
|
2078
|
+
value = 1;
|
|
2079
|
+
for (i = 0; i < context_numBits; i++) {
|
|
2080
|
+
context_data_val = context_data_val << 1 | value;
|
|
2081
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
2082
|
+
context_data_position = 0;
|
|
2083
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
2084
|
+
context_data_val = 0;
|
|
2085
|
+
} else {
|
|
2086
|
+
context_data_position++;
|
|
2087
|
+
}
|
|
2088
|
+
value = 0;
|
|
2089
|
+
}
|
|
2090
|
+
value = context_w.charCodeAt(0);
|
|
2091
|
+
for (i = 0; i < 16; i++) {
|
|
2092
|
+
context_data_val = context_data_val << 1 | value & 1;
|
|
2093
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
2094
|
+
context_data_position = 0;
|
|
2095
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
2096
|
+
context_data_val = 0;
|
|
2097
|
+
} else {
|
|
2098
|
+
context_data_position++;
|
|
2099
|
+
}
|
|
2100
|
+
value = value >> 1;
|
|
2101
|
+
}
|
|
2102
|
+
}
|
|
2103
|
+
context_enlargeIn--;
|
|
2104
|
+
if (context_enlargeIn == 0) {
|
|
2105
|
+
context_enlargeIn = Math.pow(2, context_numBits);
|
|
2106
|
+
context_numBits++;
|
|
2107
|
+
}
|
|
2108
|
+
delete context_dictionaryToCreate[context_w];
|
|
2109
|
+
} else {
|
|
2110
|
+
value = context_dictionary[context_w];
|
|
2111
|
+
for (i = 0; i < context_numBits; i++) {
|
|
2112
|
+
context_data_val = context_data_val << 1 | value & 1;
|
|
2113
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
2114
|
+
context_data_position = 0;
|
|
2115
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
2116
|
+
context_data_val = 0;
|
|
2117
|
+
} else {
|
|
2118
|
+
context_data_position++;
|
|
2119
|
+
}
|
|
2120
|
+
value = value >> 1;
|
|
2121
|
+
}
|
|
2122
|
+
}
|
|
2123
|
+
context_enlargeIn--;
|
|
2124
|
+
if (context_enlargeIn == 0) {
|
|
2125
|
+
context_enlargeIn = Math.pow(2, context_numBits);
|
|
2126
|
+
context_numBits++;
|
|
2127
|
+
}
|
|
2128
|
+
context_dictionary[context_wc] = context_dictSize++;
|
|
2129
|
+
context_w = String(context_c);
|
|
2130
|
+
}
|
|
2131
|
+
}
|
|
2132
|
+
if (context_w !== "") {
|
|
2075
2133
|
if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {
|
|
2076
2134
|
if (context_w.charCodeAt(0) < 256) {
|
|
2077
2135
|
for (i = 0; i < context_numBits; i++) {
|
|
@@ -2147,181 +2205,42 @@ lzString.exports;
|
|
|
2147
2205
|
context_enlargeIn = Math.pow(2, context_numBits);
|
|
2148
2206
|
context_numBits++;
|
|
2149
2207
|
}
|
|
2150
|
-
context_dictionary[context_wc] = context_dictSize++;
|
|
2151
|
-
context_w = String(context_c);
|
|
2152
2208
|
}
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
if (
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
context_data_position = 0;
|
|
2161
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
2162
|
-
context_data_val = 0;
|
|
2163
|
-
} else {
|
|
2164
|
-
context_data_position++;
|
|
2165
|
-
}
|
|
2166
|
-
}
|
|
2167
|
-
value = context_w.charCodeAt(0);
|
|
2168
|
-
for (i = 0; i < 8; i++) {
|
|
2169
|
-
context_data_val = context_data_val << 1 | value & 1;
|
|
2170
|
-
if (context_data_position == bitsPerChar - 1) {
|
|
2171
|
-
context_data_position = 0;
|
|
2172
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
2173
|
-
context_data_val = 0;
|
|
2174
|
-
} else {
|
|
2175
|
-
context_data_position++;
|
|
2176
|
-
}
|
|
2177
|
-
value = value >> 1;
|
|
2178
|
-
}
|
|
2209
|
+
value = 2;
|
|
2210
|
+
for (i = 0; i < context_numBits; i++) {
|
|
2211
|
+
context_data_val = context_data_val << 1 | value & 1;
|
|
2212
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
2213
|
+
context_data_position = 0;
|
|
2214
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
2215
|
+
context_data_val = 0;
|
|
2179
2216
|
} else {
|
|
2180
|
-
|
|
2181
|
-
for (i = 0; i < context_numBits; i++) {
|
|
2182
|
-
context_data_val = context_data_val << 1 | value;
|
|
2183
|
-
if (context_data_position == bitsPerChar - 1) {
|
|
2184
|
-
context_data_position = 0;
|
|
2185
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
2186
|
-
context_data_val = 0;
|
|
2187
|
-
} else {
|
|
2188
|
-
context_data_position++;
|
|
2189
|
-
}
|
|
2190
|
-
value = 0;
|
|
2191
|
-
}
|
|
2192
|
-
value = context_w.charCodeAt(0);
|
|
2193
|
-
for (i = 0; i < 16; i++) {
|
|
2194
|
-
context_data_val = context_data_val << 1 | value & 1;
|
|
2195
|
-
if (context_data_position == bitsPerChar - 1) {
|
|
2196
|
-
context_data_position = 0;
|
|
2197
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
2198
|
-
context_data_val = 0;
|
|
2199
|
-
} else {
|
|
2200
|
-
context_data_position++;
|
|
2201
|
-
}
|
|
2202
|
-
value = value >> 1;
|
|
2203
|
-
}
|
|
2204
|
-
}
|
|
2205
|
-
context_enlargeIn--;
|
|
2206
|
-
if (context_enlargeIn == 0) {
|
|
2207
|
-
context_enlargeIn = Math.pow(2, context_numBits);
|
|
2208
|
-
context_numBits++;
|
|
2217
|
+
context_data_position++;
|
|
2209
2218
|
}
|
|
2210
|
-
|
|
2211
|
-
} else {
|
|
2212
|
-
value = context_dictionary[context_w];
|
|
2213
|
-
for (i = 0; i < context_numBits; i++) {
|
|
2214
|
-
context_data_val = context_data_val << 1 | value & 1;
|
|
2215
|
-
if (context_data_position == bitsPerChar - 1) {
|
|
2216
|
-
context_data_position = 0;
|
|
2217
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
2218
|
-
context_data_val = 0;
|
|
2219
|
-
} else {
|
|
2220
|
-
context_data_position++;
|
|
2221
|
-
}
|
|
2222
|
-
value = value >> 1;
|
|
2223
|
-
}
|
|
2224
|
-
}
|
|
2225
|
-
context_enlargeIn--;
|
|
2226
|
-
if (context_enlargeIn == 0) {
|
|
2227
|
-
context_enlargeIn = Math.pow(2, context_numBits);
|
|
2228
|
-
context_numBits++;
|
|
2229
|
-
}
|
|
2230
|
-
}
|
|
2231
|
-
value = 2;
|
|
2232
|
-
for (i = 0; i < context_numBits; i++) {
|
|
2233
|
-
context_data_val = context_data_val << 1 | value & 1;
|
|
2234
|
-
if (context_data_position == bitsPerChar - 1) {
|
|
2235
|
-
context_data_position = 0;
|
|
2236
|
-
context_data.push(getCharFromInt(context_data_val));
|
|
2237
|
-
context_data_val = 0;
|
|
2238
|
-
} else {
|
|
2239
|
-
context_data_position++;
|
|
2219
|
+
value = value >> 1;
|
|
2240
2220
|
}
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
break;
|
|
2248
|
-
} else
|
|
2249
|
-
context_data_position++;
|
|
2250
|
-
}
|
|
2251
|
-
return context_data.join("");
|
|
2252
|
-
},
|
|
2253
|
-
decompress: function(compressed) {
|
|
2254
|
-
if (compressed == null)
|
|
2255
|
-
return "";
|
|
2256
|
-
if (compressed == "")
|
|
2257
|
-
return null;
|
|
2258
|
-
return LZString2._decompress(compressed.length, 32768, function(index) {
|
|
2259
|
-
return compressed.charCodeAt(index);
|
|
2260
|
-
});
|
|
2261
|
-
},
|
|
2262
|
-
_decompress: function(length, resetValue, getNextValue) {
|
|
2263
|
-
var dictionary = [], enlargeIn = 4, dictSize = 4, numBits = 3, entry = "", result = [], i, w, bits, resb, maxpower, power, c, data = { val: getNextValue(0), position: resetValue, index: 1 };
|
|
2264
|
-
for (i = 0; i < 3; i += 1) {
|
|
2265
|
-
dictionary[i] = i;
|
|
2266
|
-
}
|
|
2267
|
-
bits = 0;
|
|
2268
|
-
maxpower = Math.pow(2, 2);
|
|
2269
|
-
power = 1;
|
|
2270
|
-
while (power != maxpower) {
|
|
2271
|
-
resb = data.val & data.position;
|
|
2272
|
-
data.position >>= 1;
|
|
2273
|
-
if (data.position == 0) {
|
|
2274
|
-
data.position = resetValue;
|
|
2275
|
-
data.val = getNextValue(data.index++);
|
|
2221
|
+
while (true) {
|
|
2222
|
+
context_data_val = context_data_val << 1;
|
|
2223
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
2224
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
2225
|
+
break;
|
|
2226
|
+
} else context_data_position++;
|
|
2276
2227
|
}
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
data.val = getNextValue(data.index++);
|
|
2291
|
-
}
|
|
2292
|
-
bits |= (resb > 0 ? 1 : 0) * power;
|
|
2293
|
-
power <<= 1;
|
|
2294
|
-
}
|
|
2295
|
-
c = f(bits);
|
|
2296
|
-
break;
|
|
2297
|
-
case 1:
|
|
2298
|
-
bits = 0;
|
|
2299
|
-
maxpower = Math.pow(2, 16);
|
|
2300
|
-
power = 1;
|
|
2301
|
-
while (power != maxpower) {
|
|
2302
|
-
resb = data.val & data.position;
|
|
2303
|
-
data.position >>= 1;
|
|
2304
|
-
if (data.position == 0) {
|
|
2305
|
-
data.position = resetValue;
|
|
2306
|
-
data.val = getNextValue(data.index++);
|
|
2307
|
-
}
|
|
2308
|
-
bits |= (resb > 0 ? 1 : 0) * power;
|
|
2309
|
-
power <<= 1;
|
|
2310
|
-
}
|
|
2311
|
-
c = f(bits);
|
|
2312
|
-
break;
|
|
2313
|
-
case 2:
|
|
2314
|
-
return "";
|
|
2315
|
-
}
|
|
2316
|
-
dictionary[3] = c;
|
|
2317
|
-
w = c;
|
|
2318
|
-
result.push(c);
|
|
2319
|
-
while (true) {
|
|
2320
|
-
if (data.index > length) {
|
|
2321
|
-
return "";
|
|
2228
|
+
return context_data.join("");
|
|
2229
|
+
},
|
|
2230
|
+
decompress: function(compressed) {
|
|
2231
|
+
if (compressed == null) return "";
|
|
2232
|
+
if (compressed == "") return null;
|
|
2233
|
+
return LZString2._decompress(compressed.length, 32768, function(index) {
|
|
2234
|
+
return compressed.charCodeAt(index);
|
|
2235
|
+
});
|
|
2236
|
+
},
|
|
2237
|
+
_decompress: function(length, resetValue, getNextValue) {
|
|
2238
|
+
var dictionary = [], enlargeIn = 4, dictSize = 4, numBits = 3, entry = "", result = [], i, w, bits, resb, maxpower, power, c, data = { val: getNextValue(0), position: resetValue, index: 1 };
|
|
2239
|
+
for (i = 0; i < 3; i += 1) {
|
|
2240
|
+
dictionary[i] = i;
|
|
2322
2241
|
}
|
|
2323
2242
|
bits = 0;
|
|
2324
|
-
maxpower = Math.pow(2,
|
|
2243
|
+
maxpower = Math.pow(2, 2);
|
|
2325
2244
|
power = 1;
|
|
2326
2245
|
while (power != maxpower) {
|
|
2327
2246
|
resb = data.val & data.position;
|
|
@@ -2333,7 +2252,7 @@ lzString.exports;
|
|
|
2333
2252
|
bits |= (resb > 0 ? 1 : 0) * power;
|
|
2334
2253
|
power <<= 1;
|
|
2335
2254
|
}
|
|
2336
|
-
switch (
|
|
2255
|
+
switch (bits) {
|
|
2337
2256
|
case 0:
|
|
2338
2257
|
bits = 0;
|
|
2339
2258
|
maxpower = Math.pow(2, 8);
|
|
@@ -2348,9 +2267,7 @@ lzString.exports;
|
|
|
2348
2267
|
bits |= (resb > 0 ? 1 : 0) * power;
|
|
2349
2268
|
power <<= 1;
|
|
2350
2269
|
}
|
|
2351
|
-
|
|
2352
|
-
c = dictSize - 1;
|
|
2353
|
-
enlargeIn--;
|
|
2270
|
+
c = f(bits);
|
|
2354
2271
|
break;
|
|
2355
2272
|
case 1:
|
|
2356
2273
|
bits = 0;
|
|
@@ -2366,295 +2283,358 @@ lzString.exports;
|
|
|
2366
2283
|
bits |= (resb > 0 ? 1 : 0) * power;
|
|
2367
2284
|
power <<= 1;
|
|
2368
2285
|
}
|
|
2369
|
-
|
|
2370
|
-
c = dictSize - 1;
|
|
2371
|
-
enlargeIn--;
|
|
2286
|
+
c = f(bits);
|
|
2372
2287
|
break;
|
|
2373
2288
|
case 2:
|
|
2374
|
-
return
|
|
2289
|
+
return "";
|
|
2375
2290
|
}
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2291
|
+
dictionary[3] = c;
|
|
2292
|
+
w = c;
|
|
2293
|
+
result.push(c);
|
|
2294
|
+
while (true) {
|
|
2295
|
+
if (data.index > length) {
|
|
2296
|
+
return "";
|
|
2297
|
+
}
|
|
2298
|
+
bits = 0;
|
|
2299
|
+
maxpower = Math.pow(2, numBits);
|
|
2300
|
+
power = 1;
|
|
2301
|
+
while (power != maxpower) {
|
|
2302
|
+
resb = data.val & data.position;
|
|
2303
|
+
data.position >>= 1;
|
|
2304
|
+
if (data.position == 0) {
|
|
2305
|
+
data.position = resetValue;
|
|
2306
|
+
data.val = getNextValue(data.index++);
|
|
2307
|
+
}
|
|
2308
|
+
bits |= (resb > 0 ? 1 : 0) * power;
|
|
2309
|
+
power <<= 1;
|
|
2310
|
+
}
|
|
2311
|
+
switch (c = bits) {
|
|
2312
|
+
case 0:
|
|
2313
|
+
bits = 0;
|
|
2314
|
+
maxpower = Math.pow(2, 8);
|
|
2315
|
+
power = 1;
|
|
2316
|
+
while (power != maxpower) {
|
|
2317
|
+
resb = data.val & data.position;
|
|
2318
|
+
data.position >>= 1;
|
|
2319
|
+
if (data.position == 0) {
|
|
2320
|
+
data.position = resetValue;
|
|
2321
|
+
data.val = getNextValue(data.index++);
|
|
2322
|
+
}
|
|
2323
|
+
bits |= (resb > 0 ? 1 : 0) * power;
|
|
2324
|
+
power <<= 1;
|
|
2325
|
+
}
|
|
2326
|
+
dictionary[dictSize++] = f(bits);
|
|
2327
|
+
c = dictSize - 1;
|
|
2328
|
+
enlargeIn--;
|
|
2329
|
+
break;
|
|
2330
|
+
case 1:
|
|
2331
|
+
bits = 0;
|
|
2332
|
+
maxpower = Math.pow(2, 16);
|
|
2333
|
+
power = 1;
|
|
2334
|
+
while (power != maxpower) {
|
|
2335
|
+
resb = data.val & data.position;
|
|
2336
|
+
data.position >>= 1;
|
|
2337
|
+
if (data.position == 0) {
|
|
2338
|
+
data.position = resetValue;
|
|
2339
|
+
data.val = getNextValue(data.index++);
|
|
2340
|
+
}
|
|
2341
|
+
bits |= (resb > 0 ? 1 : 0) * power;
|
|
2342
|
+
power <<= 1;
|
|
2343
|
+
}
|
|
2344
|
+
dictionary[dictSize++] = f(bits);
|
|
2345
|
+
c = dictSize - 1;
|
|
2346
|
+
enlargeIn--;
|
|
2347
|
+
break;
|
|
2348
|
+
case 2:
|
|
2349
|
+
return result.join("");
|
|
2350
|
+
}
|
|
2351
|
+
if (enlargeIn == 0) {
|
|
2352
|
+
enlargeIn = Math.pow(2, numBits);
|
|
2353
|
+
numBits++;
|
|
2354
|
+
}
|
|
2355
|
+
if (dictionary[c]) {
|
|
2356
|
+
entry = dictionary[c];
|
|
2385
2357
|
} else {
|
|
2386
|
-
|
|
2358
|
+
if (c === dictSize) {
|
|
2359
|
+
entry = w + w.charAt(0);
|
|
2360
|
+
} else {
|
|
2361
|
+
return null;
|
|
2362
|
+
}
|
|
2363
|
+
}
|
|
2364
|
+
result.push(entry);
|
|
2365
|
+
dictionary[dictSize++] = w + entry.charAt(0);
|
|
2366
|
+
enlargeIn--;
|
|
2367
|
+
w = entry;
|
|
2368
|
+
if (enlargeIn == 0) {
|
|
2369
|
+
enlargeIn = Math.pow(2, numBits);
|
|
2370
|
+
numBits++;
|
|
2387
2371
|
}
|
|
2388
2372
|
}
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2373
|
+
}
|
|
2374
|
+
};
|
|
2375
|
+
return LZString2;
|
|
2376
|
+
}();
|
|
2377
|
+
if (module != null) {
|
|
2378
|
+
module.exports = LZString;
|
|
2379
|
+
}
|
|
2380
|
+
})(lzString);
|
|
2381
|
+
return lzString.exports;
|
|
2382
|
+
}
|
|
2383
|
+
var lzStringExports = requireLzString();
|
|
2384
|
+
var loglevel$1 = { exports: {} };
|
|
2385
|
+
var loglevel = loglevel$1.exports;
|
|
2386
|
+
var hasRequiredLoglevel;
|
|
2387
|
+
function requireLoglevel() {
|
|
2388
|
+
if (hasRequiredLoglevel) return loglevel$1.exports;
|
|
2389
|
+
hasRequiredLoglevel = 1;
|
|
2390
|
+
(function(module) {
|
|
2391
|
+
(function(root, definition) {
|
|
2392
|
+
if (module.exports) {
|
|
2393
|
+
module.exports = definition();
|
|
2394
|
+
} else {
|
|
2395
|
+
root.log = definition();
|
|
2396
|
+
}
|
|
2397
|
+
})(loglevel, function() {
|
|
2398
|
+
var noop = function() {
|
|
2399
|
+
};
|
|
2400
|
+
var undefinedType = "undefined";
|
|
2401
|
+
var isIE = typeof window !== undefinedType && typeof window.navigator !== undefinedType && /Trident\/|MSIE /.test(window.navigator.userAgent);
|
|
2402
|
+
var logMethods = [
|
|
2403
|
+
"trace",
|
|
2404
|
+
"debug",
|
|
2405
|
+
"info",
|
|
2406
|
+
"warn",
|
|
2407
|
+
"error"
|
|
2408
|
+
];
|
|
2409
|
+
var _loggersByName = {};
|
|
2410
|
+
var defaultLogger = null;
|
|
2411
|
+
function bindMethod(obj, methodName) {
|
|
2412
|
+
var method = obj[methodName];
|
|
2413
|
+
if (typeof method.bind === "function") {
|
|
2414
|
+
return method.bind(obj);
|
|
2415
|
+
} else {
|
|
2416
|
+
try {
|
|
2417
|
+
return Function.prototype.bind.call(method, obj);
|
|
2418
|
+
} catch (e) {
|
|
2419
|
+
return function() {
|
|
2420
|
+
return Function.prototype.apply.apply(method, [obj, arguments]);
|
|
2421
|
+
};
|
|
2396
2422
|
}
|
|
2397
2423
|
}
|
|
2398
2424
|
}
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
}
|
|
2406
|
-
var lzStringExports = lzString.exports;
|
|
2407
|
-
var loglevel = { exports: {} };
|
|
2408
|
-
(function(module) {
|
|
2409
|
-
(function(root, definition) {
|
|
2410
|
-
if (module.exports) {
|
|
2411
|
-
module.exports = definition();
|
|
2412
|
-
} else {
|
|
2413
|
-
root.log = definition();
|
|
2414
|
-
}
|
|
2415
|
-
})(commonjsGlobal, function() {
|
|
2416
|
-
var noop = function() {
|
|
2417
|
-
};
|
|
2418
|
-
var undefinedType = "undefined";
|
|
2419
|
-
var isIE = typeof window !== undefinedType && typeof window.navigator !== undefinedType && /Trident\/|MSIE /.test(window.navigator.userAgent);
|
|
2420
|
-
var logMethods = [
|
|
2421
|
-
"trace",
|
|
2422
|
-
"debug",
|
|
2423
|
-
"info",
|
|
2424
|
-
"warn",
|
|
2425
|
-
"error"
|
|
2426
|
-
];
|
|
2427
|
-
var _loggersByName = {};
|
|
2428
|
-
var defaultLogger = null;
|
|
2429
|
-
function bindMethod(obj, methodName) {
|
|
2430
|
-
var method = obj[methodName];
|
|
2431
|
-
if (typeof method.bind === "function") {
|
|
2432
|
-
return method.bind(obj);
|
|
2433
|
-
} else {
|
|
2434
|
-
try {
|
|
2435
|
-
return Function.prototype.bind.call(method, obj);
|
|
2436
|
-
} catch (e) {
|
|
2437
|
-
return function() {
|
|
2438
|
-
return Function.prototype.apply.apply(method, [obj, arguments]);
|
|
2439
|
-
};
|
|
2425
|
+
function traceForIE() {
|
|
2426
|
+
if (console.log) {
|
|
2427
|
+
if (console.log.apply) {
|
|
2428
|
+
console.log.apply(console, arguments);
|
|
2429
|
+
} else {
|
|
2430
|
+
Function.prototype.apply.apply(console.log, [console, arguments]);
|
|
2431
|
+
}
|
|
2440
2432
|
}
|
|
2433
|
+
if (console.trace) console.trace();
|
|
2441
2434
|
}
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2435
|
+
function realMethod(methodName) {
|
|
2436
|
+
if (methodName === "debug") {
|
|
2437
|
+
methodName = "log";
|
|
2438
|
+
}
|
|
2439
|
+
if (typeof console === undefinedType) {
|
|
2440
|
+
return false;
|
|
2441
|
+
} else if (methodName === "trace" && isIE) {
|
|
2442
|
+
return traceForIE;
|
|
2443
|
+
} else if (console[methodName] !== void 0) {
|
|
2444
|
+
return bindMethod(console, methodName);
|
|
2445
|
+
} else if (console.log !== void 0) {
|
|
2446
|
+
return bindMethod(console, "log");
|
|
2447
2447
|
} else {
|
|
2448
|
-
|
|
2448
|
+
return noop;
|
|
2449
2449
|
}
|
|
2450
2450
|
}
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
methodName = "log";
|
|
2457
|
-
}
|
|
2458
|
-
if (typeof console === undefinedType) {
|
|
2459
|
-
return false;
|
|
2460
|
-
} else if (methodName === "trace" && isIE) {
|
|
2461
|
-
return traceForIE;
|
|
2462
|
-
} else if (console[methodName] !== void 0) {
|
|
2463
|
-
return bindMethod(console, methodName);
|
|
2464
|
-
} else if (console.log !== void 0) {
|
|
2465
|
-
return bindMethod(console, "log");
|
|
2466
|
-
} else {
|
|
2467
|
-
return noop;
|
|
2468
|
-
}
|
|
2469
|
-
}
|
|
2470
|
-
function replaceLoggingMethods() {
|
|
2471
|
-
var level = this.getLevel();
|
|
2472
|
-
for (var i = 0; i < logMethods.length; i++) {
|
|
2473
|
-
var methodName = logMethods[i];
|
|
2474
|
-
this[methodName] = i < level ? noop : this.methodFactory(methodName, level, this.name);
|
|
2475
|
-
}
|
|
2476
|
-
this.log = this.debug;
|
|
2477
|
-
if (typeof console === undefinedType && level < this.levels.SILENT) {
|
|
2478
|
-
return "No console available for logging";
|
|
2479
|
-
}
|
|
2480
|
-
}
|
|
2481
|
-
function enableLoggingWhenConsoleArrives(methodName) {
|
|
2482
|
-
return function() {
|
|
2483
|
-
if (typeof console !== undefinedType) {
|
|
2484
|
-
replaceLoggingMethods.call(this);
|
|
2485
|
-
this[methodName].apply(this, arguments);
|
|
2451
|
+
function replaceLoggingMethods() {
|
|
2452
|
+
var level = this.getLevel();
|
|
2453
|
+
for (var i = 0; i < logMethods.length; i++) {
|
|
2454
|
+
var methodName = logMethods[i];
|
|
2455
|
+
this[methodName] = i < level ? noop : this.methodFactory(methodName, level, this.name);
|
|
2486
2456
|
}
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
return realMethod(methodName) || enableLoggingWhenConsoleArrives.apply(this, arguments);
|
|
2491
|
-
}
|
|
2492
|
-
function Logger(name, factory) {
|
|
2493
|
-
var self2 = this;
|
|
2494
|
-
var inheritedLevel;
|
|
2495
|
-
var defaultLevel;
|
|
2496
|
-
var userLevel;
|
|
2497
|
-
var storageKey = "loglevel";
|
|
2498
|
-
if (typeof name === "string") {
|
|
2499
|
-
storageKey += ":" + name;
|
|
2500
|
-
} else if (typeof name === "symbol") {
|
|
2501
|
-
storageKey = void 0;
|
|
2502
|
-
}
|
|
2503
|
-
function persistLevelIfPossible(levelNum) {
|
|
2504
|
-
var levelName = (logMethods[levelNum] || "silent").toUpperCase();
|
|
2505
|
-
if (typeof window === undefinedType || !storageKey)
|
|
2506
|
-
return;
|
|
2507
|
-
try {
|
|
2508
|
-
window.localStorage[storageKey] = levelName;
|
|
2509
|
-
return;
|
|
2510
|
-
} catch (ignore) {
|
|
2511
|
-
}
|
|
2512
|
-
try {
|
|
2513
|
-
window.document.cookie = encodeURIComponent(storageKey) + "=" + levelName + ";";
|
|
2514
|
-
} catch (ignore) {
|
|
2457
|
+
this.log = this.debug;
|
|
2458
|
+
if (typeof console === undefinedType && level < this.levels.SILENT) {
|
|
2459
|
+
return "No console available for logging";
|
|
2515
2460
|
}
|
|
2516
2461
|
}
|
|
2517
|
-
function
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
}
|
|
2462
|
+
function enableLoggingWhenConsoleArrives(methodName) {
|
|
2463
|
+
return function() {
|
|
2464
|
+
if (typeof console !== undefinedType) {
|
|
2465
|
+
replaceLoggingMethods.call(this);
|
|
2466
|
+
this[methodName].apply(this, arguments);
|
|
2467
|
+
}
|
|
2468
|
+
};
|
|
2469
|
+
}
|
|
2470
|
+
function defaultMethodFactory(methodName, _level, _loggerName) {
|
|
2471
|
+
return realMethod(methodName) || enableLoggingWhenConsoleArrives.apply(this, arguments);
|
|
2472
|
+
}
|
|
2473
|
+
function Logger(name, factory) {
|
|
2474
|
+
var self = this;
|
|
2475
|
+
var inheritedLevel;
|
|
2476
|
+
var defaultLevel;
|
|
2477
|
+
var userLevel;
|
|
2478
|
+
var storageKey = "loglevel";
|
|
2479
|
+
if (typeof name === "string") {
|
|
2480
|
+
storageKey += ":" + name;
|
|
2481
|
+
} else if (typeof name === "symbol") {
|
|
2482
|
+
storageKey = void 0;
|
|
2524
2483
|
}
|
|
2525
|
-
|
|
2484
|
+
function persistLevelIfPossible(levelNum) {
|
|
2485
|
+
var levelName = (logMethods[levelNum] || "silent").toUpperCase();
|
|
2486
|
+
if (typeof window === undefinedType || !storageKey) return;
|
|
2526
2487
|
try {
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
)[1];
|
|
2534
|
-
}
|
|
2488
|
+
window.localStorage[storageKey] = levelName;
|
|
2489
|
+
return;
|
|
2490
|
+
} catch (ignore) {
|
|
2491
|
+
}
|
|
2492
|
+
try {
|
|
2493
|
+
window.document.cookie = encodeURIComponent(storageKey) + "=" + levelName + ";";
|
|
2535
2494
|
} catch (ignore) {
|
|
2536
2495
|
}
|
|
2537
2496
|
}
|
|
2538
|
-
|
|
2539
|
-
storedLevel
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2497
|
+
function getPersistedLevel() {
|
|
2498
|
+
var storedLevel;
|
|
2499
|
+
if (typeof window === undefinedType || !storageKey) return;
|
|
2500
|
+
try {
|
|
2501
|
+
storedLevel = window.localStorage[storageKey];
|
|
2502
|
+
} catch (ignore) {
|
|
2503
|
+
}
|
|
2504
|
+
if (typeof storedLevel === undefinedType) {
|
|
2505
|
+
try {
|
|
2506
|
+
var cookie = window.document.cookie;
|
|
2507
|
+
var cookieName = encodeURIComponent(storageKey);
|
|
2508
|
+
var location = cookie.indexOf(cookieName + "=");
|
|
2509
|
+
if (location !== -1) {
|
|
2510
|
+
storedLevel = /^([^;]+)/.exec(
|
|
2511
|
+
cookie.slice(location + cookieName.length + 1)
|
|
2512
|
+
)[1];
|
|
2513
|
+
}
|
|
2514
|
+
} catch (ignore) {
|
|
2515
|
+
}
|
|
2516
|
+
}
|
|
2517
|
+
if (self.levels[storedLevel] === void 0) {
|
|
2518
|
+
storedLevel = void 0;
|
|
2519
|
+
}
|
|
2520
|
+
return storedLevel;
|
|
2549
2521
|
}
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2522
|
+
function clearPersistedLevel() {
|
|
2523
|
+
if (typeof window === undefinedType || !storageKey) return;
|
|
2524
|
+
try {
|
|
2525
|
+
window.localStorage.removeItem(storageKey);
|
|
2526
|
+
} catch (ignore) {
|
|
2527
|
+
}
|
|
2528
|
+
try {
|
|
2529
|
+
window.document.cookie = encodeURIComponent(storageKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
|
|
2530
|
+
} catch (ignore) {
|
|
2531
|
+
}
|
|
2553
2532
|
}
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2533
|
+
function normalizeLevel(input) {
|
|
2534
|
+
var level = input;
|
|
2535
|
+
if (typeof level === "string" && self.levels[level.toUpperCase()] !== void 0) {
|
|
2536
|
+
level = self.levels[level.toUpperCase()];
|
|
2537
|
+
}
|
|
2538
|
+
if (typeof level === "number" && level >= 0 && level <= self.levels.SILENT) {
|
|
2539
|
+
return level;
|
|
2540
|
+
} else {
|
|
2541
|
+
throw new TypeError("log.setLevel() called with invalid level: " + input);
|
|
2542
|
+
}
|
|
2559
2543
|
}
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2544
|
+
self.name = name;
|
|
2545
|
+
self.levels = {
|
|
2546
|
+
"TRACE": 0,
|
|
2547
|
+
"DEBUG": 1,
|
|
2548
|
+
"INFO": 2,
|
|
2549
|
+
"WARN": 3,
|
|
2550
|
+
"ERROR": 4,
|
|
2551
|
+
"SILENT": 5
|
|
2552
|
+
};
|
|
2553
|
+
self.methodFactory = factory || defaultMethodFactory;
|
|
2554
|
+
self.getLevel = function() {
|
|
2555
|
+
if (userLevel != null) {
|
|
2556
|
+
return userLevel;
|
|
2557
|
+
} else if (defaultLevel != null) {
|
|
2558
|
+
return defaultLevel;
|
|
2559
|
+
} else {
|
|
2560
|
+
return inheritedLevel;
|
|
2561
|
+
}
|
|
2562
|
+
};
|
|
2563
|
+
self.setLevel = function(level, persist) {
|
|
2564
|
+
userLevel = normalizeLevel(level);
|
|
2565
|
+
if (persist !== false) {
|
|
2566
|
+
persistLevelIfPossible(userLevel);
|
|
2567
|
+
}
|
|
2568
|
+
return replaceLoggingMethods.call(self);
|
|
2569
|
+
};
|
|
2570
|
+
self.setDefaultLevel = function(level) {
|
|
2571
|
+
defaultLevel = normalizeLevel(level);
|
|
2572
|
+
if (!getPersistedLevel()) {
|
|
2573
|
+
self.setLevel(level, false);
|
|
2574
|
+
}
|
|
2575
|
+
};
|
|
2576
|
+
self.resetLevel = function() {
|
|
2577
|
+
userLevel = null;
|
|
2578
|
+
clearPersistedLevel();
|
|
2579
|
+
replaceLoggingMethods.call(self);
|
|
2580
|
+
};
|
|
2581
|
+
self.enableAll = function(persist) {
|
|
2582
|
+
self.setLevel(self.levels.TRACE, persist);
|
|
2583
|
+
};
|
|
2584
|
+
self.disableAll = function(persist) {
|
|
2585
|
+
self.setLevel(self.levels.SILENT, persist);
|
|
2586
|
+
};
|
|
2587
|
+
self.rebuild = function() {
|
|
2588
|
+
if (defaultLogger !== self) {
|
|
2589
|
+
inheritedLevel = normalizeLevel(defaultLogger.getLevel());
|
|
2590
|
+
}
|
|
2591
|
+
replaceLoggingMethods.call(self);
|
|
2592
|
+
if (defaultLogger === self) {
|
|
2593
|
+
for (var childName in _loggersByName) {
|
|
2594
|
+
_loggersByName[childName].rebuild();
|
|
2595
|
+
}
|
|
2596
|
+
}
|
|
2597
|
+
};
|
|
2598
|
+
inheritedLevel = normalizeLevel(
|
|
2599
|
+
defaultLogger ? defaultLogger.getLevel() : "WARN"
|
|
2600
|
+
);
|
|
2601
|
+
var initialLevel = getPersistedLevel();
|
|
2602
|
+
if (initialLevel != null) {
|
|
2603
|
+
userLevel = normalizeLevel(initialLevel);
|
|
2564
2604
|
}
|
|
2605
|
+
replaceLoggingMethods.call(self);
|
|
2565
2606
|
}
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
"
|
|
2569
|
-
|
|
2570
|
-
"INFO": 2,
|
|
2571
|
-
"WARN": 3,
|
|
2572
|
-
"ERROR": 4,
|
|
2573
|
-
"SILENT": 5
|
|
2574
|
-
};
|
|
2575
|
-
self2.methodFactory = factory || defaultMethodFactory;
|
|
2576
|
-
self2.getLevel = function() {
|
|
2577
|
-
if (userLevel != null) {
|
|
2578
|
-
return userLevel;
|
|
2579
|
-
} else if (defaultLevel != null) {
|
|
2580
|
-
return defaultLevel;
|
|
2581
|
-
} else {
|
|
2582
|
-
return inheritedLevel;
|
|
2607
|
+
defaultLogger = new Logger();
|
|
2608
|
+
defaultLogger.getLogger = function getLogger(name) {
|
|
2609
|
+
if (typeof name !== "symbol" && typeof name !== "string" || name === "") {
|
|
2610
|
+
throw new TypeError("You must supply a name when creating a logger.");
|
|
2583
2611
|
}
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2612
|
+
var logger = _loggersByName[name];
|
|
2613
|
+
if (!logger) {
|
|
2614
|
+
logger = _loggersByName[name] = new Logger(
|
|
2615
|
+
name,
|
|
2616
|
+
defaultLogger.methodFactory
|
|
2617
|
+
);
|
|
2589
2618
|
}
|
|
2590
|
-
return
|
|
2619
|
+
return logger;
|
|
2591
2620
|
};
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
if (
|
|
2595
|
-
|
|
2621
|
+
var _log = typeof window !== undefinedType ? window.log : void 0;
|
|
2622
|
+
defaultLogger.noConflict = function() {
|
|
2623
|
+
if (typeof window !== undefinedType && window.log === defaultLogger) {
|
|
2624
|
+
window.log = _log;
|
|
2596
2625
|
}
|
|
2626
|
+
return defaultLogger;
|
|
2597
2627
|
};
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
clearPersistedLevel();
|
|
2601
|
-
replaceLoggingMethods.call(self2);
|
|
2602
|
-
};
|
|
2603
|
-
self2.enableAll = function(persist) {
|
|
2604
|
-
self2.setLevel(self2.levels.TRACE, persist);
|
|
2605
|
-
};
|
|
2606
|
-
self2.disableAll = function(persist) {
|
|
2607
|
-
self2.setLevel(self2.levels.SILENT, persist);
|
|
2608
|
-
};
|
|
2609
|
-
self2.rebuild = function() {
|
|
2610
|
-
if (defaultLogger !== self2) {
|
|
2611
|
-
inheritedLevel = normalizeLevel(defaultLogger.getLevel());
|
|
2612
|
-
}
|
|
2613
|
-
replaceLoggingMethods.call(self2);
|
|
2614
|
-
if (defaultLogger === self2) {
|
|
2615
|
-
for (var childName in _loggersByName) {
|
|
2616
|
-
_loggersByName[childName].rebuild();
|
|
2617
|
-
}
|
|
2618
|
-
}
|
|
2628
|
+
defaultLogger.getLoggers = function getLoggers() {
|
|
2629
|
+
return _loggersByName;
|
|
2619
2630
|
};
|
|
2620
|
-
|
|
2621
|
-
defaultLogger ? defaultLogger.getLevel() : "WARN"
|
|
2622
|
-
);
|
|
2623
|
-
var initialLevel = getPersistedLevel();
|
|
2624
|
-
if (initialLevel != null) {
|
|
2625
|
-
userLevel = normalizeLevel(initialLevel);
|
|
2626
|
-
}
|
|
2627
|
-
replaceLoggingMethods.call(self2);
|
|
2628
|
-
}
|
|
2629
|
-
defaultLogger = new Logger();
|
|
2630
|
-
defaultLogger.getLogger = function getLogger(name) {
|
|
2631
|
-
if (typeof name !== "symbol" && typeof name !== "string" || name === "") {
|
|
2632
|
-
throw new TypeError("You must supply a name when creating a logger.");
|
|
2633
|
-
}
|
|
2634
|
-
var logger = _loggersByName[name];
|
|
2635
|
-
if (!logger) {
|
|
2636
|
-
logger = _loggersByName[name] = new Logger(
|
|
2637
|
-
name,
|
|
2638
|
-
defaultLogger.methodFactory
|
|
2639
|
-
);
|
|
2640
|
-
}
|
|
2641
|
-
return logger;
|
|
2642
|
-
};
|
|
2643
|
-
var _log = typeof window !== undefinedType ? window.log : void 0;
|
|
2644
|
-
defaultLogger.noConflict = function() {
|
|
2645
|
-
if (typeof window !== undefinedType && window.log === defaultLogger) {
|
|
2646
|
-
window.log = _log;
|
|
2647
|
-
}
|
|
2631
|
+
defaultLogger["default"] = defaultLogger;
|
|
2648
2632
|
return defaultLogger;
|
|
2649
|
-
};
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
return defaultLogger;
|
|
2655
|
-
});
|
|
2656
|
-
})(loglevel);
|
|
2657
|
-
var loglevelExports = loglevel.exports;
|
|
2633
|
+
});
|
|
2634
|
+
})(loglevel$1);
|
|
2635
|
+
return loglevel$1.exports;
|
|
2636
|
+
}
|
|
2637
|
+
var loglevelExports = requireLoglevel();
|
|
2658
2638
|
const log = /* @__PURE__ */ getDefaultExportFromCjs(loglevelExports);
|
|
2659
2639
|
const CURRENT_VERSION = "0.0.1";
|
|
2660
2640
|
const VITESSCE_CONF_QUERY_STRING = "vitessce_conf";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitessce/export-utils",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"author": "HIDIVE Lab at HMS",
|
|
5
5
|
"homepage": "http://vitessce.io",
|
|
6
6
|
"repository": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"bowser": "^2.11.0",
|
|
20
20
|
"lz-string": "^1.4.4",
|
|
21
|
-
"@vitessce/globals": "3.
|
|
21
|
+
"@vitessce/globals": "3.6.0"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"bundle": "pnpm exec vite build -c ../../../scripts/vite.config.js",
|