@quillmark/wasm 0.45.0 → 0.47.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,57 +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 stripped JSON schema of a Quill (removes UI metadata)
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
- * @param {string} name
476
- * @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}
477
228
  */
478
- getStrippedSchema(name) {
229
+ static parseMarkdown(markdown) {
479
230
  try {
480
231
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
481
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
232
+ const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export, wasm.__wbindgen_export2);
482
233
  const len0 = WASM_VECTOR_LEN;
483
- wasm.quillmark_getStrippedSchema(retptr, this.__wbg_ptr, ptr0, len0);
234
+ wasm.quillmark_parseMarkdown(retptr, ptr0, len0);
484
235
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
485
236
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
486
237
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -493,28 +244,17 @@ export class Quillmark {
493
244
  }
494
245
  }
495
246
  /**
496
- * JavaScript constructor: `new Quillmark()`
497
- */
498
- constructor() {
499
- const ret = wasm.quillmark_new();
500
- this.__wbg_ptr = ret >>> 0;
501
- QuillmarkFinalization.register(this, this.__wbg_ptr, this);
502
- return this;
503
- }
504
- /**
505
- * Render a ParsedDocument to final artifacts (PDF, SVG, TXT)
247
+ * Register a Quill template bundle
506
248
  *
507
- * Note that the quill reference is optional to specify and can be inferred from the markdown content's frontmatter.
508
- * Uses the Quill specified in options.quill_ref if provided,
509
- * otherwise infers it from the ParsedDocument's quill_ref field.
510
- * @param {ParsedDocument} parsed
511
- * @param {RenderOptions} opts
512
- * @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}
513
253
  */
514
- render(parsed, opts) {
254
+ registerQuill(quill_json) {
515
255
  try {
516
256
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
517
- wasm.quillmark_render(retptr, this.__wbg_ptr, addHeapObject(parsed), addHeapObject(opts));
257
+ wasm.quillmark_registerQuill(retptr, this.__wbg_ptr, addHeapObject(quill_json));
518
258
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
519
259
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
520
260
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -527,136 +267,207 @@ export class Quillmark {
527
267
  }
528
268
  }
529
269
  /**
530
- * 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.
531
275
  * @param {ParsedDocument} parsed
532
- * @param {CompileOptions | null} [opts]
533
- * @returns {CompiledDocument}
276
+ * @param {RenderOptions} opts
277
+ * @returns {RenderResult}
534
278
  */
535
- compile(parsed, opts) {
279
+ render(parsed, opts) {
536
280
  try {
537
281
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
538
- 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));
539
283
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
540
284
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
541
285
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
542
286
  if (r2) {
543
287
  throw takeObject(r1);
544
288
  }
545
- return CompiledDocument.__wrap(r0);
289
+ return takeObject(r0);
546
290
  } finally {
547
291
  wasm.__wbindgen_add_to_stack_pointer(16);
548
292
  }
549
293
  }
550
294
  /**
551
- * Perform a dry run validation without backend compilation.
552
- *
553
- * Executes parsing, schema validation, and template composition to
554
- * surface input errors quickly. Returns successfully on valid input,
555
- * or throws an error with diagnostic payload on failure.
295
+ * Resolve a Quill reference to a registered Quill, or null if not available
556
296
  *
557
- * 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
558
311
  *
559
- * This is useful for fast feedback loops in LLM-driven document generation.
560
- * @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}
561
317
  */
562
- dryRun(markdown) {
563
- try {
564
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
565
- const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
566
- const len0 = WASM_VECTOR_LEN;
567
- wasm.quillmark_dryRun(retptr, this.__wbg_ptr, ptr0, len0);
568
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
569
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
570
- if (r1) {
571
- throw takeObject(r0);
572
- }
573
- } finally {
574
- wasm.__wbindgen_add_to_stack_pointer(16);
575
- }
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;
576
323
  }
577
324
  }
578
325
  if (Symbol.dispose) Quillmark.prototype[Symbol.dispose] = Quillmark.prototype.free;
579
326
 
580
- 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) {
581
334
  const ret = Error(getStringFromWasm0(arg0, arg1));
582
335
  return addHeapObject(ret);
583
- };
584
-
585
- export function __wbg_String_eecc4a11987127d6(arg0, arg1) {
336
+ }
337
+ export function __wbg_String_b51de6b05a10845b(arg0, arg1) {
586
338
  const ret = String(getObject(arg1));
587
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
339
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
588
340
  const len1 = WASM_VECTOR_LEN;
589
341
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
590
342
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
591
- };
592
-
593
- export function __wbg_call_13410aac570ffff7() { return handleError(function (arg0, arg1) {
594
- const ret = getObject(arg0).call(getObject(arg1));
595
- return addHeapObject(ret);
596
- }, arguments) };
597
-
598
- export function __wbg_done_75ed0ee6dd243d9d(arg0) {
599
- 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);
600
364
  return ret;
