@vue-office/docx
Version:
支持多种文件(**docx、excel、pdf、pptx**)预览的vue组件库,支持vue2/3。也支持非Vue框架的预览。
971 lines (968 loc) • 250 kB
JavaScript
var ze = Object.defineProperty, Re = Object.defineProperties;
var Me = Object.getOwnPropertyDescriptors;
var re = Object.getOwnPropertySymbols;
var Te = Object.prototype.hasOwnProperty, Ie = Object.prototype.propertyIsEnumerable;
var ne = (i, e, t) => e in i ? ze(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, vt = (i, e) => {
for (var t in e || (e = {}))
Te.call(e, t) && ne(i, t, e[t]);
if (re)
for (var t of re(e))
Ie.call(e, t) && ne(i, t, e[t]);
return i;
}, Tt = (i, e) => Re(i, Me(e));
var kt = (i, e, t) => new Promise((r, n) => {
var a = (h) => {
try {
o(t.next(h));
} catch (b) {
n(b);
}
}, l = (h) => {
try {
o(t.throw(h));
} catch (b) {
n(b);
}
}, o = (h) => h.done ? r(h.value) : Promise.resolve(h.value).then(a, l);
o((t = t.apply(i, e)).next());
});
import { defineComponent as Oe, ref as Fe, onMounted as De, watch as Le } from "vue-demi";
import { openBlock as je, createElementBlock as Ue, createElementVNode as $e } from "vue";
typeof window.setImmediate == "undefined" && (window.setImmediate = function(i, ...e) {
setTimeout(() => i(e));
});
var jt = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {};
function We(i) {
return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
}
function Ut(i) {
throw new Error('Could not dynamically require "' + i + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
}
var pe = { exports: {} };
/*!
JSZip v3.10.1 - A JavaScript class for generating and reading zip files
<http://stuartk.com/jszip>
(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
JSZip uses the library pako released under the MIT license :
https://github.com/nodeca/pako/blob/main/LICENSE
*/
(function(i, e) {
(function(t) {
i.exports = t();
})(function() {
return function t(r, n, a) {
function l(b, y) {
if (!n[b]) {
if (!r[b]) {
var _ = typeof Ut == "function" && Ut;
if (!y && _)
return _(b, !0);
if (o)
return o(b, !0);
var w = new Error("Cannot find module '" + b + "'");
throw w.code = "MODULE_NOT_FOUND", w;
}
var d = n[b] = { exports: {} };
r[b][0].call(d.exports, function(k) {
var u = r[b][1][k];
return l(u || k);
}, d, d.exports, t, r, n, a);
}
return n[b].exports;
}
for (var o = typeof Ut == "function" && Ut, h = 0; h < a.length; h++)
l(a[h]);
return l;
}({ 1: [function(t, r, n) {
var a = t("./utils"), l = t("./support"), o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
n.encode = function(h) {
for (var b, y, _, w, d, k, u, m = [], f = 0, v = h.length, C = v, A = a.getTypeOf(h) !== "string"; f < h.length; )
C = v - f, _ = A ? (b = h[f++], y = f < v ? h[f++] : 0, f < v ? h[f++] : 0) : (b = h.charCodeAt(f++), y = f < v ? h.charCodeAt(f++) : 0, f < v ? h.charCodeAt(f++) : 0), w = b >> 2, d = (3 & b) << 4 | y >> 4, k = 1 < C ? (15 & y) << 2 | _ >> 6 : 64, u = 2 < C ? 63 & _ : 64, m.push(o.charAt(w) + o.charAt(d) + o.charAt(k) + o.charAt(u));
return m.join("");
}, n.decode = function(h) {
var b, y, _, w, d, k, u = 0, m = 0, f = "data:";
if (h.substr(0, f.length) === f)
throw new Error("Invalid base64 input, it looks like a data url.");
var v, C = 3 * (h = h.replace(/[^A-Za-z0-9+/=]/g, "")).length / 4;
if (h.charAt(h.length - 1) === o.charAt(64) && C--, h.charAt(h.length - 2) === o.charAt(64) && C--, C % 1 != 0)
throw new Error("Invalid base64 input, bad content length.");
for (v = l.uint8array ? new Uint8Array(0 | C) : new Array(0 | C); u < h.length; )
b = o.indexOf(h.charAt(u++)) << 2 | (w = o.indexOf(h.charAt(u++))) >> 4, y = (15 & w) << 4 | (d = o.indexOf(h.charAt(u++))) >> 2, _ = (3 & d) << 6 | (k = o.indexOf(h.charAt(u++))), v[m++] = b, d !== 64 && (v[m++] = y), k !== 64 && (v[m++] = _);
return v;
};
}, { "./support": 30, "./utils": 32 }], 2: [function(t, r, n) {
var a = t("./external"), l = t("./stream/DataWorker"), o = t("./stream/Crc32Probe"), h = t("./stream/DataLengthProbe");
function b(y, _, w, d, k) {
this.compressedSize = y, this.uncompressedSize = _, this.crc32 = w, this.compression = d, this.compressedContent = k;
}
b.prototype = { getContentWorker: function() {
var y = new l(a.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new h("data_length")), _ = this;
return y.on("end", function() {
if (this.streamInfo.data_length !== _.uncompressedSize)
throw new Error("Bug : uncompressed data size mismatch");
}), y;
}, getCompressedWorker: function() {
return new l(a.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize", this.compressedSize).withStreamInfo("uncompressedSize", this.uncompressedSize).withStreamInfo("crc32", this.crc32).withStreamInfo("compression", this.compression);
} }, b.createWorkerFrom = function(y, _, w) {
return y.pipe(new o()).pipe(new h("uncompressedSize")).pipe(_.compressWorker(w)).pipe(new h("compressedSize")).withStreamInfo("compression", _);
}, r.exports = b;
}, { "./external": 6, "./stream/Crc32Probe": 25, "./stream/DataLengthProbe": 26, "./stream/DataWorker": 27 }], 3: [function(t, r, n) {
var a = t("./stream/GenericWorker");
n.STORE = { magic: "\0\0", compressWorker: function() {
return new a("STORE compression");
}, uncompressWorker: function() {
return new a("STORE decompression");
} }, n.DEFLATE = t("./flate");
}, { "./flate": 7, "./stream/GenericWorker": 28 }], 4: [function(t, r, n) {
var a = t("./utils"), l = function() {
for (var o, h = [], b = 0; b < 256; b++) {
o = b;
for (var y = 0; y < 8; y++)
o = 1 & o ? 3988292384 ^ o >>> 1 : o >>> 1;
h[b] = o;
}
return h;
}();
r.exports = function(o, h) {
return o !== void 0 && o.length ? a.getTypeOf(o) !== "string" ? function(b, y, _, w) {
var d = l, k = w + _;
b ^= -1;
for (var u = w; u < k; u++)
b = b >>> 8 ^ d[255 & (b ^ y[u])];
return -1 ^ b;
}(0 | h, o, o.length, 0) : function(b, y, _, w) {
var d = l, k = w + _;
b ^= -1;
for (var u = w; u < k; u++)
b = b >>> 8 ^ d[255 & (b ^ y.charCodeAt(u))];
return -1 ^ b;
}(0 | h, o, o.length, 0) : 0;
};
}, { "./utils": 32 }], 5: [function(t, r, n) {
n.base64 = !1, n.binary = !1, n.dir = !1, n.createFolders = !0, n.date = null, n.compression = null, n.compressionOptions = null, n.comment = null, n.unixPermissions = null, n.dosPermissions = null;
}, {}], 6: [function(t, r, n) {
var a = null;
a = typeof Promise != "undefined" ? Promise : t("lie"), r.exports = { Promise: a };
}, { lie: 37 }], 7: [function(t, r, n) {
var a = typeof Uint8Array != "undefined" && typeof Uint16Array != "undefined" && typeof Uint32Array != "undefined", l = t("pako"), o = t("./utils"), h = t("./stream/GenericWorker"), b = a ? "uint8array" : "array";
function y(_, w) {
h.call(this, "FlateWorker/" + _), this._pako = null, this._pakoAction = _, this._pakoOptions = w, this.meta = {};
}
n.magic = "\b\0", o.inherits(y, h), y.prototype.processChunk = function(_) {
this.meta = _.meta, this._pako === null && this._createPako(), this._pako.push(o.transformTo(b, _.data), !1);
}, y.prototype.flush = function() {
h.prototype.flush.call(this), this._pako === null && this._createPako(), this._pako.push([], !0);
}, y.prototype.cleanUp = function() {
h.prototype.cleanUp.call(this), this._pako = null;
}, y.prototype._createPako = function() {
this._pako = new l[this._pakoAction]({ raw: !0, level: this._pakoOptions.level || -1 });
var _ = this;
this._pako.onData = function(w) {
_.push({ data: w, meta: _.meta });
};
}, n.compressWorker = function(_) {
return new y("Deflate", _);
}, n.uncompressWorker = function() {
return new y("Inflate", {});
};
}, { "./stream/GenericWorker": 28, "./utils": 32, pako: 38 }], 8: [function(t, r, n) {
function a(d, k) {
var u, m = "";
for (u = 0; u < k; u++)
m += String.fromCharCode(255 & d), d >>>= 8;
return m;
}
function l(d, k, u, m, f, v) {
var C, A, E = d.file, D = d.compression, I = v !== b.utf8encode, W = o.transformTo("string", v(E.name)), T = o.transformTo("string", b.utf8encode(E.name)), X = E.comment, Q = o.transformTo("string", v(X)), S = o.transformTo("string", b.utf8encode(X)), O = T.length !== E.name.length, c = S.length !== X.length, L = "", et = "", $ = "", rt = E.dir, H = E.date, tt = { crc32: 0, compressedSize: 0, uncompressedSize: 0 };
k && !u || (tt.crc32 = d.crc32, tt.compressedSize = d.compressedSize, tt.uncompressedSize = d.uncompressedSize);
var R = 0;
k && (R |= 8), I || !O && !c || (R |= 2048);
var B = 0, J = 0;
rt && (B |= 16), f === "UNIX" ? (J = 798, B |= function(G, ut) {
var bt = G;
return G || (bt = ut ? 16893 : 33204), (65535 & bt) << 16;
}(E.unixPermissions, rt)) : (J = 20, B |= function(G) {
return 63 & (G || 0);
}(E.dosPermissions)), C = H.getUTCHours(), C <<= 6, C |= H.getUTCMinutes(), C <<= 5, C |= H.getUTCSeconds() / 2, A = H.getUTCFullYear() - 1980, A <<= 4, A |= H.getUTCMonth() + 1, A <<= 5, A |= H.getUTCDate(), O && (et = a(1, 1) + a(y(W), 4) + T, L += "up" + a(et.length, 2) + et), c && ($ = a(1, 1) + a(y(Q), 4) + S, L += "uc" + a($.length, 2) + $);
var q = "";
return q += `
\0`, q += a(R, 2), q += D.magic, q += a(C, 2), q += a(A, 2), q += a(tt.crc32, 4), q += a(tt.compressedSize, 4), q += a(tt.uncompressedSize, 4), q += a(W.length, 2), q += a(L.length, 2), { fileRecord: _.LOCAL_FILE_HEADER + q + W + L, dirRecord: _.CENTRAL_FILE_HEADER + a(J, 2) + q + a(Q.length, 2) + "\0\0\0\0" + a(B, 4) + a(m, 4) + W + L + Q };
}
var o = t("../utils"), h = t("../stream/GenericWorker"), b = t("../utf8"), y = t("../crc32"), _ = t("../signature");
function w(d, k, u, m) {
h.call(this, "ZipFileWorker"), this.bytesWritten = 0, this.zipComment = k, this.zipPlatform = u, this.encodeFileName = m, this.streamFiles = d, this.accumulate = !1, this.contentBuffer = [], this.dirRecords = [], this.currentSourceOffset = 0, this.entriesCount = 0, this.currentFile = null, this._sources = [];
}
o.inherits(w, h), w.prototype.push = function(d) {
var k = d.meta.percent || 0, u = this.entriesCount, m = this._sources.length;
this.accumulate ? this.contentBuffer.push(d) : (this.bytesWritten += d.data.length, h.prototype.push.call(this, { data: d.data, meta: { currentFile: this.currentFile, percent: u ? (k + 100 * (u - m - 1)) / u : 100 } }));
}, w.prototype.openedSource = function(d) {
this.currentSourceOffset = this.bytesWritten, this.currentFile = d.file.name;
var k = this.streamFiles && !d.file.dir;
if (k) {
var u = l(d, k, !1, this.currentSourceOffset, this.zipPlatform, this.encodeFileName);
this.push({ data: u.fileRecord, meta: { percent: 0 } });
} else
this.accumulate = !0;
}, w.prototype.closedSource = function(d) {
this.accumulate = !1;
var k = this.streamFiles && !d.file.dir, u = l(d, k, !0, this.currentSourceOffset, this.zipPlatform, this.encodeFileName);
if (this.dirRecords.push(u.dirRecord), k)
this.push({ data: function(m) {
return _.DATA_DESCRIPTOR + a(m.crc32, 4) + a(m.compressedSize, 4) + a(m.uncompressedSize, 4);
}(d), meta: { percent: 100 } });
else
for (this.push({ data: u.fileRecord, meta: { percent: 0 } }); this.contentBuffer.length; )
this.push(this.contentBuffer.shift());
this.currentFile = null;
}, w.prototype.flush = function() {
for (var d = this.bytesWritten, k = 0; k < this.dirRecords.length; k++)
this.push({ data: this.dirRecords[k], meta: { percent: 100 } });
var u = this.bytesWritten - d, m = function(f, v, C, A, E) {
var D = o.transformTo("string", E(A));
return _.CENTRAL_DIRECTORY_END + "\0\0\0\0" + a(f, 2) + a(f, 2) + a(v, 4) + a(C, 4) + a(D.length, 2) + D;
}(this.dirRecords.length, u, d, this.zipComment, this.encodeFileName);
this.push({ data: m, meta: { percent: 100 } });
}, w.prototype.prepareNextSource = function() {
this.previous = this._sources.shift(), this.openedSource(this.previous.streamInfo), this.isPaused ? this.previous.pause() : this.previous.resume();
}, w.prototype.registerPrevious = function(d) {
this._sources.push(d);
var k = this;
return d.on("data", function(u) {
k.processChunk(u);
}), d.on("end", function() {
k.closedSource(k.previous.streamInfo), k._sources.length ? k.prepareNextSource() : k.end();
}), d.on("error", function(u) {
k.error(u);
}), this;
}, w.prototype.resume = function() {
return !!h.prototype.resume.call(this) && (!this.previous && this._sources.length ? (this.prepareNextSource(), !0) : this.previous || this._sources.length || this.generatedError ? void 0 : (this.end(), !0));
}, w.prototype.error = function(d) {
var k = this._sources;
if (!h.prototype.error.call(this, d))
return !1;
for (var u = 0; u < k.length; u++)
try {
k[u].error(d);
} catch (m) {
}
return !0;
}, w.prototype.lock = function() {
h.prototype.lock.call(this);
for (var d = this._sources, k = 0; k < d.length; k++)
d[k].lock();
}, r.exports = w;
}, { "../crc32": 4, "../signature": 23, "../stream/GenericWorker": 28, "../utf8": 31, "../utils": 32 }], 9: [function(t, r, n) {
var a = t("../compressions"), l = t("./ZipFileWorker");
n.generateWorker = function(o, h, b) {
var y = new l(h.streamFiles, b, h.platform, h.encodeFileName), _ = 0;
try {
o.forEach(function(w, d) {
_++;
var k = function(v, C) {
var A = v || C, E = a[A];
if (!E)
throw new Error(A + " is not a valid compression method !");
return E;
}(d.options.compression, h.compression), u = d.options.compressionOptions || h.compressionOptions || {}, m = d.dir, f = d.date;
d._compressWorker(k, u).withStreamInfo("file", { name: w, dir: m, date: f, comment: d.comment || "", unixPermissions: d.unixPermissions, dosPermissions: d.dosPermissions }).pipe(y);
}), y.entriesCount = _;
} catch (w) {
y.error(w);
}
return y;
};
}, { "../compressions": 3, "./ZipFileWorker": 8 }], 10: [function(t, r, n) {
function a() {
if (!(this instanceof a))
return new a();
if (arguments.length)
throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");
this.files = /* @__PURE__ */ Object.create(null), this.comment = null, this.root = "", this.clone = function() {
var l = new a();
for (var o in this)
typeof this[o] != "function" && (l[o] = this[o]);
return l;
};
}
(a.prototype = t("./object")).loadAsync = t("./load"), a.support = t("./support"), a.defaults = t("./defaults"), a.version = "3.10.1", a.loadAsync = function(l, o) {
return new a().loadAsync(l, o);
}, a.external = t("./external"), r.exports = a;
}, { "./defaults": 5, "./external": 6, "./load": 11, "./object": 15, "./support": 30 }], 11: [function(t, r, n) {
var a = t("./utils"), l = t("./external"), o = t("./utf8"), h = t("./zipEntries"), b = t("./stream/Crc32Probe"), y = t("./nodejsUtils");
function _(w) {
return new l.Promise(function(d, k) {
var u = w.decompressed.getContentWorker().pipe(new b());
u.on("error", function(m) {
k(m);
}).on("end", function() {
u.streamInfo.crc32 !== w.decompressed.crc32 ? k(new Error("Corrupted zip : CRC32 mismatch")) : d();
}).resume();
});
}
r.exports = function(w, d) {
var k = this;
return d = a.extend(d || {}, { base64: !1, checkCRC32: !1, optimizedBinaryString: !1, createFolders: !1, decodeFileName: o.utf8decode }), y.isNode && y.isStream(w) ? l.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")) : a.prepareContent("the loaded zip file", w, !0, d.optimizedBinaryString, d.base64).then(function(u) {
var m = new h(d);
return m.load(u), m;
}).then(function(u) {
var m = [l.Promise.resolve(u)], f = u.files;
if (d.checkCRC32)
for (var v = 0; v < f.length; v++)
m.push(_(f[v]));
return l.Promise.all(m);
}).then(function(u) {
for (var m = u.shift(), f = m.files, v = 0; v < f.length; v++) {
var C = f[v], A = C.fileNameStr, E = a.resolve(C.fileNameStr);
k.file(E, C.decompressed, { binary: !0, optimizedBinaryString: !0, date: C.date, dir: C.dir, comment: C.fileCommentStr.length ? C.fileCommentStr : null, unixPermissions: C.unixPermissions, dosPermissions: C.dosPermissions, createFolders: d.createFolders }), C.dir || (k.file(E).unsafeOriginalName = A);
}
return m.zipComment.length && (k.comment = m.zipComment), k;
});
};
}, { "./external": 6, "./nodejsUtils": 14, "./stream/Crc32Probe": 25, "./utf8": 31, "./utils": 32, "./zipEntries": 33 }], 12: [function(t, r, n) {
var a = t("../utils"), l = t("../stream/GenericWorker");
function o(h, b) {
l.call(this, "Nodejs stream input adapter for " + h), this._upstreamEnded = !1, this._bindStream(b);
}
a.inherits(o, l), o.prototype._bindStream = function(h) {
var b = this;
(this._stream = h).pause(), h.on("data", function(y) {
b.push({ data: y, meta: { percent: 0 } });
}).on("error", function(y) {
b.isPaused ? this.generatedError = y : b.error(y);
}).on("end", function() {
b.isPaused ? b._upstreamEnded = !0 : b.end();
});
}, o.prototype.pause = function() {
return !!l.prototype.pause.call(this) && (this._stream.pause(), !0);
}, o.prototype.resume = function() {
return !!l.prototype.resume.call(this) && (this._upstreamEnded ? this.end() : this._stream.resume(), !0);
}, r.exports = o;
}, { "../stream/GenericWorker": 28, "../utils": 32 }], 13: [function(t, r, n) {
var a = t("readable-stream").Readable;
function l(o, h, b) {
a.call(this, h), this._helper = o;
var y = this;
o.on("data", function(_, w) {
y.push(_) || y._helper.pause(), b && b(w);
}).on("error", function(_) {
y.emit("error", _);
}).on("end", function() {
y.push(null);
});
}
t("../utils").inherits(l, a), l.prototype._read = function() {
this._helper.resume();
}, r.exports = l;
}, { "../utils": 32, "readable-stream": 16 }], 14: [function(t, r, n) {
r.exports = { isNode: typeof Buffer != "undefined", newBufferFrom: function(a, l) {
if (Buffer.from && Buffer.from !== Uint8Array.from)
return Buffer.from(a, l);
if (typeof a == "number")
throw new Error('The "data" argument must not be a number');
return new Buffer(a, l);
}, allocBuffer: function(a) {
if (Buffer.alloc)
return Buffer.alloc(a);
var l = new Buffer(a);
return l.fill(0), l;
}, isBuffer: function(a) {
return Buffer.isBuffer(a);
}, isStream: function(a) {
return a && typeof a.on == "function" && typeof a.pause == "function" && typeof a.resume == "function";
} };
}, {}], 15: [function(t, r, n) {
function a(E, D, I) {
var W, T = o.getTypeOf(D), X = o.extend(I || {}, y);
X.date = X.date || /* @__PURE__ */ new Date(), X.compression !== null && (X.compression = X.compression.toUpperCase()), typeof X.unixPermissions == "string" && (X.unixPermissions = parseInt(X.unixPermissions, 8)), X.unixPermissions && 16384 & X.unixPermissions && (X.dir = !0), X.dosPermissions && 16 & X.dosPermissions && (X.dir = !0), X.dir && (E = f(E)), X.createFolders && (W = m(E)) && v.call(this, W, !0);
var Q = T === "string" && X.binary === !1 && X.base64 === !1;
I && I.binary !== void 0 || (X.binary = !Q), (D instanceof _ && D.uncompressedSize === 0 || X.dir || !D || D.length === 0) && (X.base64 = !1, X.binary = !0, D = "", X.compression = "STORE", T = "string");
var S = null;
S = D instanceof _ || D instanceof h ? D : k.isNode && k.isStream(D) ? new u(E, D) : o.prepareContent(E, D, X.binary, X.optimizedBinaryString, X.base64);
var O = new w(E, S, X);
this.files[E] = O;
}
var l = t("./utf8"), o = t("./utils"), h = t("./stream/GenericWorker"), b = t("./stream/StreamHelper"), y = t("./defaults"), _ = t("./compressedObject"), w = t("./zipObject"), d = t("./generate"), k = t("./nodejsUtils"), u = t("./nodejs/NodejsStreamInputAdapter"), m = function(E) {
E.slice(-1) === "/" && (E = E.substring(0, E.length - 1));
var D = E.lastIndexOf("/");
return 0 < D ? E.substring(0, D) : "";
}, f = function(E) {
return E.slice(-1) !== "/" && (E += "/"), E;
}, v = function(E, D) {
return D = D !== void 0 ? D : y.createFolders, E = f(E), this.files[E] || a.call(this, E, null, { dir: !0, createFolders: D }), this.files[E];
};
function C(E) {
return Object.prototype.toString.call(E) === "[object RegExp]";
}
var A = { load: function() {
throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
}, forEach: function(E) {
var D, I, W;
for (D in this.files)
W = this.files[D], (I = D.slice(this.root.length, D.length)) && D.slice(0, this.root.length) === this.root && E(I, W);
}, filter: function(E) {
var D = [];
return this.forEach(function(I, W) {
E(I, W) && D.push(W);
}), D;
}, file: function(E, D, I) {
if (arguments.length !== 1)
return E = this.root + E, a.call(this, E, D, I), this;
if (C(E)) {
var W = E;
return this.filter(function(X, Q) {
return !Q.dir && W.test(X);
});
}
var T = this.files[this.root + E];
return T && !T.dir ? T : null;
}, folder: function(E) {
if (!E)
return this;
if (C(E))
return this.filter(function(T, X) {
return X.dir && E.test(T);
});
var D = this.root + E, I = v.call(this, D), W = this.clone();
return W.root = I.name, W;
}, remove: function(E) {
E = this.root + E;
var D = this.files[E];
if (D || (E.slice(-1) !== "/" && (E += "/"), D = this.files[E]), D && !D.dir)
delete this.files[E];
else
for (var I = this.filter(function(T, X) {
return X.name.slice(0, E.length) === E;
}), W = 0; W < I.length; W++)
delete this.files[I[W].name];
return this;
}, generate: function() {
throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
}, generateInternalStream: function(E) {
var D, I = {};
try {
if ((I = o.extend(E || {}, { streamFiles: !1, compression: "STORE", compressionOptions: null, type: "", platform: "DOS", comment: null, mimeType: "application/zip", encodeFileName: l.utf8encode })).type = I.type.toLowerCase(), I.compression = I.compression.toUpperCase(), I.type === "binarystring" && (I.type = "string"), !I.type)
throw new Error("No output type specified.");
o.checkSupport(I.type), I.platform !== "darwin" && I.platform !== "freebsd" && I.platform !== "linux" && I.platform !== "sunos" || (I.platform = "UNIX"), I.platform === "win32" && (I.platform = "DOS");
var W = I.comment || this.comment || "";
D = d.generateWorker(this, I, W);
} catch (T) {
(D = new h("error")).error(T);
}
return new b(D, I.type || "string", I.mimeType);
}, generateAsync: function(E, D) {
return this.generateInternalStream(E).accumulate(D);
}, generateNodeStream: function(E, D) {
return (E = E || {}).type || (E.type = "nodebuffer"), this.generateInternalStream(E).toNodejsStream(D);
} };
r.exports = A;
}, { "./compressedObject": 2, "./defaults": 5, "./generate": 9, "./nodejs/NodejsStreamInputAdapter": 12, "./nodejsUtils": 14, "./stream/GenericWorker": 28, "./stream/StreamHelper": 29, "./utf8": 31, "./utils": 32, "./zipObject": 35 }], 16: [function(t, r, n) {
r.exports = t("stream");
}, { stream: void 0 }], 17: [function(t, r, n) {
var a = t("./DataReader");
function l(o) {
a.call(this, o);
for (var h = 0; h < this.data.length; h++)
o[h] = 255 & o[h];
}
t("../utils").inherits(l, a), l.prototype.byteAt = function(o) {
return this.data[this.zero + o];
}, l.prototype.lastIndexOfSignature = function(o) {
for (var h = o.charCodeAt(0), b = o.charCodeAt(1), y = o.charCodeAt(2), _ = o.charCodeAt(3), w = this.length - 4; 0 <= w; --w)
if (this.data[w] === h && this.data[w + 1] === b && this.data[w + 2] === y && this.data[w + 3] === _)
return w - this.zero;
return -1;
}, l.prototype.readAndCheckSignature = function(o) {
var h = o.charCodeAt(0), b = o.charCodeAt(1), y = o.charCodeAt(2), _ = o.charCodeAt(3), w = this.readData(4);
return h === w[0] && b === w[1] && y === w[2] && _ === w[3];
}, l.prototype.readData = function(o) {
if (this.checkOffset(o), o === 0)
return [];
var h = this.data.slice(this.zero + this.index, this.zero + this.index + o);
return this.index += o, h;
}, r.exports = l;
}, { "../utils": 32, "./DataReader": 18 }], 18: [function(t, r, n) {
var a = t("../utils");
function l(o) {
this.data = o, this.length = o.length, this.index = 0, this.zero = 0;
}
l.prototype = { checkOffset: function(o) {
this.checkIndex(this.index + o);
}, checkIndex: function(o) {
if (this.length < this.zero + o || o < 0)
throw new Error("End of data reached (data length = " + this.length + ", asked index = " + o + "). Corrupted zip ?");
}, setIndex: function(o) {
this.checkIndex(o), this.index = o;
}, skip: function(o) {
this.setIndex(this.index + o);
}, byteAt: function() {
}, readInt: function(o) {
var h, b = 0;
for (this.checkOffset(o), h = this.index + o - 1; h >= this.index; h--)
b = (b << 8) + this.byteAt(h);
return this.index += o, b;
}, readString: function(o) {
return a.transformTo("string", this.readData(o));
}, readData: function() {
}, lastIndexOfSignature: function() {
}, readAndCheckSignature: function() {
}, readDate: function() {
var o = this.readInt(4);
return new Date(Date.UTC(1980 + (o >> 25 & 127), (o >> 21 & 15) - 1, o >> 16 & 31, o >> 11 & 31, o >> 5 & 63, (31 & o) << 1));
} }, r.exports = l;
}, { "../utils": 32 }], 19: [function(t, r, n) {
var a = t("./Uint8ArrayReader");
function l(o) {
a.call(this, o);
}
t("../utils").inherits(l, a), l.prototype.readData = function(o) {
this.checkOffset(o);
var h = this.data.slice(this.zero + this.index, this.zero + this.index + o);
return this.index += o, h;
}, r.exports = l;
}, { "../utils": 32, "./Uint8ArrayReader": 21 }], 20: [function(t, r, n) {
var a = t("./DataReader");
function l(o) {
a.call(this, o);
}
t("../utils").inherits(l, a), l.prototype.byteAt = function(o) {
return this.data.charCodeAt(this.zero + o);
}, l.prototype.lastIndexOfSignature = function(o) {
return this.data.lastIndexOf(o) - this.zero;
}, l.prototype.readAndCheckSignature = function(o) {
return o === this.readData(4);
}, l.prototype.readData = function(o) {
this.checkOffset(o);
var h = this.data.slice(this.zero + this.index, this.zero + this.index + o);
return this.index += o, h;
}, r.exports = l;
}, { "../utils": 32, "./DataReader": 18 }], 21: [function(t, r, n) {
var a = t("./ArrayReader");
function l(o) {
a.call(this, o);
}
t("../utils").inherits(l, a), l.prototype.readData = function(o) {
if (this.checkOffset(o), o === 0)
return new Uint8Array(0);
var h = this.data.subarray(this.zero + this.index, this.zero + this.index + o);
return this.index += o, h;
}, r.exports = l;
}, { "../utils": 32, "./ArrayReader": 17 }], 22: [function(t, r, n) {
var a = t("../utils"), l = t("../support"), o = t("./ArrayReader"), h = t("./StringReader"), b = t("./NodeBufferReader"), y = t("./Uint8ArrayReader");
r.exports = function(_) {
var w = a.getTypeOf(_);
return a.checkSupport(w), w !== "string" || l.uint8array ? w === "nodebuffer" ? new b(_) : l.uint8array ? new y(a.transformTo("uint8array", _)) : new o(a.transformTo("array", _)) : new h(_);
};
}, { "../support": 30, "../utils": 32, "./ArrayReader": 17, "./NodeBufferReader": 19, "./StringReader": 20, "./Uint8ArrayReader": 21 }], 23: [function(t, r, n) {
n.LOCAL_FILE_HEADER = "PK", n.CENTRAL_FILE_HEADER = "PK", n.CENTRAL_DIRECTORY_END = "PK", n.ZIP64_CENTRAL_DIRECTORY_LOCATOR = "PK\x07", n.ZIP64_CENTRAL_DIRECTORY_END = "PK", n.DATA_DESCRIPTOR = "PK\x07\b";
}, {}], 24: [function(t, r, n) {
var a = t("./GenericWorker"), l = t("../utils");
function o(h) {
a.call(this, "ConvertWorker to " + h), this.destType = h;
}
l.inherits(o, a), o.prototype.processChunk = function(h) {
this.push({ data: l.transformTo(this.destType, h.data), meta: h.meta });
}, r.exports = o;
}, { "../utils": 32, "./GenericWorker": 28 }], 25: [function(t, r, n) {
var a = t("./GenericWorker"), l = t("../crc32");
function o() {
a.call(this, "Crc32Probe"), this.withStreamInfo("crc32", 0);
}
t("../utils").inherits(o, a), o.prototype.processChunk = function(h) {
this.streamInfo.crc32 = l(h.data, this.streamInfo.crc32 || 0), this.push(h);
}, r.exports = o;
}, { "../crc32": 4, "../utils": 32, "./GenericWorker": 28 }], 26: [function(t, r, n) {
var a = t("../utils"), l = t("./GenericWorker");
function o(h) {
l.call(this, "DataLengthProbe for " + h), this.propName = h, this.withStreamInfo(h, 0);
}
a.inherits(o, l), o.prototype.processChunk = function(h) {
if (h) {
var b = this.streamInfo[this.propName] || 0;
this.streamInfo[this.propName] = b + h.data.length;
}
l.prototype.processChunk.call(this, h);
}, r.exports = o;
}, { "../utils": 32, "./GenericWorker": 28 }], 27: [function(t, r, n) {
var a = t("../utils"), l = t("./GenericWorker");
function o(h) {
l.call(this, "DataWorker");
var b = this;
this.dataIsReady = !1, this.index = 0, this.max = 0, this.data = null, this.type = "", this._tickScheduled = !1, h.then(function(y) {
b.dataIsReady = !0, b.data = y, b.max = y && y.length || 0, b.type = a.getTypeOf(y), b.isPaused || b._tickAndRepeat();
}, function(y) {
b.error(y);
});
}
a.inherits(o, l), o.prototype.cleanUp = function() {
l.prototype.cleanUp.call(this), this.data = null;
}, o.prototype.resume = function() {
return !!l.prototype.resume.call(this) && (!this._tickScheduled && this.dataIsReady && (this._tickScheduled = !0, a.delay(this._tickAndRepeat, [], this)), !0);
}, o.prototype._tickAndRepeat = function() {
this._tickScheduled = !1, this.isPaused || this.isFinished || (this._tick(), this.isFinished || (a.delay(this._tickAndRepeat, [], this), this._tickScheduled = !0));
}, o.prototype._tick = function() {
if (this.isPaused || this.isFinished)
return !1;
var h = null, b = Math.min(this.max, this.index + 16384);
if (this.index >= this.max)
return this.end();
switch (this.type) {
case "string":
h = this.data.substring(this.index, b);
break;
case "uint8array":
h = this.data.subarray(this.index, b);
break;
case "array":
case "nodebuffer":
h = this.data.slice(this.index, b);
}
return this.index = b, this.push({ data: h, meta: { percent: this.max ? this.index / this.max * 100 : 0 } });
}, r.exports = o;
}, { "../utils": 32, "./GenericWorker": 28 }], 28: [function(t, r, n) {
function a(l) {
this.name = l || "default", this.streamInfo = {}, this.generatedError = null, this.extraStreamInfo = {}, this.isPaused = !0, this.isFinished = !1, this.isLocked = !1, this._listeners = { data: [], end: [], error: [] }, this.previous = null;
}
a.prototype = { push: function(l) {
this.emit("data", l);
}, end: function() {
if (this.isFinished)
return !1;
this.flush();
try {
this.emit("end"), this.cleanUp(), this.isFinished = !0;
} catch (l) {
this.emit("error", l);
}
return !0;
}, error: function(l) {
return !this.isFinished && (this.isPaused ? this.generatedError = l : (this.isFinished = !0, this.emit("error", l), this.previous && this.previous.error(l), this.cleanUp()), !0);
}, on: function(l, o) {
return this._listeners[l].push(o), this;
}, cleanUp: function() {
this.streamInfo = this.generatedError = this.extraStreamInfo = null, this._listeners = [];
}, emit: function(l, o) {
if (this._listeners[l])
for (var h = 0; h < this._listeners[l].length; h++)
this._listeners[l][h].call(this, o);
}, pipe: function(l) {
return l.registerPrevious(this);
}, registerPrevious: function(l) {
if (this.isLocked)
throw new Error("The stream '" + this + "' has already been used.");
this.streamInfo = l.streamInfo, this.mergeStreamInfo(), this.previous = l;
var o = this;
return l.on("data", function(h) {
o.processChunk(h);
}), l.on("end", function() {
o.end();
}), l.on("error", function(h) {
o.error(h);
}), this;
}, pause: function() {
return !this.isPaused && !this.isFinished && (this.isPaused = !0, this.previous && this.previous.pause(), !0);
}, resume: function() {
if (!this.isPaused || this.isFinished)
return !1;
var l = this.isPaused = !1;
return this.generatedError && (this.error(this.generatedError), l = !0), this.previous && this.previous.resume(), !l;
}, flush: function() {
}, processChunk: function(l) {
this.push(l);
}, withStreamInfo: function(l, o) {
return this.extraStreamInfo[l] = o, this.mergeStreamInfo(), this;
}, mergeStreamInfo: function() {
for (var l in this.extraStreamInfo)
Object.prototype.hasOwnProperty.call(this.extraStreamInfo, l) && (this.streamInfo[l] = this.extraStreamInfo[l]);
}, lock: function() {
if (this.isLocked)
throw new Error("The stream '" + this + "' has already been used.");
this.isLocked = !0, this.previous && this.previous.lock();
}, toString: function() {
var l = "Worker " + this.name;
return this.previous ? this.previous + " -> " + l : l;
} }, r.exports = a;
}, {}], 29: [function(t, r, n) {
var a = t("../utils"), l = t("./ConvertWorker"), o = t("./GenericWorker"), h = t("../base64"), b = t("../support"), y = t("../external"), _ = null;
if (b.nodestream)
try {
_ = t("../nodejs/NodejsStreamOutputAdapter");
} catch (k) {
}
function w(k, u) {
return new y.Promise(function(m, f) {
var v = [], C = k._internalType, A = k._outputType, E = k._mimeType;
k.on("data", function(D, I) {
v.push(D), u && u(I);
}).on("error", function(D) {
v = [], f(D);
}).on("end", function() {
try {
var D = function(I, W, T) {
switch (I) {
case "blob":
return a.newBlob(a.transformTo("arraybuffer", W), T);
case "base64":
return h.encode(W);
default:
return a.transformTo(I, W);
}
}(A, function(I, W) {
var T, X = 0, Q = null, S = 0;
for (T = 0; T < W.length; T++)
S += W[T].length;
switch (I) {
case "string":
return W.join("");
case "array":
return Array.prototype.concat.apply([], W);
case "uint8array":
for (Q = new Uint8Array(S), T = 0; T < W.length; T++)
Q.set(W[T], X), X += W[T].length;
return Q;
case "nodebuffer":
return Buffer.concat(W);
default:
throw new Error("concat : unsupported type '" + I + "'");
}
}(C, v), E);
m(D);
} catch (I) {
f(I);
}
v = [];
}).resume();
});
}
function d(k, u, m) {
var f = u;
switch (u) {
case "blob":
case "arraybuffer":
f = "uint8array";
break;
case "base64":
f = "string";
}
try {
this._internalType = f, this._outputType = u, this._mimeType = m, a.checkSupport(f), this._worker = k.pipe(new l(f)), k.lock();
} catch (v) {
this._worker = new o("error"), this._worker.error(v);
}
}
d.prototype = { accumulate: function(k) {
return w(this, k);
}, on: function(k, u) {
var m = this;
return k === "data" ? this._worker.on(k, function(f) {
u.call(m, f.data, f.meta);
}) : this._worker.on(k, function() {
a.delay(u, arguments, m);
}), this;
}, resume: function() {
return a.delay(this._worker.resume, [], this._worker), this;
}, pause: function() {
return this._worker.pause(), this;
}, toNodejsStream: function(k) {
if (a.checkSupport("nodestream"), this._outputType !== "nodebuffer")
throw new Error(this._outputType + " is not supported by this method");
return new _(this, { objectMode: this._outputType !== "nodebuffer" }, k);
} }, r.exports = d;
}, { "../base64": 1, "../external": 6, "../nodejs/NodejsStreamOutputAdapter": 13, "../support": 30, "../utils": 32, "./ConvertWorker": 24, "./GenericWorker": 28 }], 30: [function(t, r, n) {
if (n.base64 = !0, n.array = !0, n.string = !0, n.arraybuffer = typeof ArrayBuffer != "undefined" && typeof Uint8Array != "undefined", n.nodebuffer = typeof Buffer != "undefined", n.uint8array = typeof Uint8Array != "undefined", typeof ArrayBuffer == "undefined")
n.blob = !1;
else {
var a = new ArrayBuffer(0);
try {
n.blob = new Blob([a], { type: "application/zip" }).size === 0;
} catch (o) {
try {
var l = new (self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder)();
l.append(a), n.blob = l.getBlob("application/zip").size === 0;
} catch (h) {
n.blob = !1;
}
}
}
try {
n.nodestream = !!t("readable-stream").Readable;
} catch (o) {
n.nodestream = !1;
}
}, { "readable-stream": 16 }], 31: [function(t, r, n) {
for (var a = t("./utils"), l = t("./support"), o = t("./nodejsUtils"), h = t("./stream/GenericWorker"), b = new Array(256), y = 0; y < 256; y++)
b[y] = 252 <= y ? 6 : 248 <= y ? 5 : 240 <= y ? 4 : 224 <= y ? 3 : 192 <= y ? 2 : 1;
b[254] = b[254] = 1;
function _() {
h.call(this, "utf-8 decode"), this.leftOver = null;
}
function w() {
h.call(this, "utf-8 encode");
}
n.utf8encode = function(d) {
return l.nodebuffer ? o.newBufferFrom(d, "utf-8") : function(k) {
var u, m, f, v, C, A = k.length, E = 0;
for (v = 0; v < A; v++)
(64512 & (m = k.charCodeAt(v))) == 55296 && v + 1 < A && (64512 & (f = k.charCodeAt(v + 1))) == 56320 && (m = 65536 + (m - 55296 << 10) + (f - 56320), v++), E += m < 128 ? 1 : m < 2048 ? 2 : m < 65536 ? 3 : 4;
for (u = l.uint8array ? new Uint8Array(E) : new Array(E), v = C = 0; C < E; v++)
(64512 & (m = k.charCodeAt(v))) == 55296 && v + 1 < A && (64512 & (f = k.charCodeAt(v + 1))) == 56320 && (m = 65536 + (m - 55296 << 10) + (f - 56320), v++), m < 128 ? u[C++] = m : (m < 2048 ? u[C++] = 192 | m >>> 6 : (m < 65536 ? u[C++] = 224 | m >>> 12 : (u[C++] = 240 | m >>> 18, u[C++] = 128 | m >>> 12 & 63), u[C++] = 128 | m >>> 6 & 63), u[C++] = 128 | 63 & m);
return u;
}(d);
}, n.utf8decode = function(d) {
return l.nodebuffer ? a.transformTo("nodebuffer", d).toString("utf-8") : function(k) {
var u, m, f, v, C = k.length, A = new Array(2 * C);
for (u = m = 0; u < C; )
if ((f = k[u++]) < 128)
A[m++] = f;
else if (4 < (v = b[f]))
A[m++] = 65533, u += v - 1;
else {
for (f &= v === 2 ? 31 : v === 3 ? 15 : 7; 1 < v && u < C; )
f = f << 6 | 63 & k[u++], v--;
1 < v ? A[m++] = 65533 : f < 65536 ? A[m++] = f : (f -= 65536, A[m++] = 55296 | f >> 10 & 1023, A[m++] = 56320 | 1023 & f);
}
return A.length !== m && (A.subarray ? A = A.subarray(0, m) : A.length = m), a.applyFromCharCode(A);
}(d = a.transformTo(l.uint8array ? "uint8array" : "array", d));
}, a.inherits(_, h), _.prototype.processChunk = function(d) {
var k = a.transformTo(l.uint8array ? "uint8array" : "array", d.data);
if (this.leftOver && this.leftOver.length) {
if (l.uint8array) {
var u = k;
(k = new Uint8Array(u.length + this.leftOver.length)).set(this.leftOver, 0), k.set(u, this.leftOver.length);
} else
k = this.leftOver.concat(k);
this.leftOver = null;
}
var m = function(v, C) {
var A;
for ((C = C || v.length) > v.length && (C = v.length), A = C - 1; 0 <= A && (192 & v[A]) == 128; )
A--;
return A < 0 || A === 0 ? C : A + b[v[A]] > C ? A : C;
}(k), f = k;
m !== k.length && (l.uint8array ? (f = k.subarray(0, m), this.leftOver = k.subarray(m, k.length)) : (f = k.slice(0, m), this.leftOver = k.slice(m, k.length))), this.push({ data: n.utf8decode(f), meta: d.meta });
}, _.prototype.flush = function() {
this.leftOver && this.leftOver.length && (this.push({ data: n.utf8decode(this.leftOver), meta: {} }), this.leftOver = null);
}, n.Utf8DecodeWorker = _, a.inherits(w, h), w.prototype.processChunk = function(d) {
this.push({ data: n.utf8encode(d.data), meta: d.meta });
}, n.Utf8EncodeWorker = w;
}, { "./nodejsUtils": 14, "./stream/GenericWorker": 28, "./support": 30, "./utils": 32 }], 32: [function(t, r, n) {
var a = t("./support"), l = t("./base64"), o = t("./nodejsUtils"), h = t("./external");
function b(u) {
return u;
}
function y(u, m) {
for (var f = 0; f < u.length; ++f)
m[f] = 255 & u.charCodeAt(f);
return m;
}
t("setimmediate"), n.newBlob = function(u, m) {
n.checkSupport("blob");
try {
return new Blob([u], { type: m });
} catch (v) {
try {
var f = new (self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder)();
return f.append(u), f.getBlob(m);
} catch (C) {
throw new Error("Bug : can't construct the Blob.");
}
}
};
var _ = { stringifyByChunk: function(u, m, f) {
var v = [], C = 0, A = u.length;
if (A <= f)
return String.fromCharCode.apply(null, u);
for (; C < A; )
m === "array" || m === "nodebuffer" ? v.push(String.fromCharCode.apply(null, u.slice(C, Math.min(C + f, A)))) : v.push(String.fromCharCode.apply(null, u.subarray(C, Math.min(C + f, A)))), C += f;
return v.join("");
}, stringifyByChar: function(u) {
for (var m = "", f = 0; f < u.length; f++)
m += String.fromCharCode(u[f]);
return m;
}, applyCanBeUsed: { uint8array: function() {
try {
return a.uint8array && String.fromCharCode.apply(null, new Uint8Array(1)).length === 1;
} catch (u) {
return !1;
}
}(), nodebuffer: function() {
try {
return a.nodebuffer && String.fromCharCode.apply(null, o.allocBuffer(1)).length === 1;
} catch (u) {
return !1;
}
}() } };
function w(u) {
var m = 65536, f = n.getTypeOf(u), v = !0;
if (f === "uint8array" ? v = _.applyCanBeUsed.uint8array : f === "nodebuffer" && (v = _.applyCanBeUsed.nodebuffer), v)
for (; 1 < m; )
try {
return _.stringifyByChunk(u, f, m);
} catch (C) {
m = Math.floor(m / 2);
}
return _.stringifyByChar(u);
}
function d(u, m) {
for (var f = 0; f < u.length; f++)
m[f] = u[f];
return m;
}
n.applyFromCharCode = w;
var k = {};
k.string = { string: b, array: function(u) {
return y(u, new Array(u.length));
}, arraybuffer: function(u) {
return k.string.uint8array(u).buffer;
}, uint8array: function(u) {
return y(u, new Uint8Array(u.length));
}, nodebuffer: function(u) {
return y(u, o.allocBuffer(u.length));
} }, k.array = { string: w, array: b, arraybuffer: function(u) {
return new Uint8Array(u).buffer;
}, uint8array: function(u) {
return new Uint8Array(u);
}, nodebuffer: function(u) {
return o.newBufferFrom(u);
} }, k.arraybuffer = { string: function(u) {
return w(new Uint8Array(u));
}, array: function(u) {
return d(new Uint8Array(u), new Array(u.byteLength));
}, arraybuffer: b, uint8array: function(u) {
return new Uint8Array(u);
}, nodebuffer: function(u) {
return o.newBufferFrom(new Uint8Array(u));
} }, k.uint8array = { string: w, array: function(u) {
return d(u, new Array(u.length));
}, arraybuffer: function(u) {
return u.buffer;
}, uint8array: b, nodebuffer: function(u) {
return o.newBufferFrom(u);
} }, k.nodebuffer = { string: w, array: function(u) {
return d(u, new Array(u.length));
}, arraybuffer: function(u) {
return k.nodebuffer.uint8array(u).buffer;
}, uint8array: function(u) {
return d(u, new Uint8Array(u.length));
}, nodebuffer: b }, n.transformTo = function(u, m) {
if (m = m || "", !u)
return m;
n.checkSupport(u);
var f = n.getTypeOf(m);
return k[f][u](m);
}, n.resolve = function(u) {
for (var m = u.split("/"), f = [], v = 0; v < m.length; v++) {
var C = m[v];
C === "." || C === "" && v !== 0 && v !== m.length - 1 || (C === ".." ? f.pop() : f.push(C));
}
return f.join("/");
}, n.getTypeOf = function(u) {
return typeof u == "string" ? "string" : Object.prototype.toString.call(u) === "[object Array]" ? "array" : a.nodebuffer && o.isBuffer(u) ? "nodebuffer" : a.uint8array && u instanceof Uint8Array ? "uint8array" : a.arraybuffer && u instanceof ArrayBuffer ? "arraybuffer" : void 0;
}, n.checkSupport = function(u) {
if (!a[u.toLowerCase()])
throw new Error(u + " is not supported by this platform");
}, n.MAX_VALUE_16BITS = 65535, n.MAX_VALUE_32BITS = -1, n.pretty = function(u) {
var m, f, v = "";
for (f = 0; f < (u || "").length; f++)
v += "\\x" + ((m = u.charCodeAt(f)) < 16 ? "0" : "") + m.toString(16).toUpperCase();
retu