@ulb-darmstadt/shacl-form 1.9.3 → 1.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/form-bootstrap.js +27 -27
- package/dist/form-default.js +36 -36
- package/dist/form-material.js +6 -6
- package/dist/plugins/mapbox.js +213 -107
- package/package.json +4 -4
- package/src/property.ts +0 -3
package/dist/form-material.js
CHANGED
|
@@ -4,7 +4,7 @@ var dn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"
|
|
|
4
4
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/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:`
|
|
7
|
-
`,r:"\r",t:" ",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},Lm=/[\x00-\x20<>\\"\{\}\|\^\`]/,Om={},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._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let t=null,r=null,n=this._readListItem;const s=this._subject,o=this._contextStack,a=o[o.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,r=this._factory.blankNode(),this.RDF_FIRST,this._subject=t=this._factory.blankNode()),n=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,r=this._factory.blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),o.length!==0&&o[o.length-1].type==="list"&&this._emit(this._subject,this._predicate,this._object,this._graph),this._predicate===null){if(n=this._readPredicate,this._subject===this.RDF_NIL)return n}else if(n=this._getContextEndReader(),this._object===this.RDF_NIL)return n;r=this.RDF_NIL;break;case"literal":e.prefix.length===0?(this._literalValue=e.value,n=this._readListItemDataTypeOrLang):(t=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),n=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(r===null&&(this._subject=r=this._factory.blankNode()),s===null?a.predicate===null?a.subject=r:a.object=r:this._emit(s,this.RDF_REST,r,this._graph),t!==null){if(this._n3Mode&&(e.type==="IRI"||e.type==="prefixed"))return this._saveContext("item",this._graph,r,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(r,this.RDF_FIRST,t,this._graph)}return n}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let t=this._factory.literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const r=this._readEntity(e);if(r===void 0)return;t=this._factory.literal(this._literalValue,r),e=null;break;case"langcode":t=this._factory.literal(this._literalValue,e.value),e=null;break}return{token:e,literal:t}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){const r=this._completeLiteral(e);if(r)return this._object=r.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),r.token===null?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(r.token))}_readFormulaTail(e){return e.type!=="}"?this._readPunctuation(e):(this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),this._object===null?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let t,r=this._graph;const n=this._subject,s=this._inversePredicate;switch(e.type){case"}":if(this._graph===null)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,s&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;case"{|":if(!this._supportsRDFStar)return this._error("Unexpected RDF-star syntax",e);const o=this._predicate,a=this._object;this._subject=this._factory.quad(n,o,a,this.DEFAULTGRAPH),t=this._readPredicate;break;case"|}":if(this._subject.termType!=="Quad")return this._error("Unexpected asserted triple closing",e);this._subject=null,t=this._readPunctuation;break;default:if(this._supportsQuads&&this._graph===null&&(r=this._readEntity(e))!==void 0){t=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(n!==null){const o=this._predicate,a=this._object;s?this._emit(a,o,n,r):this._emit(n,o,a,r)}return t}_readBlankNodePunctuation(e){let t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}_readQuadPunctuation(e){return e.type!=="."?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return e.type!=="prefix"?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if(e.type!=="IRI")return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){const t=e.type==="IRI"&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return e.type!=="]"?this._error("Invalid graph label",e):(this._subject=this._factory.blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):e.type!=="."?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let t;switch(e.type){case"IRI":case"prefixed":if((t=this._readEntity(e,!0))!==void 0)break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(this._subject===null?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._factory[this._quantifier](this._factory.blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return e.type===","?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const t=this._contextStack,r=t.length&&t[t.length-1];if(r&&r.type==="item"){const n=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,n,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,r;const n=this._factory.blankNode();if((r=this._readEntity(e))!==void 0)return this._predicate===null?(t=this._subject,this._subject=n):(t=this._object,this._object=n),this._emit(t,r,n,this._graph),this._readPath}_readBackwardPath(e){const t=this._factory.blankNode();let r,n;if((r=this._readEntity(e))!==void 0)return this._predicate===null?(n=this._subject,this._subject=t):(n=this._object,this._object=t),this._emit(t,r,n,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return e.type!==">>"?this._supportsQuads&&this._graph===null&&(this._graph=this._readEntity(e))!==void 0?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(e.type!==">>")return this._error(`Expected >> but got ${e.type}`,e);const t=this._factory.quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),this._subject===null?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_getContextEndReader(){const e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,t,r,n){this._callback(null,this._factory.quad(e,t,r,n||this.DEFAULTGRAPH))}_error(e,t){const r=new Error(`${e} on line ${t.line}.`);r.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(r),this._callback=to}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return(e[1]==="/"?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;const t=e.length;let r="",n=-1,s=-1,o=0,a="/";for(;n<t;){switch(a){case":":if(s<0&&e[++n]==="/"&&e[++n]==="/")for(;(s=n+1)<t&&e[s]!=="/";)n=s;break;case"?":case"#":n=t;break;case"/":if(e[n+1]===".")switch(a=e[++n+1],a){case"/":r+=e.substring(o,n-1),o=n+1;break;case void 0:case"?":case"#":return r+e.substring(o,n)+e.substr(n+1);case".":if(a=e[++n+1],a===void 0||a==="/"||a==="?"||a==="#"){if(r+=e.substring(o,n-2),(o=r.lastIndexOf("/"))>=s&&(r=r.substr(0,o)),a!=="/")return`${r}/${e.substr(n+1)}`;o=n+1}}}a=e[++n]}return r+e.substring(o)}parse(e,t,r){let n,s,o;if(t&&(t.onQuad||t.onPrefix||t.onComment)?(n=t.onQuad,s=t.onPrefix,o=t.onComment):(n=t,s=r),this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${Dd++}_`,this._prefixCallback=s||to,this._inversePredicate=!1,this._quantified=Object.create(null),!n){const c=[];let l;if(this._callback=(d,u)=>{d?l=d:u&&c.push(u)},this._lexer.tokenize(e).every(d=>this._readCallback=this._readCallback(d)),l)throw l;return c}let a=(c,l)=>{c!==null?(this._callback(c),this._callback=to):this._readCallback&&(this._readCallback=this._readCallback(l))};o&&(this._lexer.comments=!0,a=(c,l)=>{c!==null?(this._callback(c),this._callback=to):this._readCallback&&(l.type==="comment"?o(l.value):this._readCallback=this._readCallback(l))}),this._callback=n,this._lexer.tokenize(e,a)}}function to(){}function Wf(i,e){i._factory=e,i.DEFAULTGRAPH=e.defaultGraph(),i.RDF_FIRST=e.namedNode(Lt.rdf.first),i.RDF_REST=e.namedNode(Lt.rdf.rest),i.RDF_NIL=e.namedNode(Lt.rdf.nil),i.N3_FORALL=e.namedNode(Lt.r.forAll),i.N3_FORSOME=e.namedNode(Lt.r.forSome),i.ABBREVIATIONS={a:e.namedNode(Lt.rdf.type),"=":e.namedNode(Lt.owl.sameAs),">":e.namedNode(Lt.log.implies),"<":e.namedNode(Lt.log.isImpliedBy)},i.QUANTIFIERS_GRAPH=e.namedNode("urn:n3:quantifiers")}Wf(Hf.prototype,He);function Yl(i){return!!i&&i.termType==="DefaultGraph"}function po(i){return i.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}const zm=/^:?[^:?#]*(?:[?#]|$)|^file:|^[^:]*:\/*[^?#]+?\/(?:\.\.?(?:\/|$)|\/)/i,Hm=/^(?:(?:[^/?#]{3,}|\.?[^/?#.]\.?)(?:\/[^/?#]{3,}|\.?[^/?#.]\.?)*\/?)?(?:[?#]|$)/,Ld="./",Wm="../",sa="?",Od="#";class Nc{constructor(e){this.base=e,this._baseLength=0,this._baseMatcher=null,this._pathReplacements=new Array(e.length+1)}static supports(e){return!zm.test(e)}_getBaseMatcher(){if(this._baseMatcher)return this._baseMatcher;if(!Nc.supports(this.base))return this._baseMatcher=/.^/;const e=/^[^:]*:\/*/.exec(this.base)[0],t=["^",po(e)],r=[],n=[],s=/[^/?#]*([/?#])/y;let o,a=0,c=0,l=s.lastIndex=e.length;for(;!a&&!c&&(o=s.exec(this.base));)o[1]===Od?c=s.lastIndex-1:(t.push(po(o[0]),"(?:"),r.push(")?"),o[1]!==sa?n.push(l=s.lastIndex):(a=l=s.lastIndex,c=this.base.indexOf(Od,a),this._pathReplacements[a]=sa));for(let d=0;d<n.length;d++)this._pathReplacements[n[d]]=Wm.repeat(n.length-d-1);return this._pathReplacements[n[n.length-1]]=Ld,this._baseLength=c>0?c:this.base.length,t.push(po(this.base.substring(l,this._baseLength)),a?"(?:#|$)":"(?:[?#]|$)"),this._baseMatcher=new RegExp([...t,...r].join(""))}toRelative(e){const t=this._getBaseMatcher().exec(e);if(!t)return e;const r=t[0].length;if(r===this._baseLength&&r===e.length)return"";const n=this._pathReplacements[r];if(n){const s=e.substring(r);return n!==sa&&!Hm.test(s)?e:n===Ld&&/^[^?#]/.test(s)?s:n+s}return e.substring(r-1)}}const Hn=He.defaultGraph(),{rdf:Gm,xsd:sn}=Lt,Pd=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,Md=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,Km={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class Wn extends Ni{equals(e){return e===this}}class Dc{constructor(e,t){if(this._prefixRegex=/$0^/,e&&typeof e.write!="function"&&(t=e,e=null),t=t||{},this._lists=t.lists,e)this._outputStream=e,this._endStream=t.end===void 0?!0:!!t.end;else{let r="";this._outputStream={write(n,s,o){r+=n,o&&o()},end:n=>{n&&n(null,r)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(t.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=Hn,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes),t.baseIRI&&(this._baseIri=new Nc(t.baseIRI)))}get _inDefaultGraph(){return Hn.equals(this._graph)}_write(e,t){this._outputStream.write(e,"utf8",t)}_writeQuad(e,t,r,n,s){try{n.equals(this._graph)||(this._write((this._subject===null?"":this._inDefaultGraph?`.
|
|
7
|
+
`,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._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let t=null,r=null,n=this._readListItem;const s=this._subject,o=this._contextStack,a=o[o.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,r=this._factory.blankNode(),this.RDF_FIRST,this._subject=t=this._factory.blankNode()),n=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,r=this._factory.blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),o.length!==0&&o[o.length-1].type==="list"&&this._emit(this._subject,this._predicate,this._object,this._graph),this._predicate===null){if(n=this._readPredicate,this._subject===this.RDF_NIL)return n}else if(n=this._getContextEndReader(),this._object===this.RDF_NIL)return n;r=this.RDF_NIL;break;case"literal":e.prefix.length===0?(this._literalValue=e.value,n=this._readListItemDataTypeOrLang):(t=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),n=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(r===null&&(this._subject=r=this._factory.blankNode()),s===null?a.predicate===null?a.subject=r:a.object=r:this._emit(s,this.RDF_REST,r,this._graph),t!==null){if(this._n3Mode&&(e.type==="IRI"||e.type==="prefixed"))return this._saveContext("item",this._graph,r,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(r,this.RDF_FIRST,t,this._graph)}return n}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let t=this._factory.literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const r=this._readEntity(e);if(r===void 0)return;t=this._factory.literal(this._literalValue,r),e=null;break;case"langcode":t=this._factory.literal(this._literalValue,e.value),e=null;break}return{token:e,literal:t}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){const r=this._completeLiteral(e);if(r)return this._object=r.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),r.token===null?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(r.token))}_readFormulaTail(e){return e.type!=="}"?this._readPunctuation(e):(this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),this._object===null?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let t,r=this._graph;const n=this._subject,s=this._inversePredicate;switch(e.type){case"}":if(this._graph===null)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,s&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;case"{|":if(!this._supportsRDFStar)return this._error("Unexpected RDF-star syntax",e);const o=this._predicate,a=this._object;this._subject=this._factory.quad(n,o,a,this.DEFAULTGRAPH),t=this._readPredicate;break;case"|}":if(this._subject.termType!=="Quad")return this._error("Unexpected asserted triple closing",e);this._subject=null,t=this._readPunctuation;break;default:if(this._supportsQuads&&this._graph===null&&(r=this._readEntity(e))!==void 0){t=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(n!==null){const o=this._predicate,a=this._object;s?this._emit(a,o,n,r):this._emit(n,o,a,r)}return t}_readBlankNodePunctuation(e){let t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}_readQuadPunctuation(e){return e.type!=="."?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return e.type!=="prefix"?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if(e.type!=="IRI")return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){const t=e.type==="IRI"&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return e.type!=="]"?this._error("Invalid graph label",e):(this._subject=this._factory.blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):e.type!=="."?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let t;switch(e.type){case"IRI":case"prefixed":if((t=this._readEntity(e,!0))!==void 0)break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(this._subject===null?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._factory[this._quantifier](this._factory.blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return e.type===","?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const t=this._contextStack,r=t.length&&t[t.length-1];if(r&&r.type==="item"){const n=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,n,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,r;const n=this._factory.blankNode();if((r=this._readEntity(e))!==void 0)return this._predicate===null?(t=this._subject,this._subject=n):(t=this._object,this._object=n),this._emit(t,r,n,this._graph),this._readPath}_readBackwardPath(e){const t=this._factory.blankNode();let r,n;if((r=this._readEntity(e))!==void 0)return this._predicate===null?(n=this._subject,this._subject=t):(n=this._object,this._object=t),this._emit(t,r,n,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return e.type!==">>"?this._supportsQuads&&this._graph===null&&(this._graph=this._readEntity(e))!==void 0?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(e.type!==">>")return this._error(`Expected >> but got ${e.type}`,e);const t=this._factory.quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),this._subject===null?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_getContextEndReader(){const e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,t,r,n){this._callback(null,this._factory.quad(e,t,r,n||this.DEFAULTGRAPH))}_error(e,t){const r=new Error(`${e} on line ${t.line}.`);r.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(r),this._callback=to}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return(e[1]==="/"?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;const t=e.length;let r="",n=-1,s=-1,o=0,a="/";for(;n<t;){switch(a){case":":if(s<0&&e[++n]==="/"&&e[++n]==="/")for(;(s=n+1)<t&&e[s]!=="/";)n=s;break;case"?":case"#":n=t;break;case"/":if(e[n+1]===".")switch(a=e[++n+1],a){case"/":r+=e.substring(o,n-1),o=n+1;break;case void 0:case"?":case"#":return r+e.substring(o,n)+e.substr(n+1);case".":if(a=e[++n+1],a===void 0||a==="/"||a==="?"||a==="#"){if(r+=e.substring(o,n-2),(o=r.lastIndexOf("/"))>=s&&(r=r.substr(0,o)),a!=="/")return`${r}/${e.substr(n+1)}`;o=n+1}}}a=e[++n]}return r+e.substring(o)}parse(e,t,r){let n,s,o;if(t&&(t.onQuad||t.onPrefix||t.onComment)?(n=t.onQuad,s=t.onPrefix,o=t.onComment):(n=t,s=r),this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${Dd++}_`,this._prefixCallback=s||to,this._inversePredicate=!1,this._quantified=Object.create(null),!n){const c=[];let l;if(this._callback=(d,u)=>{d?l=d:u&&c.push(u)},this._lexer.tokenize(e).every(d=>this._readCallback=this._readCallback(d)),l)throw l;return c}let a=(c,l)=>{c!==null?(this._callback(c),this._callback=to):this._readCallback&&(this._readCallback=this._readCallback(l))};o&&(this._lexer.comments=!0,a=(c,l)=>{c!==null?(this._callback(c),this._callback=to):this._readCallback&&(l.type==="comment"?o(l.value):this._readCallback=this._readCallback(l))}),this._callback=n,this._lexer.tokenize(e,a)}}function to(){}function Wf(i,e){i._factory=e,i.DEFAULTGRAPH=e.defaultGraph(),i.RDF_FIRST=e.namedNode(Lt.rdf.first),i.RDF_REST=e.namedNode(Lt.rdf.rest),i.RDF_NIL=e.namedNode(Lt.rdf.nil),i.N3_FORALL=e.namedNode(Lt.r.forAll),i.N3_FORSOME=e.namedNode(Lt.r.forSome),i.ABBREVIATIONS={a:e.namedNode(Lt.rdf.type),"=":e.namedNode(Lt.owl.sameAs),">":e.namedNode(Lt.log.implies),"<":e.namedNode(Lt.log.isImpliedBy)},i.QUANTIFIERS_GRAPH=e.namedNode("urn:n3:quantifiers")}Wf(Hf.prototype,He);function Yl(i){return!!i&&i.termType==="DefaultGraph"}function po(i){return i.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}const zm=/^:?[^:?#]*(?:[?#]|$)|^file:|^[^:]*:\/*[^?#]+?\/(?:\.\.?(?:\/|$)|\/)/i,Hm=/^(?:(?:[^/?#]{3,}|\.?[^/?#.]\.?)(?:\/[^/?#]{3,}|\.?[^/?#.]\.?)*\/?)?(?:[?#]|$)/,Ld="./",Wm="../",sa="?",Od="#";class Nc{constructor(e){this.base=e,this._baseLength=0,this._baseMatcher=null,this._pathReplacements=new Array(e.length+1)}static supports(e){return!zm.test(e)}_getBaseMatcher(){if(this._baseMatcher)return this._baseMatcher;if(!Nc.supports(this.base))return this._baseMatcher=/.^/;const e=/^[^:]*:\/*/.exec(this.base)[0],t=["^",po(e)],r=[],n=[],s=/[^/?#]*([/?#])/y;let o,a=0,c=0,l=s.lastIndex=e.length;for(;!a&&!c&&(o=s.exec(this.base));)o[1]===Od?c=s.lastIndex-1:(t.push(po(o[0]),"(?:"),r.push(")?"),o[1]!==sa?n.push(l=s.lastIndex):(a=l=s.lastIndex,c=this.base.indexOf(Od,a),this._pathReplacements[a]=sa));for(let d=0;d<n.length;d++)this._pathReplacements[n[d]]=Wm.repeat(n.length-d-1);return this._pathReplacements[n[n.length-1]]=Ld,this._baseLength=c>0?c:this.base.length,t.push(po(this.base.substring(l,this._baseLength)),a?"(?:#|$)":"(?:[?#]|$)"),this._baseMatcher=new RegExp([...t,...r].join(""))}toRelative(e){const t=this._getBaseMatcher().exec(e);if(!t)return e;const r=t[0].length;if(r===this._baseLength&&r===e.length)return"";const n=this._pathReplacements[r];if(n){const s=e.substring(r);return n!==sa&&!Hm.test(s)?e:n===Ld&&/^[^?#]/.test(s)?s:n+s}return e.substring(r-1)}}const Hn=He.defaultGraph(),{rdf:Gm,xsd:sn}=Lt,Pd=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,Md=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,Km={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class Wn extends Ni{equals(e){return e===this}}class Dc{constructor(e,t){if(this._prefixRegex=/$0^/,e&&typeof e.write!="function"&&(t=e,e=null),t=t||{},this._lists=t.lists,e)this._outputStream=e,this._endStream=t.end===void 0?!0:!!t.end;else{let r="";this._outputStream={write(n,s,o){r+=n,o&&o()},end:n=>{n&&n(null,r)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(t.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=Hn,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes),t.baseIRI&&(this._baseIri=new Nc(t.baseIRI)))}get _inDefaultGraph(){return Hn.equals(this._graph)}_write(e,t){this._outputStream.write(e,"utf8",t)}_writeQuad(e,t,r,n,s){try{n.equals(this._graph)||(this._write((this._subject===null?"":this._inDefaultGraph?`.
|
|
8
8
|
`:`
|
|
9
9
|
}
|
|
10
10
|
`)+(Hn.equals(n)?"":`${this._encodeIriOrBlank(n)} {
|
|
@@ -87,7 +87,7 @@ a, a:visited { color: inherit; }
|
|
|
87
87
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
88
88
|
*/const Wc=globalThis,ko=Wc.trustedTypes,xu=ko?ko.createPolicy("lit-html",{createHTML:i=>i}):void 0,ap="$lit$",gr=`lit$${Math.random().toFixed(9).slice(2)}$`,lp="?"+gr,Mg=`<${lp}>`,Hr=document,$s=()=>Hr.createComment(""),As=i=>i===null||typeof i!="object"&&typeof i!="function",Gc=Array.isArray,Fg=i=>Gc(i)||typeof i?.[Symbol.iterator]=="function",Na=`[
|
|
89
89
|
\f\r]`,Kn=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Eu=/-->/g,Su=/>/g,Ar=RegExp(`>|${Na}(?:([^\\s"'>=/]+)(${Na}*=${Na}*(?:[^
|
|
90
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),ku=/'/g,Ru=/"/g,cp=/^(?:script|style|textarea|title)$/i,jg=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),Z=jg(1),Vt=Symbol.for("lit-noChange"),it=Symbol.for("lit-nothing"),Iu=new WeakMap,qr=Hr.createTreeWalker(Hr,129);function dp(i,e){if(!Gc(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return xu!==void 0?xu.createHTML(e):e}const Bg=(i,e)=>{const t=i.length-1,r=[];let n,s=e===2?"<svg>":e===3?"<math>":"",o=Kn;for(let a=0;a<t;a++){const c=i[a];let l,d,u=-1,m=0;for(;m<c.length&&(o.lastIndex=m,d=o.exec(c),d!==null);)m=o.lastIndex,o===Kn?d[1]==="!--"?o=Eu:d[1]!==void 0?o=Su:d[2]!==void 0?(cp.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=Ar):d[3]!==void 0&&(o=Ar):o===Ar?d[0]===">"?(o=n??Kn,u=-1):d[1]===void 0?u=-2:(u=o.lastIndex-d[2].length,l=d[1],o=d[3]===void 0?Ar:d[3]==='"'?Ru:ku):o===Ru||o===ku?o=Ar:o===Eu||o===Su?o=Kn:(o=Ar,n=void 0);const g=o===Ar&&i[a+1].startsWith("/>")?" ":"";s+=o===Kn?c+Mg:u>=0?(r.push(l),c.slice(0,u)+ap+c.slice(u)+gr+g):c+gr+(u===-2?a:g)}return[dp(i,s+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]};let ic=class up{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let s=0,o=0;const a=e.length-1,c=this.parts,[l,d]=Bg(e,t);if(this.el=up.createElement(l,r),qr.currentNode=this.el.content,t===2||t===3){const u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(n=qr.nextNode())!==null&&c.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(const u of n.getAttributeNames())if(u.endsWith(ap)){const m=d[o++],g=n.getAttribute(u).split(gr),v=/([.?@])?(.*)/.exec(m);c.push({type:1,index:s,name:v[2],strings:g,ctor:v[1]==="."?Ug:v[1]==="?"?Vg:v[1]==="@"?zg:Ho}),n.removeAttribute(u)}else u.startsWith(gr)&&(c.push({type:6,index:s}),n.removeAttribute(u));if(cp.test(n.tagName)){const u=n.textContent.split(gr),m=u.length-1;if(m>0){n.textContent=ko?ko.emptyScript:"";for(let g=0;g<m;g++)n.append(u[g],$s()),qr.nextNode(),c.push({type:2,index:++s});n.append(u[m],$s())}}}else if(n.nodeType===8)if(n.data===lp)c.push({type:2,index:s});else{let u=-1;for(;(u=n.data.indexOf(gr,u+1))!==-1;)c.push({type:7,index:s}),u+=gr.length-1}s++}}static createElement(e,t){const r=Hr.createElement("template");return r.innerHTML=e,r}};function gn(i,e,t=i,r){if(e===Vt)return e;let n=r!==void 0?t._$Co?.[r]:t._$Cl;const s=As(e)?void 0:e._$litDirective$;return n?.constructor!==s&&(n?._$AO?.(!1),s===void 0?n=void 0:(n=new s(i),n._$AT(i,t,r)),r!==void 0?(t._$Co??=[])[r]=n:t._$Cl=n),n!==void 0&&(e=gn(i,n._$AS(i,e.values),n,r)),e}
|
|
90
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),ku=/'/g,Ru=/"/g,cp=/^(?:script|style|textarea|title)$/i,jg=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),Z=jg(1),Vt=Symbol.for("lit-noChange"),it=Symbol.for("lit-nothing"),Iu=new WeakMap,qr=Hr.createTreeWalker(Hr,129);function dp(i,e){if(!Gc(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return xu!==void 0?xu.createHTML(e):e}const Bg=(i,e)=>{const t=i.length-1,r=[];let n,s=e===2?"<svg>":e===3?"<math>":"",o=Kn;for(let a=0;a<t;a++){const c=i[a];let l,d,u=-1,m=0;for(;m<c.length&&(o.lastIndex=m,d=o.exec(c),d!==null);)m=o.lastIndex,o===Kn?d[1]==="!--"?o=Eu:d[1]!==void 0?o=Su:d[2]!==void 0?(cp.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=Ar):d[3]!==void 0&&(o=Ar):o===Ar?d[0]===">"?(o=n??Kn,u=-1):d[1]===void 0?u=-2:(u=o.lastIndex-d[2].length,l=d[1],o=d[3]===void 0?Ar:d[3]==='"'?Ru:ku):o===Ru||o===ku?o=Ar:o===Eu||o===Su?o=Kn:(o=Ar,n=void 0);const g=o===Ar&&i[a+1].startsWith("/>")?" ":"";s+=o===Kn?c+Mg:u>=0?(r.push(l),c.slice(0,u)+ap+c.slice(u)+gr+g):c+gr+(u===-2?a:g)}return[dp(i,s+(i[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]};let ic=class up{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let s=0,o=0;const a=e.length-1,c=this.parts,[l,d]=Bg(e,t);if(this.el=up.createElement(l,r),qr.currentNode=this.el.content,t===2||t===3){const u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(n=qr.nextNode())!==null&&c.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(const u of n.getAttributeNames())if(u.endsWith(ap)){const m=d[o++],g=n.getAttribute(u).split(gr),v=/([.?@])?(.*)/.exec(m);c.push({type:1,index:s,name:v[2],strings:g,ctor:v[1]==="."?Ug:v[1]==="?"?Vg:v[1]==="@"?zg:Ho}),n.removeAttribute(u)}else u.startsWith(gr)&&(c.push({type:6,index:s}),n.removeAttribute(u));if(cp.test(n.tagName)){const u=n.textContent.split(gr),m=u.length-1;if(m>0){n.textContent=ko?ko.emptyScript:"";for(let g=0;g<m;g++)n.append(u[g],$s()),qr.nextNode(),c.push({type:2,index:++s});n.append(u[m],$s())}}}else if(n.nodeType===8)if(n.data===lp)c.push({type:2,index:s});else{let u=-1;for(;(u=n.data.indexOf(gr,u+1))!==-1;)c.push({type:7,index:s}),u+=gr.length-1}s++}}static createElement(e,t){const r=Hr.createElement("template");return r.innerHTML=e,r}};function gn(i,e,t=i,r){if(e===Vt)return e;let n=r!==void 0?t._$Co?.[r]:t._$Cl;const s=As(e)?void 0:e._$litDirective$;return n?.constructor!==s&&(n?._$AO?.(!1),s===void 0?n=void 0:(n=new s(i),n._$AT(i,t,r)),r!==void 0?(t._$Co??=[])[r]=n:t._$Cl=n),n!==void 0&&(e=gn(i,n._$AS(i,e.values),n,r)),e}class qg{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:r}=this._$AD,n=(e?.creationScope??Hr).importNode(t,!0);qr.currentNode=n;let s=qr.nextNode(),o=0,a=0,c=r[0];for(;c!==void 0;){if(o===c.index){let l;c.type===2?l=new Kc(s,s.nextSibling,this,e):c.type===1?l=new c.ctor(s,c.name,c.strings,this,e):c.type===6&&(l=new Hg(s,this,e)),this._$AV.push(l),c=r[++a]}o!==c?.index&&(s=qr.nextNode(),o++)}return qr.currentNode=Hr,n}p(e){let t=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}}let Kc=class hp{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,n){this.type=2,this._$AH=it,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=gn(this,e,t),As(e)?e===it||e==null||e===""?(this._$AH!==it&&this._$AR(),this._$AH=it):e!==this._$AH&&e!==Vt&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Fg(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==it&&As(this._$AH)?this._$AA.nextSibling.data=e:this.T(Hr.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:r}=e,n=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=ic.createElement(dp(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(t);else{const s=new qg(n,this),o=s.u(this.options);s.p(t),this.T(o),this._$AH=s}}_$AC(e){let t=Iu.get(e.strings);return t===void 0&&Iu.set(e.strings,t=new ic(e)),t}k(e){Gc(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let r,n=0;for(const s of e)n===t.length?t.push(r=new hp(this.O($s()),this.O($s()),this,this.options)):r=t[n],r._$AI(s),n++;n<t.length&&(this._$AR(r&&r._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const r=e.nextSibling;e.remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Ho=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,n,s){this.type=1,this._$AH=it,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=s,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=it}_$AI(e,t=this,r,n){const s=this.strings;let o=!1;if(s===void 0)e=gn(this,e,t,0),o=!As(e)||e!==this._$AH&&e!==Vt,o&&(this._$AH=e);else{const a=e;let c,l;for(e=s[0],c=0;c<s.length-1;c++)l=gn(this,a[r+c],t,c),l===Vt&&(l=this._$AH[c]),o||=!As(l)||l!==this._$AH[c],l===it?e=it:e!==it&&(e+=(l??"")+s[c+1]),this._$AH[c]=l}o&&!n&&this.j(e)}j(e){e===it?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Ug=class extends Ho{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===it?void 0:e}},Vg=class extends Ho{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==it)}},zg=class extends Ho{constructor(e,t,r,n,s){super(e,t,r,n,s),this.type=5}_$AI(e,t=this){if((e=gn(this,e,t,0)??it)===Vt)return;const r=this._$AH,n=e===it&&r!==it||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,s=e!==it&&(r===it||n);n&&this.element.removeEventListener(this.name,this,r),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Hg=class{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){gn(this,e)}};const Wg=Wc.litHtmlPolyfillSupport;Wg?.(ic,Kc),(Wc.litHtmlVersions??=[]).push("3.3.1");const Gg=(i,e,t)=>{const r=t?.renderBefore??e;let n=r._$litPart$;if(n===void 0){const s=t?.renderBefore??null;r._$litPart$=n=new Kc(e.insertBefore($s(),s),s,void 0,t??{})}return n._$AI(i),n};/**
|
|
91
91
|
* @license
|
|
92
92
|
* Copyright 2017 Google LLC
|
|
93
93
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -130,7 +130,7 @@ a, a:visited { color: inherit; }
|
|
|
130
130
|
:host(.caret) a:before { content: ''; width: var(--rokit-caret-size-inner); height: var(--rokit-caret-size-inner); border-style: none solid solid none; border-width: calc(0.3 * var(--rokit-caret-size-inner)); transform: translate(0.15em, -0.15em) rotate(45deg); transition: transform var(--rokit-transition-duration-inner) ease-out; margin-right: calc(0.5 * var(--rokit-caret-size-inner)); }
|
|
131
131
|
:host(.caret.down) a:before { transform: translate(0.15em, 0.15em) rotate(225deg); }
|
|
132
132
|
:host(.caret.right) a:before { transform: translate(0em, 0em) rotate(-45deg); }
|
|
133
|
-
`];gp([Ve({type:Boolean,reflect:!0})],yn.prototype,"icon",2);yn=gp([Jr("rokit-button")],yn);var pb=Object.defineProperty,mb=Object.getOwnPropertyDescriptor,ar=(i,e,t,r)=>{for(var n=r>1?void 0:r?mb(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&pb(e,t,n),n};let zt=class extends Yr{constructor(){super(...arguments),this.open=!1,this.disabled=!1,this.transitioning=!1,this.closedBeforeTransition=!1,this.onMouseDown=(()=>{this.closedBeforeTransition=!this.open&&!this.transitioning}).bind(this),this.onClick=(()=>{this.toggle(this.closedBeforeTransition,!0)}).bind(this)}firstUpdated(){this.transitionDuration=ub(getComputedStyle(this).getPropertyValue("--rokit-transition-duration-inner"))}updated(i){i.has("transitioning")&&this.classList.toggle("transitioning",this.transitioning),i.has("disabled")&&(this.disabled?(this.header.removeEventListener("mousedown",this.onMouseDown),this.header.removeEventListener("click",this.onClick)):(this.header.addEventListener("mousedown",this.onMouseDown),this.header.addEventListener("click",this.onClick))),i.has("open")&&!this.disabled&&(this.transitioning||this.toggle(this.open))}updateContentHeight(){setTimeout(()=>{this.content.style.maxHeight=(this.maxHeight!==void 0?Math.min(this.maxHeight,this.content.scrollHeight):this.content.scrollHeight)+"px",this.classList.toggle("has-content",this.content.style.maxHeight!=="0px")})}onSlotChange(){const i=this.shadowRoot.querySelector("#content > slot").assignedNodes(),e=new MutationObserver(()=>this.updateContentHeight());for(const t of i)e.observe(t,{subtree:!0,childList:!0,characterData:!0});this.updateContentHeight()}toggle(i=!this.open,e=!1){this.disabled||(this.transitioning=!0,this.open=i,this.toggleButton.classList.toggle("down",i),setTimeout(()=>{this.transitioning=!1,this.open&&e&&this.content.scrollIntoView({block:"nearest"})},this.transitionDuration))}render(){return Z`
|
|
133
|
+
`];gp([Ve({type:Boolean,reflect:!0})],yn.prototype,"icon",2);yn=gp([Jr("rokit-button")],yn);var pb=Object.defineProperty,mb=Object.getOwnPropertyDescriptor,ar=(i,e,t,r)=>{for(var n=r>1?void 0:r?mb(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&pb(e,t,n),n};let zt=class extends Yr{constructor(){super(...arguments),this.open=!1,this.disabled=!1,this.transitioning=!1,this.closedBeforeTransition=!1,this.onMouseDown=(()=>{this.closedBeforeTransition=!this.open&&!this.transitioning}).bind(this),this.onClick=(()=>{this.toggle(this.closedBeforeTransition,!0)}).bind(this)}firstUpdated(){this.transitionDuration=ub(getComputedStyle(this).getPropertyValue("--rokit-transition-duration-inner")),new IntersectionObserver(i=>{i.length&&i[0].isIntersecting&&this.updateContentHeight()}).observe(this)}updated(i){i.has("transitioning")&&this.classList.toggle("transitioning",this.transitioning),i.has("disabled")&&(this.disabled?(this.header.removeEventListener("mousedown",this.onMouseDown),this.header.removeEventListener("click",this.onClick)):(this.header.addEventListener("mousedown",this.onMouseDown),this.header.addEventListener("click",this.onClick))),i.has("open")&&!this.disabled&&(this.transitioning||this.toggle(this.open))}updateContentHeight(){setTimeout(()=>{this.content.style.maxHeight=(this.maxHeight!==void 0?Math.min(this.maxHeight,this.content.scrollHeight):this.content.scrollHeight)+"px",this.classList.toggle("has-content",this.content.style.maxHeight!=="0px")})}onSlotChange(){const i=this.shadowRoot.querySelector("#content > slot").assignedNodes(),e=new MutationObserver(()=>this.updateContentHeight());for(const t of i)e.observe(t,{subtree:!0,childList:!0,characterData:!0});this.updateContentHeight()}toggle(i=!this.open,e=!1){this.disabled||(this.transitioning=!0,this.open=i,this.toggleButton.classList.toggle("down",i),setTimeout(()=>{this.transitioning=!1,this.open&&e&&this.content.scrollIntoView({block:"nearest"})},this.transitionDuration))}render(){return Z`
|
|
134
134
|
<header part="header">
|
|
135
135
|
<slot name="prefix" part="prefix"></slot>
|
|
136
136
|
<span class="label"><slot name="label" part="label">${this.label}</slot></span>
|
|
@@ -153,7 +153,7 @@ a, a:visited { color: inherit; }
|
|
|
153
153
|
.label { flex-grow: 1; }
|
|
154
154
|
#content { display: flex; transition: max-height var(--rokit-transition-duration-inner) ease-in-out; position: relative; scrollbar-width: thin; }
|
|
155
155
|
#toggle { margin-left: 3px; }
|
|
156
|
-
`];ar([Ve({type:Boolean,reflect:!0})],zt.prototype,"open",2);ar([Ve()],zt.prototype,"label",2);ar([Ve({reflect:!0})],zt.prototype,"maxHeight",2);ar([Ve({type:Boolean})],zt.prototype,"disabled",2);ar([Di("#content")],zt.prototype,"content",2);ar([Di("#toggle")],zt.prototype,"toggleButton",2);ar([Di("header")],zt.prototype,"header",2);ar([Yc()],zt.prototype,"transitioning",2);zt=ar([Jr("rokit-collapsible")],zt);var gb=Object.defineProperty,bb=Object.getOwnPropertyDescriptor,bp=i=>{throw TypeError(i)},xi=(i,e,t,r)=>{for(var n=r>1?void 0:r?bb(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&gb(e,t,n),n},yp=(i,e,t)=>e.has(i)||bp("Cannot "+t),yb=(i,e,t)=>(yp(i,e,"read from private field"),e.get(i)),vb=(i,e,t)=>e.has(i)?bp("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Du=(i,e,t,r)=>(yp(i,e,"write to private field"),e.set(i,t),t),ps;let It=class extends Li{constructor(){super(),this.type="text",this.readonly=!1,this.sticky=!1,this.minWidth=80,vb(this,ps,""),this.addEventListener("keydown",i=>{i.code==="Escape"&&this.blur()}),this.addEventListener("focus",()=>{this.classList.add("has-focus")}),this.addEventListener("blur",()=>{this.inputElement.scrollLeft=0,this.classList.remove("has-focus")})}firstUpdated(){Du(this,ps,this.value),this.inputElement.addEventListener("change",()=>{this.value=this.inputElement.value}),this.updateMinWidth()}updateMinWidth(){var i,e;const t=this.shadowRoot.querySelector(".wrapper");if(t){const r=((e=(i=this.shadowRoot)==null?void 0:i.querySelector("label"))==null?void 0:e.scrollWidth)||0
|
|
156
|
+
`];ar([Ve({type:Boolean,reflect:!0})],zt.prototype,"open",2);ar([Ve()],zt.prototype,"label",2);ar([Ve({reflect:!0})],zt.prototype,"maxHeight",2);ar([Ve({type:Boolean})],zt.prototype,"disabled",2);ar([Di("#content")],zt.prototype,"content",2);ar([Di("#toggle")],zt.prototype,"toggleButton",2);ar([Di("header")],zt.prototype,"header",2);ar([Yc()],zt.prototype,"transitioning",2);zt=ar([Jr("rokit-collapsible")],zt);var gb=Object.defineProperty,bb=Object.getOwnPropertyDescriptor,bp=i=>{throw TypeError(i)},xi=(i,e,t,r)=>{for(var n=r>1?void 0:r?bb(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&gb(e,t,n),n},yp=(i,e,t)=>e.has(i)||bp("Cannot "+t),yb=(i,e,t)=>(yp(i,e,"read from private field"),e.get(i)),vb=(i,e,t)=>e.has(i)?bp("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Du=(i,e,t,r)=>(yp(i,e,"write to private field"),e.set(i,t),t),ps;let It=class extends Li{constructor(){super(),this.type="text",this.readonly=!1,this.sticky=!1,this.minWidth=80,vb(this,ps,""),this.addEventListener("keydown",i=>{i.code==="Escape"&&this.blur()}),this.addEventListener("focus",()=>{this.classList.add("has-focus")}),this.addEventListener("blur",()=>{this.inputElement.scrollLeft=0,this.classList.remove("has-focus")})}firstUpdated(){Du(this,ps,this.value),this.inputElement.addEventListener("change",()=>{this.value=this.inputElement.value}),new IntersectionObserver(i=>{i.length&&i[0].isIntersecting&&this.updateMinWidth()}).observe(this)}updateMinWidth(){var i,e;const t=this.shadowRoot.querySelector(".wrapper");if(t){const r=((e=(i=this.shadowRoot)==null?void 0:i.querySelector("label"))==null?void 0:e.scrollWidth)||0,n=this.minWidth>r?this.minWidth:r;t.style.minWidth=n>0?n+"px":""}}updated(i){i.has("label")&&(this.classList.toggle("has-label",this.label!==void 0),this.updateMinWidth()),i.has("min")&&(this.inputElement.min=this.min||""),i.has("max")&&(this.inputElement.max=this.max||""),i.has("step")&&(this.inputElement.step=this.step||""),i.has("placeholder")&&(this.inputElement.placeholder=this.placeholder||""),i.has("pattern")&&(this.inputElement.pattern=this.pattern||""),i.has("minLength")&&(this.inputElement.minLength=this.minLength===void 0?-1:this.minLength),i.has("maxLength")&&(this.inputElement.maxLength=this.maxLength===void 0?-1:this.maxLength),i.has("value")&&(this.classList.toggle("has-value",this.value!==""),this.setFormValue(this.value),this.updateValidity(this.inputElement.validity,this.inputElement.validationMessage,this.inputElement),this.value!==yb(this,ps)&&(Du(this,ps,this.value),this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))))}clear(){this.inputElement.value="",this.value="",this.blur()}renderInput(){return Z`<input id="input" part="input" size="1" name="${this.name}" type="${this.type}" autocomplete="off" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" .value="${this.type==="file"?"":this.value}">`}render(){return Z`
|
|
157
157
|
<slot name="prefix" part="prefix"></slot>
|
|
158
158
|
<div class="wrapper">
|
|
159
159
|
<label for="input" part="label">${this.label}</label>
|
|
@@ -222,7 +222,7 @@ a, a:visited { color: inherit; }
|
|
|
222
222
|
:host([collapse]) li > div > div { padding-left: 1.8em; }
|
|
223
223
|
:host([collapse]) ul:not(.open) { display: none; }
|
|
224
224
|
:host([collapse]) li:not(.open) > div > .toggle-node::part(link):before { transform: translate(0em, 0em) rotate(-45deg); }
|
|
225
|
-
`];Jt([Ve()],Et.prototype,"emptyMessage",2);Jt([Ve()],Et.prototype,"sort",2);Jt([Ve()],Et.prototype,"collapsibleMaxHeight",2);Jt([Ve()],Et.prototype,"collapsibleOrientationLeft",2);Jt([Ve()],Et.prototype,"collapsibleOrientationRight",2);Jt([Ve()],Et.prototype,"collapsibleWidth",2);Jt([Ve()],Et.prototype,"inputMinWidth",2);Jt([Ve({type:Boolean,reflect:!0})],Et.prototype,"collapse",2);Jt([Ve()],Et.prototype,"filterableThreshold",2);Jt([Di("rokit-collapsible")],Et.prototype,"collapsible",2);Jt([Di("#input")],Et.prototype,"input",2);Jt([Di("#list-container")],Et.prototype,"listContainer",2);Jt([Yc()],Et.prototype,"selectedItem",2);Jt([Yc()],Et.prototype,"itemCount",2);Et=Jt([Jr("rokit-select")],Et);var xb=Object.defineProperty,Eb=Object.getOwnPropertyDescriptor,Wo=(i,e,t,r)=>{for(var n=r>1?void 0:r?Eb(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&xb(e,t,n),n};let vn=class extends It{constructor(){super(...arguments),this.resize="none",this.rows=3}firstUpdated(){super.firstUpdated(),this.inputElement.rows=this.rows,this.cols!==void 0&&(this.inputElement.cols=this.cols),this.resize==="auto"?(this.inputElement.style.resize="none",this.inputElement.addEventListener("input",()=>this.autoResize())):this.inputElement.style.resize=this.resize}updated(i){super.updated(i),this.resize==="auto"&&i.has("value")&&this.autoResize()}autoResize(){this.inputElement.style.height="",this.inputElement.style.height=this.inputElement.scrollHeight+"px"}onSlotChange(){const i=this.shadowRoot.querySelector("#content").assignedNodes().map(e=>e.textContent).join("");i.trim()!==""&&(this.value=i)}renderInput(){return Z`
|
|
225
|
+
`];Jt([Ve()],Et.prototype,"emptyMessage",2);Jt([Ve()],Et.prototype,"sort",2);Jt([Ve()],Et.prototype,"collapsibleMaxHeight",2);Jt([Ve()],Et.prototype,"collapsibleOrientationLeft",2);Jt([Ve()],Et.prototype,"collapsibleOrientationRight",2);Jt([Ve()],Et.prototype,"collapsibleWidth",2);Jt([Ve()],Et.prototype,"inputMinWidth",2);Jt([Ve({type:Boolean,reflect:!0})],Et.prototype,"collapse",2);Jt([Ve()],Et.prototype,"filterableThreshold",2);Jt([Di("rokit-collapsible")],Et.prototype,"collapsible",2);Jt([Di("#input")],Et.prototype,"input",2);Jt([Di("#list-container")],Et.prototype,"listContainer",2);Jt([Yc()],Et.prototype,"selectedItem",2);Jt([Yc()],Et.prototype,"itemCount",2);Et=Jt([Jr("rokit-select")],Et);var xb=Object.defineProperty,Eb=Object.getOwnPropertyDescriptor,Wo=(i,e,t,r)=>{for(var n=r>1?void 0:r?Eb(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(n=(r?o(e,t,n):o(n))||n);return r&&n&&xb(e,t,n),n};let vn=class extends It{constructor(){super(...arguments),this.resize="none",this.rows=3}firstUpdated(){super.firstUpdated(),this.inputElement.rows=this.rows,this.cols!==void 0&&(this.inputElement.cols=this.cols),this.resize==="auto"?(this.inputElement.style.resize="none",this.inputElement.addEventListener("input",()=>this.autoResize())):this.inputElement.style.resize=this.resize}updated(i){super.updated(i),this.resize==="auto"&&i.has("resize")&&new IntersectionObserver(e=>{e.length&&e[0].isIntersecting&&this.autoResize()}).observe(this),this.resize==="auto"&&i.has("value")&&this.autoResize()}autoResize(){this.inputElement.style.height="",this.inputElement.style.height=this.inputElement.scrollHeight+"px"}onSlotChange(){const i=this.shadowRoot.querySelector("#content").assignedNodes().map(e=>e.textContent).join("");i.trim()!==""&&(this.value=i)}renderInput(){return Z`
|
|
226
226
|
<textarea id="input" part="input" autocomplete="off" name="${this.name}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" .value="${this.value}"></textarea>
|
|
227
227
|
<slot id="content" @slotchange=${this.onSlotChange}></slot>
|
|
228
228
|
`}};vn.styles=[...It.styles,$e`
|
|
@@ -277,7 +277,7 @@ a, a:visited { color: inherit; }
|
|
|
277
277
|
background-color: inherit;
|
|
278
278
|
clip-path: polygon(50% 50%, 100% 50%, 50% 100%, 0 50%);
|
|
279
279
|
}
|
|
280
|
-
`];Gi([Ve()],wn.prototype,"offset",2);Gi([Ve()],wn.prototype,"label",2);wn=Gi([Jr("rokit-slider-knob")],wn);class Io extends HTMLElement{constructor(e,t,r,n){if(super(),this.template=new bg(r.store.getQuads(e,null,null,null),t,r),this.template.extendedShapes.length&&this.template.config.attributes.collapse!==null&&(!this.template.maxCount||this.template.maxCount>1)){const s=new zt;s.classList.add("collapsible","shacl-group"),s.open=r.attributes.collapse==="open",s.label=this.template.label,this.container=s}else this.container=this;if(this.template.order!==void 0&&(this.style.order=`${this.template.order}`),this.template.cssClass&&this.classList.add(this.template.cssClass),r.editMode&&!t.linked&&(this.addButton=this.createAddButton(),this.container.appendChild(this.addButton)),this.template.path){let s=[];n&&(t.linked?s=r.store.getQuads(n,this.template.path,null,null):s=r.store.getQuads(n,this.template.path,null,Bi));let o=!1;for(const a of s)this.isValueValid(a.object)&&(this.addPropertyInstance(a.object),this.template.hasValue&&a.object.equals(this.template.hasValue)&&(o=!0));r.editMode&&this.template.hasValue&&!o&&!t.linked&&this.addPropertyInstance(this.template.hasValue)}r.editMode&&!t.linked&&(this.addEventListener("change",()=>{this.updateControls()}),this.updateControls()),this.container instanceof zt&&(r.editMode&&!t.linked||this.container.childElementCount>0)&&this.appendChild(this.container)}addPropertyInstance(e){let t;if(this.template.shaclOr?.length||this.template.shaclXone?.length){const r=this.template.shaclOr?.length?this.template.shaclOr:this.template.shaclXone;let n=!1;if(e){const s=pg(r,e,this.template.config);s.length&&(t=yo(this.template.clone().merge(s),e,!0),n=!0)}n||(t=sp(r,this,this.template.config),Ep(t,""))}else{let r=!1;if(e&&!(e instanceof bi)){const n=this.getRdfClassToLinkOrCreate();n&&this.template.config.store.countQuads(e,Ot,n,Bi)===0&&(r=!0)}t=yo(this.template,e,void 0,r||this.template.parent.linked)}return this.addButton?this.container.insertBefore(t,this.addButton):this.container.appendChild(t),t}updateControls(){let e=this.querySelectorAll(":scope > .property-instance, :scope > .shacl-or-constraint, :scope > shacl-node").length;e===0&&(!this.template.extendedShapes.length||this.template.minCount!==void 0&&this.template.minCount>0)&&(this.addPropertyInstance(),e=this.querySelectorAll(":scope > .property-instance, :scope > .shacl-or-constraint, :scope > shacl-node").length);let t;this.template.minCount!==void 0?t=e>this.template.minCount:t=this.template.extendedShapes.length>0||e>1;const r=this.template.maxCount===void 0||e<this.template.maxCount;this.classList.toggle("may-remove",t),this.classList.toggle("may-add",r),r&&this.addButton?.input&&this.addButton.input.updateMinWidth()}toRDF(e,t){for(const r of this.querySelectorAll(":scope > .property-instance, :scope > .collapsible > .property-instance")){const n=He.namedNode(r.dataset.path);if(r.firstChild instanceof wr){const s=r.firstChild.toRDF(e);e.addQuad(t,n,s,this.template.config.valuesGraphId)}else for(const s of r.querySelectorAll(":scope > .editor")){const o=Eg(s);o&&e.addQuad(t,n,o,this.template.config.valuesGraphId)}}}getRdfClassToLinkOrCreate(){if(this.template.class&&this.template.node)return this.template.class;for(const e of this.template.extendedShapes){const t=this.template.config.store.getObjects(e,Cs,null);if(t.length>0)return t[0]}}isValueValid(e){if(!this.template.extendedShapes.length)return!0;for(const t of this.template.extendedShapes){const r=this.template.config.store.getObjects(t,Cs,null);for(const n of r)if(this.template.config.store.countQuads(e,Ot,n,null)>0)return!0}return!1}createAddButton(){const e=new Et;e.dense=!0,e.label="+ "+this.template.label,e.title="Add "+this.template.label,e.classList.add("add-button");let t=[],r=this.getRdfClassToLinkOrCreate();if(r&&(t=Uc(r,this.template)),t.length===0)e.emptyMessage="",e.inputMinWidth=0,e.addEventListener("click",n=>{e.blur();const s=this.addPropertyInstance();s.classList.add("fadeIn"),this.updateControls(),setTimeout(()=>{hg(s),s.classList.remove("fadeIn")},200)});else{const n=document.createElement("ul"),s=document.createElement("li");s.innerHTML="+ Create new "+this.template.label+"...",s.dataset.value="new",s.classList.add("large"),n.appendChild(s);const o=document.createElement("li");o.classList.add("divider"),n.appendChild(o);const a=document.createElement("li");a.classList.add("header"),a.innerText="Or link existing:",n.appendChild(a);for(const c of t){const l=document.createElement("li"),d=typeof c.value=="string"?c.value:c.value.value;l.innerText=c.label?c.label:d,l.dataset.value=JSON.stringify(c.value),n.appendChild(l)}e.appendChild(n),e.collapsibleWidth="250px",e.collapsibleOrientationLeft="",e.addEventListener("change",()=>{if(e.value==="new")this.addPropertyInstance();else{const c=JSON.parse(e.value);this.container.insertBefore(yo(this.template,c,!0,!0),e)}e.value=""})}return e}}function yo(i,e,t=!1,r=!1){let n;if(i.extendedShapes.length){n=document.createElement("div"),n.classList.add("property-instance");for(const s of i.extendedShapes)n.appendChild(new wr(s,i.config,e,i.parent,i.nodeKind,i.label,r))}else{const s=Rg(i.path,i.datatype?.value);s?i.config.editMode&&!r?n=s.createEditor(i,e):n=s.createViewer(i,e):n=wg(i,e||null,i.config.editMode&&!r),n.classList.add("property-instance"),r&&n.classList.add("linked")}return i.config.editMode&&Ep(n,i.label,t),n.dataset.path=i.path,n}function Ep(i,e,t=!1){const r=new yn;r.classList.add("remove-button","clear"),r.title="Remove "+e,r.dense=!0,r.icon=!0,r.addEventListener("click",n=>{i.classList.remove("fadeIn"),i.classList.add("fadeOut"),setTimeout(()=>{const s=i.parentElement;i.remove(),s?.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},200)}),t&&r.classList.add("persistent"),i.appendChild(r)}window.customElements.define("shacl-property",Io);function Rb(i,e){let t=i;const r=e.store.getQuads(i,null,null,null),n=ys(r,"label",Fc,e.languages);n&&(t=n);let s;if(e.attributes.collapse!==null)s=new zt,s.classList.add("collapsible"),s.open=e.attributes.collapse==="open",s.label=t;else{s=document.createElement("div");const a=document.createElement("h1");a.innerText=t,s.appendChild(a)}s.dataset.subject=i,s.classList.add("shacl-group");const o=ys(r,"order");return o&&(s.style.order=o),s}const Dt=[];for(let i=0;i<256;++i)Dt.push((i+256).toString(16).slice(1));function Ib(i,e=0){return(Dt[i[e+0]]+Dt[i[e+1]]+Dt[i[e+2]]+Dt[i[e+3]]+"-"+Dt[i[e+4]]+Dt[i[e+5]]+"-"+Dt[i[e+6]]+Dt[i[e+7]]+"-"+Dt[i[e+8]]+Dt[i[e+9]]+"-"+Dt[i[e+10]]+Dt[i[e+11]]+Dt[i[e+12]]+Dt[i[e+13]]+Dt[i[e+14]]+Dt[i[e+15]]).toLowerCase()}let La;const Tb=new Uint8Array(16);function Cb(){if(!La){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");La=crypto.getRandomValues.bind(crypto)}return La(Tb)}const $b=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Pu={randomUUID:$b};function Mu(i,e,t){if(Pu.randomUUID&&!i)return Pu.randomUUID();i=i||{};const r=i.random??i.rng?.()??Cb();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Ib(r)}class wr extends HTMLElement{constructor(e,t,r,n,s,o,a){super(),this.owlImports=[],this.parent=n,this.config=t,this.shaclSubject=e,this.linked=a||!1;let c=r;if(!c){if(!s){const d=t.store.getObjects(e,`${Oe}nodeKind`,null);d.length&&(s=d[0])}s===void 0&&t.attributes.valuesNamespace||s?.value===`${Oe}IRI`?c=He.namedNode(t.attributes.valuesNamespace+Mu()):c=He.blankNode(Mu())}this.nodeId=c;const l=JSON.stringify([e,r]);if(r&&t.renderedNodes.has(l)){o=o||"Link";const d=document.createElement("label");d.innerText=o,d.classList.add("linked"),this.appendChild(d);const u=document.createElement("a");let m=r.termType==="BlankNode"?"_:"+r.value:r.value;u.innerText=m,u.classList.add("ref-link"),u.onclick=()=>{this.config.form.querySelector(`shacl-node[data-node-id='${m}']`)?.scrollIntoView()},this.appendChild(u),this.style.flexDirection="row"}else{if(r&&t.renderedNodes.add(l),this.dataset.nodeId=this.nodeId.id,this.config.attributes.showNodeIds!==null){const d=document.createElement("div");d.innerText=`id: ${this.nodeId.id}`,d.classList.add("node-id-display"),this.appendChild(d)}for(const d of t.store.getQuads(e,Bc,null,null))this.owlImports.push(d.object);for(const d of t.store.getQuads(e,null,null,null))switch(d.predicate.id){case So.id:this.addPropertyInstance(d.object,t,r);break;case`${Oe}and`:const u=t.lists[d.object.value];if(u?.length)for(const m of u)this.prepend(new wr(m,t,r,this));else console.error("list not found:",d.object.value,"existing lists:",t.lists);break;case`${Oe}node`:this.prepend(new wr(d.object,t,r,this));break;case`${Oe}targetClass`:this.targetClass=d.object;break;case`${Oe}or`:this.tryResolve(d.object,r,t);break;case`${Oe}xone`:this.tryResolve(d.object,r,t);break}if(o){const d=document.createElement("h1");d.innerText=o,this.prepend(d)}}}toRDF(e,t){if(t||(t=this.nodeId),!this.linked){for(const r of this.querySelectorAll(":scope > shacl-node, :scope > .shacl-group > shacl-node, :scope > shacl-property, :scope > .shacl-group > shacl-property"))r.toRDF(e,t);this.targetClass&&e.addQuad(t,Ot,this.targetClass,this.config.valuesGraphId),this.config.attributes.generateNodeShapeReference&&!this.parent&&e.addQuad(t,He.namedNode(this.config.attributes.generateNodeShapeReference),this.shaclSubject,this.config.valuesGraphId)}return t}addPropertyInstance(e,t,r){let n=this;const s=t.store.getQuads(e,`${Oe}group`,null,null);if(s.length>0){const a=s[0].object.value;if(t.groups.indexOf(a)>-1){let c=this.querySelector(`:scope > .shacl-group[data-subject='${a}']`);c||(c=Rb(a,t),this.appendChild(c)),n=c}else console.warn("ignoring unknown group reference",s[0],"existing groups:",t.groups)}const o=new Io(e,this,t,r);o.childElementCount>0&&n.appendChild(o)}tryResolve(e,t,r){const n=r.lists[e.value];if(n?.length){let s=!1;if(t){const o=mg(n,t,r);if(o.length){for(const a of o)this.addPropertyInstance(a,r,t);s=!0}}s||this.appendChild(sp(n,this,r))}else console.error("list for sh:or/sh:xone not found:",e,"existing lists:",r.lists)}}window.customElements.define("shacl-node",wr);var Nr={},Dr={},Lr={},Qi={},Fu;function Ab(){if(Fu)return Qi;Fu=1,Object.defineProperty(Qi,"__esModule",{value:!0}),Qi.removeDotSegmentsOfPath=Qi.removeDotSegments=Qi.resolve=void 0;function i(n,s){s=s||"";const o=s.indexOf("#");if(o>0&&(s=s.substr(0,o)),!n.length){if(s.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${s}' for value '${n}'`);return s}if(n.startsWith("?")){const g=s.indexOf("?");return g>0&&(s=s.substr(0,g)),s+n}if(n.startsWith("#"))return s+n;if(!s.length){const g=n.indexOf(":");if(g<0)throw new Error(`Found invalid relative IRI '${n}' for a missing baseIRI`);return t(n,g)}const a=n.indexOf(":");if(a>=0)return t(n,a);const c=s.indexOf(":");if(c<0)throw new Error(`Found invalid baseIRI '${s}' for value '${n}'`);const l=s.substr(0,c+1);if(n.indexOf("//")===0)return l+t(n,a);let d;if(s.indexOf("//",c)===c+1){if(d=s.indexOf("/",c+3),d<0)return s.length>c+3?s+"/"+t(n,a):l+t(n,a)}else if(d=s.indexOf("/",c+1),d<0)return l+t(n,a);if(n.indexOf("/")===0)return s.substr(0,d)+e(n);let u=s.substr(d);const m=u.lastIndexOf("/");return m>=0&&m<u.length-1&&(u=u.substr(0,m+1),n[0]==="."&&n[1]!=="."&&n[1]!=="/"&&n[2]&&(n=n.substr(1))),n=u+n,n=e(n),s.substr(0,d)+n}Qi.resolve=i;function e(n){const s=[];let o=0;for(;o<n.length;)switch(n[o]){case"/":if(n[o+1]===".")if(n[o+2]==="."){if(!r(n[o+3])){s.push([]),o++;break}s.pop(),n[o+3]||s.push([]),o+=3}else{if(!r(n[o+2])){s.push([]),o++;break}n[o+2]||s.push([]),o+=2}else s.push([]),o++;break;case"#":case"?":s.length||s.push([]),s[s.length-1].push(n.substr(o)),o=n.length;break;default:s.length||s.push([]),s[s.length-1].push(n[o]),o++;break}return"/"+s.map(a=>a.join("")).join("/")}Qi.removeDotSegments=e;function t(n,s){let o=s+1;s>=0?n[s+1]==="/"&&n[s+2]==="/"&&(o=s+3):n[0]==="/"&&n[1]==="/"&&(o=2);const a=n.indexOf("/",o);if(a<0)return n;const c=n.substr(0,a),l=n.substr(a);return c+e(l)}Qi.removeDotSegmentsOfPath=t;function r(n){return!n||n==="#"||n==="?"||n==="/"}return Qi}var ju;function Nb(){return ju||(ju=1,function(i){var e=Lr&&Lr.__createBinding||(Object.create?function(r,n,s,o){o===void 0&&(o=s),Object.defineProperty(r,o,{enumerable:!0,get:function(){return n[s]}})}:function(r,n,s,o){o===void 0&&(o=s),r[o]=n[s]}),t=Lr&&Lr.__exportStar||function(r,n){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(n,s)&&e(n,r,s)};Object.defineProperty(i,"__esModule",{value:!0}),t(Ab(),i)}(Lr)),Lr}var Or={},Oa={},Bu;function Db(){return Bu||(Bu=1,function(i){/**
|
|
280
|
+
`];Gi([Ve()],wn.prototype,"offset",2);Gi([Ve()],wn.prototype,"label",2);wn=Gi([Jr("rokit-slider-knob")],wn);class Io extends HTMLElement{constructor(e,t,r,n){if(super(),this.template=new bg(r.store.getQuads(e,null,null,null),t,r),this.template.extendedShapes.length&&this.template.config.attributes.collapse!==null&&(!this.template.maxCount||this.template.maxCount>1)){const s=new zt;s.classList.add("collapsible","shacl-group"),s.open=r.attributes.collapse==="open",s.label=this.template.label,this.container=s}else this.container=this;if(this.template.order!==void 0&&(this.style.order=`${this.template.order}`),this.template.cssClass&&this.classList.add(this.template.cssClass),r.editMode&&!t.linked&&(this.addButton=this.createAddButton(),this.container.appendChild(this.addButton)),this.template.path){let s=[];n&&(t.linked?s=r.store.getQuads(n,this.template.path,null,null):s=r.store.getQuads(n,this.template.path,null,Bi));let o=!1;for(const a of s)this.isValueValid(a.object)&&(this.addPropertyInstance(a.object),this.template.hasValue&&a.object.equals(this.template.hasValue)&&(o=!0));r.editMode&&this.template.hasValue&&!o&&!t.linked&&this.addPropertyInstance(this.template.hasValue)}r.editMode&&!t.linked&&(this.addEventListener("change",()=>{this.updateControls()}),this.updateControls()),this.container instanceof zt&&(r.editMode&&!t.linked||this.container.childElementCount>0)&&this.appendChild(this.container)}addPropertyInstance(e){let t;if(this.template.shaclOr?.length||this.template.shaclXone?.length){const r=this.template.shaclOr?.length?this.template.shaclOr:this.template.shaclXone;let n=!1;if(e){const s=pg(r,e,this.template.config);s.length&&(t=yo(this.template.clone().merge(s),e,!0),n=!0)}n||(t=sp(r,this,this.template.config),Ep(t,""))}else{let r=!1;if(e&&!(e instanceof bi)){const n=this.getRdfClassToLinkOrCreate();n&&this.template.config.store.countQuads(e,Ot,n,Bi)===0&&(r=!0)}t=yo(this.template,e,void 0,r||this.template.parent.linked)}return this.addButton?this.container.insertBefore(t,this.addButton):this.container.appendChild(t),t}updateControls(){let e=this.querySelectorAll(":scope > .property-instance, :scope > .shacl-or-constraint, :scope > shacl-node").length;e===0&&(!this.template.extendedShapes.length||this.template.minCount!==void 0&&this.template.minCount>0)&&(this.addPropertyInstance(),e=this.querySelectorAll(":scope > .property-instance, :scope > .shacl-or-constraint, :scope > shacl-node").length);let t;this.template.minCount!==void 0?t=e>this.template.minCount:t=this.template.extendedShapes.length>0||e>1;const r=this.template.maxCount===void 0||e<this.template.maxCount;this.classList.toggle("may-remove",t),this.classList.toggle("may-add",r)}toRDF(e,t){for(const r of this.querySelectorAll(":scope > .property-instance, :scope > .collapsible > .property-instance")){const n=He.namedNode(r.dataset.path);if(r.firstChild instanceof wr){const s=r.firstChild.toRDF(e);e.addQuad(t,n,s,this.template.config.valuesGraphId)}else for(const s of r.querySelectorAll(":scope > .editor")){const o=Eg(s);o&&e.addQuad(t,n,o,this.template.config.valuesGraphId)}}}getRdfClassToLinkOrCreate(){if(this.template.class&&this.template.node)return this.template.class;for(const e of this.template.extendedShapes){const t=this.template.config.store.getObjects(e,Cs,null);if(t.length>0)return t[0]}}isValueValid(e){if(!this.template.extendedShapes.length)return!0;for(const t of this.template.extendedShapes){const r=this.template.config.store.getObjects(t,Cs,null);for(const n of r)if(this.template.config.store.countQuads(e,Ot,n,null)>0)return!0}return!1}createAddButton(){const e=new Et;e.dense=!0,e.label="+ "+this.template.label,e.title="Add "+this.template.label,e.classList.add("add-button");let t=[],r=this.getRdfClassToLinkOrCreate();if(r&&(t=Uc(r,this.template)),t.length===0)e.emptyMessage="",e.inputMinWidth=0,e.addEventListener("click",n=>{e.blur();const s=this.addPropertyInstance();s.classList.add("fadeIn"),this.updateControls(),setTimeout(()=>{hg(s),s.classList.remove("fadeIn")},200)});else{const n=document.createElement("ul"),s=document.createElement("li");s.innerHTML="+ Create new "+this.template.label+"...",s.dataset.value="new",s.classList.add("large"),n.appendChild(s);const o=document.createElement("li");o.classList.add("divider"),n.appendChild(o);const a=document.createElement("li");a.classList.add("header"),a.innerText="Or link existing:",n.appendChild(a);for(const c of t){const l=document.createElement("li"),d=typeof c.value=="string"?c.value:c.value.value;l.innerText=c.label?c.label:d,l.dataset.value=JSON.stringify(c.value),n.appendChild(l)}e.appendChild(n),e.collapsibleWidth="250px",e.collapsibleOrientationLeft="",e.addEventListener("change",()=>{if(e.value==="new")this.addPropertyInstance();else{const c=JSON.parse(e.value);this.container.insertBefore(yo(this.template,c,!0,!0),e)}e.value=""})}return e}}function yo(i,e,t=!1,r=!1){let n;if(i.extendedShapes.length){n=document.createElement("div"),n.classList.add("property-instance");for(const s of i.extendedShapes)n.appendChild(new wr(s,i.config,e,i.parent,i.nodeKind,i.label,r))}else{const s=Rg(i.path,i.datatype?.value);s?i.config.editMode&&!r?n=s.createEditor(i,e):n=s.createViewer(i,e):n=wg(i,e||null,i.config.editMode&&!r),n.classList.add("property-instance"),r&&n.classList.add("linked")}return i.config.editMode&&Ep(n,i.label,t),n.dataset.path=i.path,n}function Ep(i,e,t=!1){const r=new yn;r.classList.add("remove-button","clear"),r.title="Remove "+e,r.dense=!0,r.icon=!0,r.addEventListener("click",n=>{i.classList.remove("fadeIn"),i.classList.add("fadeOut"),setTimeout(()=>{const s=i.parentElement;i.remove(),s?.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},200)}),t&&r.classList.add("persistent"),i.appendChild(r)}window.customElements.define("shacl-property",Io);function Rb(i,e){let t=i;const r=e.store.getQuads(i,null,null,null),n=ys(r,"label",Fc,e.languages);n&&(t=n);let s;if(e.attributes.collapse!==null)s=new zt,s.classList.add("collapsible"),s.open=e.attributes.collapse==="open",s.label=t;else{s=document.createElement("div");const a=document.createElement("h1");a.innerText=t,s.appendChild(a)}s.dataset.subject=i,s.classList.add("shacl-group");const o=ys(r,"order");return o&&(s.style.order=o),s}const Dt=[];for(let i=0;i<256;++i)Dt.push((i+256).toString(16).slice(1));function Ib(i,e=0){return(Dt[i[e+0]]+Dt[i[e+1]]+Dt[i[e+2]]+Dt[i[e+3]]+"-"+Dt[i[e+4]]+Dt[i[e+5]]+"-"+Dt[i[e+6]]+Dt[i[e+7]]+"-"+Dt[i[e+8]]+Dt[i[e+9]]+"-"+Dt[i[e+10]]+Dt[i[e+11]]+Dt[i[e+12]]+Dt[i[e+13]]+Dt[i[e+14]]+Dt[i[e+15]]).toLowerCase()}let La;const Tb=new Uint8Array(16);function Cb(){if(!La){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");La=crypto.getRandomValues.bind(crypto)}return La(Tb)}const $b=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Pu={randomUUID:$b};function Mu(i,e,t){if(Pu.randomUUID&&!i)return Pu.randomUUID();i=i||{};const r=i.random??i.rng?.()??Cb();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Ib(r)}class wr extends HTMLElement{constructor(e,t,r,n,s,o,a){super(),this.owlImports=[],this.parent=n,this.config=t,this.shaclSubject=e,this.linked=a||!1;let c=r;if(!c){if(!s){const d=t.store.getObjects(e,`${Oe}nodeKind`,null);d.length&&(s=d[0])}s===void 0&&t.attributes.valuesNamespace||s?.value===`${Oe}IRI`?c=He.namedNode(t.attributes.valuesNamespace+Mu()):c=He.blankNode(Mu())}this.nodeId=c;const l=JSON.stringify([e,r]);if(r&&t.renderedNodes.has(l)){o=o||"Link";const d=document.createElement("label");d.innerText=o,d.classList.add("linked"),this.appendChild(d);const u=document.createElement("a");let m=r.termType==="BlankNode"?"_:"+r.value:r.value;u.innerText=m,u.classList.add("ref-link"),u.onclick=()=>{this.config.form.querySelector(`shacl-node[data-node-id='${m}']`)?.scrollIntoView()},this.appendChild(u),this.style.flexDirection="row"}else{if(r&&t.renderedNodes.add(l),this.dataset.nodeId=this.nodeId.id,this.config.attributes.showNodeIds!==null){const d=document.createElement("div");d.innerText=`id: ${this.nodeId.id}`,d.classList.add("node-id-display"),this.appendChild(d)}for(const d of t.store.getQuads(e,Bc,null,null))this.owlImports.push(d.object);for(const d of t.store.getQuads(e,null,null,null))switch(d.predicate.id){case So.id:this.addPropertyInstance(d.object,t,r);break;case`${Oe}and`:const u=t.lists[d.object.value];if(u?.length)for(const m of u)this.prepend(new wr(m,t,r,this));else console.error("list not found:",d.object.value,"existing lists:",t.lists);break;case`${Oe}node`:this.prepend(new wr(d.object,t,r,this));break;case`${Oe}targetClass`:this.targetClass=d.object;break;case`${Oe}or`:this.tryResolve(d.object,r,t);break;case`${Oe}xone`:this.tryResolve(d.object,r,t);break}if(o){const d=document.createElement("h1");d.innerText=o,this.prepend(d)}}}toRDF(e,t){if(t||(t=this.nodeId),!this.linked){for(const r of this.querySelectorAll(":scope > shacl-node, :scope > .shacl-group > shacl-node, :scope > shacl-property, :scope > .shacl-group > shacl-property"))r.toRDF(e,t);this.targetClass&&e.addQuad(t,Ot,this.targetClass,this.config.valuesGraphId),this.config.attributes.generateNodeShapeReference&&!this.parent&&e.addQuad(t,He.namedNode(this.config.attributes.generateNodeShapeReference),this.shaclSubject,this.config.valuesGraphId)}return t}addPropertyInstance(e,t,r){let n=this;const s=t.store.getQuads(e,`${Oe}group`,null,null);if(s.length>0){const a=s[0].object.value;if(t.groups.indexOf(a)>-1){let c=this.querySelector(`:scope > .shacl-group[data-subject='${a}']`);c||(c=Rb(a,t),this.appendChild(c)),n=c}else console.warn("ignoring unknown group reference",s[0],"existing groups:",t.groups)}const o=new Io(e,this,t,r);o.childElementCount>0&&n.appendChild(o)}tryResolve(e,t,r){const n=r.lists[e.value];if(n?.length){let s=!1;if(t){const o=mg(n,t,r);if(o.length){for(const a of o)this.addPropertyInstance(a,r,t);s=!0}}s||this.appendChild(sp(n,this,r))}else console.error("list for sh:or/sh:xone not found:",e,"existing lists:",r.lists)}}window.customElements.define("shacl-node",wr);var Nr={},Dr={},Lr={},Qi={},Fu;function Ab(){if(Fu)return Qi;Fu=1,Object.defineProperty(Qi,"__esModule",{value:!0}),Qi.removeDotSegmentsOfPath=Qi.removeDotSegments=Qi.resolve=void 0;function i(n,s){s=s||"";const o=s.indexOf("#");if(o>0&&(s=s.substr(0,o)),!n.length){if(s.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${s}' for value '${n}'`);return s}if(n.startsWith("?")){const g=s.indexOf("?");return g>0&&(s=s.substr(0,g)),s+n}if(n.startsWith("#"))return s+n;if(!s.length){const g=n.indexOf(":");if(g<0)throw new Error(`Found invalid relative IRI '${n}' for a missing baseIRI`);return t(n,g)}const a=n.indexOf(":");if(a>=0)return t(n,a);const c=s.indexOf(":");if(c<0)throw new Error(`Found invalid baseIRI '${s}' for value '${n}'`);const l=s.substr(0,c+1);if(n.indexOf("//")===0)return l+t(n,a);let d;if(s.indexOf("//",c)===c+1){if(d=s.indexOf("/",c+3),d<0)return s.length>c+3?s+"/"+t(n,a):l+t(n,a)}else if(d=s.indexOf("/",c+1),d<0)return l+t(n,a);if(n.indexOf("/")===0)return s.substr(0,d)+e(n);let u=s.substr(d);const m=u.lastIndexOf("/");return m>=0&&m<u.length-1&&(u=u.substr(0,m+1),n[0]==="."&&n[1]!=="."&&n[1]!=="/"&&n[2]&&(n=n.substr(1))),n=u+n,n=e(n),s.substr(0,d)+n}Qi.resolve=i;function e(n){const s=[];let o=0;for(;o<n.length;)switch(n[o]){case"/":if(n[o+1]===".")if(n[o+2]==="."){if(!r(n[o+3])){s.push([]),o++;break}s.pop(),n[o+3]||s.push([]),o+=3}else{if(!r(n[o+2])){s.push([]),o++;break}n[o+2]||s.push([]),o+=2}else s.push([]),o++;break;case"#":case"?":s.length||s.push([]),s[s.length-1].push(n.substr(o)),o=n.length;break;default:s.length||s.push([]),s[s.length-1].push(n[o]),o++;break}return"/"+s.map(a=>a.join("")).join("/")}Qi.removeDotSegments=e;function t(n,s){let o=s+1;s>=0?n[s+1]==="/"&&n[s+2]==="/"&&(o=s+3):n[0]==="/"&&n[1]==="/"&&(o=2);const a=n.indexOf("/",o);if(a<0)return n;const c=n.substr(0,a),l=n.substr(a);return c+e(l)}Qi.removeDotSegmentsOfPath=t;function r(n){return!n||n==="#"||n==="?"||n==="/"}return Qi}var ju;function Nb(){return ju||(ju=1,function(i){var e=Lr&&Lr.__createBinding||(Object.create?function(r,n,s,o){o===void 0&&(o=s),Object.defineProperty(r,o,{enumerable:!0,get:function(){return n[s]}})}:function(r,n,s,o){o===void 0&&(o=s),r[o]=n[s]}),t=Lr&&Lr.__exportStar||function(r,n){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(n,s)&&e(n,r,s)};Object.defineProperty(i,"__esModule",{value:!0}),t(Ab(),i)}(Lr)),Lr}var Or={},Oa={},Bu;function Db(){return Bu||(Bu=1,function(i){/**
|
|
281
281
|
* Character classes and associated utilities for the 5th edition of XML 1.0.
|
|
282
282
|
*
|
|
283
283
|
* @author Louis-Dominique Dubeau
|