601
- };
602
-
603
- export function __wbg_entries_2be2f15bd5554996(arg0) {
604
- const ret = Object.entries(getObject(arg0));
605
- return addHeapObject(ret);
606
- };
607
-
608
- export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
609
- let deferred0_0;
610
- let deferred0_1;
611
- try {
612
- deferred0_0 = arg0;
613
- deferred0_1 = arg1;
614
- console.error(getStringFromWasm0(arg0, arg1));
615
- } finally {
616
- wasm.__wbindgen_export_3(deferred0_0, deferred0_1, 1);
617
- }
618
- };
619
-
620
- export function __wbg_getRandomValues_1c61fac11405ffdc() { return handleError(function (arg0, arg1) {
621
- globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
622
- }, arguments) };
623
-
624
- export function __wbg_getTime_6bb3f64e0f18f817(arg0) {
625
- const ret = getObject(arg0).getTime();
365
+ }
366
+ export function __wbg___wbindgen_is_bigint_6c98f7e945dacdde(arg0) {
367
+ const ret = typeof(getObject(arg0)) === 'bigint';
626
368
  return ret;
627
- };
628
-
629
- export function __wbg_getUTCDate_e0a363240ba1c112(arg0) {
630
- const ret = getObject(arg0).getUTCDate();
369
+ }
370
+ export function __wbg___wbindgen_is_function_49868bde5eb1e745(arg0) {
371
+ const ret = typeof(getObject(arg0)) === 'function';
631
372
  return ret;
632
- };
633
-
634
- export function __wbg_getUTCFullYear_811e319dd2642ac0(arg0) {
635
- 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;
636
377
  return ret;
637
- };
638
-
639
- export function __wbg_getUTCMonth_ed74da16cf6f6c98(arg0) {
640
- const ret = getObject(arg0).getUTCMonth();
378
+ }
379
+ export function __wbg___wbindgen_is_string_b29b5c5a8065ba1a(arg0) {
380
+ const ret = typeof(getObject(arg0)) === 'string';
641
381
  return ret;
642
- };
643
-
644
- export function __wbg_get_0da715ceaecea5c8(arg0, arg1) {
645
- const ret = getObject(arg0)[arg1 >>> 0];
646
- return addHeapObject(ret);
647
- };
648
-
649
- export function __wbg_get_458e874b43b18b25() { return handleError(function (arg0, arg1) {
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) {
451
+ const ret = getObject(arg0).getUTCMonth();
452
+ return ret;
453
+ }
454
+ export function __wbg_get_4848e350b40afc16(arg0, arg1) {
455
+ const ret = getObject(arg0)[arg1 >>> 0];
456
+ return addHeapObject(ret);
457
+ }
458
+ export function __wbg_get_ed0642c4b9d31ddf() { return handleError(function (arg0, arg1) {
650
459
  const ret = Reflect.get(getObject(arg0), getObject(arg1));
651
460
  return addHeapObject(ret);
652
- }, arguments) };
653
-
654
- 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) {
655
467
  const ret = getObject(arg0)[getObject(arg1)];
656
468
  return addHeapObject(ret);
657
- };
658
-
659
- export function __wbg_instanceof_ArrayBuffer_67f3012529f6a2dd(arg0) {
469
+ }
470
+ export function __wbg_instanceof_ArrayBuffer_ff7c1337a5e3b33a(arg0) {
660
471
  let result;
661
472
  try {
662
473
  result = getObject(arg0) instanceof ArrayBuffer;
@@ -665,9 +476,8 @@ export function __wbg_instanceof_ArrayBuffer_67f3012529f6a2dd(arg0) {
665
476
  }
666
477
  const ret = result;
667
478
  return ret;
668
- };
669
-
670
- export function __wbg_instanceof_Uint8Array_9a8378d955933db7(arg0) {
479
+ }
480
+ export function __wbg_instanceof_Uint8Array_4b8da683deb25d72(arg0) {
671
481
  let result;
672
482
  try {
673
483
  result = getObject(arg0) instanceof Uint8Array;
@@ -676,239 +486,360 @@ export function __wbg_instanceof_Uint8Array_9a8378d955933db7(arg0) {
676
486
  }
677
487
  const ret = result;
678
488
  return ret;
679
- };
680
-
681
- export function __wbg_isArray_030cce220591fb41(arg0) {
489
+ }
490
+ export function __wbg_isArray_db61795ad004c139(arg0) {
682
491
  const ret = Array.isArray(getObject(arg0));
683
492
  return ret;
684
- };
685
-
686
- export function __wbg_isSafeInteger_1c0d1af5542e102a(arg0) {
493
+ }
494
+ export function __wbg_isSafeInteger_ea83862ba994770c(arg0) {
687
495
  const ret = Number.isSafeInteger(getObject(arg0));
688
496
  return ret;
689
- };
690
-
691
- export function __wbg_iterator_f370b34483c71a1c() {
497
+ }
498
+ export function __wbg_iterator_de403ef31815a3e6() {
692
499
  const ret = Symbol.iterator;
693
500
  return addHeapObject(ret);
694
- };
695
-
696
- export function __wbg_length_186546c51cd61acd(arg0) {
501
+ }
502
+ export function __wbg_length_0c32cb8543c8e4c8(arg0) {
697
503
  const ret = getObject(arg0).length;
698
504
  return ret;
699
- };
700
-
701
- export function __wbg_length_6bb7e81f9d7713e4(arg0) {
505
+ }
506
+ export function __wbg_length_6e821edde497a532(arg0) {
702
507
  const ret = getObject(arg0).length;
703
508
  return ret;
704
- };
705
-
706
- export function __wbg_new0_b0a0a38c201e6df5() {
509
+ }
510
+ export function __wbg_new_0_bfa2ef4bc447daa2() {
707
511
  const ret = new Date();
708
512
  return addHeapObject(ret);
709
- };
710
-
711
- export function __wbg_new_19c25a3f2fa63a02() {
712
- const ret = new Object();
513
+ }
514
+ export function __wbg_new_0f6d2ddfe083319b(arg0) {
515
+ const ret = new Date(getObject(arg0));
713
516
  return addHeapObject(ret);
714
- };
715
-
716
- export function __wbg_new_1f3a344cf3123716() {
717
- const ret = new Array();
517
+ }
518
+ export function __wbg_new_227d7c05414eb861() {
519
+ const ret = new Error();
718
520
  return addHeapObject(ret);
719
- };
720
-
721
- export function __wbg_new_2ff1f68f3676ea53() {
722
- const ret = new Map();
521
+ }
522
+ export function __wbg_new_4f9fafbb3909af72() {
523
+ const ret = new Object();
723
524
  return addHeapObject(ret);
724
- };
725
-
726
- export function __wbg_new_5a2ae4557f92b50e(arg0) {
727
- const ret = new Date(getObject(arg0));
525
+ }
526
+ export function __wbg_new_99cabae501c0a8a0() {
527
+ const ret = new Map();
728
528
  return addHeapObject(ret);
729
- };
730
-
731
- export function __wbg_new_638ebfaedbf32a5e(arg0) {
529
+ }
530
+ export function __wbg_new_a560378ea1240b14(arg0) {
732
531
  const ret = new Uint8Array(getObject(arg0));
733
532
  return addHeapObject(ret);
734
- };
735
-
736
- export function __wbg_new_8a6f238a6ece86ea() {
737
- const ret = new Error();
533
+ }
534
+ export function __wbg_new_f3c9df4f38f3f798() {
535
+ const ret = new Array();
738
536
  return addHeapObject(ret);
739
- };
740
-
741
- export function __wbg_next_5b3530e612fde77d(arg0) {
537
+ }
538
+ export function __wbg_next_01132ed6134b8ef5(arg0) {
742
539
  const ret = getObject(arg0).next;
743
540
  return addHeapObject(ret);
744
- };
745
-
746
- export function __wbg_next_692e82279131b03c() { return handleError(function (arg0) {
541
+ }
542
+ export function __wbg_next_b3713ec761a9dbfd() { return handleError(function (arg0) {
747
543
  const ret = getObject(arg0).next();
748
544
  return addHeapObject(ret);
749
- }, arguments) };
750
-
751
- export function __wbg_now_1e80617bcee43265() {
545
+ }, arguments); }
546
+ export function __wbg_now_88621c9c9a4f3ffc() {
752
547
  const ret = Date.now();
753
548
  return ret;
754
- };
755
-
756
- export function __wbg_parse_442f5ba02e5eaf8b() { return handleError(function (arg0, arg1) {
549
+ }
550
+ export function __wbg_parse_545d11396395fbbd() { return handleError(function (arg0, arg1) {
757
551
  const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
758
552
  return addHeapObject(ret);
759
- }, arguments) };
760
-
761
- export function __wbg_prototypesetcall_3d4a26c1ed734349(arg0, arg1, arg2) {
553
+ }, arguments); }
554
+ export function __wbg_prototypesetcall_3e05eb9545565046(arg0, arg1, arg2) {
762
555
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
763
- };
764
-
765
- export function __wbg_set_3807d5f0bfc24aa7(arg0, arg1, arg2) {
766
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
767
- };
768
-
769
- export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
770
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
771
- };
772
-
773
- export function __wbg_set_90f6c0f7bd8c0415(arg0, arg1, arg2) {
774
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
775
- };
776
-
777
- export function __wbg_set_b7f1cf4fae26fe2a(arg0, arg1, arg2) {
556
+ }
557
+ export function __wbg_set_08463b1df38a7e29(arg0, arg1, arg2) {
778
558
  const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
779
559
  return addHeapObject(ret);
780
- };
781
-
782
- 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) {
783
571
  const ret = getObject(arg1).stack;
784
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
572
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
785
573
  const len1 = WASM_VECTOR_LEN;
786
574
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
787
575
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
788
- };
789
-
790
- export function __wbg_stringify_b98c93d0a190446a() { return handleError(function (arg0) {
576
+ }
577
+ export function __wbg_stringify_a2c39d991e1bf91d() { return handleError(function (arg0) {
791
578
  const ret = JSON.stringify(getObject(arg0));
792
579
  return addHeapObject(ret);
793
- }, arguments) };
794
-
795
- export function __wbg_value_dd9372230531eade(arg0) {
580
+ }, arguments); }
581
+ export function __wbg_value_7f6052747ccf940f(arg0) {
796
582
  const ret = getObject(arg0).value;
797
583
  return addHeapObject(ret);
798
- };
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));
799
618
 
