UNPKG

@ulb-darmstadt/shacl-form

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