@contentauth/c2pa-wasm 0.4.1 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/pkg/c2pa.d.ts +46 -34
- package/pkg/c2pa.js +308 -289
- package/pkg/c2pa_bg.wasm +0 -0
- package/pkg/c2pa_bg.wasm.d.ts +15 -15
package/pkg/c2pa.js
CHANGED
|
@@ -1,47 +1,14 @@
|
|
|
1
1
|
let wasm;
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
8
|
-
}
|
|
9
|
-
return cachedUint8ArrayMemory0;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
13
|
-
|
|
14
|
-
cachedTextDecoder.decode();
|
|
15
|
-
|
|
16
|
-
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
17
|
-
let numBytesDecoded = 0;
|
|
18
|
-
function decodeText(ptr, len) {
|
|
19
|
-
numBytesDecoded += len;
|
|
20
|
-
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
21
|
-
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
22
|
-
cachedTextDecoder.decode();
|
|
23
|
-
numBytesDecoded = len;
|
|
24
|
-
}
|
|
25
|
-
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function getStringFromWasm0(ptr, len) {
|
|
29
|
-
ptr = ptr >>> 0;
|
|
30
|
-
return decodeText(ptr, len);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function isLikeNone(x) {
|
|
34
|
-
return x === undefined || x === null;
|
|
3
|
+
function addToExternrefTable0(obj) {
|
|
4
|
+
const idx = wasm.__externref_table_alloc();
|
|
5
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
6
|
+
return idx;
|
|
35
7
|
}
|
|
36
8
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
41
|
-
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
42
|
-
}
|
|
43
|
-
return cachedDataViewMemory0;
|
|
44
|
-
}
|
|
9
|
+
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
10
|
+
? { register: () => {}, unregister: () => {} }
|
|
11
|
+
: new FinalizationRegistry(state => state.dtor(state.a, state.b));
|
|
45
12
|
|
|
46
13
|
function debugString(val) {
|
|
47
14
|
// primitive types
|
|
@@ -108,64 +75,30 @@ function debugString(val) {
|
|
|
108
75
|
return className;
|
|
109
76
|
}
|
|
110
77
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
if (!('encodeInto' in cachedTextEncoder)) {
|
|
116
|
-
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
117
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
118
|
-
view.set(buf);
|
|
119
|
-
return {
|
|
120
|
-
read: arg.length,
|
|
121
|
-
written: buf.length
|
|
122
|
-
};
|
|
123
|
-
}
|
|
78
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
79
|
+
ptr = ptr >>> 0;
|
|
80
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
124
81
|
}
|
|
125
82
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
if (
|
|
129
|
-
|
|
130
|
-
const ptr = malloc(buf.length, 1) >>> 0;
|
|
131
|
-
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
132
|
-
WASM_VECTOR_LEN = buf.length;
|
|
133
|
-
return ptr;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
let len = arg.length;
|
|
137
|
-
let ptr = malloc(len, 1) >>> 0;
|
|
138
|
-
|
|
139
|
-
const mem = getUint8ArrayMemory0();
|
|
140
|
-
|
|
141
|
-
let offset = 0;
|
|
142
|
-
|
|
143
|
-
for (; offset < len; offset++) {
|
|
144
|
-
const code = arg.charCodeAt(offset);
|
|
145
|
-
if (code > 0x7F) break;
|
|
146
|
-
mem[ptr + offset] = code;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
if (offset !== len) {
|
|
150
|
-
if (offset !== 0) {
|
|
151
|
-
arg = arg.slice(offset);
|
|
152
|
-
}
|
|
153
|
-
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
154
|
-
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
155
|
-
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
156
|
-
|
|
157
|
-
offset += ret.written;
|
|
158
|
-
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
83
|
+
let cachedDataViewMemory0 = null;
|
|
84
|
+
function getDataViewMemory0() {
|
|
85
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
86
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
159
87
|
}
|
|
88
|
+
return cachedDataViewMemory0;
|
|
89
|
+
}
|
|
160
90
|
|
|
161
|
-
|
|
162
|
-
|
|
91
|
+
function getStringFromWasm0(ptr, len) {
|
|
92
|
+
ptr = ptr >>> 0;
|
|
93
|
+
return decodeText(ptr, len);
|
|
163
94
|
}
|
|
164
95
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
96
|
+
let cachedUint8ArrayMemory0 = null;
|
|
97
|
+
function getUint8ArrayMemory0() {
|
|
98
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
99
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
100
|
+
}
|
|
101
|
+
return cachedUint8ArrayMemory0;
|
|
169
102
|
}
|
|
170
103
|
|
|
171
104
|
function handleError(f, args) {
|
|
@@ -177,15 +110,10 @@ function handleError(f, args) {
|
|
|
177
110
|
}
|
|
178
111
|
}
|
|
179
112
|
|
|
180
|
-
function
|
|
181
|
-
|
|
182
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
113
|
+
function isLikeNone(x) {
|
|
114
|
+
return x === undefined || x === null;
|
|
183
115
|
}
|
|
184
116
|
|
|
185
|
-
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
186
|
-
? { register: () => {}, unregister: () => {} }
|
|
187
|
-
: new FinalizationRegistry(state => state.dtor(state.a, state.b));
|
|
188
|
-
|
|
189
117
|
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
190
118
|
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
191
119
|
const real = (...args) => {
|
|
@@ -214,41 +142,88 @@ function makeMutClosure(arg0, arg1, dtor, f) {
|
|
|
214
142
|
return real;
|
|
215
143
|
}
|
|
216
144
|
|
|
145
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
146
|
+
if (realloc === undefined) {
|
|
147
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
148
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
149
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
150
|
+
WASM_VECTOR_LEN = buf.length;
|
|
151
|
+
return ptr;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
let len = arg.length;
|
|
155
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
156
|
+
|
|
157
|
+
const mem = getUint8ArrayMemory0();
|
|
158
|
+
|
|
159
|
+
let offset = 0;
|
|
160
|
+
|
|
161
|
+
for (; offset < len; offset++) {
|
|
162
|
+
const code = arg.charCodeAt(offset);
|
|
163
|
+
if (code > 0x7F) break;
|
|
164
|
+
mem[ptr + offset] = code;
|
|
165
|
+
}
|
|
166
|
+
if (offset !== len) {
|
|
167
|
+
if (offset !== 0) {
|
|
168
|
+
arg = arg.slice(offset);
|
|
169
|
+
}
|
|
170
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
171
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
172
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
173
|
+
|
|
174
|
+
offset += ret.written;
|
|
175
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
WASM_VECTOR_LEN = offset;
|
|
179
|
+
return ptr;
|
|
180
|
+
}
|
|
181
|
+
|
|
217
182
|
function takeFromExternrefTable0(idx) {
|
|
218
183
|
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
219
184
|
wasm.__externref_table_dealloc(idx);
|
|
220
185
|
return value;
|
|
221
186
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
187
|
+
|
|
188
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
189
|
+
cachedTextDecoder.decode();
|
|
190
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
191
|
+
let numBytesDecoded = 0;
|
|
192
|
+
function decodeText(ptr, len) {
|
|
193
|
+
numBytesDecoded += len;
|
|
194
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
195
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
196
|
+
cachedTextDecoder.decode();
|
|
197
|
+
numBytesDecoded = len;
|
|
198
|
+
}
|
|
199
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
227
200
|
}
|
|
228
201
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
202
|
+
const cachedTextEncoder = new TextEncoder();
|
|
203
|
+
|
|
204
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
205
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
206
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
207
|
+
view.set(buf);
|
|
208
|
+
return {
|
|
209
|
+
read: arg.length,
|
|
210
|
+
written: buf.length
|
|
211
|
+
};
|
|
239
212
|
}
|
|
240
213
|
}
|
|
241
214
|
|
|
242
|
-
|
|
243
|
-
|
|
215
|
+
let WASM_VECTOR_LEN = 0;
|
|
216
|
+
|
|
217
|
+
function wasm_bindgen__convert__closures_____invoke__hbb62da5b17229099(arg0, arg1) {
|
|
218
|
+
wasm.wasm_bindgen__convert__closures_____invoke__hbb62da5b17229099(arg0, arg1);
|
|
244
219
|
}
|
|
245
220
|
|
|
246
|
-
function
|
|
247
|
-
wasm.
|
|
221
|
+
function wasm_bindgen__convert__closures_____invoke__h6e57fd9fec4e535c(arg0, arg1, arg2) {
|
|
222
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h6e57fd9fec4e535c(arg0, arg1, arg2);
|
|
248
223
|
}
|
|
249
224
|
|
|
250
|
-
function
|
|
251
|
-
wasm.
|
|
225
|
+
function wasm_bindgen__convert__closures_____invoke__ha15b80997070ee79(arg0, arg1, arg2, arg3) {
|
|
226
|
+
wasm.wasm_bindgen__convert__closures_____invoke__ha15b80997070ee79(arg0, arg1, arg2, arg3);
|
|
252
227
|
}
|
|
253
228
|
|
|
254
229
|
const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
|
|
@@ -260,11 +235,19 @@ const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate
|
|
|
260
235
|
const WasmBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
261
236
|
? { register: () => {}, unregister: () => {} }
|
|
262
237
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmbuilder_free(ptr >>> 0, 1));
|
|
238
|
+
|
|
239
|
+
const WasmReaderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
240
|
+
? { register: () => {}, unregister: () => {} }
|
|
241
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmreader_free(ptr >>> 0, 1));
|
|
242
|
+
|
|
243
|
+
const WasmSignerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
244
|
+
? { register: () => {}, unregister: () => {} }
|
|
245
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmsigner_free(ptr >>> 0, 1));
|
|
246
|
+
|
|
263
247
|
/**
|
|
264
248
|
* Wraps a `c2pa::Builder`.
|
|
265
249
|
*/
|
|
266
250
|
export class WasmBuilder {
|
|
267
|
-
|
|
268
251
|
static __wrap(ptr) {
|
|
269
252
|
ptr = ptr >>> 0;
|
|
270
253
|
const obj = Object.create(WasmBuilder.prototype);
|
|
@@ -272,14 +255,12 @@ export class WasmBuilder {
|
|
|
272
255
|
WasmBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
273
256
|
return obj;
|
|
274
257
|
}
|
|
275
|
-
|
|
276
258
|
__destroy_into_raw() {
|
|
277
259
|
const ptr = this.__wbg_ptr;
|
|
278
260
|
this.__wbg_ptr = 0;
|
|
279
261
|
WasmBuilderFinalization.unregister(this);
|
|
280
262
|
return ptr;
|
|
281
263
|
}
|
|
282
|
-
|
|
283
264
|
free() {
|
|
284
265
|
const ptr = this.__destroy_into_raw();
|
|
285
266
|
wasm.__wbg_wasmbuilder_free(ptr, 0);
|
|
@@ -317,11 +298,15 @@ export class WasmBuilder {
|
|
|
317
298
|
}
|
|
318
299
|
/**
|
|
319
300
|
* Attempts to create a new `WasmBuilder` from a builder archive.
|
|
301
|
+
* Optionally accepts a context JSON string to configure the builder.
|
|
320
302
|
* @param {Blob} archive
|
|
303
|
+
* @param {string | null} [_context_json]
|
|
321
304
|
* @returns {WasmBuilder}
|
|
322
305
|
*/
|
|
323
|
-
static fromArchive(archive) {
|
|
324
|
-
|
|
306
|
+
static fromArchive(archive, _context_json) {
|
|
307
|
+
var ptr0 = isLikeNone(_context_json) ? 0 : passStringToWasm0(_context_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
308
|
+
var len0 = WASM_VECTOR_LEN;
|
|
309
|
+
const ret = wasm.wasmbuilder_fromArchive(archive, ptr0, len0);
|
|
325
310
|
if (ret[2]) {
|
|
326
311
|
throw takeFromExternrefTable0(ret[1]);
|
|
327
312
|
}
|
|
@@ -334,6 +319,21 @@ export class WasmBuilder {
|
|
|
334
319
|
setNoEmbed(no_embed) {
|
|
335
320
|
wasm.wasmbuilder_setNoEmbed(this.__wbg_ptr, no_embed);
|
|
336
321
|
}
|
|
322
|
+
/**
|
|
323
|
+
* Add an ingredient to the manifest from a JSON ingredient definition without a blob
|
|
324
|
+
*
|
|
325
|
+
* # Arguments
|
|
326
|
+
* * `ingredient_json` - A JSON string representing the ingredient.
|
|
327
|
+
* @param {string} json
|
|
328
|
+
*/
|
|
329
|
+
addIngredient(json) {
|
|
330
|
+
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
331
|
+
const len0 = WASM_VECTOR_LEN;
|
|
332
|
+
const ret = wasm.wasmbuilder_addIngredient(this.__wbg_ptr, ptr0, len0);
|
|
333
|
+
if (ret[1]) {
|
|
334
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
337
|
/**
|
|
338
338
|
* Get the current manifest definition.
|
|
339
339
|
* @returns {string}
|
|
@@ -420,10 +420,14 @@ export class WasmBuilder {
|
|
|
420
420
|
}
|
|
421
421
|
/**
|
|
422
422
|
* Creates a new `WasmBuilder` with a minimal manifest definition.
|
|
423
|
+
* Optionally accepts a context JSON string to configure the builder.
|
|
424
|
+
* @param {string | null} [context_json]
|
|
423
425
|
* @returns {WasmBuilder}
|
|
424
426
|
*/
|
|
425
|
-
static new() {
|
|
426
|
-
|
|
427
|
+
static new(context_json) {
|
|
428
|
+
var ptr0 = isLikeNone(context_json) ? 0 : passStringToWasm0(context_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
429
|
+
var len0 = WASM_VECTOR_LEN;
|
|
430
|
+
const ret = wasm.wasmbuilder_new(ptr0, len0);
|
|
427
431
|
if (ret[2]) {
|
|
428
432
|
throw takeFromExternrefTable0(ret[1]);
|
|
429
433
|
}
|
|
@@ -444,13 +448,17 @@ export class WasmBuilder {
|
|
|
444
448
|
}
|
|
445
449
|
/**
|
|
446
450
|
* Attempts to create a new `WasmBuilder` from a JSON ManifestDefinition string.
|
|
451
|
+
* Optionally accepts a context JSON string to configure the builder.
|
|
447
452
|
* @param {string} json
|
|
453
|
+
* @param {string | null} [context_json]
|
|
448
454
|
* @returns {WasmBuilder}
|
|
449
455
|
*/
|
|
450
|
-
static fromJson(json) {
|
|
456
|
+
static fromJson(json, context_json) {
|
|
451
457
|
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
452
458
|
const len0 = WASM_VECTOR_LEN;
|
|
453
|
-
|
|
459
|
+
var ptr1 = isLikeNone(context_json) ? 0 : passStringToWasm0(context_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
460
|
+
var len1 = WASM_VECTOR_LEN;
|
|
461
|
+
const ret = wasm.wasmbuilder_fromJson(ptr0, len0, ptr1, len1);
|
|
454
462
|
if (ret[2]) {
|
|
455
463
|
throw takeFromExternrefTable0(ret[1]);
|
|
456
464
|
}
|
|
@@ -459,14 +467,10 @@ export class WasmBuilder {
|
|
|
459
467
|
}
|
|
460
468
|
if (Symbol.dispose) WasmBuilder.prototype[Symbol.dispose] = WasmBuilder.prototype.free;
|
|
461
469
|
|
|
462
|
-
const WasmReaderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
463
|
-
? { register: () => {}, unregister: () => {} }
|
|
464
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_wasmreader_free(ptr >>> 0, 1));
|
|
465
470
|
/**
|
|
466
471
|
* Wraps a `c2pa::Reader`.
|
|
467
472
|
*/
|
|
468
473
|
export class WasmReader {
|
|
469
|
-
|
|
470
474
|
static __wrap(ptr) {
|
|
471
475
|
ptr = ptr >>> 0;
|
|
472
476
|
const obj = Object.create(WasmReader.prototype);
|
|
@@ -474,14 +478,12 @@ export class WasmReader {
|
|
|
474
478
|
WasmReaderFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
475
479
|
return obj;
|
|
476
480
|
}
|
|
477
|
-
|
|
478
481
|
__destroy_into_raw() {
|
|
479
482
|
const ptr = this.__wbg_ptr;
|
|
480
483
|
this.__wbg_ptr = 0;
|
|
481
484
|
WasmReaderFinalization.unregister(this);
|
|
482
485
|
return ptr;
|
|
483
486
|
}
|
|
484
|
-
|
|
485
487
|
free() {
|
|
486
488
|
const ptr = this.__destroy_into_raw();
|
|
487
489
|
wasm.__wbg_wasmreader_free(ptr, 0);
|
|
@@ -537,15 +539,19 @@ export class WasmReader {
|
|
|
537
539
|
}
|
|
538
540
|
/**
|
|
539
541
|
* Attempts to create a new `WasmReader` from an asset format, a `Blob` of the bytes of the initial segment, and a fragment `Blob`.
|
|
542
|
+
* Optionally accepts a context JSON string to configure the reader.
|
|
540
543
|
* @param {string} format
|
|
541
544
|
* @param {Blob} init
|
|
542
545
|
* @param {Blob} fragment
|
|
546
|
+
* @param {string | null} [context_json]
|
|
543
547
|
* @returns {Promise<WasmReader>}
|
|
544
548
|
*/
|
|
545
|
-
static fromBlobFragment(format, init, fragment) {
|
|
549
|
+
static fromBlobFragment(format, init, fragment, context_json) {
|
|
546
550
|
const ptr0 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
547
551
|
const len0 = WASM_VECTOR_LEN;
|
|
548
|
-
|
|
552
|
+
var ptr1 = isLikeNone(context_json) ? 0 : passStringToWasm0(context_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
553
|
+
var len1 = WASM_VECTOR_LEN;
|
|
554
|
+
const ret = wasm.wasmreader_fromBlobFragment(ptr0, len0, init, fragment, ptr1, len1);
|
|
549
555
|
return ret;
|
|
550
556
|
}
|
|
551
557
|
/**
|
|
@@ -566,25 +572,24 @@ export class WasmReader {
|
|
|
566
572
|
}
|
|
567
573
|
/**
|
|
568
574
|
* Attempts to create a new `WasmReader` from an asset format and `Blob` of the asset's bytes.
|
|
575
|
+
* Optionally accepts a context JSON string to configure the reader.
|
|
569
576
|
* @param {string} format
|
|
570
577
|
* @param {Blob} blob
|
|
578
|
+
* @param {string | null} [context_json]
|
|
571
579
|
* @returns {Promise<WasmReader>}
|
|
572
580
|
*/
|
|
573
|
-
static fromBlob(format, blob) {
|
|
581
|
+
static fromBlob(format, blob, context_json) {
|
|
574
582
|
const ptr0 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
575
583
|
const len0 = WASM_VECTOR_LEN;
|
|
576
|
-
|
|
584
|
+
var ptr1 = isLikeNone(context_json) ? 0 : passStringToWasm0(context_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
585
|
+
var len1 = WASM_VECTOR_LEN;
|
|
586
|
+
const ret = wasm.wasmreader_fromBlob(ptr0, len0, blob, ptr1, len1);
|
|
577
587
|
return ret;
|
|
578
588
|
}
|
|
579
589
|
}
|
|
580
590
|
if (Symbol.dispose) WasmReader.prototype[Symbol.dispose] = WasmReader.prototype.free;
|
|
581
591
|
|
|
582
|
-
const WasmSignerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
583
|
-
? { register: () => {}, unregister: () => {} }
|
|
584
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_wasmsigner_free(ptr >>> 0, 1));
|
|
585
|
-
|
|
586
592
|
export class WasmSigner {
|
|
587
|
-
|
|
588
593
|
static __wrap(ptr) {
|
|
589
594
|
ptr = ptr >>> 0;
|
|
590
595
|
const obj = Object.create(WasmSigner.prototype);
|
|
@@ -592,14 +597,12 @@ export class WasmSigner {
|
|
|
592
597
|
WasmSignerFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
593
598
|
return obj;
|
|
594
599
|
}
|
|
595
|
-
|
|
596
600
|
__destroy_into_raw() {
|
|
597
601
|
const ptr = this.__wbg_ptr;
|
|
598
602
|
this.__wbg_ptr = 0;
|
|
599
603
|
WasmSignerFinalization.unregister(this);
|
|
600
604
|
return ptr;
|
|
601
605
|
}
|
|
602
|
-
|
|
603
606
|
free() {
|
|
604
607
|
const ptr = this.__destroy_into_raw();
|
|
605
608
|
wasm.__wbg_wasmsigner_free(ptr, 0);
|
|
@@ -619,6 +622,26 @@ export class WasmSigner {
|
|
|
619
622
|
}
|
|
620
623
|
if (Symbol.dispose) WasmSigner.prototype[Symbol.dispose] = WasmSigner.prototype.free;
|
|
621
624
|
|
|
625
|
+
/**
|
|
626
|
+
* Accepts a JSON-serialized string to be loaded as c2pa-rs settings.
|
|
627
|
+
* @param {string} settings
|
|
628
|
+
*/
|
|
629
|
+
export function loadSettings(settings) {
|
|
630
|
+
const ptr0 = passStringToWasm0(settings, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
631
|
+
const len0 = WASM_VECTOR_LEN;
|
|
632
|
+
const ret = wasm.loadSettings(ptr0, len0);
|
|
633
|
+
if (ret[1]) {
|
|
634
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* Called when the WASM binary is initialized.
|
|
640
|
+
*/
|
|
641
|
+
export function run() {
|
|
642
|
+
wasm.run();
|
|
643
|
+
}
|
|
644
|
+
|
|
622
645
|
const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
|
|
623
646
|
|
|
624
647
|
async function __wbg_load(module, imports) {
|
|
@@ -626,7 +649,6 @@ async function __wbg_load(module, imports) {
|
|
|
626
649
|
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
627
650
|
try {
|
|
628
651
|
return await WebAssembly.instantiateStreaming(module, imports);
|
|
629
|
-
|
|
630
652
|
} catch (e) {
|
|
631
653
|
const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
|
|
632
654
|
|
|
@@ -641,13 +663,11 @@ async function __wbg_load(module, imports) {
|
|
|
641
663
|
|
|
642
664
|
const bytes = await module.arrayBuffer();
|
|
643
665
|
return await WebAssembly.instantiate(bytes, imports);
|
|
644
|
-
|
|
645
666
|
} else {
|
|
646
667
|
const instance = await WebAssembly.instantiate(module, imports);
|
|
647
668
|
|
|
648
669
|
if (instance instanceof WebAssembly.Instance) {
|
|
649
670
|
return { instance, module };
|
|
650
|
-
|
|
651
671
|
} else {
|
|
652
672
|
return instance;
|
|
653
673
|
}
|
|
@@ -657,72 +677,72 @@ async function __wbg_load(module, imports) {
|
|
|
657
677
|
function __wbg_get_imports() {
|
|
658
678
|
const imports = {};
|
|
659
679
|
imports.wbg = {};
|
|
660
|
-
imports.wbg.
|
|
680
|
+
imports.wbg.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) {
|
|
661
681
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
662
682
|
return ret;
|
|
663
683
|
};
|
|
664
|
-
imports.wbg.
|
|
684
|
+
imports.wbg.__wbg_Number_2d1dcfcf4ec51736 = function(arg0) {
|
|
665
685
|
const ret = Number(arg0);
|
|
666
686
|
return ret;
|
|
667
687
|
};
|
|
668
|
-
imports.wbg.
|
|
688
|
+
imports.wbg.__wbg___wbindgen_bigint_get_as_i64_6e32f5e6aff02e1d = function(arg0, arg1) {
|
|
669
689
|
const v = arg1;
|
|
670
690
|
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
671
691
|
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
672
692
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
673
693
|
};
|
|
674
|
-
imports.wbg.
|
|
694
|
+
imports.wbg.__wbg___wbindgen_boolean_get_dea25b33882b895b = function(arg0) {
|
|
675
695
|
const v = arg0;
|
|
676
696
|
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
677
697
|
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
678
698
|
};
|
|
679
|
-
imports.wbg.
|
|
699
|
+
imports.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) {
|
|
680
700
|
const ret = debugString(arg1);
|
|
681
701
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
682
702
|
const len1 = WASM_VECTOR_LEN;
|
|
683
703
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
684
704
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
685
705
|
};
|
|
686
|
-
imports.wbg.
|
|
706
|
+
imports.wbg.__wbg___wbindgen_in_0d3e1e8f0c669317 = function(arg0, arg1) {
|
|
687
707
|
const ret = arg0 in arg1;
|
|
688
708
|
return ret;
|
|
689
709
|
};
|
|
690
|
-
imports.wbg.
|
|
710
|
+
imports.wbg.__wbg___wbindgen_is_bigint_0e1a2e3f55cfae27 = function(arg0) {
|
|
691
711
|
const ret = typeof(arg0) === 'bigint';
|
|
692
712
|
return ret;
|
|
693
713
|
};
|
|
694
|
-
imports.wbg.
|
|
714
|
+
imports.wbg.__wbg___wbindgen_is_function_8d400b8b1af978cd = function(arg0) {
|
|
695
715
|
const ret = typeof(arg0) === 'function';
|
|
696
716
|
return ret;
|
|
697
717
|
};
|
|
698
|
-
imports.wbg.
|
|
718
|
+
imports.wbg.__wbg___wbindgen_is_object_ce774f3490692386 = function(arg0) {
|
|
699
719
|
const val = arg0;
|
|
700
720
|
const ret = typeof(val) === 'object' && val !== null;
|
|
701
721
|
return ret;
|
|
702
722
|
};
|
|
703
|
-
imports.wbg.
|
|
723
|
+
imports.wbg.__wbg___wbindgen_is_string_704ef9c8fc131030 = function(arg0) {
|
|
704
724
|
const ret = typeof(arg0) === 'string';
|
|
705
725
|
return ret;
|
|
706
726
|
};
|
|
707
|
-
imports.wbg.
|
|
727
|
+
imports.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(arg0) {
|
|
708
728
|
const ret = arg0 === undefined;
|
|
709
729
|
return ret;
|
|
710
730
|
};
|
|
711
|
-
imports.wbg.
|
|
731
|
+
imports.wbg.__wbg___wbindgen_jsval_eq_b6101cc9cef1fe36 = function(arg0, arg1) {
|
|
712
732
|
const ret = arg0 === arg1;
|
|
713
733
|
return ret;
|
|
714
734
|
};
|
|
715
|
-
imports.wbg.
|
|
735
|
+
imports.wbg.__wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d = function(arg0, arg1) {
|
|
716
736
|
const ret = arg0 == arg1;
|
|
717
737
|
return ret;
|
|
718
738
|
};
|
|
719
|
-
imports.wbg.
|
|
739
|
+
imports.wbg.__wbg___wbindgen_number_get_9619185a74197f95 = function(arg0, arg1) {
|
|
720
740
|
const obj = arg1;
|
|
721
741
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
722
742
|
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
723
743
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
724
744
|
};
|
|
725
|
-
imports.wbg.
|
|
745
|
+
imports.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) {
|
|
726
746
|
const obj = arg1;
|
|
727
747
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
728
748
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -730,34 +750,34 @@ function __wbg_get_imports() {
|
|
|
730
750
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
731
751
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
732
752
|
};
|
|
733
|
-
imports.wbg.
|
|
753
|
+
imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
|
|
734
754
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
735
755
|
};
|
|
736
|
-
imports.wbg.
|
|
756
|
+
imports.wbg.__wbg__wbg_cb_unref_87dfb5aaa0cbcea7 = function(arg0) {
|
|
737
757
|
arg0._wbg_cb_unref();
|
|
738
758
|
};
|
|
739
|
-
imports.wbg.
|
|
740
|
-
arg0.abort(arg1);
|
|
741
|
-
};
|
|
742
|
-
imports.wbg.__wbg_abort_e7eb059f72f9ed0c = function(arg0) {
|
|
759
|
+
imports.wbg.__wbg_abort_07646c894ebbf2bd = function(arg0) {
|
|
743
760
|
arg0.abort();
|
|
744
761
|
};
|
|
745
|
-
imports.wbg.
|
|
762
|
+
imports.wbg.__wbg_abort_399ecbcfd6ef3c8e = function(arg0, arg1) {
|
|
763
|
+
arg0.abort(arg1);
|
|
764
|
+
};
|
|
765
|
+
imports.wbg.__wbg_append_c5cbdf46455cc776 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
746
766
|
arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
747
767
|
}, arguments) };
|
|
748
|
-
imports.wbg.
|
|
768
|
+
imports.wbg.__wbg_arrayBuffer_c04af4fce566092d = function() { return handleError(function (arg0) {
|
|
749
769
|
const ret = arg0.arrayBuffer();
|
|
750
770
|
return ret;
|
|
751
771
|
}, arguments) };
|
|
752
|
-
imports.wbg.
|
|
772
|
+
imports.wbg.__wbg_byteLength_faa9938885bdeee6 = function(arg0) {
|
|
753
773
|
const ret = arg0.byteLength;
|
|
754
774
|
return ret;
|
|
755
775
|
};
|
|
756
|
-
imports.wbg.
|
|
776
|
+
imports.wbg.__wbg_call_3020136f7a2d6e44 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
757
777
|
const ret = arg0.call(arg1, arg2);
|
|
758
778
|
return ret;
|
|
759
779
|
}, arguments) };
|
|
760
|
-
imports.wbg.
|
|
780
|
+
imports.wbg.__wbg_call_abb4ff46ce38be40 = function() { return handleError(function (arg0, arg1) {
|
|
761
781
|
const ret = arg0.call(arg1);
|
|
762
782
|
return ret;
|
|
763
783
|
}, arguments) };
|
|
@@ -769,11 +789,11 @@ function __wbg_get_imports() {
|
|
|
769
789
|
const ret = arg0.crypto;
|
|
770
790
|
return ret;
|
|
771
791
|
};
|
|
772
|
-
imports.wbg.
|
|
792
|
+
imports.wbg.__wbg_done_62ea16af4ce34b24 = function(arg0) {
|
|
773
793
|
const ret = arg0.done;
|
|
774
794
|
return ret;
|
|
775
795
|
};
|
|
776
|
-
imports.wbg.
|
|
796
|
+
imports.wbg.__wbg_entries_83c79938054e065f = function(arg0) {
|
|
777
797
|
const ret = Object.entries(arg0);
|
|
778
798
|
return ret;
|
|
779
799
|
};
|
|
@@ -792,29 +812,32 @@ function __wbg_get_imports() {
|
|
|
792
812
|
const ret = fetch(arg0);
|
|
793
813
|
return ret;
|
|
794
814
|
};
|
|
795
|
-
imports.wbg.
|
|
815
|
+
imports.wbg.__wbg_fetch_90447c28cc0b095e = function(arg0, arg1) {
|
|
796
816
|
const ret = arg0.fetch(arg1);
|
|
797
817
|
return ret;
|
|
798
818
|
};
|
|
799
|
-
imports.wbg.
|
|
819
|
+
imports.wbg.__wbg_from_29a8414a7a7cd19d = function(arg0) {
|
|
800
820
|
const ret = Array.from(arg0);
|
|
801
821
|
return ret;
|
|
802
822
|
};
|
|
823
|
+
imports.wbg.__wbg_getRandomValues_1c61fac11405ffdc = function() { return handleError(function (arg0, arg1) {
|
|
824
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
825
|
+
}, arguments) };
|
|
803
826
|
imports.wbg.__wbg_getRandomValues_38a1ff1ea09f6cc7 = function() { return handleError(function (arg0, arg1) {
|
|
804
827
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
805
828
|
}, arguments) };
|
|
806
829
|
imports.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() { return handleError(function (arg0, arg1) {
|
|
807
830
|
arg0.getRandomValues(arg1);
|
|
808
831
|
}, arguments) };
|
|
809
|
-
imports.wbg.
|
|
832
|
+
imports.wbg.__wbg_getTime_ad1e9878a735af08 = function(arg0) {
|
|
810
833
|
const ret = arg0.getTime();
|
|
811
834
|
return ret;
|
|
812
835
|
};
|
|
813
|
-
imports.wbg.
|
|
836
|
+
imports.wbg.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
|
|
814
837
|
const ret = arg0[arg1 >>> 0];
|
|
815
838
|
return ret;
|
|
816
839
|
};
|
|
817
|
-
imports.wbg.
|
|
840
|
+
imports.wbg.__wbg_get_af9dab7e9603ea93 = function() { return handleError(function (arg0, arg1) {
|
|
818
841
|
const ret = Reflect.get(arg0, arg1);
|
|
819
842
|
return ret;
|
|
820
843
|
}, arguments) };
|
|
@@ -822,15 +845,15 @@ function __wbg_get_imports() {
|
|
|
822
845
|
const ret = arg0[arg1];
|
|
823
846
|
return ret;
|
|
824
847
|
};
|
|
825
|
-
imports.wbg.
|
|
848
|
+
imports.wbg.__wbg_has_0e670569d65d3a45 = function() { return handleError(function (arg0, arg1) {
|
|
826
849
|
const ret = Reflect.has(arg0, arg1);
|
|
827
850
|
return ret;
|
|
828
851
|
}, arguments) };
|
|
829
|
-
imports.wbg.
|
|
852
|
+
imports.wbg.__wbg_headers_654c30e1bcccc552 = function(arg0) {
|
|
830
853
|
const ret = arg0.headers;
|
|
831
854
|
return ret;
|
|
832
855
|
};
|
|
833
|
-
imports.wbg.
|
|
856
|
+
imports.wbg.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355 = function(arg0) {
|
|
834
857
|
let result;
|
|
835
858
|
try {
|
|
836
859
|
result = arg0 instanceof ArrayBuffer;
|
|
@@ -840,7 +863,7 @@ function __wbg_get_imports() {
|
|
|
840
863
|
const ret = result;
|
|
841
864
|
return ret;
|
|
842
865
|
};
|
|
843
|
-
imports.wbg.
|
|
866
|
+
imports.wbg.__wbg_instanceof_Map_084be8da74364158 = function(arg0) {
|
|
844
867
|
let result;
|
|
845
868
|
try {
|
|
846
869
|
result = arg0 instanceof Map;
|
|
@@ -850,7 +873,7 @@ function __wbg_get_imports() {
|
|
|
850
873
|
const ret = result;
|
|
851
874
|
return ret;
|
|
852
875
|
};
|
|
853
|
-
imports.wbg.
|
|
876
|
+
imports.wbg.__wbg_instanceof_Promise_eca6c43a2610558d = function(arg0) {
|
|
854
877
|
let result;
|
|
855
878
|
try {
|
|
856
879
|
result = arg0 instanceof Promise;
|
|
@@ -860,7 +883,7 @@ function __wbg_get_imports() {
|
|
|
860
883
|
const ret = result;
|
|
861
884
|
return ret;
|
|
862
885
|
};
|
|
863
|
-
imports.wbg.
|
|
886
|
+
imports.wbg.__wbg_instanceof_Response_cd74d1c2ac92cb0b = function(arg0) {
|
|
864
887
|
let result;
|
|
865
888
|
try {
|
|
866
889
|
result = arg0 instanceof Response;
|
|
@@ -870,7 +893,7 @@ function __wbg_get_imports() {
|
|
|
870
893
|
const ret = result;
|
|
871
894
|
return ret;
|
|
872
895
|
};
|
|
873
|
-
imports.wbg.
|
|
896
|
+
imports.wbg.__wbg_instanceof_Uint8Array_da54ccc9d3e09434 = function(arg0) {
|
|
874
897
|
let result;
|
|
875
898
|
try {
|
|
876
899
|
result = arg0 instanceof Uint8Array;
|
|
@@ -880,23 +903,23 @@ function __wbg_get_imports() {
|
|
|
880
903
|
const ret = result;
|
|
881
904
|
return ret;
|
|
882
905
|
};
|
|
883
|
-
imports.wbg.
|
|
906
|
+
imports.wbg.__wbg_isArray_51fd9e6422c0a395 = function(arg0) {
|
|
884
907
|
const ret = Array.isArray(arg0);
|
|
885
908
|
return ret;
|
|
886
909
|
};
|
|
887
|
-
imports.wbg.
|
|
910
|
+
imports.wbg.__wbg_isSafeInteger_ae7d3f054d55fa16 = function(arg0) {
|
|
888
911
|
const ret = Number.isSafeInteger(arg0);
|
|
889
912
|
return ret;
|
|
890
913
|
};
|
|
891
|
-
imports.wbg.
|
|
914
|
+
imports.wbg.__wbg_iterator_27b7c8b35ab3e86b = function() {
|
|
892
915
|
const ret = Symbol.iterator;
|
|
893
916
|
return ret;
|
|
894
917
|
};
|
|
895
|
-
imports.wbg.
|
|
918
|
+
imports.wbg.__wbg_length_22ac23eaec9d8053 = function(arg0) {
|
|
896
919
|
const ret = arg0.length;
|
|
897
920
|
return ret;
|
|
898
921
|
};
|
|
899
|
-
imports.wbg.
|
|
922
|
+
imports.wbg.__wbg_length_d45040a40c570362 = function(arg0) {
|
|
900
923
|
const ret = arg0.length;
|
|
901
924
|
return ret;
|
|
902
925
|
};
|
|
@@ -904,30 +927,54 @@ function __wbg_get_imports() {
|
|
|
904
927
|
const ret = arg0.msCrypto;
|
|
905
928
|
return ret;
|
|
906
929
|
};
|
|
907
|
-
imports.wbg.
|
|
930
|
+
imports.wbg.__wbg_new_0_23cedd11d9b40c9d = function() {
|
|
908
931
|
const ret = new Date();
|
|
909
932
|
return ret;
|
|
910
933
|
};
|
|
911
|
-
imports.wbg.
|
|
912
|
-
const ret = new
|
|
934
|
+
imports.wbg.__wbg_new_1ba21ce319a06297 = function() {
|
|
935
|
+
const ret = new Object();
|
|
936
|
+
return ret;
|
|
937
|
+
};
|
|
938
|
+
imports.wbg.__wbg_new_25f239778d6112b9 = function() {
|
|
939
|
+
const ret = new Array();
|
|
940
|
+
return ret;
|
|
941
|
+
};
|
|
942
|
+
imports.wbg.__wbg_new_3c79b3bb1b32b7d3 = function() { return handleError(function () {
|
|
943
|
+
const ret = new Headers();
|
|
913
944
|
return ret;
|
|
914
945
|
}, arguments) };
|
|
915
|
-
imports.wbg.
|
|
916
|
-
const ret = new
|
|
946
|
+
imports.wbg.__wbg_new_6421f6084cc5bc5a = function(arg0) {
|
|
947
|
+
const ret = new Uint8Array(arg0);
|
|
917
948
|
return ret;
|
|
918
949
|
};
|
|
919
|
-
imports.wbg.
|
|
950
|
+
imports.wbg.__wbg_new_881a222c65f168fc = function() { return handleError(function () {
|
|
920
951
|
const ret = new AbortController();
|
|
921
952
|
return ret;
|
|
922
953
|
}, arguments) };
|
|
923
|
-
imports.wbg.
|
|
954
|
+
imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
|
|
955
|
+
const ret = new Error();
|
|
956
|
+
return ret;
|
|
957
|
+
};
|
|
958
|
+
imports.wbg.__wbg_new_b546ae120718850e = function() {
|
|
959
|
+
const ret = new Map();
|
|
960
|
+
return ret;
|
|
961
|
+
};
|
|
962
|
+
imports.wbg.__wbg_new_bd4ee84941f474fa = function() { return handleError(function () {
|
|
963
|
+
const ret = new FileReaderSync();
|
|
964
|
+
return ret;
|
|
965
|
+
}, arguments) };
|
|
966
|
+
imports.wbg.__wbg_new_df1173567d5ff028 = function(arg0, arg1) {
|
|
967
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
968
|
+
return ret;
|
|
969
|
+
};
|
|
970
|
+
imports.wbg.__wbg_new_ff12d2b041fb48f1 = function(arg0, arg1) {
|
|
924
971
|
try {
|
|
925
972
|
var state0 = {a: arg0, b: arg1};
|
|
926
973
|
var cb0 = (arg0, arg1) => {
|
|
927
974
|
const a = state0.a;
|
|
928
975
|
state0.a = 0;
|
|
929
976
|
try {
|
|
930
|
-
return
|
|
977
|
+
return wasm_bindgen__convert__closures_____invoke__ha15b80997070ee79(a, state0.b, arg0, arg1);
|
|
931
978
|
} finally {
|
|
932
979
|
state0.a = a;
|
|
933
980
|
}
|
|
@@ -938,59 +985,35 @@ function __wbg_get_imports() {
|
|
|
938
985
|
state0.a = state0.b = 0;
|
|
939
986
|
}
|
|
940
987
|
};
|
|
941
|
-
imports.wbg.
|
|
942
|
-
const ret = new Uint8Array(arg0);
|
|
943
|
-
return ret;
|
|
944
|
-
};
|
|
945
|
-
imports.wbg.__wbg_new_68651c719dcda04e = function() {
|
|
946
|
-
const ret = new Map();
|
|
947
|
-
return ret;
|
|
948
|
-
};
|
|
949
|
-
imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
|
|
950
|
-
const ret = new Error();
|
|
951
|
-
return ret;
|
|
952
|
-
};
|
|
953
|
-
imports.wbg.__wbg_new_9edf9838a2def39c = function() { return handleError(function () {
|
|
954
|
-
const ret = new Headers();
|
|
955
|
-
return ret;
|
|
956
|
-
}, arguments) };
|
|
957
|
-
imports.wbg.__wbg_new_a7442b4b19c1a356 = function(arg0, arg1) {
|
|
958
|
-
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
959
|
-
return ret;
|
|
960
|
-
};
|
|
961
|
-
imports.wbg.__wbg_new_e17d9f43105b08be = function() {
|
|
962
|
-
const ret = new Array();
|
|
963
|
-
return ret;
|
|
964
|
-
};
|
|
965
|
-
imports.wbg.__wbg_new_from_slice_92f4d78ca282a2d2 = function(arg0, arg1) {
|
|
988
|
+
imports.wbg.__wbg_new_from_slice_f9c22b9153b26992 = function(arg0, arg1) {
|
|
966
989
|
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
967
990
|
return ret;
|
|
968
991
|
};
|
|
969
|
-
imports.wbg.
|
|
992
|
+
imports.wbg.__wbg_new_no_args_cb138f77cf6151ee = function(arg0, arg1) {
|
|
970
993
|
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
971
994
|
return ret;
|
|
972
995
|
};
|
|
973
|
-
imports.wbg.
|
|
996
|
+
imports.wbg.__wbg_new_with_length_aa5eaf41d35235e5 = function(arg0) {
|
|
974
997
|
const ret = new Uint8Array(arg0 >>> 0);
|
|
975
998
|
return ret;
|
|
976
999
|
};
|
|
977
|
-
imports.wbg.
|
|
1000
|
+
imports.wbg.__wbg_new_with_str_and_init_c5748f76f5108934 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
978
1001
|
const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
|
|
979
1002
|
return ret;
|
|
980
1003
|
}, arguments) };
|
|
981
|
-
imports.wbg.
|
|
982
|
-
const ret = arg0.next();
|
|
983
|
-
return ret;
|
|
984
|
-
}, arguments) };
|
|
985
|
-
imports.wbg.__wbg_next_2c826fe5dfec6b6a = function(arg0) {
|
|
1004
|
+
imports.wbg.__wbg_next_138a17bbf04e926c = function(arg0) {
|
|
986
1005
|
const ret = arg0.next;
|
|
987
1006
|
return ret;
|
|
988
1007
|
};
|
|
1008
|
+
imports.wbg.__wbg_next_3cfe5c0fe2a4cc53 = function() { return handleError(function (arg0) {
|
|
1009
|
+
const ret = arg0.next();
|
|
1010
|
+
return ret;
|
|
1011
|
+
}, arguments) };
|
|
989
1012
|
imports.wbg.__wbg_node_905d3e251edff8a2 = function(arg0) {
|
|
990
1013
|
const ret = arg0.node;
|
|
991
1014
|
return ret;
|
|
992
1015
|
};
|
|
993
|
-
imports.wbg.
|
|
1016
|
+
imports.wbg.__wbg_now_69d776cd24f5215b = function() {
|
|
994
1017
|
const ret = Date.now();
|
|
995
1018
|
return ret;
|
|
996
1019
|
};
|
|
@@ -998,20 +1021,20 @@ function __wbg_get_imports() {
|
|
|
998
1021
|
const ret = arg0.process;
|
|
999
1022
|
return ret;
|
|
1000
1023
|
};
|
|
1001
|
-
imports.wbg.
|
|
1024
|
+
imports.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
|
|
1002
1025
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
1003
1026
|
};
|
|
1004
|
-
imports.wbg.
|
|
1027
|
+
imports.wbg.__wbg_queueMicrotask_9b549dfce8865860 = function(arg0) {
|
|
1005
1028
|
const ret = arg0.queueMicrotask;
|
|
1006
1029
|
return ret;
|
|
1007
1030
|
};
|
|
1008
|
-
imports.wbg.
|
|
1031
|
+
imports.wbg.__wbg_queueMicrotask_fca69f5bfad613a5 = function(arg0) {
|
|
1009
1032
|
queueMicrotask(arg0);
|
|
1010
1033
|
};
|
|
1011
1034
|
imports.wbg.__wbg_randomFillSync_ac0988aba3254290 = function() { return handleError(function (arg0, arg1) {
|
|
1012
1035
|
arg0.randomFillSync(arg1);
|
|
1013
1036
|
}, arguments) };
|
|
1014
|
-
imports.wbg.
|
|
1037
|
+
imports.wbg.__wbg_readAsArrayBuffer_5a7ad12aa99daa2f = function() { return handleError(function (arg0, arg1) {
|
|
1015
1038
|
const ret = arg0.readAsArrayBuffer(arg1);
|
|
1016
1039
|
return ret;
|
|
1017
1040
|
}, arguments) };
|
|
@@ -1019,7 +1042,7 @@ function __wbg_get_imports() {
|
|
|
1019
1042
|
const ret = module.require;
|
|
1020
1043
|
return ret;
|
|
1021
1044
|
}, arguments) };
|
|
1022
|
-
imports.wbg.
|
|
1045
|
+
imports.wbg.__wbg_resolve_fd5bfbaa4ce36e1e = function(arg0) {
|
|
1023
1046
|
const ret = Promise.resolve(arg0);
|
|
1024
1047
|
return ret;
|
|
1025
1048
|
};
|
|
@@ -1027,49 +1050,49 @@ function __wbg_get_imports() {
|
|
|
1027
1050
|
const ret = setTimeout(arg0, arg1);
|
|
1028
1051
|
return ret;
|
|
1029
1052
|
};
|
|
1053
|
+
imports.wbg.__wbg_set_169e13b608078b7b = function(arg0, arg1, arg2) {
|
|
1054
|
+
arg0.set(getArrayU8FromWasm0(arg1, arg2));
|
|
1055
|
+
};
|
|
1030
1056
|
imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
|
1031
1057
|
arg0[arg1] = arg2;
|
|
1032
1058
|
};
|
|
1033
|
-
imports.wbg.
|
|
1034
|
-
|
|
1035
|
-
return ret;
|
|
1036
|
-
};
|
|
1037
|
-
imports.wbg.__wbg_set_9e6516df7b7d0f19 = function(arg0, arg1, arg2) {
|
|
1038
|
-
arg0.set(getArrayU8FromWasm0(arg1, arg2));
|
|
1059
|
+
imports.wbg.__wbg_set_7df433eea03a5c14 = function(arg0, arg1, arg2) {
|
|
1060
|
+
arg0[arg1 >>> 0] = arg2;
|
|
1039
1061
|
};
|
|
1040
|
-
imports.wbg.
|
|
1062
|
+
imports.wbg.__wbg_set_body_8e743242d6076a4f = function(arg0, arg1) {
|
|
1041
1063
|
arg0.body = arg1;
|
|
1042
1064
|
};
|
|
1043
|
-
imports.wbg.
|
|
1044
|
-
arg0[arg1 >>> 0] = arg2;
|
|
1045
|
-
};
|
|
1046
|
-
imports.wbg.__wbg_set_cache_2f9deb19b92b81e3 = function(arg0, arg1) {
|
|
1065
|
+
imports.wbg.__wbg_set_cache_0e437c7c8e838b9b = function(arg0, arg1) {
|
|
1047
1066
|
arg0.cache = __wbindgen_enum_RequestCache[arg1];
|
|
1048
1067
|
};
|
|
1049
|
-
imports.wbg.
|
|
1068
|
+
imports.wbg.__wbg_set_credentials_55ae7c3c106fd5be = function(arg0, arg1) {
|
|
1050
1069
|
arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
|
|
1051
1070
|
};
|
|
1052
|
-
imports.wbg.
|
|
1071
|
+
imports.wbg.__wbg_set_efaaf145b9377369 = function(arg0, arg1, arg2) {
|
|
1072
|
+
const ret = arg0.set(arg1, arg2);
|
|
1073
|
+
return ret;
|
|
1074
|
+
};
|
|
1075
|
+
imports.wbg.__wbg_set_headers_5671cf088e114d2b = function(arg0, arg1) {
|
|
1053
1076
|
arg0.headers = arg1;
|
|
1054
1077
|
};
|
|
1055
|
-
imports.wbg.
|
|
1078
|
+
imports.wbg.__wbg_set_method_76c69e41b3570627 = function(arg0, arg1, arg2) {
|
|
1056
1079
|
arg0.method = getStringFromWasm0(arg1, arg2);
|
|
1057
1080
|
};
|
|
1058
|
-
imports.wbg.
|
|
1081
|
+
imports.wbg.__wbg_set_mode_611016a6818fc690 = function(arg0, arg1) {
|
|
1059
1082
|
arg0.mode = __wbindgen_enum_RequestMode[arg1];
|
|
1060
1083
|
};
|
|
1061
|
-
imports.wbg.
|
|
1084
|
+
imports.wbg.__wbg_set_signal_e89be862d0091009 = function(arg0, arg1) {
|
|
1062
1085
|
arg0.signal = arg1;
|
|
1063
1086
|
};
|
|
1064
|
-
imports.wbg.
|
|
1087
|
+
imports.wbg.__wbg_signal_3c14fbdc89694b39 = function(arg0) {
|
|
1065
1088
|
const ret = arg0.signal;
|
|
1066
1089
|
return ret;
|
|
1067
1090
|
};
|
|
1068
|
-
imports.wbg.
|
|
1091
|
+
imports.wbg.__wbg_size_82fbdb656de23326 = function(arg0) {
|
|
1069
1092
|
const ret = arg0.size;
|
|
1070
1093
|
return ret;
|
|
1071
1094
|
};
|
|
1072
|
-
imports.wbg.
|
|
1095
|
+
imports.wbg.__wbg_slice_3518c924243cda3a = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1073
1096
|
const ret = arg0.slice(arg1, arg2);
|
|
1074
1097
|
return ret;
|
|
1075
1098
|
}, arguments) };
|
|
@@ -1080,54 +1103,54 @@ function __wbg_get_imports() {
|
|
|
1080
1103
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1081
1104
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1082
1105
|
};
|
|
1083
|
-
imports.wbg.
|
|
1106
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_769e6b65d6557335 = function() {
|
|
1084
1107
|
const ret = typeof global === 'undefined' ? null : global;
|
|
1085
1108
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1086
1109
|
};
|
|
1087
|
-
imports.wbg.
|
|
1110
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_THIS_60cf02db4de8e1c1 = function() {
|
|
1088
1111
|
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
1089
1112
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1090
1113
|
};
|
|
1091
|
-
imports.wbg.
|
|
1114
|
+
imports.wbg.__wbg_static_accessor_SELF_08f5a74c69739274 = function() {
|
|
1092
1115
|
const ret = typeof self === 'undefined' ? null : self;
|
|
1093
1116
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1094
1117
|
};
|
|
1095
|
-
imports.wbg.
|
|
1118
|
+
imports.wbg.__wbg_static_accessor_WINDOW_a8924b26aa92d024 = function() {
|
|
1096
1119
|
const ret = typeof window === 'undefined' ? null : window;
|
|
1097
1120
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1098
1121
|
};
|
|
1099
|
-
imports.wbg.
|
|
1122
|
+
imports.wbg.__wbg_status_9bfc680efca4bdfd = function(arg0) {
|
|
1100
1123
|
const ret = arg0.status;
|
|
1101
1124
|
return ret;
|
|
1102
1125
|
};
|
|
1103
|
-
imports.wbg.
|
|
1126
|
+
imports.wbg.__wbg_stringify_655a6390e1f5eb6b = function() { return handleError(function (arg0) {
|
|
1104
1127
|
const ret = JSON.stringify(arg0);
|
|
1105
1128
|
return ret;
|
|
1106
1129
|
}, arguments) };
|
|
1107
|
-
imports.wbg.
|
|
1130
|
+
imports.wbg.__wbg_subarray_845f2f5bce7d061a = function(arg0, arg1, arg2) {
|
|
1108
1131
|
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
1109
1132
|
return ret;
|
|
1110
1133
|
};
|
|
1111
|
-
imports.wbg.
|
|
1112
|
-
const ret = arg0.then(arg1);
|
|
1134
|
+
imports.wbg.__wbg_then_429f7caf1026411d = function(arg0, arg1, arg2) {
|
|
1135
|
+
const ret = arg0.then(arg1, arg2);
|
|
1113
1136
|
return ret;
|
|
1114
1137
|
};
|
|
1115
|
-
imports.wbg.
|
|
1116
|
-
const ret = arg0.then(arg1
|
|
1138
|
+
imports.wbg.__wbg_then_4f95312d68691235 = function(arg0, arg1) {
|
|
1139
|
+
const ret = arg0.then(arg1);
|
|
1117
1140
|
return ret;
|
|
1118
1141
|
};
|
|
1119
|
-
imports.wbg.
|
|
1142
|
+
imports.wbg.__wbg_url_b6d11838a4f95198 = function(arg0, arg1) {
|
|
1120
1143
|
const ret = arg1.url;
|
|
1121
1144
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1122
1145
|
const len1 = WASM_VECTOR_LEN;
|
|
1123
1146
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1124
1147
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1125
1148
|
};
|
|
1126
|
-
imports.wbg.
|
|
1149
|
+
imports.wbg.__wbg_valueOf_17c63ed1b225597a = function(arg0) {
|
|
1127
1150
|
const ret = arg0.valueOf();
|
|
1128
1151
|
return ret;
|
|
1129
1152
|
};
|
|
1130
|
-
imports.wbg.
|
|
1153
|
+
imports.wbg.__wbg_value_57b7b035e117f7ee = function(arg0) {
|
|
1131
1154
|
const ret = arg0.value;
|
|
1132
1155
|
return ret;
|
|
1133
1156
|
};
|
|
@@ -1149,16 +1172,21 @@ function __wbg_get_imports() {
|
|
|
1149
1172
|
const ret = (BigInt.asUintN(64, arg0) | (arg1 << BigInt(64)));
|
|
1150
1173
|
return ret;
|
|
1151
1174
|
};
|
|
1152
|
-
imports.wbg.__wbindgen_cast_3f8afe4d69afce15 = function(arg0, arg1) {
|
|
1153
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 1274, function: Function { arguments: [Externref], shim_idx: 1285, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1154
|
-
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h4e2af4dd32e0f9a7, wasm_bindgen__convert__closures_____invoke__hedbe22ff1e6181ec);
|
|
1155
|
-
return ret;
|
|
1156
|
-
};
|
|
1157
1175
|
imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
1158
1176
|
// Cast intrinsic for `U64 -> Externref`.
|
|
1159
1177
|
const ret = BigInt.asUintN(64, arg0);
|
|
1160
1178
|
return ret;
|
|
1161
1179
|
};
|
|
1180
|
+
imports.wbg.__wbindgen_cast_64ef26ec64f5f42c = function(arg0, arg1) {
|
|
1181
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1274, function: Function { arguments: [], shim_idx: 1275, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1182
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h4cef5599c1857d46, wasm_bindgen__convert__closures_____invoke__hbb62da5b17229099);
|
|
1183
|
+
return ret;
|
|
1184
|
+
};
|
|
1185
|
+
imports.wbg.__wbindgen_cast_72eba34e55316203 = function(arg0, arg1) {
|
|
1186
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1277, function: Function { arguments: [Externref], shim_idx: 1278, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1187
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h1529e0ff12464e8c, wasm_bindgen__convert__closures_____invoke__h6e57fd9fec4e535c);
|
|
1188
|
+
return ret;
|
|
1189
|
+
};
|
|
1162
1190
|
imports.wbg.__wbindgen_cast_77bc3e92745e9a35 = function(arg0, arg1) {
|
|
1163
1191
|
var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
|
|
1164
1192
|
wasm.__wbindgen_free(arg0, arg1 * 1, 1);
|
|
@@ -1181,11 +1209,6 @@ function __wbg_get_imports() {
|
|
|
1181
1209
|
const ret = arg0;
|
|
1182
1210
|
return ret;
|
|
1183
1211
|
};
|
|
1184
|
-
imports.wbg.__wbindgen_cast_eea71553507a2f52 = function(arg0, arg1) {
|
|
1185
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 1266, function: Function { arguments: [], shim_idx: 1267, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1186
|
-
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h3685db4568587cc8, wasm_bindgen__convert__closures_____invoke__hbb73f02d9cb5eeb0);
|
|
1187
|
-
return ret;
|
|
1188
|
-
};
|
|
1189
1212
|
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
1190
1213
|
const table = wasm.__wbindgen_externrefs;
|
|
1191
1214
|
const offset = table.grow(4);
|
|
@@ -1194,7 +1217,6 @@ function __wbg_get_imports() {
|
|
|
1194
1217
|
table.set(offset + 1, null);
|
|
1195
1218
|
table.set(offset + 2, true);
|
|
1196
1219
|
table.set(offset + 3, false);
|
|
1197
|
-
;
|
|
1198
1220
|
};
|
|
1199
1221
|
|
|
1200
1222
|
return imports;
|
|
@@ -1224,13 +1246,10 @@ function initSync(module) {
|
|
|
1224
1246
|
}
|
|
1225
1247
|
|
|
1226
1248
|
const imports = __wbg_get_imports();
|
|
1227
|
-
|
|
1228
1249
|
if (!(module instanceof WebAssembly.Module)) {
|
|
1229
1250
|
module = new WebAssembly.Module(module);
|
|
1230
1251
|
}
|
|
1231
|
-
|
|
1232
1252
|
const instance = new WebAssembly.Instance(module, imports);
|
|
1233
|
-
|
|
1234
1253
|
return __wbg_finalize_init(instance, module);
|
|
1235
1254
|
}
|
|
1236
1255
|
|
|
@@ -1260,4 +1279,4 @@ async function __wbg_init(module_or_path) {
|
|
|
1260
1279
|
|
|
1261
1280
|
export { initSync };
|
|
1262
1281
|
export default __wbg_init;
|
|
1263
|
-
export const WASM_SRI = "sha512-
|
|
1282
|
+
export const WASM_SRI = "sha512-fv1B1BIidzRL6nbH1VGEzrOgV11YILPbAPmbiDp6oA9S5s5Y1Wo5UfHueeDihW+gQkBqx18+Exy0lmMd1DUtLw==";
|