sci-form-wasm 0.3.1 → 0.4.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/package.json +1 -3
- package/sci_form_wasm.d.ts +84 -0
- package/sci_form_wasm.js +1016 -6
- package/sci_form_wasm_bg.wasm +0 -0
- package/sci_form_wasm_bg.js +0 -779
package/sci_form_wasm.js
CHANGED
|
@@ -1,9 +1,1019 @@
|
|
|
1
1
|
/* @ts-self-types="./sci_form_wasm.d.ts" */
|
|
2
|
+
import { startWorkers } from './snippets/wasm-bindgen-rayon-38edf6e439f6d70d/src/workerHelpers.js';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Assemble a framework crystal structure.
|
|
6
|
+
*
|
|
7
|
+
* `topology`: "pcu", "dia", or "sql"
|
|
8
|
+
* `metal`: atomic number of the metal center
|
|
9
|
+
* `geometry`: "linear", "tetrahedral", "octahedral", "square_planar", "trigonal"
|
|
10
|
+
* `lattice_a`: cubic lattice parameter in Å
|
|
11
|
+
* `supercell`: replication factor (1 = no replication)
|
|
12
|
+
* @param {string} topology
|
|
13
|
+
* @param {number} metal
|
|
14
|
+
* @param {string} geometry
|
|
15
|
+
* @param {number} lattice_a
|
|
16
|
+
* @param {number} supercell
|
|
17
|
+
* @returns {string}
|
|
18
|
+
*/
|
|
19
|
+
export function assemble_framework(topology, metal, geometry, lattice_a, supercell) {
|
|
20
|
+
let deferred3_0;
|
|
21
|
+
let deferred3_1;
|
|
22
|
+
try {
|
|
23
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
24
|
+
const ptr0 = passStringToWasm0(topology, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
25
|
+
const len0 = WASM_VECTOR_LEN;
|
|
26
|
+
const ptr1 = passStringToWasm0(geometry, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
27
|
+
const len1 = WASM_VECTOR_LEN;
|
|
28
|
+
wasm.assemble_framework(retptr, ptr0, len0, metal, ptr1, len1, lattice_a, supercell);
|
|
29
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
30
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
31
|
+
deferred3_0 = r0;
|
|
32
|
+
deferred3_1 = r1;
|
|
33
|
+
return getStringFromWasm0(r0, r1);
|
|
34
|
+
} finally {
|
|
35
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
36
|
+
wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
6
39
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Compute Gasteiger-Marsili partial charges from a SMILES string.
|
|
42
|
+
*
|
|
43
|
+
* Returns JSON with charges, iterations, total_charge.
|
|
44
|
+
* @param {string} smiles
|
|
45
|
+
* @returns {string}
|
|
46
|
+
*/
|
|
47
|
+
export function compute_charges(smiles) {
|
|
48
|
+
let deferred2_0;
|
|
49
|
+
let deferred2_1;
|
|
50
|
+
try {
|
|
51
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
52
|
+
const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
53
|
+
const len0 = WASM_VECTOR_LEN;
|
|
54
|
+
wasm.compute_charges(retptr, ptr0, len0);
|
|
55
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
56
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
57
|
+
deferred2_0 = r0;
|
|
58
|
+
deferred2_1 = r1;
|
|
59
|
+
return getStringFromWasm0(r0, r1);
|
|
60
|
+
} finally {
|
|
61
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
62
|
+
wasm.__wbindgen_export3(deferred2_0, deferred2_1, 1);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Compute molecular dipole moment.
|
|
68
|
+
* @param {string} elements
|
|
69
|
+
* @param {string} coords_flat
|
|
70
|
+
* @returns {string}
|
|
71
|
+
*/
|
|
72
|
+
export function compute_dipole(elements, coords_flat) {
|
|
73
|
+
let deferred3_0;
|
|
74
|
+
let deferred3_1;
|
|
75
|
+
try {
|
|
76
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
77
|
+
const ptr0 = passStringToWasm0(elements, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
78
|
+
const len0 = WASM_VECTOR_LEN;
|
|
79
|
+
const ptr1 = passStringToWasm0(coords_flat, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
80
|
+
const len1 = WASM_VECTOR_LEN;
|
|
81
|
+
wasm.compute_dipole(retptr, ptr0, len0, ptr1, len1);
|
|
82
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
83
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
84
|
+
deferred3_0 = r0;
|
|
85
|
+
deferred3_1 = r1;
|
|
86
|
+
return getStringFromWasm0(r0, r1);
|
|
87
|
+
} finally {
|
|
88
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
89
|
+
wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Compute DOS/PDOS from EHT orbital energies.
|
|
95
|
+
* @param {string} elements
|
|
96
|
+
* @param {string} coords_flat
|
|
97
|
+
* @param {number} sigma
|
|
98
|
+
* @param {number} e_min
|
|
99
|
+
* @param {number} e_max
|
|
100
|
+
* @param {number} n_points
|
|
101
|
+
* @returns {string}
|
|
102
|
+
*/
|
|
103
|
+
export function compute_dos(elements, coords_flat, sigma, e_min, e_max, n_points) {
|
|
104
|
+
let deferred3_0;
|
|
105
|
+
let deferred3_1;
|
|
106
|
+
try {
|
|
107
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
108
|
+
const ptr0 = passStringToWasm0(elements, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
109
|
+
const len0 = WASM_VECTOR_LEN;
|
|
110
|
+
const ptr1 = passStringToWasm0(coords_flat, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
111
|
+
const len1 = WASM_VECTOR_LEN;
|
|
112
|
+
wasm.compute_dos(retptr, ptr0, len0, ptr1, len1, sigma, e_min, e_max, n_points);
|
|
113
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
114
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
115
|
+
deferred3_0 = r0;
|
|
116
|
+
deferred3_1 = r1;
|
|
117
|
+
return getStringFromWasm0(r0, r1);
|
|
118
|
+
} finally {
|
|
119
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
120
|
+
wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Get ESP grid metadata (origin, spacing, dimensions) as JSON.
|
|
126
|
+
* @param {string} elements
|
|
127
|
+
* @param {string} coords_flat
|
|
128
|
+
* @param {number} spacing
|
|
129
|
+
* @param {number} padding
|
|
130
|
+
* @returns {string}
|
|
131
|
+
*/
|
|
132
|
+
export function compute_esp_grid_info(elements, coords_flat, spacing, padding) {
|
|
133
|
+
let deferred3_0;
|
|
134
|
+
let deferred3_1;
|
|
135
|
+
try {
|
|
136
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
137
|
+
const ptr0 = passStringToWasm0(elements, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
138
|
+
const len0 = WASM_VECTOR_LEN;
|
|
139
|
+
const ptr1 = passStringToWasm0(coords_flat, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
140
|
+
const len1 = WASM_VECTOR_LEN;
|
|
141
|
+
wasm.compute_esp_grid_info(retptr, ptr0, len0, ptr1, len1, spacing, padding);
|
|
142
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
143
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
144
|
+
deferred3_0 = r0;
|
|
145
|
+
deferred3_1 = r1;
|
|
146
|
+
return getStringFromWasm0(r0, r1);
|
|
147
|
+
} finally {
|
|
148
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
149
|
+
wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Compute ESP grid and return values as Float64Array (typed-array transfer).
|
|
155
|
+
*
|
|
156
|
+
* Returns Float64Array of grid values. Grid metadata available via compute_esp_grid_info().
|
|
157
|
+
* @param {string} elements
|
|
158
|
+
* @param {string} coords_flat
|
|
159
|
+
* @param {number} spacing
|
|
160
|
+
* @param {number} padding
|
|
161
|
+
* @returns {Float64Array}
|
|
162
|
+
*/
|
|
163
|
+
export function compute_esp_grid_typed(elements, coords_flat, spacing, padding) {
|
|
164
|
+
const ptr0 = passStringToWasm0(elements, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
165
|
+
const len0 = WASM_VECTOR_LEN;
|
|
166
|
+
const ptr1 = passStringToWasm0(coords_flat, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
167
|
+
const len1 = WASM_VECTOR_LEN;
|
|
168
|
+
const ret = wasm.compute_esp_grid_typed(ptr0, len0, ptr1, len1, spacing, padding);
|
|
169
|
+
return takeObject(ret);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Compute Mulliken & Löwdin population analysis.
|
|
174
|
+
* Elements: JSON array of atomic numbers. Coords: JSON array of flat xyz.
|
|
175
|
+
* @param {string} elements
|
|
176
|
+
* @param {string} coords_flat
|
|
177
|
+
* @returns {string}
|
|
178
|
+
*/
|
|
179
|
+
export function compute_population(elements, coords_flat) {
|
|
180
|
+
let deferred3_0;
|
|
181
|
+
let deferred3_1;
|
|
182
|
+
try {
|
|
183
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
184
|
+
const ptr0 = passStringToWasm0(elements, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
185
|
+
const len0 = WASM_VECTOR_LEN;
|
|
186
|
+
const ptr1 = passStringToWasm0(coords_flat, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
187
|
+
const len1 = WASM_VECTOR_LEN;
|
|
188
|
+
wasm.compute_population(retptr, ptr0, len0, ptr1, len1);
|
|
189
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
190
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
191
|
+
deferred3_0 = r0;
|
|
192
|
+
deferred3_1 = r1;
|
|
193
|
+
return getStringFromWasm0(r0, r1);
|
|
194
|
+
} finally {
|
|
195
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
196
|
+
wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Compute RMSD between two coordinate sets after Kabsch alignment.
|
|
202
|
+
* @param {string} coords
|
|
203
|
+
* @param {string} reference
|
|
204
|
+
* @returns {string}
|
|
205
|
+
*/
|
|
206
|
+
export function compute_rmsd(coords, reference) {
|
|
207
|
+
let deferred3_0;
|
|
208
|
+
let deferred3_1;
|
|
209
|
+
try {
|
|
210
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
211
|
+
const ptr0 = passStringToWasm0(coords, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
212
|
+
const len0 = WASM_VECTOR_LEN;
|
|
213
|
+
const ptr1 = passStringToWasm0(reference, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
214
|
+
const len1 = WASM_VECTOR_LEN;
|
|
215
|
+
wasm.compute_rmsd(retptr, ptr0, len0, ptr1, len1);
|
|
216
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
217
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
218
|
+
deferred3_0 = r0;
|
|
219
|
+
deferred3_1 = r1;
|
|
220
|
+
return getStringFromWasm0(r0, r1);
|
|
221
|
+
} finally {
|
|
222
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
223
|
+
wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Compute solvent-accessible surface area from atomic numbers and coordinates.
|
|
229
|
+
*
|
|
230
|
+
* - `elements`: JSON array of atomic numbers, e.g. `[8,1,1]`
|
|
231
|
+
* - `coords_flat`: JSON array of flat xyz coordinates
|
|
232
|
+
* - `probe_radius`: probe radius in Å (pass 0.0 for default 1.4)
|
|
233
|
+
*
|
|
234
|
+
* Returns JSON with total_sasa, atom_sasa, probe_radius, num_points.
|
|
235
|
+
* @param {string} elements
|
|
236
|
+
* @param {string} coords_flat
|
|
237
|
+
* @param {number} probe_radius
|
|
238
|
+
* @returns {string}
|
|
239
|
+
*/
|
|
240
|
+
export function compute_sasa(elements, coords_flat, probe_radius) {
|
|
241
|
+
let deferred3_0;
|
|
242
|
+
let deferred3_1;
|
|
243
|
+
try {
|
|
244
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
245
|
+
const ptr0 = passStringToWasm0(elements, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
246
|
+
const len0 = WASM_VECTOR_LEN;
|
|
247
|
+
const ptr1 = passStringToWasm0(coords_flat, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
248
|
+
const len1 = WASM_VECTOR_LEN;
|
|
249
|
+
wasm.compute_sasa(retptr, ptr0, len0, ptr1, len1, probe_radius);
|
|
250
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
251
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
252
|
+
deferred3_0 = r0;
|
|
253
|
+
deferred3_1 = r1;
|
|
254
|
+
return getStringFromWasm0(r0, r1);
|
|
255
|
+
} finally {
|
|
256
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
257
|
+
wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Compute UFF force field energy.
|
|
263
|
+
* @param {string} smiles
|
|
264
|
+
* @param {string} coords
|
|
265
|
+
* @returns {string}
|
|
266
|
+
*/
|
|
267
|
+
export function compute_uff_energy(smiles, coords) {
|
|
268
|
+
let deferred3_0;
|
|
269
|
+
let deferred3_1;
|
|
270
|
+
try {
|
|
271
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
272
|
+
const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
273
|
+
const len0 = WASM_VECTOR_LEN;
|
|
274
|
+
const ptr1 = passStringToWasm0(coords, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
275
|
+
const len1 = WASM_VECTOR_LEN;
|
|
276
|
+
wasm.compute_uff_energy(retptr, ptr0, len0, ptr1, len1);
|
|
277
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
278
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
279
|
+
deferred3_0 = r0;
|
|
280
|
+
deferred3_1 = r1;
|
|
281
|
+
return getStringFromWasm0(r0, r1);
|
|
282
|
+
} finally {
|
|
283
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
284
|
+
wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Create a unit cell and return parameters + volume as JSON.
|
|
290
|
+
* @param {number} a
|
|
291
|
+
* @param {number} b
|
|
292
|
+
* @param {number} c
|
|
293
|
+
* @param {number} alpha
|
|
294
|
+
* @param {number} beta
|
|
295
|
+
* @param {number} gamma
|
|
296
|
+
* @returns {string}
|
|
297
|
+
*/
|
|
298
|
+
export function create_unit_cell(a, b, c, alpha, beta, gamma) {
|
|
299
|
+
let deferred1_0;
|
|
300
|
+
let deferred1_1;
|
|
301
|
+
try {
|
|
302
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
303
|
+
wasm.create_unit_cell(retptr, a, b, c, alpha, beta, gamma);
|
|
304
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
305
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
306
|
+
deferred1_0 = r0;
|
|
307
|
+
deferred1_1 = r1;
|
|
308
|
+
return getStringFromWasm0(r0, r1);
|
|
309
|
+
} finally {
|
|
310
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
311
|
+
wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Run an EHT calculation on a molecule given its elements and flat XYZ coordinates.
|
|
317
|
+
*
|
|
318
|
+
* - `elements`: JSON array of atomic numbers, e.g. `[8,1,1]`
|
|
319
|
+
* - `coords_flat`: JSON array of flat xyz coordinates `[x0,y0,z0,x1,y1,z1,...]`
|
|
320
|
+
* - `k`: Wolfsberg-Helmholtz constant (pass 0.0 for default 1.75)
|
|
321
|
+
*
|
|
322
|
+
* Returns JSON with energies, coefficients, HOMO/LUMO info.
|
|
323
|
+
* @param {string} elements
|
|
324
|
+
* @param {string} coords_flat
|
|
325
|
+
* @param {number} k
|
|
326
|
+
* @returns {string}
|
|
327
|
+
*/
|
|
328
|
+
export function eht_calculate(elements, coords_flat, k) {
|
|
329
|
+
let deferred3_0;
|
|
330
|
+
let deferred3_1;
|
|
331
|
+
try {
|
|
332
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
333
|
+
const ptr0 = passStringToWasm0(elements, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
334
|
+
const len0 = WASM_VECTOR_LEN;
|
|
335
|
+
const ptr1 = passStringToWasm0(coords_flat, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
336
|
+
const len1 = WASM_VECTOR_LEN;
|
|
337
|
+
wasm.eht_calculate(retptr, ptr0, len0, ptr1, len1, k);
|
|
338
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
339
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
340
|
+
deferred3_0 = r0;
|
|
341
|
+
deferred3_1 = r1;
|
|
342
|
+
return getStringFromWasm0(r0, r1);
|
|
343
|
+
} finally {
|
|
344
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
345
|
+
wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Compute orbital grid from precomputed EHT coefficients as Float32Array.
|
|
351
|
+
* @param {string} elements
|
|
352
|
+
* @param {string} coords_flat
|
|
353
|
+
* @param {string} coefficients_json
|
|
354
|
+
* @param {number} mo_index
|
|
355
|
+
* @param {number} spacing
|
|
356
|
+
* @returns {Float32Array}
|
|
357
|
+
*/
|
|
358
|
+
export function eht_orbital_grid_from_coefficients_typed(elements, coords_flat, coefficients_json, mo_index, spacing) {
|
|
359
|
+
const ptr0 = passStringToWasm0(elements, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
360
|
+
const len0 = WASM_VECTOR_LEN;
|
|
361
|
+
const ptr1 = passStringToWasm0(coords_flat, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
362
|
+
const len1 = WASM_VECTOR_LEN;
|
|
363
|
+
const ptr2 = passStringToWasm0(coefficients_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
364
|
+
const len2 = WASM_VECTOR_LEN;
|
|
365
|
+
const ret = wasm.eht_orbital_grid_from_coefficients_typed(ptr0, len0, ptr1, len1, ptr2, len2, mo_index, spacing);
|
|
366
|
+
return takeObject(ret);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Compute orbital grid as Float32Array (typed-array transfer).
|
|
371
|
+
*
|
|
372
|
+
* Returns the flat volumetric grid as Float32Array for GPU volume rendering.
|
|
373
|
+
* @param {string} elements
|
|
374
|
+
* @param {string} coords_flat
|
|
375
|
+
* @param {number} mo_index
|
|
376
|
+
* @param {number} spacing
|
|
377
|
+
* @returns {Float32Array}
|
|
378
|
+
*/
|
|
379
|
+
export function eht_orbital_grid_typed(elements, coords_flat, mo_index, spacing) {
|
|
380
|
+
const ptr0 = passStringToWasm0(elements, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
381
|
+
const len0 = WASM_VECTOR_LEN;
|
|
382
|
+
const ptr1 = passStringToWasm0(coords_flat, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
383
|
+
const len1 = WASM_VECTOR_LEN;
|
|
384
|
+
const ret = wasm.eht_orbital_grid_typed(ptr0, len0, ptr1, len1, mo_index, spacing);
|
|
385
|
+
return takeObject(ret);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Generate an orbital volumetric grid and extract an isosurface mesh.
|
|
390
|
+
*
|
|
391
|
+
* - `elements`, `coords_flat`: same as `eht_calculate()`
|
|
392
|
+
* - `mo_index`: molecular orbital index (0-based)
|
|
393
|
+
* - `spacing`: grid spacing in Ångström (e.g. 0.2)
|
|
394
|
+
* - `isovalue`: isosurface cutoff (e.g. 0.02)
|
|
395
|
+
*
|
|
396
|
+
* Returns JSON with mesh vertices, normals, indices.
|
|
397
|
+
* @param {string} elements
|
|
398
|
+
* @param {string} coords_flat
|
|
399
|
+
* @param {number} mo_index
|
|
400
|
+
* @param {number} spacing
|
|
401
|
+
* @param {number} isovalue
|
|
402
|
+
* @returns {string}
|
|
403
|
+
*/
|
|
404
|
+
export function eht_orbital_mesh(elements, coords_flat, mo_index, spacing, isovalue) {
|
|
405
|
+
let deferred3_0;
|
|
406
|
+
let deferred3_1;
|
|
407
|
+
try {
|
|
408
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
409
|
+
const ptr0 = passStringToWasm0(elements, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
410
|
+
const len0 = WASM_VECTOR_LEN;
|
|
411
|
+
const ptr1 = passStringToWasm0(coords_flat, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
412
|
+
const len1 = WASM_VECTOR_LEN;
|
|
413
|
+
wasm.eht_orbital_mesh(retptr, ptr0, len0, ptr1, len1, mo_index, spacing, isovalue);
|
|
414
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
415
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
416
|
+
deferred3_0 = r0;
|
|
417
|
+
deferred3_1 = r1;
|
|
418
|
+
return getStringFromWasm0(r0, r1);
|
|
419
|
+
} finally {
|
|
420
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
421
|
+
wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* Generate a 3D conformer from a SMILES string.
|
|
427
|
+
*
|
|
428
|
+
* Returns a JSON string with the full result including atoms, bonds, and coordinates.
|
|
429
|
+
* @param {string} smiles
|
|
430
|
+
* @param {number} seed
|
|
431
|
+
* @returns {string}
|
|
432
|
+
*/
|
|
433
|
+
export function embed(smiles, seed) {
|
|
434
|
+
let deferred2_0;
|
|
435
|
+
let deferred2_1;
|
|
436
|
+
try {
|
|
437
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
438
|
+
const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
439
|
+
const len0 = WASM_VECTOR_LEN;
|
|
440
|
+
wasm.embed(retptr, ptr0, len0, seed);
|
|
441
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
442
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
443
|
+
deferred2_0 = r0;
|
|
444
|
+
deferred2_1 = r1;
|
|
445
|
+
return getStringFromWasm0(r0, r1);
|
|
446
|
+
} finally {
|
|
447
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
448
|
+
wasm.__wbindgen_export3(deferred2_0, deferred2_1, 1);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* Batch-embed multiple molecules from newline-separated SMILES.
|
|
454
|
+
*
|
|
455
|
+
* Returns a JSON array of results.
|
|
456
|
+
* @param {string} smiles_list
|
|
457
|
+
* @param {number} seed
|
|
458
|
+
* @returns {string}
|
|
459
|
+
*/
|
|
460
|
+
export function embed_batch(smiles_list, seed) {
|
|
461
|
+
let deferred2_0;
|
|
462
|
+
let deferred2_1;
|
|
463
|
+
try {
|
|
464
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
465
|
+
const ptr0 = passStringToWasm0(smiles_list, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
466
|
+
const len0 = WASM_VECTOR_LEN;
|
|
467
|
+
wasm.embed_batch(retptr, ptr0, len0, seed);
|
|
468
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
469
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
470
|
+
deferred2_0 = r0;
|
|
471
|
+
deferred2_1 = r1;
|
|
472
|
+
return getStringFromWasm0(r0, r1);
|
|
473
|
+
} finally {
|
|
474
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
475
|
+
wasm.__wbindgen_export3(deferred2_0, deferred2_1, 1);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* Generate 3D coordinates only (compact format).
|
|
481
|
+
*
|
|
482
|
+
* Returns JSON: {"coords": [x0,y0,z0,...], "num_atoms": N} or {"error": "..."}
|
|
483
|
+
* @param {string} smiles
|
|
484
|
+
* @param {number} seed
|
|
485
|
+
* @returns {string}
|
|
486
|
+
*/
|
|
487
|
+
export function embed_coords(smiles, seed) {
|
|
488
|
+
let deferred2_0;
|
|
489
|
+
let deferred2_1;
|
|
490
|
+
try {
|
|
491
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
492
|
+
const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
493
|
+
const len0 = WASM_VECTOR_LEN;
|
|
494
|
+
wasm.embed_coords(retptr, ptr0, len0, seed);
|
|
495
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
496
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
497
|
+
deferred2_0 = r0;
|
|
498
|
+
deferred2_1 = r1;
|
|
499
|
+
return getStringFromWasm0(r0, r1);
|
|
500
|
+
} finally {
|
|
501
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
502
|
+
wasm.__wbindgen_export3(deferred2_0, deferred2_1, 1);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* Generate 3D coordinates as a Float64Array (typed-array transfer).
|
|
508
|
+
*
|
|
509
|
+
* Returns a Float64Array [x0,y0,z0, x1,y1,z1,...] or empty on failure.
|
|
510
|
+
* @param {string} smiles
|
|
511
|
+
* @param {number} seed
|
|
512
|
+
* @returns {Float64Array}
|
|
513
|
+
*/
|
|
514
|
+
export function embed_coords_typed(smiles, seed) {
|
|
515
|
+
const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
516
|
+
const len0 = WASM_VECTOR_LEN;
|
|
517
|
+
const ret = wasm.embed_coords_typed(ptr0, len0, seed);
|
|
518
|
+
return takeObject(ret);
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* Estimate optimal number of Web Workers for a batch size.
|
|
523
|
+
* @param {number} n_items
|
|
524
|
+
* @param {number} max_workers
|
|
525
|
+
* @returns {number}
|
|
526
|
+
*/
|
|
527
|
+
export function estimate_workers(n_items, max_workers) {
|
|
528
|
+
const ret = wasm.estimate_workers(n_items, max_workers);
|
|
529
|
+
return ret >>> 0;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* @param {number} num_threads
|
|
534
|
+
* @returns {Promise<any>}
|
|
535
|
+
*/
|
|
536
|
+
export function initThreadPool(num_threads) {
|
|
537
|
+
const ret = wasm.initThreadPool(num_threads);
|
|
538
|
+
return takeObject(ret);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
* Pack a batch of conformer results into Arrow-compatible columnar format.
|
|
543
|
+
*
|
|
544
|
+
* Input: JSON array of ConformerResult objects.
|
|
545
|
+
* Output: JSON RecordBatch with typed columns for zero-copy transfer.
|
|
546
|
+
* @param {string} results_json
|
|
547
|
+
* @returns {string}
|
|
548
|
+
*/
|
|
549
|
+
export function pack_batch_arrow(results_json) {
|
|
550
|
+
let deferred2_0;
|
|
551
|
+
let deferred2_1;
|
|
552
|
+
try {
|
|
553
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
554
|
+
const ptr0 = passStringToWasm0(results_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
555
|
+
const len0 = WASM_VECTOR_LEN;
|
|
556
|
+
wasm.pack_batch_arrow(retptr, ptr0, len0);
|
|
557
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
558
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
559
|
+
deferred2_0 = r0;
|
|
560
|
+
deferred2_1 = r1;
|
|
561
|
+
return getStringFromWasm0(r0, r1);
|
|
562
|
+
} finally {
|
|
563
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
564
|
+
wasm.__wbindgen_export3(deferred2_0, deferred2_1, 1);
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
/**
|
|
569
|
+
* Parse a SMILES string and return molecular info (no 3D).
|
|
570
|
+
* @param {string} smiles
|
|
571
|
+
* @returns {string}
|
|
572
|
+
*/
|
|
573
|
+
export function parse_smiles(smiles) {
|
|
574
|
+
let deferred2_0;
|
|
575
|
+
let deferred2_1;
|
|
576
|
+
try {
|
|
577
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
578
|
+
const ptr0 = passStringToWasm0(smiles, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
579
|
+
const len0 = WASM_VECTOR_LEN;
|
|
580
|
+
wasm.parse_smiles(retptr, ptr0, len0);
|
|
581
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
582
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
583
|
+
deferred2_0 = r0;
|
|
584
|
+
deferred2_1 = r1;
|
|
585
|
+
return getStringFromWasm0(r0, r1);
|
|
586
|
+
} finally {
|
|
587
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
588
|
+
wasm.__wbindgen_export3(deferred2_0, deferred2_1, 1);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
/**
|
|
593
|
+
* Split a batch of SMILES into worker tasks for Web Worker dispatch.
|
|
594
|
+
*
|
|
595
|
+
* Input: JSON array of SMILES strings.
|
|
596
|
+
* Output: JSON array of WorkerTask objects.
|
|
597
|
+
* @param {string} smiles_json
|
|
598
|
+
* @param {number} n_workers
|
|
599
|
+
* @param {number} seed
|
|
600
|
+
* @returns {string}
|
|
601
|
+
*/
|
|
602
|
+
export function split_worker_tasks(smiles_json, n_workers, seed) {
|
|
603
|
+
let deferred2_0;
|
|
604
|
+
let deferred2_1;
|
|
605
|
+
try {
|
|
606
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
607
|
+
const ptr0 = passStringToWasm0(smiles_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
608
|
+
const len0 = WASM_VECTOR_LEN;
|
|
609
|
+
wasm.split_worker_tasks(retptr, ptr0, len0, n_workers, seed);
|
|
610
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
611
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
612
|
+
deferred2_0 = r0;
|
|
613
|
+
deferred2_1 = r1;
|
|
614
|
+
return getStringFromWasm0(r0, r1);
|
|
615
|
+
} finally {
|
|
616
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
617
|
+
wasm.__wbindgen_export3(deferred2_0, deferred2_1, 1);
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
/**
|
|
622
|
+
* Library version.
|
|
623
|
+
* @returns {string}
|
|
624
|
+
*/
|
|
625
|
+
export function version() {
|
|
626
|
+
let deferred1_0;
|
|
627
|
+
let deferred1_1;
|
|
628
|
+
try {
|
|
629
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
630
|
+
wasm.version(retptr);
|
|
631
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
632
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
633
|
+
deferred1_0 = r0;
|
|
634
|
+
deferred1_1 = r1;
|
|
635
|
+
return getStringFromWasm0(r0, r1);
|
|
636
|
+
} finally {
|
|
637
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
638
|
+
wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
export class wbg_rayon_PoolBuilder {
|
|
643
|
+
static __wrap(ptr) {
|
|
644
|
+
ptr = ptr >>> 0;
|
|
645
|
+
const obj = Object.create(wbg_rayon_PoolBuilder.prototype);
|
|
646
|
+
obj.__wbg_ptr = ptr;
|
|
647
|
+
wbg_rayon_PoolBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
648
|
+
return obj;
|
|
649
|
+
}
|
|
650
|
+
__destroy_into_raw() {
|
|
651
|
+
const ptr = this.__wbg_ptr;
|
|
652
|
+
this.__wbg_ptr = 0;
|
|
653
|
+
wbg_rayon_PoolBuilderFinalization.unregister(this);
|
|
654
|
+
return ptr;
|
|
655
|
+
}
|
|
656
|
+
free() {
|
|
657
|
+
const ptr = this.__destroy_into_raw();
|
|
658
|
+
wasm.__wbg_wbg_rayon_poolbuilder_free(ptr, 0);
|
|
659
|
+
}
|
|
660
|
+
build() {
|
|
661
|
+
wasm.wbg_rayon_poolbuilder_build(this.__wbg_ptr);
|
|
662
|
+
}
|
|
663
|
+
/**
|
|
664
|
+
* @returns {number}
|
|
665
|
+
*/
|
|
666
|
+
numThreads() {
|
|
667
|
+
const ret = wasm.wbg_rayon_poolbuilder_numThreads(this.__wbg_ptr);
|
|
668
|
+
return ret >>> 0;
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
* @returns {number}
|
|
672
|
+
*/
|
|
673
|
+
receiver() {
|
|
674
|
+
const ret = wasm.wbg_rayon_poolbuilder_receiver(this.__wbg_ptr);
|
|
675
|
+
return ret >>> 0;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
if (Symbol.dispose) wbg_rayon_PoolBuilder.prototype[Symbol.dispose] = wbg_rayon_PoolBuilder.prototype.free;
|
|
679
|
+
|
|
680
|
+
/**
|
|
681
|
+
* @param {number} receiver
|
|
682
|
+
*/
|
|
683
|
+
export function wbg_rayon_start_worker(receiver) {
|
|
684
|
+
wasm.wbg_rayon_start_worker(receiver);
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
function __wbg_get_imports(memory) {
|
|
688
|
+
const import0 = {
|
|
689
|
+
__proto__: null,
|
|
690
|
+
__wbg___wbindgen_is_undefined_52709e72fb9f179c: function(arg0) {
|
|
691
|
+
const ret = getObject(arg0) === undefined;
|
|
692
|
+
return ret;
|
|
693
|
+
},
|
|
694
|
+
__wbg___wbindgen_memory_edb3f01e3930bbf6: function() {
|
|
695
|
+
const ret = wasm.memory;
|
|
696
|
+
return addHeapObject(ret);
|
|
697
|
+
},
|
|
698
|
+
__wbg___wbindgen_module_bf945c07123bafe2: function() {
|
|
699
|
+
const ret = wasmModule;
|
|
700
|
+
return addHeapObject(ret);
|
|
701
|
+
},
|
|
702
|
+
__wbg___wbindgen_throw_6ddd609b62940d55: function(arg0, arg1) {
|
|
703
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
704
|
+
},
|
|
705
|
+
__wbg_instanceof_Window_23e677d2c6843922: function(arg0) {
|
|
706
|
+
let result;
|
|
707
|
+
try {
|
|
708
|
+
result = getObject(arg0) instanceof Window;
|
|
709
|
+
} catch (_) {
|
|
710
|
+
result = false;
|
|
711
|
+
}
|
|
712
|
+
const ret = result;
|
|
713
|
+
return ret;
|
|
714
|
+
},
|
|
715
|
+
__wbg_length_259ee9d041e381ad: function(arg0) {
|
|
716
|
+
const ret = getObject(arg0).length;
|
|
717
|
+
return ret;
|
|
718
|
+
},
|
|
719
|
+
__wbg_length_550d8a396009cd38: function(arg0) {
|
|
720
|
+
const ret = getObject(arg0).length;
|
|
721
|
+
return ret;
|
|
722
|
+
},
|
|
723
|
+
__wbg_new_with_length_81c1c31d4432cb9f: function(arg0) {
|
|
724
|
+
const ret = new Float32Array(arg0 >>> 0);
|
|
725
|
+
return addHeapObject(ret);
|
|
726
|
+
},
|
|
727
|
+
__wbg_new_with_length_eae667475c36c4e4: function(arg0) {
|
|
728
|
+
const ret = new Float64Array(arg0 >>> 0);
|
|
729
|
+
return addHeapObject(ret);
|
|
730
|
+
},
|
|
731
|
+
__wbg_set_361bc2460da3016f: function(arg0, arg1, arg2) {
|
|
732
|
+
getObject(arg0).set(getArrayF32FromWasm0(arg1, arg2));
|
|
733
|
+
},
|
|
734
|
+
__wbg_set_636d1e3e4286e068: function(arg0, arg1, arg2) {
|
|
735
|
+
getObject(arg0).set(getArrayF64FromWasm0(arg1, arg2));
|
|
736
|
+
},
|
|
737
|
+
__wbg_startWorkers_8b582d57e92bd2d4: function(arg0, arg1, arg2) {
|
|
738
|
+
const ret = startWorkers(takeObject(arg0), takeObject(arg1), wbg_rayon_PoolBuilder.__wrap(arg2));
|
|
739
|
+
return addHeapObject(ret);
|
|
740
|
+
},
|
|
741
|
+
__wbg_static_accessor_GLOBAL_8adb955bd33fac2f: function() {
|
|
742
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
743
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
744
|
+
},
|
|
745
|
+
__wbg_static_accessor_GLOBAL_THIS_ad356e0db91c7913: function() {
|
|
746
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
747
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
748
|
+
},
|
|
749
|
+
__wbg_static_accessor_SELF_f207c857566db248: function() {
|
|
750
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
751
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
752
|
+
},
|
|
753
|
+
__wbg_static_accessor_WINDOW_bb9f1ba69d61b386: function() {
|
|
754
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
755
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
756
|
+
},
|
|
757
|
+
__wbindgen_object_clone_ref: function(arg0) {
|
|
758
|
+
const ret = getObject(arg0);
|
|
759
|
+
return addHeapObject(ret);
|
|
760
|
+
},
|
|
761
|
+
__wbindgen_object_drop_ref: function(arg0) {
|
|
762
|
+
takeObject(arg0);
|
|
763
|
+
},
|
|
764
|
+
memory: memory || new WebAssembly.Memory({initial:20,maximum:16384,shared:true}),
|
|
765
|
+
};
|
|
766
|
+
return {
|
|
767
|
+
__proto__: null,
|
|
768
|
+
"./sci_form_wasm_bg.js": import0,
|
|
769
|
+
};
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
const wbg_rayon_PoolBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
773
|
+
? { register: () => {}, unregister: () => {} }
|
|
774
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wbg_rayon_poolbuilder_free(ptr >>> 0, 1));
|
|
775
|
+
|
|
776
|
+
function addHeapObject(obj) {
|
|
777
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
778
|
+
const idx = heap_next;
|
|
779
|
+
heap_next = heap[idx];
|
|
780
|
+
|
|
781
|
+
heap[idx] = obj;
|
|
782
|
+
return idx;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
function dropObject(idx) {
|
|
786
|
+
if (idx < 1028) return;
|
|
787
|
+
heap[idx] = heap_next;
|
|
788
|
+
heap_next = idx;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
function getArrayF32FromWasm0(ptr, len) {
|
|
792
|
+
ptr = ptr >>> 0;
|
|
793
|
+
return getFloat32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
function getArrayF64FromWasm0(ptr, len) {
|
|
797
|
+
ptr = ptr >>> 0;
|
|
798
|
+
return getFloat64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len);
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
let cachedDataViewMemory0 = null;
|
|
802
|
+
function getDataViewMemory0() {
|
|
803
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
|
|
804
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
805
|
+
}
|
|
806
|
+
return cachedDataViewMemory0;
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
let cachedFloat32ArrayMemory0 = null;
|
|
810
|
+
function getFloat32ArrayMemory0() {
|
|
811
|
+
if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.buffer !== wasm.memory.buffer) {
|
|
812
|
+
cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer);
|
|
813
|
+
}
|
|
814
|
+
return cachedFloat32ArrayMemory0;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
let cachedFloat64ArrayMemory0 = null;
|
|
818
|
+
function getFloat64ArrayMemory0() {
|
|
819
|
+
if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.buffer !== wasm.memory.buffer) {
|
|
820
|
+
cachedFloat64ArrayMemory0 = new Float64Array(wasm.memory.buffer);
|
|
821
|
+
}
|
|
822
|
+
return cachedFloat64ArrayMemory0;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
function getStringFromWasm0(ptr, len) {
|
|
826
|
+
ptr = ptr >>> 0;
|
|
827
|
+
return decodeText(ptr, len);
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
let cachedUint8ArrayMemory0 = null;
|
|
831
|
+
function getUint8ArrayMemory0() {
|
|
832
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.buffer !== wasm.memory.buffer) {
|
|
833
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
834
|
+
}
|
|
835
|
+
return cachedUint8ArrayMemory0;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
function getObject(idx) { return heap[idx]; }
|
|
839
|
+
|
|
840
|
+
let heap = new Array(1024).fill(undefined);
|
|
841
|
+
heap.push(undefined, null, true, false);
|
|
842
|
+
|
|
843
|
+
let heap_next = heap.length;
|
|
844
|
+
|
|
845
|
+
function isLikeNone(x) {
|
|
846
|
+
return x === undefined || x === null;
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
850
|
+
if (realloc === undefined) {
|
|
851
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
852
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
853
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
854
|
+
WASM_VECTOR_LEN = buf.length;
|
|
855
|
+
return ptr;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
let len = arg.length;
|
|
859
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
860
|
+
|
|
861
|
+
const mem = getUint8ArrayMemory0();
|
|
862
|
+
|
|
863
|
+
let offset = 0;
|
|
864
|
+
|
|
865
|
+
for (; offset < len; offset++) {
|
|
866
|
+
const code = arg.charCodeAt(offset);
|
|
867
|
+
if (code > 0x7F) break;
|
|
868
|
+
mem[ptr + offset] = code;
|
|
869
|
+
}
|
|
870
|
+
if (offset !== len) {
|
|
871
|
+
if (offset !== 0) {
|
|
872
|
+
arg = arg.slice(offset);
|
|
873
|
+
}
|
|
874
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
875
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
876
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
877
|
+
|
|
878
|
+
offset += ret.written;
|
|
879
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
WASM_VECTOR_LEN = offset;
|
|
883
|
+
return ptr;
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
function takeObject(idx) {
|
|
887
|
+
const ret = getObject(idx);
|
|
888
|
+
dropObject(idx);
|
|
889
|
+
return ret;
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
let cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : undefined);
|
|
893
|
+
if (cachedTextDecoder) cachedTextDecoder.decode();
|
|
894
|
+
|
|
895
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
896
|
+
let numBytesDecoded = 0;
|
|
897
|
+
function decodeText(ptr, len) {
|
|
898
|
+
numBytesDecoded += len;
|
|
899
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
900
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
901
|
+
cachedTextDecoder.decode();
|
|
902
|
+
numBytesDecoded = len;
|
|
903
|
+
}
|
|
904
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().slice(ptr, ptr + len));
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder() : undefined);
|
|
908
|
+
|
|
909
|
+
if (cachedTextEncoder) {
|
|
910
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
911
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
912
|
+
view.set(buf);
|
|
913
|
+
return {
|
|
914
|
+
read: arg.length,
|
|
915
|
+
written: buf.length
|
|
916
|
+
};
|
|
917
|
+
};
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
let WASM_VECTOR_LEN = 0;
|
|
921
|
+
|
|
922
|
+
let wasmModule, wasm;
|
|
923
|
+
function __wbg_finalize_init(instance, module, thread_stack_size) {
|
|
924
|
+
wasm = instance.exports;
|
|
925
|
+
wasmModule = module;
|
|
926
|
+
cachedDataViewMemory0 = null;
|
|
927
|
+
cachedFloat32ArrayMemory0 = null;
|
|
928
|
+
cachedFloat64ArrayMemory0 = null;
|
|
929
|
+
cachedUint8ArrayMemory0 = null;
|
|
930
|
+
if (typeof thread_stack_size !== 'undefined' && (typeof thread_stack_size !== 'number' || thread_stack_size === 0 || thread_stack_size % 65536 !== 0)) {
|
|
931
|
+
throw new Error('invalid stack size');
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
wasm.__wbindgen_start(thread_stack_size);
|
|
935
|
+
return wasm;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
async function __wbg_load(module, imports) {
|
|
939
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
940
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
941
|
+
try {
|
|
942
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
943
|
+
} catch (e) {
|
|
944
|
+
const validResponse = module.ok && expectedResponseType(module.type);
|
|
945
|
+
|
|
946
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
947
|
+
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);
|
|
948
|
+
|
|
949
|
+
} else { throw e; }
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
const bytes = await module.arrayBuffer();
|
|
954
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
955
|
+
} else {
|
|
956
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
957
|
+
|
|
958
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
959
|
+
return { instance, module };
|
|
960
|
+
} else {
|
|
961
|
+
return instance;
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
function expectedResponseType(type) {
|
|
966
|
+
switch (type) {
|
|
967
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
968
|
+
}
|
|
969
|
+
return false;
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
function initSync(module, memory) {
|
|
974
|
+
if (wasm !== undefined) return wasm;
|
|
975
|
+
|
|
976
|
+
let thread_stack_size
|
|
977
|
+
if (module !== undefined) {
|
|
978
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
979
|
+
({module, memory, thread_stack_size} = module)
|
|
980
|
+
} else {
|
|
981
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
const imports = __wbg_get_imports(memory);
|
|
986
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
987
|
+
module = new WebAssembly.Module(module);
|
|
988
|
+
}
|
|
989
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
990
|
+
return __wbg_finalize_init(instance, module, thread_stack_size);
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
async function __wbg_init(module_or_path, memory) {
|
|
994
|
+
if (wasm !== undefined) return wasm;
|
|
995
|
+
|
|
996
|
+
let thread_stack_size
|
|
997
|
+
if (module_or_path !== undefined) {
|
|
998
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
999
|
+
({module_or_path, memory, thread_stack_size} = module_or_path)
|
|
1000
|
+
} else {
|
|
1001
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
if (module_or_path === undefined) {
|
|
1006
|
+
module_or_path = new URL('sci_form_wasm_bg.wasm', import.meta.url);
|
|
1007
|
+
}
|
|
1008
|
+
const imports = __wbg_get_imports(memory);
|
|
1009
|
+
|
|
1010
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
1011
|
+
module_or_path = fetch(module_or_path);
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
1015
|
+
|
|
1016
|
+
return __wbg_finalize_init(instance, module, thread_stack_size);
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
export { initSync, __wbg_init as default };
|