800
- export function __wbg_wbindgenbigintgetasi64_ac743ece6ab9bba1(arg0, arg1) {
801
- const v = getObject(arg1);
802
- const ret = typeof(v) === 'bigint' ? v : undefined;
803
- getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
804
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
805
- };
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];
806
623
 
807
- export function __wbg_wbindgenbooleanget_3fe6f642c7d97746(arg0) {
808
- const v = getObject(arg0);
809
- const ret = typeof(v) === 'boolean' ? v : undefined;
810
- return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
811
- };
624
+ heap[idx] = obj;
625
+ return idx;
626
+ }
812
627
 
813
- export function __wbg_wbindgendebugstring_99ef257a3ddda34d(arg0, arg1) {
814
- const ret = debugString(getObject(arg1));
815
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
816
- const len1 = WASM_VECTOR_LEN;
817
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
818
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
819
- };
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
+ }
820
692
 
821
- export function __wbg_wbindgenin_d7a1ee10933d2d55(arg0, arg1) {
822
- const ret = getObject(arg0) in getObject(arg1);
823
- return ret;
824
- };
693
+ function dropObject(idx) {
694
+ if (idx < 1028) return;
695
+ heap[idx] = heap_next;
696
+ heap_next = idx;
697
+ }
825
698
 
826
- export function __wbg_wbindgenisbigint_ecb90cc08a5a9154(arg0) {
827
- const ret = typeof(getObject(arg0)) === 'bigint';
828
- return ret;
829
- };
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
+ }
830
708
 
