@quillmark/wasm 0.46.0 → 0.48.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.
@@ -1,251 +1,4 @@
1
- let wasm;
2
- export function __wbg_set_wasm(val) {
3
- wasm = val;
4
- }
5
-
6
-
7
- let cachedUint8ArrayMemory0 = null;
8
-
9
- function getUint8ArrayMemory0() {
10
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
11
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
12
- }
13
- return cachedUint8ArrayMemory0;
14
- }
15
-
16
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
17
-
18
- cachedTextDecoder.decode();
19
-
20
- const MAX_SAFARI_DECODE_BYTES = 2146435072;
21
- let numBytesDecoded = 0;
22
- function decodeText(ptr, len) {
23
- numBytesDecoded += len;
24
- if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
25
- cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
26
- cachedTextDecoder.decode();
27
- numBytesDecoded = len;
28
- }
29
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
30
- }
31
-
32
- function getStringFromWasm0(ptr, len) {
33
- ptr = ptr >>> 0;
34
- return decodeText(ptr, len);
35
- }
36
-
37
- let heap = new Array(128).fill(undefined);
38
-
39
- heap.push(undefined, null, true, false);
40
-
41
- let heap_next = heap.length;
42
-
43
- function addHeapObject(obj) {
44
- if (heap_next === heap.length) heap.push(heap.length + 1);
45
- const idx = heap_next;
46
- heap_next = heap[idx];
47
-
48
- heap[idx] = obj;
49
- return idx;
50
- }
51
-
52
- function getObject(idx) { return heap[idx]; }
53
-
54
- let WASM_VECTOR_LEN = 0;
55
-
56
- const cachedTextEncoder = new TextEncoder();
57
-
58
- if (!('encodeInto' in cachedTextEncoder)) {
59
- cachedTextEncoder.encodeInto = function (arg, view) {
60
- const buf = cachedTextEncoder.encode(arg);
61
- view.set(buf);
62
- return {
63
- read: arg.length,
64
- written: buf.length
65
- };
66
- }
67
- }
68
-
69
- function passStringToWasm0(arg, malloc, realloc) {
70
-
71
- if (realloc === undefined) {
72
- const buf = cachedTextEncoder.encode(arg);
73
- const ptr = malloc(buf.length, 1) >>> 0;
74
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
75
- WASM_VECTOR_LEN = buf.length;
76
- return ptr;
77
- }
78
-
79
- let len = arg.length;
80
- let ptr = malloc(len, 1) >>> 0;
81
-
82
- const mem = getUint8ArrayMemory0();
83
-
84
- let offset = 0;
85
-
86
- for (; offset < len; offset++) {
87
- const code = arg.charCodeAt(offset);
88
- if (code > 0x7F) break;
89
- mem[ptr + offset] = code;
90
- }
91
-
92
- if (offset !== len) {
93
- if (offset !== 0) {
94
- arg = arg.slice(offset);
95
- }
96
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
97
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
98
- const ret = cachedTextEncoder.encodeInto(arg, view);
99
-
100
- offset += ret.written;
101
- ptr = realloc(ptr, len, offset, 1) >>> 0;
102
- }
103
-
104
- WASM_VECTOR_LEN = offset;
105
- return ptr;
106
- }
107
-
108
- let cachedDataViewMemory0 = null;
109
-
110
- function getDataViewMemory0() {
111
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
112
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
113
- }
114
- return cachedDataViewMemory0;
115
- }
116
-
117
- function handleError(f, args) {
118
- try {
119
- return f.apply(this, args);
120
- } catch (e) {
121
- wasm.__wbindgen_export_2(addHeapObject(e));
122
- }
123
- }
124
-
125
- function getArrayU8FromWasm0(ptr, len) {
126
- ptr = ptr >>> 0;
127
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
128
- }
129
-
130
- function dropObject(idx) {
131
- if (idx < 132) return;
132
- heap[idx] = heap_next;
133
- heap_next = idx;
134
- }
135
-
136
- function takeObject(idx) {
137
- const ret = getObject(idx);
138
- dropObject(idx);
139
- return ret;
140
- }
141
-
142
- function isLikeNone(x) {
143
- return x === undefined || x === null;
144
- }
145
-
146
- function debugString(val) {
147
- // primitive types
148
- const type = typeof val;
149
- if (type == 'number' || type == 'boolean' || val == null) {
150
- return `${val}`;
151
- }
152
- if (type == 'string') {
153
- return `"${val}"`;
154
- }
155
- if (type == 'symbol') {
156
- const description = val.description;
157
- if (description == null) {
158
- return 'Symbol';
159
- } else {
160
- return `Symbol(${description})`;
161
- }
162
- }
163
- if (type == 'function') {
164
- const name = val.name;
165
- if (typeof name == 'string' && name.length > 0) {
166
- return `Function(${name})`;
167
- } else {
168
- return 'Function';
169
- }
170
- }
171
- // objects
172
- if (Array.isArray(val)) {
173
- const length = val.length;
174
- let debug = '[';
175
- if (length > 0) {
176
- debug += debugString(val[0]);
177
- }
178
- for(let i = 1; i < length; i++) {
179
- debug += ', ' + debugString(val[i]);
180
- }
181
- debug += ']';
182
- return debug;
183
- }
184
- // Test for built-in
185
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
186
- let className;
187
- if (builtInMatches && builtInMatches.length > 1) {
188
- className = builtInMatches[1];
189
- } else {
190
- // Failed to match the standard '[object ClassName]'
191
- return toString.call(val);
192
- }
193
- if (className == 'Object') {
194
- // we're a user defined class or Object
195
- // JSON.stringify avoids problems with cycles, and is generally much
196
- // easier than looping through ownProperties of `val`.
197
- try {
198
- return 'Object(' + JSON.stringify(val) + ')';
199
- } catch (_) {
200
- return 'Object';
201
- }
202
- }
203
- // errors
204
- if (val instanceof Error) {
205
- return `${val.name}: ${val.message}\n${val.stack}`;
206
- }
207
- // TODO we could test for more things here, like `Set`s and `Map`s.
208
- return className;
209
- }
210
- /**
211
- * Initialize the WASM module with panic hooks for better error messages
212
- */
213
- export function init() {
214
- wasm.init();
215
- }
216
-
217
- let cachedUint32ArrayMemory0 = null;
218
-
219
- function getUint32ArrayMemory0() {
220
- if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
221
- cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
222
- }
223
- return cachedUint32ArrayMemory0;
224
- }
225
-
226
- function passArray32ToWasm0(arg, malloc) {
227
- const ptr = malloc(arg.length * 4, 4) >>> 0;
228
- getUint32ArrayMemory0().set(arg, ptr / 4);
229
- WASM_VECTOR_LEN = arg.length;
230
- return ptr;
231
- }
232
-
233
- function getArrayJsValueFromWasm0(ptr, len) {
234
- ptr = ptr >>> 0;
235
- const mem = getDataViewMemory0();
236
- const result = [];
237
- for (let i = ptr; i < ptr + 4 * len; i += 4) {
238
- result.push(takeObject(mem.getUint32(i, true)));
239
- }
240
- return result;
241
- }
242
-
243
- const CompiledDocumentFinalization = (typeof FinalizationRegistry === 'undefined')
244
- ? { register: () => {}, unregister: () => {} }
245
- : new FinalizationRegistry(ptr => wasm.__wbg_compileddocument_free(ptr >>> 0, 1));
246
-
247
1
  export class CompiledDocument {
248
-
249
2
  static __wrap(ptr) {
250
3
  ptr = ptr >>> 0;
251
4
  const obj = Object.create(CompiledDocument.prototype);
@@ -253,14 +6,12 @@ export class CompiledDocument {
253
6
  CompiledDocumentFinalization.register(obj, obj.__wbg_ptr, obj);
254
7
  return obj;
255
8
  }
256
-
257
9
  __destroy_into_raw() {
258
10
  const ptr = this.__wbg_ptr;
259
11
  this.__wbg_ptr = 0;
260
12
  CompiledDocumentFinalization.unregister(this);
261
13
  return ptr;
262
14
  }
263
-
264
15
  free() {
265
16
  const ptr = this.__destroy_into_raw();
266
17
  wasm.__wbg_compileddocument_free(ptr, 0);
@@ -282,7 +33,7 @@ export class CompiledDocument {
282
33
  renderPages(pages, opts) {
283
34
  try {
284
35
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
285
- var ptr0 = isLikeNone(pages) ? 0 : passArray32ToWasm0(pages, wasm.__wbindgen_export_0);
36
+ var ptr0 = isLikeNone(pages) ? 0 : passArray32ToWasm0(pages, wasm.__wbindgen_export);
286
37
  var len0 = WASM_VECTOR_LEN;
287
38
  wasm.compileddocument_renderPages(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(opts));
288
39
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
@@ -299,42 +50,39 @@ export class CompiledDocument {
299
50
  }
300
51
  if (Symbol.dispose) CompiledDocument.prototype[Symbol.dispose] = CompiledDocument.prototype.free;
301
52
 
302
- const QuillmarkFinalization = (typeof FinalizationRegistry === 'undefined')
303
- ? { register: () => {}, unregister: () => {} }
304
- : new FinalizationRegistry(ptr => wasm.__wbg_quillmark_free(ptr >>> 0, 1));
305
53
  /**
306
54
  * Quillmark WASM Engine
307
55
  *
308
56
  * Create once, register Quills, render markdown. That's it.
309
57
  */
310
58
  export class Quillmark {
311
-
312
59
  __destroy_into_raw() {
313
60
  const ptr = this.__wbg_ptr;
314
61
  this.__wbg_ptr = 0;
315
62
  QuillmarkFinalization.unregister(this);
316
63
  return ptr;
317
64
  }
318
-
319
65
  free() {
320
66
  const ptr = this.__destroy_into_raw();
321
67
  wasm.__wbg_quillmark_free(ptr, 0);
322
68
  }
323
69
  /**
324
- * List registered Quills with their exact versions
325
- *
326
- * Returns strings in the format "name@version" (e.g. "resume-template@2.1.0")
327
- * @returns {string[]}
328
- */
329
- listQuills() {
70
+ * Compile a parsed document into an opaque compiled document handle.
71
+ * @param {ParsedDocument} parsed
72
+ * @param {CompileOptions | null} [opts]
73
+ * @returns {CompiledDocument}
74
+ */
75
+ compile(parsed, opts) {
330
76
  try {
331
77
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
332
- wasm.quillmark_listQuills(retptr, this.__wbg_ptr);
78
+ wasm.quillmark_compile(retptr, this.__wbg_ptr, addHeapObject(parsed), isLikeNone(opts) ? 0 : addHeapObject(opts));
333
79
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
334
80
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
335
- var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
336
- wasm.__wbindgen_export_3(r0, r1 * 4, 4);
337
- return v1;
81
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
82
+ if (r2) {
83
+ throw takeObject(r1);
84
+ }
85
+ return CompiledDocument.__wrap(r0);
338
86
  } finally {
339
87
  wasm.__wbindgen_add_to_stack_pointer(16);
340
88
  }
@@ -350,7 +98,7 @@ export class Quillmark {
350
98
  compileData(markdown) {
351
99
  try {
352
100
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
353
- const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
101
+ const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export, wasm.__wbindgen_export2);
354
102
  const len0 = WASM_VECTOR_LEN;
355
103
  wasm.quillmark_compileData(retptr, this.__wbg_ptr, ptr0, len0);
356
104
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
@@ -365,19 +113,31 @@ export class Quillmark {
365
113
  }
366
114
  }
367
115
  /**
368
- * Resolve a Quill reference to a registered Quill, or null if not available
116
+ * Perform a dry run validation without backend compilation.
369
117
  *
370
- * Accepts a quill reference string like "resume-template", "resume-template@2",
371
- * or "resume-template@2.1.0". Returns QuillInfo if the engine can resolve it
372
- * locally, or null if an external fetch is needed.
373
- * @param {string} quill_ref
374
- * @returns {any}
118
+ * Executes parsing, schema validation, and template composition to
119
+ * surface input errors quickly. Returns successfully on valid input,
120
+ * or throws an error with diagnostic payload on failure.
121
+ *
122
+ * The quill name is inferred from the markdown's QUILL tag (or defaults to "__default__").
123
+ *
124
+ * This is useful for fast feedback loops in LLM-driven document generation.
125
+ * @param {string} markdown
375
126
  */
376
- resolveQuill(quill_ref) {
377
- const ptr0 = passStringToWasm0(quill_ref, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
378
- const len0 = WASM_VECTOR_LEN;
379
- const ret = wasm.quillmark_resolveQuill(this.__wbg_ptr, ptr0, len0);
380
- return takeObject(ret);
127
+ dryRun(markdown) {
128
+ try {
129
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
130
+ const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export, wasm.__wbindgen_export2);
131
+ const len0 = WASM_VECTOR_LEN;
132
+ wasm.quillmark_dryRun(retptr, this.__wbg_ptr, ptr0, len0);
133
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
134
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
135
+ if (r1) {
136
+ throw takeObject(r0);
137
+ }
138
+ } finally {
139
+ wasm.__wbindgen_add_to_stack_pointer(16);
140
+ }
381
141
  }
382
142
  /**
383
143
  * Get shallow information about a registered Quill
@@ -390,7 +150,7 @@ export class Quillmark {
390
150
  getQuillInfo(name) {
391
151
  try {
392
152
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
393
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
153
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
394
154
  const len0 = WASM_VECTOR_LEN;
395
155
  wasm.quillmark_getQuillInfo(retptr, this.__wbg_ptr, ptr0, len0);
396
156
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
@@ -405,19 +165,20 @@ export class Quillmark {
405
165
  }
406
166
  }
407
167
  /**
408
- * Parse markdown into a ParsedDocument
168
+ * Get the AI-projected JSON schema of a Quill (strips UI metadata and CARDS)
409
169
  *
410
- * This is the first step in the workflow. The returned ParsedDocument contains
411
- * the parsed YAML frontmatter fields and the quill_ref (from QUILL field or "__default__").
412
- * @param {string} markdown
413
- * @returns {ParsedDocument}
170
+ * This returns the schema in a format suitable for feeding to LLMs or
171
+ * other consumers that don't need the UI configuration "x-ui" fields
172
+ * or the internal CARDS array structure.
173
+ * @param {string} name
174
+ * @returns {any}
414
175
  */
415
- static parseMarkdown(markdown) {
176
+ getStrippedSchema(name) {
416
177
  try {
417
178
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
418
- const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
179
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
419
180
  const len0 = WASM_VECTOR_LEN;
420
- wasm.quillmark_parseMarkdown(retptr, ptr0, len0);
181
+ wasm.quillmark_getStrippedSchema(retptr, this.__wbg_ptr, ptr0, len0);
421
182
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
422
183
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
423
184
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -430,58 +191,47 @@ export class Quillmark {
430
191
  }
431
192
  }
432
193
  /**
433
- * Register a Quill template bundle
194
+ * List registered Quills with their exact versions
434
195
  *
435
- * Accepts either a JSON string or a JsValue object representing the Quill file tree.
436
- * Validation happens automatically on registration.
437
- * @param {any} quill_json
438
- * @returns {QuillInfo}
196
+ * Returns strings in the format "name@version" (e.g. "resume-template@2.1.0")
197
+ * @returns {string[]}
439
198
  */
440
- registerQuill(quill_json) {
199
+ listQuills() {
441
200
  try {
442
201
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
443
- wasm.quillmark_registerQuill(retptr, this.__wbg_ptr, addHeapObject(quill_json));
202
+ wasm.quillmark_listQuills(retptr, this.__wbg_ptr);
444
203
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
445
204
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
446
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
447
- if (r2) {
448
- throw takeObject(r1);
449
- }
450
- return takeObject(r0);
205
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
206
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
207
+ return v1;
451
208
  } finally {
452
209
  wasm.__wbindgen_add_to_stack_pointer(16);
453
210
  }
454
211
  }
455
212
  /**
456
- * Unregister a Quill by name or specific version
457
- *
458
- * If a base name is provided (e.g., "my-quill"), all versions of that quill are freed.
459
- * If a versioned name is provided (e.g., "my-quill@2.1.0"), only that specific version is freed.
460
- * Returns true if something was unregistered, false if not found.
461
- * @param {string} name_or_ref
462
- * @returns {boolean}
213
+ * JavaScript constructor: `new Quillmark()`
463
214
  */
464
- unregisterQuill(name_or_ref) {
465
- const ptr0 = passStringToWasm0(name_or_ref, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
466
- const len0 = WASM_VECTOR_LEN;
467
- const ret = wasm.quillmark_unregisterQuill(this.__wbg_ptr, ptr0, len0);
468
- return ret !== 0;
215
+ constructor() {
216
+ const ret = wasm.quillmark_new();
217
+ this.__wbg_ptr = ret >>> 0;
218
+ QuillmarkFinalization.register(this, this.__wbg_ptr, this);
219
+ return this;
469
220
  }
470
221
  /**
471
- * Get the AI-projected JSON schema of a Quill (strips UI metadata and CARDS)
222
+ * Parse markdown into a ParsedDocument
472
223
  *
473
- * This returns the schema in a format suitable for feeding to LLMs or
474
- * other consumers that don't need the UI configuration "x-ui" fields
475
- * or the internal CARDS array structure.
476
- * @param {string} name
477
- * @returns {any}
224
+ * This is the first step in the workflow. The returned ParsedDocument contains
225
+ * the parsed YAML frontmatter fields and the quill_ref (from QUILL field or "__default__").
226
+ * @param {string} markdown
227
+ * @returns {ParsedDocument}
478
228
  */
479
- getStrippedSchema(name) {
229
+ static parseMarkdown(markdown) {
480
230
  try {
481
231
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
482
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
232
+ const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export, wasm.__wbindgen_export2);
483
233
  const len0 = WASM_VECTOR_LEN;
484
- wasm.quillmark_getStrippedSchema(retptr, this.__wbg_ptr, ptr0, len0);
234
+ wasm.quillmark_parseMarkdown(retptr, ptr0, len0);
485
235
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
486
236
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
487
237
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -494,28 +244,17 @@ export class Quillmark {
494
244
  }
495
245
  }
496
246
  /**
497
- * JavaScript constructor: `new Quillmark()`
498
- */
499
- constructor() {
500
- const ret = wasm.quillmark_new();
501
- this.__wbg_ptr = ret >>> 0;
502
- QuillmarkFinalization.register(this, this.__wbg_ptr, this);
503
- return this;
504
- }
505
- /**
506
- * Render a ParsedDocument to final artifacts (PDF, SVG, TXT)
247
+ * Register a Quill template bundle
507
248
  *
508
- * Note that the quill reference is optional to specify and can be inferred from the markdown content's frontmatter.
509
- * Uses the Quill specified in options.quill_ref if provided,
510
- * otherwise infers it from the ParsedDocument's quill_ref field.
511
- * @param {ParsedDocument} parsed
512
- * @param {RenderOptions} opts
513
- * @returns {RenderResult}
249
+ * Accepts either a JSON string or a JsValue object representing the Quill file tree.
250
+ * Validation happens automatically on registration.
251
+ * @param {any} quill_json
252
+ * @returns {QuillInfo}
514
253
  */
515
- render(parsed, opts) {
254
+ registerQuill(quill_json) {
516
255
  try {
517
256
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
518
- wasm.quillmark_render(retptr, this.__wbg_ptr, addHeapObject(parsed), addHeapObject(opts));
257
+ wasm.quillmark_registerQuill(retptr, this.__wbg_ptr, addHeapObject(quill_json));
519
258
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
520
259
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
521
260
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -528,136 +267,207 @@ export class Quillmark {
528
267
  }
529
268
  }
530
269
  /**
531
- * Compile a parsed document into an opaque compiled document handle.
270
+ * Render a ParsedDocument to final artifacts (PDF, SVG, TXT)
271
+ *
272
+ * Note that the quill reference is optional to specify and can be inferred from the markdown content's frontmatter.
273
+ * Uses the Quill specified in options.quill_ref if provided,
274
+ * otherwise infers it from the ParsedDocument's quill_ref field.
532
275
  * @param {ParsedDocument} parsed
533
- * @param {CompileOptions | null} [opts]
534
- * @returns {CompiledDocument}
276
+ * @param {RenderOptions} opts
277
+ * @returns {RenderResult}
535
278
  */
536
- compile(parsed, opts) {
279
+ render(parsed, opts) {
537
280
  try {
538
281
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
539
- wasm.quillmark_compile(retptr, this.__wbg_ptr, addHeapObject(parsed), isLikeNone(opts) ? 0 : addHeapObject(opts));
282
+ wasm.quillmark_render(retptr, this.__wbg_ptr, addHeapObject(parsed), addHeapObject(opts));
540
283
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
541
284
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
542
285
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
543
286
  if (r2) {
544
287
  throw takeObject(r1);
545
288
  }
546
- return CompiledDocument.__wrap(r0);
289
+ return takeObject(r0);
547
290
  } finally {
548
291
  wasm.__wbindgen_add_to_stack_pointer(16);
549
292
  }
550
293
  }
551
294
  /**
552
- * Perform a dry run validation without backend compilation.
553
- *
554
- * Executes parsing, schema validation, and template composition to
555
- * surface input errors quickly. Returns successfully on valid input,
556
- * or throws an error with diagnostic payload on failure.
295
+ * Resolve a Quill reference to a registered Quill, or null if not available
557
296
  *
558
- * The quill name is inferred from the markdown's QUILL tag (or defaults to "__default__").
297
+ * Accepts a quill reference string like "resume-template", "resume-template@2",
298
+ * or "resume-template@2.1.0". Returns QuillInfo if the engine can resolve it
299
+ * locally, or null if an external fetch is needed.
300
+ * @param {string} quill_ref
301
+ * @returns {any}
302
+ */
303
+ resolveQuill(quill_ref) {
304
+ const ptr0 = passStringToWasm0(quill_ref, wasm.__wbindgen_export, wasm.__wbindgen_export2);
305
+ const len0 = WASM_VECTOR_LEN;
306
+ const ret = wasm.quillmark_resolveQuill(this.__wbg_ptr, ptr0, len0);
307
+ return takeObject(ret);
308
+ }
309
+ /**
310
+ * Unregister a Quill by name or specific version
559
311
  *
560
- * This is useful for fast feedback loops in LLM-driven document generation.
561
- * @param {string} markdown
312
+ * If a base name is provided (e.g., "my-quill"), all versions of that quill are freed.
313
+ * If a versioned name is provided (e.g., "my-quill@2.1.0"), only that specific version is freed.
314
+ * Returns true if something was unregistered, false if not found.
315
+ * @param {string} name_or_ref
316
+ * @returns {boolean}
562
317
  */
563
- dryRun(markdown) {
564
- try {
565
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
566
- const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
567
- const len0 = WASM_VECTOR_LEN;
568
- wasm.quillmark_dryRun(retptr, this.__wbg_ptr, ptr0, len0);
569
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
570
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
571
- if (r1) {
572
- throw takeObject(r0);
573
- }
574
- } finally {
575
- wasm.__wbindgen_add_to_stack_pointer(16);
576
- }
318
+ unregisterQuill(name_or_ref) {
319
+ const ptr0 = passStringToWasm0(name_or_ref, wasm.__wbindgen_export, wasm.__wbindgen_export2);
320
+ const len0 = WASM_VECTOR_LEN;
321
+ const ret = wasm.quillmark_unregisterQuill(this.__wbg_ptr, ptr0, len0);
322
+ return ret !== 0;
577
323
  }
578
324
  }
579
325
  if (Symbol.dispose) Quillmark.prototype[Symbol.dispose] = Quillmark.prototype.free;
580
326
 
581
- export function __wbg_Error_e17e777aac105295(arg0, arg1) {
327
+ /**
328
+ * Initialize the WASM module with panic hooks for better error messages
329
+ */
330
+ export function init() {
331
+ wasm.init();
332
+ }
333
+ export function __wbg_Error_2e59b1b37a9a34c3(arg0, arg1) {
582
334
  const ret = Error(getStringFromWasm0(arg0, arg1));
583
335
  return addHeapObject(ret);
584
- };
585
-
586
- export function __wbg_String_eecc4a11987127d6(arg0, arg1) {
336
+ }
337
+ export function __wbg_String_b51de6b05a10845b(arg0, arg1) {
587
338
  const ret = String(getObject(arg1));
588
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
339
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
589
340
  const len1 = WASM_VECTOR_LEN;
590
341
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
591
342
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
592
- };
593
-
594
- export function __wbg_call_13410aac570ffff7() { return handleError(function (arg0, arg1) {
595
- const ret = getObject(arg0).call(getObject(arg1));
596
- return addHeapObject(ret);
597
- }, arguments) };
598
-
599
- export function __wbg_done_75ed0ee6dd243d9d(arg0) {
600
- const ret = getObject(arg0).done;
343
+ }
344
+ export function __wbg___wbindgen_bigint_get_as_i64_2c5082002e4826e2(arg0, arg1) {
345
+ const v = getObject(arg1);
346
+ const ret = typeof(v) === 'bigint' ? v : undefined;
347
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
348
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
349
+ }
350
+ export function __wbg___wbindgen_boolean_get_a86c216575a75c30(arg0) {
351
+ const v = getObject(arg0);
352
+ const ret = typeof(v) === 'boolean' ? v : undefined;
353
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
354
+ }
355
+ export function __wbg___wbindgen_debug_string_dd5d2d07ce9e6c57(arg0, arg1) {
356
+ const ret = debugString(getObject(arg1));
357
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
358
+ const len1 = WASM_VECTOR_LEN;
359
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
360
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
361
+ }
362
+ export function __wbg___wbindgen_in_4bd7a57e54337366(arg0, arg1) {
363
+ const ret = getObject(arg0) in getObject(arg1);
601
364
  return ret;
602
- };
603
-
604
- export function __wbg_entries_2be2f15bd5554996(arg0) {
605
- const ret = Object.entries(getObject(arg0));
606
- return addHeapObject(ret);
607
- };
608
-
609
- export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
610
- let deferred0_0;
611
- let deferred0_1;
612
- try {
613
- deferred0_0 = arg0;
614
- deferred0_1 = arg1;
615
- console.error(getStringFromWasm0(arg0, arg1));
616
- } finally {
617
- wasm.__wbindgen_export_3(deferred0_0, deferred0_1, 1);
618
- }
619
- };
620
-
621
- export function __wbg_getRandomValues_1c61fac11405ffdc() { return handleError(function (arg0, arg1) {
622
- globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
623
- }, arguments) };
624
-
625
- export function __wbg_getTime_6bb3f64e0f18f817(arg0) {
626
- const ret = getObject(arg0).getTime();
365
+ }
366
+ export function __wbg___wbindgen_is_bigint_6c98f7e945dacdde(arg0) {
367
+ const ret = typeof(getObject(arg0)) === 'bigint';
627
368
  return ret;
628
- };
629
-
630
- export function __wbg_getUTCDate_e0a363240ba1c112(arg0) {
631
- const ret = getObject(arg0).getUTCDate();
369
+ }
370
+ export function __wbg___wbindgen_is_function_49868bde5eb1e745(arg0) {
371
+ const ret = typeof(getObject(arg0)) === 'function';
632
372
  return ret;
633
- };
634
-
635
- export function __wbg_getUTCFullYear_811e319dd2642ac0(arg0) {
636
- const ret = getObject(arg0).getUTCFullYear();
373
+ }
374
+ export function __wbg___wbindgen_is_object_40c5a80572e8f9d3(arg0) {
375
+ const val = getObject(arg0);
376
+ const ret = typeof(val) === 'object' && val !== null;
637
377
  return ret;
638
- };
639
-
640
- export function __wbg_getUTCMonth_ed74da16cf6f6c98(arg0) {
378
+ }
379
+ export function __wbg___wbindgen_is_string_b29b5c5a8065ba1a(arg0) {
380
+ const ret = typeof(getObject(arg0)) === 'string';
381
+ return ret;
382
+ }
383
+ export function __wbg___wbindgen_is_undefined_c0cca72b82b86f4d(arg0) {
384
+ const ret = getObject(arg0) === undefined;
385
+ return ret;
386
+ }
387
+ export function __wbg___wbindgen_jsval_eq_7d430e744a913d26(arg0, arg1) {
388
+ const ret = getObject(arg0) === getObject(arg1);
389
+ return ret;
390
+ }
391
+ export function __wbg___wbindgen_jsval_loose_eq_3a72ae764d46d944(arg0, arg1) {
392
+ const ret = getObject(arg0) == getObject(arg1);
393
+ return ret;
394
+ }
395
+ export function __wbg___wbindgen_number_get_7579aab02a8a620c(arg0, arg1) {
396
+ const obj = getObject(arg1);
397
+ const ret = typeof(obj) === 'number' ? obj : undefined;
398
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
399
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
400
+ }
401
+ export function __wbg___wbindgen_string_get_914df97fcfa788f2(arg0, arg1) {
402
+ const obj = getObject(arg1);
403
+ const ret = typeof(obj) === 'string' ? obj : undefined;
404
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
405
+ var len1 = WASM_VECTOR_LEN;
406
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
407
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
408
+ }
409
+ export function __wbg___wbindgen_throw_81fc77679af83bc6(arg0, arg1) {
410
+ throw new Error(getStringFromWasm0(arg0, arg1));
411
+ }
412
+ export function __wbg_call_7f2987183bb62793() { return handleError(function (arg0, arg1) {
413
+ const ret = getObject(arg0).call(getObject(arg1));
414
+ return addHeapObject(ret);
415
+ }, arguments); }
416
+ export function __wbg_done_547d467e97529006(arg0) {
417
+ const ret = getObject(arg0).done;
418
+ return ret;
419
+ }
420
+ export function __wbg_entries_616b1a459b85be0b(arg0) {
421
+ const ret = Object.entries(getObject(arg0));
422
+ return addHeapObject(ret);
423
+ }
424
+ export function __wbg_error_a6fa202b58aa1cd3(arg0, arg1) {
425
+ let deferred0_0;
426
+ let deferred0_1;
427
+ try {
428
+ deferred0_0 = arg0;
429
+ deferred0_1 = arg1;
430
+ console.error(getStringFromWasm0(arg0, arg1));
431
+ } finally {
432
+ wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
433
+ }
434
+ }
435
+ export function __wbg_getRandomValues_3f44b700395062e5() { return handleError(function (arg0, arg1) {
436
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
437
+ }, arguments); }
438
+ export function __wbg_getTime_f6ac312467f7cf09(arg0) {
439
+ const ret = getObject(arg0).getTime();
440
+ return ret;
441
+ }
442
+ export function __wbg_getUTCDate_9b73619d33527a0e(arg0) {
443
+ const ret = getObject(arg0).getUTCDate();
444
+ return ret;
445
+ }
446
+ export function __wbg_getUTCFullYear_1c80c08b216993d4(arg0) {
447
+ const ret = getObject(arg0).getUTCFullYear();
448
+ return ret;
449
+ }
450
+ export function __wbg_getUTCMonth_ea2d5842542c5998(arg0) {
641
451
  const ret = getObject(arg0).getUTCMonth();
642
452
  return ret;
643
- };
644
-
645
- export function __wbg_get_0da715ceaecea5c8(arg0, arg1) {
453
+ }
454
+ export function __wbg_get_4848e350b40afc16(arg0, arg1) {
646
455
  const ret = getObject(arg0)[arg1 >>> 0];
647
456
  return addHeapObject(ret);
648
- };
649
-
650
- export function __wbg_get_458e874b43b18b25() { return handleError(function (arg0, arg1) {
457
+ }
458
+ export function __wbg_get_ed0642c4b9d31ddf() { return handleError(function (arg0, arg1) {
651
459
  const ret = Reflect.get(getObject(arg0), getObject(arg1));
652
460
  return addHeapObject(ret);
653
- }, arguments) };
654
-
655
- export function __wbg_getwithrefkey_6550b2c093d2eb18(arg0, arg1) {
461
+ }, arguments); }
462
+ export function __wbg_get_unchecked_7d7babe32e9e6a54(arg0, arg1) {
463
+ const ret = getObject(arg0)[arg1 >>> 0];
464
+ return addHeapObject(ret);
465
+ }
466
+ export function __wbg_get_with_ref_key_f64427178466f623(arg0, arg1) {
656
467
  const ret = getObject(arg0)[getObject(arg1)];
657
468
  return addHeapObject(ret);
658
- };
659
-
660
- export function __wbg_instanceof_ArrayBuffer_67f3012529f6a2dd(arg0) {
469
+ }
470
+ export function __wbg_instanceof_ArrayBuffer_ff7c1337a5e3b33a(arg0) {
661
471
  let result;
662
472
  try {
663
473
  result = getObject(arg0) instanceof ArrayBuffer;
@@ -666,9 +476,8 @@ export function __wbg_instanceof_ArrayBuffer_67f3012529f6a2dd(arg0) {
666
476
  }
667
477
  const ret = result;
668
478
  return ret;
669
- };
670
-
671
- export function __wbg_instanceof_Uint8Array_9a8378d955933db7(arg0) {
479
+ }
480
+ export function __wbg_instanceof_Uint8Array_4b8da683deb25d72(arg0) {
672
481
  let result;
673
482
  try {
674
483
  result = getObject(arg0) instanceof Uint8Array;
@@ -677,239 +486,360 @@ export function __wbg_instanceof_Uint8Array_9a8378d955933db7(arg0) {
677
486
  }
678
487
  const ret = result;
679
488
  return ret;
680
- };
681
-
682
- export function __wbg_isArray_030cce220591fb41(arg0) {
489
+ }
490
+ export function __wbg_isArray_db61795ad004c139(arg0) {
683
491
  const ret = Array.isArray(getObject(arg0));
684
492
  return ret;
685
- };
686
-
687
- export function __wbg_isSafeInteger_1c0d1af5542e102a(arg0) {
493
+ }
494
+ export function __wbg_isSafeInteger_ea83862ba994770c(arg0) {
688
495
  const ret = Number.isSafeInteger(getObject(arg0));
689
496
  return ret;
690
- };
691
-
692
- export function __wbg_iterator_f370b34483c71a1c() {
497
+ }
498
+ export function __wbg_iterator_de403ef31815a3e6() {
693
499
  const ret = Symbol.iterator;
694
500
  return addHeapObject(ret);
695
- };
696
-
697
- export function __wbg_length_186546c51cd61acd(arg0) {
501
+ }
502
+ export function __wbg_length_0c32cb8543c8e4c8(arg0) {
698
503
  const ret = getObject(arg0).length;
699
504
  return ret;
700
- };
701
-
702
- export function __wbg_length_6bb7e81f9d7713e4(arg0) {
505
+ }
506
+ export function __wbg_length_6e821edde497a532(arg0) {
703
507
  const ret = getObject(arg0).length;
704
508
  return ret;
705
- };
706
-
707
- export function __wbg_new0_b0a0a38c201e6df5() {
509
+ }
510
+ export function __wbg_new_0_bfa2ef4bc447daa2() {
708
511
  const ret = new Date();
709
512
  return addHeapObject(ret);
710
- };
711
-
712
- export function __wbg_new_19c25a3f2fa63a02() {
713
- const ret = new Object();
513
+ }
514
+ export function __wbg_new_0f6d2ddfe083319b(arg0) {
515
+ const ret = new Date(getObject(arg0));
714
516
  return addHeapObject(ret);
715
- };
716
-
717
- export function __wbg_new_1f3a344cf3123716() {
718
- const ret = new Array();
517
+ }
518
+ export function __wbg_new_227d7c05414eb861() {
519
+ const ret = new Error();
719
520
  return addHeapObject(ret);
720
- };
721
-
722
- export function __wbg_new_2ff1f68f3676ea53() {
723
- const ret = new Map();
521
+ }
522
+ export function __wbg_new_4f9fafbb3909af72() {
523
+ const ret = new Object();
724
524
  return addHeapObject(ret);
725
- };
726
-
727
- export function __wbg_new_5a2ae4557f92b50e(arg0) {
728
- const ret = new Date(getObject(arg0));
525
+ }
526
+ export function __wbg_new_99cabae501c0a8a0() {
527
+ const ret = new Map();
729
528
  return addHeapObject(ret);
730
- };
731
-
732
- export function __wbg_new_638ebfaedbf32a5e(arg0) {
529
+ }
530
+ export function __wbg_new_a560378ea1240b14(arg0) {
733
531
  const ret = new Uint8Array(getObject(arg0));
734
532
  return addHeapObject(ret);
735
- };
736
-
737
- export function __wbg_new_8a6f238a6ece86ea() {
738
- const ret = new Error();
533
+ }
534
+ export function __wbg_new_f3c9df4f38f3f798() {
535
+ const ret = new Array();
739
536
  return addHeapObject(ret);
740
- };
741
-
742
- export function __wbg_next_5b3530e612fde77d(arg0) {
537
+ }
538
+ export function __wbg_next_01132ed6134b8ef5(arg0) {
743
539
  const ret = getObject(arg0).next;
744
540
  return addHeapObject(ret);
745
- };
746
-
747
- export function __wbg_next_692e82279131b03c() { return handleError(function (arg0) {
541
+ }
542
+ export function __wbg_next_b3713ec761a9dbfd() { return handleError(function (arg0) {
748
543
  const ret = getObject(arg0).next();
749
544
  return addHeapObject(ret);
750
- }, arguments) };
751
-
752
- export function __wbg_now_1e80617bcee43265() {
545
+ }, arguments); }
546
+ export function __wbg_now_88621c9c9a4f3ffc() {
753
547
  const ret = Date.now();
754
548
  return ret;
755
- };
756
-
757
- export function __wbg_parse_442f5ba02e5eaf8b() { return handleError(function (arg0, arg1) {
549
+ }
550
+ export function __wbg_parse_545d11396395fbbd() { return handleError(function (arg0, arg1) {
758
551
  const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
759
552
  return addHeapObject(ret);
760
- }, arguments) };
761
-
762
- export function __wbg_prototypesetcall_3d4a26c1ed734349(arg0, arg1, arg2) {
553
+ }, arguments); }
554
+ export function __wbg_prototypesetcall_3e05eb9545565046(arg0, arg1, arg2) {
763
555
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
764
- };
765
-
766
- export function __wbg_set_3807d5f0bfc24aa7(arg0, arg1, arg2) {
767
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
768
- };
769
-
770
- export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
771
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
772
- };
773
-
774
- export function __wbg_set_90f6c0f7bd8c0415(arg0, arg1, arg2) {
775
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
776
- };
777
-
778
- export function __wbg_set_b7f1cf4fae26fe2a(arg0, arg1, arg2) {
556
+ }
557
+ export function __wbg_set_08463b1df38a7e29(arg0, arg1, arg2) {
779
558
  const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
780
559
  return addHeapObject(ret);
781
- };
782
-
783
- export function __wbg_stack_0ed75d68575b0f3c(arg0, arg1) {
560
+ }
561
+ export function __wbg_set_6be42768c690e380(arg0, arg1, arg2) {
562
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
563
+ }
564
+ export function __wbg_set_6c60b2e8ad0e9383(arg0, arg1, arg2) {
565
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
566
+ }
567
+ export function __wbg_set_f071dbb3bd088e0e(arg0, arg1, arg2) {
568
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
569
+ }
570
+ export function __wbg_stack_3b0d974bbf31e44f(arg0, arg1) {
784
571
  const ret = getObject(arg1).stack;
785
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
572
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
786
573
  const len1 = WASM_VECTOR_LEN;
787
574
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
788
575
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
789
- };
790
-
791
- export function __wbg_stringify_b98c93d0a190446a() { return handleError(function (arg0) {
576
+ }
577
+ export function __wbg_stringify_a2c39d991e1bf91d() { return handleError(function (arg0) {
792
578
  const ret = JSON.stringify(getObject(arg0));
793
579
  return addHeapObject(ret);
794
- }, arguments) };
795
-
796
- export function __wbg_value_dd9372230531eade(arg0) {
580
+ }, arguments); }
581
+ export function __wbg_value_7f6052747ccf940f(arg0) {
797
582
  const ret = getObject(arg0).value;
798
583
  return addHeapObject(ret);
799
- };
584
+ }
585
+ export function __wbindgen_cast_0000000000000001(arg0) {
586
+ // Cast intrinsic for `F64 -> Externref`.
587
+ const ret = arg0;
588
+ return addHeapObject(ret);
589
+ }
590
+ export function __wbindgen_cast_0000000000000002(arg0) {
591
+ // Cast intrinsic for `I64 -> Externref`.
592
+ const ret = arg0;
593
+ return addHeapObject(ret);
594
+ }
595
+ export function __wbindgen_cast_0000000000000003(arg0, arg1) {
596
+ // Cast intrinsic for `Ref(String) -> Externref`.
597
+ const ret = getStringFromWasm0(arg0, arg1);
598
+ return addHeapObject(ret);
599
+ }
600
+ export function __wbindgen_cast_0000000000000004(arg0) {
601
+ // Cast intrinsic for `U64 -> Externref`.
602
+ const ret = BigInt.asUintN(64, arg0);
603
+ return addHeapObject(ret);
604
+ }
605
+ export function __wbindgen_object_clone_ref(arg0) {
606
+ const ret = getObject(arg0);
607
+ return addHeapObject(ret);
608
+ }
609
+ export function __wbindgen_object_drop_ref(arg0) {
610
+ takeObject(arg0);
611
+ }
612
+ const CompiledDocumentFinalization = (typeof FinalizationRegistry === 'undefined')
613
+ ? { register: () => {}, unregister: () => {} }
614
+ : new FinalizationRegistry(ptr => wasm.__wbg_compileddocument_free(ptr >>> 0, 1));
615
+ const QuillmarkFinalization = (typeof FinalizationRegistry === 'undefined')
616
+ ? { register: () => {}, unregister: () => {} }
617
+ : new FinalizationRegistry(ptr => wasm.__wbg_quillmark_free(ptr >>> 0, 1));
800
618
 
801
- export function __wbg_wbindgenbigintgetasi64_ac743ece6ab9bba1(arg0, arg1) {
802
- const v = getObject(arg1);
803
- const ret = typeof(v) === 'bigint' ? v : undefined;
804
- getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
805
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
806
- };
619
+ function addHeapObject(obj) {
620
+ if (heap_next === heap.length) heap.push(heap.length + 1);
621
+ const idx = heap_next;
622
+ heap_next = heap[idx];
807
623
 
808
- export function __wbg_wbindgenbooleanget_3fe6f642c7d97746(arg0) {
809
- const v = getObject(arg0);
810
- const ret = typeof(v) === 'boolean' ? v : undefined;
811
- return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
812
- };
624
+ heap[idx] = obj;
625
+ return idx;
626
+ }
813
627
 
814
- export function __wbg_wbindgendebugstring_99ef257a3ddda34d(arg0, arg1) {
815
- const ret = debugString(getObject(arg1));
816
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
817
- const len1 = WASM_VECTOR_LEN;
818
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
819
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
820
- };
628
+ function debugString(val) {
629
+ // primitive types
630
+ const type = typeof val;
631
+ if (type == 'number' || type == 'boolean' || val == null) {
632
+ return `${val}`;
633
+ }
634
+ if (type == 'string') {
635
+ return `"${val}"`;
636
+ }
637
+ if (type == 'symbol') {
638
+ const description = val.description;
639
+ if (description == null) {
640
+ return 'Symbol';
641
+ } else {
642
+ return `Symbol(${description})`;
643
+ }
644
+ }
645
+ if (type == 'function') {
646
+ const name = val.name;
647
+ if (typeof name == 'string' && name.length > 0) {
648
+ return `Function(${name})`;
649
+ } else {
650
+ return 'Function';
651
+ }
652
+ }
653
+ // objects
654
+ if (Array.isArray(val)) {
655
+ const length = val.length;
656
+ let debug = '[';
657
+ if (length > 0) {
658
+ debug += debugString(val[0]);
659
+ }
660
+ for(let i = 1; i < length; i++) {
661
+ debug += ', ' + debugString(val[i]);
662
+ }
663
+ debug += ']';
664
+ return debug;
665
+ }
666
+ // Test for built-in
667
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
668
+ let className;
669
+ if (builtInMatches && builtInMatches.length > 1) {
670
+ className = builtInMatches[1];
671
+ } else {
672
+ // Failed to match the standard '[object ClassName]'
673
+ return toString.call(val);
674
+ }
675
+ if (className == 'Object') {
676
+ // we're a user defined class or Object
677
+ // JSON.stringify avoids problems with cycles, and is generally much
678
+ // easier than looping through ownProperties of `val`.
679
+ try {
680
+ return 'Object(' + JSON.stringify(val) + ')';
681
+ } catch (_) {
682
+ return 'Object';
683
+ }
684
+ }
685
+ // errors
686
+ if (val instanceof Error) {
687
+ return `${val.name}: ${val.message}\n${val.stack}`;
688
+ }
689
+ // TODO we could test for more things here, like `Set`s and `Map`s.
690
+ return className;
691
+ }
821
692
 
822
- export function __wbg_wbindgenin_d7a1ee10933d2d55(arg0, arg1) {
823
- const ret = getObject(arg0) in getObject(arg1);
824
- return ret;
825
- };
693
+ function dropObject(idx) {
694
+ if (idx < 1028) return;
695
+ heap[idx] = heap_next;
696
+ heap_next = idx;
697
+ }
826
698
 
827
- export function __wbg_wbindgenisbigint_ecb90cc08a5a9154(arg0) {
828
- const ret = typeof(getObject(arg0)) === 'bigint';
829
- return ret;
830
- };
699
+ function getArrayJsValueFromWasm0(ptr, len) {
700
+ ptr = ptr >>> 0;
701
+ const mem = getDataViewMemory0();
702
+ const result = [];
703
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
704
+ result.push(takeObject(mem.getUint32(i, true)));
705
+ }
706
+ return result;
707
+ }
831
708
 
832
- export function __wbg_wbindgenisfunction_8cee7dce3725ae74(arg0) {
833
- const ret = typeof(getObject(arg0)) === 'function';
834
- return ret;
835
- };
709
+ function getArrayU8FromWasm0(ptr, len) {
710
+ ptr = ptr >>> 0;
711
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
712
+ }
836
713
 
837
- export function __wbg_wbindgenisobject_307a53c6bd97fbf8(arg0) {
838
- const val = getObject(arg0);
839
- const ret = typeof(val) === 'object' && val !== null;
840
- return ret;
841
- };
714
+ let cachedDataViewMemory0 = null;
715
+ function getDataViewMemory0() {
716
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
717
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
718
+ }
719
+ return cachedDataViewMemory0;
720
+ }
842
721
 
843
- export function __wbg_wbindgenisstring_d4fa939789f003b0(arg0) {
844
- const ret = typeof(getObject(arg0)) === 'string';
845
- return ret;
846
- };
722
+ function getStringFromWasm0(ptr, len) {
723
+ ptr = ptr >>> 0;
724
+ return decodeText(ptr, len);
725
+ }
847
726
 
848
- export function __wbg_wbindgenisundefined_c4b71d073b92f3c5(arg0) {
849
- const ret = getObject(arg0) === undefined;
850
- return ret;
851
- };
727
+ let cachedUint32ArrayMemory0 = null;
728
+ function getUint32ArrayMemory0() {
729
+ if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
730
+ cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
731
+ }
732
+ return cachedUint32ArrayMemory0;
733
+ }
852
734
 
853
- export function __wbg_wbindgenjsvaleq_e6f2ad59ccae1b58(arg0, arg1) {
854
- const ret = getObject(arg0) === getObject(arg1);
855
- return ret;
856
- };
735
+ let cachedUint8ArrayMemory0 = null;
736
+ function getUint8ArrayMemory0() {
737
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
738
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
739
+ }
740
+ return cachedUint8ArrayMemory0;
741
+ }
857
742
 
858
- export function __wbg_wbindgenjsvallooseeq_9bec8c9be826bed1(arg0, arg1) {
859
- const ret = getObject(arg0) == getObject(arg1);
860
- return ret;
861
- };
743
+ function getObject(idx) { return heap[idx]; }
862
744
 
863
- export function __wbg_wbindgennumberget_f74b4c7525ac05cb(arg0, arg1) {
864
- const obj = getObject(arg1);
865
- const ret = typeof(obj) === 'number' ? obj : undefined;
866
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
867
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
868
- };
745
+ function handleError(f, args) {
746
+ try {
747
+ return f.apply(this, args);
748
+ } catch (e) {
749
+ wasm.__wbindgen_export3(addHeapObject(e));
750
+ }
751
+ }
869
752
 
870
- export function __wbg_wbindgenstringget_0f16a6ddddef376f(arg0, arg1) {
871
- const obj = getObject(arg1);
872
- const ret = typeof(obj) === 'string' ? obj : undefined;
873
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
874
- var len1 = WASM_VECTOR_LEN;
875
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
876
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
877
- };
753
+ let heap = new Array(1024).fill(undefined);
754
+ heap.push(undefined, null, true, false);
878
755
 
879
- export function __wbg_wbindgenthrow_451ec1a8469d7eb6(arg0, arg1) {
880
- throw new Error(getStringFromWasm0(arg0, arg1));
881
- };
756
+ let heap_next = heap.length;
882
757
 
883
- export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
884
- // Cast intrinsic for `Ref(String) -> Externref`.
885
- const ret = getStringFromWasm0(arg0, arg1);
886
- return addHeapObject(ret);
887
- };
758
+ function isLikeNone(x) {
759
+ return x === undefined || x === null;
760
+ }
888
761
 
889
- export function __wbindgen_cast_4625c577ab2ec9ee(arg0) {
890
- // Cast intrinsic for `U64 -> Externref`.
891
- const ret = BigInt.asUintN(64, arg0);
892
- return addHeapObject(ret);
893
- };
762
+ function passArray32ToWasm0(arg, malloc) {
763
+ const ptr = malloc(arg.length * 4, 4) >>> 0;
764
+ getUint32ArrayMemory0().set(arg, ptr / 4);
765
+ WASM_VECTOR_LEN = arg.length;
766
+ return ptr;
767
+ }
894
768
 
895
- export function __wbindgen_cast_9ae0607507abb057(arg0) {
896
- // Cast intrinsic for `I64 -> Externref`.
897
- const ret = arg0;
898
- return addHeapObject(ret);
899
- };
769
+ function passStringToWasm0(arg, malloc, realloc) {
770
+ if (realloc === undefined) {
771
+ const buf = cachedTextEncoder.encode(arg);
772
+ const ptr = malloc(buf.length, 1) >>> 0;
773
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
774
+ WASM_VECTOR_LEN = buf.length;
775
+ return ptr;
776
+ }
900
777
 
901
- export function __wbindgen_cast_d6cd19b81560fd6e(arg0) {
902
- // Cast intrinsic for `F64 -> Externref`.
903
- const ret = arg0;
904
- return addHeapObject(ret);
905
- };
778
+ let len = arg.length;
779
+ let ptr = malloc(len, 1) >>> 0;
906
780
 
907
- export function __wbindgen_object_clone_ref(arg0) {
908
- const ret = getObject(arg0);
909
- return addHeapObject(ret);
910
- };
781
+ const mem = getUint8ArrayMemory0();
911
782
 
912
- export function __wbindgen_object_drop_ref(arg0) {
913
- takeObject(arg0);
914
- };
783
+ let offset = 0;
915
784
 
785
+ for (; offset < len; offset++) {
786
+ const code = arg.charCodeAt(offset);
787
+ if (code > 0x7F) break;
788
+ mem[ptr + offset] = code;
789
+ }
790
+ if (offset !== len) {
791
+ if (offset !== 0) {
792
+ arg = arg.slice(offset);
793
+ }
794
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
795
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
796
+ const ret = cachedTextEncoder.encodeInto(arg, view);
797
+
798
+ offset += ret.written;
799
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
800
+ }
801
+
802
+ WASM_VECTOR_LEN = offset;
803
+ return ptr;
804
+ }
805
+
806
+ function takeObject(idx) {
807
+ const ret = getObject(idx);
808
+ dropObject(idx);
809
+ return ret;
810
+ }
811
+
812
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
813
+ cachedTextDecoder.decode();
814
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
815
+ let numBytesDecoded = 0;
816
+ function decodeText(ptr, len) {
817
+ numBytesDecoded += len;
818
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
819
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
820
+ cachedTextDecoder.decode();
821
+ numBytesDecoded = len;
822
+ }
823
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
824
+ }
825
+
826
+ const cachedTextEncoder = new TextEncoder();
827
+
828
+ if (!('encodeInto' in cachedTextEncoder)) {
829
+ cachedTextEncoder.encodeInto = function (arg, view) {
830
+ const buf = cachedTextEncoder.encode(arg);
831
+ view.set(buf);
832
+ return {
833
+ read: arg.length,
834
+ written: buf.length
835
+ };
836
+ };
837
+ }
838
+
839
+ let WASM_VECTOR_LEN = 0;
840
+
841
+
842
+ let wasm;
843
+ export function __wbg_set_wasm(val) {
844
+ wasm = val;
845
+ }