UNPKG

simple-mind-map

Version:

一个简单的web在线思维导图

969 lines (966 loc) 3.05 MB
var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x2, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x2)(function(x2) { if (typeof require !== "undefined") return require.apply(this, arguments); throw new Error('Dynamic require of "' + x2 + '" is not supported'); }); var __commonJS = (cb, mod) => function __require2() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all2) => { for (var name in all2) __defProp(target, name, { get: all2[name], enumerable: true }); }; var __copyProps = (to2, from2, except, desc) => { if (from2 && typeof from2 === "object" || typeof from2 === "function") { for (let key of __getOwnPropNames(from2)) if (!__hasOwnProp.call(to2, key) && key !== except) __defProp(to2, key, { get: () => from2[key], enumerable: !(desc = __getOwnPropDesc(from2, key)) || desc.enumerable }); } return to2; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __publicField = (obj, key, value) => { __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); return value; }; // ../simple-mind-map/node_modules/eventemitter3/index.js var require_eventemitter3 = __commonJS({ "../simple-mind-map/node_modules/eventemitter3/index.js"(exports2, module2) { "use strict"; var has = Object.prototype.hasOwnProperty; var prefix = "~"; function Events() { } if (Object.create) { Events.prototype = /* @__PURE__ */ Object.create(null); if (!new Events().__proto__) prefix = false; } function EE(fn, context, once) { this.fn = fn; this.context = context; this.once = once || false; } function addListener(emitter, event, fn, context, once) { if (typeof fn !== "function") { throw new TypeError("The listener must be a function"); } var listener = new EE(fn, context || emitter, once), evt = prefix ? prefix + event : event; if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); else emitter._events[evt] = [emitter._events[evt], listener]; return emitter; } function clearEvent(emitter, evt) { if (--emitter._eventsCount === 0) emitter._events = new Events(); else delete emitter._events[evt]; } function EventEmitter3() { this._events = new Events(); this._eventsCount = 0; } EventEmitter3.prototype.eventNames = function eventNames() { var names2 = [], events, name; if (this._eventsCount === 0) return names2; for (name in events = this._events) { if (has.call(events, name)) names2.push(prefix ? name.slice(1) : name); } if (Object.getOwnPropertySymbols) { return names2.concat(Object.getOwnPropertySymbols(events)); } return names2; }; EventEmitter3.prototype.listeners = function listeners(event) { var evt = prefix ? prefix + event : event, handlers = this._events[evt]; if (!handlers) return []; if (handlers.fn) return [handlers.fn]; for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { ee[i] = handlers[i].fn; } return ee; }; EventEmitter3.prototype.listenerCount = function listenerCount(event) { var evt = prefix ? prefix + event : event, listeners = this._events[evt]; if (!listeners) return 0; if (listeners.fn) return 1; return listeners.length; }; EventEmitter3.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { var evt = prefix ? prefix + event : event; if (!this._events[evt]) return false; var listeners = this._events[evt], len = arguments.length, args, i; if (listeners.fn) { if (listeners.once) this.removeListener(event, listeners.fn, void 0, true); switch (len) { case 1: return listeners.fn.call(listeners.context), true; case 2: return listeners.fn.call(listeners.context, a1), true; case 3: return listeners.fn.call(listeners.context, a1, a2), true; case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; } for (i = 1, args = new Array(len - 1); i < len; i++) { args[i - 1] = arguments[i]; } listeners.fn.apply(listeners.context, args); } else { var length2 = listeners.length, j; for (i = 0; i < length2; i++) { if (listeners[i].once) this.removeListener(event, listeners[i].fn, void 0, true); switch (len) { case 1: listeners[i].fn.call(listeners[i].context); break; case 2: listeners[i].fn.call(listeners[i].context, a1); break; case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; default: if (!args) for (j = 1, args = new Array(len - 1); j < len; j++) { args[j - 1] = arguments[j]; } listeners[i].fn.apply(listeners[i].context, args); } } } return true; }; EventEmitter3.prototype.on = function on2(event, fn, context) { return addListener(this, event, fn, context, false); }; EventEmitter3.prototype.once = function once(event, fn, context) { return addListener(this, event, fn, context, true); }; EventEmitter3.prototype.removeListener = function removeListener(event, fn, context, once) { var evt = prefix ? prefix + event : event; if (!this._events[evt]) return this; if (!fn) { clearEvent(this, evt); return this; } var listeners = this._events[evt]; if (listeners.fn) { if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) { clearEvent(this, evt); } } else { for (var i = 0, events = [], length2 = listeners.length; i < length2; i++) { if (listeners[i].fn !== fn || once && !listeners[i].once || context && listeners[i].context !== context) { events.push(listeners[i]); } } if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; else clearEvent(this, evt); } return this; }; EventEmitter3.prototype.removeAllListeners = function removeAllListeners(event) { var evt; if (event) { evt = prefix ? prefix + event : event; if (this._events[evt]) clearEvent(this, evt); } else { this._events = new Events(); this._eventsCount = 0; } return this; }; EventEmitter3.prototype.off = EventEmitter3.prototype.removeListener; EventEmitter3.prototype.addListener = EventEmitter3.prototype.on; EventEmitter3.prefixed = prefix; EventEmitter3.EventEmitter = EventEmitter3; if ("undefined" !== typeof module2) { module2.exports = EventEmitter3; } } }); // ../simple-mind-map/node_modules/deepmerge/dist/cjs.js var require_cjs = __commonJS({ "../simple-mind-map/node_modules/deepmerge/dist/cjs.js"(exports2, module2) { "use strict"; var isMergeableObject = function isMergeableObject2(value) { return isNonNullObject(value) && !isSpecial(value); }; function isNonNullObject(value) { return !!value && typeof value === "object"; } function isSpecial(value) { var stringValue = Object.prototype.toString.call(value); return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value); } var canUseSymbol = typeof Symbol === "function" && Symbol.for; var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103; function isReactElement(value) { return value.$$typeof === REACT_ELEMENT_TYPE; } function emptyTarget(val) { return Array.isArray(val) ? [] : {}; } function cloneIfNecessary(value, optionsArgument) { var clone = optionsArgument && optionsArgument.clone === true; return clone && isMergeableObject(value) ? deepmerge(emptyTarget(value), value, optionsArgument) : value; } function defaultArrayMerge(target, source, optionsArgument) { var destination = target.slice(); source.forEach(function(e, i) { if (typeof destination[i] === "undefined") { destination[i] = cloneIfNecessary(e, optionsArgument); } else if (isMergeableObject(e)) { destination[i] = deepmerge(target[i], e, optionsArgument); } else if (target.indexOf(e) === -1) { destination.push(cloneIfNecessary(e, optionsArgument)); } }); return destination; } function mergeObject(target, source, optionsArgument) { var destination = {}; if (isMergeableObject(target)) { Object.keys(target).forEach(function(key) { destination[key] = cloneIfNecessary(target[key], optionsArgument); }); } Object.keys(source).forEach(function(key) { if (!isMergeableObject(source[key]) || !target[key]) { destination[key] = cloneIfNecessary(source[key], optionsArgument); } else { destination[key] = deepmerge(target[key], source[key], optionsArgument); } }); return destination; } function deepmerge(target, source, optionsArgument) { var sourceIsArray = Array.isArray(source); var targetIsArray = Array.isArray(target); var options = optionsArgument || { arrayMerge: defaultArrayMerge }; var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray; if (!sourceAndTargetTypesMatch) { return cloneIfNecessary(source, optionsArgument); } else if (sourceIsArray) { var arrayMerge = options.arrayMerge || defaultArrayMerge; return arrayMerge(target, source, optionsArgument); } else { return mergeObject(target, source, optionsArgument); } } deepmerge.all = function deepmergeAll(array2, optionsArgument) { if (!Array.isArray(array2) || array2.length < 2) { throw new Error("first argument should be an array with at least two elements"); } return array2.reduce(function(prev2, next2) { return deepmerge(prev2, next2, optionsArgument); }); }; var deepmerge_1 = deepmerge; module2.exports = deepmerge_1; } }); // ../simple-mind-map/node_modules/jszip/dist/jszip.min.js var require_jszip_min = __commonJS({ "../simple-mind-map/node_modules/jszip/dist/jszip.min.js"(exports2, module2) { !function(e) { if ("object" == typeof exports2 && "undefined" != typeof module2) module2.exports = e(); else if ("function" == typeof define && define.amd) define([], e); else { ("undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this).JSZip = e(); } }(function() { return function s(a, o, h) { function u(r, e2) { if (!o[r]) { if (!a[r]) { var t = "function" == typeof __require && __require; if (!e2 && t) return t(r, true); if (l) return l(r, true); var n = new Error("Cannot find module '" + r + "'"); throw n.code = "MODULE_NOT_FOUND", n; } var i = o[r] = { exports: {} }; a[r][0].call(i.exports, function(e3) { var t2 = a[r][1][e3]; return u(t2 || e3); }, i, i.exports, s, a, o, h); } return o[r].exports; } for (var l = "function" == typeof __require && __require, e = 0; e < h.length; e++) u(h[e]); return u; }({ 1: [function(e, t, r) { "use strict"; var d = e("./utils"), c = e("./support"), p = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; r.encode = function(e2) { for (var t2, r2, n, i, s, a, o, h = [], u = 0, l = e2.length, f = l, c2 = "string" !== d.getTypeOf(e2); u < e2.length; ) f = l - u, n = c2 ? (t2 = e2[u++], r2 = u < l ? e2[u++] : 0, u < l ? e2[u++] : 0) : (t2 = e2.charCodeAt(u++), r2 = u < l ? e2.charCodeAt(u++) : 0, u < l ? e2.charCodeAt(u++) : 0), i = t2 >> 2, s = (3 & t2) << 4 | r2 >> 4, a = 1 < f ? (15 & r2) << 2 | n >> 6 : 64, o = 2 < f ? 63 & n : 64, h.push(p.charAt(i) + p.charAt(s) + p.charAt(a) + p.charAt(o)); return h.join(""); }, r.decode = function(e2) { var t2, r2, n, i, s, a, o = 0, h = 0, u = "data:"; if (e2.substr(0, u.length) === u) throw new Error("Invalid base64 input, it looks like a data url."); var l, f = 3 * (e2 = e2.replace(/[^A-Za-z0-9+/=]/g, "")).length / 4; if (e2.charAt(e2.length - 1) === p.charAt(64) && f--, e2.charAt(e2.length - 2) === p.charAt(64) && f--, f % 1 != 0) throw new Error("Invalid base64 input, bad content length."); for (l = c.uint8array ? new Uint8Array(0 | f) : new Array(0 | f); o < e2.length; ) t2 = p.indexOf(e2.charAt(o++)) << 2 | (i = p.indexOf(e2.charAt(o++))) >> 4, r2 = (15 & i) << 4 | (s = p.indexOf(e2.charAt(o++))) >> 2, n = (3 & s) << 6 | (a = p.indexOf(e2.charAt(o++))), l[h++] = t2, 64 !== s && (l[h++] = r2), 64 !== a && (l[h++] = n); return l; }; }, { "./support": 30, "./utils": 32 }], 2: [function(e, t, r) { "use strict"; var n = e("./external"), i = e("./stream/DataWorker"), s = e("./stream/Crc32Probe"), a = e("./stream/DataLengthProbe"); function o(e2, t2, r2, n2, i2) { this.compressedSize = e2, this.uncompressedSize = t2, this.crc32 = r2, this.compression = n2, this.compressedContent = i2; } o.prototype = { getContentWorker: function() { var e2 = new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")), t2 = this; return e2.on("end", function() { if (this.streamInfo.data_length !== t2.uncompressedSize) throw new Error("Bug : uncompressed data size mismatch"); }), e2; }, getCompressedWorker: function() { return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize", this.compressedSize).withStreamInfo("uncompressedSize", this.uncompressedSize).withStreamInfo("crc32", this.crc32).withStreamInfo("compression", this.compression); } }, o.createWorkerFrom = function(e2, t2, r2) { return e2.pipe(new s()).pipe(new a("uncompressedSize")).pipe(t2.compressWorker(r2)).pipe(new a("compressedSize")).withStreamInfo("compression", t2); }, t.exports = o; }, { "./external": 6, "./stream/Crc32Probe": 25, "./stream/DataLengthProbe": 26, "./stream/DataWorker": 27 }], 3: [function(e, t, r) { "use strict"; var n = e("./stream/GenericWorker"); r.STORE = { magic: "\0\0", compressWorker: function() { return new n("STORE compression"); }, uncompressWorker: function() { return new n("STORE decompression"); } }, r.DEFLATE = e("./flate"); }, { "./flate": 7, "./stream/GenericWorker": 28 }], 4: [function(e, t, r) { "use strict"; var n = e("./utils"); var o = function() { for (var e2, t2 = [], r2 = 0; r2 < 256; r2++) { e2 = r2; for (var n2 = 0; n2 < 8; n2++) e2 = 1 & e2 ? 3988292384 ^ e2 >>> 1 : e2 >>> 1; t2[r2] = e2; } return t2; }(); t.exports = function(e2, t2) { return void 0 !== e2 && e2.length ? "string" !== n.getTypeOf(e2) ? function(e3, t3, r2, n2) { var i = o, s = n2 + r2; e3 ^= -1; for (var a = n2; a < s; a++) e3 = e3 >>> 8 ^ i[255 & (e3 ^ t3[a])]; return -1 ^ e3; }(0 | t2, e2, e2.length, 0) : function(e3, t3, r2, n2) { var i = o, s = n2 + r2; e3 ^= -1; for (var a = n2; a < s; a++) e3 = e3 >>> 8 ^ i[255 & (e3 ^ t3.charCodeAt(a))]; return -1 ^ e3; }(0 | t2, e2, e2.length, 0) : 0; }; }, { "./utils": 32 }], 5: [function(e, t, r) { "use strict"; r.base64 = false, r.binary = false, r.dir = false, r.createFolders = true, r.date = null, r.compression = null, r.compressionOptions = null, r.comment = null, r.unixPermissions = null, r.dosPermissions = null; }, {}], 6: [function(e, t, r) { "use strict"; var n = null; n = "undefined" != typeof Promise ? Promise : e("lie"), t.exports = { Promise: n }; }, { lie: 37 }], 7: [function(e, t, r) { "use strict"; var n = "undefined" != typeof Uint8Array && "undefined" != typeof Uint16Array && "undefined" != typeof Uint32Array, i = e("pako"), s = e("./utils"), a = e("./stream/GenericWorker"), o = n ? "uint8array" : "array"; function h(e2, t2) { a.call(this, "FlateWorker/" + e2), this._pako = null, this._pakoAction = e2, this._pakoOptions = t2, this.meta = {}; } r.magic = "\b\0", s.inherits(h, a), h.prototype.processChunk = function(e2) { this.meta = e2.meta, null === this._pako && this._createPako(), this._pako.push(s.transformTo(o, e2.data), false); }, h.prototype.flush = function() { a.prototype.flush.call(this), null === this._pako && this._createPako(), this._pako.push([], true); }, h.prototype.cleanUp = function() { a.prototype.cleanUp.call(this), this._pako = null; }, h.prototype._createPako = function() { this._pako = new i[this._pakoAction]({ raw: true, level: this._pakoOptions.level || -1 }); var t2 = this; this._pako.onData = function(e2) { t2.push({ data: e2, meta: t2.meta }); }; }, r.compressWorker = function(e2) { return new h("Deflate", e2); }, r.uncompressWorker = function() { return new h("Inflate", {}); }; }, { "./stream/GenericWorker": 28, "./utils": 32, pako: 38 }], 8: [function(e, t, r) { "use strict"; function A2(e2, t2) { var r2, n2 = ""; for (r2 = 0; r2 < t2; r2++) n2 += String.fromCharCode(255 & e2), e2 >>>= 8; return n2; } function n(e2, t2, r2, n2, i2, s2) { var a, o, h = e2.file, u = e2.compression, l = s2 !== O.utf8encode, f = I.transformTo("string", s2(h.name)), c = I.transformTo("string", O.utf8encode(h.name)), d = h.comment, p = I.transformTo("string", s2(d)), m = I.transformTo("string", O.utf8encode(d)), _ = c.length !== h.name.length, g = m.length !== d.length, b = "", v = "", y2 = "", w = h.dir, k = h.date, x2 = { crc32: 0, compressedSize: 0, uncompressedSize: 0 }; t2 && !r2 || (x2.crc32 = e2.crc32, x2.compressedSize = e2.compressedSize, x2.uncompressedSize = e2.uncompressedSize); var S2 = 0; t2 && (S2 |= 8), l || !_ && !g || (S2 |= 2048); var z = 0, C = 0; w && (z |= 16), "UNIX" === i2 ? (C = 798, z |= function(e3, t3) { var r3 = e3; return e3 || (r3 = t3 ? 16893 : 33204), (65535 & r3) << 16; }(h.unixPermissions, w)) : (C = 20, z |= function(e3) { return 63 & (e3 || 0); }(h.dosPermissions)), a = k.getUTCHours(), a <<= 6, a |= k.getUTCMinutes(), a <<= 5, a |= k.getUTCSeconds() / 2, o = k.getUTCFullYear() - 1980, o <<= 4, o |= k.getUTCMonth() + 1, o <<= 5, o |= k.getUTCDate(), _ && (v = A2(1, 1) + A2(B(f), 4) + c, b += "up" + A2(v.length, 2) + v), g && (y2 = A2(1, 1) + A2(B(p), 4) + m, b += "uc" + A2(y2.length, 2) + y2); var E = ""; return E += "\n\0", E += A2(S2, 2), E += u.magic, E += A2(a, 2), E += A2(o, 2), E += A2(x2.crc32, 4), E += A2(x2.compressedSize, 4), E += A2(x2.uncompressedSize, 4), E += A2(f.length, 2), E += A2(b.length, 2), { fileRecord: R.LOCAL_FILE_HEADER + E + f + b, dirRecord: R.CENTRAL_FILE_HEADER + A2(C, 2) + E + A2(p.length, 2) + "\0\0\0\0" + A2(z, 4) + A2(n2, 4) + f + b + p }; } var I = e("../utils"), i = e("../stream/GenericWorker"), O = e("../utf8"), B = e("../crc32"), R = e("../signature"); function s(e2, t2, r2, n2) { i.call(this, "ZipFileWorker"), this.bytesWritten = 0, this.zipComment = t2, this.zipPlatform = r2, this.encodeFileName = n2, this.streamFiles = e2, this.accumulate = false, this.contentBuffer = [], this.dirRecords = [], this.currentSourceOffset = 0, this.entriesCount = 0, this.currentFile = null, this._sources = []; } I.inherits(s, i), s.prototype.push = function(e2) { var t2 = e2.meta.percent || 0, r2 = this.entriesCount, n2 = this._sources.length; this.accumulate ? this.contentBuffer.push(e2) : (this.bytesWritten += e2.data.length, i.prototype.push.call(this, { data: e2.data, meta: { currentFile: this.currentFile, percent: r2 ? (t2 + 100 * (r2 - n2 - 1)) / r2 : 100 } })); }, s.prototype.openedSource = function(e2) { this.currentSourceOffset = this.bytesWritten, this.currentFile = e2.file.name; var t2 = this.streamFiles && !e2.file.dir; if (t2) { var r2 = n(e2, t2, false, this.currentSourceOffset, this.zipPlatform, this.encodeFileName); this.push({ data: r2.fileRecord, meta: { percent: 0 } }); } else this.accumulate = true; }, s.prototype.closedSource = function(e2) { this.accumulate = false; var t2 = this.streamFiles && !e2.file.dir, r2 = n(e2, t2, true, this.currentSourceOffset, this.zipPlatform, this.encodeFileName); if (this.dirRecords.push(r2.dirRecord), t2) this.push({ data: function(e3) { return R.DATA_DESCRIPTOR + A2(e3.crc32, 4) + A2(e3.compressedSize, 4) + A2(e3.uncompressedSize, 4); }(e2), meta: { percent: 100 } }); else for (this.push({ data: r2.fileRecord, meta: { percent: 0 } }); this.contentBuffer.length; ) this.push(this.contentBuffer.shift()); this.currentFile = null; }, s.prototype.flush = function() { for (var e2 = this.bytesWritten, t2 = 0; t2 < this.dirRecords.length; t2++) this.push({ data: this.dirRecords[t2], meta: { percent: 100 } }); var r2 = this.bytesWritten - e2, n2 = function(e3, t3, r3, n3, i2) { var s2 = I.transformTo("string", i2(n3)); return R.CENTRAL_DIRECTORY_END + "\0\0\0\0" + A2(e3, 2) + A2(e3, 2) + A2(t3, 4) + A2(r3, 4) + A2(s2.length, 2) + s2; }(this.dirRecords.length, r2, e2, this.zipComment, this.encodeFileName); this.push({ data: n2, meta: { percent: 100 } }); }, s.prototype.prepareNextSource = function() { this.previous = this._sources.shift(), this.openedSource(this.previous.streamInfo), this.isPaused ? this.previous.pause() : this.previous.resume(); }, s.prototype.registerPrevious = function(e2) { this._sources.push(e2); var t2 = this; return e2.on("data", function(e3) { t2.processChunk(e3); }), e2.on("end", function() { t2.closedSource(t2.previous.streamInfo), t2._sources.length ? t2.prepareNextSource() : t2.end(); }), e2.on("error", function(e3) { t2.error(e3); }), this; }, s.prototype.resume = function() { return !!i.prototype.resume.call(this) && (!this.previous && this._sources.length ? (this.prepareNextSource(), true) : this.previous || this._sources.length || this.generatedError ? void 0 : (this.end(), true)); }, s.prototype.error = function(e2) { var t2 = this._sources; if (!i.prototype.error.call(this, e2)) return false; for (var r2 = 0; r2 < t2.length; r2++) try { t2[r2].error(e2); } catch (e3) { } return true; }, s.prototype.lock = function() { i.prototype.lock.call(this); for (var e2 = this._sources, t2 = 0; t2 < e2.length; t2++) e2[t2].lock(); }, t.exports = s; }, { "../crc32": 4, "../signature": 23, "../stream/GenericWorker": 28, "../utf8": 31, "../utils": 32 }], 9: [function(e, t, r) { "use strict"; var u = e("../compressions"), n = e("./ZipFileWorker"); r.generateWorker = function(e2, a, t2) { var o = new n(a.streamFiles, t2, a.platform, a.encodeFileName), h = 0; try { e2.forEach(function(e3, t3) { h++; var r2 = function(e4, t4) { var r3 = e4 || t4, n3 = u[r3]; if (!n3) throw new Error(r3 + " is not a valid compression method !"); return n3; }(t3.options.compression, a.compression), n2 = t3.options.compressionOptions || a.compressionOptions || {}, i = t3.dir, s = t3.date; t3._compressWorker(r2, n2).withStreamInfo("file", { name: e3, dir: i, date: s, comment: t3.comment || "", unixPermissions: t3.unixPermissions, dosPermissions: t3.dosPermissions }).pipe(o); }), o.entriesCount = h; } catch (e3) { o.error(e3); } return o; }; }, { "../compressions": 3, "./ZipFileWorker": 8 }], 10: [function(e, t, r) { "use strict"; function n() { if (!(this instanceof n)) return new n(); 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 e2 = new n(); for (var t2 in this) "function" != typeof this[t2] && (e2[t2] = this[t2]); return e2; }; } (n.prototype = e("./object")).loadAsync = e("./load"), n.support = e("./support"), n.defaults = e("./defaults"), n.version = "3.10.1", n.loadAsync = function(e2, t2) { return new n().loadAsync(e2, t2); }, n.external = e("./external"), t.exports = n; }, { "./defaults": 5, "./external": 6, "./load": 11, "./object": 15, "./support": 30 }], 11: [function(e, t, r) { "use strict"; var u = e("./utils"), i = e("./external"), n = e("./utf8"), s = e("./zipEntries"), a = e("./stream/Crc32Probe"), l = e("./nodejsUtils"); function f(n2) { return new i.Promise(function(e2, t2) { var r2 = n2.decompressed.getContentWorker().pipe(new a()); r2.on("error", function(e3) { t2(e3); }).on("end", function() { r2.streamInfo.crc32 !== n2.decompressed.crc32 ? t2(new Error("Corrupted zip : CRC32 mismatch")) : e2(); }).resume(); }); } t.exports = function(e2, o) { var h = this; return o = u.extend(o || {}, { base64: false, checkCRC32: false, optimizedBinaryString: false, createFolders: false, decodeFileName: n.utf8decode }), l.isNode && l.isStream(e2) ? i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")) : u.prepareContent("the loaded zip file", e2, true, o.optimizedBinaryString, o.base64).then(function(e3) { var t2 = new s(o); return t2.load(e3), t2; }).then(function(e3) { var t2 = [i.Promise.resolve(e3)], r2 = e3.files; if (o.checkCRC32) for (var n2 = 0; n2 < r2.length; n2++) t2.push(f(r2[n2])); return i.Promise.all(t2); }).then(function(e3) { for (var t2 = e3.shift(), r2 = t2.files, n2 = 0; n2 < r2.length; n2++) { var i2 = r2[n2], s2 = i2.fileNameStr, a2 = u.resolve(i2.fileNameStr); h.file(a2, i2.decompressed, { binary: true, optimizedBinaryString: true, date: i2.date, dir: i2.dir, comment: i2.fileCommentStr.length ? i2.fileCommentStr : null, unixPermissions: i2.unixPermissions, dosPermissions: i2.dosPermissions, createFolders: o.createFolders }), i2.dir || (h.file(a2).unsafeOriginalName = s2); } return t2.zipComment.length && (h.comment = t2.zipComment), h; }); }; }, { "./external": 6, "./nodejsUtils": 14, "./stream/Crc32Probe": 25, "./utf8": 31, "./utils": 32, "./zipEntries": 33 }], 12: [function(e, t, r) { "use strict"; var n = e("../utils"), i = e("../stream/GenericWorker"); function s(e2, t2) { i.call(this, "Nodejs stream input adapter for " + e2), this._upstreamEnded = false, this._bindStream(t2); } n.inherits(s, i), s.prototype._bindStream = function(e2) { var t2 = this; (this._stream = e2).pause(), e2.on("data", function(e3) { t2.push({ data: e3, meta: { percent: 0 } }); }).on("error", function(e3) { t2.isPaused ? this.generatedError = e3 : t2.error(e3); }).on("end", function() { t2.isPaused ? t2._upstreamEnded = true : t2.end(); }); }, s.prototype.pause = function() { return !!i.prototype.pause.call(this) && (this._stream.pause(), true); }, s.prototype.resume = function() { return !!i.prototype.resume.call(this) && (this._upstreamEnded ? this.end() : this._stream.resume(), true); }, t.exports = s; }, { "../stream/GenericWorker": 28, "../utils": 32 }], 13: [function(e, t, r) { "use strict"; var i = e("readable-stream").Readable; function n(e2, t2, r2) { i.call(this, t2), this._helper = e2; var n2 = this; e2.on("data", function(e3, t3) { n2.push(e3) || n2._helper.pause(), r2 && r2(t3); }).on("error", function(e3) { n2.emit("error", e3); }).on("end", function() { n2.push(null); }); } e("../utils").inherits(n, i), n.prototype._read = function() { this._helper.resume(); }, t.exports = n; }, { "../utils": 32, "readable-stream": 16 }], 14: [function(e, t, r) { "use strict"; t.exports = { isNode: "undefined" != typeof Buffer, newBufferFrom: function(e2, t2) { if (Buffer.from && Buffer.from !== Uint8Array.from) return Buffer.from(e2, t2); if ("number" == typeof e2) throw new Error('The "data" argument must not be a number'); return new Buffer(e2, t2); }, allocBuffer: function(e2) { if (Buffer.alloc) return Buffer.alloc(e2); var t2 = new Buffer(e2); return t2.fill(0), t2; }, isBuffer: function(e2) { return Buffer.isBuffer(e2); }, isStream: function(e2) { return e2 && "function" == typeof e2.on && "function" == typeof e2.pause && "function" == typeof e2.resume; } }; }, {}], 15: [function(e, t, r) { "use strict"; function s(e2, t2, r2) { var n2, i2 = u.getTypeOf(t2), s2 = u.extend(r2 || {}, f); s2.date = s2.date || /* @__PURE__ */ new Date(), null !== s2.compression && (s2.compression = s2.compression.toUpperCase()), "string" == typeof s2.unixPermissions && (s2.unixPermissions = parseInt(s2.unixPermissions, 8)), s2.unixPermissions && 16384 & s2.unixPermissions && (s2.dir = true), s2.dosPermissions && 16 & s2.dosPermissions && (s2.dir = true), s2.dir && (e2 = g(e2)), s2.createFolders && (n2 = _(e2)) && b.call(this, n2, true); var a2 = "string" === i2 && false === s2.binary && false === s2.base64; r2 && void 0 !== r2.binary || (s2.binary = !a2), (t2 instanceof c && 0 === t2.uncompressedSize || s2.dir || !t2 || 0 === t2.length) && (s2.base64 = false, s2.binary = true, t2 = "", s2.compression = "STORE", i2 = "string"); var o2 = null; o2 = t2 instanceof c || t2 instanceof l ? t2 : p.isNode && p.isStream(t2) ? new m(e2, t2) : u.prepareContent(e2, t2, s2.binary, s2.optimizedBinaryString, s2.base64); var h2 = new d(e2, o2, s2); this.files[e2] = h2; } var i = e("./utf8"), u = e("./utils"), l = e("./stream/GenericWorker"), a = e("./stream/StreamHelper"), f = e("./defaults"), c = e("./compressedObject"), d = e("./zipObject"), o = e("./generate"), p = e("./nodejsUtils"), m = e("./nodejs/NodejsStreamInputAdapter"), _ = function(e2) { "/" === e2.slice(-1) && (e2 = e2.substring(0, e2.length - 1)); var t2 = e2.lastIndexOf("/"); return 0 < t2 ? e2.substring(0, t2) : ""; }, g = function(e2) { return "/" !== e2.slice(-1) && (e2 += "/"), e2; }, b = function(e2, t2) { return t2 = void 0 !== t2 ? t2 : f.createFolders, e2 = g(e2), this.files[e2] || s.call(this, e2, null, { dir: true, createFolders: t2 }), this.files[e2]; }; function h(e2) { return "[object RegExp]" === Object.prototype.toString.call(e2); } var n = { load: function() { throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide."); }, forEach: function(e2) { var t2, r2, n2; for (t2 in this.files) n2 = this.files[t2], (r2 = t2.slice(this.root.length, t2.length)) && t2.slice(0, this.root.length) === this.root && e2(r2, n2); }, filter: function(r2) { var n2 = []; return this.forEach(function(e2, t2) { r2(e2, t2) && n2.push(t2); }), n2; }, file: function(e2, t2, r2) { if (1 !== arguments.length) return e2 = this.root + e2, s.call(this, e2, t2, r2), this; if (h(e2)) { var n2 = e2; return this.filter(function(e3, t3) { return !t3.dir && n2.test(e3); }); } var i2 = this.files[this.root + e2]; return i2 && !i2.dir ? i2 : null; }, folder: function(r2) { if (!r2) return this; if (h(r2)) return this.filter(function(e3, t3) { return t3.dir && r2.test(e3); }); var e2 = this.root + r2, t2 = b.call(this, e2), n2 = this.clone(); return n2.root = t2.name, n2; }, remove: function(r2) { r2 = this.root + r2; var e2 = this.files[r2]; if (e2 || ("/" !== r2.slice(-1) && (r2 += "/"), e2 = this.files[r2]), e2 && !e2.dir) delete this.files[r2]; else for (var t2 = this.filter(function(e3, t3) { return t3.name.slice(0, r2.length) === r2; }), n2 = 0; n2 < t2.length; n2++) delete this.files[t2[n2].name]; return this; }, generate: function() { throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide."); }, generateInternalStream: function(e2) { var t2, r2 = {}; try { if ((r2 = u.extend(e2 || {}, { streamFiles: false, compression: "STORE", compressionOptions: null, type: "", platform: "DOS", comment: null, mimeType: "application/zip", encodeFileName: i.utf8encode })).type = r2.type.toLowerCase(), r2.compression = r2.compression.toUpperCase(), "binarystring" === r2.type && (r2.type = "string"), !r2.type) throw new Error("No output type specified."); u.checkSupport(r2.type), "darwin" !== r2.platform && "freebsd" !== r2.platform && "linux" !== r2.platform && "sunos" !== r2.platform || (r2.platform = "UNIX"), "win32" === r2.platform && (r2.platform = "DOS"); var n2 = r2.comment || this.comment || ""; t2 = o.generateWorker(this, r2, n2); } catch (e3) { (t2 = new l("error")).error(e3); } return new a(t2, r2.type || "string", r2.mimeType); }, generateAsync: function(e2, t2) { return this.generateInternalStream(e2).accumulate(t2); }, generateNodeStream: function(e2, t2) { return (e2 = e2 || {}).type || (e2.type = "nodebuffer"), this.generateInternalStream(e2).toNodejsStream(t2); } }; t.exports = n; }, { "./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(e, t, r) { "use strict"; t.exports = e("stream"); }, { stream: void 0 }], 17: [function(e, t, r) { "use strict"; var n = e("./DataReader"); function i(e2) { n.call(this, e2); for (var t2 = 0; t2 < this.data.length; t2++) e2[t2] = 255 & e2[t2]; } e("../utils").inherits(i, n), i.prototype.byteAt = function(e2) { return this.data[this.zero + e2]; }, i.prototype.lastIndexOfSignature = function(e2) { for (var t2 = e2.charCodeAt(0), r2 = e2.charCodeAt(1), n2 = e2.charCodeAt(2), i2 = e2.charCodeAt(3), s = this.length - 4; 0 <= s; --s) if (this.data[s] === t2 && this.data[s + 1] === r2 && this.data[s + 2] === n2 && this.data[s + 3] === i2) return s - this.zero; return -1; }, i.prototype.readAndCheckSignature = function(e2) { var t2 = e2.charCodeAt(0), r2 = e2.charCodeAt(1), n2 = e2.charCodeAt(2), i2 = e2.charCodeAt(3), s = this.readData(4); return t2 === s[0] && r2 === s[1] && n2 === s[2] && i2 === s[3]; }, i.prototype.readData = function(e2) { if (this.checkOffset(e2), 0 === e2) return []; var t2 = this.data.slice(this.zero + this.index, this.zero + this.index + e2); return this.index += e2, t2; }, t.exports = i; }, { "../utils": 32, "./DataReader": 18 }], 18: [function(e, t, r) { "use strict"; var n = e("../utils"); function i(e2) { this.data = e2, this.length = e2.length, this.index = 0, this.zero = 0; } i.prototype = { checkOffset: function(e2) { this.checkIndex(this.index + e2); }, checkIndex: function(e2) { if (this.length < this.zero + e2 || e2 < 0) throw new Error("End of data reached (data length = " + this.length + ", asked index = " + e2 + "). Corrupted zip ?"); }, setIndex: function(e2) { this.checkIndex(e2), this.index = e2; }, skip: function(e2) { this.setIndex(this.index + e2); }, byteAt: function() { }, readInt: function(e2) { var t2, r2 = 0; for (this.checkOffset(e2), t2 = this.index + e2 - 1; t2 >= this.index; t2--) r2 = (r2 << 8) + this.byteAt(t2); return this.index += e2, r2; }, readString: function(e2) { return n.transformTo("string", this.readData(e2)); }, readData: function() { }, lastIndexOfSignature: function() { }, readAndCheckSignature: function() { }, readDate: function() { var e2 = this.readInt(4); return new Date(Date.UTC(1980 + (e2 >> 25 & 127), (e2 >> 21 & 15) - 1, e2 >> 16 & 31, e2 >> 11 & 31, e2 >> 5 & 63, (31 & e2) << 1)); } }, t.exports = i; }, { "../utils": 32 }], 19: [function(e, t, r) { "use strict"; var n = e("./Uint8ArrayReader"); function i(e2) { n.call(this, e2); } e("../utils").inherits(i, n), i.prototype.readData = function(e2) { this.checkOffset(e2); var t2 = this.data.slice(this.zero + this.index, this.zero + this.index + e2); return this.index += e2, t2; }, t.exports = i; }, { "../utils": 32, "./Uint8ArrayReader": 21 }], 20: [function(e, t, r) { "use strict"; var n = e("./DataReader"); function i(e2) { n.call(this, e2); } e("../utils").inherits(i, n), i.prototype.byteAt = function(e2) { return this.data.charCodeAt(this.zero + e2); }, i.prototype.lastIndexOfSignature = function(e2) { return this.data.lastIndexOf(e2) - this.zero; }, i.prototype.readAndCheckSignature = function(e2) { return e2 === this.readData(4); }, i.prototype.readData = function(e2) { this.checkOffset(e2); var t2 = this.data.slice(this.zero + this.index, this.zero + this.index + e2); return this.index += e2, t2; }, t.exports = i; }, { "../utils": 32, "./DataReader": 18 }], 21: [function(e, t, r) { "use strict"; var n = e("./ArrayReader"); function i(e2) { n.call(this, e2); } e("../utils").inherits(i, n), i.prototype.readData = function(e2) { if (this.checkOffset(e2), 0 === e2) return new Uint8Array(0); var t2 = this.data.subarray(this.zero + this.index, this.zero + this.index + e2); return this.index += e2, t2; }, t.exports = i; }, { "../utils": 32, "./ArrayReader": 17 }], 22: [function(e, t, r) { "use strict"; var n = e("../utils"), i = e("../support"), s = e("./ArrayReader"), a = e("./StringReader"), o = e("./NodeBufferReader"), h = e("./Uint8ArrayReader"); t.exports = function(e2) { var t2 = n.getTypeOf(e2); return n.checkSupport(t2), "string" !== t2 || i.uint8array ? "nodebuffer" === t2 ? new o(e2) : i.uint8array ? new h(n.transformTo("uint8array", e2)) : new s(n.transformTo("array", e2)) : new a(e2); }; }, { "../support": 30, "../utils": 32, "./ArrayReader": 17, "./NodeBufferReader": 19, "./StringReader": 20, "./Uint8ArrayReader": 21 }], 23: [function(e, t, r) { "use strict"; r.LOCAL_FILE_HEADER = "PK", r.CENTRAL_FILE_HEADER = "PK", r.CENTRAL_DIRECTORY_END = "PK", r.ZIP64_CENTRAL_DIRECTORY_LOCATOR = "PK\x07", r.ZIP64_CENTRAL_DIRECTORY_END = "PK", r.DATA_DESCRIPTOR = "PK\x07\b"; }, {}], 24: [function(e, t, r) { "use strict"; var n = e("./GenericWorker"), i = e("../utils"); function s(e2) { n.call(this, "ConvertWorker to " + e2), this.destType = e2; } i.inherits(s, n), s.prototype.processChunk = function(e2) { this.push({ data: i.transformTo(this.destType, e2.data), meta: e2.meta }); }, t.exports = s; }, { "../utils": 32, "./GenericWorker": 28 }], 25: [function(e, t, r) { "use strict"; var n = e("./GenericWorker"), i = e("../crc32"); function s() { n.call(this, "Crc32Probe"), this.withStreamInfo("crc32", 0); } e("../utils").inherits(s, n), s.prototype.processChunk = function(e2) { this.streamInfo.crc32 = i(e2.data, this.streamInfo.crc32 || 0), this.push(e2); }, t.exports = s; }, { "../crc32": 4, "../utils": 32, "./GenericWorker": 28 }], 26: [function(e, t, r) { "use strict"; var n = e("../utils"), i = e("./GenericWorker"); function s(e2) { i.call(this, "DataLengthProbe for " + e2), this.propName = e2, this.withStreamInfo(e2, 0); } n.inherits(s, i), s.prototype.processChunk = function(e2) { if (e2) { var t2 = this.streamInfo[this.propName] || 0; this.streamInfo[this.propName] = t2 + e2.data.length; } i.prototype.processChunk.call(this, e2); }, t.exports = s; }, { "../utils": 32, "./GenericWorker": 28 }], 27: [function(e, t, r) { "use strict"; var n = e("../utils"), i = e("./GenericWorker"); function s(e2) { i.call(this, "DataWorker"); var t2 = this; this.dataIsReady = false, this.index = 0, this.max = 0, this.data = null, this.type = "", this._tickScheduled = false, e2.then(function(e3) { t2.dataIsReady = true, t2.data = e3, t2.max = e3 && e3.length || 0, t2.type = n.getTypeOf(e3), t2.isPaused || t2._tickAndRepeat(); }, function(e3) { t2.error(e3); }); } n.inherits(s, i), s.prototype.cleanUp = function() { i.prototype.cleanUp.call(this), this.data = null; }, s.prototype.resume = function() { return !!i.prototype.resume.call(this) && (!this._tickScheduled && this.dataIsReady && (this._tickScheduled = true, n.delay(this._tickAndRepeat, [], this)), true); }, s.prototype._tickAndRepeat = function() { this._tickScheduled = false, this.isPaused || this.isFinished || (this._tick(), this.isFinished || (n.delay(this._tickAndRepeat, [], this), this._tickScheduled = true)); }, s.prototype._tick = function() { if (this.isPaused || this.isFinished) return false; var e2 = null, t2 = Math.min(this.max, this.index + 16384); if (this.index >= this.max) return this.end(); switch (this.type) { case "string": e2 = this.data.substring(this.index, t2); break; case "uint8array": e2 = this.data.subarray(this.index, t2); break; case "array": case "nodebuffer": e2 = this.data.slice(this.index, t2); } return this.index = t2, this.push({ data: e2, meta: { percent: this.max ? this.index / this.max * 100 : 0 } }); }, t.exports = s; }, { "../utils": 32, "./GenericWorker": 28 }], 28: [function(e, t, r) { "use strict"; function n(e2) { this.name = e2 || "default", this.streamInfo = {}, this.generatedError = null, this.extraStreamInfo = {}, this.isPaused = true, this.isFinished = false, this.isLocked = false, this._listeners = { data: [], end: [], error: [] }, this.previous = null; } n.prototype = { push: function(e2) { this.emit("data", e2); }, end: function() { if (this.isFinished) return false; this.flush(); try { this.emit("end"), this.cleanUp(), this.isFinished = true; } catch (e2) { this.emit("error", e2); } return true; }, error: function(e2) { return !this.isFinished && (this.isPaused ? this.generatedError = e2 : (this.isFinished = true, this.emit("error", e2), this.previous && this.previous.error(e2), this.cleanUp()), true); }, on: function(e2, t2) { return this._listeners[e2].push(t2), this; }, cleanUp: function() { this.streamInfo = this.generatedError = this.extraStreamInfo = null, this._listeners = []; }, emit: function(e2, t2) { if (this._listeners[e2]) for (var r2 = 0; r2 < this._listeners[e2].length; r2++) this._listeners[e2][r2].call(this, t2); }, pipe: function(e2) { return e2.registerPrevious(this); }, registerPrevious: function(e2) { if (this.isLocked) throw new Error("The stream '" + this + "' has already been used."); this.streamInfo = e2.streamInfo, this.mergeStreamInfo(), this.previous = e2; var t2 = this; return e2.on("data", function(e3) { t2.processChunk(e3); }), e2.on("end", function() { t2.end(); }), e2.on("error", function(e3) { t2.error(e3); }), this; }, pause: function() { return !this.isPaused && !this.isFinished && (this.isPaused = true, this.previous && this.previous.pause(), true); }, resume: function() { if (!this.isPaused || this.isFinished) return false; var e2 = this.isPaused = false; return this.generatedError && (this.error(this.generatedError), e2 = true), this.previous && this.previous.resume(), !e2; }, flush: function() { }, processChunk: function(e2) { this.push(e2); }, withStreamInfo: function(e2, t2) { return this.extraStreamInfo[e2] = t2, this.mergeStreamInfo(), this; }, mergeStreamInfo: function() { for (var e2 in this.extraStreamInfo) Object.prototype.hasOwnProperty.call(this.extraStreamInfo, e2) && (this.streamIn