/*! For license information please see 515.rdflib.min.js.LICENSE.txt */ (self.webpackChunk$rdf=self.webpackChunk$rdf||[]).push([[515],{7471:e=>{"use strict";e.exports=function e(t){return null===t||"object"!=typeof t||null!=t.toJSON?JSON.stringify(t):Array.isArray(t)?"["+t.reduce(((t,n,o)=>t+(0===o?"":",")+e(void 0===n||"symbol"==typeof n?null:n)),"")+"]":"{"+Object.keys(t).sort().reduce(((n,o,r)=>void 0===t[o]||"symbol"==typeof t[o]?n:n+(0===n.length?"":",")+e(o)+":"+e(t[o])),"")+"}"}},3899:(e,t,n)=>{"use strict";const{isArray:o,isObject:r,isString:a}=n(7904),{asArray:i}=n(9721),{prependBase:s}=n(904),l=n(8325),c=n(2206);function d(e){throw new l("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:e})}function u({context:e,base:t}){if(!e)return;const n=e["@context"];if(a(n))e["@context"]=s(t,n);else if(o(n))for(let e=0;e10)throw new l("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"loading remote context failed":"context overflow",max:10});if(i.has(t))throw new l("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"recursive context inclusion":"context overflow",url:t});let s,c;i.add(t);try{c=await n(t),s=c.document||null,a(s)&&(s=JSON.parse(s))}catch(e){throw new l("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:t,cause:e})}if(!r(s))throw new l("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:t});return s="@context"in s?{"@context":s["@context"]}:{"@context":{}},c.contextUrl&&(o(s["@context"])||(s["@context"]=[s["@context"]]),s["@context"].push(c.contextUrl)),{context:s,remoteDoc:c}}}},8325:e=>{"use strict";e.exports=class extends Error{constructor(e="An unspecified JSON-LD error occurred.",t="jsonld.Error",n={}){super(e),this.name=t,this.message=e,this.details=n}}},71:e=>{"use strict";e.exports=e=>{class t{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t}),t.compact=function(t,n){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(t,n)},t.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(t)},t.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(t)},t}},431:(e,t,n)=>{"use strict";e.exports=n(4051).NQuads},9889:e=>{"use strict";e.exports=class{constructor(){this._requests={}}wrapLoader(e){const t=this;return t._loader=e,function(){return t.add.apply(t,arguments)}}async add(e){let t=this._requests[e];if(t)return Promise.resolve(t);t=this._requests[e]=this._loader(e);try{return await t}finally{delete this._requests[e]}}}},2206:(e,t,n)=>{"use strict";const o=n(8729);e.exports=class{constructor({document:e}){this.document=e,this.cache=new o({max:10})}getProcessed(e){return this.cache.get(e)}setProcessed(e,t){this.cache.set(e,t)}}},964:(e,t,n)=>{"use strict";const o=n(8325),{isArray:r,isObject:a,isString:i,isUndefined:s}=n(7904),{isList:l,isValue:c,isGraph:d,isSimpleGraph:u,isSubjectReference:p}=n(7848),{expandIri:h,getContextValue:f,isKeyword:v,process:g,processingMode:y}=n(4974),{removeBase:m,prependBase:x}=n(904),{REGEX_KEYWORD:b,addValue:w,asArray:j,compareShortestLeast:I}=n(9721),N={};function S(e,t,n){if("@nest"!==h(e,t,{vocab:!0},n))throw new o("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}e.exports=N,N.compact=async({activeCtx:e,activeProperty:t=null,element:n,options:h={}})=>{if(r(n)){let o=[];for(let r=0;r1&&(O=Array.from(O).sort());const E=e;for(const t of O){const n=N.compactIri({activeCtx:E,iri:t,relativeTo:{vocab:!0}}),o=f(b,n,"@context");s(o)||(e=await g({activeCtx:e,localCtx:o,options:h,propagate:!1}))}const D=Object.keys(n).sort();for(const s of D){const p=n[s];if("@id"!==s)if("@type"!==s)if("@reverse"!==s)if("@preserve"!==s)if("@index"!==s)if("@graph"!==s&&"@list"!==s&&"@included"!==s&&v(s)){const t=N.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});w(x,t,p)}else{if(!r(p))throw new o("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===p.length){const t=N.compactIri({activeCtx:e,iri:s,value:p,relativeTo:{vocab:!0},reverse:m}),n=e.mappings.has(t)?e.mappings.get(t)["@nest"]:null;let o=x;n&&(S(e,n,h),a(x[n])||(x[n]={}),o=x[n]),w(o,t,p,{propertyIsArray:!0})}for(const t of p){const n=N.compactIri({activeCtx:e,iri:s,value:t,relativeTo:{vocab:!0},reverse:m}),o=e.mappings.has(n)?e.mappings.get(n)["@nest"]:null;let p=x;o&&(S(e,o,h),a(x[o])||(x[o]={}),p=x[o]);const v=f(e,n,"@container")||[],g=d(t),y=l(t);let b;y?b=t["@list"]:g&&(b=t["@graph"]);let I=await N.compact({activeCtx:e,activeProperty:n,element:y||g?b:t,options:h});if(y){if(r(I)||(I=[I]),v.includes("@list")){w(p,n,I,{valueIsArray:!0,allowDuplicate:!0});continue}I={[N.compactIri({activeCtx:e,iri:"@list",relativeTo:{vocab:!0}})]:I},"@index"in t&&(I[N.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"])}if(g)if(v.includes("@graph")&&(v.includes("@id")||v.includes("@index")&&u(t))){let o;p.hasOwnProperty(n)?o=p[n]:p[n]=o={};const r=(v.includes("@id")?t["@id"]:t["@index"])||N.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}});w(o,r,I,{propertyIsArray:!h.compactArrays||v.includes("@set")})}else v.includes("@graph")&&u(t)?(r(I)&&I.length>1&&(I={"@included":I}),w(p,n,I,{propertyIsArray:!h.compactArrays||v.includes("@set")})):(r(I)&&1===I.length&&h.compactArrays&&(I=I[0]),I={[N.compactIri({activeCtx:e,iri:"@graph",relativeTo:{vocab:!0}})]:I},"@id"in t&&(I[N.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t["@id"]),"@index"in t&&(I[N.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"]),w(p,n,I,{propertyIsArray:!h.compactArrays||v.includes("@set")}));else if(v.includes("@language")||v.includes("@index")||v.includes("@id")||v.includes("@type")){let o,r;if(p.hasOwnProperty(n)?o=p[n]:p[n]=o={},v.includes("@language"))c(I)&&(I=I["@value"]),r=t["@language"];else if(v.includes("@index")){const o=f(e,n,"@index")||"@index",a=N.compactIri({activeCtx:e,iri:o,relativeTo:{vocab:!0}});if("@index"===o)r=t["@index"],delete I[a];else{let e;if([r,...e]=j(I[o]||[]),i(r))switch(e.length){case 0:delete I[o];break;case 1:I[o]=e[0];break;default:I[o]=e}else r=null}}else if(v.includes("@id")){const t=N.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}});r=I[t],delete I[t]}else if(v.includes("@type")){const o=N.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}});let a;switch([r,...a]=j(I[o]||[]),a.length){case 0:delete I[o];break;case 1:I[o]=a[0];break;default:I[o]=a}1===Object.keys(I).length&&"@id"in t&&(I=await N.compact({activeCtx:e,activeProperty:n,element:{"@id":t["@id"]},options:h}))}r||(r=N.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}})),w(o,r,I,{propertyIsArray:v.includes("@set")})}else{const e=!h.compactArrays||v.includes("@set")||v.includes("@list")||r(I)&&0===I.length||"@list"===s||"@graph"===s;w(p,n,I,{propertyIsArray:e})}}}else{if((f(e,t,"@container")||[]).includes("@index"))continue;const n=N.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});w(x,n,p)}else{const n=await N.compact({activeCtx:e,activeProperty:t,element:p,options:h});r(n)&&0===n.length||w(x,s,n)}else{const t=await N.compact({activeCtx:e,activeProperty:"@reverse",element:p,options:h});for(const n in t)if(e.mappings.has(n)&&e.mappings.get(n).reverse){const o=t[n],r=(f(e,n,"@container")||[]).includes("@set")||!h.compactArrays;w(x,n,o,{propertyIsArray:r}),delete t[n]}if(Object.keys(t).length>0){const n=N.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});w(x,n,t)}}else{let t=j(p).map((e=>N.compactIri({activeCtx:b,iri:e,relativeTo:{vocab:!0}})));1===t.length&&(t=t[0]);const n=N.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}}),o=(f(e,n,"@container")||[]).includes("@set")&&y(e,1.1)||r(t)&&0===p.length;w(x,n,t,{propertyIsArray:o})}else{let t=j(p).map((t=>N.compactIri({activeCtx:e,iri:t,relativeTo:{vocab:!1},base:h.base})));1===t.length&&(t=t[0]),x[N.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t}}return x}return n},N.compactIri=({activeCtx:e,iri:t,value:n=null,relativeTo:r={vocab:!1},reverse:i=!1,base:s=null})=>{if(null===t)return t;e.isPropertyTermScoped&&e.previousContext&&(e=e.previousContext);const u=e.getInverse();if(v(t)&&t in u&&"@none"in u[t]&&"@type"in u[t]["@none"]&&"@none"in u[t]["@none"]["@type"])return u[t]["@none"]["@type"]["@none"];if(r.vocab&&t in u){const o=e["@language"]||"@none",r=[];a(n)&&"@index"in n&&!("@graph"in n)&&r.push("@index","@index@set"),a(n)&&"@preserve"in n&&(n=n["@preserve"][0]),d(n)?("@index"in n&&r.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n&&r.push("@graph@id","@graph@id@set"),r.push("@graph","@graph@set","@set"),"@index"in n||r.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n||r.push("@graph@id","@graph@id@set")):a(n)&&!c(n)&&r.push("@id","@id@set","@type","@set@type");let s="@language",u="@null";if(i)s="@type",u="@reverse",r.push("@set");else if(l(n)){"@index"in n||r.push("@list");const e=n["@list"];if(0===e.length)s="@any",u="@none";else{let t=0===e.length?o:null,n=null;for(let o=0;oe.includes("_")));e&&s.push(e.replace(/^[^_]+_/,"_"))}s.push("@none");const l=e.inverse[t];for(const e of o){if(!(e in l))continue;const t=l[e][r];for(const e of s)if(e in t)return t[e]}return null}(e,t,n,r,s,u);if(null!==p)return p}if(r.vocab&&"@vocab"in e){const n=e["@vocab"];if(0===t.indexOf(n)&&t!==n){const o=t.substr(n.length);if(!e.mappings.has(o))return o}}let p=null;const h=[];let f=e.fastCurieMap;const g=t.length-1;for(let e=0;e=0;--o){const r=h[o],a=r.terms;for(const o of a){const a=o+":"+t.substr(r.iri.length);e.mappings.get(o)._prefix&&(!e.mappings.has(a)||null===n&&e.mappings.get(a)["@id"]===t)&&(null===p||I(a,p)<0)&&(p=a)}}if(null!==p)return p;for(const[n,r]of e.mappings)if(r&&r._prefix&&t.startsWith(n+":"))throw new o(`Absolute IRI "${t}" confused with prefix "${n}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:e});if(!r.vocab){if("@base"in e){if(e["@base"]){const n=m(x(s,e["@base"]),t);return b.test(n)?`./${n}`:n}return t}return m(s,t)}return t},N.compactValue=({activeCtx:e,activeProperty:t,value:n,options:o})=>{if(c(n)){const o=f(e,t,"@type"),r=f(e,t,"@language"),a=f(e,t,"@direction"),s=f(e,t,"@container")||[],l="@index"in n&&!s.includes("@index");if(!l&&"@none"!==o){if(n["@type"]===o)return n["@value"];if("@language"in n&&n["@language"]===r&&"@direction"in n&&n["@direction"]===a)return n["@value"];if("@language"in n&&n["@language"]===r)return n["@value"];if("@direction"in n&&n["@direction"]===a)return n["@value"]}const c=Object.keys(n).length,d=1===c||2===c&&"@index"in n&&!l,u="@language"in e,p=i(n["@value"]),h=e.mappings.has(t)&&null===e.mappings.get(t)["@language"];if(d&&"@none"!==o&&(!u||!p||h))return n["@value"];const v={};return l&&(v[N.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=n["@index"]),"@type"in n?v[N.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}})]=N.compactIri({activeCtx:e,iri:n["@type"],relativeTo:{vocab:!0}}):"@language"in n&&(v[N.compactIri({activeCtx:e,iri:"@language",relativeTo:{vocab:!0}})]=n["@language"]),"@direction"in n&&(v[N.compactIri({activeCtx:e,iri:"@direction",relativeTo:{vocab:!0}})]=n["@direction"]),v[N.compactIri({activeCtx:e,iri:"@value",relativeTo:{vocab:!0}})]=n["@value"],v}const r=h(e,t,{vocab:!0},o),a=f(e,t,"@type"),s=N.compactIri({activeCtx:e,iri:n["@id"],relativeTo:{vocab:"@vocab"===a},base:o.base});return"@id"===a||"@vocab"===a||"@graph"===r?s:{[N.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]:s}}},8648:e=>{"use strict";const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#",n="http://www.w3.org/2001/XMLSchema#";e.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:t,RDF_LIST:t+"List",RDF_FIRST:t+"first",RDF_REST:t+"rest",RDF_NIL:t+"nil",RDF_TYPE:t+"type",RDF_PLAIN_LITERAL:t+"PlainLiteral",RDF_XML_LITERAL:t+"XMLLiteral",RDF_JSON_LITERAL:t+"JSON",RDF_OBJECT:t+"object",RDF_LANGSTRING:t+"langString",XSD:n,XSD_BOOLEAN:n+"boolean",XSD_DOUBLE:n+"double",XSD_INTEGER:n+"integer",XSD_STRING:n+"string"}},4974:(e,t,n)=>{"use strict";const o=n(9721),r=n(8325),{isArray:a,isObject:i,isString:s,isUndefined:l}=n(7904),{isAbsolute:c,isRelative:d,prependBase:u}=n(904),{handleEvent:p}=n(9788),{REGEX_BCP47:h,REGEX_KEYWORD:f,asArray:v,compareShortestLeast:g}=n(9721),y=new Map,m={};function x(e,t,n,o,r,a){if(null===t||!s(t)||m.isKeyword(t))return t;if(t.match(f))return null;if(o&&o.hasOwnProperty(t)&&!0!==r.get(t)&&m.createTermDefinition({activeCtx:e,localCtx:o,term:t,defined:r,options:a}),(n=n||{}).vocab){const n=e.mappings.get(t);if(null===n)return null;if(i(n)&&"@id"in n)return n["@id"]}const l=t.indexOf(":");if(l>0){const n=t.substr(0,l),i=t.substr(l+1);if("_"===n||0===i.indexOf("//"))return t;o&&o.hasOwnProperty(n)&&m.createTermDefinition({activeCtx:e,localCtx:o,term:n,defined:r,options:a});const s=e.mappings.get(n);if(s&&s._prefix)return s["@id"]+i;if(c(t))return t}if(n.vocab&&"@vocab"in e)t=e["@vocab"]+t;else if(n.base){let n,o;"@base"in e?e["@base"]?(o=u(a.base,e["@base"]),n=u(o,t)):(o=e["@base"],n=t):(o=a.base,n=u(a.base,t)),t=n}return t}function b(e,t){if(!e||"object"!=typeof e||!t||"object"!=typeof t)return e===t;const n=Array.isArray(e);if(n!==Array.isArray(t))return!1;if(n){if(e.length!==t.length)return!1;for(let n=0;n{if(i(t)&&"@context"in t&&a(t["@context"])&&(t=t["@context"]),0===v(t).length)return e;const g=[],y=[({event:e,next:t})=>{g.push(e),t()}];n.eventHandler&&y.push(n.eventHandler);const b=n;n={...n,eventHandler:y};const w=await n.contextResolver.resolve({activeCtx:e,context:t,documentLoader:n.documentLoader,base:n.base});i(w[0].document)&&"boolean"==typeof w[0].document["@propagate"]&&(o=w[0].document["@propagate"]);let j=e;o||j.previousContext||(j=j.clone(),j.previousContext=e);for(const o of w){let{document:a}=o;if(e=j,null===a){if(!l&&0!==Object.keys(e.protected).length)throw new r("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});j=e=m.getInitialContext(n).clone();continue}const v=o.getProcessed(e);if(v){if(b.eventHandler)for(const e of v.events)p({event:e,options:b});j=e=v.context;continue}if(i(a)&&"@context"in a&&(a=a["@context"]),!i(a))throw new r("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:a});j=j.clone();const y=new Map;if("@version"in a){if(1.1!==a["@version"])throw new r("Unsupported JSON-LD version: "+a["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:a});if(e.processingMode&&"json-ld-1.0"===e.processingMode)throw new r("@version: "+a["@version"]+" not compatible with "+e.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:a});j.processingMode="json-ld-1.1",j["@version"]=a["@version"],y.set("@version",!0)}if(j.processingMode=j.processingMode||e.processingMode,"@base"in a){let e=a["@base"];if(null===e||c(e));else{if(!d(e))throw new r('Invalid JSON-LD syntax; the value of "@base" in a @context must be an absolute IRI, a relative IRI, or null.',"jsonld.SyntaxError",{code:"invalid base IRI",context:a});e=u(j["@base"],e)}j["@base"]=e,y.set("@base",!0)}if("@vocab"in a){const e=a["@vocab"];if(null===e)delete j["@vocab"];else{if(!s(e))throw new r('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:a});if(!c(e)&&m.processingMode(j,1))throw new r('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:a});{const t=x(j,e,{vocab:!0,base:!0},void 0,void 0,n);c(t)||n.eventHandler&&p({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:t}},options:n}),j["@vocab"]=t}}y.set("@vocab",!0)}if("@language"in a){const e=a["@language"];if(null===e)delete j["@language"];else{if(!s(e))throw new r('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:a});e.match(h)||n.eventHandler&&p({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:n}),j["@language"]=e.toLowerCase()}y.set("@language",!0)}if("@direction"in a){const t=a["@direction"];if("json-ld-1.0"===e.processingMode)throw new r("Invalid JSON-LD syntax; @direction not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:a});if(null===t)delete j["@direction"];else{if("ltr"!==t&&"rtl"!==t)throw new r('Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:a});j["@direction"]=t}y.set("@direction",!0)}if("@propagate"in a){const n=a["@propagate"];if("json-ld-1.0"===e.processingMode)throw new r("Invalid JSON-LD syntax; @propagate not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:a});if("boolean"!=typeof n)throw new r("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:t});y.set("@propagate",!0)}if("@import"in a){const o=a["@import"];if("json-ld-1.0"===e.processingMode)throw new r("Invalid JSON-LD syntax; @import not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:a});if(!s(o))throw new r("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:t});const i=await n.contextResolver.resolve({activeCtx:e,context:o,documentLoader:n.documentLoader,base:n.base});if(1!==i.length)throw new r("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:t});const l=i[0].getProcessed(e);if(l)a=l;else{const n=i[0].document;if("@import"in n)throw new r("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:t});for(const e in n)a.hasOwnProperty(e)||(a[e]=n[e]);i[0].setProcessed(e,a)}y.set("@import",!0)}y.set("@protected",a["@protected"]||!1);for(const e in a)if(m.createTermDefinition({activeCtx:j,localCtx:a,term:e,defined:y,options:n,overrideProtected:l}),i(a[e])&&"@context"in a[e]){const t=a[e]["@context"];let o=!0;if(s(t)){const e=u(n.base,t);f.has(e)?o=!1:f.add(e)}if(o)try{await m.process({activeCtx:j.clone(),localCtx:a[e]["@context"],overrideProtected:!0,options:n,cycles:f})}catch(t){throw new r("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:a[e]["@context"],term:e})}}o.setProcessed(e,{context:j,events:g})}return j},m.createTermDefinition=({activeCtx:e,localCtx:t,term:n,defined:o,options:l,overrideProtected:d=!1})=>{if(o.has(n)){if(o.get(n))return;throw new r("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:t,term:n})}let u;if(o.set(n,!1),t.hasOwnProperty(n)&&(u=t[n]),"@type"===n&&i(u)&&"@set"===(u["@container"]||"@set")&&m.processingMode(e,1.1)){const e=["@container","@id","@protected"],o=Object.keys(u);if(0===o.length||o.some((t=>!e.includes(t))))throw new r("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n})}else{if(m.isKeyword(n))throw new r("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n});if(n.match(f))return void(l.eventHandler&&p({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:n}},options:l}));if(""===n)throw new r("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:t})}const h=e.mappings.get(n);e.mappings.has(n)&&e.mappings.delete(n);let v=!1;if((s(u)||null===u)&&(v=!0,u={"@id":u}),!i(u))throw new r("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:t});const g={};e.mappings.set(n,g),g.reverse=!1;const y=["@container","@id","@language","@reverse","@type"];m.processingMode(e,1.1)&&y.push("@context","@direction","@index","@nest","@prefix","@protected");for(const e in u)if(!y.includes(e))throw new r("Invalid JSON-LD syntax; a term definition must not contain "+e,"jsonld.SyntaxError",{code:"invalid term definition",context:t});const w=n.indexOf(":");if(g._termHasColon=w>0,"@reverse"in u){if("@id"in u)throw new r("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});if("@nest"in u)throw new r("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});const a=u["@reverse"];if(!s(a))throw new r("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(a.match(f))return l.eventHandler&&p({event:{type:["JsonLdEvent"],code:"reserved @reverse value",level:"warning",message:'@reverse values beginning with "@" are reserved for future use and dropped.',details:{reverse:a}},options:l}),void(h?e.mappings.set(n,h):e.mappings.delete(n));const i=x(e,a,{vocab:!0,base:!1},t,o,l);if(!c(i))throw new r("Invalid JSON-LD syntax; a @context @reverse value must be an absolute IRI or a blank node identifier.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});g["@id"]=i,g.reverse=!0}else if("@id"in u){let a=u["@id"];if(a&&!s(a))throw new r("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(null===a)g["@id"]=null;else{if(!m.isKeyword(a)&&a.match(f))return l.eventHandler&&p({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:'@id values beginning with "@" are reserved for future use and dropped.',details:{id:a}},options:l}),void(h?e.mappings.set(n,h):e.mappings.delete(n));if(a!==n){if(a=x(e,a,{vocab:!0,base:!1},t,o,l),!c(a)&&!m.isKeyword(a))throw new r("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(n.match(/(?::[^:])|\//)&&x(e,n,{vocab:!0,base:!1},t,new Map(o).set(n,!0),l)!==a)throw new r("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});g["@id"]=a,g._prefix=v&&!g._termHasColon&&null!==a.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in g))if(g._termHasColon){const r=n.substr(0,w);if(t.hasOwnProperty(r)&&m.createTermDefinition({activeCtx:e,localCtx:t,term:r,defined:o,options:l}),e.mappings.has(r)){const t=n.substr(w+1);g["@id"]=e.mappings.get(r)["@id"]+t}else g["@id"]=n}else if("@type"===n)g["@id"]=n;else{if(!("@vocab"in e))throw new r("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t,term:n});g["@id"]=e["@vocab"]+n}if((!0===u["@protected"]||!0===o.get("@protected")&&!1!==u["@protected"])&&(e.protected[n]=!0,g.protected=!0),o.set(n,!0),"@type"in u){let n=u["@type"];if(!s(n))throw new r("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if("@json"===n||"@none"===n){if(m.processingMode(e,1))throw new r(`Invalid JSON-LD syntax; an @context @type value must not be "${n}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else if("@id"!==n&&"@vocab"!==n){if(n=x(e,n,{vocab:!0,base:!1},t,o,l),!c(n))throw new r("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if(0===n.indexOf("_:"))throw new r("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}g["@type"]=n}if("@container"in u){const n=s(u["@container"])?[u["@container"]]:u["@container"]||[],o=["@list","@set","@index","@language"];let i=!0;const l=n.includes("@set");if(m.processingMode(e,1.1)){if(o.push("@graph","@id","@type"),n.includes("@list")){if(1!==n.length)throw new r("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else if(n.includes("@graph")){if(n.some((e=>"@graph"!==e&&"@id"!==e&&"@index"!==e&&"@set"!==e)))throw new r("Invalid JSON-LD syntax; @context @container with @graph must have no other values other than @id, @index, and @set","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else i&=n.length<=(l?2:1);if(n.includes("@type")&&(g["@type"]=g["@type"]||"@id",!["@id","@vocab"].includes(g["@type"])))throw new r("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else i&=!a(u["@container"]),i&=n.length<=1;if(i&=n.every((e=>o.includes(e))),i&=!(l&&n.includes("@list")),!i)throw new r("Invalid JSON-LD syntax; @context @container value must be one of the following: "+o.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:t});if(g.reverse&&!n.every((e=>["@index","@set"].includes(e))))throw new r("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});g["@container"]=n}if("@index"in u){if(!("@container"in u)||!g["@container"].includes("@index"))throw new r(`Invalid JSON-LD syntax; @index without @index in @container: "${u["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});if(!s(u["@index"])||0===u["@index"].indexOf("@"))throw new r(`Invalid JSON-LD syntax; @index must expand to an IRI: "${u["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});g["@index"]=u["@index"]}if("@context"in u&&(g["@context"]=u["@context"]),"@language"in u&&!("@type"in u)){let e=u["@language"];if(null!==e&&!s(e))throw new r("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:t});null!==e&&(e=e.toLowerCase()),g["@language"]=e}if("@prefix"in u){if(n.match(/:|\//))throw new r("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:t});if(m.isKeyword(g["@id"]))throw new r("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:t});if("boolean"!=typeof u["@prefix"])throw new r("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:t});g._prefix=!0===u["@prefix"]}if("@direction"in u){const e=u["@direction"];if(null!==e&&"ltr"!==e&&"rtl"!==e)throw new r('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:t});g["@direction"]=e}if("@nest"in u){const e=u["@nest"];if(!s(e)||"@nest"!==e&&0===e.indexOf("@"))throw new r("Invalid JSON-LD syntax; @context @nest value must be a string which is not a keyword other than @nest.","jsonld.SyntaxError",{code:"invalid @nest value",context:t});g["@nest"]=e}const j=g["@id"];if("@context"===j||"@preserve"===j)throw new r("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:t});if(h&&h.protected&&!d&&(e.protected[n]=!0,g.protected=!0,!b(h,g)))throw new r("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:t,term:n})},m.expandIri=(e,t,n,o)=>x(e,t,n,void 0,void 0,o),m.getInitialContext=e=>{const t=JSON.stringify({processingMode:e.processingMode}),n=y.get(t);if(n)return n;const r={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){const e=this;if(e.inverse)return e.inverse;const t=e.inverse={},n=e.fastCurieMap={},o={},r=(e["@language"]||"@none").toLowerCase(),s=e["@direction"],l=e.mappings,c=[...l.keys()].sort(g);for(const e of c){const a=l.get(e);if(null===a)continue;let c=a["@container"]||"@none";if(c=[].concat(c).sort().join(""),null===a["@id"])continue;const d=v(a["@id"]);for(const l of d){let d=t[l];const u=m.isKeyword(l);if(d)u||a._termHasColon||o[l].push(e);else if(t[l]=d={},!u&&!a._termHasColon){o[l]=[e];const t={iri:l,terms:o[l]};l[0]in n?n[l[0]].push(t):n[l[0]]=[t]}if(d[c]||(d[c]={"@language":{},"@type":{},"@any":{}}),d=d[c],i(e,d["@any"],"@none"),a.reverse)i(e,d["@type"],"@reverse");else if("@none"===a["@type"])i(e,d["@any"],"@none"),i(e,d["@language"],"@none"),i(e,d["@type"],"@none");else if("@type"in a)i(e,d["@type"],a["@type"]);else if("@language"in a&&"@direction"in a){const t=a["@language"],n=a["@direction"];i(e,d["@language"],t&&n?`${t}_${n}`.toLowerCase():t?t.toLowerCase():n?`_${n}`:"@null")}else"@language"in a?i(e,d["@language"],(a["@language"]||"@null").toLowerCase()):"@direction"in a?a["@direction"]?i(e,d["@language"],`_${a["@direction"]}`):i(e,d["@language"],"@none"):s?(i(e,d["@language"],`_${s}`),i(e,d["@language"],"@none"),i(e,d["@type"],"@none")):(i(e,d["@language"],r),i(e,d["@language"],"@none"),i(e,d["@type"],"@none"))}}for(const e in n)a(n,e,1);return t},clone:function(){const e={};return e.mappings=o.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=o.clone(this.protected),this.previousContext&&(e.previousContext=this.previousContext.clone()),e.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(e["@base"]=this["@base"]),"@language"in this&&(e["@language"]=this["@language"]),"@vocab"in this&&(e["@vocab"]=this["@vocab"]),e},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===y.size&&y.clear(),y.set(t,r),r;function a(e,t,n){const o=e[t],r=e[t]={};let i,s;for(const e of o)i=e.iri,s=n>=i.length?"":i[n],s in r?r[s].push(e):r[s]=[e];for(const e in r)""!==e&&a(r,e,n+1)}function i(e,t,n){t.hasOwnProperty(n)||(t[n]=e)}},m.getContextValue=(e,t,n)=>{if(null===t){if("@context"===n)return;return null}if(e.mappings.has(t)){const o=e.mappings.get(t);if(l(n))return o;if(o.hasOwnProperty(n))return o[n]}return"@language"===n&&n in e||"@direction"===n&&n in e?e[n]:"@context"!==n?null:void 0},m.processingMode=(e,t)=>t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():"json-ld-1.0"===e.processingMode,m.isKeyword=e=>{if(!s(e)||"@"!==e[0])return!1;switch(e){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1}},827:(e,t,n)=>{"use strict";const{parseLinkHeader:o,buildHeaders:r}=n(9721),{LINK_HEADER_CONTEXT:a}=n(8648),i=n(8325),s=n(9889),{prependBase:l}=n(904),c=/(^|(\r\n))link:/i;e.exports=({secure:e,headers:t={},xhr:n}={headers:{}})=>(t=r(t),(new s).wrapLoader((async function r(s){if(0!==s.indexOf("http:")&&0!==s.indexOf("https:"))throw new i('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:s});if(e&&0!==s.indexOf("https"))throw new i('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:s});let d;try{d=await function(e,t,n){const o=new(e=e||XMLHttpRequest);return new Promise(((e,r)=>{o.onload=()=>e(o),o.onerror=e=>r(e),o.open("GET",t,!0);for(const e in n)o.setRequestHeader(e,n[e]);o.send()}))}(n,s,t)}catch(e){throw new i("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:s,cause:e})}if(d.status>=400)throw new i("URL could not be dereferenced: "+d.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:s,httpStatusCode:d.status});let u={contextUrl:null,documentUrl:s,document:d.response},p=null;const h=d.getResponseHeader("Content-Type");let f;if(c.test(d.getAllResponseHeaders())&&(f=d.getResponseHeader("Link")),f&&"application/ld+json"!==h){const e=o(f),t=e[a];if(Array.isArray(t))throw new i("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:s});t&&(u.contextUrl=t.target),p=e.alternate,p&&"application/ld+json"==p.type&&!(h||"").match(/^application\/(\w*\+)?json$/)&&(u=await r(l(s,p.target)))}return u})))},9788:(e,t,n)=>{"use strict";var o=n(6357);const r=n(8325),{isArray:a}=n(7904),{asArray:i}=n(9721),s={};function l({event:e,handlers:t}){let n=!0;for(let o=0;n&&o{n=!0}});else{if("object"!=typeof i)throw new r("Invalid event handler.","jsonld.InvalidEventHandler",{event:e});e.code in i?i[e.code]({event:e,next:()=>{n=!0}}):n=!0}}return n}e.exports=s,s.defaultEventHandler=null,s.setupEventHandler=({options:e={}})=>{const t=[].concat(e.safe?s.safeEventHandler:[],e.eventHandler?i(e.eventHandler):[],s.defaultEventHandler?s.defaultEventHandler:[]);return 0===t.length?null:t},s.handleEvent=({event:e,options:t})=>{l({event:e,handlers:t.eventHandler})};const c=new Set(["empty object","free-floating scalar","invalid @language value","invalid property","null @id value","null @value value","object with only @id","object with only @language","object with only @list","object with only @value","relative @id reference","relative @type reference","relative @vocab reference","reserved @id value","reserved @reverse value","reserved term","blank node predicate","relative graph reference","relative object reference","relative predicate reference","relative subject reference","rdfDirection not set"]);s.safeEventHandler=function({event:e,next:t}){if("warning"===e.level&&c.has(e.code))throw new r("Safe mode validation error.","jsonld.ValidationError",{event:e});t()},s.logEventHandler=function({event:e,next:t}){o.log(`EVENT: ${e.message}`,{event:e}),t()},s.logWarningEventHandler=function({event:e,next:t}){"warning"===e.level&&o.warn(`WARNING: ${e.message}`,{event:e}),t()},s.unhandledEventHandler=function({event:e}){throw new r("No handler for event.","jsonld.UnhandledEvent",{event:e})},s.setDefaultEventHandler=function({eventHandler:e}={}){s.defaultEventHandler=e?i(e):null}},5961:(e,t,n)=>{"use strict";const o=n(8325),{isArray:r,isObject:a,isEmptyObject:i,isString:s,isUndefined:l}=n(7904),{isList:c,isValue:d,isGraph:u,isSubject:p}=n(7848),{expandIri:h,getContextValue:f,isKeyword:v,process:g,processingMode:y}=n(4974),{isAbsolute:m}=n(904),{REGEX_BCP47:x,REGEX_KEYWORD:b,addValue:w,asArray:j,getValues:I,validateTypeValue:N}=n(9721),{handleEvent:S}=n(9788),O={};function E({value:e,count:t,options:n}){if(0===t||"@value"in e||"@list"in e||1===t&&"@id"in e){if(n.eventHandler){let o,r;0===t?(o="empty object",r="Dropping empty object."):"@value"in e?(o="object with only @value",r="Dropping object with only @value."):"@list"in e?(o="object with only @list",r="Dropping object with only @list."):1===t&&"@id"in e&&(o="object with only @id",r="Dropping object with only @id."),S({event:{type:["JsonLdEvent"],code:o,level:"warning",message:r,details:{value:e}},options:n})}return null}return e}async function D({activeCtx:e,activeProperty:t,expandedActiveProperty:n,element:u,expandedParent:b,options:I={},insideList:k,typeKey:R,typeScopedContext:T}){const A=Object.keys(u).sort(),_=[];let M;const J=u[R]&&"@json"===h(e,r(u[R])?u[R][0]:u[R],{vocab:!0},{...I,typeExpansion:!0});for(const D of A){let k,R=u[D];if("@context"===D)continue;const A=h(e,D,{vocab:!0},I);if(null===A||!m(A)&&!v(A)){I.eventHandler&&S({event:{type:["JsonLdEvent"],code:"invalid property",level:"warning",message:"Dropping property that did not expand into an absolute IRI or keyword.",details:{property:D,expandedProperty:A}},options:I});continue}if(v(A)){if("@reverse"===n)throw new o("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:R});if(A in b&&"@included"!==A&&"@type"!==A)throw new o("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:A})}if("@id"===A){if(!s(R)){if(!I.isFrame)throw new o('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:R});if(a(R)){if(!i(R))throw new o('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:R})}else{if(!r(R))throw new o('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:R});if(!R.every((e=>s(e))))throw new o('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:R})}}w(b,"@id",j(R).map((t=>{if(s(t)){const n=h(e,t,{base:!0},I);return I.eventHandler&&(null===n?S(null===t?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:t}},options:I}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:t}},options:I}):m(n)||S({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:t,expandedId:n}},options:I})),n}return t})),{propertyIsArray:I.isFrame});continue}if("@type"===A){a(R)&&(R=Object.fromEntries(Object.entries(R).map((([e,t])=>[h(T,e,{vocab:!0}),j(t).map((e=>h(T,e,{base:!0,vocab:!0},{...I,typeExpansion:!0})))])))),N(R,I.isFrame),w(b,"@type",j(R).map((e=>{if(s(e)){const t=h(T,e,{base:!0,vocab:!0},{...I,typeExpansion:!0});return"@json"===t||m(t)||I.eventHandler&&S({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:e}},options:I}),t}return e})),{propertyIsArray:!!I.isFrame});continue}if("@included"===A&&y(e,1.1)){const n=j(await O.expand({activeCtx:e,activeProperty:t,element:R,options:I}));if(!n.every((e=>p(e))))throw new o("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:R});w(b,"@included",n,{propertyIsArray:!0});continue}if("@graph"===A&&!a(R)&&!r(R))throw new o('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:R});if("@value"===A){M=R,J&&y(e,1.1)?b["@value"]=R:w(b,"@value",R,{propertyIsArray:I.isFrame});continue}if("@language"===A){if(null===R)continue;if(!s(R)&&!I.isFrame)throw new o('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:R});R=j(R).map((e=>s(e)?e.toLowerCase():e));for(const e of R)s(e)&&!e.match(x)&&I.eventHandler&&S({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:I});w(b,"@language",R,{propertyIsArray:I.isFrame});continue}if("@direction"===A){if(!s(R)&&!I.isFrame)throw new o('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:R});R=j(R);for(const e of R)if(s(e)&&"ltr"!==e&&"rtl"!==e)throw new o('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:R});w(b,"@direction",R,{propertyIsArray:I.isFrame});continue}if("@index"===A){if(!s(R))throw new o('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:R});w(b,"@index",R);continue}if("@reverse"===A){if(!a(R))throw new o('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:R});if(k=await O.expand({activeCtx:e,activeProperty:"@reverse",element:R,options:I}),"@reverse"in k)for(const e in k["@reverse"])w(b,e,k["@reverse"][e],{propertyIsArray:!0});let t=b["@reverse"]||null;for(const e in k){if("@reverse"===e)continue;null===t&&(t=b["@reverse"]={}),w(t,e,[],{propertyIsArray:!0});const n=k[e];for(let r=0;r"@id"===e||"@index"===e))){if(k=j(k),I.isFrame||(k=k.filter((e=>null!==E({value:e,count:Object.keys(e).length,options:I})))),0===k.length)continue;k=k.map((e=>({"@graph":j(e)})))}if(P.mappings.has(D)&&P.mappings.get(D).reverse){const e=b["@reverse"]=b["@reverse"]||{};k=j(k);for(let t=0;t"@value"===h(e,t,{vocab:!0},I))))throw new o("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:r});await D({activeCtx:e,activeProperty:t,expandedActiveProperty:n,element:r,expandedParent:b,options:I,insideList:k,typeScopedContext:T,typeKey:R})}}}function k({activeCtx:e,activeProperty:t,value:n,options:o}){if(null==n)return null;const r=h(e,t,{vocab:!0},o);if("@id"===r)return h(e,n,{base:!0},o);if("@type"===r)return h(e,n,{vocab:!0,base:!0},{...o,typeExpansion:!0});const a=f(e,t,"@type");if(("@id"===a||"@graph"===r)&&s(n)){const r=h(e,n,{base:!0},o);return null===r&&n.match(b)&&o.eventHandler&&S({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:t}},options:o}),{"@id":r}}if("@vocab"===a&&s(n))return{"@id":h(e,n,{vocab:!0,base:!0},o)};if(v(r))return n;const i={};if(a&&!["@id","@vocab","@none"].includes(a))i["@type"]=a;else if(s(n)){const n=f(e,t,"@language");null!==n&&(i["@language"]=n);const o=f(e,t,"@direction");null!==o&&(i["@direction"]=o)}return["boolean","number","string"].includes(typeof n)||(n=n.toString()),i["@value"]=n,i}function C(e,t,n,a){const i=[],l=Object.keys(t).sort();for(const c of l){const l=h(e,c,{vocab:!0},a);let d=t[c];r(d)||(d=[d]);for(const e of d){if(null===e)continue;if(!s(e))throw new o("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:t});const r={"@value":e};"@none"!==l&&(c.match(x)||a.eventHandler&&S({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:c}},options:a}),r["@language"]=c.toLowerCase()),n&&(r["@direction"]=n),i.push(r)}}return i}async function L({activeCtx:e,options:t,activeProperty:n,value:a,asGraph:i,indexKey:s,propertyIndex:c}){const p=[],v=Object.keys(a).sort(),y="@type"===s;for(let m of v){if(y){const n=f(e,m,"@context");l(n)||(e=await g({activeCtx:e,localCtx:n,propagate:!1,options:t}))}let v,x=a[m];r(x)||(x=[x]),x=await O.expand({activeCtx:e,activeProperty:n,element:x,options:t,insideList:!1,insideIndex:!0}),v=c?"@none"===m?"@none":k({activeCtx:e,activeProperty:s,value:m,options:t}):h(e,m,{vocab:!0},t),"@id"===s?m=h(e,m,{base:!0},t):y&&(m=v);for(let e of x){if(i&&!u(e)&&(e={"@graph":[e]}),"@type"===s)"@none"===v||(e["@type"]?e["@type"]=[m].concat(e["@type"]):e["@type"]=[m]);else{if(d(e)&&!["@language","@type","@index"].includes(s))throw new o(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${s}".`,"jsonld.SyntaxError",{code:"invalid value object",value:e});c?"@none"!==v&&w(e,c,v,{propertyIsArray:!0,prependValue:!0}):"@none"===v||s in e||(e[s]=m)}p.push(e)}}return p}e.exports=O,O.expand=async({activeCtx:e,activeProperty:t=null,element:n,options:c={},insideList:d=!1,insideIndex:u=!1,typeScopedContext:p=null})=>{if(null==n)return null;if("@default"===t&&(c=Object.assign({},c,{isFrame:!1})),!r(n)&&!a(n))return d||null!==t&&"@graph"!==h(e,t,{vocab:!0},c)?k({activeCtx:e,activeProperty:t,value:n,options:c}):(c.eventHandler&&S({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:n}},options:c}),null);if(r(n)){let o=[];const a=f(e,t,"@container")||[];d=d||a.includes("@list");for(let a=0;a1?o.slice().sort():o:[o];for(const t of r){const n=f(p,t,"@context");l(n)||(e=await g({activeCtx:e,localCtx:n,options:c,propagate:!1}))}}let C={};await D({activeCtx:e,activeProperty:t,expandedActiveProperty:v,element:n,expandedParent:C,options:c,insideList:d,typeKey:N,typeScopedContext:p}),b=Object.keys(C);let L=b.length;if("@value"in C){if("@type"in C&&("@language"in C||"@direction"in C))throw new o('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:C});let t=L-1;if("@type"in C&&(t-=1),"@index"in C&&(t-=1),"@language"in C&&(t-=1),"@direction"in C&&(t-=1),0!==t)throw new o('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:C});const n=null===C["@value"]?[]:j(C["@value"]),r=I(C,"@type");if(y(e,1.1)&&r.includes("@json")&&1===r.length);else if(0===n.length)c.eventHandler&&S({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:C}},options:c}),C=null;else{if(!n.every((e=>s(e)||i(e)))&&"@language"in C)throw new o("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:C});if(!r.every((e=>m(e)&&!(s(e)&&0===e.indexOf("_:"))||i(e))))throw new o('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:C})}}else if("@type"in C&&!r(C["@type"]))C["@type"]=[C["@type"]];else if("@set"in C||"@list"in C){if(L>1&&(2!==L||!("@index"in C)))throw new o('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:C});"@set"in C&&(C=C["@set"],b=Object.keys(C),L=b.length)}else 1===L&&"@language"in C&&(c.eventHandler&&S({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:C}},options:c}),C=null);return!a(C)||c.keepFreeFloatingNodes||d||null!==t&&"@graph"!==v&&!(f(e,t,"@container")||[]).includes("@graph")||(C=E({value:C,count:L,options:c})),C}},2147:(e,t,n)=>{"use strict";const{isSubjectReference:o}=n(7848),{createMergedNodeMap:r}=n(5447),a={};e.exports=a,a.flatten=e=>{const t=r(e),n=[],a=Object.keys(t).sort();for(let e=0;e{"use strict";const{isKeyword:o}=n(4974),r=n(7848),a=n(7904),i=n(9721),s=n(904),l=n(8325),{createNodeMap:c,mergeNodeMapGraphs:d}=n(5447),u={};function p(e){const t={};for(const n in e)void 0!==e[n]&&(t["@"+n]=[e[n]]);return[t]}function h(e,t,n){for(let o=n.length-1;o>=0;--o){const r=n[o];if(r.graph===t&&r.subject["@id"]===e["@id"])return!0}return!1}function f(e,t,n){const o="@"+n;let r=o in e?e[o][0]:t[n];if("embed"===n)if(!0===r)r="@once";else if(!1===r)r="@never";else if("@always"!==r&&"@never"!==r&&"@link"!==r&&"@first"!==r&&"@last"!==r&&"@once"!==r)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:e});return r}function v(e){if(!a.isArray(e)||1!==e.length||!a.isObject(e[0]))throw new l("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:e});if("@id"in e[0])for(const t of i.asArray(e[0]["@id"]))if(!a.isObject(t)&&!s.isAbsolute(t)||a.isString(t)&&0===t.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e});if("@type"in e[0])for(const t of i.asArray(e[0]["@type"]))if(!a.isObject(t)&&!s.isAbsolute(t)&&"@json"!==t||a.isString(t)&&0===t.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}function g(e,t,n,s){let l=!0,c=!1;for(const d in n){let u=!1;const p=i.getValues(t,d),h=0===i.getValues(n,d).length;if("@id"===d){if(a.isEmptyObject(n["@id"][0]||{})?u=!0:n["@id"].length>=0&&(u=n["@id"].includes(p[0])),!s.requireAll)return u}else if("@type"===d){if(l=!1,h){if(p.length>0)return!1;u=!0}else if(1===n["@type"].length&&a.isEmptyObject(n["@type"][0]))u=p.length>0;else for(const e of n["@type"])u=!(!a.isObject(e)||!("@default"in e))||u||p.some((t=>t===e));if(!s.requireAll)return u}else{if(o(d))continue;{const t=i.getValues(n,d)[0];let o=!1;if(t&&(v([t]),o="@default"in t),l=!1,0===p.length&&o)continue;if(p.length>0&&h)return!1;if(void 0===t){if(p.length>0)return!1;u=!0}else if(r.isList(t)){const n=t["@list"][0];if(r.isList(p[0])){const t=p[0]["@list"];r.isValue(n)?u=t.some((e=>w(n,e))):(r.isSubject(n)||r.isSubjectReference(n))&&(u=t.some((t=>b(e,n,t,s))))}}else u=r.isValue(t)?p.some((e=>w(t,e))):r.isSubjectReference(t)?p.some((n=>b(e,t,n,s))):!!a.isObject(t)&&p.length>0}}if(!u&&s.requireAll)return!1;c=c||u}return l||c}function y(e,t){const n=e.uniqueEmbeds[e.graph],o=n[t],r=o.parent,s=o.property,l={"@id":t};if(a.isArray(r)){for(let e=0;e{const t=Object.keys(n);for(const o of t)o in n&&a.isObject(n[o].parent)&&n[o].parent["@id"]===e&&(delete n[o],c(o))};c(t)}function m(e,t){if(a.isArray(e))return e.map((e=>m(e,t)));if(a.isObject(e)){if("@preserve"in e)return e["@preserve"][0];if(r.isValue(e))return e;if(r.isList(e))return e["@list"]=m(e["@list"],t),e;if("@id"in e){const n=e["@id"];if(t.link.hasOwnProperty(n)){const o=t.link[n].indexOf(e);if(-1!==o)return t.link[n][o];t.link[n].push(e)}else t.link[n]=[e]}for(const n in e)"@id"===n&&t.bnodesToClear.includes(e[n])?delete e["@id"]:e[n]=m(e[n],t)}return e}function x(e,t,n){a.isObject(e)?i.addValue(e,t,n,{propertyIsArray:!0}):e.push(n)}function b(e,t,n,o){if(!("@id"in n))return!1;const r=e.subjects[n["@id"]];return r&&g(e,r,t,o)}function w(e,t){const n=t["@value"],o=t["@type"],r=t["@language"],i=e["@value"]?a.isArray(e["@value"])?e["@value"]:[e["@value"]]:[],s=e["@type"]?a.isArray(e["@type"])?e["@type"]:[e["@type"]]:[],l=e["@language"]?a.isArray(e["@language"])?e["@language"]:[e["@language"]]:[];return 0===i.length&&0===s.length&&0===l.length||!(!i.includes(n)&&!a.isEmptyObject(i[0]))&&!!(!o&&0===s.length||s.includes(o)||o&&a.isEmptyObject(s[0]))&&!!(!r&&0===l.length||l.includes(r)||r&&a.isEmptyObject(l[0]))}e.exports=u,u.frameMergedOrDefault=(e,t,n)=>{const o={options:n,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},r=new i.IdentifierIssuer("_:b");c(e,o.graphMap,"@default",r),n.merged&&(o.graphMap["@merged"]=d(o.graphMap),o.graph="@merged"),o.subjects=o.graphMap[o.graph];const a=[];return u.frame(o,Object.keys(o.subjects).sort(),t,a),n.pruneBlankNodeIdentifiers&&(n.bnodesToClear=Object.keys(o.bnodeMap).filter((e=>1===o.bnodeMap[e].length))),n.link={},m(a,n)},u.frame=(e,t,n,s,c=null)=>{v(n),n=n[0];const d=e.options,m={embed:f(n,d,"embed"),explicit:f(n,d,"explicit"),requireAll:f(n,d,"requireAll")};e.link.hasOwnProperty(e.graph)||(e.link[e.graph]={});const b=e.link[e.graph],j=function(e,t,n,o){const r={};for(const a of t){const t=e.graphMap[e.graph][a];g(e,t,n,o)&&(r[a]=t)}return r}(e,t,n,m),I=Object.keys(j).sort();for(const v of I){const g=j[v];if(null===c?e.uniqueEmbeds={[e.graph]:{}}:e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},"@link"===m.embed&&v in b){x(s,c,b[v]);continue}const I={"@id":v};if(0===v.indexOf("_:")&&i.addValue(e.bnodeMap,v,I,{propertyIsArray:!0}),b[v]=I,("@first"===m.embed||"@last"===m.embed)&&e.is11)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:n});if(e.embedded||!e.uniqueEmbeds[e.graph].hasOwnProperty(v))if(!e.embedded||"@never"!==m.embed&&!h(g,e.graph,e.subjectStack))if(!e.embedded||"@first"!=m.embed&&"@once"!=m.embed||!e.uniqueEmbeds[e.graph].hasOwnProperty(v)){if("@last"===m.embed&&v in e.uniqueEmbeds[e.graph]&&y(e,v),e.uniqueEmbeds[e.graph][v]={parent:s,property:c},e.subjectStack.push({subject:g,graph:e.graph}),v in e.graphMap){let t=!1,o=null;"@graph"in n?(o=n["@graph"][0],t=!("@merged"===v||"@default"===v),a.isObject(o)||(o={})):(t="@merged"!==e.graph,o={}),t&&u.frame({...e,graph:v,embedded:!1},Object.keys(e.graphMap[v]).sort(),[o],I,"@graph")}"@included"in n&&u.frame({...e,embedded:!1},t,n["@included"],I,"@included");for(const t of Object.keys(g).sort())if(o(t)){if(I[t]=i.clone(g[t]),"@type"===t)for(const t of g["@type"])0===t.indexOf("_:")&&i.addValue(e.bnodeMap,t,I,{propertyIsArray:!0})}else if(!m.explicit||t in n)for(const o of g[t]){const a=t in n?n[t]:p(m);if(r.isList(o)){const a=n[t]&&n[t][0]&&n[t][0]["@list"]?n[t][0]["@list"]:p(m),s={"@list":[]};x(I,t,s);const l=o["@list"];for(const t of l)r.isSubjectReference(t)?u.frame({...e,embedded:!0},[t["@id"]],a,s,"@list"):x(s,"@list",i.clone(t))}else r.isSubjectReference(o)?u.frame({...e,embedded:!0},[o["@id"]],a,I,t):w(a[0],o)&&x(I,t,i.clone(o))}for(const e of Object.keys(n).sort()){if("@type"===e){if(!a.isObject(n[e][0])||!("@default"in n[e][0]))continue}else if(o(e))continue;const t=n[e][0]||{};if(!f(t,d,"omitDefault")&&!(e in I)){let n="@null";"@default"in t&&(n=i.clone(t["@default"])),a.isArray(n)||(n=[n]),I[e]=[{"@preserve":n}]}}for(const t of Object.keys(n["@reverse"]||{}).sort()){const o=n["@reverse"][t];for(const n of Object.keys(e.subjects))i.getValues(e.subjects[n],t).some((e=>e["@id"]===v))&&(I["@reverse"]=I["@reverse"]||{},i.addValue(I["@reverse"],t,[],{propertyIsArray:!0}),u.frame({...e,embedded:!0},[n],o,I["@reverse"][t],c))}x(s,c,I),e.subjectStack.pop()}else x(s,c,I);else x(s,c,I)}},u.cleanupNull=(e,t)=>{if(a.isArray(e))return e.map((e=>u.cleanupNull(e,t))).filter((e=>e));if("@null"===e)return null;if(a.isObject(e)){if("@id"in e){const n=e["@id"];if(t.link.hasOwnProperty(n)){const o=t.link[n].indexOf(e);if(-1!==o)return t.link[n][o];t.link[n].push(e)}else t.link[n]=[e]}for(const n in e)e[n]=u.cleanupNull(e[n],t)}return e}},1661:(e,t,n)=>{"use strict";const o=n(8325),r=n(7848),a=n(7904),{REGEX_BCP47:i,addValue:s}=n(9721),{handleEvent:l}=n(9788),{RDF_LIST:c,RDF_FIRST:d,RDF_REST:u,RDF_NIL:p,RDF_TYPE:h,RDF_JSON_LITERAL:f,XSD_BOOLEAN:v,XSD_DOUBLE:g,XSD_INTEGER:y,XSD_STRING:m}=n(8648),x={};function b(e,t,n,r){if(e.termType.endsWith("Node"))return{"@id":e.value};const s={"@value":e.value};if(e.language)e.language.match(i)||r.eventHandler&&l({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e.language}},options:r}),s["@language"]=e.language;else{let c=e.datatype.value;if(c||(c=m),c===f){c="@json";try{s["@value"]=JSON.parse(s["@value"])}catch(e){throw new o("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:s["@value"],cause:e})}}if(t){if(c===v)"true"===s["@value"]?s["@value"]=!0:"false"===s["@value"]&&(s["@value"]=!1);else if(a.isNumeric(s["@value"]))if(c===y){const e=parseInt(s["@value"],10);e.toFixed(0)===s["@value"]&&(s["@value"]=e)}else c===g&&(s["@value"]=parseFloat(s["@value"]));[v,y,g,m].includes(c)||(s["@type"]=c)}else if("i18n-datatype"===n&&c.startsWith("https://www.w3.org/ns/i18n#")){const[,e,t]=c.split(/[#_]/);e.length>0&&(s["@language"]=e,e.match(i)||r.eventHandler&&l({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:r})),s["@direction"]=t}else c!==m&&(s["@type"]=c)}return s}e.exports=x,x.fromRDF=async(e,t)=>{const{useRdfType:n=!1,useNativeTypes:i=!1,rdfDirection:l=null}=t,f={},v={"@default":f},g={};if(l){if("compound-literal"===l)throw new o("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:l});if("i18n-datatype"!==l)throw new o("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:l})}for(const o of e){const e="DefaultGraph"===o.graph.termType?"@default":o.graph.value;e in v||(v[e]={}),"@default"===e||e in f||(f[e]={"@id":e});const r=v[e],a=o.subject.value,c=o.predicate.value,d=o.object;a in r||(r[a]={"@id":a});const u=r[a],y=d.termType.endsWith("Node");if(y&&!(d.value in r)&&(r[d.value]={"@id":d.value}),c===h&&!n&&y){s(u,"@type",d.value,{propertyIsArray:!0});continue}const m=b(d,i,l,t);if(s(u,c,m,{propertyIsArray:!0}),y)if(d.value===p){const e=r[d.value];"usages"in e||(e.usages=[]),e.usages.push({node:u,property:c,value:m})}else d.value in g?g[d.value]=!1:g[d.value]={node:u,property:c,value:m}}for(const e in v){const t=v[e];if(!(p in t))continue;const n=t[p];if(n.usages){for(let e of n.usages){let n=e.node,o=e.property,i=e.value;const s=[],l=[];let p=Object.keys(n).length;for(;o===u&&a.isObject(g[n["@id"]])&&a.isArray(n[d])&&1===n[d].length&&a.isArray(n[u])&&1===n[u].length&&(3===p||4===p&&a.isArray(n["@type"])&&1===n["@type"].length&&n["@type"][0]===c)&&(s.push(n[d][0]),l.push(n["@id"]),e=g[n["@id"]],n=e.node,o=e.property,i=e.value,p=Object.keys(n).length,r.isBlankNode(n)););delete i["@id"],i["@list"]=s.reverse();for(const e of l)delete t[e]}delete n.usages}}const y=[],m=Object.keys(f).sort();for(const e of m){const t=f[e];if(e in v){const n=t["@graph"]=[],o=v[e],a=Object.keys(o).sort();for(const e of a){const t=o[e];r.isSubjectReference(t)||n.push(t)}}r.isSubjectReference(t)||y.push(t)}return y}},7848:(e,t,n)=>{"use strict";const o=n(7904),r={};e.exports=r,r.isSubject=e=>!(!o.isObject(e)||"@value"in e||"@set"in e||"@list"in e)&&(Object.keys(e).length>1||!("@id"in e)),r.isSubjectReference=e=>o.isObject(e)&&1===Object.keys(e).length&&"@id"in e,r.isValue=e=>o.isObject(e)&&"@value"in e,r.isList=e=>o.isObject(e)&&"@list"in e,r.isGraph=e=>o.isObject(e)&&"@graph"in e&&1===Object.keys(e).filter((e=>"@id"!==e&&"@index"!==e)).length,r.isSimpleGraph=e=>r.isGraph(e)&&!("@id"in e),r.isBlankNode=e=>{if(o.isObject(e)){if("@id"in e){const t=e["@id"];return!o.isString(t)||0===t.indexOf("_:")}return 0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e)}return!1}},8515:(e,t,n)=>{const o=n(4051),r=n(1699),a=n(9721),i=n(3899),s=a.IdentifierIssuer,l=n(8325),c=n(8729),d=n(431),{expand:u}=n(5961),{flatten:p}=n(2147),{fromRDF:h}=n(1661),{toRDF:f}=n(2686),{frameMergedOrDefault:v,cleanupNull:g}=n(9480),{isArray:y,isObject:m,isString:x}=n(7904),{isSubjectReference:b}=n(7848),{expandIri:w,getInitialContext:j,process:I,processingMode:N}=n(4974),{compact:S,compactIri:O}=n(964),{createNodeMap:E,createMergedNodeMap:D,mergeNodeMaps:k}=n(5447),{logEventHandler:C,logWarningEventHandler:L,safeEventHandler:R,setDefaultEventHandler:T,setupEventHandler:A,strictEventHandler:_,unhandledEventHandler:M}=n(9788),J=function(e){const t={},J=new c({max:100});function P(t,{documentLoader:n=e.documentLoader,...o}){if(t&&"compactionMap"in t)throw new l('"compactionMap" not supported.',"jsonld.OptionsError");if(t&&"expansionMap"in t)throw new l('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:n},o,t,{eventHandler:A({options:t})})}return e.compact=async function(t,n,o){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===n)throw new l("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===t)return null;let r;(o=P(o,{base:x(t)?t:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new s("_:b"),contextResolver:new i({sharedCache:J})})).link&&(o.skipExpansion=!0),o.compactToRelative||delete o.base,r=o.skipExpansion?t:await e.expand(t,o);const c=await e.processContext(j(o),n,o);let d=await S({activeCtx:c,element:r,options:o});o.compactArrays&&!o.graph&&y(d)?1===d.length?d=d[0]:0===d.length&&(d={}):o.graph&&m(d)&&(d=[d]),m(n)&&"@context"in n&&(n=n["@context"]),n=a.clone(n),y(n)||(n=[n]);const u=n;n=[];for(let e=0;e0)&&n.push(u[e]);const p=n.length>0;if(1===n.length&&(n=n[0]),y(d)){const e=O({activeCtx:c,iri:"@graph",relativeTo:{vocab:!0}}),t=d;d={},p&&(d["@context"]=n),d[e]=t}else if(m(d)&&p){const e=d;d={"@context":n};for(const t in e)d[t]=e[t]}return d},e.expand=async function(t,n){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");const o={},r=[];if("expandContext"in(n=P(n,{keepFreeFloatingNodes:!1,contextResolver:new i({sharedCache:J})}))){const e=a.clone(n.expandContext);m(e)&&"@context"in e?o.expandContext=e:o.expandContext={"@context":e},r.push(o.expandContext)}let s;if(x(t)){const a=await e.get(t,n);s=a.documentUrl,o.input=a.document,a.contextUrl&&(o.remoteContext={"@context":a.contextUrl},r.push(o.remoteContext))}else o.input=a.clone(t);"base"in n||(n.base=s||"");let l=j(n);for(const e of r)l=await I({activeCtx:l,localCtx:e,options:n});let c=await u({activeCtx:l,element:o.input,options:n});return m(c)&&"@graph"in c&&1===Object.keys(c).length?c=c["@graph"]:null===c&&(c=[]),y(c)||(c=[c]),c},e.flatten=async function(t,n,o){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");n="function"==typeof n?null:n||null,o=P(o,{base:x(t)?t:"",contextResolver:new i({sharedCache:J})});const r=await e.expand(t,o),a=p(r);return null===n?a:(o.graph=!0,o.skipExpansion=!0,await e.compact(a,n,o))},e.frame=async function(t,n,o){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(o=P(o,{base:x(t)?t:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new i({sharedCache:J})}),x(n)){const t=await e.get(n,o);if(n=t.document,t.contextUrl){let e=n["@context"];e?y(e)?e.push(t.contextUrl):e=[e,t.contextUrl]:e=t.contextUrl,n["@context"]=e}}const r=n&&n["@context"]||{},a=await e.processContext(j(o),r,o);o.hasOwnProperty("omitGraph")||(o.omitGraph=N(a,1.1)),o.hasOwnProperty("pruneBlankNodeIdentifiers")||(o.pruneBlankNodeIdentifiers=N(a,1.1));const s=await e.expand(t,o),l={...o};l.isFrame=!0,l.keepFreeFloatingNodes=!0;const c=await e.expand(n,l),d=Object.keys(n).map((e=>w(a,e,{vocab:!0})));l.merged=!d.includes("@graph"),l.is11=N(a,1.1);const u=v(s,c,l);l.graph=!o.omitGraph,l.skipExpansion=!0,l.link={},l.framing=!0;let p=await e.compact(u,r,l);return l.link={},p=g(p,l),p},e.link=async function(t,n,o){const r={};return n&&(r["@context"]=n),r["@embed"]="@link",e.frame(t,r,o)},e.normalize=e.canonize=async function(t,n){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(n=P(n,{base:x(t)?t:null,algorithm:"URDNA2015",skipExpansion:!1,safe:!0,contextResolver:new i({sharedCache:J})}))){if("application/n-quads"!==n.inputFormat&&"application/nquads"!==n.inputFormat)throw new l("Unknown canonicalization input format.","jsonld.CanonizeError");const e=d.parse(t);return o.canonize(e,n)}const r={...n};delete r.format,r.produceGeneralizedRdf=!1;const a=await e.toRDF(t,r);return o.canonize(a,n)},e.fromRDF=async function(e,n){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");n=P(n,{format:x(e)?"application/n-quads":void 0});const{format:o}=n;let{rdfParser:r}=n;if(o){if(r=r||t[o],!r)throw new l("Unknown input format.","jsonld.UnknownFormat",{format:o})}else r=()=>e;const a=await r(e);return h(a,n)},e.toRDF=async function(t,n){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let o;o=(n=P(n,{base:x(t)?t:"",skipExpansion:!1,contextResolver:new i({sharedCache:J})})).skipExpansion?t:await e.expand(t,n);const r=f(o,n);if(n.format){if("application/n-quads"===n.format||"application/nquads"===n.format)return d.serialize(r);throw new l("Unknown output format.","jsonld.UnknownFormat",{format:n.format})}return r},e.createNodeMap=async function(t,n){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");n=P(n,{base:x(t)?t:"",contextResolver:new i({sharedCache:J})});const o=await e.expand(t,n);return D(o,n)},e.merge=async function(t,n,o){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!y(t))throw new TypeError('Could not merge, "docs" must be an array.');n="function"==typeof n?null:n||null,o=P(o,{contextResolver:new i({sharedCache:J})});const r=await Promise.all(t.map((t=>{const n={...o};return e.expand(t,n)})));let l=!0;"mergeNodes"in o&&(l=o.mergeNodes);const c=o.issuer||new s("_:b"),d={"@default":{}};for(let e=0;ee._documentLoader,set:t=>e._documentLoader=t}),e.documentLoader=async e=>{throw new l("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:e})},e.get=async function(t,n){let o;o="function"==typeof n.documentLoader?n.documentLoader:e.documentLoader;const r=await o(t);try{if(!r.document)throw new l("No remote document found at the given URL.","jsonld.NullRemoteDocument");x(r.document)&&(r.document=JSON.parse(r.document))}catch(e){throw new l("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:e,remoteDoc:r})}return r},e.processContext=async function(e,t,n){return n=P(n,{base:"",contextResolver:new i({sharedCache:J})}),null===t?j(n):(t=a.clone(t),m(t)&&"@context"in t||(t={"@context":t}),I({activeCtx:e,localCtx:t,options:n}))},e.getContextValue=n(4974).getContextValue,e.documentLoaders={},e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new l('Unknown document loader type: "'+t+'"',"jsonld.UnknownDocumentLoader",{type:t});e.documentLoader=e.documentLoaders[t].apply(e,Array.prototype.slice.call(arguments,1))},e.registerRDFParser=function(e,n){t[e]=n},e.unregisterRDFParser=function(e){delete t[e]},e.registerRDFParser("application/n-quads",d.parse),e.registerRDFParser("application/nquads",d.parse),e.url=n(904),e.logEventHandler=C,e.logWarningEventHandler=L,e.safeEventHandler=R,e.setDefaultEventHandler=T,e.strictEventHandler=_,e.unhandledEventHandler=M,e.util=a,Object.assign(e,a),e.promises=e,e.RequestQueue=n(9889),e.JsonLdProcessor=n(71)(e),r.setupGlobals(e),r.setupDocumentLoaders(e),e},P=function(){return J((function(){return P()}))};J(P),e.exports=P},5447:(e,t,n)=>{"use strict";const{isKeyword:o}=n(4974),r=n(7848),a=n(7904),i=n(9721),s=n(8325),l={};e.exports=l,l.createMergedNodeMap=(e,t)=>{const n=(t=t||{}).issuer||new i.IdentifierIssuer("_:b"),o={"@default":{}};return l.createNodeMap(e,o,"@default",n),l.mergeNodeMaps(o)},l.createNodeMap=(e,t,n,c,d,u)=>{if(a.isArray(e)){for(const o of e)l.createNodeMap(o,t,n,c,void 0,u);return}if(!a.isObject(e))return void(u&&u.push(e));if(r.isValue(e)){if("@type"in e){let t=e["@type"];0===t.indexOf("_:")&&(e["@type"]=t=c.getId(t))}return void(u&&u.push(e))}if(u&&r.isList(e)){const o=[];return l.createNodeMap(e["@list"],t,n,c,d,o),void u.push({"@list":o})}if("@type"in e){const t=e["@type"];for(const e of t)0===e.indexOf("_:")&&c.getId(e)}a.isUndefined(d)&&(d=r.isBlankNode(e)?c.getId(e["@id"]):e["@id"]),u&&u.push({"@id":d});const p=t[n],h=p[d]=p[d]||{};h["@id"]=d;const f=Object.keys(e).sort();for(let a of f){if("@id"===a)continue;if("@reverse"===a){const o={"@id":d},a=e["@reverse"];for(const e in a){const s=a[e];for(const a of s){let s=a["@id"];r.isBlankNode(a)&&(s=c.getId(s)),l.createNodeMap(a,t,n,c,s),i.addValue(p[s],e,o,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===a){d in t||(t[d]={}),l.createNodeMap(e[a],t,d,c);continue}if("@included"===a){l.createNodeMap(e[a],t,n,c);continue}if("@type"!==a&&o(a)){if("@index"===a&&a in h&&(e[a]!==h[a]||e[a]["@id"]!==h[a]["@id"]))throw new s("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:h});h[a]=e[a];continue}const u=e[a];if(0===a.indexOf("_:")&&(a=c.getId(a)),0!==u.length)for(let e of u)if("@type"===a&&(e=0===e.indexOf("_:")?c.getId(e):e),r.isSubject(e)||r.isSubjectReference(e)){if("@id"in e&&!e["@id"])continue;const o=r.isBlankNode(e)?c.getId(e["@id"]):e["@id"];i.addValue(h,a,{"@id":o},{propertyIsArray:!0,allowDuplicate:!1}),l.createNodeMap(e,t,n,c,o)}else if(r.isValue(e))i.addValue(h,a,e,{propertyIsArray:!0,allowDuplicate:!1});else if(r.isList(e)){const o=[];l.createNodeMap(e["@list"],t,n,c,d,o),e={"@list":o},i.addValue(h,a,e,{propertyIsArray:!0,allowDuplicate:!1})}else l.createNodeMap(e,t,n,c,d),i.addValue(h,a,e,{propertyIsArray:!0,allowDuplicate:!1});else i.addValue(h,a,[],{propertyIsArray:!0})}},l.mergeNodeMapGraphs=e=>{const t={};for(const n of Object.keys(e).sort())for(const r of Object.keys(e[n]).sort()){const a=e[n][r];r in t||(t[r]={"@id":r});const s=t[r];for(const e of Object.keys(a).sort())if(o(e)&&"@type"!==e)s[e]=i.clone(a[e]);else for(const t of a[e])i.addValue(s,e,i.clone(t),{propertyIsArray:!0,allowDuplicate:!1})}return t},l.mergeNodeMaps=e=>{const t=e["@default"],n=Object.keys(e).sort();for(const o of n){if("@default"===o)continue;const n=e[o];let a=t[o];a?"@graph"in a||(a["@graph"]=[]):t[o]=a={"@id":o,"@graph":[]};const i=a["@graph"];for(const e of Object.keys(n).sort()){const t=n[e];r.isSubjectReference(t)||i.push(t)}}return t}},1699:(e,t,n)=>{"use strict";const o=n(827),r={};e.exports=r,r.setupDocumentLoaders=function(e){"undefined"!=typeof XMLHttpRequest&&(e.documentLoaders.xhr=o,e.useDocumentLoader("xhr"))},r.setupGlobals=function(e){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:e.JsonLdProcessor})}},2686:(e,t,n)=>{"use strict";const{createNodeMap:o}=n(5447),{isKeyword:r}=n(4974),a=n(7848),i=n(7471),s=n(8325),l=n(7904),c=n(9721),{handleEvent:d}=n(9788),{RDF_FIRST:u,RDF_REST:p,RDF_NIL:h,RDF_TYPE:f,RDF_JSON_LITERAL:v,RDF_LANGSTRING:g,XSD_BOOLEAN:y,XSD_DOUBLE:m,XSD_INTEGER:x,XSD_STRING:b}=n(8648),{isAbsolute:w}=n(904),j={};function I(e,t,n,o,a){const i=Object.keys(t).sort();for(const s of i){const i=t[s],l=Object.keys(i).sort();for(let t of l){const l=i[t];if("@type"===t)t=f;else if(r(t))continue;for(const r of l){const i={termType:s.startsWith("_:")?"BlankNode":"NamedNode",value:s};if(!w(s)){a.eventHandler&&d({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:s}},options:a});continue}const l={termType:t.startsWith("_:")?"BlankNode":"NamedNode",value:t};if(!w(t)){a.eventHandler&&d({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:t}},options:a});continue}if("BlankNode"===l.termType&&!a.produceGeneralizedRdf){a.eventHandler&&d({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:o.getOldIds().find((e=>o.getId(e)===t))}},options:a});continue}const c=N(r,o,e,n,a.rdfDirection,a);c&&e.push({subject:i,predicate:l,object:c,graph:n})}}}}function N(e,t,n,o,r,c){const f={};if(a.isValue(e)){f.termType="Literal",f.value=void 0,f.datatype={termType:"NamedNode"};let t=e["@value"];const n=e["@type"]||null;if("@json"===n)f.value=i(t),f.datatype.value=v;else if(l.isBoolean(t))f.value=t.toString(),f.datatype.value=n||y;else if(l.isDouble(t)||n===m)l.isDouble(t)||(t=parseFloat(t)),f.value=t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),f.datatype.value=n||m;else if(l.isNumber(t))f.value=t.toFixed(0),f.datatype.value=n||x;else if("@direction"in e&&"i18n-datatype"===r){const n=`https://www.w3.org/ns/i18n#${(e["@language"]||"").toLowerCase()}_${e["@direction"]}`;f.datatype.value=n,f.value=t}else{if("@direction"in e&&"compound-literal"===r)throw new s("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:r});if("@direction"in e&&r)throw new s("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:r});"@language"in e?("@direction"in e&&!r&&c.eventHandler&&d({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:f.value}},options:c}),f.value=t,f.datatype.value=n||g,f.language=e["@language"]):("@direction"in e&&!r&&c.eventHandler&&d({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:f.value}},options:c}),f.value=t,f.datatype.value=n||b)}}else if(a.isList(e)){const a=function(e,t,n,o,r,a){const i={termType:"NamedNode",value:u},s={termType:"NamedNode",value:p},l={termType:"NamedNode",value:h},c=e.pop(),d=c?{termType:"BlankNode",value:t.getId()}:l;let f=d;for(const l of e){const e=N(l,t,n,o,r,a),c={termType:"BlankNode",value:t.getId()};n.push({subject:f,predicate:i,object:e,graph:o}),n.push({subject:f,predicate:s,object:c,graph:o}),f=c}if(c){const e=N(c,t,n,o,r,a);n.push({subject:f,predicate:i,object:e,graph:o}),n.push({subject:f,predicate:s,object:l,graph:o})}return d}(e["@list"],t,n,o,r,c);f.termType=a.termType,f.value=a.value}else{const t=l.isObject(e)?e["@id"]:e;f.termType=t.startsWith("_:")?"BlankNode":"NamedNode",f.value=t}return"NamedNode"!==f.termType||w(f.value)?f:(c.eventHandler&&d({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:f.value}},options:c}),null)}e.exports=j,j.toRDF=(e,t)=>{const n=new c.IdentifierIssuer("_:b"),r={"@default":{}};o(e,r,"@default",n);const a=[],i=Object.keys(r).sort();for(const e of i){let o;if("@default"===e)o={termType:"DefaultGraph",value:""};else{if(!w(e)){t.eventHandler&&d({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:e}},options:t});continue}o=e.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},o.value=e}I(a,r[e],o,n,t)}return a}},7904:e=>{"use strict";const t={};e.exports=t,t.isArray=Array.isArray,t.isBoolean=e=>"boolean"==typeof e||"[object Boolean]"===Object.prototype.toString.call(e),t.isDouble=e=>t.isNumber(e)&&(-1!==String(e).indexOf(".")||Math.abs(e)>=1e21),t.isEmptyObject=e=>t.isObject(e)&&0===Object.keys(e).length,t.isNumber=e=>"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e),t.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),t.isObject=e=>"[object Object]"===Object.prototype.toString.call(e),t.isString=e=>"string"==typeof e||"[object String]"===Object.prototype.toString.call(e),t.isUndefined=e=>void 0===e},904:(e,t,n)=>{"use strict";const o=n(7904),r={};e.exports=r,r.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([a-zA-Z][a-zA-Z0-9+-.]*):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},r.parse=(e,t)=>{const n={},o=r.parsers[t||"full"],a=o.regex.exec(e);let i=o.keys.length;for(;i--;)n[o.keys[i]]=void 0===a[i]?null:a[i];return("https"===n.scheme&&"443"===n.port||"http"===n.scheme&&"80"===n.port)&&(n.href=n.href.replace(":"+n.port,""),n.authority=n.authority.replace(":"+n.port,""),n.port=null),n.normalizedPath=r.removeDotSegments(n.path),n},r.prependBase=(e,t)=>{if(null===e)return t;if(r.isAbsolute(t))return t;e&&!o.isString(e)||(e=r.parse(e||""));const n=r.parse(t),a={protocol:e.protocol||""};if(null!==n.authority)a.authority=n.authority,a.path=n.path,a.query=n.query;else if(a.authority=e.authority,""===n.path)a.path=e.path,null!==n.query?a.query=n.query:a.query=e.query;else{if(0===n.path.indexOf("/"))a.path=n.path;else{let t=e.path;t=t.substr(0,t.lastIndexOf("/")+1),(t.length>0||e.authority)&&"/"!==t.substr(-1)&&(t+="/"),t+=n.path,a.path=t}a.query=n.query}""!==n.path&&(a.path=r.removeDotSegments(a.path));let i=a.protocol;return null!==a.authority&&(i+="//"+a.authority),i+=a.path,null!==a.query&&(i+="?"+a.query),null!==n.fragment&&(i+="#"+n.fragment),""===i&&(i="./"),i},r.removeBase=(e,t)=>{if(null===e)return t;e&&!o.isString(e)||(e=r.parse(e||""));let n="";if(""!==e.href?n+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(n+="//"),0!==t.indexOf(n))return t;const a=r.parse(t.substr(n.length)),i=e.normalizedPath.split("/"),s=a.normalizedPath.split("/"),l=a.fragment||a.query?0:1;for(;i.length>0&&s.length>l&&i[0]===s[0];)i.shift(),s.shift();let c="";if(i.length>0){i.pop();for(let e=0;e{if(0===e.length)return"";const t=e.split("/"),n=[];for(;t.length>0;){const e=t.shift(),o=0===t.length;"."!==e?".."!==e?n.push(e):(n.pop(),o&&n.push("")):o&&n.push("")}return"/"===e[0]&&n.length>0&&""!==n[0]&&n.unshift(""),1===n.length&&""===n[0]?"/":n.join("/")};const a=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;r.isAbsolute=e=>o.isString(e)&&a.test(e),r.isRelative=e=>o.isString(e)},9721:(e,t,n)=>{"use strict";const o=n(7848),r=n(7904),a=n(4051).IdentifierIssuer,i=n(8325),s=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,l=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,c=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,d="application/ld+json, application/json",u={};function p(e,t){if(r.isArray(t))for(let n=0;n{if(Object.keys(e).some((e=>"accept"===e.toLowerCase())))throw new RangeError('Accept header may not be specified; only "'+d+'" is supported.');return Object.assign({Accept:d},e)},u.parseLinkHeader=e=>{const t={},n=e.match(s);for(let e=0;e{if(!(r.isString(e)||r.isArray(e)&&e.every((e=>r.isString(e))))){if(t&&r.isObject(e))switch(Object.keys(e).length){case 0:return;case 1:if("@default"in e&&u.asArray(e["@default"]).every((e=>r.isString(e))))return}throw new i('Invalid JSON-LD syntax; "@type" value must a string, an array of strings, an empty object, or a default object.',"jsonld.SyntaxError",{code:"invalid type value",value:e})}},u.hasProperty=(e,t)=>{if(e.hasOwnProperty(t)){const n=e[t];return!r.isArray(n)||n.length>0}return!1},u.hasValue=(e,t,n)=>{if(u.hasProperty(e,t)){let a=e[t];const i=o.isList(a);if(r.isArray(a)||i){i&&(a=a["@list"]);for(let e=0;e{if("propertyIsArray"in(o=o||{})||(o.propertyIsArray=!1),"valueIsArray"in o||(o.valueIsArray=!1),"allowDuplicate"in o||(o.allowDuplicate=!0),"prependValue"in o||(o.prependValue=!1),o.valueIsArray)e[t]=n;else if(r.isArray(n)){0===n.length&&o.propertyIsArray&&!e.hasOwnProperty(t)&&(e[t]=[]),o.prependValue&&(n=n.concat(e[t]),e[t]=[]);for(let r=0;r[].concat(e[t]||[]),u.removeProperty=(e,t)=>{delete e[t]},u.removeValue=(e,t,n,o)=>{"propertyIsArray"in(o=o||{})||(o.propertyIsArray=!1);const r=u.getValues(e,t).filter((e=>!u.compareValues(e,n)));0===r.length?u.removeProperty(e,t):1!==r.length||o.propertyIsArray?e[t]=r:e[t]=r[0]},u.relabelBlankNodes=(e,t)=>p((t=t||{}).issuer||new a("_:b"),e),u.compareValues=(e,t)=>e===t||!(!o.isValue(e)||!o.isValue(t)||e["@value"]!==t["@value"]||e["@type"]!==t["@type"]||e["@language"]!==t["@language"]||e["@index"]!==t["@index"])||!!(r.isObject(e)&&"@id"in e&&r.isObject(t)&&"@id"in t)&&e["@id"]===t["@id"],u.compareShortestLeast=(e,t)=>e.length{"use strict";const o=n(8171),r=Symbol("max"),a=Symbol("length"),i=Symbol("lengthCalculator"),s=Symbol("allowStale"),l=Symbol("maxAge"),c=Symbol("dispose"),d=Symbol("noDisposeOnSet"),u=Symbol("lruList"),p=Symbol("cache"),h=Symbol("updateAgeOnGet"),f=()=>1,v=(e,t,n)=>{const o=e[p].get(t);if(o){const t=o.value;if(g(e,t)){if(m(e,o),!e[s])return}else n&&(e[h]&&(o.value.now=Date.now()),e[u].unshiftNode(o));return t.value}},g=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[l]&&n>e[l]},y=e=>{if(e[a]>e[r])for(let t=e[u].tail;e[a]>e[r]&&null!==t;){const n=t.prev;m(e,t),t=n}},m=(e,t)=>{if(t){const n=t.value;e[c]&&e[c](n.key,n.value),e[a]-=n.length,e[p].delete(n.key),e[u].removeNode(t)}};class x{constructor(e,t,n,o,r){this.key=e,this.value=t,this.length=n,this.now=o,this.maxAge=r||0}}const b=(e,t,n,o)=>{let r=n.value;g(e,r)&&(m(e,n),e[s]||(r=void 0)),r&&t.call(o,r.value,r.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[r]=e.max||1/0;const t=e.length||f;if(this[i]="function"!=typeof t?f:t,this[s]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[c]=e.dispose,this[d]=e.noDisposeOnSet||!1,this[h]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[r]=e||1/0,y(this)}get max(){return this[r]}set allowStale(e){this[s]=!!e}get allowStale(){return this[s]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,y(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=f),e!==this[i]&&(this[i]=e,this[a]=0,this[u].forEach((e=>{e.length=this[i](e.value,e.key),this[a]+=e.length}))),y(this)}get lengthCalculator(){return this[i]}get length(){return this[a]}get itemCount(){return this[u].length}rforEach(e,t){t=t||this;for(let n=this[u].tail;null!==n;){const o=n.prev;b(this,e,n,t),n=o}}forEach(e,t){t=t||this;for(let n=this[u].head;null!==n;){const o=n.next;b(this,e,n,t),n=o}}keys(){return this[u].toArray().map((e=>e.key))}values(){return this[u].toArray().map((e=>e.value))}reset(){this[c]&&this[u]&&this[u].length&&this[u].forEach((e=>this[c](e.key,e.value))),this[p]=new Map,this[u]=new o,this[a]=0}dump(){return this[u].map((e=>!g(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[u]}set(e,t,n){if((n=n||this[l])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const o=n?Date.now():0,s=this[i](t,e);if(this[p].has(e)){if(s>this[r])return m(this,this[p].get(e)),!1;const i=this[p].get(e).value;return this[c]&&(this[d]||this[c](e,i.value)),i.now=o,i.maxAge=n,i.value=t,this[a]+=s-i.length,i.length=s,this.get(e),y(this),!0}const h=new x(e,t,s,o,n);return h.length>this[r]?(this[c]&&this[c](e,t),!1):(this[a]+=h.length,this[u].unshift(h),this[p].set(e,this[u].head),y(this),!0)}has(e){if(!this[p].has(e))return!1;const t=this[p].get(e).value;return!g(this,t)}get(e){return v(this,e,!0)}peek(e){return v(this,e,!1)}pop(){const e=this[u].tail;return e?(m(this,e),e.value):null}del(e){m(this,this[p].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const o=e[n],r=o.e||0;if(0===r)this.set(o.k,o.v);else{const e=r-t;e>0&&this.set(o.k,o.v,e)}}}prune(){this[p].forEach(((e,t)=>v(this,t,!1)))}}},9919:e=>{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},8171:(e,t,n)=>{"use strict";function o(e){var t=this;if(t instanceof o||(t=new o),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var n=0,r=arguments.length;n1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");o=this.head.next,n=this.head.value}for(var r=0;null!==o;r++)n=e(n,o.value,r),o=o.next;return n},o.prototype.reduceReverse=function(e,t){var n,o=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");o=this.tail.prev,n=this.tail.value}for(var r=this.length-1;null!==o;r--)n=e(n,o.value,r),o=o.prev;return n},o.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},o.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},o.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new o;if(tthis.length&&(t=this.length);for(var r=0,a=this.head;null!==a&&rthis.length&&(t=this.length);for(var r=this.length,a=this.tail;null!==a&&r>t;r--)a=a.prev;for(;null!==a&&r>e;r--,a=a.prev)n.push(a.value);return n},o.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var o=0,a=this.head;null!==a&&o{e.exports=n(147)},7207:e=>{"use strict";e.exports=class e{constructor(e,t=new Map,n=0){this.prefix=e,this._existing=t,this.counter=n}clone(){const{prefix:t,_existing:n,counter:o}=this;return new e(t,new Map(n),o)}getId(e){const t=e&&this._existing.get(e);if(t)return t;const n=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,n),n}hasId(e){return this._existing.has(e)}getOldIds(){return[...this._existing.keys()]}}},2269:(e,t,n)=>{"use strict";n(6945);const o=self.crypto||self.msCrypto;e.exports=class{constructor(e){if(!o||!o.subtle)throw new Error("crypto.subtle not found.");if("sha256"===e)this.algorithm={name:"SHA-256"};else{if("sha1"!==e)throw new Error(`Unsupported algorithm "${e}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(e){this._content+=e}async digest(){const e=(new TextEncoder).encode(this._content),t=new Uint8Array(await o.subtle.digest(this.algorithm,e));let n="";for(let e=0;e{"use strict";const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",n="http://www.w3.org/2001/XMLSchema#string",o="NamedNode",r="BlankNode",a="Literal",i="DefaultGraph",s={};(()=>{const e="(?:<([^:]+:[^>]*)>)",t="A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_",n=t+"0-9-·̀-ͯ‿-⁀",o="(_:(?:["+t+"0-9])(?:(?:["+n+".])*(?:["+n+"]))?)",r="[ \\t]+",a="[ \\t]*",i="(?:"+e+"|"+o+")"+r,l=e+r,c="(?:"+e+"|"+o+'|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^'+e+")|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))"+a,d="(?:\\.|(?:(?:"+e+"|"+o+")"+a+"\\.))";s.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,s.empty=new RegExp("^"+a+"$"),s.quad=new RegExp("^"+a+i+l+c+d+a+"$")})(),e.exports=class e{static parse(e){const l=[],d={},u=e.split(s.eoln);let p=0;for(const e of u){if(p++,s.empty.test(e))continue;const u=e.match(s.quad);if(null===u)throw new Error("N-Quads parse error on line "+p+".");const v={subject:null,predicate:null,object:null,graph:null};if(void 0!==u[1]?v.subject={termType:o,value:u[1]}:v.subject={termType:r,value:u[2]},v.predicate={termType:o,value:u[3]},void 0!==u[4]?v.object={termType:o,value:u[4]}:void 0!==u[5]?v.object={termType:r,value:u[5]}:(v.object={termType:a,value:void 0,datatype:{termType:o}},void 0!==u[7]?v.object.datatype.value=u[7]:void 0!==u[8]?(v.object.datatype.value=t,v.object.language=u[8]):v.object.datatype.value=n,v.object.value=u[6].replace(c,(function(e,t,n,o){if(t)switch(t){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(n)return String.fromCharCode(parseInt(n,16));if(o)throw new Error("Unsupported U escape")}))),void 0!==u[9]?v.graph={termType:o,value:u[9]}:void 0!==u[10]?v.graph={termType:r,value:u[10]}:v.graph={termType:i,value:""},v.graph.value in d){let e=!0;const t=d[v.graph.value];for(const n of t)if(f=v,(h=n).subject.termType===f.subject.termType&&h.object.termType===f.object.termType&&h.subject.value===f.subject.value&&h.predicate.value===f.predicate.value&&h.object.value===f.object.value&&(h.object.termType!==a||h.object.datatype.termType===f.object.datatype.termType&&h.object.language===f.object.language&&h.object.datatype.value===f.object.datatype.value)){e=!1;break}e&&(t.push(v),l.push(v))}else d[v.graph.value]=[v],l.push(v)}var h,f;return l}static serialize(t){Array.isArray(t)||(t=e.legacyDatasetToQuads(t));const n=[];for(const o of t)n.push(e.serializeQuad(o));return n.sort().join("")}static serializeQuadComponents(e,a,i,s){let c="";return e.termType===o?c+=`<${e.value}>`:c+=`${e.value}`,c+=` <${a.value}> `,i.termType===o?c+=`<${i.value}>`:i.termType===r?c+=i.value:(c+=`"${function(e){return e.replace(l,(function(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}}))}(i.value)}"`,i.datatype.value===t?i.language&&(c+=`@${i.language}`):i.datatype.value!==n&&(c+=`^^<${i.datatype.value}>`)),s.termType===o?c+=` <${s.value}>`:s.termType===r&&(c+=` ${s.value}`),c+=" .\n",c}static serializeQuad(t){return e.serializeQuadComponents(t.subject,t.predicate,t.object,t.graph)}static legacyDatasetToQuads(e){const s=[],l={"blank node":r,IRI:o,literal:a};for(const c in e)e[c].forEach((e=>{const d={};for(const r in e){const i=e[r],s={termType:l[i.type],value:i.value};s.termType===a&&(s.datatype={termType:o},"datatype"in i&&(s.datatype.value=i.datatype),"language"in i?("datatype"in i||(s.datatype.value=t),s.language=i.language):"datatype"in i||(s.datatype.value=n)),d[r]=s}d.graph="@default"===c?{termType:i,value:""}:{termType:c.startsWith("_:")?r:o,value:c},s.push(d)}));return s}};const l=/["\\\n\r]/g,c=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},1747:e=>{"use strict";e.exports=class{constructor(e){this.current=e.sort(),this.done=!1,this.dir=new Map;for(let t=0;to)&&(s&&n>0&&i>e[n-1]||!s&&ne[n+1])&&(o=i,r=n)}if(null===o)this.done=!0;else{const n=t.get(o)?r-1:r+1;e[r]=e[n],e[n]=o;for(const n of e)n>o&&t.set(n,!t.get(n))}return n}}},6991:(e,t,n)=>{"use strict";const o=n(7207),r=n(2269),a=n(1747),i=n(3281);function s(e,t){return e.hasht.hash?1:0}e.exports=class{constructor({createMessageDigest:e=(()=>new r("sha256")),canonicalIdMap:t=new Map,maxDeepIterations:n=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new o("_:c14n",t),this.createMessageDigest=e,this.maxDeepIterations=n,this.quads=null,this.deepIterations=null}async main(e){this.deepIterations=new Map,this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,n=[...this.blankNodeInfo.keys()];let r=0;for(const e of n)++r%100==0&&await this._yield(),await this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const a=[...t.keys()].sort(),l=[];for(const e of a){const n=t.get(e);if(n.length>1){l.push(n);continue}const o=n[0];this.canonicalIssuer.getId(o)}for(const e of l){const t=[];for(const n of e){if(this.canonicalIssuer.hasId(n))continue;const e=new o("_:b");e.getId(n);const r=await this.hashNDegreeQuads(n,e);t.push(r)}t.sort(s);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const c=[];for(const e of this.quads){const t=i.serializeQuadComponents(this._componentWithCanonicalId(e.subject),e.predicate,this._componentWithCanonicalId(e.object),this._componentWithCanonicalId(e.graph));c.push(t)}return c.sort(),c.join("")}async hashFirstDegreeQuads(e){const t=[],n=this.blankNodeInfo.get(e),o=n.quads;for(const n of o){const o={subject:null,predicate:n.predicate,object:null,graph:null};o.subject=this.modifyFirstDegreeComponent(e,n.subject,"subject"),o.object=this.modifyFirstDegreeComponent(e,n.object,"object"),o.graph=this.modifyFirstDegreeComponent(e,n.graph,"graph"),t.push(i.serializeQuad(o))}t.sort();const r=this.createMessageDigest();for(const e of t)r.update(e);return n.hash=await r.digest(),n.hash}async hashRelatedBlankNode(e,t,n,o){let r;r=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):n.hasId(e)?n.getId(e):this.blankNodeInfo.get(e).hash;const a=this.createMessageDigest();return a.update(o),"g"!==o&&a.update(this.getRelatedPredicate(t)),a.update(r),a.digest()}async hashNDegreeQuads(e,t){const n=this.deepIterations.get(e)||0;if(n>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,n+1);const o=this.createMessageDigest(),r=await this.createHashToRelated(e,t),i=[...r.keys()].sort();for(const e of i){o.update(e);let n,i="";const s=new a(r.get(e));let l=0;for(;s.hasNext();){const e=s.next();++l%3==0&&await this._yield();let o=t.clone(),r="";const a=[];let c=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?r+=this.canonicalIssuer.getId(t):(o.hasId(t)||a.push(t),r+=o.getId(t)),0!==i.length&&r>i){c=!0;break}if(!c){for(const e of a){const t=await this.hashNDegreeQuads(e,o);if(r+=o.getId(e),r+=`<${t.hash}>`,o=t.issuer,0!==i.length&&r>i){c=!0;break}}c||(0===i.length||r`}async createHashToRelated(e,t){const n=new Map,o=this.blankNodeInfo.get(e).quads;let r=0;for(const a of o)++r%100==0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:a,component:a.subject,position:"s",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:a,component:a.object,position:"o",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:a,component:a.graph,position:"g",id:e,issuer:t,hashToRelated:n})]);return n}async _hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const n=await this.hashFirstDegreeQuads(e),o=t.get(n);o?o.push(e):t.set(n,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const n=t.value,o=this.blankNodeInfo.get(n);o?o.quads.add(e):this.blankNodeInfo.set(n,{quads:new Set([e]),hash:null})}async _addRelatedBlankNodeHash({quad:e,component:t,position:n,id:o,issuer:r,hashToRelated:a}){if("BlankNode"!==t.termType||t.value===o)return;const i=t.value,s=await this.hashRelatedBlankNode(i,e,r,n),l=a.get(s);l?l.push(i):a.set(s,[i])}_componentWithCanonicalId(e){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}async _yield(){return new Promise((e=>setImmediate(e)))}}},6280:(e,t,n)=>{"use strict";const o=n(7207),r=n(2269),a=n(1747),i=n(3281);function s(e,t){return e.hasht.hash?1:0}e.exports=class{constructor({createMessageDigest:e=(()=>new r("sha256")),canonicalIdMap:t=new Map,maxDeepIterations:n=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new o("_:c14n",t),this.createMessageDigest=e,this.maxDeepIterations=n,this.quads=null,this.deepIterations=null}main(e){this.deepIterations=new Map,this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,n=[...this.blankNodeInfo.keys()];for(const e of n)this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const r=[...t.keys()].sort(),a=[];for(const e of r){const n=t.get(e);if(n.length>1){a.push(n);continue}const o=n[0];this.canonicalIssuer.getId(o)}for(const e of a){const t=[];for(const n of e){if(this.canonicalIssuer.hasId(n))continue;const e=new o("_:b");e.getId(n);const r=this.hashNDegreeQuads(n,e);t.push(r)}t.sort(s);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const l=[];for(const e of this.quads){const t=i.serializeQuadComponents(this._componentWithCanonicalId({component:e.subject}),e.predicate,this._componentWithCanonicalId({component:e.object}),this._componentWithCanonicalId({component:e.graph}));l.push(t)}return l.sort(),l.join("")}hashFirstDegreeQuads(e){const t=[],n=this.blankNodeInfo.get(e),o=n.quads;for(const n of o){const o={subject:null,predicate:n.predicate,object:null,graph:null};o.subject=this.modifyFirstDegreeComponent(e,n.subject,"subject"),o.object=this.modifyFirstDegreeComponent(e,n.object,"object"),o.graph=this.modifyFirstDegreeComponent(e,n.graph,"graph"),t.push(i.serializeQuad(o))}t.sort();const r=this.createMessageDigest();for(const e of t)r.update(e);return n.hash=r.digest(),n.hash}hashRelatedBlankNode(e,t,n,o){let r;r=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):n.hasId(e)?n.getId(e):this.blankNodeInfo.get(e).hash;const a=this.createMessageDigest();return a.update(o),"g"!==o&&a.update(this.getRelatedPredicate(t)),a.update(r),a.digest()}hashNDegreeQuads(e,t){const n=this.deepIterations.get(e)||0;if(n>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,n+1);const o=this.createMessageDigest(),r=this.createHashToRelated(e,t),i=[...r.keys()].sort();for(const e of i){o.update(e);let n,i="";const s=new a(r.get(e));for(;s.hasNext();){const e=s.next();let o=t.clone(),r="";const a=[];let l=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?r+=this.canonicalIssuer.getId(t):(o.hasId(t)||a.push(t),r+=o.getId(t)),0!==i.length&&r>i){l=!0;break}if(!l){for(const e of a){const t=this.hashNDegreeQuads(e,o);if(r+=o.getId(e),r+=`<${t.hash}>`,o=t.issuer,0!==i.length&&r>i){l=!0;break}}l||(0===i.length||r`}createHashToRelated(e,t){const n=new Map,o=this.blankNodeInfo.get(e).quads;for(const r of o)this._addRelatedBlankNodeHash({quad:r,component:r.subject,position:"s",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:r,component:r.object,position:"o",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:r,component:r.graph,position:"g",id:e,issuer:t,hashToRelated:n});return n}_hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const n=this.hashFirstDegreeQuads(e),o=t.get(n);o?o.push(e):t.set(n,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const n=t.value,o=this.blankNodeInfo.get(n);o?o.quads.add(e):this.blankNodeInfo.set(n,{quads:new Set([e]),hash:null})}_addRelatedBlankNodeHash({quad:e,component:t,position:n,id:o,issuer:r,hashToRelated:a}){if("BlankNode"!==t.termType||t.value===o)return;const i=t.value,s=this.hashRelatedBlankNode(i,e,r,n),l=a.get(s);l?l.push(i):a.set(s,[i])}_componentWithCanonicalId({component:e}){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}}},715:(e,t,n)=>{"use strict";const o=n(2269),r=n(6991);e.exports=class extends r{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new o("sha1")}modifyFirstDegreeComponent(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}async createHashToRelated(e,t){const n=new Map,o=this.blankNodeInfo.get(e).quads;let r=0;for(const a of o){let o,i;if("BlankNode"===a.subject.termType&&a.subject.value!==e)i=a.subject.value,o="p";else{if("BlankNode"!==a.object.termType||a.object.value===e)continue;i=a.object.value,o="r"}++r%100==0&&await this._yield();const s=await this.hashRelatedBlankNode(i,a,t,o),l=n.get(s);l?l.push(i):n.set(s,[i])}return n}}},8172:(e,t,n)=>{"use strict";const o=n(2269),r=n(6280);e.exports=class extends r{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new o("sha1")}modifyFirstDegreeComponent(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}createHashToRelated(e,t){const n=new Map,o=this.blankNodeInfo.get(e).quads;for(const r of o){let o,a;if("BlankNode"===r.subject.termType&&r.subject.value!==e)a=r.subject.value,o="p";else{if("BlankNode"!==r.object.termType||r.object.value===e)continue;a=r.object.value,o="r"}const i=this.hashRelatedBlankNode(a,r,t,o),s=n.get(i);s?s.push(a):n.set(i,[a])}return n}}},147:(e,t,n)=>{"use strict";const o=n(6991),r=n(715),a=n(6280),i=n(8172);let s;try{s=n(7789)}catch(e){}function l(e){return Array.isArray(e)?e:t.NQuads.legacyDatasetToQuads(e)}t.NQuads=n(3281),t.IdentifierIssuer=n(7207),t._rdfCanonizeNative=function(e){return e&&(s=e),s},t.canonize=async function(e,t){const n=l(e);if(t.useNative){if(!s)throw new Error("rdf-canonize-native not available");if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise(((e,o)=>s.canonize(n,t,((t,n)=>t?o(t):e(n)))))}if("URDNA2015"===t.algorithm)return new o(t).main(n);if("URGNA2012"===t.algorithm){if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new r(t).main(n)}if(!("algorithm"in t))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm)},t._canonizeSync=function(e,t){const n=l(e);if(t.useNative){if(!s)throw new Error("rdf-canonize-native not available");if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return s.canonizeSync(n,t)}if("URDNA2015"===t.algorithm)return new a(t).main(n);if("URGNA2012"===t.algorithm){if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new i(t).main(n)}if(!("algorithm"in t))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm)}},6945:function(e,t,n){var o=n(9964);!function(e,t){"use strict";if(!e.setImmediate){var n,r,a,i,s,l=1,c={},d=!1,u=e.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,"[object process]"==={}.toString.call(e.process)?n=function(e){o.nextTick((function(){f(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(i="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(i)&&f(+t.data.slice(i.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),n=function(t){e.postMessage(i+t,"*")}):e.MessageChannel?((a=new MessageChannel).port1.onmessage=function(e){f(e.data)},n=function(e){a.port2.postMessage(e)}):u&&"onreadystatechange"in u.createElement("script")?(r=u.documentElement,n=function(e){var t=u.createElement("script");t.onreadystatechange=function(){f(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):n=function(e){setTimeout(f,0,e)},p.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),o=0;o