@gmb/bitmark-parser 3.0.1-alpha.4 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -21
- package/dist/browser/bitmark-parser.min.js +1 -1
- package/dist/browser/bitmark-parser.min.js.map +1 -1
- package/dist/browser/bitmark_wasm_bg.wasm +0 -0
- package/dist/browser/cjs/bitmark_wasm_bg.wasm +0 -0
- package/dist/browser/cjs/index.cjs +46 -32
- package/dist/browser/cjs/index.cjs.map +1 -1
- package/dist/browser/cjs/index.d.cts +16 -11
- package/dist/browser/esm/bitmark_wasm_bg.wasm +0 -0
- package/dist/browser/esm/index.d.ts +16 -11
- package/dist/browser/esm/index.js +44 -31
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/cli.js +6 -3
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -10
- package/dist/index.d.ts +9 -10
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/wasm/bitmark_wasm.d.ts +20 -24
- package/wasm/bitmark_wasm.js +58 -62
- package/wasm/bitmark_wasm_bg.wasm +0 -0
- package/wasm/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,29 +14,27 @@ npm install @gmb/bitmark-parser
|
|
|
14
14
|
import { convert, parse, lex, breakscapeText, unbreakscapeText, info, version } from "@gmb/bitmark-parser";
|
|
15
15
|
|
|
16
16
|
// Convert bitmark to JSON (auto-detects input format)
|
|
17
|
-
const json = convert("[.article]\nHello **bold**");
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
console.log(bitmark);
|
|
17
|
+
const json = convert("[.article]\nHello **bold**", { warnings: true });
|
|
18
|
+
const parsedJson = JSON.parse(json);
|
|
19
|
+
console.log(parsedJson[0].bit.type);
|
|
20
|
+
console.log(parsedJson[0].parser.warnings);
|
|
21
|
+
console.log(parsedJson[0].bitmark);
|
|
23
22
|
|
|
24
23
|
// Parse bitmark to JSON (same as convert for bitmark input)
|
|
25
|
-
const parsed = parse("[.article]\nHello **bold**");
|
|
24
|
+
const parsed = parse("[.article]\nHello **bold**", { mode: "full" });
|
|
26
25
|
|
|
27
26
|
// Lex bitmark to token dump
|
|
28
27
|
const tokens = lex("[.article]\nHello **bold**");
|
|
29
28
|
|
|
30
29
|
// Lex with a specific stage
|
|
31
|
-
const
|
|
32
|
-
const textTokens = lex(input, "lex-text");
|
|
30
|
+
const tokenJson = lex("[.article]\nHello **bold**", { stage: "lex-json" });
|
|
33
31
|
|
|
34
32
|
// Breakscape / unbreakscape text
|
|
35
33
|
const escaped = breakscapeText("[!example]", "bitmark++", "body");
|
|
36
34
|
const unescaped = unbreakscapeText(escaped, "bitmark++", "body");
|
|
37
35
|
|
|
38
36
|
// Query supported bit types
|
|
39
|
-
const bitInfo = info("list", "text");
|
|
37
|
+
const bitInfo = info({ infoType: "list", format: "text" });
|
|
40
38
|
|
|
41
39
|
// Get library version
|
|
42
40
|
console.log(version());
|
|
@@ -44,7 +42,7 @@ console.log(version());
|
|
|
44
42
|
|
|
45
43
|
### API
|
|
46
44
|
|
|
47
|
-
#### `convert(input: string,
|
|
45
|
+
#### `convert(input: string, options?: ConvertOptions): string`
|
|
48
46
|
|
|
49
47
|
Auto-detect input format and convert between bitmark and JSON.
|
|
50
48
|
|
|
@@ -55,34 +53,38 @@ Options (passed as a JSON string):
|
|
|
55
53
|
- `pretty` — prettify JSON output (default: `false`)
|
|
56
54
|
- `indent` — indent size for pretty JSON (default: `2`)
|
|
57
55
|
|
|
58
|
-
|
|
56
|
+
For bitmark input, output is a JSON array of entries with:
|
|
57
|
+
- `bit` — serialized bit payload
|
|
58
|
+
- `parser` — parser metadata and `warnings`
|
|
59
|
+
- `bitmark` — source bitmark text
|
|
60
|
+
|
|
61
|
+
#### `parse(input: string, options?: ParseOptions): string`
|
|
59
62
|
|
|
60
|
-
Parse bitmark text and return
|
|
63
|
+
Parse bitmark text and return structured JSON entries (`bit`, `parser`, `bitmark`).
|
|
61
64
|
|
|
62
65
|
#### `lex(input: string, stage?: string): string`
|
|
63
66
|
|
|
64
67
|
Lex bitmark text and return one token per line.
|
|
65
68
|
|
|
66
69
|
Stages:
|
|
67
|
-
- `"lex"` —
|
|
68
|
-
- `"lex-
|
|
69
|
-
- `"lex-text"` — Text formatting tokens only
|
|
70
|
+
- `"lex"` — Unified lexer token stream (default)
|
|
71
|
+
- `"lex-json"` — Unified lexer token stream as JSON
|
|
70
72
|
|
|
71
|
-
#### `breakscapeText(input: string,
|
|
73
|
+
#### `breakscapeText(input: string, options?: BreakscapeOptions): string`
|
|
72
74
|
|
|
73
75
|
Breakscape text (escape bitmark special characters).
|
|
74
76
|
|
|
75
77
|
- `format` — `"bitmark++"` (default) or `"plainText"`
|
|
76
78
|
- `location` — `"body"` (default) or `"tag"`
|
|
77
79
|
|
|
78
|
-
#### `unbreakscapeText(input: string,
|
|
80
|
+
#### `unbreakscapeText(input: string, options?: BreakscapeOptions): string`
|
|
79
81
|
|
|
80
82
|
Unbreakscape text (unescape bitmark special characters).
|
|
81
83
|
|
|
82
84
|
- `format` — `"bitmark++"` (default) or `"plainText"`
|
|
83
85
|
- `location` — `"body"` (default) or `"tag"`
|
|
84
86
|
|
|
85
|
-
#### `info(
|
|
87
|
+
#### `info(options?: InfoOptions): string`
|
|
86
88
|
|
|
87
89
|
Query information about supported bit types.
|
|
88
90
|
|
|
@@ -123,8 +125,8 @@ bitmark-parser-wasm parse input.bitmark --mode full
|
|
|
123
125
|
# Lex instead of parse
|
|
124
126
|
bitmark-parser-wasm parse --stage=lex input.bitmark
|
|
125
127
|
|
|
126
|
-
# Available stages: all (default), lex
|
|
127
|
-
bitmark-parser-wasm parse --stage=lex
|
|
128
|
+
# Available stages: all (default), lex
|
|
129
|
+
bitmark-parser-wasm parse --stage=lex input.bitmark
|
|
128
130
|
|
|
129
131
|
# Breakscape / unbreakscape text
|
|
130
132
|
bitmark-parser-wasm breakscape input.txt
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var t,
|
|
1
|
+
var t,p=0,m=null;function k(){return (m===null||m.byteLength===0)&&(m=new Uint8Array(t.memory.buffer)),m}var O=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},F=typeof O.encodeInto=="function"?function(e,n){return O.encodeInto(e,n)}:function(e,n){let r=O.encode(e);return n.set(r),{read:e.length,written:r.length}};function f(e,n,r){if(r===void 0){let _=O.encode(e),c=n(_.length,1)>>>0;return k().subarray(c,c+_.length).set(_),p=_.length,c}let o=e.length,s=n(o,1)>>>0,a=k(),i=0;for(;i<o;i++){let _=e.charCodeAt(i);if(_>127)break;a[s+i]=_;}if(i!==o){i!==0&&(e=e.slice(i)),s=r(s,o,o=i+e.length*3,1)>>>0;let _=k().subarray(s+i,s+o),c=F(e,_);i+=c.written,s=r(s,o,i,1)>>>0;}return p=i,s}var x=null;function g(){return (x===null||x.buffer.detached===true||x.buffer.detached===void 0&&x.buffer!==t.memory.buffer)&&(x=new DataView(t.memory.buffer)),x}var T=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:true,fatal:true}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&T.decode();function y(e,n){return e=e>>>0,T.decode(k().subarray(e,e+n))}function h(e,n){let r,o;try{let i=t.__wbindgen_add_to_stack_pointer(-16),_=f(e,t.__wbindgen_export_0,t.__wbindgen_export_1),c=p,d=f(n,t.__wbindgen_export_0,t.__wbindgen_export_1),b=p;t.lex(i,_,c,d,b);var s=g().getInt32(i+0,!0),a=g().getInt32(i+4,!0);return r=s,o=a,y(s,a)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export_2(r,o,1);}}function W(e,n,r){let o,s;try{let _=t.__wbindgen_add_to_stack_pointer(-16),c=f(e,t.__wbindgen_export_0,t.__wbindgen_export_1),d=p,b=f(n,t.__wbindgen_export_0,t.__wbindgen_export_1),u=p,w=f(r,t.__wbindgen_export_0,t.__wbindgen_export_1),l=p;t.breakscape_text(_,c,d,b,u,w,l);var a=g().getInt32(_+0,!0),i=g().getInt32(_+4,!0);return o=a,s=i,y(a,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export_2(o,s,1);}}function M(e,n,r,o,s,a){let i,_;try{let b=t.__wbindgen_add_to_stack_pointer(-16),u=f(e,t.__wbindgen_export_0,t.__wbindgen_export_1),w=p,l=f(n,t.__wbindgen_export_0,t.__wbindgen_export_1),v=p;t.convert(b,u,w,l,v,r,o,s,a);var c=g().getInt32(b+0,!0),d=g().getInt32(b+4,!0);return i=c,_=d,y(c,d)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export_2(i,_,1);}}function S(e,n,r,o,s){let a,i;try{let d=t.__wbindgen_add_to_stack_pointer(-16),b=f(e,t.__wbindgen_export_0,t.__wbindgen_export_1),u=p,w=f(n,t.__wbindgen_export_0,t.__wbindgen_export_1),l=p,v=f(r,t.__wbindgen_export_0,t.__wbindgen_export_1),B=p;t.info(d,b,u,w,l,v,B,o,s);var _=g().getInt32(d+0,!0),c=g().getInt32(d+4,!0);return a=_,i=c,y(_,c)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export_2(a,i,1);}}function E(e,n,r){let o,s;try{let _=t.__wbindgen_add_to_stack_pointer(-16),c=f(e,t.__wbindgen_export_0,t.__wbindgen_export_1),d=p,b=f(n,t.__wbindgen_export_0,t.__wbindgen_export_1),u=p,w=f(r,t.__wbindgen_export_0,t.__wbindgen_export_1),l=p;t.unbreakscape_text(_,c,d,b,u,w,l);var a=g().getInt32(_+0,!0),i=g().getInt32(_+4,!0);return o=a,s=i,y(a,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export_2(o,s,1);}}function L(e,n){let r,o;try{let i=t.__wbindgen_add_to_stack_pointer(-16),_=f(e,t.__wbindgen_export_0,t.__wbindgen_export_1),c=p,d=f(n,t.__wbindgen_export_0,t.__wbindgen_export_1),b=p;t.parse(i,_,c,d,b);var s=g().getInt32(i+0,!0),a=g().getInt32(i+4,!0);return r=s,o=a,y(s,a)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export_2(r,o,1);}}async function P(e,n){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,n)}catch(o){if(e.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",o);else throw o}let r=await e.arrayBuffer();return await WebAssembly.instantiate(r,n)}else {let r=await WebAssembly.instantiate(e,n);return r instanceof WebAssembly.Instance?{instance:r,module:e}:r}}function C(){let e={};return e.wbg={},e}function j(e,n){return t=e.exports,D.__wbindgen_wasm_module=n,x=null,m=null,t}function U(e){if(t!==void 0)return t;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let n=C();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));let r=new WebAssembly.Instance(e,n);return j(r,e)}async function D(e){if(t!==void 0)return t;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof e>"u"&&(e=new URL("bitmark_wasm_bg.wasm",import.meta.url));let n=C();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));let{instance:r,module:o}=await P(await e,n);return j(r,o)}var z=D;var R={version:"3.0.2"};function H(){return R.version}function J(e,n={}){return h(e,n.stage??"lex")}function Q(e,n={}){return L(e,n.mode??"optimized")}function X(e,n={}){return M(e,n.mode??"optimized",n.warnings??false,n.plainText??false,n.pretty??false,n.indent??2)}function Y(e,n={}){let r=n.format??"bitmark++",o=n.location??"body";return W(e,r,o)}function Z(e,n={}){let r=n.format??"bitmark++",o=n.location??"body";return E(e,r,o)}function $(e={}){let n=e.infoType??"list",r=e.format??"text",o=e.bit??"",s=e.pretty??false,a=e.indent??2;return S(n,r,o,s,a)}export{Y as breakscapeText,X as convert,$ as info,z as init,U as initSync,J as lex,Q as parse,Z as unbreakscapeText,H as version};//# sourceMappingURL=bitmark-parser.min.js.map
|
|
2
2
|
//# sourceMappingURL=bitmark-parser.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../wasm-web/bitmark_wasm.js","../../src/browser/index.ts"],"names":["wasm","WASM_VECTOR_LEN","cachedUint8ArrayMemory0","getUint8ArrayMemory0","cachedTextEncoder","encodeString","arg","view","buf","passStringToWasm0","malloc","realloc","ptr","len","mem","offset","code","ret","cachedDataViewMemory0","getDataViewMemory0","cachedTextDecoder","getStringFromWasm0","breakscape_text","input","format","location","deferred4_0","deferred4_1","retptr","ptr0","len0","ptr1","len1","ptr2","len2","r0","r1","unbreakscape_text","parse","mode","deferred3_0","deferred3_1","convert","warnings","plain_text","pretty","indent","info","info_type","bit","lex","stage","__wbg_load","module","imports","e","bytes","instance","__wbg_get_imports","__wbg_finalize_init","__wbg_init","initSync","module_or_path","bitmark_wasm_default","options","breakscapeText","unbreakscapeText","infoType"],"mappings":"AAAA,IAAIA,CAAAA,CAEAC,CAAAA,CAAkB,CAAA,CAElBC,CAAAA,CAA0B,KAE9B,SAASC,CAAAA,EAAuB,CAC5B,OAAA,CAAID,IAA4B,IAAA,EAAQA,CAAAA,CAAwB,UAAA,GAAe,CAAA,IAC3EA,EAA0B,IAAI,UAAA,CAAWF,CAAAA,CAAK,MAAA,CAAO,MAAM,CAAA,CAAA,CAExDE,CACX,CAEA,IAAME,CAAAA,CAAqB,OAAO,WAAA,CAAgB,GAAA,CAAc,IAAI,WAAA,CAAY,OAAO,CAAA,CAAI,CAAE,OAAQ,IAAM,CAAE,MAAM,KAAA,CAAM,2BAA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,IAAMxC,CAAAA,CAASwC,CAAAA,CAAQ,MAAA,EAAU,WAAA,CAC3BvC,EAAWuC,CAAAA,CAAQ,QAAA,EAAY,MAAA,CACrC,OAAY3B,EAAkBd,CAAAA,CAAOC,CAAAA,CAAQC,CAAQ,CACvD,CAQO,SAASsB,CAAAA,CAAKiB,CAAAA,CAAuB,EAAC,CAAW,CACtD,IAAMG,CAAAA,CAAWH,EAAQ,QAAA,EAAY,MAAA,CAC/BxC,CAAAA,CAASwC,CAAAA,CAAQ,QAAU,MAAA,CAC3Bf,CAAAA,CAAMe,CAAAA,CAAQ,GAAA,EAAO,GACrBnB,CAAAA,CAASmB,CAAAA,CAAQ,MAAA,EAAU,KAAA,CAC3BlB,EAASkB,CAAAA,CAAQ,MAAA,EAAU,CAAA,CACjC,OAAYjB,EAAKoB,CAAAA,CAAU3C,CAAAA,CAAQyB,CAAAA,CAAKJ,CAAAA,CAAQC,CAAM,CACxD","file":"bitmark-parser.min.js","sourcesContent":["let wasm;\n\nlet WASM_VECTOR_LEN = 0;\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nconst cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );\n\nconst encodeString = (typeof cachedTextEncoder.encodeInto === 'function'\n ? function (arg, view) {\n return cachedTextEncoder.encodeInto(arg, view);\n}\n : function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n});\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length, 1) >>> 0;\n getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len, 1) >>> 0;\n\n const mem = getUint8ArrayMemory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;\n const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);\n const ret = encodeString(arg, view);\n\n offset += ret.written;\n ptr = realloc(ptr, len, offset, 1) >>> 0;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nlet cachedDataViewMemory0 = null;\n\nfunction getDataViewMemory0() {\n if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {\n cachedDataViewMemory0 = new DataView(wasm.memory.buffer);\n }\n return cachedDataViewMemory0;\n}\n\nconst cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );\n\nif (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n/**\n * Breakscape text (escape bitmark special characters).\n *\n * `format`: `\"bitmark++\"` (default) or `\"plainText\"`\n * `location`: `\"body\"` (default) or `\"tag\"`\n * @param {string} input\n * @param {string} format\n * @param {string} location\n * @returns {string}\n */\nexport function breakscape_text(input, format, location) {\n let deferred4_0;\n let deferred4_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred4_0 = r0;\n deferred4_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);\n }\n}\n\n/**\n * Unbreakscape text (unescape bitmark special characters).\n *\n * `format`: `\"bitmark++\"` (default) or `\"plainText\"`\n * `location`: `\"body\"` (default) or `\"tag\"`\n * @param {string} input\n * @param {string} format\n * @param {string} location\n * @returns {string}\n */\nexport function unbreakscape_text(input, format, location) {\n let deferred4_0;\n let deferred4_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred4_0 = r0;\n deferred4_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);\n }\n}\n\n/**\n * Parse bitmark input text and return the reference JSON format.\n *\n * Uses the full pipeline: parse → validate → serialize.\n *\n * `mode`: `\"optimized\"` (default) or `\"full\"`\n * @param {string} input\n * @param {string} mode\n * @returns {string}\n */\nexport function parse(input, mode) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.parse(retptr, ptr0, len0, ptr1, len1);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred3_0 = r0;\n deferred3_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\n\n/**\n * Auto-detect input format and convert between bitmark and JSON.\n *\n * `mode`: `\"optimized\"` (default) or `\"full\"`\n * `warnings`: whether to include validation warnings (default: false)\n * `plain_text`: output text as plain text — debug mode (default: false)\n * `pretty`: prettify JSON output (default: false)\n * `indent`: indent size for pretty-printing (default: 2)\n *\n * Returns JSON if input is bitmark, or an error message if input is JSON\n * (generator not yet implemented).\n * @param {string} input\n * @param {string} mode\n * @param {boolean} warnings\n * @param {boolean} plain_text\n * @param {boolean} pretty\n * @param {number} indent\n * @returns {string}\n */\nexport function convert(input, mode, warnings, plain_text, pretty, indent) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.convert(retptr, ptr0, len0, ptr1, len1, warnings, plain_text, pretty, indent);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred3_0 = r0;\n deferred3_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\n\n/**\n * Query information about supported bit types.\n *\n * `info_type`: `\"list\"`, `\"bit\"`, `\"all\"`, or `\"deprecated\"`\n * `format`: `\"text\"` or `\"json\"`\n * `bit`: bit name (required when `info_type` is `\"bit\"`)\n * `pretty`: whether to pretty-print JSON output\n * `indent`: indent size for pretty-printing (default: 2)\n * @param {string} info_type\n * @param {string} format\n * @param {string} bit\n * @param {boolean} pretty\n * @param {number} indent\n * @returns {string}\n */\nexport function info(info_type, format, bit, pretty, indent) {\n let deferred4_0;\n let deferred4_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(info_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(bit, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred4_0 = r0;\n deferred4_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);\n }\n}\n\n/**\n * Lex bitmark input text, returning one line per token in the same format as\n * the Rust CLI: `{kind:?} {span:?} \"{text}\"`.\n *\n * `stage` selects the lexer pipeline:\n * - `\"lex\"` — combined (default)\n * - `\"lex-bitmark\"` — bitmark-level only\n * - `\"lex-text\"` — text-level only\n * - `\"lex-json\"` — combined, JSON array output\n * - `\"lex-bitmark-json\"` — bitmark-level, JSON array output\n * - `\"lex-text-json\"` — text-level, JSON array output\n * @param {string} input\n * @param {string} stage\n * @returns {string}\n */\nexport function lex(input, stage) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(stage, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.lex(retptr, ptr0, len0, ptr1, len1);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred3_0 = r0;\n deferred3_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\n\nasync function __wbg_load(module, imports) {\n if (typeof Response === 'function' && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === 'function') {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n\n } catch (e) {\n if (module.headers.get('Content-Type') != 'application/wasm') {\n console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\", e);\n\n } else {\n throw e;\n }\n }\n }\n\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n\n } else {\n return instance;\n }\n }\n}\n\nfunction __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n\n return imports;\n}\n\nfunction __wbg_init_memory(imports, memory) {\n\n}\n\nfunction __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedDataViewMemory0 = null;\n cachedUint8ArrayMemory0 = null;\n\n\n\n return wasm;\n}\n\nfunction initSync(module) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module !== 'undefined') {\n if (Object.getPrototypeOf(module) === Object.prototype) {\n ({module} = module)\n } else {\n console.warn('using deprecated parameters for `initSync()`; pass a single object instead')\n }\n }\n\n const imports = __wbg_get_imports();\n\n __wbg_init_memory(imports);\n\n if (!(module instanceof WebAssembly.Module)) {\n module = new WebAssembly.Module(module);\n }\n\n const instance = new WebAssembly.Instance(module, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nasync function __wbg_init(module_or_path) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module_or_path !== 'undefined') {\n if (Object.getPrototypeOf(module_or_path) === Object.prototype) {\n ({module_or_path} = module_or_path)\n } else {\n console.warn('using deprecated parameters for the initialization function; pass a single object instead')\n }\n }\n\n if (typeof module_or_path === 'undefined') {\n module_or_path = new URL('bitmark_wasm_bg.wasm', import.meta.url);\n }\n const imports = __wbg_get_imports();\n\n if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {\n module_or_path = fetch(module_or_path);\n }\n\n __wbg_init_memory(imports);\n\n const { instance, module } = await __wbg_load(await module_or_path, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nexport { initSync };\nexport default __wbg_init;\n","// This is a browser entry point that wraps the wasm-web bindings.\n// It re-exports all WASM functions so browser consumers can use:\n// import { parse, convert, ... } from '@gmb/bitmark-parser/browser'\n\nimport * as wasm from \"../../wasm-web/bitmark_wasm.js\";\n\nexport { default as init, initSync } from \"../../wasm-web/bitmark_wasm.js\";\n\nexport type { LexOptions, LexStage, ParseOptions, ConvertOptions, OutputMode, BreakscapeOptions, TextFormat, TextLocation, InfoOptions, InfoType, InfoFormat } from \"../types.js\";\nimport type { LexOptions, ParseOptions, ConvertOptions, BreakscapeOptions, InfoOptions } from \"../types.js\";\n\n/**\n * Lex bitmark input text, returning one line per token.\n *\n * @param input - The bitmark source text.\n * @param options - Lex options (e.g. `{ stage: \"lex-bitmark\" }`).\n * @returns Token dump string (one token per line).\n */\nexport function lex(input: string, options: LexOptions = {}): string {\n return wasm.lex(input, options.stage ?? \"lex\");\n}\n\n/**\n * Parse bitmark input text and return the reference JSON format.\n *\n * @param input - The bitmark source text.\n * @param options - Parse options (e.g. `{ mode: \"full\" }`).\n * @returns JSON string of the parsed bitmark document.\n */\nexport function parse(input: string, options: ParseOptions = {}): string {\n return wasm.parse(input, options.mode ?? \"optimized\");\n}\n\n/**\n * Auto-detect input format and convert between bitmark and JSON.\n *\n * @param input - Bitmark or JSON input text.\n * @param options - Convert options (e.g. `{ mode: \"full\", warnings: true }`).\n * @returns Converted output string.\n */\nexport function convert(input: string, options: ConvertOptions = {}): string {\n return wasm.convert(input, options.mode ?? \"optimized\", options.warnings ?? false, options.plainText ?? false, options.pretty ?? false, options.indent ?? 2);\n}\n\n/**\n * Breakscape text (escape bitmark special characters).\n *\n * @param input - The text to breakscape.\n * @param options - Breakscape options (e.g. `{ format: \"plainText\", location: \"tag\" }`).\n * @returns Breakscaped text.\n */\nexport function breakscapeText(input: string, options: BreakscapeOptions = {}): string {\n const format = options.format ?? \"bitmark++\";\n const location = options.location ?? \"body\";\n return wasm.breakscape_text(input, format, location);\n}\n\n/**\n * Unbreakscape text (unescape bitmark special characters).\n *\n * @param input - The text to unbreakscape.\n * @param options - Unbreakscape options (e.g. `{ format: \"plainText\", location: \"tag\" }`).\n * @returns Unbreakscaped text.\n */\nexport function unbreakscapeText(input: string, options: BreakscapeOptions = {}): string {\n const format = options.format ?? \"bitmark++\";\n const location = options.location ?? \"body\";\n return wasm.unbreakscape_text(input, format, location);\n}\n\n/**\n * Query information about supported bit types.\n *\n * @param options - Info options (e.g. `{ infoType: \"bit\", format: \"json\", bit: \"cloze\" }`).\n * @returns Information string.\n */\nexport function info(options: InfoOptions = {}): string {\n const infoType = options.infoType ?? \"list\";\n const format = options.format ?? \"text\";\n const bit = options.bit ?? \"\";\n const pretty = options.pretty ?? false;\n const indent = options.indent ?? 2;\n return wasm.info(infoType, format, bit, pretty, indent);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../wasm-web/bitmark_wasm.js","../../src/generated/package_info.ts","../../src/browser/index.ts"],"names":["wasm","WASM_VECTOR_LEN","cachedUint8ArrayMemory0","getUint8ArrayMemory0","cachedTextEncoder","encodeString","arg","view","buf","passStringToWasm0","malloc","realloc","ptr","len","mem","offset","code","ret","cachedDataViewMemory0","getDataViewMemory0","cachedTextDecoder","getStringFromWasm0","lex","input","stage","deferred3_0","deferred3_1","retptr","ptr0","len0","ptr1","len1","r0","r1","breakscape_text","format","location","deferred4_0","deferred4_1","ptr2","len2","convert","mode","warnings","plain_text","pretty","indent","info","info_type","bit","unbreakscape_text","parse","__wbg_load","module","imports","e","bytes","instance","__wbg_get_imports","__wbg_finalize_init","__wbg_init","initSync","module_or_path","bitmark_wasm_default","PACKAGE_INFO","version","options","breakscapeText","unbreakscapeText","infoType"],"mappings":"AAAA,IAAIA,CAAAA,CAEAC,CAAAA,CAAkB,CAAA,CAElBC,CAAAA,CAA0B,KAE9B,SAASC,CAAAA,EAAuB,CAC5B,OAAA,CAAID,IAA4B,IAAA,EAAQA,CAAAA,CAAwB,UAAA,GAAe,CAAA,IAC3EA,EAA0B,IAAI,UAAA,CAAWF,CAAAA,CAAK,MAAA,CAAO,MAAM,CAAA,CAAA,CAExDE,CACX,CAEA,IAAME,EAAqB,OAAO,WAAA,CAAgB,GAAA,CAAc,IAAI,YAAY,OAAO,CAAA,CAAI,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,MAAA,EAAU,WAAA,CAC3B9B,CAAAA,CAAW8B,CAAAA,CAAQ,UAAY,MAAA,CACrC,OAAYhC,CAAAA,CAAgBX,CAAAA,CAAOY,EAAQC,CAAQ,CACrD,CASO,SAASgC,EAAiB7C,CAAAA,CAAe2C,CAAAA,CAA6B,EAAC,CAAW,CACvF,IAAM/B,CAAAA,CAAS+B,CAAAA,CAAQ,MAAA,EAAU,YAC3B9B,CAAAA,CAAW8B,CAAAA,CAAQ,QAAA,EAAY,MAAA,CACrC,OAAYhB,CAAAA,CAAkB3B,CAAAA,CAAOY,CAAAA,CAAQC,CAAQ,CACvD,CAQO,SAASW,CAAAA,CAAKmB,CAAAA,CAAuB,EAAC,CAAW,CACtD,IAAMG,CAAAA,CAAWH,EAAQ,QAAA,EAAY,MAAA,CAC/B/B,CAAAA,CAAS+B,CAAAA,CAAQ,QAAU,MAAA,CAC3BjB,CAAAA,CAAMiB,CAAAA,CAAQ,GAAA,EAAO,GACrBrB,CAAAA,CAASqB,CAAAA,CAAQ,MAAA,EAAU,KAAA,CAC3BpB,EAASoB,CAAAA,CAAQ,MAAA,EAAU,CAAA,CACjC,OAAYnB,EAAKsB,CAAAA,CAAUlC,CAAAA,CAAQc,CAAAA,CAAKJ,CAAAA,CAAQC,CAAM,CACxD","file":"bitmark-parser.min.js","sourcesContent":["let wasm;\n\nlet WASM_VECTOR_LEN = 0;\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nconst cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );\n\nconst encodeString = (typeof cachedTextEncoder.encodeInto === 'function'\n ? function (arg, view) {\n return cachedTextEncoder.encodeInto(arg, view);\n}\n : function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n});\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length, 1) >>> 0;\n getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len, 1) >>> 0;\n\n const mem = getUint8ArrayMemory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;\n const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);\n const ret = encodeString(arg, view);\n\n offset += ret.written;\n ptr = realloc(ptr, len, offset, 1) >>> 0;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nlet cachedDataViewMemory0 = null;\n\nfunction getDataViewMemory0() {\n if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {\n cachedDataViewMemory0 = new DataView(wasm.memory.buffer);\n }\n return cachedDataViewMemory0;\n}\n\nconst cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );\n\nif (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n/**\n * Lex bitmark input text, returning one line per token in the same format as\n * the Rust CLI: `{kind:?} {span:?} \"{text}\"`.\n *\n * `stage` selects the lexer pipeline:\n * - `\"lex\"` — combined (default)\n * - `\"lex-json\"` — combined, JSON array output\n * @param {string} input\n * @param {string} stage\n * @returns {string}\n */\nexport function lex(input, stage) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(stage, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.lex(retptr, ptr0, len0, ptr1, len1);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred3_0 = r0;\n deferred3_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\n\n/**\n * Breakscape text (escape bitmark special characters).\n *\n * `format`: `\"bitmark++\"` (default) or `\"plainText\"`\n * `location`: `\"body\"` (default) or `\"tag\"`\n * @param {string} input\n * @param {string} format\n * @param {string} location\n * @returns {string}\n */\nexport function breakscape_text(input, format, location) {\n let deferred4_0;\n let deferred4_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred4_0 = r0;\n deferred4_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);\n }\n}\n\n/**\n * Auto-detect input format and convert between bitmark and JSON.\n *\n * `mode`: `\"optimized\"` (default) or `\"full\"`\n * `warnings`: whether to include validation warnings (default: false)\n * `plain_text`: output text as plain text — debug mode (default: false)\n * `pretty`: prettify JSON output (default: false)\n * `indent`: indent size for pretty-printing (default: 2)\n *\n * Returns JSON if input is bitmark, or an error message if input is JSON\n * (generator not yet implemented).\n * @param {string} input\n * @param {string} mode\n * @param {boolean} warnings\n * @param {boolean} plain_text\n * @param {boolean} pretty\n * @param {number} indent\n * @returns {string}\n */\nexport function convert(input, mode, warnings, plain_text, pretty, indent) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.convert(retptr, ptr0, len0, ptr1, len1, warnings, plain_text, pretty, indent);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred3_0 = r0;\n deferred3_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\n\n/**\n * Query information about supported bit types.\n *\n * `info_type`: `\"list\"`, `\"bit\"`, `\"all\"`, or `\"deprecated\"`\n * `format`: `\"text\"` or `\"json\"`\n * `bit`: bit name (required when `info_type` is `\"bit\"`)\n * `pretty`: whether to pretty-print JSON output\n * `indent`: indent size for pretty-printing (default: 2)\n * @param {string} info_type\n * @param {string} format\n * @param {string} bit\n * @param {boolean} pretty\n * @param {number} indent\n * @returns {string}\n */\nexport function info(info_type, format, bit, pretty, indent) {\n let deferred4_0;\n let deferred4_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(info_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(bit, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred4_0 = r0;\n deferred4_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);\n }\n}\n\n/**\n * Unbreakscape text (unescape bitmark special characters).\n *\n * `format`: `\"bitmark++\"` (default) or `\"plainText\"`\n * `location`: `\"body\"` (default) or `\"tag\"`\n * @param {string} input\n * @param {string} format\n * @param {string} location\n * @returns {string}\n */\nexport function unbreakscape_text(input, format, location) {\n let deferred4_0;\n let deferred4_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred4_0 = r0;\n deferred4_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);\n }\n}\n\n/**\n * Parse bitmark input text and return the reference JSON format.\n *\n * Uses the full pipeline: parse → validate → serialize.\n *\n * `mode`: `\"optimized\"` (default) or `\"full\"`\n * @param {string} input\n * @param {string} mode\n * @returns {string}\n */\nexport function parse(input, mode) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.parse(retptr, ptr0, len0, ptr1, len1);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred3_0 = r0;\n deferred3_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\n\nasync function __wbg_load(module, imports) {\n if (typeof Response === 'function' && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === 'function') {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n\n } catch (e) {\n if (module.headers.get('Content-Type') != 'application/wasm') {\n console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\", e);\n\n } else {\n throw e;\n }\n }\n }\n\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n\n } else {\n return instance;\n }\n }\n}\n\nfunction __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n\n return imports;\n}\n\nfunction __wbg_init_memory(imports, memory) {\n\n}\n\nfunction __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedDataViewMemory0 = null;\n cachedUint8ArrayMemory0 = null;\n\n\n\n return wasm;\n}\n\nfunction initSync(module) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module !== 'undefined') {\n if (Object.getPrototypeOf(module) === Object.prototype) {\n ({module} = module)\n } else {\n console.warn('using deprecated parameters for `initSync()`; pass a single object instead')\n }\n }\n\n const imports = __wbg_get_imports();\n\n __wbg_init_memory(imports);\n\n if (!(module instanceof WebAssembly.Module)) {\n module = new WebAssembly.Module(module);\n }\n\n const instance = new WebAssembly.Instance(module, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nasync function __wbg_init(module_or_path) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module_or_path !== 'undefined') {\n if (Object.getPrototypeOf(module_or_path) === Object.prototype) {\n ({module_or_path} = module_or_path)\n } else {\n console.warn('using deprecated parameters for the initialization function; pass a single object instead')\n }\n }\n\n if (typeof module_or_path === 'undefined') {\n module_or_path = new URL('bitmark_wasm_bg.wasm', import.meta.url);\n }\n const imports = __wbg_get_imports();\n\n if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {\n module_or_path = fetch(module_or_path);\n }\n\n __wbg_init_memory(imports);\n\n const { instance, module } = await __wbg_load(await module_or_path, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nexport { initSync };\nexport default __wbg_init;\n","// This file is automatically generated. DO NOT EDIT.\n\n/* eslint-disable */\n\nexport const PACKAGE_INFO = {\n \"name\": \"@gmb/bitmark-parser\",\n \"version\": \"3.0.2\",\n \"author\": \"Get More Brain Ltd <info@getmorebrain.com>\",\n \"license\": \"ISC\",\n \"description\": \"A parser for bitmark text, powered by WebAssembly.\"\n};\n","// This is a browser entry point that wraps the wasm-web bindings.\n// It re-exports all WASM functions so browser consumers can use:\n// import { parse, convert, ... } from '@gmb/bitmark-parser/browser'\n\nimport * as wasm from \"../../wasm-web/bitmark_wasm.js\";\nimport { PACKAGE_INFO } from \"../generated/package_info.js\";\n\nexport { default as init, initSync } from \"../../wasm-web/bitmark_wasm.js\";\n\nexport type { LexOptions, LexStage, ParseOptions, ConvertOptions, OutputMode, BreakscapeOptions, TextFormat, TextLocation, InfoOptions, InfoType, InfoFormat } from \"../types.js\";\nimport type { LexOptions, ParseOptions, ConvertOptions, BreakscapeOptions, InfoOptions } from \"../types.js\";\n\n/**\n * Get the version of the @gmb/bitmark-parser library.\n *\n * @returns Version string (e.g. \"3.0.0\").\n */\nexport function version(): string {\n return PACKAGE_INFO.version;\n}\n\n/**\n * Lex bitmark input text, returning one line per token.\n *\n * @param input - The bitmark source text.\n * @param options - Lex options (e.g. `{ stage: \"lex\" }`).\n * @returns Token dump string (one token per line).\n */\nexport function lex(input: string, options: LexOptions = {}): string {\n return wasm.lex(input, options.stage ?? \"lex\");\n}\n\n/**\n * Parse bitmark input text and return structured JSON entries.\n *\n * Each entry contains `bit`, `parser`, and `bitmark` fields.\n *\n * @param input - The bitmark source text.\n * @param options - Parse options (e.g. `{ mode: \"full\" }`).\n * @returns JSON string array of structured parsed entries.\n */\nexport function parse(input: string, options: ParseOptions = {}): string {\n return wasm.parse(input, options.mode ?? \"optimized\");\n}\n\n/**\n * Auto-detect input format and convert between bitmark and JSON.\n *\n * @param input - Bitmark or JSON input text.\n * @param options - Convert options (e.g. `{ mode: \"full\", warnings: true }`).\n * @returns Converted output string. For bitmark input, this is a JSON string\n * array of structured parsed entries (`bit`, `parser`, `bitmark`).\n */\nexport function convert(input: string, options: ConvertOptions = {}): string {\n return wasm.convert(input, options.mode ?? \"optimized\", options.warnings ?? false, options.plainText ?? false, options.pretty ?? false, options.indent ?? 2);\n}\n\n/**\n * Breakscape text (escape bitmark special characters).\n *\n * @param input - The text to breakscape.\n * @param options - Breakscape options (e.g. `{ format: \"plainText\", location: \"tag\" }`).\n * @returns Breakscaped text.\n */\nexport function breakscapeText(input: string, options: BreakscapeOptions = {}): string {\n const format = options.format ?? \"bitmark++\";\n const location = options.location ?? \"body\";\n return wasm.breakscape_text(input, format, location);\n}\n\n/**\n * Unbreakscape text (unescape bitmark special characters).\n *\n * @param input - The text to unbreakscape.\n * @param options - Unbreakscape options (e.g. `{ format: \"plainText\", location: \"tag\" }`).\n * @returns Unbreakscaped text.\n */\nexport function unbreakscapeText(input: string, options: BreakscapeOptions = {}): string {\n const format = options.format ?? \"bitmark++\";\n const location = options.location ?? \"body\";\n return wasm.unbreakscape_text(input, format, location);\n}\n\n/**\n * Query information about supported bit types.\n *\n * @param options - Info options (e.g. `{ infoType: \"bit\", format: \"json\", bit: \"cloze\" }`).\n * @returns Information string.\n */\nexport function info(options: InfoOptions = {}): string {\n const infoType = options.infoType ?? \"list\";\n const format = options.format ?? \"text\";\n const bit = options.bit ?? \"\";\n const pretty = options.pretty ?? false;\n const indent = options.indent ?? 2;\n return wasm.info(infoType, format, bit, pretty, indent);\n}\n"]}
|
|
Binary file
|
|
Binary file
|
|
@@ -27,7 +27,8 @@ __export(index_exports, {
|
|
|
27
27
|
initSync: () => initSync,
|
|
28
28
|
lex: () => lex2,
|
|
29
29
|
parse: () => parse2,
|
|
30
|
-
unbreakscapeText: () => unbreakscapeText
|
|
30
|
+
unbreakscapeText: () => unbreakscapeText,
|
|
31
|
+
version: () => version
|
|
31
32
|
});
|
|
32
33
|
module.exports = __toCommonJS(index_exports);
|
|
33
34
|
|
|
@@ -105,29 +106,27 @@ function getStringFromWasm0(ptr, len) {
|
|
|
105
106
|
ptr = ptr >>> 0;
|
|
106
107
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
107
108
|
}
|
|
108
|
-
function
|
|
109
|
-
let
|
|
110
|
-
let
|
|
109
|
+
function lex(input, stage) {
|
|
110
|
+
let deferred3_0;
|
|
111
|
+
let deferred3_1;
|
|
111
112
|
try {
|
|
112
113
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
113
114
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
114
115
|
const len0 = WASM_VECTOR_LEN;
|
|
115
|
-
const ptr1 = passStringToWasm0(
|
|
116
|
+
const ptr1 = passStringToWasm0(stage, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
116
117
|
const len1 = WASM_VECTOR_LEN;
|
|
117
|
-
|
|
118
|
-
const len2 = WASM_VECTOR_LEN;
|
|
119
|
-
wasm.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
118
|
+
wasm.lex(retptr, ptr0, len0, ptr1, len1);
|
|
120
119
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
121
120
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
deferred3_0 = r0;
|
|
122
|
+
deferred3_1 = r1;
|
|
124
123
|
return getStringFromWasm0(r0, r1);
|
|
125
124
|
} finally {
|
|
126
125
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
127
|
-
wasm.__wbindgen_export_2(
|
|
126
|
+
wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
128
127
|
}
|
|
129
128
|
}
|
|
130
|
-
function
|
|
129
|
+
function breakscape_text(input, format, location) {
|
|
131
130
|
let deferred4_0;
|
|
132
131
|
let deferred4_1;
|
|
133
132
|
try {
|
|
@@ -138,7 +137,7 @@ function unbreakscape_text(input, format, location) {
|
|
|
138
137
|
const len1 = WASM_VECTOR_LEN;
|
|
139
138
|
const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
140
139
|
const len2 = WASM_VECTOR_LEN;
|
|
141
|
-
wasm.
|
|
140
|
+
wasm.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
142
141
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
143
142
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
144
143
|
deferred4_0 = r0;
|
|
@@ -149,7 +148,7 @@ function unbreakscape_text(input, format, location) {
|
|
|
149
148
|
wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
150
149
|
}
|
|
151
150
|
}
|
|
152
|
-
function
|
|
151
|
+
function convert(input, mode, warnings, plain_text, pretty, indent) {
|
|
153
152
|
let deferred3_0;
|
|
154
153
|
let deferred3_1;
|
|
155
154
|
try {
|
|
@@ -158,7 +157,7 @@ function parse(input, mode) {
|
|
|
158
157
|
const len0 = WASM_VECTOR_LEN;
|
|
159
158
|
const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
160
159
|
const len1 = WASM_VECTOR_LEN;
|
|
161
|
-
wasm.
|
|
160
|
+
wasm.convert(retptr, ptr0, len0, ptr1, len1, warnings, plain_text, pretty, indent);
|
|
162
161
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
163
162
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
164
163
|
deferred3_0 = r0;
|
|
@@ -169,38 +168,40 @@ function parse(input, mode) {
|
|
|
169
168
|
wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
|
|
170
169
|
}
|
|
171
170
|
}
|
|
172
|
-
function
|
|
173
|
-
let
|
|
174
|
-
let
|
|
171
|
+
function info(info_type, format, bit, pretty, indent) {
|
|
172
|
+
let deferred4_0;
|
|
173
|
+
let deferred4_1;
|
|
175
174
|
try {
|
|
176
175
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
177
|
-
const ptr0 = passStringToWasm0(
|
|
176
|
+
const ptr0 = passStringToWasm0(info_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
178
177
|
const len0 = WASM_VECTOR_LEN;
|
|
179
|
-
const ptr1 = passStringToWasm0(
|
|
178
|
+
const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
180
179
|
const len1 = WASM_VECTOR_LEN;
|
|
181
|
-
|
|
180
|
+
const ptr2 = passStringToWasm0(bit, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
181
|
+
const len2 = WASM_VECTOR_LEN;
|
|
182
|
+
wasm.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent);
|
|
182
183
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
183
184
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
184
|
-
|
|
185
|
-
|
|
185
|
+
deferred4_0 = r0;
|
|
186
|
+
deferred4_1 = r1;
|
|
186
187
|
return getStringFromWasm0(r0, r1);
|
|
187
188
|
} finally {
|
|
188
189
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
189
|
-
wasm.__wbindgen_export_2(
|
|
190
|
+
wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
190
191
|
}
|
|
191
192
|
}
|
|
192
|
-
function
|
|
193
|
+
function unbreakscape_text(input, format, location) {
|
|
193
194
|
let deferred4_0;
|
|
194
195
|
let deferred4_1;
|
|
195
196
|
try {
|
|
196
197
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
197
|
-
const ptr0 = passStringToWasm0(
|
|
198
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
198
199
|
const len0 = WASM_VECTOR_LEN;
|
|
199
200
|
const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
200
201
|
const len1 = WASM_VECTOR_LEN;
|
|
201
|
-
const ptr2 = passStringToWasm0(
|
|
202
|
+
const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
202
203
|
const len2 = WASM_VECTOR_LEN;
|
|
203
|
-
wasm.
|
|
204
|
+
wasm.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
204
205
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
205
206
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
206
207
|
deferred4_0 = r0;
|
|
@@ -211,16 +212,16 @@ function info(info_type, format, bit, pretty, indent) {
|
|
|
211
212
|
wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);
|
|
212
213
|
}
|
|
213
214
|
}
|
|
214
|
-
function
|
|
215
|
+
function parse(input, mode) {
|
|
215
216
|
let deferred3_0;
|
|
216
217
|
let deferred3_1;
|
|
217
218
|
try {
|
|
218
219
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
219
220
|
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
220
221
|
const len0 = WASM_VECTOR_LEN;
|
|
221
|
-
const ptr1 = passStringToWasm0(
|
|
222
|
+
const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
222
223
|
const len1 = WASM_VECTOR_LEN;
|
|
223
|
-
wasm.
|
|
224
|
+
wasm.parse(retptr, ptr0, len0, ptr1, len1);
|
|
224
225
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
225
226
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
226
227
|
deferred3_0 = r0;
|
|
@@ -308,7 +309,19 @@ async function __wbg_init(module_or_path) {
|
|
|
308
309
|
}
|
|
309
310
|
var bitmark_wasm_default = __wbg_init;
|
|
310
311
|
|
|
312
|
+
// src/generated/package_info.ts
|
|
313
|
+
var PACKAGE_INFO = {
|
|
314
|
+
"name": "@gmb/bitmark-parser",
|
|
315
|
+
"version": "3.0.2",
|
|
316
|
+
"author": "Get More Brain Ltd <info@getmorebrain.com>",
|
|
317
|
+
"license": "ISC",
|
|
318
|
+
"description": "A parser for bitmark text, powered by WebAssembly."
|
|
319
|
+
};
|
|
320
|
+
|
|
311
321
|
// src/browser/index.ts
|
|
322
|
+
function version() {
|
|
323
|
+
return PACKAGE_INFO.version;
|
|
324
|
+
}
|
|
312
325
|
function lex2(input, options = {}) {
|
|
313
326
|
return lex(input, options.stage ?? "lex");
|
|
314
327
|
}
|
|
@@ -345,6 +358,7 @@ function info2(options = {}) {
|
|
|
345
358
|
initSync,
|
|
346
359
|
lex,
|
|
347
360
|
parse,
|
|
348
|
-
unbreakscapeText
|
|
361
|
+
unbreakscapeText,
|
|
362
|
+
version
|
|
349
363
|
});
|
|
350
364
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/browser/index.ts","../../../../../node_modules/tsup/assets/cjs_shims.js","../../../wasm-web/bitmark_wasm.js"],"sourcesContent":["// This is a browser entry point that wraps the wasm-web bindings.\n// It re-exports all WASM functions so browser consumers can use:\n// import { parse, convert, ... } from '@gmb/bitmark-parser/browser'\n\nimport * as wasm from \"../../wasm-web/bitmark_wasm.js\";\n\nexport { default as init, initSync } from \"../../wasm-web/bitmark_wasm.js\";\n\nexport type { LexOptions, LexStage, ParseOptions, ConvertOptions, OutputMode, BreakscapeOptions, TextFormat, TextLocation, InfoOptions, InfoType, InfoFormat } from \"../types.js\";\nimport type { LexOptions, ParseOptions, ConvertOptions, BreakscapeOptions, InfoOptions } from \"../types.js\";\n\n/**\n * Lex bitmark input text, returning one line per token.\n *\n * @param input - The bitmark source text.\n * @param options - Lex options (e.g. `{ stage: \"lex-bitmark\" }`).\n * @returns Token dump string (one token per line).\n */\nexport function lex(input: string, options: LexOptions = {}): string {\n return wasm.lex(input, options.stage ?? \"lex\");\n}\n\n/**\n * Parse bitmark input text and return the reference JSON format.\n *\n * @param input - The bitmark source text.\n * @param options - Parse options (e.g. `{ mode: \"full\" }`).\n * @returns JSON string of the parsed bitmark document.\n */\nexport function parse(input: string, options: ParseOptions = {}): string {\n return wasm.parse(input, options.mode ?? \"optimized\");\n}\n\n/**\n * Auto-detect input format and convert between bitmark and JSON.\n *\n * @param input - Bitmark or JSON input text.\n * @param options - Convert options (e.g. `{ mode: \"full\", warnings: true }`).\n * @returns Converted output string.\n */\nexport function convert(input: string, options: ConvertOptions = {}): string {\n return wasm.convert(input, options.mode ?? \"optimized\", options.warnings ?? false, options.plainText ?? false, options.pretty ?? false, options.indent ?? 2);\n}\n\n/**\n * Breakscape text (escape bitmark special characters).\n *\n * @param input - The text to breakscape.\n * @param options - Breakscape options (e.g. `{ format: \"plainText\", location: \"tag\" }`).\n * @returns Breakscaped text.\n */\nexport function breakscapeText(input: string, options: BreakscapeOptions = {}): string {\n const format = options.format ?? \"bitmark++\";\n const location = options.location ?? \"body\";\n return wasm.breakscape_text(input, format, location);\n}\n\n/**\n * Unbreakscape text (unescape bitmark special characters).\n *\n * @param input - The text to unbreakscape.\n * @param options - Unbreakscape options (e.g. `{ format: \"plainText\", location: \"tag\" }`).\n * @returns Unbreakscaped text.\n */\nexport function unbreakscapeText(input: string, options: BreakscapeOptions = {}): string {\n const format = options.format ?? \"bitmark++\";\n const location = options.location ?? \"body\";\n return wasm.unbreakscape_text(input, format, location);\n}\n\n/**\n * Query information about supported bit types.\n *\n * @param options - Info options (e.g. `{ infoType: \"bit\", format: \"json\", bit: \"cloze\" }`).\n * @returns Information string.\n */\nexport function info(options: InfoOptions = {}): string {\n const infoType = options.infoType ?? \"list\";\n const format = options.format ?? \"text\";\n const bit = options.bit ?? \"\";\n const pretty = options.pretty ?? false;\n const indent = options.indent ?? 2;\n return wasm.info(infoType, format, bit, pretty, indent);\n}\n","// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () => \n typeof document === \"undefined\" \n ? new URL(`file:${__filename}`).href \n : (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') \n ? document.currentScript.src \n : new URL(\"main.js\", document.baseURI).href;\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n","let wasm;\n\nlet WASM_VECTOR_LEN = 0;\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nconst cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );\n\nconst encodeString = (typeof cachedTextEncoder.encodeInto === 'function'\n ? function (arg, view) {\n return cachedTextEncoder.encodeInto(arg, view);\n}\n : function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n});\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length, 1) >>> 0;\n getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len, 1) >>> 0;\n\n const mem = getUint8ArrayMemory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;\n const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);\n const ret = encodeString(arg, view);\n\n offset += ret.written;\n ptr = realloc(ptr, len, offset, 1) >>> 0;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nlet cachedDataViewMemory0 = null;\n\nfunction getDataViewMemory0() {\n if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {\n cachedDataViewMemory0 = new DataView(wasm.memory.buffer);\n }\n return cachedDataViewMemory0;\n}\n\nconst cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );\n\nif (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n/**\n * Breakscape text (escape bitmark special characters).\n *\n * `format`: `\"bitmark++\"` (default) or `\"plainText\"`\n * `location`: `\"body\"` (default) or `\"tag\"`\n * @param {string} input\n * @param {string} format\n * @param {string} location\n * @returns {string}\n */\nexport function breakscape_text(input, format, location) {\n let deferred4_0;\n let deferred4_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred4_0 = r0;\n deferred4_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);\n }\n}\n\n/**\n * Unbreakscape text (unescape bitmark special characters).\n *\n * `format`: `\"bitmark++\"` (default) or `\"plainText\"`\n * `location`: `\"body\"` (default) or `\"tag\"`\n * @param {string} input\n * @param {string} format\n * @param {string} location\n * @returns {string}\n */\nexport function unbreakscape_text(input, format, location) {\n let deferred4_0;\n let deferred4_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred4_0 = r0;\n deferred4_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);\n }\n}\n\n/**\n * Parse bitmark input text and return the reference JSON format.\n *\n * Uses the full pipeline: parse → validate → serialize.\n *\n * `mode`: `\"optimized\"` (default) or `\"full\"`\n * @param {string} input\n * @param {string} mode\n * @returns {string}\n */\nexport function parse(input, mode) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.parse(retptr, ptr0, len0, ptr1, len1);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred3_0 = r0;\n deferred3_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\n\n/**\n * Auto-detect input format and convert between bitmark and JSON.\n *\n * `mode`: `\"optimized\"` (default) or `\"full\"`\n * `warnings`: whether to include validation warnings (default: false)\n * `plain_text`: output text as plain text — debug mode (default: false)\n * `pretty`: prettify JSON output (default: false)\n * `indent`: indent size for pretty-printing (default: 2)\n *\n * Returns JSON if input is bitmark, or an error message if input is JSON\n * (generator not yet implemented).\n * @param {string} input\n * @param {string} mode\n * @param {boolean} warnings\n * @param {boolean} plain_text\n * @param {boolean} pretty\n * @param {number} indent\n * @returns {string}\n */\nexport function convert(input, mode, warnings, plain_text, pretty, indent) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.convert(retptr, ptr0, len0, ptr1, len1, warnings, plain_text, pretty, indent);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred3_0 = r0;\n deferred3_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\n\n/**\n * Query information about supported bit types.\n *\n * `info_type`: `\"list\"`, `\"bit\"`, `\"all\"`, or `\"deprecated\"`\n * `format`: `\"text\"` or `\"json\"`\n * `bit`: bit name (required when `info_type` is `\"bit\"`)\n * `pretty`: whether to pretty-print JSON output\n * `indent`: indent size for pretty-printing (default: 2)\n * @param {string} info_type\n * @param {string} format\n * @param {string} bit\n * @param {boolean} pretty\n * @param {number} indent\n * @returns {string}\n */\nexport function info(info_type, format, bit, pretty, indent) {\n let deferred4_0;\n let deferred4_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(info_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(bit, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred4_0 = r0;\n deferred4_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);\n }\n}\n\n/**\n * Lex bitmark input text, returning one line per token in the same format as\n * the Rust CLI: `{kind:?} {span:?} \"{text}\"`.\n *\n * `stage` selects the lexer pipeline:\n * - `\"lex\"` — combined (default)\n * - `\"lex-bitmark\"` — bitmark-level only\n * - `\"lex-text\"` — text-level only\n * - `\"lex-json\"` — combined, JSON array output\n * - `\"lex-bitmark-json\"` — bitmark-level, JSON array output\n * - `\"lex-text-json\"` — text-level, JSON array output\n * @param {string} input\n * @param {string} stage\n * @returns {string}\n */\nexport function lex(input, stage) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(stage, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.lex(retptr, ptr0, len0, ptr1, len1);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred3_0 = r0;\n deferred3_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\n\nasync function __wbg_load(module, imports) {\n if (typeof Response === 'function' && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === 'function') {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n\n } catch (e) {\n if (module.headers.get('Content-Type') != 'application/wasm') {\n console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\", e);\n\n } else {\n throw e;\n }\n }\n }\n\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n\n } else {\n return instance;\n }\n }\n}\n\nfunction __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n\n return imports;\n}\n\nfunction __wbg_init_memory(imports, memory) {\n\n}\n\nfunction __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedDataViewMemory0 = null;\n cachedUint8ArrayMemory0 = null;\n\n\n\n return wasm;\n}\n\nfunction initSync(module) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module !== 'undefined') {\n if (Object.getPrototypeOf(module) === Object.prototype) {\n ({module} = module)\n } else {\n console.warn('using deprecated parameters for `initSync()`; pass a single object instead')\n }\n }\n\n const imports = __wbg_get_imports();\n\n __wbg_init_memory(imports);\n\n if (!(module instanceof WebAssembly.Module)) {\n module = new WebAssembly.Module(module);\n }\n\n const instance = new WebAssembly.Instance(module, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nasync function __wbg_init(module_or_path) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module_or_path !== 'undefined') {\n if (Object.getPrototypeOf(module_or_path) === Object.prototype) {\n ({module_or_path} = module_or_path)\n } else {\n console.warn('using deprecated parameters for the initialization function; pass a single object instead')\n }\n }\n\n if (typeof module_or_path === 'undefined') {\n module_or_path = new URL('bitmark_wasm_bg.wasm', import.meta.url);\n }\n const imports = __wbg_get_imports();\n\n if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {\n module_or_path = fetch(module_or_path);\n }\n\n __wbg_init_memory(imports);\n\n const { instance, module } = await __wbg_load(await module_or_path, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nexport { initSync };\nexport default __wbg_init;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,iBAAAA;AAAA,EAAA,YAAAC;AAAA,EAAA;AAAA;AAAA,aAAAC;AAAA,EAAA,aAAAC;AAAA,EAAA;AAAA;AAAA;;;ACKA,IAAM,mBAAmB,MACvB,OAAO,aAAa,cAChB,IAAI,IAAI,QAAQ,UAAU,EAAE,EAAE,OAC7B,SAAS,iBAAiB,SAAS,cAAc,QAAQ,YAAY,MAAM,WAC1E,SAAS,cAAc,MACvB,IAAI,IAAI,WAAW,SAAS,OAAO,EAAE;AAEtC,IAAM,gBAAgC,iCAAiB;;;ACZ9D,IAAI;AAEJ,I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W,QAAQ,YAAY;AACrC,SAAY,kBAAkB,OAAO,QAAQ,QAAQ;AACvD;AAQO,SAASC,MAAK,UAAuB,CAAC,GAAW;AACtD,QAAM,WAAW,QAAQ,YAAY;AACrC,QAAM,SAAS,QAAQ,UAAU;AACjC,QAAM,MAAM,QAAQ,OAAO;AAC3B,QAAM,SAAS,QAAQ,UAAU;AACjC,QAAM,SAAS,QAAQ,UAAU;AACjC,SAAY,KAAK,UAAU,QAAQ,KAAK,QAAQ,MAAM;AACxD;","names":["convert","info","lex","parse","ptr","module","lex","parse","convert","info"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/browser/index.ts","../../../../../node_modules/tsup/assets/cjs_shims.js","../../../wasm-web/bitmark_wasm.js","../../../src/generated/package_info.ts"],"sourcesContent":["// This is a browser entry point that wraps the wasm-web bindings.\n// It re-exports all WASM functions so browser consumers can use:\n// import { parse, convert, ... } from '@gmb/bitmark-parser/browser'\n\nimport * as wasm from \"../../wasm-web/bitmark_wasm.js\";\nimport { PACKAGE_INFO } from \"../generated/package_info.js\";\n\nexport { default as init, initSync } from \"../../wasm-web/bitmark_wasm.js\";\n\nexport type { LexOptions, LexStage, ParseOptions, ConvertOptions, OutputMode, BreakscapeOptions, TextFormat, TextLocation, InfoOptions, InfoType, InfoFormat } from \"../types.js\";\nimport type { LexOptions, ParseOptions, ConvertOptions, BreakscapeOptions, InfoOptions } from \"../types.js\";\n\n/**\n * Get the version of the @gmb/bitmark-parser library.\n *\n * @returns Version string (e.g. \"3.0.0\").\n */\nexport function version(): string {\n return PACKAGE_INFO.version;\n}\n\n/**\n * Lex bitmark input text, returning one line per token.\n *\n * @param input - The bitmark source text.\n * @param options - Lex options (e.g. `{ stage: \"lex\" }`).\n * @returns Token dump string (one token per line).\n */\nexport function lex(input: string, options: LexOptions = {}): string {\n return wasm.lex(input, options.stage ?? \"lex\");\n}\n\n/**\n * Parse bitmark input text and return structured JSON entries.\n *\n * Each entry contains `bit`, `parser`, and `bitmark` fields.\n *\n * @param input - The bitmark source text.\n * @param options - Parse options (e.g. `{ mode: \"full\" }`).\n * @returns JSON string array of structured parsed entries.\n */\nexport function parse(input: string, options: ParseOptions = {}): string {\n return wasm.parse(input, options.mode ?? \"optimized\");\n}\n\n/**\n * Auto-detect input format and convert between bitmark and JSON.\n *\n * @param input - Bitmark or JSON input text.\n * @param options - Convert options (e.g. `{ mode: \"full\", warnings: true }`).\n * @returns Converted output string. For bitmark input, this is a JSON string\n * array of structured parsed entries (`bit`, `parser`, `bitmark`).\n */\nexport function convert(input: string, options: ConvertOptions = {}): string {\n return wasm.convert(input, options.mode ?? \"optimized\", options.warnings ?? false, options.plainText ?? false, options.pretty ?? false, options.indent ?? 2);\n}\n\n/**\n * Breakscape text (escape bitmark special characters).\n *\n * @param input - The text to breakscape.\n * @param options - Breakscape options (e.g. `{ format: \"plainText\", location: \"tag\" }`).\n * @returns Breakscaped text.\n */\nexport function breakscapeText(input: string, options: BreakscapeOptions = {}): string {\n const format = options.format ?? \"bitmark++\";\n const location = options.location ?? \"body\";\n return wasm.breakscape_text(input, format, location);\n}\n\n/**\n * Unbreakscape text (unescape bitmark special characters).\n *\n * @param input - The text to unbreakscape.\n * @param options - Unbreakscape options (e.g. `{ format: \"plainText\", location: \"tag\" }`).\n * @returns Unbreakscaped text.\n */\nexport function unbreakscapeText(input: string, options: BreakscapeOptions = {}): string {\n const format = options.format ?? \"bitmark++\";\n const location = options.location ?? \"body\";\n return wasm.unbreakscape_text(input, format, location);\n}\n\n/**\n * Query information about supported bit types.\n *\n * @param options - Info options (e.g. `{ infoType: \"bit\", format: \"json\", bit: \"cloze\" }`).\n * @returns Information string.\n */\nexport function info(options: InfoOptions = {}): string {\n const infoType = options.infoType ?? \"list\";\n const format = options.format ?? \"text\";\n const bit = options.bit ?? \"\";\n const pretty = options.pretty ?? false;\n const indent = options.indent ?? 2;\n return wasm.info(infoType, format, bit, pretty, indent);\n}\n","// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () => \n typeof document === \"undefined\" \n ? new URL(`file:${__filename}`).href \n : (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') \n ? document.currentScript.src \n : new URL(\"main.js\", document.baseURI).href;\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n","let wasm;\n\nlet WASM_VECTOR_LEN = 0;\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nconst cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );\n\nconst encodeString = (typeof cachedTextEncoder.encodeInto === 'function'\n ? function (arg, view) {\n return cachedTextEncoder.encodeInto(arg, view);\n}\n : function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n});\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length, 1) >>> 0;\n getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len, 1) >>> 0;\n\n const mem = getUint8ArrayMemory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;\n const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);\n const ret = encodeString(arg, view);\n\n offset += ret.written;\n ptr = realloc(ptr, len, offset, 1) >>> 0;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nlet cachedDataViewMemory0 = null;\n\nfunction getDataViewMemory0() {\n if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {\n cachedDataViewMemory0 = new DataView(wasm.memory.buffer);\n }\n return cachedDataViewMemory0;\n}\n\nconst cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );\n\nif (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n/**\n * Lex bitmark input text, returning one line per token in the same format as\n * the Rust CLI: `{kind:?} {span:?} \"{text}\"`.\n *\n * `stage` selects the lexer pipeline:\n * - `\"lex\"` — combined (default)\n * - `\"lex-json\"` — combined, JSON array output\n * @param {string} input\n * @param {string} stage\n * @returns {string}\n */\nexport function lex(input, stage) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(stage, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.lex(retptr, ptr0, len0, ptr1, len1);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred3_0 = r0;\n deferred3_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\n\n/**\n * Breakscape text (escape bitmark special characters).\n *\n * `format`: `\"bitmark++\"` (default) or `\"plainText\"`\n * `location`: `\"body\"` (default) or `\"tag\"`\n * @param {string} input\n * @param {string} format\n * @param {string} location\n * @returns {string}\n */\nexport function breakscape_text(input, format, location) {\n let deferred4_0;\n let deferred4_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.breakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred4_0 = r0;\n deferred4_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);\n }\n}\n\n/**\n * Auto-detect input format and convert between bitmark and JSON.\n *\n * `mode`: `\"optimized\"` (default) or `\"full\"`\n * `warnings`: whether to include validation warnings (default: false)\n * `plain_text`: output text as plain text — debug mode (default: false)\n * `pretty`: prettify JSON output (default: false)\n * `indent`: indent size for pretty-printing (default: 2)\n *\n * Returns JSON if input is bitmark, or an error message if input is JSON\n * (generator not yet implemented).\n * @param {string} input\n * @param {string} mode\n * @param {boolean} warnings\n * @param {boolean} plain_text\n * @param {boolean} pretty\n * @param {number} indent\n * @returns {string}\n */\nexport function convert(input, mode, warnings, plain_text, pretty, indent) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.convert(retptr, ptr0, len0, ptr1, len1, warnings, plain_text, pretty, indent);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred3_0 = r0;\n deferred3_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\n\n/**\n * Query information about supported bit types.\n *\n * `info_type`: `\"list\"`, `\"bit\"`, `\"all\"`, or `\"deprecated\"`\n * `format`: `\"text\"` or `\"json\"`\n * `bit`: bit name (required when `info_type` is `\"bit\"`)\n * `pretty`: whether to pretty-print JSON output\n * `indent`: indent size for pretty-printing (default: 2)\n * @param {string} info_type\n * @param {string} format\n * @param {string} bit\n * @param {boolean} pretty\n * @param {number} indent\n * @returns {string}\n */\nexport function info(info_type, format, bit, pretty, indent) {\n let deferred4_0;\n let deferred4_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(info_type, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(bit, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.info(retptr, ptr0, len0, ptr1, len1, ptr2, len2, pretty, indent);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred4_0 = r0;\n deferred4_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);\n }\n}\n\n/**\n * Unbreakscape text (unescape bitmark special characters).\n *\n * `format`: `\"bitmark++\"` (default) or `\"plainText\"`\n * `location`: `\"body\"` (default) or `\"tag\"`\n * @param {string} input\n * @param {string} format\n * @param {string} location\n * @returns {string}\n */\nexport function unbreakscape_text(input, format, location) {\n let deferred4_0;\n let deferred4_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(format, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(location, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len2 = WASM_VECTOR_LEN;\n wasm.unbreakscape_text(retptr, ptr0, len0, ptr1, len1, ptr2, len2);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred4_0 = r0;\n deferred4_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred4_0, deferred4_1, 1);\n }\n}\n\n/**\n * Parse bitmark input text and return the reference JSON format.\n *\n * Uses the full pipeline: parse → validate → serialize.\n *\n * `mode`: `\"optimized\"` (default) or `\"full\"`\n * @param {string} input\n * @param {string} mode\n * @returns {string}\n */\nexport function parse(input, mode) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);\n const len1 = WASM_VECTOR_LEN;\n wasm.parse(retptr, ptr0, len0, ptr1, len1);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred3_0 = r0;\n deferred3_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);\n }\n}\n\nasync function __wbg_load(module, imports) {\n if (typeof Response === 'function' && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === 'function') {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n\n } catch (e) {\n if (module.headers.get('Content-Type') != 'application/wasm') {\n console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\", e);\n\n } else {\n throw e;\n }\n }\n }\n\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n\n } else {\n return instance;\n }\n }\n}\n\nfunction __wbg_get_imports() {\n const imports = {};\n imports.wbg = {};\n\n return imports;\n}\n\nfunction __wbg_init_memory(imports, memory) {\n\n}\n\nfunction __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n __wbg_init.__wbindgen_wasm_module = module;\n cachedDataViewMemory0 = null;\n cachedUint8ArrayMemory0 = null;\n\n\n\n return wasm;\n}\n\nfunction initSync(module) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module !== 'undefined') {\n if (Object.getPrototypeOf(module) === Object.prototype) {\n ({module} = module)\n } else {\n console.warn('using deprecated parameters for `initSync()`; pass a single object instead')\n }\n }\n\n const imports = __wbg_get_imports();\n\n __wbg_init_memory(imports);\n\n if (!(module instanceof WebAssembly.Module)) {\n module = new WebAssembly.Module(module);\n }\n\n const instance = new WebAssembly.Instance(module, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nasync function __wbg_init(module_or_path) {\n if (wasm !== undefined) return wasm;\n\n\n if (typeof module_or_path !== 'undefined') {\n if (Object.getPrototypeOf(module_or_path) === Object.prototype) {\n ({module_or_path} = module_or_path)\n } else {\n console.warn('using deprecated parameters for the initialization function; pass a single object instead')\n }\n }\n\n if (typeof module_or_path === 'undefined') {\n module_or_path = new URL('bitmark_wasm_bg.wasm', import.meta.url);\n }\n const imports = __wbg_get_imports();\n\n if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {\n module_or_path = fetch(module_or_path);\n }\n\n __wbg_init_memory(imports);\n\n const { instance, module } = await __wbg_load(await module_or_path, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nexport { initSync };\nexport default __wbg_init;\n","// This file is automatically generated. DO NOT EDIT.\n\n/* eslint-disable */\n\nexport const PACKAGE_INFO = {\n \"name\": \"@gmb/bitmark-parser\",\n \"version\": \"3.0.2\",\n \"author\": \"Get More Brain Ltd <info@getmorebrain.com>\",\n \"license\": \"ISC\",\n \"description\": \"A parser for bitmark text, powered by WebAssembly.\"\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,iBAAAA;AAAA,EAAA,YAAAC;AAAA,EAAA;AAAA;AAAA,aAAAC;AAAA,EAAA,aAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;;;ACKA,IAAM,mBAAmB,MACvB,OAAO,aAAa,cAChB,IAAI,IAAI,QAAQ,UAAU,EAAE,EAAE,OAC7B,SAAS,iBAAiB,SAAS,cAAc,QAAQ,YAAY,MAAM,WAC1E,SAAS,cAAc,MACvB,IAAI,IAAI,WAAW,SAAS,OAAO,EAAE;AAEtC,IAAM,gBAAgC,iCAAiB;;;ACZ9D,IAAI;A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