831
- export function __wbg_wbindgenisfunction_8cee7dce3725ae74(arg0) {
832
- const ret = typeof(getObject(arg0)) === 'function';
833
- return ret;
834
- };
709
+ function getArrayU8FromWasm0(ptr, len) {
710
+ ptr = ptr >>> 0;
711
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
712
+ }
835
713
 
836
- export function __wbg_wbindgenisobject_307a53c6bd97fbf8(arg0) {
837
- const val = getObject(arg0);
838
- const ret = typeof(val) === 'object' && val !== null;
839
- return ret;
840
- };
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
+ }
841
721
 
842
- export function __wbg_wbindgenisstring_d4fa939789f003b0(arg0) {
843
- const ret = typeof(getObject(arg0)) === 'string';
844
- return ret;
845
- };
722
+ function getStringFromWasm0(ptr, len) {
723
+ ptr = ptr >>> 0;
724
+ return decodeText(ptr, len);
725
+ }
846
726
 
847
- export function __wbg_wbindgenisundefined_c4b71d073b92f3c5(arg0) {
848
- const ret = getObject(arg0) === undefined;
849
- return ret;
850
- };
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
+ }
851
734
 
852
- export function __wbg_wbindgenjsvaleq_e6f2ad59ccae1b58(arg0, arg1) {
853
- const ret = getObject(arg0) === getObject(arg1);
854
- return ret;
855
- };
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
+ }
856
742
 
