UNPKG

@ulb-darmstadt/shacl-form

Version:
7 lines 729 kB
var Mi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function cg(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function dg(i){if(Object.prototype.hasOwnProperty.call(i,"__esModule"))return i;var e=i.default;if(typeof e=="function"){var n=function r(){var o=!1;try{o=this instanceof r}catch{}return o?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(i).forEach(function(r){var o=Object.getOwnPropertyDescriptor(i,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return i[r]}})}),n}var So={},or={},Zu;function hg(){if(Zu)return or;Zu=1,or.byteLength=u,or.toByteArray=h,or.fromByteArray=d;for(var i=[],e=[],n=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=r.length;o<a;++o)i[o]=r[o],e[r.charCodeAt(o)]=o;e[45]=62,e[95]=63;function l(g){var b=g.length;if(b%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var T=g.indexOf("=");T===-1&&(T=b);var N=T===b?0:4-T%4;return[T,N]}function u(g){var b=l(g),T=b[0],N=b[1];return(T+N)*3/4-N}function f(g,b,T){return(b+T)*3/4-T}function h(g){var b,T=l(g),N=T[0],A=T[1],R=new n(f(g,N,A)),S=0,y=A>0?N-4:N,x;for(x=0;x<y;x+=4)b=e[g.charCodeAt(x)]<<18|e[g.charCodeAt(x+1)]<<12|e[g.charCodeAt(x+2)]<<6|e[g.charCodeAt(x+3)],R[S++]=b>>16&255,R[S++]=b>>8&255,R[S++]=b&255;return A===2&&(b=e[g.charCodeAt(x)]<<2|e[g.charCodeAt(x+1)]>>4,R[S++]=b&255),A===1&&(b=e[g.charCodeAt(x)]<<10|e[g.charCodeAt(x+1)]<<4|e[g.charCodeAt(x+2)]>>2,R[S++]=b>>8&255,R[S++]=b&255),R}function m(g){return i[g>>18&63]+i[g>>12&63]+i[g>>6&63]+i[g&63]}function _(g,b,T){for(var N,A=[],R=b;R<T;R+=3)N=(g[R]<<16&16711680)+(g[R+1]<<8&65280)+(g[R+2]&255),A.push(m(N));return A.join("")}function d(g){for(var b,T=g.length,N=T%3,A=[],R=16383,S=0,y=T-N;S<y;S+=R)A.push(_(g,S,S+R>y?y:S+R));return N===1?(b=g[T-1],A.push(i[b>>2]+i[b<<4&63]+"==")):N===2&&(b=(g[T-2]<<8)+g[T-1],A.push(i[b>>10]+i[b>>4&63]+i[b<<2&63]+"=")),A.join("")}return or}var cs={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var Xu;function fg(){return Xu||(Xu=1,cs.read=function(i,e,n,r,o){var a,l,u=o*8-r-1,f=(1<<u)-1,h=f>>1,m=-7,_=n?o-1:0,d=n?-1:1,g=i[e+_];for(_+=d,a=g&(1<<-m)-1,g>>=-m,m+=u;m>0;a=a*256+i[e+_],_+=d,m-=8);for(l=a&(1<<-m)-1,a>>=-m,m+=r;m>0;l=l*256+i[e+_],_+=d,m-=8);if(a===0)a=1-h;else{if(a===f)return l?NaN:(g?-1:1)*(1/0);l=l+Math.pow(2,r),a=a-h}return(g?-1:1)*l*Math.pow(2,a-r)},cs.write=function(i,e,n,r,o,a){var l,u,f,h=a*8-o-1,m=(1<<h)-1,_=m>>1,d=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=r?0:a-1,b=r?1:-1,T=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,l=m):(l=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-l))<1&&(l--,f*=2),l+_>=1?e+=d/f:e+=d*Math.pow(2,1-_),e*f>=2&&(l++,f/=2),l+_>=m?(u=0,l=m):l+_>=1?(u=(e*f-1)*Math.pow(2,o),l=l+_):(u=e*Math.pow(2,_-1)*Math.pow(2,o),l=0));o>=8;i[n+g]=u&255,g+=b,u/=256,o-=8);for(l=l<<o|u,h+=o;h>0;i[n+g]=l&255,g+=b,l/=256,h-=8);i[n+g-b]|=T*128}),cs}/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <https://feross.org> * @license MIT */var Qu;function Rn(){return Qu||(Qu=1,(function(i){const e=hg(),n=fg(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;i.Buffer=u,i.SlowBuffer=R,i.INSPECT_MAX_BYTES=50;const o=2147483647;i.kMaxLength=o,u.TYPED_ARRAY_SUPPORT=a(),!u.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{const C=new Uint8Array(1),v={foo:function(){return 42}};return Object.setPrototypeOf(v,Uint8Array.prototype),Object.setPrototypeOf(C,v),C.foo()===42}catch{return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}});function l(C){if(C>o)throw new RangeError('The value "'+C+'" is invalid for option "size"');const v=new Uint8Array(C);return Object.setPrototypeOf(v,u.prototype),v}function u(C,v,w){if(typeof C=="number"){if(typeof v=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return _(C)}return f(C,v,w)}u.poolSize=8192;function f(C,v,w){if(typeof C=="string")return d(C,v);if(ArrayBuffer.isView(C))return b(C);if(C==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof C);if(ve(C,ArrayBuffer)||C&&ve(C.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ve(C,SharedArrayBuffer)||C&&ve(C.buffer,SharedArrayBuffer)))return T(C,v,w);if(typeof C=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const H=C.valueOf&&C.valueOf();if(H!=null&&H!==C)return u.from(H,v,w);const re=N(C);if(re)return re;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof C[Symbol.toPrimitive]=="function")return u.from(C[Symbol.toPrimitive]("string"),v,w);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof C)}u.from=function(C,v,w){return f(C,v,w)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array);function h(C){if(typeof C!="number")throw new TypeError('"size" argument must be of type number');if(C<0)throw new RangeError('The value "'+C+'" is invalid for option "size"')}function m(C,v,w){return h(C),C<=0?l(C):v!==void 0?typeof w=="string"?l(C).fill(v,w):l(C).fill(v):l(C)}u.alloc=function(C,v,w){return m(C,v,w)};function _(C){return h(C),l(C<0?0:A(C)|0)}u.allocUnsafe=function(C){return _(C)},u.allocUnsafeSlow=function(C){return _(C)};function d(C,v){if((typeof v!="string"||v==="")&&(v="utf8"),!u.isEncoding(v))throw new TypeError("Unknown encoding: "+v);const w=S(C,v)|0;let H=l(w);const re=H.write(C,v);return re!==w&&(H=H.slice(0,re)),H}function g(C){const v=C.length<0?0:A(C.length)|0,w=l(v);for(let H=0;H<v;H+=1)w[H]=C[H]&255;return w}function b(C){if(ve(C,Uint8Array)){const v=new Uint8Array(C);return T(v.buffer,v.byteOffset,v.byteLength)}return g(C)}function T(C,v,w){if(v<0||C.byteLength<v)throw new RangeError('"offset" is outside of buffer bounds');if(C.byteLength<v+(w||0))throw new RangeError('"length" is outside of buffer bounds');let H;return v===void 0&&w===void 0?H=new Uint8Array(C):w===void 0?H=new Uint8Array(C,v):H=new Uint8Array(C,v,w),Object.setPrototypeOf(H,u.prototype),H}function N(C){if(u.isBuffer(C)){const v=A(C.length)|0,w=l(v);return w.length===0||C.copy(w,0,0,v),w}if(C.length!==void 0)return typeof C.length!="number"||$e(C.length)?l(0):g(C);if(C.type==="Buffer"&&Array.isArray(C.data))return g(C.data)}function A(C){if(C>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return C|0}function R(C){return+C!=C&&(C=0),u.alloc(+C)}u.isBuffer=function(v){return v!=null&&v._isBuffer===!0&&v!==u.prototype},u.compare=function(v,w){if(ve(v,Uint8Array)&&(v=u.from(v,v.offset,v.byteLength)),ve(w,Uint8Array)&&(w=u.from(w,w.offset,w.byteLength)),!u.isBuffer(v)||!u.isBuffer(w))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(v===w)return 0;let H=v.length,re=w.length;for(let _e=0,we=Math.min(H,re);_e<we;++_e)if(v[_e]!==w[_e]){H=v[_e],re=w[_e];break}return H<re?-1:re<H?1:0},u.isEncoding=function(v){switch(String(v).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(v,w){if(!Array.isArray(v))throw new TypeError('"list" argument must be an Array of Buffers');if(v.length===0)return u.alloc(0);let H;if(w===void 0)for(w=0,H=0;H<v.length;++H)w+=v[H].length;const re=u.allocUnsafe(w);let _e=0;for(H=0;H<v.length;++H){let we=v[H];if(ve(we,Uint8Array))_e+we.length>re.length?(u.isBuffer(we)||(we=u.from(we)),we.copy(re,_e)):Uint8Array.prototype.set.call(re,we,_e);else if(u.isBuffer(we))we.copy(re,_e);else throw new TypeError('"list" argument must be an Array of Buffers');_e+=we.length}return re};function S(C,v){if(u.isBuffer(C))return C.length;if(ArrayBuffer.isView(C)||ve(C,ArrayBuffer))return C.byteLength;if(typeof C!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof C);const w=C.length,H=arguments.length>2&&arguments[2]===!0;if(!H&&w===0)return 0;let re=!1;for(;;)switch(v){case"ascii":case"latin1":case"binary":return w;case"utf8":case"utf-8":return Se(C).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w*2;case"hex":return w>>>1;case"base64":return be(C).length;default:if(re)return H?-1:Se(C).length;v=(""+v).toLowerCase(),re=!0}}u.byteLength=S;function y(C,v,w){let H=!1;if((v===void 0||v<0)&&(v=0),v>this.length||((w===void 0||w>this.length)&&(w=this.length),w<=0)||(w>>>=0,v>>>=0,w<=v))return"";for(C||(C="utf8");;)switch(C){case"hex":return ae(this,v,w);case"utf8":case"utf-8":return B(this,v,w);case"ascii":return oe(this,v,w);case"latin1":case"binary":return j(this,v,w);case"base64":return F(this,v,w);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,v,w);default:if(H)throw new TypeError("Unknown encoding: "+C);C=(C+"").toLowerCase(),H=!0}}u.prototype._isBuffer=!0;function x(C,v,w){const H=C[v];C[v]=C[w],C[w]=H}u.prototype.swap16=function(){const v=this.length;if(v%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let w=0;w<v;w+=2)x(this,w,w+1);return this},u.prototype.swap32=function(){const v=this.length;if(v%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let w=0;w<v;w+=4)x(this,w,w+3),x(this,w+1,w+2);return this},u.prototype.swap64=function(){const v=this.length;if(v%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let w=0;w<v;w+=8)x(this,w,w+7),x(this,w+1,w+6),x(this,w+2,w+5),x(this,w+3,w+4);return this},u.prototype.toString=function(){const v=this.length;return v===0?"":arguments.length===0?B(this,0,v):y.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(v){if(!u.isBuffer(v))throw new TypeError("Argument must be a Buffer");return this===v?!0:u.compare(this,v)===0},u.prototype.inspect=function(){let v="";const w=i.INSPECT_MAX_BYTES;return v=this.toString("hex",0,w).replace(/(.{2})/g,"$1 ").trim(),this.length>w&&(v+=" ... "),"<Buffer "+v+">"},r&&(u.prototype[r]=u.prototype.inspect),u.prototype.compare=function(v,w,H,re,_e){if(ve(v,Uint8Array)&&(v=u.from(v,v.offset,v.byteLength)),!u.isBuffer(v))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof v);if(w===void 0&&(w=0),H===void 0&&(H=v?v.length:0),re===void 0&&(re=0),_e===void 0&&(_e=this.length),w<0||H>v.length||re<0||_e>this.length)throw new RangeError("out of range index");if(re>=_e&&w>=H)return 0;if(re>=_e)return-1;if(w>=H)return 1;if(w>>>=0,H>>>=0,re>>>=0,_e>>>=0,this===v)return 0;let we=_e-re,Oe=H-w;const Ye=Math.min(we,Oe),Qe=this.slice(re,_e),We=v.slice(w,H);for(let Ze=0;Ze<Ye;++Ze)if(Qe[Ze]!==We[Ze]){we=Qe[Ze],Oe=We[Ze];break}return we<Oe?-1:Oe<we?1:0};function D(C,v,w,H,re){if(C.length===0)return-1;if(typeof w=="string"?(H=w,w=0):w>2147483647?w=2147483647:w<-2147483648&&(w=-2147483648),w=+w,$e(w)&&(w=re?0:C.length-1),w<0&&(w=C.length+w),w>=C.length){if(re)return-1;w=C.length-1}else if(w<0)if(re)w=0;else return-1;if(typeof v=="string"&&(v=u.from(v,H)),u.isBuffer(v))return v.length===0?-1:U(C,v,w,H,re);if(typeof v=="number")return v=v&255,typeof Uint8Array.prototype.indexOf=="function"?re?Uint8Array.prototype.indexOf.call(C,v,w):Uint8Array.prototype.lastIndexOf.call(C,v,w):U(C,[v],w,H,re);throw new TypeError("val must be string, number or Buffer")}function U(C,v,w,H,re){let _e=1,we=C.length,Oe=v.length;if(H!==void 0&&(H=String(H).toLowerCase(),H==="ucs2"||H==="ucs-2"||H==="utf16le"||H==="utf-16le")){if(C.length<2||v.length<2)return-1;_e=2,we/=2,Oe/=2,w/=2}function Ye(We,Ze){return _e===1?We[Ze]:We.readUInt16BE(Ze*_e)}let Qe;if(re){let We=-1;for(Qe=w;Qe<we;Qe++)if(Ye(C,Qe)===Ye(v,We===-1?0:Qe-We)){if(We===-1&&(We=Qe),Qe-We+1===Oe)return We*_e}else We!==-1&&(Qe-=Qe-We),We=-1}else for(w+Oe>we&&(w=we-Oe),Qe=w;Qe>=0;Qe--){let We=!0;for(let Ze=0;Ze<Oe;Ze++)if(Ye(C,Qe+Ze)!==Ye(v,Ze)){We=!1;break}if(We)return Qe}return-1}u.prototype.includes=function(v,w,H){return this.indexOf(v,w,H)!==-1},u.prototype.indexOf=function(v,w,H){return D(this,v,w,H,!0)},u.prototype.lastIndexOf=function(v,w,H){return D(this,v,w,H,!1)};function O(C,v,w,H){w=Number(w)||0;const re=C.length-w;H?(H=Number(H),H>re&&(H=re)):H=re;const _e=v.length;H>_e/2&&(H=_e/2);let we;for(we=0;we<H;++we){const Oe=parseInt(v.substr(we*2,2),16);if($e(Oe))return we;C[w+we]=Oe}return we}function Q(C,v,w,H){return Ne(Se(v,C.length-w),C,w,H)}function M(C,v,w,H){return Ne(Ie(v),C,w,H)}function $(C,v,w,H){return Ne(be(v),C,w,H)}function X(C,v,w,H){return Ne(se(v,C.length-w),C,w,H)}u.prototype.write=function(v,w,H,re){if(w===void 0)re="utf8",H=this.length,w=0;else if(H===void 0&&typeof w=="string")re=w,H=this.length,w=0;else if(isFinite(w))w=w>>>0,isFinite(H)?(H=H>>>0,re===void 0&&(re="utf8")):(re=H,H=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const _e=this.length-w;if((H===void 0||H>_e)&&(H=_e),v.length>0&&(H<0||w<0)||w>this.length)throw new RangeError("Attempt to write outside buffer bounds");re||(re="utf8");let we=!1;for(;;)switch(re){case"hex":return O(this,v,w,H);case"utf8":case"utf-8":return Q(this,v,w,H);case"ascii":case"latin1":case"binary":return M(this,v,w,H);case"base64":return $(this,v,w,H);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return X(this,v,w,H);default:if(we)throw new TypeError("Unknown encoding: "+re);re=(""+re).toLowerCase(),we=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function F(C,v,w){return v===0&&w===C.length?e.fromByteArray(C):e.fromByteArray(C.slice(v,w))}function B(C,v,w){w=Math.min(C.length,w);const H=[];let re=v;for(;re<w;){const _e=C[re];let we=null,Oe=_e>239?4:_e>223?3:_e>191?2:1;if(re+Oe<=w){let Ye,Qe,We,Ze;switch(Oe){case 1:_e<128&&(we=_e);break;case 2:Ye=C[re+1],(Ye&192)===128&&(Ze=(_e&31)<<6|Ye&63,Ze>127&&(we=Ze));break;case 3:Ye=C[re+1],Qe=C[re+2],(Ye&192)===128&&(Qe&192)===128&&(Ze=(_e&15)<<12|(Ye&63)<<6|Qe&63,Ze>2047&&(Ze<55296||Ze>57343)&&(we=Ze));break;case 4:Ye=C[re+1],Qe=C[re+2],We=C[re+3],(Ye&192)===128&&(Qe&192)===128&&(We&192)===128&&(Ze=(_e&15)<<18|(Ye&63)<<12|(Qe&63)<<6|We&63,Ze>65535&&Ze<1114112&&(we=Ze))}}we===null?(we=65533,Oe=1):we>65535&&(we-=65536,H.push(we>>>10&1023|55296),we=56320|we&1023),H.push(we),re+=Oe}return P(H)}const ue=4096;function P(C){const v=C.length;if(v<=ue)return String.fromCharCode.apply(String,C);let w="",H=0;for(;H<v;)w+=String.fromCharCode.apply(String,C.slice(H,H+=ue));return w}function oe(C,v,w){let H="";w=Math.min(C.length,w);for(let re=v;re<w;++re)H+=String.fromCharCode(C[re]&127);return H}function j(C,v,w){let H="";w=Math.min(C.length,w);for(let re=v;re<w;++re)H+=String.fromCharCode(C[re]);return H}function ae(C,v,w){const H=C.length;(!v||v<0)&&(v=0),(!w||w<0||w>H)&&(w=H);let re="";for(let _e=v;_e<w;++_e)re+=mt[C[_e]];return re}function I(C,v,w){const H=C.slice(v,w);let re="";for(let _e=0;_e<H.length-1;_e+=2)re+=String.fromCharCode(H[_e]+H[_e+1]*256);return re}u.prototype.slice=function(v,w){const H=this.length;v=~~v,w=w===void 0?H:~~w,v<0?(v+=H,v<0&&(v=0)):v>H&&(v=H),w<0?(w+=H,w<0&&(w=0)):w>H&&(w=H),w<v&&(w=v);const re=this.subarray(v,w);return Object.setPrototypeOf(re,u.prototype),re};function Z(C,v,w){if(C%1!==0||C<0)throw new RangeError("offset is not uint");if(C+v>w)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(v,w,H){v=v>>>0,w=w>>>0,H||Z(v,w,this.length);let re=this[v],_e=1,we=0;for(;++we<w&&(_e*=256);)re+=this[v+we]*_e;return re},u.prototype.readUintBE=u.prototype.readUIntBE=function(v,w,H){v=v>>>0,w=w>>>0,H||Z(v,w,this.length);let re=this[v+--w],_e=1;for(;w>0&&(_e*=256);)re+=this[v+--w]*_e;return re},u.prototype.readUint8=u.prototype.readUInt8=function(v,w){return v=v>>>0,w||Z(v,1,this.length),this[v]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(v,w){return v=v>>>0,w||Z(v,2,this.length),this[v]|this[v+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(v,w){return v=v>>>0,w||Z(v,2,this.length),this[v]<<8|this[v+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(v,w){return v=v>>>0,w||Z(v,4,this.length),(this[v]|this[v+1]<<8|this[v+2]<<16)+this[v+3]*16777216},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(v,w){return v=v>>>0,w||Z(v,4,this.length),this[v]*16777216+(this[v+1]<<16|this[v+2]<<8|this[v+3])},u.prototype.readBigUInt64LE=Be(function(v){v=v>>>0,q(v,"offset");const w=this[v],H=this[v+7];(w===void 0||H===void 0)&&te(v,this.length-8);const re=w+this[++v]*2**8+this[++v]*2**16+this[++v]*2**24,_e=this[++v]+this[++v]*2**8+this[++v]*2**16+H*2**24;return BigInt(re)+(BigInt(_e)<<BigInt(32))}),u.prototype.readBigUInt64BE=Be(function(v){v=v>>>0,q(v,"offset");const w=this[v],H=this[v+7];(w===void 0||H===void 0)&&te(v,this.length-8);const re=w*2**24+this[++v]*2**16+this[++v]*2**8+this[++v],_e=this[++v]*2**24+this[++v]*2**16+this[++v]*2**8+H;return(BigInt(re)<<BigInt(32))+BigInt(_e)}),u.prototype.readIntLE=function(v,w,H){v=v>>>0,w=w>>>0,H||Z(v,w,this.length);let re=this[v],_e=1,we=0;for(;++we<w&&(_e*=256);)re+=this[v+we]*_e;return _e*=128,re>=_e&&(re-=Math.pow(2,8*w)),re},u.prototype.readIntBE=function(v,w,H){v=v>>>0,w=w>>>0,H||Z(v,w,this.length);let re=w,_e=1,we=this[v+--re];for(;re>0&&(_e*=256);)we+=this[v+--re]*_e;return _e*=128,we>=_e&&(we-=Math.pow(2,8*w)),we},u.prototype.readInt8=function(v,w){return v=v>>>0,w||Z(v,1,this.length),this[v]&128?(255-this[v]+1)*-1:this[v]},u.prototype.readInt16LE=function(v,w){v=v>>>0,w||Z(v,2,this.length);const H=this[v]|this[v+1]<<8;return H&32768?H|4294901760:H},u.prototype.readInt16BE=function(v,w){v=v>>>0,w||Z(v,2,this.length);const H=this[v+1]|this[v]<<8;return H&32768?H|4294901760:H},u.prototype.readInt32LE=function(v,w){return v=v>>>0,w||Z(v,4,this.length),this[v]|this[v+1]<<8|this[v+2]<<16|this[v+3]<<24},u.prototype.readInt32BE=function(v,w){return v=v>>>0,w||Z(v,4,this.length),this[v]<<24|this[v+1]<<16|this[v+2]<<8|this[v+3]},u.prototype.readBigInt64LE=Be(function(v){v=v>>>0,q(v,"offset");const w=this[v],H=this[v+7];(w===void 0||H===void 0)&&te(v,this.length-8);const re=this[v+4]+this[v+5]*2**8+this[v+6]*2**16+(H<<24);return(BigInt(re)<<BigInt(32))+BigInt(w+this[++v]*2**8+this[++v]*2**16+this[++v]*2**24)}),u.prototype.readBigInt64BE=Be(function(v){v=v>>>0,q(v,"offset");const w=this[v],H=this[v+7];(w===void 0||H===void 0)&&te(v,this.length-8);const re=(w<<24)+this[++v]*2**16+this[++v]*2**8+this[++v];return(BigInt(re)<<BigInt(32))+BigInt(this[++v]*2**24+this[++v]*2**16+this[++v]*2**8+H)}),u.prototype.readFloatLE=function(v,w){return v=v>>>0,w||Z(v,4,this.length),n.read(this,v,!0,23,4)},u.prototype.readFloatBE=function(v,w){return v=v>>>0,w||Z(v,4,this.length),n.read(this,v,!1,23,4)},u.prototype.readDoubleLE=function(v,w){return v=v>>>0,w||Z(v,8,this.length),n.read(this,v,!0,52,8)},u.prototype.readDoubleBE=function(v,w){return v=v>>>0,w||Z(v,8,this.length),n.read(this,v,!1,52,8)};function ie(C,v,w,H,re,_e){if(!u.isBuffer(C))throw new TypeError('"buffer" argument must be a Buffer instance');if(v>re||v<_e)throw new RangeError('"value" argument is out of bounds');if(w+H>C.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(v,w,H,re){if(v=+v,w=w>>>0,H=H>>>0,!re){const Oe=Math.pow(2,8*H)-1;ie(this,v,w,H,Oe,0)}let _e=1,we=0;for(this[w]=v&255;++we<H&&(_e*=256);)this[w+we]=v/_e&255;return w+H},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(v,w,H,re){if(v=+v,w=w>>>0,H=H>>>0,!re){const Oe=Math.pow(2,8*H)-1;ie(this,v,w,H,Oe,0)}let _e=H-1,we=1;for(this[w+_e]=v&255;--_e>=0&&(we*=256);)this[w+_e]=v/we&255;return w+H},u.prototype.writeUint8=u.prototype.writeUInt8=function(v,w,H){return v=+v,w=w>>>0,H||ie(this,v,w,1,255,0),this[w]=v&255,w+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(v,w,H){return v=+v,w=w>>>0,H||ie(this,v,w,2,65535,0),this[w]=v&255,this[w+1]=v>>>8,w+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(v,w,H){return v=+v,w=w>>>0,H||ie(this,v,w,2,65535,0),this[w]=v>>>8,this[w+1]=v&255,w+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(v,w,H){return v=+v,w=w>>>0,H||ie(this,v,w,4,4294967295,0),this[w+3]=v>>>24,this[w+2]=v>>>16,this[w+1]=v>>>8,this[w]=v&255,w+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(v,w,H){return v=+v,w=w>>>0,H||ie(this,v,w,4,4294967295,0),this[w]=v>>>24,this[w+1]=v>>>16,this[w+2]=v>>>8,this[w+3]=v&255,w+4};function ee(C,v,w,H,re){Te(v,H,re,C,w,7);let _e=Number(v&BigInt(4294967295));C[w++]=_e,_e=_e>>8,C[w++]=_e,_e=_e>>8,C[w++]=_e,_e=_e>>8,C[w++]=_e;let we=Number(v>>BigInt(32)&BigInt(4294967295));return C[w++]=we,we=we>>8,C[w++]=we,we=we>>8,C[w++]=we,we=we>>8,C[w++]=we,w}function me(C,v,w,H,re){Te(v,H,re,C,w,7);let _e=Number(v&BigInt(4294967295));C[w+7]=_e,_e=_e>>8,C[w+6]=_e,_e=_e>>8,C[w+5]=_e,_e=_e>>8,C[w+4]=_e;let we=Number(v>>BigInt(32)&BigInt(4294967295));return C[w+3]=we,we=we>>8,C[w+2]=we,we=we>>8,C[w+1]=we,we=we>>8,C[w]=we,w+8}u.prototype.writeBigUInt64LE=Be(function(v,w=0){return ee(this,v,w,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=Be(function(v,w=0){return me(this,v,w,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(v,w,H,re){if(v=+v,w=w>>>0,!re){const Ye=Math.pow(2,8*H-1);ie(this,v,w,H,Ye-1,-Ye)}let _e=0,we=1,Oe=0;for(this[w]=v&255;++_e<H&&(we*=256);)v<0&&Oe===0&&this[w+_e-1]!==0&&(Oe=1),this[w+_e]=(v/we>>0)-Oe&255;return w+H},u.prototype.writeIntBE=function(v,w,H,re){if(v=+v,w=w>>>0,!re){const Ye=Math.pow(2,8*H-1);ie(this,v,w,H,Ye-1,-Ye)}let _e=H-1,we=1,Oe=0;for(this[w+_e]=v&255;--_e>=0&&(we*=256);)v<0&&Oe===0&&this[w+_e+1]!==0&&(Oe=1),this[w+_e]=(v/we>>0)-Oe&255;return w+H},u.prototype.writeInt8=function(v,w,H){return v=+v,w=w>>>0,H||ie(this,v,w,1,127,-128),v<0&&(v=255+v+1),this[w]=v&255,w+1},u.prototype.writeInt16LE=function(v,w,H){return v=+v,w=w>>>0,H||ie(this,v,w,2,32767,-32768),this[w]=v&255,this[w+1]=v>>>8,w+2},u.prototype.writeInt16BE=function(v,w,H){return v=+v,w=w>>>0,H||ie(this,v,w,2,32767,-32768),this[w]=v>>>8,this[w+1]=v&255,w+2},u.prototype.writeInt32LE=function(v,w,H){return v=+v,w=w>>>0,H||ie(this,v,w,4,2147483647,-2147483648),this[w]=v&255,this[w+1]=v>>>8,this[w+2]=v>>>16,this[w+3]=v>>>24,w+4},u.prototype.writeInt32BE=function(v,w,H){return v=+v,w=w>>>0,H||ie(this,v,w,4,2147483647,-2147483648),v<0&&(v=4294967295+v+1),this[w]=v>>>24,this[w+1]=v>>>16,this[w+2]=v>>>8,this[w+3]=v&255,w+4},u.prototype.writeBigInt64LE=Be(function(v,w=0){return ee(this,v,w,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=Be(function(v,w=0){return me(this,v,w,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function W(C,v,w,H,re,_e){if(w+H>C.length)throw new RangeError("Index out of range");if(w<0)throw new RangeError("Index out of range")}function G(C,v,w,H,re){return v=+v,w=w>>>0,re||W(C,v,w,4),n.write(C,v,w,H,23,4),w+4}u.prototype.writeFloatLE=function(v,w,H){return G(this,v,w,!0,H)},u.prototype.writeFloatBE=function(v,w,H){return G(this,v,w,!1,H)};function Y(C,v,w,H,re){return v=+v,w=w>>>0,re||W(C,v,w,8),n.write(C,v,w,H,52,8),w+8}u.prototype.writeDoubleLE=function(v,w,H){return Y(this,v,w,!0,H)},u.prototype.writeDoubleBE=function(v,w,H){return Y(this,v,w,!1,H)},u.prototype.copy=function(v,w,H,re){if(!u.isBuffer(v))throw new TypeError("argument should be a Buffer");if(H||(H=0),!re&&re!==0&&(re=this.length),w>=v.length&&(w=v.length),w||(w=0),re>0&&re<H&&(re=H),re===H||v.length===0||this.length===0)return 0;if(w<0)throw new RangeError("targetStart out of bounds");if(H<0||H>=this.length)throw new RangeError("Index out of range");if(re<0)throw new RangeError("sourceEnd out of bounds");re>this.length&&(re=this.length),v.length-w<re-H&&(re=v.length-w+H);const _e=re-H;return this===v&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(w,H,re):Uint8Array.prototype.set.call(v,this.subarray(H,re),w),_e},u.prototype.fill=function(v,w,H,re){if(typeof v=="string"){if(typeof w=="string"?(re=w,w=0,H=this.length):typeof H=="string"&&(re=H,H=this.length),re!==void 0&&typeof re!="string")throw new TypeError("encoding must be a string");if(typeof re=="string"&&!u.isEncoding(re))throw new TypeError("Unknown encoding: "+re);if(v.length===1){const we=v.charCodeAt(0);(re==="utf8"&&we<128||re==="latin1")&&(v=we)}}else typeof v=="number"?v=v&255:typeof v=="boolean"&&(v=Number(v));if(w<0||this.length<w||this.length<H)throw new RangeError("Out of range index");if(H<=w)return this;w=w>>>0,H=H===void 0?this.length:H>>>0,v||(v=0);let _e;if(typeof v=="number")for(_e=w;_e<H;++_e)this[_e]=v;else{const we=u.isBuffer(v)?v:u.from(v,re),Oe=we.length;if(Oe===0)throw new TypeError('The value "'+v+'" is invalid for argument "value"');for(_e=0;_e<H-w;++_e)this[_e+w]=we[_e%Oe]}return this};const K={};function le(C,v,w){K[C]=class extends w{constructor(){super(),Object.defineProperty(this,"message",{value:v.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${C}]`,this.stack,delete this.name}get code(){return C}set code(re){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:re,writable:!0})}toString(){return`${this.name} [${C}]: ${this.message}`}}}le("ERR_BUFFER_OUT_OF_BOUNDS",function(C){return C?`${C} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),le("ERR_INVALID_ARG_TYPE",function(C,v){return`The "${C}" argument must be of type number. Received type ${typeof v}`},TypeError),le("ERR_OUT_OF_RANGE",function(C,v,w){let H=`The value of "${C}" is out of range.`,re=w;return Number.isInteger(w)&&Math.abs(w)>2**32?re=ce(String(w)):typeof w=="bigint"&&(re=String(w),(w>BigInt(2)**BigInt(32)||w<-(BigInt(2)**BigInt(32)))&&(re=ce(re)),re+="n"),H+=` It must be ${v}. Received ${re}`,H},RangeError);function ce(C){let v="",w=C.length;const H=C[0]==="-"?1:0;for(;w>=H+4;w-=3)v=`_${C.slice(w-3,w)}${v}`;return`${C.slice(0,w)}${v}`}function Ee(C,v,w){q(v,"offset"),(C[v]===void 0||C[v+w]===void 0)&&te(v,C.length-(w+1))}function Te(C,v,w,H,re,_e){if(C>w||C<v){const we=typeof v=="bigint"?"n":"";let Oe;throw v===0||v===BigInt(0)?Oe=`>= 0${we} and < 2${we} ** ${(_e+1)*8}${we}`:Oe=`>= -(2${we} ** ${(_e+1)*8-1}${we}) and < 2 ** ${(_e+1)*8-1}${we}`,new K.ERR_OUT_OF_RANGE("value",Oe,C)}Ee(H,re,_e)}function q(C,v){if(typeof C!="number")throw new K.ERR_INVALID_ARG_TYPE(v,"number",C)}function te(C,v,w){throw Math.floor(C)!==C?(q(C,w),new K.ERR_OUT_OF_RANGE("offset","an integer",C)):v<0?new K.ERR_BUFFER_OUT_OF_BOUNDS:new K.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${v}`,C)}const fe=/[^+/0-9A-Za-z-_]/g;function xe(C){if(C=C.split("=")[0],C=C.trim().replace(fe,""),C.length<2)return"";for(;C.length%4!==0;)C=C+"=";return C}function Se(C,v){v=v||1/0;let w;const H=C.length;let re=null;const _e=[];for(let we=0;we<H;++we){if(w=C.charCodeAt(we),w>55295&&w<57344){if(!re){if(w>56319){(v-=3)>-1&&_e.push(239,191,189);continue}else if(we+1===H){(v-=3)>-1&&_e.push(239,191,189);continue}re=w;continue}if(w<56320){(v-=3)>-1&&_e.push(239,191,189),re=w;continue}w=(re-55296<<10|w-56320)+65536}else re&&(v-=3)>-1&&_e.push(239,191,189);if(re=null,w<128){if((v-=1)<0)break;_e.push(w)}else if(w<2048){if((v-=2)<0)break;_e.push(w>>6|192,w&63|128)}else if(w<65536){if((v-=3)<0)break;_e.push(w>>12|224,w>>6&63|128,w&63|128)}else if(w<1114112){if((v-=4)<0)break;_e.push(w>>18|240,w>>12&63|128,w>>6&63|128,w&63|128)}else throw new Error("Invalid code point")}return _e}function Ie(C){const v=[];for(let w=0;w<C.length;++w)v.push(C.charCodeAt(w)&255);return v}function se(C,v){let w,H,re;const _e=[];for(let we=0;we<C.length&&!((v-=2)<0);++we)w=C.charCodeAt(we),H=w>>8,re=w%256,_e.push(re),_e.push(H);return _e}function be(C){return e.toByteArray(xe(C))}function Ne(C,v,w,H){let re;for(re=0;re<H&&!(re+w>=v.length||re>=C.length);++re)v[re+w]=C[re];return re}function ve(C,v){return C instanceof v||C!=null&&C.constructor!=null&&C.constructor.name!=null&&C.constructor.name===v.name}function $e(C){return C!==C}const mt=(function(){const C="0123456789abcdef",v=new Array(256);for(let w=0;w<16;++w){const H=w*16;for(let re=0;re<16;++re)v[H+re]=C[w]+C[re]}return v})();function Be(C){return typeof BigInt>"u"?ft:C}function ft(){throw new Error("BigInt not supported")}})(So)),So}var pg=Rn();const ar="http://www.w3.org/1999/02/22-rdf-syntax-ns#",lr="http://www.w3.org/2001/XMLSchema#",ds="http://www.w3.org/2000/10/swap/",Lt={xsd:{decimal:`${lr}decimal`,boolean:`${lr}boolean`,double:`${lr}double`,integer:`${lr}integer`,string:`${lr}string`},rdf:{type:`${ar}type`,nil:`${ar}nil`,first:`${ar}first`,rest:`${ar}rest`,langString:`${ar}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${ds}reify#forSome`,forAll:`${ds}reify#forAll`},log:{implies:`${ds}log#implies`,isImpliedBy:`${ds}log#isImpliedBy`}},{xsd:hs}=Lt,gg=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,Ju={"\\":"\\","'":"'",'"':'"',n:` `,r:"\r",t:" ",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},mg=/[\x00-\x20<>\\"\{\}\|\^\`]/,_g={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},yg=/$0^/;class vg{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,e=e||{},this._isImpliedBy=e.isImpliedBy,this._lineMode=!!e.lineMode){this._n3Mode=!1;for(const n in this)!(n in _g)&&this[n]instanceof RegExp&&(this[n]=yg)}else this._n3Mode=e.n3!==!1;this.comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,n){let r=this._input,o=r.length;for(;;){let u,f;for(;u=this._newline.exec(r);)this.comments&&(f=this._comment.exec(u[0]))&&a("comment",f[1],"",this._line,u[0].length),r=r.substr(u[0].length,r.length),o=r.length,this._line++;if(!u&&(u=this._whitespace.exec(r))&&(r=r.substr(u[0].length,r.length)),this._endOfFile.test(r))return n&&(this.comments&&(f=this._comment.exec(r))&&a("comment",f[1],"",this._line,r.length),r=null,a("eof","","",this._line,0)),this._input=r;const h=this._line,m=r[0];let _="",d="",g="",b=null,T=0,N=!1;switch(m){case"^":if(r.length<3)break;if(r[1]==="^"){if(this._previousMarker="^^",r=r.substr(2),r[0]!=="<"){N=!0;break}}else{this._n3Mode&&(T=1,_="^");break}case"<":if(b=this._unescapedIri.exec(r))_="IRI",d=b[1];else if(b=this._iri.exec(r)){if(d=this._unescape(b[1]),d===null||mg.test(d))return l(this);_="IRI"}else r.length>1&&r[1]==="<"?(_="<<",T=2):this._n3Mode&&r.length>1&&r[1]==="="&&(T=2,this._isImpliedBy?(_="abbreviation",d="<"):(_="inverse",d=">"));break;case">":r.length>1&&r[1]===">"&&(_=">>",T=2);break;case"_":((b=this._blank.exec(r))||n&&(b=this._blank.exec(`${r} `)))&&(_="blank",g="_",d=b[1]);break;case'"':if(b=this._simpleQuotedString.exec(r))d=b[1];else if({value:d,matchLength:T}=this._parseLiteral(r),d===null)return l(this);(b!==null||T!==0)&&(_="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(b=this._simpleApostropheString.exec(r))d=b[1];else if({value:d,matchLength:T}=this._parseLiteral(r),d===null)return l(this);(b!==null||T!==0)&&(_="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(b=this._variable.exec(r))&&(_="var",d=b[0]);break;case"@":this._previousMarker==="literal"&&(b=this._langcode.exec(r))?(_="langcode",d=b[1]):(b=this._keyword.exec(r))&&(_=b[0]);break;case".":if(r.length===1?n:r[1]<"0"||r[1]>"9"){_=".",T=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(b=this._number.exec(r)||n&&(b=this._number.exec(`${r} `)))&&(_="literal",d=b[0],g=typeof b[1]=="string"?hs.double:typeof b[2]=="string"?hs.decimal:hs.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(b=this._sparqlKeyword.exec(r))?_=b[0].toUpperCase():N=!0;break;case"f":case"t":(b=this._boolean.exec(r))?(_="literal",d=b[0],g=hs.boolean):N=!0;break;case"a":(b=this._shortPredicates.exec(r))?(_="abbreviation",d="a"):N=!0;break;case"=":this._n3Mode&&r.length>1&&(_="abbreviation",r[1]!==">"?(T=1,d="="):(T=2,d=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(T=1,_=m);break;case"{":!this._lineMode&&r.length>=2&&(r[1]==="|"?(_="{|",T=2):(_=m,T=1));break;case"|":r.length>=2&&r[1]==="}"&&(_="|}",T=2);break;default:N=!0}if(N&&((this._previousMarker==="@prefix"||this._previousMarker==="PREFIX")&&(b=this._prefix.exec(r))?(_="prefix",d=b[1]||""):((b=this._prefixed.exec(r))||n&&(b=this._prefixed.exec(`${r} `)))&&(_="prefixed",g=b[1]||"",d=this._unescape(b[2]))),this._previousMarker==="^^")switch(_){case"prefixed":_="type";break;case"IRI":_="typeIRI";break;default:_=""}if(!_)return n||!/^'''|^"""/.test(r)&&/\n|\r/.test(r)?l(this):this._input=r;const A=T||b[0].length,R=a(_,d,g,h,A);this.previousToken=R,this._previousMarker=_,r=r.substr(A,r.length)}function a(u,f,h,m,_){const d=r?o-r.length:o,g=d+_,b={type:u,value:f,prefix:h,line:m,start:d,end:g};return e(null,b),b}function l(u){e(u._syntaxError(/^\S*/.exec(r)[0]))}}_unescape(e){let n=!1;const r=e.replace(gg,(o,a,l,u)=>{if(typeof a=="string")return String.fromCharCode(Number.parseInt(a,16));if(typeof l=="string"){let f=Number.parseInt(l,16);return f<=65535?String.fromCharCode(Number.parseInt(l,16)):String.fromCharCode(55296+((f-=65536)>>10),56320+(f&1023))}return u in Ju?Ju[u]:(n=!0,"")});return n?null:r}_parseLiteral(e){if(e.length>=3){const n=e.match(/^(?:"""|"|'''|'|)/)[0],r=n.length;let o=Math.max(this._literalClosingPos,r);for(;(o=e.indexOf(n,o))>0;){let a=0;for(;e[o-a-1]==="\\";)a++;if(a%2===0){const l=e.substring(r,o),u=l.split(/\r\n|\r|\n/).length-1,f=o+r;if(r===1&&u!==0||r===3&&this._lineMode)break;return this._line+=u,{value:this._unescape(l),matchLength:f}}o++}this._literalClosingPos=e.length-r+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const n=new Error(`Unexpected "${e}" on line ${this._line}.`);return n.context={token:void 0,line:this._line,previousToken:this.previousToken},n}_readStartingBom(e){return e.startsWith("\uFEFF")?e.substr(1):e}tokenize(e,n){if(this._line=1,typeof e=="string")if(this._input=this._readStartingBom(e),typeof n=="function")queueMicrotask(()=>this._tokenizeToEnd(n,!0));else{const r=[];let o;if(this._tokenizeToEnd((a,l)=>a?o=a:r.push(l),!0),o)throw o;return r}else this._pendingBuffer=null,typeof e.setEncoding=="function"&&e.setEncoding("utf8"),e.on("data",r=>{this._input!==null&&r.length!==0&&(this._pendingBuffer&&(r=pg.Buffer.concat([this._pendingBuffer,r]),this._pendingBuffer=null),r[r.length-1]&128?this._pendingBuffer=r:(typeof this._input>"u"?this._input=this._readStartingBom(typeof r=="string"?r:r.toString()):this._input+=r,this._tokenizeToEnd(n,!1)))}),e.on("end",()=>{typeof this._input=="string"&&this._tokenizeToEnd(n,!0)}),e.on("error",n)}}const{rdf:bg,xsd:di}=Lt;let zi,wg=0;const ze={namedNode:Jh,blankNode:Kh,variable:ef,literal:Yh,defaultGraph:Tg,quad:hl,triple:hl,fromTerm:Nr,fromQuad:tf};class on{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof on?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}let pi=class extends on{get termType(){return"NamedNode"}},Wt=class Qh extends on{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let n=e.lastIndexOf('"')+1;return n<e.length&&e[n++]==="@"?e.substr(n).toLowerCase():""}get datatype(){return new pi(this.datatypeString)}get datatypeString(){const e=this.id,n=e.lastIndexOf('"')+1,r=n<e.length?e[n]:"";return r==="^"?e.substr(n+2):r!=="@"?di.string:bg.langString}equals(e){return e instanceof Qh?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}},xg=class extends on{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}},Eg=class extends on{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}},Sg=class extends on{constructor(){return super(""),zi||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};zi=new Sg;function Ir(i,e,n){if(e=e||ze,!i)return e.defaultGraph();switch(i[0]){case"?":return e.variable(i.substr(1));case"_":return e.blankNode(i.substr(2));case'"':if(e===ze)return new Wt(i);if(i[i.length-1]==='"')return e.literal(i.substr(1,i.length-2));const r=i.lastIndexOf('"',i.length-1);return e.literal(i.substr(1,r-1),i[r+1]==="@"?i.substr(r+2):e.namedNode(i.substr(r+3)));case"[":i=JSON.parse(i);break;default:if(!n||!Array.isArray(i))return e.namedNode(i)}return e.quad(Ir(i[0],e,!0),Ir(i[1],e,!0),Ir(i[2],e,!0),i[3]&&Ir(i[3],e,!0))}function Oi(i,e){if(typeof i=="string")return i;if(i instanceof on&&i.termType!=="Quad")return i.id;if(!i)return zi.id;switch(i.termType){case"NamedNode":return i.value;case"BlankNode":return`_:${i.value}`;case"Variable":return`?${i.value}`;case"DefaultGraph":return"";case"Literal":return`"${i.value}"${i.language?`@${i.language}`:i.datatype&&i.datatype.value!==di.string?`^^${i.datatype.value}`:""}`;case"Quad":const n=[Oi(i.subject,!0),Oi(i.predicate,!0),Oi(i.object,!0)];return i.graph&&i.graph.termType!=="DefaultGraph"&&n.push(Oi(i.graph,!0)),e?n:JSON.stringify(n);default:throw new Error(`Unexpected termType: ${i.termType}`)}}let Tl=class extends on{constructor(e,n,r,o){super(""),this._subject=e,this._predicate=n,this._object=r,this._graph=o||zi}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(e){return!!e&&this._subject.equals(e.subject)&&this._predicate.equals(e.predicate)&&this._object.equals(e.object)&&this._graph.equals(e.graph)}};function Jh(i){return new pi(i)}function Kh(i){return new xg(i||`n3-${wg++}`)}function Yh(i,e){if(typeof e=="string")return new Wt(`"${i}"@${e.toLowerCase()}`);let n=e?e.value:"";return n===""&&(typeof i=="boolean"?n=di.boolean:typeof i=="number"&&(Number.isFinite(i)?n=Number.isInteger(i)?di.integer:di.double:(n=di.double,Number.isNaN(i)||(i=i>0?"INF":"-INF")))),n===""||n===di.string?new Wt(`"${i}"`):new Wt(`"${i}"^^${n}`)}function ef(i){return new Eg(i)}function Tg(){return zi}function hl(i,e,n,r){return new Tl(i,e,n,r)}function Nr(i){if(i instanceof on)return i;switch(i.termType){case"NamedNode":return Jh(i.value);case"BlankNode":return Kh(i.value);case"Variable":return ef(i.value);case"DefaultGraph":return zi;case"Literal":return Yh(i.value,i.language||i.datatype);case"Quad":return tf(i);default:throw new Error(`Unexpected termType: ${i.termType}`)}}function tf(i){if(i instanceof Tl)return i;if(i.termType!=="Quad")throw new Error(`Unexpected termType: ${i.termType}`);return hl(Nr(i.subject),Nr(i.predicate),Nr(i.object),Nr(i.graph))}let Ku=0;class nf{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&rf(this,e.factory);const n=typeof e.format=="string"?e.format.match(/\w*$/)[0].toLowerCase():"",r=/turtle/.test(n),o=/trig/.test(n),a=/triple/.test(n),l=/quad/.test(n),u=this._n3Mode=/n3/.test(n),f=a||l;(this._supportsNamedGraphs=!(r||u))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(r||o||a||u),this._isImpliedBy=e.isImpliedBy,this._supportsRDFStar=n===""||/star|\*$/.test(n),f&&(this._resolveRelativeIRI=h=>null),this._blankNodePrefix=typeof e.blankNodePrefix!="string"?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new vg({lineMode:f,n3:u,isImpliedBy:this._isImpliedBy}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){Ku=0}_setBase(e){if(!e)this._base="",this._basePath="";else{const n=e.indexOf("#");n>=0&&(e=e.substr(0,n)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}}_saveContext(e,n,r,o,a){const l=this._n3Mode;this._contextStack.push({type:e,subject:r,predicate:o,object:a,graph:n,inverse:l?this._inversePredicate:!1,blankPrefix:l?this._prefixes._:"",quantified:l?this._quantified:null}),l&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,n){const r=this._contextStack.pop();if(!r||r.type!==e)return this._error(`Unexpected ${n.type}`,n);this._subject=r.subject,this._predicate=r.predicate,this._object=r.object,this._graph=r.graph,this._n3Mode&&(this._inversePredicate=r.inverse,this._prefixes._=r.blankPrefix,this._quantified=r.quantified)}_readInTopContext(e){switch(e.type){case"eof":return this._graph!==null?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,n){let r;switch(e.type){case"IRI":case"typeIRI":const o=this._resolveIRI(e.value);if(o===null)return this._error("Invalid IRI",e);r=this._factory.namedNode(o);break;case"type":case"prefixed":const a=this._prefixes[e.prefix];if(a===void 0)return this._error(`Undefined prefix "${e.prefix}:"`,e);r=this._factory.namedNode(a+e.value);break;case"blank":r=this._factory.blankNode(this._prefixes[e.prefix]+e.value);break;case"var":r=this._factory.variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!n&&this._n3Mode&&r.id in this._quantified&&(r=this._quantified[r.id]),r}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._factory.blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._factory.blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier="blankNode",this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier="variable",this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(e.prefix.length===0)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",e);default:if((this._subject=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){const n=e.type;switch(n){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return this._predicate===null?this._error(`Unexpected ${n}`,e):(this._subject=null,n==="]"?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return this._predicate!==null?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._factory.blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if((this._predicate=this._readEntity(e))===void 0)return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(e.prefix.length===0)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._factory.blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",e);default:if((this._object=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return e.type==="{"?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return e.type!=="{"?this._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return e.type==="]"?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}_readBlankNodeTail(e){if(e.type!=="]")return this._readBlankNodePunctuation(e);this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph);const n=this._predicate===null;return this._restoreContext("blank",e),this._object!==null?this._getContextEndReader():this._predicate!==null?this._readObject:n?this._readPredicat