UNPKG

@ulb-darmstadt/shacl-form

Version:
2 lines 727 kB
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),u=o((e=>{e.byteLength=c,e.toByteArray=u,e.fromByteArray=p;for(var t=[],n=[],r=typeof Uint8Array<`u`?Uint8Array:Array,i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,a=0,o=i.length;a<o;++a)t[a]=i[a],n[i.charCodeAt(a)]=a;n[45]=62,n[95]=63;function s(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function c(e){var t=s(e),n=t[0],r=t[1];return(n+r)*3/4-r}function l(e,t,n){return(t+n)*3/4-n}function u(e){var t,i=s(e),a=i[0],o=i[1],c=new r(l(e,a,o)),u=0,d=o>0?a-4:a,f;for(f=0;f<d;f+=4)t=n[e.charCodeAt(f)]<<18|n[e.charCodeAt(f+1)]<<12|n[e.charCodeAt(f+2)]<<6|n[e.charCodeAt(f+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=t&255;return o===2&&(t=n[e.charCodeAt(f)]<<2|n[e.charCodeAt(f+1)]>>4,c[u++]=t&255),o===1&&(t=n[e.charCodeAt(f)]<<10|n[e.charCodeAt(f+1)]<<4|n[e.charCodeAt(f+2)]>>2,c[u++]=t>>8&255,c[u++]=t&255),c}function d(e){return t[e>>18&63]+t[e>>12&63]+t[e>>6&63]+t[e&63]}function f(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(d(r));return i.join(``)}function p(e){for(var n,r=e.length,i=r%3,a=[],o=16383,s=0,c=r-i;s<c;s+=o)a.push(f(e,s,s+o>c?c:s+o));return i===1?(n=e[r-1],a.push(t[n>>2]+t[n<<4&63]+`==`)):i===2&&(n=(e[r-2]<<8)+e[r-1],a.push(t[n>>10]+t[n>>4&63]+t[n<<2&63]+`=`)),a.join(``)}})),d=o((e=>{e.read=function(e,t,n,r,i){var a,o,s=i*8-r-1,c=(1<<s)-1,l=c>>1,u=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=a*256+e[t+d],d+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=o*256+e[t+d],d+=f,u-=8);if(a===0)a=1-l;else if(a===c)return o?NaN:(p?-1:1)*(1/0);else o+=2**r,a-=l;return(p?-1:1)*o*2**(a-r)},e.write=function(e,t,n,r,i,a){var o,s,c,l=a*8-i-1,u=(1<<l)-1,d=u>>1,f=i===23?2**-24-2**-77:0,p=r?0:a-1,m=r?1:-1,h=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=2**-o)<1&&(o--,c*=2),o+d>=1?t+=f/c:t+=f*2**(1-d),t*c>=2&&(o++,c/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*c-1)*2**i,o+=d):(s=t*2**(d-1)*2**i,o=0));i>=8;e[n+p]=s&255,p+=m,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+p]=o&255,p+=m,o/=256,l-=8);e[n+p-m]|=h*128}})),f=o((e=>{var t=u(),n=d(),r=typeof Symbol==`function`&&typeof Symbol.for==`function`?Symbol.for(`nodejs.util.inspect.custom`):null;e.Buffer=s,e.SlowBuffer=b,e.INSPECT_MAX_BYTES=50;var i=2147483647;e.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=a(),!s.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{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,`parent`,{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,`offset`,{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(e){if(e>i)throw RangeError(`The value "`+e+`" is invalid for option "size"`);let t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,n){if(typeof e==`number`){if(typeof t==`string`)throw TypeError(`The "string" argument must be of type string. Received type number`);return p(e)}return c(e,t,n)}s.poolSize=8192;function c(e,t,n){if(typeof e==`string`)return m(e,t);if(ArrayBuffer.isView(e))return g(e);if(e==null)throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e);if(ye(e,ArrayBuffer)||e&&ye(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<`u`&&(ye(e,SharedArrayBuffer)||e&&ye(e.buffer,SharedArrayBuffer)))return _(e,t,n);if(typeof e==`number`)throw TypeError(`The "value" argument must not be of type number. Received type number`);let r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return s.from(r,t,n);let i=v(e);if(i)return i;if(typeof Symbol<`u`&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]==`function`)return s.from(e[Symbol.toPrimitive](`string`),t,n);throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e)}s.from=function(e,t,n){return c(e,t,n)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function l(e){if(typeof e!=`number`)throw TypeError(`"size" argument must be of type number`);if(e<0)throw RangeError(`The value "`+e+`" is invalid for option "size"`)}function f(e,t,n){return l(e),e<=0||t===void 0?o(e):typeof n==`string`?o(e).fill(t,n):o(e).fill(t)}s.alloc=function(e,t,n){return f(e,t,n)};function p(e){return l(e),o(e<0?0:y(e)|0)}s.allocUnsafe=function(e){return p(e)},s.allocUnsafeSlow=function(e){return p(e)};function m(e,t){if((typeof t!=`string`||t===``)&&(t=`utf8`),!s.isEncoding(t))throw TypeError(`Unknown encoding: `+t);let n=x(e,t)|0,r=o(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function h(e){let t=e.length<0?0:y(e.length)|0,n=o(t);for(let r=0;r<t;r+=1)n[r]=e[r]&255;return n}function g(e){if(ye(e,Uint8Array)){let t=new Uint8Array(e);return _(t.buffer,t.byteOffset,t.byteLength)}return h(e)}function _(e,t,n){if(t<0||e.byteLength<t)throw RangeError(`"offset" is outside of buffer bounds`);if(e.byteLength<t+(n||0))throw RangeError(`"length" is outside of buffer bounds`);let r;return r=t===void 0&&n===void 0?new Uint8Array(e):n===void 0?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,s.prototype),r}function v(e){if(s.isBuffer(e)){let t=y(e.length)|0,n=o(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!=`number`||H(e.length)?o(0):h(e);if(e.type===`Buffer`&&Array.isArray(e.data))return h(e.data)}function y(e){if(e>=i)throw RangeError(`Attempt to allocate Buffer larger than maximum size: 0x`+i.toString(16)+` bytes`);return e|0}function b(e){return+e!=e&&(e=0),s.alloc(+e)}s.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==s.prototype},s.compare=function(e,t){if(ye(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),ye(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw TypeError(`The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array`);if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},s.isEncoding=function(e){switch(String(e).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}},s.concat=function(e,t){if(!Array.isArray(e))throw TypeError(`"list" argument must be an Array of Buffers`);if(e.length===0)return s.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;let r=s.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){let t=e[n];if(ye(t,Uint8Array))i+t.length>r.length?(s.isBuffer(t)||(t=s.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else if(s.isBuffer(t))t.copy(r,i);else throw TypeError(`"list" argument must be an Array of Buffers`);i+=t.length}return r};function x(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||ye(e,ArrayBuffer))return e.byteLength;if(typeof e!=`string`)throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type `+typeof e);let n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;let i=!1;for(;;)switch(t){case`ascii`:case`latin1`:case`binary`:return n;case`utf8`:case`utf-8`:return me(e).length;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return n*2;case`hex`:return n>>>1;case`base64`:return _e(e).length;default:if(i)return r?-1:me(e).length;t=(``+t).toLowerCase(),i=!0}}s.byteLength=x;function S(e,t,n){let r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return``;for(e||=`utf8`;;)switch(e){case`hex`:return R(this,t,n);case`utf8`:case`utf-8`:return M(this,t,n);case`ascii`:return F(this,t,n);case`latin1`:case`binary`:return I(this,t,n);case`base64`:return j(this,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return z(this,t,n);default:if(r)throw TypeError(`Unknown encoding: `+e);e=(e+``).toLowerCase(),r=!0}}s.prototype._isBuffer=!0;function C(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}s.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(let t=0;t<e;t+=2)C(this,t,t+1);return this},s.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(let t=0;t<e;t+=4)C(this,t,t+3),C(this,t+1,t+2);return this},s.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(let t=0;t<e;t+=8)C(this,t,t+7),C(this,t+1,t+6),C(this,t+2,t+5),C(this,t+3,t+4);return this},s.prototype.toString=function(){let e=this.length;return e===0?``:arguments.length===0?M(this,0,e):S.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError(`Argument must be a Buffer`);return this===e?!0:s.compare(this,e)===0},s.prototype.inspect=function(){let t=``,n=e.INSPECT_MAX_BYTES;return t=this.toString(`hex`,0,n).replace(/(.{2})/g,`$1 `).trim(),this.length>n&&(t+=` ... `),`<Buffer `+t+`>`},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(e,t,n,r,i){if(ye(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw TypeError(`The "target" argument must be one of type Buffer or Uint8Array. Received type `+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError(`out of range index`);if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;let a=i-r,o=n-t,c=Math.min(a,o),l=this.slice(r,i),u=e.slice(t,n);for(let e=0;e<c;++e)if(l[e]!==u[e]){a=l[e],o=u[e];break}return a<o?-1:o<a?1:0};function w(e,t,n,r,i){if(e.length===0)return-1;if(typeof n==`string`?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,H(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0)if(i)n=0;else return-1;if(typeof t==`string`&&(t=s.from(t,r)),s.isBuffer(t))return t.length===0?-1:T(e,t,n,r,i);if(typeof t==`number`)return t&=255,typeof Uint8Array.prototype.indexOf==`function`?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):T(e,[t],n,r,i);throw TypeError(`val must be string, number or Buffer`)}function T(e,t,n,r,i){let a=1,o=e.length,s=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r===`ucs2`||r===`ucs-2`||r===`utf16le`||r===`utf-16le`)){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,n/=2}function c(e,t){return a===1?e[t]:e.readUInt16BE(t*a)}let l;if(i){let r=-1;for(l=n;l<o;l++)if(c(e,l)===c(t,r===-1?0:l-r)){if(r===-1&&(r=l),l-r+1===s)return r*a}else r!==-1&&(l-=l-r),r=-1}else for(n+s>o&&(n=o-s),l=n;l>=0;l--){let n=!0;for(let r=0;r<s;r++)if(c(e,l+r)!==c(t,r)){n=!1;break}if(n)return l}return-1}s.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},s.prototype.indexOf=function(e,t,n){return w(this,e,t,n,!0)},s.prototype.lastIndexOf=function(e,t,n){return w(this,e,t,n,!1)};function E(e,t,n,r){n=Number(n)||0;let i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;let a=t.length;r>a/2&&(r=a/2);let o;for(o=0;o<r;++o){let r=parseInt(t.substr(o*2,2),16);if(H(r))return o;e[n+o]=r}return o}function D(e,t,n,r){return ve(me(t,e.length-n),e,n,r)}function O(e,t,n,r){return ve(he(t),e,n,r)}function k(e,t,n,r){return ve(_e(t),e,n,r)}function A(e,t,n,r){return ve(ge(t,e.length-n),e,n,r)}s.prototype.write=function(e,t,n,r){if(t===void 0)r=`utf8`,n=this.length,t=0;else if(n===void 0&&typeof t==`string`)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,r===void 0&&(r=`utf8`)):(r=n,n=void 0);else throw Error(`Buffer.write(string, encoding, offset[, length]) is no longer supported`);let i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError(`Attempt to write outside buffer bounds`);r||=`utf8`;let a=!1;for(;;)switch(r){case`hex`:return E(this,e,t,n);case`utf8`:case`utf-8`:return D(this,e,t,n);case`ascii`:case`latin1`:case`binary`:return O(this,e,t,n);case`base64`:return k(this,e,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return A(this,e,t,n);default:if(a)throw TypeError(`Unknown encoding: `+r);r=(``+r).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};function j(e,n,r){return n===0&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function M(e,t,n){n=Math.min(e.length,n);let r=[],i=t;for(;i<n;){let t=e[i],a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=n){let n,r,s,c;switch(o){case 1:t<128&&(a=t);break;case 2:n=e[i+1],(n&192)==128&&(c=(t&31)<<6|n&63,c>127&&(a=c));break;case 3:n=e[i+1],r=e[i+2],(n&192)==128&&(r&192)==128&&(c=(t&15)<<12|(n&63)<<6|r&63,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],(n&192)==128&&(r&192)==128&&(s&192)==128&&(c=(t&15)<<18|(n&63)<<12|(r&63)<<6|s&63,c>65535&&c<1114112&&(a=c))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),i+=o}return P(r)}var N=4096;function P(e){let t=e.length;if(t<=N)return String.fromCharCode.apply(String,e);let n=``,r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=N));return n}function F(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]&127);return r}function I(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function R(e,t,n){let r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i=``;for(let r=t;r<n;++r)i+=be[e[r]];return i}function z(e,t,n){let r=e.slice(t,n),i=``;for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+r[e+1]*256);return i}s.prototype.slice=function(e,t){let n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);let r=this.subarray(e,t);return Object.setPrototypeOf(r,s.prototype),r};function B(e,t,n){if(e%1!=0||e<0)throw RangeError(`offset is not uint`);if(e+t>n)throw RangeError(`Trying to access beyond buffer length`)}s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||B(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return r},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||B(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readBigUInt64LE=xe(function(e){e>>>=0,ue(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&de(e,this.length-8);let r=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))}),s.prototype.readBigUInt64BE=xe(function(e){e>>>=0,ue(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&de(e,this.length-8);let r=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),s.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||B(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,r>=i&&(r-=2**(8*t)),r},s.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||B(e,t,this.length);let r=t,i=1,a=this[e+--r];for(;r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=2**(8*t)),a},s.prototype.readInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||B(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},s.prototype.readInt16BE=function(e,t){e>>>=0,t||B(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readBigInt64LE=xe(function(e){e>>>=0,ue(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&de(e,this.length-8);let r=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)}),s.prototype.readBigInt64BE=xe(function(e){e>>>=0,ue(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&de(e,this.length-8);let r=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)}),s.prototype.readFloatLE=function(e,t){return e>>>=0,t||B(e,4,this.length),n.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||B(e,4,this.length),n.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||B(e,8,this.length),n.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||B(e,8,this.length),n.read(this,e,!1,52,8)};function V(e,t,n,r,i,a){if(!s.isBuffer(e))throw TypeError(`"buffer" argument must be a Buffer instance`);if(t>i||t<a)throw RangeError(`"value" argument is out of bounds`);if(n+r>e.length)throw RangeError(`Index out of range`)}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;V(this,e,t,n,r,0)}let i=1,a=0;for(this[t]=e&255;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;V(this,e,t,n,r,0)}let i=n-1,a=1;for(this[t+i]=e&255;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||V(this,e,t,1,255,0),this[t]=e&255,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||V(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||V(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||V(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||V(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function ee(e,t,n,r,i){le(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function te(e,t,n,r,i){le(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}s.prototype.writeBigUInt64LE=xe(function(e,t=0){return ee(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeBigUInt64BE=xe(function(e,t=0){return te(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);V(this,e,t,n,r-1,-r)}let i=0,a=1,o=0;for(this[t]=e&255;++i<n&&(a*=256);)e<0&&o===0&&this[t+i-1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);V(this,e,t,n,r-1,-r)}let i=n-1,a=1,o=0;for(this[t+i]=e&255;--i>=0&&(a*=256);)e<0&&o===0&&this[t+i+1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||V(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||V(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||V(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||V(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||V(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},s.prototype.writeBigInt64LE=xe(function(e,t=0){return ee(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))}),s.prototype.writeBigInt64BE=xe(function(e,t=0){return te(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))});function ne(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError(`Index out of range`)}function re(e,t,r,i,a){return t=+t,r>>>=0,a||ne(e,t,r,4,34028234663852886e22,-34028234663852886e22),n.write(e,t,r,i,23,4),r+4}s.prototype.writeFloatLE=function(e,t,n){return re(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return re(this,e,t,!1,n)};function ie(e,t,r,i,a){return t=+t,r>>>=0,a||ne(e,t,r,8,17976931348623157e292,-17976931348623157e292),n.write(e,t,r,i,52,8),r+8}s.prototype.writeDoubleLE=function(e,t,n){return ie(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return ie(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(!s.isBuffer(e))throw TypeError(`argument should be a Buffer`);if(n||=0,!r&&r!==0&&(r=this.length),t>=e.length&&(t=e.length),t||=0,r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(t<0)throw RangeError(`targetStart out of bounds`);if(n<0||n>=this.length)throw RangeError(`Index out of range`);if(r<0)throw RangeError(`sourceEnd out of bounds`);r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);let i=r-n;return this===e&&typeof Uint8Array.prototype.copyWithin==`function`?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},s.prototype.fill=function(e,t,n,r){if(typeof e==`string`){if(typeof t==`string`?(r=t,t=0,n=this.length):typeof n==`string`&&(r=n,n=this.length),r!==void 0&&typeof r!=`string`)throw TypeError(`encoding must be a string`);if(typeof r==`string`&&!s.isEncoding(r))throw TypeError(`Unknown encoding: `+r);if(e.length===1){let t=e.charCodeAt(0);(r===`utf8`&&t<128||r===`latin1`)&&(e=t)}}else typeof e==`number`?e&=255:typeof e==`boolean`&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError(`Out of range index`);if(n<=t)return this;t>>>=0,n=n===void 0?this.length:n>>>0,e||=0;let i;if(typeof e==`number`)for(i=t;i<n;++i)this[i]=e;else{let a=s.isBuffer(e)?e:s.from(e,r),o=a.length;if(o===0)throw TypeError(`The value "`+e+`" is invalid for argument "value"`);for(i=0;i<n-t;++i)this[i+t]=a[i%o]}return this};var ae={};function oe(e,t,n){ae[e]=class extends n{constructor(){super(),Object.defineProperty(this,`message`,{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,`code`,{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}oe(`ERR_BUFFER_OUT_OF_BOUNDS`,function(e){return e?`${e} is outside of buffer bounds`:`Attempt to access memory outside buffer bounds`},RangeError),oe(`ERR_INVALID_ARG_TYPE`,function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),oe(`ERR_OUT_OF_RANGE`,function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=se(String(n)):typeof n==`bigint`&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=se(i)),i+=`n`),r+=` It must be ${t}. Received ${i}`,r},RangeError);function se(e){let t=``,n=e.length,r=e[0]===`-`?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function ce(e,t,n){ue(t,`offset`),(e[t]===void 0||e[t+n]===void 0)&&de(t,e.length-(n+1))}function le(e,t,n,r,i,a){if(e>n||e<t){let r=typeof t==`bigint`?`n`:``,i;throw i=a>3?t===0||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${(a+1)*8}${r}`:`>= -(2${r} ** ${(a+1)*8-1}${r}) and < 2 ** ${(a+1)*8-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new ae.ERR_OUT_OF_RANGE(`value`,i,e)}ce(r,i,a)}function ue(e,t){if(typeof e!=`number`)throw new ae.ERR_INVALID_ARG_TYPE(t,`number`,e)}function de(e,t,n){throw Math.floor(e)===e?t<0?new ae.ERR_BUFFER_OUT_OF_BOUNDS:new ae.ERR_OUT_OF_RANGE(n||`offset`,`>= ${n?1:0} and <= ${t}`,e):(ue(e,n),new ae.ERR_OUT_OF_RANGE(n||`offset`,`an integer`,e))}var fe=/[^+/0-9A-Za-z-_]/g;function pe(e){if(e=e.split(`=`)[0],e=e.trim().replace(fe,``),e.length<2)return``;for(;e.length%4!=0;)e+=`=`;return e}function me(e,t){t||=1/0;let n,r=e.length,i=null,a=[];for(let o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if(--t<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw Error(`Invalid code point`)}return a}function he(e){let t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function ge(e,t){let n,r,i,a=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}function _e(e){return t.toByteArray(pe(e))}function ve(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function ye(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function H(e){return e!==e}var be=(function(){let e=`0123456789abcdef`,t=Array(256);for(let n=0;n<16;++n){let r=n*16;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t})();function xe(e){return typeof BigInt>`u`?Se:e}function Se(){throw Error(`BigInt not supported`)}})),p=`http://www.w3.org/1999/02/22-rdf-syntax-ns#`,m=`http://www.w3.org/2001/XMLSchema#`,h=`http://www.w3.org/2000/10/swap/`,g={xsd:{decimal:`${m}decimal`,boolean:`${m}boolean`,double:`${m}double`,integer:`${m}integer`,string:`${m}string`},rdf:{type:`${p}type`,nil:`${p}nil`,first:`${p}first`,rest:`${p}rest`,langString:`${p}langString`},owl:{sameAs:`http://www.w3.org/2002/07/owl#sameAs`},r:{forSome:`${h}reify#forSome`,forAll:`${h}reify#forAll`},log:{implies:`${h}log#implies`,isImpliedBy:`${h}log#isImpliedBy`}},_=f(),{xsd:v}=g,y=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,b={"\\":`\\`,"'":`'`,'"':`"`,n:` `,r:`\r`,t:` `,f:`\f`,b:`\b`,_:`_`,"~":`~`,".":`.`,"-":`-`,"!":`!`,$:`$`,"&":`&`,"(":`(`,")":`)`,"*":`*`,"+":`+`,",":`,`,";":`;`,"=":`=`,"/":`/`,"?":`?`,"#":`#`,"@":`@`,"%":`%`},x=/[\x00-\x20<>\\"\{\}\|\^\`]/,S={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},C=/$0^/,w=class{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||={},this._isImpliedBy=e.isImpliedBy,this._lineMode=!!e.lineMode){this._n3Mode=!1;for(let e in this)!(e in S)&&this[e]instanceof RegExp&&(this[e]=C)}else this._n3Mode=e.n3!==!1;this.comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let n=this._input,r=n.length;for(;;){let e,o;for(;e=this._newline.exec(n);)this.comments&&(o=this._comment.exec(e[0]))&&i(`comment`,o[1],``,this._line,e[0].length),n=n.substr(e[0].length,n.length),r=n.length,this._line++;if(!e&&(e=this._whitespace.exec(n))&&(n=n.substr(e[0].length,n.length)),this._endOfFile.test(n))return t&&(this.comments&&(o=this._comment.exec(n))&&i(`comment`,o[1],``,this._line,n.length),n=null,i(`eof`,``,``,this._line,0)),this._input=n;let s=this._line,c=n[0],l=``,u=``,d=``,f=null,p=0,m=!1;switch(c){case`^`:if(n.length<3)break;if(n[1]===`^`){if(this._previousMarker=`^^`,n=n.substr(2),n[0]!==`<`){m=!0;break}}else{this._n3Mode&&(p=1,l=`^`);break}case`<`:if(f=this._unescapedIri.exec(n))l=`IRI`,u=f[1];else if(f=this._iri.exec(n)){if(u=this._unescape(f[1]),u===null||x.test(u))return a(this);l=`IRI`}else n.length>1&&n[1]===`<`?(l=`<<`,p=2):this._n3Mode&&n.length>1&&n[1]===`=`&&(p=2,this._isImpliedBy?(l=`abbreviation`,u=`<`):(l=`inverse`,u=`>`));break;case`>`:n.length>1&&n[1]===`>`&&(l=`>>`,p=2);break;case`_`:((f=this._blank.exec(n))||t&&(f=this._blank.exec(`${n} `)))&&(l=`blank`,d=`_`,u=f[1]);break;case`"`:if(f=this._simpleQuotedString.exec(n))u=f[1];else if({value:u,matchLength:p}=this._parseLiteral(n),u===null)return a(this);(f!==null||p!==0)&&(l=`literal`,this._literalClosingPos=0);break;case`'`:if(!this._lineMode){if(f=this._simpleApostropheString.exec(n))u=f[1];else if({value:u,matchLength:p}=this._parseLiteral(n),u===null)return a(this);(f!==null||p!==0)&&(l=`literal`,this._literalClosingPos=0)}break;case`?`:this._n3Mode&&(f=this._variable.exec(n))&&(l=`var`,u=f[0]);break;case`@`:this._previousMarker===`literal`&&(f=this._langcode.exec(n))?(l=`langcode`,u=f[1]):(f=this._keyword.exec(n))&&(l=f[0]);break;case`.`:if(n.length===1?t:n[1]<`0`||n[1]>`9`){l=`.`,p=1;break}case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:case`+`:case`-`:(f=this._number.exec(n)||t&&(f=this._number.exec(`${n} `)))&&(l=`literal`,u=f[0],d=typeof f[1]==`string`?v.double:typeof f[2]==`string`?v.decimal:v.integer);break;case`B`:case`b`:case`p`:case`P`:case`G`:case`g`:(f=this._sparqlKeyword.exec(n))?l=f[0].toUpperCase():m=!0;break;case`f`:case`t`:(f=this._boolean.exec(n))?(l=`literal`,u=f[0],d=v.boolean):m=!0;break;case`a`:(f=this._shortPredicates.exec(n))?(l=`abbreviation`,u=`a`):m=!0;break;case`=`:this._n3Mode&&n.length>1&&(l=`abbreviation`,n[1]===`>`?(p=2,u=`>`):(p=1,u=`=`));break;case`!`:if(!this._n3Mode)break;case`,`:case`;`:case`[`:case`]`:case`(`:case`)`:case`}`:this._lineMode||(p=1,l=c);break;case`{`:!this._lineMode&&n.length>=2&&(n[1]===`|`?(l=`{|`,p=2):(l=c,p=1));break;case`|`:n.length>=2&&n[1]===`}`&&(l=`|}`,p=2);break;default:m=!0}if(m&&((this._previousMarker===`@prefix`||this._previousMarker===`PREFIX`)&&(f=this._prefix.exec(n))?(l=`prefix`,u=f[1]||``):((f=this._prefixed.exec(n))||t&&(f=this._prefixed.exec(`${n} `)))&&(l=`prefixed`,d=f[1]||``,u=this._unescape(f[2]))),this._previousMarker===`^^`)switch(l){case`prefixed`:l=`type`;break;case`IRI`:l=`typeIRI`;break;default:l=``}if(!l)return t||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?a(this):this._input=n;let h=p||f[0].length;this.previousToken=i(l,u,d,s,h),this._previousMarker=l,n=n.substr(h,n.length)}function i(t,i,a,o,s){let c=n?r-n.length:r,l={type:t,value:i,prefix:a,line:o,start:c,end:c+s};return e(null,l),l}function a(t){e(t._syntaxError(/^\S*/.exec(n)[0]))}}_unescape(e){let t=!1,n=e.replace(y,(e,n,r,i)=>{if(typeof n==`string`)return String.fromCharCode(Number.parseInt(n,16));if(typeof r==`string`){let e=Number.parseInt(r,16);return e<=65535?String.fromCharCode(Number.parseInt(r,16)):String.fromCharCode(55296+((e-=65536)>>10),56320+(e&1023))}return i in b?b[i]:(t=!0,``)});return t?null:n}_parseLiteral(e){if(e.length>=3){let t=e.match(/^(?:"""|"|'''|'|)/)[0],n=t.length,r=Math.max(this._literalClosingPos,n);for(;(r=e.indexOf(t,r))>0;){let t=0;for(;e[r-t-1]===`\\`;)t++;if(t%2==0){let t=e.substring(n,r),i=t.split(/\r\n|\r|\n/).length-1,a=r+n;if(n===1&&i!==0||n===3&&this._lineMode)break;return this._line+=i,{value:this._unescape(t),matchLength:a}}r++}this._literalClosingPos=e.length-n+1}return{value:``,matchLength:0}}_syntaxError(e){this._input=null;let t=Error(`Unexpected "${e}" on line ${this._line}.`);return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}_readStartingBom(e){return e.startsWith(``)?e.substr(1):e}tokenize(e,t){if(this._line=1,typeof e==`string`)if(this._input=this._readStartingBom(e),typeof t==`function`)queueMicrotask(()=>this._tokenizeToEnd(t,!0));else{let e=[],t;if(this._tokenizeToEnd((n,r)=>n?t=n:e.push(r),!0),t)throw t;return e}else this._pendingBuffer=null,typeof e.setEncoding==`function`&&e.setEncoding(`utf8`),e.on(`data`,e=>{this._input!==null&&e.length!==0&&(this._pendingBuffer&&=(e=_.Buffer.concat([this._pendingBuffer,e]),null),e[e.length-1]&128?this._pendingBuffer=e:(this._input===void 0?this._input=this._readStartingBom(typeof e==`string`?e:e.toString()):this._input+=e,this._tokenizeToEnd(t,!1)))}),e.on(`end`,()=>{typeof this._input==`string`&&this._tokenizeToEnd(t,!0)}),e.on(`error`,t)}},{rdf:T,xsd:E}=g,D,O=0,k={namedNode:z,blankNode:B,variable:ee,literal:V,defaultGraph:te,quad:ne,triple:ne,fromTerm:re,fromQuad:ie},A=class e{constructor(e){this.id=e}get value(){return this.id}equals(t){return t instanceof e?this.id===t.id:!!t&&this.termType===t.termType&&this.value===t.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}},j=class extends A{get termType(){return`NamedNode`}},M=class e extends A{get termType(){return`Literal`}get value(){return this.id.substring(1,this.id.lastIndexOf(`"`))}get language(){let e=this.id,t=e.lastIndexOf(`"`)+1;return t<e.length&&e[t++]===`@`?e.substr(t).toLowerCase():``}get datatype(){return new j(this.datatypeString)}get datatypeString(){let e=this.id,t=e.lastIndexOf(`"`)+1,n=t<e.length?e[t]:``;return n===`^`?e.substr(t+2):n===`@`?T.langString:E.string}equals(t){return t instanceof e?this.id===t.id:!!t&&!!t.datatype&&this.termType===t.termType&&this.value===t.value&&this.language===t.language&&this.datatype.value===t.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:`NamedNode`,value:this.datatypeString}}}},N=class extends A{constructor(e){super(`_:${e}`)}get termType(){return`BlankNode`}get value(){return this.id.substr(2)}},P=class extends A{constructor(e){super(`?${e}`)}get termType(){return`Variable`}get value(){return this.id.substr(1)}};D=new class extends A{constructor(){return super(``),D||this}get termType(){return`DefaultGraph`}equals(e){return this===e||!!e&&this.termType===e.termType}};function F(e,t,n){if(t||=k,!e)return t.defaultGraph();switch(e[0]){case`?`:return t.variable(e.substr(1));case`_`:return t.blankNode(e.substr(2));case`"`:if(t===k)return new M(e);if(e[e.length-1]===`"`)return t.literal(e.substr(1,e.length-2));let r=e.lastIndexOf(`"`,e.length-1);return t.literal(e.substr(1,r-1),e[r+1]===`@`?e.substr(r+2):t.namedNode(e.substr(r+3)));case`[`:e=JSON.parse(e);break;default:if(!n||!Array.isArray(e))return t.namedNode(e)}return t.quad(F(e[0],t,!0),F(e[1],t,!0),F(e[2],t,!0),e[3]&&F(e[3],t,!0))}function I(e,t){if(typeof e==`string`)return e;if(e instanceof A&&e.termType!==`Quad`)return e.id;if(!e)return D.id;switch(e.termType){case`NamedNode`:return e.value;case`BlankNode`:return`_:${e.value}`;case`Variable`:return`?${e.value}`;case`DefaultGraph`:return``;case`Literal`:return`"${e.value}"${e.language?`@${e.language}`:e.datatype&&e.datatype.value!==E.string?`^^${e.datatype.value}`:``}`;case`Quad`:let n=[I(e.subject,!0),I(e.predicate,!0),I(e.object,!0)];return e.graph&&e.graph.termType!==`DefaultGraph`&&n.push(I(e.graph,!0)),t?n:JSON.stringify(n);default:throw Error(`Unexpected termType: ${e.termType}`)}}var R=class extends A{constructor(e,t,n,r){super(``),this._subject=e,this._predicate=t,this._object=n,this._graph=r||D}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 z(e){return new j(e)}function B(e){return new N(e||`n3-${O++}`)}function V(e,t){if(typeof t==`string`)return new M(`"${e}"@${t.toLowerCase()}`);let n=t?t.value:``;return n===``&&(typeof e==`boolean`?n=E.boolean:typeof e==`number`&&(Number.isFinite(e)?n=Number.isInteger(e)?E.integer:E.double:(n=E.double,Number.isNaN(e)||(e=e>0?`INF`:`-INF`)))),n===``||n===E.string?new M(`"${e}"`):new M(`"${e}"^^${n}`)}function ee(e){return new P(e)}function te(){return D}function ne(e,t,n,r){return new R(e,t,n,r)}function re(e){if(e instanceof A)return e;switch(e.termType){case`NamedNode`:return z(e.value);case`BlankNode`:return B(e.value);case`Variable`:return ee(e.value);case`DefaultGraph`:return D;case`Literal`:return V(e.value,e.language||e.datatype);case`Quad`:return ie(e);default:throw Error(`Unexpected termType: ${e.termType}`)}}function ie(e){if(e instanceof R)return e;if(e.termType!==`Quad`)throw Error(`Unexpected termType: ${e.termType}`);return ne(re(e.subject),re(e.predicate),re(e.object),re(e.graph))}var ae=0,oe=class{constructor(e){this._contextStack=[],this._graph=null,e||={},this._setBase(e.baseIRI),e.factory&&ce(this,e.factory);let t=typeof e.format==`string`?e.format.match(/\w*$/)[0].toLowerCase():``,n=/turtle/.test(t),r=/trig/.test(t),i=/triple/.test(t),a=/quad/.test(t),o=this._n3Mode=/n3/.test(t),s=i||a;(this._supportsNamedGraphs=!(n||o))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(n||r||i||o),this._isImpliedBy=e.isImpliedBy,this._supportsRDFStar=t===``||/star|\*$/.test(t),s&&(this._resolveRelativeIRI=e=>null),this._blankNodePrefix=typeof e.blankNodePrefix==`string`?e.blankNodePrefix.replace(/^(?!_:)/,`_:`):``,this._lexer=e.lexer||new w({lineMode:s,n3:o,isImpliedBy:this._isImpliedBy}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){ae=0}_setBase(e){if(!e)this._base=``,this._basePath=``;else{let t=e.indexOf(`#`);t>=0&&(e=e.substr(0,t)),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,t,n,r,i){let a=this._n3Mode;this._contextStack.push({type:e,subject:n,predicate:r,object:i,graph:t,inverse:a?this._inversePredicate:!1,blankPrefix:a?this._prefixes._:``,quantified:a?this._quantified:null}),a&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:`.`,this._quantified=Object.create(this._quantified))}_restoreContext(e,t){let n=this._contextStack.pop();if(!n||n.type!==e)return this._error(`Unexpected ${t.type}`,t);this._subject=n.subject,this._predicate=n.predicate,this._object=n.object,this._graph=n.graph,this._n3Mode&&(this._inversePredicate=n.inverse,this._prefixes._=n.blankPrefix,this._quantified=n.quantified)}_readInTopContext(e){switch(e.type){case`eof`:return this._graph===null?(delete this._prefixes._,this._callback(null,null,this._prefixes)):this._error(`Unclosed graph`,e);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,t){let n;switch(e.type){case`IRI`:case`typeIRI`:let t=this._resolveIRI(e.value);if(t===null)return this._error(`Invalid IRI`,e);n=this._factory.namedNode(t);break;case`type`:case`prefixed`:let r=this._prefixes[e.prefix];if(r===void 0)return this._error(`Undefined prefix "${e.prefix}:"`,e);n=this._factory.namedNode(r+e.value);break;case`blank`:n=this._factory.blankNode(this._prefixes[e.prefix]+e.value);break;case`var`:n=this._factory.variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!t&&this._n3Mode&&n.id in this._quantified&&(n=this._quantified[n.id]),n}_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){let t=e.type;switch(t){case`inverse`:this._inversePredicate=!0;case`abbreviation`:this._predicate=this.ABBREVIATIONS[e.value];break;case`.`:case`]`:case`}`:return this._predicate===null?this._error(`Unexpected ${t}`,e):(this._subject=null,t===`]`?this._readBlankNodeTail(e):this._readPunctuation(e));case`;`:return this._predicate===null?this._error(`Expected predicate but got ;`,e):this._readPredicate;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._graph=this._subject,this._subject=null,this._readSubject):this._error(`Expected graph but got ${e.type}`,e)}_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);let t=this._predicate===null;return this._restoreContext(`blank`,e),this._object===null?this._predicate===null?t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank:this._readObject:this._getContextEndReader()}_readPredicateAfterBlank(e){switch(e.type){case`.`:case`}`:return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let t=null,n=null,r=this._readListItem,i=this._subject,a=this._contextStack,o=a[a.length-1];switch(e.type){case`[`:this._saveContext(`blank`,this._graph,n=this._factory.blankNode(),this.RDF_FIRST,this._subject=t=this._factory.blankNode()),r=this._readBlankNodeHead;break;case`(`:this._saveContext(`list`,this._graph,n=this._factory.blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case`)`:if(this._restoreContext(`list`,e),a.length!==0&&a[a.length-1].type===`list`&&this._emit(this._subject,this._predicate,this._object,this._graph),this._predicate===null){if(r=this._readPredicate,this._subject===this.RDF_NIL)return r}else if(r=this._getContextEndReader(),this._object===this.RDF_NIL)return r;n=this.RDF_NIL;break;case`literal`:e.prefix.length===0?(this._literalValue=e.value,r=this._readListItemDataTypeOrLang):(t=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),r=this._getContextEndReader());break;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);default:if((t=this._readEntity(e))===void 0)return}if(n===null&&(this._subject=n=this._factory.blankNode()),i===null?o.predicate===null?o.subject=n:o.object=n:this._emit(i,this.RDF_REST,n,this._graph),t!==null){if(this._n3Mode&&(e.type===`IRI`||e.type===`prefixed`))return this._saveContext(`item`,this._graph,n,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(n,th