linkque-cli-v2 1.6.4 → 1.6.5
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/dev/worker.js +3 -16
- package/linkquejs.js +631 -1015
- package/package.json +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-KDHBKVSL.js → anthropic-messages-5DOLTIGP.js} +15 -14
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{azure-openai-responses-NPKMM3LF.js → azure-openai-responses-HVAVRLTK.js} +9 -7
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-JMBJJF7P.js → chunk-4XAZNSEQ.js} +5 -18
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-UZS5YLV2.js → chunk-IATVK6CO.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-J4JCPZDI.js → chunk-Q2Y6LMNC.js} +7 -5
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/chunk-RYONFGPP.js +317 -0
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-VBERH5QM.js → chunk-UTJ7DVT7.js} +133 -423
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-XOLFZ4XS.js → chunk-Y3G4J3TB.js} +1 -316
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-CO4I3RJE.js → chunk-YZLXAZFT.js} +2 -15
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{dist-TGBYXSBU.js → dist-ZPLSQEAM.js} +42 -27
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{google-generative-ai-KD7MXONK.js → google-generative-ai-OLT56CSV.js} +10 -8
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{google-vertex-TREYA472.js → google-vertex-4DBBJ7SR.js} +11 -9
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{mistral-conversations-OEOTQWE5.js → mistral-conversations-OEBGEDLQ.js} +9 -7
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{openai-codex-responses-GEFKSNVN.js → openai-codex-responses-3KOC6KHN.js} +12 -10
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{openai-completions-TAACO6T5.js → openai-completions-HG6OJRL5.js} +15 -13
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{openai-responses-4DDTXIGI.js → openai-responses-F6V2PG3Y.js} +14 -12
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/chat.js +60 -181
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/clientCapability.js +2 -2
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/protocol.js +2 -2
- package/worker.js +183 -381
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/anthropic-messages-GSYNBLMR.js +0 -17
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{pi-messages-7JN3W3BC.js → pi-messages-DC4DVRAJ.js} +4 -4
package/linkquejs.js
CHANGED
|
@@ -12135,7 +12135,7 @@ var require_dist = __commonJS({
|
|
|
12135
12135
|
});
|
|
12136
12136
|
|
|
12137
12137
|
// ../../node_modules/@zip.js/zip.js/lib/core/constants.js
|
|
12138
|
-
var MAX_32_BITS, MAX_16_BITS, MAX_8_BITS, COMPRESSION_METHOD_DEFLATE, COMPRESSION_METHOD_DEFLATE_64, COMPRESSION_METHOD_STORE, COMPRESSION_METHOD_AES, LOCAL_FILE_HEADER_SIGNATURE, SPLIT_ZIP_FILE_SIGNATURE, TEMPORARY_SPLIT_ZIP_FILE_SIGNATURE, DATA_DESCRIPTOR_RECORD_SIGNATURE, ARCHIVE_EXTRA_DATA_SIGNATURE, DIGITAL_SIGNATURE_RECORD_SIGNATURE, CENTRAL_FILE_HEADER_SIGNATURE, END_OF_CENTRAL_DIR_SIGNATURE, ZIP64_END_OF_CENTRAL_DIR_SIGNATURE, ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE, CENTRAL_FILE_HEADER_LENGTH, END_OF_CENTRAL_DIR_LENGTH, ZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH, ZIP64_END_OF_CENTRAL_DIR_LENGTH, ZIP64_END_OF_CENTRAL_DIR_TOTAL_LENGTH, DATA_DESCRIPTOR_RECORD_LENGTH, DATA_DESCRIPTOR_RECORD_ZIP_64_LENGTH, DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH, SPLIT_ZIP_FILE_SIGNATURE_LENGTH, EXTRAFIELD_TYPE_ZIP64, EXTRAFIELD_TYPE_AES, EXTRAFIELD_TYPE_NTFS, EXTRAFIELD_TYPE_NTFS_TAG1, EXTRAFIELD_TYPE_EXTENDED_TIMESTAMP, EXTRAFIELD_TYPE_UNICODE_PATH, EXTRAFIELD_TYPE_UNICODE_COMMENT, EXTRAFIELD_TYPE_USDZ, EXTRAFIELD_TYPE_INFOZIP, EXTRAFIELD_TYPE_UNIX, EXTRAFIELD_TYPE_UNIX_TYPE1, EXTRAFIELD_TYPE_PKWARE_UNIX, BITFLAG_ENCRYPTED, BITFLAG_LEVEL, BITFLAG_LEVEL_MAX_MASK, BITFLAG_LEVEL_FAST_MASK, BITFLAG_LEVEL_SUPER_FAST_MASK, BITFLAG_DATA_DESCRIPTOR, BITFLAG_COMPRESSED_PATCHED_DATA, BITFLAG_STRONG_ENCRYPTION, BITFLAG_LANG_ENCODING_FLAG, BITFLAG_MASKED_LOCAL_HEADERS, FILE_ATTR_MSDOS_DIR_MASK, FILE_ATTR_MSDOS_READONLY_MASK, FILE_ATTR_MSDOS_HIDDEN_MASK, FILE_ATTR_MSDOS_SYSTEM_MASK, FILE_ATTR_MSDOS_ARCHIVE_MASK, FILE_ATTR_UNIX_TYPE_MASK, FILE_ATTR_UNIX_TYPE_DIR, FILE_ATTR_UNIX_TYPE_SYMLINK, FILE_ATTR_UNIX_TYPE_FILE, FILE_ATTR_UNIX_EXECUTABLE_MASK, FILE_ATTR_UNIX_DEFAULT_MASK, FILE_ATTR_UNIX_SETUID_MASK, FILE_ATTR_UNIX_SETGID_MASK, FILE_ATTR_UNIX_STICKY_MASK, VERSION_STORE, VERSION_DEFLATE, VERSION_ZIP64, VERSION_AES, VERSION_MADE_BY_MSDOS, VERSION_MADE_BY_UNIX, DIRECTORY_SIGNATURE, HEADER_SIZE, HEADER_OFFSET_VERSION, HEADER_OFFSET_SIGNATURE, HEADER_OFFSET_COMPRESSED_SIZE, HEADER_OFFSET_UNCOMPRESSED_SIZE, HEADER_OFFSET_FILENAME_LENGTH, HEADER_OFFSET_EXTRAFIELD_LENGTH, LOCAL_HEADER_COMMON_OFFSET, MAX_DATE, MIN_DATE, UNDEFINED_VALUE, INFINITY_VALUE,
|
|
12138
|
+
var MAX_32_BITS, MAX_16_BITS, MAX_8_BITS, COMPRESSION_METHOD_DEFLATE, COMPRESSION_METHOD_DEFLATE_64, COMPRESSION_METHOD_STORE, COMPRESSION_METHOD_AES, LOCAL_FILE_HEADER_SIGNATURE, SPLIT_ZIP_FILE_SIGNATURE, TEMPORARY_SPLIT_ZIP_FILE_SIGNATURE, DATA_DESCRIPTOR_RECORD_SIGNATURE, ARCHIVE_EXTRA_DATA_SIGNATURE, DIGITAL_SIGNATURE_RECORD_SIGNATURE, CENTRAL_FILE_HEADER_SIGNATURE, END_OF_CENTRAL_DIR_SIGNATURE, ZIP64_END_OF_CENTRAL_DIR_SIGNATURE, ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE, CENTRAL_FILE_HEADER_LENGTH, END_OF_CENTRAL_DIR_LENGTH, ZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH, ZIP64_END_OF_CENTRAL_DIR_LENGTH, ZIP64_END_OF_CENTRAL_DIR_TOTAL_LENGTH, DATA_DESCRIPTOR_RECORD_LENGTH, DATA_DESCRIPTOR_RECORD_ZIP_64_LENGTH, DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH, SPLIT_ZIP_FILE_SIGNATURE_LENGTH, EXTRAFIELD_TYPE_ZIP64, EXTRAFIELD_TYPE_AES, EXTRAFIELD_TYPE_NTFS, EXTRAFIELD_TYPE_NTFS_TAG1, EXTRAFIELD_TYPE_EXTENDED_TIMESTAMP, EXTRAFIELD_TYPE_UNICODE_PATH, EXTRAFIELD_TYPE_UNICODE_COMMENT, EXTRAFIELD_TYPE_USDZ, EXTRAFIELD_TYPE_INFOZIP, EXTRAFIELD_TYPE_UNIX, EXTRAFIELD_TYPE_UNIX_TYPE1, EXTRAFIELD_TYPE_PKWARE_UNIX, BITFLAG_ENCRYPTED, BITFLAG_LEVEL, BITFLAG_LEVEL_MAX_MASK, BITFLAG_LEVEL_FAST_MASK, BITFLAG_LEVEL_SUPER_FAST_MASK, BITFLAG_DATA_DESCRIPTOR, BITFLAG_COMPRESSED_PATCHED_DATA, BITFLAG_STRONG_ENCRYPTION, BITFLAG_LANG_ENCODING_FLAG, BITFLAG_MASKED_LOCAL_HEADERS, FILE_ATTR_MSDOS_DIR_MASK, FILE_ATTR_MSDOS_READONLY_MASK, FILE_ATTR_MSDOS_HIDDEN_MASK, FILE_ATTR_MSDOS_SYSTEM_MASK, FILE_ATTR_MSDOS_ARCHIVE_MASK, FILE_ATTR_UNIX_TYPE_MASK, FILE_ATTR_UNIX_TYPE_DIR, FILE_ATTR_UNIX_TYPE_SYMLINK, FILE_ATTR_UNIX_TYPE_FILE, FILE_ATTR_UNIX_EXECUTABLE_MASK, FILE_ATTR_UNIX_DEFAULT_MASK, FILE_ATTR_UNIX_SETUID_MASK, FILE_ATTR_UNIX_SETGID_MASK, FILE_ATTR_UNIX_STICKY_MASK, VERSION_STORE, VERSION_DEFLATE, VERSION_ZIP64, VERSION_AES, VERSION_MADE_BY_MSDOS, VERSION_MADE_BY_UNIX, DIRECTORY_SIGNATURE, HEADER_SIZE, HEADER_OFFSET_VERSION, HEADER_OFFSET_SIGNATURE, HEADER_OFFSET_COMPRESSED_SIZE, HEADER_OFFSET_UNCOMPRESSED_SIZE, HEADER_OFFSET_FILENAME_LENGTH, HEADER_OFFSET_EXTRAFIELD_LENGTH, LOCAL_HEADER_COMMON_OFFSET, MAX_DATE, MIN_DATE, UNDEFINED_VALUE, INFINITY_VALUE, UNDEFINED_TYPE, FUNCTION_TYPE, OBJECT_TYPE, STRING_TYPE, NUMBER_TYPE, BOOLEAN_TYPE, EMPTY_UINT8_ARRAY, SYMBOL_ASYNC_DISPOSE;
|
|
12139
12139
|
var init_constants = __esm({
|
|
12140
12140
|
"../../node_modules/@zip.js/zip.js/lib/core/constants.js"() {
|
|
12141
12141
|
MAX_32_BITS = 4294967295;
|
|
@@ -12219,9 +12219,6 @@ var init_constants = __esm({
|
|
|
12219
12219
|
MIN_DATE = new Date(1980, 0, 1);
|
|
12220
12220
|
UNDEFINED_VALUE = void 0;
|
|
12221
12221
|
INFINITY_VALUE = Infinity;
|
|
12222
|
-
ERR_LOCAL_FILE_HEADER_NOT_FOUND = "Local file header not found";
|
|
12223
|
-
ERR_OVERLAPPING_ENTRY = "Overlapping entry found";
|
|
12224
|
-
ERR_EXTRAFIELD_ZIP64_NOT_FOUND = "Zip64 extra field not found";
|
|
12225
12222
|
UNDEFINED_TYPE = "undefined";
|
|
12226
12223
|
FUNCTION_TYPE = "function";
|
|
12227
12224
|
OBJECT_TYPE = "object";
|
|
@@ -12240,12 +12237,6 @@ function checkFunctionOption(value) {
|
|
|
12240
12237
|
}
|
|
12241
12238
|
return value;
|
|
12242
12239
|
}
|
|
12243
|
-
function checkReaderOptionsObject(readerOptions) {
|
|
12244
|
-
if (readerOptions && (typeof readerOptions != OBJECT_TYPE || Array.isArray(readerOptions))) {
|
|
12245
|
-
throw new Error(ERR_INVALID_READER_OPTIONS);
|
|
12246
|
-
}
|
|
12247
|
-
return readerOptions;
|
|
12248
|
-
}
|
|
12249
12240
|
function checkSignalOption(signal) {
|
|
12250
12241
|
if (signal && (typeof signal.addEventListener != FUNCTION_TYPE || typeof signal.aborted != BOOLEAN_TYPE)) {
|
|
12251
12242
|
throw new Error(ERR_INVALID_SIGNAL);
|
|
@@ -12281,7 +12272,7 @@ function checkIntegerOption(value, maxValue, errorMessage) {
|
|
|
12281
12272
|
function toNumber(value) {
|
|
12282
12273
|
return typeof value == STRING_TYPE && value.trim() ? Number(value) : value;
|
|
12283
12274
|
}
|
|
12284
|
-
var OPTION_FILENAME_ENCODING, OPTION_COMMENT_ENCODING, OPTION_DECODE_TEXT, OPTION_EXTRACT_PREPENDED_DATA, OPTION_EXTRACT_APPENDED_DATA, OPTION_PASSWORD, OPTION_RAW_PASSWORD, OPTION_PASS_THROUGH, OPTION_SIGNAL, OPTION_CHECK_PASSWORD_ONLY, OPTION_CHECK_OVERLAPPING_ENTRY_ONLY, OPTION_CHECK_OVERLAPPING_ENTRY, OPTION_CHECK_AMBIGUITY, OPTION_CHECK_LOCAL_DIRECTORY, OPTION_CHECK_LOCAL_FILENAME, OPTION_CHECK_SIGNATURE, OPTION_CHECK_CRC32, OPTION_CHECK_AUTHENTICATION_CODE, OPTION_USE_WEB_WORKERS, OPTION_USE_COMPRESSION_STREAM, OPTION_PREVENT_CLOSE, OPTION_ENCRYPTION_STRENGTH, OPTION_EXTENDED_TIMESTAMP, OPTION_NTFS_TIMESTAMP, OPTION_KEEP_ORDER, OPTION_LEVEL, OPTION_BUFFERED_WRITE, OPTION_CREATE_TEMP_STREAM, OPTION_DATA_DESCRIPTOR_SIGNATURE, OPTION_USE_UNICODE_FILE_NAMES, OPTION_DATA_DESCRIPTOR, OPTION_SUPPORT_ZIP64_SPLIT_FILE, OPTION_ENCODE_TEXT, OPTION_OFFSET, OPTION_USDZ, OPTION_UNIX_EXTRA_FIELD_TYPE, OPTION_LOCAL_EXTRA_FIELD, OPTION_CENTRAL_EXTRA_FIELD, OPTION_STRICTNESS, OPTION_FILENAME_VALIDATION, OPTION_NORMALIZE_FILENAME, OPTION_MAX_APPENDED_DATA_SIZE, OPTION_DECRYPT_CENTRAL_DIRECTORY, OPTION_SIGN_CENTRAL_DIRECTORY, OPTION_ENTRY, TEXT_TYPE_FILENAME, TEXT_TYPE_COMMENT, STRICTNESS_STRICT, STRICTNESS_BALANCED, STRICTNESS_TOLERANT, PASS_THROUGH_COMPRESSED, ERR_INVALID_FUNCTION_OPTION, ERR_INVALID_SIGNAL, ERR_INVALID_PASSWORD_TYPE, ERR_INVALID_PASS_THROUGH_VALUE,
|
|
12275
|
+
var OPTION_FILENAME_ENCODING, OPTION_COMMENT_ENCODING, OPTION_DECODE_TEXT, OPTION_EXTRACT_PREPENDED_DATA, OPTION_EXTRACT_APPENDED_DATA, OPTION_PASSWORD, OPTION_RAW_PASSWORD, OPTION_PASS_THROUGH, OPTION_SIGNAL, OPTION_CHECK_PASSWORD_ONLY, OPTION_CHECK_OVERLAPPING_ENTRY_ONLY, OPTION_CHECK_OVERLAPPING_ENTRY, OPTION_CHECK_AMBIGUITY, OPTION_CHECK_LOCAL_DIRECTORY, OPTION_CHECK_LOCAL_FILENAME, OPTION_CHECK_SIGNATURE, OPTION_CHECK_CRC32, OPTION_CHECK_AUTHENTICATION_CODE, OPTION_USE_WEB_WORKERS, OPTION_USE_COMPRESSION_STREAM, OPTION_TRANSFER_STREAMS, OPTION_PREVENT_CLOSE, OPTION_ENCRYPTION_STRENGTH, OPTION_EXTENDED_TIMESTAMP, OPTION_NTFS_TIMESTAMP, OPTION_KEEP_ORDER, OPTION_LEVEL, OPTION_BUFFERED_WRITE, OPTION_CREATE_TEMP_STREAM, OPTION_DATA_DESCRIPTOR_SIGNATURE, OPTION_USE_UNICODE_FILE_NAMES, OPTION_DATA_DESCRIPTOR, OPTION_SUPPORT_ZIP64_SPLIT_FILE, OPTION_ENCODE_TEXT, OPTION_OFFSET, OPTION_USDZ, OPTION_UNIX_EXTRA_FIELD_TYPE, OPTION_LOCAL_EXTRA_FIELD, OPTION_CENTRAL_EXTRA_FIELD, OPTION_STRICTNESS, OPTION_FILENAME_VALIDATION, OPTION_NORMALIZE_FILENAME, OPTION_MAX_APPENDED_DATA_SIZE, OPTION_DECRYPT_CENTRAL_DIRECTORY, OPTION_SIGN_CENTRAL_DIRECTORY, OPTION_ENTRY, TEXT_TYPE_FILENAME, TEXT_TYPE_COMMENT, STRICTNESS_STRICT, STRICTNESS_BALANCED, STRICTNESS_TOLERANT, PASS_THROUGH_COMPRESSED, ERR_INVALID_FUNCTION_OPTION, ERR_INVALID_SIGNAL, ERR_INVALID_PASSWORD_TYPE, ERR_INVALID_PASS_THROUGH_VALUE, ERR_ABORTED, ABORT_ERROR_NAME;
|
|
12285
12276
|
var init_options = __esm({
|
|
12286
12277
|
"../../node_modules/@zip.js/zip.js/lib/core/options.js"() {
|
|
12287
12278
|
init_constants();
|
|
@@ -12305,6 +12296,7 @@ var init_options = __esm({
|
|
|
12305
12296
|
OPTION_CHECK_AUTHENTICATION_CODE = "checkAuthenticationCode";
|
|
12306
12297
|
OPTION_USE_WEB_WORKERS = "useWebWorkers";
|
|
12307
12298
|
OPTION_USE_COMPRESSION_STREAM = "useCompressionStream";
|
|
12299
|
+
OPTION_TRANSFER_STREAMS = "transferStreams";
|
|
12308
12300
|
OPTION_PREVENT_CLOSE = "preventClose";
|
|
12309
12301
|
OPTION_ENCRYPTION_STRENGTH = "encryptionStrength";
|
|
12310
12302
|
OPTION_EXTENDED_TIMESTAMP = "extendedTimestamp";
|
|
@@ -12340,7 +12332,6 @@ var init_options = __esm({
|
|
|
12340
12332
|
ERR_INVALID_SIGNAL = "Invalid signal (must be an AbortSignal instance)";
|
|
12341
12333
|
ERR_INVALID_PASSWORD_TYPE = "Invalid password (password must be a string, rawPassword must be a Uint8Array)";
|
|
12342
12334
|
ERR_INVALID_PASS_THROUGH_VALUE = "Invalid passThrough option (must be a boolean or 'compressed')";
|
|
12343
|
-
ERR_INVALID_READER_OPTIONS = "Invalid readerOptions (must be an object)";
|
|
12344
12335
|
ERR_ABORTED = "The operation was aborted";
|
|
12345
12336
|
ABORT_ERROR_NAME = "AbortError";
|
|
12346
12337
|
}
|
|
@@ -12411,7 +12402,7 @@ var init_configuration = __esm({
|
|
|
12411
12402
|
"../../node_modules/@zip.js/zip.js/lib/core/configuration.js"() {
|
|
12412
12403
|
init_constants();
|
|
12413
12404
|
init_options();
|
|
12414
|
-
DEFAULT_CHUNK_SIZE =
|
|
12405
|
+
DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
12415
12406
|
MINIMUM_CHUNK_SIZE = 64;
|
|
12416
12407
|
MINIMUM_PROPERTY_VALUE = 1;
|
|
12417
12408
|
ERR_INVALID_MAX_WORKERS = "Invalid maxWorkers (must be an integer greater than 0)";
|
|
@@ -12434,6 +12425,7 @@ var init_configuration = __esm({
|
|
|
12434
12425
|
workerStartupTimeout: 5e3,
|
|
12435
12426
|
useWebWorkers: true,
|
|
12436
12427
|
useCompressionStream: true,
|
|
12428
|
+
transferStreams: true,
|
|
12437
12429
|
CompressionStream: typeof CompressionStream != UNDEFINED_TYPE && CompressionStream,
|
|
12438
12430
|
DecompressionStream: typeof DecompressionStream != UNDEFINED_TYPE && DecompressionStream
|
|
12439
12431
|
};
|
|
@@ -12445,7 +12437,8 @@ var init_configuration = __esm({
|
|
|
12445
12437
|
];
|
|
12446
12438
|
BOOLEAN_PROPERTY_NAMES = [
|
|
12447
12439
|
"useCompressionStream",
|
|
12448
|
-
"useWebWorkers"
|
|
12440
|
+
"useWebWorkers",
|
|
12441
|
+
"transferStreams"
|
|
12449
12442
|
];
|
|
12450
12443
|
NUMBER_PROPERTY_NAMES = [
|
|
12451
12444
|
"chunkSize",
|
|
@@ -13067,37 +13060,7 @@ function initAesCrypto(aesCrypto, password, rawPassword, encryptionStrength) {
|
|
|
13067
13060
|
ready: new Promise((resolve2) => aesCrypto.resolveReady = resolve2),
|
|
13068
13061
|
password: encodePassword(password, rawPassword),
|
|
13069
13062
|
strength: encryptionStrength - 1,
|
|
13070
|
-
pendingInput: EMPTY_UINT8_ARRAY
|
|
13071
|
-
discarded: false
|
|
13072
|
-
});
|
|
13073
|
-
}
|
|
13074
|
-
function setDisposingReadable(stream, aesCrypto) {
|
|
13075
|
-
const reader = stream.readable.getReader();
|
|
13076
|
-
const readable = new ReadableStream({
|
|
13077
|
-
async pull(controller) {
|
|
13078
|
-
try {
|
|
13079
|
-
const { value, done } = await reader.read();
|
|
13080
|
-
if (done) {
|
|
13081
|
-
controller.close();
|
|
13082
|
-
} else {
|
|
13083
|
-
controller.enqueue(value);
|
|
13084
|
-
}
|
|
13085
|
-
} catch (error2) {
|
|
13086
|
-
disposeEngine(aesCrypto);
|
|
13087
|
-
reader.cancel(error2).catch(() => {
|
|
13088
|
-
});
|
|
13089
|
-
throw error2;
|
|
13090
|
-
}
|
|
13091
|
-
},
|
|
13092
|
-
cancel(reason) {
|
|
13093
|
-
disposeEngine(aesCrypto);
|
|
13094
|
-
return reader.cancel(reason);
|
|
13095
|
-
}
|
|
13096
|
-
});
|
|
13097
|
-
Object.defineProperty(stream, "readable", {
|
|
13098
|
-
get() {
|
|
13099
|
-
return readable;
|
|
13100
|
-
}
|
|
13063
|
+
pendingInput: EMPTY_UINT8_ARRAY
|
|
13101
13064
|
});
|
|
13102
13065
|
}
|
|
13103
13066
|
function append(aesCrypto, input, output, paddingStart, paddingEnd, decrypt2) {
|
|
@@ -13127,9 +13090,7 @@ async function createDecryptionKeys(decrypt2, strength, password, preamble) {
|
|
|
13127
13090
|
throw new Error(ERR_INVALID_PASSWORD);
|
|
13128
13091
|
}
|
|
13129
13092
|
}
|
|
13130
|
-
function disposeEngine(
|
|
13131
|
-
const { engine } = aesCrypto;
|
|
13132
|
-
aesCrypto.discarded = true;
|
|
13093
|
+
function disposeEngine({ engine }) {
|
|
13133
13094
|
if (engine && engine.dispose) {
|
|
13134
13095
|
engine.dispose();
|
|
13135
13096
|
}
|
|
@@ -13144,9 +13105,6 @@ async function createKeys(aesCrypto, strength, password, salt) {
|
|
|
13144
13105
|
const keyLength = KEY_LENGTH[strength];
|
|
13145
13106
|
const compositeKey = await deriveKey(password, salt, keyLength * 2 + PASSWORD_VERIFICATION_LENGTH);
|
|
13146
13107
|
aesCrypto.engine = createEngine2(subarray(compositeKey, 0, keyLength), subarray(compositeKey, keyLength, keyLength * 2));
|
|
13147
|
-
if (aesCrypto.discarded) {
|
|
13148
|
-
disposeEngine(aesCrypto);
|
|
13149
|
-
}
|
|
13150
13108
|
return subarray(compositeKey, keyLength * 2);
|
|
13151
13109
|
}
|
|
13152
13110
|
async function deriveKey(password, salt, length) {
|
|
@@ -13206,12 +13164,12 @@ var init_aes_crypto_stream = __esm({
|
|
|
13206
13164
|
createEngine2 = createEngine;
|
|
13207
13165
|
AESDecryptionStream = class extends TransformStream {
|
|
13208
13166
|
constructor({ password, rawPassword, encryptionStrength, checkPasswordOnly, checkAuthenticationCode = true }) {
|
|
13209
|
-
const aesCrypto = {};
|
|
13210
13167
|
super({
|
|
13211
13168
|
start() {
|
|
13212
|
-
initAesCrypto(
|
|
13169
|
+
initAesCrypto(this, password, rawPassword, encryptionStrength);
|
|
13213
13170
|
},
|
|
13214
13171
|
async transform(chunk, controller) {
|
|
13172
|
+
const aesCrypto = this;
|
|
13215
13173
|
const {
|
|
13216
13174
|
password: password2,
|
|
13217
13175
|
strength,
|
|
@@ -13230,9 +13188,6 @@ var init_aes_crypto_stream = __esm({
|
|
|
13230
13188
|
} else {
|
|
13231
13189
|
await ready;
|
|
13232
13190
|
}
|
|
13233
|
-
if (aesCrypto.discarded) {
|
|
13234
|
-
return;
|
|
13235
|
-
}
|
|
13236
13191
|
const output = new Uint8Array(chunk.length - AUTHENTICATION_CODE_LENGTH - (chunk.length - AUTHENTICATION_CODE_LENGTH) % BLOCK_LENGTH2);
|
|
13237
13192
|
controller.enqueue(append(aesCrypto, chunk, output, 0, AUTHENTICATION_CODE_LENGTH, true));
|
|
13238
13193
|
},
|
|
@@ -13241,12 +13196,9 @@ var init_aes_crypto_stream = __esm({
|
|
|
13241
13196
|
engine,
|
|
13242
13197
|
pendingInput,
|
|
13243
13198
|
ready
|
|
13244
|
-
} =
|
|
13199
|
+
} = this;
|
|
13245
13200
|
if (engine) {
|
|
13246
13201
|
await ready;
|
|
13247
|
-
if (aesCrypto.discarded) {
|
|
13248
|
-
return;
|
|
13249
|
-
}
|
|
13250
13202
|
const originalAuthenticationCode = subarray(pendingInput, pendingInput.length - AUTHENTICATION_CODE_LENGTH);
|
|
13251
13203
|
const decryptedChunkArray = new Uint8Array(subarray(pendingInput, 0, pendingInput.length - AUTHENTICATION_CODE_LENGTH));
|
|
13252
13204
|
engine.process(decryptedChunkArray, true);
|
|
@@ -13256,24 +13208,25 @@ var init_aes_crypto_stream = __esm({
|
|
|
13256
13208
|
invalidAuthenticationCode |= authenticationCode[indexByte] ^ originalAuthenticationCode[indexByte];
|
|
13257
13209
|
}
|
|
13258
13210
|
if (invalidAuthenticationCode && checkAuthenticationCode) {
|
|
13259
|
-
|
|
13260
|
-
return;
|
|
13211
|
+
throw new Error(ERR_INVALID_AUTHENTICATION_CODE);
|
|
13261
13212
|
}
|
|
13262
13213
|
controller.enqueue(decryptedChunkArray);
|
|
13263
13214
|
}
|
|
13215
|
+
},
|
|
13216
|
+
cancel() {
|
|
13217
|
+
disposeEngine(this);
|
|
13264
13218
|
}
|
|
13265
13219
|
});
|
|
13266
|
-
setDisposingReadable(this, aesCrypto);
|
|
13267
13220
|
}
|
|
13268
13221
|
};
|
|
13269
13222
|
AESEncryptionStream = class extends TransformStream {
|
|
13270
13223
|
constructor({ password, rawPassword, encryptionStrength }) {
|
|
13271
|
-
const aesCrypto = {};
|
|
13272
13224
|
super({
|
|
13273
13225
|
start() {
|
|
13274
|
-
initAesCrypto(
|
|
13226
|
+
initAesCrypto(this, password, rawPassword, encryptionStrength);
|
|
13275
13227
|
},
|
|
13276
13228
|
async transform(chunk, controller) {
|
|
13229
|
+
const aesCrypto = this;
|
|
13277
13230
|
const {
|
|
13278
13231
|
password: password2,
|
|
13279
13232
|
strength,
|
|
@@ -13287,9 +13240,6 @@ var init_aes_crypto_stream = __esm({
|
|
|
13287
13240
|
} else {
|
|
13288
13241
|
await ready;
|
|
13289
13242
|
}
|
|
13290
|
-
if (aesCrypto.discarded) {
|
|
13291
|
-
return;
|
|
13292
|
-
}
|
|
13293
13243
|
const output = new Uint8Array(preamble.length + chunk.length - chunk.length % BLOCK_LENGTH2);
|
|
13294
13244
|
output.set(preamble, 0);
|
|
13295
13245
|
controller.enqueue(append(aesCrypto, chunk, output, preamble.length, 0, false));
|
|
@@ -13299,20 +13249,19 @@ var init_aes_crypto_stream = __esm({
|
|
|
13299
13249
|
engine,
|
|
13300
13250
|
pendingInput,
|
|
13301
13251
|
ready
|
|
13302
|
-
} =
|
|
13252
|
+
} = this;
|
|
13303
13253
|
if (engine) {
|
|
13304
13254
|
await ready;
|
|
13305
|
-
if (aesCrypto.discarded) {
|
|
13306
|
-
return;
|
|
13307
|
-
}
|
|
13308
13255
|
const encryptedChunkArray = new Uint8Array(pendingInput);
|
|
13309
13256
|
engine.process(encryptedChunkArray, false);
|
|
13310
13257
|
const authenticationCode = subarray(engine.digest(), 0, AUTHENTICATION_CODE_LENGTH);
|
|
13311
13258
|
controller.enqueue(concat(encryptedChunkArray, authenticationCode));
|
|
13312
13259
|
}
|
|
13260
|
+
},
|
|
13261
|
+
cancel() {
|
|
13262
|
+
disposeEngine(this);
|
|
13313
13263
|
}
|
|
13314
13264
|
});
|
|
13315
|
-
setDisposingReadable(this, aesCrypto);
|
|
13316
13265
|
}
|
|
13317
13266
|
};
|
|
13318
13267
|
}
|
|
@@ -13344,11 +13293,11 @@ function encrypt(target, input) {
|
|
|
13344
13293
|
return output;
|
|
13345
13294
|
}
|
|
13346
13295
|
function createKeys2(target, password, rawPassword) {
|
|
13347
|
-
const
|
|
13296
|
+
const keys = [305419896, 591751049, 878082192];
|
|
13348
13297
|
Object.assign(target, {
|
|
13349
|
-
|
|
13350
|
-
crcKey0: new Crc32(
|
|
13351
|
-
crcKey2: new Crc32(
|
|
13298
|
+
keys,
|
|
13299
|
+
crcKey0: new Crc32(keys[0]),
|
|
13300
|
+
crcKey2: new Crc32(keys[2])
|
|
13352
13301
|
});
|
|
13353
13302
|
if (rawPassword) {
|
|
13354
13303
|
for (let index = 0; index < rawPassword.length; index++) {
|
|
@@ -13361,16 +13310,16 @@ function createKeys2(target, password, rawPassword) {
|
|
|
13361
13310
|
}
|
|
13362
13311
|
}
|
|
13363
13312
|
function updateKeys(target, byte) {
|
|
13364
|
-
let [, key1] = target.
|
|
13313
|
+
let [, key1] = target.keys;
|
|
13365
13314
|
target.crcKey0.append([byte]);
|
|
13366
13315
|
const key0 = ~target.crcKey0.get();
|
|
13367
13316
|
key1 = getInt32(Math.imul(getInt32(key1 + getInt8(key0)), 134775813) + 1);
|
|
13368
13317
|
target.crcKey2.append([key1 >>> 24]);
|
|
13369
13318
|
const key2 = ~target.crcKey2.get();
|
|
13370
|
-
target.
|
|
13319
|
+
target.keys = [key0, key1, key2];
|
|
13371
13320
|
}
|
|
13372
13321
|
function getByte(target) {
|
|
13373
|
-
const temp = target.
|
|
13322
|
+
const temp = target.keys[2] | 2;
|
|
13374
13323
|
return getInt8(Math.imul(temp, temp ^ 1) >>> 8);
|
|
13375
13324
|
}
|
|
13376
13325
|
function getInt8(number4) {
|
|
@@ -13448,17 +13397,11 @@ function toCompatibleReadable(readable) {
|
|
|
13448
13397
|
const reader = readable.getReader();
|
|
13449
13398
|
return new ReadableStream({
|
|
13450
13399
|
async pull(controller) {
|
|
13451
|
-
|
|
13452
|
-
|
|
13453
|
-
|
|
13454
|
-
|
|
13455
|
-
|
|
13456
|
-
controller.enqueue(value);
|
|
13457
|
-
}
|
|
13458
|
-
} catch (error2) {
|
|
13459
|
-
reader.cancel(error2).catch(() => {
|
|
13460
|
-
});
|
|
13461
|
-
throw error2;
|
|
13400
|
+
const { value, done } = await reader.read();
|
|
13401
|
+
if (done) {
|
|
13402
|
+
controller.close();
|
|
13403
|
+
} else {
|
|
13404
|
+
controller.enqueue(value);
|
|
13462
13405
|
}
|
|
13463
13406
|
},
|
|
13464
13407
|
cancel(reason) {
|
|
@@ -13540,30 +13483,54 @@ var init_codec_registry = __esm({
|
|
|
13540
13483
|
});
|
|
13541
13484
|
|
|
13542
13485
|
// ../../node_modules/@zip.js/zip.js/lib/core/streams/zip-entry-stream.js
|
|
13543
|
-
function pipeThroughGzipDecompressionStream(readable, gzipStream, outputSize, crc32
|
|
13486
|
+
function pipeThroughGzipDecompressionStream(readable, gzipStream, outputSize, crc32) {
|
|
13544
13487
|
const writer = gzipStream.writable.getWriter();
|
|
13545
13488
|
const reader = gzipStream.readable.getReader();
|
|
13546
13489
|
const outputCrc32 = crc32 === UNDEFINED_VALUE ? new Crc32() : UNDEFINED_VALUE;
|
|
13547
13490
|
let outputLength = 0;
|
|
13491
|
+
let inputDone = false;
|
|
13548
13492
|
let trailerWritten = false;
|
|
13549
|
-
let
|
|
13550
|
-
let
|
|
13551
|
-
|
|
13552
|
-
|
|
13553
|
-
|
|
13554
|
-
|
|
13555
|
-
|
|
13556
|
-
|
|
13493
|
+
let idleCheckArmed = false;
|
|
13494
|
+
let readCount = 0;
|
|
13495
|
+
let readPending = false;
|
|
13496
|
+
let resolveTrailerReady, rejectTrailerReady;
|
|
13497
|
+
const trailerReady = new Promise((resolve2, reject) => {
|
|
13498
|
+
resolveTrailerReady = resolve2;
|
|
13499
|
+
rejectTrailerReady = reject;
|
|
13500
|
+
});
|
|
13501
|
+
trailerReady.catch(() => {
|
|
13502
|
+
});
|
|
13503
|
+
pump();
|
|
13504
|
+
return new ReadableStream({
|
|
13505
|
+
async pull(controller) {
|
|
13506
|
+
let result;
|
|
13507
|
+
try {
|
|
13508
|
+
result = await read();
|
|
13509
|
+
} catch (error2) {
|
|
13510
|
+
throw trailerWritten ? getTrailerError(error2) : error2;
|
|
13511
|
+
}
|
|
13512
|
+
const { value, done } = result;
|
|
13513
|
+
if (done) {
|
|
13514
|
+
controller.close();
|
|
13515
|
+
} else {
|
|
13516
|
+
outputLength += value.length;
|
|
13517
|
+
if (outputLength > outputSize) {
|
|
13518
|
+
const error2 = new Error(ERR_INVALID_UNCOMPRESSED_SIZE);
|
|
13519
|
+
rejectTrailerReady(error2);
|
|
13520
|
+
await cancel(reader, error2);
|
|
13521
|
+
throw error2;
|
|
13522
|
+
}
|
|
13523
|
+
if (outputCrc32) {
|
|
13524
|
+
outputCrc32.append(value);
|
|
13525
|
+
}
|
|
13526
|
+
controller.enqueue(value);
|
|
13527
|
+
}
|
|
13557
13528
|
},
|
|
13558
13529
|
cancel(reason) {
|
|
13559
|
-
|
|
13560
|
-
resumePump();
|
|
13530
|
+
rejectTrailerReady(reason);
|
|
13561
13531
|
return reader.cancel(reason);
|
|
13562
13532
|
}
|
|
13563
13533
|
});
|
|
13564
|
-
pump();
|
|
13565
|
-
drain();
|
|
13566
|
-
return output;
|
|
13567
13534
|
async function pump() {
|
|
13568
13535
|
const inputReader = readable.getReader();
|
|
13569
13536
|
try {
|
|
@@ -13571,16 +13538,19 @@ function pipeThroughGzipDecompressionStream(readable, gzipStream, outputSize, cr
|
|
|
13571
13538
|
header.set(GZIP_HEADER_BYTES);
|
|
13572
13539
|
await writer.write(header);
|
|
13573
13540
|
for (; ; ) {
|
|
13574
|
-
await outputCapacity();
|
|
13575
13541
|
await writer.ready;
|
|
13576
|
-
const { value, done } = await
|
|
13542
|
+
const { value, done } = await inputReader.read();
|
|
13577
13543
|
if (done) {
|
|
13578
13544
|
break;
|
|
13579
13545
|
}
|
|
13580
13546
|
await writer.write(value);
|
|
13581
13547
|
}
|
|
13548
|
+
inputDone = true;
|
|
13582
13549
|
if (outputCrc32) {
|
|
13583
|
-
|
|
13550
|
+
if (readPending) {
|
|
13551
|
+
armIdleCheck();
|
|
13552
|
+
}
|
|
13553
|
+
await trailerReady;
|
|
13584
13554
|
}
|
|
13585
13555
|
const trailer = new Uint8Array(GZIP_TRAILER_LENGTH);
|
|
13586
13556
|
const dataView = getDataView(trailer);
|
|
@@ -13594,65 +13564,51 @@ function pipeThroughGzipDecompressionStream(readable, gzipStream, outputSize, cr
|
|
|
13594
13564
|
await cancel(inputReader, error2);
|
|
13595
13565
|
}
|
|
13596
13566
|
}
|
|
13597
|
-
|
|
13598
|
-
|
|
13599
|
-
|
|
13600
|
-
|
|
13601
|
-
|
|
13602
|
-
|
|
13603
|
-
|
|
13604
|
-
outputLength += value.length;
|
|
13605
|
-
if (outputLength > outputSize) {
|
|
13606
|
-
throw new Error(ERR_INVALID_UNCOMPRESSED_SIZE);
|
|
13607
|
-
}
|
|
13608
|
-
if (outputCrc32) {
|
|
13609
|
-
outputCrc32.append(value);
|
|
13610
|
-
}
|
|
13611
|
-
controller.enqueue(value);
|
|
13612
|
-
}
|
|
13613
|
-
if (!settled) {
|
|
13614
|
-
settled = true;
|
|
13615
|
-
controller.close();
|
|
13616
|
-
}
|
|
13617
|
-
} catch (error2) {
|
|
13618
|
-
fail(error2);
|
|
13619
|
-
await cancel(reader, error2);
|
|
13567
|
+
function read() {
|
|
13568
|
+
readCount++;
|
|
13569
|
+
readPending = true;
|
|
13570
|
+
const result = reader.read();
|
|
13571
|
+
result.then(onReadSettled, onReadSettled);
|
|
13572
|
+
if (inputDone && outputCrc32) {
|
|
13573
|
+
armIdleCheck();
|
|
13620
13574
|
}
|
|
13575
|
+
return result;
|
|
13621
13576
|
}
|
|
13622
|
-
function
|
|
13623
|
-
|
|
13624
|
-
|
|
13625
|
-
|
|
13626
|
-
|
|
13627
|
-
|
|
13628
|
-
|
|
13629
|
-
|
|
13577
|
+
function onReadSettled() {
|
|
13578
|
+
readPending = false;
|
|
13579
|
+
}
|
|
13580
|
+
async function armIdleCheck() {
|
|
13581
|
+
if (!idleCheckArmed) {
|
|
13582
|
+
idleCheckArmed = true;
|
|
13583
|
+
const count = readCount;
|
|
13584
|
+
await nextTask();
|
|
13585
|
+
idleCheckArmed = false;
|
|
13586
|
+
if (readPending) {
|
|
13587
|
+
if (readCount == count) {
|
|
13588
|
+
resolveTrailerReady();
|
|
13589
|
+
} else {
|
|
13590
|
+
armIdleCheck();
|
|
13630
13591
|
}
|
|
13631
|
-
return { done: true };
|
|
13632
13592
|
}
|
|
13633
|
-
throw mapCodecError(error2, sourceErrors);
|
|
13634
|
-
});
|
|
13635
|
-
}
|
|
13636
|
-
function outputCapacity() {
|
|
13637
|
-
if (!settled && controller.desiredSize <= 0) {
|
|
13638
|
-
return new Promise((resolve2) => resolvePull = resolve2);
|
|
13639
13593
|
}
|
|
13640
13594
|
}
|
|
13641
|
-
function
|
|
13642
|
-
|
|
13643
|
-
|
|
13644
|
-
|
|
13645
|
-
resolve2();
|
|
13646
|
-
}
|
|
13647
|
-
}
|
|
13648
|
-
function fail(error2) {
|
|
13649
|
-
if (!settled) {
|
|
13650
|
-
settled = true;
|
|
13651
|
-
controller.error(error2);
|
|
13652
|
-
resumePump();
|
|
13653
|
-
}
|
|
13595
|
+
function getTrailerError(error2) {
|
|
13596
|
+
const trailerError = new Error(outputLength == outputSize ? ERR_INVALID_CRC32 : ERR_INVALID_UNCOMPRESSED_SIZE);
|
|
13597
|
+
trailerError.cause = error2;
|
|
13598
|
+
return trailerError;
|
|
13654
13599
|
}
|
|
13655
13600
|
}
|
|
13601
|
+
function nextTask() {
|
|
13602
|
+
return new Promise((resolve2) => {
|
|
13603
|
+
const { port1, port2 } = new MessageChannel();
|
|
13604
|
+
port2.onmessage = () => {
|
|
13605
|
+
port1.close();
|
|
13606
|
+
port2.close();
|
|
13607
|
+
resolve2();
|
|
13608
|
+
};
|
|
13609
|
+
port1.postMessage(UNDEFINED_VALUE);
|
|
13610
|
+
});
|
|
13611
|
+
}
|
|
13656
13612
|
function supportsFormat(StreamClass, format) {
|
|
13657
13613
|
if (!StreamClass) {
|
|
13658
13614
|
return false;
|
|
@@ -13701,7 +13657,7 @@ function getGzipCodecStream(useCompressionStream, CodecStreamNative, CodecStream
|
|
|
13701
13657
|
return CodecStreamFallback;
|
|
13702
13658
|
}
|
|
13703
13659
|
}
|
|
13704
|
-
function pipeThroughCompressionStream(readable, useCompressionStream, options, CompressionStreamNative, CompressionStreamFallback
|
|
13660
|
+
function pipeThroughCompressionStream(readable, useCompressionStream, options, CompressionStreamNative, CompressionStreamFallback) {
|
|
13705
13661
|
const Stream2 = useCompressionStream && CompressionStreamNative ? CompressionStreamNative : CompressionStreamFallback || CompressionStreamNative;
|
|
13706
13662
|
const format = options.deflate64 ? FORMAT_DEFLATE64_RAW : FORMAT_DEFLATE_RAW;
|
|
13707
13663
|
let codecStream;
|
|
@@ -13714,12 +13670,12 @@ function pipeThroughCompressionStream(readable, useCompressionStream, options, C
|
|
|
13714
13670
|
throw error2;
|
|
13715
13671
|
}
|
|
13716
13672
|
}
|
|
13717
|
-
return pipeThroughBackpressured(readable, codecStream
|
|
13673
|
+
return pipeThroughBackpressured(readable, codecStream);
|
|
13718
13674
|
}
|
|
13719
13675
|
function pipeThrough(readable, transformStream) {
|
|
13720
13676
|
return toCompatibleReadable(readable).pipeThrough(transformStream);
|
|
13721
13677
|
}
|
|
13722
|
-
function pipeThroughBackpressured(readable, transformStream
|
|
13678
|
+
function pipeThroughBackpressured(readable, transformStream) {
|
|
13723
13679
|
const writer = transformStream.writable.getWriter();
|
|
13724
13680
|
const reader = readable.getReader();
|
|
13725
13681
|
pump();
|
|
@@ -13728,7 +13684,7 @@ function pipeThroughBackpressured(readable, transformStream, sourceErrors) {
|
|
|
13728
13684
|
try {
|
|
13729
13685
|
for (; ; ) {
|
|
13730
13686
|
await writer.ready;
|
|
13731
|
-
const result = await
|
|
13687
|
+
const result = await reader.read();
|
|
13732
13688
|
if (result.done) {
|
|
13733
13689
|
await writer.close();
|
|
13734
13690
|
break;
|
|
@@ -13753,44 +13709,26 @@ async function cancel(reader, error2) {
|
|
|
13753
13709
|
} catch {
|
|
13754
13710
|
}
|
|
13755
13711
|
}
|
|
13756
|
-
function
|
|
13757
|
-
const result = reader.read();
|
|
13758
|
-
return sourceErrors ? result.catch((error2) => {
|
|
13759
|
-
sourceErrors.add(error2);
|
|
13760
|
-
throw error2;
|
|
13761
|
-
}) : result;
|
|
13762
|
-
}
|
|
13763
|
-
function mapCodecError(error2, sourceErrors) {
|
|
13764
|
-
if (sourceErrors.has(error2)) {
|
|
13765
|
-
return error2;
|
|
13766
|
-
}
|
|
13767
|
-
return mapError(error2, isMemoryError(error2) ? ERR_CODEC_OUT_OF_MEMORY : ERR_INVALID_COMPRESSED_DATA);
|
|
13768
|
-
}
|
|
13769
|
-
function mapMemoryError(error2) {
|
|
13770
|
-
return isMemoryError(error2) ? mapError(error2, ERR_CODEC_OUT_OF_MEMORY) : error2;
|
|
13771
|
-
}
|
|
13772
|
-
function isMemoryError(error2) {
|
|
13773
|
-
return isErrorObject(error2) && error2.code == Z_MEM_ERROR_CODE;
|
|
13774
|
-
}
|
|
13775
|
-
function mapError(error2, message) {
|
|
13776
|
-
const mappedError = new Error(message);
|
|
13777
|
-
mappedError.cause = error2;
|
|
13778
|
-
return mappedError;
|
|
13779
|
-
}
|
|
13780
|
-
function mapInflateStreamError(readable, sourceErrors) {
|
|
13712
|
+
function mapInflateStreamError(readable) {
|
|
13781
13713
|
const reader = readable.getReader();
|
|
13782
13714
|
return new ReadableStream({
|
|
13783
13715
|
async pull(controller) {
|
|
13716
|
+
let result;
|
|
13784
13717
|
try {
|
|
13785
|
-
|
|
13786
|
-
if (done) {
|
|
13787
|
-
controller.close();
|
|
13788
|
-
} else {
|
|
13789
|
-
controller.enqueue(value);
|
|
13790
|
-
}
|
|
13718
|
+
result = await reader.read();
|
|
13791
13719
|
} catch (error2) {
|
|
13792
|
-
|
|
13793
|
-
|
|
13720
|
+
if (error2 && error2.message) {
|
|
13721
|
+
throw error2;
|
|
13722
|
+
}
|
|
13723
|
+
const mappedError = new Error(ERR_INVALID_COMPRESSED_DATA);
|
|
13724
|
+
mappedError.cause = error2;
|
|
13725
|
+
throw mappedError;
|
|
13726
|
+
}
|
|
13727
|
+
const { value, done } = result;
|
|
13728
|
+
if (done) {
|
|
13729
|
+
controller.close();
|
|
13730
|
+
} else {
|
|
13731
|
+
controller.enqueue(value);
|
|
13794
13732
|
}
|
|
13795
13733
|
},
|
|
13796
13734
|
cancel(reason) {
|
|
@@ -13798,7 +13736,7 @@ function mapInflateStreamError(readable, sourceErrors) {
|
|
|
13798
13736
|
}
|
|
13799
13737
|
});
|
|
13800
13738
|
}
|
|
13801
|
-
var ERR_INVALID_UNCOMPRESSED_SIZE, ERR_INVALID_COMPRESSED_DATA,
|
|
13739
|
+
var ERR_INVALID_UNCOMPRESSED_SIZE, ERR_INVALID_COMPRESSED_DATA, ERR_INVALID_CRC32, FORMAT_DEFLATE_RAW, FORMAT_DEFLATE64_RAW, FORMAT_GZIP, GZIP_HEADER_LENGTH, GZIP_TRAILER_LENGTH, GZIP_HEADER_BYTES, DeflateStream, GzipToRawDeflateStream, InflateStream, formatSupportByStream;
|
|
13802
13740
|
var init_zip_entry_stream = __esm({
|
|
13803
13741
|
"../../node_modules/@zip.js/zip.js/lib/core/streams/zip-entry-stream.js"() {
|
|
13804
13742
|
init_crc32();
|
|
@@ -13809,13 +13747,10 @@ var init_zip_entry_stream = __esm({
|
|
|
13809
13747
|
init_constants();
|
|
13810
13748
|
init_array();
|
|
13811
13749
|
init_compatible_streams();
|
|
13812
|
-
init_error();
|
|
13813
13750
|
init_codec_registry();
|
|
13814
13751
|
ERR_INVALID_UNCOMPRESSED_SIZE = "Invalid uncompressed size";
|
|
13815
13752
|
ERR_INVALID_COMPRESSED_DATA = "Invalid compressed data";
|
|
13816
|
-
ERR_CODEC_OUT_OF_MEMORY = "Codec out of memory";
|
|
13817
13753
|
ERR_INVALID_CRC32 = "Invalid CRC32";
|
|
13818
|
-
Z_MEM_ERROR_CODE = "Z_MEM_ERROR";
|
|
13819
13754
|
FORMAT_DEFLATE_RAW = "deflate-raw";
|
|
13820
13755
|
FORMAT_DEFLATE64_RAW = "deflate64-raw";
|
|
13821
13756
|
FORMAT_GZIP = "gzip";
|
|
@@ -13848,13 +13783,13 @@ var init_zip_entry_stream = __esm({
|
|
|
13848
13783
|
readable = pipeThroughCompressionStream(readable, useCompressionStream, { level, chunkSize }, CompressionStream2, CompressionStreamFallback);
|
|
13849
13784
|
} catch (error2) {
|
|
13850
13785
|
if (!useCompressionStream && CompressionStreamFallback) {
|
|
13851
|
-
throw
|
|
13786
|
+
throw error2;
|
|
13852
13787
|
}
|
|
13853
13788
|
let gzipStream;
|
|
13854
13789
|
try {
|
|
13855
13790
|
gzipStream = new CompressionStream2(FORMAT_GZIP);
|
|
13856
13791
|
} catch {
|
|
13857
|
-
throw
|
|
13792
|
+
throw error2;
|
|
13858
13793
|
}
|
|
13859
13794
|
readable = pipeThroughBackpressured(readable, gzipStream);
|
|
13860
13795
|
readable = pipeThrough(readable, new GzipToRawDeflateStream());
|
|
@@ -13931,12 +13866,11 @@ var init_zip_entry_stream = __esm({
|
|
|
13931
13866
|
}
|
|
13932
13867
|
}
|
|
13933
13868
|
if (compressed) {
|
|
13934
|
-
const sourceErrors = /* @__PURE__ */ new Set();
|
|
13935
13869
|
const codecStreams2 = format && getCodecStreams(format);
|
|
13936
|
-
let gzipStream;
|
|
13937
13870
|
if (codecStreams2) {
|
|
13938
|
-
readable = pipeThroughBackpressured(readable, createCodecStream(codecStreams2.DecompressionStream, format, { chunkSize, compressionMethod, rawBitFlag, uncompressedSize: outputSize })
|
|
13871
|
+
readable = pipeThroughBackpressured(readable, createCodecStream(codecStreams2.DecompressionStream, format, { chunkSize, compressionMethod, rawBitFlag, uncompressedSize: outputSize }));
|
|
13939
13872
|
} else {
|
|
13873
|
+
let gzipStream;
|
|
13940
13874
|
const GzipDecompressionStream = getGzipCodecStream(useCompressionStream, DecompressionStream2, DecompressionStreamFallback);
|
|
13941
13875
|
if (checkCrc32 && !deflate64 && crc32 !== UNDEFINED_VALUE && outputSize !== UNDEFINED_VALUE && GzipDecompressionStream) {
|
|
13942
13876
|
try {
|
|
@@ -13947,25 +13881,24 @@ var init_zip_entry_stream = __esm({
|
|
|
13947
13881
|
}
|
|
13948
13882
|
if (!gzipStream) {
|
|
13949
13883
|
try {
|
|
13950
|
-
readable = pipeThroughCompressionStream(readable, useCompressionStream, { chunkSize, deflate64 }, DecompressionStream2, DecompressionStreamFallback
|
|
13884
|
+
readable = pipeThroughCompressionStream(readable, useCompressionStream, { chunkSize, deflate64 }, DecompressionStream2, DecompressionStreamFallback);
|
|
13951
13885
|
} catch (error2) {
|
|
13952
13886
|
if (deflate64 || outputSize === UNDEFINED_VALUE || !useCompressionStream && DecompressionStreamFallback) {
|
|
13953
|
-
throw
|
|
13887
|
+
throw error2;
|
|
13954
13888
|
}
|
|
13955
13889
|
try {
|
|
13956
13890
|
gzipStream = new DecompressionStream2(FORMAT_GZIP);
|
|
13957
13891
|
} catch {
|
|
13958
|
-
throw
|
|
13892
|
+
throw error2;
|
|
13959
13893
|
}
|
|
13960
13894
|
}
|
|
13961
13895
|
}
|
|
13896
|
+
if (gzipStream) {
|
|
13897
|
+
gzipCrc32 = true;
|
|
13898
|
+
readable = pipeThroughGzipDecompressionStream(readable, gzipStream, outputSize, crc32);
|
|
13899
|
+
}
|
|
13962
13900
|
}
|
|
13963
|
-
|
|
13964
|
-
gzipCrc32 = true;
|
|
13965
|
-
readable = pipeThroughGzipDecompressionStream(readable, gzipStream, outputSize, crc32, sourceErrors);
|
|
13966
|
-
} else {
|
|
13967
|
-
readable = mapInflateStreamError(readable, sourceErrors);
|
|
13968
|
-
}
|
|
13901
|
+
readable = mapInflateStreamError(readable);
|
|
13969
13902
|
}
|
|
13970
13903
|
if (checkCrc32 && !gzipCrc32) {
|
|
13971
13904
|
crc32Stream = new Crc32Stream();
|
|
@@ -13991,7 +13924,7 @@ var init_codec_stream = __esm({
|
|
|
13991
13924
|
"../../node_modules/@zip.js/zip.js/lib/core/streams/codec-stream.js"() {
|
|
13992
13925
|
init_constants();
|
|
13993
13926
|
init_zip_entry_stream();
|
|
13994
|
-
DEFAULT_CHUNK_SIZE2 =
|
|
13927
|
+
DEFAULT_CHUNK_SIZE2 = 64 * 1024;
|
|
13995
13928
|
MESSAGE_EVENT_TYPE = "message";
|
|
13996
13929
|
MESSAGE_START = "start";
|
|
13997
13930
|
MESSAGE_PULL = "pull";
|
|
@@ -14181,8 +14114,7 @@ async function runWorker({ options, readable, writable, onTaskFinished, workerOp
|
|
|
14181
14114
|
}
|
|
14182
14115
|
codecStream = new CodecStream(options, config3);
|
|
14183
14116
|
chunkStream = new ChunkStream(getChunkSize(config3));
|
|
14184
|
-
|
|
14185
|
-
await readable.pipeThrough(codecStream).pipeThrough(chunkStream).pipeTo(writable, { preventClose: true, preventAbort: true, signal });
|
|
14117
|
+
await readable.pipeThrough(codecStream).pipeThrough(chunkStream).pipeTo(writable, { preventClose: true, preventAbort: true });
|
|
14186
14118
|
const {
|
|
14187
14119
|
crc32,
|
|
14188
14120
|
inputSize,
|
|
@@ -14227,7 +14159,7 @@ var init_codec_worker = __esm({
|
|
|
14227
14159
|
};
|
|
14228
14160
|
CodecWorker = class {
|
|
14229
14161
|
constructor(workerData, { readable, writable }, workerOptions, onTaskFinished) {
|
|
14230
|
-
const { options, config: config3, streamOptions, useWebWorkers, workerURI } = workerOptions;
|
|
14162
|
+
const { options, config: config3, streamOptions, useWebWorkers, transferStreams, workerURI } = workerOptions;
|
|
14231
14163
|
let { createWorker } = workerOptions;
|
|
14232
14164
|
const { signal } = streamOptions;
|
|
14233
14165
|
if (createWorkerFailed) {
|
|
@@ -14242,6 +14174,7 @@ var init_codec_worker = __esm({
|
|
|
14242
14174
|
workerOptions,
|
|
14243
14175
|
workerURI,
|
|
14244
14176
|
createWorker,
|
|
14177
|
+
transferStreams,
|
|
14245
14178
|
terminate() {
|
|
14246
14179
|
return new Promise((resolve2) => {
|
|
14247
14180
|
const { worker, busy } = workerData;
|
|
@@ -14312,7 +14245,7 @@ var init_codec_worker = __esm({
|
|
|
14312
14245
|
// ../../node_modules/@zip.js/zip.js/lib/core/codec-pool.js
|
|
14313
14246
|
async function runWorker2(stream, workerOptions) {
|
|
14314
14247
|
const { options, config: config3 } = workerOptions;
|
|
14315
|
-
const { useWebWorkers, useCompressionStream, compressed, checkCrc32, computeCrc32, encrypted, format, codecURI } = options;
|
|
14248
|
+
const { transferStreams, useWebWorkers, useCompressionStream, compressed, checkCrc32, computeCrc32, encrypted, format, codecURI } = options;
|
|
14316
14249
|
const { workerURI, createWorker, maxWorkers: maxWorkers2 } = config3;
|
|
14317
14250
|
if (format) {
|
|
14318
14251
|
if (codecURI) {
|
|
@@ -14320,6 +14253,7 @@ async function runWorker2(stream, workerOptions) {
|
|
|
14320
14253
|
}
|
|
14321
14254
|
await ensureCodecStreams(format, options.codecURI);
|
|
14322
14255
|
}
|
|
14256
|
+
workerOptions.transferStreams = !format && (transferStreams || transferStreams === UNDEFINED_VALUE && config3.transferStreams);
|
|
14323
14257
|
const streamCopy = !compressed && !checkCrc32 && !computeCrc32 && !encrypted;
|
|
14324
14258
|
const workerSupported = format === UNDEFINED_VALUE || Boolean(options.codecURI);
|
|
14325
14259
|
workerOptions.useWebWorkers = !streamCopy && workerSupported && (useWebWorkers || useWebWorkers === UNDEFINED_VALUE && config3.useWebWorkers);
|
|
@@ -15040,7 +14974,6 @@ __export(zip_reader_exports, {
|
|
|
15040
14974
|
ERR_AMBIGUOUS_ARCHIVE: () => ERR_AMBIGUOUS_ARCHIVE,
|
|
15041
14975
|
ERR_BAD_FORMAT: () => ERR_BAD_FORMAT,
|
|
15042
14976
|
ERR_CENTRAL_DIRECTORY_NOT_FOUND: () => ERR_CENTRAL_DIRECTORY_NOT_FOUND,
|
|
15043
|
-
ERR_CODEC_OUT_OF_MEMORY: () => ERR_CODEC_OUT_OF_MEMORY,
|
|
15044
14977
|
ERR_ENCRYPTED: () => ERR_ENCRYPTED,
|
|
15045
14978
|
ERR_ENCRYPTED_CENTRAL_DIRECTORY: () => ERR_ENCRYPTED_CENTRAL_DIRECTORY,
|
|
15046
14979
|
ERR_ENTRY_DATA_OUT_OF_BOUNDS: () => ERR_ENTRY_DATA_OUT_OF_BOUNDS,
|
|
@@ -15067,13 +15000,11 @@ __export(zip_reader_exports, {
|
|
|
15067
15000
|
WARNING_COMPRESSED_PATCHED_DATA: () => WARNING_COMPRESSED_PATCHED_DATA,
|
|
15068
15001
|
WARNING_DUPLICATE_FILENAME: () => WARNING_DUPLICATE_FILENAME,
|
|
15069
15002
|
WARNING_MALFORMED_EXTRA_FIELD: () => WARNING_MALFORMED_EXTRA_FIELD,
|
|
15070
|
-
WARNING_MISMATCHED_CENTRAL_DIRECTORY_OFFSET: () => WARNING_MISMATCHED_CENTRAL_DIRECTORY_OFFSET,
|
|
15071
15003
|
WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG: () => WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG,
|
|
15072
15004
|
WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD: () => WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD,
|
|
15073
15005
|
WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES: () => WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES,
|
|
15074
15006
|
WARNING_MISMATCHED_LOCAL_FILE_HEADER_FILENAME: () => WARNING_MISMATCHED_LOCAL_FILE_HEADER_FILENAME,
|
|
15075
15007
|
WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY: () => WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY,
|
|
15076
|
-
WARNING_MISSING_ZIP64_EXTRA_FIELD: () => WARNING_MISSING_ZIP64_EXTRA_FIELD,
|
|
15077
15008
|
WARNING_MULTIPLE_END_OF_CENTRAL_DIRECTORY: () => WARNING_MULTIPLE_END_OF_CENTRAL_DIRECTORY,
|
|
15078
15009
|
WARNING_PREPENDED_CENTRAL_DIRECTORY: () => WARNING_PREPENDED_CENTRAL_DIRECTORY,
|
|
15079
15010
|
WARNING_PREPENDED_DATA: () => WARNING_PREPENDED_DATA,
|
|
@@ -15084,7 +15015,6 @@ __export(zip_reader_exports, {
|
|
|
15084
15015
|
WARNING_WRAPPED_ENTRIES_COUNT: () => WARNING_WRAPPED_ENTRIES_COUNT,
|
|
15085
15016
|
ZipReader: () => ZipReader,
|
|
15086
15017
|
ZipReaderStream: () => ZipReaderStream,
|
|
15087
|
-
getEntryDataDescriptorLength: () => getEntryDataDescriptorLength,
|
|
15088
15018
|
isZipFile: () => isZipFile
|
|
15089
15019
|
});
|
|
15090
15020
|
function createEntryStream(entry, pendingEntries2) {
|
|
@@ -15148,7 +15078,13 @@ async function isZipFile(reader, options = {}) {
|
|
|
15148
15078
|
return reader.size - appendedDataOffset <= maxAppendedDataSize;
|
|
15149
15079
|
}
|
|
15150
15080
|
function detectEncryptedCentralDirectory(directoryView) {
|
|
15151
|
-
|
|
15081
|
+
const maxOffset = Math.min(directoryView.byteLength, 1024) - 3;
|
|
15082
|
+
for (let offset = 0; offset < maxOffset; offset++) {
|
|
15083
|
+
if (getUint32(directoryView, offset) == ARCHIVE_EXTRA_DATA_SIGNATURE) {
|
|
15084
|
+
return true;
|
|
15085
|
+
}
|
|
15086
|
+
}
|
|
15087
|
+
return false;
|
|
15152
15088
|
}
|
|
15153
15089
|
function getWrappedFilesLength(directoryView, directoryArray, offset) {
|
|
15154
15090
|
let wrappedFilesLength = 0;
|
|
@@ -15158,79 +15094,6 @@ function getWrappedFilesLength(directoryView, directoryArray, offset) {
|
|
|
15158
15094
|
}
|
|
15159
15095
|
return wrappedFilesLength % (MAX_16_BITS + 1) ? 0 : wrappedFilesLength;
|
|
15160
15096
|
}
|
|
15161
|
-
function pointsAtDirectory(reader, offset) {
|
|
15162
|
-
return startsWithSignature(reader, offset, CENTRAL_FILE_HEADER_SIGNATURE);
|
|
15163
|
-
}
|
|
15164
|
-
async function startsWithSignature(reader, offset, signature) {
|
|
15165
|
-
if (offset < 0 || offset + 4 > reader.size) {
|
|
15166
|
-
return false;
|
|
15167
|
-
}
|
|
15168
|
-
const signatureArray = await readUint8Array(reader, offset, 4);
|
|
15169
|
-
return getUint32(getDataView(signatureArray), 0) == signature;
|
|
15170
|
-
}
|
|
15171
|
-
async function findDigitalSignatureRecordOffset(reader, endOffset) {
|
|
15172
|
-
const startOffset = Math.max(0, endOffset - (6 + MAX_16_BITS));
|
|
15173
|
-
const tailArray = await readUint8Array(reader, startOffset, endOffset - startOffset);
|
|
15174
|
-
const tailView = getDataView(tailArray);
|
|
15175
|
-
for (let indexByte = tailArray.length - 6; indexByte >= 0; indexByte--) {
|
|
15176
|
-
if (getUint32(tailView, indexByte) == DIGITAL_SIGNATURE_RECORD_SIGNATURE && indexByte + 6 + getUint16(tailView, indexByte + 4) == tailArray.length) {
|
|
15177
|
-
return startOffset + indexByte;
|
|
15178
|
-
}
|
|
15179
|
-
}
|
|
15180
|
-
}
|
|
15181
|
-
async function findZip64EndOfDirectoryOffset(reader, endOffset) {
|
|
15182
|
-
const startOffset = Math.max(0, endOffset - (ZIP64_END_OF_CENTRAL_DIR_LENGTH + MAX_16_BITS));
|
|
15183
|
-
const tailArray = await readUint8Array(reader, startOffset, endOffset - startOffset);
|
|
15184
|
-
const tailView = getDataView(tailArray);
|
|
15185
|
-
for (let indexByte = tailArray.length - ZIP64_END_OF_CENTRAL_DIR_LENGTH; indexByte >= 0; indexByte--) {
|
|
15186
|
-
if (getUint32(tailView, indexByte) == ZIP64_END_OF_CENTRAL_DIR_SIGNATURE && indexByte + 12 + Number(tailView.getBigUint64(indexByte + 4, true)) == tailArray.length) {
|
|
15187
|
-
return startOffset + indexByte;
|
|
15188
|
-
}
|
|
15189
|
-
}
|
|
15190
|
-
}
|
|
15191
|
-
async function probeLocalHeaders(reader, directoryArray, directoryView, offsetDelta) {
|
|
15192
|
-
let result = { localHeaderFound: false, shiftedLocalHeaderFound: false };
|
|
15193
|
-
let recordOffset = 0;
|
|
15194
|
-
while (recordOffset + CENTRAL_FILE_HEADER_LENGTH <= directoryArray.length && getUint32(directoryView, recordOffset) == CENTRAL_FILE_HEADER_SIGNATURE) {
|
|
15195
|
-
const localHeaderOffset = getLocalHeaderOffset(directoryArray, directoryView, recordOffset);
|
|
15196
|
-
if (localHeaderOffset !== UNDEFINED_VALUE) {
|
|
15197
|
-
const localHeaderFound = await startsWithSignature(reader, localHeaderOffset, LOCAL_FILE_HEADER_SIGNATURE);
|
|
15198
|
-
const shiftedLocalHeaderFound = await startsWithSignature(reader, localHeaderOffset + offsetDelta, LOCAL_FILE_HEADER_SIGNATURE);
|
|
15199
|
-
if (!recordOffset) {
|
|
15200
|
-
result = { localHeaderFound, shiftedLocalHeaderFound };
|
|
15201
|
-
}
|
|
15202
|
-
if (localHeaderFound != shiftedLocalHeaderFound) {
|
|
15203
|
-
return { localHeaderFound, shiftedLocalHeaderFound };
|
|
15204
|
-
}
|
|
15205
|
-
}
|
|
15206
|
-
recordOffset += CENTRAL_FILE_HEADER_LENGTH + getUint16(directoryView, recordOffset + 28) + getUint16(directoryView, recordOffset + 30) + getUint16(directoryView, recordOffset + 32);
|
|
15207
|
-
}
|
|
15208
|
-
return result;
|
|
15209
|
-
}
|
|
15210
|
-
function getLocalHeaderOffset(directoryArray, directoryView, recordOffset) {
|
|
15211
|
-
const localHeaderOffset = getUint32(directoryView, recordOffset + 42);
|
|
15212
|
-
if (localHeaderOffset != MAX_32_BITS) {
|
|
15213
|
-
return localHeaderOffset;
|
|
15214
|
-
}
|
|
15215
|
-
let offsetExtraField = recordOffset + CENTRAL_FILE_HEADER_LENGTH + getUint16(directoryView, recordOffset + 28);
|
|
15216
|
-
const endExtraField = Math.min(offsetExtraField + getUint16(directoryView, recordOffset + 30), directoryArray.length);
|
|
15217
|
-
while (offsetExtraField + 4 <= endExtraField) {
|
|
15218
|
-
const type = getUint16(directoryView, offsetExtraField);
|
|
15219
|
-
const size = getUint16(directoryView, offsetExtraField + 2);
|
|
15220
|
-
if (type == EXTRAFIELD_TYPE_ZIP64) {
|
|
15221
|
-
let offsetValue = offsetExtraField + 4;
|
|
15222
|
-
if (getUint32(directoryView, recordOffset + 24) == MAX_32_BITS) {
|
|
15223
|
-
offsetValue += 8;
|
|
15224
|
-
}
|
|
15225
|
-
if (getUint32(directoryView, recordOffset + 20) == MAX_32_BITS) {
|
|
15226
|
-
offsetValue += 8;
|
|
15227
|
-
}
|
|
15228
|
-
return offsetValue + 8 <= endExtraField ? getBigUint64(directoryView, offsetValue) : UNDEFINED_VALUE;
|
|
15229
|
-
}
|
|
15230
|
-
offsetExtraField += 4 + size;
|
|
15231
|
-
}
|
|
15232
|
-
return UNDEFINED_VALUE;
|
|
15233
|
-
}
|
|
15234
15097
|
function readDigitalSignature(signatureRecordArray) {
|
|
15235
15098
|
if (signatureRecordArray.length >= 6) {
|
|
15236
15099
|
const signatureRecordView = getDataView(signatureRecordArray);
|
|
@@ -15312,18 +15175,9 @@ function readCommonFooter(fileEntry, directory, dataView, offset, localDirectory
|
|
|
15312
15175
|
uncompressedSize: getUint32(dataView, offset + HEADER_OFFSET_UNCOMPRESSED_SIZE)
|
|
15313
15176
|
});
|
|
15314
15177
|
const extraFieldZip64 = extraField.get(EXTRAFIELD_TYPE_ZIP64);
|
|
15315
|
-
let extraFieldZip64Missing;
|
|
15316
15178
|
if (extraFieldZip64) {
|
|
15317
|
-
|
|
15318
|
-
malformedExtraField = true;
|
|
15319
|
-
}
|
|
15179
|
+
readExtraFieldZip64(extraFieldZip64, directory);
|
|
15320
15180
|
directory.extraFieldZip64 = extraFieldZip64;
|
|
15321
|
-
} else if (ZIP64_PROPERTIES.some(([propertyName, max]) => directory[propertyName] == max)) {
|
|
15322
|
-
if (localDirectory) {
|
|
15323
|
-
malformedExtraField = true;
|
|
15324
|
-
} else {
|
|
15325
|
-
extraFieldZip64Missing = true;
|
|
15326
|
-
}
|
|
15327
15181
|
}
|
|
15328
15182
|
const extraFieldUnicodePath = extraField.get(EXTRAFIELD_TYPE_UNICODE_PATH);
|
|
15329
15183
|
if (extraFieldUnicodePath) {
|
|
@@ -15336,13 +15190,10 @@ function readCommonFooter(fileEntry, directory, dataView, offset, localDirectory
|
|
|
15336
15190
|
directory.extraFieldUnicodeComment = extraFieldUnicodeComment;
|
|
15337
15191
|
}
|
|
15338
15192
|
const extraFieldAES = extraField.get(EXTRAFIELD_TYPE_AES);
|
|
15339
|
-
if (extraFieldAES &&
|
|
15193
|
+
if (extraFieldAES && extraFieldAES.data.length >= 7) {
|
|
15340
15194
|
readExtraFieldAES(extraFieldAES, directory, compressionMethod);
|
|
15341
15195
|
directory.extraFieldAES = extraFieldAES;
|
|
15342
15196
|
} else {
|
|
15343
|
-
if (extraFieldAES) {
|
|
15344
|
-
malformedExtraField = true;
|
|
15345
|
-
}
|
|
15346
15197
|
directory.compressionMethod = compressionMethod;
|
|
15347
15198
|
}
|
|
15348
15199
|
const extraFieldPkwareUnix = extraField.get(EXTRAFIELD_TYPE_PKWARE_UNIX);
|
|
@@ -15355,65 +15206,49 @@ function readCommonFooter(fileEntry, directory, dataView, offset, localDirectory
|
|
|
15355
15206
|
readExtraFieldUnixDates(extraFieldUnixType1, directory);
|
|
15356
15207
|
directory.extraFieldUnixType1 = extraFieldUnixType1;
|
|
15357
15208
|
}
|
|
15358
|
-
const extraFieldExtendedTimestamp = extraField.get(EXTRAFIELD_TYPE_EXTENDED_TIMESTAMP);
|
|
15359
|
-
if (extraFieldExtendedTimestamp) {
|
|
15360
|
-
readExtraFieldExtendedTimestamp(extraFieldExtendedTimestamp, directory, localDirectory);
|
|
15361
|
-
directory.extraFieldExtendedTimestamp = extraFieldExtendedTimestamp;
|
|
15362
|
-
}
|
|
15363
15209
|
const extraFieldNTFS = extraField.get(EXTRAFIELD_TYPE_NTFS);
|
|
15364
15210
|
if (extraFieldNTFS) {
|
|
15365
15211
|
readExtraFieldNTFS(extraFieldNTFS, directory);
|
|
15366
15212
|
directory.extraFieldNTFS = extraFieldNTFS;
|
|
15367
15213
|
}
|
|
15368
|
-
const extraFieldInfoZip = extraField.get(EXTRAFIELD_TYPE_INFOZIP);
|
|
15369
|
-
let unixIdsRead;
|
|
15370
|
-
if (extraFieldInfoZip) {
|
|
15371
|
-
unixIdsRead = readExtraFieldUnix(extraFieldInfoZip, directory, true);
|
|
15372
|
-
directory.extraFieldInfoZip = extraFieldInfoZip;
|
|
15373
|
-
}
|
|
15374
15214
|
const extraFieldUnix = extraField.get(EXTRAFIELD_TYPE_UNIX);
|
|
15215
|
+
let unixIdsRead;
|
|
15375
15216
|
if (extraFieldUnix) {
|
|
15376
|
-
readExtraFieldUnix(extraFieldUnix,
|
|
15217
|
+
unixIdsRead = readExtraFieldUnix(extraFieldUnix, directory, false);
|
|
15377
15218
|
directory.extraFieldUnix = extraFieldUnix;
|
|
15378
15219
|
}
|
|
15220
|
+
if (!unixIdsRead) {
|
|
15221
|
+
const extraFieldInfoZip = extraField.get(EXTRAFIELD_TYPE_INFOZIP);
|
|
15222
|
+
if (extraFieldInfoZip) {
|
|
15223
|
+
readExtraFieldUnix(extraFieldInfoZip, directory, true);
|
|
15224
|
+
directory.extraFieldInfoZip = extraFieldInfoZip;
|
|
15225
|
+
}
|
|
15226
|
+
}
|
|
15227
|
+
const extraFieldExtendedTimestamp = extraField.get(EXTRAFIELD_TYPE_EXTENDED_TIMESTAMP);
|
|
15228
|
+
if (extraFieldExtendedTimestamp) {
|
|
15229
|
+
readExtraFieldExtendedTimestamp(extraFieldExtendedTimestamp, directory, localDirectory);
|
|
15230
|
+
directory.extraFieldExtendedTimestamp = extraFieldExtendedTimestamp;
|
|
15231
|
+
}
|
|
15379
15232
|
const extraFieldUSDZ = extraField.get(EXTRAFIELD_TYPE_USDZ);
|
|
15380
15233
|
if (extraFieldUSDZ) {
|
|
15381
15234
|
directory.extraFieldUSDZ = extraFieldUSDZ;
|
|
15382
15235
|
}
|
|
15383
|
-
if (extraFieldZip64Missing) {
|
|
15384
|
-
throw new Error(ERR_EXTRAFIELD_ZIP64_NOT_FOUND);
|
|
15385
|
-
}
|
|
15386
15236
|
return malformedExtraField;
|
|
15387
15237
|
}
|
|
15388
|
-
function readExtraFieldZip64(extraFieldZip64, directory
|
|
15238
|
+
function readExtraFieldZip64(extraFieldZip64, directory) {
|
|
15389
15239
|
directory.zip64 = true;
|
|
15390
15240
|
const extraFieldView = getDataView(extraFieldZip64.data);
|
|
15391
15241
|
const missingProperties = ZIP64_PROPERTIES.filter(([propertyName, max]) => directory[propertyName] == max);
|
|
15392
15242
|
const requiredLength = missingProperties.reduce((length, [, max]) => length + ZIP64_EXTRACTION[max].bytes, 0);
|
|
15393
15243
|
if (extraFieldZip64.data.length < requiredLength) {
|
|
15394
|
-
if (localDirectory) {
|
|
15395
|
-
return false;
|
|
15396
|
-
}
|
|
15397
15244
|
throw new Error(ERR_EXTRAFIELD_ZIP64_NOT_FOUND);
|
|
15398
15245
|
}
|
|
15399
|
-
|
|
15400
|
-
|
|
15401
|
-
|
|
15402
|
-
|
|
15403
|
-
|
|
15404
|
-
values.push(extraction.getValue(extraFieldView, offset));
|
|
15405
|
-
offset += extraction.bytes;
|
|
15406
|
-
}
|
|
15407
|
-
} catch (error2) {
|
|
15408
|
-
if (localDirectory) {
|
|
15409
|
-
return false;
|
|
15410
|
-
}
|
|
15411
|
-
throw error2;
|
|
15246
|
+
for (let indexMissingProperty = 0, offset = 0; indexMissingProperty < missingProperties.length; indexMissingProperty++) {
|
|
15247
|
+
const [propertyName, max] = missingProperties[indexMissingProperty];
|
|
15248
|
+
const extraction = ZIP64_EXTRACTION[max];
|
|
15249
|
+
directory[propertyName] = extraFieldZip64[propertyName] = extraction.getValue(extraFieldView, offset);
|
|
15250
|
+
offset += extraction.bytes;
|
|
15412
15251
|
}
|
|
15413
|
-
missingProperties.forEach(([propertyName], indexMissingProperty) => {
|
|
15414
|
-
directory[propertyName] = extraFieldZip64[propertyName] = values[indexMissingProperty];
|
|
15415
|
-
});
|
|
15416
|
-
return true;
|
|
15417
15252
|
}
|
|
15418
15253
|
function readExtraFieldUnicode(extraFieldUnicode, propertyName, rawPropertyName, directory, fileEntry) {
|
|
15419
15254
|
if (extraFieldUnicode.data.length < 5) {
|
|
@@ -15585,13 +15420,29 @@ async function detectOverlappingEntry({
|
|
|
15585
15420
|
}) {
|
|
15586
15421
|
let dataDescriptorLength = 0;
|
|
15587
15422
|
if (dataDescriptor) {
|
|
15588
|
-
|
|
15589
|
-
|
|
15590
|
-
if (localDataDescriptor) {
|
|
15591
|
-
fileEntry.localDirectory.dataDescriptor = localDataDescriptor;
|
|
15592
|
-
dataDescriptorLength = getDataDescriptorLength(localDataDescriptor.zip64, localDataDescriptor.signature);
|
|
15423
|
+
if (extraFieldZip64) {
|
|
15424
|
+
dataDescriptorLength = DATA_DESCRIPTOR_RECORD_ZIP_64_LENGTH;
|
|
15593
15425
|
} else {
|
|
15594
|
-
dataDescriptorLength =
|
|
15426
|
+
dataDescriptorLength = DATA_DESCRIPTOR_RECORD_LENGTH;
|
|
15427
|
+
}
|
|
15428
|
+
}
|
|
15429
|
+
if (dataDescriptorLength) {
|
|
15430
|
+
const dataDescriptorArray = await readUint8Array(reader, dataOffset + compressedSize, dataDescriptorLength + DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH);
|
|
15431
|
+
const dataDescriptorView = getDataView(dataDescriptorArray);
|
|
15432
|
+
let signature = dataDescriptorArray.length == dataDescriptorLength + DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH && getUint32(dataDescriptorView, 0) == DATA_DESCRIPTOR_RECORD_SIGNATURE;
|
|
15433
|
+
if (signature) {
|
|
15434
|
+
const signedDataDescriptor = readDataDescriptor(dataDescriptorView, DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH, extraFieldZip64);
|
|
15435
|
+
const matchCrc32 = fileEntry.encrypted && !fileEntry.zipCrypto || signedDataDescriptor.crc32 == crc32;
|
|
15436
|
+
if (matchCrc32 && signedDataDescriptor.compressedSize == compressedSize && signedDataDescriptor.uncompressedSize == uncompressedSize) {
|
|
15437
|
+
dataDescriptorLength += DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH;
|
|
15438
|
+
} else {
|
|
15439
|
+
signature = false;
|
|
15440
|
+
}
|
|
15441
|
+
}
|
|
15442
|
+
if (dataDescriptorArray.length >= dataDescriptorLength) {
|
|
15443
|
+
const localDataDescriptor = readDataDescriptor(dataDescriptorView, signature ? DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH : 0, extraFieldZip64);
|
|
15444
|
+
localDataDescriptor.signature = signature;
|
|
15445
|
+
fileEntry.localDirectory.dataDescriptor = localDataDescriptor;
|
|
15595
15446
|
}
|
|
15596
15447
|
}
|
|
15597
15448
|
const range = {
|
|
@@ -15652,43 +15503,18 @@ function mergeRanges(sortedRanges, pendingRanges) {
|
|
|
15652
15503
|
}
|
|
15653
15504
|
return mergedRanges;
|
|
15654
15505
|
}
|
|
15655
|
-
|
|
15656
|
-
const maxLength = DATA_DESCRIPTOR_RECORD_ZIP_64_LENGTH + DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH;
|
|
15657
|
-
const length = Math.min(maxLength, Math.max(0, reader.size - offset));
|
|
15658
|
-
const dataDescriptorArray = length ? await readUint8Array(reader, offset, length) : EMPTY_UINT8_ARRAY;
|
|
15659
|
-
const dataDescriptorView = getDataView(dataDescriptorArray);
|
|
15660
|
-
const candidates = [[zip64, true], [zip64, false], [!zip64, true], [!zip64, false]].map(([zip64Layout, signature]) => readDataDescriptor(dataDescriptorView, zip64Layout, signature)).filter((candidate) => candidate && candidate.compressedSize == compressedSize && candidate.uncompressedSize == uncompressedSize);
|
|
15661
|
-
return candidates.find((candidate) => candidate.crc32 == crc32) || candidates[0] || readDataDescriptor(dataDescriptorView, zip64, true) || readDataDescriptor(dataDescriptorView, zip64, false);
|
|
15662
|
-
}
|
|
15663
|
-
async function getEntryDataDescriptorLength(reader, offset, { crc32, compressedSize, uncompressedSize, extraFieldZip64 }) {
|
|
15664
|
-
const dataDescriptor = await readLocalDataDescriptor(reader, offset, { crc32, compressedSize, uncompressedSize, zip64: Boolean(extraFieldZip64) });
|
|
15665
|
-
if (dataDescriptor && dataDescriptor.compressedSize == compressedSize && dataDescriptor.uncompressedSize == uncompressedSize) {
|
|
15666
|
-
return getDataDescriptorLength(dataDescriptor.zip64, dataDescriptor.signature);
|
|
15667
|
-
}
|
|
15668
|
-
}
|
|
15669
|
-
function readDataDescriptor(dataDescriptorView, zip64, signature) {
|
|
15670
|
-
const offset = signature ? DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH : 0;
|
|
15671
|
-
if (dataDescriptorView.byteLength < getDataDescriptorLength(zip64, signature) || signature && getUint32(dataDescriptorView, 0) != DATA_DESCRIPTOR_RECORD_SIGNATURE) {
|
|
15672
|
-
return UNDEFINED_VALUE;
|
|
15673
|
-
}
|
|
15506
|
+
function readDataDescriptor(dataDescriptorView, offset, extraFieldZip64) {
|
|
15674
15507
|
const crc32 = getUint32(dataDescriptorView, offset);
|
|
15675
15508
|
let compressedSize;
|
|
15676
15509
|
let uncompressedSize;
|
|
15677
|
-
|
|
15678
|
-
|
|
15679
|
-
|
|
15680
|
-
|
|
15681
|
-
|
|
15682
|
-
|
|
15683
|
-
uncompressedSize = getUint32(dataDescriptorView, offset + 8);
|
|
15684
|
-
}
|
|
15685
|
-
} catch {
|
|
15686
|
-
return UNDEFINED_VALUE;
|
|
15510
|
+
if (extraFieldZip64) {
|
|
15511
|
+
compressedSize = getBigUint64(dataDescriptorView, offset + 4);
|
|
15512
|
+
uncompressedSize = getBigUint64(dataDescriptorView, offset + 12);
|
|
15513
|
+
} else {
|
|
15514
|
+
compressedSize = getUint32(dataDescriptorView, offset + 4);
|
|
15515
|
+
uncompressedSize = getUint32(dataDescriptorView, offset + 8);
|
|
15687
15516
|
}
|
|
15688
|
-
return {
|
|
15689
|
-
}
|
|
15690
|
-
function getDataDescriptorLength(zip64, signature) {
|
|
15691
|
-
return (zip64 ? DATA_DESCRIPTOR_RECORD_ZIP_64_LENGTH : DATA_DESCRIPTOR_RECORD_LENGTH) + (signature ? DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH : 0);
|
|
15517
|
+
return { crc32, compressedSize, uncompressedSize };
|
|
15692
15518
|
}
|
|
15693
15519
|
function getDiskOffset(reader, diskNumber) {
|
|
15694
15520
|
return reader.getDiskOffset ? reader.getDiskOffset(diskNumber) : 0;
|
|
@@ -15783,7 +15609,7 @@ function getMaxAppendedDataSize(maxAppendedDataSize, strictness) {
|
|
|
15783
15609
|
async function findEndOfCentralDirectory(reader, rejectAmbiguous, maxAppendedDataSize) {
|
|
15784
15610
|
const { size } = reader;
|
|
15785
15611
|
const anchoredLength = Math.min(size, END_OF_CENTRAL_DIR_LENGTH + MAX_16_BITS);
|
|
15786
|
-
const remoteProbeBudget = {
|
|
15612
|
+
const remoteProbeBudget = { count: MAX_END_OF_CENTRAL_DIR_PROBES };
|
|
15787
15613
|
let endOfDirectoryInfo;
|
|
15788
15614
|
let plausibleEndOfDirectoryInfo;
|
|
15789
15615
|
let endOfDirectoryReachingEndCount = 0;
|
|
@@ -15870,8 +15696,8 @@ async function readSignature(reader, view, anchoredOffset, signatureOffset, size
|
|
|
15870
15696
|
if (signatureOffset >= anchoredOffset) {
|
|
15871
15697
|
return getUint32(view, signatureOffset - anchoredOffset);
|
|
15872
15698
|
}
|
|
15873
|
-
if (remoteProbeBudget.
|
|
15874
|
-
remoteProbeBudget.
|
|
15699
|
+
if (remoteProbeBudget.count > 0) {
|
|
15700
|
+
remoteProbeBudget.count--;
|
|
15875
15701
|
const signatureArray = await readUint8Array(reader, signatureOffset, 4);
|
|
15876
15702
|
return getUint32(getDataView(signatureArray), 0);
|
|
15877
15703
|
}
|
|
@@ -15894,13 +15720,6 @@ function validateLocalDirectory(zipEntry, localDirectory, rawLocalFilename, chec
|
|
|
15894
15720
|
reportAmbiguity(reject, warnings, WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES);
|
|
15895
15721
|
}
|
|
15896
15722
|
}
|
|
15897
|
-
function validateDataDescriptor(zipEntry, localDirectory, warnings) {
|
|
15898
|
-
const { dataDescriptor } = localDirectory;
|
|
15899
|
-
const maskedLocalDirectory = zipEntry.decryptedDirectory && (localDirectory.rawBitFlag & BITFLAG_MASKED_LOCAL_HEADERS) == BITFLAG_MASKED_LOCAL_HEADERS;
|
|
15900
|
-
if (dataDescriptor && !maskedLocalDirectory && (zipEntry.crc32 !== UNDEFINED_VALUE && dataDescriptor.crc32 != zipEntry.crc32 || dataDescriptor.compressedSize != zipEntry.compressedSize || dataDescriptor.uncompressedSize != zipEntry.uncompressedSize)) {
|
|
15901
|
-
reportAmbiguity(!warnings, warnings, WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES);
|
|
15902
|
-
}
|
|
15903
|
-
}
|
|
15904
15723
|
function reportAmbiguity(reject, warnings, reason) {
|
|
15905
15724
|
if (reject) {
|
|
15906
15725
|
throwAmbiguousArchive(reason);
|
|
@@ -15943,7 +15762,7 @@ function getBigUint64(view, offset) {
|
|
|
15943
15762
|
}
|
|
15944
15763
|
return Number(value);
|
|
15945
15764
|
}
|
|
15946
|
-
var ERR_BAD_FORMAT, ERR_EOCDR_NOT_FOUND, ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND, ERR_CENTRAL_DIRECTORY_NOT_FOUND, ERR_ENCRYPTED, ERR_UNSUPPORTED_ENCRYPTION, ERR_SPLIT_ZIP_FILE, ERR_ENTRY_DATA_OUT_OF_BOUNDS, ERR_AMBIGUOUS_ARCHIVE, ERR_ENCRYPTED_CENTRAL_DIRECTORY, ERR_UNSAFE_FILENAME, ERR_INVALID_STRICTNESS, ERR_INVALID_FILENAME_VALIDATION, ERR_INVALID_MAX_APPENDED_DATA_SIZE, ERR_UNSUPPORTED_UINT64, WARNING_UNSORTED_CENTRAL_DIRECTORY, WARNING_UNKNOWN_VERSION, WARNING_COMPRESSED_PATCHED_DATA, WARNING_MALFORMED_EXTRA_FIELD, WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA, WARNING_WRAPPED_ENTRIES_COUNT, WARNING_APPENDED_DATA, WARNING_PREPENDED_DATA, WARNING_PREPENDED_CENTRAL_DIRECTORY, WARNING_TRAILING_CENTRAL_DIRECTORY_DATA,
|
|
15765
|
+
var ERR_BAD_FORMAT, ERR_EOCDR_NOT_FOUND, ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND, ERR_CENTRAL_DIRECTORY_NOT_FOUND, ERR_LOCAL_FILE_HEADER_NOT_FOUND, ERR_EXTRAFIELD_ZIP64_NOT_FOUND, ERR_ENCRYPTED, ERR_UNSUPPORTED_ENCRYPTION, ERR_SPLIT_ZIP_FILE, ERR_OVERLAPPING_ENTRY, ERR_ENTRY_DATA_OUT_OF_BOUNDS, ERR_AMBIGUOUS_ARCHIVE, ERR_ENCRYPTED_CENTRAL_DIRECTORY, ERR_UNSAFE_FILENAME, ERR_INVALID_STRICTNESS, ERR_INVALID_FILENAME_VALIDATION, ERR_INVALID_MAX_APPENDED_DATA_SIZE, ERR_UNSUPPORTED_UINT64, WARNING_UNSORTED_CENTRAL_DIRECTORY, WARNING_UNKNOWN_VERSION, WARNING_COMPRESSED_PATCHED_DATA, WARNING_MALFORMED_EXTRA_FIELD, WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA, WARNING_WRAPPED_ENTRIES_COUNT, WARNING_APPENDED_DATA, WARNING_PREPENDED_DATA, WARNING_PREPENDED_CENTRAL_DIRECTORY, WARNING_TRAILING_CENTRAL_DIRECTORY_DATA, WARNING_DUPLICATE_FILENAME, WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY, WARNING_MULTIPLE_END_OF_CENTRAL_DIRECTORY, WARNING_MISMATCHED_LOCAL_FILE_HEADER_FILENAME, WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG, WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD, WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES, MAX_KNOWN_VERSION, DRIVE_LETTER_REGEXP, PARENT_DIRECTORY_REGEXP, CHARSET_UTF8, PROPERTY_NAME_UTF8_SUFFIX, CHARSET_CP437, BITFLAG_AMBIGUITY_MASK, VENDOR_VERSION_AE_1, ZIP64_PROPERTIES, ZIP64_EXTRACTION, MAX_SAFE_UINT64, MAX_END_OF_CENTRAL_DIR_PROBES, MAX_DEFLATE_EXPANSION_RATIO, CENTRAL_DIRECTORY_UNREACHABLE, CENTRAL_DIRECTORY_PLAUSIBLE, CENTRAL_DIRECTORY_REACHABLE, ZipReader, ZipReaderStream, ZipEntry;
|
|
15947
15766
|
var init_zip_reader = __esm({
|
|
15948
15767
|
"../../node_modules/@zip.js/zip.js/lib/core/zip-reader.js"() {
|
|
15949
15768
|
init_constants();
|
|
@@ -15963,9 +15782,12 @@ var init_zip_reader = __esm({
|
|
|
15963
15782
|
ERR_EOCDR_NOT_FOUND = "End of central directory not found";
|
|
15964
15783
|
ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND = "End of Zip64 central directory locator not found";
|
|
15965
15784
|
ERR_CENTRAL_DIRECTORY_NOT_FOUND = "Central directory header not found";
|
|
15785
|
+
ERR_LOCAL_FILE_HEADER_NOT_FOUND = "Local file header not found";
|
|
15786
|
+
ERR_EXTRAFIELD_ZIP64_NOT_FOUND = "Zip64 extra field not found";
|
|
15966
15787
|
ERR_ENCRYPTED = "File contains encrypted entry";
|
|
15967
15788
|
ERR_UNSUPPORTED_ENCRYPTION = "Encryption method not supported";
|
|
15968
15789
|
ERR_SPLIT_ZIP_FILE = "Split zip file";
|
|
15790
|
+
ERR_OVERLAPPING_ENTRY = "Overlapping entry found";
|
|
15969
15791
|
ERR_ENTRY_DATA_OUT_OF_BOUNDS = "Entry data out of bounds";
|
|
15970
15792
|
ERR_AMBIGUOUS_ARCHIVE = "Ambiguous archive";
|
|
15971
15793
|
ERR_ENCRYPTED_CENTRAL_DIRECTORY = "Encrypted central directory is not supported";
|
|
@@ -15984,8 +15806,6 @@ var init_zip_reader = __esm({
|
|
|
15984
15806
|
WARNING_PREPENDED_DATA = "prepended data";
|
|
15985
15807
|
WARNING_PREPENDED_CENTRAL_DIRECTORY = "prepended central directory";
|
|
15986
15808
|
WARNING_TRAILING_CENTRAL_DIRECTORY_DATA = "trailing central directory data";
|
|
15987
|
-
WARNING_MISMATCHED_CENTRAL_DIRECTORY_OFFSET = "mismatched central directory offset";
|
|
15988
|
-
WARNING_MISSING_ZIP64_EXTRA_FIELD = "missing zip64 extra field";
|
|
15989
15809
|
WARNING_DUPLICATE_FILENAME = "duplicate filename";
|
|
15990
15810
|
WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY = "mismatched zip64 end of central directory record";
|
|
15991
15811
|
WARNING_MULTIPLE_END_OF_CENTRAL_DIRECTORY = "multiple end of central directory records";
|
|
@@ -15999,7 +15819,7 @@ var init_zip_reader = __esm({
|
|
|
15999
15819
|
CHARSET_UTF8 = "utf-8";
|
|
16000
15820
|
PROPERTY_NAME_UTF8_SUFFIX = "UTF8";
|
|
16001
15821
|
CHARSET_CP437 = "cp437";
|
|
16002
|
-
BITFLAG_AMBIGUITY_MASK = BITFLAG_ENCRYPTED | BITFLAG_DATA_DESCRIPTOR |
|
|
15822
|
+
BITFLAG_AMBIGUITY_MASK = BITFLAG_ENCRYPTED | BITFLAG_DATA_DESCRIPTOR | BITFLAG_LANG_ENCODING_FLAG;
|
|
16003
15823
|
VENDOR_VERSION_AE_1 = 1;
|
|
16004
15824
|
ZIP64_PROPERTIES = [
|
|
16005
15825
|
[PROPERTY_NAME_UNCOMPRESSED_SIZE, MAX_32_BITS],
|
|
@@ -16027,9 +15847,8 @@ var init_zip_reader = __esm({
|
|
|
16027
15847
|
constructor(reader, options = {}) {
|
|
16028
15848
|
Object.assign(this, {
|
|
16029
15849
|
reader: new GenericReader(reader),
|
|
16030
|
-
options
|
|
16031
|
-
readRanges: { indexes: /* @__PURE__ */ new Set(), sortedRanges: [], pendingRanges: [] }
|
|
16032
|
-
entriesMissingZip64ExtraField: /* @__PURE__ */ new WeakSet()
|
|
15850
|
+
options,
|
|
15851
|
+
readRanges: { indexes: /* @__PURE__ */ new Set(), sortedRanges: [], pendingRanges: [] }
|
|
16033
15852
|
});
|
|
16034
15853
|
}
|
|
16035
15854
|
async *getEntriesGenerator(options = {}) {
|
|
@@ -16096,21 +15915,15 @@ var init_zip_reader = __esm({
|
|
|
16096
15915
|
directoryDataOffset = getDiskOffset(reader, getUint32(endOfDirectoryLocatorView, 4)) + getBigUint64(endOfDirectoryLocatorView, 8);
|
|
16097
15916
|
let endOfDirectoryArray = await readUint8Array(reader, directoryDataOffset, ZIP64_END_OF_CENTRAL_DIR_LENGTH);
|
|
16098
15917
|
let endOfDirectoryView2 = getDataView(endOfDirectoryArray);
|
|
16099
|
-
|
|
16100
|
-
|
|
16101
|
-
|
|
16102
|
-
|
|
16103
|
-
|
|
16104
|
-
|
|
16105
|
-
if (expectedDirectoryDataOffset !== UNDEFINED_VALUE && expectedDirectoryDataOffset >= 0 && directoryDataOffset != expectedDirectoryDataOffset) {
|
|
16106
|
-
const originalDirectoryDataOffset = directoryDataOffset;
|
|
16107
|
-
directoryDataOffset = expectedDirectoryDataOffset;
|
|
16108
|
-
if (directoryDataOffset > originalDirectoryDataOffset) {
|
|
16109
|
-
prependedDataLength = directoryDataOffset - originalDirectoryDataOffset;
|
|
16110
|
-
}
|
|
16111
|
-
endOfDirectoryArray = await readUint8Array(reader, directoryDataOffset, ZIP64_END_OF_CENTRAL_DIR_LENGTH);
|
|
16112
|
-
endOfDirectoryView2 = getDataView(endOfDirectoryArray);
|
|
15918
|
+
const expectedDirectoryDataOffset = endOfDirectoryInfo.offset - ZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH - ZIP64_END_OF_CENTRAL_DIR_LENGTH;
|
|
15919
|
+
if ((endOfDirectoryArray.length < ZIP64_END_OF_CENTRAL_DIR_LENGTH || getUint32(endOfDirectoryView2, 0) != ZIP64_END_OF_CENTRAL_DIR_SIGNATURE) && directoryDataOffset != expectedDirectoryDataOffset && expectedDirectoryDataOffset >= 0) {
|
|
15920
|
+
const originalDirectoryDataOffset = directoryDataOffset;
|
|
15921
|
+
directoryDataOffset = expectedDirectoryDataOffset;
|
|
15922
|
+
if (directoryDataOffset > originalDirectoryDataOffset) {
|
|
15923
|
+
prependedDataLength = directoryDataOffset - originalDirectoryDataOffset;
|
|
16113
15924
|
}
|
|
15925
|
+
endOfDirectoryArray = await readUint8Array(reader, directoryDataOffset, ZIP64_END_OF_CENTRAL_DIR_LENGTH);
|
|
15926
|
+
endOfDirectoryView2 = getDataView(endOfDirectoryArray);
|
|
16114
15927
|
}
|
|
16115
15928
|
if (endOfDirectoryArray.length < ZIP64_END_OF_CENTRAL_DIR_LENGTH || getUint32(endOfDirectoryView2, 0) != ZIP64_END_OF_CENTRAL_DIR_SIGNATURE) {
|
|
16116
15929
|
throw new Error(ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND);
|
|
@@ -16149,12 +15962,14 @@ var init_zip_reader = __esm({
|
|
|
16149
15962
|
reportAmbiguity(checkAmbiguity, warnings, WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY);
|
|
16150
15963
|
}
|
|
16151
15964
|
directoryDataOffset = getDiskOffset(reader, diskNumber) + getBigUint64(endOfDirectoryView2, 48) + prependedDataLength;
|
|
16152
|
-
} else if (directoryDataOffset == MAX_32_BITS || directoryDataLength == MAX_32_BITS || diskNumber == MAX_16_BITS) {
|
|
16153
|
-
throw new Error(ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND);
|
|
16154
15965
|
}
|
|
16155
15966
|
}
|
|
16156
15967
|
let declaredDirectoryDataLength = directoryDataLength;
|
|
16157
15968
|
const centralDirectoryEndOffset = endOfDirectoryInfo.offset - (zip64EndOfDirectory ? zip64EndOfDirectoryLength + ZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH : 0);
|
|
15969
|
+
if (directoryDataOffset >= reader.size) {
|
|
15970
|
+
prependedDataLength = reader.size - directoryDataOffset - directoryDataLength - END_OF_CENTRAL_DIR_LENGTH;
|
|
15971
|
+
directoryDataOffset = reader.size - directoryDataLength - END_OF_CENTRAL_DIR_LENGTH;
|
|
15972
|
+
}
|
|
16158
15973
|
if (expectedLastDiskNumber != lastDiskNumber) {
|
|
16159
15974
|
throw new Error(ERR_SPLIT_ZIP_FILE);
|
|
16160
15975
|
}
|
|
@@ -16162,54 +15977,31 @@ var init_zip_reader = __esm({
|
|
|
16162
15977
|
throw new Error(ERR_BAD_FORMAT);
|
|
16163
15978
|
}
|
|
16164
15979
|
let offset = 0;
|
|
16165
|
-
let directoryArray =
|
|
15980
|
+
let directoryArray = await readUint8Array(reader, directoryDataOffset, directoryDataLength);
|
|
16166
15981
|
let directoryView = getDataView(directoryArray);
|
|
16167
15982
|
if (directoryDataLength) {
|
|
16168
|
-
|
|
15983
|
+
if (directoryArray.length < 4) {
|
|
15984
|
+
throw new Error(ERR_BAD_FORMAT);
|
|
15985
|
+
}
|
|
15986
|
+
const expectedDirectoryDataOffset = centralDirectoryEndOffset - directoryDataLength;
|
|
16169
15987
|
if (directoryDataOffset != expectedDirectoryDataOffset && diskNumber == lastDiskNumber) {
|
|
16170
|
-
const storedPointsAtDirectory =
|
|
16171
|
-
if (!storedPointsAtDirectory && expectedDirectoryDataOffset < 0) {
|
|
16172
|
-
throw new Error(ERR_BAD_FORMAT);
|
|
16173
|
-
}
|
|
15988
|
+
const storedPointsAtDirectory = getUint32(directoryView, offset) == CENTRAL_FILE_HEADER_SIGNATURE || Boolean(directoryEncryptionInfo && directoryEncryptionInfo.compressedSize) || detectEncryptedCentralDirectory(directoryView);
|
|
16174
15989
|
let reconcile = !storedPointsAtDirectory;
|
|
16175
|
-
if (expectedDirectoryDataOffset >= 0 && expectedDirectoryDataOffset + 4 <= reader.size) {
|
|
16176
|
-
|
|
16177
|
-
|
|
16178
|
-
const signatureRecordOffset = await findDigitalSignatureRecordOffset(reader, centralDirectoryEndOffset);
|
|
16179
|
-
const signedDirectoryDataOffset = signatureRecordOffset - directoryDataLength;
|
|
16180
|
-
if (signatureRecordOffset !== UNDEFINED_VALUE && signedDirectoryDataOffset >= 0 && await pointsAtDirectory(reader, signedDirectoryDataOffset)) {
|
|
16181
|
-
expectedDirectoryDataOffset = signedDirectoryDataOffset;
|
|
16182
|
-
expectedPointsAtDirectory = true;
|
|
16183
|
-
}
|
|
16184
|
-
}
|
|
16185
|
-
if (storedPointsAtDirectory) {
|
|
16186
|
-
reconcile = expectedPointsAtDirectory;
|
|
16187
|
-
}
|
|
15990
|
+
if (!reconcile && expectedDirectoryDataOffset >= 0 && expectedDirectoryDataOffset + 4 <= reader.size) {
|
|
15991
|
+
const expectedSignatureArray = await readUint8Array(reader, expectedDirectoryDataOffset, 4);
|
|
15992
|
+
reconcile = getUint32(getDataView(expectedSignatureArray), 0) == CENTRAL_FILE_HEADER_SIGNATURE;
|
|
16188
15993
|
}
|
|
16189
|
-
if (reconcile
|
|
15994
|
+
if (reconcile) {
|
|
16190
15995
|
const originalDirectoryDataOffset = directoryDataOffset;
|
|
16191
15996
|
directoryDataOffset = expectedDirectoryDataOffset;
|
|
16192
|
-
|
|
16193
|
-
|
|
16194
|
-
const offsetDelta = directoryDataOffset - originalDirectoryDataOffset;
|
|
16195
|
-
const { localHeaderFound, shiftedLocalHeaderFound } = await probeLocalHeaders(reader, directoryArray, directoryView, offsetDelta);
|
|
16196
|
-
if (offsetDelta > 0 && !(localHeaderFound && !shiftedLocalHeaderFound)) {
|
|
16197
|
-
prependedDataLength += offsetDelta;
|
|
15997
|
+
if (directoryDataOffset > originalDirectoryDataOffset) {
|
|
15998
|
+
prependedDataLength += directoryDataOffset - originalDirectoryDataOffset;
|
|
16198
15999
|
prependedCentralDirectory = storedPointsAtDirectory;
|
|
16199
|
-
} else {
|
|
16200
|
-
reportAmbiguity(checkAmbiguity, warnings, WARNING_MISMATCHED_CENTRAL_DIRECTORY_OFFSET);
|
|
16201
|
-
if (offsetDelta < 0 && !localHeaderFound && shiftedLocalHeaderFound) {
|
|
16202
|
-
prependedDataLength += offsetDelta;
|
|
16203
|
-
}
|
|
16204
16000
|
}
|
|
16001
|
+
directoryArray = await readUint8Array(reader, directoryDataOffset, directoryDataLength);
|
|
16002
|
+
directoryView = getDataView(directoryArray);
|
|
16205
16003
|
}
|
|
16206
16004
|
}
|
|
16207
|
-
if (directoryArray.length < 4) {
|
|
16208
|
-
throw new Error(ERR_BAD_FORMAT);
|
|
16209
|
-
}
|
|
16210
|
-
} else if (!filesLength && directoryDataOffset < centralDirectoryEndOffset && diskNumber == lastDiskNumber) {
|
|
16211
|
-
prependedDataLength += centralDirectoryEndOffset - directoryDataOffset;
|
|
16212
|
-
directoryDataOffset = centralDirectoryEndOffset;
|
|
16213
16005
|
}
|
|
16214
16006
|
const expectedDirectoryDataLength = centralDirectoryEndOffset - directoryDataOffset;
|
|
16215
16007
|
if (directoryDataLength != expectedDirectoryDataLength && expectedDirectoryDataLength >= 0 && diskNumber == lastDiskNumber) {
|
|
@@ -16240,7 +16032,7 @@ var init_zip_reader = __esm({
|
|
|
16240
16032
|
const commentEncoding = getOptionValue(zipReader, options, OPTION_COMMENT_ENCODING);
|
|
16241
16033
|
const filenames = /* @__PURE__ */ new Set();
|
|
16242
16034
|
let duplicateFilename;
|
|
16243
|
-
let previousEntryPosition = -
|
|
16035
|
+
let previousEntryPosition = -1;
|
|
16244
16036
|
const recoverWrappedFilesLength = !checkAmbiguity && !zip64EndOfDirectory;
|
|
16245
16037
|
if (!filesLength && recoverWrappedFilesLength) {
|
|
16246
16038
|
filesLength = getWrappedFilesLength(directoryView, directoryArray, offset);
|
|
@@ -16248,10 +16040,8 @@ var init_zip_reader = __esm({
|
|
|
16248
16040
|
addWarning(warnings, WARNING_WRAPPED_ENTRIES_COUNT);
|
|
16249
16041
|
}
|
|
16250
16042
|
}
|
|
16251
|
-
const entryOptions = Object.assign({}, zipReader.options, options, { [OPTION_STRICTNESS]: strictness });
|
|
16252
|
-
delete entryOptions[OPTION_CHECK_AMBIGUITY];
|
|
16253
16043
|
for (let indexFile = 0; indexFile < filesLength; indexFile++) {
|
|
16254
|
-
const fileEntry = new ZipEntry(reader,
|
|
16044
|
+
const fileEntry = new ZipEntry(reader, zipReader.options);
|
|
16255
16045
|
if (offset + CENTRAL_FILE_HEADER_LENGTH > directoryArray.length || getUint32(directoryView, offset) != CENTRAL_FILE_HEADER_SIGNATURE) {
|
|
16256
16046
|
if (indexFile == 0 && !decryptedDirectory && (zip64EndOfDirectoryVersion2 || detectEncryptedCentralDirectory(directoryView))) {
|
|
16257
16047
|
throw new Error(ERR_ENCRYPTED_CENTRAL_DIRECTORY);
|
|
@@ -16290,6 +16080,17 @@ var init_zip_reader = __esm({
|
|
|
16290
16080
|
if (filename === UNDEFINED_VALUE) {
|
|
16291
16081
|
filename = decodeText(rawFilename, rawFilenameEncoding);
|
|
16292
16082
|
}
|
|
16083
|
+
if (normalizeFilename) {
|
|
16084
|
+
const normalizedFilename = normalizeFilename(filename);
|
|
16085
|
+
if (normalizedFilename !== UNDEFINED_VALUE) {
|
|
16086
|
+
filename = normalizedFilename;
|
|
16087
|
+
}
|
|
16088
|
+
}
|
|
16089
|
+
if (isUnsafeFilename(filename, filenameValidation)) {
|
|
16090
|
+
const error2 = new Error(ERR_UNSAFE_FILENAME);
|
|
16091
|
+
error2.filename = filename;
|
|
16092
|
+
throw error2;
|
|
16093
|
+
}
|
|
16293
16094
|
let comment = decode2(rawComment, rawCommentEncoding, TEXT_TYPE_COMMENT);
|
|
16294
16095
|
if (comment === UNDEFINED_VALUE) {
|
|
16295
16096
|
comment = decodeText(rawComment, rawCommentEncoding);
|
|
@@ -16317,42 +16118,16 @@ var init_zip_reader = __esm({
|
|
|
16317
16118
|
filename,
|
|
16318
16119
|
comment
|
|
16319
16120
|
});
|
|
16320
|
-
|
|
16321
|
-
try {
|
|
16322
|
-
malformedExtraField = readCommonFooter(fileEntry, fileEntry, directoryView, offset + 6);
|
|
16323
|
-
} catch (error2) {
|
|
16324
|
-
if (checkAmbiguity || error2.message != ERR_EXTRAFIELD_ZIP64_NOT_FOUND) {
|
|
16325
|
-
throw error2;
|
|
16326
|
-
}
|
|
16327
|
-
fileEntry.zip64ExtraFieldMissing = true;
|
|
16328
|
-
addWarning(warnings, WARNING_MISSING_ZIP64_EXTRA_FIELD, fileEntry.filename);
|
|
16329
|
-
}
|
|
16330
|
-
filename = fileEntry.filename;
|
|
16331
|
-
if (normalizeFilename) {
|
|
16332
|
-
const normalizedFilename = normalizeFilename(filename);
|
|
16333
|
-
if (normalizedFilename !== UNDEFINED_VALUE) {
|
|
16334
|
-
filename = fileEntry.filename = normalizedFilename;
|
|
16335
|
-
}
|
|
16336
|
-
}
|
|
16337
|
-
if (isUnsafeFilename(filename, filenameValidation)) {
|
|
16338
|
-
const error2 = new Error(ERR_UNSAFE_FILENAME);
|
|
16339
|
-
error2.filename = filename;
|
|
16340
|
-
throw error2;
|
|
16341
|
-
}
|
|
16342
|
-
if (malformedExtraField) {
|
|
16121
|
+
if (readCommonFooter(fileEntry, fileEntry, directoryView, offset + 6)) {
|
|
16343
16122
|
addWarning(warnings, WARNING_MALFORMED_EXTRA_FIELD, filename);
|
|
16344
16123
|
}
|
|
16345
|
-
|
|
16346
|
-
|
|
16347
|
-
|
|
16348
|
-
|
|
16349
|
-
|
|
16350
|
-
startOffset = Math.min(entryPosition, startOffset);
|
|
16351
|
-
if (entryPosition < previousEntryPosition) {
|
|
16352
|
-
addWarning(warnings, WARNING_UNSORTED_CENTRAL_DIRECTORY, filename);
|
|
16353
|
-
}
|
|
16354
|
-
previousEntryPosition = entryPosition;
|
|
16124
|
+
fileEntry.offset += prependedDataLength;
|
|
16125
|
+
const entryPosition = getDiskOffset(reader, fileEntry.diskNumberStart) + fileEntry.offset;
|
|
16126
|
+
startOffset = Math.min(entryPosition, startOffset);
|
|
16127
|
+
if (entryPosition < previousEntryPosition) {
|
|
16128
|
+
addWarning(warnings, WARNING_UNSORTED_CENTRAL_DIRECTORY, filename);
|
|
16355
16129
|
}
|
|
16130
|
+
previousEntryPosition = entryPosition;
|
|
16356
16131
|
if ((fileEntry.version & MAX_8_BITS) > MAX_KNOWN_VERSION) {
|
|
16357
16132
|
addWarning(warnings, WARNING_UNKNOWN_VERSION, filename);
|
|
16358
16133
|
}
|
|
@@ -16372,10 +16147,9 @@ var init_zip_reader = __esm({
|
|
|
16372
16147
|
const sticky = Boolean(fileEntry.unixMode & FILE_ATTR_UNIX_STICKY_MASK);
|
|
16373
16148
|
const unixType = fileEntry.unixMode === UNDEFINED_VALUE ? unixExternalUpper : fileEntry.unixMode;
|
|
16374
16149
|
const symlink = (unixType & FILE_ATTR_UNIX_TYPE_MASK) == FILE_ATTR_UNIX_TYPE_SYMLINK;
|
|
16150
|
+
const executable = !symlink && (fileEntry.unixMode !== UNDEFINED_VALUE ? (fileEntry.unixMode & FILE_ATTR_UNIX_EXECUTABLE_MASK) != 0 : unixCompatible && (unixExternalUpper & FILE_ATTR_UNIX_EXECUTABLE_MASK) != 0);
|
|
16375
16151
|
const modeIsDir = fileEntry.unixMode !== UNDEFINED_VALUE && (fileEntry.unixMode & FILE_ATTR_UNIX_TYPE_MASK) == FILE_ATTR_UNIX_TYPE_DIR;
|
|
16376
16152
|
const upperIsDir = (unixExternalUpper & FILE_ATTR_UNIX_TYPE_MASK) == FILE_ATTR_UNIX_TYPE_DIR;
|
|
16377
|
-
const directory = modeIsDir || upperIsDir || msDosCompatible && msdosAttributes.directory || fileEntry.filename.endsWith(DIRECTORY_SIGNATURE);
|
|
16378
|
-
const executable = !symlink && !directory && (fileEntry.unixMode !== UNDEFINED_VALUE ? (fileEntry.unixMode & FILE_ATTR_UNIX_EXECUTABLE_MASK) != 0 : unixCompatible && (unixExternalUpper & FILE_ATTR_UNIX_EXECUTABLE_MASK) != 0);
|
|
16379
16153
|
Object.assign(fileEntry, {
|
|
16380
16154
|
setuid,
|
|
16381
16155
|
setgid,
|
|
@@ -16383,14 +16157,11 @@ var init_zip_reader = __esm({
|
|
|
16383
16157
|
symlink,
|
|
16384
16158
|
unixExternalUpper,
|
|
16385
16159
|
executable,
|
|
16386
|
-
directory,
|
|
16160
|
+
directory: modeIsDir || upperIsDir || msDosCompatible && msdosAttributes.directory || fileEntry.filename.endsWith(DIRECTORY_SIGNATURE),
|
|
16387
16161
|
zipCrypto: fileEntry.encrypted && !fileEntry.extraFieldAES
|
|
16388
16162
|
});
|
|
16389
16163
|
const entry = new Entry(fileEntry);
|
|
16390
|
-
|
|
16391
|
-
zipReader.entriesMissingZip64ExtraField.add(entry);
|
|
16392
|
-
}
|
|
16393
|
-
entry.getData = (writer, options2) => fileEntry.getData(writer, entry, zipReader, options2);
|
|
16164
|
+
entry.getData = (writer, options2) => fileEntry.getData(writer, entry, zipReader.readRanges, options2);
|
|
16394
16165
|
entry.arrayBuffer = async (options2) => {
|
|
16395
16166
|
const writer = new TransformStream();
|
|
16396
16167
|
const arrayBufferPromise = streamToBlob(writer.readable).then((blob) => blob.arrayBuffer());
|
|
@@ -16399,7 +16170,7 @@ var init_zip_reader = __esm({
|
|
|
16399
16170
|
await fileEntry.getData(
|
|
16400
16171
|
writer,
|
|
16401
16172
|
entry,
|
|
16402
|
-
zipReader,
|
|
16173
|
+
zipReader.readRanges,
|
|
16403
16174
|
Object.assign({}, options2, { preventClose: false })
|
|
16404
16175
|
);
|
|
16405
16176
|
return arrayBufferPromise;
|
|
@@ -16443,10 +16214,10 @@ var init_zip_reader = __esm({
|
|
|
16443
16214
|
const extractPrependedData = getOptionValue(zipReader, options, OPTION_EXTRACT_PREPENDED_DATA);
|
|
16444
16215
|
const extractAppendedData = getOptionValue(zipReader, options, OPTION_EXTRACT_APPENDED_DATA);
|
|
16445
16216
|
const splitZipSignatureLength = (checkAmbiguity || extractPrependedData) && filesLength && startOffset == SPLIT_ZIP_FILE_SIGNATURE_LENGTH && await startsWithSplitZipMarker(reader) ? SPLIT_ZIP_FILE_SIGNATURE_LENGTH : 0;
|
|
16446
|
-
if (checkAmbiguity && (prependedDataLength
|
|
16217
|
+
if (checkAmbiguity && (prependedDataLength || filesLength && startOffset > splitZipSignatureLength)) {
|
|
16447
16218
|
throwAmbiguousArchive(WARNING_PREPENDED_DATA);
|
|
16448
16219
|
}
|
|
16449
|
-
if (prependedDataLength
|
|
16220
|
+
if (prependedDataLength || filesLength && startOffset > SPLIT_ZIP_FILE_SIGNATURE_LENGTH) {
|
|
16450
16221
|
addWarning(warnings, WARNING_PREPENDED_DATA);
|
|
16451
16222
|
}
|
|
16452
16223
|
if (prependedCentralDirectory) {
|
|
@@ -16530,12 +16301,8 @@ var init_zip_reader = __esm({
|
|
|
16530
16301
|
options
|
|
16531
16302
|
});
|
|
16532
16303
|
}
|
|
16533
|
-
async getData(writer, fileEntry,
|
|
16304
|
+
async getData(writer, fileEntry, readRanges, options = {}) {
|
|
16534
16305
|
const zipEntry = this;
|
|
16535
|
-
const { readRanges, directoryOffset } = zipReader;
|
|
16536
|
-
if (zipEntry.zip64ExtraFieldMissing) {
|
|
16537
|
-
throw new Error(ERR_EXTRAFIELD_ZIP64_NOT_FOUND);
|
|
16538
|
-
}
|
|
16539
16306
|
const config3 = getConfiguration();
|
|
16540
16307
|
const {
|
|
16541
16308
|
reader,
|
|
@@ -16566,8 +16333,8 @@ var init_zip_reader = __esm({
|
|
|
16566
16333
|
const passThroughCompression = Boolean(passThrough);
|
|
16567
16334
|
const passThroughEncryption = passThrough === true;
|
|
16568
16335
|
checkPasswordOption(password, rawPassword);
|
|
16569
|
-
password = password && password.length
|
|
16570
|
-
rawPassword = rawPassword && rawPassword.length
|
|
16336
|
+
password = password && password.length && password;
|
|
16337
|
+
rawPassword = rawPassword && rawPassword.length && rawPassword;
|
|
16571
16338
|
if (extraFieldAES) {
|
|
16572
16339
|
if (extraFieldAES.originalCompressionMethod != COMPRESSION_METHOD_AES) {
|
|
16573
16340
|
throw new Error(ERR_UNSUPPORTED_COMPRESSION);
|
|
@@ -16606,10 +16373,10 @@ var init_zip_reader = __esm({
|
|
|
16606
16373
|
}
|
|
16607
16374
|
validateLocalDirectory(zipEntry, localDirectory, rawLocalFilename, checkLocalFilename, checkLocalDirectory ? UNDEFINED_VALUE : warnings);
|
|
16608
16375
|
const { lastAccessDate, creationDate, uid, gid } = localDirectory;
|
|
16609
|
-
if (lastAccessDate
|
|
16376
|
+
if (lastAccessDate) {
|
|
16610
16377
|
fileEntry.lastAccessDate = lastAccessDate;
|
|
16611
16378
|
}
|
|
16612
|
-
if (creationDate
|
|
16379
|
+
if (creationDate) {
|
|
16613
16380
|
fileEntry.creationDate = creationDate;
|
|
16614
16381
|
}
|
|
16615
16382
|
if (uid !== UNDEFINED_VALUE && fileEntry.uid === UNDEFINED_VALUE) {
|
|
@@ -16619,12 +16386,12 @@ var init_zip_reader = __esm({
|
|
|
16619
16386
|
fileEntry.gid = gid;
|
|
16620
16387
|
}
|
|
16621
16388
|
const checkPasswordOnly = getOptionValue(zipEntry, options, OPTION_CHECK_PASSWORD_ONLY);
|
|
16622
|
-
const encrypted = zipEntry.encrypted && (!passThroughEncryption || checkPasswordOnly);
|
|
16389
|
+
const encrypted = zipEntry.encrypted && localDirectory.encrypted && (!passThroughEncryption || checkPasswordOnly);
|
|
16623
16390
|
const zipCrypto = encrypted && !extraFieldAES;
|
|
16624
16391
|
if (!passThroughEncryption) {
|
|
16625
16392
|
fileEntry.zipCrypto = zipCrypto;
|
|
16626
16393
|
}
|
|
16627
|
-
if (encrypted && (
|
|
16394
|
+
if (encrypted && (localDirectory.rawBitFlag & BITFLAG_STRONG_ENCRYPTION) == BITFLAG_STRONG_ENCRYPTION) {
|
|
16628
16395
|
throw new Error(ERR_UNSUPPORTED_ENCRYPTION);
|
|
16629
16396
|
}
|
|
16630
16397
|
const registeredCodec = passThroughCompression ? UNDEFINED_VALUE : getRegisteredCodec(compressionMethod);
|
|
@@ -16638,7 +16405,7 @@ var init_zip_reader = __esm({
|
|
|
16638
16405
|
throw new Error(ERR_ENCRYPTED);
|
|
16639
16406
|
}
|
|
16640
16407
|
}
|
|
16641
|
-
if (dataOffset + compressedSize >
|
|
16408
|
+
if (dataOffset + compressedSize > reader.size) {
|
|
16642
16409
|
throw new Error(ERR_ENTRY_DATA_OUT_OF_BOUNDS);
|
|
16643
16410
|
}
|
|
16644
16411
|
const size = compressedSize;
|
|
@@ -16675,6 +16442,7 @@ var init_zip_reader = __esm({
|
|
|
16675
16442
|
encrypted,
|
|
16676
16443
|
useWebWorkers: getOptionValue(zipEntry, options, OPTION_USE_WEB_WORKERS),
|
|
16677
16444
|
useCompressionStream,
|
|
16445
|
+
transferStreams: getOptionValue(zipEntry, options, OPTION_TRANSFER_STREAMS),
|
|
16678
16446
|
deflate64,
|
|
16679
16447
|
format: registeredCodec ? registeredCodec.format : UNDEFINED_VALUE,
|
|
16680
16448
|
codecURI: registeredCodec ? registeredCodec.codecURI : UNDEFINED_VALUE,
|
|
@@ -16699,7 +16467,6 @@ var init_zip_reader = __esm({
|
|
|
16699
16467
|
extraFieldZip64: extraFieldZip64 || localDirectory.extraFieldZip64,
|
|
16700
16468
|
readRanges
|
|
16701
16469
|
});
|
|
16702
|
-
validateDataDescriptor(zipEntry, localDirectory, checkLocalDirectory ? UNDEFINED_VALUE : warnings);
|
|
16703
16470
|
}
|
|
16704
16471
|
let writable, abortError, aborted2;
|
|
16705
16472
|
try {
|
|
@@ -16712,14 +16479,16 @@ var init_zip_reader = __esm({
|
|
|
16712
16479
|
({ writable } = writer);
|
|
16713
16480
|
const readable = toCompatibleReadable(reader.createReadable({ offset: dataOffset, size }));
|
|
16714
16481
|
const { outputSize: writtenSize } = await runWorker2({ readable, writable }, workerOptions);
|
|
16715
|
-
throwIfAborted(signal);
|
|
16716
16482
|
if (writtenSize != outputSize) {
|
|
16717
16483
|
throw Object.assign(new Error(ERR_INVALID_UNCOMPRESSED_SIZE), { outputSize: writtenSize });
|
|
16718
16484
|
}
|
|
16719
16485
|
writer.size += writtenSize;
|
|
16720
16486
|
}
|
|
16721
16487
|
} catch (error2) {
|
|
16722
|
-
|
|
16488
|
+
const { outputSize: failedOutputSize } = workerOptions;
|
|
16489
|
+
if (failedOutputSize !== UNDEFINED_VALUE) {
|
|
16490
|
+
writer.size += failedOutputSize;
|
|
16491
|
+
} else if (isErrorObject(error2) && error2.outputSize !== UNDEFINED_VALUE) {
|
|
16723
16492
|
writer.size += error2.outputSize;
|
|
16724
16493
|
}
|
|
16725
16494
|
if (!checkPasswordOnly || !isErrorObject(error2) || error2.message != ERR_ABORT_CHECK_PASSWORD) {
|
|
@@ -34758,12 +34527,7 @@ var OAuthTokensSchema = object({
|
|
|
34758
34527
|
token_type: string2(),
|
|
34759
34528
|
expires_in: coerce_exports.number().optional(),
|
|
34760
34529
|
scope: string2().optional(),
|
|
34761
|
-
refresh_token: string2().optional()
|
|
34762
|
-
/**
|
|
34763
|
-
* Not part of the wire format: the authorization server this value was obtained from, added by
|
|
34764
|
-
* the client's `auth()` before it is stored and compared when it is read back.
|
|
34765
|
-
*/
|
|
34766
|
-
issuer: string2().optional().catch(void 0)
|
|
34530
|
+
refresh_token: string2().optional()
|
|
34767
34531
|
}).strip();
|
|
34768
34532
|
var OAuthErrorResponseSchema = object({
|
|
34769
34533
|
error: string2(),
|
|
@@ -34793,12 +34557,7 @@ var OAuthClientInformationSchema = object({
|
|
|
34793
34557
|
client_id: string2(),
|
|
34794
34558
|
client_secret: string2().optional(),
|
|
34795
34559
|
client_id_issued_at: number2().optional(),
|
|
34796
|
-
client_secret_expires_at: number2().optional()
|
|
34797
|
-
/**
|
|
34798
|
-
* Not part of the wire format: the authorization server this value was obtained from, added by
|
|
34799
|
-
* the client's `auth()` before it is stored and compared when it is read back.
|
|
34800
|
-
*/
|
|
34801
|
-
issuer: string2().optional().catch(void 0)
|
|
34560
|
+
client_secret_expires_at: number2().optional()
|
|
34802
34561
|
}).strip();
|
|
34803
34562
|
var OAuthClientInformationFullSchema = OAuthClientMetadataSchema.merge(OAuthClientInformationSchema);
|
|
34804
34563
|
var OAuthClientRegistrationErrorSchema = object({
|
|
@@ -34905,10 +34664,6 @@ var OAUTH_ERRORS = {
|
|
|
34905
34664
|
[InvalidTargetError.errorCode]: InvalidTargetError
|
|
34906
34665
|
};
|
|
34907
34666
|
|
|
34908
|
-
// ../../node_modules/@modelcontextprotocol/sdk/dist/esm/client/auth.js
|
|
34909
|
-
var TokenResponseSchema = OAuthTokensSchema.omit({ issuer: true });
|
|
34910
|
-
var RegistrationResponseSchema = OAuthClientInformationFullSchema.omit({ issuer: true });
|
|
34911
|
-
|
|
34912
34667
|
// ../linkque-agent-runtime/dist/esm/impl/mcp/alipay/argsMapper.js
|
|
34913
34668
|
var USER_ID = Symbol("\u7CFB\u7EDF\u53D8\u91CF\u7528\u6237\u6807\u8BC6");
|
|
34914
34669
|
|
|
@@ -37931,29 +37686,29 @@ t.fill(8, 0, 144), t.fill(9, 144, 256), t.fill(7, 256, 280), t.fill(8, 280, 288)
|
|
|
37931
37686
|
var n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
37932
37687
|
var e = (t3) => t3({ workerURI: (t4) => {
|
|
37933
37688
|
const e3 = "text/javascript";
|
|
37934
|
-
let r2 = '!function(t){"function"==typeof define&&define.amd?define(t):t()}(function(){"use strict";const{Array:t,Object:n,Number:e,Math:o,Error:r,Uint8Array:c,Uint16Array:s,Uint32Array:a,Int32Array:i,Map:f,DataView:u,Promise:w,TextEncoder:l,crypto:d,postMessage:p,TransformStream:h,ReadableStream:y,WritableStream:m,CompressionStream:S,DecompressionStream:g}=self,v=void 0,b="undefined",k="function",z=new c,C=[[],[],[],[],[],[],[],[]];for(let t=0;t<256;t++){let n=t;for(let t=0;t<8;t++)n=1&n?n>>>1^3988292384:n>>>1;C[0][t]=n}for(let t=0;t<256;t++)for(let n=1;n<8;n++){const e=C[n-1][t];C[n][t]=e>>>8^C[0][255&e]}const[I,M,A,E,R,x,P,D]=C;class F{constructor(t){this.o=t||-1}append(t){let n=0|this.o;const e=0|t.length;let o=0;if(e>=8&&t.buffer){const r=new u(t.buffer,t.byteOffset,e),c=e-8;for(;o<=c;o+=8){const t=n^r.getInt32(o,!0),e=r.getInt32(o+4,!0);n=D[255&t]^P[t>>>8&255]^x[t>>>16&255]^R[t>>>24&255]^E[255&e]^A[e>>>8&255]^M[e>>>16&255]^I[e>>>24&255]}}for(;o<e;o++)n=n>>>8^I[255&(n^t[o])];this.o=n}get(){return~this.o}}class U extends h{constructor(){let t;const n=new F;super({transform(t,e){n.append(t),e.enqueue(t)},flush(){const e=new c(4);new u(e.buffer).setUint32(0,n.get()),t.value=e}}),t=this}}function B(t,n){const e=new c(t.length+n.length);return e.set(t),e.set(n,t.length),e}function W(t){return new u(t.buffer,t.byteOffset,t.byteLength)}const O=64,V=20,K=new c([128]),T=new c(1),_=new i([1732584193,4023233417,2562383102,271733878,3285377520]),j=new c(256),H=new i(256),L=new i(256),Z=new i(256),N=new i(256);let q=!1;function G(t,n){!function(){if(!q){let t=1,n=1;do{t=255&(t^t<<1^(128&t?27:0)),n=255&(n^n<<1),n=255&(n^n<<2),n=255&(n^n<<4),128&n&&(n^=9),j[t]=255&(n^(n<<1|n>>7)^(n<<2|n>>6)^(n<<3|n>>5)^(n<<4|n>>4)^99)}while(1!=t);j[0]=99;for(let t=0;t<256;t++){const n=j[t],e=Y(n),o=e<<24|n<<16|n<<8|e^n;H[t]=o,L[t]=o>>>8|o<<24,Z[t]=o>>>16|o<<16,N[t]=o>>>24|o<<8}q=!0}}();const e=new i(60),o=function(t,n){const e=t.length>>2,o=e+6,r=4*(o+1);let c=1;for(let o=0;o<e;o++)n[o]=t[4*o]<<24|t[4*o+1]<<16|t[4*o+2]<<8|t[4*o+3];for(let t=e;t<r;t++){let o=n[t-1];t%e==0?(o=Q(o<<8|o>>>24)^c<<24,c=Y(c)):e>6&&t%e==4&&(o=Q(o)),n[t]=n[t-e]^o}return o}(t,e),r=new i(4),c=J(n);let s=0,a=0,f=0,w=0;return{process(t,n){n&&c.update(t,0,t.length),function(t){const n=new u(t.buffer,t.byteOffset,t.byteLength),e=t.length;let o=0;for(;o+16<=e;o+=16)l(),n.setInt32(o,n.getInt32(o)^r[0]),n.setInt32(o+4,n.getInt32(o+4)^r[1]),n.setInt32(o+8,n.getInt32(o+8)^r[2]),n.setInt32(o+12,n.getInt32(o+12)^r[3]);if(o<e){l();for(let n=0;o<e;o++,n++)t[o]^=r[n>>2]>>>24-8*(3&n)}}(t),n||c.update(t,0,t.length)},digest:()=>c.digest()};function l(){s=s+1|0,s||(a=a+1|0,a||(f=f+1|0,f||(w=w+1|0)));let t=X(s)^e[0],n=X(a)^e[1],c=X(f)^e[2],i=X(w)^e[3],u=H[t>>>24]^L[n>>>16&255]^Z[c>>>8&255]^N[255&i]^e[4],l=H[n>>>24]^L[c>>>16&255]^Z[i>>>8&255]^N[255&t]^e[5],d=H[c>>>24]^L[i>>>16&255]^Z[t>>>8&255]^N[255&n]^e[6],p=H[i>>>24]^L[t>>>16&255]^Z[n>>>8&255]^N[255&c]^e[7];t=H[u>>>24]^L[l>>>16&255]^Z[d>>>8&255]^N[255&p]^e[8],n=H[l>>>24]^L[d>>>16&255]^Z[p>>>8&255]^N[255&u]^e[9],c=H[d>>>24]^L[p>>>16&255]^Z[u>>>8&255]^N[255&l]^e[10],i=H[p>>>24]^L[u>>>16&255]^Z[l>>>8&255]^N[255&d]^e[11],u=H[t>>>24]^L[n>>>16&255]^Z[c>>>8&255]^N[255&i]^e[12],l=H[n>>>24]^L[c>>>16&255]^Z[i>>>8&255]^N[255&t]^e[13],d=H[c>>>24]^L[i>>>16&255]^Z[t>>>8&255]^N[255&n]^e[14],p=H[i>>>24]^L[t>>>16&255]^Z[n>>>8&255]^N[255&c]^e[15],t=H[u>>>24]^L[l>>>16&255]^Z[d>>>8&255]^N[255&p]^e[16],n=H[l>>>24]^L[d>>>16&255]^Z[p>>>8&255]^N[255&u]^e[17],c=H[d>>>24]^L[p>>>16&255]^Z[u>>>8&255]^N[255&l]^e[18],i=H[p>>>24]^L[u>>>16&255]^Z[l>>>8&255]^N[255&d]^e[19],u=H[t>>>24]^L[n>>>16&255]^Z[c>>>8&255]^N[255&i]^e[20],l=H[n>>>24]^L[c>>>16&255]^Z[i>>>8&255]^N[255&t]^e[21],d=H[c>>>24]^L[i>>>16&255]^Z[t>>>8&255]^N[255&n]^e[22],p=H[i>>>24]^L[t>>>16&255]^Z[n>>>8&255]^N[255&c]^e[23],t=H[u>>>24]^L[l>>>16&255]^Z[d>>>8&255]^N[255&p]^e[24],n=H[l>>>24]^L[d>>>16&255]^Z[p>>>8&255]^N[255&u]^e[25],c=H[d>>>24]^L[p>>>16&255]^Z[u>>>8&255]^N[255&l]^e[26],i=H[p>>>24]^L[u>>>16&255]^Z[l>>>8&255]^N[255&d]^e[27],u=H[t>>>24]^L[n>>>16&255]^Z[c>>>8&255]^N[255&i]^e[28],l=H[n>>>24]^L[c>>>16&255]^Z[i>>>8&255]^N[255&t]^e[29],d=H[c>>>24]^L[i>>>16&255]^Z[t>>>8&255]^N[255&n]^e[30],p=H[i>>>24]^L[t>>>16&255]^Z[n>>>8&255]^N[255&c]^e[31],t=H[u>>>24]^L[l>>>16&255]^Z[d>>>8&255]^N[255&p]^e[32],n=H[l>>>24]^L[d>>>16&255]^Z[p>>>8&255]^N[255&u]^e[33],c=H[d>>>24]^L[p>>>16&255]^Z[u>>>8&255]^N[255&l]^e[34],i=H[p>>>24]^L[u>>>16&255]^Z[l>>>8&255]^N[255&d]^e[35],u=H[t>>>24]^L[n>>>16&255]^Z[c>>>8&255]^N[255&i]^e[36],l=H[n>>>24]^L[c>>>16&255]^Z[i>>>8&255]^N[255&t]^e[37],d=H[c>>>24]^L[i>>>16&255]^Z[t>>>8&255]^N[255&n]^e[38],p=H[i>>>24]^L[t>>>16&255]^Z[n>>>8&255]^N[255&c]^e[39];let h=40;o>10&&(t=H[u>>>24]^L[l>>>16&255]^Z[d>>>8&255]^N[255&p]^e[40],n=H[l>>>24]^L[d>>>16&255]^Z[p>>>8&255]^N[255&u]^e[41],c=H[d>>>24]^L[p>>>16&255]^Z[u>>>8&255]^N[255&l]^e[42],i=H[p>>>24]^L[u>>>16&255]^Z[l>>>8&255]^N[255&d]^e[43],u=H[t>>>24]^L[n>>>16&255]^Z[c>>>8&255]^N[255&i]^e[44],l=H[n>>>24]^L[c>>>16&255]^Z[i>>>8&255]^N[255&t]^e[45],d=H[c>>>24]^L[i>>>16&255]^Z[t>>>8&255]^N[255&n]^e[46],p=H[i>>>24]^L[t>>>16&255]^Z[n>>>8&255]^N[255&c]^e[47],h=48),o>12&&(t=H[u>>>24]^L[l>>>16&255]^Z[d>>>8&255]^N[255&p]^e[48],n=H[l>>>24]^L[d>>>16&255]^Z[p>>>8&255]^N[255&u]^e[49],c=H[d>>>24]^L[p>>>16&255]^Z[u>>>8&255]^N[255&l]^e[50],i=H[p>>>24]^L[u>>>16&255]^Z[l>>>8&255]^N[255&d]^e[51],u=H[t>>>24]^L[n>>>16&255]^Z[c>>>8&255]^N[255&i]^e[52],l=H[n>>>24]^L[c>>>16&255]^Z[i>>>8&255]^N[255&t]^e[53],d=H[c>>>24]^L[i>>>16&255]^Z[t>>>8&255]^N[255&n]^e[54],p=H[i>>>24]^L[t>>>16&255]^Z[n>>>8&255]^N[255&c]^e[55],h=56),r[0]=(j[u>>>24]<<24|j[l>>>16&255]<<16|j[d>>>8&255]<<8|j[255&p])^e[h],r[1]=(j[l>>>24]<<24|j[d>>>16&255]<<16|j[p>>>8&255]<<8|j[255&u])^e[h+1],r[2]=(j[d>>>24]<<24|j[p>>>16&255]<<16|j[u>>>8&255]<<8|j[255&l])^e[h+2],r[3]=(j[p>>>24]<<24|j[u>>>16&255]<<16|j[l>>>8&255]<<8|j[255&d])^e[h+3]}}function J(t){const n=function(){const t=new i(_),n=new i(16),e=new c(O),r=new u(e.buffer),s=new c(8);let a=0,f=0;return{update:w,digest:function(){const n=8*f,e=o.floor(n/4294967296),r=n>>>0;for(w(K,0,1);56!=a;)w(T,0,1);s[0]=e>>>24,s[1]=e>>>16,s[2]=e>>>8,s[3]=e,s[4]=r>>>24,s[5]=r>>>16,s[6]=r>>>8,s[7]=r,w(s,0,8);const i=new c(V),l=new u(i.buffer);for(let n=0;n<t.length;n++)l.setInt32(4*n,t[n]);return t.set(_),a=0,f=0,i}};function w(t,n,o){const c=n+o;if(f+=o,a){for(;n<c&&a<O;)e[a++]=t[n++];a==O&&(l(r,0),a=0)}if(n+O<=c){const e=new u(t.buffer,t.byteOffset,t.byteLength);for(;n+O<=c;n+=O)l(e,n)}for(;n<c;)e[a++]=t[n++]}function l(e,o){for(let t=0;t<16;t++)n[t]=e.getInt32(o+4*t);let r,c=t[0],s=t[1],a=t[2],i=t[3],f=t[4];for(let t=0;t<15;t+=5)f=(c<<5|c>>>27)+((a^i)&s^i)+f+1518500249+n[t]|0,s=s<<30|s>>>2,i=(f<<5|f>>>27)+((s^a)&c^a)+i+1518500249+n[t+1]|0,c=c<<30|c>>>2,a=(i<<5|i>>>27)+((c^s)&f^s)+a+1518500249+n[t+2]|0,f=f<<30|f>>>2,s=(a<<5|a>>>27)+((f^c)&i^c)+s+1518500249+n[t+3]|0,i=i<<30|i>>>2,c=(s<<5|s>>>27)+((i^f)&a^f)+c+1518500249+n[t+4]|0,a=a<<30|a>>>2;f=(c<<5|c>>>27)+((a^i)&s^i)+f+1518500249+n[15]|0,s=s<<30|s>>>2,r=n[13]^n[8]^n[2]^n[0],r=r<<1|r>>>31,n[0]=r,i=(f<<5|f>>>27)+((s^a)&c^a)+i+1518500249+r|0,c=c<<30|c>>>2,r=n[14]^n[9]^n[3]^n[1],r=r<<1|r>>>31,n[1]=r,a=(i<<5|i>>>27)+((c^s)&f^s)+a+1518500249+r|0,f=f<<30|f>>>2,r=n[15]^n[10]^n[4]^n[2],r=r<<1|r>>>31,n[2]=r,s=(a<<5|a>>>27)+((f^c)&i^c)+s+1518500249+r|0,i=i<<30|i>>>2,r=n[0]^n[11]^n[5]^n[3],r=r<<1|r>>>31,n[3]=r,c=(s<<5|s>>>27)+((i^f)&a^f)+c+1518500249+r|0,a=a<<30|a>>>2;for(let t=20;t<40;t+=5)r=n[t-3&15]^n[t-8&15]^n[t-14&15]^n[15&t],r=r<<1|r>>>31,n[15&t]=r,f=(c<<5|c>>>27)+(s^a^i)+f+1859775393+r|0,s=s<<30|s>>>2,r=n[t-2&15]^n[t-7&15]^n[t-13&15]^n[t+1&15],r=r<<1|r>>>31,n[t+1&15]=r,i=(f<<5|f>>>27)+(c^s^a)+i+1859775393+r|0,c=c<<30|c>>>2,r=n[t-1&15]^n[t-6&15]^n[t-12&15]^n[t+2&15],r=r<<1|r>>>31,n[t+2&15]=r,a=(i<<5|i>>>27)+(f^c^s)+a+1859775393+r|0,f=f<<30|f>>>2,r=n[15&t]^n[t-5&15]^n[t-11&15]^n[t+3&15],r=r<<1|r>>>31,n[t+3&15]=r,s=(a<<5|a>>>27)+(i^f^c)+s+1859775393+r|0,i=i<<30|i>>>2,r=n[t+1&15]^n[t-4&15]^n[t-10&15]^n[t+4&15],r=r<<1|r>>>31,n[t+4&15]=r,c=(s<<5|s>>>27)+(a^i^f)+c+1859775393+r|0,a=a<<30|a>>>2;for(let t=40;t<60;t+=5)r=n[t-3&15]^n[t-8&15]^n[t-14&15]^n[15&t],r=r<<1|r>>>31,n[15&t]=r,f=(c<<5|c>>>27)+(s&a|(s|a)&i)+f+2400959708+r|0,s=s<<30|s>>>2,r=n[t-2&15]^n[t-7&15]^n[t-13&15]^n[t+1&15],r=r<<1|r>>>31,n[t+1&15]=r,i=(f<<5|f>>>27)+(c&s|(c|s)&a)+i+2400959708+r|0,c=c<<30|c>>>2,r=n[t-1&15]^n[t-6&15]^n[t-12&15]^n[t+2&15],r=r<<1|r>>>31,n[t+2&15]=r,a=(i<<5|i>>>27)+(f&c|(f|c)&s)+a+2400959708+r|0,f=f<<30|f>>>2,r=n[15&t]^n[t-5&15]^n[t-11&15]^n[t+3&15],r=r<<1|r>>>31,n[t+3&15]=r,s=(a<<5|a>>>27)+(i&f|(i|f)&c)+s+2400959708+r|0,i=i<<30|i>>>2,r=n[t+1&15]^n[t-4&15]^n[t-10&15]^n[t+4&15],r=r<<1|r>>>31,n[t+4&15]=r,c=(s<<5|s>>>27)+(a&i|(a|i)&f)+c+2400959708+r|0,a=a<<30|a>>>2;for(let t=60;t<80;t+=5)r=n[t-3&15]^n[t-8&15]^n[t-14&15]^n[15&t],r=r<<1|r>>>31,n[15&t]=r,f=(c<<5|c>>>27)+(s^a^i)+f+3395469782+r|0,s=s<<30|s>>>2,r=n[t-2&15]^n[t-7&15]^n[t-13&15]^n[t+1&15],r=r<<1|r>>>31,n[t+1&15]=r,i=(f<<5|f>>>27)+(c^s^a)+i+3395469782+r|0,c=c<<30|c>>>2,r=n[t-1&15]^n[t-6&15]^n[t-12&15]^n[t+2&15],r=r<<1|r>>>31,n[t+2&15]=r,a=(i<<5|i>>>27)+(f^c^s)+a+3395469782+r|0,f=f<<30|f>>>2,r=n[15&t]^n[t-5&15]^n[t-11&15]^n[t+3&15],r=r<<1|r>>>31,n[t+3&15]=r,s=(a<<5|a>>>27)+(i^f^c)+s+3395469782+r|0,i=i<<30|i>>>2,r=n[t+1&15]^n[t-4&15]^n[t-10&15]^n[t+4&15],r=r<<1|r>>>31,n[t+4&15]=r,c=(s<<5|s>>>27)+(a^i^f)+c+3395469782+r|0,a=a<<30|a>>>2;t[0]=t[0]+c|0,t[1]=t[1]+s|0,t[2]=t[2]+a|0,t[3]=t[3]+i|0,t[4]=t[4]+f|0}}(),e=new c(O),r=new c(O);t.length>O&&(n.update(t,0,t.length),t=n.digest());for(let n=0;n<O;n++){const o=n<t.length?t[n]:0;e[n]=54^o,r[n]=92^o}return n.update(e,0,O),{update(t,e,o){n.update(t,e,o)},digest(){const t=n.digest();n.update(r,0,O),n.update(t,0,V);const o=n.digest();return n.update(e,0,O),o}}}function Q(t){return j[t>>>24]<<24|j[t>>>16&255]<<16|j[t>>>8&255]<<8|j[255&t]}function X(t){return t<<24|(65280&t)<<8|t>>>8&65280|t>>>24}function Y(t){return 255&(t<<1^27*(t>>7))}const $=typeof d!=b&&typeof d.getRandomValues==k,tt="Invalid password",nt="zipjs-abort-check-password";function et(t){if($)return d.getRandomValues(t);throw new r("Crypto API not supported")}const ot={name:"PBKDF2"},rt=n.assign({hash:{name:"HMAC"}},ot),ct=n.assign({iterations:1e3,hash:{name:"SHA-1"}},ot),st=["deriveBits"],at=[8,12,16],it=[16,24,32],ft=10,ut=typeof d!=b,wt=ut&&d.subtle;let lt=ut&&typeof wt!=b&&typeof wt.importKey==k&&typeof wt.deriveBits==k,dt=G;class pt extends h{constructor({password:t,rawPassword:n,encryptionStrength:e,checkPasswordOnly:o,checkAuthenticationCode:s=!0}){const a={};super({start(){yt(a,t,n,e)},async transform(t,n){const{password:e,strength:s,l:i,ready:f}=a;if(e?(await async function(t,n,e,o){const c=await vt(t,n,e,kt(o,0,at[n])),s=kt(o,at[n]);if(c[0]!=s[0]||c[1]!=s[1])throw gt(t),new r(tt)}(a,s,e,kt(t,0,at[s]+2)),t=kt(t,at[s]+2),o?(gt(a),n.error(new r(nt))):i()):await f,a.h)return;const u=new c(t.length-ft-(t.length-ft)%16);n.enqueue(St(a,t,u,0,ft,!0))},async flush(t){const{m:n,S:e,ready:o}=a;if(n){if(await o,a.h)return;const i=kt(e,e.length-ft),f=new c(kt(e,0,e.length-ft));n.process(f,!0);const u=n.digest();let w=e.length<ft?1:0;for(let t=0;t<ft;t++)w|=u[t]^i[t];if(w&&s)return void t.error(new r("Invalid authentication code"));t.enqueue(f)}}}),mt(this,a)}}class ht extends h{constructor({password:t,rawPassword:n,encryptionStrength:e}){const o={};super({start(){yt(o,t,n,e)},async transform(t,n){const{password:e,strength:r,l:s,ready:a}=o;let i=z;if(e?(i=await async function(t,n,e){const o=et(new c(at[n]));return B(o,await vt(t,n,e,o))}(o,r,e),s()):await a,o.h)return;const f=new c(i.length+t.length-t.length%16);f.set(i,0),n.enqueue(St(o,t,f,i.length,0,!1))},async flush(t){const{m:n,S:e,ready:r}=o;if(n){if(await r,o.h)return;const s=new c(e);n.process(s,!1);const a=kt(n.digest(),0,ft);t.enqueue(B(s,a))}}}),mt(this,o)}}function yt(t,e,o,r){n.assign(t,{ready:new w(n=>t.l=n),password:bt(e,o),strength:r-1,S:z,h:!1})}function mt(t,e){const o=t.readable.getReader(),r=new y({async pull(t){try{const{value:n,done:e}=await o.read();e?t.close():t.enqueue(n)}catch(t){throw gt(e),o.cancel(t).catch(()=>{}),t}},cancel:t=>(gt(e),o.cancel(t))});n.defineProperty(t,"readable",{get:()=>r})}function St(t,n,e,o,r,s){const{m:a,S:i}=t;i.length&&(n=B(i,n));const f=n.length-r,u=f-f%16;if(e=function(t,n){if(n&&n>t.length){const e=t;(t=new c(n)).set(e,0)}return t}(e,o+u),u){const t=kt(e,o,o+u);t.set(kt(n,0,u)),a.process(t,s)}return t.S=kt(n,u),e}function gt(t){const{m:n}=t;t.h=!0,n&&n.dispose&&n.dispose()}async function vt(t,e,r,s){t.password=null;const a=it[e],i=await async function(t,e,r){if(lt)try{const o=await wt.importKey("raw",t,rt,!1,st);return new c(await wt.deriveBits(n.assign({salt:e},ct),o,8*r))}catch{lt=!1}return function(t,n,e,r){const s=J(t),a=new c(r),i=new c(n.length+4),f=new u(i.buffer);i.set(n);for(let t=1,e=0;e<r;t++,e+=V){f.setUint32(n.length,t),s.update(i,0,i.length);let c=s.digest();const u=c.slice();for(let t=1;t<1e3;t++){s.update(c,0,V),c=s.digest();for(let t=0;t<V;t++)u[t]^=c[t]}a.set(u.subarray(0,o.min(V,r-e)),e)}return a}(t,e,0,r)}(r,s,2*a+2);return t.m=dt(kt(i,0,a),kt(i,a,2*a)),t.h&>(t),kt(i,2*a)}function bt(t,n){return n===v?function(t){if(typeof l==b){t=unescape(encodeURIComponent(t));const n=new c(t.length);for(let e=0;e<n.length;e++)n[e]=t.charCodeAt(e);return n}return(new l).encode(t)}(t):n}function kt(t,n,e){return t.subarray(n,e)}class zt extends h{constructor({password:t,rawPassword:n,passwordVerification:e,checkPasswordOnly:o}){super({start(){It(this,t,n,e)},transform(t,n){const e=this;if(e.password||e.rawPassword){const n=Mt(e,t.subarray(0,12));if(e.password=e.rawPassword=null,0!=(n[11]^e.passwordVerification))throw new r(tt);t=t.subarray(12)}o?n.error(new r(nt)):n.enqueue(Mt(e,t))}})}}class Ct extends h{constructor({password:t,rawPassword:n,passwordVerification:e}){super({start(){It(this,t,n,e)},transform(t,n){const e=this;let o,r;if(e.password||e.rawPassword){e.password=e.rawPassword=null;const n=et(new c(12));n[11]=e.passwordVerification,o=new c(t.length+n.length),o.set(At(e,n),0),r=12}else o=new c(t.length),r=0;o.set(At(e,t),r),n.enqueue(o)}})}}function It(t,e,o,r){n.assign(t,{password:e,rawPassword:o,passwordVerification:r}),function(t,e,o){const r=[305419896,591751049,878082192];if(n.assign(t,{v:r,C:new F(r[0]),I:new F(r[2])}),o)for(let n=0;n<o.length;n++)Et(t,o[n]);else for(let n=0;n<e.length;n++)Et(t,e.charCodeAt(n))}(t,e,o)}function Mt(t,n){const e=new c(n.length);for(let o=0;o<n.length;o++)e[o]=Rt(t)^n[o],Et(t,e[o]);return e}function At(t,n){const e=new c(n.length);for(let o=0;o<n.length;o++)e[o]=Rt(t)^n[o],Et(t,n[o]);return e}function Et(t,n){let[,e]=t.v;t.C.append([n]);const r=~t.C.get();e=Pt(o.imul(Pt(e+xt(r)),134775813)+1),t.I.append([e>>>24]);const c=~t.I.get();t.v=[r,e,c]}function Rt(t){const n=2|t.v[2];return xt(o.imul(n,1^n)>>>8)}function xt(t){return 255&t}function Pt(t){return 4294967295&t}function Dt(t){return Boolean(t)&&"object"==typeof t}const Ft=new f;function Ut(t){return Ft.get(t)}const Bt="Invalid uncompressed size",Wt="Codec out of memory",Ot="Invalid CRC32",Vt="deflate-raw",Kt="gzip",Tt=[31,139,8];class _t extends h{constructor(t,{chunkSize:n,CompressionStreamFallback:e,CompressionStream:o}){super({});const{compressed:r,encrypted:c,useCompressionStream:s,zipCrypto:a,computeCrc32:i,level:f,deflate64:w,format:l,compressionMethod:d,inputSize:p}=t,h=this;let y,m,S,g=super.readable;const v=l&&Ut(l),b=qt(s,o,e),k=i&&r&&!w&&!v&&(!c||a)&&Boolean(b);if(c&&!a||!i||k||(y=new U,g=Jt(g,y)),r)if(v)g=Qt(g,Nt(v.CompressionStream,l,{level:f,chunkSize:n,compressionMethod:d,uncompressedSize:p}));else if(k)S=new jt,g=Qt(g,new b(Kt,{level:f,chunkSize:n})),g=Jt(g,S);else try{g=Gt(g,s,{level:f,chunkSize:n},o,e)}catch(t){if(!s&&e)throw nn(t);let n;try{n=new o(Kt)}catch{throw nn(t)}g=Qt(g,n),g=Jt(g,new jt)}c&&(a?g=Jt(g,new Ct(t)):(m=new ht(t),g=Jt(g,m))),Zt(h,g,()=>{c&&!a||!i||(h.crc32=k?S.crc32:new u(y.value.buffer).getUint32(0))})}}class jt extends h{constructor(){let t,n=10,e=new c(0);super({transform(t,r){if(n){const e=o.min(n,t.length);if(n-=e,!(t=t.subarray(e)).length)return}const c=e.length+t.length;if(c<=8)return void(e=B(e,t));const s=c-8,a=o.min(s,e.length);r.enqueue(B(e.subarray(0,a),t.subarray(0,s-a))),e=B(e.subarray(a),t.subarray(s-a))},flush(){const n=W(e);t.crc32=n.getUint32(0,!0),t.uncompressedSize=n.getUint32(4,!0)}}),t=this}}class Ht extends h{constructor(t,{chunkSize:n,DecompressionStreamFallback:e,DecompressionStream:o}){super({});const{zipCrypto:s,encrypted:a,checkCrc32:i,crc32:f,compressed:l,useCompressionStream:d,deflate64:p,format:h,compressionMethod:m,rawBitFlag:S,outputSize:g}=t;let b,k,z,C=super.readable;if(a&&(s?C=Jt(C,new zt(t)):(k=new pt(t),C=Jt(C,k))),l){const t=new Set,s=h&&Ut(h);let a;if(s)C=Qt(C,Nt(s.DecompressionStream,h,{chunkSize:n,compressionMethod:m,rawBitFlag:S,uncompressedSize:g}),t);else{const r=qt(d,o,e);if(i&&!p&&f!==v&&g!==v&&r)try{a=new r(Kt,{chunkSize:n})}catch{a=v}if(!a)try{C=Gt(C,d,{chunkSize:n,deflate64:p},o,e,t)}catch(t){if(p||g===v||!d&&e)throw nn(t);try{a=new o(Kt)}catch{throw nn(t)}}}a?(z=!0,C=function(t,n,e,o,s){const a=n.writable.getWriter(),i=n.readable.getReader(),f=o===v?new F:v;let u,l,d=0,p=!1,h=!1;const m=new y({start(t){l=t},pull(){b()},cancel:t=>(h=!0,b(),i.cancel(t))});return async function(){const n=t.getReader();try{const t=new c(10);for(t.set(Tt),await a.write(t);;){await g(),await a.ready;const{value:t,done:e}=await $t(n,s);if(e)break;await a.write(t)}f&&await a.write(new c(0));const r=new c(8),i=W(r);i.setUint32(0,f?f.get():o,!0),i.setUint32(4,e,!0),p=!0,await a.write(r),await a.close()}catch(t){await Xt(a,t),await Yt(n,t)}}(),async function(){try{for(;;){const{value:t,done:n}=await S();if(n)break;if(d+=t.length,d>e)throw new r(Bt);f&&f.append(t),l.enqueue(t)}h||(h=!0,l.close())}catch(t){!function(t){h||(h=!0,l.error(t),b())}(t),await Yt(i,t)}}(),m;function S(){return i.read().catch(t=>{if(p){if(!f)throw on(t,Ot);if(d!=e)throw on(t,Bt);return{done:!0}}throw tn(t,s)})}function g(){if(!h&&l.desiredSize<=0)return new w(t=>u=t)}function b(){if(u){const t=u;u=v,t()}}}(C,a,g,f,t)):C=function(t,n){const e=t.getReader();return new y({async pull(t){try{const{value:n,done:o}=await e.read();o?t.close():t.enqueue(n)}catch(t){throw await Yt(e,t),tn(t,n)}},cancel:t=>e.cancel(t)})}(C,t)}i&&!z&&(b=new U,C=Jt(C,b)),Zt(this,C,()=>{if(b){const t=new u(b.value.buffer).getUint32(0,!1);if(f!=t)throw new r(Ot)}})}}const Lt=new f;function Zt(t,e,o){e=Jt(e,new h({flush:o})),n.defineProperty(t,"readable",{get:()=>e})}function Nt(t,n,e){if(!t)throw new r("Compression method not supported");return new t(n,e)}function qt(t,n,e){return t&&n?n:e&&e.requiresModule?e:void 0}function Gt(t,n,e,o,r,c){const s=n&&o?o:r||o,a=e.deflate64?"deflate64-raw":Vt;let i;try{i=new s(a,e)}catch(t){if(!n||!r||s==r)throw t;i=new r(a,e)}return Qt(t,i,c)}function Jt(t,n){return function(t){if(t instanceof y)return t;const n=t.getReader();return new y({async pull(t){try{const{value:e,done:o}=await n.read();o?t.close():t.enqueue(e)}catch(t){throw n.cancel(t).catch(()=>{}),t}},cancel:t=>n.cancel(t)})}(t).pipeThrough(n)}function Qt(t,n,e){const o=n.writable.getWriter(),r=t.getReader();return async function(){try{for(;;){await o.ready;const t=await $t(r,e);if(t.done){await o.close();break}await o.write(t.value)}}catch(t){await Xt(o,t),await Yt(r,t)}}(),n.readable}async function Xt(t,n){try{await t.abort(n)}catch{}}async function Yt(t,n){try{await t.cancel(n)}catch{}}function $t(t,n){const e=t.read();return n?e.catch(t=>{throw n.add(t),t}):e}function tn(t,n){return n.has(t)?t:on(t,en(t)?Wt:"Invalid compressed data")}function nn(t){return en(t)?on(t,Wt):t}function en(t){return Dt(t)&&"Z_MEM_ERROR"==t.code}function on(t,n){const e=new r(n);return e.cause=t,e}const rn="data",cn="deflate";class sn extends h{constructor(t,e){super({});const o=this,{codecType:c}=t;let s;c.startsWith(cn)?s=_t:c.startsWith("inflate")&&(s=Ht),o.outputSize=0;let a=0;const i=new s(t,e),f=super.readable,u=new h({transform(t,n){t&&t.length&&(a+=t.length,n.enqueue(t))},flush(){n.assign(o,{inputSize:a})}}),w=new h({transform(n,e){if(n&&n.length&&(e.enqueue(n),o.outputSize+=n.length,t.outputSize!==v&&o.outputSize>t.outputSize))throw new r(Bt)},flush(){const{crc32:t}=i;n.assign(o,{crc32:t,inputSize:a})}});n.defineProperty(o,"readable",{get:()=>f.pipeThrough(u).pipeThrough(i).pipeThrough(w)})}}class an extends h{constructor(t){const o=[];let r=0,s=0;function a(){const n=new c(t);let e=0;for(;e<t;){const r=o[0],c=t-e;r.length<=c?(n.set(r,e),e+=r.length,o.shift()):(n.set(r.subarray(0,c),e),o[0]=r.subarray(c),e+=c)}return r-=t,n}(!e.isFinite(t)||t<1)&&(t=262144),super({transform(n,e){for(o.push(n),r+=n.length;r>t;)s+=t,e.enqueue(a())},flush(t){r&&(s+=r,t.enqueue(function(t,n){const e=new c(n);let o=0;for(const n of t)e.set(n,o),o+=n.length;return e}(o,r)))}}),n.defineProperty(this,"outputSize",{get:()=>s})}}let fn=2;try{typeof navigator!=b&&navigator.hardwareConcurrency&&(fn=navigator.hardwareConcurrency)}catch{}const un=new f,wn=new f,ln=function(){try{return structuredClone(new r)instanceof r}catch{return!1}}();let dn=0;async function pn(t){let n,c,s;try{const{options:a,config:i}=t;if(a.format)try{await async function(t,n){!Ft.has(t)&&n&&function(t,n){const{CompressionStream:e,DecompressionStream:o}=n;if(typeof e!=k&&typeof o!=k)throw new r("Invalid codec module");Ft.set(t,{CompressionStream:e,DecompressionStream:o})}(t,await(import(n)))}(a.format,a.codecURI)}catch(t){if(Dt(t))try{t.codecImportFailed=!0}catch{}throw t}if(i.CompressionStream=self.CompressionStream,i.DecompressionStream=self.DecompressionStream,a.compressed&&!a.format)if(a.useCompressionStream){if(!function(t,n){if(!t)return!1;let e=Lt.get(t);e||(e=new f,Lt.set(t,e));let o=e.get(n);if(o===v){try{new t(n),o=!0}catch{o=!1}e.set(n,o)}return o}(a.codecType.startsWith(cn)?i.CompressionStream:i.DecompressionStream,Vt))try{await self.initModule(t.config)}catch{}}else try{await self.initModule(t.config)}catch{a.useCompressionStream=!0}if(a.encrypted&&!a.zipCrypto)try{await self.initModule(t.config)}catch{}!i.CompressionStreamFallback&&i.CompressionStreamZlib&&(i.CompressionStreamFallback=i.CompressionStreamZlib),!i.DecompressionStreamFallback&&i.DecompressionStreamZlib&&(i.DecompressionStreamFallback=i.DecompressionStreamZlib);const u={highWaterMark:1},l=new y({async pull(t){const n=new w(t=>un.set(dn,t));hn({type:"pull",messageId:dn}),dn=(dn+1)%e.MAX_SAFE_INTEGER;const{value:o,done:r}=await n;t.enqueue(o),r&&t.close()}},u);s=new m({async write(t){let n;const o=new w(t=>n=t);wn.set(dn,n),hn({type:rn,value:t,messageId:dn}),dn=(dn+1)%e.MAX_SAFE_INTEGER,await o}},u),n=new sn(a,i),c=new an(function(t){return r="string"==typeof(n=r=t.chunkSize)&&n.trim()?e(n):n,e.isInteger(r)&&r>=1?o.max(r,64):262144;var n,r}(i)),await l.pipeThrough(n).pipeThrough(c).pipeTo(s,{preventClose:!0,preventAbort:!0}),await s.getWriter().close();const{crc32:d,inputSize:p,outputSize:h}=n;hn({type:"close",result:{crc32:d,inputSize:p,outputSize:h}})}catch(t){const n=c?c.outputSize:0;if(Dt(t))try{t.outputSize=n}catch{}if(s&&!s.locked)try{await s.getWriter().close()}catch{}yn(t,n)}}function hn(t){const{value:n}=t;if(n)if(n.length)try{t.value=(e=n,e.byteOffset||e.byteLength!=e.buffer.byteLength?new c(e):e).buffer,p(t,[t.value])}catch{p(t)}else p(t);else p(t);var e}function yn(t,n){const{message:e,stack:o,code:c,name:s,outputSize:a,cause:i,codecImportFailed:f}=function(t=new r("Unknown error")){return Dt(t)?t:new r(String(t))}(t),u={message:e,stack:o,code:c,name:s,outputSize:a===v?n:a};if(Dt(i)&&(u.cause={name:i.name,message:i.message,code:i.code}),f&&(u.codecImportFailed=!0),ln)try{return void p({error:u,errorValue:{value:t}})}catch{}p({error:u})}addEventListener("message",({data:t})=>{const{type:n,messageId:e,value:o,done:r}=t;try{if("start"==n&&pn(t),n==rn){const t=un.get(e);un.delete(e),t({value:o||new c,done:r})}if("ack"==n){const t=wn.get(e);wn.delete(e),t()}}catch(t){yn(t)}}),p({type:"ready"});const mn="deflate",Sn="deflate-raw",gn="deflate64-raw",vn="gzip",bn=[mn,Sn,vn],kn=[mn,Sn,vn,gn];let zn,Cn,In,Mn,An;function En(t,n){return-4===n&&(t.code="Z_MEM_ERROR"),t}function Rn(t,n,e={}){if(!(t?bn:kn).includes(n))throw new TypeError("Unsupported format: "+n);if(!zn){const t=new r("WASM module not loaded");throw t.cause=An,t}const s="number"==typeof e.level?e.level:-1,a="number"==typeof e.outBuffer?e.outBuffer:65536,i="number"==typeof e.inBufferSize?e.inBufferSize:65536,f={M:0,in:0,inBufferSize:0,A:0,R:!1};let u,l,d,p,h=!0,S=!1;return function(){try{let e;if(f.M=Cn(a),f.in=Cn(i),f.inBufferSize=i,!f.M||!f.in)throw En(new r("allocation failed"),-4);if(t?(f.P=zn.deflate_process,f.D=zn.deflate_last_consumed,f.F=zn.deflate_end,f.A=zn.deflate_new(),e=n===vn?zn.deflate_init_gzip(f.A,s):n===Sn?zn.deflate_init_raw(f.A,s):zn.deflate_init(f.A,s)):n===gn?(f.P=zn.inflate9_process,f.D=zn.inflate9_last_consumed,f.F=zn.inflate9_end,f.A=zn.inflate9_new(),e=zn.inflate9_init_raw(f.A)):(f.P=zn.inflate_process,f.D=zn.inflate_last_consumed,f.F=zn.inflate_end,f.A=zn.inflate_new(),e=n===Sn?zn.inflate_init_raw(f.A):n===vn?zn.inflate_init_gzip(f.A):zn.inflate_init(f.A)),0!==e)throw En(new r("init failed:"+e),e)}catch(t){throw b(f),t}}(),{readable:new y({start(t){u=t},pull(){h=!1,v()},cancel(t){S=!0,p=t,b(f),l.error(t),v()}},{highWaterMark:0}),writable:new m({start(t){l=t},async write(t){if(h&&await new w(t=>d=t),S)throw p;try{!function(t){const n=new c(Mn.buffer),e=f.P,s=f.D,i=f.M;let u=0;for(;u<t.length;){if(f.R)throw new r("trailing data after the end of the stream");const c=o.min(t.length-u,32768);if((!f.in||f.inBufferSize<c)&&(f.in&&In&&(In(f.in),f.in=0),f.in=Cn(c),f.inBufferSize=c,!f.in))throw En(new r("allocation failed"),-4);n.set(t.subarray(u,u+c),f.in);const w=e(f.A,f.in,c,i,a,0),l=w>>24&255,d=128&l?l-256:l;if(d<0)throw En(new r("process error:"+d),d);const p=16777215&w;p&&g(n.slice(i,i+p));const h=s(f.A);if(1===l)f.R=!0;else if(0===h&&0===p)break;u+=h}}(t)}catch(t){throw b(f),u.error(t),t}},close(){if(S)return;try{!function(){const t=new c(Mn.buffer),n=f.P,e=f.M;for(;;){const o=n(f.A,0,0,e,a,4),c=o>>24&255,s=128&c?c-256:c;if(s<0)throw En(new r("process error:"+s),s);const i=16777215&o;if(i&&g(t.slice(e,e+i)),1===c||0===i)break}}()}catch(t){throw b(f),u.error(t),t}const t=b(f);if(0!==t){const n=En(new r("end error:"+t),t);throw u.error(n),n}u.close()},abort(t){b(f),u.error(t)}},{highWaterMark:1})};function g(t){h=!0,u.enqueue(t)}function v(){if(d){const t=d;d=null,t()}}function b(t){let n=0;return t.A&&t.F&&(n=t.F(t.A)),t.A=0,t.in&&In&&In(t.in),t.in=0,t.M&&In&&In(t.M),t.M=0,n}}class xn{constructor(t=mn,n){return Rn(!0,t,n)}}class Pn{constructor(t=mn,n){return Rn(!1,t,n)}}xn.requiresModule=!0,Pn.requiresModule=!0,xn.supportedFormats=bn,Pn.supportedFormats=kn;const Dn=65536;let Fn,Un;function Bn(t){return new c(t.memory.buffer)}let Wn=!1;!function(t={}){const{init:n,U:e}=t,o=t.CompressionStreamFallback||t.CompressionStreamZlib,r=t.DecompressionStreamFallback||t.DecompressionStreamZlib;e&&(dt=e||G),self.initModule=async t=>{n&&await n(t),o&&(t.CompressionStreamFallback=o),r&&(t.DecompressionStreamFallback=r)}}({CompressionStreamFallback:xn,DecompressionStreamFallback:Pn,U:function(t,n){const e=Fn;let o=e?function(t,n,e){Un||(Un=t.malloc(Dn));const o=Un?t.aes_hmac_new():0;if(o){const r=Bn(t);if(r.set(n,Un),r.set(e,Un+n.length),t.aes_hmac_init(o,Un,n.length,Un+n.length,e.length))return t.aes_hmac_end(o,0),0}return o}(e,t,n):0;if(!o)return G(t,n);const r=Un;return{process(t,n){for(let c=0;c<t.length;c+=Dn){const s=t.subarray(c,c+Dn),a=Bn(e);a.set(s,r),e.aes_hmac_process(o,r,s.length,n?1:0),s.set(a.subarray(r,r+s.length))}},digest:()=>(e.aes_hmac_end(o,r),o=0,Bn(e).slice(r,r+20)),dispose(){o&&(e.aes_hmac_end(o,0),o=0)}}},init:t=>async function(t,{baseURI:n}){if(!Wn)try{await async function(t,n){let e,o;try{try{o=new URL(t,n)}catch{}const r=await fetch(o);e=await r.arrayBuffer()}catch(n){if(!t.startsWith("data:application/wasm;base64,"))throw n;e=function(t){const n=t.split(",")[1],e=atob(n),o=e.length,r=new c(o);for(let t=0;t<o;++t)r[t]=e.charCodeAt(t);return r.buffer}(t)}const s=await WebAssembly.instantiate(e);var a;(function(t){if(zn=t,({malloc:Cn,free:In,memory:Mn}=zn),"function"!=typeof Cn||"function"!=typeof In||!Mn)throw zn=Cn=In=Mn=null,new r("Invalid WASM module")})(s.instance.exports),typeof(a=s.instance.exports).aes_hmac_new==k&&(Fn=a,Un=0)}(t,n),Wn=!0}catch(t){throw function(t){An=t}(t),t}}(t.wasmURI,t)})});\n';
|
|
37935
|
-
if ("string" == typeof
|
|
37936
|
-
const t5 = new Blob([
|
|
37689
|
+
let s4 = '!function(t){"function"==typeof define&&define.amd?define(t):t()}(function(){"use strict";const{Array:t,Object:n,Number:e,Math:o,Error:s,Uint8Array:r,Uint16Array:c,Uint32Array:i,Int32Array:a,Map:f,DataView:u,Promise:w,TextEncoder:l,crypto:h,postMessage:p,TransformStream:d,ReadableStream:y,WritableStream:m,CompressionStream:S,DecompressionStream:g}=self,v=void 0,k="undefined",z="function",b=new r,C=[[],[],[],[],[],[],[],[]];for(let t=0;t<256;t++){let n=t;for(let t=0;t<8;t++)n=1&n?n>>>1^3988292384:n>>>1;C[0][t]=n}for(let t=0;t<256;t++)for(let n=1;n<8;n++){const e=C[n-1][t];C[n][t]=e>>>8^C[0][255&e]}const[I,A,M,x,P,D,F,E]=C;class R{constructor(t){this.o=t||-1}append(t){let n=0|this.o;const e=0|t.length;let o=0;if(e>=8&&t.buffer){const s=new u(t.buffer,t.byteOffset,e),r=e-8;for(;o<=r;o+=8){const t=n^s.getInt32(o,!0),e=s.getInt32(o+4,!0);n=E[255&t]^F[t>>>8&255]^D[t>>>16&255]^P[t>>>24&255]^x[255&e]^M[e>>>8&255]^A[e>>>16&255]^I[e>>>24&255]}}for(;o<e;o++)n=n>>>8^I[255&(n^t[o])];this.o=n}get(){return~this.o}}class U extends d{constructor(){let t;const n=new R;super({transform(t,e){n.append(t),e.enqueue(t)},flush(){const e=new r(4);new u(e.buffer).setUint32(0,n.get()),t.value=e}}),t=this}}function B(t,n){const e=new r(t.length+n.length);return e.set(t),e.set(n,t.length),e}function V(t){return new u(t.buffer,t.byteOffset,t.byteLength)}const W=64,j=20,K=new r([128]),O=new r(1),T=new a([1732584193,4023233417,2562383102,271733878,3285377520]),H=new r(256),L=new a(256),N=new a(256),q=new a(256),G=new a(256);let J=!1;function Q(t,n){!function(){if(!J){let t=1,n=1;do{t=255&(t^t<<1^(128&t?27:0)),n=255&(n^n<<1),n=255&(n^n<<2),n=255&(n^n<<4),128&n&&(n^=9),H[t]=255&(n^(n<<1|n>>7)^(n<<2|n>>6)^(n<<3|n>>5)^(n<<4|n>>4)^99)}while(1!=t);H[0]=99;for(let t=0;t<256;t++){const n=H[t],e=$(n),o=e<<24|n<<16|n<<8|e^n;L[t]=o,N[t]=o>>>8|o<<24,q[t]=o>>>16|o<<16,G[t]=o>>>24|o<<8}J=!0}}();const e=new a(60),o=function(t,n){const e=t.length>>2,o=e+6,s=4*(o+1);let r=1;for(let o=0;o<e;o++)n[o]=t[4*o]<<24|t[4*o+1]<<16|t[4*o+2]<<8|t[4*o+3];for(let t=e;t<s;t++){let o=n[t-1];t%e==0?(o=Y(o<<8|o>>>24)^r<<24,r=$(r)):e>6&&t%e==4&&(o=Y(o)),n[t]=n[t-e]^o}return o}(t,e),s=new a(4),r=X(n);let c=0,i=0,f=0,w=0;return{process(t,n){n&&r.update(t,0,t.length),function(t){const n=new u(t.buffer,t.byteOffset,t.byteLength),e=t.length;let o=0;for(;o+16<=e;o+=16)l(),n.setInt32(o,n.getInt32(o)^s[0]),n.setInt32(o+4,n.getInt32(o+4)^s[1]),n.setInt32(o+8,n.getInt32(o+8)^s[2]),n.setInt32(o+12,n.getInt32(o+12)^s[3]);if(o<e){l();for(let n=0;o<e;o++,n++)t[o]^=s[n>>2]>>>24-8*(3&n)}}(t),n||r.update(t,0,t.length)},digest:()=>r.digest()};function l(){c=c+1|0,c||(i=i+1|0,i||(f=f+1|0,f||(w=w+1|0)));let t=Z(c)^e[0],n=Z(i)^e[1],r=Z(f)^e[2],a=Z(w)^e[3],u=L[t>>>24]^N[n>>>16&255]^q[r>>>8&255]^G[255&a]^e[4],l=L[n>>>24]^N[r>>>16&255]^q[a>>>8&255]^G[255&t]^e[5],h=L[r>>>24]^N[a>>>16&255]^q[t>>>8&255]^G[255&n]^e[6],p=L[a>>>24]^N[t>>>16&255]^q[n>>>8&255]^G[255&r]^e[7];t=L[u>>>24]^N[l>>>16&255]^q[h>>>8&255]^G[255&p]^e[8],n=L[l>>>24]^N[h>>>16&255]^q[p>>>8&255]^G[255&u]^e[9],r=L[h>>>24]^N[p>>>16&255]^q[u>>>8&255]^G[255&l]^e[10],a=L[p>>>24]^N[u>>>16&255]^q[l>>>8&255]^G[255&h]^e[11],u=L[t>>>24]^N[n>>>16&255]^q[r>>>8&255]^G[255&a]^e[12],l=L[n>>>24]^N[r>>>16&255]^q[a>>>8&255]^G[255&t]^e[13],h=L[r>>>24]^N[a>>>16&255]^q[t>>>8&255]^G[255&n]^e[14],p=L[a>>>24]^N[t>>>16&255]^q[n>>>8&255]^G[255&r]^e[15],t=L[u>>>24]^N[l>>>16&255]^q[h>>>8&255]^G[255&p]^e[16],n=L[l>>>24]^N[h>>>16&255]^q[p>>>8&255]^G[255&u]^e[17],r=L[h>>>24]^N[p>>>16&255]^q[u>>>8&255]^G[255&l]^e[18],a=L[p>>>24]^N[u>>>16&255]^q[l>>>8&255]^G[255&h]^e[19],u=L[t>>>24]^N[n>>>16&255]^q[r>>>8&255]^G[255&a]^e[20],l=L[n>>>24]^N[r>>>16&255]^q[a>>>8&255]^G[255&t]^e[21],h=L[r>>>24]^N[a>>>16&255]^q[t>>>8&255]^G[255&n]^e[22],p=L[a>>>24]^N[t>>>16&255]^q[n>>>8&255]^G[255&r]^e[23],t=L[u>>>24]^N[l>>>16&255]^q[h>>>8&255]^G[255&p]^e[24],n=L[l>>>24]^N[h>>>16&255]^q[p>>>8&255]^G[255&u]^e[25],r=L[h>>>24]^N[p>>>16&255]^q[u>>>8&255]^G[255&l]^e[26],a=L[p>>>24]^N[u>>>16&255]^q[l>>>8&255]^G[255&h]^e[27],u=L[t>>>24]^N[n>>>16&255]^q[r>>>8&255]^G[255&a]^e[28],l=L[n>>>24]^N[r>>>16&255]^q[a>>>8&255]^G[255&t]^e[29],h=L[r>>>24]^N[a>>>16&255]^q[t>>>8&255]^G[255&n]^e[30],p=L[a>>>24]^N[t>>>16&255]^q[n>>>8&255]^G[255&r]^e[31],t=L[u>>>24]^N[l>>>16&255]^q[h>>>8&255]^G[255&p]^e[32],n=L[l>>>24]^N[h>>>16&255]^q[p>>>8&255]^G[255&u]^e[33],r=L[h>>>24]^N[p>>>16&255]^q[u>>>8&255]^G[255&l]^e[34],a=L[p>>>24]^N[u>>>16&255]^q[l>>>8&255]^G[255&h]^e[35],u=L[t>>>24]^N[n>>>16&255]^q[r>>>8&255]^G[255&a]^e[36],l=L[n>>>24]^N[r>>>16&255]^q[a>>>8&255]^G[255&t]^e[37],h=L[r>>>24]^N[a>>>16&255]^q[t>>>8&255]^G[255&n]^e[38],p=L[a>>>24]^N[t>>>16&255]^q[n>>>8&255]^G[255&r]^e[39];let d=40;o>10&&(t=L[u>>>24]^N[l>>>16&255]^q[h>>>8&255]^G[255&p]^e[40],n=L[l>>>24]^N[h>>>16&255]^q[p>>>8&255]^G[255&u]^e[41],r=L[h>>>24]^N[p>>>16&255]^q[u>>>8&255]^G[255&l]^e[42],a=L[p>>>24]^N[u>>>16&255]^q[l>>>8&255]^G[255&h]^e[43],u=L[t>>>24]^N[n>>>16&255]^q[r>>>8&255]^G[255&a]^e[44],l=L[n>>>24]^N[r>>>16&255]^q[a>>>8&255]^G[255&t]^e[45],h=L[r>>>24]^N[a>>>16&255]^q[t>>>8&255]^G[255&n]^e[46],p=L[a>>>24]^N[t>>>16&255]^q[n>>>8&255]^G[255&r]^e[47],d=48),o>12&&(t=L[u>>>24]^N[l>>>16&255]^q[h>>>8&255]^G[255&p]^e[48],n=L[l>>>24]^N[h>>>16&255]^q[p>>>8&255]^G[255&u]^e[49],r=L[h>>>24]^N[p>>>16&255]^q[u>>>8&255]^G[255&l]^e[50],a=L[p>>>24]^N[u>>>16&255]^q[l>>>8&255]^G[255&h]^e[51],u=L[t>>>24]^N[n>>>16&255]^q[r>>>8&255]^G[255&a]^e[52],l=L[n>>>24]^N[r>>>16&255]^q[a>>>8&255]^G[255&t]^e[53],h=L[r>>>24]^N[a>>>16&255]^q[t>>>8&255]^G[255&n]^e[54],p=L[a>>>24]^N[t>>>16&255]^q[n>>>8&255]^G[255&r]^e[55],d=56),s[0]=(H[u>>>24]<<24|H[l>>>16&255]<<16|H[h>>>8&255]<<8|H[255&p])^e[d],s[1]=(H[l>>>24]<<24|H[h>>>16&255]<<16|H[p>>>8&255]<<8|H[255&u])^e[d+1],s[2]=(H[h>>>24]<<24|H[p>>>16&255]<<16|H[u>>>8&255]<<8|H[255&l])^e[d+2],s[3]=(H[p>>>24]<<24|H[u>>>16&255]<<16|H[l>>>8&255]<<8|H[255&h])^e[d+3]}}function X(t){const n=function(){const t=new a(T),n=new a(16),e=new r(W),s=new u(e.buffer),c=new r(8);let i=0,f=0;return{update:w,digest:function(){const n=8*f,e=o.floor(n/4294967296),s=n>>>0;for(w(K,0,1);56!=i;)w(O,0,1);c[0]=e>>>24,c[1]=e>>>16,c[2]=e>>>8,c[3]=e,c[4]=s>>>24,c[5]=s>>>16,c[6]=s>>>8,c[7]=s,w(c,0,8);const a=new r(j),l=new u(a.buffer);for(let n=0;n<t.length;n++)l.setInt32(4*n,t[n]);return t.set(T),i=0,f=0,a}};function w(t,n,o){const r=n+o;if(f+=o,i){for(;n<r&&i<W;)e[i++]=t[n++];i==W&&(l(s,0),i=0)}if(n+W<=r){const e=new u(t.buffer,t.byteOffset,t.byteLength);for(;n+W<=r;n+=W)l(e,n)}for(;n<r;)e[i++]=t[n++]}function l(e,o){for(let t=0;t<16;t++)n[t]=e.getInt32(o+4*t);let s,r=t[0],c=t[1],i=t[2],a=t[3],f=t[4];for(let t=0;t<15;t+=5)f=(r<<5|r>>>27)+((i^a)&c^a)+f+1518500249+n[t]|0,c=c<<30|c>>>2,a=(f<<5|f>>>27)+((c^i)&r^i)+a+1518500249+n[t+1]|0,r=r<<30|r>>>2,i=(a<<5|a>>>27)+((r^c)&f^c)+i+1518500249+n[t+2]|0,f=f<<30|f>>>2,c=(i<<5|i>>>27)+((f^r)&a^r)+c+1518500249+n[t+3]|0,a=a<<30|a>>>2,r=(c<<5|c>>>27)+((a^f)&i^f)+r+1518500249+n[t+4]|0,i=i<<30|i>>>2;f=(r<<5|r>>>27)+((i^a)&c^a)+f+1518500249+n[15]|0,c=c<<30|c>>>2,s=n[13]^n[8]^n[2]^n[0],s=s<<1|s>>>31,n[0]=s,a=(f<<5|f>>>27)+((c^i)&r^i)+a+1518500249+s|0,r=r<<30|r>>>2,s=n[14]^n[9]^n[3]^n[1],s=s<<1|s>>>31,n[1]=s,i=(a<<5|a>>>27)+((r^c)&f^c)+i+1518500249+s|0,f=f<<30|f>>>2,s=n[15]^n[10]^n[4]^n[2],s=s<<1|s>>>31,n[2]=s,c=(i<<5|i>>>27)+((f^r)&a^r)+c+1518500249+s|0,a=a<<30|a>>>2,s=n[0]^n[11]^n[5]^n[3],s=s<<1|s>>>31,n[3]=s,r=(c<<5|c>>>27)+((a^f)&i^f)+r+1518500249+s|0,i=i<<30|i>>>2;for(let t=20;t<40;t+=5)s=n[t-3&15]^n[t-8&15]^n[t-14&15]^n[15&t],s=s<<1|s>>>31,n[15&t]=s,f=(r<<5|r>>>27)+(c^i^a)+f+1859775393+s|0,c=c<<30|c>>>2,s=n[t-2&15]^n[t-7&15]^n[t-13&15]^n[t+1&15],s=s<<1|s>>>31,n[t+1&15]=s,a=(f<<5|f>>>27)+(r^c^i)+a+1859775393+s|0,r=r<<30|r>>>2,s=n[t-1&15]^n[t-6&15]^n[t-12&15]^n[t+2&15],s=s<<1|s>>>31,n[t+2&15]=s,i=(a<<5|a>>>27)+(f^r^c)+i+1859775393+s|0,f=f<<30|f>>>2,s=n[15&t]^n[t-5&15]^n[t-11&15]^n[t+3&15],s=s<<1|s>>>31,n[t+3&15]=s,c=(i<<5|i>>>27)+(a^f^r)+c+1859775393+s|0,a=a<<30|a>>>2,s=n[t+1&15]^n[t-4&15]^n[t-10&15]^n[t+4&15],s=s<<1|s>>>31,n[t+4&15]=s,r=(c<<5|c>>>27)+(i^a^f)+r+1859775393+s|0,i=i<<30|i>>>2;for(let t=40;t<60;t+=5)s=n[t-3&15]^n[t-8&15]^n[t-14&15]^n[15&t],s=s<<1|s>>>31,n[15&t]=s,f=(r<<5|r>>>27)+(c&i|(c|i)&a)+f+2400959708+s|0,c=c<<30|c>>>2,s=n[t-2&15]^n[t-7&15]^n[t-13&15]^n[t+1&15],s=s<<1|s>>>31,n[t+1&15]=s,a=(f<<5|f>>>27)+(r&c|(r|c)&i)+a+2400959708+s|0,r=r<<30|r>>>2,s=n[t-1&15]^n[t-6&15]^n[t-12&15]^n[t+2&15],s=s<<1|s>>>31,n[t+2&15]=s,i=(a<<5|a>>>27)+(f&r|(f|r)&c)+i+2400959708+s|0,f=f<<30|f>>>2,s=n[15&t]^n[t-5&15]^n[t-11&15]^n[t+3&15],s=s<<1|s>>>31,n[t+3&15]=s,c=(i<<5|i>>>27)+(a&f|(a|f)&r)+c+2400959708+s|0,a=a<<30|a>>>2,s=n[t+1&15]^n[t-4&15]^n[t-10&15]^n[t+4&15],s=s<<1|s>>>31,n[t+4&15]=s,r=(c<<5|c>>>27)+(i&a|(i|a)&f)+r+2400959708+s|0,i=i<<30|i>>>2;for(let t=60;t<80;t+=5)s=n[t-3&15]^n[t-8&15]^n[t-14&15]^n[15&t],s=s<<1|s>>>31,n[15&t]=s,f=(r<<5|r>>>27)+(c^i^a)+f+3395469782+s|0,c=c<<30|c>>>2,s=n[t-2&15]^n[t-7&15]^n[t-13&15]^n[t+1&15],s=s<<1|s>>>31,n[t+1&15]=s,a=(f<<5|f>>>27)+(r^c^i)+a+3395469782+s|0,r=r<<30|r>>>2,s=n[t-1&15]^n[t-6&15]^n[t-12&15]^n[t+2&15],s=s<<1|s>>>31,n[t+2&15]=s,i=(a<<5|a>>>27)+(f^r^c)+i+3395469782+s|0,f=f<<30|f>>>2,s=n[15&t]^n[t-5&15]^n[t-11&15]^n[t+3&15],s=s<<1|s>>>31,n[t+3&15]=s,c=(i<<5|i>>>27)+(a^f^r)+c+3395469782+s|0,a=a<<30|a>>>2,s=n[t+1&15]^n[t-4&15]^n[t-10&15]^n[t+4&15],s=s<<1|s>>>31,n[t+4&15]=s,r=(c<<5|c>>>27)+(i^a^f)+r+3395469782+s|0,i=i<<30|i>>>2;t[0]=t[0]+r|0,t[1]=t[1]+c|0,t[2]=t[2]+i|0,t[3]=t[3]+a|0,t[4]=t[4]+f|0}}(),e=new r(W),s=new r(W);t.length>W&&(n.update(t,0,t.length),t=n.digest());for(let n=0;n<W;n++){const o=n<t.length?t[n]:0;e[n]=54^o,s[n]=92^o}return n.update(e,0,W),{update(t,e,o){n.update(t,e,o)},digest(){const t=n.digest();n.update(s,0,W),n.update(t,0,j);const o=n.digest();return n.update(e,0,W),o}}}function Y(t){return H[t>>>24]<<24|H[t>>>16&255]<<16|H[t>>>8&255]<<8|H[255&t]}function Z(t){return t<<24|(65280&t)<<8|t>>>8&65280|t>>>24}function $(t){return 255&(t<<1^27*(t>>7))}const _=typeof h!=k&&typeof h.getRandomValues==z,tt="Invalid password",nt="zipjs-abort-check-password";function et(t){if(_)return h.getRandomValues(t);throw new s("Crypto API not supported")}const ot={name:"PBKDF2"},st=n.assign({hash:{name:"HMAC"}},ot),rt=n.assign({iterations:1e3,hash:{name:"SHA-1"}},ot),ct=["deriveBits"],it=[8,12,16],at=[16,24,32],ft=10,ut=typeof h!=k,wt=ut&&h.subtle;let lt=ut&&typeof wt!=k&&typeof wt.importKey==z&&typeof wt.deriveBits==z,ht=Q;class pt extends d{constructor({password:t,rawPassword:n,encryptionStrength:e,checkPasswordOnly:o,checkAuthenticationCode:c=!0}){super({start(){yt(this,t,n,e)},async transform(t,n){const e=this,{password:c,strength:i,l:a,ready:f}=e;c?(await async function(t,n,e,o){const r=await gt(t,n,e,kt(o,0,it[n])),c=kt(o,it[n]);if(r[0]!=c[0]||r[1]!=c[1])throw St(t),new s(tt)}(e,i,c,kt(t,0,it[i]+2)),t=kt(t,it[i]+2),o?(St(e),n.error(new s(nt))):a()):await f;const u=new r(t.length-ft-(t.length-ft)%16);n.enqueue(mt(e,t,u,0,ft,!0))},async flush(t){const{h:n,m:e,ready:o}=this;if(n){await o;const i=kt(e,e.length-ft),a=new r(kt(e,0,e.length-ft));n.process(a,!0);const f=n.digest();let u=e.length<ft?1:0;for(let t=0;t<ft;t++)u|=f[t]^i[t];if(u&&c)throw new s("Invalid authentication code");t.enqueue(a)}},cancel(){St(this)}})}}class dt extends d{constructor({password:t,rawPassword:n,encryptionStrength:e}){super({start(){yt(this,t,n,e)},async transform(t,n){const e=this,{password:o,strength:s,l:c,ready:i}=e;let a=b;o?(a=await async function(t,n,e){const o=et(new r(it[n]));return B(o,await gt(t,n,e,o))}(e,s,o),c()):await i;const f=new r(a.length+t.length-t.length%16);f.set(a,0),n.enqueue(mt(e,t,f,a.length,0,!1))},async flush(t){const{h:n,m:e,ready:o}=this;if(n){await o;const s=new r(e);n.process(s,!1);const c=kt(n.digest(),0,ft);t.enqueue(B(s,c))}},cancel(){St(this)}})}}function yt(t,e,o,s){n.assign(t,{ready:new w(n=>t.l=n),password:vt(e,o),strength:s-1,m:b})}function mt(t,n,e,o,s,c){const{h:i,m:a}=t;a.length&&(n=B(a,n));const f=n.length-s,u=f-f%16;if(e=function(t,n){if(n&&n>t.length){const e=t;(t=new r(n)).set(e,0)}return t}(e,o+u),u){const t=kt(e,o,o+u);t.set(kt(n,0,u)),i.process(t,c)}return t.m=kt(n,u),e}function St({h:t}){t&&t.dispose&&t.dispose()}async function gt(t,e,s,c){t.password=null;const i=at[e],a=await async function(t,e,s){if(lt)try{const o=await wt.importKey("raw",t,st,!1,ct);return new r(await wt.deriveBits(n.assign({salt:e},rt),o,8*s))}catch{lt=!1}return function(t,n,e,s){const c=X(t),i=new r(s),a=new r(n.length+4),f=new u(a.buffer);a.set(n);for(let t=1,e=0;e<s;t++,e+=j){f.setUint32(n.length,t),c.update(a,0,a.length);let r=c.digest();const u=r.slice();for(let t=1;t<1e3;t++){c.update(r,0,j),r=c.digest();for(let t=0;t<j;t++)u[t]^=r[t]}i.set(u.subarray(0,o.min(j,s-e)),e)}return i}(t,e,0,s)}(s,c,2*i+2);return t.h=ht(kt(a,0,i),kt(a,i,2*i)),kt(a,2*i)}function vt(t,n){return n===v?function(t){if(typeof l==k){t=unescape(encodeURIComponent(t));const n=new r(t.length);for(let e=0;e<n.length;e++)n[e]=t.charCodeAt(e);return n}return(new l).encode(t)}(t):n}function kt(t,n,e){return t.subarray(n,e)}class zt extends d{constructor({password:t,rawPassword:n,passwordVerification:e,checkPasswordOnly:o}){super({start(){Ct(this,t,n,e)},transform(t,n){const e=this;if(e.password||e.rawPassword){const n=It(e,t.subarray(0,12));if(e.password=e.rawPassword=null,0!=(n[11]^e.passwordVerification))throw new s(tt);t=t.subarray(12)}o?n.error(new s(nt)):n.enqueue(It(e,t))}})}}class bt extends d{constructor({password:t,rawPassword:n,passwordVerification:e}){super({start(){Ct(this,t,n,e)},transform(t,n){const e=this;let o,s;if(e.password||e.rawPassword){e.password=e.rawPassword=null;const n=et(new r(12));n[11]=e.passwordVerification,o=new r(t.length+n.length),o.set(At(e,n),0),s=12}else o=new r(t.length),s=0;o.set(At(e,t),s),n.enqueue(o)}})}}function Ct(t,e,o,s){n.assign(t,{password:e,rawPassword:o,passwordVerification:s}),function(t,e,o){const s=[305419896,591751049,878082192];if(n.assign(t,{keys:s,S:new R(s[0]),v:new R(s[2])}),o)for(let n=0;n<o.length;n++)Mt(t,o[n]);else for(let n=0;n<e.length;n++)Mt(t,e.charCodeAt(n))}(t,e,o)}function It(t,n){const e=new r(n.length);for(let o=0;o<n.length;o++)e[o]=xt(t)^n[o],Mt(t,e[o]);return e}function At(t,n){const e=new r(n.length);for(let o=0;o<n.length;o++)e[o]=xt(t)^n[o],Mt(t,n[o]);return e}function Mt(t,n){let[,e]=t.keys;t.S.append([n]);const s=~t.S.get();e=Dt(o.imul(Dt(e+Pt(s)),134775813)+1),t.v.append([e>>>24]);const r=~t.v.get();t.keys=[s,e,r]}function xt(t){const n=2|t.keys[2];return Pt(o.imul(n,1^n)>>>8)}function Pt(t){return 255&t}function Dt(t){return 4294967295&t}function Ft(t){if(t instanceof y)return t;const n=t.getReader();return new y({async pull(t){const{value:e,done:o}=await n.read();o?t.close():t.enqueue(e)},cancel:t=>n.cancel(t)})}const Et=new f;function Rt(t){return Et.get(t)}const Ut="Invalid uncompressed size",Bt="Invalid CRC32",Vt="deflate-raw",Wt="gzip",jt=[31,139,8];class Kt extends d{constructor(t,{chunkSize:n,CompressionStreamFallback:e,CompressionStream:o}){super({});const{compressed:s,encrypted:r,useCompressionStream:c,zipCrypto:i,computeCrc32:a,level:f,deflate64:w,format:l,compressionMethod:h,inputSize:p}=t,d=this;let y,m,S,g=super.readable;const v=l&&Rt(l),k=qt(c,o,e),z=a&&s&&!w&&!v&&(!r||i)&&Boolean(k);if(r&&!i||!a||z||(y=new U,g=Jt(g,y)),s)if(v)g=Qt(g,Nt(v.CompressionStream,l,{level:f,chunkSize:n,compressionMethod:h,uncompressedSize:p}));else if(z)S=new Ot,g=Qt(g,new k(Wt,{level:f,chunkSize:n})),g=Jt(g,S);else try{g=Gt(g,c,{level:f,chunkSize:n},o,e)}catch(t){if(!c&&e)throw t;let n;try{n=new o(Wt)}catch{throw t}g=Qt(g,n),g=Jt(g,new Ot)}r&&(i?g=Jt(g,new bt(t)):(m=new dt(t),g=Jt(g,m))),Lt(d,g,()=>{r&&!i||!a||(d.crc32=z?S.crc32:new u(y.value.buffer).getUint32(0))})}}class Ot extends d{constructor(){let t,n=10,e=new r(0);super({transform(t,s){if(n){const e=o.min(n,t.length);if(n-=e,!(t=t.subarray(e)).length)return}const r=e.length+t.length;if(r<=8)return void(e=B(e,t));const c=r-8,i=o.min(c,e.length);s.enqueue(B(e.subarray(0,i),t.subarray(0,c-i))),e=B(e.subarray(i),t.subarray(c-i))},flush(){const n=V(e);t.crc32=n.getUint32(0,!0),t.uncompressedSize=n.getUint32(4,!0)}}),t=this}}class Tt extends d{constructor(t,{chunkSize:n,DecompressionStreamFallback:e,DecompressionStream:o}){super({});const{zipCrypto:c,encrypted:i,checkCrc32:a,crc32:f,compressed:l,useCompressionStream:h,deflate64:p,format:d,compressionMethod:m,rawBitFlag:S,outputSize:g}=t;let k,z,b,C=super.readable;if(i&&(c?C=Jt(C,new zt(t)):(z=new pt(t),C=Jt(C,z))),l){const t=d&&Rt(d);if(t)C=Qt(C,Nt(t.DecompressionStream,d,{chunkSize:n,compressionMethod:m,rawBitFlag:S,uncompressedSize:g}));else{let t;const c=qt(h,o,e);if(a&&!p&&f!==v&&g!==v&&c)try{t=new c(Wt,{chunkSize:n})}catch{t=v}if(!t)try{C=Gt(C,h,{chunkSize:n,deflate64:p},o,e)}catch(n){if(p||g===v||!h&&e)throw n;try{t=new o(Wt)}catch{throw n}}t&&(b=!0,C=function(t,n,e,o){const c=n.writable.getWriter(),i=n.readable.getReader(),a=o===v?new R:v;let f,u,l=0,h=!1,p=!1,d=!1,m=0,S=!1;const g=new w((t,n)=>{f=t,u=n});return g.catch(()=>{}),async function(){const n=t.getReader();try{const t=new r(10);for(t.set(jt),await c.write(t);;){await c.ready;const{value:t,done:e}=await n.read();if(e)break;await c.write(t)}h=!0,a&&(S&&z(),await g);const s=new r(8),i=V(s);i.setUint32(0,a?a.get():o,!0),i.setUint32(4,e,!0),p=!0,await c.write(s),await c.close()}catch(t){await Xt(c,t),await Yt(n,t)}}(),new y({async pull(t){let n;try{n=await function(){m++,S=!0;const t=i.read();return t.then(k,k),h&&a&&z(),t}()}catch(t){throw p?function(t){const n=new s(l==e?Bt:Ut);return n.cause=t,n}(t):t}const{value:o,done:r}=n;if(r)t.close();else{if(l+=o.length,l>e){const t=new s(Ut);throw u(t),await Yt(i,t),t}a&&a.append(o),t.enqueue(o)}},cancel:t=>(u(t),i.cancel(t))});function k(){S=!1}async function z(){if(!d){d=!0;const t=m;await new w(t=>{const{port1:n,port2:e}=new MessageChannel;e.onmessage=()=>{n.close(),e.close(),t()},n.postMessage(v)}),d=!1,S&&(m==t?f():z())}}}(C,t,g,f))}C=function(t){const n=t.getReader();return new y({async pull(t){let e;try{e=await n.read()}catch(t){if(t&&t.message)throw t;const n=new s("Invalid compressed data");throw n.cause=t,n}const{value:o,done:r}=e;r?t.close():t.enqueue(o)},cancel:t=>n.cancel(t)})}(C)}a&&!b&&(k=new U,C=Jt(C,k)),Lt(this,C,()=>{if(k){const t=new u(k.value.buffer).getUint32(0,!1);if(f!=t)throw new s(Bt)}})}}const Ht=new f;function Lt(t,e,o){e=Jt(e,new d({flush:o})),n.defineProperty(t,"readable",{get:()=>e})}function Nt(t,n,e){if(!t)throw new s("Compression method not supported");return new t(n,e)}function qt(t,n,e){return t&&n?n:e&&e.requiresModule?e:void 0}function Gt(t,n,e,o,s){const r=n&&o?o:s||o,c=e.deflate64?"deflate64-raw":Vt;let i;try{i=new r(c,e)}catch(t){if(!n||!s||r==s)throw t;i=new s(c,e)}return Qt(t,i)}function Jt(t,n){return Ft(t).pipeThrough(n)}function Qt(t,n){const e=n.writable.getWriter(),o=t.getReader();return async function(){try{for(;;){await e.ready;const t=await o.read();if(t.done){await e.close();break}await e.write(t.value)}}catch(t){await Xt(e,t),await Yt(o,t)}}(),n.readable}async function Xt(t,n){try{await t.abort(n)}catch{}}async function Yt(t,n){try{await t.cancel(n)}catch{}}const Zt="data",$t="deflate";class _t extends d{constructor(t,e){super({});const o=this,{codecType:r}=t;let c;r.startsWith($t)?c=Kt:r.startsWith("inflate")&&(c=Tt),o.outputSize=0;let i=0;const a=new c(t,e),f=super.readable,u=new d({transform(t,n){t&&t.length&&(i+=t.length,n.enqueue(t))},flush(){n.assign(o,{inputSize:i})}}),w=new d({transform(n,e){if(n&&n.length&&(e.enqueue(n),o.outputSize+=n.length,t.outputSize!==v&&o.outputSize>t.outputSize))throw new s(Ut)},flush(){const{crc32:t}=a;n.assign(o,{crc32:t,inputSize:i})}});n.defineProperty(o,"readable",{get:()=>f.pipeThrough(u).pipeThrough(a).pipeThrough(w)})}}class tn extends d{constructor(t){const o=[];let s=0,c=0;function i(){const n=new r(t);let e=0;for(;e<t;){const s=o[0],r=t-e;s.length<=r?(n.set(s,e),e+=s.length,o.shift()):(n.set(s.subarray(0,r),e),o[0]=s.subarray(r),e+=r)}return s-=t,n}(!e.isFinite(t)||t<1)&&(t=65536),super({transform(n,e){for(o.push(n),s+=n.length;s>t;)c+=t,e.enqueue(i())},flush(t){s&&(c+=s,t.enqueue(function(t,n){const e=new r(n);let o=0;for(const n of t)e.set(n,o),o+=n.length;return e}(o,s)))}}),n.defineProperty(this,"outputSize",{get:()=>c})}}let nn=2;try{typeof navigator!=k&&navigator.hardwareConcurrency&&(nn=navigator.hardwareConcurrency)}catch{}function en(t){return Boolean(t)&&"object"==typeof t}const on=new f,sn=new f,rn=function(){try{return structuredClone(new s)instanceof s}catch{return!1}}();let cn=0;async function an(t){let n,r,c;try{const{options:i,config:a}=t;if(i.format)try{await async function(t,n){!Et.has(t)&&n&&function(t,n){const{CompressionStream:e,DecompressionStream:o}=n;if(typeof e!=z&&typeof o!=z)throw new s("Invalid codec module");Et.set(t,{CompressionStream:e,DecompressionStream:o})}(t,await(import(n)))}(i.format,i.codecURI)}catch(t){if(en(t))try{t.codecImportFailed=!0}catch{}throw t}if(a.CompressionStream=self.CompressionStream,a.DecompressionStream=self.DecompressionStream,i.compressed&&!i.format)if(i.useCompressionStream){if(!function(t,n){if(!t)return!1;let e=Ht.get(t);e||(e=new f,Ht.set(t,e));let o=e.get(n);if(o===v){try{new t(n),o=!0}catch{o=!1}e.set(n,o)}return o}(i.codecType.startsWith($t)?a.CompressionStream:a.DecompressionStream,Vt))try{await self.initModule(t.config)}catch{}}else try{await self.initModule(t.config)}catch{i.useCompressionStream=!0}if(i.encrypted&&!i.zipCrypto)try{await self.initModule(t.config)}catch{}!a.CompressionStreamFallback&&a.CompressionStreamZlib&&(a.CompressionStreamFallback=a.CompressionStreamZlib),!a.DecompressionStreamFallback&&a.DecompressionStreamZlib&&(a.DecompressionStreamFallback=a.DecompressionStreamZlib);const u={highWaterMark:1},l=t.readable?Ft(t.readable):new y({async pull(t){const n=new w(t=>on.set(cn,t));fn({type:"pull",messageId:cn}),cn=(cn+1)%e.MAX_SAFE_INTEGER;const{value:o,done:s}=await n;t.enqueue(o),s&&t.close()}},u);c=t.writable?function(t){if(t instanceof m)return t;const n=t.getWriter();return new m({write:t=>n.write(t),close:()=>n.close(),abort:t=>n.abort(t)})}(t.writable):new m({async write(t){let n;const o=new w(t=>n=t);sn.set(cn,n),fn({type:Zt,value:t,messageId:cn}),cn=(cn+1)%e.MAX_SAFE_INTEGER,await o}},u),n=new _t(i,a),r=new tn(function(t){return s="string"==typeof(n=s=t.chunkSize)&&n.trim()?e(n):n,e.isInteger(s)&&s>=1?o.max(s,64):65536;var n,s}(a)),await l.pipeThrough(n).pipeThrough(r).pipeTo(c,{preventClose:!0,preventAbort:!0}),await c.getWriter().close();const{crc32:h,inputSize:p,outputSize:d}=n;fn({type:"close",result:{crc32:h,inputSize:p,outputSize:d}})}catch(t){const n=r?r.outputSize:0;if(en(t))try{t.outputSize=n}catch{}if(c&&!c.locked)try{await c.getWriter().close()}catch{}un(t,n)}}function fn(t){const{value:n}=t;if(n)if(n.length)try{t.value=(e=n,e.byteOffset||e.byteLength!=e.buffer.byteLength?new r(e):e).buffer,p(t,[t.value])}catch{p(t)}else p(t);else p(t);var e}function un(t,n){const{message:e,stack:o,code:r,name:c,outputSize:i,cause:a,codecImportFailed:f}=function(t=new s("Unknown error")){return en(t)?t:new s(String(t))}(t),u={message:e,stack:o,code:r,name:c,outputSize:i===v?n:i};if(a&&(u.cause={name:a.name,message:a.message}),f&&(u.codecImportFailed=!0),rn)try{return void p({error:u,errorValue:{value:t}})}catch{}p({error:u})}addEventListener("message",({data:t})=>{const{type:n,messageId:e,value:o,done:s}=t;try{if("start"==n&&an(t),n==Zt){const t=on.get(e);on.delete(e),t({value:o||new r,done:s})}if("ack"==n){const t=sn.get(e);sn.delete(e),t()}}catch(t){un(t)}}),p({type:"ready"});const wn="deflate",ln="deflate-raw",hn="deflate64-raw",pn="gzip";let dn,yn,mn,Sn,gn;function vn(t,n,e={}){if(!dn){const t=new s("WASM module not loaded");throw t.cause=gn,t}const c="number"==typeof e.level?e.level:-1,i="number"==typeof e.outBuffer?e.outBuffer:65536,a="number"==typeof e.inBufferSize?e.inBufferSize:65536;return new d({start(){try{let e;if(this.C=yn(i),this.in=yn(a),this.inBufferSize=a,!this.C||!this.in)throw new s("allocation failed");if(t?(this.I=dn.deflate_process,this.A=dn.deflate_last_consumed,this.M=dn.deflate_end,this.P=dn.deflate_new(),e=n===pn?dn.deflate_init_gzip(this.P,c):n===ln?dn.deflate_init_raw(this.P,c):dn.deflate_init(this.P,c)):n===hn?(this.I=dn.inflate9_process,this.A=dn.inflate9_last_consumed,this.M=dn.inflate9_end,this.P=dn.inflate9_new(),e=dn.inflate9_init_raw(this.P)):(this.I=dn.inflate_process,this.A=dn.inflate_last_consumed,this.M=dn.inflate_end,this.P=dn.inflate_new(),e=n===ln?dn.inflate_init_raw(this.P):n===pn?dn.inflate_init_gzip(this.P):dn.inflate_init(this.P)),0!==e)throw new s("init failed:"+e)}catch(t){throw f(this),t}},transform(t,n){try{const e=t,c=new r(Sn.buffer),a=this.I,f=this.A,u=this.C;let w=0;for(;w<e.length;){const t=o.min(e.length-w,32768);if((!this.in||this.inBufferSize<t)&&(this.in&&mn&&(mn(this.in),this.in=0),this.in=yn(t),this.inBufferSize=t,!this.in))throw new s("allocation failed");c.set(e.subarray(w,w+t),this.in);const r=a(this.P,this.in,t,u,i,0),l=r>>24&255,h=128&l?l-256:l;if(h<0)throw new s("process error:"+h);const p=16777215&r;p&&n.enqueue(c.slice(u,u+p));const d=f(this.P);if(0===d&&0===p)break;w+=d}}catch(t){f(this),n.error(t)}},flush(t){try{const n=new r(Sn.buffer),e=this.I,o=this.C;for(;;){const r=e(this.P,0,0,o,i,4),c=r>>24&255,a=128&c?c-256:c;if(a<0)throw new s("process error:"+a);const f=16777215&r;if(f&&t.enqueue(n.slice(o,o+f)),1===c||0===f)break}}catch(n){t.error(n)}finally{const n=f(this);0!==n&&t.error(new s("end error:"+n))}},cancel(){f(this)}});function f(t){let n=0;return t.P&&t.M&&(n=t.M(t.P)),t.P=0,t.in&&mn&&mn(t.in),t.in=0,t.C&&mn&&mn(t.C),t.C=0,n}}class kn{constructor(t=wn,n){return vn(!0,t,n)}}class zn{constructor(t=wn,n){return vn(!1,t,n)}}kn.requiresModule=!0,zn.requiresModule=!0,kn.supportedFormats=[wn,ln,pn],zn.supportedFormats=[wn,ln,pn,hn];const bn=65536;let Cn,In;function An(t){return new r(t.memory.buffer)}let Mn=!1;!function(t={}){const{init:n,D:e}=t,o=t.CompressionStreamFallback||t.CompressionStreamZlib,s=t.DecompressionStreamFallback||t.DecompressionStreamZlib;e&&(ht=e||Q),self.initModule=async t=>{n&&await n(t),o&&(t.CompressionStreamFallback=o),s&&(t.DecompressionStreamFallback=s)}}({CompressionStreamFallback:kn,DecompressionStreamFallback:zn,D:function(t,n){const e=Cn;let o=e?function(t,n,e){In||(In=t.malloc(bn));const o=In?t.aes_hmac_new():0;if(o){const s=An(t);if(s.set(n,In),s.set(e,In+n.length),t.aes_hmac_init(o,In,n.length,In+n.length,e.length))return t.aes_hmac_end(o,0),0}return o}(e,t,n):0;if(!o)return Q(t,n);const s=In;return{process(t,n){for(let r=0;r<t.length;r+=bn){const c=t.subarray(r,r+bn),i=An(e);i.set(c,s),e.aes_hmac_process(o,s,c.length,n?1:0),c.set(i.subarray(s,s+c.length))}},digest:()=>(e.aes_hmac_end(o,s),o=0,An(e).slice(s,s+20)),dispose(){o&&(e.aes_hmac_end(o,0),o=0)}}},init:t=>async function(t,{baseURI:n}){if(!Mn)try{await async function(t,n){let e,o;try{try{o=new URL(t,n)}catch{}const s=await fetch(o);e=await s.arrayBuffer()}catch(n){if(!t.startsWith("data:application/wasm;base64,"))throw n;e=function(t){const n=t.split(",")[1],e=atob(n),o=e.length,s=new r(o);for(let t=0;t<o;++t)s[t]=e.charCodeAt(t);return s.buffer}(t)}const c=await WebAssembly.instantiate(e);var i;(function(t){if(dn=t,({malloc:yn,free:mn,memory:Sn}=dn),"function"!=typeof yn||"function"!=typeof mn||!Sn)throw dn=yn=mn=Sn=null,new s("Invalid WASM module")})(c.instance.exports),typeof(i=c.instance.exports).aes_hmac_new==z&&(Cn=i,In=0)}(t,n),Mn=!0}catch(t){throw function(t){gn=t}(t),t}}(t.wasmURI,t)})});\n';
|
|
37690
|
+
if ("string" == typeof s4 && (s4 = new TextEncoder().encode(s4)), t4) {
|
|
37691
|
+
const t5 = new Blob([s4], { type: e3 });
|
|
37937
37692
|
return URL.createObjectURL(t5);
|
|
37938
37693
|
}
|
|
37939
37694
|
return "data:" + e3 + ";base64," + function(t5) {
|
|
37940
37695
|
let e4 = "";
|
|
37941
|
-
const
|
|
37942
|
-
let
|
|
37943
|
-
for (;
|
|
37944
|
-
const
|
|
37945
|
-
e4 += n[
|
|
37946
|
-
}
|
|
37947
|
-
const
|
|
37948
|
-
if (1 ===
|
|
37949
|
-
const
|
|
37950
|
-
e4 += n[
|
|
37951
|
-
} else if (2 ===
|
|
37952
|
-
const
|
|
37953
|
-
e4 += n[
|
|
37696
|
+
const s5 = t5.length;
|
|
37697
|
+
let r2 = 0;
|
|
37698
|
+
for (; r2 + 2 < s5; r2 += 3) {
|
|
37699
|
+
const s6 = t5[r2] << 16 | t5[r2 + 1] << 8 | t5[r2 + 2];
|
|
37700
|
+
e4 += n[s6 >> 18 & 63] + n[s6 >> 12 & 63] + n[s6 >> 6 & 63] + n[63 & s6];
|
|
37701
|
+
}
|
|
37702
|
+
const o2 = s5 - r2;
|
|
37703
|
+
if (1 === o2) {
|
|
37704
|
+
const s6 = t5[r2] << 16;
|
|
37705
|
+
e4 += n[s6 >> 18 & 63] + n[s6 >> 12 & 63] + "==";
|
|
37706
|
+
} else if (2 === o2) {
|
|
37707
|
+
const s6 = t5[r2] << 16 | t5[r2 + 1] << 8;
|
|
37708
|
+
e4 += n[s6 >> 18 & 63] + n[s6 >> 12 & 63] + n[s6 >> 6 & 63] + "=";
|
|
37954
37709
|
}
|
|
37955
37710
|
return e4;
|
|
37956
|
-
}(
|
|
37711
|
+
}(s4);
|
|
37957
37712
|
} });
|
|
37958
37713
|
|
|
37959
37714
|
// ../../node_modules/@zip.js/zip.js/lib/zip-core-base.js
|
|
@@ -37968,10 +37723,14 @@ init_codec_worker();
|
|
|
37968
37723
|
var MODULE_WORKER_OPTIONS = { type: "module" };
|
|
37969
37724
|
var ERROR_EVENT_TYPE = "error";
|
|
37970
37725
|
var MESSAGE_ERROR_EVENT_TYPE = "messageerror";
|
|
37971
|
-
var ABORT_EVENT_TYPE = "abort";
|
|
37972
37726
|
var webWorkerSource;
|
|
37973
37727
|
var webWorkerURI;
|
|
37974
37728
|
var webWorkerOptions;
|
|
37729
|
+
var transferStreamsSupported = true;
|
|
37730
|
+
try {
|
|
37731
|
+
transferStreamsSupported = typeof structuredClone == FUNCTION_TYPE && structuredClone(new DOMException("", "AbortError")).code !== UNDEFINED_VALUE;
|
|
37732
|
+
} catch {
|
|
37733
|
+
}
|
|
37975
37734
|
setWebWorkerBackend(createWebWorkerInterface);
|
|
37976
37735
|
function createWebWorkerInterface(workerData, config3) {
|
|
37977
37736
|
const { baseURI, chunkSize, workerStartupTimeout } = config3;
|
|
@@ -38052,11 +37811,14 @@ async function runWebWorker(workerData, config3) {
|
|
|
38052
37811
|
});
|
|
38053
37812
|
const { readable, options } = workerData;
|
|
38054
37813
|
const { writable, closed, abortPipe } = watchClosedStream(workerData.writable, workerData);
|
|
37814
|
+
let streamsTransferred;
|
|
38055
37815
|
try {
|
|
38056
|
-
sendMessage({
|
|
37816
|
+
streamsTransferred = sendMessage({
|
|
38057
37817
|
type: MESSAGE_START,
|
|
38058
37818
|
options,
|
|
38059
|
-
config: config3
|
|
37819
|
+
config: config3,
|
|
37820
|
+
readable,
|
|
37821
|
+
writable
|
|
38060
37822
|
}, workerData);
|
|
38061
37823
|
} catch (error2) {
|
|
38062
37824
|
abortPipe();
|
|
@@ -38067,10 +37829,12 @@ async function runWebWorker(workerData, config3) {
|
|
|
38067
37829
|
workerData.onTaskFinished();
|
|
38068
37830
|
throw error2;
|
|
38069
37831
|
}
|
|
38070
|
-
|
|
38071
|
-
|
|
38072
|
-
|
|
38073
|
-
|
|
37832
|
+
if (!streamsTransferred) {
|
|
37833
|
+
Object.assign(workerData, {
|
|
37834
|
+
reader: readable.getReader(),
|
|
37835
|
+
writer: writable.getWriter()
|
|
37836
|
+
});
|
|
37837
|
+
}
|
|
38074
37838
|
const { workerStartupTimeout } = config3;
|
|
38075
37839
|
if (!workerData.workerAlive && Number.isFinite(workerStartupTimeout) && workerStartupTimeout >= 0) {
|
|
38076
37840
|
workerData.startupTimeout = setTimeout(() => onStartupTimeout(workerData), workerStartupTimeout);
|
|
@@ -38100,7 +37864,7 @@ async function runWebWorker(workerData, config3) {
|
|
|
38100
37864
|
throw reportedError;
|
|
38101
37865
|
}
|
|
38102
37866
|
async function closeWritable() {
|
|
38103
|
-
if (!writable.locked) {
|
|
37867
|
+
if (!streamsTransferred && !writable.locked) {
|
|
38104
37868
|
try {
|
|
38105
37869
|
await writable.getWriter().close();
|
|
38106
37870
|
} catch {
|
|
@@ -38123,13 +37887,6 @@ function watchClosedStream(writableSource, workerData) {
|
|
|
38123
37887
|
Object.assign(workerData, { destinationFailed: true, destinationError: error2 });
|
|
38124
37888
|
}
|
|
38125
37889
|
});
|
|
38126
|
-
const { signal } = workerData.workerOptions.streamOptions;
|
|
38127
|
-
if (signal) {
|
|
38128
|
-
const onAbort = () => abortController.abort(signal.reason);
|
|
38129
|
-
const removeAbortListener = () => signal.removeEventListener(ABORT_EVENT_TYPE, onAbort);
|
|
38130
|
-
signal.addEventListener(ABORT_EVENT_TYPE, onAbort);
|
|
38131
|
-
closed.then(removeAbortListener, removeAbortListener);
|
|
38132
|
-
}
|
|
38133
37890
|
return {
|
|
38134
37891
|
writable,
|
|
38135
37892
|
closed,
|
|
@@ -38280,14 +38037,31 @@ function onWorkerError(event, workerData) {
|
|
|
38280
38037
|
}
|
|
38281
38038
|
}
|
|
38282
38039
|
}
|
|
38283
|
-
function sendMessage(message, { worker, writer }) {
|
|
38040
|
+
function sendMessage(message, { worker, writer, transferStreams, workerAlive }) {
|
|
38284
38041
|
try {
|
|
38285
|
-
const { value } = message;
|
|
38042
|
+
const { value, readable, writable } = message;
|
|
38043
|
+
const transferables = [];
|
|
38286
38044
|
if (value) {
|
|
38287
38045
|
message.value = toExactUint8Array(value);
|
|
38046
|
+
transferables.push(message.value.buffer);
|
|
38047
|
+
}
|
|
38048
|
+
if (transferStreams && transferStreamsSupported && workerAlive) {
|
|
38049
|
+
if (readable) {
|
|
38050
|
+
transferables.push(readable);
|
|
38051
|
+
}
|
|
38052
|
+
if (writable) {
|
|
38053
|
+
transferables.push(writable);
|
|
38054
|
+
}
|
|
38055
|
+
} else {
|
|
38056
|
+
message.readable = message.writable = null;
|
|
38057
|
+
}
|
|
38058
|
+
if (transferables.length) {
|
|
38288
38059
|
try {
|
|
38289
|
-
worker.postMessage(message,
|
|
38060
|
+
worker.postMessage(message, transferables);
|
|
38061
|
+
return true;
|
|
38290
38062
|
} catch {
|
|
38063
|
+
transferStreamsSupported = false;
|
|
38064
|
+
message.readable = message.writable = null;
|
|
38291
38065
|
worker.postMessage(message);
|
|
38292
38066
|
}
|
|
38293
38067
|
} else {
|
|
@@ -38361,6 +38135,9 @@ function getResponseError(errorData, errorValue) {
|
|
|
38361
38135
|
responseError = errorValue.value;
|
|
38362
38136
|
} else {
|
|
38363
38137
|
responseError = Object.assign(new Error(message), { stack, code, name });
|
|
38138
|
+
if (cause) {
|
|
38139
|
+
responseError.cause = Object.assign(new Error(cause.message), { name: cause.name });
|
|
38140
|
+
}
|
|
38364
38141
|
}
|
|
38365
38142
|
if (isErrorObject(responseError)) {
|
|
38366
38143
|
try {
|
|
@@ -38370,14 +38147,6 @@ function getResponseError(errorData, errorValue) {
|
|
|
38370
38147
|
if (codecImportFailed) {
|
|
38371
38148
|
responseError.codecImportFailed = true;
|
|
38372
38149
|
}
|
|
38373
|
-
if (cause) {
|
|
38374
|
-
if (!isErrorObject(responseError.cause)) {
|
|
38375
|
-
responseError.cause = Object.assign(new Error(cause.message), { name: cause.name });
|
|
38376
|
-
}
|
|
38377
|
-
if (cause.code !== UNDEFINED_VALUE && responseError.cause.code !== cause.code) {
|
|
38378
|
-
responseError.cause.code = cause.code;
|
|
38379
|
-
}
|
|
38380
|
-
}
|
|
38381
38150
|
if (errorValue) {
|
|
38382
38151
|
if (responseError.name !== name) {
|
|
38383
38152
|
responseError.name = name;
|
|
@@ -38490,8 +38259,128 @@ var ZipWriter = class {
|
|
|
38490
38259
|
prependZip(reader) {
|
|
38491
38260
|
return watchPromiseError(this, prependZipEntries(this, reader));
|
|
38492
38261
|
}
|
|
38493
|
-
appendZip(reader
|
|
38494
|
-
return watchPromiseError(this, appendZipEntries(
|
|
38262
|
+
appendZip(reader) {
|
|
38263
|
+
return watchPromiseError(this, this.appendZipEntries(reader));
|
|
38264
|
+
}
|
|
38265
|
+
async appendZipEntries(reader) {
|
|
38266
|
+
const zipWriter = this;
|
|
38267
|
+
const { pendingAddFileCalls, filenames, fileEntries } = zipWriter;
|
|
38268
|
+
while (pendingAddFileCalls.size) {
|
|
38269
|
+
await Promise.allSettled(Array.from(pendingAddFileCalls));
|
|
38270
|
+
}
|
|
38271
|
+
let resolveAppendZip;
|
|
38272
|
+
const promiseAppendZip = new Promise((resolve2) => resolveAppendZip = resolve2);
|
|
38273
|
+
pendingAddFileCalls.add(promiseAppendZip);
|
|
38274
|
+
const appendedFilenames = [];
|
|
38275
|
+
let releaseLockWriter;
|
|
38276
|
+
try {
|
|
38277
|
+
reader = new GenericReader(reader);
|
|
38278
|
+
await initStream(reader);
|
|
38279
|
+
if (reader.size === UNDEFINED_VALUE || !reader.readUint8Array) {
|
|
38280
|
+
reader = new BlobReader(await streamToBlob(reader.readable));
|
|
38281
|
+
await initStream(reader);
|
|
38282
|
+
}
|
|
38283
|
+
const { ZipReader: ZipReader2 } = await Promise.resolve().then(() => (init_zip_reader(), zip_reader_exports));
|
|
38284
|
+
const zipReader = new ZipReader2(reader);
|
|
38285
|
+
const entries = await zipReader.getEntries();
|
|
38286
|
+
await zipReader.close();
|
|
38287
|
+
await initStream(zipWriter.writer);
|
|
38288
|
+
const { directoryOffset } = zipReader;
|
|
38289
|
+
entries.forEach(({ filename }) => {
|
|
38290
|
+
if (filenames.has(filename)) {
|
|
38291
|
+
throw new Error(ERR_DUPLICATED_NAME);
|
|
38292
|
+
}
|
|
38293
|
+
filenames.add(filename);
|
|
38294
|
+
appendedFilenames.push(filename);
|
|
38295
|
+
});
|
|
38296
|
+
zipWriter.writerLocked = true;
|
|
38297
|
+
const { lockWriter } = zipWriter;
|
|
38298
|
+
zipWriter.lockWriter = new Promise((resolve2) => releaseLockWriter = () => {
|
|
38299
|
+
zipWriter.writerLocked = false;
|
|
38300
|
+
resolve2();
|
|
38301
|
+
});
|
|
38302
|
+
await lockWriter;
|
|
38303
|
+
if (zipWriter.addSplitZipSignature) {
|
|
38304
|
+
delete zipWriter.addSplitZipSignature;
|
|
38305
|
+
if (!await startsWithSplitZipSignature2(reader)) {
|
|
38306
|
+
await writeData(zipWriter.writer, getSplitZipSignatureArray());
|
|
38307
|
+
zipWriter.offset += SPLIT_ZIP_FILE_SIGNATURE_LENGTH;
|
|
38308
|
+
}
|
|
38309
|
+
}
|
|
38310
|
+
const entryPositions = await copyZipData(zipWriter, reader, entries, directoryOffset);
|
|
38311
|
+
entries.forEach((entry) => {
|
|
38312
|
+
const {
|
|
38313
|
+
version: version3,
|
|
38314
|
+
rawLastModDate,
|
|
38315
|
+
rawFilename,
|
|
38316
|
+
bitFlag,
|
|
38317
|
+
encrypted,
|
|
38318
|
+
uncompressedSize,
|
|
38319
|
+
compressedSize,
|
|
38320
|
+
extraFieldZip64
|
|
38321
|
+
} = entry;
|
|
38322
|
+
let {
|
|
38323
|
+
compressionMethod,
|
|
38324
|
+
rawExtraField
|
|
38325
|
+
} = entry;
|
|
38326
|
+
const { level, languageEncodingFlag, dataDescriptor } = bitFlag;
|
|
38327
|
+
rawExtraField = removeExtraFieldZip64(rawExtraField || EMPTY_UINT8_ARRAY);
|
|
38328
|
+
if (entry.extraFieldAES) {
|
|
38329
|
+
compressionMethod = COMPRESSION_METHOD_AES;
|
|
38330
|
+
}
|
|
38331
|
+
const extraFieldLength = getLength(rawExtraField);
|
|
38332
|
+
const zip64UncompressedSize = Boolean(extraFieldZip64) && extraFieldZip64.uncompressedSize !== UNDEFINED_VALUE;
|
|
38333
|
+
const zip64CompressedSize = Boolean(extraFieldZip64) && extraFieldZip64.compressedSize !== UNDEFINED_VALUE;
|
|
38334
|
+
const bitFlagValue = getBitFlag(level, languageEncodingFlag, dataDescriptor, encrypted, compressionMethod) & ~BITFLAG_LEVEL | level << 1;
|
|
38335
|
+
const {
|
|
38336
|
+
headerArray,
|
|
38337
|
+
headerView
|
|
38338
|
+
} = getHeaderArrayData({
|
|
38339
|
+
version: version3,
|
|
38340
|
+
bitFlag: bitFlagValue,
|
|
38341
|
+
compressionMethod,
|
|
38342
|
+
uncompressedSize,
|
|
38343
|
+
compressedSize,
|
|
38344
|
+
rawLastModDate,
|
|
38345
|
+
rawFilename,
|
|
38346
|
+
zip64CompressedSize,
|
|
38347
|
+
zip64UncompressedSize,
|
|
38348
|
+
extraFieldLength
|
|
38349
|
+
});
|
|
38350
|
+
const { crc32 } = entry;
|
|
38351
|
+
if (crc32 !== UNDEFINED_VALUE) {
|
|
38352
|
+
setUint32(headerView, HEADER_OFFSET_SIGNATURE, crc32);
|
|
38353
|
+
}
|
|
38354
|
+
const { offset, diskNumberStart } = entryPositions.get(entry);
|
|
38355
|
+
Object.assign(entry, {
|
|
38356
|
+
zip64Enabled: true,
|
|
38357
|
+
zip64UncompressedSize,
|
|
38358
|
+
zip64CompressedSize,
|
|
38359
|
+
offset,
|
|
38360
|
+
diskNumberStart,
|
|
38361
|
+
zip64DiskNumberStart: false,
|
|
38362
|
+
rawExtraFieldZip64: EMPTY_UINT8_ARRAY,
|
|
38363
|
+
rawExtraFieldAES: EMPTY_UINT8_ARRAY,
|
|
38364
|
+
rawExtraFieldExtendedTimestamp: EMPTY_UINT8_ARRAY,
|
|
38365
|
+
rawExtraFieldNTFS: EMPTY_UINT8_ARRAY,
|
|
38366
|
+
rawExtraFieldUnix: EMPTY_UINT8_ARRAY,
|
|
38367
|
+
rawExtraField,
|
|
38368
|
+
rawCentralExtraField: EMPTY_UINT8_ARRAY,
|
|
38369
|
+
headerArray,
|
|
38370
|
+
headerView
|
|
38371
|
+
});
|
|
38372
|
+
fileEntries.set(entry.filename, entry);
|
|
38373
|
+
});
|
|
38374
|
+
} catch (error2) {
|
|
38375
|
+
appendedFilenames.forEach((filename) => filenames.delete(filename));
|
|
38376
|
+
throw error2;
|
|
38377
|
+
} finally {
|
|
38378
|
+
resolveAppendZip();
|
|
38379
|
+
pendingAddFileCalls.delete(promiseAppendZip);
|
|
38380
|
+
if (releaseLockWriter) {
|
|
38381
|
+
releaseLockWriter();
|
|
38382
|
+
}
|
|
38383
|
+
}
|
|
38495
38384
|
}
|
|
38496
38385
|
add(name = "", reader, options = {}) {
|
|
38497
38386
|
const zipWriter = this;
|
|
@@ -38581,147 +38470,11 @@ function watchPromiseError(zipWriter, promise) {
|
|
|
38581
38470
|
zipWriter.pendingErrors.push(watcher);
|
|
38582
38471
|
return watchedPromise;
|
|
38583
38472
|
}
|
|
38584
|
-
async function appendZipEntries(zipWriter, reader, options = {}) {
|
|
38585
|
-
const { pendingAddFileCalls, filenames, fileEntries } = zipWriter;
|
|
38586
|
-
const filter = checkFunctionOption(options.filter);
|
|
38587
|
-
const readerOptions = checkReaderOptionsObject(options.readerOptions);
|
|
38588
|
-
while (pendingAddFileCalls.size) {
|
|
38589
|
-
await Promise.allSettled(Array.from(pendingAddFileCalls));
|
|
38590
|
-
}
|
|
38591
|
-
let resolveAppendZip;
|
|
38592
|
-
const promiseAppendZip = new Promise((resolve2) => resolveAppendZip = resolve2);
|
|
38593
|
-
pendingAddFileCalls.add(promiseAppendZip);
|
|
38594
|
-
const appendedFilenames = [];
|
|
38595
|
-
let releaseLockWriter;
|
|
38596
|
-
try {
|
|
38597
|
-
reader = new GenericReader(reader);
|
|
38598
|
-
await initStream(reader);
|
|
38599
|
-
if (reader.size === UNDEFINED_VALUE || !reader.readUint8Array) {
|
|
38600
|
-
reader = new BlobReader(await streamToBlob(reader.readable));
|
|
38601
|
-
await initStream(reader);
|
|
38602
|
-
}
|
|
38603
|
-
const { ZipReader: ZipReader2, getEntryDataDescriptorLength: getEntryDataDescriptorLength2 } = await Promise.resolve().then(() => (init_zip_reader(), zip_reader_exports));
|
|
38604
|
-
const zipReader = new ZipReader2(reader, readerOptions);
|
|
38605
|
-
const keptEntries = [];
|
|
38606
|
-
let entries;
|
|
38607
|
-
try {
|
|
38608
|
-
entries = await zipReader.getEntries();
|
|
38609
|
-
for (const entry of entries) {
|
|
38610
|
-
if (!filter || await filter(entry, getExistingEntry(fileEntries, entry.filename))) {
|
|
38611
|
-
keptEntries.push(entry);
|
|
38612
|
-
}
|
|
38613
|
-
}
|
|
38614
|
-
} finally {
|
|
38615
|
-
await zipReader.close();
|
|
38616
|
-
}
|
|
38617
|
-
await initStream(zipWriter.writer);
|
|
38618
|
-
const { directoryOffset, entriesMissingZip64ExtraField } = zipReader;
|
|
38619
|
-
keptEntries.forEach((entry) => {
|
|
38620
|
-
const { filename } = entry;
|
|
38621
|
-
if (entriesMissingZip64ExtraField.has(entry)) {
|
|
38622
|
-
throw new Error(ERR_EXTRAFIELD_ZIP64_NOT_FOUND);
|
|
38623
|
-
}
|
|
38624
|
-
if (filenames.has(filename)) {
|
|
38625
|
-
throw new Error(ERR_DUPLICATED_NAME);
|
|
38626
|
-
}
|
|
38627
|
-
filenames.add(filename);
|
|
38628
|
-
appendedFilenames.push(filename);
|
|
38629
|
-
});
|
|
38630
|
-
zipWriter.writerLocked = true;
|
|
38631
|
-
const { lockWriter } = zipWriter;
|
|
38632
|
-
zipWriter.lockWriter = new Promise((resolve2) => releaseLockWriter = () => {
|
|
38633
|
-
zipWriter.writerLocked = false;
|
|
38634
|
-
resolve2();
|
|
38635
|
-
});
|
|
38636
|
-
await lockWriter;
|
|
38637
|
-
if (zipWriter.addSplitZipSignature) {
|
|
38638
|
-
delete zipWriter.addSplitZipSignature;
|
|
38639
|
-
if (filter || !await startsWithSplitZipSignature2(reader)) {
|
|
38640
|
-
await writeData(zipWriter.writer, getSplitZipSignatureArray());
|
|
38641
|
-
zipWriter.offset += SPLIT_ZIP_FILE_SIGNATURE_LENGTH;
|
|
38642
|
-
}
|
|
38643
|
-
}
|
|
38644
|
-
const entryPositions = await copyZipData(zipWriter, reader, entries, keptEntries, directoryOffset, Boolean(filter), getEntryDataDescriptorLength2);
|
|
38645
|
-
keptEntries.forEach((entry) => {
|
|
38646
|
-
const {
|
|
38647
|
-
version: version3,
|
|
38648
|
-
rawLastModDate,
|
|
38649
|
-
rawFilename,
|
|
38650
|
-
rawBitFlag,
|
|
38651
|
-
uncompressedSize,
|
|
38652
|
-
compressedSize,
|
|
38653
|
-
extraFieldZip64
|
|
38654
|
-
} = entry;
|
|
38655
|
-
let {
|
|
38656
|
-
compressionMethod,
|
|
38657
|
-
rawExtraField
|
|
38658
|
-
} = entry;
|
|
38659
|
-
rawExtraField = removeExtraFieldZip64(rawExtraField || EMPTY_UINT8_ARRAY);
|
|
38660
|
-
if (entry.extraFieldAES) {
|
|
38661
|
-
compressionMethod = COMPRESSION_METHOD_AES;
|
|
38662
|
-
}
|
|
38663
|
-
const extraFieldLength = getLength(rawExtraField);
|
|
38664
|
-
const zip64UncompressedSize = Boolean(extraFieldZip64) && extraFieldZip64.uncompressedSize !== UNDEFINED_VALUE;
|
|
38665
|
-
const zip64CompressedSize = Boolean(extraFieldZip64) && extraFieldZip64.compressedSize !== UNDEFINED_VALUE;
|
|
38666
|
-
const {
|
|
38667
|
-
headerArray,
|
|
38668
|
-
headerView
|
|
38669
|
-
} = getHeaderArrayData({
|
|
38670
|
-
version: version3,
|
|
38671
|
-
bitFlag: rawBitFlag,
|
|
38672
|
-
compressionMethod,
|
|
38673
|
-
uncompressedSize,
|
|
38674
|
-
compressedSize,
|
|
38675
|
-
rawLastModDate,
|
|
38676
|
-
rawFilename,
|
|
38677
|
-
zip64CompressedSize,
|
|
38678
|
-
zip64UncompressedSize,
|
|
38679
|
-
extraFieldLength
|
|
38680
|
-
});
|
|
38681
|
-
const { crc32 } = entry;
|
|
38682
|
-
if (crc32 !== UNDEFINED_VALUE) {
|
|
38683
|
-
setUint32(headerView, HEADER_OFFSET_SIGNATURE, crc32);
|
|
38684
|
-
}
|
|
38685
|
-
const { offset, diskNumberStart } = entryPositions.get(entry);
|
|
38686
|
-
fileEntries.set(entry.filename, Object.assign({}, entry, {
|
|
38687
|
-
zip64Enabled: true,
|
|
38688
|
-
zip64UncompressedSize,
|
|
38689
|
-
zip64CompressedSize,
|
|
38690
|
-
offset,
|
|
38691
|
-
diskNumberStart,
|
|
38692
|
-
zip64DiskNumberStart: false,
|
|
38693
|
-
rawExtraFieldZip64: EMPTY_UINT8_ARRAY,
|
|
38694
|
-
rawExtraFieldAES: EMPTY_UINT8_ARRAY,
|
|
38695
|
-
rawExtraFieldExtendedTimestamp: EMPTY_UINT8_ARRAY,
|
|
38696
|
-
rawExtraFieldNTFS: EMPTY_UINT8_ARRAY,
|
|
38697
|
-
rawExtraFieldUnix: EMPTY_UINT8_ARRAY,
|
|
38698
|
-
rawCentralExtraFieldUnix: EMPTY_UINT8_ARRAY,
|
|
38699
|
-
rawExtraField,
|
|
38700
|
-
rawCentralExtraField: EMPTY_UINT8_ARRAY,
|
|
38701
|
-
headerArray,
|
|
38702
|
-
headerView
|
|
38703
|
-
}));
|
|
38704
|
-
});
|
|
38705
|
-
} catch (error2) {
|
|
38706
|
-
appendedFilenames.forEach((filename) => filenames.delete(filename));
|
|
38707
|
-
throw error2;
|
|
38708
|
-
} finally {
|
|
38709
|
-
resolveAppendZip();
|
|
38710
|
-
pendingAddFileCalls.delete(promiseAppendZip);
|
|
38711
|
-
if (releaseLockWriter) {
|
|
38712
|
-
releaseLockWriter();
|
|
38713
|
-
}
|
|
38714
|
-
}
|
|
38715
|
-
}
|
|
38716
|
-
function getExistingEntry(fileEntries, filename) {
|
|
38717
|
-
const fileEntry = fileEntries.get(filename);
|
|
38718
|
-
return fileEntry ? new Entry(fileEntry) : UNDEFINED_VALUE;
|
|
38719
|
-
}
|
|
38720
38473
|
async function prependZipEntries(zipWriter, reader) {
|
|
38721
38474
|
if (zipWriter.filenames.size) {
|
|
38722
38475
|
throw new Error(ERR_ZIP_NOT_EMPTY);
|
|
38723
38476
|
}
|
|
38724
|
-
await appendZipEntries(
|
|
38477
|
+
await zipWriter.appendZipEntries(reader);
|
|
38725
38478
|
}
|
|
38726
38479
|
async function addFileEntry(zipWriter, name, reader, options) {
|
|
38727
38480
|
options = Object.assign({}, options);
|
|
@@ -39068,17 +38821,16 @@ function resolveMetadata(zipWriter, name, options) {
|
|
|
39068
38821
|
const passThrough = checkPassThroughOption(getOptionValue2(zipWriter, options, OPTION_PASS_THROUGH));
|
|
39069
38822
|
const passThroughCompression = Boolean(passThrough);
|
|
39070
38823
|
const passThroughEncryption = passThrough === true;
|
|
39071
|
-
|
|
39072
|
-
|
|
38824
|
+
const password = getOptionValue2(zipWriter, options, OPTION_PASSWORD);
|
|
38825
|
+
const rawPassword = getOptionValue2(zipWriter, options, OPTION_RAW_PASSWORD);
|
|
39073
38826
|
checkPasswordOption(password, rawPassword);
|
|
39074
|
-
password = password && password.length ? password : UNDEFINED_VALUE;
|
|
39075
|
-
rawPassword = rawPassword && rawPassword.length ? rawPassword : UNDEFINED_VALUE;
|
|
39076
38827
|
const encryptionStrength = getNumberOptionValue(zipWriter, options, OPTION_ENCRYPTION_STRENGTH, 3);
|
|
39077
38828
|
const zipCrypto = getOptionValue2(zipWriter, options, PROPERTY_NAME_ZIPCRYPTO);
|
|
39078
38829
|
const extendedTimestamp = getOptionValue2(zipWriter, options, OPTION_EXTENDED_TIMESTAMP, true);
|
|
39079
38830
|
const ntfsTimestamp = getOptionValue2(zipWriter, options, OPTION_NTFS_TIMESTAMP);
|
|
39080
38831
|
const keepOrder = getOptionValue2(zipWriter, options, OPTION_KEEP_ORDER, true);
|
|
39081
38832
|
const useWebWorkers = getOptionValue2(zipWriter, options, OPTION_USE_WEB_WORKERS);
|
|
38833
|
+
const transferStreams = getOptionValue2(zipWriter, options, OPTION_TRANSFER_STREAMS);
|
|
39082
38834
|
const bufferedWrite = getOptionValue2(zipWriter, options, OPTION_BUFFERED_WRITE);
|
|
39083
38835
|
const createTempStream = getFunctionOptionValue2(zipWriter, options, OPTION_CREATE_TEMP_STREAM);
|
|
39084
38836
|
const dataDescriptorSignature = getOptionValue2(zipWriter, options, OPTION_DATA_DESCRIPTOR_SIGNATURE, true);
|
|
@@ -39147,6 +38899,7 @@ function resolveMetadata(zipWriter, name, options) {
|
|
|
39147
38899
|
ntfsTimestamp,
|
|
39148
38900
|
keepOrder,
|
|
39149
38901
|
useWebWorkers,
|
|
38902
|
+
transferStreams,
|
|
39150
38903
|
bufferedWrite,
|
|
39151
38904
|
createTempStream,
|
|
39152
38905
|
dataDescriptorSignature,
|
|
@@ -39203,7 +38956,7 @@ async function resolveSizes(zipWriter, reader, { resolvedOptions: metadata }, op
|
|
|
39203
38956
|
if (reader) {
|
|
39204
38957
|
reader = new GenericReader(reader);
|
|
39205
38958
|
await initStream(reader);
|
|
39206
|
-
if (!reader.
|
|
38959
|
+
if (!reader.readable && !reader.readUint8Array) {
|
|
39207
38960
|
throw new Error(ERR_INVALID_READER);
|
|
39208
38961
|
}
|
|
39209
38962
|
({ size: contentSize } = reader);
|
|
@@ -39457,7 +39210,6 @@ async function createFileEntry(reader, writer, { diskNumberStart, lockFileEntry
|
|
|
39457
39210
|
extraFieldExtendedTimestampTime,
|
|
39458
39211
|
rawExtraFieldNTFS,
|
|
39459
39212
|
rawExtraFieldUnix,
|
|
39460
|
-
rawCentralExtraFieldUnix,
|
|
39461
39213
|
rawExtraFieldAES
|
|
39462
39214
|
} = headerInfo;
|
|
39463
39215
|
const { dataDescriptorArray } = dataDescriptorInfo;
|
|
@@ -39482,6 +39234,7 @@ async function createFileEntry(reader, writer, { diskNumberStart, lockFileEntry
|
|
|
39482
39234
|
rawExtraField,
|
|
39483
39235
|
rawCentralExtraField,
|
|
39484
39236
|
useWebWorkers,
|
|
39237
|
+
transferStreams,
|
|
39485
39238
|
onstart,
|
|
39486
39239
|
onprogress,
|
|
39487
39240
|
onend,
|
|
@@ -39523,7 +39276,6 @@ async function createFileEntry(reader, writer, { diskNumberStart, lockFileEntry
|
|
|
39523
39276
|
rawExtraFieldExtendedTimestamp,
|
|
39524
39277
|
rawExtraFieldNTFS,
|
|
39525
39278
|
rawExtraFieldUnix,
|
|
39526
|
-
rawCentralExtraFieldUnix,
|
|
39527
39279
|
rawExtraFieldAES,
|
|
39528
39280
|
rawExtraField,
|
|
39529
39281
|
rawCentralExtraField,
|
|
@@ -39570,6 +39322,7 @@ async function createFileEntry(reader, writer, { diskNumberStart, lockFileEntry
|
|
|
39570
39322
|
encrypted: encrypted && !passThroughEncryption,
|
|
39571
39323
|
useWebWorkers,
|
|
39572
39324
|
useCompressionStream,
|
|
39325
|
+
transferStreams,
|
|
39573
39326
|
format,
|
|
39574
39327
|
codecURI,
|
|
39575
39328
|
compressionMethod
|
|
@@ -39581,7 +39334,6 @@ async function createFileEntry(reader, writer, { diskNumberStart, lockFileEntry
|
|
|
39581
39334
|
const result = await runWorker2({ readable, writable }, workerOptions);
|
|
39582
39335
|
compressedSize = result.outputSize;
|
|
39583
39336
|
writer.size += compressedSize;
|
|
39584
|
-
throwIfAborted(signal);
|
|
39585
39337
|
if (!passThroughCompression) {
|
|
39586
39338
|
uncompressedSize = result.inputSize;
|
|
39587
39339
|
if (!encrypted || zipCrypto) {
|
|
@@ -39742,7 +39494,6 @@ function getHeaderInfo(options) {
|
|
|
39742
39494
|
rawExtraFieldNTFS = rawExtraFieldExtendedTimestamp = EMPTY_UINT8_ARRAY;
|
|
39743
39495
|
}
|
|
39744
39496
|
let rawExtraFieldUnix;
|
|
39745
|
-
let rawCentralExtraFieldUnix;
|
|
39746
39497
|
try {
|
|
39747
39498
|
const { uid, gid, unixExtraFieldType } = options;
|
|
39748
39499
|
if (unixExtraFieldType == INFOZIP_EXTRA_FIELD_TYPE && (uid !== UNDEFINED_VALUE || gid !== UNDEFINED_VALUE)) {
|
|
@@ -39757,7 +39508,7 @@ function getHeaderInfo(options) {
|
|
|
39757
39508
|
extraFieldUnix.writeBytes(uidBytes);
|
|
39758
39509
|
extraFieldUnix.writeUint8(gidBytes.length);
|
|
39759
39510
|
extraFieldUnix.writeBytes(gidBytes);
|
|
39760
|
-
rawExtraFieldUnix =
|
|
39511
|
+
rawExtraFieldUnix = extraFieldUnix.array;
|
|
39761
39512
|
} else if (unixExtraFieldType == UNIX_EXTRA_FIELD_TYPE && (uid !== UNDEFINED_VALUE || gid !== UNDEFINED_VALUE)) {
|
|
39762
39513
|
const extraFieldUnix = createRecordWriter(8);
|
|
39763
39514
|
extraFieldUnix.writeUint16(EXTRAFIELD_TYPE_UNIX);
|
|
@@ -39765,15 +39516,11 @@ function getHeaderInfo(options) {
|
|
|
39765
39516
|
extraFieldUnix.writeUint16((uid === UNDEFINED_VALUE ? 0 : uid) & MAX_16_BITS);
|
|
39766
39517
|
extraFieldUnix.writeUint16((gid === UNDEFINED_VALUE ? 0 : gid) & MAX_16_BITS);
|
|
39767
39518
|
rawExtraFieldUnix = extraFieldUnix.array;
|
|
39768
|
-
const centralExtraFieldUnix = createRecordWriter(4);
|
|
39769
|
-
centralExtraFieldUnix.writeUint16(EXTRAFIELD_TYPE_UNIX);
|
|
39770
|
-
centralExtraFieldUnix.writeUint16(0);
|
|
39771
|
-
rawCentralExtraFieldUnix = centralExtraFieldUnix.array;
|
|
39772
39519
|
} else {
|
|
39773
|
-
rawExtraFieldUnix =
|
|
39520
|
+
rawExtraFieldUnix = EMPTY_UINT8_ARRAY;
|
|
39774
39521
|
}
|
|
39775
39522
|
} catch {
|
|
39776
|
-
rawExtraFieldUnix =
|
|
39523
|
+
rawExtraFieldUnix = EMPTY_UINT8_ARRAY;
|
|
39777
39524
|
}
|
|
39778
39525
|
if (compressionMethod === UNDEFINED_VALUE) {
|
|
39779
39526
|
compressionMethod = compressed ? COMPRESSION_METHOD_DEFLATE : COMPRESSION_METHOD_STORE;
|
|
@@ -39863,7 +39610,6 @@ function getHeaderInfo(options) {
|
|
|
39863
39610
|
rawExtraFieldExtendedTimestamp,
|
|
39864
39611
|
rawExtraFieldNTFS,
|
|
39865
39612
|
rawExtraFieldUnix,
|
|
39866
|
-
rawCentralExtraFieldUnix,
|
|
39867
39613
|
rawExtraFieldAES,
|
|
39868
39614
|
extraFieldLength
|
|
39869
39615
|
};
|
|
@@ -40030,7 +39776,7 @@ function createDirectoryRecords(files) {
|
|
|
40030
39776
|
rawExtraFieldAES,
|
|
40031
39777
|
rawComment,
|
|
40032
39778
|
rawExtraFieldNTFS,
|
|
40033
|
-
|
|
39779
|
+
rawExtraFieldUnix,
|
|
40034
39780
|
rawExtraField,
|
|
40035
39781
|
rawCentralExtraField,
|
|
40036
39782
|
extraFieldExtendedTimestampFlag,
|
|
@@ -40092,7 +39838,7 @@ function createDirectoryRecords(files) {
|
|
|
40092
39838
|
rawExtraFieldZip64,
|
|
40093
39839
|
rawExtraFieldAES,
|
|
40094
39840
|
rawExtraFieldNTFS,
|
|
40095
|
-
|
|
39841
|
+
rawExtraFieldUnix,
|
|
40096
39842
|
rawExtraFieldTimestamp,
|
|
40097
39843
|
rawExtraField,
|
|
40098
39844
|
rawCentralExtraField
|
|
@@ -40121,7 +39867,7 @@ async function writeDirectoryRecords(zipWriter, directoryDataLength, options) {
|
|
|
40121
39867
|
rawExtraFieldAES,
|
|
40122
39868
|
rawExtraFieldExtendedTimestamp,
|
|
40123
39869
|
rawExtraFieldNTFS,
|
|
40124
|
-
|
|
39870
|
+
rawExtraFieldUnix,
|
|
40125
39871
|
rawExtraField,
|
|
40126
39872
|
rawCentralExtraField,
|
|
40127
39873
|
rawComment,
|
|
@@ -40138,7 +39884,7 @@ async function writeDirectoryRecords(zipWriter, directoryDataLength, options) {
|
|
|
40138
39884
|
uncompressedSize,
|
|
40139
39885
|
compressedSize
|
|
40140
39886
|
} = fileEntry;
|
|
40141
|
-
const extraFieldLength = getLength(rawExtraFieldZip64, rawExtraFieldAES, rawExtraFieldExtendedTimestamp, rawExtraFieldNTFS,
|
|
39887
|
+
const extraFieldLength = getLength(rawExtraFieldZip64, rawExtraFieldAES, rawExtraFieldExtendedTimestamp, rawExtraFieldNTFS, rawExtraFieldUnix, rawExtraField, rawCentralExtraField);
|
|
40142
39888
|
const directoryRecordLength = CENTRAL_FILE_HEADER_LENGTH + getLength(rawFilename, rawComment) + extraFieldLength;
|
|
40143
39889
|
if (exceedsAvailableSize(writer, offset + directoryRecordLength - directoryDiskOffset)) {
|
|
40144
39890
|
await writeData(writer, directoryArray.slice(directoryDiskOffset, offset));
|
|
@@ -40174,7 +39920,7 @@ async function writeDirectoryRecords(zipWriter, directoryDataLength, options) {
|
|
|
40174
39920
|
directoryRecord.writeBytes(rawExtraFieldAES);
|
|
40175
39921
|
directoryRecord.writeBytes(rawExtraFieldExtendedTimestamp);
|
|
40176
39922
|
directoryRecord.writeBytes(rawExtraFieldNTFS);
|
|
40177
|
-
directoryRecord.writeBytes(
|
|
39923
|
+
directoryRecord.writeBytes(rawExtraFieldUnix);
|
|
40178
39924
|
directoryRecord.writeBytes(rawExtraField);
|
|
40179
39925
|
directoryRecord.writeBytes(rawCentralExtraField);
|
|
40180
39926
|
directoryRecord.writeBytes(rawComment);
|
|
@@ -40348,62 +40094,25 @@ function removeExtraFieldZip64(rawExtraField) {
|
|
|
40348
40094
|
}
|
|
40349
40095
|
return rawExtraField;
|
|
40350
40096
|
}
|
|
40351
|
-
async function copyZipData(zipWriter, reader, entries,
|
|
40097
|
+
async function copyZipData(zipWriter, reader, entries, directoryOffset) {
|
|
40352
40098
|
const { writer } = zipWriter;
|
|
40353
40099
|
const entryPositions = /* @__PURE__ */ new Map();
|
|
40354
|
-
if (writer.closeDisk
|
|
40100
|
+
if (writer.closeDisk) {
|
|
40355
40101
|
const sortedEntries = Array.from(entries).sort((firstEntry, secondEntry) => getSourceOffset(reader, firstEntry) - getSourceOffset(reader, secondEntry));
|
|
40356
|
-
|
|
40357
|
-
const
|
|
40358
|
-
|
|
40359
|
-
|
|
40360
|
-
|
|
40361
|
-
|
|
40362
|
-
|
|
40363
|
-
|
|
40364
|
-
|
|
40365
|
-
|
|
40366
|
-
|
|
40367
|
-
|
|
40368
|
-
if (entry.bitFlag.dataDescriptor) {
|
|
40369
|
-
const dataDescriptorLength = await getEntryDataDescriptorLength2(reader, entryEnd, entry);
|
|
40370
|
-
entryEnd = dataDescriptorLength === UNDEFINED_VALUE ? Math.max(entryEnd, regionEnds[indexEntry]) : entryEnd + dataDescriptorLength;
|
|
40371
|
-
}
|
|
40372
|
-
if (entryEnd > regionEnds[indexEntry]) {
|
|
40373
|
-
throw new Error(ERR_OVERLAPPING_ENTRY);
|
|
40374
|
-
}
|
|
40375
|
-
regionEnds[indexEntry] = entryEnd;
|
|
40376
|
-
localHeaderLengths.set(entry, localHeaderLength);
|
|
40377
|
-
}
|
|
40378
|
-
}
|
|
40379
|
-
let copiedOffset = 0;
|
|
40380
|
-
let lastPosition;
|
|
40381
|
-
for (let indexEntry = 0; indexEntry < sortedEntries.length; indexEntry++) {
|
|
40382
|
-
const entry = sortedEntries[indexEntry];
|
|
40383
|
-
if (keptEntrySet.has(entry)) {
|
|
40384
|
-
const sourceOffset = getSourceOffset(reader, entry);
|
|
40385
|
-
if (sourceOffset < copiedOffset) {
|
|
40386
|
-
entryPositions.set(entry, lastPosition);
|
|
40387
|
-
} else {
|
|
40388
|
-
if (!compact) {
|
|
40389
|
-
await copyData(zipWriter, reader, copiedOffset, sourceOffset - copiedOffset);
|
|
40390
|
-
}
|
|
40391
|
-
if (writer.closeDisk && exceedsAvailableSize(writer, localHeaderLengths.get(entry))) {
|
|
40392
|
-
await writer.closeDisk();
|
|
40393
|
-
}
|
|
40394
|
-
lastPosition = {
|
|
40395
|
-
offset: getSegmentOffset(zipWriter, writer),
|
|
40396
|
-
diskNumberStart: getDiskNumber(writer)
|
|
40397
|
-
};
|
|
40398
|
-
entryPositions.set(entry, lastPosition);
|
|
40399
|
-
await copyData(zipWriter, reader, sourceOffset, regionEnds[indexEntry] - sourceOffset);
|
|
40400
|
-
copiedOffset = regionEnds[indexEntry];
|
|
40401
|
-
}
|
|
40402
|
-
}
|
|
40403
|
-
}
|
|
40404
|
-
if (!compact) {
|
|
40405
|
-
await copyData(zipWriter, reader, copiedOffset, directoryOffset - copiedOffset);
|
|
40102
|
+
let copiedLength = 0;
|
|
40103
|
+
for (const entry of sortedEntries) {
|
|
40104
|
+
const sourceOffset = getSourceOffset(reader, entry);
|
|
40105
|
+
await copyData(zipWriter, reader, copiedLength, sourceOffset - copiedLength);
|
|
40106
|
+
if (exceedsAvailableSize(writer, await getLocalHeaderLength(reader, sourceOffset))) {
|
|
40107
|
+
await writer.closeDisk();
|
|
40108
|
+
}
|
|
40109
|
+
entryPositions.set(entry, {
|
|
40110
|
+
offset: getSegmentOffset(zipWriter, writer),
|
|
40111
|
+
diskNumberStart: getDiskNumber(writer)
|
|
40112
|
+
});
|
|
40113
|
+
copiedLength = sourceOffset;
|
|
40406
40114
|
}
|
|
40115
|
+
await copyData(zipWriter, reader, copiedLength, directoryOffset - copiedLength);
|
|
40407
40116
|
} else {
|
|
40408
40117
|
const baseOffset = zipWriter.offset;
|
|
40409
40118
|
await copyData(zipWriter, reader, 0, directoryOffset);
|
|
@@ -40414,19 +40123,6 @@ async function copyZipData(zipWriter, reader, entries, keptEntries, directoryOff
|
|
|
40414
40123
|
}
|
|
40415
40124
|
return entryPositions;
|
|
40416
40125
|
}
|
|
40417
|
-
function getRegionEnds(reader, sortedEntries, directoryOffset) {
|
|
40418
|
-
const regionEnds = new Array(sortedEntries.length);
|
|
40419
|
-
let regionEnd = directoryOffset;
|
|
40420
|
-
for (let indexEntry = sortedEntries.length - 1; indexEntry >= 0; indexEntry--) {
|
|
40421
|
-
const sourceOffset = getSourceOffset(reader, sortedEntries[indexEntry]);
|
|
40422
|
-
const nextEntry = sortedEntries[indexEntry + 1];
|
|
40423
|
-
if (nextEntry && getSourceOffset(reader, nextEntry) > sourceOffset) {
|
|
40424
|
-
regionEnd = Math.min(getSourceOffset(reader, nextEntry), directoryOffset);
|
|
40425
|
-
}
|
|
40426
|
-
regionEnds[indexEntry] = regionEnd;
|
|
40427
|
-
}
|
|
40428
|
-
return regionEnds;
|
|
40429
|
-
}
|
|
40430
40126
|
async function copyData(zipWriter, reader, offset, size) {
|
|
40431
40127
|
if (size > 0) {
|
|
40432
40128
|
const { writer } = zipWriter;
|
|
@@ -40434,12 +40130,10 @@ async function copyData(zipWriter, reader, offset, size) {
|
|
|
40434
40130
|
try {
|
|
40435
40131
|
await flushBufferedData(createReadable(reader, { offset, size }), writer, UNDEFINED_VALUE, (chunkLength) => copiedLength += chunkLength);
|
|
40436
40132
|
} catch (error2) {
|
|
40437
|
-
|
|
40438
|
-
|
|
40439
|
-
|
|
40440
|
-
|
|
40441
|
-
} catch {
|
|
40442
|
-
}
|
|
40133
|
+
zipWriter.hasCorruptedEntries = true;
|
|
40134
|
+
try {
|
|
40135
|
+
error2.corruptedEntry = true;
|
|
40136
|
+
} catch {
|
|
40443
40137
|
}
|
|
40444
40138
|
throw error2;
|
|
40445
40139
|
} finally {
|
|
@@ -40449,14 +40143,11 @@ async function copyData(zipWriter, reader, offset, size) {
|
|
|
40449
40143
|
}
|
|
40450
40144
|
}
|
|
40451
40145
|
async function getLocalHeaderLength(reader, offset) {
|
|
40452
|
-
const headerArray =
|
|
40146
|
+
const headerArray = await readUint8Array(reader, offset, HEADER_SIZE);
|
|
40453
40147
|
if (getLength(headerArray) < HEADER_SIZE) {
|
|
40454
|
-
return
|
|
40148
|
+
return HEADER_SIZE;
|
|
40455
40149
|
}
|
|
40456
40150
|
const headerView = getDataView(headerArray);
|
|
40457
|
-
if (getUint322(headerView, 0) != LOCAL_FILE_HEADER_SIGNATURE) {
|
|
40458
|
-
return UNDEFINED_VALUE;
|
|
40459
|
-
}
|
|
40460
40151
|
return HEADER_SIZE + getUint162(headerView, HEADER_OFFSET_FILENAME_LENGTH + LOCAL_HEADER_COMMON_OFFSET) + getUint162(headerView, HEADER_OFFSET_EXTRAFIELD_LENGTH + LOCAL_HEADER_COMMON_OFFSET);
|
|
40461
40152
|
}
|
|
40462
40153
|
function getSourceOffset(reader, { offset, diskNumberStart }) {
|
|
@@ -40808,10 +40499,6 @@ var FORMAT_DEFLATE = "deflate";
|
|
|
40808
40499
|
var FORMAT_DEFLATE_RAW2 = "deflate-raw";
|
|
40809
40500
|
var FORMAT_DEFLATE64_RAW2 = "deflate64-raw";
|
|
40810
40501
|
var FORMAT_GZIP2 = "gzip";
|
|
40811
|
-
var Z_MEM_ERROR = -4;
|
|
40812
|
-
var Z_MEM_ERROR_CODE2 = "Z_MEM_ERROR";
|
|
40813
|
-
var COMPRESSION_FORMATS = [FORMAT_DEFLATE, FORMAT_DEFLATE_RAW2, FORMAT_GZIP2];
|
|
40814
|
-
var DECOMPRESSION_FORMATS = [FORMAT_DEFLATE, FORMAT_DEFLATE_RAW2, FORMAT_GZIP2, FORMAT_DEFLATE64_RAW2];
|
|
40815
40502
|
var wasm;
|
|
40816
40503
|
var malloc;
|
|
40817
40504
|
var free;
|
|
@@ -40828,16 +40515,7 @@ function setWasmExports(wasmAPI) {
|
|
|
40828
40515
|
function setInitError(error2) {
|
|
40829
40516
|
initError = error2;
|
|
40830
40517
|
}
|
|
40831
|
-
function setZlibCode(error2, result) {
|
|
40832
|
-
if (result === Z_MEM_ERROR) {
|
|
40833
|
-
error2.code = Z_MEM_ERROR_CODE2;
|
|
40834
|
-
}
|
|
40835
|
-
return error2;
|
|
40836
|
-
}
|
|
40837
40518
|
function _make(isCompress, type, options = {}) {
|
|
40838
|
-
if (!(isCompress ? COMPRESSION_FORMATS : DECOMPRESSION_FORMATS).includes(type)) {
|
|
40839
|
-
throw new TypeError("Unsupported format: " + type);
|
|
40840
|
-
}
|
|
40841
40519
|
if (!wasm) {
|
|
40842
40520
|
const error2 = new Error("WASM module not loaded");
|
|
40843
40521
|
error2.cause = initError;
|
|
@@ -40846,208 +40524,147 @@ function _make(isCompress, type, options = {}) {
|
|
|
40846
40524
|
const level = typeof options.level === "number" ? options.level : -1;
|
|
40847
40525
|
const outBufferSize = typeof options.outBuffer === "number" ? options.outBuffer : 64 * 1024;
|
|
40848
40526
|
const inBufferSize = typeof options.inBufferSize === "number" ? options.inBufferSize : 64 * 1024;
|
|
40849
|
-
|
|
40850
|
-
|
|
40851
|
-
let backpressure = true;
|
|
40852
|
-
let cancelled = false;
|
|
40853
|
-
initStream2();
|
|
40854
|
-
const readable = new ReadableStream({
|
|
40855
|
-
start(controller) {
|
|
40856
|
-
readableController = controller;
|
|
40857
|
-
},
|
|
40858
|
-
pull() {
|
|
40859
|
-
backpressure = false;
|
|
40860
|
-
resumeWrite();
|
|
40861
|
-
},
|
|
40862
|
-
cancel(reason) {
|
|
40863
|
-
cancelled = true;
|
|
40864
|
-
cancelReason = reason;
|
|
40865
|
-
disposeStream(state);
|
|
40866
|
-
writableController.error(reason);
|
|
40867
|
-
resumeWrite();
|
|
40868
|
-
}
|
|
40869
|
-
}, { highWaterMark: 0 });
|
|
40870
|
-
const writable = new WritableStream({
|
|
40871
|
-
start(controller) {
|
|
40872
|
-
writableController = controller;
|
|
40873
|
-
},
|
|
40874
|
-
async write(chunk) {
|
|
40875
|
-
if (backpressure) {
|
|
40876
|
-
await new Promise((resolve2) => resolveWrite = resolve2);
|
|
40877
|
-
}
|
|
40878
|
-
if (cancelled) {
|
|
40879
|
-
throw cancelReason;
|
|
40880
|
-
}
|
|
40527
|
+
return new TransformStream({
|
|
40528
|
+
start() {
|
|
40881
40529
|
try {
|
|
40882
|
-
|
|
40530
|
+
let result;
|
|
40531
|
+
this.out = malloc(outBufferSize);
|
|
40532
|
+
this.in = malloc(inBufferSize);
|
|
40533
|
+
this.inBufferSize = inBufferSize;
|
|
40534
|
+
if (!this.out || !this.in) {
|
|
40535
|
+
throw new Error("allocation failed");
|
|
40536
|
+
}
|
|
40537
|
+
if (isCompress) {
|
|
40538
|
+
this._process = wasm.deflate_process;
|
|
40539
|
+
this._last_consumed = wasm.deflate_last_consumed;
|
|
40540
|
+
this._end = wasm.deflate_end;
|
|
40541
|
+
this.streamHandle = wasm.deflate_new();
|
|
40542
|
+
if (type === FORMAT_GZIP2) {
|
|
40543
|
+
result = wasm.deflate_init_gzip(this.streamHandle, level);
|
|
40544
|
+
} else if (type === FORMAT_DEFLATE_RAW2) {
|
|
40545
|
+
result = wasm.deflate_init_raw(this.streamHandle, level);
|
|
40546
|
+
} else {
|
|
40547
|
+
result = wasm.deflate_init(this.streamHandle, level);
|
|
40548
|
+
}
|
|
40549
|
+
} else {
|
|
40550
|
+
if (type === FORMAT_DEFLATE64_RAW2) {
|
|
40551
|
+
this._process = wasm.inflate9_process;
|
|
40552
|
+
this._last_consumed = wasm.inflate9_last_consumed;
|
|
40553
|
+
this._end = wasm.inflate9_end;
|
|
40554
|
+
this.streamHandle = wasm.inflate9_new();
|
|
40555
|
+
result = wasm.inflate9_init_raw(this.streamHandle);
|
|
40556
|
+
} else {
|
|
40557
|
+
this._process = wasm.inflate_process;
|
|
40558
|
+
this._last_consumed = wasm.inflate_last_consumed;
|
|
40559
|
+
this._end = wasm.inflate_end;
|
|
40560
|
+
this.streamHandle = wasm.inflate_new();
|
|
40561
|
+
if (type === FORMAT_DEFLATE_RAW2) {
|
|
40562
|
+
result = wasm.inflate_init_raw(this.streamHandle);
|
|
40563
|
+
} else if (type === FORMAT_GZIP2) {
|
|
40564
|
+
result = wasm.inflate_init_gzip(this.streamHandle);
|
|
40565
|
+
} else {
|
|
40566
|
+
result = wasm.inflate_init(this.streamHandle);
|
|
40567
|
+
}
|
|
40568
|
+
}
|
|
40569
|
+
}
|
|
40570
|
+
if (result !== 0) {
|
|
40571
|
+
throw new Error("init failed:" + result);
|
|
40572
|
+
}
|
|
40883
40573
|
} catch (error2) {
|
|
40884
|
-
disposeStream(
|
|
40885
|
-
readableController.error(error2);
|
|
40574
|
+
disposeStream(this);
|
|
40886
40575
|
throw error2;
|
|
40887
40576
|
}
|
|
40888
40577
|
},
|
|
40889
|
-
|
|
40890
|
-
if (cancelled) {
|
|
40891
|
-
return;
|
|
40892
|
-
}
|
|
40578
|
+
transform(chunk, controller) {
|
|
40893
40579
|
try {
|
|
40894
|
-
|
|
40580
|
+
const buffer2 = chunk;
|
|
40581
|
+
const heap = new Uint8Array(memory.buffer);
|
|
40582
|
+
const process2 = this._process;
|
|
40583
|
+
const last_consumed = this._last_consumed;
|
|
40584
|
+
const out = this.out;
|
|
40585
|
+
let offset = 0;
|
|
40586
|
+
while (offset < buffer2.length) {
|
|
40587
|
+
const toRead = Math.min(buffer2.length - offset, 32 * 1024);
|
|
40588
|
+
if (!this.in || this.inBufferSize < toRead) {
|
|
40589
|
+
if (this.in && free) {
|
|
40590
|
+
free(this.in);
|
|
40591
|
+
this.in = 0;
|
|
40592
|
+
}
|
|
40593
|
+
this.in = malloc(toRead);
|
|
40594
|
+
this.inBufferSize = toRead;
|
|
40595
|
+
if (!this.in) {
|
|
40596
|
+
throw new Error("allocation failed");
|
|
40597
|
+
}
|
|
40598
|
+
}
|
|
40599
|
+
heap.set(buffer2.subarray(offset, offset + toRead), this.in);
|
|
40600
|
+
const result = process2(this.streamHandle, this.in, toRead, out, outBufferSize, 0);
|
|
40601
|
+
const code = result >> 24 & 255;
|
|
40602
|
+
const signedCode = code & 128 ? code - 256 : code;
|
|
40603
|
+
if (signedCode < 0) {
|
|
40604
|
+
throw new Error("process error:" + signedCode);
|
|
40605
|
+
}
|
|
40606
|
+
const prod = result & 16777215;
|
|
40607
|
+
if (prod) {
|
|
40608
|
+
controller.enqueue(heap.slice(out, out + prod));
|
|
40609
|
+
}
|
|
40610
|
+
const consumed = last_consumed(this.streamHandle);
|
|
40611
|
+
if (consumed === 0 && prod === 0) {
|
|
40612
|
+
break;
|
|
40613
|
+
}
|
|
40614
|
+
offset += consumed;
|
|
40615
|
+
}
|
|
40895
40616
|
} catch (error2) {
|
|
40896
|
-
disposeStream(
|
|
40897
|
-
|
|
40898
|
-
throw error2;
|
|
40899
|
-
}
|
|
40900
|
-
const result = disposeStream(state);
|
|
40901
|
-
if (result !== 0) {
|
|
40902
|
-
const error2 = setZlibCode(new Error("end error:" + result), result);
|
|
40903
|
-
readableController.error(error2);
|
|
40904
|
-
throw error2;
|
|
40617
|
+
disposeStream(this);
|
|
40618
|
+
controller.error(error2);
|
|
40905
40619
|
}
|
|
40906
|
-
readableController.close();
|
|
40907
40620
|
},
|
|
40908
|
-
|
|
40909
|
-
|
|
40910
|
-
|
|
40911
|
-
|
|
40912
|
-
|
|
40913
|
-
|
|
40914
|
-
|
|
40915
|
-
|
|
40916
|
-
|
|
40917
|
-
|
|
40918
|
-
|
|
40919
|
-
|
|
40920
|
-
|
|
40921
|
-
|
|
40922
|
-
|
|
40923
|
-
|
|
40924
|
-
|
|
40925
|
-
|
|
40926
|
-
state._end = wasm.deflate_end;
|
|
40927
|
-
state.streamHandle = wasm.deflate_new();
|
|
40928
|
-
if (type === FORMAT_GZIP2) {
|
|
40929
|
-
result = wasm.deflate_init_gzip(state.streamHandle, level);
|
|
40930
|
-
} else if (type === FORMAT_DEFLATE_RAW2) {
|
|
40931
|
-
result = wasm.deflate_init_raw(state.streamHandle, level);
|
|
40932
|
-
} else {
|
|
40933
|
-
result = wasm.deflate_init(state.streamHandle, level);
|
|
40934
|
-
}
|
|
40935
|
-
} else {
|
|
40936
|
-
if (type === FORMAT_DEFLATE64_RAW2) {
|
|
40937
|
-
state._process = wasm.inflate9_process;
|
|
40938
|
-
state._last_consumed = wasm.inflate9_last_consumed;
|
|
40939
|
-
state._end = wasm.inflate9_end;
|
|
40940
|
-
state.streamHandle = wasm.inflate9_new();
|
|
40941
|
-
result = wasm.inflate9_init_raw(state.streamHandle);
|
|
40942
|
-
} else {
|
|
40943
|
-
state._process = wasm.inflate_process;
|
|
40944
|
-
state._last_consumed = wasm.inflate_last_consumed;
|
|
40945
|
-
state._end = wasm.inflate_end;
|
|
40946
|
-
state.streamHandle = wasm.inflate_new();
|
|
40947
|
-
if (type === FORMAT_DEFLATE_RAW2) {
|
|
40948
|
-
result = wasm.inflate_init_raw(state.streamHandle);
|
|
40949
|
-
} else if (type === FORMAT_GZIP2) {
|
|
40950
|
-
result = wasm.inflate_init_gzip(state.streamHandle);
|
|
40951
|
-
} else {
|
|
40952
|
-
result = wasm.inflate_init(state.streamHandle);
|
|
40621
|
+
flush(controller) {
|
|
40622
|
+
try {
|
|
40623
|
+
const heap = new Uint8Array(memory.buffer);
|
|
40624
|
+
const process2 = this._process;
|
|
40625
|
+
const out = this.out;
|
|
40626
|
+
while (true) {
|
|
40627
|
+
const result = process2(this.streamHandle, 0, 0, out, outBufferSize, 4);
|
|
40628
|
+
const code = result >> 24 & 255;
|
|
40629
|
+
const signedCode = code & 128 ? code - 256 : code;
|
|
40630
|
+
if (signedCode < 0) {
|
|
40631
|
+
throw new Error("process error:" + signedCode);
|
|
40632
|
+
}
|
|
40633
|
+
const produced = result & 16777215;
|
|
40634
|
+
if (produced) {
|
|
40635
|
+
controller.enqueue(heap.slice(out, out + produced));
|
|
40636
|
+
}
|
|
40637
|
+
if (code === 1 || produced === 0) {
|
|
40638
|
+
break;
|
|
40953
40639
|
}
|
|
40954
40640
|
}
|
|
40641
|
+
} catch (error2) {
|
|
40642
|
+
controller.error(error2);
|
|
40643
|
+
} finally {
|
|
40644
|
+
const result = disposeStream(this);
|
|
40645
|
+
if (result !== 0) {
|
|
40646
|
+
controller.error(new Error("end error:" + result));
|
|
40647
|
+
}
|
|
40955
40648
|
}
|
|
40956
|
-
|
|
40957
|
-
|
|
40958
|
-
|
|
40959
|
-
} catch (error2) {
|
|
40960
|
-
disposeStream(state);
|
|
40961
|
-
throw error2;
|
|
40962
|
-
}
|
|
40963
|
-
}
|
|
40964
|
-
function processChunk(chunk) {
|
|
40965
|
-
const heap = new Uint8Array(memory.buffer);
|
|
40966
|
-
const process2 = state._process;
|
|
40967
|
-
const last_consumed = state._last_consumed;
|
|
40968
|
-
const out = state.out;
|
|
40969
|
-
let offset = 0;
|
|
40970
|
-
while (offset < chunk.length) {
|
|
40971
|
-
if (state.streamEnded) {
|
|
40972
|
-
throw new Error("trailing data after the end of the stream");
|
|
40973
|
-
}
|
|
40974
|
-
const toRead = Math.min(chunk.length - offset, 32 * 1024);
|
|
40975
|
-
if (!state.in || state.inBufferSize < toRead) {
|
|
40976
|
-
if (state.in && free) {
|
|
40977
|
-
free(state.in);
|
|
40978
|
-
state.in = 0;
|
|
40979
|
-
}
|
|
40980
|
-
state.in = malloc(toRead);
|
|
40981
|
-
state.inBufferSize = toRead;
|
|
40982
|
-
if (!state.in) {
|
|
40983
|
-
throw setZlibCode(new Error("allocation failed"), Z_MEM_ERROR);
|
|
40984
|
-
}
|
|
40985
|
-
}
|
|
40986
|
-
heap.set(chunk.subarray(offset, offset + toRead), state.in);
|
|
40987
|
-
const result = process2(state.streamHandle, state.in, toRead, out, outBufferSize, 0);
|
|
40988
|
-
const code = result >> 24 & 255;
|
|
40989
|
-
const signedCode = code & 128 ? code - 256 : code;
|
|
40990
|
-
if (signedCode < 0) {
|
|
40991
|
-
throw setZlibCode(new Error("process error:" + signedCode), signedCode);
|
|
40992
|
-
}
|
|
40993
|
-
const prod = result & 16777215;
|
|
40994
|
-
if (prod) {
|
|
40995
|
-
enqueue(heap.slice(out, out + prod));
|
|
40996
|
-
}
|
|
40997
|
-
const consumed = last_consumed(state.streamHandle);
|
|
40998
|
-
if (code === 1) {
|
|
40999
|
-
state.streamEnded = true;
|
|
41000
|
-
} else if (consumed === 0 && prod === 0) {
|
|
41001
|
-
break;
|
|
41002
|
-
}
|
|
41003
|
-
offset += consumed;
|
|
41004
|
-
}
|
|
41005
|
-
}
|
|
41006
|
-
function flushStream() {
|
|
41007
|
-
const heap = new Uint8Array(memory.buffer);
|
|
41008
|
-
const process2 = state._process;
|
|
41009
|
-
const out = state.out;
|
|
41010
|
-
while (true) {
|
|
41011
|
-
const result = process2(state.streamHandle, 0, 0, out, outBufferSize, 4);
|
|
41012
|
-
const code = result >> 24 & 255;
|
|
41013
|
-
const signedCode = code & 128 ? code - 256 : code;
|
|
41014
|
-
if (signedCode < 0) {
|
|
41015
|
-
throw setZlibCode(new Error("process error:" + signedCode), signedCode);
|
|
41016
|
-
}
|
|
41017
|
-
const produced = result & 16777215;
|
|
41018
|
-
if (produced) {
|
|
41019
|
-
enqueue(heap.slice(out, out + produced));
|
|
41020
|
-
}
|
|
41021
|
-
if (code === 1 || produced === 0) {
|
|
41022
|
-
break;
|
|
41023
|
-
}
|
|
41024
|
-
}
|
|
41025
|
-
}
|
|
41026
|
-
function enqueue(chunk) {
|
|
41027
|
-
backpressure = true;
|
|
41028
|
-
readableController.enqueue(chunk);
|
|
41029
|
-
}
|
|
41030
|
-
function resumeWrite() {
|
|
41031
|
-
if (resolveWrite) {
|
|
41032
|
-
const resolve2 = resolveWrite;
|
|
41033
|
-
resolveWrite = null;
|
|
41034
|
-
resolve2();
|
|
40649
|
+
},
|
|
40650
|
+
cancel() {
|
|
40651
|
+
disposeStream(this);
|
|
41035
40652
|
}
|
|
41036
|
-
}
|
|
41037
|
-
function disposeStream(
|
|
40653
|
+
});
|
|
40654
|
+
function disposeStream(state) {
|
|
41038
40655
|
let endResult = 0;
|
|
41039
|
-
if (
|
|
41040
|
-
endResult =
|
|
40656
|
+
if (state.streamHandle && state._end) {
|
|
40657
|
+
endResult = state._end(state.streamHandle);
|
|
41041
40658
|
}
|
|
41042
|
-
|
|
41043
|
-
if (
|
|
41044
|
-
free(
|
|
40659
|
+
state.streamHandle = 0;
|
|
40660
|
+
if (state.in && free) {
|
|
40661
|
+
free(state.in);
|
|
41045
40662
|
}
|
|
41046
|
-
|
|
41047
|
-
if (
|
|
41048
|
-
free(
|
|
40663
|
+
state.in = 0;
|
|
40664
|
+
if (state.out && free) {
|
|
40665
|
+
free(state.out);
|
|
41049
40666
|
}
|
|
41050
|
-
|
|
40667
|
+
state.out = 0;
|
|
41051
40668
|
return endResult;
|
|
41052
40669
|
}
|
|
41053
40670
|
}
|
|
@@ -41063,8 +40680,8 @@ var DecompressionStreamZlib = class {
|
|
|
41063
40680
|
};
|
|
41064
40681
|
CompressionStreamZlib.requiresModule = true;
|
|
41065
40682
|
DecompressionStreamZlib.requiresModule = true;
|
|
41066
|
-
CompressionStreamZlib.supportedFormats =
|
|
41067
|
-
DecompressionStreamZlib.supportedFormats =
|
|
40683
|
+
CompressionStreamZlib.supportedFormats = [FORMAT_DEFLATE, FORMAT_DEFLATE_RAW2, FORMAT_GZIP2];
|
|
40684
|
+
DecompressionStreamZlib.supportedFormats = [FORMAT_DEFLATE, FORMAT_DEFLATE_RAW2, FORMAT_GZIP2, FORMAT_DEFLATE64_RAW2];
|
|
41068
40685
|
|
|
41069
40686
|
// ../../node_modules/@zip.js/zip.js/lib/core/streams/zlib-wasm/aes-hmac-sha1-wasm.js
|
|
41070
40687
|
init_constants();
|
|
@@ -41209,7 +40826,6 @@ init_constants();
|
|
|
41209
40826
|
init_array();
|
|
41210
40827
|
init_compatible_streams();
|
|
41211
40828
|
init_error();
|
|
41212
|
-
var EMPTY_RAW_PASSWORD = new Uint8Array(0);
|
|
41213
40829
|
|
|
41214
40830
|
// ../../node_modules/@zip.js/zip.js/lib/zip-fs-wasm.js
|
|
41215
40831
|
e(setDefaultConfiguration);
|