@gmb/bitmark-parser 7.1.0 → 7.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- var ge=Object.defineProperty;var fn=(t,e,r)=>e in t?ge(t,e,{enumerable:true,configurable:true,writable:true,value:r}):t[e]=r;var Rt=(t,e)=>{for(var r in e)ge(t,r,{get:e[r],enumerable:true});};var J=(t,e,r)=>fn(t,typeof e!="symbol"?e+"":e,r);var $t={};Rt($t,{breakscape_text:()=>xn,canonicalize:()=>An,complete:()=>Rn,convert:()=>Pn,convert_text:()=>In,count_bits:()=>jn,default:()=>Kt,diff:()=>Fn,hover:()=>Sn,info:()=>wn,info_text_supported:()=>kn,initSync:()=>zt,is_bitmark:()=>Cn,prettify:()=>Dn,register:()=>Bn,resolve:()=>En,resolve_patch_document:()=>On,split_bits:()=>Ln,split_json_bits:()=>Wn,transform:()=>Tn,unbreakscape_text:()=>yn});var p,fe=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:true,fatal:true}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&fe.decode();var wt=null;function Et(){return (wt===null||wt.byteLength===0)&&(wt=new Uint8Array(p.memory.buffer)),wt}function N(t,e){return t=t>>>0,fe.decode(Et().subarray(t,t+e))}var nt=new Array(128).fill(void 0);nt.push(void 0,null,true,false);var kt=nt.length;function mn(t){kt===nt.length&&nt.push(nt.length+1);let e=kt;return kt=nt[e],nt[e]=t,e}var O=0,St=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},bn=typeof St.encodeInto=="function"?function(t,e){return St.encodeInto(t,e)}:function(t,e){let r=St.encode(t);return e.set(r),{read:t.length,written:r.length}};function E(t,e,r){if(r===void 0){let i=St.encode(t),c=e(i.length,1)>>>0;return Et().subarray(c,c+i.length).set(i),O=i.length,c}let n=t.length,o=e(n,1)>>>0,a=Et(),s=0;for(;s<n;s++){let i=t.charCodeAt(s);if(i>127)break;a[o+s]=i;}if(s!==n){s!==0&&(t=t.slice(s)),o=r(o,n,n=s+t.length*3,1)>>>0;let i=Et().subarray(o+s,o+n),c=bn(t,i);s+=c.written,o=r(o,n,s,1)>>>0;}return O=s,o}var pt=null;function h(){return (pt===null||pt.buffer.detached===true||pt.buffer.detached===void 0&&pt.buffer!==p.memory.buffer)&&(pt=new DataView(p.memory.buffer)),pt}function xn(t,e,r){let n,o;try{let i=p.__wbindgen_add_to_stack_pointer(-16),c=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),d=O,g=E(e,p.__wbindgen_export_0,p.__wbindgen_export_1),l=O,f=E(r,p.__wbindgen_export_0,p.__wbindgen_export_1),m=O;p.breakscape_text(i,c,d,g,l,f,m);var a=h().getInt32(i+0,!0),s=h().getInt32(i+4,!0);return n=a,o=s,N(a,s)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(n,o,1);}}function yn(t,e,r){let n,o;try{let i=p.__wbindgen_add_to_stack_pointer(-16),c=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),d=O,g=E(e,p.__wbindgen_export_0,p.__wbindgen_export_1),l=O,f=E(r,p.__wbindgen_export_0,p.__wbindgen_export_1),m=O;p.unbreakscape_text(i,c,d,g,l,f,m);var a=h().getInt32(i+0,!0),s=h().getInt32(i+4,!0);return n=a,o=s,N(a,s)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(n,o,1);}}function wn(t,e,r,n,o,a,s,i,c){let d,g;try{let m=p.__wbindgen_add_to_stack_pointer(-16),b=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),y=O,x=E(e,p.__wbindgen_export_0,p.__wbindgen_export_1),w=O,k=E(r,p.__wbindgen_export_0,p.__wbindgen_export_1),v=O,T=E(c,p.__wbindgen_export_0,p.__wbindgen_export_1),A=O;p.info(m,b,y,x,w,k,v,n,o,a,s,i,T,A);var l=h().getInt32(m+0,!0),f=h().getInt32(m+4,!0);return d=l,g=f,N(l,f)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(d,g,1);}}function kn(){return p.info_text_supported()!==0}function vn(t){return nt[t]}function hn(t){t<132||(nt[t]=kt,kt=t);}function Y(t){let e=vn(t);return hn(t),e}function In(t,e,r,n){let o,a;try{let f=p.__wbindgen_add_to_stack_pointer(-16),m=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),b=O,y=E(e,p.__wbindgen_export_0,p.__wbindgen_export_1),x=O,w=E(r,p.__wbindgen_export_0,p.__wbindgen_export_1),k=O,v=E(n,p.__wbindgen_export_0,p.__wbindgen_export_1),T=O;p.convert_text(f,m,b,y,x,w,k,v,T);var s=h().getInt32(f+0,!0),i=h().getInt32(f+4,!0),c=h().getInt32(f+8,!0),d=h().getInt32(f+12,!0),g=s,l=i;if(d)throw g=0,l=0,Y(c);return o=g,a=l,N(g,l)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(o,a,1);}}function Tn(t,e,r,n,o,a,s,i){let c,d;try{let x=p.__wbindgen_add_to_stack_pointer(-16),w=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),k=O,v=E(e,p.__wbindgen_export_0,p.__wbindgen_export_1),T=O,A=E(r,p.__wbindgen_export_0,p.__wbindgen_export_1),U=O,G=E(n,p.__wbindgen_export_0,p.__wbindgen_export_1),z=O,K=E(o,p.__wbindgen_export_0,p.__wbindgen_export_1),Q=O;p.transform(x,w,k,v,T,A,U,G,z,K,Q,a,s,i);var g=h().getInt32(x+0,!0),l=h().getInt32(x+4,!0),f=h().getInt32(x+8,!0),m=h().getInt32(x+12,!0),b=g,y=l;if(m)throw b=0,y=0,Y(f);return c=b,d=y,N(b,y)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(c,d,1);}}function On(t,e,r){let n,o;try{let l=p.__wbindgen_add_to_stack_pointer(-16),f=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),m=O,b=E(e,p.__wbindgen_export_0,p.__wbindgen_export_1),y=O,x=E(r,p.__wbindgen_export_0,p.__wbindgen_export_1),w=O;p.resolve_patch_document(l,f,m,b,y,x,w);var a=h().getInt32(l+0,!0),s=h().getInt32(l+4,!0),i=h().getInt32(l+8,!0),c=h().getInt32(l+12,!0),d=a,g=s;if(c)throw d=0,g=0,Y(i);return n=d,o=g,N(d,g)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(n,o,1);}}function Fn(t,e,r,n,o,a,s,i,c){let d,g;try{let w=p.__wbindgen_add_to_stack_pointer(-16),k=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),v=O,T=E(e,p.__wbindgen_export_0,p.__wbindgen_export_1),A=O,U=E(r,p.__wbindgen_export_0,p.__wbindgen_export_1),G=O,z=E(n,p.__wbindgen_export_0,p.__wbindgen_export_1),K=O;p.diff(w,k,v,T,A,U,G,z,K,o,a,s,i,c);var l=h().getInt32(w+0,!0),f=h().getInt32(w+4,!0),m=h().getInt32(w+8,!0),b=h().getInt32(w+12,!0),y=l,x=f;if(b)throw y=0,x=0,Y(m);return d=y,g=x,N(y,x)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(d,g,1);}}function Rn(t,e,r,n,o,a){let s,i;try{let b=p.__wbindgen_add_to_stack_pointer(-16),y=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),x=O,w=E(n,p.__wbindgen_export_0,p.__wbindgen_export_1),k=O,v=E(a,p.__wbindgen_export_0,p.__wbindgen_export_1),T=O;p.complete(b,y,x,e,r,w,k,o,v,T);var c=h().getInt32(b+0,!0),d=h().getInt32(b+4,!0),g=h().getInt32(b+8,!0),l=h().getInt32(b+12,!0),f=c,m=d;if(l)throw f=0,m=0,Y(g);return s=f,i=m,N(f,m)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(s,i,1);}}function En(t,e,r,n,o,a,s){let i,c;try{let y=p.__wbindgen_add_to_stack_pointer(-16),x=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),w=O,k=E(n,p.__wbindgen_export_0,p.__wbindgen_export_1),v=O,T=E(a,p.__wbindgen_export_0,p.__wbindgen_export_1),A=O;p.resolve(y,x,w,e,r,k,v,o,T,A,s);var d=h().getInt32(y+0,!0),g=h().getInt32(y+4,!0),l=h().getInt32(y+8,!0),f=h().getInt32(y+12,!0),m=d,b=g;if(f)throw m=0,b=0,Y(l);return i=m,c=b,N(m,b)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(i,c,1);}}function Sn(t,e,r,n){let o,a;try{let f=p.__wbindgen_add_to_stack_pointer(-16),m=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),b=O,y=E(n,p.__wbindgen_export_0,p.__wbindgen_export_1),x=O;p.hover(f,m,b,e,r,y,x);var s=h().getInt32(f+0,!0),i=h().getInt32(f+4,!0),c=h().getInt32(f+8,!0),d=h().getInt32(f+12,!0),g=s,l=i;if(d)throw g=0,l=0,Y(c);return o=g,a=l,N(g,l)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(o,a,1);}}function Bn(t,e){try{let o=p.__wbindgen_add_to_stack_pointer(-16),a=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),s=O,i=E(e,p.__wbindgen_export_0,p.__wbindgen_export_1),c=O;p.register(o,a,s,i,c);var r=h().getInt32(o+0,!0),n=h().getInt32(o+4,!0);if(n)throw Y(r)}finally{p.__wbindgen_add_to_stack_pointer(16);}}function Pn(t,e,r,n,o,a,s,i,c,d,g){let l,f;try{let v=p.__wbindgen_add_to_stack_pointer(-16),T=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),A=O,U=E(e,p.__wbindgen_export_0,p.__wbindgen_export_1),G=O,z=E(r,p.__wbindgen_export_0,p.__wbindgen_export_1),K=O,Q=E(n,p.__wbindgen_export_0,p.__wbindgen_export_1),ft=O,mt=E(d,p.__wbindgen_export_0,p.__wbindgen_export_1),bt=O,xt=E(g,p.__wbindgen_export_0,p.__wbindgen_export_1),yt=O;p.convert(v,T,A,U,G,z,K,Q,ft,o,a,s,i,c,mt,bt,xt,yt);var m=h().getInt32(v+0,!0),b=h().getInt32(v+4,!0),y=h().getInt32(v+8,!0),x=h().getInt32(v+12,!0),w=m,k=b;if(x)throw w=0,k=0,Y(y);return l=w,f=k,N(w,k)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(l,f,1);}}function An(t,e,r,n,o,a){let s,i;try{let b=p.__wbindgen_add_to_stack_pointer(-16),y=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),x=O,w=E(e,p.__wbindgen_export_0,p.__wbindgen_export_1),k=O,v=E(r,p.__wbindgen_export_0,p.__wbindgen_export_1),T=O;p.canonicalize(b,y,x,w,k,v,T,n,o,a);var c=h().getInt32(b+0,!0),d=h().getInt32(b+4,!0),g=h().getInt32(b+8,!0),l=h().getInt32(b+12,!0),f=c,m=d;if(l)throw f=0,m=0,Y(g);return s=f,i=m,N(f,m)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(s,i,1);}}function jn(t){let e,r;try{let d=p.__wbindgen_add_to_stack_pointer(-16),g=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),l=O;p.count_bits(d,g,l);var n=h().getInt32(d+0,!0),o=h().getInt32(d+4,!0),a=h().getInt32(d+8,!0),s=h().getInt32(d+12,!0),i=n,c=o;if(s)throw i=0,c=0,Y(a);return e=i,r=c,N(i,c)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(e,r,1);}}function Ln(t){let e,r;try{let a=p.__wbindgen_add_to_stack_pointer(-16),s=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),i=O;p.split_bits(a,s,i);var n=h().getInt32(a+0,!0),o=h().getInt32(a+4,!0);return e=n,r=o,N(n,o)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(e,r,1);}}function Cn(t){let e=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),r=O;return p.is_bitmark(e,r)!==0}function Wn(t){let e,r;try{let d=p.__wbindgen_add_to_stack_pointer(-16),g=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),l=O;p.split_json_bits(d,g,l);var n=h().getInt32(d+0,!0),o=h().getInt32(d+4,!0),a=h().getInt32(d+8,!0),s=h().getInt32(d+12,!0),i=n,c=o;if(s)throw i=0,c=0,Y(a);return e=i,r=c,N(i,c)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(e,r,1);}}function Dn(t,e){let r,n;try{let s=p.__wbindgen_add_to_stack_pointer(-16),i=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),c=O;p.prettify(s,i,c,e);var o=h().getInt32(s+0,!0),a=h().getInt32(s+4,!0);return r=o,n=a,N(o,a)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(r,n,1);}}async function Jn(t,e){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(t,e)}catch(n){if(t.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",n);else throw n}let r=await t.arrayBuffer();return await WebAssembly.instantiate(r,e)}else {let r=await WebAssembly.instantiate(t,e);return r instanceof WebAssembly.Instance?{instance:r,module:t}:r}}function me(){let t={};return t.wbg={},t.wbg.__wbindgen_error_new=function(e,r){let n=new Error(N(e,r));return mn(n)},t}function be(t,e){return p=t.exports,xe.__wbindgen_wasm_module=e,pt=null,wt=null,p}function zt(t){if(p!==void 0)return p;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module:t}=t:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let e=me();t instanceof WebAssembly.Module||(t=new WebAssembly.Module(t));let r=new WebAssembly.Instance(t,e);return be(r,t)}async function xe(t){if(p!==void 0)return p;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module_or_path:t}=t:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof t>"u"&&(t=new URL("bitmark_wasm_bg.wasm",import.meta.url));let e=me();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));let{instance:r,module:n}=await Jn(await t,e);return be(r,n)}var Kt=xe;var Xt={};Rt(Xt,{breakscape_text:()=>Vn,canonicalize:()=>rr,complete:()=>Qn,convert:()=>nr,convert_text:()=>$n,count_bits:()=>or,default:()=>Yt,diff:()=>Xn,hover:()=>tr,info:()=>Un,info_text_supported:()=>Gn,initSync:()=>qt,is_bitmark:()=>sr,prettify:()=>pr,register:()=>er,resolve:()=>Zn,resolve_patch_document:()=>Yn,split_bits:()=>ir,split_json_bits:()=>ar,transform:()=>qn,unbreakscape_text:()=>Hn});var _,ye=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:true,fatal:true}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&ye.decode();var vt=null;function Bt(){return (vt===null||vt.byteLength===0)&&(vt=new Uint8Array(_.memory.buffer)),vt}function V(t,e){return t=t>>>0,ye.decode(Bt().subarray(t,t+e))}var rt=new Array(128).fill(void 0);rt.push(void 0,null,true,false);var ht=rt.length;function Mn(t){ht===rt.length&&rt.push(rt.length+1);let e=ht;return ht=rt[e],rt[e]=t,e}var F=0,Pt=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},Nn=typeof Pt.encodeInto=="function"?function(t,e){return Pt.encodeInto(t,e)}:function(t,e){let r=Pt.encode(t);return e.set(r),{read:t.length,written:r.length}};function S(t,e,r){if(r===void 0){let i=Pt.encode(t),c=e(i.length,1)>>>0;return Bt().subarray(c,c+i.length).set(i),F=i.length,c}let n=t.length,o=e(n,1)>>>0,a=Bt(),s=0;for(;s<n;s++){let i=t.charCodeAt(s);if(i>127)break;a[o+s]=i;}if(s!==n){s!==0&&(t=t.slice(s)),o=r(o,n,n=s+t.length*3,1)>>>0;let i=Bt().subarray(o+s,o+n),c=Nn(t,i);s+=c.written,o=r(o,n,s,1)>>>0;}return F=s,o}var _t=null;function I(){return (_t===null||_t.buffer.detached===true||_t.buffer.detached===void 0&&_t.buffer!==_.memory.buffer)&&(_t=new DataView(_.memory.buffer)),_t}function Vn(t,e,r){let n,o;try{let i=_.__wbindgen_add_to_stack_pointer(-16),c=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),d=F,g=S(e,_.__wbindgen_export_0,_.__wbindgen_export_1),l=F,f=S(r,_.__wbindgen_export_0,_.__wbindgen_export_1),m=F;_.breakscape_text(i,c,d,g,l,f,m);var a=I().getInt32(i+0,!0),s=I().getInt32(i+4,!0);return n=a,o=s,V(a,s)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(n,o,1);}}function Hn(t,e,r){let n,o;try{let i=_.__wbindgen_add_to_stack_pointer(-16),c=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),d=F,g=S(e,_.__wbindgen_export_0,_.__wbindgen_export_1),l=F,f=S(r,_.__wbindgen_export_0,_.__wbindgen_export_1),m=F;_.unbreakscape_text(i,c,d,g,l,f,m);var a=I().getInt32(i+0,!0),s=I().getInt32(i+4,!0);return n=a,o=s,V(a,s)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(n,o,1);}}function Un(t,e,r,n,o,a,s,i,c){let d,g;try{let m=_.__wbindgen_add_to_stack_pointer(-16),b=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),y=F,x=S(e,_.__wbindgen_export_0,_.__wbindgen_export_1),w=F,k=S(r,_.__wbindgen_export_0,_.__wbindgen_export_1),v=F,T=S(c,_.__wbindgen_export_0,_.__wbindgen_export_1),A=F;_.info(m,b,y,x,w,k,v,n,o,a,s,i,T,A);var l=I().getInt32(m+0,!0),f=I().getInt32(m+4,!0);return d=l,g=f,V(l,f)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(d,g,1);}}function Gn(){return _.info_text_supported()!==0}function zn(t){return rt[t]}function Kn(t){t<132||(rt[t]=ht,ht=t);}function X(t){let e=zn(t);return Kn(t),e}function $n(t,e,r,n){let o,a;try{let f=_.__wbindgen_add_to_stack_pointer(-16),m=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),b=F,y=S(e,_.__wbindgen_export_0,_.__wbindgen_export_1),x=F,w=S(r,_.__wbindgen_export_0,_.__wbindgen_export_1),k=F,v=S(n,_.__wbindgen_export_0,_.__wbindgen_export_1),T=F;_.convert_text(f,m,b,y,x,w,k,v,T);var s=I().getInt32(f+0,!0),i=I().getInt32(f+4,!0),c=I().getInt32(f+8,!0),d=I().getInt32(f+12,!0),g=s,l=i;if(d)throw g=0,l=0,X(c);return o=g,a=l,V(g,l)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(o,a,1);}}function qn(t,e,r,n,o,a,s,i){let c,d;try{let x=_.__wbindgen_add_to_stack_pointer(-16),w=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),k=F,v=S(e,_.__wbindgen_export_0,_.__wbindgen_export_1),T=F,A=S(r,_.__wbindgen_export_0,_.__wbindgen_export_1),U=F,G=S(n,_.__wbindgen_export_0,_.__wbindgen_export_1),z=F,K=S(o,_.__wbindgen_export_0,_.__wbindgen_export_1),Q=F;_.transform(x,w,k,v,T,A,U,G,z,K,Q,a,s,i);var g=I().getInt32(x+0,!0),l=I().getInt32(x+4,!0),f=I().getInt32(x+8,!0),m=I().getInt32(x+12,!0),b=g,y=l;if(m)throw b=0,y=0,X(f);return c=b,d=y,V(b,y)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(c,d,1);}}function Yn(t,e,r){let n,o;try{let l=_.__wbindgen_add_to_stack_pointer(-16),f=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),m=F,b=S(e,_.__wbindgen_export_0,_.__wbindgen_export_1),y=F,x=S(r,_.__wbindgen_export_0,_.__wbindgen_export_1),w=F;_.resolve_patch_document(l,f,m,b,y,x,w);var a=I().getInt32(l+0,!0),s=I().getInt32(l+4,!0),i=I().getInt32(l+8,!0),c=I().getInt32(l+12,!0),d=a,g=s;if(c)throw d=0,g=0,X(i);return n=d,o=g,V(d,g)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(n,o,1);}}function Xn(t,e,r,n,o,a,s,i,c){let d,g;try{let w=_.__wbindgen_add_to_stack_pointer(-16),k=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),v=F,T=S(e,_.__wbindgen_export_0,_.__wbindgen_export_1),A=F,U=S(r,_.__wbindgen_export_0,_.__wbindgen_export_1),G=F,z=S(n,_.__wbindgen_export_0,_.__wbindgen_export_1),K=F;_.diff(w,k,v,T,A,U,G,z,K,o,a,s,i,c);var l=I().getInt32(w+0,!0),f=I().getInt32(w+4,!0),m=I().getInt32(w+8,!0),b=I().getInt32(w+12,!0),y=l,x=f;if(b)throw y=0,x=0,X(m);return d=y,g=x,V(y,x)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(d,g,1);}}function Qn(t,e,r,n,o,a){let s,i;try{let b=_.__wbindgen_add_to_stack_pointer(-16),y=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),x=F,w=S(n,_.__wbindgen_export_0,_.__wbindgen_export_1),k=F,v=S(a,_.__wbindgen_export_0,_.__wbindgen_export_1),T=F;_.complete(b,y,x,e,r,w,k,o,v,T);var c=I().getInt32(b+0,!0),d=I().getInt32(b+4,!0),g=I().getInt32(b+8,!0),l=I().getInt32(b+12,!0),f=c,m=d;if(l)throw f=0,m=0,X(g);return s=f,i=m,V(f,m)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(s,i,1);}}function Zn(t,e,r,n,o,a,s){let i,c;try{let y=_.__wbindgen_add_to_stack_pointer(-16),x=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),w=F,k=S(n,_.__wbindgen_export_0,_.__wbindgen_export_1),v=F,T=S(a,_.__wbindgen_export_0,_.__wbindgen_export_1),A=F;_.resolve(y,x,w,e,r,k,v,o,T,A,s);var d=I().getInt32(y+0,!0),g=I().getInt32(y+4,!0),l=I().getInt32(y+8,!0),f=I().getInt32(y+12,!0),m=d,b=g;if(f)throw m=0,b=0,X(l);return i=m,c=b,V(m,b)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(i,c,1);}}function tr(t,e,r,n){let o,a;try{let f=_.__wbindgen_add_to_stack_pointer(-16),m=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),b=F,y=S(n,_.__wbindgen_export_0,_.__wbindgen_export_1),x=F;_.hover(f,m,b,e,r,y,x);var s=I().getInt32(f+0,!0),i=I().getInt32(f+4,!0),c=I().getInt32(f+8,!0),d=I().getInt32(f+12,!0),g=s,l=i;if(d)throw g=0,l=0,X(c);return o=g,a=l,V(g,l)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(o,a,1);}}function er(t,e){try{let o=_.__wbindgen_add_to_stack_pointer(-16),a=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),s=F,i=S(e,_.__wbindgen_export_0,_.__wbindgen_export_1),c=F;_.register(o,a,s,i,c);var r=I().getInt32(o+0,!0),n=I().getInt32(o+4,!0);if(n)throw X(r)}finally{_.__wbindgen_add_to_stack_pointer(16);}}function nr(t,e,r,n,o,a,s,i,c,d,g){let l,f;try{let v=_.__wbindgen_add_to_stack_pointer(-16),T=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),A=F,U=S(e,_.__wbindgen_export_0,_.__wbindgen_export_1),G=F,z=S(r,_.__wbindgen_export_0,_.__wbindgen_export_1),K=F,Q=S(n,_.__wbindgen_export_0,_.__wbindgen_export_1),ft=F,mt=S(d,_.__wbindgen_export_0,_.__wbindgen_export_1),bt=F,xt=S(g,_.__wbindgen_export_0,_.__wbindgen_export_1),yt=F;_.convert(v,T,A,U,G,z,K,Q,ft,o,a,s,i,c,mt,bt,xt,yt);var m=I().getInt32(v+0,!0),b=I().getInt32(v+4,!0),y=I().getInt32(v+8,!0),x=I().getInt32(v+12,!0),w=m,k=b;if(x)throw w=0,k=0,X(y);return l=w,f=k,V(w,k)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(l,f,1);}}function rr(t,e,r,n,o,a){let s,i;try{let b=_.__wbindgen_add_to_stack_pointer(-16),y=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),x=F,w=S(e,_.__wbindgen_export_0,_.__wbindgen_export_1),k=F,v=S(r,_.__wbindgen_export_0,_.__wbindgen_export_1),T=F;_.canonicalize(b,y,x,w,k,v,T,n,o,a);var c=I().getInt32(b+0,!0),d=I().getInt32(b+4,!0),g=I().getInt32(b+8,!0),l=I().getInt32(b+12,!0),f=c,m=d;if(l)throw f=0,m=0,X(g);return s=f,i=m,V(f,m)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(s,i,1);}}function or(t){let e,r;try{let d=_.__wbindgen_add_to_stack_pointer(-16),g=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),l=F;_.count_bits(d,g,l);var n=I().getInt32(d+0,!0),o=I().getInt32(d+4,!0),a=I().getInt32(d+8,!0),s=I().getInt32(d+12,!0),i=n,c=o;if(s)throw i=0,c=0,X(a);return e=i,r=c,V(i,c)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(e,r,1);}}function ir(t){let e,r;try{let a=_.__wbindgen_add_to_stack_pointer(-16),s=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),i=F;_.split_bits(a,s,i);var n=I().getInt32(a+0,!0),o=I().getInt32(a+4,!0);return e=n,r=o,V(n,o)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(e,r,1);}}function sr(t){let e=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),r=F;return _.is_bitmark(e,r)!==0}function ar(t){let e,r;try{let d=_.__wbindgen_add_to_stack_pointer(-16),g=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),l=F;_.split_json_bits(d,g,l);var n=I().getInt32(d+0,!0),o=I().getInt32(d+4,!0),a=I().getInt32(d+8,!0),s=I().getInt32(d+12,!0),i=n,c=o;if(s)throw i=0,c=0,X(a);return e=i,r=c,V(i,c)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(e,r,1);}}function pr(t,e){let r,n;try{let s=_.__wbindgen_add_to_stack_pointer(-16),i=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),c=F;_.prettify(s,i,c,e);var o=I().getInt32(s+0,!0),a=I().getInt32(s+4,!0);return r=o,n=a,V(o,a)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(r,n,1);}}async function _r(t,e){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(t,e)}catch(n){if(t.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",n);else throw n}let r=await t.arrayBuffer();return await WebAssembly.instantiate(r,e)}else {let r=await WebAssembly.instantiate(t,e);return r instanceof WebAssembly.Instance?{instance:r,module:t}:r}}function we(){let t={};return t.wbg={},t.wbg.__wbindgen_error_new=function(e,r){let n=new Error(V(e,r));return Mn(n)},t}function ke(t,e){return _=t.exports,ve.__wbindgen_wasm_module=e,_t=null,vt=null,_}function qt(t){if(_!==void 0)return _;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module:t}=t:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let e=we();t instanceof WebAssembly.Module||(t=new WebAssembly.Module(t));let r=new WebAssembly.Instance(t,e);return ke(r,t)}async function ve(t){if(_!==void 0)return _;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module_or_path:t}=t:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof t>"u"&&(t=new URL("bitmark_browser_full_wasm_bg.wasm",import.meta.url));let e=we();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));let{instance:r,module:n}=await _r(await t,e);return ke(r,n)}var Yt=ve;var te={};Rt(te,{breakscape_text:()=>dr,canonicalize:()=>Ir,complete:()=>wr,convert:()=>hr,convert_text:()=>Sr,count_bits:()=>Tr,default:()=>Zt,hover:()=>vr,info:()=>gr,initSync:()=>Qt,is_bitmark:()=>Fr,prettify:()=>Er,register:()=>br,resolve:()=>kr,resolve_patch_document:()=>yr,split_bits:()=>Or,split_json_bits:()=>Rr,transform:()=>xr,unbreakscape_text:()=>lr});var u,he=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:true,fatal:true}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&he.decode();var It=null;function At(){return (It===null||It.byteLength===0)&&(It=new Uint8Array(u.memory.buffer)),It}function H(t,e){return t=t>>>0,he.decode(At().subarray(t,t+e))}var ot=new Array(128).fill(void 0);ot.push(void 0,null,true,false);var Tt=ot.length;function cr(t){Tt===ot.length&&ot.push(ot.length+1);let e=Tt;return Tt=ot[e],ot[e]=t,e}var B=0,jt=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},ur=typeof jt.encodeInto=="function"?function(t,e){return jt.encodeInto(t,e)}:function(t,e){let r=jt.encode(t);return e.set(r),{read:t.length,written:r.length}};function P(t,e,r){if(r===void 0){let i=jt.encode(t),c=e(i.length,1)>>>0;return At().subarray(c,c+i.length).set(i),B=i.length,c}let n=t.length,o=e(n,1)>>>0,a=At(),s=0;for(;s<n;s++){let i=t.charCodeAt(s);if(i>127)break;a[o+s]=i;}if(s!==n){s!==0&&(t=t.slice(s)),o=r(o,n,n=s+t.length*3,1)>>>0;let i=At().subarray(o+s,o+n),c=ur(t,i);s+=c.written,o=r(o,n,s,1)>>>0;}return B=s,o}var ct=null;function R(){return (ct===null||ct.buffer.detached===true||ct.buffer.detached===void 0&&ct.buffer!==u.memory.buffer)&&(ct=new DataView(u.memory.buffer)),ct}function dr(t,e,r){let n,o;try{let i=u.__wbindgen_add_to_stack_pointer(-16),c=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),d=B,g=P(e,u.__wbindgen_export_0,u.__wbindgen_export_1),l=B,f=P(r,u.__wbindgen_export_0,u.__wbindgen_export_1),m=B;u.breakscape_text(i,c,d,g,l,f,m);var a=R().getInt32(i+0,!0),s=R().getInt32(i+4,!0);return n=a,o=s,H(a,s)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(n,o,1);}}function lr(t,e,r){let n,o;try{let i=u.__wbindgen_add_to_stack_pointer(-16),c=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),d=B,g=P(e,u.__wbindgen_export_0,u.__wbindgen_export_1),l=B,f=P(r,u.__wbindgen_export_0,u.__wbindgen_export_1),m=B;u.unbreakscape_text(i,c,d,g,l,f,m);var a=R().getInt32(i+0,!0),s=R().getInt32(i+4,!0);return n=a,o=s,H(a,s)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(n,o,1);}}function gr(t,e,r,n,o,a,s,i,c){let d,g;try{let m=u.__wbindgen_add_to_stack_pointer(-16),b=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),y=B,x=P(e,u.__wbindgen_export_0,u.__wbindgen_export_1),w=B,k=P(r,u.__wbindgen_export_0,u.__wbindgen_export_1),v=B,T=P(c,u.__wbindgen_export_0,u.__wbindgen_export_1),A=B;u.info(m,b,y,x,w,k,v,n,o,a,s,i,T,A);var l=R().getInt32(m+0,!0),f=R().getInt32(m+4,!0);return d=l,g=f,H(l,f)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(d,g,1);}}function fr(t){return ot[t]}function mr(t){t<132||(ot[t]=Tt,Tt=t);}function Z(t){let e=fr(t);return mr(t),e}function br(t,e){try{let o=u.__wbindgen_add_to_stack_pointer(-16),a=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),s=B,i=P(e,u.__wbindgen_export_0,u.__wbindgen_export_1),c=B;u.register(o,a,s,i,c);var r=R().getInt32(o+0,!0),n=R().getInt32(o+4,!0);if(n)throw Z(r)}finally{u.__wbindgen_add_to_stack_pointer(16);}}function xr(t,e,r,n,o,a,s,i){let c,d;try{let x=u.__wbindgen_add_to_stack_pointer(-16),w=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),k=B,v=P(e,u.__wbindgen_export_0,u.__wbindgen_export_1),T=B,A=P(r,u.__wbindgen_export_0,u.__wbindgen_export_1),U=B,G=P(n,u.__wbindgen_export_0,u.__wbindgen_export_1),z=B,K=P(o,u.__wbindgen_export_0,u.__wbindgen_export_1),Q=B;u.transform(x,w,k,v,T,A,U,G,z,K,Q,a,s,i);var g=R().getInt32(x+0,!0),l=R().getInt32(x+4,!0),f=R().getInt32(x+8,!0),m=R().getInt32(x+12,!0),b=g,y=l;if(m)throw b=0,y=0,Z(f);return c=b,d=y,H(b,y)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(c,d,1);}}function yr(t,e,r){let n,o;try{let l=u.__wbindgen_add_to_stack_pointer(-16),f=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),m=B,b=P(e,u.__wbindgen_export_0,u.__wbindgen_export_1),y=B,x=P(r,u.__wbindgen_export_0,u.__wbindgen_export_1),w=B;u.resolve_patch_document(l,f,m,b,y,x,w);var a=R().getInt32(l+0,!0),s=R().getInt32(l+4,!0),i=R().getInt32(l+8,!0),c=R().getInt32(l+12,!0),d=a,g=s;if(c)throw d=0,g=0,Z(i);return n=d,o=g,H(d,g)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(n,o,1);}}function wr(t,e,r,n,o,a){let s,i;try{let b=u.__wbindgen_add_to_stack_pointer(-16),y=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),x=B,w=P(n,u.__wbindgen_export_0,u.__wbindgen_export_1),k=B,v=P(a,u.__wbindgen_export_0,u.__wbindgen_export_1),T=B;u.complete(b,y,x,e,r,w,k,o,v,T);var c=R().getInt32(b+0,!0),d=R().getInt32(b+4,!0),g=R().getInt32(b+8,!0),l=R().getInt32(b+12,!0),f=c,m=d;if(l)throw f=0,m=0,Z(g);return s=f,i=m,H(f,m)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(s,i,1);}}function kr(t,e,r,n,o,a,s){let i,c;try{let y=u.__wbindgen_add_to_stack_pointer(-16),x=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),w=B,k=P(n,u.__wbindgen_export_0,u.__wbindgen_export_1),v=B,T=P(a,u.__wbindgen_export_0,u.__wbindgen_export_1),A=B;u.resolve(y,x,w,e,r,k,v,o,T,A,s);var d=R().getInt32(y+0,!0),g=R().getInt32(y+4,!0),l=R().getInt32(y+8,!0),f=R().getInt32(y+12,!0),m=d,b=g;if(f)throw m=0,b=0,Z(l);return i=m,c=b,H(m,b)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(i,c,1);}}function vr(t,e,r,n){let o,a;try{let f=u.__wbindgen_add_to_stack_pointer(-16),m=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),b=B,y=P(n,u.__wbindgen_export_0,u.__wbindgen_export_1),x=B;u.hover(f,m,b,e,r,y,x);var s=R().getInt32(f+0,!0),i=R().getInt32(f+4,!0),c=R().getInt32(f+8,!0),d=R().getInt32(f+12,!0),g=s,l=i;if(d)throw g=0,l=0,Z(c);return o=g,a=l,H(g,l)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(o,a,1);}}function hr(t,e,r,n,o,a,s,i,c,d,g){let l,f;try{let v=u.__wbindgen_add_to_stack_pointer(-16),T=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),A=B,U=P(e,u.__wbindgen_export_0,u.__wbindgen_export_1),G=B,z=P(r,u.__wbindgen_export_0,u.__wbindgen_export_1),K=B,Q=P(n,u.__wbindgen_export_0,u.__wbindgen_export_1),ft=B,mt=P(d,u.__wbindgen_export_0,u.__wbindgen_export_1),bt=B,xt=P(g,u.__wbindgen_export_0,u.__wbindgen_export_1),yt=B;u.convert(v,T,A,U,G,z,K,Q,ft,o,a,s,i,c,mt,bt,xt,yt);var m=R().getInt32(v+0,!0),b=R().getInt32(v+4,!0),y=R().getInt32(v+8,!0),x=R().getInt32(v+12,!0),w=m,k=b;if(x)throw w=0,k=0,Z(y);return l=w,f=k,H(w,k)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(l,f,1);}}function Ir(t,e,r,n,o,a){let s,i;try{let b=u.__wbindgen_add_to_stack_pointer(-16),y=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),x=B,w=P(e,u.__wbindgen_export_0,u.__wbindgen_export_1),k=B,v=P(r,u.__wbindgen_export_0,u.__wbindgen_export_1),T=B;u.canonicalize(b,y,x,w,k,v,T,n,o,a);var c=R().getInt32(b+0,!0),d=R().getInt32(b+4,!0),g=R().getInt32(b+8,!0),l=R().getInt32(b+12,!0),f=c,m=d;if(l)throw f=0,m=0,Z(g);return s=f,i=m,H(f,m)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(s,i,1);}}function Tr(t){let e,r;try{let d=u.__wbindgen_add_to_stack_pointer(-16),g=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),l=B;u.count_bits(d,g,l);var n=R().getInt32(d+0,!0),o=R().getInt32(d+4,!0),a=R().getInt32(d+8,!0),s=R().getInt32(d+12,!0),i=n,c=o;if(s)throw i=0,c=0,Z(a);return e=i,r=c,H(i,c)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(e,r,1);}}function Or(t){let e,r;try{let a=u.__wbindgen_add_to_stack_pointer(-16),s=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),i=B;u.split_bits(a,s,i);var n=R().getInt32(a+0,!0),o=R().getInt32(a+4,!0);return e=n,r=o,H(n,o)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(e,r,1);}}function Fr(t){let e=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),r=B;return u.is_bitmark(e,r)!==0}function Rr(t){let e,r;try{let d=u.__wbindgen_add_to_stack_pointer(-16),g=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),l=B;u.split_json_bits(d,g,l);var n=R().getInt32(d+0,!0),o=R().getInt32(d+4,!0),a=R().getInt32(d+8,!0),s=R().getInt32(d+12,!0),i=n,c=o;if(s)throw i=0,c=0,Z(a);return e=i,r=c,H(i,c)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(e,r,1);}}function Er(t,e){let r,n;try{let s=u.__wbindgen_add_to_stack_pointer(-16),i=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),c=B;u.prettify(s,i,c,e);var o=R().getInt32(s+0,!0),a=R().getInt32(s+4,!0);return r=o,n=a,H(o,a)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(r,n,1);}}function Sr(t,e,r,n){let o,a;try{let f=u.__wbindgen_add_to_stack_pointer(-16),m=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),b=B,y=P(e,u.__wbindgen_export_0,u.__wbindgen_export_1),x=B,w=P(r,u.__wbindgen_export_0,u.__wbindgen_export_1),k=B,v=P(n,u.__wbindgen_export_0,u.__wbindgen_export_1),T=B;u.convert_text(f,m,b,y,x,w,k,v,T);var s=R().getInt32(f+0,!0),i=R().getInt32(f+4,!0),c=R().getInt32(f+8,!0),d=R().getInt32(f+12,!0),g=s,l=i;if(d)throw g=0,l=0,Z(c);return o=g,a=l,H(g,l)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(o,a,1);}}async function Br(t,e){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(t,e)}catch(n){if(t.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",n);else throw n}let r=await t.arrayBuffer();return await WebAssembly.instantiate(r,e)}else {let r=await WebAssembly.instantiate(t,e);return r instanceof WebAssembly.Instance?{instance:r,module:t}:r}}function Ie(){let t={};return t.wbg={},t.wbg.__wbindgen_error_new=function(e,r){let n=new Error(H(e,r));return cr(n)},t}function Te(t,e){return u=t.exports,Oe.__wbindgen_wasm_module=e,ct=null,It=null,u}function Qt(t){if(u!==void 0)return u;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module:t}=t:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let e=Ie();t instanceof WebAssembly.Module||(t=new WebAssembly.Module(t));let r=new WebAssembly.Instance(t,e);return Te(r,t)}async function Oe(t){if(u!==void 0)return u;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module_or_path:t}=t:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof t>"u"&&(t=new URL("bitmark_json_wasm_bg.wasm",import.meta.url));let e=Ie();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));let{instance:r,module:n}=await Br(await t,e);return Te(r,n)}var Zt=Oe;var Ot={version:"7.1.0"};var ee="browser-full",Ct=class extends Error{constructor(){super("wasm not initialised: call init() (or init({ feature: \u2026 })) first"),this.name="NotInitializedError";}},dt=class extends Error{constructor(e){super(e),this.name="RegisterError";}},it=class extends Error{constructor(e,r){super(`${e} is not available in the loaded wasm module${r?` (feature: "${r}")`:""}; init({ feature: "full" }) to load it`),this.name="UnsupportedFeatureError";}},Lt,Re,Fe,Ee=new Map;function C(){if(!Lt&&Fe&&Fe(),!Lt)throw new Ct;return Lt}function ne(t,e){for(let[r,n]of Ee)try{e.register(r,n);}catch(o){throw new dt(o instanceof Error?o.message:String(o))}Lt=e,Re=t;}function Se(t,e){Ee.set(t,e);}function et(){return Re}function Pr(t){let e=t.trim();return e.startsWith("[")&&e.endsWith("]")?e.slice(1,-1):t}function Ar(t){return t===void 0?"":typeof t=="string"?t.trim():JSON.stringify(t)}function jr(t,e,r){if(r){let o=JSON.parse(t.split_bits(e));return o.map(a=>({view:{format:"bitmark",index:a.index,total:o.length,source:a.source},source:a.source}))}let n=JSON.parse(t.split_json_bits(e));return n.map((o,a)=>({view:{format:"json",index:a,total:n.length,bit:o.bit??{}},source:JSON.stringify([o])}))}function re(t,e,r){let n=r.mode??"optimized",o=r.outputFormat??"json",a=r.spacesAroundValues??1,s=r.indent??2,i=r.pretty??false,c=r.inputFormat??"auto",d=c==="bitmark"||c!=="json"&&t.is_bitmark(e),g=d?"bitmark":"json";t.transform("","bitmark",o,n,"",false,s,a);let l=jr(t,e,d),f=l.length,m=[];for(let k=0;k<f;k++){let{view:v}=l[k];v.index=k,v.total=f;let T=r.preHook?r.preHook(v)||{}:{};m.push(T.drop?null:{patches:T.patches??[],outputFormat:T.outputFormat??o});}let b=Ar(r.patch),y;b===""?y=l.map((k,v)=>({source:v,bit:null,patch:[]})):y=JSON.parse(t.resolve_patch_document(e,g,b));let x=[],w=[];for(let k of y)if(k.source!==null){let v=m[k.source];if(!v)continue;x.push({index:k.source,source:l[k.source].source,inputFormat:g,outputFormat:v.outputFormat,mode:n,patchJson:JSON.stringify([...k.patch,...v.patches]),spacesAroundValues:a}),w.push(l[k.source].view);}else {let v=k.bit??{},T=x.length;x.push({index:T,source:JSON.stringify([{bit:v}]),inputFormat:"json",outputFormat:o,mode:n,patchJson:JSON.stringify(k.patch),spacesAroundValues:a}),w.push({format:"json",index:T,total:f,bit:v});}return {jobs:x,views:w,output:o,pretty:i,indent:s}}function Lr(t,e){let r=t.transform(e.source,e.inputFormat,e.outputFormat,e.mode,e.patchJson,false,2,e.spacesAroundValues);return e.outputFormat==="json"?Pr(r):r}function oe(t,e,r,n,o){if(r!=="json")return e.join(`
1
+ var ge=Object.defineProperty;var fn=(t,e,r)=>e in t?ge(t,e,{enumerable:true,configurable:true,writable:true,value:r}):t[e]=r;var Rt=(t,e)=>{for(var r in e)ge(t,r,{get:e[r],enumerable:true});};var J=(t,e,r)=>fn(t,typeof e!="symbol"?e+"":e,r);var $t={};Rt($t,{breakscape_text:()=>xn,canonicalize:()=>An,complete:()=>Rn,convert:()=>Pn,convert_text:()=>In,count_bits:()=>jn,default:()=>Kt,diff:()=>Fn,hover:()=>Sn,info:()=>wn,info_text_supported:()=>kn,initSync:()=>zt,is_bitmark:()=>Cn,prettify:()=>Dn,register:()=>Bn,resolve:()=>En,resolve_patch_document:()=>On,split_bits:()=>Ln,split_json_bits:()=>Wn,transform:()=>Tn,unbreakscape_text:()=>yn});var p,fe=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:true,fatal:true}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&fe.decode();var wt=null;function Et(){return (wt===null||wt.byteLength===0)&&(wt=new Uint8Array(p.memory.buffer)),wt}function N(t,e){return t=t>>>0,fe.decode(Et().subarray(t,t+e))}var nt=new Array(128).fill(void 0);nt.push(void 0,null,true,false);var kt=nt.length;function mn(t){kt===nt.length&&nt.push(nt.length+1);let e=kt;return kt=nt[e],nt[e]=t,e}var O=0,St=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},bn=typeof St.encodeInto=="function"?function(t,e){return St.encodeInto(t,e)}:function(t,e){let r=St.encode(t);return e.set(r),{read:t.length,written:r.length}};function E(t,e,r){if(r===void 0){let i=St.encode(t),c=e(i.length,1)>>>0;return Et().subarray(c,c+i.length).set(i),O=i.length,c}let n=t.length,o=e(n,1)>>>0,a=Et(),s=0;for(;s<n;s++){let i=t.charCodeAt(s);if(i>127)break;a[o+s]=i;}if(s!==n){s!==0&&(t=t.slice(s)),o=r(o,n,n=s+t.length*3,1)>>>0;let i=Et().subarray(o+s,o+n),c=bn(t,i);s+=c.written,o=r(o,n,s,1)>>>0;}return O=s,o}var pt=null;function h(){return (pt===null||pt.buffer.detached===true||pt.buffer.detached===void 0&&pt.buffer!==p.memory.buffer)&&(pt=new DataView(p.memory.buffer)),pt}function xn(t,e,r){let n,o;try{let i=p.__wbindgen_add_to_stack_pointer(-16),c=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),d=O,g=E(e,p.__wbindgen_export_0,p.__wbindgen_export_1),l=O,f=E(r,p.__wbindgen_export_0,p.__wbindgen_export_1),m=O;p.breakscape_text(i,c,d,g,l,f,m);var a=h().getInt32(i+0,!0),s=h().getInt32(i+4,!0);return n=a,o=s,N(a,s)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(n,o,1);}}function yn(t,e,r){let n,o;try{let i=p.__wbindgen_add_to_stack_pointer(-16),c=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),d=O,g=E(e,p.__wbindgen_export_0,p.__wbindgen_export_1),l=O,f=E(r,p.__wbindgen_export_0,p.__wbindgen_export_1),m=O;p.unbreakscape_text(i,c,d,g,l,f,m);var a=h().getInt32(i+0,!0),s=h().getInt32(i+4,!0);return n=a,o=s,N(a,s)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(n,o,1);}}function wn(t,e,r,n,o,a,s,i,c){let d,g;try{let m=p.__wbindgen_add_to_stack_pointer(-16),b=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),y=O,x=E(e,p.__wbindgen_export_0,p.__wbindgen_export_1),w=O,k=E(r,p.__wbindgen_export_0,p.__wbindgen_export_1),v=O,T=E(c,p.__wbindgen_export_0,p.__wbindgen_export_1),A=O;p.info(m,b,y,x,w,k,v,n,o,a,s,i,T,A);var l=h().getInt32(m+0,!0),f=h().getInt32(m+4,!0);return d=l,g=f,N(l,f)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(d,g,1);}}function kn(){return p.info_text_supported()!==0}function vn(t){return nt[t]}function hn(t){t<132||(nt[t]=kt,kt=t);}function Y(t){let e=vn(t);return hn(t),e}function In(t,e,r,n){let o,a;try{let f=p.__wbindgen_add_to_stack_pointer(-16),m=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),b=O,y=E(e,p.__wbindgen_export_0,p.__wbindgen_export_1),x=O,w=E(r,p.__wbindgen_export_0,p.__wbindgen_export_1),k=O,v=E(n,p.__wbindgen_export_0,p.__wbindgen_export_1),T=O;p.convert_text(f,m,b,y,x,w,k,v,T);var s=h().getInt32(f+0,!0),i=h().getInt32(f+4,!0),c=h().getInt32(f+8,!0),d=h().getInt32(f+12,!0),g=s,l=i;if(d)throw g=0,l=0,Y(c);return o=g,a=l,N(g,l)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(o,a,1);}}function Tn(t,e,r,n,o,a,s,i){let c,d;try{let x=p.__wbindgen_add_to_stack_pointer(-16),w=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),k=O,v=E(e,p.__wbindgen_export_0,p.__wbindgen_export_1),T=O,A=E(r,p.__wbindgen_export_0,p.__wbindgen_export_1),U=O,G=E(n,p.__wbindgen_export_0,p.__wbindgen_export_1),z=O,K=E(o,p.__wbindgen_export_0,p.__wbindgen_export_1),Q=O;p.transform(x,w,k,v,T,A,U,G,z,K,Q,a,s,i);var g=h().getInt32(x+0,!0),l=h().getInt32(x+4,!0),f=h().getInt32(x+8,!0),m=h().getInt32(x+12,!0),b=g,y=l;if(m)throw b=0,y=0,Y(f);return c=b,d=y,N(b,y)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(c,d,1);}}function On(t,e,r){let n,o;try{let l=p.__wbindgen_add_to_stack_pointer(-16),f=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),m=O,b=E(e,p.__wbindgen_export_0,p.__wbindgen_export_1),y=O,x=E(r,p.__wbindgen_export_0,p.__wbindgen_export_1),w=O;p.resolve_patch_document(l,f,m,b,y,x,w);var a=h().getInt32(l+0,!0),s=h().getInt32(l+4,!0),i=h().getInt32(l+8,!0),c=h().getInt32(l+12,!0),d=a,g=s;if(c)throw d=0,g=0,Y(i);return n=d,o=g,N(d,g)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(n,o,1);}}function Fn(t,e,r,n,o,a,s,i,c){let d,g;try{let w=p.__wbindgen_add_to_stack_pointer(-16),k=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),v=O,T=E(e,p.__wbindgen_export_0,p.__wbindgen_export_1),A=O,U=E(r,p.__wbindgen_export_0,p.__wbindgen_export_1),G=O,z=E(n,p.__wbindgen_export_0,p.__wbindgen_export_1),K=O;p.diff(w,k,v,T,A,U,G,z,K,o,a,s,i,c);var l=h().getInt32(w+0,!0),f=h().getInt32(w+4,!0),m=h().getInt32(w+8,!0),b=h().getInt32(w+12,!0),y=l,x=f;if(b)throw y=0,x=0,Y(m);return d=y,g=x,N(y,x)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(d,g,1);}}function Rn(t,e,r,n,o,a){let s,i;try{let b=p.__wbindgen_add_to_stack_pointer(-16),y=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),x=O,w=E(n,p.__wbindgen_export_0,p.__wbindgen_export_1),k=O,v=E(a,p.__wbindgen_export_0,p.__wbindgen_export_1),T=O;p.complete(b,y,x,e,r,w,k,o,v,T);var c=h().getInt32(b+0,!0),d=h().getInt32(b+4,!0),g=h().getInt32(b+8,!0),l=h().getInt32(b+12,!0),f=c,m=d;if(l)throw f=0,m=0,Y(g);return s=f,i=m,N(f,m)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(s,i,1);}}function En(t,e,r,n,o,a,s){let i,c;try{let y=p.__wbindgen_add_to_stack_pointer(-16),x=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),w=O,k=E(n,p.__wbindgen_export_0,p.__wbindgen_export_1),v=O,T=E(a,p.__wbindgen_export_0,p.__wbindgen_export_1),A=O;p.resolve(y,x,w,e,r,k,v,o,T,A,s);var d=h().getInt32(y+0,!0),g=h().getInt32(y+4,!0),l=h().getInt32(y+8,!0),f=h().getInt32(y+12,!0),m=d,b=g;if(f)throw m=0,b=0,Y(l);return i=m,c=b,N(m,b)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(i,c,1);}}function Sn(t,e,r,n){let o,a;try{let f=p.__wbindgen_add_to_stack_pointer(-16),m=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),b=O,y=E(n,p.__wbindgen_export_0,p.__wbindgen_export_1),x=O;p.hover(f,m,b,e,r,y,x);var s=h().getInt32(f+0,!0),i=h().getInt32(f+4,!0),c=h().getInt32(f+8,!0),d=h().getInt32(f+12,!0),g=s,l=i;if(d)throw g=0,l=0,Y(c);return o=g,a=l,N(g,l)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(o,a,1);}}function Bn(t,e){try{let o=p.__wbindgen_add_to_stack_pointer(-16),a=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),s=O,i=E(e,p.__wbindgen_export_0,p.__wbindgen_export_1),c=O;p.register(o,a,s,i,c);var r=h().getInt32(o+0,!0),n=h().getInt32(o+4,!0);if(n)throw Y(r)}finally{p.__wbindgen_add_to_stack_pointer(16);}}function Pn(t,e,r,n,o,a,s,i,c,d,g){let l,f;try{let v=p.__wbindgen_add_to_stack_pointer(-16),T=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),A=O,U=E(e,p.__wbindgen_export_0,p.__wbindgen_export_1),G=O,z=E(r,p.__wbindgen_export_0,p.__wbindgen_export_1),K=O,Q=E(n,p.__wbindgen_export_0,p.__wbindgen_export_1),ft=O,mt=E(d,p.__wbindgen_export_0,p.__wbindgen_export_1),bt=O,xt=E(g,p.__wbindgen_export_0,p.__wbindgen_export_1),yt=O;p.convert(v,T,A,U,G,z,K,Q,ft,o,a,s,i,c,mt,bt,xt,yt);var m=h().getInt32(v+0,!0),b=h().getInt32(v+4,!0),y=h().getInt32(v+8,!0),x=h().getInt32(v+12,!0),w=m,k=b;if(x)throw w=0,k=0,Y(y);return l=w,f=k,N(w,k)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(l,f,1);}}function An(t,e,r,n,o,a){let s,i;try{let b=p.__wbindgen_add_to_stack_pointer(-16),y=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),x=O,w=E(e,p.__wbindgen_export_0,p.__wbindgen_export_1),k=O,v=E(r,p.__wbindgen_export_0,p.__wbindgen_export_1),T=O;p.canonicalize(b,y,x,w,k,v,T,n,o,a);var c=h().getInt32(b+0,!0),d=h().getInt32(b+4,!0),g=h().getInt32(b+8,!0),l=h().getInt32(b+12,!0),f=c,m=d;if(l)throw f=0,m=0,Y(g);return s=f,i=m,N(f,m)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(s,i,1);}}function jn(t){let e,r;try{let d=p.__wbindgen_add_to_stack_pointer(-16),g=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),l=O;p.count_bits(d,g,l);var n=h().getInt32(d+0,!0),o=h().getInt32(d+4,!0),a=h().getInt32(d+8,!0),s=h().getInt32(d+12,!0),i=n,c=o;if(s)throw i=0,c=0,Y(a);return e=i,r=c,N(i,c)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(e,r,1);}}function Ln(t){let e,r;try{let a=p.__wbindgen_add_to_stack_pointer(-16),s=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),i=O;p.split_bits(a,s,i);var n=h().getInt32(a+0,!0),o=h().getInt32(a+4,!0);return e=n,r=o,N(n,o)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(e,r,1);}}function Cn(t){let e=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),r=O;return p.is_bitmark(e,r)!==0}function Wn(t){let e,r;try{let d=p.__wbindgen_add_to_stack_pointer(-16),g=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),l=O;p.split_json_bits(d,g,l);var n=h().getInt32(d+0,!0),o=h().getInt32(d+4,!0),a=h().getInt32(d+8,!0),s=h().getInt32(d+12,!0),i=n,c=o;if(s)throw i=0,c=0,Y(a);return e=i,r=c,N(i,c)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(e,r,1);}}function Dn(t,e){let r,n;try{let s=p.__wbindgen_add_to_stack_pointer(-16),i=E(t,p.__wbindgen_export_0,p.__wbindgen_export_1),c=O;p.prettify(s,i,c,e);var o=h().getInt32(s+0,!0),a=h().getInt32(s+4,!0);return r=o,n=a,N(o,a)}finally{p.__wbindgen_add_to_stack_pointer(16),p.__wbindgen_export_2(r,n,1);}}async function Jn(t,e){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(t,e)}catch(n){if(t.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",n);else throw n}let r=await t.arrayBuffer();return await WebAssembly.instantiate(r,e)}else {let r=await WebAssembly.instantiate(t,e);return r instanceof WebAssembly.Instance?{instance:r,module:t}:r}}function me(){let t={};return t.wbg={},t.wbg.__wbindgen_error_new=function(e,r){let n=new Error(N(e,r));return mn(n)},t}function be(t,e){return p=t.exports,xe.__wbindgen_wasm_module=e,pt=null,wt=null,p}function zt(t){if(p!==void 0)return p;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module:t}=t:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let e=me();t instanceof WebAssembly.Module||(t=new WebAssembly.Module(t));let r=new WebAssembly.Instance(t,e);return be(r,t)}async function xe(t){if(p!==void 0)return p;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module_or_path:t}=t:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof t>"u"&&(t=new URL("bitmark_wasm_bg.wasm",import.meta.url));let e=me();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));let{instance:r,module:n}=await Jn(await t,e);return be(r,n)}var Kt=xe;var Xt={};Rt(Xt,{breakscape_text:()=>Vn,canonicalize:()=>rr,complete:()=>Qn,convert:()=>nr,convert_text:()=>$n,count_bits:()=>or,default:()=>Yt,diff:()=>Xn,hover:()=>tr,info:()=>Un,info_text_supported:()=>Gn,initSync:()=>qt,is_bitmark:()=>sr,prettify:()=>pr,register:()=>er,resolve:()=>Zn,resolve_patch_document:()=>Yn,split_bits:()=>ir,split_json_bits:()=>ar,transform:()=>qn,unbreakscape_text:()=>Hn});var _,ye=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:true,fatal:true}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&ye.decode();var vt=null;function Bt(){return (vt===null||vt.byteLength===0)&&(vt=new Uint8Array(_.memory.buffer)),vt}function V(t,e){return t=t>>>0,ye.decode(Bt().subarray(t,t+e))}var rt=new Array(128).fill(void 0);rt.push(void 0,null,true,false);var ht=rt.length;function Mn(t){ht===rt.length&&rt.push(rt.length+1);let e=ht;return ht=rt[e],rt[e]=t,e}var F=0,Pt=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},Nn=typeof Pt.encodeInto=="function"?function(t,e){return Pt.encodeInto(t,e)}:function(t,e){let r=Pt.encode(t);return e.set(r),{read:t.length,written:r.length}};function S(t,e,r){if(r===void 0){let i=Pt.encode(t),c=e(i.length,1)>>>0;return Bt().subarray(c,c+i.length).set(i),F=i.length,c}let n=t.length,o=e(n,1)>>>0,a=Bt(),s=0;for(;s<n;s++){let i=t.charCodeAt(s);if(i>127)break;a[o+s]=i;}if(s!==n){s!==0&&(t=t.slice(s)),o=r(o,n,n=s+t.length*3,1)>>>0;let i=Bt().subarray(o+s,o+n),c=Nn(t,i);s+=c.written,o=r(o,n,s,1)>>>0;}return F=s,o}var _t=null;function I(){return (_t===null||_t.buffer.detached===true||_t.buffer.detached===void 0&&_t.buffer!==_.memory.buffer)&&(_t=new DataView(_.memory.buffer)),_t}function Vn(t,e,r){let n,o;try{let i=_.__wbindgen_add_to_stack_pointer(-16),c=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),d=F,g=S(e,_.__wbindgen_export_0,_.__wbindgen_export_1),l=F,f=S(r,_.__wbindgen_export_0,_.__wbindgen_export_1),m=F;_.breakscape_text(i,c,d,g,l,f,m);var a=I().getInt32(i+0,!0),s=I().getInt32(i+4,!0);return n=a,o=s,V(a,s)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(n,o,1);}}function Hn(t,e,r){let n,o;try{let i=_.__wbindgen_add_to_stack_pointer(-16),c=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),d=F,g=S(e,_.__wbindgen_export_0,_.__wbindgen_export_1),l=F,f=S(r,_.__wbindgen_export_0,_.__wbindgen_export_1),m=F;_.unbreakscape_text(i,c,d,g,l,f,m);var a=I().getInt32(i+0,!0),s=I().getInt32(i+4,!0);return n=a,o=s,V(a,s)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(n,o,1);}}function Un(t,e,r,n,o,a,s,i,c){let d,g;try{let m=_.__wbindgen_add_to_stack_pointer(-16),b=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),y=F,x=S(e,_.__wbindgen_export_0,_.__wbindgen_export_1),w=F,k=S(r,_.__wbindgen_export_0,_.__wbindgen_export_1),v=F,T=S(c,_.__wbindgen_export_0,_.__wbindgen_export_1),A=F;_.info(m,b,y,x,w,k,v,n,o,a,s,i,T,A);var l=I().getInt32(m+0,!0),f=I().getInt32(m+4,!0);return d=l,g=f,V(l,f)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(d,g,1);}}function Gn(){return _.info_text_supported()!==0}function zn(t){return rt[t]}function Kn(t){t<132||(rt[t]=ht,ht=t);}function X(t){let e=zn(t);return Kn(t),e}function $n(t,e,r,n){let o,a;try{let f=_.__wbindgen_add_to_stack_pointer(-16),m=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),b=F,y=S(e,_.__wbindgen_export_0,_.__wbindgen_export_1),x=F,w=S(r,_.__wbindgen_export_0,_.__wbindgen_export_1),k=F,v=S(n,_.__wbindgen_export_0,_.__wbindgen_export_1),T=F;_.convert_text(f,m,b,y,x,w,k,v,T);var s=I().getInt32(f+0,!0),i=I().getInt32(f+4,!0),c=I().getInt32(f+8,!0),d=I().getInt32(f+12,!0),g=s,l=i;if(d)throw g=0,l=0,X(c);return o=g,a=l,V(g,l)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(o,a,1);}}function qn(t,e,r,n,o,a,s,i){let c,d;try{let x=_.__wbindgen_add_to_stack_pointer(-16),w=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),k=F,v=S(e,_.__wbindgen_export_0,_.__wbindgen_export_1),T=F,A=S(r,_.__wbindgen_export_0,_.__wbindgen_export_1),U=F,G=S(n,_.__wbindgen_export_0,_.__wbindgen_export_1),z=F,K=S(o,_.__wbindgen_export_0,_.__wbindgen_export_1),Q=F;_.transform(x,w,k,v,T,A,U,G,z,K,Q,a,s,i);var g=I().getInt32(x+0,!0),l=I().getInt32(x+4,!0),f=I().getInt32(x+8,!0),m=I().getInt32(x+12,!0),b=g,y=l;if(m)throw b=0,y=0,X(f);return c=b,d=y,V(b,y)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(c,d,1);}}function Yn(t,e,r){let n,o;try{let l=_.__wbindgen_add_to_stack_pointer(-16),f=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),m=F,b=S(e,_.__wbindgen_export_0,_.__wbindgen_export_1),y=F,x=S(r,_.__wbindgen_export_0,_.__wbindgen_export_1),w=F;_.resolve_patch_document(l,f,m,b,y,x,w);var a=I().getInt32(l+0,!0),s=I().getInt32(l+4,!0),i=I().getInt32(l+8,!0),c=I().getInt32(l+12,!0),d=a,g=s;if(c)throw d=0,g=0,X(i);return n=d,o=g,V(d,g)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(n,o,1);}}function Xn(t,e,r,n,o,a,s,i,c){let d,g;try{let w=_.__wbindgen_add_to_stack_pointer(-16),k=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),v=F,T=S(e,_.__wbindgen_export_0,_.__wbindgen_export_1),A=F,U=S(r,_.__wbindgen_export_0,_.__wbindgen_export_1),G=F,z=S(n,_.__wbindgen_export_0,_.__wbindgen_export_1),K=F;_.diff(w,k,v,T,A,U,G,z,K,o,a,s,i,c);var l=I().getInt32(w+0,!0),f=I().getInt32(w+4,!0),m=I().getInt32(w+8,!0),b=I().getInt32(w+12,!0),y=l,x=f;if(b)throw y=0,x=0,X(m);return d=y,g=x,V(y,x)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(d,g,1);}}function Qn(t,e,r,n,o,a){let s,i;try{let b=_.__wbindgen_add_to_stack_pointer(-16),y=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),x=F,w=S(n,_.__wbindgen_export_0,_.__wbindgen_export_1),k=F,v=S(a,_.__wbindgen_export_0,_.__wbindgen_export_1),T=F;_.complete(b,y,x,e,r,w,k,o,v,T);var c=I().getInt32(b+0,!0),d=I().getInt32(b+4,!0),g=I().getInt32(b+8,!0),l=I().getInt32(b+12,!0),f=c,m=d;if(l)throw f=0,m=0,X(g);return s=f,i=m,V(f,m)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(s,i,1);}}function Zn(t,e,r,n,o,a,s){let i,c;try{let y=_.__wbindgen_add_to_stack_pointer(-16),x=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),w=F,k=S(n,_.__wbindgen_export_0,_.__wbindgen_export_1),v=F,T=S(a,_.__wbindgen_export_0,_.__wbindgen_export_1),A=F;_.resolve(y,x,w,e,r,k,v,o,T,A,s);var d=I().getInt32(y+0,!0),g=I().getInt32(y+4,!0),l=I().getInt32(y+8,!0),f=I().getInt32(y+12,!0),m=d,b=g;if(f)throw m=0,b=0,X(l);return i=m,c=b,V(m,b)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(i,c,1);}}function tr(t,e,r,n){let o,a;try{let f=_.__wbindgen_add_to_stack_pointer(-16),m=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),b=F,y=S(n,_.__wbindgen_export_0,_.__wbindgen_export_1),x=F;_.hover(f,m,b,e,r,y,x);var s=I().getInt32(f+0,!0),i=I().getInt32(f+4,!0),c=I().getInt32(f+8,!0),d=I().getInt32(f+12,!0),g=s,l=i;if(d)throw g=0,l=0,X(c);return o=g,a=l,V(g,l)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(o,a,1);}}function er(t,e){try{let o=_.__wbindgen_add_to_stack_pointer(-16),a=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),s=F,i=S(e,_.__wbindgen_export_0,_.__wbindgen_export_1),c=F;_.register(o,a,s,i,c);var r=I().getInt32(o+0,!0),n=I().getInt32(o+4,!0);if(n)throw X(r)}finally{_.__wbindgen_add_to_stack_pointer(16);}}function nr(t,e,r,n,o,a,s,i,c,d,g){let l,f;try{let v=_.__wbindgen_add_to_stack_pointer(-16),T=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),A=F,U=S(e,_.__wbindgen_export_0,_.__wbindgen_export_1),G=F,z=S(r,_.__wbindgen_export_0,_.__wbindgen_export_1),K=F,Q=S(n,_.__wbindgen_export_0,_.__wbindgen_export_1),ft=F,mt=S(d,_.__wbindgen_export_0,_.__wbindgen_export_1),bt=F,xt=S(g,_.__wbindgen_export_0,_.__wbindgen_export_1),yt=F;_.convert(v,T,A,U,G,z,K,Q,ft,o,a,s,i,c,mt,bt,xt,yt);var m=I().getInt32(v+0,!0),b=I().getInt32(v+4,!0),y=I().getInt32(v+8,!0),x=I().getInt32(v+12,!0),w=m,k=b;if(x)throw w=0,k=0,X(y);return l=w,f=k,V(w,k)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(l,f,1);}}function rr(t,e,r,n,o,a){let s,i;try{let b=_.__wbindgen_add_to_stack_pointer(-16),y=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),x=F,w=S(e,_.__wbindgen_export_0,_.__wbindgen_export_1),k=F,v=S(r,_.__wbindgen_export_0,_.__wbindgen_export_1),T=F;_.canonicalize(b,y,x,w,k,v,T,n,o,a);var c=I().getInt32(b+0,!0),d=I().getInt32(b+4,!0),g=I().getInt32(b+8,!0),l=I().getInt32(b+12,!0),f=c,m=d;if(l)throw f=0,m=0,X(g);return s=f,i=m,V(f,m)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(s,i,1);}}function or(t){let e,r;try{let d=_.__wbindgen_add_to_stack_pointer(-16),g=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),l=F;_.count_bits(d,g,l);var n=I().getInt32(d+0,!0),o=I().getInt32(d+4,!0),a=I().getInt32(d+8,!0),s=I().getInt32(d+12,!0),i=n,c=o;if(s)throw i=0,c=0,X(a);return e=i,r=c,V(i,c)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(e,r,1);}}function ir(t){let e,r;try{let a=_.__wbindgen_add_to_stack_pointer(-16),s=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),i=F;_.split_bits(a,s,i);var n=I().getInt32(a+0,!0),o=I().getInt32(a+4,!0);return e=n,r=o,V(n,o)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(e,r,1);}}function sr(t){let e=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),r=F;return _.is_bitmark(e,r)!==0}function ar(t){let e,r;try{let d=_.__wbindgen_add_to_stack_pointer(-16),g=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),l=F;_.split_json_bits(d,g,l);var n=I().getInt32(d+0,!0),o=I().getInt32(d+4,!0),a=I().getInt32(d+8,!0),s=I().getInt32(d+12,!0),i=n,c=o;if(s)throw i=0,c=0,X(a);return e=i,r=c,V(i,c)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(e,r,1);}}function pr(t,e){let r,n;try{let s=_.__wbindgen_add_to_stack_pointer(-16),i=S(t,_.__wbindgen_export_0,_.__wbindgen_export_1),c=F;_.prettify(s,i,c,e);var o=I().getInt32(s+0,!0),a=I().getInt32(s+4,!0);return r=o,n=a,V(o,a)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_2(r,n,1);}}async function _r(t,e){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(t,e)}catch(n){if(t.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",n);else throw n}let r=await t.arrayBuffer();return await WebAssembly.instantiate(r,e)}else {let r=await WebAssembly.instantiate(t,e);return r instanceof WebAssembly.Instance?{instance:r,module:t}:r}}function we(){let t={};return t.wbg={},t.wbg.__wbindgen_error_new=function(e,r){let n=new Error(V(e,r));return Mn(n)},t}function ke(t,e){return _=t.exports,ve.__wbindgen_wasm_module=e,_t=null,vt=null,_}function qt(t){if(_!==void 0)return _;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module:t}=t:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let e=we();t instanceof WebAssembly.Module||(t=new WebAssembly.Module(t));let r=new WebAssembly.Instance(t,e);return ke(r,t)}async function ve(t){if(_!==void 0)return _;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module_or_path:t}=t:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof t>"u"&&(t=new URL("bitmark_browser_full_wasm_bg.wasm",import.meta.url));let e=we();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));let{instance:r,module:n}=await _r(await t,e);return ke(r,n)}var Yt=ve;var te={};Rt(te,{breakscape_text:()=>dr,canonicalize:()=>Ir,complete:()=>wr,convert:()=>hr,convert_text:()=>Sr,count_bits:()=>Tr,default:()=>Zt,hover:()=>vr,info:()=>gr,initSync:()=>Qt,is_bitmark:()=>Fr,prettify:()=>Er,register:()=>br,resolve:()=>kr,resolve_patch_document:()=>yr,split_bits:()=>Or,split_json_bits:()=>Rr,transform:()=>xr,unbreakscape_text:()=>lr});var u,he=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:true,fatal:true}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&he.decode();var It=null;function At(){return (It===null||It.byteLength===0)&&(It=new Uint8Array(u.memory.buffer)),It}function H(t,e){return t=t>>>0,he.decode(At().subarray(t,t+e))}var ot=new Array(128).fill(void 0);ot.push(void 0,null,true,false);var Tt=ot.length;function cr(t){Tt===ot.length&&ot.push(ot.length+1);let e=Tt;return Tt=ot[e],ot[e]=t,e}var B=0,jt=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},ur=typeof jt.encodeInto=="function"?function(t,e){return jt.encodeInto(t,e)}:function(t,e){let r=jt.encode(t);return e.set(r),{read:t.length,written:r.length}};function P(t,e,r){if(r===void 0){let i=jt.encode(t),c=e(i.length,1)>>>0;return At().subarray(c,c+i.length).set(i),B=i.length,c}let n=t.length,o=e(n,1)>>>0,a=At(),s=0;for(;s<n;s++){let i=t.charCodeAt(s);if(i>127)break;a[o+s]=i;}if(s!==n){s!==0&&(t=t.slice(s)),o=r(o,n,n=s+t.length*3,1)>>>0;let i=At().subarray(o+s,o+n),c=ur(t,i);s+=c.written,o=r(o,n,s,1)>>>0;}return B=s,o}var ct=null;function R(){return (ct===null||ct.buffer.detached===true||ct.buffer.detached===void 0&&ct.buffer!==u.memory.buffer)&&(ct=new DataView(u.memory.buffer)),ct}function dr(t,e,r){let n,o;try{let i=u.__wbindgen_add_to_stack_pointer(-16),c=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),d=B,g=P(e,u.__wbindgen_export_0,u.__wbindgen_export_1),l=B,f=P(r,u.__wbindgen_export_0,u.__wbindgen_export_1),m=B;u.breakscape_text(i,c,d,g,l,f,m);var a=R().getInt32(i+0,!0),s=R().getInt32(i+4,!0);return n=a,o=s,H(a,s)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(n,o,1);}}function lr(t,e,r){let n,o;try{let i=u.__wbindgen_add_to_stack_pointer(-16),c=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),d=B,g=P(e,u.__wbindgen_export_0,u.__wbindgen_export_1),l=B,f=P(r,u.__wbindgen_export_0,u.__wbindgen_export_1),m=B;u.unbreakscape_text(i,c,d,g,l,f,m);var a=R().getInt32(i+0,!0),s=R().getInt32(i+4,!0);return n=a,o=s,H(a,s)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(n,o,1);}}function gr(t,e,r,n,o,a,s,i,c){let d,g;try{let m=u.__wbindgen_add_to_stack_pointer(-16),b=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),y=B,x=P(e,u.__wbindgen_export_0,u.__wbindgen_export_1),w=B,k=P(r,u.__wbindgen_export_0,u.__wbindgen_export_1),v=B,T=P(c,u.__wbindgen_export_0,u.__wbindgen_export_1),A=B;u.info(m,b,y,x,w,k,v,n,o,a,s,i,T,A);var l=R().getInt32(m+0,!0),f=R().getInt32(m+4,!0);return d=l,g=f,H(l,f)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(d,g,1);}}function fr(t){return ot[t]}function mr(t){t<132||(ot[t]=Tt,Tt=t);}function Z(t){let e=fr(t);return mr(t),e}function br(t,e){try{let o=u.__wbindgen_add_to_stack_pointer(-16),a=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),s=B,i=P(e,u.__wbindgen_export_0,u.__wbindgen_export_1),c=B;u.register(o,a,s,i,c);var r=R().getInt32(o+0,!0),n=R().getInt32(o+4,!0);if(n)throw Z(r)}finally{u.__wbindgen_add_to_stack_pointer(16);}}function xr(t,e,r,n,o,a,s,i){let c,d;try{let x=u.__wbindgen_add_to_stack_pointer(-16),w=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),k=B,v=P(e,u.__wbindgen_export_0,u.__wbindgen_export_1),T=B,A=P(r,u.__wbindgen_export_0,u.__wbindgen_export_1),U=B,G=P(n,u.__wbindgen_export_0,u.__wbindgen_export_1),z=B,K=P(o,u.__wbindgen_export_0,u.__wbindgen_export_1),Q=B;u.transform(x,w,k,v,T,A,U,G,z,K,Q,a,s,i);var g=R().getInt32(x+0,!0),l=R().getInt32(x+4,!0),f=R().getInt32(x+8,!0),m=R().getInt32(x+12,!0),b=g,y=l;if(m)throw b=0,y=0,Z(f);return c=b,d=y,H(b,y)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(c,d,1);}}function yr(t,e,r){let n,o;try{let l=u.__wbindgen_add_to_stack_pointer(-16),f=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),m=B,b=P(e,u.__wbindgen_export_0,u.__wbindgen_export_1),y=B,x=P(r,u.__wbindgen_export_0,u.__wbindgen_export_1),w=B;u.resolve_patch_document(l,f,m,b,y,x,w);var a=R().getInt32(l+0,!0),s=R().getInt32(l+4,!0),i=R().getInt32(l+8,!0),c=R().getInt32(l+12,!0),d=a,g=s;if(c)throw d=0,g=0,Z(i);return n=d,o=g,H(d,g)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(n,o,1);}}function wr(t,e,r,n,o,a){let s,i;try{let b=u.__wbindgen_add_to_stack_pointer(-16),y=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),x=B,w=P(n,u.__wbindgen_export_0,u.__wbindgen_export_1),k=B,v=P(a,u.__wbindgen_export_0,u.__wbindgen_export_1),T=B;u.complete(b,y,x,e,r,w,k,o,v,T);var c=R().getInt32(b+0,!0),d=R().getInt32(b+4,!0),g=R().getInt32(b+8,!0),l=R().getInt32(b+12,!0),f=c,m=d;if(l)throw f=0,m=0,Z(g);return s=f,i=m,H(f,m)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(s,i,1);}}function kr(t,e,r,n,o,a,s){let i,c;try{let y=u.__wbindgen_add_to_stack_pointer(-16),x=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),w=B,k=P(n,u.__wbindgen_export_0,u.__wbindgen_export_1),v=B,T=P(a,u.__wbindgen_export_0,u.__wbindgen_export_1),A=B;u.resolve(y,x,w,e,r,k,v,o,T,A,s);var d=R().getInt32(y+0,!0),g=R().getInt32(y+4,!0),l=R().getInt32(y+8,!0),f=R().getInt32(y+12,!0),m=d,b=g;if(f)throw m=0,b=0,Z(l);return i=m,c=b,H(m,b)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(i,c,1);}}function vr(t,e,r,n){let o,a;try{let f=u.__wbindgen_add_to_stack_pointer(-16),m=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),b=B,y=P(n,u.__wbindgen_export_0,u.__wbindgen_export_1),x=B;u.hover(f,m,b,e,r,y,x);var s=R().getInt32(f+0,!0),i=R().getInt32(f+4,!0),c=R().getInt32(f+8,!0),d=R().getInt32(f+12,!0),g=s,l=i;if(d)throw g=0,l=0,Z(c);return o=g,a=l,H(g,l)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(o,a,1);}}function hr(t,e,r,n,o,a,s,i,c,d,g){let l,f;try{let v=u.__wbindgen_add_to_stack_pointer(-16),T=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),A=B,U=P(e,u.__wbindgen_export_0,u.__wbindgen_export_1),G=B,z=P(r,u.__wbindgen_export_0,u.__wbindgen_export_1),K=B,Q=P(n,u.__wbindgen_export_0,u.__wbindgen_export_1),ft=B,mt=P(d,u.__wbindgen_export_0,u.__wbindgen_export_1),bt=B,xt=P(g,u.__wbindgen_export_0,u.__wbindgen_export_1),yt=B;u.convert(v,T,A,U,G,z,K,Q,ft,o,a,s,i,c,mt,bt,xt,yt);var m=R().getInt32(v+0,!0),b=R().getInt32(v+4,!0),y=R().getInt32(v+8,!0),x=R().getInt32(v+12,!0),w=m,k=b;if(x)throw w=0,k=0,Z(y);return l=w,f=k,H(w,k)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(l,f,1);}}function Ir(t,e,r,n,o,a){let s,i;try{let b=u.__wbindgen_add_to_stack_pointer(-16),y=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),x=B,w=P(e,u.__wbindgen_export_0,u.__wbindgen_export_1),k=B,v=P(r,u.__wbindgen_export_0,u.__wbindgen_export_1),T=B;u.canonicalize(b,y,x,w,k,v,T,n,o,a);var c=R().getInt32(b+0,!0),d=R().getInt32(b+4,!0),g=R().getInt32(b+8,!0),l=R().getInt32(b+12,!0),f=c,m=d;if(l)throw f=0,m=0,Z(g);return s=f,i=m,H(f,m)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(s,i,1);}}function Tr(t){let e,r;try{let d=u.__wbindgen_add_to_stack_pointer(-16),g=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),l=B;u.count_bits(d,g,l);var n=R().getInt32(d+0,!0),o=R().getInt32(d+4,!0),a=R().getInt32(d+8,!0),s=R().getInt32(d+12,!0),i=n,c=o;if(s)throw i=0,c=0,Z(a);return e=i,r=c,H(i,c)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(e,r,1);}}function Or(t){let e,r;try{let a=u.__wbindgen_add_to_stack_pointer(-16),s=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),i=B;u.split_bits(a,s,i);var n=R().getInt32(a+0,!0),o=R().getInt32(a+4,!0);return e=n,r=o,H(n,o)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(e,r,1);}}function Fr(t){let e=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),r=B;return u.is_bitmark(e,r)!==0}function Rr(t){let e,r;try{let d=u.__wbindgen_add_to_stack_pointer(-16),g=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),l=B;u.split_json_bits(d,g,l);var n=R().getInt32(d+0,!0),o=R().getInt32(d+4,!0),a=R().getInt32(d+8,!0),s=R().getInt32(d+12,!0),i=n,c=o;if(s)throw i=0,c=0,Z(a);return e=i,r=c,H(i,c)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(e,r,1);}}function Er(t,e){let r,n;try{let s=u.__wbindgen_add_to_stack_pointer(-16),i=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),c=B;u.prettify(s,i,c,e);var o=R().getInt32(s+0,!0),a=R().getInt32(s+4,!0);return r=o,n=a,H(o,a)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(r,n,1);}}function Sr(t,e,r,n){let o,a;try{let f=u.__wbindgen_add_to_stack_pointer(-16),m=P(t,u.__wbindgen_export_0,u.__wbindgen_export_1),b=B,y=P(e,u.__wbindgen_export_0,u.__wbindgen_export_1),x=B,w=P(r,u.__wbindgen_export_0,u.__wbindgen_export_1),k=B,v=P(n,u.__wbindgen_export_0,u.__wbindgen_export_1),T=B;u.convert_text(f,m,b,y,x,w,k,v,T);var s=R().getInt32(f+0,!0),i=R().getInt32(f+4,!0),c=R().getInt32(f+8,!0),d=R().getInt32(f+12,!0),g=s,l=i;if(d)throw g=0,l=0,Z(c);return o=g,a=l,H(g,l)}finally{u.__wbindgen_add_to_stack_pointer(16),u.__wbindgen_export_2(o,a,1);}}async function Br(t,e){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(t,e)}catch(n){if(t.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",n);else throw n}let r=await t.arrayBuffer();return await WebAssembly.instantiate(r,e)}else {let r=await WebAssembly.instantiate(t,e);return r instanceof WebAssembly.Instance?{instance:r,module:t}:r}}function Ie(){let t={};return t.wbg={},t.wbg.__wbindgen_error_new=function(e,r){let n=new Error(H(e,r));return cr(n)},t}function Te(t,e){return u=t.exports,Oe.__wbindgen_wasm_module=e,ct=null,It=null,u}function Qt(t){if(u!==void 0)return u;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module:t}=t:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let e=Ie();t instanceof WebAssembly.Module||(t=new WebAssembly.Module(t));let r=new WebAssembly.Instance(t,e);return Te(r,t)}async function Oe(t){if(u!==void 0)return u;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module_or_path:t}=t:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof t>"u"&&(t=new URL("bitmark_json_wasm_bg.wasm",import.meta.url));let e=Ie();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));let{instance:r,module:n}=await Br(await t,e);return Te(r,n)}var Zt=Oe;var Ot={version:"7.2.0"};var ee="browser-full",Ct=class extends Error{constructor(){super("wasm not initialised: call init() (or init({ feature: \u2026 })) first"),this.name="NotInitializedError";}},dt=class extends Error{constructor(e){super(e),this.name="RegisterError";}},it=class extends Error{constructor(e,r){super(`${e} is not available in the loaded wasm module${r?` (feature: "${r}")`:""}; init({ feature: "full" }) to load it`),this.name="UnsupportedFeatureError";}},Lt,Re,Fe,Ee=new Map;function C(){if(!Lt&&Fe&&Fe(),!Lt)throw new Ct;return Lt}function ne(t,e){for(let[r,n]of Ee)try{e.register(r,n);}catch(o){throw new dt(o instanceof Error?o.message:String(o))}Lt=e,Re=t;}function Se(t,e){Ee.set(t,e);}function et(){return Re}function Pr(t){let e=t.trim();return e.startsWith("[")&&e.endsWith("]")?e.slice(1,-1):t}function Ar(t){return t===void 0?"":typeof t=="string"?t.trim():JSON.stringify(t)}function jr(t,e,r){if(r){let o=JSON.parse(t.split_bits(e));return o.map(a=>({view:{format:"bitmark",index:a.index,total:o.length,source:a.source},source:a.source}))}let n=JSON.parse(t.split_json_bits(e));return n.map((o,a)=>({view:{format:"json",index:a,total:n.length,bit:o.bit??{}},source:JSON.stringify([o])}))}function re(t,e,r){let n=r.mode??"optimized",o=r.outputFormat??"json",a=r.spacesAroundValues??1,s=r.indent??2,i=r.pretty??false,c=r.inputFormat??"auto",d=c==="bitmark"||c!=="json"&&t.is_bitmark(e),g=d?"bitmark":"json";t.transform("","bitmark",o,n,"",false,s,a);let l=jr(t,e,d),f=l.length,m=[];for(let k=0;k<f;k++){let{view:v}=l[k];v.index=k,v.total=f;let T=r.preHook?r.preHook(v)||{}:{};m.push(T.drop?null:{patches:T.patches??[],outputFormat:T.outputFormat??o});}let b=Ar(r.patch),y;b===""?y=l.map((k,v)=>({source:v,bit:null,patch:[]})):y=JSON.parse(t.resolve_patch_document(e,g,b));let x=[],w=[];for(let k of y)if(k.source!==null){let v=m[k.source];if(!v)continue;x.push({index:k.source,source:l[k.source].source,inputFormat:g,outputFormat:v.outputFormat,mode:n,patchJson:JSON.stringify([...k.patch,...v.patches]),spacesAroundValues:a}),w.push(l[k.source].view);}else {let v=k.bit??{},T=x.length;x.push({index:T,source:JSON.stringify([{bit:v}]),inputFormat:"json",outputFormat:o,mode:n,patchJson:JSON.stringify(k.patch),spacesAroundValues:a}),w.push({format:"json",index:T,total:f,bit:v});}return {jobs:x,views:w,output:o,pretty:i,indent:s}}function Lr(t,e){let r=t.transform(e.source,e.inputFormat,e.outputFormat,e.mode,e.patchJson,false,2,e.spacesAroundValues);return e.outputFormat==="json"?Pr(r):r}function oe(t,e,r,n,o){if(r!=="json")return e.join(`
2
2
  `);let a=`[${e.join(",")}]`;return n?t.prettify(a,o):a}function Be(t,e,r){let n=re(t,e,r),o=[];for(let a=0;a<n.jobs.length;a++){let s=Lr(t,n.jobs[a]);r.postHook?.(n.views[a],s),o.push(s);}return oe(t,o,n.output,n.pretty,n.indent)}async function Pe(t,e,r,n){let o=re(t,e,r),a=await n(o.jobs,r.workers??4);for(let s=0;s<a.length;s++)r.postHook?.(o.views[s],a[s]);return oe(t,a,o.output,o.pretty,o.indent)}var ie;function Ae(t){ie=t;}function W(){if(!ie)throw new Error("legacy API not initialised: the WASM module has not been provided (browser consumers must call init() first)");return ie()}function je(t,e,r){if(t.length===0)return Promise.resolve([]);let n=Math.max(1,Math.min(e,t.length));return new Promise((o,a)=>{let s=new Array(t.length),i=0,c=0,d=false,g=[],l=m=>{if(!d){d=true;for(let b of g)b.terminate();m?a(m):o(s);}},f=m=>{if(d||i>=t.length)return;let b=i++;m.post({id:b,job:t[b]});};for(let m=0;m<n;m++){let b=r(y=>{if(!d){if(!y.ok)return l(new Error(y.error??"worker job failed"));s[y.id]=y.element,++c===t.length?l():f(b);}},l);g.push(b);}for(let m of g)f(m);})}function Le(t,e,r){let n=new URL("./worker-entry.js",import.meta.url);return je(t,e,(o,a)=>{let s=new Worker(n,{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:r}),terminate:()=>s.terminate()}})}var _n={};Rt(_n,{Ast:()=>$e,BitType:()=>Ue,BitmarkFileGenerator:()=>Xe,BitmarkGenerator:()=>qe,BitmarkParser:()=>rn,BitmarkParserGenerator:()=>Ht,BitmarkParserType:()=>zr,BitmarkStringGenerator:()=>Ye,BitmarkVersion:()=>Ur,BodyTextFormat:()=>qr,BoundingBoxIndex:()=>Ke,Builder:()=>Vt,CardSetVersion:()=>Gr,FileWriter:()=>an,HtmlTableGenerator:()=>en,HtmlTableParser:()=>nn,InfoFormat:()=>$r,InfoType:()=>Kr,Input:()=>Nr,InputFormat:()=>Hr,JsonFileGenerator:()=>tn,JsonGenerator:()=>Qe,JsonParser:()=>on,JsonStringGenerator:()=>Ze,LegacyUnsupportedError:()=>lt,NodeType:()=>ze,Output:()=>Vr,ResourceBuilder:()=>Ut,StreamWriter:()=>pn,StringWriter:()=>sn,TextLocation:()=>Yr,TextMarkType:()=>Ve,TextNodeType:()=>He,bitmarkTextParse:()=>Me,isPseudoAst:()=>We});var lt=class extends Error{constructor(e){super(e),this.name="LegacyUnsupportedError";}};function at(t,e){throw new lt(`'${t}' is not supported by the @gmb/bitmark-parser legacy API`+(e?`: ${e}`:""))}function tt(t,e){throw new lt(`Option '${t}' is not supported by the @gmb/bitmark-parser legacy API`+(e?`: ${e}`:""))}var se="bitmark v2 output is not supported (this parser is bitmark v3 only)";function ae(t){t.bitmarkVersion===2&&tt("bitmarkVersion: 2",se);}function Dt(t){t.explicitTextFormat&&tt("bitmarkOptions.explicitTextFormat"),t.cardSetVersion===1&&tt("bitmarkOptions.cardSetVersion: 1",se),t.debugGenerationInline&&tt("bitmarkOptions.debugGenerationInline"),t.noBreakscaping&&tt("bitmarkOptions.noBreakscaping");}function Jt(t){t.textAsPlainText&&tt("jsonOptions.textAsPlainText",se),t.debugGenerationInline&&tt("jsonOptions.debugGenerationInline");}function ut(t){return t===true?{pretty:true,indent:2}:typeof t=="number"&&t>0?{pretty:true,indent:t}:{pretty:false,indent:2}}function Mt(t){return t===void 0||t===true?1:t===false?0:Math.max(0,Math.min(10,t))}function Nt(t){switch(t){case "text":case "latex":case "json":case "xml":return "plainText";default:return "bitmark++"}}var Ce=Symbol.for("@gmb/bitmark-parser/legacy-pseudo-ast");function gt(t){let e={bits:t};return Object.defineProperty(e,Ce,{value:true,enumerable:false}),e}function We(t){return t!==null&&typeof t=="object"&&(Ce in t||Array.isArray(t.bits))}var De={"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 pe=Symbol.for("@gmb/bitmark-parser/legacy-built-bit-parser"),Wr={bitType:"type",textFormat:"format",flashcards:"cards",markConfig:"marks"},Dr={"bitmark--":"bitmark++","bitmark+":"bitmark++"},Jr={bitmark:"bitmark++",text:"text",json:"json",latex:"latex",xml:"xml"},Mr=["title","subtitle","item","lead","pageNumber","marginNumber","hint","instruction","caption"],Vt=class{buildBitmark(e){let r=gt(e.bits??[]);return e.errors!==void 0&&(r.errors=e.errors),r}buildBit(e,r){let n=W(),o={...e},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 c=o.textFormat;c!==void 0?(i.format=Dr[c]??c,delete o.textFormat):i.format=Jr[s.bodyFormat??""]??"bitmark++",delete o.resourceType;let d=o.body;d!=null&&typeof d=="object"&&"body"in d&&(i.body=d.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 x=Array.isArray(g)?g:[g],w=De[a];w?i[w.key]=x.filter(k=>k!==null&&typeof k=="object"&&k.type===w.resourceType):x.length>=1&&(i.resource=x[0]),delete o.resources;}let l=o.parser;delete o.parser;let f=o.extraProperties;delete o.extraProperties;for(let[x,w]of Object.entries(o))w!==void 0&&(i[Wr[x]??x]=w);if(f)for(let[x,w]of Object.entries(f))x in i||(i[x]=w);this.parseStringTexts(i);let m=n.convert(JSON.stringify([{bit:i}]),"json","json","optimized",false,2,1,false,false,"",""),y=JSON.parse(m)[0]?.bit??i;for(let[x,w]of Object.entries(i))x in y||w===false||w===""||w===null||Array.isArray(w)&&w.length===0||(y[x]=w);return l!==void 0&&Object.defineProperty(y,pe,{value:l,enumerable:false}),y}buildHighlight(e,r){if(!r)return;let n={...r},o=n.attrs;return o&&Object.assign(n,o),{type:"highlight",texts:Array.isArray(n.texts)?n.texts.filter(i=>i!=null).map(i=>({text:i.text??"",isCorrect:i.isCorrect??false,isHighlighted:i.isHighlighted??false,...Je(i,["text","isCorrect","isHighlighted"])})):[],prefix:n.prefix??"",postfix:n.postfix??"",...Je(n,["type","texts","prefix","postfix","attrs"]),attrs:{}}}parseStringTexts(e){let r=W(),n=(s,i)=>{if(s==="")return s;let c=r.convert_text(s,"textToAst","bitmark++",i);try{return JSON.parse(c)}catch{return s}},o=e.format,a=o===void 0||o==="bitmark++"||o==="bitmark+";if(typeof e.body=="string")if(o==="json")try{e.body=JSON.parse(e.body);}catch{e.body=null;}else a&&(e.body=n(e.body,"body"));for(let s of Mr){let i=e[s];typeof i=="string"&&(e[s]=n(i,"tag"));}}getBitConfig(e){let r=W();if(e!==void 0)try{let n=JSON.parse(r.info("bit","json",e,!1,2,!1,!1,!0,""));if(n.error===void 0)return {bodyFormat:n.body?.format}}catch{}throw new Error(`No config found for bit: ${e}`)}};function Je(t,e){let r={};for(let[n,o]of Object.entries(t))o!==void 0&&!e.includes(n)&&(r[n]=o);return r}var Ht=class{version(){return Ot.version}convert(e,r){let n=Object.assign({},r),o=Object.assign({},n.jsonOptions),a=Object.assign({},n.bitmarkOptions);ae(n),Dt(a),Jt(o),this.checkBrowserFileWrite(n.outputFile);let s=W(),{source:i,isBitmark:c}=this.resolveInput(e,n.inputFormat),d=n.outputFormat??(c?"json":"bitmark"),g=d==="ast"?"json":d,{pretty:l,indent:f}=ut(o.prettify),m=g==="bitmark"?ut(a.prettifyJson):{pretty:l,indent:f},b=Mt(a.spacesAroundValues),y=!o.excludeUnknownProperties,x=s.convert(i,c?"bitmark":"json",g,"optimized",m.pretty,m.indent,b,y,false,"","");if(d==="bitmark"||d==="text")return this.deliver(x,n.outputFile,n.fileOptions);if(d==="json")return n.outputFile?this.deliver(x,n.outputFile,n.fileOptions):l||o.stringify?x:JSON.parse(x);let w=gt(JSON.parse(x));return n.outputFile?this.deliver(JSON.stringify(w),n.outputFile,n.fileOptions):w}upgrade(e,r){let n=Object.assign({},r),o=Object.assign({},n.jsonOptions),a=Object.assign({},n.bitmarkOptions);ae(n),Dt(a),Jt(o),this.checkBrowserFileWrite(n.outputFile);let s=W(),{source:i,isBitmark:c}=this.resolveInput(e,n.inputFormat),{pretty:d,indent:g}=ut(c?a.prettifyJson:o.prettify),l=Mt(a.spacesAroundValues),f=s.canonicalize(i,c?"bitmark":"json","optimized",d,g,l);return c?this.deliver(f,n.outputFile,n.fileOptions):n.outputFile?this.deliver(f,n.outputFile,n.fileOptions):d||o.stringify?f:JSON.parse(f)}info(e){let r=Object.assign({},e),n=W(),o=r.type??"list",a=r.outputFormat??"text",{pretty:s,indent:i}=ut(r.prettify),c=a==="pojo"?"json":a,d=n.info(o,c,r.bit??"",s,i,false,false,true,"");return a==="pojo"?JSON.parse(d):d}generateConfig(e){at("BitmarkParserGenerator.generateConfig","bpg-internal development tool");}convertHtmlTable(e,r){let n=Object.assign({},r),o=Object.assign({},n.jsonOptions),a=Object.assign({},n.bitmarkOptions);Dt(a),Jt(o),n.keepUnknownTags&&tt("keepUnknownTags"),n.noBreakscaping&&tt("noBreakscaping"),this.checkBrowserFileWrite(n.outputFile);let s=W(),i=typeof e=="string"?this.maybeReadFile(e,void 0):"";if(!(n.inputFormat==="html"||n.inputFormat===void 0&&typeof e=="string"&&/<table[\s>]/iu.test(i))){let{source:k,isBitmark:v}=this.resolveInput(e,void 0),T=s.convert(k,v?"bitmark":"json","html","optimized",false,2,1,false,false,"","");return this.deliver(_e(T).join(`
3
3
  `),n.outputFile,n.fileOptions)}let d=n.tableFormat==="table"?"table":"table-extended",g=_e(i).map(k=>`<bitmark-bit data-type="${d}" data-format="bitmark++">${k}</bitmark-bit>`).join(""),l=n.outputFormat??"bitmark",{pretty:f,indent:m}=ut(o.prettify),b=Mt(a.spacesAroundValues);if(l==="html"){let k=s.convert(g,"html","html","optimized",false,2,1,false,false,"","");return this.deliver(_e(k).join(`
4
4
  `),n.outputFile,n.fileOptions)}let y=l==="ast"?"json":l,x=s.convert(g,"html",y,"optimized",f,m,b,false,false,"","");if(l==="bitmark"||l==="text")return this.deliver(x,n.outputFile,n.fileOptions);if(l==="json")return n.outputFile?this.deliver(x,n.outputFile,n.fileOptions):f||o.stringify?x:JSON.parse(x);let w=gt(JSON.parse(x));return n.outputFile?this.deliver(JSON.stringify(w),n.outputFile,n.fileOptions):w}createAst(e,r){let n=Object.assign({},r),o=W(),{source:a,isBitmark:s}=this.resolveInput(e,n.inputFormat),i=o.convert(a,s?"bitmark":"json","json","optimized",false,2,1,true,false,"","");return gt(JSON.parse(i))}breakscapeText(e,r){if(!e)return e;let n=Object.assign({},r);this.checkBrowserFileWrite(n.outputFile);let o=W(),a=this.maybeReadFile(e,n.inputFormat),s=o.breakscape_text(a,Nt(n.textFormat),n.textLocation??"body");return this.deliver(s,n.outputFile,n.fileOptions)}unbreakscapeText(e,r){if(!e)return e;let n=Object.assign({},r);this.checkBrowserFileWrite(n.outputFile);let o=W(),a=this.maybeReadFile(e,n.inputFormat),s=o.unbreakscape_text(a,Nt(n.textFormat),n.textLocation??"body");return this.deliver(s,n.outputFile,n.fileOptions)}convertText(e,r){let n=Object.assign({},r),o=Object.assign({},n.jsonOptions);this.checkBrowserFileWrite(n.outputFile);let a=W(),s=n.textFormat===void 0||Nt(n.textFormat)==="bitmark++",i=n.textLocation??"body",c,d;if(typeof e=="string"?(c=this.maybeReadFile(e,n.inputFormat),d=this.parseTextAstString(c)):(c=JSON.stringify(e),d=Array.isArray(e)?e:void 0),d!==void 0){let b=s?a.convert_text(JSON.stringify(d),"astToText","bitmark++",i):a.convert_text(JSON.stringify(d),"astToPlainText","plainText",i);return this.deliver(b,n.outputFile,n.fileOptions)}let g=a.convert_text(c,"textToAst",s?"bitmark++":"plainText","body"),{pretty:l,indent:f}=ut(o.prettify),m=l?a.prettify(g,f):g;return n.outputFile?this.deliver(m,n.outputFile,n.fileOptions):l?m:JSON.parse(g)}textAstToPlainText(e,r){return W().convert_text(typeof e=="string"?e:JSON.stringify(e),"astToPlainText","bitmark++","body")}extractPlainText(e,r){let n=r?.inputFormat,o=W();if(n==="plainText")return typeof e=="string"?String(e):"";if(n==="bitmarkText"){let c=o.convert_text(String(e),"textToAst","bitmark++","body");return o.convert_text(c,"astToPlainText","bitmark++","body")}if(typeof e=="string"&&this.parseTextAstString(e)===void 0&&!o.is_bitmark(e)&&!(()=>{try{return JSON.parse(e),!0}catch{return false}})())return this.extractPlainText(e,{inputFormat:"bitmarkText"});let{source:a,isBitmark:s}=this.resolveInput(e,void 0);return o.convert(a,s?"bitmark":"json","text","optimized",false,2,1,false,false,"","")}parseTextAstString(e){let r=e.trim();if(r.startsWith("["))try{let n=JSON.parse(r);if(Array.isArray(n)&&n.every(o=>o!==null&&typeof o=="object"&&"type"in o))return n}catch{}}resolveInput(e,r){if(typeof e!="string"){let a=this.jsonEntries(e);return {source:JSON.stringify(a?a.map(s=>this.toWrapperEntry(s)):e),isBitmark:false}}let n=this.maybeReadFile(e,r);if(W().is_bitmark(n))return {source:n,isBitmark:true};try{let a=JSON.parse(n),s=this.jsonEntries(a);if(s)return {source:JSON.stringify(s.map(i=>this.toWrapperEntry(i))),isBitmark:!1}}catch{return {source:n,isBitmark:true}}return {source:n,isBitmark:false}}jsonEntries(e){if(Array.isArray(e))return e;if(e!==null&&typeof e=="object"){let r=e;if(Array.isArray(r.bits))return r.bits;if("bit"in r)return [r];if(typeof r.type=="string")return [{bit:r}]}}toWrapperEntry(e){if(e!==null&&typeof e=="object"&&"bit"in e)return e;let r={bit:e},n=e?.[pe];return n!==void 0&&(r.parser=n),r}maybeReadFile(e,r){if(r==="string")return e;return e;}checkBrowserFileWrite(e){if(e&&true)throw new Error("Cannot write to file in browser environment")}deliver(e,r,n){if(!r)return e;throw new Error("Cannot write to file in browser environment");}};function _e(t){let e=[],r=t.toLowerCase(),n=0;for(;;){let o=r.indexOf("<table",n);if(o===-1)break;let a=0,s=o,i=-1;for(;s<t.length;){let c=r.indexOf("<table",s),d=r.indexOf("</table",s);if(d===-1)break;if(c!==-1&&c<d)a++,s=c+6;else {a--;let g=r.indexOf(">",d);if(s=g===-1?t.length:g+1,a===0){i=s;break}}}if(i===-1)break;e.push(t.slice(o,i)),n=i;}return e}function Me(t){let e=W().convert_text(t,"textToAst","bitmark++","body");return JSON.parse(e)}var M={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 D(t){return (e,r,n)=>{if(!r)return;let{value:o,...a}=r,s={[t.valueField]:o??""};for(let[i,c]of Object.entries(a))c!==void 0&&(s[i]=c);return {type:t.type,[t.key]:s}}}var Ne=Object.fromEntries(Object.values(M).map(t=>[t.type,t])),Ut=class{constructor(){J(this,"imageResource",D(M.imageResource));J(this,"imageLinkResource",D(M.imageLinkResource));J(this,"audioResource",D(M.audioResource));J(this,"audioEmbedResource",D(M.audioEmbedResource));J(this,"audioLinkResource",D(M.audioLinkResource));J(this,"videoResource",D(M.videoResource));J(this,"videoEmbedResource",D(M.videoEmbedResource));J(this,"videoLinkResource",D(M.videoLinkResource));J(this,"stillImageFilmEmbedResource",D(M.stillImageFilmEmbedResource));J(this,"stillImageFilmLinkResource",D(M.stillImageFilmLinkResource));J(this,"articleResource",D(M.articleResource));J(this,"documentResource",D(M.documentResource));J(this,"documentEmbedResource",D(M.documentEmbedResource));J(this,"documentLinkResource",D(M.documentLinkResource));J(this,"documentDownloadResource",D(M.documentDownloadResource));J(this,"appLinkResource",D(M.appLinkResource));J(this,"websiteLinkResource",D(M.websiteLinkResource));}resourceFromResourceJson(e,r){if(!r)return;let n=!Array.isArray(r),o=n?[r]:r,a=[];for(let s of o){let i=Ne[s.type];if(!i)continue;let c=s[i.key]??{},{[i.valueField]:d,...g}=c,l=D(i)(void 0,{value:d,...g});l&&a.push(l);}if(a.length!==0)return n?a[0]:a}resourceFromResourceDataJson(e,r,n){if(!n)return;let o=Ne[r];if(!o)return;let a=typeof n=="string"?n:void 0,s=typeof n=="object"?n:{},{url:i,src:c,body:d,...g}=s,l=i??c??d??a;return D(o)(e,{value:l,...g})}};var Nr={string:"string",file:"file"},Vr={bitmark:"bitmark",json:"json",ast:"ast",text:"text"},Hr={bitmark:"bitmark",bitmarkText:"bitmarkText",plainText:"plainText",html:"html"},Ur={v2:2,v3:3},Gr={v1:1,v2:2},zr={peggy:"peggy"},Kr={list:"list",deprecated:"deprecated",all:"all",bit:"bit"},$r={text:"text",json:"json",pojo:"pojo"},qr={plainText:"text",latex:"latex",json:"json",xml:"xml",bitmarkPlusPlus:"bitmark++"},Yr={tag:"tag",body:"body"};var Ve={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"},He={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 Xr(t){return t.replace(/-([a-z0-9])/gu,(e,r)=>r.toUpperCase())}var ce;function Ft(){if(!ce){let t=W(),e=JSON.parse(t.info("all","json","",false,2,true,false,false,"")),r={_standard:"_standard"};for(let{name:n}of e)r[Xr(n)]=n;ce=r;}return ce}var Ue=new Proxy({},{get:(t,e)=>typeof e=="string"?Ft()[e]:void 0,has:(t,e)=>typeof e=="string"&&e in Ft(),ownKeys:()=>Reflect.ownKeys(Ft()),getOwnPropertyDescriptor:(t,e)=>typeof e=="string"&&e in Ft()?{value:Ft()[e],enumerable:true,configurable:true,writable:false}:void 0});function Ge(t,e){return new Proxy({},{get:(r,n)=>n===Symbol.toPrimitive||n==="toString"||n===Symbol.toStringTag?()=>`[unsupported ${t}]`:at(t,e),has:()=>at(t,e),ownKeys:()=>at(t,e)})}var ze=Ge("NodeType","it names bpg's internal AST nodes; the legacy AST is bit JSON (see createAst)"),Ke=Ge("BoundingBoxIndex","bpg-internal bounding-box utility");function $(t,e){return class{constructor(){at(t,e);}}}var Qr="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",$e=$("Ast",Qr),qe=$("BitmarkGenerator",q),Ye=$("BitmarkStringGenerator",q),Xe=$("BitmarkFileGenerator",q),Qe=$("JsonGenerator",q),Ze=$("JsonStringGenerator",q),tn=$("JsonFileGenerator",q),en=$("HtmlTableGenerator",q),nn=$("HtmlTableParser",q),rn=$("BitmarkParser",q),on=$("JsonParser",q),sn=$("StringWriter",q),an=$("FileWriter",q),pn=$("StreamWriter",q);var cn={Error:1,Warning:2,Information:3,Hint:4},un={Class:7,Property:10,Value:12,Keyword:14,Snippet:15,EnumMember:20,TypeParameter:25},dn={Deprecated:1};function Zr(t,e,r){return r===void 0?{path:t,op:e}:{path:t,op:e,value:r}}var to="all";function eo(t,e={}){let r=C().convert(t,"bitmark","json",e.mode??"optimized",false,2,1,e.includeUnknownProperties??false,false,"","");return JSON.parse(r)}function no(t,e={}){let r=t.map(o=>o!==null&&typeof o=="object"&&"bit"in o&&typeof o.bit=="object"?o:{bit:o});return C().convert(JSON.stringify(r),"json","bitmark",e.mode??"optimized",false,2,1,false,false,"","")}function ue(t,e={}){return C().convert(t,e.inputFormat??"auto",e.outputFormat??"auto",e.mode??"optimized",e.pretty??false,e.indent??2,e.spacesAroundValues??1,e.includeUnknownProperties??false,e.mappingReport??false,e.positionEncoding??"",e.tokensLayout??"")}function ro(t,e={}){return JSON.parse(ue(t,{inputFormat:"bitmark",outputFormat:"semantic-tokens",positionEncoding:e.positionEncoding,tokensLayout:e.tokensLayout}))}function oo(t,e={}){return JSON.parse(ue(t,{inputFormat:"bitmark",outputFormat:"diagnostics",positionEncoding:e.positionEncoding}))}function io(t,e,r={}){let n=C();if(typeof n.complete!="function")throw new it("complete",et());return JSON.parse(n.complete(t,e.line,e.character,r.positionEncoding??"",r.includeDeprecated??false,r.triggerCharacter??""))}function so(t,e,r,n={}){let o=C();if(typeof o.resolve!="function")throw new it("resolve",et());return JSON.parse(o.resolve(t,e.line,e.character,n.positionEncoding??"",n.includeDeprecated??false,r.label,r.kind))??r}function ao(t,e,r={}){let n=C();if(typeof n.hover!="function")throw new it("hover",et());return JSON.parse(n.hover(t,e.line,e.character,r.positionEncoding??""))}function po(t,e={}){return C().canonicalize(t,e.inputFormat??"auto",e.mode??"optimized",e.pretty??false,e.indent??2,e.spacesAroundValues??1)}function _o(t){return Number.parseInt(C().count_bits(t),10)}function co(t){return JSON.parse(C().split_bits(t))}function uo(t,e={}){let r=C();if(e.preHook||e.postHook)return Be(r,t,e);let n=e.patch===void 0?"":typeof e.patch=="string"?e.patch:JSON.stringify(e.patch);return r.transform(t,e.inputFormat??"auto",e.outputFormat??"json",e.mode??"optimized",n,e.pretty??false,e.indent??2,e.spacesAroundValues??1)}function ln(t,e,r={}){let n=C();if(typeof n.diff!="function")throw new it("diff",et());return n.diff(t,e,r.inputFormat??"auto",r.outputFormat??"bitmark",r.context??3,r.locate??false,r.similarity??.6,r.bboxTolerance??8,r.spacesAroundValues??0)}function lo(t,e,r={}){return JSON.parse(ln(t,e,{...r,outputFormat:"json"}))}function go(t,e={}){let r=e.format??"bitmark++",n=e.location??"body";return C().breakscape_text(t,r,n)}function fo(t,e={}){let r=e.format??"bitmark++",n=e.location??"body";return C().unbreakscape_text(t,r,n)}function mo(t={}){let e=t.infoType??"list",r=t.format??"text",n=t.bit??"",o=t.pretty??false,a=t.indent??2,s=t.includeDeprecated??false,i=t.onlyDeprecated??false,c=t.full??false,d=typeof t.language=="string"?t.language:t.language?.join(",")??"",g=C();if(r!=="json"&&typeof g.info_text_supported!="function")throw new it('info (format: "text")',et());return g.info(e,r,n,o,a,s,i,c,d)}function bo(t){try{C().register(t.type,t.data);}catch(e){throw new dt(e instanceof Error?e.message:String(e))}Se(t.type,t.data);}var xo="./wasm/",gn={full:{init:Kt,initSync:zt,ns:$t,wasmFile:"bitmark_wasm_bg.wasm"},"browser-full":{init:Yt,initSync:qt,ns:Xt,wasmFile:"bitmark_browser_full_wasm_bg.wasm"},"bitmark-json":{init:Zt,initSync:Qt,ns:te,wasmFile:"bitmark_json_wasm_bg.wasm"}};Ae(()=>C());function de(t){return t===void 0?ee:"full"}function yo(t){if(t===null||typeof t!="object")return false;if("feature"in t||"module_or_path"in t)return true;let e=Object.getPrototypeOf(t);return (e===Object.prototype||e===null)&&Object.keys(t).length===0}function wo(t){if(yo(t))return {feature:t.feature??de(t.module_or_path),module_or_path:t.module_or_path};let e=t??void 0;return {feature:de(e),module_or_path:e}}var le=0,Gt,st;async function $i(t){let{feature:e,module_or_path:r}=wo(t);if(r===void 0){if(!st&&et()===e)return Gt;if(st?.feature===e)return st.promise}let n=++le,o=gn[e],a=r??new URL(`${xo}${o.wasmFile}?v=${Ot.version}`,import.meta.url),s=(async()=>{try{let i=await o.init({module_or_path:a});n===le&&(ne(e,o.ns),Gt=i);}finally{st?.seq===n&&(st=void 0);}for(;st;)await st.promise.catch(()=>{});return Gt})();return st={feature:e,seq:n,promise:s},s}function qi(t,e={}){let r=e.feature??de(t),n=gn[r],o=n.initSync({module:t});return ++le,st=void 0,ne(r,n.ns),Gt=o,o}function Yi(){return Ot.version}function Xi(t,e={}){let r=C(),n=et()??ee;return Pe(r,t,e,(o,a)=>Le(o,a,n))}export{to as ALL_LANGUAGES,un as CompletionItemKind,dn as CompletionItemTag,cn as DiagnosticSeverity,Ct as NotInitializedError,dt as RegisterError,it as UnsupportedFeatureError,eo as bitmarkToObjects,go as breakscapeText,po as canonicalize,io as complete,ue as convert,_o as countBits,oo as diagnostics,ln as diff,lo as diffBits,ao as hover,mo as info,$i as init,qi as initSync,_n as legacy,no as objectsToBitmark,Zr as patchEntry,bo as register,so as resolve,ro as semanticTokens,co as splitBits,uo as transform,Xi as transformParallel,fo as unbreakscapeText,et as variant,Yi as version};//# sourceMappingURL=bitmark-parser.min.js.map