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