@gmb/bitmark-parser 7.7.0 → 7.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -17
- package/config/bitmark.json +2 -2
- package/dist/browser/bitmark-parser.min.js +4 -4
- package/dist/browser/bitmark-parser.min.js.map +1 -1
- package/dist/browser/cjs/index.cjs +16 -10
- package/dist/browser/cjs/index.cjs.map +1 -1
- package/dist/browser/cjs/index.d.cts +30 -17
- package/dist/browser/esm/index.d.ts +30 -17
- package/dist/browser/esm/index.js +16 -10
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/browser/esm/worker-entry.js +6 -6
- package/dist/browser/esm/worker-entry.js.map +1 -1
- package/dist/browser/wasm/bitmark_browser_full_wasm_bg.wasm +0 -0
- package/dist/browser/wasm/bitmark_json_wasm_bg.wasm +0 -0
- package/dist/browser/wasm/bitmark_wasm_bg.wasm +0 -0
- package/dist/index.cjs +10 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -17
- package/dist/index.d.ts +30 -17
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/legacy.cjs +1 -1
- package/dist/legacy.cjs.map +1 -1
- package/dist/legacy.js +1 -1
- package/dist/legacy.js.map +1 -1
- package/dist/worker-entry.cjs.map +1 -1
- package/package.json +6 -6
- package/schema/bitmark.schema.json +1 -1
- package/wasm/bitmark_wasm.d.ts +2 -2
- package/wasm/bitmark_wasm.js +2 -2
- package/wasm/bitmark_wasm_bg.wasm +0 -0
- package/wasm/package.json +1 -1
- package/wasm-bitmark-json/bitmark_json_wasm.d.ts +2 -2
- package/wasm-bitmark-json/bitmark_json_wasm.js +2 -2
- package/wasm-bitmark-json/bitmark_json_wasm_bg.wasm +0 -0
- package/wasm-bitmark-json/package.json +1 -1
- package/wasm-browser-full/bitmark_browser_full_wasm.d.ts +2 -2
- package/wasm-browser-full/bitmark_browser_full_wasm.js +2 -2
- package/wasm-browser-full/bitmark_browser_full_wasm_bg.wasm +0 -0
- package/wasm-browser-full/package.json +1 -1
package/README.md
CHANGED
|
@@ -294,8 +294,8 @@ with each extra asked for by a flag in the options. `output` is exactly what
|
|
|
294
294
|
one more flag and one more field each.
|
|
295
295
|
|
|
296
296
|
- `bitSpans` — `true` adds `result.bitSpans`, where each top-level bit's text
|
|
297
|
-
|
|
298
|
-
bit:
|
|
297
|
+
is in the input and in the output, for linking the panes that show them
|
|
298
|
+
bit by bit — whichever side of the conversion a pane is on:
|
|
299
299
|
|
|
300
300
|
```ts
|
|
301
301
|
const { output, bitSpans } = convertWithDetails(source, {
|
|
@@ -303,24 +303,32 @@ const { output, bitSpans } = convertWithDetails(source, {
|
|
|
303
303
|
outputFormat: "html",
|
|
304
304
|
bitSpans: true,
|
|
305
305
|
});
|
|
306
|
-
// bitSpans = { positionEncoding: "utf-16",
|
|
307
|
-
|
|
308
|
-
|
|
306
|
+
// bitSpans = { positionEncoding: "utf-16",
|
|
307
|
+
// spans: [{ index, inputStart, inputEnd, outputStart, outputEnd }, …] }
|
|
308
|
+
for (const { index, inputStart, inputEnd, outputStart, outputEnd } of bitSpans!.spans) {
|
|
309
|
+
console.log(index, source.slice(inputStart, inputEnd), output.slice(outputStart, outputEnd));
|
|
309
310
|
}
|
|
310
311
|
```
|
|
311
312
|
|
|
312
313
|
- `index` is the bit's position in the **input**: its `splitBits` index for
|
|
313
|
-
bitmark input, its entry index in the top-level array for JSON input
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
314
|
+
bitmark input, its entry index in the top-level array for JSON input, its
|
|
315
|
+
position among the bits the import finds for markup input. An entry that
|
|
316
|
+
is not a bit gets no span, so the indexes can have gaps.
|
|
317
|
+
- Each side is **the bit's text**, tight: never the separators between bits
|
|
318
|
+
(`\n`, blank lines, `,`) nor the JSON array's `[` / `]`. Both are counted
|
|
319
|
+
in `positionEncoding` — `"utf-16"` by default, so
|
|
320
|
+
`output.slice(outputStart, outputEnd)` is the bit — or `"utf-8"` bytes.
|
|
321
|
+
- `inputStart` / `inputEnd`: for bitmark input, the bit's `splitBits`
|
|
322
|
+
`start` / `end`; for JSON, its top-level entry; for markup, the element it
|
|
323
|
+
was read from — one that holds the next bit's element (a NISO section
|
|
324
|
+
around its paragraphs) ends where that element starts. Converting an
|
|
325
|
+
output back gives input spans equal to the output spans it was written
|
|
326
|
+
with.
|
|
327
|
+
- Output spans are reported for the document outputs: `bitmark`, `json`
|
|
328
|
+
(compact or pretty), `text`, and the markup formats (`html`, `xml`, …). In
|
|
329
|
+
`bitmark` output they equal `splitBits(output)`'s `start` / `end`.
|
|
322
330
|
- A bit that writes nothing (an empty or `_error` bit in `text`) gets a
|
|
323
|
-
zero-width span where its text would start.
|
|
331
|
+
zero-width output span where its text would start.
|
|
324
332
|
- Only top-level bits get spans. For any other output (`lex`, `ast`,
|
|
325
333
|
`semantic-tokens`, `diagnostics`, a mapping report) `bitSpans` is present
|
|
326
334
|
with `spans: []`; without the flag it is absent.
|
|
@@ -1135,8 +1143,9 @@ bitmark convert input.bitmark --output-format semantic-tokens --tokens-layout ab
|
|
|
1135
1143
|
# Dump the lexer token stream as JSON (debug tooling; bitmark input only)
|
|
1136
1144
|
bitmark convert input.bitmark --input-format bitmark --output-format lex --pretty
|
|
1137
1145
|
|
|
1138
|
-
# Also write where each bit
|
|
1139
|
-
# to its own file (offsets into this run's
|
|
1146
|
+
# Also write where each bit is in the input and in the output,
|
|
1147
|
+
# {positionEncoding, spans}, to its own file (output offsets into this run's
|
|
1148
|
+
# output; --position-encoding applies)
|
|
1140
1149
|
bitmark convert input.bitmark --output-format html -o out.html --bit-spans spans.json
|
|
1141
1150
|
|
|
1142
1151
|
# Breakscape / unbreakscape text
|
package/config/bitmark.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var ke=Object.defineProperty;var Rn=(e,t,n)=>t in e?ke(e,t,{enumerable:true,configurable:true,writable:true,value:n}):e[t]=n;var Pt=(e,t)=>{for(var n in t)ke(e,n,{get:t[n],enumerable:true});};var M=(e,t,n)=>Rn(e,typeof t!="symbol"?t+"":t,n);var ee={};Pt(ee,{ConvertDetails:()=>Lt,breakscape_text:()=>Bn,canonicalize:()=>Hn,complete:()=>Mn,convert:()=>Xn,convert_text:()=>Yn,convert_with_details:()=>Qn,count_bits:()=>Gn,default:()=>te,diff:()=>Jn,hover:()=>Vn,info:()=>An,info_text_supported:()=>jn,initSync:()=>Zt,is_bitmark:()=>$n,prettify:()=>qn,register:()=>Un,resolve:()=>Nn,resolve_patch_document:()=>Wn,split_bits:()=>zn,split_json_bits:()=>Kn,transform:()=>Dn,unbreakscape_text:()=>Pn});var _,he=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:true,fatal:true}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&he.decode();var kt=null;function At(){return (kt===null||kt.byteLength===0)&&(kt=new Uint8Array(_.memory.buffer)),kt}function N(e,t){return e=e>>>0,he.decode(At().subarray(e,e+t))}var rt=new Array(128).fill(void 0);rt.push(void 0,null,true,false);var ht=rt.length;function En(e){ht===rt.length&&rt.push(rt.length+1);let t=ht;return ht=rt[t],rt[t]=e,t}var O=0,jt=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},Sn=typeof jt.encodeInto=="function"?function(e,t){return jt.encodeInto(e,t)}:function(e,t){let n=jt.encode(e);return t.set(n),{read:e.length,written:n.length}};function E(e,t,n){if(n===void 0){let i=jt.encode(e),d=t(i.length,1)>>>0;return At().subarray(d,d+i.length).set(i),O=i.length,d}let r=e.length,o=t(r,1)>>>0,a=At(),s=0;for(;s<r;s++){let i=e.charCodeAt(s);if(i>127)break;a[o+s]=i;}if(s!==r){s!==0&&(e=e.slice(s)),o=n(o,r,r=s+e.length*3,1)>>>0;let i=At().subarray(o+s,o+r),d=Sn(e,i);s+=d.written,o=n(o,r,s,1)>>>0;}return O=s,o}function Ie(e){return e==null}var ct=null;function h(){return (ct===null||ct.buffer.detached===true||ct.buffer.detached===void 0&&ct.buffer!==_.memory.buffer)&&(ct=new DataView(_.memory.buffer)),ct}function Bn(e,t,n,r){let o,a;try{let g=_.__wbindgen_add_to_stack_pointer(-16),l=E(e,_.__wbindgen_export_0,_.__wbindgen_export_1),f=O,x=E(t,_.__wbindgen_export_0,_.__wbindgen_export_1),b=O,m=E(n,_.__wbindgen_export_0,_.__wbindgen_export_1),w=O;var s=Ie(r)?0:E(r,_.__wbindgen_export_0,_.__wbindgen_export_1),i=O;_.breakscape_text(g,l,f,x,b,m,w,s,i);var d=h().getInt32(g+0,!0),u=h().getInt32(g+4,!0);return o=d,a=u,N(d,u)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(o,a,1);}}function Pn(e,t,n,r){let o,a;try{let g=_.__wbindgen_add_to_stack_pointer(-16),l=E(e,_.__wbindgen_export_0,_.__wbindgen_export_1),f=O,x=E(t,_.__wbindgen_export_0,_.__wbindgen_export_1),b=O,m=E(n,_.__wbindgen_export_0,_.__wbindgen_export_1),w=O;var s=Ie(r)?0:E(r,_.__wbindgen_export_0,_.__wbindgen_export_1),i=O;_.unbreakscape_text(g,l,f,x,b,m,w,s,i);var d=h().getInt32(g+0,!0),u=h().getInt32(g+4,!0);return o=d,a=u,N(d,u)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(o,a,1);}}function An(e,t,n,r,o,a,s,i,d){let u,g;try{let x=_.__wbindgen_add_to_stack_pointer(-16),b=E(e,_.__wbindgen_export_0,_.__wbindgen_export_1),m=O,w=E(t,_.__wbindgen_export_0,_.__wbindgen_export_1),y=O,k=E(n,_.__wbindgen_export_0,_.__wbindgen_export_1),v=O,R=E(d,_.__wbindgen_export_0,_.__wbindgen_export_1),A=O;_.info(x,b,m,w,y,k,v,r,o,a,s,i,R,A);var l=h().getInt32(x+0,!0),f=h().getInt32(x+4,!0);return u=l,g=f,N(l,f)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(u,g,1);}}function jn(){return _.info_text_supported()!==0}function Ln(e){return rt[e]}function Cn(e){e<132||(rt[e]=ht,ht=e);}function Y(e){let t=Ln(e);return Cn(e),t}function Dn(e,t,n,r,o,a,s,i){let d,u;try{let w=_.__wbindgen_add_to_stack_pointer(-16),y=E(e,_.__wbindgen_export_0,_.__wbindgen_export_1),k=O,v=E(t,_.__wbindgen_export_0,_.__wbindgen_export_1),R=O,A=E(n,_.__wbindgen_export_0,_.__wbindgen_export_1),C=O,D=E(r,_.__wbindgen_export_0,_.__wbindgen_export_1),W=O,J=E(o,_.__wbindgen_export_0,_.__wbindgen_export_1),K=O;_.transform(w,y,k,v,R,A,C,D,W,J,K,a,s,i);var g=h().getInt32(w+0,!0),l=h().getInt32(w+4,!0),f=h().getInt32(w+8,!0),x=h().getInt32(w+12,!0),b=g,m=l;if(x)throw b=0,m=0,Y(f);return d=b,u=m,N(b,m)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(d,u,1);}}function Wn(e,t,n){let r,o;try{let l=_.__wbindgen_add_to_stack_pointer(-16),f=E(e,_.__wbindgen_export_0,_.__wbindgen_export_1),x=O,b=E(t,_.__wbindgen_export_0,_.__wbindgen_export_1),m=O,w=E(n,_.__wbindgen_export_0,_.__wbindgen_export_1),y=O;_.resolve_patch_document(l,f,x,b,m,w,y);var a=h().getInt32(l+0,!0),s=h().getInt32(l+4,!0),i=h().getInt32(l+8,!0),d=h().getInt32(l+12,!0),u=a,g=s;if(d)throw u=0,g=0,Y(i);return r=u,o=g,N(u,g)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(r,o,1);}}function Jn(e,t,n,r,o,a,s,i,d){let u,g;try{let y=_.__wbindgen_add_to_stack_pointer(-16),k=E(e,_.__wbindgen_export_0,_.__wbindgen_export_1),v=O,R=E(t,_.__wbindgen_export_0,_.__wbindgen_export_1),A=O,C=E(n,_.__wbindgen_export_0,_.__wbindgen_export_1),D=O,W=E(r,_.__wbindgen_export_0,_.__wbindgen_export_1),J=O;_.diff(y,k,v,R,A,C,D,W,J,o,a,s,i,d);var l=h().getInt32(y+0,!0),f=h().getInt32(y+4,!0),x=h().getInt32(y+8,!0),b=h().getInt32(y+12,!0),m=l,w=f;if(b)throw m=0,w=0,Y(x);return u=m,g=w,N(m,w)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(u,g,1);}}function Mn(e,t,n,r,o,a){let s,i;try{let b=_.__wbindgen_add_to_stack_pointer(-16),m=E(e,_.__wbindgen_export_0,_.__wbindgen_export_1),w=O,y=E(r,_.__wbindgen_export_0,_.__wbindgen_export_1),k=O,v=E(a,_.__wbindgen_export_0,_.__wbindgen_export_1),R=O;_.complete(b,m,w,t,n,y,k,o,v,R);var d=h().getInt32(b+0,!0),u=h().getInt32(b+4,!0),g=h().getInt32(b+8,!0),l=h().getInt32(b+12,!0),f=d,x=u;if(l)throw f=0,x=0,Y(g);return s=f,i=x,N(f,x)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(s,i,1);}}function Nn(e,t,n,r,o,a,s){let i,d;try{let m=_.__wbindgen_add_to_stack_pointer(-16),w=E(e,_.__wbindgen_export_0,_.__wbindgen_export_1),y=O,k=E(r,_.__wbindgen_export_0,_.__wbindgen_export_1),v=O,R=E(a,_.__wbindgen_export_0,_.__wbindgen_export_1),A=O;_.resolve(m,w,y,t,n,k,v,o,R,A,s);var u=h().getInt32(m+0,!0),g=h().getInt32(m+4,!0),l=h().getInt32(m+8,!0),f=h().getInt32(m+12,!0),x=u,b=g;if(f)throw x=0,b=0,Y(l);return i=x,d=b,N(x,b)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(i,d,1);}}function Vn(e,t,n,r){let o,a;try{let f=_.__wbindgen_add_to_stack_pointer(-16),x=E(e,_.__wbindgen_export_0,_.__wbindgen_export_1),b=O,m=E(r,_.__wbindgen_export_0,_.__wbindgen_export_1),w=O;_.hover(f,x,b,t,n,m,w);var s=h().getInt32(f+0,!0),i=h().getInt32(f+4,!0),d=h().getInt32(f+8,!0),u=h().getInt32(f+12,!0),g=s,l=i;if(u)throw g=0,l=0,Y(d);return o=g,a=l,N(g,l)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(o,a,1);}}function Un(e,t){try{let o=_.__wbindgen_add_to_stack_pointer(-16),a=E(e,_.__wbindgen_export_0,_.__wbindgen_export_1),s=O,i=E(t,_.__wbindgen_export_0,_.__wbindgen_export_1),d=O;_.register(o,a,s,i,d);var n=h().getInt32(o+0,!0),r=h().getInt32(o+4,!0);if(r)throw Y(n)}finally{_.__wbindgen_add_to_stack_pointer(16);}}function Hn(e,t,n,r,o,a){let s,i;try{let b=_.__wbindgen_add_to_stack_pointer(-16),m=E(e,_.__wbindgen_export_0,_.__wbindgen_export_1),w=O,y=E(t,_.__wbindgen_export_0,_.__wbindgen_export_1),k=O,v=E(n,_.__wbindgen_export_0,_.__wbindgen_export_1),R=O;_.canonicalize(b,m,w,y,k,v,R,r,o,a);var d=h().getInt32(b+0,!0),u=h().getInt32(b+4,!0),g=h().getInt32(b+8,!0),l=h().getInt32(b+12,!0),f=d,x=u;if(l)throw f=0,x=0,Y(g);return s=f,i=x,N(f,x)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(s,i,1);}}function Gn(e){let t,n;try{let u=_.__wbindgen_add_to_stack_pointer(-16),g=E(e,_.__wbindgen_export_0,_.__wbindgen_export_1),l=O;_.count_bits(u,g,l);var r=h().getInt32(u+0,!0),o=h().getInt32(u+4,!0),a=h().getInt32(u+8,!0),s=h().getInt32(u+12,!0),i=r,d=o;if(s)throw i=0,d=0,Y(a);return t=i,n=d,N(i,d)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(t,n,1);}}function zn(e,t){let n,r;try{let s=_.__wbindgen_add_to_stack_pointer(-16),i=E(e,_.__wbindgen_export_0,_.__wbindgen_export_1),d=O,u=E(t,_.__wbindgen_export_0,_.__wbindgen_export_1),g=O;_.split_bits(s,i,d,u,g);var o=h().getInt32(s+0,!0),a=h().getInt32(s+4,!0);return n=o,r=a,N(o,a)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(n,r,1);}}function $n(e){let t=E(e,_.__wbindgen_export_0,_.__wbindgen_export_1),n=O;return _.is_bitmark(t,n)!==0}function Kn(e){let t,n;try{let u=_.__wbindgen_add_to_stack_pointer(-16),g=E(e,_.__wbindgen_export_0,_.__wbindgen_export_1),l=O;_.split_json_bits(u,g,l);var r=h().getInt32(u+0,!0),o=h().getInt32(u+4,!0),a=h().getInt32(u+8,!0),s=h().getInt32(u+12,!0),i=r,d=o;if(s)throw i=0,d=0,Y(a);return t=i,n=d,N(i,d)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(t,n,1);}}function qn(e,t){let n,r;try{let s=_.__wbindgen_add_to_stack_pointer(-16),i=E(e,_.__wbindgen_export_0,_.__wbindgen_export_1),d=O;_.prettify(s,i,d,t);var o=h().getInt32(s+0,!0),a=h().getInt32(s+4,!0);return n=o,r=a,N(o,a)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(n,r,1);}}function Yn(e,t,n,r){let o,a;try{let f=_.__wbindgen_add_to_stack_pointer(-16),x=E(e,_.__wbindgen_export_0,_.__wbindgen_export_1),b=O,m=E(t,_.__wbindgen_export_0,_.__wbindgen_export_1),w=O,y=E(n,_.__wbindgen_export_0,_.__wbindgen_export_1),k=O,v=E(r,_.__wbindgen_export_0,_.__wbindgen_export_1),R=O;_.convert_text(f,x,b,m,w,y,k,v,R);var s=h().getInt32(f+0,!0),i=h().getInt32(f+4,!0),d=h().getInt32(f+8,!0),u=h().getInt32(f+12,!0),g=s,l=i;if(u)throw g=0,l=0,Y(d);return o=g,a=l,N(g,l)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(o,a,1);}}function Xn(e,t,n,r,o,a,s,i,d,u,g){let l,f;try{let v=_.__wbindgen_add_to_stack_pointer(-16),R=E(e,_.__wbindgen_export_0,_.__wbindgen_export_1),A=O,C=E(t,_.__wbindgen_export_0,_.__wbindgen_export_1),D=O,W=E(n,_.__wbindgen_export_0,_.__wbindgen_export_1),J=O,K=E(r,_.__wbindgen_export_0,_.__wbindgen_export_1),tt=O,mt=E(u,_.__wbindgen_export_0,_.__wbindgen_export_1),wt=O,xt=E(g,_.__wbindgen_export_0,_.__wbindgen_export_1),yt=O;_.convert(v,R,A,C,D,W,J,K,tt,o,a,s,i,d,mt,wt,xt,yt);var x=h().getInt32(v+0,!0),b=h().getInt32(v+4,!0),m=h().getInt32(v+8,!0),w=h().getInt32(v+12,!0),y=x,k=b;if(w)throw y=0,k=0,Y(m);return l=y,f=k,N(y,k)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(l,f,1);}}function Qn(e,t,n,r,o,a,s,i,d,u,g,l){try{let m=_.__wbindgen_add_to_stack_pointer(-16),w=E(e,_.__wbindgen_export_0,_.__wbindgen_export_1),y=O,k=E(t,_.__wbindgen_export_0,_.__wbindgen_export_1),v=O,R=E(n,_.__wbindgen_export_0,_.__wbindgen_export_1),A=O,C=E(r,_.__wbindgen_export_0,_.__wbindgen_export_1),D=O,W=E(u,_.__wbindgen_export_0,_.__wbindgen_export_1),J=O,K=E(g,_.__wbindgen_export_0,_.__wbindgen_export_1),tt=O;_.convert_with_details(m,w,y,k,v,R,A,C,D,o,a,s,i,d,W,J,K,tt,l);var f=h().getInt32(m+0,!0),x=h().getInt32(m+4,!0),b=h().getInt32(m+8,!0);if(b)throw Y(x);return Lt.__wrap(f)}finally{_.__wbindgen_add_to_stack_pointer(16);}}var vt=null;function Zn(){return (vt===null||vt.byteLength===0)&&(vt=new Uint32Array(_.memory.buffer)),vt}function tr(e,t){return e=e>>>0,Zn().subarray(e/4,e/4+t)}var ve=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>_.__wbg_convertdetails_free(e>>>0,1)),Lt=class e{static __wrap(t){t=t>>>0;let n=Object.create(e.prototype);return n.__wbg_ptr=t,ve.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,ve.unregister(this),t}free(){let t=this.__destroy_into_raw();_.__wbg_convertdetails_free(t,0);}bit_spans_encoding(){try{let r=_.__wbindgen_add_to_stack_pointer(-16);_.convertdetails_bit_spans_encoding(r,this.__wbg_ptr);var t=h().getInt32(r+0,!0),n=h().getInt32(r+4,!0);let o;return t!==0&&(o=N(t,n).slice(),_.__wbindgen_export_2(t,n*1,1)),o}finally{_.__wbindgen_add_to_stack_pointer(16);}}bit_spans(){try{let r=_.__wbindgen_add_to_stack_pointer(-16);_.convertdetails_bit_spans(r,this.__wbg_ptr);var t=h().getInt32(r+0,!0),n=h().getInt32(r+4,!0);let o;return t!==0&&(o=tr(t,n).slice(),_.__wbindgen_export_2(t,n*4,4)),o}finally{_.__wbindgen_add_to_stack_pointer(16);}}take_data(){let t,n;try{let a=_.__wbindgen_add_to_stack_pointer(-16);_.convertdetails_take_data(a,this.__wbg_ptr);var r=h().getInt32(a+0,!0),o=h().getInt32(a+4,!0);return t=r,n=o,N(r,o)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(t,n,1);}}};async function er(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(r){if(e.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}let n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else {let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function Oe(){let e={};return e.wbg={},e.wbg.__wbindgen_error_new=function(t,n){let r=new Error(N(t,n));return En(r)},e.wbg.__wbindgen_throw=function(t,n){throw new Error(N(t,n))},e}function Te(e,t){return _=e.exports,Fe.__wbindgen_wasm_module=t,ct=null,vt=null,kt=null,_}function Zt(e){if(_!==void 0)return _;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=Oe();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));let n=new WebAssembly.Instance(e,t);return Te(n,e)}async function Fe(e){if(_!==void 0)return _;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 t=Oe();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await er(await e,t);return Te(n,r)}var te=Fe;var oe={};Pt(oe,{ConvertDetails:()=>Wt,breakscape_text:()=>or,canonicalize:()=>mr,complete:()=>gr,convert:()=>Ir,convert_text:()=>hr,convert_with_details:()=>Or,count_bits:()=>wr,default:()=>re,diff:()=>ur,hover:()=>fr,info:()=>sr,info_text_supported:()=>ar,initSync:()=>ne,is_bitmark:()=>yr,prettify:()=>vr,register:()=>br,resolve:()=>lr,resolve_patch_document:()=>dr,split_bits:()=>xr,split_json_bits:()=>kr,transform:()=>cr,unbreakscape_text:()=>ir});var p,Ee=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:true,fatal:true}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&Ee.decode();var It=null;function Ct(){return (It===null||It.byteLength===0)&&(It=new Uint8Array(p.memory.buffer)),It}function V(e,t){return e=e>>>0,Ee.decode(Ct().subarray(e,e+t))}var ot=new Array(128).fill(void 0);ot.push(void 0,null,true,false);var Tt=ot.length;function nr(e){Tt===ot.length&&ot.push(ot.length+1);let t=Tt;return Tt=ot[t],ot[t]=e,t}var T=0,Dt=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},rr=typeof Dt.encodeInto=="function"?function(e,t){return Dt.encodeInto(e,t)}:function(e,t){let n=Dt.encode(e);return t.set(n),{read:e.length,written:n.length}};function S(e,t,n){if(n===void 0){let i=Dt.encode(e),d=t(i.length,1)>>>0;return Ct().subarray(d,d+i.length).set(i),T=i.length,d}let r=e.length,o=t(r,1)>>>0,a=Ct(),s=0;for(;s<r;s++){let i=e.charCodeAt(s);if(i>127)break;a[o+s]=i;}if(s!==r){s!==0&&(e=e.slice(s)),o=n(o,r,r=s+e.length*3,1)>>>0;let i=Ct().subarray(o+s,o+r),d=rr(e,i);s+=d.written,o=n(o,r,s,1)>>>0;}return T=s,o}function Se(e){return e==null}var dt=null;function I(){return (dt===null||dt.buffer.detached===true||dt.buffer.detached===void 0&&dt.buffer!==p.memory.buffer)&&(dt=new DataView(p.memory.buffer)),dt}function or(e,t,n,r){let o,a;try{let g=p.__wbindgen_add_to_stack_pointer(-16),l=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),f=T,x=S(t,p.__wbindgen_export_0,p.__wbindgen_export_1),b=T,m=S(n,p.__wbindgen_export_0,p.__wbindgen_export_1),w=T;var s=Se(r)?0:S(r,p.__wbindgen_export_0,p.__wbindgen_export_1),i=T;p.breakscape_text(g,l,f,x,b,m,w,s,i);var d=I().getInt32(g+0,!0),u=I().getInt32(g+4,!0);return o=d,a=u,V(d,u)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(o,a,1);}}function ir(e,t,n,r){let o,a;try{let g=p.__wbindgen_add_to_stack_pointer(-16),l=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),f=T,x=S(t,p.__wbindgen_export_0,p.__wbindgen_export_1),b=T,m=S(n,p.__wbindgen_export_0,p.__wbindgen_export_1),w=T;var s=Se(r)?0:S(r,p.__wbindgen_export_0,p.__wbindgen_export_1),i=T;p.unbreakscape_text(g,l,f,x,b,m,w,s,i);var d=I().getInt32(g+0,!0),u=I().getInt32(g+4,!0);return o=d,a=u,V(d,u)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(o,a,1);}}function sr(e,t,n,r,o,a,s,i,d){let u,g;try{let x=p.__wbindgen_add_to_stack_pointer(-16),b=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),m=T,w=S(t,p.__wbindgen_export_0,p.__wbindgen_export_1),y=T,k=S(n,p.__wbindgen_export_0,p.__wbindgen_export_1),v=T,R=S(d,p.__wbindgen_export_0,p.__wbindgen_export_1),A=T;p.info(x,b,m,w,y,k,v,r,o,a,s,i,R,A);var l=I().getInt32(x+0,!0),f=I().getInt32(x+4,!0);return u=l,g=f,V(l,f)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(u,g,1);}}function ar(){return p.info_text_supported()!==0}function _r(e){return ot[e]}function pr(e){e<132||(ot[e]=Tt,Tt=e);}function X(e){let t=_r(e);return pr(e),t}function cr(e,t,n,r,o,a,s,i){let d,u;try{let w=p.__wbindgen_add_to_stack_pointer(-16),y=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),k=T,v=S(t,p.__wbindgen_export_0,p.__wbindgen_export_1),R=T,A=S(n,p.__wbindgen_export_0,p.__wbindgen_export_1),C=T,D=S(r,p.__wbindgen_export_0,p.__wbindgen_export_1),W=T,J=S(o,p.__wbindgen_export_0,p.__wbindgen_export_1),K=T;p.transform(w,y,k,v,R,A,C,D,W,J,K,a,s,i);var g=I().getInt32(w+0,!0),l=I().getInt32(w+4,!0),f=I().getInt32(w+8,!0),x=I().getInt32(w+12,!0),b=g,m=l;if(x)throw b=0,m=0,X(f);return d=b,u=m,V(b,m)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(d,u,1);}}function dr(e,t,n){let r,o;try{let l=p.__wbindgen_add_to_stack_pointer(-16),f=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),x=T,b=S(t,p.__wbindgen_export_0,p.__wbindgen_export_1),m=T,w=S(n,p.__wbindgen_export_0,p.__wbindgen_export_1),y=T;p.resolve_patch_document(l,f,x,b,m,w,y);var a=I().getInt32(l+0,!0),s=I().getInt32(l+4,!0),i=I().getInt32(l+8,!0),d=I().getInt32(l+12,!0),u=a,g=s;if(d)throw u=0,g=0,X(i);return r=u,o=g,V(u,g)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(r,o,1);}}function ur(e,t,n,r,o,a,s,i,d){let u,g;try{let y=p.__wbindgen_add_to_stack_pointer(-16),k=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),v=T,R=S(t,p.__wbindgen_export_0,p.__wbindgen_export_1),A=T,C=S(n,p.__wbindgen_export_0,p.__wbindgen_export_1),D=T,W=S(r,p.__wbindgen_export_0,p.__wbindgen_export_1),J=T;p.diff(y,k,v,R,A,C,D,W,J,o,a,s,i,d);var l=I().getInt32(y+0,!0),f=I().getInt32(y+4,!0),x=I().getInt32(y+8,!0),b=I().getInt32(y+12,!0),m=l,w=f;if(b)throw m=0,w=0,X(x);return u=m,g=w,V(m,w)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(u,g,1);}}function gr(e,t,n,r,o,a){let s,i;try{let b=p.__wbindgen_add_to_stack_pointer(-16),m=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),w=T,y=S(r,p.__wbindgen_export_0,p.__wbindgen_export_1),k=T,v=S(a,p.__wbindgen_export_0,p.__wbindgen_export_1),R=T;p.complete(b,m,w,t,n,y,k,o,v,R);var d=I().getInt32(b+0,!0),u=I().getInt32(b+4,!0),g=I().getInt32(b+8,!0),l=I().getInt32(b+12,!0),f=d,x=u;if(l)throw f=0,x=0,X(g);return s=f,i=x,V(f,x)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(s,i,1);}}function lr(e,t,n,r,o,a,s){let i,d;try{let m=p.__wbindgen_add_to_stack_pointer(-16),w=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),y=T,k=S(r,p.__wbindgen_export_0,p.__wbindgen_export_1),v=T,R=S(a,p.__wbindgen_export_0,p.__wbindgen_export_1),A=T;p.resolve(m,w,y,t,n,k,v,o,R,A,s);var u=I().getInt32(m+0,!0),g=I().getInt32(m+4,!0),l=I().getInt32(m+8,!0),f=I().getInt32(m+12,!0),x=u,b=g;if(f)throw x=0,b=0,X(l);return i=x,d=b,V(x,b)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(i,d,1);}}function fr(e,t,n,r){let o,a;try{let f=p.__wbindgen_add_to_stack_pointer(-16),x=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),b=T,m=S(r,p.__wbindgen_export_0,p.__wbindgen_export_1),w=T;p.hover(f,x,b,t,n,m,w);var s=I().getInt32(f+0,!0),i=I().getInt32(f+4,!0),d=I().getInt32(f+8,!0),u=I().getInt32(f+12,!0),g=s,l=i;if(u)throw g=0,l=0,X(d);return o=g,a=l,V(g,l)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(o,a,1);}}function br(e,t){try{let o=p.__wbindgen_add_to_stack_pointer(-16),a=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),s=T,i=S(t,p.__wbindgen_export_0,p.__wbindgen_export_1),d=T;p.register(o,a,s,i,d);var n=I().getInt32(o+0,!0),r=I().getInt32(o+4,!0);if(r)throw X(n)}finally{p.__wbindgen_add_to_stack_pointer(16);}}function mr(e,t,n,r,o,a){let s,i;try{let b=p.__wbindgen_add_to_stack_pointer(-16),m=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),w=T,y=S(t,p.__wbindgen_export_0,p.__wbindgen_export_1),k=T,v=S(n,p.__wbindgen_export_0,p.__wbindgen_export_1),R=T;p.canonicalize(b,m,w,y,k,v,R,r,o,a);var d=I().getInt32(b+0,!0),u=I().getInt32(b+4,!0),g=I().getInt32(b+8,!0),l=I().getInt32(b+12,!0),f=d,x=u;if(l)throw f=0,x=0,X(g);return s=f,i=x,V(f,x)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(s,i,1);}}function wr(e){let t,n;try{let u=p.__wbindgen_add_to_stack_pointer(-16),g=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),l=T;p.count_bits(u,g,l);var r=I().getInt32(u+0,!0),o=I().getInt32(u+4,!0),a=I().getInt32(u+8,!0),s=I().getInt32(u+12,!0),i=r,d=o;if(s)throw i=0,d=0,X(a);return t=i,n=d,V(i,d)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(t,n,1);}}function xr(e,t){let n,r;try{let s=p.__wbindgen_add_to_stack_pointer(-16),i=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),d=T,u=S(t,p.__wbindgen_export_0,p.__wbindgen_export_1),g=T;p.split_bits(s,i,d,u,g);var o=I().getInt32(s+0,!0),a=I().getInt32(s+4,!0);return n=o,r=a,V(o,a)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(n,r,1);}}function yr(e){let t=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),n=T;return p.is_bitmark(t,n)!==0}function kr(e){let t,n;try{let u=p.__wbindgen_add_to_stack_pointer(-16),g=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),l=T;p.split_json_bits(u,g,l);var r=I().getInt32(u+0,!0),o=I().getInt32(u+4,!0),a=I().getInt32(u+8,!0),s=I().getInt32(u+12,!0),i=r,d=o;if(s)throw i=0,d=0,X(a);return t=i,n=d,V(i,d)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(t,n,1);}}function vr(e,t){let n,r;try{let s=p.__wbindgen_add_to_stack_pointer(-16),i=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),d=T;p.prettify(s,i,d,t);var o=I().getInt32(s+0,!0),a=I().getInt32(s+4,!0);return n=o,r=a,V(o,a)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(n,r,1);}}function hr(e,t,n,r){let o,a;try{let f=p.__wbindgen_add_to_stack_pointer(-16),x=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),b=T,m=S(t,p.__wbindgen_export_0,p.__wbindgen_export_1),w=T,y=S(n,p.__wbindgen_export_0,p.__wbindgen_export_1),k=T,v=S(r,p.__wbindgen_export_0,p.__wbindgen_export_1),R=T;p.convert_text(f,x,b,m,w,y,k,v,R);var s=I().getInt32(f+0,!0),i=I().getInt32(f+4,!0),d=I().getInt32(f+8,!0),u=I().getInt32(f+12,!0),g=s,l=i;if(u)throw g=0,l=0,X(d);return o=g,a=l,V(g,l)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(o,a,1);}}function Ir(e,t,n,r,o,a,s,i,d,u,g){let l,f;try{let v=p.__wbindgen_add_to_stack_pointer(-16),R=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),A=T,C=S(t,p.__wbindgen_export_0,p.__wbindgen_export_1),D=T,W=S(n,p.__wbindgen_export_0,p.__wbindgen_export_1),J=T,K=S(r,p.__wbindgen_export_0,p.__wbindgen_export_1),tt=T,mt=S(u,p.__wbindgen_export_0,p.__wbindgen_export_1),wt=T,xt=S(g,p.__wbindgen_export_0,p.__wbindgen_export_1),yt=T;p.convert(v,R,A,C,D,W,J,K,tt,o,a,s,i,d,mt,wt,xt,yt);var x=I().getInt32(v+0,!0),b=I().getInt32(v+4,!0),m=I().getInt32(v+8,!0),w=I().getInt32(v+12,!0),y=x,k=b;if(w)throw y=0,k=0,X(m);return l=y,f=k,V(y,k)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(l,f,1);}}function Or(e,t,n,r,o,a,s,i,d,u,g,l){try{let m=p.__wbindgen_add_to_stack_pointer(-16),w=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),y=T,k=S(t,p.__wbindgen_export_0,p.__wbindgen_export_1),v=T,R=S(n,p.__wbindgen_export_0,p.__wbindgen_export_1),A=T,C=S(r,p.__wbindgen_export_0,p.__wbindgen_export_1),D=T,W=S(u,p.__wbindgen_export_0,p.__wbindgen_export_1),J=T,K=S(g,p.__wbindgen_export_0,p.__wbindgen_export_1),tt=T;p.convert_with_details(m,w,y,k,v,R,A,C,D,o,a,s,i,d,W,J,K,tt,l);var f=I().getInt32(m+0,!0),x=I().getInt32(m+4,!0),b=I().getInt32(m+8,!0);if(b)throw X(x);return Wt.__wrap(f)}finally{p.__wbindgen_add_to_stack_pointer(16);}}var Ot=null;function Tr(){return (Ot===null||Ot.byteLength===0)&&(Ot=new Uint32Array(p.memory.buffer)),Ot}function Fr(e,t){return e=e>>>0,Tr().subarray(e/4,e/4+t)}var Re=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>p.__wbg_convertdetails_free(e>>>0,1)),Wt=class e{static __wrap(t){t=t>>>0;let n=Object.create(e.prototype);return n.__wbg_ptr=t,Re.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,Re.unregister(this),t}free(){let t=this.__destroy_into_raw();p.__wbg_convertdetails_free(t,0);}bit_spans_encoding(){try{let r=p.__wbindgen_add_to_stack_pointer(-16);p.convertdetails_bit_spans_encoding(r,this.__wbg_ptr);var t=I().getInt32(r+0,!0),n=I().getInt32(r+4,!0);let o;return t!==0&&(o=V(t,n).slice(),p.__wbindgen_export_2(t,n*1,1)),o}finally{p.__wbindgen_add_to_stack_pointer(16);}}bit_spans(){try{let r=p.__wbindgen_add_to_stack_pointer(-16);p.convertdetails_bit_spans(r,this.__wbg_ptr);var t=I().getInt32(r+0,!0),n=I().getInt32(r+4,!0);let o;return t!==0&&(o=Fr(t,n).slice(),p.__wbindgen_export_2(t,n*4,4)),o}finally{p.__wbindgen_add_to_stack_pointer(16);}}take_data(){let t,n;try{let a=p.__wbindgen_add_to_stack_pointer(-16);p.convertdetails_take_data(a,this.__wbg_ptr);var r=I().getInt32(a+0,!0),o=I().getInt32(a+4,!0);return t=r,n=o,V(r,o)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(t,n,1);}}};async function Rr(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(r){if(e.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}let n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else {let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function Be(){let e={};return e.wbg={},e.wbg.__wbindgen_error_new=function(t,n){let r=new Error(V(t,n));return nr(r)},e.wbg.__wbindgen_throw=function(t,n){throw new Error(V(t,n))},e}function Pe(e,t){return p=e.exports,Ae.__wbindgen_wasm_module=t,dt=null,Ot=null,It=null,p}function ne(e){if(p!==void 0)return p;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=Be();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));let n=new WebAssembly.Instance(e,t);return Pe(n,e)}async function Ae(e){if(p!==void 0)return p;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_browser_full_wasm_bg.wasm",import.meta.url));let t=Be();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await Rr(await e,t);return Pe(n,r)}var re=Ae;var ae={};Pt(ae,{ConvertDetails:()=>Nt,breakscape_text:()=>Br,canonicalize:()=>Nr,complete:()=>Wr,convert:()=>qr,convert_text:()=>$r,convert_with_details:()=>Yr,count_bits:()=>Vr,default:()=>se,hover:()=>Mr,info:()=>Ar,initSync:()=>ie,is_bitmark:()=>Hr,prettify:()=>zr,register:()=>Cr,resolve:()=>Jr,resolve_patch_document:()=>Dr,split_bits:()=>Ur,split_json_bits:()=>Gr,transform:()=>Kr,unbreakscape_text:()=>Pr});var c,Le=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:true,fatal:true}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&Le.decode();var Ft=null;function Jt(){return (Ft===null||Ft.byteLength===0)&&(Ft=new Uint8Array(c.memory.buffer)),Ft}function H(e,t){return e=e>>>0,Le.decode(Jt().subarray(e,e+t))}var it=new Array(128).fill(void 0);it.push(void 0,null,true,false);var Et=it.length;function Er(e){Et===it.length&&it.push(it.length+1);let t=Et;return Et=it[t],it[t]=e,t}var B=0,Mt=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},Sr=typeof Mt.encodeInto=="function"?function(e,t){return Mt.encodeInto(e,t)}:function(e,t){let n=Mt.encode(e);return t.set(n),{read:e.length,written:n.length}};function P(e,t,n){if(n===void 0){let i=Mt.encode(e),d=t(i.length,1)>>>0;return Jt().subarray(d,d+i.length).set(i),B=i.length,d}let r=e.length,o=t(r,1)>>>0,a=Jt(),s=0;for(;s<r;s++){let i=e.charCodeAt(s);if(i>127)break;a[o+s]=i;}if(s!==r){s!==0&&(e=e.slice(s)),o=n(o,r,r=s+e.length*3,1)>>>0;let i=Jt().subarray(o+s,o+r),d=Sr(e,i);s+=d.written,o=n(o,r,s,1)>>>0;}return B=s,o}function Ce(e){return e==null}var ut=null;function F(){return (ut===null||ut.buffer.detached===true||ut.buffer.detached===void 0&&ut.buffer!==c.memory.buffer)&&(ut=new DataView(c.memory.buffer)),ut}function Br(e,t,n,r){let o,a;try{let g=c.__wbindgen_add_to_stack_pointer(-16),l=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),f=B,x=P(t,c.__wbindgen_export_0,c.__wbindgen_export_1),b=B,m=P(n,c.__wbindgen_export_0,c.__wbindgen_export_1),w=B;var s=Ce(r)?0:P(r,c.__wbindgen_export_0,c.__wbindgen_export_1),i=B;c.breakscape_text(g,l,f,x,b,m,w,s,i);var d=F().getInt32(g+0,!0),u=F().getInt32(g+4,!0);return o=d,a=u,H(d,u)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(o,a,1);}}function Pr(e,t,n,r){let o,a;try{let g=c.__wbindgen_add_to_stack_pointer(-16),l=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),f=B,x=P(t,c.__wbindgen_export_0,c.__wbindgen_export_1),b=B,m=P(n,c.__wbindgen_export_0,c.__wbindgen_export_1),w=B;var s=Ce(r)?0:P(r,c.__wbindgen_export_0,c.__wbindgen_export_1),i=B;c.unbreakscape_text(g,l,f,x,b,m,w,s,i);var d=F().getInt32(g+0,!0),u=F().getInt32(g+4,!0);return o=d,a=u,H(d,u)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(o,a,1);}}function Ar(e,t,n,r,o,a,s,i,d){let u,g;try{let x=c.__wbindgen_add_to_stack_pointer(-16),b=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),m=B,w=P(t,c.__wbindgen_export_0,c.__wbindgen_export_1),y=B,k=P(n,c.__wbindgen_export_0,c.__wbindgen_export_1),v=B,R=P(d,c.__wbindgen_export_0,c.__wbindgen_export_1),A=B;c.info(x,b,m,w,y,k,v,r,o,a,s,i,R,A);var l=F().getInt32(x+0,!0),f=F().getInt32(x+4,!0);return u=l,g=f,H(l,f)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(u,g,1);}}function jr(e){return it[e]}function Lr(e){e<132||(it[e]=Et,Et=e);}function Z(e){let t=jr(e);return Lr(e),t}function Cr(e,t){try{let o=c.__wbindgen_add_to_stack_pointer(-16),a=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),s=B,i=P(t,c.__wbindgen_export_0,c.__wbindgen_export_1),d=B;c.register(o,a,s,i,d);var n=F().getInt32(o+0,!0),r=F().getInt32(o+4,!0);if(r)throw Z(n)}finally{c.__wbindgen_add_to_stack_pointer(16);}}function Dr(e,t,n){let r,o;try{let l=c.__wbindgen_add_to_stack_pointer(-16),f=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),x=B,b=P(t,c.__wbindgen_export_0,c.__wbindgen_export_1),m=B,w=P(n,c.__wbindgen_export_0,c.__wbindgen_export_1),y=B;c.resolve_patch_document(l,f,x,b,m,w,y);var a=F().getInt32(l+0,!0),s=F().getInt32(l+4,!0),i=F().getInt32(l+8,!0),d=F().getInt32(l+12,!0),u=a,g=s;if(d)throw u=0,g=0,Z(i);return r=u,o=g,H(u,g)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(r,o,1);}}function Wr(e,t,n,r,o,a){let s,i;try{let b=c.__wbindgen_add_to_stack_pointer(-16),m=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),w=B,y=P(r,c.__wbindgen_export_0,c.__wbindgen_export_1),k=B,v=P(a,c.__wbindgen_export_0,c.__wbindgen_export_1),R=B;c.complete(b,m,w,t,n,y,k,o,v,R);var d=F().getInt32(b+0,!0),u=F().getInt32(b+4,!0),g=F().getInt32(b+8,!0),l=F().getInt32(b+12,!0),f=d,x=u;if(l)throw f=0,x=0,Z(g);return s=f,i=x,H(f,x)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(s,i,1);}}function Jr(e,t,n,r,o,a,s){let i,d;try{let m=c.__wbindgen_add_to_stack_pointer(-16),w=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),y=B,k=P(r,c.__wbindgen_export_0,c.__wbindgen_export_1),v=B,R=P(a,c.__wbindgen_export_0,c.__wbindgen_export_1),A=B;c.resolve(m,w,y,t,n,k,v,o,R,A,s);var u=F().getInt32(m+0,!0),g=F().getInt32(m+4,!0),l=F().getInt32(m+8,!0),f=F().getInt32(m+12,!0),x=u,b=g;if(f)throw x=0,b=0,Z(l);return i=x,d=b,H(x,b)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(i,d,1);}}function Mr(e,t,n,r){let o,a;try{let f=c.__wbindgen_add_to_stack_pointer(-16),x=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),b=B,m=P(r,c.__wbindgen_export_0,c.__wbindgen_export_1),w=B;c.hover(f,x,b,t,n,m,w);var s=F().getInt32(f+0,!0),i=F().getInt32(f+4,!0),d=F().getInt32(f+8,!0),u=F().getInt32(f+12,!0),g=s,l=i;if(u)throw g=0,l=0,Z(d);return o=g,a=l,H(g,l)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(o,a,1);}}function Nr(e,t,n,r,o,a){let s,i;try{let b=c.__wbindgen_add_to_stack_pointer(-16),m=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),w=B,y=P(t,c.__wbindgen_export_0,c.__wbindgen_export_1),k=B,v=P(n,c.__wbindgen_export_0,c.__wbindgen_export_1),R=B;c.canonicalize(b,m,w,y,k,v,R,r,o,a);var d=F().getInt32(b+0,!0),u=F().getInt32(b+4,!0),g=F().getInt32(b+8,!0),l=F().getInt32(b+12,!0),f=d,x=u;if(l)throw f=0,x=0,Z(g);return s=f,i=x,H(f,x)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(s,i,1);}}function Vr(e){let t,n;try{let u=c.__wbindgen_add_to_stack_pointer(-16),g=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),l=B;c.count_bits(u,g,l);var r=F().getInt32(u+0,!0),o=F().getInt32(u+4,!0),a=F().getInt32(u+8,!0),s=F().getInt32(u+12,!0),i=r,d=o;if(s)throw i=0,d=0,Z(a);return t=i,n=d,H(i,d)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(t,n,1);}}function Ur(e,t){let n,r;try{let s=c.__wbindgen_add_to_stack_pointer(-16),i=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),d=B,u=P(t,c.__wbindgen_export_0,c.__wbindgen_export_1),g=B;c.split_bits(s,i,d,u,g);var o=F().getInt32(s+0,!0),a=F().getInt32(s+4,!0);return n=o,r=a,H(o,a)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(n,r,1);}}function Hr(e){let t=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),n=B;return c.is_bitmark(t,n)!==0}function Gr(e){let t,n;try{let u=c.__wbindgen_add_to_stack_pointer(-16),g=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),l=B;c.split_json_bits(u,g,l);var r=F().getInt32(u+0,!0),o=F().getInt32(u+4,!0),a=F().getInt32(u+8,!0),s=F().getInt32(u+12,!0),i=r,d=o;if(s)throw i=0,d=0,Z(a);return t=i,n=d,H(i,d)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(t,n,1);}}function zr(e,t){let n,r;try{let s=c.__wbindgen_add_to_stack_pointer(-16),i=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),d=B;c.prettify(s,i,d,t);var o=F().getInt32(s+0,!0),a=F().getInt32(s+4,!0);return n=o,r=a,H(o,a)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(n,r,1);}}function $r(e,t,n,r){let o,a;try{let f=c.__wbindgen_add_to_stack_pointer(-16),x=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),b=B,m=P(t,c.__wbindgen_export_0,c.__wbindgen_export_1),w=B,y=P(n,c.__wbindgen_export_0,c.__wbindgen_export_1),k=B,v=P(r,c.__wbindgen_export_0,c.__wbindgen_export_1),R=B;c.convert_text(f,x,b,m,w,y,k,v,R);var s=F().getInt32(f+0,!0),i=F().getInt32(f+4,!0),d=F().getInt32(f+8,!0),u=F().getInt32(f+12,!0),g=s,l=i;if(u)throw g=0,l=0,Z(d);return o=g,a=l,H(g,l)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(o,a,1);}}function Kr(e,t,n,r,o,a,s,i){let d,u;try{let w=c.__wbindgen_add_to_stack_pointer(-16),y=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),k=B,v=P(t,c.__wbindgen_export_0,c.__wbindgen_export_1),R=B,A=P(n,c.__wbindgen_export_0,c.__wbindgen_export_1),C=B,D=P(r,c.__wbindgen_export_0,c.__wbindgen_export_1),W=B,J=P(o,c.__wbindgen_export_0,c.__wbindgen_export_1),K=B;c.transform(w,y,k,v,R,A,C,D,W,J,K,a,s,i);var g=F().getInt32(w+0,!0),l=F().getInt32(w+4,!0),f=F().getInt32(w+8,!0),x=F().getInt32(w+12,!0),b=g,m=l;if(x)throw b=0,m=0,Z(f);return d=b,u=m,H(b,m)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(d,u,1);}}function qr(e,t,n,r,o,a,s,i,d,u,g){let l,f;try{let v=c.__wbindgen_add_to_stack_pointer(-16),R=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),A=B,C=P(t,c.__wbindgen_export_0,c.__wbindgen_export_1),D=B,W=P(n,c.__wbindgen_export_0,c.__wbindgen_export_1),J=B,K=P(r,c.__wbindgen_export_0,c.__wbindgen_export_1),tt=B,mt=P(u,c.__wbindgen_export_0,c.__wbindgen_export_1),wt=B,xt=P(g,c.__wbindgen_export_0,c.__wbindgen_export_1),yt=B;c.convert(v,R,A,C,D,W,J,K,tt,o,a,s,i,d,mt,wt,xt,yt);var x=F().getInt32(v+0,!0),b=F().getInt32(v+4,!0),m=F().getInt32(v+8,!0),w=F().getInt32(v+12,!0),y=x,k=b;if(w)throw y=0,k=0,Z(m);return l=y,f=k,H(y,k)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(l,f,1);}}function Yr(e,t,n,r,o,a,s,i,d,u,g,l){try{let m=c.__wbindgen_add_to_stack_pointer(-16),w=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),y=B,k=P(t,c.__wbindgen_export_0,c.__wbindgen_export_1),v=B,R=P(n,c.__wbindgen_export_0,c.__wbindgen_export_1),A=B,C=P(r,c.__wbindgen_export_0,c.__wbindgen_export_1),D=B,W=P(u,c.__wbindgen_export_0,c.__wbindgen_export_1),J=B,K=P(g,c.__wbindgen_export_0,c.__wbindgen_export_1),tt=B;c.convert_with_details(m,w,y,k,v,R,A,C,D,o,a,s,i,d,W,J,K,tt,l);var f=F().getInt32(m+0,!0),x=F().getInt32(m+4,!0),b=F().getInt32(m+8,!0);if(b)throw Z(x);return Nt.__wrap(f)}finally{c.__wbindgen_add_to_stack_pointer(16);}}var Rt=null;function Xr(){return (Rt===null||Rt.byteLength===0)&&(Rt=new Uint32Array(c.memory.buffer)),Rt}function Qr(e,t){return e=e>>>0,Xr().subarray(e/4,e/4+t)}var je=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>c.__wbg_convertdetails_free(e>>>0,1)),Nt=class e{static __wrap(t){t=t>>>0;let n=Object.create(e.prototype);return n.__wbg_ptr=t,je.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,je.unregister(this),t}free(){let t=this.__destroy_into_raw();c.__wbg_convertdetails_free(t,0);}bit_spans_encoding(){try{let r=c.__wbindgen_add_to_stack_pointer(-16);c.convertdetails_bit_spans_encoding(r,this.__wbg_ptr);var t=F().getInt32(r+0,!0),n=F().getInt32(r+4,!0);let o;return t!==0&&(o=H(t,n).slice(),c.__wbindgen_export_2(t,n*1,1)),o}finally{c.__wbindgen_add_to_stack_pointer(16);}}bit_spans(){try{let r=c.__wbindgen_add_to_stack_pointer(-16);c.convertdetails_bit_spans(r,this.__wbg_ptr);var t=F().getInt32(r+0,!0),n=F().getInt32(r+4,!0);let o;return t!==0&&(o=Qr(t,n).slice(),c.__wbindgen_export_2(t,n*4,4)),o}finally{c.__wbindgen_add_to_stack_pointer(16);}}take_data(){let t,n;try{let a=c.__wbindgen_add_to_stack_pointer(-16);c.convertdetails_take_data(a,this.__wbg_ptr);var r=F().getInt32(a+0,!0),o=F().getInt32(a+4,!0);return t=r,n=o,H(r,o)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(t,n,1);}}};async function Zr(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(r){if(e.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}let n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else {let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function De(){let e={};return e.wbg={},e.wbg.__wbindgen_error_new=function(t,n){let r=new Error(H(t,n));return Er(r)},e.wbg.__wbindgen_throw=function(t,n){throw new Error(H(t,n))},e}function We(e,t){return c=e.exports,Je.__wbindgen_wasm_module=t,ut=null,Rt=null,Ft=null,c}function ie(e){if(c!==void 0)return c;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=De();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));let n=new WebAssembly.Instance(e,t);return We(n,e)}async function Je(e){if(c!==void 0)return c;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_json_wasm_bg.wasm",import.meta.url));let t=De();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await Zr(await e,t);return We(n,r)}var se=Je;var St={version:"7.7.0"};var _e="browser-full",Ut=class extends Error{constructor(){super("wasm not initialised: call init() (or init({ feature: \u2026 })) first"),this.name="NotInitializedError";}},lt=class extends Error{constructor(t){super(t),this.name="RegisterError";}},st=class extends Error{constructor(n){let r=n.map(o=>`${o.kind} at ${o.path}: ${o.message}`);super(`${n.length} patch ${n.length===1?"entry was":"entries were"} skipped:
|
|
1
|
+
var ke=Object.defineProperty;var En=(e,t,n)=>t in e?ke(e,t,{enumerable:true,configurable:true,writable:true,value:n}):e[t]=n;var Pt=(e,t)=>{for(var n in t)ke(e,n,{get:t[n],enumerable:true});};var M=(e,t,n)=>En(e,typeof t!="symbol"?t+"":t,n);var ee={};Pt(ee,{ConvertDetails:()=>Lt,breakscape_text:()=>Bn,canonicalize:()=>Hn,complete:()=>Mn,convert:()=>Xn,convert_text:()=>Yn,convert_with_details:()=>Qn,count_bits:()=>Gn,default:()=>te,diff:()=>Jn,hover:()=>Vn,info:()=>An,info_text_supported:()=>jn,initSync:()=>Zt,is_bitmark:()=>$n,prettify:()=>qn,register:()=>Un,resolve:()=>Nn,resolve_patch_document:()=>Wn,split_bits:()=>zn,split_json_bits:()=>Kn,transform:()=>Dn,unbreakscape_text:()=>Pn});var _,he=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:true,fatal:true}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&he.decode();var kt=null;function At(){return (kt===null||kt.byteLength===0)&&(kt=new Uint8Array(_.memory.buffer)),kt}function N(e,t){return e=e>>>0,he.decode(At().subarray(e,e+t))}var rt=new Array(128).fill(void 0);rt.push(void 0,null,true,false);var ht=rt.length;function Rn(e){ht===rt.length&&rt.push(rt.length+1);let t=ht;return ht=rt[t],rt[t]=e,t}var O=0,jt=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},Sn=typeof jt.encodeInto=="function"?function(e,t){return jt.encodeInto(e,t)}:function(e,t){let n=jt.encode(e);return t.set(n),{read:e.length,written:n.length}};function R(e,t,n){if(n===void 0){let i=jt.encode(e),d=t(i.length,1)>>>0;return At().subarray(d,d+i.length).set(i),O=i.length,d}let r=e.length,o=t(r,1)>>>0,a=At(),s=0;for(;s<r;s++){let i=e.charCodeAt(s);if(i>127)break;a[o+s]=i;}if(s!==r){s!==0&&(e=e.slice(s)),o=n(o,r,r=s+e.length*3,1)>>>0;let i=At().subarray(o+s,o+r),d=Sn(e,i);s+=d.written,o=n(o,r,s,1)>>>0;}return O=s,o}function Ie(e){return e==null}var ct=null;function h(){return (ct===null||ct.buffer.detached===true||ct.buffer.detached===void 0&&ct.buffer!==_.memory.buffer)&&(ct=new DataView(_.memory.buffer)),ct}function Bn(e,t,n,r){let o,a;try{let g=_.__wbindgen_add_to_stack_pointer(-16),l=R(e,_.__wbindgen_export_0,_.__wbindgen_export_1),f=O,x=R(t,_.__wbindgen_export_0,_.__wbindgen_export_1),b=O,m=R(n,_.__wbindgen_export_0,_.__wbindgen_export_1),w=O;var s=Ie(r)?0:R(r,_.__wbindgen_export_0,_.__wbindgen_export_1),i=O;_.breakscape_text(g,l,f,x,b,m,w,s,i);var d=h().getInt32(g+0,!0),u=h().getInt32(g+4,!0);return o=d,a=u,N(d,u)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(o,a,1);}}function Pn(e,t,n,r){let o,a;try{let g=_.__wbindgen_add_to_stack_pointer(-16),l=R(e,_.__wbindgen_export_0,_.__wbindgen_export_1),f=O,x=R(t,_.__wbindgen_export_0,_.__wbindgen_export_1),b=O,m=R(n,_.__wbindgen_export_0,_.__wbindgen_export_1),w=O;var s=Ie(r)?0:R(r,_.__wbindgen_export_0,_.__wbindgen_export_1),i=O;_.unbreakscape_text(g,l,f,x,b,m,w,s,i);var d=h().getInt32(g+0,!0),u=h().getInt32(g+4,!0);return o=d,a=u,N(d,u)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(o,a,1);}}function An(e,t,n,r,o,a,s,i,d){let u,g;try{let x=_.__wbindgen_add_to_stack_pointer(-16),b=R(e,_.__wbindgen_export_0,_.__wbindgen_export_1),m=O,w=R(t,_.__wbindgen_export_0,_.__wbindgen_export_1),y=O,k=R(n,_.__wbindgen_export_0,_.__wbindgen_export_1),v=O,E=R(d,_.__wbindgen_export_0,_.__wbindgen_export_1),A=O;_.info(x,b,m,w,y,k,v,r,o,a,s,i,E,A);var l=h().getInt32(x+0,!0),f=h().getInt32(x+4,!0);return u=l,g=f,N(l,f)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(u,g,1);}}function jn(){return _.info_text_supported()!==0}function Ln(e){return rt[e]}function Cn(e){e<132||(rt[e]=ht,ht=e);}function Y(e){let t=Ln(e);return Cn(e),t}function Dn(e,t,n,r,o,a,s,i){let d,u;try{let w=_.__wbindgen_add_to_stack_pointer(-16),y=R(e,_.__wbindgen_export_0,_.__wbindgen_export_1),k=O,v=R(t,_.__wbindgen_export_0,_.__wbindgen_export_1),E=O,A=R(n,_.__wbindgen_export_0,_.__wbindgen_export_1),C=O,D=R(r,_.__wbindgen_export_0,_.__wbindgen_export_1),W=O,J=R(o,_.__wbindgen_export_0,_.__wbindgen_export_1),K=O;_.transform(w,y,k,v,E,A,C,D,W,J,K,a,s,i);var g=h().getInt32(w+0,!0),l=h().getInt32(w+4,!0),f=h().getInt32(w+8,!0),x=h().getInt32(w+12,!0),b=g,m=l;if(x)throw b=0,m=0,Y(f);return d=b,u=m,N(b,m)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(d,u,1);}}function Wn(e,t,n){let r,o;try{let l=_.__wbindgen_add_to_stack_pointer(-16),f=R(e,_.__wbindgen_export_0,_.__wbindgen_export_1),x=O,b=R(t,_.__wbindgen_export_0,_.__wbindgen_export_1),m=O,w=R(n,_.__wbindgen_export_0,_.__wbindgen_export_1),y=O;_.resolve_patch_document(l,f,x,b,m,w,y);var a=h().getInt32(l+0,!0),s=h().getInt32(l+4,!0),i=h().getInt32(l+8,!0),d=h().getInt32(l+12,!0),u=a,g=s;if(d)throw u=0,g=0,Y(i);return r=u,o=g,N(u,g)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(r,o,1);}}function Jn(e,t,n,r,o,a,s,i,d){let u,g;try{let y=_.__wbindgen_add_to_stack_pointer(-16),k=R(e,_.__wbindgen_export_0,_.__wbindgen_export_1),v=O,E=R(t,_.__wbindgen_export_0,_.__wbindgen_export_1),A=O,C=R(n,_.__wbindgen_export_0,_.__wbindgen_export_1),D=O,W=R(r,_.__wbindgen_export_0,_.__wbindgen_export_1),J=O;_.diff(y,k,v,E,A,C,D,W,J,o,a,s,i,d);var l=h().getInt32(y+0,!0),f=h().getInt32(y+4,!0),x=h().getInt32(y+8,!0),b=h().getInt32(y+12,!0),m=l,w=f;if(b)throw m=0,w=0,Y(x);return u=m,g=w,N(m,w)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(u,g,1);}}function Mn(e,t,n,r,o,a){let s,i;try{let b=_.__wbindgen_add_to_stack_pointer(-16),m=R(e,_.__wbindgen_export_0,_.__wbindgen_export_1),w=O,y=R(r,_.__wbindgen_export_0,_.__wbindgen_export_1),k=O,v=R(a,_.__wbindgen_export_0,_.__wbindgen_export_1),E=O;_.complete(b,m,w,t,n,y,k,o,v,E);var d=h().getInt32(b+0,!0),u=h().getInt32(b+4,!0),g=h().getInt32(b+8,!0),l=h().getInt32(b+12,!0),f=d,x=u;if(l)throw f=0,x=0,Y(g);return s=f,i=x,N(f,x)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(s,i,1);}}function Nn(e,t,n,r,o,a,s){let i,d;try{let m=_.__wbindgen_add_to_stack_pointer(-16),w=R(e,_.__wbindgen_export_0,_.__wbindgen_export_1),y=O,k=R(r,_.__wbindgen_export_0,_.__wbindgen_export_1),v=O,E=R(a,_.__wbindgen_export_0,_.__wbindgen_export_1),A=O;_.resolve(m,w,y,t,n,k,v,o,E,A,s);var u=h().getInt32(m+0,!0),g=h().getInt32(m+4,!0),l=h().getInt32(m+8,!0),f=h().getInt32(m+12,!0),x=u,b=g;if(f)throw x=0,b=0,Y(l);return i=x,d=b,N(x,b)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(i,d,1);}}function Vn(e,t,n,r){let o,a;try{let f=_.__wbindgen_add_to_stack_pointer(-16),x=R(e,_.__wbindgen_export_0,_.__wbindgen_export_1),b=O,m=R(r,_.__wbindgen_export_0,_.__wbindgen_export_1),w=O;_.hover(f,x,b,t,n,m,w);var s=h().getInt32(f+0,!0),i=h().getInt32(f+4,!0),d=h().getInt32(f+8,!0),u=h().getInt32(f+12,!0),g=s,l=i;if(u)throw g=0,l=0,Y(d);return o=g,a=l,N(g,l)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(o,a,1);}}function Un(e,t){try{let o=_.__wbindgen_add_to_stack_pointer(-16),a=R(e,_.__wbindgen_export_0,_.__wbindgen_export_1),s=O,i=R(t,_.__wbindgen_export_0,_.__wbindgen_export_1),d=O;_.register(o,a,s,i,d);var n=h().getInt32(o+0,!0),r=h().getInt32(o+4,!0);if(r)throw Y(n)}finally{_.__wbindgen_add_to_stack_pointer(16);}}function Hn(e,t,n,r,o,a){let s,i;try{let b=_.__wbindgen_add_to_stack_pointer(-16),m=R(e,_.__wbindgen_export_0,_.__wbindgen_export_1),w=O,y=R(t,_.__wbindgen_export_0,_.__wbindgen_export_1),k=O,v=R(n,_.__wbindgen_export_0,_.__wbindgen_export_1),E=O;_.canonicalize(b,m,w,y,k,v,E,r,o,a);var d=h().getInt32(b+0,!0),u=h().getInt32(b+4,!0),g=h().getInt32(b+8,!0),l=h().getInt32(b+12,!0),f=d,x=u;if(l)throw f=0,x=0,Y(g);return s=f,i=x,N(f,x)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(s,i,1);}}function Gn(e){let t,n;try{let u=_.__wbindgen_add_to_stack_pointer(-16),g=R(e,_.__wbindgen_export_0,_.__wbindgen_export_1),l=O;_.count_bits(u,g,l);var r=h().getInt32(u+0,!0),o=h().getInt32(u+4,!0),a=h().getInt32(u+8,!0),s=h().getInt32(u+12,!0),i=r,d=o;if(s)throw i=0,d=0,Y(a);return t=i,n=d,N(i,d)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(t,n,1);}}function zn(e,t){let n,r;try{let s=_.__wbindgen_add_to_stack_pointer(-16),i=R(e,_.__wbindgen_export_0,_.__wbindgen_export_1),d=O,u=R(t,_.__wbindgen_export_0,_.__wbindgen_export_1),g=O;_.split_bits(s,i,d,u,g);var o=h().getInt32(s+0,!0),a=h().getInt32(s+4,!0);return n=o,r=a,N(o,a)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(n,r,1);}}function $n(e){let t=R(e,_.__wbindgen_export_0,_.__wbindgen_export_1),n=O;return _.is_bitmark(t,n)!==0}function Kn(e){let t,n;try{let u=_.__wbindgen_add_to_stack_pointer(-16),g=R(e,_.__wbindgen_export_0,_.__wbindgen_export_1),l=O;_.split_json_bits(u,g,l);var r=h().getInt32(u+0,!0),o=h().getInt32(u+4,!0),a=h().getInt32(u+8,!0),s=h().getInt32(u+12,!0),i=r,d=o;if(s)throw i=0,d=0,Y(a);return t=i,n=d,N(i,d)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(t,n,1);}}function qn(e,t){let n,r;try{let s=_.__wbindgen_add_to_stack_pointer(-16),i=R(e,_.__wbindgen_export_0,_.__wbindgen_export_1),d=O;_.prettify(s,i,d,t);var o=h().getInt32(s+0,!0),a=h().getInt32(s+4,!0);return n=o,r=a,N(o,a)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(n,r,1);}}function Yn(e,t,n,r){let o,a;try{let f=_.__wbindgen_add_to_stack_pointer(-16),x=R(e,_.__wbindgen_export_0,_.__wbindgen_export_1),b=O,m=R(t,_.__wbindgen_export_0,_.__wbindgen_export_1),w=O,y=R(n,_.__wbindgen_export_0,_.__wbindgen_export_1),k=O,v=R(r,_.__wbindgen_export_0,_.__wbindgen_export_1),E=O;_.convert_text(f,x,b,m,w,y,k,v,E);var s=h().getInt32(f+0,!0),i=h().getInt32(f+4,!0),d=h().getInt32(f+8,!0),u=h().getInt32(f+12,!0),g=s,l=i;if(u)throw g=0,l=0,Y(d);return o=g,a=l,N(g,l)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(o,a,1);}}function Xn(e,t,n,r,o,a,s,i,d,u,g){let l,f;try{let v=_.__wbindgen_add_to_stack_pointer(-16),E=R(e,_.__wbindgen_export_0,_.__wbindgen_export_1),A=O,C=R(t,_.__wbindgen_export_0,_.__wbindgen_export_1),D=O,W=R(n,_.__wbindgen_export_0,_.__wbindgen_export_1),J=O,K=R(r,_.__wbindgen_export_0,_.__wbindgen_export_1),tt=O,mt=R(u,_.__wbindgen_export_0,_.__wbindgen_export_1),wt=O,xt=R(g,_.__wbindgen_export_0,_.__wbindgen_export_1),yt=O;_.convert(v,E,A,C,D,W,J,K,tt,o,a,s,i,d,mt,wt,xt,yt);var x=h().getInt32(v+0,!0),b=h().getInt32(v+4,!0),m=h().getInt32(v+8,!0),w=h().getInt32(v+12,!0),y=x,k=b;if(w)throw y=0,k=0,Y(m);return l=y,f=k,N(y,k)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(l,f,1);}}function Qn(e,t,n,r,o,a,s,i,d,u,g,l){try{let m=_.__wbindgen_add_to_stack_pointer(-16),w=R(e,_.__wbindgen_export_0,_.__wbindgen_export_1),y=O,k=R(t,_.__wbindgen_export_0,_.__wbindgen_export_1),v=O,E=R(n,_.__wbindgen_export_0,_.__wbindgen_export_1),A=O,C=R(r,_.__wbindgen_export_0,_.__wbindgen_export_1),D=O,W=R(u,_.__wbindgen_export_0,_.__wbindgen_export_1),J=O,K=R(g,_.__wbindgen_export_0,_.__wbindgen_export_1),tt=O;_.convert_with_details(m,w,y,k,v,E,A,C,D,o,a,s,i,d,W,J,K,tt,l);var f=h().getInt32(m+0,!0),x=h().getInt32(m+4,!0),b=h().getInt32(m+8,!0);if(b)throw Y(x);return Lt.__wrap(f)}finally{_.__wbindgen_add_to_stack_pointer(16);}}var vt=null;function Zn(){return (vt===null||vt.byteLength===0)&&(vt=new Uint32Array(_.memory.buffer)),vt}function tr(e,t){return e=e>>>0,Zn().subarray(e/4,e/4+t)}var ve=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>_.__wbg_convertdetails_free(e>>>0,1)),Lt=class e{static __wrap(t){t=t>>>0;let n=Object.create(e.prototype);return n.__wbg_ptr=t,ve.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,ve.unregister(this),t}free(){let t=this.__destroy_into_raw();_.__wbg_convertdetails_free(t,0);}bit_spans_encoding(){try{let r=_.__wbindgen_add_to_stack_pointer(-16);_.convertdetails_bit_spans_encoding(r,this.__wbg_ptr);var t=h().getInt32(r+0,!0),n=h().getInt32(r+4,!0);let o;return t!==0&&(o=N(t,n).slice(),_.__wbindgen_export_2(t,n*1,1)),o}finally{_.__wbindgen_add_to_stack_pointer(16);}}bit_spans(){try{let r=_.__wbindgen_add_to_stack_pointer(-16);_.convertdetails_bit_spans(r,this.__wbg_ptr);var t=h().getInt32(r+0,!0),n=h().getInt32(r+4,!0);let o;return t!==0&&(o=tr(t,n).slice(),_.__wbindgen_export_2(t,n*4,4)),o}finally{_.__wbindgen_add_to_stack_pointer(16);}}take_data(){let t,n;try{let a=_.__wbindgen_add_to_stack_pointer(-16);_.convertdetails_take_data(a,this.__wbg_ptr);var r=h().getInt32(a+0,!0),o=h().getInt32(a+4,!0);return t=r,n=o,N(r,o)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(t,n,1);}}};async function er(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(r){if(e.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}let n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else {let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function Oe(){let e={};return e.wbg={},e.wbg.__wbindgen_error_new=function(t,n){let r=new Error(N(t,n));return Rn(r)},e.wbg.__wbindgen_throw=function(t,n){throw new Error(N(t,n))},e}function Te(e,t){return _=e.exports,Fe.__wbindgen_wasm_module=t,ct=null,vt=null,kt=null,_}function Zt(e){if(_!==void 0)return _;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=Oe();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));let n=new WebAssembly.Instance(e,t);return Te(n,e)}async function Fe(e){if(_!==void 0)return _;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 t=Oe();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await er(await e,t);return Te(n,r)}var te=Fe;var oe={};Pt(oe,{ConvertDetails:()=>Wt,breakscape_text:()=>or,canonicalize:()=>mr,complete:()=>gr,convert:()=>Ir,convert_text:()=>hr,convert_with_details:()=>Or,count_bits:()=>wr,default:()=>re,diff:()=>ur,hover:()=>fr,info:()=>sr,info_text_supported:()=>ar,initSync:()=>ne,is_bitmark:()=>yr,prettify:()=>vr,register:()=>br,resolve:()=>lr,resolve_patch_document:()=>dr,split_bits:()=>xr,split_json_bits:()=>kr,transform:()=>cr,unbreakscape_text:()=>ir});var p,Re=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:true,fatal:true}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&Re.decode();var It=null;function Ct(){return (It===null||It.byteLength===0)&&(It=new Uint8Array(p.memory.buffer)),It}function V(e,t){return e=e>>>0,Re.decode(Ct().subarray(e,e+t))}var ot=new Array(128).fill(void 0);ot.push(void 0,null,true,false);var Tt=ot.length;function nr(e){Tt===ot.length&&ot.push(ot.length+1);let t=Tt;return Tt=ot[t],ot[t]=e,t}var T=0,Dt=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},rr=typeof Dt.encodeInto=="function"?function(e,t){return Dt.encodeInto(e,t)}:function(e,t){let n=Dt.encode(e);return t.set(n),{read:e.length,written:n.length}};function S(e,t,n){if(n===void 0){let i=Dt.encode(e),d=t(i.length,1)>>>0;return Ct().subarray(d,d+i.length).set(i),T=i.length,d}let r=e.length,o=t(r,1)>>>0,a=Ct(),s=0;for(;s<r;s++){let i=e.charCodeAt(s);if(i>127)break;a[o+s]=i;}if(s!==r){s!==0&&(e=e.slice(s)),o=n(o,r,r=s+e.length*3,1)>>>0;let i=Ct().subarray(o+s,o+r),d=rr(e,i);s+=d.written,o=n(o,r,s,1)>>>0;}return T=s,o}function Se(e){return e==null}var dt=null;function I(){return (dt===null||dt.buffer.detached===true||dt.buffer.detached===void 0&&dt.buffer!==p.memory.buffer)&&(dt=new DataView(p.memory.buffer)),dt}function or(e,t,n,r){let o,a;try{let g=p.__wbindgen_add_to_stack_pointer(-16),l=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),f=T,x=S(t,p.__wbindgen_export_0,p.__wbindgen_export_1),b=T,m=S(n,p.__wbindgen_export_0,p.__wbindgen_export_1),w=T;var s=Se(r)?0:S(r,p.__wbindgen_export_0,p.__wbindgen_export_1),i=T;p.breakscape_text(g,l,f,x,b,m,w,s,i);var d=I().getInt32(g+0,!0),u=I().getInt32(g+4,!0);return o=d,a=u,V(d,u)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(o,a,1);}}function ir(e,t,n,r){let o,a;try{let g=p.__wbindgen_add_to_stack_pointer(-16),l=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),f=T,x=S(t,p.__wbindgen_export_0,p.__wbindgen_export_1),b=T,m=S(n,p.__wbindgen_export_0,p.__wbindgen_export_1),w=T;var s=Se(r)?0:S(r,p.__wbindgen_export_0,p.__wbindgen_export_1),i=T;p.unbreakscape_text(g,l,f,x,b,m,w,s,i);var d=I().getInt32(g+0,!0),u=I().getInt32(g+4,!0);return o=d,a=u,V(d,u)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(o,a,1);}}function sr(e,t,n,r,o,a,s,i,d){let u,g;try{let x=p.__wbindgen_add_to_stack_pointer(-16),b=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),m=T,w=S(t,p.__wbindgen_export_0,p.__wbindgen_export_1),y=T,k=S(n,p.__wbindgen_export_0,p.__wbindgen_export_1),v=T,E=S(d,p.__wbindgen_export_0,p.__wbindgen_export_1),A=T;p.info(x,b,m,w,y,k,v,r,o,a,s,i,E,A);var l=I().getInt32(x+0,!0),f=I().getInt32(x+4,!0);return u=l,g=f,V(l,f)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(u,g,1);}}function ar(){return p.info_text_supported()!==0}function _r(e){return ot[e]}function pr(e){e<132||(ot[e]=Tt,Tt=e);}function X(e){let t=_r(e);return pr(e),t}function cr(e,t,n,r,o,a,s,i){let d,u;try{let w=p.__wbindgen_add_to_stack_pointer(-16),y=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),k=T,v=S(t,p.__wbindgen_export_0,p.__wbindgen_export_1),E=T,A=S(n,p.__wbindgen_export_0,p.__wbindgen_export_1),C=T,D=S(r,p.__wbindgen_export_0,p.__wbindgen_export_1),W=T,J=S(o,p.__wbindgen_export_0,p.__wbindgen_export_1),K=T;p.transform(w,y,k,v,E,A,C,D,W,J,K,a,s,i);var g=I().getInt32(w+0,!0),l=I().getInt32(w+4,!0),f=I().getInt32(w+8,!0),x=I().getInt32(w+12,!0),b=g,m=l;if(x)throw b=0,m=0,X(f);return d=b,u=m,V(b,m)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(d,u,1);}}function dr(e,t,n){let r,o;try{let l=p.__wbindgen_add_to_stack_pointer(-16),f=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),x=T,b=S(t,p.__wbindgen_export_0,p.__wbindgen_export_1),m=T,w=S(n,p.__wbindgen_export_0,p.__wbindgen_export_1),y=T;p.resolve_patch_document(l,f,x,b,m,w,y);var a=I().getInt32(l+0,!0),s=I().getInt32(l+4,!0),i=I().getInt32(l+8,!0),d=I().getInt32(l+12,!0),u=a,g=s;if(d)throw u=0,g=0,X(i);return r=u,o=g,V(u,g)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(r,o,1);}}function ur(e,t,n,r,o,a,s,i,d){let u,g;try{let y=p.__wbindgen_add_to_stack_pointer(-16),k=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),v=T,E=S(t,p.__wbindgen_export_0,p.__wbindgen_export_1),A=T,C=S(n,p.__wbindgen_export_0,p.__wbindgen_export_1),D=T,W=S(r,p.__wbindgen_export_0,p.__wbindgen_export_1),J=T;p.diff(y,k,v,E,A,C,D,W,J,o,a,s,i,d);var l=I().getInt32(y+0,!0),f=I().getInt32(y+4,!0),x=I().getInt32(y+8,!0),b=I().getInt32(y+12,!0),m=l,w=f;if(b)throw m=0,w=0,X(x);return u=m,g=w,V(m,w)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(u,g,1);}}function gr(e,t,n,r,o,a){let s,i;try{let b=p.__wbindgen_add_to_stack_pointer(-16),m=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),w=T,y=S(r,p.__wbindgen_export_0,p.__wbindgen_export_1),k=T,v=S(a,p.__wbindgen_export_0,p.__wbindgen_export_1),E=T;p.complete(b,m,w,t,n,y,k,o,v,E);var d=I().getInt32(b+0,!0),u=I().getInt32(b+4,!0),g=I().getInt32(b+8,!0),l=I().getInt32(b+12,!0),f=d,x=u;if(l)throw f=0,x=0,X(g);return s=f,i=x,V(f,x)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(s,i,1);}}function lr(e,t,n,r,o,a,s){let i,d;try{let m=p.__wbindgen_add_to_stack_pointer(-16),w=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),y=T,k=S(r,p.__wbindgen_export_0,p.__wbindgen_export_1),v=T,E=S(a,p.__wbindgen_export_0,p.__wbindgen_export_1),A=T;p.resolve(m,w,y,t,n,k,v,o,E,A,s);var u=I().getInt32(m+0,!0),g=I().getInt32(m+4,!0),l=I().getInt32(m+8,!0),f=I().getInt32(m+12,!0),x=u,b=g;if(f)throw x=0,b=0,X(l);return i=x,d=b,V(x,b)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(i,d,1);}}function fr(e,t,n,r){let o,a;try{let f=p.__wbindgen_add_to_stack_pointer(-16),x=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),b=T,m=S(r,p.__wbindgen_export_0,p.__wbindgen_export_1),w=T;p.hover(f,x,b,t,n,m,w);var s=I().getInt32(f+0,!0),i=I().getInt32(f+4,!0),d=I().getInt32(f+8,!0),u=I().getInt32(f+12,!0),g=s,l=i;if(u)throw g=0,l=0,X(d);return o=g,a=l,V(g,l)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(o,a,1);}}function br(e,t){try{let o=p.__wbindgen_add_to_stack_pointer(-16),a=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),s=T,i=S(t,p.__wbindgen_export_0,p.__wbindgen_export_1),d=T;p.register(o,a,s,i,d);var n=I().getInt32(o+0,!0),r=I().getInt32(o+4,!0);if(r)throw X(n)}finally{p.__wbindgen_add_to_stack_pointer(16);}}function mr(e,t,n,r,o,a){let s,i;try{let b=p.__wbindgen_add_to_stack_pointer(-16),m=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),w=T,y=S(t,p.__wbindgen_export_0,p.__wbindgen_export_1),k=T,v=S(n,p.__wbindgen_export_0,p.__wbindgen_export_1),E=T;p.canonicalize(b,m,w,y,k,v,E,r,o,a);var d=I().getInt32(b+0,!0),u=I().getInt32(b+4,!0),g=I().getInt32(b+8,!0),l=I().getInt32(b+12,!0),f=d,x=u;if(l)throw f=0,x=0,X(g);return s=f,i=x,V(f,x)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(s,i,1);}}function wr(e){let t,n;try{let u=p.__wbindgen_add_to_stack_pointer(-16),g=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),l=T;p.count_bits(u,g,l);var r=I().getInt32(u+0,!0),o=I().getInt32(u+4,!0),a=I().getInt32(u+8,!0),s=I().getInt32(u+12,!0),i=r,d=o;if(s)throw i=0,d=0,X(a);return t=i,n=d,V(i,d)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(t,n,1);}}function xr(e,t){let n,r;try{let s=p.__wbindgen_add_to_stack_pointer(-16),i=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),d=T,u=S(t,p.__wbindgen_export_0,p.__wbindgen_export_1),g=T;p.split_bits(s,i,d,u,g);var o=I().getInt32(s+0,!0),a=I().getInt32(s+4,!0);return n=o,r=a,V(o,a)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(n,r,1);}}function yr(e){let t=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),n=T;return p.is_bitmark(t,n)!==0}function kr(e){let t,n;try{let u=p.__wbindgen_add_to_stack_pointer(-16),g=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),l=T;p.split_json_bits(u,g,l);var r=I().getInt32(u+0,!0),o=I().getInt32(u+4,!0),a=I().getInt32(u+8,!0),s=I().getInt32(u+12,!0),i=r,d=o;if(s)throw i=0,d=0,X(a);return t=i,n=d,V(i,d)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(t,n,1);}}function vr(e,t){let n,r;try{let s=p.__wbindgen_add_to_stack_pointer(-16),i=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),d=T;p.prettify(s,i,d,t);var o=I().getInt32(s+0,!0),a=I().getInt32(s+4,!0);return n=o,r=a,V(o,a)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(n,r,1);}}function hr(e,t,n,r){let o,a;try{let f=p.__wbindgen_add_to_stack_pointer(-16),x=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),b=T,m=S(t,p.__wbindgen_export_0,p.__wbindgen_export_1),w=T,y=S(n,p.__wbindgen_export_0,p.__wbindgen_export_1),k=T,v=S(r,p.__wbindgen_export_0,p.__wbindgen_export_1),E=T;p.convert_text(f,x,b,m,w,y,k,v,E);var s=I().getInt32(f+0,!0),i=I().getInt32(f+4,!0),d=I().getInt32(f+8,!0),u=I().getInt32(f+12,!0),g=s,l=i;if(u)throw g=0,l=0,X(d);return o=g,a=l,V(g,l)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(o,a,1);}}function Ir(e,t,n,r,o,a,s,i,d,u,g){let l,f;try{let v=p.__wbindgen_add_to_stack_pointer(-16),E=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),A=T,C=S(t,p.__wbindgen_export_0,p.__wbindgen_export_1),D=T,W=S(n,p.__wbindgen_export_0,p.__wbindgen_export_1),J=T,K=S(r,p.__wbindgen_export_0,p.__wbindgen_export_1),tt=T,mt=S(u,p.__wbindgen_export_0,p.__wbindgen_export_1),wt=T,xt=S(g,p.__wbindgen_export_0,p.__wbindgen_export_1),yt=T;p.convert(v,E,A,C,D,W,J,K,tt,o,a,s,i,d,mt,wt,xt,yt);var x=I().getInt32(v+0,!0),b=I().getInt32(v+4,!0),m=I().getInt32(v+8,!0),w=I().getInt32(v+12,!0),y=x,k=b;if(w)throw y=0,k=0,X(m);return l=y,f=k,V(y,k)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(l,f,1);}}function Or(e,t,n,r,o,a,s,i,d,u,g,l){try{let m=p.__wbindgen_add_to_stack_pointer(-16),w=S(e,p.__wbindgen_export_0,p.__wbindgen_export_1),y=T,k=S(t,p.__wbindgen_export_0,p.__wbindgen_export_1),v=T,E=S(n,p.__wbindgen_export_0,p.__wbindgen_export_1),A=T,C=S(r,p.__wbindgen_export_0,p.__wbindgen_export_1),D=T,W=S(u,p.__wbindgen_export_0,p.__wbindgen_export_1),J=T,K=S(g,p.__wbindgen_export_0,p.__wbindgen_export_1),tt=T;p.convert_with_details(m,w,y,k,v,E,A,C,D,o,a,s,i,d,W,J,K,tt,l);var f=I().getInt32(m+0,!0),x=I().getInt32(m+4,!0),b=I().getInt32(m+8,!0);if(b)throw X(x);return Wt.__wrap(f)}finally{p.__wbindgen_add_to_stack_pointer(16);}}var Ot=null;function Tr(){return (Ot===null||Ot.byteLength===0)&&(Ot=new Uint32Array(p.memory.buffer)),Ot}function Fr(e,t){return e=e>>>0,Tr().subarray(e/4,e/4+t)}var Ee=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>p.__wbg_convertdetails_free(e>>>0,1)),Wt=class e{static __wrap(t){t=t>>>0;let n=Object.create(e.prototype);return n.__wbg_ptr=t,Ee.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,Ee.unregister(this),t}free(){let t=this.__destroy_into_raw();p.__wbg_convertdetails_free(t,0);}bit_spans_encoding(){try{let r=p.__wbindgen_add_to_stack_pointer(-16);p.convertdetails_bit_spans_encoding(r,this.__wbg_ptr);var t=I().getInt32(r+0,!0),n=I().getInt32(r+4,!0);let o;return t!==0&&(o=V(t,n).slice(),p.__wbindgen_export_2(t,n*1,1)),o}finally{p.__wbindgen_add_to_stack_pointer(16);}}bit_spans(){try{let r=p.__wbindgen_add_to_stack_pointer(-16);p.convertdetails_bit_spans(r,this.__wbg_ptr);var t=I().getInt32(r+0,!0),n=I().getInt32(r+4,!0);let o;return t!==0&&(o=Fr(t,n).slice(),p.__wbindgen_export_2(t,n*4,4)),o}finally{p.__wbindgen_add_to_stack_pointer(16);}}take_data(){let t,n;try{let a=p.__wbindgen_add_to_stack_pointer(-16);p.convertdetails_take_data(a,this.__wbg_ptr);var r=I().getInt32(a+0,!0),o=I().getInt32(a+4,!0);return t=r,n=o,V(r,o)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(t,n,1);}}};async function Er(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(r){if(e.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}let n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else {let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function Be(){let e={};return e.wbg={},e.wbg.__wbindgen_error_new=function(t,n){let r=new Error(V(t,n));return nr(r)},e.wbg.__wbindgen_throw=function(t,n){throw new Error(V(t,n))},e}function Pe(e,t){return p=e.exports,Ae.__wbindgen_wasm_module=t,dt=null,Ot=null,It=null,p}function ne(e){if(p!==void 0)return p;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=Be();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));let n=new WebAssembly.Instance(e,t);return Pe(n,e)}async function Ae(e){if(p!==void 0)return p;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_browser_full_wasm_bg.wasm",import.meta.url));let t=Be();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await Er(await e,t);return Pe(n,r)}var re=Ae;var ae={};Pt(ae,{ConvertDetails:()=>Nt,breakscape_text:()=>Br,canonicalize:()=>Nr,complete:()=>Wr,convert:()=>qr,convert_text:()=>$r,convert_with_details:()=>Yr,count_bits:()=>Vr,default:()=>se,hover:()=>Mr,info:()=>Ar,initSync:()=>ie,is_bitmark:()=>Hr,prettify:()=>zr,register:()=>Cr,resolve:()=>Jr,resolve_patch_document:()=>Dr,split_bits:()=>Ur,split_json_bits:()=>Gr,transform:()=>Kr,unbreakscape_text:()=>Pr});var c,Le=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:true,fatal:true}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&Le.decode();var Ft=null;function Jt(){return (Ft===null||Ft.byteLength===0)&&(Ft=new Uint8Array(c.memory.buffer)),Ft}function H(e,t){return e=e>>>0,Le.decode(Jt().subarray(e,e+t))}var it=new Array(128).fill(void 0);it.push(void 0,null,true,false);var Rt=it.length;function Rr(e){Rt===it.length&&it.push(it.length+1);let t=Rt;return Rt=it[t],it[t]=e,t}var B=0,Mt=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},Sr=typeof Mt.encodeInto=="function"?function(e,t){return Mt.encodeInto(e,t)}:function(e,t){let n=Mt.encode(e);return t.set(n),{read:e.length,written:n.length}};function P(e,t,n){if(n===void 0){let i=Mt.encode(e),d=t(i.length,1)>>>0;return Jt().subarray(d,d+i.length).set(i),B=i.length,d}let r=e.length,o=t(r,1)>>>0,a=Jt(),s=0;for(;s<r;s++){let i=e.charCodeAt(s);if(i>127)break;a[o+s]=i;}if(s!==r){s!==0&&(e=e.slice(s)),o=n(o,r,r=s+e.length*3,1)>>>0;let i=Jt().subarray(o+s,o+r),d=Sr(e,i);s+=d.written,o=n(o,r,s,1)>>>0;}return B=s,o}function Ce(e){return e==null}var ut=null;function F(){return (ut===null||ut.buffer.detached===true||ut.buffer.detached===void 0&&ut.buffer!==c.memory.buffer)&&(ut=new DataView(c.memory.buffer)),ut}function Br(e,t,n,r){let o,a;try{let g=c.__wbindgen_add_to_stack_pointer(-16),l=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),f=B,x=P(t,c.__wbindgen_export_0,c.__wbindgen_export_1),b=B,m=P(n,c.__wbindgen_export_0,c.__wbindgen_export_1),w=B;var s=Ce(r)?0:P(r,c.__wbindgen_export_0,c.__wbindgen_export_1),i=B;c.breakscape_text(g,l,f,x,b,m,w,s,i);var d=F().getInt32(g+0,!0),u=F().getInt32(g+4,!0);return o=d,a=u,H(d,u)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(o,a,1);}}function Pr(e,t,n,r){let o,a;try{let g=c.__wbindgen_add_to_stack_pointer(-16),l=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),f=B,x=P(t,c.__wbindgen_export_0,c.__wbindgen_export_1),b=B,m=P(n,c.__wbindgen_export_0,c.__wbindgen_export_1),w=B;var s=Ce(r)?0:P(r,c.__wbindgen_export_0,c.__wbindgen_export_1),i=B;c.unbreakscape_text(g,l,f,x,b,m,w,s,i);var d=F().getInt32(g+0,!0),u=F().getInt32(g+4,!0);return o=d,a=u,H(d,u)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(o,a,1);}}function Ar(e,t,n,r,o,a,s,i,d){let u,g;try{let x=c.__wbindgen_add_to_stack_pointer(-16),b=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),m=B,w=P(t,c.__wbindgen_export_0,c.__wbindgen_export_1),y=B,k=P(n,c.__wbindgen_export_0,c.__wbindgen_export_1),v=B,E=P(d,c.__wbindgen_export_0,c.__wbindgen_export_1),A=B;c.info(x,b,m,w,y,k,v,r,o,a,s,i,E,A);var l=F().getInt32(x+0,!0),f=F().getInt32(x+4,!0);return u=l,g=f,H(l,f)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(u,g,1);}}function jr(e){return it[e]}function Lr(e){e<132||(it[e]=Rt,Rt=e);}function Z(e){let t=jr(e);return Lr(e),t}function Cr(e,t){try{let o=c.__wbindgen_add_to_stack_pointer(-16),a=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),s=B,i=P(t,c.__wbindgen_export_0,c.__wbindgen_export_1),d=B;c.register(o,a,s,i,d);var n=F().getInt32(o+0,!0),r=F().getInt32(o+4,!0);if(r)throw Z(n)}finally{c.__wbindgen_add_to_stack_pointer(16);}}function Dr(e,t,n){let r,o;try{let l=c.__wbindgen_add_to_stack_pointer(-16),f=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),x=B,b=P(t,c.__wbindgen_export_0,c.__wbindgen_export_1),m=B,w=P(n,c.__wbindgen_export_0,c.__wbindgen_export_1),y=B;c.resolve_patch_document(l,f,x,b,m,w,y);var a=F().getInt32(l+0,!0),s=F().getInt32(l+4,!0),i=F().getInt32(l+8,!0),d=F().getInt32(l+12,!0),u=a,g=s;if(d)throw u=0,g=0,Z(i);return r=u,o=g,H(u,g)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(r,o,1);}}function Wr(e,t,n,r,o,a){let s,i;try{let b=c.__wbindgen_add_to_stack_pointer(-16),m=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),w=B,y=P(r,c.__wbindgen_export_0,c.__wbindgen_export_1),k=B,v=P(a,c.__wbindgen_export_0,c.__wbindgen_export_1),E=B;c.complete(b,m,w,t,n,y,k,o,v,E);var d=F().getInt32(b+0,!0),u=F().getInt32(b+4,!0),g=F().getInt32(b+8,!0),l=F().getInt32(b+12,!0),f=d,x=u;if(l)throw f=0,x=0,Z(g);return s=f,i=x,H(f,x)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(s,i,1);}}function Jr(e,t,n,r,o,a,s){let i,d;try{let m=c.__wbindgen_add_to_stack_pointer(-16),w=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),y=B,k=P(r,c.__wbindgen_export_0,c.__wbindgen_export_1),v=B,E=P(a,c.__wbindgen_export_0,c.__wbindgen_export_1),A=B;c.resolve(m,w,y,t,n,k,v,o,E,A,s);var u=F().getInt32(m+0,!0),g=F().getInt32(m+4,!0),l=F().getInt32(m+8,!0),f=F().getInt32(m+12,!0),x=u,b=g;if(f)throw x=0,b=0,Z(l);return i=x,d=b,H(x,b)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(i,d,1);}}function Mr(e,t,n,r){let o,a;try{let f=c.__wbindgen_add_to_stack_pointer(-16),x=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),b=B,m=P(r,c.__wbindgen_export_0,c.__wbindgen_export_1),w=B;c.hover(f,x,b,t,n,m,w);var s=F().getInt32(f+0,!0),i=F().getInt32(f+4,!0),d=F().getInt32(f+8,!0),u=F().getInt32(f+12,!0),g=s,l=i;if(u)throw g=0,l=0,Z(d);return o=g,a=l,H(g,l)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(o,a,1);}}function Nr(e,t,n,r,o,a){let s,i;try{let b=c.__wbindgen_add_to_stack_pointer(-16),m=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),w=B,y=P(t,c.__wbindgen_export_0,c.__wbindgen_export_1),k=B,v=P(n,c.__wbindgen_export_0,c.__wbindgen_export_1),E=B;c.canonicalize(b,m,w,y,k,v,E,r,o,a);var d=F().getInt32(b+0,!0),u=F().getInt32(b+4,!0),g=F().getInt32(b+8,!0),l=F().getInt32(b+12,!0),f=d,x=u;if(l)throw f=0,x=0,Z(g);return s=f,i=x,H(f,x)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(s,i,1);}}function Vr(e){let t,n;try{let u=c.__wbindgen_add_to_stack_pointer(-16),g=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),l=B;c.count_bits(u,g,l);var r=F().getInt32(u+0,!0),o=F().getInt32(u+4,!0),a=F().getInt32(u+8,!0),s=F().getInt32(u+12,!0),i=r,d=o;if(s)throw i=0,d=0,Z(a);return t=i,n=d,H(i,d)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(t,n,1);}}function Ur(e,t){let n,r;try{let s=c.__wbindgen_add_to_stack_pointer(-16),i=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),d=B,u=P(t,c.__wbindgen_export_0,c.__wbindgen_export_1),g=B;c.split_bits(s,i,d,u,g);var o=F().getInt32(s+0,!0),a=F().getInt32(s+4,!0);return n=o,r=a,H(o,a)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(n,r,1);}}function Hr(e){let t=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),n=B;return c.is_bitmark(t,n)!==0}function Gr(e){let t,n;try{let u=c.__wbindgen_add_to_stack_pointer(-16),g=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),l=B;c.split_json_bits(u,g,l);var r=F().getInt32(u+0,!0),o=F().getInt32(u+4,!0),a=F().getInt32(u+8,!0),s=F().getInt32(u+12,!0),i=r,d=o;if(s)throw i=0,d=0,Z(a);return t=i,n=d,H(i,d)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(t,n,1);}}function zr(e,t){let n,r;try{let s=c.__wbindgen_add_to_stack_pointer(-16),i=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),d=B;c.prettify(s,i,d,t);var o=F().getInt32(s+0,!0),a=F().getInt32(s+4,!0);return n=o,r=a,H(o,a)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(n,r,1);}}function $r(e,t,n,r){let o,a;try{let f=c.__wbindgen_add_to_stack_pointer(-16),x=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),b=B,m=P(t,c.__wbindgen_export_0,c.__wbindgen_export_1),w=B,y=P(n,c.__wbindgen_export_0,c.__wbindgen_export_1),k=B,v=P(r,c.__wbindgen_export_0,c.__wbindgen_export_1),E=B;c.convert_text(f,x,b,m,w,y,k,v,E);var s=F().getInt32(f+0,!0),i=F().getInt32(f+4,!0),d=F().getInt32(f+8,!0),u=F().getInt32(f+12,!0),g=s,l=i;if(u)throw g=0,l=0,Z(d);return o=g,a=l,H(g,l)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(o,a,1);}}function Kr(e,t,n,r,o,a,s,i){let d,u;try{let w=c.__wbindgen_add_to_stack_pointer(-16),y=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),k=B,v=P(t,c.__wbindgen_export_0,c.__wbindgen_export_1),E=B,A=P(n,c.__wbindgen_export_0,c.__wbindgen_export_1),C=B,D=P(r,c.__wbindgen_export_0,c.__wbindgen_export_1),W=B,J=P(o,c.__wbindgen_export_0,c.__wbindgen_export_1),K=B;c.transform(w,y,k,v,E,A,C,D,W,J,K,a,s,i);var g=F().getInt32(w+0,!0),l=F().getInt32(w+4,!0),f=F().getInt32(w+8,!0),x=F().getInt32(w+12,!0),b=g,m=l;if(x)throw b=0,m=0,Z(f);return d=b,u=m,H(b,m)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(d,u,1);}}function qr(e,t,n,r,o,a,s,i,d,u,g){let l,f;try{let v=c.__wbindgen_add_to_stack_pointer(-16),E=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),A=B,C=P(t,c.__wbindgen_export_0,c.__wbindgen_export_1),D=B,W=P(n,c.__wbindgen_export_0,c.__wbindgen_export_1),J=B,K=P(r,c.__wbindgen_export_0,c.__wbindgen_export_1),tt=B,mt=P(u,c.__wbindgen_export_0,c.__wbindgen_export_1),wt=B,xt=P(g,c.__wbindgen_export_0,c.__wbindgen_export_1),yt=B;c.convert(v,E,A,C,D,W,J,K,tt,o,a,s,i,d,mt,wt,xt,yt);var x=F().getInt32(v+0,!0),b=F().getInt32(v+4,!0),m=F().getInt32(v+8,!0),w=F().getInt32(v+12,!0),y=x,k=b;if(w)throw y=0,k=0,Z(m);return l=y,f=k,H(y,k)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(l,f,1);}}function Yr(e,t,n,r,o,a,s,i,d,u,g,l){try{let m=c.__wbindgen_add_to_stack_pointer(-16),w=P(e,c.__wbindgen_export_0,c.__wbindgen_export_1),y=B,k=P(t,c.__wbindgen_export_0,c.__wbindgen_export_1),v=B,E=P(n,c.__wbindgen_export_0,c.__wbindgen_export_1),A=B,C=P(r,c.__wbindgen_export_0,c.__wbindgen_export_1),D=B,W=P(u,c.__wbindgen_export_0,c.__wbindgen_export_1),J=B,K=P(g,c.__wbindgen_export_0,c.__wbindgen_export_1),tt=B;c.convert_with_details(m,w,y,k,v,E,A,C,D,o,a,s,i,d,W,J,K,tt,l);var f=F().getInt32(m+0,!0),x=F().getInt32(m+4,!0),b=F().getInt32(m+8,!0);if(b)throw Z(x);return Nt.__wrap(f)}finally{c.__wbindgen_add_to_stack_pointer(16);}}var Et=null;function Xr(){return (Et===null||Et.byteLength===0)&&(Et=new Uint32Array(c.memory.buffer)),Et}function Qr(e,t){return e=e>>>0,Xr().subarray(e/4,e/4+t)}var je=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>c.__wbg_convertdetails_free(e>>>0,1)),Nt=class e{static __wrap(t){t=t>>>0;let n=Object.create(e.prototype);return n.__wbg_ptr=t,je.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,je.unregister(this),t}free(){let t=this.__destroy_into_raw();c.__wbg_convertdetails_free(t,0);}bit_spans_encoding(){try{let r=c.__wbindgen_add_to_stack_pointer(-16);c.convertdetails_bit_spans_encoding(r,this.__wbg_ptr);var t=F().getInt32(r+0,!0),n=F().getInt32(r+4,!0);let o;return t!==0&&(o=H(t,n).slice(),c.__wbindgen_export_2(t,n*1,1)),o}finally{c.__wbindgen_add_to_stack_pointer(16);}}bit_spans(){try{let r=c.__wbindgen_add_to_stack_pointer(-16);c.convertdetails_bit_spans(r,this.__wbg_ptr);var t=F().getInt32(r+0,!0),n=F().getInt32(r+4,!0);let o;return t!==0&&(o=Qr(t,n).slice(),c.__wbindgen_export_2(t,n*4,4)),o}finally{c.__wbindgen_add_to_stack_pointer(16);}}take_data(){let t,n;try{let a=c.__wbindgen_add_to_stack_pointer(-16);c.convertdetails_take_data(a,this.__wbg_ptr);var r=F().getInt32(a+0,!0),o=F().getInt32(a+4,!0);return t=r,n=o,H(r,o)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_export_2(t,n,1);}}};async function Zr(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(r){if(e.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}let n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else {let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function De(){let e={};return e.wbg={},e.wbg.__wbindgen_error_new=function(t,n){let r=new Error(H(t,n));return Rr(r)},e.wbg.__wbindgen_throw=function(t,n){throw new Error(H(t,n))},e}function We(e,t){return c=e.exports,Je.__wbindgen_wasm_module=t,ut=null,Et=null,Ft=null,c}function ie(e){if(c!==void 0)return c;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=De();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));let n=new WebAssembly.Instance(e,t);return We(n,e)}async function Je(e){if(c!==void 0)return c;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_json_wasm_bg.wasm",import.meta.url));let t=De();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await Zr(await e,t);return We(n,r)}var se=Je;var St={version:"7.8.0"};var _e="browser-full",Ut=class extends Error{constructor(){super("wasm not initialised: call init() (or init({ feature: \u2026 })) first"),this.name="NotInitializedError";}},lt=class extends Error{constructor(t){super(t),this.name="RegisterError";}},st=class extends Error{constructor(n){let r=n.map(o=>`${o.kind} at ${o.path}: ${o.message}`);super(`${n.length} patch ${n.length===1?"entry was":"entries were"} skipped:
|
|
2
2
|
`+r.join(`
|
|
3
|
-
`));M(this,"diagnostics");this.name="PatchError",this.diagnostics=n;}},at=class extends Error{constructor(t,n){super(`${t} is not available in the loaded wasm module${n?` (feature: "${n}")`:""}; init({ feature: "full" }) to load it`),this.name="UnsupportedFeatureError";}},Vt,Ne,Me,Ve=new Map;function U(){if(!Vt&&Me&&Me(),!Vt)throw new Ut;return Vt}function pe(e,t){for(let[n,r]of Ve)try{t.register(n,r);}catch(o){throw new lt(o instanceof Error?o.message:String(o))}Vt=t,Ne=e;}function Ue(e,t){Ve.set(e,t);}function nt(){return Ne}function to(e){let t=e.trim();return t.startsWith("[")&&t.endsWith("]")?t.slice(1,-1):e}function eo(e){return e===void 0?"":typeof e=="string"?e.trim():JSON.stringify(e)}function no(e,t,n){if(n){let o=JSON.parse(e.split_bits(t,"utf-8"));return o.map(a=>({view:{format:"bitmark",index:a.index,total:o.length,source:a.source},source:a.source}))}let r=JSON.parse(e.split_json_bits(t));return r.map((o,a)=>({view:{format:"json",index:a,total:r.length,bit:o.bit??{}},source:JSON.stringify([o])}))}function ce(e,t,n){let r=n.mode??"optimized",o=n.outputFormat??"json",a=n.spacesAroundValues??1,s=n.indent??2,i=n.pretty??false,d=n.inputFormat??"auto",u=d==="bitmark"||d!=="json"&&e.is_bitmark(t),g=u?"bitmark":"json";e.transform("","bitmark",o,r,"",false,s,a);let l=no(e,t,u),f=l.length,x=[];for(let k=0;k<f;k++){let{view:v}=l[k];v.index=k,v.total=f;let
|
|
4
|
-
`);let a=`[${t.join(",")}]`;return r?e.prettify(a,o):a}function He(e,t,n){let r=ce(e,t,n),o=[],a=[];for(let s=0;s<r.jobs.length;s++){let{element:i,diagnostics:d}=oo(e,r.jobs[s]);a.push(...d),n.postHook?.(r.views[s],i),o.push(i);}if(a.length>0)throw new st(a);return de(e,o,r.output,r.pretty,r.indent)}async function Ge(e,t,n,r){let o=ce(e,t,n),a=await r(o.jobs,n.workers??4),s=[],i=[];for(let d=0;d<a.length;d++)s.push(a[d].element),i.push(...a[d].diagnostics),n.postHook?.(o.views[d],a[d].element);if(i.length>0)throw new st(i);return de(e,s,o.output,o.pretty,o.indent)}var ue;function ze(e){ue=e;}function G(){if(!ue)throw new Error("legacy API not initialised: the WASM module has not been provided (browser consumers must call init() first)");return ue()}function $e(e,t,n){if(e.length===0)return Promise.resolve([]);let r=Math.max(1,Math.min(t,e.length));return new Promise((o,a)=>{let s=new Array(e.length),i=0,d=0,u=false,g=[],l=x=>{if(!u){u=true;for(let b of g)b.terminate();x?a(x):o(s);}},f=x=>{if(u||i>=e.length)return;let b=i++;x.post({id:b,job:e[b]});};for(let x=0;x<r;x++){let b=n(m=>{if(!u){if(!m.ok)return l(new Error(m.error??"worker job failed"));s[m.id]={element:m.element,diagnostics:m.diagnostics??[]},++d===e.length?l():f(b);}},l);g.push(b);}for(let x of g)f(x);})}function Ke(e,t,n){let r=new URL("./worker-entry.js",import.meta.url);return $e(e,t,(o,a)=>{let s=new Worker(r,{type:"module"});return s.onmessage=i=>o(i.data),s.onerror=i=>a(new Error(i.message||"worker error")),{post:i=>s.postMessage({...i,feature:n}),terminate:()=>s.terminate()}})}var vn={};Pt(vn,{Ast:()=>_n,BitType:()=>rn,BitmarkFileGenerator:()=>dn,BitmarkGenerator:()=>pn,BitmarkParser:()=>mn,BitmarkParserGenerator:()=>Yt,BitmarkParserType:()=>bo,BitmarkStringGenerator:()=>cn,BitmarkVersion:()=>lo,BodyTextFormat:()=>xo,BoundingBoxIndex:()=>an,Builder:()=>qt,CardSetVersion:()=>fo,FileWriter:()=>yn,HtmlTableGenerator:()=>fn,HtmlTableParser:()=>bn,InfoFormat:()=>wo,InfoType:()=>mo,Input:()=>co,InputFormat:()=>go,JsonFileGenerator:()=>ln,JsonGenerator:()=>un,JsonParser:()=>wn,JsonStringGenerator:()=>gn,LegacyUnsupportedError:()=>ft,NodeType:()=>sn,Output:()=>uo,ResourceBuilder:()=>Xt,StreamWriter:()=>kn,StringWriter:()=>xn,TextLocation:()=>yo,TextMarkType:()=>en,TextNodeType:()=>nn,bitmarkTextParse:()=>Ze,isPseudoAst:()=>Ye});var ft=class extends Error{constructor(t){super(t),this.name="LegacyUnsupportedError";}};function pt(e,t){throw new ft(`'${e}' is not supported by the @gmb/bitmark-parser legacy API`+(t?`: ${t}`:""))}function et(e,t){throw new ft(`Option '${e}' is not supported by the @gmb/bitmark-parser legacy API`+(t?`: ${t}`:""))}var ge="bitmark v2 output is not supported (this parser is bitmark v3 only)";function le(e){e.bitmarkVersion===2&&et("bitmarkVersion: 2",ge);}function Gt(e){e.explicitTextFormat&&et("bitmarkOptions.explicitTextFormat"),e.cardSetVersion===1&&et("bitmarkOptions.cardSetVersion: 1",ge),e.debugGenerationInline&&et("bitmarkOptions.debugGenerationInline"),e.noBreakscaping&&et("bitmarkOptions.noBreakscaping");}function zt(e){e.textAsPlainText&&et("jsonOptions.textAsPlainText",ge),e.debugGenerationInline&&et("jsonOptions.debugGenerationInline");}function gt(e){return e===true?{pretty:true,indent:2}:typeof e=="number"&&e>0?{pretty:true,indent:e}:{pretty:false,indent:2}}function $t(e){return e===void 0||e===true?1:e===false?0:Math.max(0,Math.min(10,e))}function Kt(e){switch(e){case "text":case "latex":case "json":case "xml":return "plainText";default:return "bitmark++"}}var qe=Symbol.for("@gmb/bitmark-parser/legacy-pseudo-ast");function bt(e){let t={bits:e};return Object.defineProperty(t,qe,{value:true,enumerable:false}),t}function Ye(e){return e!==null&&typeof e=="object"&&(qe in e||Array.isArray(e.bits))}var Xe={"extractor-image":{key:"images",resourceType:"image"},"extractor-image-collapsible":{key:"images",resourceType:"image"},"images-logo-grave":{key:"logos",resourceType:"image"},"prototype-images":{key:"images",resourceType:"image"}};var fe=Symbol.for("@gmb/bitmark-parser/legacy-built-bit-parser"),so={bitType:"type",textFormat:"format",flashcards:"cards",markConfig:"marks"},ao={"bitmark--":"bitmark++","bitmark+":"bitmark++"},_o={bitmark:"bitmark++",text:"text",json:"json",latex:"latex",xml:"xml"},po=["title","subtitle","item","lead","pageNumber","marginNumber","hint","instruction","caption"],qt=class{buildBitmark(t){let n=bt(t.bits??[]);return t.errors!==void 0&&(n.errors=t.errors),n}buildBit(t,n){let r=G(),o={...t},a=o.bitType,s=this.getBitConfig(a),i={};i.type=a,o.isCommented&&(i.type="_comment",i.originalType=a),delete o.bitType,delete o.isCommented;let d=o.textFormat;d!==void 0?(i.format=ao[d]??d,delete o.textFormat):i.format=_o[s.bodyFormat??""]??"bitmark++",delete o.resourceType;let u=o.body;u!=null&&typeof u=="object"&&"body"in u&&(i.body=u.body,delete o.body),o.example!==void 0?(i.isExample=true,i.example=o.example,delete o.example,delete o.__isDefaultExample):o.__isDefaultExample&&(i.isExample=true,delete o.__isDefaultExample);let g=o.resources;if(g!==void 0&&a!==void 0){let w=Array.isArray(g)?g:[g],y=Xe[a];y?i[y.key]=w.filter(k=>k!==null&&typeof k=="object"&&k.type===y.resourceType):w.length>=1&&(i.resource=w[0]),delete o.resources;}let l=o.parser;delete o.parser;let f=o.extraProperties;delete o.extraProperties;for(let[w,y]of Object.entries(o))y!==void 0&&(i[so[w]??w]=y);if(f)for(let[w,y]of Object.entries(f))w in i||(i[w]=y);this.parseStringTexts(i);let x=r.convert(JSON.stringify([{bit:i}]),"json","json","optimized",false,2,1,false,false,"",""),m=JSON.parse(x)[0]?.bit??i;for(let[w,y]of Object.entries(i))w in m||y===false||y===""||y===null||Array.isArray(y)&&y.length===0||(m[w]=y);return l!==void 0&&Object.defineProperty(m,fe,{value:l,enumerable:false}),m}buildHighlight(t,n){if(!n)return;let r={...n},o=r.attrs;return o&&Object.assign(r,o),{type:"highlight",texts:Array.isArray(r.texts)?r.texts.filter(i=>i!=null).map(i=>({text:i.text??"",isCorrect:i.isCorrect??false,isHighlighted:i.isHighlighted??false,...Qe(i,["text","isCorrect","isHighlighted"])})):[],prefix:r.prefix??"",postfix:r.postfix??"",...Qe(r,["type","texts","prefix","postfix","attrs"]),attrs:{}}}parseStringTexts(t){let n=G(),r=(s,i)=>{if(s==="")return s;let d=n.convert_text(s,"textToAst","bitmark++",i);try{return JSON.parse(d)}catch{return s}},o=t.format,a=o===void 0||o==="bitmark++"||o==="bitmark+";if(typeof t.body=="string")if(o==="json")try{t.body=JSON.parse(t.body);}catch{t.body=null;}else a&&(t.body=r(t.body,"body"));for(let s of po){let i=t[s];typeof i=="string"&&(t[s]=r(i,"tag"));}}getBitConfig(t){let n=G();if(t!==void 0)try{let r=JSON.parse(n.info("bit","json",t,!1,2,!1,!1,!0,""));if(r.error===void 0)return {bodyFormat:r.body?.format}}catch{}throw new Error(`No config found for bit: ${t}`)}};function Qe(e,t){let n={};for(let[r,o]of Object.entries(e))o!==void 0&&!t.includes(r)&&(n[r]=o);return n}var Yt=class{version(){return St.version}convert(t,n){let r=Object.assign({},n),o=Object.assign({},r.jsonOptions),a=Object.assign({},r.bitmarkOptions);le(r),Gt(a),zt(o),this.checkBrowserFileWrite(r.outputFile);let s=G(),{source:i,isBitmark:d}=this.resolveInput(t,r.inputFormat),u=r.outputFormat??(d?"json":"bitmark"),g=u==="ast"?"json":u,{pretty:l,indent:f}=gt(o.prettify),x=g==="bitmark"?gt(a.prettifyJson):{pretty:l,indent:f},b=$t(a.spacesAroundValues),m=!o.excludeUnknownProperties,w=s.convert(i,d?"bitmark":"json",g,"optimized",x.pretty,x.indent,b,m,false,"","");if(u==="bitmark"||u==="text")return this.deliver(w,r.outputFile,r.fileOptions);if(u==="json")return r.outputFile?this.deliver(w,r.outputFile,r.fileOptions):l||o.stringify?w:JSON.parse(w);let y=bt(JSON.parse(w));return r.outputFile?this.deliver(JSON.stringify(y),r.outputFile,r.fileOptions):y}upgrade(t,n){let r=Object.assign({},n),o=Object.assign({},r.jsonOptions),a=Object.assign({},r.bitmarkOptions);le(r),Gt(a),zt(o),this.checkBrowserFileWrite(r.outputFile);let s=G(),{source:i,isBitmark:d}=this.resolveInput(t,r.inputFormat),{pretty:u,indent:g}=gt(d?a.prettifyJson:o.prettify),l=$t(a.spacesAroundValues),f=s.canonicalize(i,d?"bitmark":"json","optimized",u,g,l);return d?this.deliver(f,r.outputFile,r.fileOptions):r.outputFile?this.deliver(f,r.outputFile,r.fileOptions):u||o.stringify?f:JSON.parse(f)}info(t){let n=Object.assign({},t),r=G(),o=n.type??"list",a=n.outputFormat??"text",{pretty:s,indent:i}=gt(n.prettify),d=a==="pojo"?"json":a,u=r.info(o,d,n.bit??"",s,i,false,false,true,"");return a==="pojo"?JSON.parse(u):u}generateConfig(t){pt("BitmarkParserGenerator.generateConfig","bpg-internal development tool");}convertHtmlTable(t,n){let r=Object.assign({},n),o=Object.assign({},r.jsonOptions),a=Object.assign({},r.bitmarkOptions);Gt(a),zt(o),r.keepUnknownTags&&et("keepUnknownTags"),r.noBreakscaping&&et("noBreakscaping"),this.checkBrowserFileWrite(r.outputFile);let s=G(),i=typeof t=="string"?this.maybeReadFile(t,void 0):"";if(!(r.inputFormat==="html"||r.inputFormat===void 0&&typeof t=="string"&&/<table[\s>]/iu.test(i))){let{source:k,isBitmark:v}=this.resolveInput(t,void 0),
|
|
3
|
+
`));M(this,"diagnostics");this.name="PatchError",this.diagnostics=n;}},at=class extends Error{constructor(t,n){super(`${t} is not available in the loaded wasm module${n?` (feature: "${n}")`:""}; init({ feature: "full" }) to load it`),this.name="UnsupportedFeatureError";}},Vt,Ne,Me,Ve=new Map;function U(){if(!Vt&&Me&&Me(),!Vt)throw new Ut;return Vt}function pe(e,t){for(let[n,r]of Ve)try{t.register(n,r);}catch(o){throw new lt(o instanceof Error?o.message:String(o))}Vt=t,Ne=e;}function Ue(e,t){Ve.set(e,t);}function nt(){return Ne}function to(e){let t=e.trim();return t.startsWith("[")&&t.endsWith("]")?t.slice(1,-1):e}function eo(e){return e===void 0?"":typeof e=="string"?e.trim():JSON.stringify(e)}function no(e,t,n){if(n){let o=JSON.parse(e.split_bits(t,"utf-8"));return o.map(a=>({view:{format:"bitmark",index:a.index,total:o.length,source:a.source},source:a.source}))}let r=JSON.parse(e.split_json_bits(t));return r.map((o,a)=>({view:{format:"json",index:a,total:r.length,bit:o.bit??{}},source:JSON.stringify([o])}))}function ce(e,t,n){let r=n.mode??"optimized",o=n.outputFormat??"json",a=n.spacesAroundValues??1,s=n.indent??2,i=n.pretty??false,d=n.inputFormat??"auto",u=d==="bitmark"||d!=="json"&&e.is_bitmark(t),g=u?"bitmark":"json";e.transform("","bitmark",o,r,"",false,s,a);let l=no(e,t,u),f=l.length,x=[];for(let k=0;k<f;k++){let{view:v}=l[k];v.index=k,v.total=f;let E=n.preHook?n.preHook(v)||{}:{};x.push(E.drop?null:{patches:E.patches??[],outputFormat:E.outputFormat??o});}let b=eo(n.patch),m;b===""?m=l.map((k,v)=>({source:v,bit:null,patch:[]})):m=JSON.parse(e.resolve_patch_document(t,g,b));let w=[],y=[];for(let k of m)if(k.source!==null){let v=x[k.source];if(!v)continue;w.push({index:k.source,source:l[k.source].source,inputFormat:g,outputFormat:v.outputFormat,mode:r,patchJson:JSON.stringify([...k.patch,...v.patches]),spacesAroundValues:a}),y.push(l[k.source].view);}else if(typeof k.bit=="string"){let v=w.length;w.push({index:v,source:k.bit,inputFormat:"bitmark",outputFormat:o,mode:r,patchJson:JSON.stringify(k.patch),spacesAroundValues:a}),y.push({format:"bitmark",index:v,total:f,source:k.bit});}else {let v=k.bit??{},E=w.length;w.push({index:E,source:JSON.stringify([{bit:v}]),inputFormat:"json",outputFormat:o,mode:r,patchJson:JSON.stringify(k.patch),spacesAroundValues:a}),y.push({format:"json",index:E,total:f,bit:v});}return {jobs:w,views:y,output:o,pretty:i,indent:s}}function ro(e,t){let{data:n,diagnostics:r}=JSON.parse(e);return {element:t==="json"?to(n):n,diagnostics:r}}function oo(e,t){return ro(e.transform(t.source,t.inputFormat,t.outputFormat,t.mode,t.patchJson,false,2,t.spacesAroundValues),t.outputFormat)}function de(e,t,n,r,o){if(n!=="json")return t.join(`
|
|
4
|
+
`);let a=`[${t.join(",")}]`;return r?e.prettify(a,o):a}function He(e,t,n){let r=ce(e,t,n),o=[],a=[];for(let s=0;s<r.jobs.length;s++){let{element:i,diagnostics:d}=oo(e,r.jobs[s]);a.push(...d),n.postHook?.(r.views[s],i),o.push(i);}if(a.length>0)throw new st(a);return de(e,o,r.output,r.pretty,r.indent)}async function Ge(e,t,n,r){let o=ce(e,t,n),a=await r(o.jobs,n.workers??4),s=[],i=[];for(let d=0;d<a.length;d++)s.push(a[d].element),i.push(...a[d].diagnostics),n.postHook?.(o.views[d],a[d].element);if(i.length>0)throw new st(i);return de(e,s,o.output,o.pretty,o.indent)}var ue;function ze(e){ue=e;}function G(){if(!ue)throw new Error("legacy API not initialised: the WASM module has not been provided (browser consumers must call init() first)");return ue()}function $e(e,t,n){if(e.length===0)return Promise.resolve([]);let r=Math.max(1,Math.min(t,e.length));return new Promise((o,a)=>{let s=new Array(e.length),i=0,d=0,u=false,g=[],l=x=>{if(!u){u=true;for(let b of g)b.terminate();x?a(x):o(s);}},f=x=>{if(u||i>=e.length)return;let b=i++;x.post({id:b,job:e[b]});};for(let x=0;x<r;x++){let b=n(m=>{if(!u){if(!m.ok)return l(new Error(m.error??"worker job failed"));s[m.id]={element:m.element,diagnostics:m.diagnostics??[]},++d===e.length?l():f(b);}},l);g.push(b);}for(let x of g)f(x);})}function Ke(e,t,n){let r=new URL("./worker-entry.js",import.meta.url);return $e(e,t,(o,a)=>{let s=new Worker(r,{type:"module"});return s.onmessage=i=>o(i.data),s.onerror=i=>a(new Error(i.message||"worker error")),{post:i=>s.postMessage({...i,feature:n}),terminate:()=>s.terminate()}})}var vn={};Pt(vn,{Ast:()=>_n,BitType:()=>rn,BitmarkFileGenerator:()=>dn,BitmarkGenerator:()=>pn,BitmarkParser:()=>mn,BitmarkParserGenerator:()=>Yt,BitmarkParserType:()=>bo,BitmarkStringGenerator:()=>cn,BitmarkVersion:()=>lo,BodyTextFormat:()=>xo,BoundingBoxIndex:()=>an,Builder:()=>qt,CardSetVersion:()=>fo,FileWriter:()=>yn,HtmlTableGenerator:()=>fn,HtmlTableParser:()=>bn,InfoFormat:()=>wo,InfoType:()=>mo,Input:()=>co,InputFormat:()=>go,JsonFileGenerator:()=>ln,JsonGenerator:()=>un,JsonParser:()=>wn,JsonStringGenerator:()=>gn,LegacyUnsupportedError:()=>ft,NodeType:()=>sn,Output:()=>uo,ResourceBuilder:()=>Xt,StreamWriter:()=>kn,StringWriter:()=>xn,TextLocation:()=>yo,TextMarkType:()=>en,TextNodeType:()=>nn,bitmarkTextParse:()=>Ze,isPseudoAst:()=>Ye});var ft=class extends Error{constructor(t){super(t),this.name="LegacyUnsupportedError";}};function pt(e,t){throw new ft(`'${e}' is not supported by the @gmb/bitmark-parser legacy API`+(t?`: ${t}`:""))}function et(e,t){throw new ft(`Option '${e}' is not supported by the @gmb/bitmark-parser legacy API`+(t?`: ${t}`:""))}var ge="bitmark v2 output is not supported (this parser is bitmark v3 only)";function le(e){e.bitmarkVersion===2&&et("bitmarkVersion: 2",ge);}function Gt(e){e.explicitTextFormat&&et("bitmarkOptions.explicitTextFormat"),e.cardSetVersion===1&&et("bitmarkOptions.cardSetVersion: 1",ge),e.debugGenerationInline&&et("bitmarkOptions.debugGenerationInline"),e.noBreakscaping&&et("bitmarkOptions.noBreakscaping");}function zt(e){e.textAsPlainText&&et("jsonOptions.textAsPlainText",ge),e.debugGenerationInline&&et("jsonOptions.debugGenerationInline");}function gt(e){return e===true?{pretty:true,indent:2}:typeof e=="number"&&e>0?{pretty:true,indent:e}:{pretty:false,indent:2}}function $t(e){return e===void 0||e===true?1:e===false?0:Math.max(0,Math.min(10,e))}function Kt(e){switch(e){case "text":case "latex":case "json":case "xml":return "plainText";default:return "bitmark++"}}var qe=Symbol.for("@gmb/bitmark-parser/legacy-pseudo-ast");function bt(e){let t={bits:e};return Object.defineProperty(t,qe,{value:true,enumerable:false}),t}function Ye(e){return e!==null&&typeof e=="object"&&(qe in e||Array.isArray(e.bits))}var Xe={"extractor-image":{key:"images",resourceType:"image"},"extractor-image-collapsible":{key:"images",resourceType:"image"},"images-logo-grave":{key:"logos",resourceType:"image"},"prototype-images":{key:"images",resourceType:"image"}};var fe=Symbol.for("@gmb/bitmark-parser/legacy-built-bit-parser"),so={bitType:"type",textFormat:"format",flashcards:"cards",markConfig:"marks"},ao={"bitmark--":"bitmark++","bitmark+":"bitmark++"},_o={bitmark:"bitmark++",text:"text",json:"json",latex:"latex",xml:"xml"},po=["title","subtitle","item","lead","pageNumber","marginNumber","hint","instruction","caption"],qt=class{buildBitmark(t){let n=bt(t.bits??[]);return t.errors!==void 0&&(n.errors=t.errors),n}buildBit(t,n){let r=G(),o={...t},a=o.bitType,s=this.getBitConfig(a),i={};i.type=a,o.isCommented&&(i.type="_comment",i.originalType=a),delete o.bitType,delete o.isCommented;let d=o.textFormat;d!==void 0?(i.format=ao[d]??d,delete o.textFormat):i.format=_o[s.bodyFormat??""]??"bitmark++",delete o.resourceType;let u=o.body;u!=null&&typeof u=="object"&&"body"in u&&(i.body=u.body,delete o.body),o.example!==void 0?(i.isExample=true,i.example=o.example,delete o.example,delete o.__isDefaultExample):o.__isDefaultExample&&(i.isExample=true,delete o.__isDefaultExample);let g=o.resources;if(g!==void 0&&a!==void 0){let w=Array.isArray(g)?g:[g],y=Xe[a];y?i[y.key]=w.filter(k=>k!==null&&typeof k=="object"&&k.type===y.resourceType):w.length>=1&&(i.resource=w[0]),delete o.resources;}let l=o.parser;delete o.parser;let f=o.extraProperties;delete o.extraProperties;for(let[w,y]of Object.entries(o))y!==void 0&&(i[so[w]??w]=y);if(f)for(let[w,y]of Object.entries(f))w in i||(i[w]=y);this.parseStringTexts(i);let x=r.convert(JSON.stringify([{bit:i}]),"json","json","optimized",false,2,1,false,false,"",""),m=JSON.parse(x)[0]?.bit??i;for(let[w,y]of Object.entries(i))w in m||y===false||y===""||y===null||Array.isArray(y)&&y.length===0||(m[w]=y);return l!==void 0&&Object.defineProperty(m,fe,{value:l,enumerable:false}),m}buildHighlight(t,n){if(!n)return;let r={...n},o=r.attrs;return o&&Object.assign(r,o),{type:"highlight",texts:Array.isArray(r.texts)?r.texts.filter(i=>i!=null).map(i=>({text:i.text??"",isCorrect:i.isCorrect??false,isHighlighted:i.isHighlighted??false,...Qe(i,["text","isCorrect","isHighlighted"])})):[],prefix:r.prefix??"",postfix:r.postfix??"",...Qe(r,["type","texts","prefix","postfix","attrs"]),attrs:{}}}parseStringTexts(t){let n=G(),r=(s,i)=>{if(s==="")return s;let d=n.convert_text(s,"textToAst","bitmark++",i);try{return JSON.parse(d)}catch{return s}},o=t.format,a=o===void 0||o==="bitmark++"||o==="bitmark+";if(typeof t.body=="string")if(o==="json")try{t.body=JSON.parse(t.body);}catch{t.body=null;}else a&&(t.body=r(t.body,"body"));for(let s of po){let i=t[s];typeof i=="string"&&(t[s]=r(i,"tag"));}}getBitConfig(t){let n=G();if(t!==void 0)try{let r=JSON.parse(n.info("bit","json",t,!1,2,!1,!1,!0,""));if(r.error===void 0)return {bodyFormat:r.body?.format}}catch{}throw new Error(`No config found for bit: ${t}`)}};function Qe(e,t){let n={};for(let[r,o]of Object.entries(e))o!==void 0&&!t.includes(r)&&(n[r]=o);return n}var Yt=class{version(){return St.version}convert(t,n){let r=Object.assign({},n),o=Object.assign({},r.jsonOptions),a=Object.assign({},r.bitmarkOptions);le(r),Gt(a),zt(o),this.checkBrowserFileWrite(r.outputFile);let s=G(),{source:i,isBitmark:d}=this.resolveInput(t,r.inputFormat),u=r.outputFormat??(d?"json":"bitmark"),g=u==="ast"?"json":u,{pretty:l,indent:f}=gt(o.prettify),x=g==="bitmark"?gt(a.prettifyJson):{pretty:l,indent:f},b=$t(a.spacesAroundValues),m=!o.excludeUnknownProperties,w=s.convert(i,d?"bitmark":"json",g,"optimized",x.pretty,x.indent,b,m,false,"","");if(u==="bitmark"||u==="text")return this.deliver(w,r.outputFile,r.fileOptions);if(u==="json")return r.outputFile?this.deliver(w,r.outputFile,r.fileOptions):l||o.stringify?w:JSON.parse(w);let y=bt(JSON.parse(w));return r.outputFile?this.deliver(JSON.stringify(y),r.outputFile,r.fileOptions):y}upgrade(t,n){let r=Object.assign({},n),o=Object.assign({},r.jsonOptions),a=Object.assign({},r.bitmarkOptions);le(r),Gt(a),zt(o),this.checkBrowserFileWrite(r.outputFile);let s=G(),{source:i,isBitmark:d}=this.resolveInput(t,r.inputFormat),{pretty:u,indent:g}=gt(d?a.prettifyJson:o.prettify),l=$t(a.spacesAroundValues),f=s.canonicalize(i,d?"bitmark":"json","optimized",u,g,l);return d?this.deliver(f,r.outputFile,r.fileOptions):r.outputFile?this.deliver(f,r.outputFile,r.fileOptions):u||o.stringify?f:JSON.parse(f)}info(t){let n=Object.assign({},t),r=G(),o=n.type??"list",a=n.outputFormat??"text",{pretty:s,indent:i}=gt(n.prettify),d=a==="pojo"?"json":a,u=r.info(o,d,n.bit??"",s,i,false,false,true,"");return a==="pojo"?JSON.parse(u):u}generateConfig(t){pt("BitmarkParserGenerator.generateConfig","bpg-internal development tool");}convertHtmlTable(t,n){let r=Object.assign({},n),o=Object.assign({},r.jsonOptions),a=Object.assign({},r.bitmarkOptions);Gt(a),zt(o),r.keepUnknownTags&&et("keepUnknownTags"),r.noBreakscaping&&et("noBreakscaping"),this.checkBrowserFileWrite(r.outputFile);let s=G(),i=typeof t=="string"?this.maybeReadFile(t,void 0):"";if(!(r.inputFormat==="html"||r.inputFormat===void 0&&typeof t=="string"&&/<table[\s>]/iu.test(i))){let{source:k,isBitmark:v}=this.resolveInput(t,void 0),E=s.convert(k,v?"bitmark":"json","html","optimized",false,2,1,false,false,"","");return this.deliver(be(E).join(`
|
|
5
5
|
`),r.outputFile,r.fileOptions)}let u=r.tableFormat==="table"?"table":"table-extended",g=be(i).map(k=>`<bitmark-bit data-type="${u}" data-format="bitmark++">${k}</bitmark-bit>`).join(""),l=r.outputFormat??"bitmark",{pretty:f,indent:x}=gt(o.prettify),b=$t(a.spacesAroundValues);if(l==="html"){let k=s.convert(g,"html","html","optimized",false,2,1,false,false,"","");return this.deliver(be(k).join(`
|
|
6
|
-
`),r.outputFile,r.fileOptions)}let m=l==="ast"?"json":l,w=s.convert(g,"html",m,"optimized",f,x,b,false,false,"","");if(l==="bitmark"||l==="text")return this.deliver(w,r.outputFile,r.fileOptions);if(l==="json")return r.outputFile?this.deliver(w,r.outputFile,r.fileOptions):f||o.stringify?w:JSON.parse(w);let y=bt(JSON.parse(w));return r.outputFile?this.deliver(JSON.stringify(y),r.outputFile,r.fileOptions):y}createAst(t,n){let r=Object.assign({},n),o=G(),{source:a,isBitmark:s}=this.resolveInput(t,r.inputFormat),i=o.convert(a,s?"bitmark":"json","json","optimized",false,2,1,true,false,"","");return bt(JSON.parse(i))}breakscapeText(t,n){if(!t)return t;let r=Object.assign({},n);this.checkBrowserFileWrite(r.outputFile);let o=G(),a=this.maybeReadFile(t,r.inputFormat),s=o.breakscape_text(a,Kt(r.textFormat),r.textLocation??"body");return this.deliver(s,r.outputFile,r.fileOptions)}unbreakscapeText(t,n){if(!t)return t;let r=Object.assign({},n);this.checkBrowserFileWrite(r.outputFile);let o=G(),a=this.maybeReadFile(t,r.inputFormat),s=o.unbreakscape_text(a,Kt(r.textFormat),r.textLocation??"body");return this.deliver(s,r.outputFile,r.fileOptions)}convertText(t,n){let r=Object.assign({},n),o=Object.assign({},r.jsonOptions);this.checkBrowserFileWrite(r.outputFile);let a=G(),s=r.textFormat===void 0||Kt(r.textFormat)==="bitmark++",i=r.textLocation??"body",d,u;if(typeof t=="string"?(d=this.maybeReadFile(t,r.inputFormat),u=this.parseTextAstString(d)):(d=JSON.stringify(t),u=Array.isArray(t)?t:void 0),u!==void 0){let b=s?a.convert_text(JSON.stringify(u),"astToText","bitmark++",i):a.convert_text(JSON.stringify(u),"astToPlainText","plainText",i);return this.deliver(b,r.outputFile,r.fileOptions)}let g=a.convert_text(d,"textToAst",s?"bitmark++":"plainText","body"),{pretty:l,indent:f}=gt(o.prettify),x=l?a.prettify(g,f):g;return r.outputFile?this.deliver(x,r.outputFile,r.fileOptions):l?x:JSON.parse(g)}textAstToPlainText(t,n){return G().convert_text(typeof t=="string"?t:JSON.stringify(t),"astToPlainText","bitmark++","body")}extractPlainText(t,n){let r=n?.inputFormat,o=G();if(r==="plainText")return typeof t=="string"?String(t):"";if(r==="bitmarkText"){let d=o.convert_text(String(t),"textToAst","bitmark++","body");return o.convert_text(d,"astToPlainText","bitmark++","body")}if(typeof t=="string"&&this.parseTextAstString(t)===void 0&&!o.is_bitmark(t)&&!(()=>{try{return JSON.parse(t),!0}catch{return false}})())return this.extractPlainText(t,{inputFormat:"bitmarkText"});let{source:a,isBitmark:s}=this.resolveInput(t,void 0);return o.convert(a,s?"bitmark":"json","text","optimized",false,2,1,false,false,"","")}parseTextAstString(t){let n=t.trim();if(n.startsWith("["))try{let r=JSON.parse(n);if(Array.isArray(r)&&r.every(o=>o!==null&&typeof o=="object"&&"type"in o))return r}catch{}}resolveInput(t,n){if(typeof t!="string"){let a=this.jsonEntries(t);return {source:JSON.stringify(a?a.map(s=>this.toWrapperEntry(s)):t),isBitmark:false}}let r=this.maybeReadFile(t,n);if(G().is_bitmark(r))return {source:r,isBitmark:true};try{let a=JSON.parse(r),s=this.jsonEntries(a);if(s)return {source:JSON.stringify(s.map(i=>this.toWrapperEntry(i))),isBitmark:!1}}catch{return {source:r,isBitmark:true}}return {source:r,isBitmark:false}}jsonEntries(t){if(Array.isArray(t))return t;if(t!==null&&typeof t=="object"){let n=t;if(Array.isArray(n.bits))return n.bits;if("bit"in n)return [n];if(typeof n.type=="string")return [{bit:n}]}}toWrapperEntry(t){if(t!==null&&typeof t=="object"&&"bit"in t)return t;let n={bit:t},r=t?.[fe];return r!==void 0&&(n.parser=r),n}maybeReadFile(t,n){if(n==="string")return t;return t;}checkBrowserFileWrite(t){if(t&&true)throw new Error("Cannot write to file in browser environment")}deliver(t,n,r){if(!n)return t;throw new Error("Cannot write to file in browser environment");}};function be(e){let t=[],n=e.toLowerCase(),r=0;for(;;){let o=n.indexOf("<table",r);if(o===-1)break;let a=0,s=o,i=-1;for(;s<e.length;){let d=n.indexOf("<table",s),u=n.indexOf("</table",s);if(u===-1)break;if(d!==-1&&d<u)a++,s=d+6;else {a--;let g=n.indexOf(">",u);if(s=g===-1?e.length:g+1,a===0){i=s;break}}}if(i===-1)break;t.push(e.slice(o,i)),r=i;}return t}function Ze(e){let t=G().convert_text(e,"textToAst","bitmark++","body");return JSON.parse(t)}var $={imageResource:{type:"image",key:"image",valueField:"src"},imageLinkResource:{type:"image-link",key:"imageLink",valueField:"url"},audioResource:{type:"audio",key:"audio",valueField:"src"},audioEmbedResource:{type:"audio-embed",key:"audioEmbed",valueField:"src"},audioLinkResource:{type:"audio-link",key:"audioLink",valueField:"url"},videoResource:{type:"video",key:"video",valueField:"src"},videoEmbedResource:{type:"video-embed",key:"videoEmbed",valueField:"url"},videoLinkResource:{type:"video-link",key:"videoLink",valueField:"url"},stillImageFilmEmbedResource:{type:"still-image-film-embed",key:"stillImageFilmEmbed",valueField:"url"},stillImageFilmLinkResource:{type:"still-image-film-link",key:"stillImageFilmLink",valueField:"url"},articleResource:{type:"article",key:"article",valueField:"body"},documentResource:{type:"document",key:"document",valueField:"url"},documentEmbedResource:{type:"document-embed",key:"documentEmbed",valueField:"url"},documentLinkResource:{type:"document-link",key:"documentLink",valueField:"url"},documentDownloadResource:{type:"document-download",key:"documentDownload",valueField:"url"},appLinkResource:{type:"app-link",key:"appLink",valueField:"url"},websiteLinkResource:{type:"website-link",key:"websiteLink",valueField:"url"}};function z(e){return (t,n,r)=>{if(!n)return;let{value:o,...a}=n,s={[e.valueField]:o??""};for(let[i,d]of Object.entries(a))d!==void 0&&(s[i]=d);return {type:e.type,[e.key]:s}}}var tn=Object.fromEntries(Object.values($).map(e=>[e.type,e])),Xt=class{constructor(){M(this,"imageResource",z($.imageResource));M(this,"imageLinkResource",z($.imageLinkResource));M(this,"audioResource",z($.audioResource));M(this,"audioEmbedResource",z($.audioEmbedResource));M(this,"audioLinkResource",z($.audioLinkResource));M(this,"videoResource",z($.videoResource));M(this,"videoEmbedResource",z($.videoEmbedResource));M(this,"videoLinkResource",z($.videoLinkResource));M(this,"stillImageFilmEmbedResource",z($.stillImageFilmEmbedResource));M(this,"stillImageFilmLinkResource",z($.stillImageFilmLinkResource));M(this,"articleResource",z($.articleResource));M(this,"documentResource",z($.documentResource));M(this,"documentEmbedResource",z($.documentEmbedResource));M(this,"documentLinkResource",z($.documentLinkResource));M(this,"documentDownloadResource",z($.documentDownloadResource));M(this,"appLinkResource",z($.appLinkResource));M(this,"websiteLinkResource",z($.websiteLinkResource));}resourceFromResourceJson(t,n){if(!n)return;let r=!Array.isArray(n),o=r?[n]:n,a=[];for(let s of o){let i=tn[s.type];if(!i)continue;let d=s[i.key]??{},{[i.valueField]:u,...g}=d,l=z(i)(void 0,{value:u,...g});l&&a.push(l);}if(a.length!==0)return r?a[0]:a}resourceFromResourceDataJson(t,n,r){if(!r)return;let o=tn[n];if(!o)return;let a=typeof r=="string"?r:void 0,s=typeof r=="object"?r:{},{url:i,src:d,body:u,...g}=s,l=i??d??u??a;return z(o)(t,{value:l,...g})}};var co={string:"string",file:"file"},uo={bitmark:"bitmark",json:"json",ast:"ast",text:"text"},go={bitmark:"bitmark",bitmarkText:"bitmarkText",plainText:"plainText",html:"html"},lo={v2:2,v3:3},fo={v1:1,v2:2},bo={peggy:"peggy"},mo={list:"list",deprecated:"deprecated",all:"all",bit:"bit"},wo={text:"text",json:"json",pojo:"pojo"},xo={plainText:"text",latex:"latex",json:"json",xml:"xml",bitmarkPlusPlus:"bitmark++"},yo={tag:"tag",body:"body",cardBody:"cardBody"};var en={bold:"bold",light:"light",italic:"italic",highlight:"highlight",highlightOrange:"highlightOrange",highlightYellow:"highlightYellow",highlightGreen:"highlightGreen",highlightBlue:"highlightBlue",highlightPurple:"highlightPurple",highlightPink:"highlightPink",highlightBrown:"highlightBrown",highlightBlack:"highlightBlack",highlightWhite:"highlightWhite",highlightGray:"highlightGray",strike:"strike",subscript:"subscript",superscript:"superscript",ins:"ins",del:"del",underline:"underline",doubleUnderline:"doubleUnderline",circle:"circle",languageEmRed:"languageEmRed",languageEmOrange:"languageEmOrange",languageEmYellow:"languageEmYellow",languageEmGreen:"languageEmGreen",languageEmBlue:"languageEmBlue",languageEmPurple:"languageEmPurple",languageEmPink:"languageEmPink",languageEmBrown:"languageEmBrown",languageEmBlack:"languageEmBlack",languageEmWhite:"languageEmWhite",languageEmGray:"languageEmGray",languageEm:"languageEm",userUnderline:"userUnderline",userDoubleUnderline:"userDoubleUnderline",userStrike:"userStrike",userCircle:"userCircle",userHighlight:"userHighlight",notranslate:"notranslate",link:"link",ref:"ref",xref:"xref",extref:"extref",footnote:"footnote",footnoteStar:"footnote*",symbol:"symbol",var:"var",code:"code",timer:"timer",duration:"duration",color:"color",colorPicker:"colorPicker",comment:"comment"},nn={text:"text",hardBreak:"hardBreak",paragraph:"paragraph",heading:"heading",section:"section",noBulletList:"noBulletList",bulletList:"bulletList",orderedList:"orderedList",orderedListRoman:"orderedListRoman",orderedListRomanLower:"orderedListRomanLower",letteredList:"letteredList",letteredListLower:"letteredListLower",taskList:"taskList",listItem:"listItem",taskItem:"taskItem",image:"image",imageInline:"imageInline",codeBlock:"codeBlock",latex:"latex",gap:"gap",select:"select",highlight:"highlight",mark:"mark"};function ko(e){return e.replace(/-([a-z0-9])/gu,(t,n)=>n.toUpperCase())}var me;function Bt(){if(!me){let e=G(),t=JSON.parse(e.info("all","json","",false,2,true,false,false,"")),n={_standard:"_standard"};for(let{name:r}of t)n[ko(r)]=r;me=n;}return me}var rn=new Proxy({},{get:(e,t)=>typeof t=="string"?Bt()[t]:void 0,has:(e,t)=>typeof t=="string"&&t in Bt(),ownKeys:()=>Reflect.ownKeys(Bt()),getOwnPropertyDescriptor:(e,t)=>typeof t=="string"&&t in Bt()?{value:Bt()[t],enumerable:true,configurable:true,writable:false}:void 0});function on(e,t){return new Proxy({},{get:(n,r)=>r===Symbol.toPrimitive||r==="toString"||r===Symbol.toStringTag?()=>`[unsupported ${e}]`:pt(e,t),has:()=>pt(e,t),ownKeys:()=>pt(e,t)})}var sn=on("NodeType","it names bpg's internal AST nodes; the legacy AST is bit JSON (see createAst)"),an=on("BoundingBoxIndex","bpg-internal bounding-box utility");function q(e,t){return class{constructor(){pt(e,t);}}}var vo="the legacy AST is bit JSON, not bpg's internal node model; walking it with bpg NodeType names would silently misbehave",Q="internal class of bpg's TS implementation",_n=q("Ast",vo),pn=q("BitmarkGenerator",Q),cn=q("BitmarkStringGenerator",Q),dn=q("BitmarkFileGenerator",Q),un=q("JsonGenerator",Q),gn=q("JsonStringGenerator",Q),ln=q("JsonFileGenerator",Q),fn=q("HtmlTableGenerator",Q),bn=q("HtmlTableParser",Q),mn=q("BitmarkParser",Q),wn=q("JsonParser",Q),xn=q("StringWriter",Q),yn=q("FileWriter",Q),kn=q("StreamWriter",Q);var hn={Error:1,Warning:2,Information:3,Hint:4},In={Class:7,Property:10,Value:12,Keyword:14,Snippet:15,EnumMember:20,TypeParameter:25},On={Deprecated:1};function ho(e,t,n){return n===void 0?{path:e,op:t}:{path:e,op:t,value:n}}var Io="all";function Oo(e,t={}){let n=U().convert(e,"bitmark","json",t.mode??"optimized",false,2,1,t.includeUnknownProperties??false,false,"","");return JSON.parse(n)}function To(e,t={}){let n=e.map(o=>o!==null&&typeof o=="object"&&"bit"in o&&typeof o.bit=="object"?o:{bit:o});return U().convert(JSON.stringify(n),"json","bitmark",t.mode??"optimized",false,2,1,false,false,"","")}function we(e,t={}){return U().convert(e,t.inputFormat??"auto",t.outputFormat??"auto",t.mode??"optimized",t.pretty??false,t.indent??2,t.spacesAroundValues??1,t.includeUnknownProperties??false,t.mappingReport??false,t.positionEncoding??"",t.tokensLayout??"")}function Fo(e,t={}){let n=U().convert_with_details(e,t.inputFormat??"auto",t.outputFormat??"auto",t.mode??"optimized",t.pretty??false,t.indent??2,t.spacesAroundValues??1,t.includeUnknownProperties??false,t.mappingReport??false,t.positionEncoding??"",t.tokensLayout??"",t.bitSpans??false);try{let r={output:n.take_data()},o=n.bit_spans();if(o!==void 0){let a=new Array(o.length/3);for(let s=0,i=0;i<o.length;s++,i+=3)a[s]={index:o[i],start:o[i+1],end:o[i+2]};r.bitSpans={positionEncoding:n.bit_spans_encoding(),spans:a};}return r}finally{n.free();}}function Ro(e,t={}){return JSON.parse(we(e,{inputFormat:"bitmark",outputFormat:"semantic-tokens",positionEncoding:t.positionEncoding,tokensLayout:t.tokensLayout}))}function Eo(e,t={}){return JSON.parse(we(e,{inputFormat:"bitmark",outputFormat:"diagnostics",positionEncoding:t.positionEncoding}))}function So(e,t,n={}){let r=U();if(typeof r.complete!="function")throw new at("complete",nt());return JSON.parse(r.complete(e,t.line,t.character,n.positionEncoding??"",n.includeDeprecated??false,n.triggerCharacter??""))}function Bo(e,t,n,r={}){let o=U();if(typeof o.resolve!="function")throw new at("resolve",nt());return JSON.parse(o.resolve(e,t.line,t.character,r.positionEncoding??"",r.includeDeprecated??false,n.label,n.kind))??n}function Po(e,t,n={}){let r=U();if(typeof r.hover!="function")throw new at("hover",nt());return JSON.parse(r.hover(e,t.line,t.character,n.positionEncoding??""))}function Ao(e,t={}){return U().canonicalize(e,t.inputFormat??"auto",t.mode??"optimized",t.pretty??false,t.indent??2,t.spacesAroundValues??1)}function jo(e){return Number.parseInt(U().count_bits(e),10)}function Lo(e,t={}){return JSON.parse(U().split_bits(e,t.positionEncoding??""))}function Co(e,t={}){let n=U();if(t.preHook||t.postHook)return He(n,e,t);let r=t.patch===void 0?"":typeof t.patch=="string"?t.patch:JSON.stringify(t.patch),{data:o,diagnostics:a}=JSON.parse(n.transform(e,t.inputFormat??"auto",t.outputFormat??"json",t.mode??"optimized",r,t.pretty??false,t.indent??2,t.spacesAroundValues??1));if(a.length>0)throw new st(a);return o}function Tn(e,t,n={}){let r=U();if(typeof r.diff!="function")throw new at("diff",nt());return r.diff(e,t,n.inputFormat??"auto",n.outputFormat??"bitmark",n.context??3,n.locate??false,n.similarity??.6,n.bboxTolerance??8,n.spacesAroundValues??0)}function Do(e,t,n={}){return JSON.parse(Tn(e,t,{...n,outputFormat:"json"}))}function Wo(e,t={}){let n=t.format??"bitmark++",r=t.location??"body",o=t.subLocation??"text";return U().breakscape_text(e,n,r,o)}function Jo(e,t={}){let n=t.format??"bitmark++",r=t.location??"body",o=t.subLocation??"text";return U().unbreakscape_text(e,n,r,o)}function Mo(e={}){let t=e.infoType??"list",n=e.format??"text",r=e.bit??"",o=e.pretty??false,a=e.indent??2,s=e.includeDeprecated??false,i=e.onlyDeprecated??false,d=e.full??false,u=typeof e.language=="string"?e.language:e.language?.join(",")??"",g=U();if(n!=="json"&&typeof g.info_text_supported!="function")throw new at('info (format: "text")',nt());return g.info(t,n,r,o,a,s,i,d,u)}function No(e){try{U().register(e.type,e.data);}catch(t){throw new lt(t instanceof Error?t.message:String(t))}Ue(e.type,e.data);}var Vo="./wasm/",Fn={full:{init:te,initSync:Zt,ns:ee,wasmFile:"bitmark_wasm_bg.wasm"},"browser-full":{init:re,initSync:ne,ns:oe,wasmFile:"bitmark_browser_full_wasm_bg.wasm"},"bitmark-json":{init:se,initSync:ie,ns:ae,wasmFile:"bitmark_json_wasm_bg.wasm"}};ze(()=>U());function xe(e){return e===void 0?_e:"full"}function Uo(e){if(e===null||typeof e!="object")return false;if("feature"in e||"module_or_path"in e)return true;let t=Object.getPrototypeOf(e);return (t===Object.prototype||t===null)&&Object.keys(e).length===0}function Ho(e){if(Uo(e))return {feature:e.feature??xe(e.module_or_path),module_or_path:e.module_or_path};let t=e??void 0;return {feature:xe(t),module_or_path:t}}var ye=0,Qt,_t;async function ks(e){let{feature:t,module_or_path:n}=Ho(e);if(n===void 0){if(!_t&&nt()===t)return Qt;if(_t?.feature===t)return _t.promise}let r=++ye,o=Fn[t],a=n??new URL(`${Vo}${o.wasmFile}?v=${St.version}`,import.meta.url),s=(async()=>{try{let i=await o.init({module_or_path:a});r===ye&&(pe(t,o.ns),Qt=i);}finally{_t?.seq===r&&(_t=void 0);}for(;_t;)await _t.promise.catch(()=>{});return Qt})();return _t={feature:t,seq:r,promise:s},s}function vs(e,t={}){let n=t.feature??xe(e),r=Fn[n],o=r.initSync({module:e});return ++ye,_t=void 0,pe(n,r.ns),Qt=o,o}function hs(){return St.version}function Is(e,t={}){let n=U(),r=nt()??_e;return Ge(n,e,t,(o,a)=>Ke(o,a,r))}export{Io as ALL_LANGUAGES,In as CompletionItemKind,On as CompletionItemTag,hn as DiagnosticSeverity,Ut as NotInitializedError,st as PatchError,lt as RegisterError,at as UnsupportedFeatureError,Oo as bitmarkToObjects,Wo as breakscapeText,Ao as canonicalize,So as complete,we as convert,Fo as convertWithDetails,jo as countBits,Eo as diagnostics,Tn as diff,Do as diffBits,Po as hover,Mo as info,ks as init,vs as initSync,vn as legacy,To as objectsToBitmark,ho as patchEntry,No as register,Bo as resolve,Ro as semanticTokens,Lo as splitBits,Co as transform,Is as transformParallel,Jo as unbreakscapeText,nt as variant,hs as version};//# sourceMappingURL=bitmark-parser.min.js.map
|
|
6
|
+
`),r.outputFile,r.fileOptions)}let m=l==="ast"?"json":l,w=s.convert(g,"html",m,"optimized",f,x,b,false,false,"","");if(l==="bitmark"||l==="text")return this.deliver(w,r.outputFile,r.fileOptions);if(l==="json")return r.outputFile?this.deliver(w,r.outputFile,r.fileOptions):f||o.stringify?w:JSON.parse(w);let y=bt(JSON.parse(w));return r.outputFile?this.deliver(JSON.stringify(y),r.outputFile,r.fileOptions):y}createAst(t,n){let r=Object.assign({},n),o=G(),{source:a,isBitmark:s}=this.resolveInput(t,r.inputFormat),i=o.convert(a,s?"bitmark":"json","json","optimized",false,2,1,true,false,"","");return bt(JSON.parse(i))}breakscapeText(t,n){if(!t)return t;let r=Object.assign({},n);this.checkBrowserFileWrite(r.outputFile);let o=G(),a=this.maybeReadFile(t,r.inputFormat),s=o.breakscape_text(a,Kt(r.textFormat),r.textLocation??"body");return this.deliver(s,r.outputFile,r.fileOptions)}unbreakscapeText(t,n){if(!t)return t;let r=Object.assign({},n);this.checkBrowserFileWrite(r.outputFile);let o=G(),a=this.maybeReadFile(t,r.inputFormat),s=o.unbreakscape_text(a,Kt(r.textFormat),r.textLocation??"body");return this.deliver(s,r.outputFile,r.fileOptions)}convertText(t,n){let r=Object.assign({},n),o=Object.assign({},r.jsonOptions);this.checkBrowserFileWrite(r.outputFile);let a=G(),s=r.textFormat===void 0||Kt(r.textFormat)==="bitmark++",i=r.textLocation??"body",d,u;if(typeof t=="string"?(d=this.maybeReadFile(t,r.inputFormat),u=this.parseTextAstString(d)):(d=JSON.stringify(t),u=Array.isArray(t)?t:void 0),u!==void 0){let b=s?a.convert_text(JSON.stringify(u),"astToText","bitmark++",i):a.convert_text(JSON.stringify(u),"astToPlainText","plainText",i);return this.deliver(b,r.outputFile,r.fileOptions)}let g=a.convert_text(d,"textToAst",s?"bitmark++":"plainText","body"),{pretty:l,indent:f}=gt(o.prettify),x=l?a.prettify(g,f):g;return r.outputFile?this.deliver(x,r.outputFile,r.fileOptions):l?x:JSON.parse(g)}textAstToPlainText(t,n){return G().convert_text(typeof t=="string"?t:JSON.stringify(t),"astToPlainText","bitmark++","body")}extractPlainText(t,n){let r=n?.inputFormat,o=G();if(r==="plainText")return typeof t=="string"?String(t):"";if(r==="bitmarkText"){let d=o.convert_text(String(t),"textToAst","bitmark++","body");return o.convert_text(d,"astToPlainText","bitmark++","body")}if(typeof t=="string"&&this.parseTextAstString(t)===void 0&&!o.is_bitmark(t)&&!(()=>{try{return JSON.parse(t),!0}catch{return false}})())return this.extractPlainText(t,{inputFormat:"bitmarkText"});let{source:a,isBitmark:s}=this.resolveInput(t,void 0);return o.convert(a,s?"bitmark":"json","text","optimized",false,2,1,false,false,"","")}parseTextAstString(t){let n=t.trim();if(n.startsWith("["))try{let r=JSON.parse(n);if(Array.isArray(r)&&r.every(o=>o!==null&&typeof o=="object"&&"type"in o))return r}catch{}}resolveInput(t,n){if(typeof t!="string"){let a=this.jsonEntries(t);return {source:JSON.stringify(a?a.map(s=>this.toWrapperEntry(s)):t),isBitmark:false}}let r=this.maybeReadFile(t,n);if(G().is_bitmark(r))return {source:r,isBitmark:true};try{let a=JSON.parse(r),s=this.jsonEntries(a);if(s)return {source:JSON.stringify(s.map(i=>this.toWrapperEntry(i))),isBitmark:!1}}catch{return {source:r,isBitmark:true}}return {source:r,isBitmark:false}}jsonEntries(t){if(Array.isArray(t))return t;if(t!==null&&typeof t=="object"){let n=t;if(Array.isArray(n.bits))return n.bits;if("bit"in n)return [n];if(typeof n.type=="string")return [{bit:n}]}}toWrapperEntry(t){if(t!==null&&typeof t=="object"&&"bit"in t)return t;let n={bit:t},r=t?.[fe];return r!==void 0&&(n.parser=r),n}maybeReadFile(t,n){if(n==="string")return t;return t;}checkBrowserFileWrite(t){if(t&&true)throw new Error("Cannot write to file in browser environment")}deliver(t,n,r){if(!n)return t;throw new Error("Cannot write to file in browser environment");}};function be(e){let t=[],n=e.toLowerCase(),r=0;for(;;){let o=n.indexOf("<table",r);if(o===-1)break;let a=0,s=o,i=-1;for(;s<e.length;){let d=n.indexOf("<table",s),u=n.indexOf("</table",s);if(u===-1)break;if(d!==-1&&d<u)a++,s=d+6;else {a--;let g=n.indexOf(">",u);if(s=g===-1?e.length:g+1,a===0){i=s;break}}}if(i===-1)break;t.push(e.slice(o,i)),r=i;}return t}function Ze(e){let t=G().convert_text(e,"textToAst","bitmark++","body");return JSON.parse(t)}var $={imageResource:{type:"image",key:"image",valueField:"src"},imageLinkResource:{type:"image-link",key:"imageLink",valueField:"url"},audioResource:{type:"audio",key:"audio",valueField:"src"},audioEmbedResource:{type:"audio-embed",key:"audioEmbed",valueField:"src"},audioLinkResource:{type:"audio-link",key:"audioLink",valueField:"url"},videoResource:{type:"video",key:"video",valueField:"src"},videoEmbedResource:{type:"video-embed",key:"videoEmbed",valueField:"url"},videoLinkResource:{type:"video-link",key:"videoLink",valueField:"url"},stillImageFilmEmbedResource:{type:"still-image-film-embed",key:"stillImageFilmEmbed",valueField:"url"},stillImageFilmLinkResource:{type:"still-image-film-link",key:"stillImageFilmLink",valueField:"url"},articleResource:{type:"article",key:"article",valueField:"body"},documentResource:{type:"document",key:"document",valueField:"url"},documentEmbedResource:{type:"document-embed",key:"documentEmbed",valueField:"url"},documentLinkResource:{type:"document-link",key:"documentLink",valueField:"url"},documentDownloadResource:{type:"document-download",key:"documentDownload",valueField:"url"},appLinkResource:{type:"app-link",key:"appLink",valueField:"url"},websiteLinkResource:{type:"website-link",key:"websiteLink",valueField:"url"}};function z(e){return (t,n,r)=>{if(!n)return;let{value:o,...a}=n,s={[e.valueField]:o??""};for(let[i,d]of Object.entries(a))d!==void 0&&(s[i]=d);return {type:e.type,[e.key]:s}}}var tn=Object.fromEntries(Object.values($).map(e=>[e.type,e])),Xt=class{constructor(){M(this,"imageResource",z($.imageResource));M(this,"imageLinkResource",z($.imageLinkResource));M(this,"audioResource",z($.audioResource));M(this,"audioEmbedResource",z($.audioEmbedResource));M(this,"audioLinkResource",z($.audioLinkResource));M(this,"videoResource",z($.videoResource));M(this,"videoEmbedResource",z($.videoEmbedResource));M(this,"videoLinkResource",z($.videoLinkResource));M(this,"stillImageFilmEmbedResource",z($.stillImageFilmEmbedResource));M(this,"stillImageFilmLinkResource",z($.stillImageFilmLinkResource));M(this,"articleResource",z($.articleResource));M(this,"documentResource",z($.documentResource));M(this,"documentEmbedResource",z($.documentEmbedResource));M(this,"documentLinkResource",z($.documentLinkResource));M(this,"documentDownloadResource",z($.documentDownloadResource));M(this,"appLinkResource",z($.appLinkResource));M(this,"websiteLinkResource",z($.websiteLinkResource));}resourceFromResourceJson(t,n){if(!n)return;let r=!Array.isArray(n),o=r?[n]:n,a=[];for(let s of o){let i=tn[s.type];if(!i)continue;let d=s[i.key]??{},{[i.valueField]:u,...g}=d,l=z(i)(void 0,{value:u,...g});l&&a.push(l);}if(a.length!==0)return r?a[0]:a}resourceFromResourceDataJson(t,n,r){if(!r)return;let o=tn[n];if(!o)return;let a=typeof r=="string"?r:void 0,s=typeof r=="object"?r:{},{url:i,src:d,body:u,...g}=s,l=i??d??u??a;return z(o)(t,{value:l,...g})}};var co={string:"string",file:"file"},uo={bitmark:"bitmark",json:"json",ast:"ast",text:"text"},go={bitmark:"bitmark",bitmarkText:"bitmarkText",plainText:"plainText",html:"html"},lo={v2:2,v3:3},fo={v1:1,v2:2},bo={peggy:"peggy"},mo={list:"list",deprecated:"deprecated",all:"all",bit:"bit"},wo={text:"text",json:"json",pojo:"pojo"},xo={plainText:"text",latex:"latex",json:"json",xml:"xml",bitmarkPlusPlus:"bitmark++"},yo={tag:"tag",body:"body",cardBody:"cardBody"};var en={bold:"bold",light:"light",italic:"italic",highlight:"highlight",highlightOrange:"highlightOrange",highlightYellow:"highlightYellow",highlightGreen:"highlightGreen",highlightBlue:"highlightBlue",highlightPurple:"highlightPurple",highlightPink:"highlightPink",highlightBrown:"highlightBrown",highlightBlack:"highlightBlack",highlightWhite:"highlightWhite",highlightGray:"highlightGray",strike:"strike",subscript:"subscript",superscript:"superscript",ins:"ins",del:"del",underline:"underline",doubleUnderline:"doubleUnderline",circle:"circle",languageEmRed:"languageEmRed",languageEmOrange:"languageEmOrange",languageEmYellow:"languageEmYellow",languageEmGreen:"languageEmGreen",languageEmBlue:"languageEmBlue",languageEmPurple:"languageEmPurple",languageEmPink:"languageEmPink",languageEmBrown:"languageEmBrown",languageEmBlack:"languageEmBlack",languageEmWhite:"languageEmWhite",languageEmGray:"languageEmGray",languageEm:"languageEm",userUnderline:"userUnderline",userDoubleUnderline:"userDoubleUnderline",userStrike:"userStrike",userCircle:"userCircle",userHighlight:"userHighlight",notranslate:"notranslate",link:"link",ref:"ref",xref:"xref",extref:"extref",footnote:"footnote",footnoteStar:"footnote*",symbol:"symbol",var:"var",code:"code",timer:"timer",duration:"duration",color:"color",colorPicker:"colorPicker",comment:"comment"},nn={text:"text",hardBreak:"hardBreak",paragraph:"paragraph",heading:"heading",section:"section",noBulletList:"noBulletList",bulletList:"bulletList",orderedList:"orderedList",orderedListRoman:"orderedListRoman",orderedListRomanLower:"orderedListRomanLower",letteredList:"letteredList",letteredListLower:"letteredListLower",taskList:"taskList",listItem:"listItem",taskItem:"taskItem",image:"image",imageInline:"imageInline",codeBlock:"codeBlock",latex:"latex",gap:"gap",select:"select",highlight:"highlight",mark:"mark"};function ko(e){return e.replace(/-([a-z0-9])/gu,(t,n)=>n.toUpperCase())}var me;function Bt(){if(!me){let e=G(),t=JSON.parse(e.info("all","json","",false,2,true,false,false,"")),n={_standard:"_standard"};for(let{name:r}of t)n[ko(r)]=r;me=n;}return me}var rn=new Proxy({},{get:(e,t)=>typeof t=="string"?Bt()[t]:void 0,has:(e,t)=>typeof t=="string"&&t in Bt(),ownKeys:()=>Reflect.ownKeys(Bt()),getOwnPropertyDescriptor:(e,t)=>typeof t=="string"&&t in Bt()?{value:Bt()[t],enumerable:true,configurable:true,writable:false}:void 0});function on(e,t){return new Proxy({},{get:(n,r)=>r===Symbol.toPrimitive||r==="toString"||r===Symbol.toStringTag?()=>`[unsupported ${e}]`:pt(e,t),has:()=>pt(e,t),ownKeys:()=>pt(e,t)})}var sn=on("NodeType","it names bpg's internal AST nodes; the legacy AST is bit JSON (see createAst)"),an=on("BoundingBoxIndex","bpg-internal bounding-box utility");function q(e,t){return class{constructor(){pt(e,t);}}}var vo="the legacy AST is bit JSON, not bpg's internal node model; walking it with bpg NodeType names would silently misbehave",Q="internal class of bpg's TS implementation",_n=q("Ast",vo),pn=q("BitmarkGenerator",Q),cn=q("BitmarkStringGenerator",Q),dn=q("BitmarkFileGenerator",Q),un=q("JsonGenerator",Q),gn=q("JsonStringGenerator",Q),ln=q("JsonFileGenerator",Q),fn=q("HtmlTableGenerator",Q),bn=q("HtmlTableParser",Q),mn=q("BitmarkParser",Q),wn=q("JsonParser",Q),xn=q("StringWriter",Q),yn=q("FileWriter",Q),kn=q("StreamWriter",Q);var hn={Error:1,Warning:2,Information:3,Hint:4},In={Class:7,Property:10,Value:12,Keyword:14,Snippet:15,EnumMember:20,TypeParameter:25},On={Deprecated:1};function ho(e,t,n){return n===void 0?{path:e,op:t}:{path:e,op:t,value:n}}var Io="all";function Oo(e,t={}){let n=U().convert(e,"bitmark","json",t.mode??"optimized",false,2,1,t.includeUnknownProperties??false,false,"","");return JSON.parse(n)}function To(e,t={}){let n=e.map(o=>o!==null&&typeof o=="object"&&"bit"in o&&typeof o.bit=="object"?o:{bit:o});return U().convert(JSON.stringify(n),"json","bitmark",t.mode??"optimized",false,2,1,false,false,"","")}function we(e,t={}){return U().convert(e,t.inputFormat??"auto",t.outputFormat??"auto",t.mode??"optimized",t.pretty??false,t.indent??2,t.spacesAroundValues??1,t.includeUnknownProperties??false,t.mappingReport??false,t.positionEncoding??"",t.tokensLayout??"")}function Fo(e,t={}){let n=U().convert_with_details(e,t.inputFormat??"auto",t.outputFormat??"auto",t.mode??"optimized",t.pretty??false,t.indent??2,t.spacesAroundValues??1,t.includeUnknownProperties??false,t.mappingReport??false,t.positionEncoding??"",t.tokensLayout??"",t.bitSpans??false);try{let r={output:n.take_data()},o=n.bit_spans();if(o!==void 0){let a=new Array(o.length/5);for(let s=0,i=0;i<o.length;s++,i+=5)a[s]={index:o[i],inputStart:o[i+1],inputEnd:o[i+2],outputStart:o[i+3],outputEnd:o[i+4]};r.bitSpans={positionEncoding:n.bit_spans_encoding(),spans:a};}return r}finally{n.free();}}function Eo(e,t={}){return JSON.parse(we(e,{inputFormat:"bitmark",outputFormat:"semantic-tokens",positionEncoding:t.positionEncoding,tokensLayout:t.tokensLayout}))}function Ro(e,t={}){return JSON.parse(we(e,{inputFormat:"bitmark",outputFormat:"diagnostics",positionEncoding:t.positionEncoding}))}function So(e,t,n={}){let r=U();if(typeof r.complete!="function")throw new at("complete",nt());return JSON.parse(r.complete(e,t.line,t.character,n.positionEncoding??"",n.includeDeprecated??false,n.triggerCharacter??""))}function Bo(e,t,n,r={}){let o=U();if(typeof o.resolve!="function")throw new at("resolve",nt());return JSON.parse(o.resolve(e,t.line,t.character,r.positionEncoding??"",r.includeDeprecated??false,n.label,n.kind))??n}function Po(e,t,n={}){let r=U();if(typeof r.hover!="function")throw new at("hover",nt());return JSON.parse(r.hover(e,t.line,t.character,n.positionEncoding??""))}function Ao(e,t={}){return U().canonicalize(e,t.inputFormat??"auto",t.mode??"optimized",t.pretty??false,t.indent??2,t.spacesAroundValues??1)}function jo(e){return Number.parseInt(U().count_bits(e),10)}function Lo(e,t={}){return JSON.parse(U().split_bits(e,t.positionEncoding??""))}function Co(e,t={}){let n=U();if(t.preHook||t.postHook)return He(n,e,t);let r=t.patch===void 0?"":typeof t.patch=="string"?t.patch:JSON.stringify(t.patch),{data:o,diagnostics:a}=JSON.parse(n.transform(e,t.inputFormat??"auto",t.outputFormat??"json",t.mode??"optimized",r,t.pretty??false,t.indent??2,t.spacesAroundValues??1));if(a.length>0)throw new st(a);return o}function Tn(e,t,n={}){let r=U();if(typeof r.diff!="function")throw new at("diff",nt());return r.diff(e,t,n.inputFormat??"auto",n.outputFormat??"bitmark",n.context??3,n.locate??false,n.similarity??.6,n.bboxTolerance??8,n.spacesAroundValues??0)}function Do(e,t,n={}){return JSON.parse(Tn(e,t,{...n,outputFormat:"json"}))}function Wo(e,t={}){let n=t.format??"bitmark++",r=t.location??"body",o=t.subLocation??"text";return U().breakscape_text(e,n,r,o)}function Jo(e,t={}){let n=t.format??"bitmark++",r=t.location??"body",o=t.subLocation??"text";return U().unbreakscape_text(e,n,r,o)}function Mo(e={}){let t=e.infoType??"list",n=e.format??"text",r=e.bit??"",o=e.pretty??false,a=e.indent??2,s=e.includeDeprecated??false,i=e.onlyDeprecated??false,d=e.full??false,u=typeof e.language=="string"?e.language:e.language?.join(",")??"",g=U();if(n!=="json"&&typeof g.info_text_supported!="function")throw new at('info (format: "text")',nt());return g.info(t,n,r,o,a,s,i,d,u)}function No(e){try{U().register(e.type,e.data);}catch(t){throw new lt(t instanceof Error?t.message:String(t))}Ue(e.type,e.data);}var Vo="./wasm/",Fn={full:{init:te,initSync:Zt,ns:ee,wasmFile:"bitmark_wasm_bg.wasm"},"browser-full":{init:re,initSync:ne,ns:oe,wasmFile:"bitmark_browser_full_wasm_bg.wasm"},"bitmark-json":{init:se,initSync:ie,ns:ae,wasmFile:"bitmark_json_wasm_bg.wasm"}};ze(()=>U());function xe(e){return e===void 0?_e:"full"}function Uo(e){if(e===null||typeof e!="object")return false;if("feature"in e||"module_or_path"in e)return true;let t=Object.getPrototypeOf(e);return (t===Object.prototype||t===null)&&Object.keys(e).length===0}function Ho(e){if(Uo(e))return {feature:e.feature??xe(e.module_or_path),module_or_path:e.module_or_path};let t=e??void 0;return {feature:xe(t),module_or_path:t}}var ye=0,Qt,_t;async function ks(e){let{feature:t,module_or_path:n}=Ho(e);if(n===void 0){if(!_t&&nt()===t)return Qt;if(_t?.feature===t)return _t.promise}let r=++ye,o=Fn[t],a=n??new URL(`${Vo}${o.wasmFile}?v=${St.version}`,import.meta.url),s=(async()=>{try{let i=await o.init({module_or_path:a});r===ye&&(pe(t,o.ns),Qt=i);}finally{_t?.seq===r&&(_t=void 0);}for(;_t;)await _t.promise.catch(()=>{});return Qt})();return _t={feature:t,seq:r,promise:s},s}function vs(e,t={}){let n=t.feature??xe(e),r=Fn[n],o=r.initSync({module:e});return ++ye,_t=void 0,pe(n,r.ns),Qt=o,o}function hs(){return St.version}function Is(e,t={}){let n=U(),r=nt()??_e;return Ge(n,e,t,(o,a)=>Ke(o,a,r))}export{Io as ALL_LANGUAGES,In as CompletionItemKind,On as CompletionItemTag,hn as DiagnosticSeverity,Ut as NotInitializedError,st as PatchError,lt as RegisterError,at as UnsupportedFeatureError,Oo as bitmarkToObjects,Wo as breakscapeText,Ao as canonicalize,So as complete,we as convert,Fo as convertWithDetails,jo as countBits,Ro as diagnostics,Tn as diff,Do as diffBits,Po as hover,Mo as info,ks as init,vs as initSync,vn as legacy,To as objectsToBitmark,ho as patchEntry,No as register,Bo as resolve,Eo as semanticTokens,Lo as splitBits,Co as transform,Is as transformParallel,Jo as unbreakscapeText,nt as variant,hs as version};//# sourceMappingURL=bitmark-parser.min.js.map
|
|
7
7
|
//# sourceMappingURL=bitmark-parser.min.js.map
|