857
- export function __wbg_wbindgenjsvallooseeq_9bec8c9be826bed1(arg0, arg1) {
858
- const ret = getObject(arg0) == getObject(arg1);
859
- return ret;
860
- };
743
+ function getObject(idx) { return heap[idx]; }
861
744
 
862
- export function __wbg_wbindgennumberget_f74b4c7525ac05cb(arg0, arg1) {
863
- const obj = getObject(arg1);
864
- const ret = typeof(obj) === 'number' ? obj : undefined;
865
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
866
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
867
- };
745
+ function handleError(f, args) {
746
+ try {
747
+ return f.apply(this, args);
748
+ } catch (e) {
749
+ wasm.__wbindgen_export3(addHeapObject(e));
750
+ }
751
+ }
868
752
 
869
- export function __wbg_wbindgenstringget_0f16a6ddddef376f(arg0, arg1) {
870
- const obj = getObject(arg1);
871
- const ret = typeof(obj) === 'string' ? obj : undefined;
872
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
873
- var len1 = WASM_VECTOR_LEN;
874
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
875
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
876
- };
753
+ let heap = new Array(1024).fill(undefined);
754
+ heap.push(undefined, null, true, false);
877
755
 
878
- export function __wbg_wbindgenthrow_451ec1a8469d7eb6(arg0, arg1) {
879
- throw new Error(getStringFromWasm0(arg0, arg1));
880
- };
756
+ let heap_next = heap.length;
881
757
 
882
- export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
883
- // Cast intrinsic for `Ref(String) -> Externref`.
884
- const ret = getStringFromWasm0(arg0, arg1);
885
- return addHeapObject(ret);
886
- };
758
+ function isLikeNone(x) {
759
+ return x === undefined || x === null;
760
+ }
887
761
 
888
- export function __wbindgen_cast_4625c577ab2ec9ee(arg0) {
889
- // Cast intrinsic for `U64 -> Externref`.
890
- const ret = BigInt.asUintN(64, arg0);
891
- return addHeapObject(ret);
892
- };
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
+ }
893
768
 
894
- export function __wbindgen_cast_9ae0607507abb057(arg0) {
895
- // Cast intrinsic for `I64 -> Externref`.
896
- const ret = arg0;
897
- return addHeapObject(ret);
898
- };
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
+ }
899
777
 
900
- export function __wbindgen_cast_d6cd19b81560fd6e(arg0) {
901
- // Cast intrinsic for `F64 -> Externref`.
902
- const ret = arg0;
903
- return addHeapObject(ret);
904
- };
778
+ let len = arg.length;
779
+ let ptr = malloc(len, 1) >>> 0;
905
780
 
906
- export function __wbindgen_object_clone_ref(arg0) {
907
- const ret = getObject(arg0);
908
- return addHeapObject(ret);
909
- };
781
+ const mem = getUint8ArrayMemory0();
910
782
 
911
- export function __wbindgen_object_drop_ref(arg0) {
912
- takeObject(arg0);
913
- };
783
+ let offset = 0;
914
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
+ }