@css-inline/css-inline-wasm 0.19.1 → 0.19.2
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/index.js +192 -180
- package/index.min.js +2 -2
- package/index.mjs +192 -180
- package/index_bg.wasm +0 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -28,7 +28,177 @@ __export(wasm_binding_exports, {
|
|
|
28
28
|
module.exports = __toCommonJS(wasm_binding_exports);
|
|
29
29
|
|
|
30
30
|
// wasm/dist/index.js
|
|
31
|
-
|
|
31
|
+
function inline(html, options) {
|
|
32
|
+
let deferred3_0;
|
|
33
|
+
let deferred3_1;
|
|
34
|
+
try {
|
|
35
|
+
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
36
|
+
const len0 = WASM_VECTOR_LEN;
|
|
37
|
+
const ret = wasm.inline(ptr0, len0, options);
|
|
38
|
+
var ptr2 = ret[0];
|
|
39
|
+
var len2 = ret[1];
|
|
40
|
+
if (ret[3]) {
|
|
41
|
+
ptr2 = 0;
|
|
42
|
+
len2 = 0;
|
|
43
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
44
|
+
}
|
|
45
|
+
deferred3_0 = ptr2;
|
|
46
|
+
deferred3_1 = len2;
|
|
47
|
+
return getStringFromWasm0(ptr2, len2);
|
|
48
|
+
} finally {
|
|
49
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function inlineFragment(html, css, options) {
|
|
53
|
+
let deferred4_0;
|
|
54
|
+
let deferred4_1;
|
|
55
|
+
try {
|
|
56
|
+
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
57
|
+
const len0 = WASM_VECTOR_LEN;
|
|
58
|
+
const ptr1 = passStringToWasm0(css, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
59
|
+
const len1 = WASM_VECTOR_LEN;
|
|
60
|
+
const ret = wasm.inlineFragment(ptr0, len0, ptr1, len1, options);
|
|
61
|
+
var ptr3 = ret[0];
|
|
62
|
+
var len3 = ret[1];
|
|
63
|
+
if (ret[3]) {
|
|
64
|
+
ptr3 = 0;
|
|
65
|
+
len3 = 0;
|
|
66
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
67
|
+
}
|
|
68
|
+
deferred4_0 = ptr3;
|
|
69
|
+
deferred4_1 = len3;
|
|
70
|
+
return getStringFromWasm0(ptr3, len3);
|
|
71
|
+
} finally {
|
|
72
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function version() {
|
|
76
|
+
let deferred1_0;
|
|
77
|
+
let deferred1_1;
|
|
78
|
+
try {
|
|
79
|
+
const ret = wasm.version();
|
|
80
|
+
deferred1_0 = ret[0];
|
|
81
|
+
deferred1_1 = ret[1];
|
|
82
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
83
|
+
} finally {
|
|
84
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function __wbg_get_imports() {
|
|
88
|
+
const import0 = {
|
|
89
|
+
__proto__: null,
|
|
90
|
+
__wbg_Error_8c4e43fe74559d73: function(arg0, arg1) {
|
|
91
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
92
|
+
return ret;
|
|
93
|
+
},
|
|
94
|
+
__wbg_Number_04624de7d0e8332d: function(arg0) {
|
|
95
|
+
const ret = Number(arg0);
|
|
96
|
+
return ret;
|
|
97
|
+
},
|
|
98
|
+
__wbg___wbindgen_boolean_get_bbbb1c18aa2f5e25: function(arg0) {
|
|
99
|
+
const v = arg0;
|
|
100
|
+
const ret = typeof v === "boolean" ? v : void 0;
|
|
101
|
+
return isLikeNone(ret) ? 16777215 : ret ? 1 : 0;
|
|
102
|
+
},
|
|
103
|
+
__wbg___wbindgen_debug_string_0bc8482c6e3508ae: function(arg0, arg1) {
|
|
104
|
+
const ret = debugString(arg1);
|
|
105
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
106
|
+
const len1 = WASM_VECTOR_LEN;
|
|
107
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
108
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
109
|
+
},
|
|
110
|
+
__wbg___wbindgen_in_47fa6863be6f2f25: function(arg0, arg1) {
|
|
111
|
+
const ret = arg0 in arg1;
|
|
112
|
+
return ret;
|
|
113
|
+
},
|
|
114
|
+
__wbg___wbindgen_is_object_5ae8e5880f2c1fbd: function(arg0) {
|
|
115
|
+
const val = arg0;
|
|
116
|
+
const ret = typeof val === "object" && val !== null;
|
|
117
|
+
return ret;
|
|
118
|
+
},
|
|
119
|
+
__wbg___wbindgen_is_undefined_9e4d92534c42d778: function(arg0) {
|
|
120
|
+
const ret = arg0 === void 0;
|
|
121
|
+
return ret;
|
|
122
|
+
},
|
|
123
|
+
__wbg___wbindgen_jsval_loose_eq_9dd77d8cd6671811: function(arg0, arg1) {
|
|
124
|
+
const ret = arg0 == arg1;
|
|
125
|
+
return ret;
|
|
126
|
+
},
|
|
127
|
+
__wbg___wbindgen_number_get_8ff4255516ccad3e: function(arg0, arg1) {
|
|
128
|
+
const obj = arg1;
|
|
129
|
+
const ret = typeof obj === "number" ? obj : void 0;
|
|
130
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
131
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
132
|
+
},
|
|
133
|
+
__wbg___wbindgen_string_get_72fb696202c56729: function(arg0, arg1) {
|
|
134
|
+
const obj = arg1;
|
|
135
|
+
const ret = typeof obj === "string" ? obj : void 0;
|
|
136
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
137
|
+
var len1 = WASM_VECTOR_LEN;
|
|
138
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
139
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
140
|
+
},
|
|
141
|
+
__wbg___wbindgen_throw_be289d5034ed271b: function(arg0, arg1) {
|
|
142
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
143
|
+
},
|
|
144
|
+
__wbg_get_with_ref_key_1dc361bd10053bfe: function(arg0, arg1) {
|
|
145
|
+
const ret = arg0[arg1];
|
|
146
|
+
return ret;
|
|
147
|
+
},
|
|
148
|
+
__wbg_instanceof_ArrayBuffer_c367199e2fa2aa04: function(arg0) {
|
|
149
|
+
let result;
|
|
150
|
+
try {
|
|
151
|
+
result = arg0 instanceof ArrayBuffer;
|
|
152
|
+
} catch (_) {
|
|
153
|
+
result = false;
|
|
154
|
+
}
|
|
155
|
+
const ret = result;
|
|
156
|
+
return ret;
|
|
157
|
+
},
|
|
158
|
+
__wbg_instanceof_Uint8Array_9b9075935c74707c: function(arg0) {
|
|
159
|
+
let result;
|
|
160
|
+
try {
|
|
161
|
+
result = arg0 instanceof Uint8Array;
|
|
162
|
+
} catch (_) {
|
|
163
|
+
result = false;
|
|
164
|
+
}
|
|
165
|
+
const ret = result;
|
|
166
|
+
return ret;
|
|
167
|
+
},
|
|
168
|
+
__wbg_isSafeInteger_bfbc7332a9768d2a: function(arg0) {
|
|
169
|
+
const ret = Number.isSafeInteger(arg0);
|
|
170
|
+
return ret;
|
|
171
|
+
},
|
|
172
|
+
__wbg_length_32ed9a279acd054c: function(arg0) {
|
|
173
|
+
const ret = arg0.length;
|
|
174
|
+
return ret;
|
|
175
|
+
},
|
|
176
|
+
__wbg_new_dd2b680c8bf6ae29: function(arg0) {
|
|
177
|
+
const ret = new Uint8Array(arg0);
|
|
178
|
+
return ret;
|
|
179
|
+
},
|
|
180
|
+
__wbg_prototypesetcall_bdcdcc5842e4d77d: function(arg0, arg1, arg2) {
|
|
181
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
182
|
+
},
|
|
183
|
+
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
184
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
185
|
+
return ret;
|
|
186
|
+
},
|
|
187
|
+
__wbindgen_init_externref_table: function() {
|
|
188
|
+
const table = wasm.__wbindgen_externrefs;
|
|
189
|
+
const offset = table.grow(4);
|
|
190
|
+
table.set(0, void 0);
|
|
191
|
+
table.set(offset + 0, void 0);
|
|
192
|
+
table.set(offset + 1, null);
|
|
193
|
+
table.set(offset + 2, true);
|
|
194
|
+
table.set(offset + 3, false);
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
return {
|
|
198
|
+
__proto__: null,
|
|
199
|
+
"./index_bg.js": import0
|
|
200
|
+
};
|
|
201
|
+
}
|
|
32
202
|
function debugString(val) {
|
|
33
203
|
const type = typeof val;
|
|
34
204
|
if (type == "number" || type == "boolean" || val == null) {
|
|
@@ -170,70 +340,23 @@ if (!("encodeInto" in cachedTextEncoder)) {
|
|
|
170
340
|
};
|
|
171
341
|
}
|
|
172
342
|
var WASM_VECTOR_LEN = 0;
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
if (ret[3]) {
|
|
183
|
-
ptr2 = 0;
|
|
184
|
-
len2 = 0;
|
|
185
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
186
|
-
}
|
|
187
|
-
deferred3_0 = ptr2;
|
|
188
|
-
deferred3_1 = len2;
|
|
189
|
-
return getStringFromWasm0(ptr2, len2);
|
|
190
|
-
} finally {
|
|
191
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
function inlineFragment(html, css, options) {
|
|
195
|
-
let deferred4_0;
|
|
196
|
-
let deferred4_1;
|
|
197
|
-
try {
|
|
198
|
-
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
199
|
-
const len0 = WASM_VECTOR_LEN;
|
|
200
|
-
const ptr1 = passStringToWasm0(css, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
201
|
-
const len1 = WASM_VECTOR_LEN;
|
|
202
|
-
const ret = wasm.inlineFragment(ptr0, len0, ptr1, len1, options);
|
|
203
|
-
var ptr3 = ret[0];
|
|
204
|
-
var len3 = ret[1];
|
|
205
|
-
if (ret[3]) {
|
|
206
|
-
ptr3 = 0;
|
|
207
|
-
len3 = 0;
|
|
208
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
209
|
-
}
|
|
210
|
-
deferred4_0 = ptr3;
|
|
211
|
-
deferred4_1 = len3;
|
|
212
|
-
return getStringFromWasm0(ptr3, len3);
|
|
213
|
-
} finally {
|
|
214
|
-
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
function version() {
|
|
218
|
-
let deferred1_0;
|
|
219
|
-
let deferred1_1;
|
|
220
|
-
try {
|
|
221
|
-
const ret = wasm.version();
|
|
222
|
-
deferred1_0 = ret[0];
|
|
223
|
-
deferred1_1 = ret[1];
|
|
224
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
225
|
-
} finally {
|
|
226
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
227
|
-
}
|
|
343
|
+
var wasmModule;
|
|
344
|
+
var wasm;
|
|
345
|
+
function __wbg_finalize_init(instance, module2) {
|
|
346
|
+
wasm = instance.exports;
|
|
347
|
+
wasmModule = module2;
|
|
348
|
+
cachedDataViewMemory0 = null;
|
|
349
|
+
cachedUint8ArrayMemory0 = null;
|
|
350
|
+
wasm.__wbindgen_start();
|
|
351
|
+
return wasm;
|
|
228
352
|
}
|
|
229
|
-
var EXPECTED_RESPONSE_TYPES = /* @__PURE__ */ new Set(["basic", "cors", "default"]);
|
|
230
353
|
async function __wbg_load(module2, imports) {
|
|
231
354
|
if (typeof Response === "function" && module2 instanceof Response) {
|
|
232
355
|
if (typeof WebAssembly.instantiateStreaming === "function") {
|
|
233
356
|
try {
|
|
234
357
|
return await WebAssembly.instantiateStreaming(module2, imports);
|
|
235
358
|
} catch (e) {
|
|
236
|
-
const validResponse = module2.ok &&
|
|
359
|
+
const validResponse = module2.ok && expectedResponseType(module2.type);
|
|
237
360
|
if (validResponse && module2.headers.get("Content-Type") !== "application/wasm") {
|
|
238
361
|
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);
|
|
239
362
|
} else {
|
|
@@ -251,136 +374,26 @@ async function __wbg_load(module2, imports) {
|
|
|
251
374
|
return instance;
|
|
252
375
|
}
|
|
253
376
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
return ret;
|
|
261
|
-
};
|
|
262
|
-
imports.wbg.__wbg_Number_2d1dcfcf4ec51736 = function(arg0) {
|
|
263
|
-
const ret = Number(arg0);
|
|
264
|
-
return ret;
|
|
265
|
-
};
|
|
266
|
-
imports.wbg.__wbg___wbindgen_boolean_get_dea25b33882b895b = function(arg0) {
|
|
267
|
-
const v = arg0;
|
|
268
|
-
const ret = typeof v === "boolean" ? v : void 0;
|
|
269
|
-
return isLikeNone(ret) ? 16777215 : ret ? 1 : 0;
|
|
270
|
-
};
|
|
271
|
-
imports.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) {
|
|
272
|
-
const ret = debugString(arg1);
|
|
273
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
274
|
-
const len1 = WASM_VECTOR_LEN;
|
|
275
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
276
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
277
|
-
};
|
|
278
|
-
imports.wbg.__wbg___wbindgen_in_0d3e1e8f0c669317 = function(arg0, arg1) {
|
|
279
|
-
const ret = arg0 in arg1;
|
|
280
|
-
return ret;
|
|
281
|
-
};
|
|
282
|
-
imports.wbg.__wbg___wbindgen_is_object_ce774f3490692386 = function(arg0) {
|
|
283
|
-
const val = arg0;
|
|
284
|
-
const ret = typeof val === "object" && val !== null;
|
|
285
|
-
return ret;
|
|
286
|
-
};
|
|
287
|
-
imports.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(arg0) {
|
|
288
|
-
const ret = arg0 === void 0;
|
|
289
|
-
return ret;
|
|
290
|
-
};
|
|
291
|
-
imports.wbg.__wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d = function(arg0, arg1) {
|
|
292
|
-
const ret = arg0 == arg1;
|
|
293
|
-
return ret;
|
|
294
|
-
};
|
|
295
|
-
imports.wbg.__wbg___wbindgen_number_get_9619185a74197f95 = function(arg0, arg1) {
|
|
296
|
-
const obj = arg1;
|
|
297
|
-
const ret = typeof obj === "number" ? obj : void 0;
|
|
298
|
-
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
299
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
300
|
-
};
|
|
301
|
-
imports.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) {
|
|
302
|
-
const obj = arg1;
|
|
303
|
-
const ret = typeof obj === "string" ? obj : void 0;
|
|
304
|
-
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
305
|
-
var len1 = WASM_VECTOR_LEN;
|
|
306
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
307
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
308
|
-
};
|
|
309
|
-
imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
|
|
310
|
-
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
311
|
-
};
|
|
312
|
-
imports.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
|
|
313
|
-
const ret = arg0[arg1];
|
|
314
|
-
return ret;
|
|
315
|
-
};
|
|
316
|
-
imports.wbg.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355 = function(arg0) {
|
|
317
|
-
let result;
|
|
318
|
-
try {
|
|
319
|
-
result = arg0 instanceof ArrayBuffer;
|
|
320
|
-
} catch (_) {
|
|
321
|
-
result = false;
|
|
322
|
-
}
|
|
323
|
-
const ret = result;
|
|
324
|
-
return ret;
|
|
325
|
-
};
|
|
326
|
-
imports.wbg.__wbg_instanceof_Uint8Array_da54ccc9d3e09434 = function(arg0) {
|
|
327
|
-
let result;
|
|
328
|
-
try {
|
|
329
|
-
result = arg0 instanceof Uint8Array;
|
|
330
|
-
} catch (_) {
|
|
331
|
-
result = false;
|
|
377
|
+
function expectedResponseType(type) {
|
|
378
|
+
switch (type) {
|
|
379
|
+
case "basic":
|
|
380
|
+
case "cors":
|
|
381
|
+
case "default":
|
|
382
|
+
return true;
|
|
332
383
|
}
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
};
|
|
336
|
-
imports.wbg.__wbg_isSafeInteger_ae7d3f054d55fa16 = function(arg0) {
|
|
337
|
-
const ret = Number.isSafeInteger(arg0);
|
|
338
|
-
return ret;
|
|
339
|
-
};
|
|
340
|
-
imports.wbg.__wbg_length_22ac23eaec9d8053 = function(arg0) {
|
|
341
|
-
const ret = arg0.length;
|
|
342
|
-
return ret;
|
|
343
|
-
};
|
|
344
|
-
imports.wbg.__wbg_new_6421f6084cc5bc5a = function(arg0) {
|
|
345
|
-
const ret = new Uint8Array(arg0);
|
|
346
|
-
return ret;
|
|
347
|
-
};
|
|
348
|
-
imports.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
|
|
349
|
-
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
350
|
-
};
|
|
351
|
-
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
352
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
353
|
-
return ret;
|
|
354
|
-
};
|
|
355
|
-
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
356
|
-
const table = wasm.__wbindgen_externrefs;
|
|
357
|
-
const offset = table.grow(4);
|
|
358
|
-
table.set(0, void 0);
|
|
359
|
-
table.set(offset + 0, void 0);
|
|
360
|
-
table.set(offset + 1, null);
|
|
361
|
-
table.set(offset + 2, true);
|
|
362
|
-
table.set(offset + 3, false);
|
|
363
|
-
};
|
|
364
|
-
return imports;
|
|
365
|
-
}
|
|
366
|
-
function __wbg_finalize_init(instance, module2) {
|
|
367
|
-
wasm = instance.exports;
|
|
368
|
-
__wbg_init.__wbindgen_wasm_module = module2;
|
|
369
|
-
cachedDataViewMemory0 = null;
|
|
370
|
-
cachedUint8ArrayMemory0 = null;
|
|
371
|
-
wasm.__wbindgen_start();
|
|
372
|
-
return wasm;
|
|
384
|
+
return false;
|
|
385
|
+
}
|
|
373
386
|
}
|
|
374
387
|
async function __wbg_init(module_or_path) {
|
|
375
388
|
if (wasm !== void 0) return wasm;
|
|
376
|
-
if (
|
|
389
|
+
if (module_or_path !== void 0) {
|
|
377
390
|
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
378
391
|
({ module_or_path } = module_or_path);
|
|
379
392
|
} else {
|
|
380
393
|
console.warn("using deprecated parameters for the initialization function; pass a single object instead");
|
|
381
394
|
}
|
|
382
395
|
}
|
|
383
|
-
if (
|
|
396
|
+
if (module_or_path === void 0) {
|
|
384
397
|
module_or_path = new URL("index_bg.wasm", void 0);
|
|
385
398
|
}
|
|
386
399
|
const imports = __wbg_get_imports();
|
|
@@ -390,7 +403,6 @@ async function __wbg_init(module_or_path) {
|
|
|
390
403
|
const { instance, module: module2 } = await __wbg_load(await module_or_path, imports);
|
|
391
404
|
return __wbg_finalize_init(instance, module2);
|
|
392
405
|
}
|
|
393
|
-
var dist_default = __wbg_init;
|
|
394
406
|
|
|
395
407
|
// wasm-binding.ts
|
|
396
408
|
var initialized = false;
|
|
@@ -400,7 +412,7 @@ var initWasm = async (module_or_path) => {
|
|
|
400
412
|
"Already initialized. The `initWasm()` function can be used only once."
|
|
401
413
|
);
|
|
402
414
|
}
|
|
403
|
-
await
|
|
415
|
+
await __wbg_init(await module_or_path);
|
|
404
416
|
initialized = true;
|
|
405
417
|
};
|
|
406
418
|
function inline2(html, options) {
|
package/index.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var cssInline=(()=>{var A=Object.defineProperty;var
|
|
2
|
-
${
|
|
1
|
+
"use strict";var cssInline=(()=>{var A=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var D=Object.prototype.hasOwnProperty;var k=(n,e)=>{for(var t in e)A(n,t,{get:e[t],enumerable:!0})},B=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of U(e))!D.call(n,i)&&i!==t&&A(n,i,{get:()=>e[i],enumerable:!(r=R(e,i))||r.enumerable});return n};var N=n=>B(A({},"__esModule",{value:!0}),n);var G={};k(G,{initWasm:()=>q,inline:()=>J,inlineFragment:()=>X,version:()=>Y});function F(n,e){let t,r;try{let s=y(n,o.__wbindgen_malloc,o.__wbindgen_realloc),f=u,_=o.inline(s,f,e);var i=_[0],c=_[1];if(_[3])throw i=0,c=0,W(_[2]);return t=i,r=c,l(i,c)}finally{o.__wbindgen_free(t,r,1)}}function O(n,e,t){let r,i;try{let f=y(n,o.__wbindgen_malloc,o.__wbindgen_realloc),_=u,M=y(e,o.__wbindgen_malloc,o.__wbindgen_realloc),T=u,p=o.inlineFragment(f,_,M,T,t);var c=p[0],s=p[1];if(p[3])throw c=0,s=0,W(p[2]);return r=c,i=s,l(c,s)}finally{o.__wbindgen_free(r,i,1)}}function S(){let n,e;try{let t=o.version();return n=t[0],e=t[1],l(t[0],t[1])}finally{o.__wbindgen_free(n,e,1)}}function $(){return{__proto__:null,"./index_bg.js":{__proto__:null,__wbg_Error_8c4e43fe74559d73:function(e,t){return Error(l(e,t))},__wbg_Number_04624de7d0e8332d:function(e){return Number(e)},__wbg___wbindgen_boolean_get_bbbb1c18aa2f5e25:function(e){let t=e,r=typeof t=="boolean"?t:void 0;return m(r)?16777215:r?1:0},__wbg___wbindgen_debug_string_0bc8482c6e3508ae:function(e,t){let r=I(t),i=y(r,o.__wbindgen_malloc,o.__wbindgen_realloc),c=u;b().setInt32(e+4,c,!0),b().setInt32(e+0,i,!0)},__wbg___wbindgen_in_47fa6863be6f2f25:function(e,t){return e in t},__wbg___wbindgen_is_object_5ae8e5880f2c1fbd:function(e){let t=e;return typeof t=="object"&&t!==null},__wbg___wbindgen_is_undefined_9e4d92534c42d778:function(e){return e===void 0},__wbg___wbindgen_jsval_loose_eq_9dd77d8cd6671811:function(e,t){return e==t},__wbg___wbindgen_number_get_8ff4255516ccad3e:function(e,t){let r=t,i=typeof r=="number"?r:void 0;b().setFloat64(e+8,m(i)?0:i,!0),b().setInt32(e+0,!m(i),!0)},__wbg___wbindgen_string_get_72fb696202c56729:function(e,t){let r=t,i=typeof r=="string"?r:void 0;var c=m(i)?0:y(i,o.__wbindgen_malloc,o.__wbindgen_realloc),s=u;b().setInt32(e+4,s,!0),b().setInt32(e+0,c,!0)},__wbg___wbindgen_throw_be289d5034ed271b:function(e,t){throw new Error(l(e,t))},__wbg_get_with_ref_key_1dc361bd10053bfe:function(e,t){return e[t]},__wbg_instanceof_ArrayBuffer_c367199e2fa2aa04:function(e){let t;try{t=e instanceof ArrayBuffer}catch{t=!1}return t},__wbg_instanceof_Uint8Array_9b9075935c74707c:function(e){let t;try{t=e instanceof Uint8Array}catch{t=!1}return t},__wbg_isSafeInteger_bfbc7332a9768d2a:function(e){return Number.isSafeInteger(e)},__wbg_length_32ed9a279acd054c:function(e){return e.length},__wbg_new_dd2b680c8bf6ae29:function(e){return new Uint8Array(e)},__wbg_prototypesetcall_bdcdcc5842e4d77d:function(e,t,r){Uint8Array.prototype.set.call(L(e,t),r)},__wbindgen_cast_0000000000000001:function(e,t){return l(e,t)},__wbindgen_init_externref_table:function(){let e=o.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}}}}function I(n){let e=typeof n;if(e=="number"||e=="boolean"||n==null)return`${n}`;if(e=="string")return`"${n}"`;if(e=="symbol"){let i=n.description;return i==null?"Symbol":`Symbol(${i})`}if(e=="function"){let i=n.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(n)){let i=n.length,c="[";i>0&&(c+=I(n[0]));for(let s=1;s<i;s++)c+=", "+I(n[s]);return c+="]",c}let t=/\[object ([^\]]+)\]/.exec(toString.call(n)),r;if(t&&t.length>1)r=t[1];else return toString.call(n);if(r=="Object")try{return"Object("+JSON.stringify(n)+")"}catch{return"Object"}return n instanceof Error?`${n.name}: ${n.message}
|
|
2
|
+
${n.stack}`:r}function L(n,e){return n=n>>>0,g().subarray(n/1,n/1+e)}var a=null;function b(){return(a===null||a.buffer.detached===!0||a.buffer.detached===void 0&&a.buffer!==o.memory.buffer)&&(a=new DataView(o.memory.buffer)),a}function l(n,e){return n=n>>>0,z(n,e)}var d=null;function g(){return(d===null||d.byteLength===0)&&(d=new Uint8Array(o.memory.buffer)),d}function m(n){return n==null}function y(n,e,t){if(t===void 0){let f=w.encode(n),_=e(f.length,1)>>>0;return g().subarray(_,_+f.length).set(f),u=f.length,_}let r=n.length,i=e(r,1)>>>0,c=g(),s=0;for(;s<r;s++){let f=n.charCodeAt(s);if(f>127)break;c[i+s]=f}if(s!==r){s!==0&&(n=n.slice(s)),i=t(i,r,r=s+n.length*3,1)>>>0;let f=g().subarray(i+s,i+r),_=w.encodeInto(n,f);s+=_.written,i=t(i,r,s,1)>>>0}return u=s,i}function W(n){let e=o.__wbindgen_externrefs.get(n);return o.__externref_table_dealloc(n),e}var h=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});h.decode();var v=2146435072,x=0;function z(n,e){return x+=e,x>=v&&(h=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),h.decode(),x=e),h.decode(g().subarray(n,n+e))}var w=new TextEncoder;"encodeInto"in w||(w.encodeInto=function(n,e){let t=w.encode(n);return e.set(t),{read:n.length,written:t.length}});var u=0,C,o;function P(n,e){return o=n.exports,C=e,a=null,d=null,o.__wbindgen_start(),o}async function V(n,e){if(typeof Response=="function"&&n instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(n,e)}catch(i){if(n.ok&&t(n.type)&&n.headers.get("Content-Type")!=="application/wasm")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",i);else throw i}let r=await n.arrayBuffer();return await WebAssembly.instantiate(r,e)}else{let r=await WebAssembly.instantiate(n,e);return r instanceof WebAssembly.Instance?{instance:r,module:n}:r}function t(r){switch(r){case"basic":case"cors":case"default":return!0}return!1}}async function j(n){if(o!==void 0)return o;n!==void 0&&(Object.getPrototypeOf(n)===Object.prototype?{module_or_path:n}=n:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),n===void 0&&(n=new URL("index_bg.wasm",void 0));let e=$();(typeof n=="string"||typeof Request=="function"&&n instanceof Request||typeof URL=="function"&&n instanceof URL)&&(n=fetch(n));let{instance:t,module:r}=await V(await n,e);return P(t,r)}var E=!1,q=async n=>{if(E)throw new Error("Already initialized. The `initWasm()` function can be used only once.");await j(await n),E=!0};function J(n,e){return F(n,e)}function X(n,e,t){return O(n,e,t)}function Y(){return S()}return N(G);})();
|
package/index.mjs
CHANGED
|
@@ -1,5 +1,175 @@
|
|
|
1
1
|
// wasm/dist/index.js
|
|
2
|
-
|
|
2
|
+
function inline(html, options) {
|
|
3
|
+
let deferred3_0;
|
|
4
|
+
let deferred3_1;
|
|
5
|
+
try {
|
|
6
|
+
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7
|
+
const len0 = WASM_VECTOR_LEN;
|
|
8
|
+
const ret = wasm.inline(ptr0, len0, options);
|
|
9
|
+
var ptr2 = ret[0];
|
|
10
|
+
var len2 = ret[1];
|
|
11
|
+
if (ret[3]) {
|
|
12
|
+
ptr2 = 0;
|
|
13
|
+
len2 = 0;
|
|
14
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
15
|
+
}
|
|
16
|
+
deferred3_0 = ptr2;
|
|
17
|
+
deferred3_1 = len2;
|
|
18
|
+
return getStringFromWasm0(ptr2, len2);
|
|
19
|
+
} finally {
|
|
20
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function inlineFragment(html, css, options) {
|
|
24
|
+
let deferred4_0;
|
|
25
|
+
let deferred4_1;
|
|
26
|
+
try {
|
|
27
|
+
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
28
|
+
const len0 = WASM_VECTOR_LEN;
|
|
29
|
+
const ptr1 = passStringToWasm0(css, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
30
|
+
const len1 = WASM_VECTOR_LEN;
|
|
31
|
+
const ret = wasm.inlineFragment(ptr0, len0, ptr1, len1, options);
|
|
32
|
+
var ptr3 = ret[0];
|
|
33
|
+
var len3 = ret[1];
|
|
34
|
+
if (ret[3]) {
|
|
35
|
+
ptr3 = 0;
|
|
36
|
+
len3 = 0;
|
|
37
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
38
|
+
}
|
|
39
|
+
deferred4_0 = ptr3;
|
|
40
|
+
deferred4_1 = len3;
|
|
41
|
+
return getStringFromWasm0(ptr3, len3);
|
|
42
|
+
} finally {
|
|
43
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function version() {
|
|
47
|
+
let deferred1_0;
|
|
48
|
+
let deferred1_1;
|
|
49
|
+
try {
|
|
50
|
+
const ret = wasm.version();
|
|
51
|
+
deferred1_0 = ret[0];
|
|
52
|
+
deferred1_1 = ret[1];
|
|
53
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
54
|
+
} finally {
|
|
55
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function __wbg_get_imports() {
|
|
59
|
+
const import0 = {
|
|
60
|
+
__proto__: null,
|
|
61
|
+
__wbg_Error_8c4e43fe74559d73: function(arg0, arg1) {
|
|
62
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
63
|
+
return ret;
|
|
64
|
+
},
|
|
65
|
+
__wbg_Number_04624de7d0e8332d: function(arg0) {
|
|
66
|
+
const ret = Number(arg0);
|
|
67
|
+
return ret;
|
|
68
|
+
},
|
|
69
|
+
__wbg___wbindgen_boolean_get_bbbb1c18aa2f5e25: function(arg0) {
|
|
70
|
+
const v = arg0;
|
|
71
|
+
const ret = typeof v === "boolean" ? v : void 0;
|
|
72
|
+
return isLikeNone(ret) ? 16777215 : ret ? 1 : 0;
|
|
73
|
+
},
|
|
74
|
+
__wbg___wbindgen_debug_string_0bc8482c6e3508ae: function(arg0, arg1) {
|
|
75
|
+
const ret = debugString(arg1);
|
|
76
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
77
|
+
const len1 = WASM_VECTOR_LEN;
|
|
78
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
79
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
80
|
+
},
|
|
81
|
+
__wbg___wbindgen_in_47fa6863be6f2f25: function(arg0, arg1) {
|
|
82
|
+
const ret = arg0 in arg1;
|
|
83
|
+
return ret;
|
|
84
|
+
},
|
|
85
|
+
__wbg___wbindgen_is_object_5ae8e5880f2c1fbd: function(arg0) {
|
|
86
|
+
const val = arg0;
|
|
87
|
+
const ret = typeof val === "object" && val !== null;
|
|
88
|
+
return ret;
|
|
89
|
+
},
|
|
90
|
+
__wbg___wbindgen_is_undefined_9e4d92534c42d778: function(arg0) {
|
|
91
|
+
const ret = arg0 === void 0;
|
|
92
|
+
return ret;
|
|
93
|
+
},
|
|
94
|
+
__wbg___wbindgen_jsval_loose_eq_9dd77d8cd6671811: function(arg0, arg1) {
|
|
95
|
+
const ret = arg0 == arg1;
|
|
96
|
+
return ret;
|
|
97
|
+
},
|
|
98
|
+
__wbg___wbindgen_number_get_8ff4255516ccad3e: function(arg0, arg1) {
|
|
99
|
+
const obj = arg1;
|
|
100
|
+
const ret = typeof obj === "number" ? obj : void 0;
|
|
101
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
102
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
103
|
+
},
|
|
104
|
+
__wbg___wbindgen_string_get_72fb696202c56729: function(arg0, arg1) {
|
|
105
|
+
const obj = arg1;
|
|
106
|
+
const ret = typeof obj === "string" ? obj : void 0;
|
|
107
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
108
|
+
var len1 = WASM_VECTOR_LEN;
|
|
109
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
110
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
111
|
+
},
|
|
112
|
+
__wbg___wbindgen_throw_be289d5034ed271b: function(arg0, arg1) {
|
|
113
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
114
|
+
},
|
|
115
|
+
__wbg_get_with_ref_key_1dc361bd10053bfe: function(arg0, arg1) {
|
|
116
|
+
const ret = arg0[arg1];
|
|
117
|
+
return ret;
|
|
118
|
+
},
|
|
119
|
+
__wbg_instanceof_ArrayBuffer_c367199e2fa2aa04: function(arg0) {
|
|
120
|
+
let result;
|
|
121
|
+
try {
|
|
122
|
+
result = arg0 instanceof ArrayBuffer;
|
|
123
|
+
} catch (_) {
|
|
124
|
+
result = false;
|
|
125
|
+
}
|
|
126
|
+
const ret = result;
|
|
127
|
+
return ret;
|
|
128
|
+
},
|
|
129
|
+
__wbg_instanceof_Uint8Array_9b9075935c74707c: function(arg0) {
|
|
130
|
+
let result;
|
|
131
|
+
try {
|
|
132
|
+
result = arg0 instanceof Uint8Array;
|
|
133
|
+
} catch (_) {
|
|
134
|
+
result = false;
|
|
135
|
+
}
|
|
136
|
+
const ret = result;
|
|
137
|
+
return ret;
|
|
138
|
+
},
|
|
139
|
+
__wbg_isSafeInteger_bfbc7332a9768d2a: function(arg0) {
|
|
140
|
+
const ret = Number.isSafeInteger(arg0);
|
|
141
|
+
return ret;
|
|
142
|
+
},
|
|
143
|
+
__wbg_length_32ed9a279acd054c: function(arg0) {
|
|
144
|
+
const ret = arg0.length;
|
|
145
|
+
return ret;
|
|
146
|
+
},
|
|
147
|
+
__wbg_new_dd2b680c8bf6ae29: function(arg0) {
|
|
148
|
+
const ret = new Uint8Array(arg0);
|
|
149
|
+
return ret;
|
|
150
|
+
},
|
|
151
|
+
__wbg_prototypesetcall_bdcdcc5842e4d77d: function(arg0, arg1, arg2) {
|
|
152
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
153
|
+
},
|
|
154
|
+
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
155
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
156
|
+
return ret;
|
|
157
|
+
},
|
|
158
|
+
__wbindgen_init_externref_table: function() {
|
|
159
|
+
const table = wasm.__wbindgen_externrefs;
|
|
160
|
+
const offset = table.grow(4);
|
|
161
|
+
table.set(0, void 0);
|
|
162
|
+
table.set(offset + 0, void 0);
|
|
163
|
+
table.set(offset + 1, null);
|
|
164
|
+
table.set(offset + 2, true);
|
|
165
|
+
table.set(offset + 3, false);
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
return {
|
|
169
|
+
__proto__: null,
|
|
170
|
+
"./index_bg.js": import0
|
|
171
|
+
};
|
|
172
|
+
}
|
|
3
173
|
function debugString(val) {
|
|
4
174
|
const type = typeof val;
|
|
5
175
|
if (type == "number" || type == "boolean" || val == null) {
|
|
@@ -141,70 +311,23 @@ if (!("encodeInto" in cachedTextEncoder)) {
|
|
|
141
311
|
};
|
|
142
312
|
}
|
|
143
313
|
var WASM_VECTOR_LEN = 0;
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
if (ret[3]) {
|
|
154
|
-
ptr2 = 0;
|
|
155
|
-
len2 = 0;
|
|
156
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
157
|
-
}
|
|
158
|
-
deferred3_0 = ptr2;
|
|
159
|
-
deferred3_1 = len2;
|
|
160
|
-
return getStringFromWasm0(ptr2, len2);
|
|
161
|
-
} finally {
|
|
162
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
function inlineFragment(html, css, options) {
|
|
166
|
-
let deferred4_0;
|
|
167
|
-
let deferred4_1;
|
|
168
|
-
try {
|
|
169
|
-
const ptr0 = passStringToWasm0(html, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
170
|
-
const len0 = WASM_VECTOR_LEN;
|
|
171
|
-
const ptr1 = passStringToWasm0(css, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
172
|
-
const len1 = WASM_VECTOR_LEN;
|
|
173
|
-
const ret = wasm.inlineFragment(ptr0, len0, ptr1, len1, options);
|
|
174
|
-
var ptr3 = ret[0];
|
|
175
|
-
var len3 = ret[1];
|
|
176
|
-
if (ret[3]) {
|
|
177
|
-
ptr3 = 0;
|
|
178
|
-
len3 = 0;
|
|
179
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
180
|
-
}
|
|
181
|
-
deferred4_0 = ptr3;
|
|
182
|
-
deferred4_1 = len3;
|
|
183
|
-
return getStringFromWasm0(ptr3, len3);
|
|
184
|
-
} finally {
|
|
185
|
-
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
function version() {
|
|
189
|
-
let deferred1_0;
|
|
190
|
-
let deferred1_1;
|
|
191
|
-
try {
|
|
192
|
-
const ret = wasm.version();
|
|
193
|
-
deferred1_0 = ret[0];
|
|
194
|
-
deferred1_1 = ret[1];
|
|
195
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
196
|
-
} finally {
|
|
197
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
198
|
-
}
|
|
314
|
+
var wasmModule;
|
|
315
|
+
var wasm;
|
|
316
|
+
function __wbg_finalize_init(instance, module) {
|
|
317
|
+
wasm = instance.exports;
|
|
318
|
+
wasmModule = module;
|
|
319
|
+
cachedDataViewMemory0 = null;
|
|
320
|
+
cachedUint8ArrayMemory0 = null;
|
|
321
|
+
wasm.__wbindgen_start();
|
|
322
|
+
return wasm;
|
|
199
323
|
}
|
|
200
|
-
var EXPECTED_RESPONSE_TYPES = /* @__PURE__ */ new Set(["basic", "cors", "default"]);
|
|
201
324
|
async function __wbg_load(module, imports) {
|
|
202
325
|
if (typeof Response === "function" && module instanceof Response) {
|
|
203
326
|
if (typeof WebAssembly.instantiateStreaming === "function") {
|
|
204
327
|
try {
|
|
205
328
|
return await WebAssembly.instantiateStreaming(module, imports);
|
|
206
329
|
} catch (e) {
|
|
207
|
-
const validResponse = module.ok &&
|
|
330
|
+
const validResponse = module.ok && expectedResponseType(module.type);
|
|
208
331
|
if (validResponse && module.headers.get("Content-Type") !== "application/wasm") {
|
|
209
332
|
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);
|
|
210
333
|
} else {
|
|
@@ -222,136 +345,26 @@ async function __wbg_load(module, imports) {
|
|
|
222
345
|
return instance;
|
|
223
346
|
}
|
|
224
347
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
return ret;
|
|
232
|
-
};
|
|
233
|
-
imports.wbg.__wbg_Number_2d1dcfcf4ec51736 = function(arg0) {
|
|
234
|
-
const ret = Number(arg0);
|
|
235
|
-
return ret;
|
|
236
|
-
};
|
|
237
|
-
imports.wbg.__wbg___wbindgen_boolean_get_dea25b33882b895b = function(arg0) {
|
|
238
|
-
const v = arg0;
|
|
239
|
-
const ret = typeof v === "boolean" ? v : void 0;
|
|
240
|
-
return isLikeNone(ret) ? 16777215 : ret ? 1 : 0;
|
|
241
|
-
};
|
|
242
|
-
imports.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) {
|
|
243
|
-
const ret = debugString(arg1);
|
|
244
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
245
|
-
const len1 = WASM_VECTOR_LEN;
|
|
246
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
247
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
248
|
-
};
|
|
249
|
-
imports.wbg.__wbg___wbindgen_in_0d3e1e8f0c669317 = function(arg0, arg1) {
|
|
250
|
-
const ret = arg0 in arg1;
|
|
251
|
-
return ret;
|
|
252
|
-
};
|
|
253
|
-
imports.wbg.__wbg___wbindgen_is_object_ce774f3490692386 = function(arg0) {
|
|
254
|
-
const val = arg0;
|
|
255
|
-
const ret = typeof val === "object" && val !== null;
|
|
256
|
-
return ret;
|
|
257
|
-
};
|
|
258
|
-
imports.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(arg0) {
|
|
259
|
-
const ret = arg0 === void 0;
|
|
260
|
-
return ret;
|
|
261
|
-
};
|
|
262
|
-
imports.wbg.__wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d = function(arg0, arg1) {
|
|
263
|
-
const ret = arg0 == arg1;
|
|
264
|
-
return ret;
|
|
265
|
-
};
|
|
266
|
-
imports.wbg.__wbg___wbindgen_number_get_9619185a74197f95 = function(arg0, arg1) {
|
|
267
|
-
const obj = arg1;
|
|
268
|
-
const ret = typeof obj === "number" ? obj : void 0;
|
|
269
|
-
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
270
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
271
|
-
};
|
|
272
|
-
imports.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) {
|
|
273
|
-
const obj = arg1;
|
|
274
|
-
const ret = typeof obj === "string" ? obj : void 0;
|
|
275
|
-
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
276
|
-
var len1 = WASM_VECTOR_LEN;
|
|
277
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
278
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
279
|
-
};
|
|
280
|
-
imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
|
|
281
|
-
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
282
|
-
};
|
|
283
|
-
imports.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
|
|
284
|
-
const ret = arg0[arg1];
|
|
285
|
-
return ret;
|
|
286
|
-
};
|
|
287
|
-
imports.wbg.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355 = function(arg0) {
|
|
288
|
-
let result;
|
|
289
|
-
try {
|
|
290
|
-
result = arg0 instanceof ArrayBuffer;
|
|
291
|
-
} catch (_) {
|
|
292
|
-
result = false;
|
|
293
|
-
}
|
|
294
|
-
const ret = result;
|
|
295
|
-
return ret;
|
|
296
|
-
};
|
|
297
|
-
imports.wbg.__wbg_instanceof_Uint8Array_da54ccc9d3e09434 = function(arg0) {
|
|
298
|
-
let result;
|
|
299
|
-
try {
|
|
300
|
-
result = arg0 instanceof Uint8Array;
|
|
301
|
-
} catch (_) {
|
|
302
|
-
result = false;
|
|
348
|
+
function expectedResponseType(type) {
|
|
349
|
+
switch (type) {
|
|
350
|
+
case "basic":
|
|
351
|
+
case "cors":
|
|
352
|
+
case "default":
|
|
353
|
+
return true;
|
|
303
354
|
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
};
|
|
307
|
-
imports.wbg.__wbg_isSafeInteger_ae7d3f054d55fa16 = function(arg0) {
|
|
308
|
-
const ret = Number.isSafeInteger(arg0);
|
|
309
|
-
return ret;
|
|
310
|
-
};
|
|
311
|
-
imports.wbg.__wbg_length_22ac23eaec9d8053 = function(arg0) {
|
|
312
|
-
const ret = arg0.length;
|
|
313
|
-
return ret;
|
|
314
|
-
};
|
|
315
|
-
imports.wbg.__wbg_new_6421f6084cc5bc5a = function(arg0) {
|
|
316
|
-
const ret = new Uint8Array(arg0);
|
|
317
|
-
return ret;
|
|
318
|
-
};
|
|
319
|
-
imports.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
|
|
320
|
-
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
321
|
-
};
|
|
322
|
-
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
323
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
324
|
-
return ret;
|
|
325
|
-
};
|
|
326
|
-
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
327
|
-
const table = wasm.__wbindgen_externrefs;
|
|
328
|
-
const offset = table.grow(4);
|
|
329
|
-
table.set(0, void 0);
|
|
330
|
-
table.set(offset + 0, void 0);
|
|
331
|
-
table.set(offset + 1, null);
|
|
332
|
-
table.set(offset + 2, true);
|
|
333
|
-
table.set(offset + 3, false);
|
|
334
|
-
};
|
|
335
|
-
return imports;
|
|
336
|
-
}
|
|
337
|
-
function __wbg_finalize_init(instance, module) {
|
|
338
|
-
wasm = instance.exports;
|
|
339
|
-
__wbg_init.__wbindgen_wasm_module = module;
|
|
340
|
-
cachedDataViewMemory0 = null;
|
|
341
|
-
cachedUint8ArrayMemory0 = null;
|
|
342
|
-
wasm.__wbindgen_start();
|
|
343
|
-
return wasm;
|
|
355
|
+
return false;
|
|
356
|
+
}
|
|
344
357
|
}
|
|
345
358
|
async function __wbg_init(module_or_path) {
|
|
346
359
|
if (wasm !== void 0) return wasm;
|
|
347
|
-
if (
|
|
360
|
+
if (module_or_path !== void 0) {
|
|
348
361
|
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
349
362
|
({ module_or_path } = module_or_path);
|
|
350
363
|
} else {
|
|
351
364
|
console.warn("using deprecated parameters for the initialization function; pass a single object instead");
|
|
352
365
|
}
|
|
353
366
|
}
|
|
354
|
-
if (
|
|
367
|
+
if (module_or_path === void 0) {
|
|
355
368
|
module_or_path = new URL("index_bg.wasm", void 0);
|
|
356
369
|
}
|
|
357
370
|
const imports = __wbg_get_imports();
|
|
@@ -361,7 +374,6 @@ async function __wbg_init(module_or_path) {
|
|
|
361
374
|
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
362
375
|
return __wbg_finalize_init(instance, module);
|
|
363
376
|
}
|
|
364
|
-
var dist_default = __wbg_init;
|
|
365
377
|
|
|
366
378
|
// wasm-binding.ts
|
|
367
379
|
var initialized = false;
|
|
@@ -371,7 +383,7 @@ var initWasm = async (module_or_path) => {
|
|
|
371
383
|
"Already initialized. The `initWasm()` function can be used only once."
|
|
372
384
|
);
|
|
373
385
|
}
|
|
374
|
-
await
|
|
386
|
+
await __wbg_init(await module_or_path);
|
|
375
387
|
initialized = true;
|
|
376
388
|
};
|
|
377
389
|
function inline2(html, options) {
|
package/index_bg.wasm
CHANGED
|
Binary file
|