@dpuse/dpuse-tool-file-previewer 0.0.59 → 0.0.62
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/README.md +51 -51
- package/dist/dpuse-tool-file-previewer.es.js +336 -366
- package/dist/dpuse-tool-file-previewer.es.js.map +1 -1
- package/dist/types/eslint.config.d.ts +1 -1
- package/package.json +27 -16
|
@@ -5839,7 +5839,7 @@ function de(e) {
|
|
|
5839
5839
|
continue;
|
|
5840
5840
|
}
|
|
5841
5841
|
let a = e[r + 1], o = e[r + 2];
|
|
5842
|
-
if (
|
|
5842
|
+
if ((a & 192) != 128 || (o & 192) != 128 || i === 224 && a < 160 || i === 237 && a >= 160) {
|
|
5843
5843
|
_(t, n, h), r++;
|
|
5844
5844
|
continue;
|
|
5845
5845
|
}
|
|
@@ -5851,7 +5851,7 @@ function de(e) {
|
|
|
5851
5851
|
continue;
|
|
5852
5852
|
}
|
|
5853
5853
|
let a = e[r + 1], o = e[r + 2], s = e[r + 3];
|
|
5854
|
-
if (
|
|
5854
|
+
if ((a & 192) != 128 || (o & 192) != 128 || (s & 192) != 128 || i === 240 && a < 144 || i === 244 && a > 143) {
|
|
5855
5855
|
_(t, n, h), r++;
|
|
5856
5856
|
continue;
|
|
5857
5857
|
}
|
|
@@ -5941,7 +5941,7 @@ var ge = {
|
|
|
5941
5941
|
put(e, t, n) {
|
|
5942
5942
|
return v(e).setUint32(t, n, !0), t + 4;
|
|
5943
5943
|
}
|
|
5944
|
-
},
|
|
5944
|
+
}, _e = {
|
|
5945
5945
|
len: 4,
|
|
5946
5946
|
get(e, t) {
|
|
5947
5947
|
return v(e).getUint32(t);
|
|
@@ -5949,7 +5949,7 @@ var ge = {
|
|
|
5949
5949
|
put(e, t, n) {
|
|
5950
5950
|
return v(e).setUint32(t, n), t + 4;
|
|
5951
5951
|
}
|
|
5952
|
-
},
|
|
5952
|
+
}, ve = {
|
|
5953
5953
|
len: 4,
|
|
5954
5954
|
get(e, t) {
|
|
5955
5955
|
return v(e).getInt32(t);
|
|
@@ -5957,7 +5957,7 @@ var ge = {
|
|
|
5957
5957
|
put(e, t, n) {
|
|
5958
5958
|
return v(e).setInt32(t, n), t + 4;
|
|
5959
5959
|
}
|
|
5960
|
-
},
|
|
5960
|
+
}, ye = {
|
|
5961
5961
|
len: 8,
|
|
5962
5962
|
get(e, t) {
|
|
5963
5963
|
return v(e).getBigUint64(t, !0);
|
|
@@ -5965,22 +5965,22 @@ var ge = {
|
|
|
5965
5965
|
put(e, t, n) {
|
|
5966
5966
|
return v(e).setBigUint64(t, n, !0), t + 8;
|
|
5967
5967
|
}
|
|
5968
|
-
},
|
|
5968
|
+
}, S = class {
|
|
5969
5969
|
constructor(e, t) {
|
|
5970
5970
|
this.len = e, this.encoding = t;
|
|
5971
5971
|
}
|
|
5972
5972
|
get(e, t = 0) {
|
|
5973
5973
|
return le(e.subarray(t, t + this.len), this.encoding);
|
|
5974
5974
|
}
|
|
5975
|
-
},
|
|
5975
|
+
}, be = "End-Of-Stream", C = class extends Error {
|
|
5976
5976
|
constructor() {
|
|
5977
|
-
super(
|
|
5977
|
+
super(be), this.name = "EndOfStreamError";
|
|
5978
5978
|
}
|
|
5979
|
-
},
|
|
5979
|
+
}, xe = class extends Error {
|
|
5980
5980
|
constructor(e = "The operation was aborted") {
|
|
5981
5981
|
super(e), this.name = "AbortError";
|
|
5982
5982
|
}
|
|
5983
|
-
},
|
|
5983
|
+
}, Se = class {
|
|
5984
5984
|
constructor() {
|
|
5985
5985
|
this.endOfStream = !1, this.interrupted = !1, this.peekQueue = [];
|
|
5986
5986
|
}
|
|
@@ -5991,7 +5991,7 @@ var ge = {
|
|
|
5991
5991
|
async read(e, t = !1) {
|
|
5992
5992
|
if (e.length === 0) return 0;
|
|
5993
5993
|
let n = this.readFromPeekBuffer(e);
|
|
5994
|
-
if (this.endOfStream || (n += await this.readRemainderFromStream(e.subarray(n), t)), n === 0 && !t) throw new
|
|
5994
|
+
if (this.endOfStream || (n += await this.readRemainderFromStream(e.subarray(n), t)), n === 0 && !t) throw new C();
|
|
5995
5995
|
return n;
|
|
5996
5996
|
}
|
|
5997
5997
|
readFromPeekBuffer(e) {
|
|
@@ -6007,15 +6007,15 @@ var ge = {
|
|
|
6007
6007
|
async readRemainderFromStream(e, t) {
|
|
6008
6008
|
let n = 0;
|
|
6009
6009
|
for (; n < e.length && !this.endOfStream;) {
|
|
6010
|
-
if (this.interrupted) throw new
|
|
6010
|
+
if (this.interrupted) throw new xe();
|
|
6011
6011
|
let r = await this.readFromStream(e.subarray(n), t);
|
|
6012
6012
|
if (r === 0) break;
|
|
6013
6013
|
n += r;
|
|
6014
6014
|
}
|
|
6015
|
-
if (!t && n < e.length) throw new
|
|
6015
|
+
if (!t && n < e.length) throw new C();
|
|
6016
6016
|
return n;
|
|
6017
6017
|
}
|
|
6018
|
-
},
|
|
6018
|
+
}, Ce = class extends Se {
|
|
6019
6019
|
constructor(e) {
|
|
6020
6020
|
super(), this.reader = e;
|
|
6021
6021
|
}
|
|
@@ -6025,13 +6025,13 @@ var ge = {
|
|
|
6025
6025
|
async close() {
|
|
6026
6026
|
this.reader.releaseLock();
|
|
6027
6027
|
}
|
|
6028
|
-
},
|
|
6028
|
+
}, we = class extends Ce {
|
|
6029
6029
|
async readFromStream(e, t) {
|
|
6030
6030
|
if (e.length === 0) return 0;
|
|
6031
6031
|
let n = await this.reader.read(new Uint8Array(e.length), { min: t ? void 0 : e.length });
|
|
6032
6032
|
return n.done && (this.endOfStream = n.done), n.value ? (e.set(n.value), n.value.length) : 0;
|
|
6033
6033
|
}
|
|
6034
|
-
},
|
|
6034
|
+
}, Te = class extends Se {
|
|
6035
6035
|
constructor(e) {
|
|
6036
6036
|
super(), this.reader = e, this.buffer = null;
|
|
6037
6037
|
}
|
|
@@ -6050,7 +6050,7 @@ var ge = {
|
|
|
6050
6050
|
}
|
|
6051
6051
|
t.value && (n += this.writeChunk(e.subarray(n), t.value));
|
|
6052
6052
|
}
|
|
6053
|
-
if (!t && n === 0 && this.endOfStream) throw new
|
|
6053
|
+
if (!t && n === 0 && this.endOfStream) throw new C();
|
|
6054
6054
|
return n;
|
|
6055
6055
|
}
|
|
6056
6056
|
abort() {
|
|
@@ -6062,18 +6062,18 @@ var ge = {
|
|
|
6062
6062
|
};
|
|
6063
6063
|
//#endregion
|
|
6064
6064
|
//#region node_modules/strtok3/lib/stream/WebStreamReaderFactory.js
|
|
6065
|
-
function
|
|
6065
|
+
function Ee(e) {
|
|
6066
6066
|
try {
|
|
6067
6067
|
let t = e.getReader({ mode: "byob" });
|
|
6068
|
-
return t instanceof ReadableStreamDefaultReader ? new
|
|
6068
|
+
return t instanceof ReadableStreamDefaultReader ? new Te(t) : new we(t);
|
|
6069
6069
|
} catch (t) {
|
|
6070
|
-
if (t instanceof TypeError) return new
|
|
6070
|
+
if (t instanceof TypeError) return new Te(e.getReader());
|
|
6071
6071
|
throw t;
|
|
6072
6072
|
}
|
|
6073
6073
|
}
|
|
6074
6074
|
//#endregion
|
|
6075
6075
|
//#region node_modules/strtok3/lib/AbstractTokenizer.js
|
|
6076
|
-
var
|
|
6076
|
+
var w = class {
|
|
6077
6077
|
constructor(e) {
|
|
6078
6078
|
this.numBuffer = /* @__PURE__ */ new Uint8Array(8), this.position = 0, this.onClose = e?.onClose, e?.abortSignal && e.abortSignal.addEventListener("abort", () => {
|
|
6079
6079
|
this.abort();
|
|
@@ -6081,20 +6081,20 @@ var T = class {
|
|
|
6081
6081
|
}
|
|
6082
6082
|
async readToken(e, t = this.position) {
|
|
6083
6083
|
let n = new Uint8Array(e.len);
|
|
6084
|
-
if (await this.readBuffer(n, { position: t }) < e.len) throw new
|
|
6084
|
+
if (await this.readBuffer(n, { position: t }) < e.len) throw new C();
|
|
6085
6085
|
return e.get(n, 0);
|
|
6086
6086
|
}
|
|
6087
6087
|
async peekToken(e, t = this.position) {
|
|
6088
6088
|
let n = new Uint8Array(e.len);
|
|
6089
|
-
if (await this.peekBuffer(n, { position: t }) < e.len) throw new
|
|
6089
|
+
if (await this.peekBuffer(n, { position: t }) < e.len) throw new C();
|
|
6090
6090
|
return e.get(n, 0);
|
|
6091
6091
|
}
|
|
6092
6092
|
async readNumber(e) {
|
|
6093
|
-
if (await this.readBuffer(this.numBuffer, { length: e.len }) < e.len) throw new
|
|
6093
|
+
if (await this.readBuffer(this.numBuffer, { length: e.len }) < e.len) throw new C();
|
|
6094
6094
|
return e.get(this.numBuffer, 0);
|
|
6095
6095
|
}
|
|
6096
6096
|
async peekNumber(e) {
|
|
6097
|
-
if (await this.peekBuffer(this.numBuffer, { length: e.len }) < e.len) throw new
|
|
6097
|
+
if (await this.peekBuffer(this.numBuffer, { length: e.len }) < e.len) throw new C();
|
|
6098
6098
|
return e.get(this.numBuffer, 0);
|
|
6099
6099
|
}
|
|
6100
6100
|
async ignore(e) {
|
|
@@ -6121,7 +6121,7 @@ var T = class {
|
|
|
6121
6121
|
abort() {
|
|
6122
6122
|
return Promise.resolve();
|
|
6123
6123
|
}
|
|
6124
|
-
},
|
|
6124
|
+
}, De = 256e3, Oe = class extends w {
|
|
6125
6125
|
constructor(e, t) {
|
|
6126
6126
|
super(t), this.streamReader = e, this.fileInfo = t?.fileInfo ?? {};
|
|
6127
6127
|
}
|
|
@@ -6131,7 +6131,7 @@ var T = class {
|
|
|
6131
6131
|
if (r < 0) throw Error("`options.position` must be equal or greater than `tokenizer.position`");
|
|
6132
6132
|
if (n.length === 0) return 0;
|
|
6133
6133
|
let i = await this.streamReader.read(e.subarray(0, n.length), n.mayBeLess);
|
|
6134
|
-
if (this.position += i, (!t || !t.mayBeLess) && i < n.length) throw new
|
|
6134
|
+
if (this.position += i, (!t || !t.mayBeLess) && i < n.length) throw new C();
|
|
6135
6135
|
return i;
|
|
6136
6136
|
}
|
|
6137
6137
|
async peekBuffer(e, t) {
|
|
@@ -6148,16 +6148,16 @@ var T = class {
|
|
|
6148
6148
|
try {
|
|
6149
6149
|
r = await this.streamReader.peek(e.subarray(0, n.length), n.mayBeLess);
|
|
6150
6150
|
} catch (e) {
|
|
6151
|
-
if (t?.mayBeLess && e instanceof
|
|
6151
|
+
if (t?.mayBeLess && e instanceof C) return 0;
|
|
6152
6152
|
throw e;
|
|
6153
6153
|
}
|
|
6154
|
-
if (!n.mayBeLess && r < n.length) throw new
|
|
6154
|
+
if (!n.mayBeLess && r < n.length) throw new C();
|
|
6155
6155
|
}
|
|
6156
6156
|
return r;
|
|
6157
6157
|
}
|
|
6158
6158
|
async ignore(e) {
|
|
6159
6159
|
if (e < 0) throw RangeError("ignore length must be ≥ 0 bytes");
|
|
6160
|
-
let t = Math.min(
|
|
6160
|
+
let t = Math.min(De, e), n = new Uint8Array(t), r = 0;
|
|
6161
6161
|
for (; r < e;) {
|
|
6162
6162
|
let i = e - r, a = await this.readBuffer(n, { length: Math.min(t, i) });
|
|
6163
6163
|
if (a < 0) return a;
|
|
@@ -6174,7 +6174,7 @@ var T = class {
|
|
|
6174
6174
|
supportsRandomAccess() {
|
|
6175
6175
|
return !1;
|
|
6176
6176
|
}
|
|
6177
|
-
},
|
|
6177
|
+
}, ke = class extends w {
|
|
6178
6178
|
constructor(e, t) {
|
|
6179
6179
|
super(t), this.uint8Array = e, this.fileInfo = {
|
|
6180
6180
|
...t?.fileInfo ?? {},
|
|
@@ -6188,7 +6188,7 @@ var T = class {
|
|
|
6188
6188
|
}
|
|
6189
6189
|
async peekBuffer(e, t) {
|
|
6190
6190
|
let n = this.normalizeOptions(e, t), r = Math.min(this.uint8Array.length - n.position, n.length);
|
|
6191
|
-
if (!n.mayBeLess && r < n.length) throw new
|
|
6191
|
+
if (!n.mayBeLess && r < n.length) throw new C();
|
|
6192
6192
|
return e.set(this.uint8Array.subarray(n.position, n.position + r)), r;
|
|
6193
6193
|
}
|
|
6194
6194
|
close() {
|
|
@@ -6200,7 +6200,7 @@ var T = class {
|
|
|
6200
6200
|
setPosition(e) {
|
|
6201
6201
|
this.position = e;
|
|
6202
6202
|
}
|
|
6203
|
-
},
|
|
6203
|
+
}, Ae = class extends w {
|
|
6204
6204
|
constructor(e, t) {
|
|
6205
6205
|
super(t), this.blob = e, this.fileInfo = {
|
|
6206
6206
|
...t?.fileInfo ?? {},
|
|
@@ -6215,7 +6215,7 @@ var T = class {
|
|
|
6215
6215
|
}
|
|
6216
6216
|
async peekBuffer(e, t) {
|
|
6217
6217
|
let n = this.normalizeOptions(e, t), r = Math.min(this.blob.size - n.position, n.length);
|
|
6218
|
-
if (!n.mayBeLess && r < n.length) throw new
|
|
6218
|
+
if (!n.mayBeLess && r < n.length) throw new C();
|
|
6219
6219
|
let i = await this.blob.slice(n.position, n.position + r).arrayBuffer();
|
|
6220
6220
|
return e.set(new Uint8Array(i)), r;
|
|
6221
6221
|
}
|
|
@@ -6231,21 +6231,21 @@ var T = class {
|
|
|
6231
6231
|
};
|
|
6232
6232
|
//#endregion
|
|
6233
6233
|
//#region node_modules/strtok3/lib/core.js
|
|
6234
|
-
function
|
|
6235
|
-
let n =
|
|
6234
|
+
function je(e, t) {
|
|
6235
|
+
let n = Ee(e), r = t ?? {}, i = r.onClose;
|
|
6236
6236
|
return r.onClose = async () => {
|
|
6237
6237
|
if (await n.close(), i) return i();
|
|
6238
|
-
}, new
|
|
6239
|
-
}
|
|
6240
|
-
function je(e, t) {
|
|
6241
|
-
return new Oe(e, t);
|
|
6238
|
+
}, new Oe(n, r);
|
|
6242
6239
|
}
|
|
6243
6240
|
function Me(e, t) {
|
|
6244
6241
|
return new ke(e, t);
|
|
6245
6242
|
}
|
|
6243
|
+
function Ne(e, t) {
|
|
6244
|
+
return new Ae(e, t);
|
|
6245
|
+
}
|
|
6246
6246
|
//#endregion
|
|
6247
6247
|
//#region node_modules/ms/index.js
|
|
6248
|
-
var
|
|
6248
|
+
var Pe = /* @__PURE__ */ o(((e, t) => {
|
|
6249
6249
|
var n = 1e3, r = n * 60, i = r * 60, a = i * 24, o = a * 7, s = a * 365.25;
|
|
6250
6250
|
t.exports = function(e, t) {
|
|
6251
6251
|
t ||= {};
|
|
@@ -6308,9 +6308,9 @@ var Ne = /* @__PURE__ */ o(((e, t) => {
|
|
|
6308
6308
|
var i = t >= n * 1.5;
|
|
6309
6309
|
return Math.round(e / n) + " " + r + (i ? "s" : "");
|
|
6310
6310
|
}
|
|
6311
|
-
})),
|
|
6311
|
+
})), Fe = /* @__PURE__ */ o(((e, t) => {
|
|
6312
6312
|
function n(e) {
|
|
6313
|
-
n.debug = n, n.default = n, n.coerce = c, n.disable = o, n.enable = i, n.enabled = s, n.humanize =
|
|
6313
|
+
n.debug = n, n.default = n, n.coerce = c, n.disable = o, n.enable = i, n.enabled = s, n.humanize = Pe(), n.destroy = l, Object.keys(e).forEach((t) => {
|
|
6314
6314
|
n[t] = e[t];
|
|
6315
6315
|
}), n.names = [], n.skips = [], n.formatters = {};
|
|
6316
6316
|
function t(e) {
|
|
@@ -6381,7 +6381,7 @@ var Ne = /* @__PURE__ */ o(((e, t) => {
|
|
|
6381
6381
|
return n.enable(n.load()), n;
|
|
6382
6382
|
}
|
|
6383
6383
|
t.exports = n;
|
|
6384
|
-
})),
|
|
6384
|
+
})), Ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
6385
6385
|
e.formatArgs = r, e.save = i, e.load = a, e.useColors = n, e.storage = o(), e.destroy = (() => {
|
|
6386
6386
|
let e = !1;
|
|
6387
6387
|
return () => {
|
|
@@ -6421,7 +6421,7 @@ var Ne = /* @__PURE__ */ o(((e, t) => {
|
|
|
6421
6421
|
return localStorage;
|
|
6422
6422
|
} catch {}
|
|
6423
6423
|
}
|
|
6424
|
-
t.exports =
|
|
6424
|
+
t.exports = Fe()(e);
|
|
6425
6425
|
var { formatters: s } = t.exports;
|
|
6426
6426
|
s.j = function(e) {
|
|
6427
6427
|
try {
|
|
@@ -6430,12 +6430,12 @@ var Ne = /* @__PURE__ */ o(((e, t) => {
|
|
|
6430
6430
|
return "[UnexpectedJSONParseError]: " + e.message;
|
|
6431
6431
|
}
|
|
6432
6432
|
};
|
|
6433
|
-
})))(), 1),
|
|
6433
|
+
})))(), 1), T = {
|
|
6434
6434
|
LocalFileHeader: 67324752,
|
|
6435
6435
|
DataDescriptor: 134695760,
|
|
6436
6436
|
CentralFileHeader: 33639248,
|
|
6437
6437
|
EndOfCentralDirectory: 101010256
|
|
6438
|
-
},
|
|
6438
|
+
}, E = {
|
|
6439
6439
|
get(e) {
|
|
6440
6440
|
return {
|
|
6441
6441
|
signature: x.get(e, 0),
|
|
@@ -6444,7 +6444,7 @@ var Ne = /* @__PURE__ */ o(((e, t) => {
|
|
|
6444
6444
|
};
|
|
6445
6445
|
},
|
|
6446
6446
|
len: 16
|
|
6447
|
-
},
|
|
6447
|
+
}, Le = {
|
|
6448
6448
|
get(e) {
|
|
6449
6449
|
let t = y.get(e, 6);
|
|
6450
6450
|
return {
|
|
@@ -6460,7 +6460,7 @@ var Ne = /* @__PURE__ */ o(((e, t) => {
|
|
|
6460
6460
|
};
|
|
6461
6461
|
},
|
|
6462
6462
|
len: 30
|
|
6463
|
-
},
|
|
6463
|
+
}, Re = {
|
|
6464
6464
|
get(e) {
|
|
6465
6465
|
return {
|
|
6466
6466
|
signature: x.get(e, 0),
|
|
@@ -6474,7 +6474,7 @@ var Ne = /* @__PURE__ */ o(((e, t) => {
|
|
|
6474
6474
|
};
|
|
6475
6475
|
},
|
|
6476
6476
|
len: 22
|
|
6477
|
-
},
|
|
6477
|
+
}, ze = {
|
|
6478
6478
|
get(e) {
|
|
6479
6479
|
let t = y.get(e, 8);
|
|
6480
6480
|
return {
|
|
@@ -6495,16 +6495,16 @@ var Ne = /* @__PURE__ */ o(((e, t) => {
|
|
|
6495
6495
|
};
|
|
6496
6496
|
//#endregion
|
|
6497
6497
|
//#region node_modules/@tokenizer/inflate/lib/ZipHandler.js
|
|
6498
|
-
function
|
|
6498
|
+
function D(e) {
|
|
6499
6499
|
let t = new Uint8Array(x.len);
|
|
6500
6500
|
return x.put(t, 0, e), t;
|
|
6501
6501
|
}
|
|
6502
|
-
var
|
|
6502
|
+
var O = (0, Ie.default)("tokenizer:inflate"), k = 262144, Be = D(T.DataDescriptor), A = D(T.EndOfCentralDirectory), j = class e {
|
|
6503
6503
|
constructor(e) {
|
|
6504
|
-
this.tokenizer = e, this.syncBuffer = new Uint8Array(
|
|
6504
|
+
this.tokenizer = e, this.syncBuffer = new Uint8Array(k);
|
|
6505
6505
|
}
|
|
6506
6506
|
async isZip() {
|
|
6507
|
-
return await this.peekSignature() ===
|
|
6507
|
+
return await this.peekSignature() === T.LocalFileHeader;
|
|
6508
6508
|
}
|
|
6509
6509
|
peekSignature() {
|
|
6510
6510
|
return this.tokenizer.peekToken(x);
|
|
@@ -6512,24 +6512,24 @@ var k = (0, Fe.default)("tokenizer:inflate"), A = 262144, ze = O(E.DataDescripto
|
|
|
6512
6512
|
async findEndOfCentralDirectoryLocator() {
|
|
6513
6513
|
let e = this.tokenizer, t = Math.min(16384, e.fileInfo.size), n = this.syncBuffer.subarray(0, t);
|
|
6514
6514
|
await this.tokenizer.readBuffer(n, { position: e.fileInfo.size - t });
|
|
6515
|
-
for (let r = n.length - 4; r >= 0; r--) if (n[r] ===
|
|
6515
|
+
for (let r = n.length - 4; r >= 0; r--) if (n[r] === A[0] && n[r + 1] === A[1] && n[r + 2] === A[2] && n[r + 3] === A[3]) return e.fileInfo.size - t + r;
|
|
6516
6516
|
return -1;
|
|
6517
6517
|
}
|
|
6518
6518
|
async readCentralDirectory() {
|
|
6519
6519
|
if (!this.tokenizer.supportsRandomAccess()) {
|
|
6520
|
-
|
|
6520
|
+
O("Cannot reading central-directory without random-read support");
|
|
6521
6521
|
return;
|
|
6522
6522
|
}
|
|
6523
|
-
|
|
6523
|
+
O("Reading central-directory...");
|
|
6524
6524
|
let e = this.tokenizer.position, t = await this.findEndOfCentralDirectoryLocator();
|
|
6525
6525
|
if (t > 0) {
|
|
6526
|
-
|
|
6527
|
-
let n = await this.tokenizer.readToken(
|
|
6526
|
+
O("Central-directory 32-bit signature found");
|
|
6527
|
+
let n = await this.tokenizer.readToken(Re, t), r = [];
|
|
6528
6528
|
this.tokenizer.setPosition(n.offsetOfStartOfCd);
|
|
6529
6529
|
for (let e = 0; e < n.nrOfEntriesOfSize; ++e) {
|
|
6530
|
-
let t = await this.tokenizer.readToken(
|
|
6531
|
-
if (t.signature !==
|
|
6532
|
-
t.filename = await this.tokenizer.readToken(new
|
|
6530
|
+
let t = await this.tokenizer.readToken(ze);
|
|
6531
|
+
if (t.signature !== T.CentralFileHeader) throw Error("Expected Central-File-Header signature");
|
|
6532
|
+
t.filename = await this.tokenizer.readToken(new S(t.filenameLength, "utf-8")), await this.tokenizer.ignore(t.extraFieldLength), await this.tokenizer.ignore(t.fileCommentLength), r.push(t), O(`Add central-directory file-entry: n=${e + 1}/${r.length}: filename=${r[e].filename}`);
|
|
6533
6533
|
}
|
|
6534
6534
|
return this.tokenizer.setPosition(e), r;
|
|
6535
6535
|
}
|
|
@@ -6546,20 +6546,20 @@ var k = (0, Fe.default)("tokenizer:inflate"), A = 262144, ze = O(E.DataDescripto
|
|
|
6546
6546
|
n = !!r.stop;
|
|
6547
6547
|
let i;
|
|
6548
6548
|
if (await this.tokenizer.ignore(t.extraFieldLength), t.dataDescriptor && t.compressedSize === 0) {
|
|
6549
|
-
let e = [], n =
|
|
6550
|
-
|
|
6549
|
+
let e = [], n = k;
|
|
6550
|
+
O("Compressed-file-size unknown, scanning for next data-descriptor-signature....");
|
|
6551
6551
|
let i = -1;
|
|
6552
|
-
for (; i < 0 && n ===
|
|
6553
|
-
n = await this.tokenizer.peekBuffer(this.syncBuffer, { mayBeLess: !0 }), i =
|
|
6552
|
+
for (; i < 0 && n === k;) {
|
|
6553
|
+
n = await this.tokenizer.peekBuffer(this.syncBuffer, { mayBeLess: !0 }), i = Ve(this.syncBuffer.subarray(0, n), Be);
|
|
6554
6554
|
let t = i >= 0 ? i : n;
|
|
6555
6555
|
if (r.handler) {
|
|
6556
6556
|
let n = new Uint8Array(t);
|
|
6557
6557
|
await this.tokenizer.readBuffer(n), e.push(n);
|
|
6558
6558
|
} else await this.tokenizer.ignore(t);
|
|
6559
6559
|
}
|
|
6560
|
-
|
|
6561
|
-
} else r.handler ? (
|
|
6562
|
-
if (
|
|
6560
|
+
O(`Found data-descriptor-signature at pos=${this.tokenizer.position}`), r.handler && await this.inflate(t, He(e), r.handler);
|
|
6561
|
+
} else r.handler ? (O(`Reading compressed-file-data: ${t.compressedSize} bytes`), i = new Uint8Array(t.compressedSize), await this.tokenizer.readBuffer(i), await this.inflate(t, i, r.handler)) : (O(`Ignoring compressed-file-data: ${t.compressedSize} bytes`), await this.tokenizer.ignore(t.compressedSize));
|
|
6562
|
+
if (O(`Reading data-descriptor at pos=${this.tokenizer.position}`), t.dataDescriptor && (await this.tokenizer.readToken(E)).signature !== 134695760) throw Error(`Expected data-descriptor-signature at position ${this.tokenizer.position - E.len}`);
|
|
6563
6563
|
} while (!n);
|
|
6564
6564
|
}
|
|
6565
6565
|
async iterateOverCentralDirectory(e, t) {
|
|
@@ -6580,7 +6580,7 @@ var k = (0, Fe.default)("tokenizer:inflate"), A = 262144, ze = O(E.DataDescripto
|
|
|
6580
6580
|
async inflate(t, n, r) {
|
|
6581
6581
|
if (t.compressedMethod === 0) return r(n);
|
|
6582
6582
|
if (t.compressedMethod !== 8) throw Error(`Unsupported ZIP compression method: ${t.compressedMethod}`);
|
|
6583
|
-
return
|
|
6583
|
+
return O(`Decompress filename=${t.filename}, compressed-size=${n.length}`), r(await e.decompressDeflateRaw(n));
|
|
6584
6584
|
}
|
|
6585
6585
|
static async decompressDeflateRaw(e) {
|
|
6586
6586
|
let t = new ReadableStream({ start(t) {
|
|
@@ -6596,15 +6596,15 @@ var k = (0, Fe.default)("tokenizer:inflate"), A = 262144, ze = O(E.DataDescripto
|
|
|
6596
6596
|
}
|
|
6597
6597
|
async readLocalFileHeader() {
|
|
6598
6598
|
let e = await this.tokenizer.peekToken(x);
|
|
6599
|
-
if (e ===
|
|
6600
|
-
let e = await this.tokenizer.readToken(
|
|
6601
|
-
return e.filename = await this.tokenizer.readToken(new
|
|
6599
|
+
if (e === T.LocalFileHeader) {
|
|
6600
|
+
let e = await this.tokenizer.readToken(Le);
|
|
6601
|
+
return e.filename = await this.tokenizer.readToken(new S(e.filenameLength, "utf-8")), e;
|
|
6602
6602
|
}
|
|
6603
|
-
if (e ===
|
|
6603
|
+
if (e === T.CentralFileHeader) return !1;
|
|
6604
6604
|
throw Error(e === 3759263696 ? "Encrypted ZIP" : "Unexpected signature");
|
|
6605
6605
|
}
|
|
6606
6606
|
};
|
|
6607
|
-
function
|
|
6607
|
+
function Ve(e, t) {
|
|
6608
6608
|
let n = e.length, r = t.length;
|
|
6609
6609
|
if (r > n) return -1;
|
|
6610
6610
|
for (let i = 0; i <= n - r; i++) {
|
|
@@ -6617,14 +6617,14 @@ function Be(e, t) {
|
|
|
6617
6617
|
}
|
|
6618
6618
|
return -1;
|
|
6619
6619
|
}
|
|
6620
|
-
function
|
|
6620
|
+
function He(e) {
|
|
6621
6621
|
let t = e.reduce((e, t) => e + t.length, 0), n = new Uint8Array(t), r = 0;
|
|
6622
6622
|
for (let t of e) n.set(t, r), r += t.length;
|
|
6623
6623
|
return n;
|
|
6624
6624
|
}
|
|
6625
6625
|
//#endregion
|
|
6626
6626
|
//#region node_modules/@tokenizer/inflate/lib/GzipHandler.js
|
|
6627
|
-
var
|
|
6627
|
+
var Ue = class {
|
|
6628
6628
|
constructor(e) {
|
|
6629
6629
|
this.tokenizer = e;
|
|
6630
6630
|
}
|
|
@@ -6639,25 +6639,25 @@ var He = class {
|
|
|
6639
6639
|
t.enqueue(n.subarray(0, r));
|
|
6640
6640
|
} }).pipeThrough(new DecompressionStream("gzip"));
|
|
6641
6641
|
}
|
|
6642
|
-
},
|
|
6643
|
-
function
|
|
6644
|
-
return e ? e.constructor === t ||
|
|
6645
|
-
}
|
|
6646
|
-
function Ke(e) {
|
|
6647
|
-
return Ge(e, Uint8Array, We);
|
|
6642
|
+
}, We = Object.prototype.toString, Ge = "[object Uint8Array]";
|
|
6643
|
+
function Ke(e, t, n) {
|
|
6644
|
+
return e ? e.constructor === t || We.call(e) === n : !1;
|
|
6648
6645
|
}
|
|
6649
6646
|
function qe(e) {
|
|
6650
|
-
|
|
6647
|
+
return Ke(e, Uint8Array, Ge);
|
|
6648
|
+
}
|
|
6649
|
+
function Je(e) {
|
|
6650
|
+
if (!qe(e)) throw TypeError(`Expected \`Uint8Array\`, got \`${typeof e}\``);
|
|
6651
6651
|
}
|
|
6652
|
-
function
|
|
6652
|
+
function Ye(e, t) {
|
|
6653
6653
|
if (e.length === 0) return /* @__PURE__ */ new Uint8Array();
|
|
6654
6654
|
t ??= e.reduce((e, t) => e + t.length, 0);
|
|
6655
6655
|
let n = new Uint8Array(t), r = 0;
|
|
6656
|
-
for (let t of e)
|
|
6656
|
+
for (let t of e) Je(t), n.set(t, r), r += t.length;
|
|
6657
6657
|
return n;
|
|
6658
6658
|
}
|
|
6659
6659
|
new globalThis.TextDecoder("utf8"), new globalThis.TextEncoder(), Array.from({ length: 256 }, (e, t) => t.toString(16).padStart(2, "0"));
|
|
6660
|
-
function
|
|
6660
|
+
function M(e) {
|
|
6661
6661
|
let { byteLength: t } = e;
|
|
6662
6662
|
if (t === 6) return e.getUint16(0) * 2 ** 32 + e.getUint32(2);
|
|
6663
6663
|
if (t === 5) return e.getUint8(0) * 2 ** 32 + e.getUint32(1);
|
|
@@ -6668,7 +6668,7 @@ function Ye(e) {
|
|
|
6668
6668
|
}
|
|
6669
6669
|
//#endregion
|
|
6670
6670
|
//#region node_modules/file-type/source/tokens.js
|
|
6671
|
-
function
|
|
6671
|
+
function N(e, t) {
|
|
6672
6672
|
if (t === "utf-16le") {
|
|
6673
6673
|
let t = [];
|
|
6674
6674
|
for (let n = 0; n < e.length; n++) {
|
|
@@ -6687,34 +6687,34 @@ function Xe(e, t) {
|
|
|
6687
6687
|
}
|
|
6688
6688
|
return [...e].map((e) => e.charCodeAt(0));
|
|
6689
6689
|
}
|
|
6690
|
-
function
|
|
6691
|
-
let n = Number.parseInt(new
|
|
6690
|
+
function Xe(e, t = 0) {
|
|
6691
|
+
let n = Number.parseInt(new S(6).get(e, 148).replace(/\0.*$/v, "").trim(), 8);
|
|
6692
6692
|
if (Number.isNaN(n)) return !1;
|
|
6693
6693
|
let r = 256;
|
|
6694
6694
|
for (let n = t; n < t + 148; n++) r += e[n];
|
|
6695
6695
|
for (let n = t + 156; n < t + 512; n++) r += e[n];
|
|
6696
6696
|
return n === r;
|
|
6697
6697
|
}
|
|
6698
|
-
var
|
|
6698
|
+
var Ze = {
|
|
6699
6699
|
get: (e, t) => e[t + 3] & 127 | (e[t + 2] & 127) << 7 | (e[t + 1] & 127) << 14 | (e[t] & 127) << 21,
|
|
6700
6700
|
len: 4
|
|
6701
|
-
},
|
|
6702
|
-
function
|
|
6703
|
-
if (!Number.isFinite(e) || e < 0 || e > t) throw new
|
|
6701
|
+
}, Qe = /* @__PURE__ */ "jpg,png,apng,gif,webp,flif,xcf,cr2,cr3,orf,arw,dng,nef,rw2,raf,tif,bmp,icns,jxr,psd,indd,zip,tar,rar,gz,bz2,7z,dmg,mp4,mid,mkv,webm,mov,avi,mpg,mp2,mp3,m4a,oga,ogg,ogv,opus,flac,wav,spx,amr,pdf,epub,elf,macho,exe,swf,rtf,wasm,woff,woff2,eot,ttf,otf,ttc,ico,flv,ps,xz,sqlite,nes,crx,xpi,cab,deb,ar,rpm,Z,lz,cfb,mxf,mts,blend,bpg,docx,pptx,xlsx,3gp,3g2,j2c,jp2,jpm,jpx,mj2,aif,qcp,odt,ods,odp,xml,mobi,heic,cur,ktx,ape,wv,dcm,ics,glb,pcap,dsf,lnk,alias,voc,ac3,m4v,m4p,m4b,f4v,f4p,f4b,f4a,mie,asf,ogm,ogx,mpc,arrow,shp,aac,mp1,it,s3m,xm,skp,avif,eps,lzh,pgp,asar,stl,chm,3mf,zst,jxl,vcf,jls,pst,dwg,parquet,class,arj,cpio,ace,avro,icc,fbx,vsdx,vtt,apk,drc,lz4,potx,xltx,dotx,xltm,ott,ots,otp,odg,otg,xlsm,docm,dotm,potm,pptm,jar,jmp,rm,sav,ppsm,ppsx,tar.gz,reg,dat,key,numbers,pages,iso".split(","), $e = /* @__PURE__ */ "image/jpeg,image/png,image/gif,image/webp,image/flif,image/x-xcf,image/x-canon-cr2,image/x-canon-cr3,image/tiff,image/bmp,image/vnd.ms-photo,image/vnd.adobe.photoshop,application/x-indesign,application/epub+zip,application/x-xpinstall,application/vnd.ms-powerpoint.slideshow.macroenabled.12,application/vnd.oasis.opendocument.text,application/vnd.oasis.opendocument.spreadsheet,application/vnd.oasis.opendocument.presentation,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.presentationml.slideshow,application/zip,application/x-tar,application/x-rar-compressed,application/gzip,application/x-bzip2,application/x-7z-compressed,application/x-apple-diskimage,application/vnd.apache.arrow.file,video/mp4,audio/midi,video/matroska,video/webm,video/quicktime,video/vnd.avi,audio/wav,audio/qcelp,audio/x-ms-asf,video/x-ms-asf,application/vnd.ms-asf,video/mpeg,video/3gpp,audio/mpeg,audio/mp4,video/ogg,audio/ogg,audio/ogg; codecs=opus,application/ogg,audio/flac,audio/ape,audio/wavpack,audio/amr,application/pdf,application/x-elf,application/x-mach-binary,application/x-msdownload,application/x-shockwave-flash,application/rtf,application/wasm,font/woff,font/woff2,application/vnd.ms-fontobject,font/ttf,font/otf,font/collection,image/x-icon,video/x-flv,application/postscript,application/eps,application/x-xz,application/x-sqlite3,application/x-nintendo-nes-rom,application/x-google-chrome-extension,application/vnd.ms-cab-compressed,application/x-deb,application/x-unix-archive,application/x-rpm,application/x-compress,application/lzip,application/x-cfb,application/x-mie,application/mxf,video/mp2t,application/x-blender,image/bpg,image/j2c,image/jp2,image/jpx,image/jpm,image/mj2,audio/aiff,application/xml,application/x-mobipocket-ebook,image/heif,image/heif-sequence,image/heic,image/heic-sequence,image/icns,image/ktx,application/dicom,audio/x-musepack,text/calendar,text/vcard,text/vtt,model/gltf-binary,application/vnd.tcpdump.pcap,audio/x-dsf,application/x-ms-shortcut,application/x-ft-apple.alias,audio/x-voc,audio/vnd.dolby.dd-raw,audio/x-m4a,image/apng,image/x-olympus-orf,image/x-sony-arw,image/x-adobe-dng,image/x-nikon-nef,image/x-panasonic-rw2,image/x-fujifilm-raf,video/x-m4v,video/3gpp2,application/x-esri-shape,audio/aac,audio/x-it,audio/x-s3m,audio/x-xm,video/MP1S,video/MP2P,application/vnd.sketchup.skp,image/avif,application/x-lzh-compressed,application/pgp-encrypted,application/x-asar,model/stl,application/vnd.ms-htmlhelp,model/3mf,image/jxl,application/zstd,image/jls,application/vnd.ms-outlook,image/vnd.dwg,application/vnd.apache.parquet,application/java-vm,application/x-arj,application/x-cpio,application/x-ace-compressed,application/avro,application/vnd.iccprofile,application/x-ft-fbx,application/vnd.visio,application/vnd.android.package-archive,application/x-ft-draco,application/x-lz4,application/vnd.openxmlformats-officedocument.presentationml.template,application/vnd.openxmlformats-officedocument.spreadsheetml.template,application/vnd.openxmlformats-officedocument.wordprocessingml.template,application/vnd.ms-excel.template.macroenabled.12,application/vnd.oasis.opendocument.text-template,application/vnd.oasis.opendocument.spreadsheet-template,application/vnd.oasis.opendocument.presentation-template,application/vnd.oasis.opendocument.graphics,application/vnd.oasis.opendocument.graphics-template,application/vnd.ms-excel.sheet.macroenabled.12,application/vnd.ms-word.document.macroenabled.12,application/vnd.ms-word.template.macroenabled.12,application/vnd.ms-powerpoint.template.macroenabled.12,application/vnd.ms-powerpoint.presentation.macroenabled.12,application/java-archive,application/vnd.rn-realmedia,application/x-spss-sav,application/x-ms-regedit,application/x-ft-windows-registry-hive,application/x-jmp-data,application/vnd.apple.keynote,application/vnd.apple.numbers,application/vnd.apple.pages,application/x-iso9660-image".split(","), P = 16777216, F = class extends Error {};
|
|
6702
|
+
function I(e, t, n) {
|
|
6703
|
+
if (!Number.isFinite(e) || e < 0 || e > t) throw new F(`${n} has invalid size ${e} (maximum ${t} bytes)`);
|
|
6704
6704
|
return e;
|
|
6705
6705
|
}
|
|
6706
|
-
async function
|
|
6707
|
-
let i =
|
|
6706
|
+
async function L(e, t, { maximumLength: n = P, reason: r = "skip" } = {}) {
|
|
6707
|
+
let i = I(t, n, r);
|
|
6708
6708
|
await e.ignore(i);
|
|
6709
6709
|
}
|
|
6710
|
-
async function
|
|
6711
|
-
let a =
|
|
6710
|
+
async function R(e, t, n, { maximumLength: r = t.length, reason: i = "read" } = {}) {
|
|
6711
|
+
let a = I(n?.length ?? t.length, r, i);
|
|
6712
6712
|
return e.readBuffer(t, {
|
|
6713
6713
|
...n,
|
|
6714
6714
|
length: a
|
|
6715
6715
|
});
|
|
6716
6716
|
}
|
|
6717
|
-
function
|
|
6717
|
+
function z(e, t, n) {
|
|
6718
6718
|
n = {
|
|
6719
6719
|
offset: 0,
|
|
6720
6720
|
...n
|
|
@@ -6724,31 +6724,31 @@ function R(e, t, n) {
|
|
|
6724
6724
|
} else if (i !== e[r + n.offset]) return !1;
|
|
6725
6725
|
return !0;
|
|
6726
6726
|
}
|
|
6727
|
-
function
|
|
6727
|
+
function B(e) {
|
|
6728
6728
|
let t = e.fileInfo.size;
|
|
6729
6729
|
return !Number.isFinite(t) || t === 2 ** 53 - 1;
|
|
6730
6730
|
}
|
|
6731
|
-
function
|
|
6732
|
-
return
|
|
6731
|
+
function V(e, t, n) {
|
|
6732
|
+
return B(e) && e.position - t > n;
|
|
6733
6733
|
}
|
|
6734
6734
|
//#endregion
|
|
6735
6735
|
//#region node_modules/file-type/source/detectors/zip.js
|
|
6736
|
-
var
|
|
6736
|
+
var H = 1048576, U = 1024, et = 2 ** 31 - 1, W = H, tt = /* @__PURE__ */ new Set([
|
|
6737
6737
|
"Unexpected signature",
|
|
6738
6738
|
"Encrypted ZIP",
|
|
6739
6739
|
"Expected Central-File-Header signature"
|
|
6740
|
-
]),
|
|
6740
|
+
]), nt = [
|
|
6741
6741
|
"ZIP entry count exceeds ",
|
|
6742
6742
|
"Unsupported ZIP compression method:",
|
|
6743
6743
|
"ZIP entry compressed data exceeds ",
|
|
6744
6744
|
"ZIP entry decompressed data exceeds ",
|
|
6745
6745
|
"Expected data-descriptor-signature at position "
|
|
6746
|
-
],
|
|
6746
|
+
], rt = /* @__PURE__ */ new Set([
|
|
6747
6747
|
"Z_BUF_ERROR",
|
|
6748
6748
|
"Z_DATA_ERROR",
|
|
6749
6749
|
"ERR_INVALID_STATE"
|
|
6750
6750
|
]);
|
|
6751
|
-
async function
|
|
6751
|
+
async function it(e, { maximumLength: t = H } = {}) {
|
|
6752
6752
|
let n = new ReadableStream({ start(t) {
|
|
6753
6753
|
t.enqueue(e), t.close();
|
|
6754
6754
|
} }).pipeThrough(new DecompressionStream("deflate-raw")).getReader(), r = [], i = 0;
|
|
@@ -6768,28 +6768,28 @@ async function at(e, { maximumLength: t = V } = {}) {
|
|
|
6768
6768
|
for (let e of r) a.set(e, o), o += e.length;
|
|
6769
6769
|
return a;
|
|
6770
6770
|
}
|
|
6771
|
-
function
|
|
6771
|
+
function at(e, t) {
|
|
6772
6772
|
let n = new Uint8Array(t), r = 0;
|
|
6773
6773
|
for (let t of e) n.set(t, r), r += t.length;
|
|
6774
6774
|
return n;
|
|
6775
6775
|
}
|
|
6776
|
-
function
|
|
6776
|
+
function ot(e) {
|
|
6777
6777
|
let t = e.fileInfo.size, n = Number.isFinite(t) ? Math.max(0, t - e.position) : 2 ** 53 - 1;
|
|
6778
|
-
return Math.min(n,
|
|
6778
|
+
return Math.min(n, et);
|
|
6779
6779
|
}
|
|
6780
|
-
function
|
|
6781
|
-
if (e instanceof
|
|
6780
|
+
function st(e) {
|
|
6781
|
+
if (e instanceof C || e instanceof F) return !0;
|
|
6782
6782
|
if (!(e instanceof Error)) return !1;
|
|
6783
|
-
if (
|
|
6784
|
-
for (let t of
|
|
6783
|
+
if (tt.has(e.message) || rt.has(e.code)) return !0;
|
|
6784
|
+
for (let t of nt) if (e.message.startsWith(t)) return !0;
|
|
6785
6785
|
return !1;
|
|
6786
6786
|
}
|
|
6787
|
-
function
|
|
6787
|
+
function G(e, t = H) {
|
|
6788
6788
|
let n = [e.compressedSize, e.uncompressedSize];
|
|
6789
6789
|
for (let e of n) if (!Number.isFinite(e) || e < 0 || e > t) return !1;
|
|
6790
6790
|
return !0;
|
|
6791
6791
|
}
|
|
6792
|
-
function
|
|
6792
|
+
function ct() {
|
|
6793
6793
|
return {
|
|
6794
6794
|
hasDocumentEntry: !1,
|
|
6795
6795
|
hasMasterSlideEntry: !1,
|
|
@@ -6797,10 +6797,10 @@ function lt() {
|
|
|
6797
6797
|
hasCalculationEngineEntry: !1
|
|
6798
6798
|
};
|
|
6799
6799
|
}
|
|
6800
|
-
function
|
|
6800
|
+
function lt(e, t) {
|
|
6801
6801
|
t === "Index/Document.iwa" && (e.hasDocumentEntry = !0), t.startsWith("Index/MasterSlide") && (e.hasMasterSlideEntry = !0), t.startsWith("Index/Tables/") && (e.hasTablesEntry = !0), t === "Index/CalculationEngine.iwa" && (e.hasCalculationEngineEntry = !0);
|
|
6802
6802
|
}
|
|
6803
|
-
function
|
|
6803
|
+
function K(e) {
|
|
6804
6804
|
if (e.hasDocumentEntry) return e.hasMasterSlideEntry ? {
|
|
6805
6805
|
ext: "key",
|
|
6806
6806
|
mime: "application/vnd.apple.keynote"
|
|
@@ -6812,7 +6812,7 @@ function G(e) {
|
|
|
6812
6812
|
mime: "application/vnd.apple.pages"
|
|
6813
6813
|
};
|
|
6814
6814
|
}
|
|
6815
|
-
function
|
|
6815
|
+
function q(e) {
|
|
6816
6816
|
switch (e = e.toLowerCase(), e) {
|
|
6817
6817
|
case "application/epub+zip": return {
|
|
6818
6818
|
ext: "epub",
|
|
@@ -6916,7 +6916,7 @@ function K(e) {
|
|
|
6916
6916
|
};
|
|
6917
6917
|
}
|
|
6918
6918
|
}
|
|
6919
|
-
function
|
|
6919
|
+
function ut() {
|
|
6920
6920
|
return {
|
|
6921
6921
|
hasContentTypesEntry: !1,
|
|
6922
6922
|
hasParsedContentTypesEntry: !1,
|
|
@@ -6928,10 +6928,10 @@ function dt() {
|
|
|
6928
6928
|
hasThreeDimensionalModelEntry: !1
|
|
6929
6929
|
};
|
|
6930
6930
|
}
|
|
6931
|
-
function
|
|
6931
|
+
function dt(e, t) {
|
|
6932
6932
|
t.startsWith("word/") && (e.hasWordDirectory = !0), t.startsWith("ppt/") && (e.hasPresentationDirectory = !0), t.startsWith("xl/") && (e.hasSpreadsheetDirectory = !0), t.startsWith("3D/") && t.endsWith(".model") && (e.hasThreeDimensionalModelEntry = !0);
|
|
6933
6933
|
}
|
|
6934
|
-
function
|
|
6934
|
+
function J(e) {
|
|
6935
6935
|
if (e.hasWordDirectory) return {
|
|
6936
6936
|
ext: "docx",
|
|
6937
6937
|
mime: "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
|
@@ -6949,10 +6949,10 @@ function q(e) {
|
|
|
6949
6949
|
mime: "model/3mf"
|
|
6950
6950
|
};
|
|
6951
6951
|
}
|
|
6952
|
-
function
|
|
6953
|
-
if (!(!e.hasContentTypesEntry || e.hasUnparseableContentTypes || e.isParsingContentTypes || e.hasParsedContentTypesEntry)) return
|
|
6952
|
+
function Y(e) {
|
|
6953
|
+
if (!(!e.hasContentTypesEntry || e.hasUnparseableContentTypes || e.isParsingContentTypes || e.hasParsedContentTypesEntry)) return J(e);
|
|
6954
6954
|
}
|
|
6955
|
-
function
|
|
6955
|
+
function ft(e) {
|
|
6956
6956
|
let t = e.indexOf(".main+xml\"");
|
|
6957
6957
|
if (t === -1) {
|
|
6958
6958
|
let t = "application/vnd.ms-package.3dmanufacturing-3dmodel+xml";
|
|
@@ -6961,78 +6961,78 @@ function pt(e) {
|
|
|
6961
6961
|
let n = e.slice(0, t), r = n.lastIndexOf("\"");
|
|
6962
6962
|
return n.slice(r + 1);
|
|
6963
6963
|
}
|
|
6964
|
-
var
|
|
6964
|
+
var pt = 134695760, X = 16, mt = 15;
|
|
6965
6965
|
function ht(e, t) {
|
|
6966
6966
|
if (e.length < X) return -1;
|
|
6967
6967
|
let n = e.length - X;
|
|
6968
|
-
for (let r = 0; r <= n; r++) if (x.get(e, r) ===
|
|
6968
|
+
for (let r = 0; r <= n; r++) if (x.get(e, r) === pt && x.get(e, r + 8) === t + r) return r;
|
|
6969
6969
|
return -1;
|
|
6970
6970
|
}
|
|
6971
|
-
async function gt(e, { shouldBuffer: t, maximumLength: n =
|
|
6971
|
+
async function gt(e, { shouldBuffer: t, maximumLength: n = H } = {}) {
|
|
6972
6972
|
let { syncBuffer: r } = e, { length: i } = r, a = [], o = 0;
|
|
6973
6973
|
for (;;) {
|
|
6974
6974
|
let s = await e.tokenizer.peekBuffer(r, { mayBeLess: !0 }), c = ht(r.subarray(0, s), o), l = c >= 0 ? 0 : s === i ? Math.min(mt, s - 1) : 0, u = c >= 0 ? c : s - l;
|
|
6975
6975
|
if (u === 0) break;
|
|
6976
|
-
if (o += u, o > n) throw
|
|
6976
|
+
if (o += u, o > n) throw new F(`ZIP entry data descriptor not found within ${n} bytes`);
|
|
6977
6977
|
if (t) {
|
|
6978
6978
|
let t = new Uint8Array(u);
|
|
6979
6979
|
await e.tokenizer.readBuffer(t), a.push(t);
|
|
6980
6980
|
} else await e.tokenizer.ignore(u);
|
|
6981
6981
|
if (c >= 0) break;
|
|
6982
6982
|
}
|
|
6983
|
-
if (
|
|
6983
|
+
if (B(e.tokenizer) || (e.knownSizeDescriptorScannedBytes += o), t) return at(a, o);
|
|
6984
6984
|
}
|
|
6985
6985
|
function _t(e, t) {
|
|
6986
|
-
return
|
|
6986
|
+
return B(e.tokenizer) ? Math.max(0, P - (e.tokenizer.position - t)) : Math.max(0, H - e.knownSizeDescriptorScannedBytes);
|
|
6987
6987
|
}
|
|
6988
|
-
async function vt(e, t, { shouldBuffer: n, maximumDescriptorLength: r =
|
|
6988
|
+
async function vt(e, t, { shouldBuffer: n, maximumDescriptorLength: r = H } = {}) {
|
|
6989
6989
|
if (t.dataDescriptor && t.compressedSize === 0) return gt(e, {
|
|
6990
6990
|
shouldBuffer: n,
|
|
6991
6991
|
maximumLength: r
|
|
6992
6992
|
});
|
|
6993
6993
|
if (!n) {
|
|
6994
|
-
await
|
|
6995
|
-
maximumLength:
|
|
6994
|
+
await L(e.tokenizer, t.compressedSize, {
|
|
6995
|
+
maximumLength: B(e.tokenizer) ? H : e.tokenizer.fileInfo.size,
|
|
6996
6996
|
reason: "ZIP entry compressed data"
|
|
6997
6997
|
});
|
|
6998
6998
|
return;
|
|
6999
6999
|
}
|
|
7000
|
-
let i =
|
|
7000
|
+
let i = ot(e.tokenizer);
|
|
7001
7001
|
if (!Number.isFinite(t.compressedSize) || t.compressedSize < 0 || t.compressedSize > i) throw Error(`ZIP entry compressed data exceeds ${i} bytes`);
|
|
7002
7002
|
let a = new Uint8Array(t.compressedSize);
|
|
7003
7003
|
return await e.tokenizer.readBuffer(a), a;
|
|
7004
7004
|
}
|
|
7005
|
-
|
|
7005
|
+
j.prototype.inflate = async function(e, t, n) {
|
|
7006
7006
|
if (e.compressedMethod === 0) return n(t);
|
|
7007
7007
|
if (e.compressedMethod !== 8) throw Error(`Unsupported ZIP compression method: ${e.compressedMethod}`);
|
|
7008
|
-
return n(await
|
|
7009
|
-
},
|
|
7008
|
+
return n(await it(t, { maximumLength: H }));
|
|
7009
|
+
}, j.prototype.unzip = async function(e) {
|
|
7010
7010
|
let t = !1, n = 0, r = this.tokenizer.position;
|
|
7011
7011
|
this.knownSizeDescriptorScannedBytes = 0;
|
|
7012
7012
|
do {
|
|
7013
|
-
if (
|
|
7013
|
+
if (V(this.tokenizer, r, 16777216)) throw new F(`ZIP stream probing exceeds ${P} bytes`);
|
|
7014
7014
|
let i = await this.readLocalFileHeader();
|
|
7015
7015
|
if (!i) break;
|
|
7016
|
-
if (n++, n >
|
|
7016
|
+
if (n++, n > U) throw Error(`ZIP entry count exceeds ${U}`);
|
|
7017
7017
|
let a = e(i);
|
|
7018
7018
|
t = !!a.stop, await this.tokenizer.ignore(i.extraFieldLength);
|
|
7019
7019
|
let o = await vt(this, i, {
|
|
7020
7020
|
shouldBuffer: !!a.handler,
|
|
7021
|
-
maximumDescriptorLength: Math.min(
|
|
7021
|
+
maximumDescriptorLength: Math.min(H, _t(this, r))
|
|
7022
7022
|
});
|
|
7023
7023
|
if (a.handler && await this.inflate(i, o, a.handler), i.dataDescriptor) {
|
|
7024
7024
|
let e = new Uint8Array(X);
|
|
7025
|
-
if (await this.tokenizer.readBuffer(e), x.get(e, 0) !==
|
|
7025
|
+
if (await this.tokenizer.readBuffer(e), x.get(e, 0) !== pt) throw Error(`Expected data-descriptor-signature at position ${this.tokenizer.position - e.length}`);
|
|
7026
7026
|
}
|
|
7027
|
-
if (
|
|
7027
|
+
if (V(this.tokenizer, r, 16777216)) throw new F(`ZIP stream probing exceeds ${P} bytes`);
|
|
7028
7028
|
} while (!t);
|
|
7029
7029
|
};
|
|
7030
7030
|
async function yt(e) {
|
|
7031
|
-
let t, n =
|
|
7031
|
+
let t, n = ut(), r = ct();
|
|
7032
7032
|
try {
|
|
7033
|
-
await new
|
|
7034
|
-
if (
|
|
7035
|
-
let i = e.filename === "[Content_Types].xml", a =
|
|
7033
|
+
await new j(e).unzip((e) => {
|
|
7034
|
+
if (dt(n, e.filename), lt(r, e.filename), r.hasDocumentEntry && (r.hasMasterSlideEntry || r.hasTablesEntry)) return t = K(r), { stop: !0 };
|
|
7035
|
+
let i = e.filename === "[Content_Types].xml", a = Y(n);
|
|
7036
7036
|
if (!i && a) return t = a, { stop: !0 };
|
|
7037
7037
|
switch (e.filename) {
|
|
7038
7038
|
case "META-INF/mozilla.rsa": return t = {
|
|
@@ -7043,16 +7043,16 @@ async function yt(e) {
|
|
|
7043
7043
|
ext: "jar",
|
|
7044
7044
|
mime: "application/java-archive"
|
|
7045
7045
|
}, { stop: !0 };
|
|
7046
|
-
case "mimetype": return
|
|
7046
|
+
case "mimetype": return G(e, W) ? {
|
|
7047
7047
|
async handler(e) {
|
|
7048
|
-
t =
|
|
7048
|
+
t = q(new TextDecoder("utf-8").decode(e).trim());
|
|
7049
7049
|
},
|
|
7050
7050
|
stop: !0
|
|
7051
7051
|
} : {};
|
|
7052
|
-
case "[Content_Types].xml": return n.hasContentTypesEntry = !0,
|
|
7052
|
+
case "[Content_Types].xml": return n.hasContentTypesEntry = !0, G(e, W) ? (n.isParsingContentTypes = !0, {
|
|
7053
7053
|
async handler(e) {
|
|
7054
|
-
let r =
|
|
7055
|
-
r && (t =
|
|
7054
|
+
let r = ft(new TextDecoder("utf-8").decode(e));
|
|
7055
|
+
r && (t = q(r)), n.hasParsedContentTypesEntry = !0, n.isParsingContentTypes = !1;
|
|
7056
7056
|
},
|
|
7057
7057
|
stop: !0
|
|
7058
7058
|
}) : (n.hasUnparseableContentTypes = !0, {});
|
|
@@ -7063,11 +7063,11 @@ async function yt(e) {
|
|
|
7063
7063
|
}
|
|
7064
7064
|
});
|
|
7065
7065
|
} catch (e) {
|
|
7066
|
-
if (!
|
|
7067
|
-
n.isParsingContentTypes && (n.isParsingContentTypes = !1, n.hasUnparseableContentTypes = !0), !t && e instanceof
|
|
7066
|
+
if (!st(e)) throw e;
|
|
7067
|
+
n.isParsingContentTypes && (n.isParsingContentTypes = !1, n.hasUnparseableContentTypes = !0), !t && (e instanceof C || e instanceof F) && !n.hasContentTypesEntry && (t = J(n));
|
|
7068
7068
|
}
|
|
7069
|
-
let i =
|
|
7070
|
-
return t ??
|
|
7069
|
+
let i = B(e) && r.hasDocumentEntry && !r.hasMasterSlideEntry && !r.hasTablesEntry && !r.hasCalculationEngineEntry ? void 0 : K(r);
|
|
7070
|
+
return t ?? Y(n) ?? i ?? {
|
|
7071
7071
|
ext: "zip",
|
|
7072
7072
|
mime: "application/zip"
|
|
7073
7073
|
};
|
|
@@ -7080,7 +7080,7 @@ async function Ct(e) {
|
|
|
7080
7080
|
let t = await e.peekNumber(ge), n = 128, r = 0;
|
|
7081
7081
|
for (; (t & n) === 0 && n !== 0;) ++r, n >>= 1;
|
|
7082
7082
|
let i = new Uint8Array(r + 1);
|
|
7083
|
-
return await
|
|
7083
|
+
return await R(e, i, void 0, {
|
|
7084
7084
|
maximumLength: i.length,
|
|
7085
7085
|
reason: "EBML field"
|
|
7086
7086
|
}), i;
|
|
@@ -7090,22 +7090,22 @@ async function Ct(e) {
|
|
|
7090
7090
|
n[0] ^= 128 >> n.length - 1;
|
|
7091
7091
|
let r = Math.min(6, n.length), i = new DataView(e.buffer), a = new DataView(n.buffer, n.length - r, r);
|
|
7092
7092
|
return {
|
|
7093
|
-
id:
|
|
7094
|
-
len:
|
|
7093
|
+
id: M(i),
|
|
7094
|
+
len: M(a)
|
|
7095
7095
|
};
|
|
7096
7096
|
}
|
|
7097
7097
|
async function r(t) {
|
|
7098
7098
|
let r = 0;
|
|
7099
7099
|
for (; t > 0;) {
|
|
7100
|
-
if (r++, r > St ||
|
|
7100
|
+
if (r++, r > St || V(e, a, 16777216)) return;
|
|
7101
7101
|
let i = e.position, o = await n();
|
|
7102
7102
|
if (o.id === 17026) {
|
|
7103
7103
|
if (o.len > bt) return;
|
|
7104
|
-
let t =
|
|
7105
|
-
return (await e.readToken(new
|
|
7104
|
+
let t = I(o.len, bt, "EBML DocType");
|
|
7105
|
+
return (await e.readToken(new S(t))).replaceAll(/\0.*$/gv, "");
|
|
7106
7106
|
}
|
|
7107
|
-
if (
|
|
7108
|
-
maximumLength:
|
|
7107
|
+
if (B(e) && (!Number.isFinite(o.len) || o.len < 0 || o.len > xt) || (await L(e, o.len, {
|
|
7108
|
+
maximumLength: B(e) ? xt : e.fileInfo.size,
|
|
7109
7109
|
reason: "EBML payload"
|
|
7110
7110
|
}), --t, e.position <= i)) return;
|
|
7111
7111
|
}
|
|
@@ -7139,13 +7139,13 @@ async function Ot(e) {
|
|
|
7139
7139
|
await e.ignore(8);
|
|
7140
7140
|
async function r() {
|
|
7141
7141
|
return {
|
|
7142
|
-
length: await e.readToken(
|
|
7143
|
-
type: await e.readToken(new
|
|
7142
|
+
length: await e.readToken(ve),
|
|
7143
|
+
type: await e.readToken(new S(4, "latin1"))
|
|
7144
7144
|
};
|
|
7145
7145
|
}
|
|
7146
|
-
let i =
|
|
7146
|
+
let i = B(e), a = e.position, o = 0, s = !1;
|
|
7147
7147
|
do {
|
|
7148
|
-
if (o++, o > wt ||
|
|
7148
|
+
if (o++, o > wt || V(e, a, Tt)) break;
|
|
7149
7149
|
let c = e.position, l = await r();
|
|
7150
7150
|
if (l.length < 0) return;
|
|
7151
7151
|
if (l.type === "IHDR") {
|
|
@@ -7159,12 +7159,12 @@ async function Ot(e) {
|
|
|
7159
7159
|
if (!s && l.type !== "CgBI") return;
|
|
7160
7160
|
if (i && l.length > Et) return s && Dt(l.type) ? t : void 0;
|
|
7161
7161
|
try {
|
|
7162
|
-
await
|
|
7162
|
+
await L(e, l.length + 4, {
|
|
7163
7163
|
maximumLength: i ? 1048580 : e.fileInfo.size,
|
|
7164
7164
|
reason: "PNG chunk payload"
|
|
7165
7165
|
});
|
|
7166
7166
|
} catch (e) {
|
|
7167
|
-
if (!i && (e instanceof
|
|
7167
|
+
if (!i && (e instanceof F || e instanceof C)) return t;
|
|
7168
7168
|
throw e;
|
|
7169
7169
|
}
|
|
7170
7170
|
}
|
|
@@ -7174,32 +7174,32 @@ async function Ot(e) {
|
|
|
7174
7174
|
}
|
|
7175
7175
|
//#endregion
|
|
7176
7176
|
//#region node_modules/file-type/source/detectors/asf.js
|
|
7177
|
-
var kt = 512,
|
|
7178
|
-
async function
|
|
7177
|
+
var kt = 512, Z = 1048576;
|
|
7178
|
+
async function At(e) {
|
|
7179
7179
|
let t = !1;
|
|
7180
7180
|
try {
|
|
7181
7181
|
async function n() {
|
|
7182
7182
|
let t = /* @__PURE__ */ new Uint8Array(16);
|
|
7183
|
-
return await
|
|
7183
|
+
return await R(e, t, void 0, {
|
|
7184
7184
|
maximumLength: t.length,
|
|
7185
7185
|
reason: "ASF header GUID"
|
|
7186
7186
|
}), {
|
|
7187
7187
|
id: t,
|
|
7188
|
-
size: Number(await e.readToken(
|
|
7188
|
+
size: Number(await e.readToken(ye))
|
|
7189
7189
|
};
|
|
7190
7190
|
}
|
|
7191
|
-
await
|
|
7191
|
+
await L(e, 30, {
|
|
7192
7192
|
maximumLength: 30,
|
|
7193
7193
|
reason: "ASF header prelude"
|
|
7194
7194
|
});
|
|
7195
|
-
let r =
|
|
7196
|
-
for (; e.position + 24 < e.fileInfo.size && (a++, !(a > kt ||
|
|
7195
|
+
let r = B(e), i = e.position, a = 0;
|
|
7196
|
+
for (; e.position + 24 < e.fileInfo.size && (a++, !(a > kt || V(e, i, 16777216)));) {
|
|
7197
7197
|
let i = e.position, a = await n(), o = a.size - 24;
|
|
7198
7198
|
if (!Number.isFinite(o) || o < 0) {
|
|
7199
7199
|
t = !0;
|
|
7200
7200
|
break;
|
|
7201
7201
|
}
|
|
7202
|
-
if (
|
|
7202
|
+
if (z(a.id, [
|
|
7203
7203
|
145,
|
|
7204
7204
|
7,
|
|
7205
7205
|
220,
|
|
@@ -7218,10 +7218,10 @@ async function jt(e) {
|
|
|
7218
7218
|
101
|
|
7219
7219
|
])) {
|
|
7220
7220
|
let t = /* @__PURE__ */ new Uint8Array(16);
|
|
7221
|
-
if (o -= await
|
|
7221
|
+
if (o -= await R(e, t, void 0, {
|
|
7222
7222
|
maximumLength: t.length,
|
|
7223
7223
|
reason: "ASF stream type GUID"
|
|
7224
|
-
}),
|
|
7224
|
+
}), z(t, [
|
|
7225
7225
|
64,
|
|
7226
7226
|
158,
|
|
7227
7227
|
105,
|
|
@@ -7242,7 +7242,7 @@ async function jt(e) {
|
|
|
7242
7242
|
ext: "asf",
|
|
7243
7243
|
mime: "audio/x-ms-asf"
|
|
7244
7244
|
};
|
|
7245
|
-
if (
|
|
7245
|
+
if (z(t, [
|
|
7246
7246
|
192,
|
|
7247
7247
|
239,
|
|
7248
7248
|
25,
|
|
@@ -7265,12 +7265,12 @@ async function jt(e) {
|
|
|
7265
7265
|
};
|
|
7266
7266
|
break;
|
|
7267
7267
|
}
|
|
7268
|
-
if (r && o >
|
|
7268
|
+
if (r && o > Z) {
|
|
7269
7269
|
t = !0;
|
|
7270
7270
|
break;
|
|
7271
7271
|
}
|
|
7272
|
-
if (await
|
|
7273
|
-
maximumLength: r ?
|
|
7272
|
+
if (await L(e, o, {
|
|
7273
|
+
maximumLength: r ? Z : e.fileInfo.size,
|
|
7274
7274
|
reason: "ASF header payload"
|
|
7275
7275
|
}), e.position <= i) {
|
|
7276
7276
|
t = !0;
|
|
@@ -7278,7 +7278,7 @@ async function jt(e) {
|
|
|
7278
7278
|
}
|
|
7279
7279
|
}
|
|
7280
7280
|
} catch (n) {
|
|
7281
|
-
if (n instanceof
|
|
7281
|
+
if (n instanceof C || n instanceof F) B(e) && (t = !0);
|
|
7282
7282
|
else throw n;
|
|
7283
7283
|
}
|
|
7284
7284
|
if (!t) return {
|
|
@@ -7288,18 +7288,22 @@ async function jt(e) {
|
|
|
7288
7288
|
}
|
|
7289
7289
|
//#endregion
|
|
7290
7290
|
//#region node_modules/file-type/source/index.js
|
|
7291
|
-
var
|
|
7291
|
+
var Q = 4100, jt = 4096, Mt = P, Nt = 1, Pt = 100, $ = P, Ft = 512, It = 256, Lt = 1048576, Rt = P;
|
|
7292
7292
|
function zt(e) {
|
|
7293
|
-
return Number.isFinite(e) ? Math.max(1, Math.trunc(e)) :
|
|
7293
|
+
return Number.isFinite(e) ? Math.max(1, Math.trunc(e)) : Q;
|
|
7294
7294
|
}
|
|
7295
7295
|
function Bt(e) {
|
|
7296
|
-
return Number.isFinite(e) ? Math.max(0, Math.min(
|
|
7296
|
+
return Number.isFinite(e) ? Math.max(0, Math.min(jt, Math.trunc(e))) : 0;
|
|
7297
7297
|
}
|
|
7298
7298
|
function Vt(e) {
|
|
7299
7299
|
return Number.isFinite(e) ? Math.max(0, e) : 2 ** 53 - 1;
|
|
7300
7300
|
}
|
|
7301
7301
|
function Ht(e) {
|
|
7302
|
-
return import(
|
|
7302
|
+
return import(
|
|
7303
|
+
/* @vite-ignore */
|
|
7304
|
+
/* webpackIgnore: true */
|
|
7305
|
+
e
|
|
7306
|
+
);
|
|
7303
7307
|
}
|
|
7304
7308
|
function Ut(e) {
|
|
7305
7309
|
return e.pipeThrough(new TransformStream());
|
|
@@ -7363,7 +7367,7 @@ var qt = class e {
|
|
|
7363
7367
|
return { ...this.tokenizerOptions };
|
|
7364
7368
|
}
|
|
7365
7369
|
createTokenizerFromWebStream(e) {
|
|
7366
|
-
return
|
|
7370
|
+
return je(Ut(e), this.getTokenizerOptions());
|
|
7367
7371
|
}
|
|
7368
7372
|
async parseTokenizer(e, t = 0) {
|
|
7369
7373
|
this.detectionReentryCount = t;
|
|
@@ -7373,7 +7377,7 @@ var qt = class e {
|
|
|
7373
7377
|
try {
|
|
7374
7378
|
r = await t.detect(e);
|
|
7375
7379
|
} catch (e) {
|
|
7376
|
-
if (e instanceof
|
|
7380
|
+
if (e instanceof C || e instanceof F) return;
|
|
7377
7381
|
throw e;
|
|
7378
7382
|
}
|
|
7379
7383
|
if (r) return r;
|
|
@@ -7390,11 +7394,11 @@ var qt = class e {
|
|
|
7390
7394
|
async fromBuffer(e) {
|
|
7391
7395
|
if (!(e instanceof Uint8Array || e instanceof ArrayBuffer)) throw TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``);
|
|
7392
7396
|
let t = e instanceof Uint8Array ? e : new Uint8Array(e);
|
|
7393
|
-
if (t?.length > 1) return this.fromTokenizer(
|
|
7397
|
+
if (t?.length > 1) return this.fromTokenizer(Me(t, this.getTokenizerOptions()));
|
|
7394
7398
|
}
|
|
7395
7399
|
async fromBlob(e) {
|
|
7396
7400
|
this.options.signal?.throwIfAborted();
|
|
7397
|
-
let t =
|
|
7401
|
+
let t = Ne(e, this.getTokenizerOptions());
|
|
7398
7402
|
return this.fromTokenizer(t);
|
|
7399
7403
|
}
|
|
7400
7404
|
async fromStream(e) {
|
|
@@ -7438,11 +7442,11 @@ var qt = class e {
|
|
|
7438
7442
|
a.releaseLock();
|
|
7439
7443
|
}
|
|
7440
7444
|
if (s > 0) {
|
|
7441
|
-
let e = o.length === 1 ? o[0] :
|
|
7445
|
+
let e = o.length === 1 ? o[0] : Ye(o);
|
|
7442
7446
|
try {
|
|
7443
7447
|
r = await this.fromBuffer(e.subarray(0, n));
|
|
7444
7448
|
} catch (e) {
|
|
7445
|
-
if (!(e instanceof
|
|
7449
|
+
if (!(e instanceof C)) throw e;
|
|
7446
7450
|
r = void 0;
|
|
7447
7451
|
}
|
|
7448
7452
|
!i && r?.ext === "pages" && (r = {
|
|
@@ -7461,16 +7465,16 @@ var qt = class e {
|
|
|
7461
7465
|
return l.fileType = r, l;
|
|
7462
7466
|
}
|
|
7463
7467
|
async detectGzip(t) {
|
|
7464
|
-
if (this.gzipProbeDepth >=
|
|
7468
|
+
if (this.gzipProbeDepth >= Nt) return {
|
|
7465
7469
|
ext: "gz",
|
|
7466
7470
|
mime: "application/gzip"
|
|
7467
7471
|
};
|
|
7468
|
-
let n = Gt(new
|
|
7472
|
+
let n = Gt(new Ue(t).inflate(), Mt), r = B(t), i, a, o, s;
|
|
7469
7473
|
if (r) {
|
|
7470
7474
|
let t = new AbortController();
|
|
7471
7475
|
i = setTimeout(() => {
|
|
7472
|
-
t.abort(new DOMException(`Operation timed out after ${
|
|
7473
|
-
},
|
|
7476
|
+
t.abort(new DOMException(`Operation timed out after ${Pt} ms`, "TimeoutError"));
|
|
7477
|
+
}, Pt), a = this.options.signal === void 0 ? t.signal : AbortSignal.any([this.options.signal, t.signal]), o = new e({
|
|
7474
7478
|
...this.options,
|
|
7475
7479
|
signal: a
|
|
7476
7480
|
}), o.gzipProbeDepth = this.gzipProbeDepth + 1;
|
|
@@ -7491,13 +7495,13 @@ var qt = class e {
|
|
|
7491
7495
|
};
|
|
7492
7496
|
}
|
|
7493
7497
|
check(e, t) {
|
|
7494
|
-
return
|
|
7498
|
+
return z(this.buffer, e, t);
|
|
7495
7499
|
}
|
|
7496
7500
|
checkString(e, t) {
|
|
7497
|
-
return this.check(
|
|
7501
|
+
return this.check(N(e, t?.encoding), t);
|
|
7498
7502
|
}
|
|
7499
7503
|
detectConfident = async (e) => {
|
|
7500
|
-
if (this.buffer = new Uint8Array(
|
|
7504
|
+
if (this.buffer = new Uint8Array(Q), e.fileInfo.size === void 0 && (e.fileInfo.size = 2 ** 53 - 1), this.tokenizer = e, B(e) && (await e.peekBuffer(this.buffer, {
|
|
7501
7505
|
length: 3,
|
|
7502
7506
|
mayBeLess: !0
|
|
7503
7507
|
}), this.check([
|
|
@@ -7550,7 +7554,7 @@ var qt = class e {
|
|
|
7550
7554
|
239,
|
|
7551
7555
|
187,
|
|
7552
7556
|
191
|
|
7553
|
-
])) return this.detectionReentryCount >=
|
|
7557
|
+
])) return this.detectionReentryCount >= It ? void 0 : (this.detectionReentryCount++, await this.tokenizer.ignore(3), this.detectConfident(e));
|
|
7554
7558
|
if (this.check([
|
|
7555
7559
|
71,
|
|
7556
7560
|
73,
|
|
@@ -7581,26 +7585,26 @@ var qt = class e {
|
|
|
7581
7585
|
mime: "application/x-bzip2"
|
|
7582
7586
|
};
|
|
7583
7587
|
if (this.checkString("ID3")) {
|
|
7584
|
-
await
|
|
7588
|
+
await L(e, 6, {
|
|
7585
7589
|
maximumLength: 6,
|
|
7586
7590
|
reason: "ID3 header prefix"
|
|
7587
7591
|
});
|
|
7588
|
-
let t = await e.readToken(
|
|
7589
|
-
if (!Number.isFinite(t) || t < 0 || n && (t >
|
|
7592
|
+
let t = await e.readToken(Ze), n = B(e);
|
|
7593
|
+
if (!Number.isFinite(t) || t < 0 || n && (t > $ || e.position + t > $)) return;
|
|
7590
7594
|
if (e.position + t > e.fileInfo.size) return n ? void 0 : {
|
|
7591
7595
|
ext: "mp3",
|
|
7592
7596
|
mime: "audio/mpeg"
|
|
7593
7597
|
};
|
|
7594
7598
|
try {
|
|
7595
|
-
await
|
|
7596
|
-
maximumLength: n ?
|
|
7599
|
+
await L(e, t, {
|
|
7600
|
+
maximumLength: n ? $ : e.fileInfo.size,
|
|
7597
7601
|
reason: "ID3 payload"
|
|
7598
7602
|
});
|
|
7599
7603
|
} catch (e) {
|
|
7600
|
-
if (e instanceof
|
|
7604
|
+
if (e instanceof C) return;
|
|
7601
7605
|
throw e;
|
|
7602
7606
|
}
|
|
7603
|
-
return this.detectionReentryCount >=
|
|
7607
|
+
return this.detectionReentryCount >= It ? void 0 : (this.detectionReentryCount++, this.parseTokenizer(e, this.detectionReentryCount));
|
|
7604
7608
|
}
|
|
7605
7609
|
if (this.checkString("MP+")) return {
|
|
7606
7610
|
ext: "mpc",
|
|
@@ -7659,7 +7663,7 @@ var qt = class e {
|
|
|
7659
7663
|
if (this.checkString("OggS")) {
|
|
7660
7664
|
await e.ignore(28);
|
|
7661
7665
|
let t = /* @__PURE__ */ new Uint8Array(8);
|
|
7662
|
-
return await e.readBuffer(t),
|
|
7666
|
+
return await e.readBuffer(t), z(t, [
|
|
7663
7667
|
79,
|
|
7664
7668
|
112,
|
|
7665
7669
|
117,
|
|
@@ -7671,7 +7675,7 @@ var qt = class e {
|
|
|
7671
7675
|
]) ? {
|
|
7672
7676
|
ext: "opus",
|
|
7673
7677
|
mime: "audio/ogg; codecs=opus"
|
|
7674
|
-
} :
|
|
7678
|
+
} : z(t, [
|
|
7675
7679
|
128,
|
|
7676
7680
|
116,
|
|
7677
7681
|
104,
|
|
@@ -7682,7 +7686,7 @@ var qt = class e {
|
|
|
7682
7686
|
]) ? {
|
|
7683
7687
|
ext: "ogv",
|
|
7684
7688
|
mime: "video/ogg"
|
|
7685
|
-
} :
|
|
7689
|
+
} : z(t, [
|
|
7686
7690
|
1,
|
|
7687
7691
|
118,
|
|
7688
7692
|
105,
|
|
@@ -7693,7 +7697,7 @@ var qt = class e {
|
|
|
7693
7697
|
]) ? {
|
|
7694
7698
|
ext: "ogm",
|
|
7695
7699
|
mime: "video/ogg"
|
|
7696
|
-
} :
|
|
7700
|
+
} : z(t, [
|
|
7697
7701
|
127,
|
|
7698
7702
|
70,
|
|
7699
7703
|
76,
|
|
@@ -7702,7 +7706,7 @@ var qt = class e {
|
|
|
7702
7706
|
]) ? {
|
|
7703
7707
|
ext: "oga",
|
|
7704
7708
|
mime: "audio/ogg"
|
|
7705
|
-
} :
|
|
7709
|
+
} : z(t, [
|
|
7706
7710
|
83,
|
|
7707
7711
|
112,
|
|
7708
7712
|
101,
|
|
@@ -7713,7 +7717,7 @@ var qt = class e {
|
|
|
7713
7717
|
]) ? {
|
|
7714
7718
|
ext: "spx",
|
|
7715
7719
|
mime: "audio/ogg"
|
|
7716
|
-
} :
|
|
7720
|
+
} : z(t, [
|
|
7717
7721
|
1,
|
|
7718
7722
|
118,
|
|
7719
7723
|
111,
|
|
@@ -8006,7 +8010,7 @@ var qt = class e {
|
|
|
8006
8010
|
186,
|
|
8007
8011
|
190
|
|
8008
8012
|
])) {
|
|
8009
|
-
let e =
|
|
8013
|
+
let e = _e.get(this.buffer, 4), t = b.get(this.buffer, 6);
|
|
8010
8014
|
if (e > 0 && e <= 30) return {
|
|
8011
8015
|
ext: "macho",
|
|
8012
8016
|
mime: "application/x-mach-binary"
|
|
@@ -8066,7 +8070,7 @@ var qt = class e {
|
|
|
8066
8070
|
mime: "model/stl"
|
|
8067
8071
|
};
|
|
8068
8072
|
if (this.checkString("AC")) {
|
|
8069
|
-
let e = new
|
|
8073
|
+
let e = new S(4, "latin1").get(this.buffer, 2);
|
|
8070
8074
|
if (/^\d+$/v.test(e) && e >= 1e3 && e <= 1050) return {
|
|
8071
8075
|
ext: "dwg",
|
|
8072
8076
|
mime: "image/vnd.dwg"
|
|
@@ -8080,7 +8084,7 @@ var qt = class e {
|
|
|
8080
8084
|
ext: "blend",
|
|
8081
8085
|
mime: "application/x-blender"
|
|
8082
8086
|
};
|
|
8083
|
-
if (this.checkString("!<arch>")) return await e.ignore(8), await e.readToken(new
|
|
8087
|
+
if (this.checkString("!<arch>")) return await e.ignore(8), await e.readToken(new S(13, "ascii")) === "debian-binary" ? {
|
|
8084
8088
|
ext: "deb",
|
|
8085
8089
|
mime: "application/x-deb"
|
|
8086
8090
|
} : {
|
|
@@ -8176,7 +8180,7 @@ var qt = class e {
|
|
|
8176
8180
|
mime: "image/x-xcf"
|
|
8177
8181
|
};
|
|
8178
8182
|
if (this.checkString("ftyp", { offset: 4 }) && this.buffer[8] & 96) {
|
|
8179
|
-
let e = new
|
|
8183
|
+
let e = new S(4, "latin1").get(this.buffer, 8).replace("\0", " ").trim();
|
|
8180
8184
|
switch (e) {
|
|
8181
8185
|
case "avif":
|
|
8182
8186
|
case "avis": return {
|
|
@@ -8324,7 +8328,7 @@ var qt = class e {
|
|
|
8324
8328
|
17,
|
|
8325
8329
|
166,
|
|
8326
8330
|
217
|
|
8327
|
-
])) return
|
|
8331
|
+
])) return At(e);
|
|
8328
8332
|
if (this.check([
|
|
8329
8333
|
171,
|
|
8330
8334
|
75,
|
|
@@ -8398,7 +8402,7 @@ var qt = class e {
|
|
|
8398
8402
|
10,
|
|
8399
8403
|
135,
|
|
8400
8404
|
10
|
|
8401
|
-
])) switch (await e.ignore(20), await e.readToken(new
|
|
8405
|
+
])) switch (await e.ignore(20), await e.readToken(new S(4, "ascii"))) {
|
|
8402
8406
|
case "jp2 ": return {
|
|
8403
8407
|
ext: "jp2",
|
|
8404
8408
|
mime: "image/jp2"
|
|
@@ -8691,7 +8695,7 @@ var qt = class e {
|
|
|
8691
8695
|
0,
|
|
8692
8696
|
0,
|
|
8693
8697
|
0
|
|
8694
|
-
], { offset: 257 }) &&
|
|
8698
|
+
], { offset: 257 }) && Xe(this.buffer)) return {
|
|
8695
8699
|
ext: "tar",
|
|
8696
8700
|
mime: "application/x-tar"
|
|
8697
8701
|
};
|
|
@@ -8721,9 +8725,20 @@ var qt = class e {
|
|
|
8721
8725
|
ext: "pgp",
|
|
8722
8726
|
mime: "application/pgp-encrypted"
|
|
8723
8727
|
};
|
|
8728
|
+
if (e.supportsRandomAccess() && e.fileInfo.size >= 32774) {
|
|
8729
|
+
let t = /* @__PURE__ */ new Uint8Array(5);
|
|
8730
|
+
if (await e.peekBuffer(t, {
|
|
8731
|
+
position: 32769,
|
|
8732
|
+
length: 5,
|
|
8733
|
+
mayBeLess: !0
|
|
8734
|
+
}), z(t, N("CD001"))) return {
|
|
8735
|
+
ext: "iso",
|
|
8736
|
+
mime: "application/x-iso9660-image"
|
|
8737
|
+
};
|
|
8738
|
+
}
|
|
8724
8739
|
};
|
|
8725
8740
|
detectImprecise = async (e) => {
|
|
8726
|
-
this.buffer = new Uint8Array(
|
|
8741
|
+
this.buffer = new Uint8Array(Q);
|
|
8727
8742
|
let t = Vt(e.fileInfo.size);
|
|
8728
8743
|
if (await e.peekBuffer(this.buffer, {
|
|
8729
8744
|
length: Math.min(8, t),
|
|
@@ -8793,7 +8808,7 @@ var qt = class e {
|
|
|
8793
8808
|
}
|
|
8794
8809
|
async readTiffIFD(e) {
|
|
8795
8810
|
let t = await this.tokenizer.readToken(e ? b : y);
|
|
8796
|
-
if (!(t >
|
|
8811
|
+
if (!(t > Ft) && !(B(this.tokenizer) && 2 + t * 12 > Rt)) for (let n = 0; n < t; ++n) {
|
|
8797
8812
|
let t = await this.readTiffTag(e);
|
|
8798
8813
|
if (t) return t;
|
|
8799
8814
|
}
|
|
@@ -8802,7 +8817,7 @@ var qt = class e {
|
|
|
8802
8817
|
let t = {
|
|
8803
8818
|
ext: "tif",
|
|
8804
8819
|
mime: "image/tiff"
|
|
8805
|
-
}, n = (e ? b : y).get(this.buffer, 2), r = (e ?
|
|
8820
|
+
}, n = (e ? b : y).get(this.buffer, 2), r = (e ? _e : x).get(this.buffer, 4);
|
|
8806
8821
|
if (n === 42) {
|
|
8807
8822
|
if (r >= 6) {
|
|
8808
8823
|
if (this.checkString("CR", { offset: 8 })) return {
|
|
@@ -8817,22 +8832,22 @@ var qt = class e {
|
|
|
8817
8832
|
};
|
|
8818
8833
|
}
|
|
8819
8834
|
}
|
|
8820
|
-
if (
|
|
8821
|
-
let n =
|
|
8835
|
+
if (B(this.tokenizer) && r > Lt) return t;
|
|
8836
|
+
let n = B(this.tokenizer) ? Rt : this.tokenizer.fileInfo.size;
|
|
8822
8837
|
try {
|
|
8823
|
-
await
|
|
8838
|
+
await L(this.tokenizer, r, {
|
|
8824
8839
|
maximumLength: n,
|
|
8825
8840
|
reason: "TIFF IFD offset"
|
|
8826
8841
|
});
|
|
8827
8842
|
} catch (e) {
|
|
8828
|
-
if (e instanceof
|
|
8843
|
+
if (e instanceof C) return;
|
|
8829
8844
|
throw e;
|
|
8830
8845
|
}
|
|
8831
8846
|
let i;
|
|
8832
8847
|
try {
|
|
8833
8848
|
i = await this.readTiffIFD(e);
|
|
8834
8849
|
} catch (e) {
|
|
8835
|
-
if (e instanceof
|
|
8850
|
+
if (e instanceof C) return;
|
|
8836
8851
|
throw e;
|
|
8837
8852
|
}
|
|
8838
8853
|
return i ?? t;
|
|
@@ -8885,7 +8900,7 @@ var qt = class e {
|
|
|
8885
8900
|
}
|
|
8886
8901
|
}
|
|
8887
8902
|
};
|
|
8888
|
-
new Set(
|
|
8903
|
+
new Set(Qe), new Set($e);
|
|
8889
8904
|
//#endregion
|
|
8890
8905
|
//#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-errors.es.js
|
|
8891
8906
|
var Jt = 2048, Yt = class extends Error {
|
|
@@ -8923,356 +8938,311 @@ function Qt(e) {
|
|
|
8923
8938
|
function $t(e) {
|
|
8924
8939
|
if (e != null && e !== "") return e.length > Jt ? `${e.slice(0, Jt)}... [truncated]` : e;
|
|
8925
8940
|
}
|
|
8926
|
-
//#endregion
|
|
8927
|
-
//#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-encoding.es.js
|
|
8928
8941
|
var en = {
|
|
8929
8942
|
ascii: {
|
|
8930
8943
|
id: "ascii",
|
|
8931
|
-
|
|
8932
|
-
label: "ascii",
|
|
8944
|
+
groupId: null,
|
|
8933
8945
|
isDetectable: !1,
|
|
8934
8946
|
isDecodable: !0
|
|
8935
8947
|
},
|
|
8936
8948
|
big5: {
|
|
8937
8949
|
id: "big5",
|
|
8938
|
-
|
|
8939
|
-
label: "Chinese Traditional (big5)",
|
|
8950
|
+
groupId: "chineseTraditional",
|
|
8940
8951
|
isDetectable: !0,
|
|
8941
8952
|
isDecodable: !0
|
|
8942
8953
|
},
|
|
8943
8954
|
"euc-jp": {
|
|
8944
8955
|
id: "euc-jp",
|
|
8945
|
-
|
|
8946
|
-
label: "Japanese (euc-jp)",
|
|
8956
|
+
groupId: "japanese",
|
|
8947
8957
|
isDetectable: !0,
|
|
8948
8958
|
isDecodable: !0
|
|
8949
8959
|
},
|
|
8950
8960
|
"euc-kr": {
|
|
8951
8961
|
id: "euc-kr",
|
|
8952
|
-
|
|
8953
|
-
label: "Korean (euc-kr)",
|
|
8962
|
+
groupId: "korean",
|
|
8954
8963
|
isDetectable: !0,
|
|
8955
8964
|
isDecodable: !0
|
|
8956
8965
|
},
|
|
8957
8966
|
gb18030: {
|
|
8958
8967
|
id: "gb18030",
|
|
8959
|
-
|
|
8960
|
-
label: "Chinese Simplified (gb18030)",
|
|
8968
|
+
groupId: "chineseSimplified",
|
|
8961
8969
|
isDetectable: !0,
|
|
8962
8970
|
isDecodable: !0
|
|
8963
8971
|
},
|
|
8964
8972
|
gbk: {
|
|
8965
8973
|
id: "gbk",
|
|
8966
|
-
|
|
8967
|
-
label: "Chinese Simplified (gbk)",
|
|
8974
|
+
groupId: "chineseSimplified",
|
|
8968
8975
|
isDetectable: !1,
|
|
8969
8976
|
isDecodable: !0
|
|
8970
8977
|
},
|
|
8971
8978
|
ibm866: {
|
|
8972
8979
|
id: "ibm866",
|
|
8973
|
-
|
|
8974
|
-
label: "Cyrillic (ibm866)",
|
|
8980
|
+
groupId: "cyrillic",
|
|
8975
8981
|
isDetectable: !1,
|
|
8976
8982
|
isDecodable: !0
|
|
8977
8983
|
},
|
|
8978
8984
|
"iso-2022-cn": {
|
|
8979
8985
|
id: "iso-2022-cn",
|
|
8980
|
-
|
|
8981
|
-
label: "Japanese (iso-2022-cn)",
|
|
8986
|
+
groupId: "chineseSimplified",
|
|
8982
8987
|
isDetectable: !0,
|
|
8983
8988
|
isDecodable: !1
|
|
8984
8989
|
},
|
|
8985
8990
|
"iso-2022-jp": {
|
|
8986
8991
|
id: "iso-2022-jp",
|
|
8987
|
-
|
|
8988
|
-
label: "Japanese (iso-2022-jp)",
|
|
8992
|
+
groupId: "japanese",
|
|
8989
8993
|
isDetectable: !0,
|
|
8990
8994
|
isDecodable: !0
|
|
8991
8995
|
},
|
|
8992
8996
|
"iso-2022-kr": {
|
|
8993
8997
|
id: "iso-2022-kr",
|
|
8994
|
-
|
|
8995
|
-
label: "Korean (iso-2022-kr)",
|
|
8998
|
+
groupId: "korean",
|
|
8996
8999
|
isDetectable: !0,
|
|
8997
9000
|
isDecodable: !1
|
|
8998
9001
|
},
|
|
8999
9002
|
"iso-8859-1": {
|
|
9000
9003
|
id: "iso-8859-1",
|
|
9001
|
-
|
|
9002
|
-
label: "Western (iso-8859-1)",
|
|
9004
|
+
groupId: "western",
|
|
9003
9005
|
isDetectable: !0,
|
|
9004
9006
|
isDecodable: !0
|
|
9005
9007
|
},
|
|
9006
9008
|
"iso-8859-2": {
|
|
9007
9009
|
id: "iso-8859-2",
|
|
9008
|
-
|
|
9009
|
-
label: "Central European (iso-8859-2)",
|
|
9010
|
+
groupId: "centralEuropean",
|
|
9010
9011
|
isDetectable: !0,
|
|
9011
9012
|
isDecodable: !0
|
|
9012
9013
|
},
|
|
9013
9014
|
"iso-8859-3": {
|
|
9014
9015
|
id: "iso-8859-3",
|
|
9015
|
-
|
|
9016
|
-
label: "Southern European (iso-8859-3)",
|
|
9016
|
+
groupId: "southernEuropean",
|
|
9017
9017
|
isDetectable: !1,
|
|
9018
9018
|
isDecodable: !0
|
|
9019
9019
|
},
|
|
9020
9020
|
"iso-8859-4": {
|
|
9021
9021
|
id: "iso-8859-4",
|
|
9022
|
-
|
|
9023
|
-
label: "Baltic (iso-8859-4)",
|
|
9022
|
+
groupId: "baltic",
|
|
9024
9023
|
isDetectable: !1,
|
|
9025
9024
|
isDecodable: !0
|
|
9026
9025
|
},
|
|
9027
9026
|
"iso-8859-5": {
|
|
9028
9027
|
id: "iso-8859-5",
|
|
9029
|
-
|
|
9030
|
-
label: "Cyrillic (iso-8859-5)",
|
|
9028
|
+
groupId: "cyrillic",
|
|
9031
9029
|
isDetectable: !0,
|
|
9032
9030
|
isDecodable: !0
|
|
9033
9031
|
},
|
|
9034
9032
|
"iso-8859-6": {
|
|
9035
9033
|
id: "iso-8859-6",
|
|
9036
|
-
|
|
9037
|
-
label: "Arabic (iso-8859-6)",
|
|
9034
|
+
groupId: "arabic",
|
|
9038
9035
|
isDetectable: !0,
|
|
9039
9036
|
isDecodable: !0
|
|
9040
9037
|
},
|
|
9041
9038
|
"iso-8859-7": {
|
|
9042
9039
|
id: "iso-8859-7",
|
|
9043
|
-
|
|
9044
|
-
label: "Greek (iso-8859-7)",
|
|
9040
|
+
groupId: "greek",
|
|
9045
9041
|
isDetectable: !0,
|
|
9046
9042
|
isDecodable: !0
|
|
9047
9043
|
},
|
|
9048
9044
|
"iso-8859-8": {
|
|
9049
9045
|
id: "iso-8859-8",
|
|
9050
|
-
|
|
9051
|
-
label: "Hebrew (iso-8859-8)",
|
|
9046
|
+
groupId: "hebrew",
|
|
9052
9047
|
isDetectable: !0,
|
|
9053
9048
|
isDecodable: !0
|
|
9054
9049
|
},
|
|
9055
9050
|
"iso-8859-9": {
|
|
9056
9051
|
id: "iso-8859-9",
|
|
9057
|
-
|
|
9058
|
-
label: "Turkish (iso-8859-9)",
|
|
9052
|
+
groupId: "turkish",
|
|
9059
9053
|
isDetectable: !0,
|
|
9060
9054
|
isDecodable: !0
|
|
9061
9055
|
},
|
|
9062
9056
|
"iso-8859-10": {
|
|
9063
9057
|
id: "iso-8859-10",
|
|
9064
|
-
|
|
9065
|
-
label: "Nordic (iso-8859-10)",
|
|
9058
|
+
groupId: "nordic",
|
|
9066
9059
|
isDetectable: !1,
|
|
9067
9060
|
isDecodable: !0
|
|
9068
9061
|
},
|
|
9069
9062
|
"iso-8859-11": {
|
|
9070
9063
|
id: "iso-8859-11",
|
|
9071
|
-
|
|
9072
|
-
label: "Thai (iso-8859-11)",
|
|
9064
|
+
groupId: "thai",
|
|
9073
9065
|
isDetectable: !1,
|
|
9074
9066
|
isDecodable: !0
|
|
9075
9067
|
},
|
|
9076
9068
|
"iso-8859-13": {
|
|
9077
9069
|
id: "iso-8859-13",
|
|
9078
|
-
|
|
9079
|
-
label: "Baltic (iso-8859-13)",
|
|
9070
|
+
groupId: "baltic",
|
|
9080
9071
|
isDetectable: !1,
|
|
9081
9072
|
isDecodable: !0
|
|
9082
9073
|
},
|
|
9083
9074
|
"iso-8859-14": {
|
|
9084
9075
|
id: "iso-8859-14",
|
|
9085
|
-
|
|
9086
|
-
label: "Celtic (iso-8859-14)",
|
|
9076
|
+
groupId: "celtic",
|
|
9087
9077
|
isDetectable: !1,
|
|
9088
9078
|
isDecodable: !0
|
|
9089
9079
|
},
|
|
9090
9080
|
"iso-8859-15": {
|
|
9091
9081
|
id: "iso-8859-15",
|
|
9092
|
-
|
|
9093
|
-
label: "Western (iso-8859-15)",
|
|
9082
|
+
groupId: "western",
|
|
9094
9083
|
isDetectable: !1,
|
|
9095
9084
|
isDecodable: !0
|
|
9096
9085
|
},
|
|
9097
9086
|
"iso-8859-16": {
|
|
9098
9087
|
id: "iso-8859-16",
|
|
9099
|
-
|
|
9100
|
-
label: "Romanian (iso-8859-16)",
|
|
9088
|
+
groupId: "romanian",
|
|
9101
9089
|
isDetectable: !1,
|
|
9102
9090
|
isDecodable: !0
|
|
9103
9091
|
},
|
|
9104
|
-
"
|
|
9092
|
+
"koi8-r": {
|
|
9105
9093
|
id: "koi8-r",
|
|
9106
|
-
|
|
9107
|
-
label: "Cyrillic (koi8-r)",
|
|
9094
|
+
groupId: "cyrillic",
|
|
9108
9095
|
isDetectable: !0,
|
|
9109
9096
|
isDecodable: !0
|
|
9110
9097
|
},
|
|
9111
|
-
"
|
|
9098
|
+
"koi8-u": {
|
|
9112
9099
|
id: "koi8-u",
|
|
9113
|
-
|
|
9114
|
-
label: "Cyrillic (koi8-u)",
|
|
9100
|
+
groupId: "cyrillic",
|
|
9115
9101
|
isDetectable: !1,
|
|
9116
9102
|
isDecodable: !0
|
|
9117
9103
|
},
|
|
9118
9104
|
latin1: {
|
|
9119
9105
|
id: "latin1",
|
|
9120
|
-
|
|
9121
|
-
label: "Western (latin1)",
|
|
9106
|
+
groupId: "western",
|
|
9122
9107
|
isDetectable: !1,
|
|
9123
9108
|
isDecodable: !0
|
|
9124
9109
|
},
|
|
9125
9110
|
macintosh: {
|
|
9126
9111
|
id: "macintosh",
|
|
9127
|
-
|
|
9128
|
-
label: "Western (macintosh)",
|
|
9112
|
+
groupId: "western",
|
|
9129
9113
|
isDetectable: !1,
|
|
9130
9114
|
isDecodable: !0
|
|
9131
9115
|
},
|
|
9132
9116
|
shift_jis: {
|
|
9133
9117
|
id: "shift_jis",
|
|
9134
|
-
|
|
9135
|
-
label: "Japanese (shift_jis)",
|
|
9118
|
+
groupId: "japanese",
|
|
9136
9119
|
isDetectable: !0,
|
|
9137
9120
|
isDecodable: !0
|
|
9138
9121
|
},
|
|
9139
9122
|
"tis-620": {
|
|
9140
9123
|
id: "tis-620",
|
|
9141
|
-
|
|
9142
|
-
label: "Thai (tis-620)",
|
|
9124
|
+
groupId: "thai",
|
|
9143
9125
|
isDetectable: !1,
|
|
9144
9126
|
isDecodable: !0
|
|
9145
9127
|
},
|
|
9146
|
-
|
|
9147
|
-
id: "
|
|
9148
|
-
|
|
9149
|
-
label: "Unicode 16 (utf16)",
|
|
9128
|
+
"utf-16": {
|
|
9129
|
+
id: "utf-16",
|
|
9130
|
+
groupId: "unicode16",
|
|
9150
9131
|
isDetectable: !1,
|
|
9151
9132
|
isDecodable: !0
|
|
9152
9133
|
},
|
|
9153
|
-
|
|
9154
|
-
id: "
|
|
9155
|
-
|
|
9156
|
-
label: "Unicode 16 (utf16be)",
|
|
9134
|
+
"utf-16be": {
|
|
9135
|
+
id: "utf-16be",
|
|
9136
|
+
groupId: "unicode16",
|
|
9157
9137
|
isDetectable: !0,
|
|
9158
9138
|
isDecodable: !0
|
|
9159
9139
|
},
|
|
9160
|
-
|
|
9161
|
-
id: "
|
|
9162
|
-
|
|
9163
|
-
label: "Unicode 16 (utf16le)",
|
|
9140
|
+
"utf-16le": {
|
|
9141
|
+
id: "utf-16le",
|
|
9142
|
+
groupId: "unicode16",
|
|
9164
9143
|
isDetectable: !0,
|
|
9165
9144
|
isDecodable: !0
|
|
9166
9145
|
},
|
|
9167
|
-
|
|
9168
|
-
id: "
|
|
9169
|
-
|
|
9170
|
-
label: "Unicode 32 (utf32be)",
|
|
9146
|
+
"utf-32be": {
|
|
9147
|
+
id: "utf-32be",
|
|
9148
|
+
groupId: "unicode32",
|
|
9171
9149
|
isDetectable: !0,
|
|
9172
9150
|
isDecodable: !1
|
|
9173
9151
|
},
|
|
9174
|
-
|
|
9175
|
-
id: "
|
|
9176
|
-
|
|
9177
|
-
label: "Unicode 32 (utf32le)",
|
|
9152
|
+
"utf-32le": {
|
|
9153
|
+
id: "utf-32le",
|
|
9154
|
+
groupId: "unicode32",
|
|
9178
9155
|
isDetectable: !0,
|
|
9179
9156
|
isDecodable: !1
|
|
9180
9157
|
},
|
|
9181
|
-
|
|
9182
|
-
id: "
|
|
9183
|
-
|
|
9184
|
-
label: "utf8",
|
|
9158
|
+
"utf-8": {
|
|
9159
|
+
id: "utf-8",
|
|
9160
|
+
groupId: null,
|
|
9185
9161
|
isDetectable: !0,
|
|
9186
9162
|
isDecodable: !0
|
|
9187
9163
|
},
|
|
9188
9164
|
"windows-1250": {
|
|
9189
9165
|
id: "windows-1250",
|
|
9190
|
-
|
|
9191
|
-
label: "Central European (windows-1250)",
|
|
9166
|
+
groupId: "centralEuropean",
|
|
9192
9167
|
isDetectable: !0,
|
|
9193
9168
|
isDecodable: !0
|
|
9194
9169
|
},
|
|
9195
9170
|
"windows-1251": {
|
|
9196
9171
|
id: "windows-1251",
|
|
9197
|
-
|
|
9198
|
-
label: "Cyrillic (windows-1251)",
|
|
9172
|
+
groupId: "cyrillic",
|
|
9199
9173
|
isDetectable: !0,
|
|
9200
9174
|
isDecodable: !0
|
|
9201
9175
|
},
|
|
9202
9176
|
"windows-1252": {
|
|
9203
9177
|
id: "windows-1252",
|
|
9204
|
-
|
|
9205
|
-
label: "Western (windows-1252)",
|
|
9178
|
+
groupId: "western",
|
|
9206
9179
|
isDetectable: !0,
|
|
9207
9180
|
isDecodable: !0
|
|
9208
9181
|
},
|
|
9209
9182
|
"windows-1253": {
|
|
9210
9183
|
id: "windows-1253",
|
|
9211
|
-
|
|
9212
|
-
label: "Greek (windows-1253)",
|
|
9184
|
+
groupId: "greek",
|
|
9213
9185
|
isDetectable: !0,
|
|
9214
9186
|
isDecodable: !0
|
|
9215
9187
|
},
|
|
9216
9188
|
"windows-1254": {
|
|
9217
9189
|
id: "windows-1254",
|
|
9218
|
-
|
|
9219
|
-
label: "Turkish (windows-1254)",
|
|
9190
|
+
groupId: "turkish",
|
|
9220
9191
|
isDetectable: !0,
|
|
9221
9192
|
isDecodable: !0
|
|
9222
9193
|
},
|
|
9223
9194
|
"windows-1255": {
|
|
9224
9195
|
id: "windows-1255",
|
|
9225
|
-
|
|
9226
|
-
label: "Hebrew (windows-1255)",
|
|
9196
|
+
groupId: "hebrew",
|
|
9227
9197
|
isDetectable: !0,
|
|
9228
9198
|
isDecodable: !0
|
|
9229
9199
|
},
|
|
9230
9200
|
"windows-1256": {
|
|
9231
9201
|
id: "windows-1256",
|
|
9232
|
-
|
|
9233
|
-
label: "Arabic (windows-1256)",
|
|
9202
|
+
groupId: "arabic",
|
|
9234
9203
|
isDetectable: !0,
|
|
9235
9204
|
isDecodable: !0
|
|
9236
9205
|
},
|
|
9237
9206
|
"windows-1257": {
|
|
9238
9207
|
id: "windows-1257",
|
|
9239
|
-
|
|
9240
|
-
label: "Baltic (windows-1257)",
|
|
9208
|
+
groupId: "baltic",
|
|
9241
9209
|
isDetectable: !1,
|
|
9242
9210
|
isDecodable: !0
|
|
9243
9211
|
},
|
|
9244
9212
|
"windows-1258": {
|
|
9245
9213
|
id: "windows-1258",
|
|
9246
|
-
|
|
9247
|
-
label: "Vietnamese (windows-1258)",
|
|
9214
|
+
groupId: "vietnamese",
|
|
9248
9215
|
isDetectable: !1,
|
|
9249
9216
|
isDecodable: !0
|
|
9250
9217
|
},
|
|
9251
9218
|
"windows-874": {
|
|
9252
9219
|
id: "windows-874",
|
|
9253
|
-
|
|
9254
|
-
label: "Thai (windows-874)",
|
|
9220
|
+
groupId: "thai",
|
|
9255
9221
|
isDetectable: !1,
|
|
9256
9222
|
isDecodable: !0
|
|
9257
9223
|
},
|
|
9258
9224
|
"x-mac-cyrillic": {
|
|
9259
9225
|
id: "x-mac-cyrillic",
|
|
9260
|
-
|
|
9261
|
-
label: "Cyrillic (x-mac-cyrillic)",
|
|
9226
|
+
groupId: "cyrillic",
|
|
9262
9227
|
isDetectable: !1,
|
|
9263
9228
|
isDecodable: !0
|
|
9264
9229
|
},
|
|
9265
9230
|
"x-user-defined": {
|
|
9266
9231
|
id: "x-user-defined",
|
|
9267
|
-
|
|
9268
|
-
label: "Other (x-user-defined)",
|
|
9232
|
+
groupId: "other",
|
|
9269
9233
|
isDetectable: !1,
|
|
9270
9234
|
isDecodable: !0
|
|
9271
9235
|
}
|
|
9272
|
-
}
|
|
9273
|
-
|
|
9236
|
+
};
|
|
9237
|
+
function tn(e) {
|
|
9238
|
+
return Object.hasOwn(en, e);
|
|
9239
|
+
}
|
|
9240
|
+
//#endregion
|
|
9241
|
+
//#region src/index.ts
|
|
9242
|
+
var nn = {
|
|
9243
|
+
id: "utf-8",
|
|
9274
9244
|
confidenceLevel: void 0
|
|
9275
|
-
},
|
|
9245
|
+
}, rn = {
|
|
9276
9246
|
arrow: {
|
|
9277
9247
|
label: "Columnar format for tables of data.",
|
|
9278
9248
|
isAutoDetectable: !0,
|
|
@@ -9437,17 +9407,17 @@ var en = {
|
|
|
9437
9407
|
isSupported: !1,
|
|
9438
9408
|
notes: ""
|
|
9439
9409
|
}
|
|
9440
|
-
},
|
|
9410
|
+
}, an = class {
|
|
9441
9411
|
async previewFile(e, t, n) {
|
|
9442
9412
|
let r = await fetch(encodeURI(e), {
|
|
9443
9413
|
headers: { Range: `bytes=0-${String(n ?? 4095)}` },
|
|
9444
9414
|
signal: t
|
|
9445
9415
|
});
|
|
9446
9416
|
if (!r.ok) throw await Zt(r, `Failed to fetch '${e}' file.`, "dpuse-tool-file-previewer.previewRemoteFile");
|
|
9447
|
-
return await
|
|
9417
|
+
return await on(new Uint8Array(await r.arrayBuffer()));
|
|
9448
9418
|
}
|
|
9449
9419
|
};
|
|
9450
|
-
async function
|
|
9420
|
+
async function on(e) {
|
|
9451
9421
|
if (e.length === 0) return {
|
|
9452
9422
|
bytes: e,
|
|
9453
9423
|
dataFormatId: void 0,
|
|
@@ -9458,17 +9428,17 @@ async function an(e) {
|
|
|
9458
9428
|
};
|
|
9459
9429
|
let t = await Kt(e);
|
|
9460
9430
|
if (t == null) {
|
|
9461
|
-
let n =
|
|
9431
|
+
let n = cn(e, sn(e));
|
|
9462
9432
|
return {
|
|
9463
9433
|
bytes: e,
|
|
9464
|
-
dataFormatId:
|
|
9434
|
+
dataFormatId: ln(n.text) ? "json" : "dtv",
|
|
9465
9435
|
encodingId: n.encoding.id,
|
|
9466
9436
|
encodingConfidenceLevel: n.encoding.confidenceLevel,
|
|
9467
9437
|
fileTypeConfig: t,
|
|
9468
9438
|
text: n.text
|
|
9469
9439
|
};
|
|
9470
9440
|
}
|
|
9471
|
-
let n =
|
|
9441
|
+
let n = rn[t.ext];
|
|
9472
9442
|
return n == null ? {
|
|
9473
9443
|
bytes: e,
|
|
9474
9444
|
dataFormatId: void 0,
|
|
@@ -9485,10 +9455,10 @@ async function an(e) {
|
|
|
9485
9455
|
text: void 0
|
|
9486
9456
|
};
|
|
9487
9457
|
}
|
|
9488
|
-
function
|
|
9458
|
+
function sn(e) {
|
|
9489
9459
|
if (e[0] === 239 && e[1] === 187 && e[2] === 191) return {
|
|
9490
9460
|
confidenceLevel: 100,
|
|
9491
|
-
id: "
|
|
9461
|
+
id: "utf-8"
|
|
9492
9462
|
};
|
|
9493
9463
|
if (e[0] === 254 && e[1] === 255) return {
|
|
9494
9464
|
confidenceLevel: 100,
|
|
@@ -9500,27 +9470,27 @@ function on(e) {
|
|
|
9500
9470
|
};
|
|
9501
9471
|
let t = f.default.analyse(e)[0] ?? {
|
|
9502
9472
|
confidence: void 0,
|
|
9503
|
-
name: "
|
|
9504
|
-
}, n =
|
|
9473
|
+
name: "utf-8"
|
|
9474
|
+
}, n = t.name.toLowerCase();
|
|
9505
9475
|
return {
|
|
9506
9476
|
confidenceLevel: t.confidence,
|
|
9507
|
-
id:
|
|
9477
|
+
id: tn(n) ? n : "utf-8"
|
|
9508
9478
|
};
|
|
9509
9479
|
}
|
|
9510
|
-
function
|
|
9480
|
+
function cn(e, t) {
|
|
9511
9481
|
try {
|
|
9512
9482
|
return {
|
|
9513
9483
|
encoding: t,
|
|
9514
|
-
text: new TextDecoder(t.id).decode(
|
|
9484
|
+
text: new TextDecoder(t.id).decode(un(e))
|
|
9515
9485
|
};
|
|
9516
9486
|
} catch {
|
|
9517
9487
|
return {
|
|
9518
|
-
encoding:
|
|
9519
|
-
text: new TextDecoder(
|
|
9488
|
+
encoding: nn,
|
|
9489
|
+
text: new TextDecoder(nn.id, { fatal: !1 }).decode(un(e))
|
|
9520
9490
|
};
|
|
9521
9491
|
}
|
|
9522
9492
|
}
|
|
9523
|
-
function
|
|
9493
|
+
function ln(e) {
|
|
9524
9494
|
let t = e.trimStart();
|
|
9525
9495
|
if (t.length > 2) {
|
|
9526
9496
|
let e = t[0], n = e === "{", r = e === "[", i = /"\s*:\s*/.test(t), a = /\b(?:true|false|null)\b/.test(t), o = t.includes("\"");
|
|
@@ -9528,7 +9498,7 @@ function cn(e) {
|
|
|
9528
9498
|
}
|
|
9529
9499
|
return !1;
|
|
9530
9500
|
}
|
|
9531
|
-
function
|
|
9501
|
+
function un(e) {
|
|
9532
9502
|
let t = e, n = t.length;
|
|
9533
9503
|
for (let e = n - 1; e >= 0; e--) {
|
|
9534
9504
|
let n = t[e];
|
|
@@ -9544,4 +9514,4 @@ function ln(e) {
|
|
|
9544
9514
|
return t;
|
|
9545
9515
|
}
|
|
9546
9516
|
//#endregion
|
|
9547
|
-
export {
|
|
9517
|
+
export { an as Tool };
|