@stll/anonymize-wasm 2.4.2 → 2.6.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/README.md +11 -20
- package/dist/native/index.js +1785 -0
- package/dist/native/{index.wasm32-wasi.wasm → index_bg.wasm} +0 -0
- package/dist/vite.d.mts +1 -1
- package/dist/vite.mjs +3 -3
- package/dist/vite.mjs.map +1 -1
- package/dist/wasm.d.mts +80 -72
- package/dist/wasm.mjs +239 -106
- package/dist/wasm.mjs.map +1 -1
- package/package.json +1 -4
- package/dist/native/index.wasi-browser.js +0 -12020
- package/dist/native/index.wasi.cjs +0 -132
- package/dist/native/wasi-worker-browser.mjs +0 -10766
- package/dist/native/wasi-worker.mjs +0 -63
|
@@ -0,0 +1,1785 @@
|
|
|
1
|
+
export class WasmDocumentRewriteResult {
|
|
2
|
+
static __wrap(ptr) {
|
|
3
|
+
const obj = Object.create(WasmDocumentRewriteResult.prototype);
|
|
4
|
+
obj.__wbg_ptr = ptr;
|
|
5
|
+
WasmDocumentRewriteResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
6
|
+
return obj;
|
|
7
|
+
}
|
|
8
|
+
__destroy_into_raw() {
|
|
9
|
+
const ptr = this.__wbg_ptr;
|
|
10
|
+
this.__wbg_ptr = 0;
|
|
11
|
+
WasmDocumentRewriteResultFinalization.unregister(this);
|
|
12
|
+
return ptr;
|
|
13
|
+
}
|
|
14
|
+
free() {
|
|
15
|
+
const ptr = this.__destroy_into_raw();
|
|
16
|
+
wasm.__wbg_wasmdocumentrewriteresult_free(ptr, 0);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* @returns {number}
|
|
20
|
+
*/
|
|
21
|
+
get appliedReplacementCount() {
|
|
22
|
+
const ret = wasm.wasmdocumentrewriteresult_appliedReplacementCount(this.__wbg_ptr);
|
|
23
|
+
return ret >>> 0;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @returns {Uint8Array}
|
|
27
|
+
*/
|
|
28
|
+
get document() {
|
|
29
|
+
const ret = wasm.wasmdocumentrewriteresult_document(this.__wbg_ptr);
|
|
30
|
+
return takeObject(ret);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @returns {number}
|
|
34
|
+
*/
|
|
35
|
+
get rewrittenBlockCount() {
|
|
36
|
+
const ret = wasm.wasmdocumentrewriteresult_rewrittenBlockCount(this.__wbg_ptr);
|
|
37
|
+
return ret >>> 0;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (Symbol.dispose) WasmDocumentRewriteResult.prototype[Symbol.dispose] = WasmDocumentRewriteResult.prototype.free;
|
|
41
|
+
|
|
42
|
+
export class WasmPdfRasterResult {
|
|
43
|
+
static __wrap(ptr) {
|
|
44
|
+
const obj = Object.create(WasmPdfRasterResult.prototype);
|
|
45
|
+
obj.__wbg_ptr = ptr;
|
|
46
|
+
WasmPdfRasterResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
47
|
+
return obj;
|
|
48
|
+
}
|
|
49
|
+
__destroy_into_raw() {
|
|
50
|
+
const ptr = this.__wbg_ptr;
|
|
51
|
+
this.__wbg_ptr = 0;
|
|
52
|
+
WasmPdfRasterResultFinalization.unregister(this);
|
|
53
|
+
return ptr;
|
|
54
|
+
}
|
|
55
|
+
free() {
|
|
56
|
+
const ptr = this.__destroy_into_raw();
|
|
57
|
+
wasm.__wbg_wasmpdfrasterresult_free(ptr, 0);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* @returns {string}
|
|
61
|
+
*/
|
|
62
|
+
get certificateJson() {
|
|
63
|
+
let deferred1_0;
|
|
64
|
+
let deferred1_1;
|
|
65
|
+
try {
|
|
66
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
67
|
+
wasm.wasmpdfrasterresult_certificateJson(retptr, this.__wbg_ptr);
|
|
68
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
69
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
70
|
+
deferred1_0 = r0;
|
|
71
|
+
deferred1_1 = r1;
|
|
72
|
+
return getStringFromWasm0(r0, r1);
|
|
73
|
+
} finally {
|
|
74
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
75
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* @returns {Uint8Array}
|
|
80
|
+
*/
|
|
81
|
+
get document() {
|
|
82
|
+
const ret = wasm.wasmpdfrasterresult_document(this.__wbg_ptr);
|
|
83
|
+
return takeObject(ret);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (Symbol.dispose) WasmPdfRasterResult.prototype[Symbol.dispose] = WasmPdfRasterResult.prototype.free;
|
|
87
|
+
|
|
88
|
+
export class WasmPreparedRedactionSession {
|
|
89
|
+
static __wrap(ptr) {
|
|
90
|
+
const obj = Object.create(WasmPreparedRedactionSession.prototype);
|
|
91
|
+
obj.__wbg_ptr = ptr;
|
|
92
|
+
WasmPreparedRedactionSessionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
93
|
+
return obj;
|
|
94
|
+
}
|
|
95
|
+
__destroy_into_raw() {
|
|
96
|
+
const ptr = this.__wbg_ptr;
|
|
97
|
+
this.__wbg_ptr = 0;
|
|
98
|
+
WasmPreparedRedactionSessionFinalization.unregister(this);
|
|
99
|
+
return ptr;
|
|
100
|
+
}
|
|
101
|
+
free() {
|
|
102
|
+
const ptr = this.__destroy_into_raw();
|
|
103
|
+
wasm.__wbg_wasmpreparedredactionsession_free(ptr, 0);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* @returns {string}
|
|
107
|
+
*/
|
|
108
|
+
deleteJson() {
|
|
109
|
+
let deferred2_0;
|
|
110
|
+
let deferred2_1;
|
|
111
|
+
try {
|
|
112
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
113
|
+
wasm.wasmpreparedredactionsession_deleteJson(retptr, this.__wbg_ptr);
|
|
114
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
115
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
116
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
117
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
118
|
+
var ptr1 = r0;
|
|
119
|
+
var len1 = r1;
|
|
120
|
+
if (r3) {
|
|
121
|
+
ptr1 = 0; len1 = 0;
|
|
122
|
+
throw takeObject(r2);
|
|
123
|
+
}
|
|
124
|
+
deferred2_0 = ptr1;
|
|
125
|
+
deferred2_1 = len1;
|
|
126
|
+
return getStringFromWasm0(ptr1, len1);
|
|
127
|
+
} finally {
|
|
128
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
129
|
+
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* @param {number | null} [observed_at_epoch_seconds]
|
|
134
|
+
* @returns {string}
|
|
135
|
+
*/
|
|
136
|
+
inspectJson(observed_at_epoch_seconds) {
|
|
137
|
+
let deferred2_0;
|
|
138
|
+
let deferred2_1;
|
|
139
|
+
try {
|
|
140
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
141
|
+
wasm.wasmpreparedredactionsession_inspectJson(retptr, this.__wbg_ptr, isLikeNone(observed_at_epoch_seconds) ? Number.MAX_SAFE_INTEGER : (observed_at_epoch_seconds) >>> 0);
|
|
142
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
143
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
144
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
145
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
146
|
+
var ptr1 = r0;
|
|
147
|
+
var len1 = r1;
|
|
148
|
+
if (r3) {
|
|
149
|
+
ptr1 = 0; len1 = 0;
|
|
150
|
+
throw takeObject(r2);
|
|
151
|
+
}
|
|
152
|
+
deferred2_0 = ptr1;
|
|
153
|
+
deferred2_1 = len1;
|
|
154
|
+
return getStringFromWasm0(ptr1, len1);
|
|
155
|
+
} finally {
|
|
156
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
157
|
+
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* @returns {number}
|
|
162
|
+
*/
|
|
163
|
+
mappingCount() {
|
|
164
|
+
try {
|
|
165
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
166
|
+
wasm.wasmpreparedredactionsession_mappingCount(retptr, this.__wbg_ptr);
|
|
167
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
168
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
169
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
170
|
+
if (r2) {
|
|
171
|
+
throw takeObject(r1);
|
|
172
|
+
}
|
|
173
|
+
return r0 >>> 0;
|
|
174
|
+
} finally {
|
|
175
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* @param {string} inputs_json
|
|
180
|
+
* @param {string | null} [operators_json]
|
|
181
|
+
* @param {number | null} [observed_at_epoch_seconds]
|
|
182
|
+
* @returns {WasmPreparedSessionRedactionPlan}
|
|
183
|
+
*/
|
|
184
|
+
planStaticEntitiesWithCallerDetections(inputs_json, operators_json, observed_at_epoch_seconds) {
|
|
185
|
+
try {
|
|
186
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
187
|
+
const ptr0 = passStringToWasm0(inputs_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
188
|
+
const len0 = WASM_VECTOR_LEN;
|
|
189
|
+
var ptr1 = isLikeNone(operators_json) ? 0 : passStringToWasm0(operators_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
190
|
+
var len1 = WASM_VECTOR_LEN;
|
|
191
|
+
wasm.wasmpreparedredactionsession_planStaticEntitiesWithCallerDetections(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(observed_at_epoch_seconds) ? Number.MAX_SAFE_INTEGER : (observed_at_epoch_seconds) >>> 0);
|
|
192
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
193
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
194
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
195
|
+
if (r2) {
|
|
196
|
+
throw takeObject(r1);
|
|
197
|
+
}
|
|
198
|
+
return WasmPreparedSessionRedactionPlan.__wrap(r0);
|
|
199
|
+
} finally {
|
|
200
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* @param {string} full_text
|
|
205
|
+
* @param {string | null} [operators_json]
|
|
206
|
+
* @returns {string}
|
|
207
|
+
*/
|
|
208
|
+
redactStaticEntitiesJson(full_text, operators_json) {
|
|
209
|
+
let deferred4_0;
|
|
210
|
+
let deferred4_1;
|
|
211
|
+
try {
|
|
212
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
213
|
+
const ptr0 = passStringToWasm0(full_text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
214
|
+
const len0 = WASM_VECTOR_LEN;
|
|
215
|
+
var ptr1 = isLikeNone(operators_json) ? 0 : passStringToWasm0(operators_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
216
|
+
var len1 = WASM_VECTOR_LEN;
|
|
217
|
+
wasm.wasmpreparedredactionsession_redactStaticEntitiesJson(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
218
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
219
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
220
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
221
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
222
|
+
var ptr3 = r0;
|
|
223
|
+
var len3 = r1;
|
|
224
|
+
if (r3) {
|
|
225
|
+
ptr3 = 0; len3 = 0;
|
|
226
|
+
throw takeObject(r2);
|
|
227
|
+
}
|
|
228
|
+
deferred4_0 = ptr3;
|
|
229
|
+
deferred4_1 = len3;
|
|
230
|
+
return getStringFromWasm0(ptr3, len3);
|
|
231
|
+
} finally {
|
|
232
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
233
|
+
wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* @param {string} full_text
|
|
238
|
+
* @param {number} observed_at_epoch_seconds
|
|
239
|
+
* @param {string | null} [operators_json]
|
|
240
|
+
* @returns {string}
|
|
241
|
+
*/
|
|
242
|
+
redactStaticEntitiesJsonAt(full_text, observed_at_epoch_seconds, operators_json) {
|
|
243
|
+
let deferred4_0;
|
|
244
|
+
let deferred4_1;
|
|
245
|
+
try {
|
|
246
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
247
|
+
const ptr0 = passStringToWasm0(full_text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
248
|
+
const len0 = WASM_VECTOR_LEN;
|
|
249
|
+
var ptr1 = isLikeNone(operators_json) ? 0 : passStringToWasm0(operators_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
250
|
+
var len1 = WASM_VECTOR_LEN;
|
|
251
|
+
wasm.wasmpreparedredactionsession_redactStaticEntitiesJsonAt(retptr, this.__wbg_ptr, ptr0, len0, observed_at_epoch_seconds, ptr1, len1);
|
|
252
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
253
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
254
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
255
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
256
|
+
var ptr3 = r0;
|
|
257
|
+
var len3 = r1;
|
|
258
|
+
if (r3) {
|
|
259
|
+
ptr3 = 0; len3 = 0;
|
|
260
|
+
throw takeObject(r2);
|
|
261
|
+
}
|
|
262
|
+
deferred4_0 = ptr3;
|
|
263
|
+
deferred4_1 = len3;
|
|
264
|
+
return getStringFromWasm0(ptr3, len3);
|
|
265
|
+
} finally {
|
|
266
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
267
|
+
wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* @param {string} full_text
|
|
272
|
+
* @returns {string}
|
|
273
|
+
*/
|
|
274
|
+
restoreText(full_text) {
|
|
275
|
+
let deferred3_0;
|
|
276
|
+
let deferred3_1;
|
|
277
|
+
try {
|
|
278
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
279
|
+
const ptr0 = passStringToWasm0(full_text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
280
|
+
const len0 = WASM_VECTOR_LEN;
|
|
281
|
+
wasm.wasmpreparedredactionsession_restoreText(retptr, this.__wbg_ptr, ptr0, len0);
|
|
282
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
283
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
284
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
285
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
286
|
+
var ptr2 = r0;
|
|
287
|
+
var len2 = r1;
|
|
288
|
+
if (r3) {
|
|
289
|
+
ptr2 = 0; len2 = 0;
|
|
290
|
+
throw takeObject(r2);
|
|
291
|
+
}
|
|
292
|
+
deferred3_0 = ptr2;
|
|
293
|
+
deferred3_1 = len2;
|
|
294
|
+
return getStringFromWasm0(ptr2, len2);
|
|
295
|
+
} finally {
|
|
296
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
297
|
+
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* @param {string} full_text
|
|
302
|
+
* @param {number} observed_at_epoch_seconds
|
|
303
|
+
* @returns {string}
|
|
304
|
+
*/
|
|
305
|
+
restoreTextAt(full_text, observed_at_epoch_seconds) {
|
|
306
|
+
let deferred3_0;
|
|
307
|
+
let deferred3_1;
|
|
308
|
+
try {
|
|
309
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
310
|
+
const ptr0 = passStringToWasm0(full_text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
311
|
+
const len0 = WASM_VECTOR_LEN;
|
|
312
|
+
wasm.wasmpreparedredactionsession_restoreTextAt(retptr, this.__wbg_ptr, ptr0, len0, observed_at_epoch_seconds);
|
|
313
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
314
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
315
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
316
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
317
|
+
var ptr2 = r0;
|
|
318
|
+
var len2 = r1;
|
|
319
|
+
if (r3) {
|
|
320
|
+
ptr2 = 0; len2 = 0;
|
|
321
|
+
throw takeObject(r2);
|
|
322
|
+
}
|
|
323
|
+
deferred3_0 = ptr2;
|
|
324
|
+
deferred3_1 = len2;
|
|
325
|
+
return getStringFromWasm0(ptr2, len2);
|
|
326
|
+
} finally {
|
|
327
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
328
|
+
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* @returns {string}
|
|
333
|
+
*/
|
|
334
|
+
sessionId() {
|
|
335
|
+
let deferred1_0;
|
|
336
|
+
let deferred1_1;
|
|
337
|
+
try {
|
|
338
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
339
|
+
wasm.wasmpreparedredactionsession_sessionId(retptr, this.__wbg_ptr);
|
|
340
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
341
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
342
|
+
deferred1_0 = r0;
|
|
343
|
+
deferred1_1 = r1;
|
|
344
|
+
return getStringFromWasm0(r0, r1);
|
|
345
|
+
} finally {
|
|
346
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
347
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* @param {Uint8Array} key
|
|
352
|
+
* @returns {Uint8Array}
|
|
353
|
+
*/
|
|
354
|
+
toEncryptedArchive(key) {
|
|
355
|
+
try {
|
|
356
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
357
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_export);
|
|
358
|
+
const len0 = WASM_VECTOR_LEN;
|
|
359
|
+
wasm.wasmpreparedredactionsession_toEncryptedArchive(retptr, this.__wbg_ptr, ptr0, len0);
|
|
360
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
361
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
362
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
363
|
+
if (r2) {
|
|
364
|
+
throw takeObject(r1);
|
|
365
|
+
}
|
|
366
|
+
return takeObject(r0);
|
|
367
|
+
} finally {
|
|
368
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* @param {Uint8Array} key
|
|
373
|
+
* @param {number} observed_at_epoch_seconds
|
|
374
|
+
* @returns {Uint8Array}
|
|
375
|
+
*/
|
|
376
|
+
toEncryptedArchiveAt(key, observed_at_epoch_seconds) {
|
|
377
|
+
try {
|
|
378
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
379
|
+
const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_export);
|
|
380
|
+
const len0 = WASM_VECTOR_LEN;
|
|
381
|
+
wasm.wasmpreparedredactionsession_toEncryptedArchiveAt(retptr, this.__wbg_ptr, ptr0, len0, observed_at_epoch_seconds);
|
|
382
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
383
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
384
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
385
|
+
if (r2) {
|
|
386
|
+
throw takeObject(r1);
|
|
387
|
+
}
|
|
388
|
+
return takeObject(r0);
|
|
389
|
+
} finally {
|
|
390
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* @returns {string}
|
|
395
|
+
*/
|
|
396
|
+
toPlaintextJson() {
|
|
397
|
+
let deferred2_0;
|
|
398
|
+
let deferred2_1;
|
|
399
|
+
try {
|
|
400
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
401
|
+
wasm.wasmpreparedredactionsession_toPlaintextJson(retptr, this.__wbg_ptr);
|
|
402
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
403
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
404
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
405
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
406
|
+
var ptr1 = r0;
|
|
407
|
+
var len1 = r1;
|
|
408
|
+
if (r3) {
|
|
409
|
+
ptr1 = 0; len1 = 0;
|
|
410
|
+
throw takeObject(r2);
|
|
411
|
+
}
|
|
412
|
+
deferred2_0 = ptr1;
|
|
413
|
+
deferred2_1 = len1;
|
|
414
|
+
return getStringFromWasm0(ptr1, len1);
|
|
415
|
+
} finally {
|
|
416
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
417
|
+
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* @param {number} observed_at_epoch_seconds
|
|
422
|
+
* @returns {string}
|
|
423
|
+
*/
|
|
424
|
+
toPlaintextJsonAt(observed_at_epoch_seconds) {
|
|
425
|
+
let deferred2_0;
|
|
426
|
+
let deferred2_1;
|
|
427
|
+
try {
|
|
428
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
429
|
+
wasm.wasmpreparedredactionsession_toPlaintextJsonAt(retptr, this.__wbg_ptr, observed_at_epoch_seconds);
|
|
430
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
431
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
432
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
433
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
434
|
+
var ptr1 = r0;
|
|
435
|
+
var len1 = r1;
|
|
436
|
+
if (r3) {
|
|
437
|
+
ptr1 = 0; len1 = 0;
|
|
438
|
+
throw takeObject(r2);
|
|
439
|
+
}
|
|
440
|
+
deferred2_0 = ptr1;
|
|
441
|
+
deferred2_1 = len1;
|
|
442
|
+
return getStringFromWasm0(ptr1, len1);
|
|
443
|
+
} finally {
|
|
444
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
445
|
+
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
if (Symbol.dispose) WasmPreparedRedactionSession.prototype[Symbol.dispose] = WasmPreparedRedactionSession.prototype.free;
|
|
450
|
+
|
|
451
|
+
export class WasmPreparedSearch {
|
|
452
|
+
static __wrap(ptr) {
|
|
453
|
+
const obj = Object.create(WasmPreparedSearch.prototype);
|
|
454
|
+
obj.__wbg_ptr = ptr;
|
|
455
|
+
WasmPreparedSearchFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
456
|
+
return obj;
|
|
457
|
+
}
|
|
458
|
+
__destroy_into_raw() {
|
|
459
|
+
const ptr = this.__wbg_ptr;
|
|
460
|
+
this.__wbg_ptr = 0;
|
|
461
|
+
WasmPreparedSearchFinalization.unregister(this);
|
|
462
|
+
return ptr;
|
|
463
|
+
}
|
|
464
|
+
free() {
|
|
465
|
+
const ptr = this.__destroy_into_raw();
|
|
466
|
+
wasm.__wbg_wasmpreparedsearch_free(ptr, 0);
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* @param {string} session_id
|
|
470
|
+
* @returns {WasmPreparedRedactionSession}
|
|
471
|
+
*/
|
|
472
|
+
createRedactionSession(session_id) {
|
|
473
|
+
try {
|
|
474
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
475
|
+
const ptr0 = passStringToWasm0(session_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
476
|
+
const len0 = WASM_VECTOR_LEN;
|
|
477
|
+
wasm.wasmpreparedsearch_createRedactionSession(retptr, this.__wbg_ptr, ptr0, len0);
|
|
478
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
479
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
480
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
481
|
+
if (r2) {
|
|
482
|
+
throw takeObject(r1);
|
|
483
|
+
}
|
|
484
|
+
return WasmPreparedRedactionSession.__wrap(r0);
|
|
485
|
+
} finally {
|
|
486
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* @param {string} session_id
|
|
491
|
+
* @param {number} created_at_epoch_seconds
|
|
492
|
+
* @param {number | null} [expires_at_epoch_seconds]
|
|
493
|
+
* @returns {WasmPreparedRedactionSession}
|
|
494
|
+
*/
|
|
495
|
+
createRedactionSessionWithLifecycle(session_id, created_at_epoch_seconds, expires_at_epoch_seconds) {
|
|
496
|
+
try {
|
|
497
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
498
|
+
const ptr0 = passStringToWasm0(session_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
499
|
+
const len0 = WASM_VECTOR_LEN;
|
|
500
|
+
wasm.wasmpreparedsearch_createRedactionSessionWithLifecycle(retptr, this.__wbg_ptr, ptr0, len0, created_at_epoch_seconds, isLikeNone(expires_at_epoch_seconds) ? Number.MAX_SAFE_INTEGER : (expires_at_epoch_seconds) >>> 0);
|
|
501
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
502
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
503
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
504
|
+
if (r2) {
|
|
505
|
+
throw takeObject(r1);
|
|
506
|
+
}
|
|
507
|
+
return WasmPreparedRedactionSession.__wrap(r0);
|
|
508
|
+
} finally {
|
|
509
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
/**
|
|
513
|
+
* @param {Uint8Array} config_json
|
|
514
|
+
* @returns {WasmPreparedSearch}
|
|
515
|
+
*/
|
|
516
|
+
static fromConfigJsonBytes(config_json) {
|
|
517
|
+
try {
|
|
518
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
519
|
+
const ptr0 = passArray8ToWasm0(config_json, wasm.__wbindgen_export);
|
|
520
|
+
const len0 = WASM_VECTOR_LEN;
|
|
521
|
+
wasm.wasmpreparedsearch_fromConfigJsonBytes(retptr, ptr0, len0);
|
|
522
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
523
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
524
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
525
|
+
if (r2) {
|
|
526
|
+
throw takeObject(r1);
|
|
527
|
+
}
|
|
528
|
+
return WasmPreparedSearch.__wrap(r0);
|
|
529
|
+
} finally {
|
|
530
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* @param {Uint8Array} package_bytes
|
|
535
|
+
* @returns {WasmPreparedSearch}
|
|
536
|
+
*/
|
|
537
|
+
static fromPreparedPackageBytes(package_bytes) {
|
|
538
|
+
try {
|
|
539
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
540
|
+
const ptr0 = passArray8ToWasm0(package_bytes, wasm.__wbindgen_export);
|
|
541
|
+
const len0 = WASM_VECTOR_LEN;
|
|
542
|
+
wasm.wasmpreparedsearch_fromPreparedPackageBytes(retptr, ptr0, len0);
|
|
543
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
544
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
545
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
546
|
+
if (r2) {
|
|
547
|
+
throw takeObject(r1);
|
|
548
|
+
}
|
|
549
|
+
return WasmPreparedSearch.__wrap(r0);
|
|
550
|
+
} finally {
|
|
551
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* @param {Uint8Array} package_bytes
|
|
556
|
+
* @returns {WasmPreparedSearch}
|
|
557
|
+
*/
|
|
558
|
+
static fromTrustedPreparedPackageBytes(package_bytes) {
|
|
559
|
+
try {
|
|
560
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
561
|
+
const ptr0 = passArray8ToWasm0(package_bytes, wasm.__wbindgen_export);
|
|
562
|
+
const len0 = WASM_VECTOR_LEN;
|
|
563
|
+
wasm.wasmpreparedsearch_fromTrustedPreparedPackageBytes(retptr, ptr0, len0);
|
|
564
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
565
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
566
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
567
|
+
if (r2) {
|
|
568
|
+
throw takeObject(r1);
|
|
569
|
+
}
|
|
570
|
+
return WasmPreparedSearch.__wrap(r0);
|
|
571
|
+
} finally {
|
|
572
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* @returns {string}
|
|
577
|
+
*/
|
|
578
|
+
prepareDiagnosticsJson() {
|
|
579
|
+
let deferred2_0;
|
|
580
|
+
let deferred2_1;
|
|
581
|
+
try {
|
|
582
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
583
|
+
wasm.wasmpreparedsearch_prepareDiagnosticsJson(retptr, this.__wbg_ptr);
|
|
584
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
585
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
586
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
587
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
588
|
+
var ptr1 = r0;
|
|
589
|
+
var len1 = r1;
|
|
590
|
+
if (r3) {
|
|
591
|
+
ptr1 = 0; len1 = 0;
|
|
592
|
+
throw takeObject(r2);
|
|
593
|
+
}
|
|
594
|
+
deferred2_0 = ptr1;
|
|
595
|
+
deferred2_1 = len1;
|
|
596
|
+
return getStringFromWasm0(ptr1, len1);
|
|
597
|
+
} finally {
|
|
598
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
599
|
+
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* @param {string} full_text
|
|
604
|
+
* @param {string | null} [operators_json]
|
|
605
|
+
* @returns {string}
|
|
606
|
+
*/
|
|
607
|
+
redactStaticEntitiesDiagnosticsJson(full_text, operators_json) {
|
|
608
|
+
let deferred4_0;
|
|
609
|
+
let deferred4_1;
|
|
610
|
+
try {
|
|
611
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
612
|
+
const ptr0 = passStringToWasm0(full_text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
613
|
+
const len0 = WASM_VECTOR_LEN;
|
|
614
|
+
var ptr1 = isLikeNone(operators_json) ? 0 : passStringToWasm0(operators_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
615
|
+
var len1 = WASM_VECTOR_LEN;
|
|
616
|
+
wasm.wasmpreparedsearch_redactStaticEntitiesDiagnosticsJson(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
617
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
618
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
619
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
620
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
621
|
+
var ptr3 = r0;
|
|
622
|
+
var len3 = r1;
|
|
623
|
+
if (r3) {
|
|
624
|
+
ptr3 = 0; len3 = 0;
|
|
625
|
+
throw takeObject(r2);
|
|
626
|
+
}
|
|
627
|
+
deferred4_0 = ptr3;
|
|
628
|
+
deferred4_1 = len3;
|
|
629
|
+
return getStringFromWasm0(ptr3, len3);
|
|
630
|
+
} finally {
|
|
631
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
632
|
+
wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
/**
|
|
636
|
+
* @param {string} full_text
|
|
637
|
+
* @param {string | null | undefined} operators_json
|
|
638
|
+
* @param {Function} on_batch
|
|
639
|
+
* @returns {string}
|
|
640
|
+
*/
|
|
641
|
+
redactStaticEntitiesDiagnosticsStreamJson(full_text, operators_json, on_batch) {
|
|
642
|
+
let deferred4_0;
|
|
643
|
+
let deferred4_1;
|
|
644
|
+
try {
|
|
645
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
646
|
+
const ptr0 = passStringToWasm0(full_text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
647
|
+
const len0 = WASM_VECTOR_LEN;
|
|
648
|
+
var ptr1 = isLikeNone(operators_json) ? 0 : passStringToWasm0(operators_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
649
|
+
var len1 = WASM_VECTOR_LEN;
|
|
650
|
+
wasm.wasmpreparedsearch_redactStaticEntitiesDiagnosticsStreamJson(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, addBorrowedObject(on_batch));
|
|
651
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
652
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
653
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
654
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
655
|
+
var ptr3 = r0;
|
|
656
|
+
var len3 = r1;
|
|
657
|
+
if (r3) {
|
|
658
|
+
ptr3 = 0; len3 = 0;
|
|
659
|
+
throw takeObject(r2);
|
|
660
|
+
}
|
|
661
|
+
deferred4_0 = ptr3;
|
|
662
|
+
deferred4_1 = len3;
|
|
663
|
+
return getStringFromWasm0(ptr3, len3);
|
|
664
|
+
} finally {
|
|
665
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
666
|
+
heap[stack_pointer++] = undefined;
|
|
667
|
+
wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
* @param {string} full_text
|
|
672
|
+
* @param {string | null} [operators_json]
|
|
673
|
+
* @returns {string}
|
|
674
|
+
*/
|
|
675
|
+
redactStaticEntitiesJson(full_text, operators_json) {
|
|
676
|
+
let deferred4_0;
|
|
677
|
+
let deferred4_1;
|
|
678
|
+
try {
|
|
679
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
680
|
+
const ptr0 = passStringToWasm0(full_text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
681
|
+
const len0 = WASM_VECTOR_LEN;
|
|
682
|
+
var ptr1 = isLikeNone(operators_json) ? 0 : passStringToWasm0(operators_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
683
|
+
var len1 = WASM_VECTOR_LEN;
|
|
684
|
+
wasm.wasmpreparedsearch_redactStaticEntitiesJson(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
685
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
686
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
687
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
688
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
689
|
+
var ptr3 = r0;
|
|
690
|
+
var len3 = r1;
|
|
691
|
+
if (r3) {
|
|
692
|
+
ptr3 = 0; len3 = 0;
|
|
693
|
+
throw takeObject(r2);
|
|
694
|
+
}
|
|
695
|
+
deferred4_0 = ptr3;
|
|
696
|
+
deferred4_1 = len3;
|
|
697
|
+
return getStringFromWasm0(ptr3, len3);
|
|
698
|
+
} finally {
|
|
699
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
700
|
+
wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* @param {string} full_text
|
|
705
|
+
* @param {string | null | undefined} operators_json
|
|
706
|
+
* @param {Function} on_event
|
|
707
|
+
* @returns {string}
|
|
708
|
+
*/
|
|
709
|
+
redactStaticEntitiesResultStreamJson(full_text, operators_json, on_event) {
|
|
710
|
+
let deferred4_0;
|
|
711
|
+
let deferred4_1;
|
|
712
|
+
try {
|
|
713
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
714
|
+
const ptr0 = passStringToWasm0(full_text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
715
|
+
const len0 = WASM_VECTOR_LEN;
|
|
716
|
+
var ptr1 = isLikeNone(operators_json) ? 0 : passStringToWasm0(operators_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
717
|
+
var len1 = WASM_VECTOR_LEN;
|
|
718
|
+
wasm.wasmpreparedsearch_redactStaticEntitiesResultStreamJson(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, addBorrowedObject(on_event));
|
|
719
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
720
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
721
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
722
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
723
|
+
var ptr3 = r0;
|
|
724
|
+
var len3 = r1;
|
|
725
|
+
if (r3) {
|
|
726
|
+
ptr3 = 0; len3 = 0;
|
|
727
|
+
throw takeObject(r2);
|
|
728
|
+
}
|
|
729
|
+
deferred4_0 = ptr3;
|
|
730
|
+
deferred4_1 = len3;
|
|
731
|
+
return getStringFromWasm0(ptr3, len3);
|
|
732
|
+
} finally {
|
|
733
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
734
|
+
heap[stack_pointer++] = undefined;
|
|
735
|
+
wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
/**
|
|
739
|
+
* @param {string} full_text
|
|
740
|
+
* @param {string | null} [operators_json]
|
|
741
|
+
* @returns {string}
|
|
742
|
+
*/
|
|
743
|
+
redactStaticEntitiesSummaryDiagnosticsJson(full_text, operators_json) {
|
|
744
|
+
let deferred4_0;
|
|
745
|
+
let deferred4_1;
|
|
746
|
+
try {
|
|
747
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
748
|
+
const ptr0 = passStringToWasm0(full_text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
749
|
+
const len0 = WASM_VECTOR_LEN;
|
|
750
|
+
var ptr1 = isLikeNone(operators_json) ? 0 : passStringToWasm0(operators_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
751
|
+
var len1 = WASM_VECTOR_LEN;
|
|
752
|
+
wasm.wasmpreparedsearch_redactStaticEntitiesSummaryDiagnosticsJson(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
753
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
754
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
755
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
756
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
757
|
+
var ptr3 = r0;
|
|
758
|
+
var len3 = r1;
|
|
759
|
+
if (r3) {
|
|
760
|
+
ptr3 = 0; len3 = 0;
|
|
761
|
+
throw takeObject(r2);
|
|
762
|
+
}
|
|
763
|
+
deferred4_0 = ptr3;
|
|
764
|
+
deferred4_1 = len3;
|
|
765
|
+
return getStringFromWasm0(ptr3, len3);
|
|
766
|
+
} finally {
|
|
767
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
768
|
+
wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
/**
|
|
772
|
+
* @param {string} full_text
|
|
773
|
+
* @param {string} request_json
|
|
774
|
+
* @param {string | null} [operators_json]
|
|
775
|
+
* @returns {string}
|
|
776
|
+
*/
|
|
777
|
+
redactStaticEntitiesWithCallerDetectionsDiagnosticsJson(full_text, request_json, operators_json) {
|
|
778
|
+
let deferred5_0;
|
|
779
|
+
let deferred5_1;
|
|
780
|
+
try {
|
|
781
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
782
|
+
const ptr0 = passStringToWasm0(full_text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
783
|
+
const len0 = WASM_VECTOR_LEN;
|
|
784
|
+
const ptr1 = passStringToWasm0(request_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
785
|
+
const len1 = WASM_VECTOR_LEN;
|
|
786
|
+
var ptr2 = isLikeNone(operators_json) ? 0 : passStringToWasm0(operators_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
787
|
+
var len2 = WASM_VECTOR_LEN;
|
|
788
|
+
wasm.wasmpreparedsearch_redactStaticEntitiesWithCallerDetectionsDiagnosticsJson(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
789
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
790
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
791
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
792
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
793
|
+
var ptr4 = r0;
|
|
794
|
+
var len4 = r1;
|
|
795
|
+
if (r3) {
|
|
796
|
+
ptr4 = 0; len4 = 0;
|
|
797
|
+
throw takeObject(r2);
|
|
798
|
+
}
|
|
799
|
+
deferred5_0 = ptr4;
|
|
800
|
+
deferred5_1 = len4;
|
|
801
|
+
return getStringFromWasm0(ptr4, len4);
|
|
802
|
+
} finally {
|
|
803
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
804
|
+
wasm.__wbindgen_export4(deferred5_0, deferred5_1, 1);
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
/**
|
|
808
|
+
* @param {string} full_text
|
|
809
|
+
* @param {string} request_json
|
|
810
|
+
* @param {string | null} [operators_json]
|
|
811
|
+
* @returns {string}
|
|
812
|
+
*/
|
|
813
|
+
redactStaticEntitiesWithCallerDetectionsJson(full_text, request_json, operators_json) {
|
|
814
|
+
let deferred5_0;
|
|
815
|
+
let deferred5_1;
|
|
816
|
+
try {
|
|
817
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
818
|
+
const ptr0 = passStringToWasm0(full_text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
819
|
+
const len0 = WASM_VECTOR_LEN;
|
|
820
|
+
const ptr1 = passStringToWasm0(request_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
821
|
+
const len1 = WASM_VECTOR_LEN;
|
|
822
|
+
var ptr2 = isLikeNone(operators_json) ? 0 : passStringToWasm0(operators_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
823
|
+
var len2 = WASM_VECTOR_LEN;
|
|
824
|
+
wasm.wasmpreparedsearch_redactStaticEntitiesWithCallerDetectionsJson(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
825
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
826
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
827
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
828
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
829
|
+
var ptr4 = r0;
|
|
830
|
+
var len4 = r1;
|
|
831
|
+
if (r3) {
|
|
832
|
+
ptr4 = 0; len4 = 0;
|
|
833
|
+
throw takeObject(r2);
|
|
834
|
+
}
|
|
835
|
+
deferred5_0 = ptr4;
|
|
836
|
+
deferred5_1 = len4;
|
|
837
|
+
return getStringFromWasm0(ptr4, len4);
|
|
838
|
+
} finally {
|
|
839
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
840
|
+
wasm.__wbindgen_export4(deferred5_0, deferred5_1, 1);
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
/**
|
|
844
|
+
* @param {Uint8Array} archive
|
|
845
|
+
* @param {Uint8Array} key
|
|
846
|
+
* @param {string} expected_session_id
|
|
847
|
+
* @param {number | null} [observed_at_epoch_seconds]
|
|
848
|
+
* @returns {WasmPreparedRedactionSession}
|
|
849
|
+
*/
|
|
850
|
+
restoreEncryptedRedactionSession(archive, key, expected_session_id, observed_at_epoch_seconds) {
|
|
851
|
+
try {
|
|
852
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
853
|
+
const ptr0 = passArray8ToWasm0(archive, wasm.__wbindgen_export);
|
|
854
|
+
const len0 = WASM_VECTOR_LEN;
|
|
855
|
+
const ptr1 = passArray8ToWasm0(key, wasm.__wbindgen_export);
|
|
856
|
+
const len1 = WASM_VECTOR_LEN;
|
|
857
|
+
const ptr2 = passStringToWasm0(expected_session_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
858
|
+
const len2 = WASM_VECTOR_LEN;
|
|
859
|
+
wasm.wasmpreparedsearch_restoreEncryptedRedactionSession(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, isLikeNone(observed_at_epoch_seconds) ? Number.MAX_SAFE_INTEGER : (observed_at_epoch_seconds) >>> 0);
|
|
860
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
861
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
862
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
863
|
+
if (r2) {
|
|
864
|
+
throw takeObject(r1);
|
|
865
|
+
}
|
|
866
|
+
return WasmPreparedRedactionSession.__wrap(r0);
|
|
867
|
+
} finally {
|
|
868
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
/**
|
|
872
|
+
* @param {string} plaintext_json
|
|
873
|
+
* @returns {WasmPreparedRedactionSession}
|
|
874
|
+
*/
|
|
875
|
+
restoreRedactionSession(plaintext_json) {
|
|
876
|
+
try {
|
|
877
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
878
|
+
const ptr0 = passStringToWasm0(plaintext_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
879
|
+
const len0 = WASM_VECTOR_LEN;
|
|
880
|
+
wasm.wasmpreparedsearch_restoreRedactionSession(retptr, this.__wbg_ptr, ptr0, len0);
|
|
881
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
882
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
883
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
884
|
+
if (r2) {
|
|
885
|
+
throw takeObject(r1);
|
|
886
|
+
}
|
|
887
|
+
return WasmPreparedRedactionSession.__wrap(r0);
|
|
888
|
+
} finally {
|
|
889
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
warmLazyRegex() {
|
|
893
|
+
try {
|
|
894
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
895
|
+
wasm.wasmpreparedsearch_warmLazyRegex(retptr, this.__wbg_ptr);
|
|
896
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
897
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
898
|
+
if (r1) {
|
|
899
|
+
throw takeObject(r0);
|
|
900
|
+
}
|
|
901
|
+
} finally {
|
|
902
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
/**
|
|
906
|
+
* @returns {string}
|
|
907
|
+
*/
|
|
908
|
+
warmLazyRegexDiagnosticsJson() {
|
|
909
|
+
let deferred2_0;
|
|
910
|
+
let deferred2_1;
|
|
911
|
+
try {
|
|
912
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
913
|
+
wasm.wasmpreparedsearch_warmLazyRegexDiagnosticsJson(retptr, this.__wbg_ptr);
|
|
914
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
915
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
916
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
917
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
918
|
+
var ptr1 = r0;
|
|
919
|
+
var len1 = r1;
|
|
920
|
+
if (r3) {
|
|
921
|
+
ptr1 = 0; len1 = 0;
|
|
922
|
+
throw takeObject(r2);
|
|
923
|
+
}
|
|
924
|
+
deferred2_0 = ptr1;
|
|
925
|
+
deferred2_1 = len1;
|
|
926
|
+
return getStringFromWasm0(ptr1, len1);
|
|
927
|
+
} finally {
|
|
928
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
929
|
+
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
if (Symbol.dispose) WasmPreparedSearch.prototype[Symbol.dispose] = WasmPreparedSearch.prototype.free;
|
|
934
|
+
|
|
935
|
+
export class WasmPreparedSessionRedactionPlan {
|
|
936
|
+
static __wrap(ptr) {
|
|
937
|
+
const obj = Object.create(WasmPreparedSessionRedactionPlan.prototype);
|
|
938
|
+
obj.__wbg_ptr = ptr;
|
|
939
|
+
WasmPreparedSessionRedactionPlanFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
940
|
+
return obj;
|
|
941
|
+
}
|
|
942
|
+
__destroy_into_raw() {
|
|
943
|
+
const ptr = this.__wbg_ptr;
|
|
944
|
+
this.__wbg_ptr = 0;
|
|
945
|
+
WasmPreparedSessionRedactionPlanFinalization.unregister(this);
|
|
946
|
+
return ptr;
|
|
947
|
+
}
|
|
948
|
+
free() {
|
|
949
|
+
const ptr = this.__destroy_into_raw();
|
|
950
|
+
wasm.__wbg_wasmpreparedsessionredactionplan_free(ptr, 0);
|
|
951
|
+
}
|
|
952
|
+
commit() {
|
|
953
|
+
try {
|
|
954
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
955
|
+
wasm.wasmpreparedsessionredactionplan_commit(retptr, this.__wbg_ptr);
|
|
956
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
957
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
958
|
+
if (r1) {
|
|
959
|
+
throw takeObject(r0);
|
|
960
|
+
}
|
|
961
|
+
} finally {
|
|
962
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
/**
|
|
966
|
+
* @returns {string}
|
|
967
|
+
*/
|
|
968
|
+
resultJson() {
|
|
969
|
+
let deferred1_0;
|
|
970
|
+
let deferred1_1;
|
|
971
|
+
try {
|
|
972
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
973
|
+
wasm.wasmpreparedsessionredactionplan_resultJson(retptr, this.__wbg_ptr);
|
|
974
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
975
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
976
|
+
deferred1_0 = r0;
|
|
977
|
+
deferred1_1 = r1;
|
|
978
|
+
return getStringFromWasm0(r0, r1);
|
|
979
|
+
} finally {
|
|
980
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
981
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
if (Symbol.dispose) WasmPreparedSessionRedactionPlan.prototype[Symbol.dispose] = WasmPreparedSessionRedactionPlan.prototype.free;
|
|
986
|
+
|
|
987
|
+
/**
|
|
988
|
+
* @param {Uint8Array} pipeline_config_json
|
|
989
|
+
* @param {Uint8Array | null} [dictionaries_json]
|
|
990
|
+
* @param {Uint8Array | null} [gazetteer_json]
|
|
991
|
+
* @returns {Uint8Array}
|
|
992
|
+
*/
|
|
993
|
+
export function assembleStaticSearchCompressedPackageBytes(pipeline_config_json, dictionaries_json, gazetteer_json) {
|
|
994
|
+
try {
|
|
995
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
996
|
+
const ptr0 = passArray8ToWasm0(pipeline_config_json, wasm.__wbindgen_export);
|
|
997
|
+
const len0 = WASM_VECTOR_LEN;
|
|
998
|
+
var ptr1 = isLikeNone(dictionaries_json) ? 0 : passArray8ToWasm0(dictionaries_json, wasm.__wbindgen_export);
|
|
999
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1000
|
+
var ptr2 = isLikeNone(gazetteer_json) ? 0 : passArray8ToWasm0(gazetteer_json, wasm.__wbindgen_export);
|
|
1001
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1002
|
+
wasm.assembleStaticSearchCompressedPackageBytes(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1003
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1004
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1005
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1006
|
+
if (r2) {
|
|
1007
|
+
throw takeObject(r1);
|
|
1008
|
+
}
|
|
1009
|
+
return takeObject(r0);
|
|
1010
|
+
} finally {
|
|
1011
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
/**
|
|
1016
|
+
* @param {Uint8Array} pipeline_config_json
|
|
1017
|
+
* @param {Uint8Array | null} [dictionaries_json]
|
|
1018
|
+
* @param {Uint8Array | null} [gazetteer_json]
|
|
1019
|
+
* @returns {Uint8Array}
|
|
1020
|
+
*/
|
|
1021
|
+
export function assembleStaticSearchConfigJson(pipeline_config_json, dictionaries_json, gazetteer_json) {
|
|
1022
|
+
try {
|
|
1023
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1024
|
+
const ptr0 = passArray8ToWasm0(pipeline_config_json, wasm.__wbindgen_export);
|
|
1025
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1026
|
+
var ptr1 = isLikeNone(dictionaries_json) ? 0 : passArray8ToWasm0(dictionaries_json, wasm.__wbindgen_export);
|
|
1027
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1028
|
+
var ptr2 = isLikeNone(gazetteer_json) ? 0 : passArray8ToWasm0(gazetteer_json, wasm.__wbindgen_export);
|
|
1029
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1030
|
+
wasm.assembleStaticSearchConfigJson(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1031
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1032
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1033
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1034
|
+
if (r2) {
|
|
1035
|
+
throw takeObject(r1);
|
|
1036
|
+
}
|
|
1037
|
+
return takeObject(r0);
|
|
1038
|
+
} finally {
|
|
1039
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
/**
|
|
1044
|
+
* @param {Uint8Array} pipeline_config_json
|
|
1045
|
+
* @param {Uint8Array | null} [dictionaries_json]
|
|
1046
|
+
* @param {Uint8Array | null} [gazetteer_json]
|
|
1047
|
+
* @returns {Uint8Array}
|
|
1048
|
+
*/
|
|
1049
|
+
export function assembleStaticSearchPackageBytes(pipeline_config_json, dictionaries_json, gazetteer_json) {
|
|
1050
|
+
try {
|
|
1051
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1052
|
+
const ptr0 = passArray8ToWasm0(pipeline_config_json, wasm.__wbindgen_export);
|
|
1053
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1054
|
+
var ptr1 = isLikeNone(dictionaries_json) ? 0 : passArray8ToWasm0(dictionaries_json, wasm.__wbindgen_export);
|
|
1055
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1056
|
+
var ptr2 = isLikeNone(gazetteer_json) ? 0 : passArray8ToWasm0(gazetteer_json, wasm.__wbindgen_export);
|
|
1057
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1058
|
+
wasm.assembleStaticSearchPackageBytes(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1059
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1060
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1061
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1062
|
+
if (r2) {
|
|
1063
|
+
throw takeObject(r1);
|
|
1064
|
+
}
|
|
1065
|
+
return takeObject(r0);
|
|
1066
|
+
} finally {
|
|
1067
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
/**
|
|
1072
|
+
* @param {Uint8Array} document
|
|
1073
|
+
* @param {string} batch_json
|
|
1074
|
+
* @returns {string}
|
|
1075
|
+
*/
|
|
1076
|
+
export function convertExternalDetectionBatchJson(document, batch_json) {
|
|
1077
|
+
let deferred4_0;
|
|
1078
|
+
let deferred4_1;
|
|
1079
|
+
try {
|
|
1080
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1081
|
+
const ptr0 = passArray8ToWasm0(document, wasm.__wbindgen_export);
|
|
1082
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1083
|
+
const ptr1 = passStringToWasm0(batch_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1084
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1085
|
+
wasm.convertExternalDetectionBatchJson(retptr, ptr0, len0, ptr1, len1);
|
|
1086
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1087
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1088
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1089
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1090
|
+
var ptr3 = r0;
|
|
1091
|
+
var len3 = r1;
|
|
1092
|
+
if (r3) {
|
|
1093
|
+
ptr3 = 0; len3 = 0;
|
|
1094
|
+
throw takeObject(r2);
|
|
1095
|
+
}
|
|
1096
|
+
deferred4_0 = ptr3;
|
|
1097
|
+
deferred4_1 = len3;
|
|
1098
|
+
return getStringFromWasm0(ptr3, len3);
|
|
1099
|
+
} finally {
|
|
1100
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1101
|
+
wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
/**
|
|
1106
|
+
* @returns {string}
|
|
1107
|
+
*/
|
|
1108
|
+
export function externalDetectionLimitsJson() {
|
|
1109
|
+
let deferred2_0;
|
|
1110
|
+
let deferred2_1;
|
|
1111
|
+
try {
|
|
1112
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1113
|
+
wasm.externalDetectionLimitsJson(retptr);
|
|
1114
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1115
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1116
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1117
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1118
|
+
var ptr1 = r0;
|
|
1119
|
+
var len1 = r1;
|
|
1120
|
+
if (r3) {
|
|
1121
|
+
ptr1 = 0; len1 = 0;
|
|
1122
|
+
throw takeObject(r2);
|
|
1123
|
+
}
|
|
1124
|
+
deferred2_0 = ptr1;
|
|
1125
|
+
deferred2_1 = len1;
|
|
1126
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1127
|
+
} finally {
|
|
1128
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1129
|
+
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
/**
|
|
1134
|
+
* @param {Uint8Array} document
|
|
1135
|
+
* @returns {string}
|
|
1136
|
+
*/
|
|
1137
|
+
export function extractDocxTextJson(document) {
|
|
1138
|
+
let deferred3_0;
|
|
1139
|
+
let deferred3_1;
|
|
1140
|
+
try {
|
|
1141
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1142
|
+
const ptr0 = passArray8ToWasm0(document, wasm.__wbindgen_export);
|
|
1143
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1144
|
+
wasm.extractDocxTextJson(retptr, ptr0, len0);
|
|
1145
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1146
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1147
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1148
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1149
|
+
var ptr2 = r0;
|
|
1150
|
+
var len2 = r1;
|
|
1151
|
+
if (r3) {
|
|
1152
|
+
ptr2 = 0; len2 = 0;
|
|
1153
|
+
throw takeObject(r2);
|
|
1154
|
+
}
|
|
1155
|
+
deferred3_0 = ptr2;
|
|
1156
|
+
deferred3_1 = len2;
|
|
1157
|
+
return getStringFromWasm0(ptr2, len2);
|
|
1158
|
+
} finally {
|
|
1159
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1160
|
+
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
/**
|
|
1165
|
+
* @param {Uint8Array} document
|
|
1166
|
+
* @param {string | null} [observations_json]
|
|
1167
|
+
* @returns {string}
|
|
1168
|
+
*/
|
|
1169
|
+
export function inspectPdfJson(document, observations_json) {
|
|
1170
|
+
let deferred4_0;
|
|
1171
|
+
let deferred4_1;
|
|
1172
|
+
try {
|
|
1173
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1174
|
+
const ptr0 = passArray8ToWasm0(document, wasm.__wbindgen_export);
|
|
1175
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1176
|
+
var ptr1 = isLikeNone(observations_json) ? 0 : passStringToWasm0(observations_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1177
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1178
|
+
wasm.inspectPdfJson(retptr, ptr0, len0, ptr1, len1);
|
|
1179
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1180
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1181
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1182
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1183
|
+
var ptr3 = r0;
|
|
1184
|
+
var len3 = r1;
|
|
1185
|
+
if (r3) {
|
|
1186
|
+
ptr3 = 0; len3 = 0;
|
|
1187
|
+
throw takeObject(r2);
|
|
1188
|
+
}
|
|
1189
|
+
deferred4_0 = ptr3;
|
|
1190
|
+
deferred4_1 = len3;
|
|
1191
|
+
return getStringFromWasm0(ptr3, len3);
|
|
1192
|
+
} finally {
|
|
1193
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1194
|
+
wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
/**
|
|
1199
|
+
* @returns {string}
|
|
1200
|
+
*/
|
|
1201
|
+
export function nativePackageVersion() {
|
|
1202
|
+
let deferred1_0;
|
|
1203
|
+
let deferred1_1;
|
|
1204
|
+
try {
|
|
1205
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1206
|
+
wasm.nativePackageVersion(retptr);
|
|
1207
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1208
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1209
|
+
deferred1_0 = r0;
|
|
1210
|
+
deferred1_1 = r1;
|
|
1211
|
+
return getStringFromWasm0(r0, r1);
|
|
1212
|
+
} finally {
|
|
1213
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1214
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
/**
|
|
1219
|
+
* @param {string} text
|
|
1220
|
+
* @returns {string}
|
|
1221
|
+
*/
|
|
1222
|
+
export function normalizeForSearch(text) {
|
|
1223
|
+
let deferred2_0;
|
|
1224
|
+
let deferred2_1;
|
|
1225
|
+
try {
|
|
1226
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1227
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1228
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1229
|
+
wasm.normalizeForSearch(retptr, ptr0, len0);
|
|
1230
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1231
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1232
|
+
deferred2_0 = r0;
|
|
1233
|
+
deferred2_1 = r1;
|
|
1234
|
+
return getStringFromWasm0(r0, r1);
|
|
1235
|
+
} finally {
|
|
1236
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1237
|
+
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
/**
|
|
1242
|
+
* @param {Uint8Array} document
|
|
1243
|
+
* @param {string} session_id
|
|
1244
|
+
* @returns {string}
|
|
1245
|
+
*/
|
|
1246
|
+
export function planDocxRestorationJson(document, session_id) {
|
|
1247
|
+
let deferred4_0;
|
|
1248
|
+
let deferred4_1;
|
|
1249
|
+
try {
|
|
1250
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1251
|
+
const ptr0 = passArray8ToWasm0(document, wasm.__wbindgen_export);
|
|
1252
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1253
|
+
const ptr1 = passStringToWasm0(session_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1254
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1255
|
+
wasm.planDocxRestorationJson(retptr, ptr0, len0, ptr1, len1);
|
|
1256
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1257
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1258
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1259
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1260
|
+
var ptr3 = r0;
|
|
1261
|
+
var len3 = r1;
|
|
1262
|
+
if (r3) {
|
|
1263
|
+
ptr3 = 0; len3 = 0;
|
|
1264
|
+
throw takeObject(r2);
|
|
1265
|
+
}
|
|
1266
|
+
deferred4_0 = ptr3;
|
|
1267
|
+
deferred4_1 = len3;
|
|
1268
|
+
return getStringFromWasm0(ptr3, len3);
|
|
1269
|
+
} finally {
|
|
1270
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1271
|
+
wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
/**
|
|
1276
|
+
* @param {Uint8Array} config_json
|
|
1277
|
+
* @returns {Uint8Array}
|
|
1278
|
+
*/
|
|
1279
|
+
export function prepareStaticSearchCompressedPackageBytes(config_json) {
|
|
1280
|
+
try {
|
|
1281
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1282
|
+
const ptr0 = passArray8ToWasm0(config_json, wasm.__wbindgen_export);
|
|
1283
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1284
|
+
wasm.prepareStaticSearchCompressedPackageBytes(retptr, ptr0, len0);
|
|
1285
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1286
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1287
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1288
|
+
if (r2) {
|
|
1289
|
+
throw takeObject(r1);
|
|
1290
|
+
}
|
|
1291
|
+
return takeObject(r0);
|
|
1292
|
+
} finally {
|
|
1293
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
/**
|
|
1298
|
+
* @param {Uint8Array} config_json
|
|
1299
|
+
* @returns {Uint8Array}
|
|
1300
|
+
*/
|
|
1301
|
+
export function prepareStaticSearchPackageBytes(config_json) {
|
|
1302
|
+
try {
|
|
1303
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1304
|
+
const ptr0 = passArray8ToWasm0(config_json, wasm.__wbindgen_export);
|
|
1305
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1306
|
+
wasm.prepareStaticSearchPackageBytes(retptr, ptr0, len0);
|
|
1307
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1308
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1309
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1310
|
+
if (r2) {
|
|
1311
|
+
throw takeObject(r1);
|
|
1312
|
+
}
|
|
1313
|
+
return takeObject(r0);
|
|
1314
|
+
} finally {
|
|
1315
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
/**
|
|
1320
|
+
* @param {Uint8Array} document
|
|
1321
|
+
* @param {string} rewrites_json
|
|
1322
|
+
* @returns {WasmDocumentRewriteResult}
|
|
1323
|
+
*/
|
|
1324
|
+
export function rewriteDocxTextNative(document, rewrites_json) {
|
|
1325
|
+
try {
|
|
1326
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1327
|
+
const ptr0 = passArray8ToWasm0(document, wasm.__wbindgen_export);
|
|
1328
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1329
|
+
const ptr1 = passStringToWasm0(rewrites_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1330
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1331
|
+
wasm.rewriteDocxTextNative(retptr, ptr0, len0, ptr1, len1);
|
|
1332
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1333
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1334
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1335
|
+
if (r2) {
|
|
1336
|
+
throw takeObject(r1);
|
|
1337
|
+
}
|
|
1338
|
+
return WasmDocumentRewriteResult.__wrap(r0);
|
|
1339
|
+
} finally {
|
|
1340
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1341
|
+
}
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
/**
|
|
1345
|
+
* @param {Uint8Array} document
|
|
1346
|
+
* @param {string} request_json
|
|
1347
|
+
* @param {Uint8Array[]} page_pixels
|
|
1348
|
+
* @returns {WasmPdfRasterResult}
|
|
1349
|
+
*/
|
|
1350
|
+
export function rewritePdfRasterFromDetectionsJson(document, request_json, page_pixels) {
|
|
1351
|
+
try {
|
|
1352
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1353
|
+
const ptr0 = passArray8ToWasm0(document, wasm.__wbindgen_export);
|
|
1354
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1355
|
+
const ptr1 = passStringToWasm0(request_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1356
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1357
|
+
const ptr2 = passArrayJsValueToWasm0(page_pixels, wasm.__wbindgen_export);
|
|
1358
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1359
|
+
wasm.rewritePdfRasterFromDetectionsJson(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1360
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1361
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1362
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1363
|
+
if (r2) {
|
|
1364
|
+
throw takeObject(r1);
|
|
1365
|
+
}
|
|
1366
|
+
return WasmPdfRasterResult.__wrap(r0);
|
|
1367
|
+
} finally {
|
|
1368
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
function __wbg_get_imports() {
|
|
1372
|
+
const import0 = {
|
|
1373
|
+
__proto__: null,
|
|
1374
|
+
__wbg_Error_92b29b0548f8b746: function(arg0, arg1) {
|
|
1375
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
1376
|
+
return addHeapObject(ret);
|
|
1377
|
+
},
|
|
1378
|
+
__wbg___wbindgen_debug_string_c25d447a39f5578f: function(arg0, arg1) {
|
|
1379
|
+
const ret = debugString(getObject(arg1));
|
|
1380
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1381
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1382
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1383
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1384
|
+
},
|
|
1385
|
+
__wbg___wbindgen_is_undefined_c05833b95a3cf397: function(arg0) {
|
|
1386
|
+
const ret = getObject(arg0) === undefined;
|
|
1387
|
+
return ret;
|
|
1388
|
+
},
|
|
1389
|
+
__wbg___wbindgen_throw_344f42d3211c4765: function(arg0, arg1) {
|
|
1390
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1391
|
+
},
|
|
1392
|
+
__wbg_call_a6e5c5dce5018821: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1393
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
1394
|
+
return addHeapObject(ret);
|
|
1395
|
+
}, arguments); },
|
|
1396
|
+
__wbg_getRandomValues_cc7f052a444bb2ce: function() { return handleError(function (arg0, arg1) {
|
|
1397
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
1398
|
+
}, arguments); },
|
|
1399
|
+
__wbg_length_1f0964f4a5e2c6d8: function(arg0) {
|
|
1400
|
+
const ret = getObject(arg0).length;
|
|
1401
|
+
return ret;
|
|
1402
|
+
},
|
|
1403
|
+
__wbg_new_from_slice_77cdfb7977362f3c: function(arg0, arg1) {
|
|
1404
|
+
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
1405
|
+
return addHeapObject(ret);
|
|
1406
|
+
},
|
|
1407
|
+
__wbg_now_86c0d4ba3fa605b8: function() {
|
|
1408
|
+
const ret = Date.now();
|
|
1409
|
+
return ret;
|
|
1410
|
+
},
|
|
1411
|
+
__wbg_now_e7c6795a7f81e10f: function(arg0) {
|
|
1412
|
+
const ret = getObject(arg0).now();
|
|
1413
|
+
return ret;
|
|
1414
|
+
},
|
|
1415
|
+
__wbg_performance_3fcf6e32a7e1ed0a: function(arg0) {
|
|
1416
|
+
const ret = getObject(arg0).performance;
|
|
1417
|
+
return addHeapObject(ret);
|
|
1418
|
+
},
|
|
1419
|
+
__wbg_prototypesetcall_4770620bbe4688a0: function(arg0, arg1, arg2) {
|
|
1420
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
1421
|
+
},
|
|
1422
|
+
__wbg_static_accessor_GLOBAL_4ef717fb391d88b7: function() {
|
|
1423
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
1424
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1425
|
+
},
|
|
1426
|
+
__wbg_static_accessor_GLOBAL_THIS_8d1badc68b5a74f4: function() {
|
|
1427
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
1428
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1429
|
+
},
|
|
1430
|
+
__wbg_static_accessor_SELF_146583524fe1469b: function() {
|
|
1431
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
1432
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1433
|
+
},
|
|
1434
|
+
__wbg_static_accessor_WINDOW_f2829a2234d7819e: function() {
|
|
1435
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
1436
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1437
|
+
},
|
|
1438
|
+
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
1439
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
1440
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1441
|
+
return addHeapObject(ret);
|
|
1442
|
+
},
|
|
1443
|
+
__wbindgen_object_clone_ref: function(arg0) {
|
|
1444
|
+
const ret = getObject(arg0);
|
|
1445
|
+
return addHeapObject(ret);
|
|
1446
|
+
},
|
|
1447
|
+
__wbindgen_object_drop_ref: function(arg0) {
|
|
1448
|
+
takeObject(arg0);
|
|
1449
|
+
},
|
|
1450
|
+
};
|
|
1451
|
+
return {
|
|
1452
|
+
__proto__: null,
|
|
1453
|
+
"./index_bg.js": import0,
|
|
1454
|
+
};
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
const WasmDocumentRewriteResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1458
|
+
? { register: () => {}, unregister: () => {} }
|
|
1459
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmdocumentrewriteresult_free(ptr, 1));
|
|
1460
|
+
const WasmPdfRasterResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1461
|
+
? { register: () => {}, unregister: () => {} }
|
|
1462
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmpdfrasterresult_free(ptr, 1));
|
|
1463
|
+
const WasmPreparedRedactionSessionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1464
|
+
? { register: () => {}, unregister: () => {} }
|
|
1465
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmpreparedredactionsession_free(ptr, 1));
|
|
1466
|
+
const WasmPreparedSearchFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1467
|
+
? { register: () => {}, unregister: () => {} }
|
|
1468
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmpreparedsearch_free(ptr, 1));
|
|
1469
|
+
const WasmPreparedSessionRedactionPlanFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1470
|
+
? { register: () => {}, unregister: () => {} }
|
|
1471
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmpreparedsessionredactionplan_free(ptr, 1));
|
|
1472
|
+
|
|
1473
|
+
function addHeapObject(obj) {
|
|
1474
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
1475
|
+
const idx = heap_next;
|
|
1476
|
+
heap_next = heap[idx];
|
|
1477
|
+
|
|
1478
|
+
heap[idx] = obj;
|
|
1479
|
+
return idx;
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
function addBorrowedObject(obj) {
|
|
1483
|
+
if (stack_pointer == 1) throw new Error('out of js stack');
|
|
1484
|
+
heap[--stack_pointer] = obj;
|
|
1485
|
+
return stack_pointer;
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
function debugString(val) {
|
|
1489
|
+
// primitive types
|
|
1490
|
+
const type = typeof val;
|
|
1491
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
1492
|
+
return `${val}`;
|
|
1493
|
+
}
|
|
1494
|
+
if (type == 'string') {
|
|
1495
|
+
return `"${val}"`;
|
|
1496
|
+
}
|
|
1497
|
+
if (type == 'symbol') {
|
|
1498
|
+
const description = val.description;
|
|
1499
|
+
if (description == null) {
|
|
1500
|
+
return 'Symbol';
|
|
1501
|
+
} else {
|
|
1502
|
+
return `Symbol(${description})`;
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
if (type == 'function') {
|
|
1506
|
+
const name = val.name;
|
|
1507
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
1508
|
+
return `Function(${name})`;
|
|
1509
|
+
} else {
|
|
1510
|
+
return 'Function';
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
// objects
|
|
1514
|
+
if (Array.isArray(val)) {
|
|
1515
|
+
const length = val.length;
|
|
1516
|
+
let debug = '[';
|
|
1517
|
+
if (length > 0) {
|
|
1518
|
+
debug += debugString(val[0]);
|
|
1519
|
+
}
|
|
1520
|
+
for(let i = 1; i < length; i++) {
|
|
1521
|
+
debug += ', ' + debugString(val[i]);
|
|
1522
|
+
}
|
|
1523
|
+
debug += ']';
|
|
1524
|
+
return debug;
|
|
1525
|
+
}
|
|
1526
|
+
// Test for built-in
|
|
1527
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
1528
|
+
let className;
|
|
1529
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
1530
|
+
className = builtInMatches[1];
|
|
1531
|
+
} else {
|
|
1532
|
+
// Failed to match the standard '[object ClassName]'
|
|
1533
|
+
return toString.call(val);
|
|
1534
|
+
}
|
|
1535
|
+
if (className == 'Object') {
|
|
1536
|
+
// we're a user defined class or Object
|
|
1537
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
1538
|
+
// easier than looping through ownProperties of `val`.
|
|
1539
|
+
try {
|
|
1540
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
1541
|
+
} catch (_) {
|
|
1542
|
+
return 'Object';
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
// errors
|
|
1546
|
+
if (val instanceof Error) {
|
|
1547
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
1548
|
+
}
|
|
1549
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
1550
|
+
return className;
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1553
|
+
function dropObject(idx) {
|
|
1554
|
+
if (idx < 1028) return;
|
|
1555
|
+
heap[idx] = heap_next;
|
|
1556
|
+
heap_next = idx;
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
1560
|
+
ptr = ptr >>> 0;
|
|
1561
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
let cachedDataViewMemory0 = null;
|
|
1565
|
+
function getDataViewMemory0() {
|
|
1566
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
1567
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
1568
|
+
}
|
|
1569
|
+
return cachedDataViewMemory0;
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
function getStringFromWasm0(ptr, len) {
|
|
1573
|
+
return decodeText(ptr >>> 0, len);
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
let cachedUint8ArrayMemory0 = null;
|
|
1577
|
+
function getUint8ArrayMemory0() {
|
|
1578
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
1579
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
1580
|
+
}
|
|
1581
|
+
return cachedUint8ArrayMemory0;
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
function getObject(idx) { return heap[idx]; }
|
|
1585
|
+
|
|
1586
|
+
function handleError(f, args) {
|
|
1587
|
+
try {
|
|
1588
|
+
return f.apply(this, args);
|
|
1589
|
+
} catch (e) {
|
|
1590
|
+
wasm.__wbindgen_export3(addHeapObject(e));
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
let heap = new Array(1024).fill(undefined);
|
|
1595
|
+
heap.push(undefined, null, true, false);
|
|
1596
|
+
|
|
1597
|
+
let heap_next = heap.length;
|
|
1598
|
+
|
|
1599
|
+
function isLikeNone(x) {
|
|
1600
|
+
return x === undefined || x === null;
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
1604
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
1605
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
1606
|
+
WASM_VECTOR_LEN = arg.length;
|
|
1607
|
+
return ptr;
|
|
1608
|
+
}
|
|
1609
|
+
|
|
1610
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
1611
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
1612
|
+
const mem = getDataViewMemory0();
|
|
1613
|
+
for (let i = 0; i < array.length; i++) {
|
|
1614
|
+
mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
|
|
1615
|
+
}
|
|
1616
|
+
WASM_VECTOR_LEN = array.length;
|
|
1617
|
+
return ptr;
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
1621
|
+
if (realloc === undefined) {
|
|
1622
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1623
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
1624
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
1625
|
+
WASM_VECTOR_LEN = buf.length;
|
|
1626
|
+
return ptr;
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1629
|
+
let len = arg.length;
|
|
1630
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
1631
|
+
|
|
1632
|
+
const mem = getUint8ArrayMemory0();
|
|
1633
|
+
|
|
1634
|
+
let offset = 0;
|
|
1635
|
+
|
|
1636
|
+
for (; offset < len; offset++) {
|
|
1637
|
+
const code = arg.charCodeAt(offset);
|
|
1638
|
+
if (code > 0x7F) break;
|
|
1639
|
+
mem[ptr + offset] = code;
|
|
1640
|
+
}
|
|
1641
|
+
if (offset !== len) {
|
|
1642
|
+
if (offset !== 0) {
|
|
1643
|
+
arg = arg.slice(offset);
|
|
1644
|
+
}
|
|
1645
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
1646
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
1647
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
1648
|
+
|
|
1649
|
+
offset += ret.written;
|
|
1650
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
WASM_VECTOR_LEN = offset;
|
|
1654
|
+
return ptr;
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
let stack_pointer = 1024;
|
|
1658
|
+
|
|
1659
|
+
function takeObject(idx) {
|
|
1660
|
+
const ret = getObject(idx);
|
|
1661
|
+
dropObject(idx);
|
|
1662
|
+
return ret;
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1666
|
+
cachedTextDecoder.decode();
|
|
1667
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
1668
|
+
let numBytesDecoded = 0;
|
|
1669
|
+
function decodeText(ptr, len) {
|
|
1670
|
+
numBytesDecoded += len;
|
|
1671
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
1672
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1673
|
+
cachedTextDecoder.decode();
|
|
1674
|
+
numBytesDecoded = len;
|
|
1675
|
+
}
|
|
1676
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
const cachedTextEncoder = new TextEncoder();
|
|
1680
|
+
|
|
1681
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
1682
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
1683
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1684
|
+
view.set(buf);
|
|
1685
|
+
return {
|
|
1686
|
+
read: arg.length,
|
|
1687
|
+
written: buf.length
|
|
1688
|
+
};
|
|
1689
|
+
};
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
let WASM_VECTOR_LEN = 0;
|
|
1693
|
+
|
|
1694
|
+
let wasmModule, wasmInstance, wasm;
|
|
1695
|
+
function __wbg_finalize_init(instance, module) {
|
|
1696
|
+
wasmInstance = instance;
|
|
1697
|
+
wasm = instance.exports;
|
|
1698
|
+
wasmModule = module;
|
|
1699
|
+
cachedDataViewMemory0 = null;
|
|
1700
|
+
cachedUint8ArrayMemory0 = null;
|
|
1701
|
+
return wasm;
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
async function __wbg_load(module, imports) {
|
|
1705
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
1706
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
1707
|
+
try {
|
|
1708
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
1709
|
+
} catch (e) {
|
|
1710
|
+
const validResponse = module.ok && expectedResponseType(module.type);
|
|
1711
|
+
|
|
1712
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
1713
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
1714
|
+
|
|
1715
|
+
} else { throw e; }
|
|
1716
|
+
}
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1719
|
+
const bytes = await module.arrayBuffer();
|
|
1720
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
1721
|
+
} else {
|
|
1722
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
1723
|
+
|
|
1724
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
1725
|
+
return { instance, module };
|
|
1726
|
+
} else {
|
|
1727
|
+
return instance;
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1731
|
+
function expectedResponseType(type) {
|
|
1732
|
+
switch (type) {
|
|
1733
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
1734
|
+
}
|
|
1735
|
+
return false;
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1739
|
+
function initSync(module) {
|
|
1740
|
+
if (wasm !== undefined) return wasm;
|
|
1741
|
+
|
|
1742
|
+
|
|
1743
|
+
if (module !== undefined) {
|
|
1744
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
1745
|
+
({module} = module)
|
|
1746
|
+
} else {
|
|
1747
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
1748
|
+
}
|
|
1749
|
+
}
|
|
1750
|
+
|
|
1751
|
+
const imports = __wbg_get_imports();
|
|
1752
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
1753
|
+
module = new WebAssembly.Module(module);
|
|
1754
|
+
}
|
|
1755
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
1756
|
+
return __wbg_finalize_init(instance, module);
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
async function __wbg_init(module_or_path) {
|
|
1760
|
+
if (wasm !== undefined) return wasm;
|
|
1761
|
+
|
|
1762
|
+
|
|
1763
|
+
if (module_or_path !== undefined) {
|
|
1764
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
1765
|
+
({module_or_path} = module_or_path)
|
|
1766
|
+
} else {
|
|
1767
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
if (module_or_path === undefined) {
|
|
1772
|
+
module_or_path = new URL('index_bg.wasm', import.meta.url);
|
|
1773
|
+
}
|
|
1774
|
+
const imports = __wbg_get_imports();
|
|
1775
|
+
|
|
1776
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
1777
|
+
module_or_path = fetch(module_or_path);
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
1781
|
+
|
|
1782
|
+
return __wbg_finalize_init(instance, module);
|
|
1783
|
+
}
|
|
1784
|
+
|
|
1785
|
+
export { initSync, __wbg_init as default };
|