@loro-dev/streams-crdt 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +2 -4
- package/dist/flock.js +1 -1
- package/dist/index.js +1 -1
- package/dist/loro.js +1 -1
- package/dist/{stream-id-BS_IJr-Y.js → stream-id-TsPj50Jj.js} +1 -1
- package/dist/{stream-id-BS_IJr-Y.js.map → stream-id-TsPj50Jj.js.map} +1 -1
- package/dist/zstd-core-nJ4Lg1a0.js +546 -0
- package/dist/zstd-core-nJ4Lg1a0.js.map +1 -0
- package/dist/zstd-worker.js +1 -1
- package/dist/zstd.js +1 -1
- package/dist/zstd.wasm +0 -0
- package/package.json +11 -13
- package/dist/zstd-core-l_BzmODD.js +0 -24
- package/dist/zstd-core-l_BzmODD.js.map +0 -1
|
@@ -0,0 +1,546 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __exportAll = (all, no_symbols) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) __defProp(target, name, {
|
|
6
|
+
get: all[name],
|
|
7
|
+
enumerable: true
|
|
8
|
+
});
|
|
9
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
|
+
return target;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region ../../node_modules/.pnpm/@bokuweb+zstd-wasm@0.0.27/node_modules/@bokuweb/zstd-wasm/dist/web/zstd.js
|
|
14
|
+
var Module = typeof Module !== "undefined" ? Module : {};
|
|
15
|
+
var moduleOverrides = {};
|
|
16
|
+
var key;
|
|
17
|
+
for (key in Module) if (Module.hasOwnProperty(key)) moduleOverrides[key] = Module[key];
|
|
18
|
+
var err = Module["printErr"] || console.warn.bind(console);
|
|
19
|
+
for (key in moduleOverrides) if (moduleOverrides.hasOwnProperty(key)) Module[key] = moduleOverrides[key];
|
|
20
|
+
var quit_ = (status, toThrow) => {
|
|
21
|
+
throw toThrow;
|
|
22
|
+
};
|
|
23
|
+
moduleOverrides = null;
|
|
24
|
+
if (Module["arguments"]) Module["arguments"];
|
|
25
|
+
if (Module["thisProgram"]) thisProgram = Module["thisProgram"];
|
|
26
|
+
if (Module["quit"]) quit_ = Module["quit"];
|
|
27
|
+
if (typeof WebAssembly !== "object") abort("no native wasm support detected");
|
|
28
|
+
var wasmMemory;
|
|
29
|
+
var ABORT = false, EXITSTATUS, HEAPU8;
|
|
30
|
+
function updateMemoryViews() {
|
|
31
|
+
var b = wasmMemory.buffer;
|
|
32
|
+
Module["HEAP8"] = new Int8Array(b);
|
|
33
|
+
Module["HEAPU8"] = HEAPU8 = new Uint8Array(b);
|
|
34
|
+
}
|
|
35
|
+
var __ATPRERUN__ = [];
|
|
36
|
+
var __ATINIT__ = [];
|
|
37
|
+
var __ATPOSTRUN__ = [];
|
|
38
|
+
function preRun() {
|
|
39
|
+
if (Module["preRun"]) {
|
|
40
|
+
if (typeof Module["preRun"] == "function") Module["preRun"] = [Module["preRun"]];
|
|
41
|
+
while (Module["preRun"].length) addOnPreRun(Module["preRun"].shift());
|
|
42
|
+
}
|
|
43
|
+
callRuntimeCallbacks(__ATPRERUN__);
|
|
44
|
+
}
|
|
45
|
+
function initRuntime() {
|
|
46
|
+
callRuntimeCallbacks(__ATINIT__);
|
|
47
|
+
}
|
|
48
|
+
function postRun() {
|
|
49
|
+
if (Module["postRun"]) {
|
|
50
|
+
if (typeof Module["postRun"] == "function") Module["postRun"] = [Module["postRun"]];
|
|
51
|
+
while (Module["postRun"].length) addOnPostRun(Module["postRun"].shift());
|
|
52
|
+
}
|
|
53
|
+
callRuntimeCallbacks(__ATPOSTRUN__);
|
|
54
|
+
}
|
|
55
|
+
function addOnPreRun(cb) {
|
|
56
|
+
__ATPRERUN__.unshift(cb);
|
|
57
|
+
}
|
|
58
|
+
function addOnInit(cb) {
|
|
59
|
+
__ATINIT__.unshift(cb);
|
|
60
|
+
}
|
|
61
|
+
function addOnPostRun(cb) {
|
|
62
|
+
__ATPOSTRUN__.unshift(cb);
|
|
63
|
+
}
|
|
64
|
+
var runDependencies = 0;
|
|
65
|
+
var dependenciesFulfilled = null;
|
|
66
|
+
function addRunDependency(id) {
|
|
67
|
+
var _a;
|
|
68
|
+
runDependencies++;
|
|
69
|
+
(_a = Module["monitorRunDependencies"]) === null || _a === void 0 || _a.call(Module, runDependencies);
|
|
70
|
+
}
|
|
71
|
+
function removeRunDependency(id) {
|
|
72
|
+
var _a;
|
|
73
|
+
runDependencies--;
|
|
74
|
+
(_a = Module["monitorRunDependencies"]) === null || _a === void 0 || _a.call(Module, runDependencies);
|
|
75
|
+
if (runDependencies == 0) {
|
|
76
|
+
if (dependenciesFulfilled) {
|
|
77
|
+
var callback = dependenciesFulfilled;
|
|
78
|
+
dependenciesFulfilled = null;
|
|
79
|
+
callback();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
function abort(what) {
|
|
84
|
+
var _a;
|
|
85
|
+
(_a = Module["onAbort"]) === null || _a === void 0 || _a.call(Module, what);
|
|
86
|
+
what = "Aborted(" + what + ")";
|
|
87
|
+
err(what);
|
|
88
|
+
ABORT = true;
|
|
89
|
+
what += ". Build with -sASSERTIONS for more info.";
|
|
90
|
+
throw new WebAssembly.RuntimeError(what);
|
|
91
|
+
}
|
|
92
|
+
function getWasmImports() {
|
|
93
|
+
return { a: wasmImports };
|
|
94
|
+
}
|
|
95
|
+
function getBinaryPromise(url) {
|
|
96
|
+
return fetch(url, { credentials: "same-origin" }).then(function(response) {
|
|
97
|
+
if (!response["ok"]) throw "failed to load wasm binary file at '" + url + "'";
|
|
98
|
+
return response["arrayBuffer"]();
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function init$1(filePathOrBuf) {
|
|
102
|
+
var info = getWasmImports();
|
|
103
|
+
function receiveInstance(instance, module) {
|
|
104
|
+
wasmExports = instance.exports;
|
|
105
|
+
wasmMemory = wasmExports["f"];
|
|
106
|
+
updateMemoryViews();
|
|
107
|
+
addOnInit(wasmExports["g"]);
|
|
108
|
+
removeRunDependency("wasm-instantiate");
|
|
109
|
+
return wasmExports;
|
|
110
|
+
}
|
|
111
|
+
addRunDependency("wasm-instantiate");
|
|
112
|
+
function receiveInstantiationResult(result) {
|
|
113
|
+
receiveInstance(result["instance"]);
|
|
114
|
+
}
|
|
115
|
+
function instantiateArrayBuffer(receiver) {
|
|
116
|
+
return getBinaryPromise(filePathOrBuf).then(function(binary) {
|
|
117
|
+
return WebAssembly.instantiate(binary, info);
|
|
118
|
+
}).then(receiver, function(reason) {
|
|
119
|
+
err("failed to asynchronously prepare wasm: " + reason);
|
|
120
|
+
abort(reason);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
function instantiateAsync() {
|
|
124
|
+
if (filePathOrBuf && filePathOrBuf.byteLength > 0) return WebAssembly.instantiate(filePathOrBuf, info).then(receiveInstantiationResult, function(reason) {
|
|
125
|
+
err("wasm compile failed: " + reason);
|
|
126
|
+
});
|
|
127
|
+
else if (typeof WebAssembly.instantiateStreaming === "function" && typeof filePathOrBuf === "string" && typeof fetch === "function") return fetch(filePathOrBuf, { credentials: "same-origin" }).then(function(response) {
|
|
128
|
+
return WebAssembly.instantiateStreaming(response, info).then(receiveInstantiationResult, function(reason) {
|
|
129
|
+
err("wasm streaming compile failed: " + reason);
|
|
130
|
+
err("falling back to ArrayBuffer instantiation");
|
|
131
|
+
return instantiateArrayBuffer(receiveInstantiationResult);
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
else return instantiateArrayBuffer(receiveInstantiationResult);
|
|
135
|
+
}
|
|
136
|
+
if (Module["instantiateWasm"]) try {
|
|
137
|
+
return Module["instantiateWasm"](info, receiveInstance);
|
|
138
|
+
} catch (e) {
|
|
139
|
+
err("Module.instantiateWasm callback failed with error: " + e);
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
instantiateAsync();
|
|
143
|
+
return {};
|
|
144
|
+
}
|
|
145
|
+
var ExitStatus = class {
|
|
146
|
+
constructor(status) {
|
|
147
|
+
this.name = "ExitStatus";
|
|
148
|
+
this.message = `Program terminated with exit(${status})`;
|
|
149
|
+
this.status = status;
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
var callRuntimeCallbacks = (callbacks) => {
|
|
153
|
+
while (callbacks.length > 0) callbacks.shift()(Module);
|
|
154
|
+
};
|
|
155
|
+
var noExitRuntime = Module["noExitRuntime"] || true;
|
|
156
|
+
var __abort_js = () => abort("");
|
|
157
|
+
var runtimeKeepaliveCounter = 0;
|
|
158
|
+
var __emscripten_runtime_keepalive_clear = () => {
|
|
159
|
+
noExitRuntime = false;
|
|
160
|
+
runtimeKeepaliveCounter = 0;
|
|
161
|
+
};
|
|
162
|
+
var timers = {};
|
|
163
|
+
var handleException = (e) => {
|
|
164
|
+
if (e instanceof ExitStatus || e == "unwind") return EXITSTATUS;
|
|
165
|
+
quit_(1, e);
|
|
166
|
+
};
|
|
167
|
+
var keepRuntimeAlive = () => noExitRuntime || runtimeKeepaliveCounter > 0;
|
|
168
|
+
var _proc_exit = (code) => {
|
|
169
|
+
var _a;
|
|
170
|
+
EXITSTATUS = code;
|
|
171
|
+
if (!keepRuntimeAlive()) {
|
|
172
|
+
(_a = Module["onExit"]) === null || _a === void 0 || _a.call(Module, code);
|
|
173
|
+
ABORT = true;
|
|
174
|
+
}
|
|
175
|
+
quit_(code, new ExitStatus(code));
|
|
176
|
+
};
|
|
177
|
+
var exitJS = (status, implicit) => {
|
|
178
|
+
EXITSTATUS = status;
|
|
179
|
+
_proc_exit(status);
|
|
180
|
+
};
|
|
181
|
+
var _exit = exitJS;
|
|
182
|
+
var maybeExit = () => {
|
|
183
|
+
if (!keepRuntimeAlive()) try {
|
|
184
|
+
_exit(EXITSTATUS);
|
|
185
|
+
} catch (e) {
|
|
186
|
+
handleException(e);
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
var callUserCallback = (func) => {
|
|
190
|
+
if (ABORT) return;
|
|
191
|
+
try {
|
|
192
|
+
func();
|
|
193
|
+
maybeExit();
|
|
194
|
+
} catch (e) {
|
|
195
|
+
handleException(e);
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
var _emscripten_get_now = () => performance.now();
|
|
199
|
+
var __setitimer_js = (which, timeout_ms) => {
|
|
200
|
+
if (timers[which]) {
|
|
201
|
+
clearTimeout(timers[which].id);
|
|
202
|
+
delete timers[which];
|
|
203
|
+
}
|
|
204
|
+
if (!timeout_ms) return 0;
|
|
205
|
+
timers[which] = {
|
|
206
|
+
id: setTimeout(() => {
|
|
207
|
+
delete timers[which];
|
|
208
|
+
callUserCallback(() => __emscripten_timeout(which, _emscripten_get_now()));
|
|
209
|
+
}, timeout_ms),
|
|
210
|
+
timeout_ms
|
|
211
|
+
};
|
|
212
|
+
return 0;
|
|
213
|
+
};
|
|
214
|
+
var getHeapMax = () => 2147483648;
|
|
215
|
+
var alignMemory = (size, alignment) => Math.ceil(size / alignment) * alignment;
|
|
216
|
+
var growMemory = (size) => {
|
|
217
|
+
var pages = (size - wasmMemory.buffer.byteLength + 65535) / 65536 | 0;
|
|
218
|
+
try {
|
|
219
|
+
wasmMemory.grow(pages);
|
|
220
|
+
updateMemoryViews();
|
|
221
|
+
return 1;
|
|
222
|
+
} catch (e) {}
|
|
223
|
+
};
|
|
224
|
+
var _emscripten_resize_heap = (requestedSize) => {
|
|
225
|
+
var oldSize = HEAPU8.length;
|
|
226
|
+
requestedSize >>>= 0;
|
|
227
|
+
var maxHeapSize = getHeapMax();
|
|
228
|
+
if (requestedSize > maxHeapSize) return false;
|
|
229
|
+
for (var cutDown = 1; cutDown <= 4; cutDown *= 2) {
|
|
230
|
+
var overGrownHeapSize = oldSize * (1 + .2 / cutDown);
|
|
231
|
+
overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296);
|
|
232
|
+
if (growMemory(Math.min(maxHeapSize, alignMemory(Math.max(requestedSize, overGrownHeapSize), 65536)))) return true;
|
|
233
|
+
}
|
|
234
|
+
return false;
|
|
235
|
+
};
|
|
236
|
+
var wasmImports = {
|
|
237
|
+
c: __abort_js,
|
|
238
|
+
b: __emscripten_runtime_keepalive_clear,
|
|
239
|
+
d: __setitimer_js,
|
|
240
|
+
e: _emscripten_resize_heap,
|
|
241
|
+
a: _proc_exit
|
|
242
|
+
};
|
|
243
|
+
var wasmExports;
|
|
244
|
+
var _ZSTD_isError = Module["_ZSTD_isError"] = (a0) => (_ZSTD_isError = Module["_ZSTD_isError"] = wasmExports["h"])(a0);
|
|
245
|
+
var _ZSTD_compressBound = Module["_ZSTD_compressBound"] = (a0) => (_ZSTD_compressBound = Module["_ZSTD_compressBound"] = wasmExports["i"])(a0);
|
|
246
|
+
var _ZSTD_createCCtx = Module["_ZSTD_createCCtx"] = () => (_ZSTD_createCCtx = Module["_ZSTD_createCCtx"] = wasmExports["j"])();
|
|
247
|
+
var _ZSTD_freeCCtx = Module["_ZSTD_freeCCtx"] = (a0) => (_ZSTD_freeCCtx = Module["_ZSTD_freeCCtx"] = wasmExports["k"])(a0);
|
|
248
|
+
var _ZSTD_compress_usingDict = Module["_ZSTD_compress_usingDict"] = (a0, a1, a2, a3, a4, a5, a6, a7) => (_ZSTD_compress_usingDict = Module["_ZSTD_compress_usingDict"] = wasmExports["l"])(a0, a1, a2, a3, a4, a5, a6, a7);
|
|
249
|
+
var _ZSTD_compress = Module["_ZSTD_compress"] = (a0, a1, a2, a3, a4) => (_ZSTD_compress = Module["_ZSTD_compress"] = wasmExports["m"])(a0, a1, a2, a3, a4);
|
|
250
|
+
var _ZSTD_createDCtx = Module["_ZSTD_createDCtx"] = () => (_ZSTD_createDCtx = Module["_ZSTD_createDCtx"] = wasmExports["n"])();
|
|
251
|
+
var _ZSTD_freeDCtx = Module["_ZSTD_freeDCtx"] = (a0) => (_ZSTD_freeDCtx = Module["_ZSTD_freeDCtx"] = wasmExports["o"])(a0);
|
|
252
|
+
var _ZSTD_getFrameContentSize = Module["_ZSTD_getFrameContentSize"] = (a0, a1) => (_ZSTD_getFrameContentSize = Module["_ZSTD_getFrameContentSize"] = wasmExports["p"])(a0, a1);
|
|
253
|
+
var _ZSTD_decompress_usingDict = Module["_ZSTD_decompress_usingDict"] = (a0, a1, a2, a3, a4, a5, a6) => (_ZSTD_decompress_usingDict = Module["_ZSTD_decompress_usingDict"] = wasmExports["q"])(a0, a1, a2, a3, a4, a5, a6);
|
|
254
|
+
var _ZSTD_decompress = Module["_ZSTD_decompress"] = (a0, a1, a2, a3) => (_ZSTD_decompress = Module["_ZSTD_decompress"] = wasmExports["r"])(a0, a1, a2, a3);
|
|
255
|
+
var _malloc = Module["_malloc"] = (a0) => (_malloc = Module["_malloc"] = wasmExports["s"])(a0);
|
|
256
|
+
var _free = Module["_free"] = (a0) => (_free = Module["_free"] = wasmExports["t"])(a0);
|
|
257
|
+
var __emscripten_timeout = (a0, a1) => (__emscripten_timeout = wasmExports["v"])(a0, a1);
|
|
258
|
+
var calledRun;
|
|
259
|
+
dependenciesFulfilled = function runCaller() {
|
|
260
|
+
if (!calledRun) run();
|
|
261
|
+
if (!calledRun) dependenciesFulfilled = runCaller;
|
|
262
|
+
};
|
|
263
|
+
function run() {
|
|
264
|
+
if (runDependencies > 0) return;
|
|
265
|
+
preRun();
|
|
266
|
+
if (runDependencies > 0) return;
|
|
267
|
+
function doRun() {
|
|
268
|
+
var _a;
|
|
269
|
+
if (calledRun) return;
|
|
270
|
+
calledRun = true;
|
|
271
|
+
Module["calledRun"] = true;
|
|
272
|
+
if (ABORT) return;
|
|
273
|
+
initRuntime();
|
|
274
|
+
(_a = Module["onRuntimeInitialized"]) === null || _a === void 0 || _a.call(Module);
|
|
275
|
+
postRun();
|
|
276
|
+
}
|
|
277
|
+
if (Module["setStatus"]) {
|
|
278
|
+
Module["setStatus"]("Running...");
|
|
279
|
+
setTimeout(() => {
|
|
280
|
+
setTimeout(() => Module["setStatus"](""), 1);
|
|
281
|
+
doRun();
|
|
282
|
+
}, 1);
|
|
283
|
+
} else doRun();
|
|
284
|
+
}
|
|
285
|
+
Module["run"] = run;
|
|
286
|
+
if (Module["preInit"]) {
|
|
287
|
+
if (typeof Module["preInit"] == "function") Module["preInit"] = [Module["preInit"]];
|
|
288
|
+
while (Module["preInit"].length > 0) Module["preInit"].pop()();
|
|
289
|
+
}
|
|
290
|
+
Module["init"] = init$1;
|
|
291
|
+
//#endregion
|
|
292
|
+
//#region ../../node_modules/.pnpm/@bokuweb+zstd-wasm@0.0.27/node_modules/@bokuweb/zstd-wasm/dist/web/module.js
|
|
293
|
+
var __awaiter$1 = function(thisArg, _arguments, P, generator) {
|
|
294
|
+
function adopt(value) {
|
|
295
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
296
|
+
resolve(value);
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
300
|
+
function fulfilled(value) {
|
|
301
|
+
try {
|
|
302
|
+
step(generator.next(value));
|
|
303
|
+
} catch (e) {
|
|
304
|
+
reject(e);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
function rejected(value) {
|
|
308
|
+
try {
|
|
309
|
+
step(generator["throw"](value));
|
|
310
|
+
} catch (e) {
|
|
311
|
+
reject(e);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
function step(result) {
|
|
315
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
316
|
+
}
|
|
317
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
318
|
+
});
|
|
319
|
+
};
|
|
320
|
+
const initialized = new Promise((resolve) => {
|
|
321
|
+
Module.onRuntimeInitialized = resolve;
|
|
322
|
+
});
|
|
323
|
+
const waitInitialized = () => __awaiter$1(void 0, void 0, void 0, function* () {
|
|
324
|
+
yield initialized;
|
|
325
|
+
});
|
|
326
|
+
//#endregion
|
|
327
|
+
//#region ../../node_modules/.pnpm/@bokuweb+zstd-wasm@0.0.27/node_modules/@bokuweb/zstd-wasm/dist/web/errors/index.js
|
|
328
|
+
const isError = (code) => {
|
|
329
|
+
const _isError = Module["_ZSTD_isError"];
|
|
330
|
+
return _isError(code);
|
|
331
|
+
};
|
|
332
|
+
//#endregion
|
|
333
|
+
//#region ../../node_modules/.pnpm/@bokuweb+zstd-wasm@0.0.27/node_modules/@bokuweb/zstd-wasm/dist/web/simple/decompress.js
|
|
334
|
+
const getFrameContentSize$1 = (src, size) => {
|
|
335
|
+
const getSize = Module["_ZSTD_getFrameContentSize"];
|
|
336
|
+
return getSize(src, size);
|
|
337
|
+
};
|
|
338
|
+
const decompress = (buf, opts = { defaultHeapSize: 1024 * 1024 }) => {
|
|
339
|
+
const malloc = Module["_malloc"];
|
|
340
|
+
const src = malloc(buf.byteLength);
|
|
341
|
+
Module.HEAP8.set(buf, src);
|
|
342
|
+
const contentSize = getFrameContentSize$1(src, buf.byteLength);
|
|
343
|
+
const size = contentSize === -1 ? opts.defaultHeapSize : contentSize;
|
|
344
|
+
const free = Module["_free"];
|
|
345
|
+
const heap = malloc(size);
|
|
346
|
+
try {
|
|
347
|
+
const _decompress = Module["_ZSTD_decompress"];
|
|
348
|
+
const sizeOrError = _decompress(heap, size, src, buf.byteLength);
|
|
349
|
+
if (isError(sizeOrError)) throw new Error(`Failed to compress with code ${sizeOrError}`);
|
|
350
|
+
const data = new Uint8Array(Module.HEAPU8.buffer, heap, sizeOrError).slice();
|
|
351
|
+
free(heap, size);
|
|
352
|
+
free(src, buf.byteLength);
|
|
353
|
+
return data;
|
|
354
|
+
} catch (e) {
|
|
355
|
+
free(heap, size);
|
|
356
|
+
free(src, buf.byteLength);
|
|
357
|
+
throw e;
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
//#endregion
|
|
361
|
+
//#region ../../node_modules/.pnpm/@bokuweb+zstd-wasm@0.0.27/node_modules/@bokuweb/zstd-wasm/dist/web/simple/compress.js
|
|
362
|
+
const compressBound$1 = (size) => {
|
|
363
|
+
const bound = Module["_ZSTD_compressBound"];
|
|
364
|
+
return bound(size);
|
|
365
|
+
};
|
|
366
|
+
const compress = (buf, level) => {
|
|
367
|
+
const bound = compressBound$1(buf.byteLength);
|
|
368
|
+
const malloc = Module["_malloc"];
|
|
369
|
+
const compressed = malloc(bound);
|
|
370
|
+
const src = malloc(buf.byteLength);
|
|
371
|
+
Module.HEAP8.set(buf, src);
|
|
372
|
+
const free = Module["_free"];
|
|
373
|
+
try {
|
|
374
|
+
const _compress = Module["_ZSTD_compress"];
|
|
375
|
+
const sizeOrError = _compress(compressed, bound, src, buf.byteLength, level !== null && level !== void 0 ? level : 3);
|
|
376
|
+
if (isError(sizeOrError)) throw new Error(`Failed to compress with code ${sizeOrError}`);
|
|
377
|
+
const data = new Uint8Array(Module.HEAPU8.buffer, compressed, sizeOrError).slice();
|
|
378
|
+
free(compressed, bound);
|
|
379
|
+
free(src, buf.byteLength);
|
|
380
|
+
return data;
|
|
381
|
+
} catch (e) {
|
|
382
|
+
free(compressed, bound);
|
|
383
|
+
free(src, buf.byteLength);
|
|
384
|
+
throw e;
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
//#endregion
|
|
388
|
+
//#region ../../node_modules/.pnpm/@bokuweb+zstd-wasm@0.0.27/node_modules/@bokuweb/zstd-wasm/dist/web/simple/decompress_using_dict.js
|
|
389
|
+
const getFrameContentSize = (src, size) => {
|
|
390
|
+
const getSize = Module["_ZSTD_getFrameContentSize"];
|
|
391
|
+
return getSize(src, size);
|
|
392
|
+
};
|
|
393
|
+
const createDCtx = () => {
|
|
394
|
+
return Module["_ZSTD_createDCtx"]();
|
|
395
|
+
};
|
|
396
|
+
const freeDCtx = (dctx) => {
|
|
397
|
+
return Module["_ZSTD_freeDCtx"](dctx);
|
|
398
|
+
};
|
|
399
|
+
const decompressUsingDict = (dctx, buf, dict, opts = { defaultHeapSize: 1024 * 1024 }) => {
|
|
400
|
+
const malloc = Module["_malloc"];
|
|
401
|
+
const src = malloc(buf.byteLength);
|
|
402
|
+
Module.HEAP8.set(buf, src);
|
|
403
|
+
const pdict = malloc(dict.byteLength);
|
|
404
|
+
Module.HEAP8.set(dict, pdict);
|
|
405
|
+
const contentSize = getFrameContentSize(src, buf.byteLength);
|
|
406
|
+
const size = contentSize === -1 ? opts.defaultHeapSize : contentSize;
|
|
407
|
+
const free = Module["_free"];
|
|
408
|
+
const heap = malloc(size);
|
|
409
|
+
try {
|
|
410
|
+
const _decompress = Module["_ZSTD_decompress_usingDict"];
|
|
411
|
+
const sizeOrError = _decompress(dctx, heap, size, src, buf.byteLength, pdict, dict.byteLength);
|
|
412
|
+
if (isError(sizeOrError)) throw new Error(`Failed to compress with code ${sizeOrError}`);
|
|
413
|
+
const data = new Uint8Array(Module.HEAPU8.buffer, heap, sizeOrError).slice();
|
|
414
|
+
free(heap, size);
|
|
415
|
+
free(src, buf.byteLength);
|
|
416
|
+
free(pdict, dict.byteLength);
|
|
417
|
+
return data;
|
|
418
|
+
} catch (e) {
|
|
419
|
+
free(heap, size);
|
|
420
|
+
free(src, buf.byteLength);
|
|
421
|
+
free(pdict, dict.byteLength);
|
|
422
|
+
throw e;
|
|
423
|
+
}
|
|
424
|
+
};
|
|
425
|
+
//#endregion
|
|
426
|
+
//#region ../../node_modules/.pnpm/@bokuweb+zstd-wasm@0.0.27/node_modules/@bokuweb/zstd-wasm/dist/web/simple/compress_using_dict.js
|
|
427
|
+
const compressBound = (size) => {
|
|
428
|
+
const bound = Module["_ZSTD_compressBound"];
|
|
429
|
+
return bound(size);
|
|
430
|
+
};
|
|
431
|
+
const createCCtx = () => {
|
|
432
|
+
return Module["_ZSTD_createCCtx"]();
|
|
433
|
+
};
|
|
434
|
+
const freeCCtx = (cctx) => {
|
|
435
|
+
return Module["_ZSTD_freeCCtx"](cctx);
|
|
436
|
+
};
|
|
437
|
+
const compressUsingDict = (cctx, buf, dict, level) => {
|
|
438
|
+
const bound = compressBound(buf.byteLength);
|
|
439
|
+
const malloc = Module["_malloc"];
|
|
440
|
+
const compressed = malloc(bound);
|
|
441
|
+
const src = malloc(buf.byteLength);
|
|
442
|
+
Module.HEAP8.set(buf, src);
|
|
443
|
+
const pdict = malloc(dict.byteLength);
|
|
444
|
+
Module.HEAP8.set(dict, pdict);
|
|
445
|
+
const free = Module["_free"];
|
|
446
|
+
try {
|
|
447
|
+
const _compress = Module["_ZSTD_compress_usingDict"];
|
|
448
|
+
const sizeOrError = _compress(cctx, compressed, bound, src, buf.byteLength, pdict, dict.byteLength, level !== null && level !== void 0 ? level : 3);
|
|
449
|
+
if (isError(sizeOrError)) throw new Error(`Failed to compress with code ${sizeOrError}`);
|
|
450
|
+
const data = new Uint8Array(Module.HEAPU8.buffer, compressed, sizeOrError).slice();
|
|
451
|
+
free(compressed, bound);
|
|
452
|
+
free(src, buf.byteLength);
|
|
453
|
+
free(pdict, dict.byteLength);
|
|
454
|
+
return data;
|
|
455
|
+
} catch (e) {
|
|
456
|
+
free(compressed, bound);
|
|
457
|
+
free(src, buf.byteLength);
|
|
458
|
+
free(pdict, dict.byteLength);
|
|
459
|
+
throw e;
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
//#endregion
|
|
463
|
+
//#region ../../node_modules/.pnpm/@bokuweb+zstd-wasm@0.0.27/node_modules/@bokuweb/zstd-wasm/dist/web/index.web.js
|
|
464
|
+
var index_web_exports = /* @__PURE__ */ __exportAll({
|
|
465
|
+
compress: () => compress,
|
|
466
|
+
compressUsingDict: () => compressUsingDict,
|
|
467
|
+
createCCtx: () => createCCtx,
|
|
468
|
+
createDCtx: () => createDCtx,
|
|
469
|
+
decompress: () => decompress,
|
|
470
|
+
decompressUsingDict: () => decompressUsingDict,
|
|
471
|
+
freeCCtx: () => freeCCtx,
|
|
472
|
+
freeDCtx: () => freeDCtx,
|
|
473
|
+
init: () => init
|
|
474
|
+
});
|
|
475
|
+
var __awaiter = function(thisArg, _arguments, P, generator) {
|
|
476
|
+
function adopt(value) {
|
|
477
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
478
|
+
resolve(value);
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
482
|
+
function fulfilled(value) {
|
|
483
|
+
try {
|
|
484
|
+
step(generator.next(value));
|
|
485
|
+
} catch (e) {
|
|
486
|
+
reject(e);
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
function rejected(value) {
|
|
490
|
+
try {
|
|
491
|
+
step(generator["throw"](value));
|
|
492
|
+
} catch (e) {
|
|
493
|
+
reject(e);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
function step(result) {
|
|
497
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
498
|
+
}
|
|
499
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
500
|
+
});
|
|
501
|
+
};
|
|
502
|
+
const init = (path) => __awaiter(void 0, void 0, void 0, function* () {
|
|
503
|
+
const url = new URL(`./zstd.wasm`, import.meta.url).href;
|
|
504
|
+
Module["init"](path !== null && path !== void 0 ? path : url);
|
|
505
|
+
yield waitInitialized();
|
|
506
|
+
});
|
|
507
|
+
//#endregion
|
|
508
|
+
//#region src/zstd-core.ts
|
|
509
|
+
const zstdModule = index_web_exports;
|
|
510
|
+
const bundledWasmUrl = new URL("./zstd.wasm", import.meta.url);
|
|
511
|
+
let modulePromise;
|
|
512
|
+
function isNodeRuntime() {
|
|
513
|
+
return typeof process !== "undefined" && process.versions?.node != null;
|
|
514
|
+
}
|
|
515
|
+
function isMissingBundledWasm(error) {
|
|
516
|
+
return error?.code === "ENOENT";
|
|
517
|
+
}
|
|
518
|
+
async function loadZstdModule() {
|
|
519
|
+
try {
|
|
520
|
+
if (isNodeRuntime()) {
|
|
521
|
+
const { readFile } = await import("node:fs/promises");
|
|
522
|
+
try {
|
|
523
|
+
await zstdModule.init(await readFile(bundledWasmUrl));
|
|
524
|
+
} catch (error) {
|
|
525
|
+
if (!isMissingBundledWasm(error)) throw error;
|
|
526
|
+
await zstdModule.init();
|
|
527
|
+
}
|
|
528
|
+
} else await zstdModule.init();
|
|
529
|
+
return zstdModule;
|
|
530
|
+
} catch (error) {
|
|
531
|
+
throw new Error("Failed to initialize the bundled zstd runtime for \"@loro-dev/streams-crdt/zstd\".", { cause: error });
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
async function getZstdModule() {
|
|
535
|
+
return await (modulePromise ??= loadZstdModule());
|
|
536
|
+
}
|
|
537
|
+
async function compressInCurrentThread(snapshot) {
|
|
538
|
+
return (await getZstdModule()).compress(snapshot);
|
|
539
|
+
}
|
|
540
|
+
async function decompressInCurrentThread(snapshot) {
|
|
541
|
+
return (await getZstdModule()).decompress(snapshot);
|
|
542
|
+
}
|
|
543
|
+
//#endregion
|
|
544
|
+
export { decompressInCurrentThread as n, compressInCurrentThread as t };
|
|
545
|
+
|
|
546
|
+
//# sourceMappingURL=zstd-core-nJ4Lg1a0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zstd-core-nJ4Lg1a0.js","names":["init","__awaiter","getFrameContentSize","compressBound","zstd"],"sources":["../../../node_modules/.pnpm/@bokuweb+zstd-wasm@0.0.27/node_modules/@bokuweb/zstd-wasm/dist/web/zstd.js","../../../node_modules/.pnpm/@bokuweb+zstd-wasm@0.0.27/node_modules/@bokuweb/zstd-wasm/dist/web/module.js","../../../node_modules/.pnpm/@bokuweb+zstd-wasm@0.0.27/node_modules/@bokuweb/zstd-wasm/dist/web/errors/index.js","../../../node_modules/.pnpm/@bokuweb+zstd-wasm@0.0.27/node_modules/@bokuweb/zstd-wasm/dist/web/simple/decompress.js","../../../node_modules/.pnpm/@bokuweb+zstd-wasm@0.0.27/node_modules/@bokuweb/zstd-wasm/dist/web/simple/compress.js","../../../node_modules/.pnpm/@bokuweb+zstd-wasm@0.0.27/node_modules/@bokuweb/zstd-wasm/dist/web/simple/decompress_using_dict.js","../../../node_modules/.pnpm/@bokuweb+zstd-wasm@0.0.27/node_modules/@bokuweb/zstd-wasm/dist/web/simple/compress_using_dict.js","../../../node_modules/.pnpm/@bokuweb+zstd-wasm@0.0.27/node_modules/@bokuweb/zstd-wasm/dist/web/index.web.js","../src/zstd-core.ts"],"sourcesContent":["// @ts-nocheck\nvar Module = typeof Module !== 'undefined' ? Module : {};\nvar moduleOverrides = {};\nvar key;\nfor (key in Module) {\n if (Module.hasOwnProperty(key)) {\n moduleOverrides[key] = Module[key];\n }\n}\nvar arguments_ = [];\nvar err = Module['printErr'] || console.warn.bind(console);\nfor (key in moduleOverrides) {\n if (moduleOverrides.hasOwnProperty(key)) {\n Module[key] = moduleOverrides[key];\n }\n}\nvar quit_ = (status, toThrow) => {\n throw toThrow;\n};\nmoduleOverrides = null;\nif (Module['arguments'])\n arguments_ = Module['arguments'];\nif (Module['thisProgram'])\n thisProgram = Module['thisProgram'];\nif (Module['quit'])\n quit_ = Module['quit'];\nvar tempRet0 = 0;\nvar setTempRet0 = function (value) {\n tempRet0 = value;\n};\nif (typeof WebAssembly !== 'object') {\n abort('no native wasm support detected');\n}\nvar wasmMemory;\nvar ABORT = false;\nvar EXITSTATUS;\nvar buffer, HEAPU8, HEAP8;\nfunction updateMemoryViews() {\n var b = wasmMemory.buffer;\n Module['HEAP8'] = HEAP8 = new Int8Array(b);\n Module['HEAPU8'] = HEAPU8 = new Uint8Array(b);\n}\nvar __ATPRERUN__ = [];\nvar __ATINIT__ = [];\nvar __ATPOSTRUN__ = [];\nvar runtimeInitialized = false;\nfunction preRun() {\n if (Module['preRun']) {\n if (typeof Module['preRun'] == 'function')\n Module['preRun'] = [Module['preRun']];\n while (Module['preRun'].length) {\n addOnPreRun(Module['preRun'].shift());\n }\n }\n callRuntimeCallbacks(__ATPRERUN__);\n}\nfunction initRuntime() {\n runtimeInitialized = true;\n callRuntimeCallbacks(__ATINIT__);\n}\nfunction postRun() {\n if (Module['postRun']) {\n if (typeof Module['postRun'] == 'function')\n Module['postRun'] = [Module['postRun']];\n while (Module['postRun'].length) {\n addOnPostRun(Module['postRun'].shift());\n }\n }\n callRuntimeCallbacks(__ATPOSTRUN__);\n}\nfunction addOnPreRun(cb) {\n __ATPRERUN__.unshift(cb);\n}\nfunction addOnInit(cb) {\n __ATINIT__.unshift(cb);\n}\nfunction addOnPostRun(cb) {\n __ATPOSTRUN__.unshift(cb);\n}\nvar runDependencies = 0;\nvar dependenciesFulfilled = null;\nfunction addRunDependency(id) {\n var _a;\n runDependencies++;\n (_a = Module['monitorRunDependencies']) === null || _a === void 0 ? void 0 : _a.call(Module, runDependencies);\n}\nfunction removeRunDependency(id) {\n var _a;\n runDependencies--;\n (_a = Module['monitorRunDependencies']) === null || _a === void 0 ? void 0 : _a.call(Module, runDependencies);\n if (runDependencies == 0) {\n if (dependenciesFulfilled) {\n var callback = dependenciesFulfilled;\n dependenciesFulfilled = null;\n callback();\n }\n }\n}\nfunction abort(what) {\n var _a;\n (_a = Module['onAbort']) === null || _a === void 0 ? void 0 : _a.call(Module, what);\n what = 'Aborted(' + what + ')';\n err(what);\n ABORT = true;\n what += '. Build with -sASSERTIONS for more info.';\n var e = new WebAssembly.RuntimeError(what);\n throw e;\n}\nfunction getWasmImports() {\n return { a: wasmImports };\n}\nfunction getBinaryPromise(url) {\n return fetch(url, { credentials: 'same-origin' }).then(function (response) {\n if (!response['ok']) {\n throw \"failed to load wasm binary file at '\" + url + \"'\";\n }\n return response['arrayBuffer']();\n });\n}\nfunction init(filePathOrBuf) {\n var info = getWasmImports();\n function receiveInstance(instance, module) {\n wasmExports = instance.exports;\n wasmMemory = wasmExports['f'];\n updateMemoryViews();\n addOnInit(wasmExports['g']);\n removeRunDependency('wasm-instantiate');\n return wasmExports;\n }\n addRunDependency('wasm-instantiate');\n function receiveInstantiationResult(result) {\n receiveInstance(result['instance']);\n }\n function instantiateArrayBuffer(receiver) {\n return getBinaryPromise(filePathOrBuf)\n .then(function (binary) {\n var result = WebAssembly.instantiate(binary, info);\n return result;\n })\n .then(receiver, function (reason) {\n err('failed to asynchronously prepare wasm: ' + reason);\n abort(reason);\n });\n }\n function instantiateAsync() {\n if (filePathOrBuf && filePathOrBuf.byteLength > 0) {\n return WebAssembly.instantiate(filePathOrBuf, info).then(receiveInstantiationResult, function (reason) {\n err('wasm compile failed: ' + reason);\n });\n }\n else if (typeof WebAssembly.instantiateStreaming === 'function' &&\n typeof filePathOrBuf === 'string' &&\n typeof fetch === 'function') {\n return fetch(filePathOrBuf, { credentials: 'same-origin' }).then(function (response) {\n var result = WebAssembly.instantiateStreaming(response, info);\n return result.then(receiveInstantiationResult, function (reason) {\n err('wasm streaming compile failed: ' + reason);\n err('falling back to ArrayBuffer instantiation');\n return instantiateArrayBuffer(receiveInstantiationResult);\n });\n });\n }\n else {\n return instantiateArrayBuffer(receiveInstantiationResult);\n }\n }\n if (Module['instantiateWasm']) {\n try {\n var exports = Module['instantiateWasm'](info, receiveInstance);\n return exports;\n }\n catch (e) {\n err('Module.instantiateWasm callback failed with error: ' + e);\n return false;\n }\n }\n instantiateAsync();\n return {};\n}\nclass ExitStatus {\n constructor(status) {\n this.name = 'ExitStatus';\n this.message = `Program terminated with exit(${status})`;\n this.status = status;\n }\n}\nvar callRuntimeCallbacks = (callbacks) => {\n while (callbacks.length > 0) {\n callbacks.shift()(Module);\n }\n};\nvar noExitRuntime = Module['noExitRuntime'] || true;\nvar __abort_js = () => abort('');\nvar runtimeKeepaliveCounter = 0;\nvar __emscripten_runtime_keepalive_clear = () => {\n noExitRuntime = false;\n runtimeKeepaliveCounter = 0;\n};\nvar timers = {};\nvar handleException = (e) => {\n if (e instanceof ExitStatus || e == 'unwind') {\n return EXITSTATUS;\n }\n quit_(1, e);\n};\nvar keepRuntimeAlive = () => noExitRuntime || runtimeKeepaliveCounter > 0;\nvar _proc_exit = (code) => {\n var _a;\n EXITSTATUS = code;\n if (!keepRuntimeAlive()) {\n (_a = Module['onExit']) === null || _a === void 0 ? void 0 : _a.call(Module, code);\n ABORT = true;\n }\n quit_(code, new ExitStatus(code));\n};\nvar exitJS = (status, implicit) => {\n EXITSTATUS = status;\n _proc_exit(status);\n};\nvar _exit = exitJS;\nvar maybeExit = () => {\n if (!keepRuntimeAlive()) {\n try {\n _exit(EXITSTATUS);\n }\n catch (e) {\n handleException(e);\n }\n }\n};\nvar callUserCallback = (func) => {\n if (ABORT) {\n return;\n }\n try {\n func();\n maybeExit();\n }\n catch (e) {\n handleException(e);\n }\n};\nvar _emscripten_get_now = () => performance.now();\nvar __setitimer_js = (which, timeout_ms) => {\n if (timers[which]) {\n clearTimeout(timers[which].id);\n delete timers[which];\n }\n if (!timeout_ms)\n return 0;\n var id = setTimeout(() => {\n delete timers[which];\n callUserCallback(() => __emscripten_timeout(which, _emscripten_get_now()));\n }, timeout_ms);\n timers[which] = { id, timeout_ms };\n return 0;\n};\nvar getHeapMax = () => 2147483648;\nvar alignMemory = (size, alignment) => Math.ceil(size / alignment) * alignment;\nvar growMemory = (size) => {\n var b = wasmMemory.buffer;\n var pages = ((size - b.byteLength + 65535) / 65536) | 0;\n try {\n wasmMemory.grow(pages);\n updateMemoryViews();\n return 1;\n }\n catch (e) { }\n};\nvar _emscripten_resize_heap = (requestedSize) => {\n var oldSize = HEAPU8.length;\n requestedSize >>>= 0;\n var maxHeapSize = getHeapMax();\n if (requestedSize > maxHeapSize) {\n return false;\n }\n for (var cutDown = 1; cutDown <= 4; cutDown *= 2) {\n var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown);\n overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296);\n var newSize = Math.min(maxHeapSize, alignMemory(Math.max(requestedSize, overGrownHeapSize), 65536));\n var replacement = growMemory(newSize);\n if (replacement) {\n return true;\n }\n }\n return false;\n};\nvar wasmImports = {\n c: __abort_js,\n b: __emscripten_runtime_keepalive_clear,\n d: __setitimer_js,\n e: _emscripten_resize_heap,\n a: _proc_exit,\n};\nvar wasmExports;\nvar ___wasm_call_ctors = () => (___wasm_call_ctors = wasmExports['g'])();\nvar _ZSTD_isError = (Module['_ZSTD_isError'] = (a0) => (_ZSTD_isError = Module['_ZSTD_isError'] = wasmExports['h'])(a0));\nvar _ZSTD_compressBound = (Module['_ZSTD_compressBound'] = (a0) => (_ZSTD_compressBound = Module['_ZSTD_compressBound'] = wasmExports['i'])(a0));\nvar _ZSTD_createCCtx = (Module['_ZSTD_createCCtx'] = () => (_ZSTD_createCCtx = Module['_ZSTD_createCCtx'] = wasmExports['j'])());\nvar _ZSTD_freeCCtx = (Module['_ZSTD_freeCCtx'] = (a0) => (_ZSTD_freeCCtx = Module['_ZSTD_freeCCtx'] = wasmExports['k'])(a0));\nvar _ZSTD_compress_usingDict = (Module['_ZSTD_compress_usingDict'] = (a0, a1, a2, a3, a4, a5, a6, a7) => (_ZSTD_compress_usingDict = Module['_ZSTD_compress_usingDict'] = wasmExports['l'])(a0, a1, a2, a3, a4, a5, a6, a7));\nvar _ZSTD_compress = (Module['_ZSTD_compress'] = (a0, a1, a2, a3, a4) => (_ZSTD_compress = Module['_ZSTD_compress'] = wasmExports['m'])(a0, a1, a2, a3, a4));\nvar _ZSTD_createDCtx = (Module['_ZSTD_createDCtx'] = () => (_ZSTD_createDCtx = Module['_ZSTD_createDCtx'] = wasmExports['n'])());\nvar _ZSTD_freeDCtx = (Module['_ZSTD_freeDCtx'] = (a0) => (_ZSTD_freeDCtx = Module['_ZSTD_freeDCtx'] = wasmExports['o'])(a0));\nvar _ZSTD_getFrameContentSize = (Module['_ZSTD_getFrameContentSize'] = (a0, a1) => (_ZSTD_getFrameContentSize = Module['_ZSTD_getFrameContentSize'] = wasmExports['p'])(a0, a1));\nvar _ZSTD_decompress_usingDict = (Module['_ZSTD_decompress_usingDict'] = (a0, a1, a2, a3, a4, a5, a6) => (_ZSTD_decompress_usingDict = Module['_ZSTD_decompress_usingDict'] = wasmExports['q'])(a0, a1, a2, a3, a4, a5, a6));\nvar _ZSTD_decompress = (Module['_ZSTD_decompress'] = (a0, a1, a2, a3) => (_ZSTD_decompress = Module['_ZSTD_decompress'] = wasmExports['r'])(a0, a1, a2, a3));\nvar _malloc = (Module['_malloc'] = (a0) => (_malloc = Module['_malloc'] = wasmExports['s'])(a0));\nvar _free = (Module['_free'] = (a0) => (_free = Module['_free'] = wasmExports['t'])(a0));\nvar __emscripten_timeout = (a0, a1) => (__emscripten_timeout = wasmExports['v'])(a0, a1);\nvar calledRun;\ndependenciesFulfilled = function runCaller() {\n if (!calledRun)\n run();\n if (!calledRun)\n dependenciesFulfilled = runCaller;\n};\nfunction run() {\n if (runDependencies > 0) {\n return;\n }\n preRun();\n if (runDependencies > 0) {\n return;\n }\n function doRun() {\n var _a;\n if (calledRun)\n return;\n calledRun = true;\n Module['calledRun'] = true;\n if (ABORT)\n return;\n initRuntime();\n (_a = Module['onRuntimeInitialized']) === null || _a === void 0 ? void 0 : _a.call(Module);\n postRun();\n }\n if (Module['setStatus']) {\n Module['setStatus']('Running...');\n setTimeout(() => {\n setTimeout(() => Module['setStatus'](''), 1);\n doRun();\n }, 1);\n }\n else {\n doRun();\n }\n}\nModule['run'] = run;\nif (Module['preInit']) {\n if (typeof Module['preInit'] == 'function')\n Module['preInit'] = [Module['preInit']];\n while (Module['preInit'].length > 0) {\n Module['preInit'].pop()();\n }\n}\nModule['init'] = init;\nexport { Module };\n//# sourceMappingURL=zstd.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { Module } from './zstd';\nconst initialized = (() => new Promise((resolve) => {\n Module.onRuntimeInitialized = resolve;\n}))();\nexport const waitInitialized = () => __awaiter(void 0, void 0, void 0, function* () {\n yield initialized;\n});\nexport { Module };\n//# sourceMappingURL=module.js.map","import { Module } from '../module';\nexport const isError = (code) => {\n const _isError = Module['_ZSTD_isError'];\n return _isError(code);\n};\n// @See https://github.com/facebook/zstd/blob/12c045f74d922dc934c168f6e1581d72df983388/lib/common/error_private.c#L24-L53\n// export const getErrorName = (code: number): string => {\n// const _getErrorName = Module.cwrap('ZSTD_getErrorName', 'string', ['number']);\n// return _getErrorName(code);\n// };\n//# sourceMappingURL=index.js.map","import { Module } from '../module';\nimport { isError } from '../errors';\nconst getFrameContentSize = (src, size) => {\n const getSize = Module['_ZSTD_getFrameContentSize'];\n return getSize(src, size);\n};\nexport const decompress = (buf, opts = { defaultHeapSize: 1024 * 1024 }) => {\n const malloc = Module['_malloc'];\n const src = malloc(buf.byteLength);\n Module.HEAP8.set(buf, src);\n const contentSize = getFrameContentSize(src, buf.byteLength);\n const size = contentSize === -1 ? opts.defaultHeapSize : contentSize;\n const free = Module['_free'];\n const heap = malloc(size);\n try {\n /*\n @See https://zstd.docsforge.com/dev/api/ZSTD_decompress/\n compressedSize : must be the exact size of some number of compressed and/or skippable frames.\n dstCapacity is an upper bound of originalSize to regenerate.\n If user cannot imply a maximum upper bound, it's better to use streaming mode to decompress data.\n @return: the number of bytes decompressed into dst (<= dstCapacity), or an errorCode if it fails (which can be tested using ZSTD_isError()).\n */\n const _decompress = Module['_ZSTD_decompress'];\n const sizeOrError = _decompress(heap, size, src, buf.byteLength);\n if (isError(sizeOrError)) {\n throw new Error(`Failed to compress with code ${sizeOrError}`);\n }\n // Copy buffer\n // Uint8Array.prototype.slice() return copied buffer.\n const data = new Uint8Array(Module.HEAPU8.buffer, heap, sizeOrError).slice();\n free(heap, size);\n free(src, buf.byteLength);\n return data;\n }\n catch (e) {\n free(heap, size);\n free(src, buf.byteLength);\n throw e;\n }\n};\n//# sourceMappingURL=decompress.js.map","import { Module } from '../module';\nimport { isError } from '../errors';\nconst compressBound = (size) => {\n const bound = Module['_ZSTD_compressBound'];\n return bound(size);\n};\nexport const compress = (buf, level) => {\n const bound = compressBound(buf.byteLength);\n const malloc = Module['_malloc'];\n const compressed = malloc(bound);\n const src = malloc(buf.byteLength);\n Module.HEAP8.set(buf, src);\n const free = Module['_free'];\n try {\n /*\n @See https://zstd.docsforge.com/dev/api/ZSTD_compress/\n size_t ZSTD_compress( void* dst, size_t dstCapacity, const void* src, size_t srcSize, int compressionLevel);\n Compresses `src` content as a single zstd compressed frame into already allocated `dst`.\n Hint : compression runs faster if `dstCapacity` >= `ZSTD_compressBound(srcSize)`.\n @return : compressed size written into `dst` (<= `dstCapacity),\n or an error code if it fails (which can be tested using ZSTD_isError()).\n */\n const _compress = Module['_ZSTD_compress'];\n const sizeOrError = _compress(compressed, bound, src, buf.byteLength, level !== null && level !== void 0 ? level : 3);\n if (isError(sizeOrError)) {\n throw new Error(`Failed to compress with code ${sizeOrError}`);\n }\n // // Copy buffer\n // // Uint8Array.prototype.slice() return copied buffer.\n const data = new Uint8Array(Module.HEAPU8.buffer, compressed, sizeOrError).slice();\n free(compressed, bound);\n free(src, buf.byteLength);\n return data;\n }\n catch (e) {\n free(compressed, bound);\n free(src, buf.byteLength);\n throw e;\n }\n};\n//# sourceMappingURL=compress.js.map","import { Module } from '../module';\nimport { isError } from '../errors';\nconst getFrameContentSize = (src, size) => {\n const getSize = Module['_ZSTD_getFrameContentSize'];\n return getSize(src, size);\n};\nexport const createDCtx = () => {\n return Module['_ZSTD_createDCtx']();\n};\nexport const freeDCtx = (dctx) => {\n return Module['_ZSTD_freeDCtx'](dctx);\n};\nexport const decompressUsingDict = (dctx, buf, dict, opts = { defaultHeapSize: 1024 * 1024 }) => {\n const malloc = Module['_malloc'];\n const src = malloc(buf.byteLength);\n Module.HEAP8.set(buf, src);\n const pdict = malloc(dict.byteLength);\n Module.HEAP8.set(dict, pdict);\n const contentSize = getFrameContentSize(src, buf.byteLength);\n const size = contentSize === -1 ? opts.defaultHeapSize : contentSize;\n const free = Module['_free'];\n const heap = malloc(size);\n try {\n const _decompress = Module['_ZSTD_decompress_usingDict'];\n const sizeOrError = _decompress(dctx, heap, size, src, buf.byteLength, pdict, dict.byteLength);\n if (isError(sizeOrError)) {\n throw new Error(`Failed to compress with code ${sizeOrError}`);\n }\n // Copy buffer\n // Uint8Array.prototype.slice() return copied buffer.\n const data = new Uint8Array(Module.HEAPU8.buffer, heap, sizeOrError).slice();\n free(heap, size);\n free(src, buf.byteLength);\n free(pdict, dict.byteLength);\n return data;\n }\n catch (e) {\n free(heap, size);\n free(src, buf.byteLength);\n free(pdict, dict.byteLength);\n throw e;\n }\n};\n//# sourceMappingURL=decompress_using_dict.js.map","import { Module } from '../module';\nimport { isError } from '../errors';\nconst compressBound = (size) => {\n const bound = Module['_ZSTD_compressBound'];\n return bound(size);\n};\nexport const createCCtx = () => {\n return Module['_ZSTD_createCCtx']();\n};\nexport const freeCCtx = (cctx) => {\n return Module['_ZSTD_freeCCtx'](cctx);\n};\nexport const compressUsingDict = (cctx, buf, dict, level) => {\n const bound = compressBound(buf.byteLength);\n const malloc = Module['_malloc'];\n const compressed = malloc(bound);\n const src = malloc(buf.byteLength);\n Module.HEAP8.set(buf, src);\n // Setup dict\n const pdict = malloc(dict.byteLength);\n Module.HEAP8.set(dict, pdict);\n const free = Module['_free'];\n try {\n /*\n @See https://zstd.docsforge.com/dev/api/ZSTD_compress_usingDict/\n size_t ZSTD_compress_usingDict(ZSTD_CCtx* cctx,\n void* dst, size_t dstCapacity,\n const void* src, size_t srcSize,\n const void* dict, size_t dictSize,\n int compressionLevel)\n */\n const _compress = Module['_ZSTD_compress_usingDict'];\n const sizeOrError = _compress(cctx, compressed, bound, src, buf.byteLength, pdict, dict.byteLength, level !== null && level !== void 0 ? level : 3);\n if (isError(sizeOrError)) {\n throw new Error(`Failed to compress with code ${sizeOrError}`);\n }\n // // Copy buffer\n // // Uint8Array.prototype.slice() return copied buffer.\n const data = new Uint8Array(Module.HEAPU8.buffer, compressed, sizeOrError).slice();\n free(compressed, bound);\n free(src, buf.byteLength);\n free(pdict, dict.byteLength);\n return data;\n }\n catch (e) {\n free(compressed, bound);\n free(src, buf.byteLength);\n free(pdict, dict.byteLength);\n throw e;\n }\n};\n//# sourceMappingURL=compress_using_dict.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { Module, waitInitialized } from './module';\nexport const init = (path) => __awaiter(void 0, void 0, void 0, function* () {\n // @ts-ignore\n const url = new URL(`./zstd.wasm`, import.meta.url).href;\n Module['init'](path !== null && path !== void 0 ? path : url);\n yield waitInitialized();\n});\nexport * from './simple/decompress';\nexport * from './simple/compress';\nexport * from './simple/decompress_using_dict';\nexport * from './simple/compress_using_dict';\n//# sourceMappingURL=index.web.js.map","import * as zstd from \"@bokuweb/zstd-wasm\";\n\ntype ZstdModule = {\n readonly init: (pathOrBytes?: string | Uint8Array) => Promise<void>;\n readonly compress: (\n buffer: Uint8Array,\n compressionLevel?: number,\n ) => Uint8Array;\n readonly decompress: (buffer: Uint8Array) => Uint8Array;\n};\n\nconst zstdModule = zstd as unknown as ZstdModule;\nconst bundledWasmUrl = new URL(\"./zstd.wasm\", import.meta.url);\n\nlet modulePromise: Promise<ZstdModule> | undefined;\n\nfunction isNodeRuntime(): boolean {\n return typeof process !== \"undefined\" && process.versions?.node != null;\n}\n\nfunction isMissingBundledWasm(error: unknown): boolean {\n return (error as NodeJS.ErrnoException | undefined)?.code === \"ENOENT\";\n}\n\nasync function loadZstdModule(): Promise<ZstdModule> {\n try {\n // Built artifacts ship a colocated wasm file. Source-level Node tests still\n // fall back to zstd-wasm's own node loader because src/zstd.wasm does not exist.\n if (isNodeRuntime()) {\n const { readFile } = await import(\"node:fs/promises\");\n try {\n await zstdModule.init(await readFile(bundledWasmUrl));\n } catch (error) {\n if (!isMissingBundledWasm(error)) {\n throw error;\n }\n await zstdModule.init();\n }\n } else {\n await zstdModule.init();\n }\n return zstdModule;\n } catch (error) {\n throw new Error(\n 'Failed to initialize the bundled zstd runtime for \"@loro-dev/streams-crdt/zstd\".',\n { cause: error },\n );\n }\n}\n\nasync function getZstdModule(): Promise<ZstdModule> {\n return await (modulePromise ??= loadZstdModule());\n}\n\nexport async function compressInCurrentThread(\n snapshot: Uint8Array,\n): Promise<Uint8Array> {\n const zstd = await getZstdModule();\n return zstd.compress(snapshot);\n}\n\nexport async function decompressInCurrentThread(\n snapshot: Uint8Array,\n): Promise<Uint8Array> {\n const zstd = await getZstdModule();\n return zstd.decompress(snapshot);\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7],"mappings":";;;;;;;;;;;;;AACA,IAAI,SAAS,OAAO,WAAW,cAAc,SAAS,EAAE;AACxD,IAAI,kBAAkB,EAAE;AACxB,IAAI;AACJ,KAAK,OAAO,OACR,KAAI,OAAO,eAAe,IAAI,CAC1B,iBAAgB,OAAO,OAAO;AAItC,IAAI,MAAM,OAAO,eAAe,QAAQ,KAAK,KAAK,QAAQ;AAC1D,KAAK,OAAO,gBACR,KAAI,gBAAgB,eAAe,IAAI,CACnC,QAAO,OAAO,gBAAgB;AAGtC,IAAI,SAAS,QAAQ,YAAY;AAC7B,OAAM;;AAEV,kBAAkB;AAClB,IAAI,OAAO,aACM,QAAO;AACxB,IAAI,OAAO,eACP,eAAc,OAAO;AACzB,IAAI,OAAO,QACP,SAAQ,OAAO;AAKnB,IAAI,OAAO,gBAAgB,SACvB,OAAM,kCAAkC;AAE5C,IAAI;AACJ,IAAI,QAAQ,OACR,YACQ;AACZ,SAAS,oBAAoB;CACzB,IAAI,IAAI,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AqB,OAAyB;AACrD,QAAQ,OAA6C,SAAS;;AAGhE,eAAe,iBAAsC;AACnD,KAAI;AAGF,MAAI,eAAe,EAAE;GACnB,MAAM,EAAE,aAAa,MAAM,OAAO;AAClC,OAAI;AACF,UAAM,WAAW,KAAK,MAAM,SAAS,eAAe,CAAC;YAC9C,OAAO;AACd,QAAI,CAAC,qBAAqB,MAAM,CAC9B,OAAM;AAER,UAAM,WAAW,MAAM;;QAGzB,OAAM,WAAW,MAAM;AAEzB,SAAO;UACA,OAAO;AACd,QAAM,IAAI,MACR,sFACA,EAAE,OAAO,OAAO,CACjB;;;AAIL,eAAe,gBAAqC;AAClD,QAAO,OAAO,kBAAkB,gBAAgB;;AAGlD,eAAsB,wBACpB,UACqB;AAErB,SADa,MAAM,eAAe,EACtB,SAAS,SAAS;;AAGhC,eAAsB,0BACpB,UACqB;AAErB,SADa,MAAM,eAAe,EACtB,WAAW,SAAS"}
|
package/dist/zstd-worker.js
CHANGED
package/dist/zstd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as decompressInCurrentThread, t as compressInCurrentThread } from "./zstd-core-
|
|
1
|
+
import { n as decompressInCurrentThread, t as compressInCurrentThread } from "./zstd-core-nJ4Lg1a0.js";
|
|
2
2
|
//#region src/zstd.ts
|
|
3
3
|
let compressionWorker;
|
|
4
4
|
function rejectPending(state, error) {
|
package/dist/zstd.wasm
ADDED
|
Binary file
|