diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/CNAME b/CNAME new file mode 100644 index 0000000..0380db5 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +console.foerderfunke.org \ No newline at end of file diff --git a/assets/bundle.js b/assets/bundle.js new file mode 100644 index 0000000..bafb190 --- /dev/null +++ b/assets/bundle.js @@ -0,0 +1,2 @@ +/*! For license information please see bundle.js.LICENSE.txt */ +(()=>{var e={50608:(e,t,r)=>{var{Buffer:n}=r(48287),i={},a=i.LEFT_BRACE=1,o=i.RIGHT_BRACE=2,s=i.LEFT_BRACKET=3,c=i.RIGHT_BRACKET=4,u=i.COLON=5,l=i.COMMA=6,d=i.TRUE=7,p=i.FALSE=8,h=i.NULL=9,f=i.STRING=10,y=i.NUMBER=11,g=i.START=17,m=i.STOP=18,b=i.TRUE1=33,v=i.TRUE2=34,_=i.TRUE3=35,w=i.FALSE1=49,O=i.FALSE2=50,T=i.FALSE3=51,S=i.FALSE4=52,E=i.NULL1=65,x=i.NULL2=66,I=i.NULL3=67,A=i.NUMBER1=81,j=i.NUMBER3=83,N=i.STRING1=97,R=i.STRING2=98,D=i.STRING3=99,P=i.STRING4=100,F=i.STRING5=101,C=i.STRING6=102,M=i.VALUE=113,L=i.KEY=114,k=i.OBJECT=129,B=i.ARRAY=130,U="\\".charCodeAt(0),V="/".charCodeAt(0),$="\b".charCodeAt(0),q="\f".charCodeAt(0),Q="\n".charCodeAt(0),G="\r".charCodeAt(0),z="\t".charCodeAt(0),H=65536;function K(e){return n.alloc?n.alloc(e):new n(e)}function X(){this.tState=g,this.value=void 0,this.string=void 0,this.stringBuffer=K(H),this.stringBufferOffset=0,this.unicode=void 0,this.highSurrogate=void 0,this.key=void 0,this.mode=void 0,this.stack=[],this.state=M,this.bytes_remaining=0,this.bytes_in_sequence=0,this.temp_buffs={2:K(2),3:K(3),4:K(4)},this.offset=-1}X.toknam=function(e){for(var t=Object.keys(i),r=0,n=t.length;r=H&&(this.string+=this.stringBuffer.toString("utf8"),this.stringBufferOffset=0),this.stringBuffer[this.stringBufferOffset++]=e},J.appendStringBuf=function(e,t,r){var n=e.length;"number"==typeof t&&(n="number"==typeof r?r<0?e.length-t+r:r-t:e.length-t),n<0&&(n=0),this.stringBufferOffset+n>H&&(this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0),e.copy(this.stringBuffer,this.stringBufferOffset,t,r),this.stringBufferOffset+=n},J.write=function(e){var t;"string"==typeof e&&(e=new n(e));for(var r=0,i=e.length;r=48&&t<64)this.string=String.fromCharCode(t),this.tState=j;else if(32!==t&&9!==t&&10!==t&&13!==t)return this.charError(e,r)}else if(this.tState===N)if(t=e[r],this.bytes_remaining>0){for(var y=0;y=128){if(t<=193||t>244)return this.onError(new Error("Invalid UTF-8 character at position "+r+" in state "+X.toknam(this.tState)));if(t>=194&&t<=223&&(this.bytes_in_sequence=2),t>=224&&t<=239&&(this.bytes_in_sequence=3),t>=240&&t<=244&&(this.bytes_in_sequence=4),this.bytes_in_sequence+r>e.length){for(var m=0;m<=e.length-1-r;m++)this.temp_buffs[this.bytes_in_sequence][m]=e[r+m];this.bytes_remaining=r+this.bytes_in_sequence-e.length,r=e.length-1}else this.appendStringBuf(e,r,r+this.bytes_in_sequence),r=r+this.bytes_in_sequence-1}else if(34===t)this.tState=g,this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0,this.onToken(f,this.string),this.offset+=n.byteLength(this.string,"utf8")+1,this.string=void 0;else if(92===t)this.tState=R;else{if(!(t>=32))return this.charError(e,r);this.appendStringChar(t)}else if(this.tState===R)if(34===(t=e[r]))this.appendStringChar(t),this.tState=N;else if(92===t)this.appendStringChar(U),this.tState=N;else if(47===t)this.appendStringChar(V),this.tState=N;else if(98===t)this.appendStringChar($),this.tState=N;else if(102===t)this.appendStringChar(q),this.tState=N;else if(110===t)this.appendStringChar(Q),this.tState=N;else if(114===t)this.appendStringChar(G),this.tState=N;else if(116===t)this.appendStringChar(z),this.tState=N;else{if(117!==t)return this.charError(e,r);this.unicode="",this.tState=D}else if(this.tState===D||this.tState===P||this.tState===F||this.tState===C){if(!((t=e[r])>=48&&t<64||t>64&&t<=70||t>96&&t<=102))return this.charError(e,r);if(this.unicode+=String.fromCharCode(t),this.tState++===C){var M=parseInt(this.unicode,16);this.unicode=void 0,void 0!==this.highSurrogate&&M>=56320&&M<57344?(this.appendStringBuf(new n(String.fromCharCode(this.highSurrogate,M))),this.highSurrogate=void 0):void 0===this.highSurrogate&&M>=55296&&M<56320?this.highSurrogate=M:(void 0!==this.highSurrogate&&(this.appendStringBuf(new n(String.fromCharCode(this.highSurrogate))),this.highSurrogate=void 0),this.appendStringBuf(new n(String.fromCharCode(M)))),this.tState=N}}else if(this.tState===A||this.tState===j)switch(t=e[r]){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 46:case 101:case 69:case 43:case 45:this.string+=String.fromCharCode(t),this.tState=j;break;default:this.tState=g;var L=this.numberReviver(this.string,e,r);if(L)return L;this.offset+=this.string.length-1,this.string=void 0,r--}else if(this.tState===b){if(114!==e[r])return this.charError(e,r);this.tState=v}else if(this.tState===v){if(117!==e[r])return this.charError(e,r);this.tState=_}else if(this.tState===_){if(101!==e[r])return this.charError(e,r);this.tState=g,this.onToken(d,!0),this.offset+=3}else if(this.tState===w){if(97!==e[r])return this.charError(e,r);this.tState=O}else if(this.tState===O){if(108!==e[r])return this.charError(e,r);this.tState=T}else if(this.tState===T){if(115!==e[r])return this.charError(e,r);this.tState=S}else if(this.tState===S){if(101!==e[r])return this.charError(e,r);this.tState=g,this.onToken(p,!1),this.offset+=4}else if(this.tState===E){if(117!==e[r])return this.charError(e,r);this.tState=x}else if(this.tState===x){if(108!==e[r])return this.charError(e,r);this.tState=I}else if(this.tState===I){if(108!==e[r])return this.charError(e,r);this.tState=g,this.onToken(h,null),this.offset+=3}},J.onToken=function(e,t){},J.parseError=function(e,t){this.tState=m,this.onError(new Error("Unexpected "+X.toknam(e)+(t?"("+JSON.stringify(t)+")":"")+" in state "+X.toknam(this.state)))},J.push=function(){this.stack.push({value:this.value,key:this.key,mode:this.mode})},J.pop=function(){var e=this.value,t=this.stack.pop();this.value=t.value,this.key=t.key,this.mode=t.mode,this.emit(e),this.mode||(this.state=M)},J.emit=function(e){this.mode&&(this.state=l),this.onValue(e)},J.onValue=function(e){},J.onToken=function(e,t){if(this.state===M)if(e===f||e===y||e===d||e===p||e===h)this.value&&(this.value[this.key]=t),this.emit(t);else if(e===a)this.push(),this.value?this.value=this.value[this.key]={}:this.value={},this.key=void 0,this.state=L,this.mode=k;else if(e===s)this.push(),this.value?this.value=this.value[this.key]=[]:this.value=[],this.key=0,this.mode=B,this.state=M;else if(e===o){if(this.mode!==k)return this.parseError(e,t);this.pop()}else{if(e!==c)return this.parseError(e,t);if(this.mode!==B)return this.parseError(e,t);this.pop()}else if(this.state===L)if(e===f)this.key=t,this.state=u;else{if(e!==o)return this.parseError(e,t);this.pop()}else if(this.state===u){if(e!==u)return this.parseError(e,t);this.state=M}else{if(this.state!==l)return this.parseError(e,t);if(e===l)this.mode===B?(this.key++,this.state=M):this.mode===k&&(this.state=L);else{if(!(e===c&&this.mode===B||e===o&&this.mode===k))return this.parseError(e,t);this.pop()}}},J.numberReviver=function(e,t,r){var n=Number(e);if(isNaN(n))return this.charError(t,r);e.match(/[0-9]+/)==e&&n.toString()!=e?this.onToken(f,e):this.onToken(y,n)},X.C=i,e.exports=X},78563:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorAbstractMediaTyped=void 0;const n=r(90412);class i extends n.Actor{constructor(e){super(e)}async run(e){if("handle"in e){const t=e;return{handle:await this.runHandle(t.handle,t.handleMediaType,e.context)}}if("mediaTypes"in e)return{mediaTypes:await this.getMediaTypes(e.context)};if("mediaTypeFormats"in e)return{mediaTypeFormats:await this.getMediaTypeFormats(e.context)};throw new Error("Either a handle, mediaTypes or mediaTypeFormats action needs to be provided")}async test(e){if("handle"in e){const t=e;return(await this.testHandle(t.handle,t.handleMediaType,e.context)).map((e=>({handle:e})))}return"mediaTypes"in e?(await this.testMediaType(e.context)).map((e=>({mediaTypes:e}))):"mediaTypeFormats"in e?(await this.testMediaTypeFormats(e.context)).map((e=>({mediaTypeFormats:e}))):(0,n.failTest)("Either a handle, mediaTypes or mediaTypeFormats action needs to be provided")}}t.ActorAbstractMediaTyped=i},17633:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorAbstractMediaTypedFixed=void 0;const n=r(90412),i=r(78563);class a extends i.ActorAbstractMediaTyped{constructor(e){super(e);const t=this.priorityScale||0===this.priorityScale?this.priorityScale:1;if(this.mediaTypePriorities)for(const[e,[r,n]]of Object.entries(this.mediaTypePriorities).entries())this.mediaTypePriorities[r]=t*n;this.mediaTypePriorities=Object.freeze(this.mediaTypePriorities),this.mediaTypeFormats=Object.freeze(this.mediaTypeFormats)}async testHandle(e,t,r){return t&&t in this.mediaTypePriorities?await this.testHandleChecked(e,r):(0,n.failTest)(`Unrecognized media type: ${t}`)}async testMediaType(e){return(0,n.passTestVoid)()}async getMediaTypes(e){return this.mediaTypePriorities}async testMediaTypeFormats(e){return(0,n.passTestVoid)()}async getMediaTypeFormats(e){return this.mediaTypeFormats}}t.ActorAbstractMediaTypedFixed=a},48092:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(78563),t),i(r(17633),t)},92647:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorAbstractPath=void 0;const n=r(66490),i=r(90711),a=r(90412),o=r(67021),s=r(75627),c=r(43347),u=r(96331),l=r(71493);class d extends n.ActorQueryOperationTypedMediated{constructor(e,t){super(e,"path"),this.predicateType=t}async testOperation(e,t){return e.predicate.type!==this.predicateType?(0,a.failTest)(`This Actor only supports ${this.predicateType} Path operations.`):(0,a.passTestVoid)()}generateVariable(e,t,r){return r?!t||t.subject.value!==r&&t.object.value!==r?e.variable(r):this.generateVariable(e,t,`${r}b`):this.generateVariable(e,t,"b")}async isPathArbitraryLengthDistinct(e,t,r){return t.get(i.KeysQueryOperation.isPathArbitraryLengthDistinctKey)?{context:t=t.set(i.KeysQueryOperation.isPathArbitraryLengthDistinctKey,!1),operation:void 0}:{context:t=t.set(i.KeysQueryOperation.isPathArbitraryLengthDistinctKey,!0),operation:(0,o.getSafeBindings)(await this.mediatorQueryOperation.mediate({operation:e.createDistinct(r),context:t}))}}async predicateStarGraphVariable(e,t,r,n,i,a,c){const u=this.getPathSources(r),l=this.generateVariable(a.dataFactory,a.createPath(e,r,t,n)),d=a.createUnion([this.assignPatternSources(a,a.createPattern(e,l,t,n),u),this.assignPatternSources(a,a.createPattern(t,l,e,n),u)]),p=(0,o.getSafeBindings)(await this.mediatorQueryOperation.mediate({context:i,operation:d})),h=new Set;return{bindingsStream:new s.MultiTransformIterator(p.bindingsStream,{multiTransform:o=>{const u=o.get(n);return h.has(u.value)?new s.EmptyIterator:(h.add(u.value),new s.TransformIterator((async()=>{const o=new s.BufferedIterator;return await this.getObjectsPredicateStar(a,e,r,u,i,{},o,{count:0}),o.transform({transform(e,r,i){i(c.bindings([[t,e],[n,u]])),r()}})}),{maxBufferSize:128}))},autoStart:!1}),metadata:p.metadata}}async getObjectsPredicateStarEval(e,t,r,n,i,a,o,s){if("Variable"===n.termType)return this.predicateStarGraphVariable(e,r,t,n,i,o,s);const c=new l.PathVariableObjectIterator(o,e,t,n,i,this.mediatorQueryOperation,a);return{bindingsStream:c.transform({autoStart:!1,transform(e,t,n){n(s.bindings([[r,e]])),t()}}),async metadata(){const e=await new Promise((e=>{c.getProperty("metadata",(t=>e(t())))}));return e.cardinality.value++,e}}}async getObjectsPredicateStar(e,t,r,n,i,a,s,u){const l=(0,c.termToString)(t);if(a[l])return;s._push(t),a[l]=t,u.count++;const d=this.generateVariable(e.dataFactory),p=e.createPath(t,r,d,n),h=(0,o.getSafeBindings)(await this.mediatorQueryOperation.mediate({operation:p,context:i}));return h.bindingsStream.on("data",(async t=>{const o=t.get(d);await this.getObjectsPredicateStar(e,o,r,n,i,a,s,u)})),h.bindingsStream.on("end",(()=>{0==--u.count&&s.close()})),h.metadata}async getSubjectAndObjectBindingsPredicateStar(e,t,r,n,i,a,s,u,l,d,p,h,f){const y=(0,c.termToString)(n)+(0,c.termToString)(a);if(l[y])return;if(p.count++,l[y]=!0,d._push(f.bindings([[e,r],[t,n]])),y in u){const n=await u[y];for(const o of n)await this.getSubjectAndObjectBindingsPredicateStar(e,t,r,o,i,a,s,u,l,d,p,h,f);return void(0==--p.count&&d.close())}const g=new Promise((async(c,y)=>{const g=[],m=this.generateVariable(h.dataFactory),b=h.createPath(n,i,m,a),v=(0,o.getSafeBindings)(await this.mediatorQueryOperation.mediate({operation:b,context:s}));v.bindingsStream.on("data",(async n=>{const o=n.get(m);g.push(o),await this.getSubjectAndObjectBindingsPredicateStar(e,t,r,o,i,a,s,u,l,d,p,h,f)})),v.bindingsStream.on("error",y),v.bindingsStream.on("end",(()=>{0==--p.count&&d.close(),c(g)}))}));u[y]=g}getPathSources(e){switch(e.type){case u.Algebra.types.ALT:case u.Algebra.types.SEQ:return e.input.flatMap((e=>this.getPathSources(e)));case u.Algebra.types.INV:case u.Algebra.types.ONE_OR_MORE_PATH:case u.Algebra.types.ZERO_OR_MORE_PATH:case u.Algebra.types.ZERO_OR_ONE_PATH:return this.getPathSources(e.path);case u.Algebra.types.LINK:case u.Algebra.types.NPS:{const t=(0,o.getOperationSource)(e);if(!t)throw new Error("Could not find a required source on a link path operation");return[t]}}}assignPatternSources(e,t,r){if(0===r.length)throw new Error("Attempted to assign zero sources to a pattern during property path handling");return 1===r.length?(0,o.assignOperationSource)(t,r[0]):e.createUnion(r.map((e=>(0,o.assignOperationSource)(t,e))),!0)}}t.ActorAbstractPath=d},71493:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PathVariableObjectIterator=void 0;const n=r(67021),i=r(75627),a=r(43347);class o extends i.BufferedIterator{constructor(e,t,r,n,i,a,o,s=16){super({autoStart:!0}),this.algebraFactory=e,this.subject=t,this.predicate=r,this.graph=n,this.context=i,this.mediatorQueryOperation=a,this.maxRunningOperations=s,this.termHashes=new Map,this.runningOperations=[],this.pendingOperations=[],this._push(this.subject,o)}_end(e){for(const e of this.runningOperations)e.destroy();super._end(e)}_push(e,t=!0){let r;if(t&&(r=(0,a.termToString)(e),this.termHashes.has(r)))return;const n=this.algebraFactory.dataFactory.variable("b");this.pendingOperations.push({variable:n,operation:this.algebraFactory.createPath(e,this.predicate,n,this.graph)}),r&&(this.termHashes.set(r,e),super._push(e))}_read(e,t){const r=this;(async function(){for(;r.runningOperations.lengthr.destroy(e))),i.on("readable",(()=>{r.readable=!0,r._fillBufferAsync()})),i.on("end",(()=>{r.runningOperations.splice(r.runningOperations.indexOf(i),1),r.readable=!0,r._fillBufferAsync()}))),r.setProperty("metadata",t.metadata)}let t,i=0;for(;i!==(i=e);)for(let n=0;n0;n++)null!==(t=r.runningOperations[n].read())&&(e--,r._push(t));0===r.runningOperations.length&&0===r.pendingOperations.length&&r.close()})().then((()=>{t()}),(e=>this.destroy(e)))}}t.PathVariableObjectIterator=o},97091:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(92647),t),i(r(71493),t)},34023:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorBindingsAggregatorFactoryAverage=void 0;const n=r(86581),i=r(90711),a=r(90412),o=r(77545),s=r(23786);class c extends n.ActorBindingsAggregatorFactory{constructor(e){super(e),this.mediatorFunctionFactory=e.mediatorFunctionFactory}async test(e){return"avg"!==e.expr.aggregator?(0,a.failTest)("This actor only supports the 'avg' aggregator."):(0,a.passTestVoid)()}async run({context:e,expr:t}){return new s.AverageAggregator(await this.mediatorExpressionEvaluatorFactory.mediate({algExpr:t.expression,context:e}),t.distinct,e.getSafe(i.KeysInitQuery.dataFactory),await this.mediatorFunctionFactory.mediate({functionName:o.SparqlOperator.ADDITION,context:e,requireTermExpression:!0}),await this.mediatorFunctionFactory.mediate({functionName:o.SparqlOperator.DIVISION,context:e,requireTermExpression:!0}))}}t.ActorBindingsAggregatorFactoryAverage=c},23786:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AverageAggregator=void 0;const n=r(86581),i=r(77545);class a extends n.AggregateEvaluator{constructor(e,t,r,n,i,a){super(e,t,a),this.dataFactory=r,this.additionFunction=n,this.divisionFunction=i,this.state=void 0}emptyValueTerm(){return i.typedLiteral("0",i.TypeURL.XSD_INTEGER)}putTerm(e){if(void 0===this.state){const t=this.termToNumericOrError(e);this.state={sum:t,count:1}}else{const t=this.termToNumericOrError(e);this.state.sum=this.additionFunction.applyOnTerms([this.state.sum,t],this.evaluator),this.state.count++}}termResult(){if(void 0===this.state)return this.emptyValue();const e=new i.IntegerLiteral(this.state.count);return this.divisionFunction.applyOnTerms([this.state.sum,e],this.evaluator).toRDF(this.dataFactory)}}t.AverageAggregator=a},17352:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(34023),t),i(r(23786),t)},63055:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorBindingsAggregatorFactoryCount=void 0;const n=r(86581),i=r(90412),a=r(96331),o=r(53930);class s extends n.ActorBindingsAggregatorFactory{constructor(e){super(e)}async test(e){return"count"!==e.expr.aggregator||e.expr.expression.expressionType===a.Algebra.expressionTypes.WILDCARD?(0,i.failTest)("This actor only supports the 'count' aggregator without wildcard."):(0,i.passTestVoid)()}async run({context:e,expr:t}){return new o.CountAggregator(await this.mediatorExpressionEvaluatorFactory.mediate({algExpr:t.expression,context:e}),t.distinct)}}t.ActorBindingsAggregatorFactoryCount=s},53930:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CountAggregator=void 0;const n=r(86581),i=r(77545);class a extends n.AggregateEvaluator{constructor(e,t,r){super(e,t,r),this.state=void 0}emptyValueTerm(){return(0,i.typedLiteral)("0",i.TypeURL.XSD_INTEGER)}putTerm(e){void 0===this.state&&(this.state=0),this.state++}termResult(){return void 0===this.state?this.emptyValue():(0,i.typedLiteral)(String(this.state),i.TypeURL.XSD_INTEGER)}}t.CountAggregator=a},2236:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(63055),t),i(r(53930),t)},50776:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorBindingsAggregatorFactoryGroupConcat=void 0;const n=r(86581),i=r(90711),a=r(90412),o=r(52573);class s extends n.ActorBindingsAggregatorFactory{constructor(e){super(e)}async test(e){return"group_concat"!==e.expr.aggregator?(0,a.failTest)("This actor only supports the 'group_concat' aggregator."):(0,a.passTestVoid)()}async run({context:e,expr:t}){return new o.GroupConcatAggregator(await this.mediatorExpressionEvaluatorFactory.mediate({algExpr:t.expression,context:e}),t.distinct,e.getSafe(i.KeysInitQuery.dataFactory),t.separator)}}t.ActorBindingsAggregatorFactoryGroupConcat=s},52573:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GroupConcatAggregator=void 0;const n=r(86581),i=r(77545);class a extends n.AggregateEvaluator{constructor(e,t,r,n,i){super(e,t,i),this.dataFactory=r,this.state=void 0,this.lastLanguageValid=!0,this.lastLanguage=void 0,this.separator=n??" "}emptyValueTerm(){return i.typedLiteral("",i.TypeURL.XSD_STRING)}putTerm(e){void 0===this.state?(this.state=e.value,"Literal"===e.termType&&(this.lastLanguage=e.language)):(this.state+=this.separator+e.value,this.lastLanguageValid&&"Literal"===e.termType&&this.lastLanguage!==e.language&&(this.lastLanguageValid=!1,this.lastLanguage=void 0))}termResult(){return void 0===this.state?this.emptyValue():this.lastLanguageValid&&this.lastLanguage?i.langString(this.state,this.lastLanguage).toRDF(this.dataFactory):i.typedLiteral(this.state,i.TypeURL.XSD_STRING)}}t.GroupConcatAggregator=a},37779:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(50776),t),i(r(52573),t)},58959:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorBindingsAggregatorFactoryMax=void 0;const n=r(86581),i=r(90412),a=r(7394);class o extends n.ActorBindingsAggregatorFactory{constructor(e){super(e),this.mediatorTermComparatorFactory=e.mediatorTermComparatorFactory}async test(e){return"max"!==e.expr.aggregator?(0,i.failTest)("This actor only supports the 'max' aggregator."):(0,i.passTestVoid)()}async run({expr:e,context:t}){return new a.MaxAggregator(await this.mediatorExpressionEvaluatorFactory.mediate({algExpr:e.expression,context:t}),e.distinct,await this.mediatorTermComparatorFactory.mediate({context:t}))}}t.ActorBindingsAggregatorFactoryMax=o},7394:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MaxAggregator=void 0;const n=r(86581);class i extends n.AggregateEvaluator{constructor(e,t,r,n){super(e,t,n),this.orderByEvaluator=r,this.state=void 0}putTerm(e){if("Literal"!==e.termType)throw new Error(`Term with value ${e.value} has type ${e.termType} and is not a literal`);(void 0===this.state||-1===this.orderByEvaluator.orderTypes(this.state,e))&&(this.state=e)}termResult(){return void 0===this.state?this.emptyValue():this.state}}t.MaxAggregator=i},51237:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(58959),t),i(r(7394),t)},13903:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorBindingsAggregatorFactoryMin=void 0;const n=r(86581),i=r(90412),a=r(7178);class o extends n.ActorBindingsAggregatorFactory{constructor(e){super(e),this.mediatorTermComparatorFactory=e.mediatorTermComparatorFactory}async test(e){return"min"!==e.expr.aggregator?(0,i.failTest)("This actor only supports the 'min' aggregator."):(0,i.passTestVoid)()}async run({context:e,expr:t}){return new a.MinAggregator(await this.mediatorExpressionEvaluatorFactory.mediate({algExpr:t.expression,context:e}),t.distinct,await this.mediatorTermComparatorFactory.mediate({context:e}))}}t.ActorBindingsAggregatorFactoryMin=o},7178:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MinAggregator=void 0;const n=r(86581);class i extends n.AggregateEvaluator{constructor(e,t,r,n){super(e,t,n),this.orderByEvaluator=r,this.state=void 0}putTerm(e){if("Literal"!==e.termType)throw new Error(`Term with value ${e.value} has type ${e.termType} and is not a literal`);(void 0===this.state||1===this.orderByEvaluator.orderTypes(this.state,e))&&(this.state=e)}termResult(){return void 0===this.state?this.emptyValue():this.state}}t.MinAggregator=i},13847:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(13903),t),i(r(7178),t)},30785:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorBindingsAggregatorFactorySample=void 0;const n=r(86581),i=r(90412),a=r(71932);class o extends n.ActorBindingsAggregatorFactory{constructor(e){super(e)}async test(e){return"sample"!==e.expr.aggregator?(0,i.failTest)("This actor only supports the 'sample' aggregator."):(0,i.passTestVoid)()}async run({context:e,expr:t}){return new a.SampleAggregator(await this.mediatorExpressionEvaluatorFactory.mediate({algExpr:t.expression,context:e}),t.distinct)}}t.ActorBindingsAggregatorFactorySample=o},71932:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SampleAggregator=void 0;const n=r(86581);class i extends n.AggregateEvaluator{constructor(e,t,r){super(e,t,r),this.state=void 0}putTerm(e){void 0===this.state&&(this.state=e)}termResult(){return void 0===this.state?this.emptyValue():this.state}}t.SampleAggregator=i},71271:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(30785),t),i(r(71932),t)},20935:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorBindingsAggregatorFactorySum=void 0;const n=r(86581),i=r(90711),a=r(90412),o=r(77545),s=r(77866);class c extends n.ActorBindingsAggregatorFactory{constructor(e){super(e),this.mediatorFunctionFactory=e.mediatorFunctionFactory}async test(e){return"sum"!==e.expr.aggregator?(0,a.failTest)("This actor only supports the 'sum' aggregator."):(0,a.passTestVoid)()}async run({expr:e,context:t}){return new s.SumAggregator(await this.mediatorExpressionEvaluatorFactory.mediate({algExpr:e.expression,context:t}),e.distinct,t.getSafe(i.KeysInitQuery.dataFactory),await this.mediatorFunctionFactory.mediate({functionName:o.SparqlOperator.ADDITION,context:t,requireTermExpression:!0}))}}t.ActorBindingsAggregatorFactorySum=c},77866:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SumAggregator=void 0;const n=r(86581),i=r(77545);class a extends n.AggregateEvaluator{constructor(e,t,r,n,i){super(e,t,i),this.dataFactory=r,this.additionFunction=n,this.state=void 0}emptyValueTerm(){return(0,i.typedLiteral)("0",i.TypeURL.XSD_INTEGER)}putTerm(e){if(void 0===this.state)this.state=this.termToNumericOrError(e);else{const t=this.termToNumericOrError(e);this.state=this.additionFunction.applyOnTerms([this.state,t],this.evaluator)}}termResult(){return void 0===this.state?this.emptyValue():this.state.toRDF(this.dataFactory)}}t.SumAggregator=a},26568:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(20935),t),i(r(77866),t)},38020:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorBindingsAggregatorFactoryWildcardCount=void 0;const n=r(86581),i=r(90412),a=r(60801);class o extends n.ActorBindingsAggregatorFactory{constructor(e){super(e)}async test(e){return"count"!==e.expr.aggregator||"wildcard"!==e.expr.expression.expressionType?(0,i.failTest)("This actor only supports the 'count' aggregator with wildcard."):(0,i.passTestVoid)()}async run({context:e,expr:t}){return new a.WildcardCountAggregator(await this.mediatorExpressionEvaluatorFactory.mediate({algExpr:t.expression,context:e}),t.distinct)}}t.ActorBindingsAggregatorFactoryWildcardCount=o},60801:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WildcardCountAggregator=void 0;const n=r(86581),i=r(77545),a=r(43347);class o extends n.AggregateEvaluator{constructor(e,t,r){super(e,t,r),this.bindingValues=new Map,this.state=void 0}putTerm(e){}async putBindings(e){this.handleDistinct(e)||(void 0===this.state&&(this.state=0),this.state+=1)}emptyValueTerm(){return(0,i.typedLiteral)("0",i.TypeURL.XSD_INTEGER)}termResult(){return void 0===this.state?this.emptyValue():(0,i.typedLiteral)(String(this.state),i.TypeURL.XSD_INTEGER)}handleDistinct(e){if(this.distinct){const t=[...e];t.sort(((e,t)=>e[0].value.localeCompare(t[0].value)));const r=t.map((([e])=>e.value)).join(","),n=t.map((([,e])=>a.termToString(e))).join(","),i=this.bindingValues.get(r),o=void 0!==i&&i.has(n);return i||this.bindingValues.set(r,new Set),this.bindingValues.get(r).add(n),o}return!1}}t.WildcardCountAggregator=o},20489:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(38020),t),i(r(60801),t)},72243:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorContextPreprocessConvertShortcuts=void 0;const n=r(98926),i=r(90412);class a extends n.ActorContextPreprocess{constructor(e){super(e)}async test(e){return(0,i.passTestVoid)()}async run(e){return{context:a.expandShortcuts(e.context,this.contextKeyShortcuts)}}static expandShortcuts(e,t){for(const r of e.keys())t[r.name]&&(e=e.set(new i.ActionContextKey(t[r.name]),e.get(r)).delete(r));return e}}t.ActorContextPreprocessConvertShortcuts=a},71871:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(72243),t)},90284:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorContextPreprocessQuerySourceIdentify=void 0;const n=r(98926),i=r(90711),a=r(90412),o=r(89096);class s extends n.ActorContextPreprocess{constructor(e){super(e),this.cache=this.cacheSize?new o.LRUCache({max:this.cacheSize}):void 0;const t=this.cache;t&&this.httpInvalidator.addInvalidateListener((({url:e})=>e?t.delete(e):t.clear()))}async test(e){return(0,a.passTestVoid)()}async run(e){let t=e.context;if(t.has(i.KeysInitQuery.querySourcesUnidentified)){const r=e.context.get(i.KeysInitQuery.querySourcesUnidentified),n=await Promise.all(r.map((e=>this.expandSource(e)))),a=await Promise.all(n.map((async t=>this.identifySource(t,e.context)))),o=e.context.get(i.KeysStatistics.dereferencedLinks);if(o)for(const e of a)o.updateStatistic({url:e.source.referenceValue,metadata:{seed:!0}},e.source);t=e.context.delete(i.KeysInitQuery.querySourcesUnidentified).set(i.KeysQueryOperation.querySources,a)}return{context:t}}async expandSource(e){return"string"==typeof e||"match"in e?{value:e}:{...e,context:(await this.mediatorContextPreprocess.mediate({context:a.ActionContext.ensureActionContext(e.context??{})})).context}}identifySource(e,t){let r;return"string"==typeof e.value&&this.cache&&(r=this.cache.get(e.value)),r||(r=this.mediatorQuerySourceIdentify.mediate({querySourceUnidentified:e,context:t}).then((({querySource:e})=>e)),"string"==typeof e.value&&this.cache&&this.cache.set(e.value,r)),r}}t.ActorContextPreprocessQuerySourceIdentify=s},38235:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(90284),t)},17426:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorContextPreprocessQuerySourceSkolemize=void 0;const n=r(98926),i=r(90711),a=r(90412),o=r(3898),s=r(28703);class c extends n.ActorContextPreprocess{constructor(e){super(e)}async test(e){return(0,a.passTestVoid)()}async run(e){let t=e.context;if(t.has(i.KeysQueryOperation.querySources)){t.has(i.KeysQuerySourceIdentify.sourceIds)||(t=t.set(i.KeysQuerySourceIdentify.sourceIds,new Map));const e=t.getSafe(i.KeysQuerySourceIdentify.sourceIds);let r=t.getSafe(i.KeysQueryOperation.querySources);r=r.map((t=>({source:new o.QuerySourceSkolemized(t.source,(0,s.getSourceId)(e,t.source)),context:t.context}))),t=t.set(i.KeysQueryOperation.querySources,r)}return{context:t}}}t.ActorContextPreprocessQuerySourceSkolemize=c},3898:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuerySourceSkolemized=void 0;const n=r(90711),i=r(99214),a=r(75627),o=r(28703);t.QuerySourceSkolemized=class{constructor(e,t){this.innerSource=e,this.sourceId=t}async getSelectorShape(e){return this.innerSource.getSelectorShape(e)}queryBindings(e,t,r){const s=t.getSafe(n.KeysInitQuery.dataFactory),c=(0,o.deskolemizeOperation)(s,e,this.sourceId);if(!c){const e=new a.ArrayIterator([],{autoStart:!1});return e.setProperty("metadata",{state:new i.MetadataValidationState,cardinality:{type:"exact",value:0},variables:[]}),e}return(0,o.skolemizeBindingsStream)(s,this.innerSource.queryBindings(c,t,r),this.sourceId)}queryBoolean(e,t){return this.innerSource.queryBoolean(e,t)}queryQuads(e,t){const r=t.getSafe(n.KeysInitQuery.dataFactory),s=(0,o.deskolemizeOperation)(r,e,this.sourceId);if(!s){const e=new a.ArrayIterator([],{autoStart:!1});return e.setProperty("metadata",{state:new i.MetadataValidationState,cardinality:{type:"exact",value:0}}),e}return(0,o.skolemizeQuadStream)(r,this.innerSource.queryQuads(s,t),this.sourceId)}queryVoid(e,t){return this.innerSource.queryVoid(e,t)}get referenceValue(){return this.innerSource.referenceValue}toString(){return`${this.innerSource.toString()}(SkolemID:${this.sourceId})`}}},21806:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(17426),t),i(r(3898),t),i(r(28703),t)},28703:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deskolemizeOperation=t.deskolemizeQuad=t.deskolemizeTermNestedThrowing=t.deskolemizeTerm=t.skolemizeBindingsStream=t.skolemizeQuadStream=t.skolemizeBindings=t.skolemizeQuad=t.skolemizeTerm=t.getSourceId=t.SKOLEM_PREFIX=void 0;const n=r(51296),i=r(3285),a=r(96331);function o(e,r,i){return"BlankNode"===r.termType?new n.BlankNodeScoped(`bc_${i}_${r.value}`,e.namedNode(`${t.SKOLEM_PREFIX}${i}:${r.value}`)):r}function s(e,t,r){return(0,i.mapTermsNested)(t,(t=>o(e,t,r)))}function c(e,t,r){return t.map((t=>"Quad"===t.termType?s(e,t,r):o(e,t,r)))}function u(e,r,n){if("BlankNode"===r.termType&&"skolemized"in r&&(r=r.skolemized),"NamedNode"===r.termType&&r.value.startsWith(t.SKOLEM_PREFIX)){const i=r.value.indexOf(":",t.SKOLEM_PREFIX.length);if(r.value.slice(t.SKOLEM_PREFIX.length,i)===n){const t=r.value.slice(i+1,r.value.length);return e.blankNode(t)}return null}return r}function l(e,t,r){if("Quad"===t.termType)return(0,i.mapTermsNested)(t,(t=>{const n=u(e,t,r);if(!n)throw new Error("Skolemized term is not in scope for this source");return n}));const n=u(e,t,r);if(null===n)throw new Error("Skolemized term is not in scope for this source");return n}t.SKOLEM_PREFIX="urn:comunica_skolem:source_",t.getSourceId=function(e,t){let r=e.get(t.referenceValue);return void 0===r&&(r=`${e.size}`,e.set(t.referenceValue,r)),r},t.skolemizeTerm=o,t.skolemizeQuad=s,t.skolemizeBindings=c,t.skolemizeQuadStream=function(e,t,r){const n=t.map((t=>s(e,t,r)));return function e(){t.getProperty("metadata",(t=>{n.setProperty("metadata",t),t.state.addInvalidateListener(e)}))}(),n},t.skolemizeBindingsStream=function(e,t,r){const n=t.map((t=>c(e,t,r)));return function e(){t.getProperty("metadata",(t=>{n.setProperty("metadata",t),t.state.addInvalidateListener(e)}))}(),n},t.deskolemizeTerm=u,t.deskolemizeTermNestedThrowing=l,t.deskolemizeQuad=function(e,t,r){return(0,i.mapTermsNested)(t,(t=>u(e,t,r)??t))},t.deskolemizeOperation=function(e,t,r){const n=new a.Factory;try{return a.Util.mapOperation(t,{[a.Algebra.types.PATTERN]:(t,n)=>({result:Object.assign(n.createPattern(l(e,t.subject,r),l(e,t.predicate,r),l(e,t.object,r),l(e,t.graph,r)),{metadata:t.metadata}),recurse:!1}),[a.Algebra.types.PATH]:(t,n)=>({result:Object.assign(n.createPath(l(e,t.subject,r),t.predicate,l(e,t.object,r),l(e,t.graph,r)),{metadata:t.metadata}),recurse:!1})},n)}catch{}}},78867:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorContextPreprocessSetDefaults=void 0;const n=r(98926),i=r(90711),a=r(90412),o=r(47793);class s extends n.ActorContextPreprocess{constructor(e){super(e),this.defaultFunctionArgumentsCache={}}async test(e){return(0,a.passTestVoid)()}async run(e){let t=e.context;if(e.initialize){t=t.setDefault(i.KeysInitQuery.queryTimestamp,new Date).setDefault(i.KeysInitQuery.queryTimestampHighResolution,performance.now()).setDefault(i.KeysQuerySourceIdentify.sourceIds,new Map).setDefault(i.KeysCore.log,this.logger).setDefault(i.KeysInitQuery.functionArgumentsCache,this.defaultFunctionArgumentsCache).setDefault(i.KeysQuerySourceIdentify.hypermediaSourcesAggregatedStores,new Map).setDefault(i.KeysInitQuery.dataFactory,new o.DataFactory);let e={language:"sparql",version:"1.1"};t.has(i.KeysInitQuery.queryFormat)?(e=t.get(i.KeysInitQuery.queryFormat),"graphql"===e.language&&(t=t.setDefault(i.KeysInitQuery.graphqlSingularizeVariables,{}))):t=t.set(i.KeysInitQuery.queryFormat,e)}return{context:t}}}t.ActorContextPreprocessSetDefaults=s},10607:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(78867),t)},36356:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorContextPreprocessSourceToDestination=void 0;const n=r(98926),i=r(90711),a=r(90412);class o extends n.ActorContextPreprocess{constructor(e){super(e)}async test(e){return(0,a.passTestVoid)()}async run(e){if(e.context.get(i.KeysInitQuery.querySourcesUnidentified)&&!e.context.get(i.KeysRdfUpdateQuads.destination)){const t=e.context.get(i.KeysInitQuery.querySourcesUnidentified);if(1===t.length)return{context:e.context.set(i.KeysRdfUpdateQuads.destination,t[0])}}return e}}t.ActorContextPreprocessSourceToDestination=o},94410:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(36356),t)},47:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorExpressionEvaluatorFactoryDefault=void 0;const n=r(37811),i=r(90711),a=r(90412),o=r(81926),s=r(77545),c=r(96607),u=r(61549);class l extends n.ActorExpressionEvaluatorFactory{constructor(e){super(e)}async test(e){return(0,a.passTestVoid)()}async run(e){const t=(0,s.prepareEvaluatorActionContext)(e.context);return new u.ExpressionEvaluator(t,await new c.AlgebraTransformer(t,this.mediatorFunctionFactory).transformAlgebra(e.algExpr),this.mediatorFunctionFactory,this.mediatorQueryOperation,await o.BindingsFactory.create(this.mediatorMergeBindingsContext,e.context,e.context.getSafe(i.KeysInitQuery.dataFactory)))}}t.ActorExpressionEvaluatorFactoryDefault=l},96607:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AlgebraTransformer=void 0;const n=r(90711),i=r(77545),a=r(96331);class o extends i.TermTransformer{constructor(e,t){super(e.getSafe(n.KeysExpressionEvaluator.superTypeProvider)),this.context=e,this.mediatorFunctionFactory=t}async transformAlgebra(e){const t=a.Algebra.expressionTypes;switch(e.expressionType){case t.TERM:return this.transformTerm(e);case t.OPERATOR:return await this.transformOperator(e);case t.NAMED:return await this.transformNamed(e);case t.EXISTENCE:return o.transformExistence(e);case t.AGGREGATE:return o.transformAggregate(e);case t.WILDCARD:return o.transformWildcard(e)}}static transformWildcard(e){return new i.NamedNode(e.wildcard.value)}async getOperator(e,t){const r=await this.mediatorFunctionFactory.mediate({functionName:e,arguments:t.args,context:this.context}),n=await Promise.all(t.args.map((e=>this.transformAlgebra(e))));if(!r.checkArity(n))throw new i.InvalidArity(n,e);return new i.Operator(e,n,r.apply)}async transformOperator(e){return this.getOperator(e.operator.toLowerCase(),e)}async transformNamed(e){return this.getOperator(e.name.value,e)}static transformAggregate(e){const t=e.aggregator;return new i.Aggregate(t,e)}static transformExistence(e){return new i.Existence(e)}}t.AlgebraTransformer=o},61549:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionEvaluator=void 0;const n=r(90711),i=r(74448);t.ExpressionEvaluator=class{constructor(e,t,r,n,a){this.context=e,this.expr=t,this.mediatorFunctionFactory=r,this.mediatorQueryOperation=n,this.bindingsFactory=a,this.internalEvaluator=new i.InternalEvaluator(e,r,n,a)}async evaluate(e){return(await this.internalEvaluator.evaluatorExpressionEvaluation(this.expr,e)).toRDF(this.context.getSafe(n.KeysInitQuery.dataFactory))}async evaluateAsEBV(e){return(await this.internalEvaluator.evaluatorExpressionEvaluation(this.expr,e)).coerceEBV()}evaluateAsEvaluatorExpression(e){return this.evaluatorExpressionEvaluation(this.expr,e)}evaluatorExpressionEvaluation(e,t){return this.internalEvaluator.evaluatorExpressionEvaluation(e,t)}}},74448:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InternalEvaluator=void 0;const n=r(90711),i=r(42996),a=r(77545),o=r(67021),s=r(96331),c=r(96607);t.InternalEvaluator=class{constructor(e,t,r,n){this.context=e,this.mediatorQueryOperation=r,this.bindingsFactory=n,this.subEvaluators={[i.ExpressionType.Term]:(e,t)=>this.term(e),[i.ExpressionType.Variable]:(e,t)=>this.variable(e,t),[i.ExpressionType.Operator]:(e,t)=>this.evalFunction(e,t),[i.ExpressionType.Existence]:(e,t)=>this.evalExistence(e,t),[i.ExpressionType.Aggregate]:(e,t)=>this.evalAggregate()},this.transformer=new c.AlgebraTransformer(e,t)}async evaluatorExpressionEvaluation(e,t){return this.subEvaluators[e.expressionType].bind(this)(e,t)}term(e){return e}variable(e,t){const r=t.get(a.expressionToVar(this.context.getSafe(n.KeysInitQuery.dataFactory),e));if(!r)throw new a.UnboundVariableError(e.name,t);return this.transformer.transformRDFTermUnsafe(r)}async evalFunction(e,t){return e.apply({args:e.args,mapping:t,exprEval:this})}async evalExistence(e,t){const r=this.context.getSafe(n.KeysInitQuery.dataFactory),i=new s.Factory(r),c=(0,o.materializeOperation)(e.expression.input,t,i,this.bindingsFactory),u=await this.mediatorQueryOperation.mediate({operation:c,context:this.context}),l=(0,o.getSafeBindings)(u);return await new Promise(((e,t)=>{l.bindingsStream.on("end",(()=>{e(!1)})),l.bindingsStream.on("error",t),l.bindingsStream.on("data",(()=>{l.bindingsStream.close(),e(!0)}))})).then((t=>e.expression.not?!t:t)).then((e=>new a.BooleanLiteral(e)))}evalAggregate(){throw new a.NoAggregator}}},76810:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(47),t)},69909:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryExpressionBnode=void 0;const n=r(77617),i=r(77545),a=r(5526);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.BNODE],termFunction:!1})}async run(e){return new a.ExpressionFunctionBnode}}t.ActorFunctionFactoryExpressionBnode=o},5526:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionFunctionBnode=void 0;const n=r(77617),i=r(90711),a=r(51296),o=r(77545);class s extends n.ExpressionFunctionBase{constructor(){super({arity:Number.POSITIVE_INFINITY,operator:o.SparqlOperator.BNODE,apply:async e=>{const{args:t,mapping:r,exprEval:n}=e,c=1===t.length?await n.evaluatorExpressionEvaluation(t[0],r):void 0;let u;if(c){const e=s.bnodeTree.search([c],n.context.getSafe(i.KeysExpressionEvaluator.superTypeProvider),n.context.getSafe(i.KeysInitQuery.functionArgumentsCache));if(!e)throw new o.InvalidArgumentTypes(t,o.SparqlOperator.BNODE);u=e(n)([c]).str()}const l=new a.BlankNodeBindingsScoped(u??"BNODE_"+s.bnodeCounter++);return new o.BlankNode(l)}})}checkArity(e){return 0===e.length||1===e.length}}t.ExpressionFunctionBnode=s,s.bnodeTree=(0,o.declare)(o.SparqlOperator.BNODE).onString1((()=>e=>e)).collect(),s.bnodeCounter=0},52598:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(69909),t)},26357:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryExpressionBound=void 0;const n=r(77617),i=r(77545),a=r(72818);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.BOUND],termFunction:!1})}async run(e){return new a.ExpressionFunctionBound}}t.ActorFunctionFactoryExpressionBound=o},72818:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionFunctionBound=void 0;const n=r(77617),i=r(90711),a=r(42996),o=r(77545);class s extends n.ExpressionFunctionBase{constructor(){super({arity:1,operator:o.SparqlOperator.BOUND,apply:async({args:e,mapping:t,exprEval:r})=>{const n=e[0];if(n.expressionType!==a.ExpressionType.Variable)throw new o.InvalidArgumentTypes(e,o.SparqlOperator.BOUND);const s=t.has((0,o.expressionToVar)(r.context.getSafe(i.KeysInitQuery.dataFactory),n));return(0,o.bool)(s)}})}}t.ExpressionFunctionBound=s},19856:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(26357),t)},26615:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryExpressionCoalesce=void 0;const n=r(77617),i=r(77545),a=r(67626);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.COALESCE],termFunction:!1})}async run(e){return new a.ExpressionFunctionCoalesce}}t.ActorFunctionFactoryExpressionCoalesce=o},67626:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionFunctionCoalesce=void 0;const n=r(77617),i=r(77545);class a extends n.ExpressionFunctionBase{constructor(){super({arity:Number.POSITIVE_INFINITY,operator:i.SparqlOperator.COALESCE,apply:async({args:e,mapping:t,exprEval:r})=>{const n=[];for(const i of e)try{return await r.evaluatorExpressionEvaluation(i,t)}catch(e){n.push(e)}throw new i.CoalesceError(n)}})}}t.ExpressionFunctionCoalesce=a},4475:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(26615),t)},89349:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryExpressionConcat=void 0;const n=r(77617),i=r(77545),a=r(73392);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.CONCAT],termFunction:!1})}async run(e){return new a.ExpressionFunctionConcat}}t.ActorFunctionFactoryExpressionConcat=o},73392:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionFunctionConcat=void 0;const n=r(77617),i=r(90711),a=r(77545);class o extends n.ExpressionFunctionBase{constructor(){super({arity:Number.POSITIVE_INFINITY,operator:a.SparqlOperator.CONCAT,apply:async e=>{const{args:t,mapping:r,exprEval:n}=e,s=t.map((async e=>n.evaluatorExpressionEvaluation(e,r))).map((async e=>{const r=o.concatTree.search([await e],n.context.getSafe(i.KeysExpressionEvaluator.superTypeProvider),n.context.getSafe(i.KeysInitQuery.functionArgumentsCache));if(!r)throw new a.InvalidArgumentTypes(t,a.SparqlOperator.CONCAT);return r(n)([await e])})),c=await Promise.all(s),u=c.map((e=>e.typedValue)).join(""),l=o.langAllEqual(c)?c[0].language:void 0;return l?(0,a.langString)(u,l):(0,a.string)(u)}})}static langAllEqual(e){return e.length>0&&e.every((t=>t.language===e[0].language))}}t.ExpressionFunctionConcat=o,o.concatTree=(0,a.declare)(a.SparqlOperator.CONCAT).onStringly1((()=>e=>e)).collect()},85312:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(89349),t)},40589:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryExpressionExtensions=void 0;const n=r(77617),i=r(90711),a=r(90412),o=r(47793),s=r(71742);class c extends n.ActorFunctionFactory{constructor(e){super(e)}async test({context:e,functionName:t}){const r=e.getSafe(i.KeysExpressionEvaluator.extensionFunctionCreator);return await r((new o.DataFactory).namedNode(t))?(0,a.passTestVoid)():(0,a.failTest)(`Actor ${this.name} can only provide non-termExpression implementations for functions that are provided through config entries like: ${i.KeysInitQuery.extensionFunctionCreator.name} or ${i.KeysInitQuery.extensionFunctions.name}`)}async run({context:e,functionName:t}){const r=e.getSafe(i.KeysExpressionEvaluator.extensionFunctionCreator),n=await r((new o.DataFactory).namedNode(t));return new s.NamedExtension({operator:t,functionDefinition:n})}}t.ActorFunctionFactoryExpressionExtensions=c},71742:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NamedExtension=void 0;const n=r(5673),i=r(90711),a=r(77545);class o extends n.ExpressionFunctionBase{constructor({operator:e,functionDefinition:t}){super({arity:Number.POSITIVE_INFINITY,operator:e,apply:async({args:e,exprEval:r,mapping:n})=>{const o=await Promise.all(e.map((e=>r.evaluatorExpressionEvaluation(e,n))));try{return new a.TermTransformer(r.context.getSafe(i.KeysExpressionEvaluator.superTypeProvider)).transformRDFTermUnsafe(await t(o.map((e=>e.toRDF(r.context.getSafe(i.KeysInitQuery.dataFactory))))))}catch(e){throw new a.ExtensionFunctionError(this.operator,e)}}})}}t.NamedExtension=o},66478:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(40589),t)},68435:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryExpressionIf=void 0;const n=r(77617),i=r(77545),a=r(20550);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.IF],termFunction:!1})}async run(e){return new a.ExpressionFunctionIf}}t.ActorFunctionFactoryExpressionIf=o},20550:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionFunctionIf=void 0;const n=r(77617),i=r(77545);class a extends n.ExpressionFunctionBase{constructor(){super({arity:3,operator:i.SparqlOperator.IF,apply:async({args:e,mapping:t,exprEval:r})=>(await r.evaluatorExpressionEvaluation(e[0],t)).coerceEBV()?r.evaluatorExpressionEvaluation(e[1],t):r.evaluatorExpressionEvaluation(e[2],t)})}}t.ExpressionFunctionIf=a},40767:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(68435),t)},16883:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryExpressionIn=void 0;const n=r(77617),i=r(77545),a=r(7190);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.IN],termFunction:!1}),this.mediatorFunctionFactory=e.mediatorFunctionFactory}async run(e){const t=await this.mediatorFunctionFactory.mediate({functionName:i.SparqlOperator.EQUAL,requireTermExpression:!0,context:e.context,arguments:e.arguments});return new a.ExpressionFunctionIn(t)}}t.ActorFunctionFactoryExpressionIn=o},7190:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionFunctionIn=void 0;const n=r(77617),i=r(77545);class a extends n.ExpressionFunctionBase{constructor(e){super({arity:Number.POSITIVE_INFINITY,operator:i.SparqlOperator.IN,apply:async e=>{const{args:t,mapping:r,exprEval:n}=e,[i,...a]=t,o=await n.evaluatorExpressionEvaluation(i,r);return await this.inRecursive(o,{...e,args:a},[])}}),this.equalityFunction=e}checkArity(e){return e.length>0}async inRecursive(e,t,r){const{args:n,mapping:a,exprEval:o}=t;if(0===n.length)return r.every((e=>!e))?(0,i.bool)(!1):Promise.reject(new i.InError(r));try{const s=n.shift(),c=await o.evaluatorExpressionEvaluation(s,a);return this.equalityFunction.applyOnTerms([e,c],o).typedValue?(0,i.bool)(!0):this.inRecursive(e,t,[...r,!1])}catch(n){return this.inRecursive(e,t,[...r,n])}}}t.ExpressionFunctionIn=a},94311:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(16883),t)},19464:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryExpressionLogicalAnd=void 0;const n=r(77617),i=r(77545),a=r(60677);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.LOGICAL_AND],termFunction:!1})}async run(e){return new a.ExpressionFunctionLogicalAnd}}t.ActorFunctionFactoryExpressionLogicalAnd=o},60677:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionFunctionLogicalAnd=void 0;const n=r(77617),i=r(77545);class a extends n.ExpressionFunctionBase{constructor(){super({arity:2,operator:i.SparqlOperator.LOGICAL_AND,apply:async({args:e,mapping:t,exprEval:r})=>{const[n,a]=e;try{if(!(await r.evaluatorExpressionEvaluation(n,t)).coerceEBV())return(0,i.bool)(!1);const e=(await r.evaluatorExpressionEvaluation(a,t)).coerceEBV();return(0,i.bool)(e)}catch(e){if((await r.evaluatorExpressionEvaluation(a,t)).coerceEBV())throw e;return(0,i.bool)(!1)}}})}}t.ExpressionFunctionLogicalAnd=a},12067:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(19464),t)},30872:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryExpressionLogicalOr=void 0;const n=r(77617),i=r(77545),a=r(40883);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.LOGICAL_OR],termFunction:!1})}async run(e){return new a.ExpressionFunctionLogicalOr}}t.ActorFunctionFactoryExpressionLogicalOr=o},40883:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionFunctionLogicalOr=void 0;const n=r(77617),i=r(77545);class a extends n.ExpressionFunctionBase{constructor(){super({arity:2,operator:i.SparqlOperator.LOGICAL_OR,apply:async({args:e,mapping:t,exprEval:r})=>{const[n,a]=e;try{if((await r.evaluatorExpressionEvaluation(n,t)).coerceEBV())return(0,i.bool)(!0);const e=(await r.evaluatorExpressionEvaluation(a,t)).coerceEBV();return(0,i.bool)(e)}catch(e){if(!(await r.evaluatorExpressionEvaluation(a,t)).coerceEBV())throw e;return(0,i.bool)(!0)}}})}}t.ExpressionFunctionLogicalOr=a},1223:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(30872),t)},29832:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryExpressionNotIn=void 0;const n=r(77617),i=r(77545),a=r(5743);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.NOT_IN],termFunction:!1}),this.mediatorFunctionFactory=e.mediatorFunctionFactory}async run(e){const t=await this.mediatorFunctionFactory.mediate({functionName:i.SparqlOperator.IN,context:e.context,arguments:e.arguments});return new a.ExpressionFunctionNotIn(t)}}t.ActorFunctionFactoryExpressionNotIn=o},5743:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionFunctionNotIn=void 0;const n=r(77617),i=r(77545);class a extends n.ExpressionFunctionBase{constructor(e){super({arity:Number.POSITIVE_INFINITY,operator:i.SparqlOperator.NOT_IN,apply:async e=>{const t=await this.inFunction.apply(e);return(0,i.bool)(!t.typedValue)}}),this.inFunction=e}checkArity(e){return e.length>0}}t.ExpressionFunctionNotIn=a},63067:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(29832),t)},86652:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryExpressionSameTerm=void 0;const n=r(77617),i=r(77545),a=r(72253);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.SAME_TERM],termFunction:!1})}async run(e){return new a.ExpressionFunctionSameTerm}}t.ActorFunctionFactoryExpressionSameTerm=o},72253:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionFunctionSameTerm=void 0;const n=r(77617),i=r(90711),a=r(77545);class o extends n.ExpressionFunctionBase{constructor(){super({arity:2,operator:a.SparqlOperator.SAME_TERM,apply:async({args:e,mapping:t,exprEval:r})=>{const n=r.context.getSafe(i.KeysInitQuery.dataFactory),[o,s]=e.map((e=>r.evaluatorExpressionEvaluation(e,t))),[c,u]=await Promise.all([o,s]);return(0,a.bool)(c.toRDF(n).equals(u.toRDF(n)))}})}}t.ExpressionFunctionSameTerm=o},14579:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(86652),t)},46645:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermAbs=void 0;const n=r(77617),i=r(77545),a=r(54502);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.ABS],termFunction:!0})}async run(e){return new a.TermFunctionAbs}}t.ActorFunctionFactoryTermAbs=o},54502:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionAbs=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.ABS,overloads:(0,i.declare)(i.SparqlOperator.ABS).numericConverter((()=>e=>Math.abs(e))).collect()})}}t.TermFunctionAbs=a},59812:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(46645),t)},65569:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermAddition=void 0;const n=r(77617),i=r(77545),a=r(55940);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.ADDITION],termFunction:!0})}async run(e){return new a.TermFunctionAddition}}t.ActorFunctionFactoryTermAddition=o},55940:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionAddition=void 0;const n=r(77617),i=r(77545),a=r(61594);class o extends n.TermFunctionBase{constructor(){super({arity:2,operator:i.SparqlOperator.ADDITION,overloads:(0,i.declare)(i.SparqlOperator.ADDITION).arithmetic((()=>(e,t)=>new a.BigNumber(e).plus(t).toNumber())).set([i.TypeURL.XSD_DATE_TIME,i.TypeURL.XSD_DAY_TIME_DURATION],(()=>([e,t])=>new i.DateTimeLiteral((0,i.addDurationToDateTime)(e.typedValue,(0,i.defaultedDurationRepresentation)(t.typedValue))))).copy({from:[i.TypeURL.XSD_DATE_TIME,i.TypeURL.XSD_DAY_TIME_DURATION],to:[i.TypeURL.XSD_DATE_TIME,i.TypeURL.XSD_YEAR_MONTH_DURATION]}).set([i.TypeURL.XSD_DATE,i.TypeURL.XSD_DAY_TIME_DURATION],(()=>([e,t])=>new i.DateLiteral((0,i.addDurationToDateTime)((0,i.defaultedDateTimeRepresentation)(e.typedValue),(0,i.defaultedDurationRepresentation)(t.typedValue))))).copy({from:[i.TypeURL.XSD_DATE,i.TypeURL.XSD_DAY_TIME_DURATION],to:[i.TypeURL.XSD_DATE,i.TypeURL.XSD_YEAR_MONTH_DURATION]}).set([i.TypeURL.XSD_TIME,i.TypeURL.XSD_DAY_TIME_DURATION],(()=>([e,t])=>new i.TimeLiteral((0,i.addDurationToDateTime)((0,i.defaultedDateTimeRepresentation)(e.typedValue),(0,i.defaultedDurationRepresentation)(t.typedValue))))).copy({from:[i.TypeURL.XSD_TIME,i.TypeURL.XSD_DAY_TIME_DURATION],to:[i.TypeURL.XSD_TIME,i.TypeURL.XSD_YEAR_MONTH_DURATION]}).collect()})}}t.TermFunctionAddition=o},91172:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(65569),t)},5935:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermCeil=void 0;const n=r(77617),i=r(77545),a=r(47882);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.CEIL],termFunction:!0})}async run(e){return new a.TermFunctionCeil}}t.ActorFunctionFactoryTermCeil=o},47882:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionCeil=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.CEIL,overloads:(0,i.declare)(i.SparqlOperator.CEIL).numericConverter((()=>e=>Math.ceil(e))).collect()})}}t.TermFunctionCeil=a},30953:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(5935),t)},5847:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermContains=void 0;const n=r(77617),i=r(77545),a=r(97114);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.CONTAINS],termFunction:!0})}async run(e){return new a.TermFunctionContains}}t.ActorFunctionFactoryTermContains=o},97114:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionContains=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:2,operator:i.SparqlOperator.CONTAINS,overloads:(0,i.declare)(i.SparqlOperator.CONTAINS).onBinaryTyped([i.TypeAlias.SPARQL_STRINGLY,i.TypeURL.XSD_STRING],(()=>(e,t)=>(0,i.bool)(e.includes(t)))).onBinary([i.TypeURL.RDF_LANG_STRING,i.TypeURL.RDF_LANG_STRING],(()=>(e,t)=>{if(e.language!==t.language)throw new i.IncompatibleLanguageOperation(e,t);return(0,i.bool)(e.typedValue.includes(t.typedValue))})).collect()})}}t.TermFunctionContains=a},72945:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(5847),t)},17569:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermDatatype=void 0;const n=r(77617),i=r(77545),a=r(62944);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.DATATYPE],termFunction:!0})}async run(e){return new a.TermFunctionDatatype}}t.ActorFunctionFactoryTermDatatype=o},62944:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionDatatype=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.DATATYPE,overloads:(0,i.declare)(i.SparqlOperator.DATATYPE).onLiteral1((()=>e=>new i.NamedNode(e.dataType))).collect()})}}t.TermFunctionDatatype=a},24700:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(17569),t)},70177:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermDay=void 0;const n=r(77617),i=r(77545),a=r(9430);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.DAY],termFunction:!0})}async run(e){return new a.TermFunctionDay}}t.ActorFunctionFactoryTermDay=o},9430:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionDay=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.DAY,overloads:(0,i.declare)(i.SparqlOperator.DAY).onDateTime1((()=>e=>(0,i.integer)(e.typedValue.day))).set([i.TypeURL.XSD_DATE],(()=>([e])=>(0,i.integer)(e.typedValue.day))).collect()})}}t.TermFunctionDay=a},99778:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(70177),t)},11867:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermDivision=void 0;const n=r(77617),i=r(77545),a=r(39878);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.DIVISION],termFunction:!0})}async run(e){return new a.TermFunctionDivision}}t.ActorFunctionFactoryTermDivision=o},39878:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionDivision=void 0;const n=r(77617),i=r(77545),a=r(61594);class o extends n.TermFunctionBase{constructor(){super({arity:2,operator:i.SparqlOperator.DIVISION,overloads:(0,i.declare)(i.SparqlOperator.DIVISION).arithmetic((()=>(e,t)=>new a.BigNumber(e).div(t).toNumber())).onBinaryTyped([i.TypeURL.XSD_INTEGER,i.TypeURL.XSD_INTEGER],(()=>(e,t)=>{if(0===t)throw new i.ExpressionError("Integer division by 0");return(0,i.decimal)(new a.BigNumber(e).div(t).toNumber())})).collect()})}}t.TermFunctionDivision=o},61103:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(11867),t)},27749:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermEncodeForUri=void 0;const n=r(77617),i=r(77545),a=r(1144);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.ENCODE_FOR_URI],termFunction:!0})}async run(e){return new a.TermFunctionEncodeForUri}}t.ActorFunctionFactoryTermEncodeForUri=o},1144:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionEncodeForUri=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.ENCODE_FOR_URI,overloads:(0,i.declare)(i.SparqlOperator.ENCODE_FOR_URI).onStringly1Typed((()=>e=>(0,i.string)(encodeURI(e)))).collect()})}}t.TermFunctionEncodeForUri=a},30971:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(27749),t)},23129:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermEquality=void 0;const n=r(77617),i=r(77545),a=r(60856);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.EQUAL],termFunction:!0})}async run(e){return new a.TermFunctionEquality}}t.ActorFunctionFactoryTermEquality=o},60856:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionEquality=void 0;const n=r(77617),i=r(90711),a=r(77545);class o extends n.TermFunctionBase{constructor(){super({arity:2,operator:a.SparqlOperator.EQUAL,overloads:(0,a.declare)(a.SparqlOperator.EQUAL).numberTest((()=>(e,t)=>e===t)).stringTest((()=>(e,t)=>0===e.localeCompare(t))).set([a.TypeURL.RDF_LANG_STRING,a.TypeURL.RDF_LANG_STRING],(()=>([e,t])=>(0,a.bool)(e.str()===t.str()&&e.language===t.language))).set([a.TypeAlias.SPARQL_STRINGLY,a.TypeAlias.SPARQL_STRINGLY],(()=>()=>(0,a.bool)(!1))).booleanTest((()=>(e,t)=>e===t)).dateTimeTest((e=>(t,r)=>(0,a.toUTCDate)(t,e.context.getSafe(i.KeysExpressionEvaluator.defaultTimeZone)).getTime()===(0,a.toUTCDate)(r,e.context.getSafe(i.KeysExpressionEvaluator.defaultTimeZone)).getTime())).copy({from:[a.TypeURL.XSD_DATE_TIME,a.TypeURL.XSD_DATE_TIME],to:[a.TypeURL.XSD_DATE,a.TypeURL.XSD_DATE]}).set(["quad","quad"],(e=>([t,r])=>(0,a.bool)(this.applyOnTerms([t.subject,r.subject],e).coerceEBV()&&this.applyOnTerms([t.predicate,r.predicate],e).coerceEBV()&&this.applyOnTerms([t.object,r.object],e).coerceEBV()&&this.applyOnTerms([t.graph,r.graph],e).coerceEBV())),!1).set(["term","term"],(e=>([t,r])=>{const n=t.toRDF(e.context.getSafe(i.KeysInitQuery.dataFactory)),o=r.toRDF(e.context.getSafe(i.KeysInitQuery.dataFactory)),s=n.equals(o);if(!s&&"Literal"===n.termType&&"Literal"===o.termType)throw new a.RDFEqualTypeError([t,r]);return(0,a.bool)(s)}),!1).set([a.TypeURL.XSD_DURATION,a.TypeURL.XSD_DURATION],(()=>([e,t])=>(0,a.bool)((0,a.yearMonthDurationsToMonths)((0,a.defaultedYearMonthDurationRepresentation)(e.typedValue))===(0,a.yearMonthDurationsToMonths)((0,a.defaultedYearMonthDurationRepresentation)(t.typedValue))&&(0,a.dayTimeDurationsToSeconds)((0,a.defaultedDayTimeDurationRepresentation)(e.typedValue))===(0,a.dayTimeDurationsToSeconds)((0,a.defaultedDayTimeDurationRepresentation)(t.typedValue))))).set([a.TypeURL.XSD_TIME,a.TypeURL.XSD_TIME],(e=>([t,r])=>(0,a.bool)((0,a.toUTCDate)((0,a.defaultedDateTimeRepresentation)(t.typedValue),e.context.getSafe(i.KeysExpressionEvaluator.defaultTimeZone)).getTime()===(0,a.toUTCDate)((0,a.defaultedDateTimeRepresentation)(r.typedValue),e.context.getSafe(i.KeysExpressionEvaluator.defaultTimeZone)).getTime()))).collect()})}}t.TermFunctionEquality=o},61688:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(23129),t)},3129:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermFloor=void 0;const n=r(77617),i=r(77545),a=r(57834);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.FLOOR],termFunction:!0})}async run(e){return new a.TermFunctionFloor}}t.ActorFunctionFactoryTermFloor=o},57834:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionFloor=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.FLOOR,overloads:(0,i.declare)(i.SparqlOperator.FLOOR).numericConverter((()=>e=>Math.floor(e))).collect()})}}t.TermFunctionFloor=a},56718:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(3129),t)},33823:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermGreaterThanEqual=void 0;const n=r(77617),i=r(77545),a=r(40178);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.GTE],termFunction:!0}),this.mediatorFunctionFactory=e.mediatorFunctionFactory}async run(e){const t=await this.mediatorFunctionFactory.mediate({functionName:i.SparqlOperator.LTE,requireTermExpression:!0,context:e.context,arguments:e.arguments});return new a.TermFunctionGreaterThanEqual(t)}}t.ActorFunctionFactoryTermGreaterThanEqual=o},40178:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionGreaterThanEqual=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(e){super({arity:2,operator:i.SparqlOperator.GTE,overloads:(0,i.declare)(i.SparqlOperator.GTE).set(["term","term"],(e=>([t,r])=>this.lessThanEqualFunction.applyOnTerms([r,t],e))).collect()}),this.lessThanEqualFunction=e}}t.TermFunctionGreaterThanEqual=a},8711:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(33823),t)},70982:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermGreaterThan=void 0;const n=r(77617),i=r(77545),a=r(81253);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.GT],termFunction:!0}),this.mediatorFunctionFactory=e.mediatorFunctionFactory}async run(e){const t=await this.mediatorFunctionFactory.mediate({functionName:i.SparqlOperator.LT,requireTermExpression:!0,context:e.context,arguments:e.arguments});return new a.TermFunctionGreaterThan(t)}}t.ActorFunctionFactoryTermGreaterThan=o},81253:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionGreaterThan=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(e){super({arity:2,operator:i.SparqlOperator.GT,overloads:(0,i.declare)(i.SparqlOperator.GT).set(["term","term"],(e=>([t,r])=>this.lessThanFunction.applyOnTerms([r,t],e))).collect()}),this.lessThanFunction=e}}t.TermFunctionGreaterThan=a},31038:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(70982),t)},60385:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermHours=void 0;const n=r(77617),i=r(77545),a=r(74230);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.HOURS],termFunction:!0})}async run(e){return new a.TermFunctionHours}}t.ActorFunctionFactoryTermHours=o},74230:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionHours=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.HOURS,overloads:(0,i.declare)(i.SparqlOperator.HOURS).onDateTime1((()=>e=>(0,i.integer)(e.typedValue.hours))).set([i.TypeURL.XSD_TIME],(()=>([e])=>(0,i.integer)(e.typedValue.hours))).collect()})}}t.TermFunctionHours=a},54531:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(60385),t)},15195:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermInequality=void 0;const n=r(77617),i=r(77545),a=r(1530);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.NOT_EQUAL],termFunction:!0}),this.mediatorFunctionFactory=e.mediatorFunctionFactory}async run(e){const t=await this.mediatorFunctionFactory.mediate({functionName:i.SparqlOperator.EQUAL,requireTermExpression:!0,context:e.context,arguments:e.arguments});return new a.TermFunctionInequality(t)}}t.ActorFunctionFactoryTermInequality=o},1530:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionInequality=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(e){super({arity:2,operator:i.SparqlOperator.NOT_EQUAL,overloads:(0,i.declare)(i.SparqlOperator.NOT_EQUAL).set(["term","term"],(e=>([t,r])=>(0,i.bool)(!this.equalityFunction.applyOnTerms([t,r],e).typedValue))).collect()}),this.equalityFunction=e}}t.TermFunctionInequality=a},76695:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(15195),t)},73481:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermIri=void 0;const n=r(77617),i=r(77545),a=r(58006);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.IRI,i.SparqlOperator.URI],termFunction:!0})}async run(e){return new a.TermFunctionIri}}t.ActorFunctionFactoryTermIri=o},58006:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionIri=void 0;const n=r(77617),i=r(90711),a=r(77545),o=r(70742);class s extends n.TermFunctionBase{constructor(){super({arity:1,operator:a.SparqlOperator.IRI,overloads:(0,a.declare)(a.SparqlOperator.IRI).set(["namedNode"],(e=>t=>{const r=t[0],n=(0,o.resolve)(r.str(),e.context.get(i.KeysInitQuery.baseIRI)??"");return new a.NamedNode(n)})).onString1((e=>t=>{const r=(0,o.resolve)(t.str(),e.context.get(i.KeysInitQuery.baseIRI)??"");return new a.NamedNode(r)})).collect()})}}t.TermFunctionIri=s},16686:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(73481),t)},67528:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermIsBlank=void 0;const n=r(77617),i=r(77545),a=r(89195);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.IS_BLANK],termFunction:!0})}async run(e){return new a.TermFunctionIsBlank}}t.ActorFunctionFactoryTermIsBlank=o},89195:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionIsBlank=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.IS_BLANK,overloads:(0,i.declare)(i.SparqlOperator.IS_BLANK).onTerm1((()=>e=>(0,i.bool)("blankNode"===e.termType))).collect()})}}t.TermFunctionIsBlank=a},92959:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(67528),t)},4136:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermIsIri=void 0;const n=r(77617),i=r(77545),a=r(3035);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.IS_IRI,i.SparqlOperator.IS_URI],termFunction:!0})}async run(e){return new a.TermFunctionIsIri}}t.ActorFunctionFactoryTermIsIri=o},3035:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionIsIri=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.IS_IRI,overloads:(0,i.declare)(i.SparqlOperator.IS_IRI).onTerm1((()=>e=>(0,i.bool)("namedNode"===e.termType))).collect()})}}t.TermFunctionIsIri=a},11767:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4136),t)},40236:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermIsLiteral=void 0;const n=r(77617),i=r(77545),a=r(92615);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.IS_LITERAL],termFunction:!0})}async run(e){return new a.TermFunctionIsLiteral}}t.ActorFunctionFactoryTermIsLiteral=o},92615:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionIsLiteral=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.IS_LITERAL,overloads:(0,i.declare)(i.SparqlOperator.IS_LITERAL).onTerm1((()=>e=>(0,i.bool)("literal"===e.termType))).collect()})}}t.TermFunctionIsLiteral=a},30254:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(40236),t)},50620:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermIsNumeric=void 0;const n=r(77617),i=r(77545),a=r(77415);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.IS_NUMERIC],termFunction:!0})}async run(e){return new a.TermFunctionIsNumeric}}t.ActorFunctionFactoryTermIsNumeric=o},77415:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionIsNumeric=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.IS_NUMERIC,overloads:(0,i.declare)(i.SparqlOperator.IS_NUMERIC).onNumeric1((()=>()=>(0,i.bool)(!0))).onTerm1((()=>()=>(0,i.bool)(!1))).collect()})}}t.TermFunctionIsNumeric=a},6082:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(50620),t)},11304:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermIsTriple=void 0;const n=r(77617),i=r(77545),a=r(99669);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.IS_TRIPLE],termFunction:!0})}async run(e){return new a.TermFunctionIsTriple}}t.ActorFunctionFactoryTermIsTriple=o},99669:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionIsTriple=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.IS_TRIPLE,overloads:(0,i.declare)(i.SparqlOperator.IS_TRIPLE).onTerm1((()=>e=>(0,i.bool)("quad"===e.termType))).collect()})}}t.TermFunctionIsTriple=a},61151:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(11304),t)},25337:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermLang=void 0;const n=r(77617),i=r(77545),a=r(41420);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.LANG],termFunction:!0})}async run(e){return new a.TermFunctionLang}}t.ActorFunctionFactoryTermLang=o},41420:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionLang=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.LANG,overloads:(0,i.declare)(i.SparqlOperator.LANG).onLiteral1((()=>e=>(0,i.string)(e.language??""))).collect()})}}t.TermFunctionLang=a},33032:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(25337),t)},30393:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermLangmatches=void 0;const n=r(77617),i=r(77545),a=r(42586);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.LANG_MATCHES],termFunction:!0})}async run(e){return new a.TermFunctionLangmatches}}t.ActorFunctionFactoryTermLangmatches=o},42586:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionLangmatches=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:2,operator:i.SparqlOperator.LANG_MATCHES,overloads:(0,i.declare)(i.SparqlOperator.LANG_MATCHES).onBinaryTyped([i.TypeURL.XSD_STRING,i.TypeURL.XSD_STRING],(()=>(e,t)=>(0,i.bool)(a.langMatches(e,t)))).collect()})}static langMatches(e,t){const r=e.split("-"),n=t.split("-");if(!a.matchLangTag(n[0],r[0])&&!a.isWildCard(r[0]))return!1;let i=1,o=1;for(;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermLcase=void 0;const n=r(77617),i=r(77545),a=r(60770);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.LCASE],termFunction:!0})}async run(e){return new a.TermFunctionLcase}}t.ActorFunctionFactoryTermLcase=o},60770:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionLcase=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.LCASE,overloads:(0,i.declare)(i.SparqlOperator.LCASE).onString1Typed((()=>e=>(0,i.string)(e.toLowerCase()))).onLangString1((()=>e=>(0,i.langString)(e.typedValue.toLowerCase(),e.language))).collect()})}}t.TermFunctionLcase=a},22460:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(85181),t)},89:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermLesserThanEqual=void 0;const n=r(77617),i=r(77545),a=r(7246);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.LTE],termFunction:!0}),this.mediatorFunctionFactory=e.mediatorFunctionFactory}async run(e){const t=await this.mediatorFunctionFactory.mediate({functionName:i.SparqlOperator.EQUAL,requireTermExpression:!0,context:e.context,arguments:e.arguments}),r=await this.mediatorFunctionFactory.mediate({functionName:i.SparqlOperator.LT,requireTermExpression:!0,context:e.context,arguments:e.arguments});return new a.TermFunctionLesserThanEqual(t,r)}}t.ActorFunctionFactoryTermLesserThanEqual=o},7246:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionLesserThanEqual=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(e,t){super({arity:2,operator:i.SparqlOperator.LTE,overloads:(0,i.declare)(i.SparqlOperator.LTE).set(["term","term"],(e=>([t,r])=>(0,i.bool)(this.lessThanFunction.applyOnTerms([t,r],e).typedValue||this.equalityFunction.applyOnTerms([t,r],e).typedValue))).collect()}),this.equalityFunction=e,this.lessThanFunction=t}}t.TermFunctionLesserThanEqual=a},38507:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(89),t)},41142:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermLesserThan=void 0;const n=r(77617),i=r(77545),a=r(95199);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.LT],termFunction:!0}),this.mediatorFunctionFactory=e.mediatorFunctionFactory}async run(e){const t=await this.mediatorFunctionFactory.mediate({functionName:i.SparqlOperator.EQUAL,requireTermExpression:!0,context:e.context,arguments:e.arguments});return new a.TermFunctionLesserThan(t)}}t.ActorFunctionFactoryTermLesserThan=o},95199:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionLesserThan=void 0;const n=r(77617),i=r(90711),a=r(77545);class o extends n.TermFunctionBase{constructor(e){super({arity:2,operator:a.SparqlOperator.LT,overloads:(0,a.declare)(a.SparqlOperator.LT).numberTest((()=>(e,t)=>e(e,t)=>-1===e.localeCompare(t))).booleanTest((()=>(e,t)=>e(t,r)=>(0,a.toUTCDate)(t,e.context.getSafe(i.KeysExpressionEvaluator.defaultTimeZone)).getTime()<(0,a.toUTCDate)(r,e.context.getSafe(i.KeysExpressionEvaluator.defaultTimeZone)).getTime())).copy({from:[a.TypeURL.XSD_DATE_TIME,a.TypeURL.XSD_DATE_TIME],to:[a.TypeURL.XSD_DATE,a.TypeURL.XSD_DATE]}).set([a.TypeURL.XSD_YEAR_MONTH_DURATION,a.TypeURL.XSD_YEAR_MONTH_DURATION],(()=>([e,t])=>(0,a.bool)((0,a.yearMonthDurationsToMonths)((0,a.defaultedYearMonthDurationRepresentation)(e.typedValue))<(0,a.yearMonthDurationsToMonths)((0,a.defaultedYearMonthDurationRepresentation)(t.typedValue))))).set([a.TypeURL.XSD_DAY_TIME_DURATION,a.TypeURL.XSD_DAY_TIME_DURATION],(()=>([e,t])=>(0,a.bool)((0,a.dayTimeDurationsToSeconds)((0,a.defaultedDayTimeDurationRepresentation)(e.typedValue))<(0,a.dayTimeDurationsToSeconds)((0,a.defaultedDayTimeDurationRepresentation)(t.typedValue))))).set([a.TypeURL.XSD_TIME,a.TypeURL.XSD_TIME],(e=>([t,r])=>(0,a.bool)((0,a.toUTCDate)((0,a.defaultedDateTimeRepresentation)(t.typedValue),e.context.getSafe(i.KeysExpressionEvaluator.defaultTimeZone)).getTime()<(0,a.toUTCDate)((0,a.defaultedDateTimeRepresentation)(r.typedValue),e.context.getSafe(i.KeysExpressionEvaluator.defaultTimeZone)).getTime()))).set(["quad","quad"],(e=>([t,r])=>{const n=this.quadComponentTest(t.subject,r.subject,e);if(void 0!==n)return(0,a.bool)(n);const i=this.quadComponentTest(t.predicate,r.predicate,e);if(void 0!==i)return(0,a.bool)(i);const o=this.quadComponentTest(t.object,r.object,e);return void 0!==o?(0,a.bool)(o):(0,a.bool)(this.quadComponentTest(t.graph,r.graph,e)??!1)}),!1).collect()}),this.equalityFunction=e}quadComponentTest(e,t,r){if(!this.equalityFunction.applyOnTerms([e,t],r).typedValue)return this.applyOnTerms([e,t],r).typedValue}}t.TermFunctionLesserThan=o},95426:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(41142),t)},20405:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermMd5=void 0;const n=r(77617),i=r(77545),a=r(64826);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.MD5],termFunction:!0})}async run(e){return new a.TermFunctionMd5}}t.ActorFunctionFactoryTermMd5=o},64826:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionMd5=void 0;const n=r(77617),i=r(77545),a=r(75735);class o extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.MD5,overloads:(0,i.declare)(i.SparqlOperator.MD5).onString1Typed((()=>e=>(0,i.string)((0,a.hash)(e)))).collect()})}}t.TermFunctionMd5=o},12744:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(20405),t)},74577:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermMinutes=void 0;const n=r(77617),i=r(77545),a=r(84906);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.MINUTES],termFunction:!0})}async run(e){return new a.TermFunctionMinutes}}t.ActorFunctionFactoryTermMinutes=o},84906:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionMinutes=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.MINUTES,overloads:(0,i.declare)(i.SparqlOperator.MINUTES).onDateTime1((()=>e=>(0,i.integer)(e.typedValue.minutes))).set([i.TypeURL.XSD_TIME],(()=>([e])=>(0,i.integer)(e.typedValue.minutes))).collect()})}}t.TermFunctionMinutes=a},24713:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(74577),t)},62489:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermMonth=void 0;const n=r(77617),i=r(77545),a=r(78490);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.MONTH],termFunction:!0})}async run(e){return new a.TermFunctionMonth}}t.ActorFunctionFactoryTermMonth=o},78490:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionMonth=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.MONTH,overloads:(0,i.declare)(i.SparqlOperator.MONTH).onDateTime1((()=>e=>(0,i.integer)(e.typedValue.month))).set([i.TypeURL.XSD_DATE],(()=>([e])=>(0,i.integer)(e.typedValue.month))).collect()})}}t.TermFunctionMonth=a},32310:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(62489),t)},26769:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermMultiplication=void 0;const n=r(77617),i=r(77545),a=r(44936);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.MULTIPLICATION],termFunction:!0})}async run(e){return new a.TermFunctionMultiplication}}t.ActorFunctionFactoryTermMultiplication=o},44936:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionMultiplication=void 0;const n=r(77617),i=r(77545),a=r(61594);class o extends n.TermFunctionBase{constructor(){super({arity:2,operator:i.SparqlOperator.MULTIPLICATION,overloads:(0,i.declare)(i.SparqlOperator.MULTIPLICATION).arithmetic((()=>(e,t)=>new a.BigNumber(e).times(t).toNumber())).collect()})}}t.TermFunctionMultiplication=o},23610:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(26769),t)},51941:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermNot=void 0;const n=r(77617),i=r(77545),a=r(97274);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.NOT],termFunction:!0})}async run(e){return new a.TermFunctionNot}}t.ActorFunctionFactoryTermNot=o},97274:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionNot=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.NOT,overloads:(0,i.declare)(i.SparqlOperator.NOT).onTerm1((()=>e=>(0,i.bool)(!e.coerceEBV()))).collect()})}}t.TermFunctionNot=a},52505:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(51941),t)},15721:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermNow=void 0;const n=r(77617),i=r(77545),a=r(78478);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.NOW],termFunction:!0})}async run(e){return new a.TermFunctionNow}}t.ActorFunctionFactoryTermNow=o},78478:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionNow=void 0;const n=r(77617),i=r(90711),a=r(77545);class o extends n.TermFunctionBase{constructor(){super({arity:0,operator:a.SparqlOperator.NOW,overloads:(0,a.declare)(a.SparqlOperator.NOW).set([],(e=>()=>new a.DateTimeLiteral((0,a.toDateTimeRepresentation)({date:e.context.getSafe(i.KeysInitQuery.queryTimestamp),timeZone:e.context.getSafe(i.KeysExpressionEvaluator.defaultTimeZone)})))).collect()})}}t.TermFunctionNow=o},69636:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(15721),t)},771:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermObject=void 0;const n=r(77617),i=r(77545),a=r(99694);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.OBJECT],termFunction:!0})}async run(e){return new a.TermFunctionObject}}t.ActorFunctionFactoryTermObject=o},99694:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionObject=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.OBJECT,overloads:(0,i.declare)(i.SparqlOperator.OBJECT).onQuad1((()=>e=>e.object)).collect()})}}t.TermFunctionObject=a},20379:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(771),t)},67313:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermPredicate=void 0;const n=r(77617),i=r(77545),a=r(14330);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.PREDICATE],termFunction:!0})}async run(e){return new a.TermFunctionPredicate}}t.ActorFunctionFactoryTermPredicate=o},14330:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionPredicate=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.PREDICATE,overloads:(0,i.declare)(i.SparqlOperator.PREDICATE).onQuad1((()=>e=>e.predicate)).collect()})}}t.TermFunctionPredicate=a},68545:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(67313),t)},35943:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermRand=void 0;const n=r(77617),i=r(77545),a=r(48430);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.RAND],termFunction:!0})}async run(e){return new a.TermFunctionRand}}t.ActorFunctionFactoryTermRand=o},48430:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionRand=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:0,operator:i.SparqlOperator.RAND,overloads:(0,i.declare)(i.SparqlOperator.RAND).set([],(()=>()=>(0,i.double)(Math.random()))).collect()})}}t.TermFunctionRand=a},86155:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(35943),t)},99441:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermRegex=void 0;const n=r(77617),i=r(77545),a=r(11658);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.REGEX],termFunction:!0})}async run(e){return new a.TermFunctionRegex}}t.ActorFunctionFactoryTermRegex=o},11658:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionRegex=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:[2,3],operator:i.SparqlOperator.REGEX,overloads:(0,i.declare)(i.SparqlOperator.REGEX).onBinaryTyped([i.TypeAlias.SPARQL_STRINGLY,i.TypeURL.XSD_STRING],a.regex2).onTernaryTyped([i.TypeAlias.SPARQL_STRINGLY,i.TypeURL.XSD_STRING,i.TypeURL.XSD_STRING],a.regex3).collect()})}static matches(e,t,r){return new RegExp(t,r).test(e)}static regex2(){return(e,t)=>(0,i.bool)(a.matches(e,t))}static regex3(){return(e,t,r)=>(0,i.bool)(a.matches(e,t,r))}}t.TermFunctionRegex=a},98811:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(99441),t)},98349:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermReplace=void 0;const n=r(77617),i=r(77545),a=r(77054);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.REPLACE],termFunction:!0})}async run(e){return new a.TermFunctionReplace}}t.ActorFunctionFactoryTermReplace=o},77054:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionReplace=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:[3,4],operator:i.SparqlOperator.REPLACE,overloads:(0,i.declare)(i.SparqlOperator.REPLACE).onTernaryTyped([i.TypeURL.XSD_STRING,i.TypeURL.XSD_STRING,i.TypeURL.XSD_STRING],(()=>(e,t,r)=>(0,i.string)(a.replace(e,t,r)))).set([i.TypeURL.RDF_LANG_STRING,i.TypeURL.XSD_STRING,i.TypeURL.XSD_STRING],(()=>([e,t,r])=>{const n=a.replace(e.typedValue,t.typedValue,r.typedValue);return(0,i.langString)(n,e.language)})).onQuaternaryTyped([i.TypeURL.XSD_STRING,i.TypeURL.XSD_STRING,i.TypeURL.XSD_STRING,i.TypeURL.XSD_STRING],(()=>(e,t,r,n)=>(0,i.string)(a.replace(e,t,r,n)))).set([i.TypeURL.RDF_LANG_STRING,i.TypeURL.XSD_STRING,i.TypeURL.XSD_STRING,i.TypeURL.XSD_STRING],(()=>([e,t,r,n])=>{const o=a.replace(e.typedValue,t.typedValue,r.typedValue,n.typedValue);return(0,i.langString)(o,e.language)})).collect()})}static replace(e,t,r,n){let i=new RegExp(t,n);return i.global||(i=new RegExp(t,`${n??""}g`)),e.replace(i,r)}}t.TermFunctionReplace=a},52452:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(98349),t)},76593:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermRound=void 0;const n=r(77617),i=r(77545),a=r(55282);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.ROUND],termFunction:!0})}async run(e){return new a.TermFunctionRound}}t.ActorFunctionFactoryTermRound=o},55282:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionRound=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.ROUND,overloads:(0,i.declare)(i.SparqlOperator.ROUND).numericConverter((()=>e=>Math.round(e))).collect()})}}t.TermFunctionRound=a},80748:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(76593),t)},78673:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermSeconds=void 0;const n=r(77617),i=r(77545),a=r(72706);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.SECONDS],termFunction:!0})}async run(e){return new a.TermFunctionSeconds}}t.ActorFunctionFactoryTermSeconds=o},72706:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionSeconds=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.SECONDS,overloads:(0,i.declare)(i.SparqlOperator.SECONDS).onDateTime1((()=>e=>(0,i.decimal)(e.typedValue.seconds))).set([i.TypeURL.XSD_TIME],(()=>([e])=>(0,i.integer)(e.typedValue.seconds))).collect()})}}t.TermFunctionSeconds=a},9941:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(78673),t)},28223:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermSha1=void 0;const n=r(77617),i=r(77545),a=r(87242);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.SHA1],termFunction:!0})}async run(e){return new a.TermFunctionSha1}}t.ActorFunctionFactoryTermSha1=o},87242:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionSha1=void 0;const n=r(77617),i=r(77545),a=r(77952);class o extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.SHA1,overloads:(0,i.declare)(i.SparqlOperator.SHA1).onString1Typed((()=>e=>(0,i.string)((0,a.sha1)().update(e).digest("hex")))).collect()})}}t.TermFunctionSha1=o},45845:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(28223),t)},48767:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermSha256=void 0;const n=r(77617),i=r(77545),a=r(36706);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.SHA256],termFunction:!0})}async run(e){return new a.TermFunctionSha256}}t.ActorFunctionFactoryTermSha256=o},36706:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionSha256=void 0;const n=r(77617),i=r(77545),a=r(77952);class o extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.SHA256,overloads:(0,i.declare)(i.SparqlOperator.SHA256).onString1Typed((()=>e=>(0,i.string)((0,a.sha256)().update(e).digest("hex")))).collect()})}}t.TermFunctionSha256=o},77267:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(48767),t)},41291:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermSha384=void 0;const n=r(77617),i=r(77545),a=r(29814);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.SHA384],termFunction:!0})}async run(e){return new a.TermFunctionSha384}}t.ActorFunctionFactoryTermSha384=o},29814:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionSha384=void 0;const n=r(77617),i=r(77545),a=r(77952);class o extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.SHA384,overloads:(0,i.declare)(i.SparqlOperator.SHA384).onString1Typed((()=>e=>(0,i.string)((0,a.sha384)().update(e).digest("hex")))).collect()})}}t.TermFunctionSha384=o},96447:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(41291),t)},39417:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermSha512=void 0;const n=r(77617),i=r(77545),a=r(17796);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.SHA512],termFunction:!0})}async run(e){return new a.TermFunctionSha512}}t.ActorFunctionFactoryTermSha512=o},17796:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionSha512=void 0;const n=r(77617),i=r(77545),a=r(77952);class o extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.SHA512,overloads:(0,i.declare)(i.SparqlOperator.SHA512).onString1Typed((()=>e=>(0,i.string)((0,a.sha512)().update(e).digest("hex")))).collect()})}}t.TermFunctionSha512=o},24742:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(39417),t)},33778:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermStrAfter=void 0;const n=r(77617),i=r(77545),a=r(79011);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.STRAFTER],termFunction:!0})}async run(e){return new a.TermFunctionStrAfter}}t.ActorFunctionFactoryTermStrAfter=o},79011:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionStrAfter=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:2,operator:i.SparqlOperator.STRAFTER,overloads:(0,i.declare)(i.SparqlOperator.STRAFTER).onBinaryTyped([i.TypeURL.XSD_STRING,i.TypeURL.XSD_STRING],(()=>(e,t)=>(0,i.string)(e.slice(e.indexOf(t)).slice(t.length)))).onBinary([i.TypeURL.RDF_LANG_STRING,i.TypeURL.XSD_STRING],(()=>(e,t)=>{const[r,n]=[e.typedValue,t.typedValue],a=r.slice(r.indexOf(n)).slice(n.length);return a||!n?(0,i.langString)(a,e.language):(0,i.string)(a)})).onBinary([i.TypeURL.RDF_LANG_STRING,i.TypeURL.RDF_LANG_STRING],(()=>(e,t)=>{if(e.language!==t.language)throw new i.IncompatibleLanguageOperation(e,t);const[r,n]=[e.typedValue,t.typedValue],a=r.slice(r.indexOf(n)).slice(n.length);return a||!n?(0,i.langString)(a,e.language):(0,i.string)(a)})).collect()})}}t.TermFunctionStrAfter=a},30912:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(33778),t)},49176:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermStrBefore=void 0;const n=r(77617),i=r(77545),a=r(19831);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.STRBEFORE],termFunction:!0})}async run(e){return new a.TermFunctionStrBefore}}t.ActorFunctionFactoryTermStrBefore=o},19831:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionStrBefore=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:2,operator:i.SparqlOperator.STRBEFORE,overloads:(0,i.declare)(i.SparqlOperator.STRBEFORE).onBinaryTyped([i.TypeURL.XSD_STRING,i.TypeURL.XSD_STRING],(()=>(e,t)=>(0,i.string)(e.slice(0,Math.max(0,e.indexOf(t)))))).onBinary([i.TypeURL.RDF_LANG_STRING,i.TypeURL.XSD_STRING],(()=>(e,t)=>{const[r,n]=[e.typedValue,t.typedValue],a=e.typedValue.slice(0,Math.max(0,r.indexOf(n)));return a||!n?(0,i.langString)(a,e.language):(0,i.string)(a)})).onBinary([i.TypeURL.RDF_LANG_STRING,i.TypeURL.RDF_LANG_STRING],(()=>(e,t)=>{if(e.language!==t.language)throw new i.IncompatibleLanguageOperation(e,t);const[r,n]=[e.typedValue,t.typedValue],a=e.typedValue.slice(0,Math.max(0,r.indexOf(n)));return a||!n?(0,i.langString)(a,e.language):(0,i.string)(a)})).collect()})}}t.TermFunctionStrBefore=a},60649:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(49176),t)},40916:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermStrDt=void 0;const n=r(77617),i=r(77545),a=r(27403);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.STRDT],termFunction:!0})}async run(e){return new a.TermFunctionStrDt}}t.ActorFunctionFactoryTermStrDt=o},27403:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionStrDt=void 0;const n=r(77617),i=r(90711),a=r(77545);class o extends n.TermFunctionBase{constructor(){super({arity:2,operator:a.SparqlOperator.STRDT,overloads:(0,a.declare)(a.SparqlOperator.STRDT).set([a.TypeURL.XSD_STRING,"namedNode"],(e=>([t,r])=>{const n=e.context.getSafe(i.KeysInitQuery.dataFactory),o=n.literal(t.typedValue,n.namedNode(r.value));return new a.TermTransformer(e.context.getSafe(i.KeysExpressionEvaluator.superTypeProvider)).transformLiteral(o)})).collect()})}}t.TermFunctionStrDt=o},93734:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(40916),t)},64212:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermStrEnds=void 0;const n=r(77617),i=r(77545),a=r(24075);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.STRENDS],termFunction:!0})}async run(e){return new a.TermFunctionStrEnds}}t.ActorFunctionFactoryTermStrEnds=o},24075:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionStrEnds=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:2,operator:i.SparqlOperator.STRENDS,overloads:(0,i.declare)(i.SparqlOperator.STRENDS).onBinaryTyped([i.TypeAlias.SPARQL_STRINGLY,i.TypeURL.XSD_STRING],(()=>(e,t)=>(0,i.bool)(e.endsWith(t)))).onBinary([i.TypeURL.RDF_LANG_STRING,i.TypeURL.RDF_LANG_STRING],(()=>(e,t)=>{if(e.language!==t.language)throw new i.IncompatibleLanguageOperation(e,t);return(0,i.bool)(e.typedValue.endsWith(t.typedValue))})).collect()})}}t.TermFunctionStrEnds=a},49060:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(64212),t)},48904:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermStrLang=void 0;const n=r(77617),i=r(77545),a=r(21115);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.STRLANG],termFunction:!0})}async run(e){return new a.TermFunctionStrLang}}t.ActorFunctionFactoryTermStrLang=o},21115:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionStrLang=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:2,operator:i.SparqlOperator.STRLANG,overloads:(0,i.declare)(i.SparqlOperator.STRLANG).onBinaryTyped([i.TypeURL.XSD_STRING,i.TypeURL.XSD_STRING],(()=>(e,t)=>new i.LangStringLiteral(e,t.toLowerCase()))).collect()})}}t.TermFunctionStrLang=a},20554:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(48904),t)},67024:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermStrLen=void 0;const n=r(77617),i=r(77545),a=r(76869);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.STRLEN],termFunction:!0})}async run(e){return new a.TermFunctionStrLen}}t.ActorFunctionFactoryTermStrLen=o},76869:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionStrLen=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.STRLEN,overloads:(0,i.declare)(i.SparqlOperator.STRLEN).onStringly1((()=>e=>(0,i.integer)([...e.typedValue].length))).collect()})}}t.TermFunctionStrLen=a},27869:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(67024),t)},85572:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermStrStarts=void 0;const n=r(77617),i=r(77545),a=r(3863);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.STRSTARTS],termFunction:!0})}async run(e){return new a.TermFunctionStrStarts}}t.ActorFunctionFactoryTermStrStarts=o},3863:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionStrStarts=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:2,operator:i.SparqlOperator.STRSTARTS,overloads:(0,i.declare)(i.SparqlOperator.STRSTARTS).onBinaryTyped([i.TypeAlias.SPARQL_STRINGLY,i.TypeURL.XSD_STRING],(()=>(e,t)=>(0,i.bool)(e.startsWith(t)))).onBinary([i.TypeURL.RDF_LANG_STRING,i.TypeURL.RDF_LANG_STRING],(()=>(e,t)=>{if(e.language!==t.language)throw new i.IncompatibleLanguageOperation(e,t);return(0,i.bool)(e.typedValue.startsWith(t.typedValue))})).collect()})}}t.TermFunctionStrStarts=a},94379:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(85572),t)},60808:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermStrUuid=void 0;const n=r(77617),i=r(77545),a=r(12147);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.STRUUID],termFunction:!0})}async run(e){return new a.TermFunctionStrUuid}}t.ActorFunctionFactoryTermStrUuid=o},12147:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionStrUuid=void 0;const n=r(77617),i=r(77545),a=r(22831);class o extends n.TermFunctionBase{constructor(){super({arity:0,operator:i.SparqlOperator.STRUUID,overloads:(0,i.declare)(i.SparqlOperator.STRUUID).set([],(()=>()=>(0,i.string)(a.v4()))).collect()})}}t.TermFunctionStrUuid=o},53417:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(60808),t)},45510:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermStr=void 0;const n=r(77617),i=r(77545),a=r(32834);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.STR],termFunction:!0})}async run(e){return new a.TermFunctionStr}}t.ActorFunctionFactoryTermStr=o},32834:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionStr=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.STR,overloads:(0,i.declare)(i.SparqlOperator.STR).onTerm1((()=>e=>(0,i.string)(e.str()))).collect()})}}t.TermFunctionStr=a},28699:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(45510),t)},6912:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermSubStr=void 0;const n=r(77617),i=r(77545),a=r(63369);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.SUBSTR],termFunction:!0})}async run(e){return new a.TermFunctionSubStr}}t.ActorFunctionFactoryTermSubStr=o},63369:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionSubStr=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:[2,3],operator:i.SparqlOperator.SUBSTR,overloads:(0,i.declare)(i.SparqlOperator.SUBSTR).onBinaryTyped([i.TypeURL.XSD_STRING,i.TypeURL.XSD_INTEGER],(()=>(e,t)=>(0,i.string)([...e].slice(t-1).join("")))).onBinary([i.TypeURL.RDF_LANG_STRING,i.TypeURL.XSD_INTEGER],(()=>(e,t)=>{const r=[...e.typedValue].slice(t.typedValue-1).join("");return(0,i.langString)(r,e.language)})).onTernaryTyped([i.TypeURL.XSD_STRING,i.TypeURL.XSD_INTEGER,i.TypeURL.XSD_INTEGER],(()=>(e,t,r)=>(0,i.string)([...e].slice(t-1,r+t-1).join("")))).onTernary([i.TypeURL.RDF_LANG_STRING,i.TypeURL.XSD_INTEGER,i.TypeURL.XSD_INTEGER],(()=>(e,t,r)=>{const n=[...e.typedValue].slice(t.typedValue-1,r.typedValue+t.typedValue-1).join("");return(0,i.langString)(n,e.language)})).collect()})}}t.TermFunctionSubStr=a},96404:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(6912),t)},46293:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermSubject=void 0;const n=r(77617),i=r(77545),a=r(12922);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.SUBJECT],termFunction:!0})}async run(e){return new a.TermFunctionSubject}}t.ActorFunctionFactoryTermSubject=o},12922:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionSubject=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.SUBJECT,overloads:(0,i.declare)(i.SparqlOperator.SUBJECT).onQuad1((()=>e=>e.subject)).collect()})}}t.TermFunctionSubject=a},51060:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(46293),t)},37185:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermSubtraction=void 0;const n=r(77617),i=r(77545),a=r(47074);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.SUBTRACTION],termFunction:!0})}async run(e){return new a.TermFunctionSubtraction}}t.ActorFunctionFactoryTermSubtraction=o},47074:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionSubtraction=void 0;const n=r(77617),i=r(90711),a=r(77545),o=r(61594);class s extends n.TermFunctionBase{constructor(){super({arity:2,operator:a.SparqlOperator.SUBTRACTION,overloads:(0,a.declare)(a.SparqlOperator.SUBTRACTION).arithmetic((()=>(e,t)=>new o.BigNumber(e).minus(t).toNumber())).set([a.TypeURL.XSD_DATE_TIME,a.TypeURL.XSD_DATE_TIME],(e=>([t,r])=>new a.DayTimeDurationLiteral((0,a.elapsedDuration)(t.typedValue,r.typedValue,e.context.getSafe(i.KeysExpressionEvaluator.defaultTimeZone))))).copy({from:[a.TypeURL.XSD_DATE_TIME,a.TypeURL.XSD_DATE_TIME],to:[a.TypeURL.XSD_DATE,a.TypeURL.XSD_DATE]}).copy({from:[a.TypeURL.XSD_DATE_TIME,a.TypeURL.XSD_DATE_TIME],to:[a.TypeURL.XSD_TIME,a.TypeURL.XSD_TIME]}).set([a.TypeURL.XSD_DATE_TIME,a.TypeURL.XSD_DAY_TIME_DURATION],(()=>([e,t])=>new a.DateTimeLiteral((0,a.addDurationToDateTime)(e.typedValue,(0,a.defaultedDurationRepresentation)((0,a.negateDuration)(t.typedValue)))))).copy({from:[a.TypeURL.XSD_DATE_TIME,a.TypeURL.XSD_DAY_TIME_DURATION],to:[a.TypeURL.XSD_DATE_TIME,a.TypeURL.XSD_YEAR_MONTH_DURATION]}).set([a.TypeURL.XSD_DATE,a.TypeURL.XSD_DAY_TIME_DURATION],(()=>([e,t])=>new a.DateLiteral((0,a.addDurationToDateTime)((0,a.defaultedDateTimeRepresentation)(e.typedValue),(0,a.defaultedDurationRepresentation)((0,a.negateDuration)(t.typedValue)))))).copy({from:[a.TypeURL.XSD_DATE,a.TypeURL.XSD_DAY_TIME_DURATION],to:[a.TypeURL.XSD_DATE,a.TypeURL.XSD_YEAR_MONTH_DURATION]}).set([a.TypeURL.XSD_TIME,a.TypeURL.XSD_DAY_TIME_DURATION],(()=>([e,t])=>new a.TimeLiteral((0,a.addDurationToDateTime)((0,a.defaultedDateTimeRepresentation)(e.typedValue),(0,a.defaultedDurationRepresentation)((0,a.negateDuration)(t.typedValue)))))).collect()})}}t.TermFunctionSubtraction=s},55010:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(37185),t)},9875:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermTimezone=void 0;const n=r(77617),i=r(77545),a=r(38274);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.TIMEZONE],termFunction:!0})}async run(e){return new a.TermFunctionTimezone}}t.ActorFunctionFactoryTermTimezone=o},38274:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionTimezone=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.TIMEZONE,overloads:(0,i.declare)(i.SparqlOperator.TIMEZONE).onDateTime1((()=>e=>{const t={hours:e.typedValue.zoneHours,minutes:e.typedValue.zoneMinutes};if(void 0===t.hours&&void 0===t.minutes)throw new i.InvalidTimezoneCall(e.str());return new i.DayTimeDurationLiteral(t)})).copy({from:[i.TypeURL.XSD_DATE_TIME],to:[i.TypeURL.XSD_DATE]}).copy({from:[i.TypeURL.XSD_DATE_TIME],to:[i.TypeURL.XSD_TIME]}).collect()})}}t.TermFunctionTimezone=a},4535:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(9875),t)},2693:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermTriple=void 0;const n=r(77617),i=r(77545),a=r(13252);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.TRIPLE],termFunction:!0})}async run(e){return new a.TermFunctionTriple}}t.ActorFunctionFactoryTermTriple=o},13252:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionTriple=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:3,operator:i.SparqlOperator.TRIPLE,overloads:(0,i.declare)(i.SparqlOperator.TRIPLE).onTerm3((e=>(...e)=>new i.Quad(e[0],e[1],e[2],new i.DefaultGraph))).collect()})}}t.TermFunctionTriple=a},31348:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(2693),t)},1209:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermTz=void 0;const n=r(77617),i=r(77545),a=r(4e4);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.TZ],termFunction:!0})}async run(e){return new a.TermFunctionTz}}t.ActorFunctionFactoryTermTz=o},4e4:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionTz=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.TZ,overloads:(0,i.declare)(i.SparqlOperator.TZ).onDateTime1((()=>e=>(0,i.string)((0,i.extractRawTimeZone)(e.str())))).copy({from:[i.TypeURL.XSD_DATE_TIME],to:[i.TypeURL.XSD_DATE]}).copy({from:[i.TypeURL.XSD_DATE_TIME],to:[i.TypeURL.XSD_TIME]}).collect()})}}t.TermFunctionTz=a},4898:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(1209),t)},52161:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermUcase=void 0;const n=r(77617),i=r(77545),a=r(19722);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.UCASE],termFunction:!0})}async run(e){return new a.TermFunctionUcase}}t.ActorFunctionFactoryTermUcase=o},19722:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionUcase=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.UCASE,overloads:(0,i.declare)(i.SparqlOperator.UCASE).onString1Typed((()=>e=>(0,i.string)(e.toUpperCase()))).onLangString1((()=>e=>(0,i.langString)(e.typedValue.toUpperCase(),e.language))).collect()})}}t.TermFunctionUcase=a},55711:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(52161),t)},36666:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermUnaryMinus=void 0;const n=r(77617),i=r(77545),a=r(85959);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.UMINUS],termFunction:!0})}async run(e){return new a.TermFunctionUnaryMinus}}t.ActorFunctionFactoryTermUnaryMinus=o},85959:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionUnaryMinus=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.UMINUS,overloads:(0,i.declare)(i.SparqlOperator.UMINUS).numericConverter((()=>e=>-e)).collect()})}}t.TermFunctionUnaryMinus=a},67186:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(36666),t)},67444:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermUnaryPlus=void 0;const n=r(77617),i=r(77545),a=r(14695);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.UPLUS],termFunction:!0})}async run(e){return new a.TermFunctionUnaryPlus}}t.ActorFunctionFactoryTermUnaryPlus=o},14695:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionUnaryPlus=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.UPLUS,overloads:(0,i.declare)(i.SparqlOperator.UPLUS).numericConverter((()=>e=>e)).collect()})}}t.TermFunctionUnaryPlus=a},2810:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(67444),t)},93111:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermUuid=void 0;const n=r(77617),i=r(77545),a=r(3742);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.UUID],termFunction:!0})}async run(e){return new a.TermFunctionUuid}}t.ActorFunctionFactoryTermUuid=o},3742:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionUuid=void 0;const n=r(77617),i=r(77545),a=r(22831);class o extends n.TermFunctionBase{constructor(){super({arity:0,operator:i.SparqlOperator.UUID,overloads:(0,i.declare)(i.SparqlOperator.UUID).set([],(()=>()=>new i.NamedNode(`urn:uuid:${a.v4()}`))).collect()})}}t.TermFunctionUuid=o},2479:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(93111),t)},83161:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermXsdToBoolean=void 0;const n=r(77617),i=r(77545),a=r(36424);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.TypeURL.XSD_BOOLEAN],termFunction:!0})}async run(e){return new a.TermFunctionXsdToBoolean}}t.ActorFunctionFactoryTermXsdToBoolean=o},36424:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionXsdToBoolean=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.TypeURL.XSD_BOOLEAN,overloads:(0,i.declare)(i.TypeURL.XSD_BOOLEAN).onNumeric1((()=>e=>(0,i.bool)(e.coerceEBV())),!0).onUnary(i.TypeURL.XSD_BOOLEAN,(()=>e=>(0,i.bool)(e.coerceEBV())),!0).onUnary(i.TypeURL.XSD_STRING,(()=>e=>{switch(e.str()){case"true":case"1":return(0,i.bool)(!0);case"false":case"0":return(0,i.bool)(!1);default:throw new i.CastError(e,i.TypeURL.XSD_BOOLEAN)}}),!1).collect()})}}t.TermFunctionXsdToBoolean=a},11554:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(83161),t)},79217:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermXsdToDate=void 0;const n=r(77617),i=r(77545),a=r(42);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.TypeURL.XSD_DATE],termFunction:!0})}async run(e){return new a.TermFunctionXsdToDate}}t.ActorFunctionFactoryTermXsdToDate=o},42:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionXsdToDate=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.TypeURL.XSD_DATE,overloads:(0,i.declare)(i.TypeURL.XSD_DATE).onUnary(i.TypeURL.XSD_DATE,(()=>e=>new i.DateLiteral(e.typedValue,e.strValue))).onUnary(i.TypeURL.XSD_DATE_TIME,(()=>e=>new i.DateLiteral(e.typedValue))).onStringly1((()=>e=>new i.DateLiteral((0,i.parseDate)(e.str())))).collect()})}}t.TermFunctionXsdToDate=a},43406:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(79217),t)},81093:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermXsdToDatetime=void 0;const n=r(77617),i=r(77545),a=r(63082);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.TypeURL.XSD_DATE_TIME],termFunction:!0})}async run(e){return new a.TermFunctionXsdToDatetime}}t.ActorFunctionFactoryTermXsdToDatetime=o},63082:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionXsdToDatetime=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.TypeURL.XSD_DATE_TIME,overloads:(0,i.declare)(i.TypeURL.XSD_DATE_TIME).onUnary(i.TypeURL.XSD_DATE_TIME,(()=>e=>e)).onUnary(i.TypeURL.XSD_STRING,(()=>e=>(0,i.dateTime)((0,i.parseDateTime)(e.str()),e.str())),!1).onUnary(i.TypeURL.XSD_DATE,(()=>e=>new i.DateTimeLiteral({...e.typedValue,hours:0,minutes:0,seconds:0}))).collect()})}}t.TermFunctionXsdToDatetime=a},4523:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(81093),t)},77447:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermXsdToDayTimeDuration=void 0;const n=r(77617),i=r(77545),a=r(9402);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.TypeURL.XSD_DAY_TIME_DURATION],termFunction:!0})}async run(e){return new a.TermFunctionXsdToDayTimeDuration}}t.ActorFunctionFactoryTermXsdToDayTimeDuration=o},9402:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionXsdToDayTimeDuration=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.TypeURL.XSD_DAY_TIME_DURATION,overloads:(0,i.declare)(i.TypeURL.XSD_DAY_TIME_DURATION).onUnary(i.TypeURL.XSD_DURATION,(()=>e=>new i.DayTimeDurationLiteral((0,i.trimToDayTimeDuration)(e.typedValue)))).onStringly1((()=>e=>new i.DayTimeDurationLiteral((0,i.parseDayTimeDuration)(e.str())))).collect()})}}t.TermFunctionXsdToDayTimeDuration=a},69721:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(77447),t)},92015:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermXsdToDecimal=void 0;const n=r(77617),i=r(77545),a=r(73410);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.TypeURL.XSD_DECIMAL],termFunction:!0})}async run(e){return new a.TermFunctionXsdToDecimal}}t.ActorFunctionFactoryTermXsdToDecimal=o},73410:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionXsdToDecimal=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.TypeURL.XSD_DECIMAL,overloads:(0,i.declare)(i.TypeURL.XSD_DECIMAL).onNumeric1((()=>e=>{const t=(0,i.parseXSDDecimal)(e.str());if(void 0===t)throw new i.CastError(e,i.TypeURL.XSD_DECIMAL);return(0,i.decimal)(t)})).onString1((()=>e=>{const t=e.str(),r=/^([+-])?(\d+(\.\d+)?)$/u.test(t)?(0,i.parseXSDDecimal)(t):void 0;if(void 0===r)throw new i.CastError(e,i.TypeURL.XSD_DECIMAL);return(0,i.decimal)(r)}),!1).onBoolean1Typed((()=>e=>(0,i.decimal)(e?1:0))).collect()})}}t.TermFunctionXsdToDecimal=a},25033:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(92015),t)},48293:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermXsdToDouble=void 0;const n=r(77617),i=r(77545),a=r(92810);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.TypeURL.XSD_DOUBLE],termFunction:!0})}async run(e){return new a.TermFunctionXsdToDouble}}t.ActorFunctionFactoryTermXsdToDouble=o},92810:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionXsdToDouble=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.TypeURL.XSD_DOUBLE,overloads:(0,i.declare)(i.TypeURL.XSD_DOUBLE).onNumeric1((()=>e=>(0,i.double)(e.typedValue))).onBoolean1Typed((()=>e=>(0,i.double)(e?1:0))).onUnary(i.TypeURL.XSD_STRING,(()=>e=>{const t=(0,i.parseXSDFloat)(e.str());if(void 0===t)throw new i.CastError(e,i.TypeURL.XSD_DOUBLE);return(0,i.double)(t)}),!1).collect()})}}t.TermFunctionXsdToDouble=a},99507:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(48293),t)},97969:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermXsdToDuration=void 0;const n=r(77617),i=r(77545),a=r(2126);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.TypeURL.XSD_DURATION],termFunction:!0})}async run(e){return new a.TermFunctionXsdToDuration}}t.ActorFunctionFactoryTermXsdToDuration=o},2126:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionXsdToDuration=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.TypeURL.XSD_DAY_TIME_DURATION,overloads:(0,i.declare)(i.TypeURL.XSD_DURATION).onUnary(i.TypeURL.XSD_DURATION,(()=>e=>new i.DurationLiteral(e.typedValue,e.strValue))).onStringly1((()=>e=>new i.DurationLiteral((0,i.parseDuration)(e.str())))).collect()})}}t.TermFunctionXsdToDuration=a},48758:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(97969),t)},20057:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermXsdToFloat=void 0;const n=r(77617),i=r(77545),a=r(48260);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.TypeURL.XSD_FLOAT],termFunction:!0})}async run(e){return new a.TermFunctionXsdToFloat}}t.ActorFunctionFactoryTermXsdToFloat=o},48260:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionXsdToFloat=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.TypeURL.XSD_FLOAT,overloads:(0,i.declare)(i.TypeURL.XSD_FLOAT).onNumeric1((()=>e=>(0,i.float)(e.typedValue))).onBoolean1Typed((()=>e=>(0,i.float)(e?1:0))).onUnary(i.TypeURL.XSD_STRING,(()=>e=>{const t=(0,i.parseXSDFloat)(e.str());if(void 0===t)throw new i.CastError(e,i.TypeURL.XSD_FLOAT);return(0,i.float)(t)}),!1).collect()})}}t.TermFunctionXsdToFloat=a},64068:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(20057),t)},29637:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermXsdToInteger=void 0;const n=r(77617),i=r(77545),a=r(78740);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.TypeURL.XSD_INTEGER],termFunction:!0})}async run(e){return new a.TermFunctionXsdToInteger}}t.ActorFunctionFactoryTermXsdToInteger=o},78740:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionXsdToInteger=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.TypeURL.XSD_INTEGER,overloads:(0,i.declare)(i.TypeURL.XSD_INTEGER).onBoolean1Typed((()=>e=>(0,i.integer)(e?1:0))).onNumeric1((()=>e=>{if(!Number.isFinite(e.typedValue))throw new i.CastError(e,i.TypeURL.XSD_INTEGER);return(0,i.integer)(Math.trunc(e.typedValue))})).onString1((()=>e=>{const t=e.str(),r=/^\d+$/u.test(t)?Number.parseInt(t,10):void 0;if(void 0===r)throw new i.CastError(e,i.TypeURL.XSD_INTEGER);return(0,i.integer)(r)})).collect()})}}t.TermFunctionXsdToInteger=a},8096:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(29637),t)},34169:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermXsdToString=void 0;const n=r(77617),i=r(77545),a=r(62082);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.TypeURL.XSD_STRING],termFunction:!0})}async run(e){return new a.TermFunctionXsdToString}}t.ActorFunctionFactoryTermXsdToString=o},62082:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionXsdToString=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.TypeURL.XSD_STRING,overloads:(0,i.declare)(i.TypeURL.XSD_STRING).onNumeric1((()=>e=>(0,i.string)((0,i.float)(e.typedValue).str()))).onBoolean1Typed((()=>e=>(0,i.string)((0,i.bool)(e).str()))).onTerm1((()=>e=>(0,i.string)(e.str()))).collect()})}}t.TermFunctionXsdToString=a},91799:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(34169),t)},57805:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermXsdToTime=void 0;const n=r(77617),i=r(77545),a=r(29754);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.TypeURL.XSD_TIME],termFunction:!0})}async run(e){return new a.TermFunctionXsdToTime}}t.ActorFunctionFactoryTermXsdToTime=o},29754:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionXsdToTime=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.TypeURL.XSD_TIME,overloads:(0,i.declare)(i.TypeURL.XSD_TIME).onUnary(i.TypeURL.XSD_TIME,(()=>e=>new i.TimeLiteral(e.typedValue,e.strValue))).onUnary(i.TypeURL.XSD_DATE_TIME,(()=>e=>new i.TimeLiteral(e.typedValue))).onStringly1((()=>e=>new i.TimeLiteral((0,i.parseTime)(e.str())))).collect()})}}t.TermFunctionXsdToTime=a},18895:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(57805),t)},17919:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermXsdToYearMonthDuration=void 0;const n=r(77617),i=r(77545),a=r(60882);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.TypeURL.XSD_YEAR_MONTH_DURATION],termFunction:!0})}async run(e){return new a.TermFunctionXsdToYearMonthDuration}}t.ActorFunctionFactoryTermXsdToYearMonthDuration=o},60882:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionXsdToYearMonthDuration=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.TypeURL.XSD_YEAR_MONTH_DURATION,overloads:(0,i.declare)(i.TypeURL.XSD_YEAR_MONTH_DURATION).onUnary(i.TypeURL.XSD_DURATION,(()=>e=>new i.YearMonthDurationLiteral((0,i.trimToYearMonthDuration)(e.typedValue)))).onStringly1((()=>e=>new i.YearMonthDurationLiteral((0,i.parseYearMonthDuration)(e.str())))).collect()})}}t.TermFunctionXsdToYearMonthDuration=a},26143:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(17919),t)},29395:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryTermYear=void 0;const n=r(77617),i=r(77545),a=r(49562);class o extends n.ActorFunctionFactoryDedicated{constructor(e){super({...e,functionNames:[i.SparqlOperator.YEAR],termFunction:!0})}async run(e){return new a.TermFunctionYear}}t.ActorFunctionFactoryTermYear=o},49562:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionYear=void 0;const n=r(77617),i=r(77545);class a extends n.TermFunctionBase{constructor(){super({arity:1,operator:i.SparqlOperator.YEAR,overloads:(0,i.declare)(i.SparqlOperator.YEAR).onDateTime1((()=>e=>(0,i.integer)(e.typedValue.year))).set([i.TypeURL.XSD_DATE],(()=>([e])=>(0,i.integer)(e.typedValue.year))).collect()})}}t.TermFunctionYear=a},22361:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(29395),t)},29856:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorHashBindingsMurmur=void 0;const n=r(16235),i=r(90412),a=r(24799);class o extends n.ActorHashBindings{async test(e){return(0,i.passTestVoid)()}async run(e){return{hashFunction:(e,t)=>{let r=a();for(const n of t)r=r.hash(e.get(n)?.value??"UNDEF");return r.result()}}}}t.ActorHashBindingsMurmur=o},47111:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(29856),t)},45122:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorHashQuadsMurmur=void 0;const n=r(65239),i=r(90412),a=r(24799);class o extends n.ActorHashQuads{async test(e){return(0,i.passTestVoid)()}async run(e){return{hashFunction:e=>{const t=a(e.subject.value);return t.hash(e.predicate.value),t.hash(e.object.value),t.hash(e.graph.value),t.result()}}}}t.ActorHashQuadsMurmur=o},33401:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(45122),t)},20358:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorInitQuery=void 0;const n=r(53638);"undefined"==typeof process&&(globalThis.process=r(65606));class i extends n.ActorInitQueryBase{}t.ActorInitQuery=i},53638:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorInitQueryBase=void 0;const n=r(6180),i=r(90412);class a extends n.ActorInit{async test(e){return(0,i.passTestVoid)()}async run(e){throw new Error("ActorInitSparql#run is not supported in the browser.")}}t.ActorInitQueryBase=a},76235:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QueryEngineBase=void 0;const n=r(90711),i=r(90412);class a{constructor(e){this.actorInitQuery=e}async queryBindings(e,t){return this.queryOfType(e,t,"bindings")}async queryQuads(e,t){return this.queryOfType(e,t,"quads")}async queryBoolean(e,t){return this.queryOfType(e,t,"boolean")}async queryVoid(e,t){return this.queryOfType(e,t,"void")}async queryOfType(e,t,r){const n=await this.query(e,t);if(n.resultType===r)return await n.execute();throw new Error(`Query result type '${r}' was expected, while '${n.resultType}' was found.`)}async query(e,t){const r=await this.queryOrExplain(e,t);if("explain"in r)throw new Error("Tried to explain a query when in query-only mode");return r}async explain(e,t,r){return t.explain=r,await this.queryOrExplain(e,t)}async queryOrExplain(e,t){const r=i.ActionContext.ensureActionContext(t);r.get(n.KeysInitQuery.invalidateCache)&&await this.invalidateHttpCache();const{result:o}=await this.actorInitQuery.mediatorQueryProcess.mediate({query:e,context:r});return"explain"in o?o:a.internalToFinalResult(o)}async getResultMediaTypes(e){return e=i.ActionContext.ensureActionContext(e),(await this.actorInitQuery.mediatorQueryResultSerializeMediaTypeCombiner.mediate({context:e,mediaTypes:!0})).mediaTypes}async getResultMediaTypeFormats(e){return e=i.ActionContext.ensureActionContext(e),(await this.actorInitQuery.mediatorQueryResultSerializeMediaTypeFormatCombiner.mediate({context:e,mediaTypeFormats:!0})).mediaTypeFormats}async resultToString(e,t,r){if(r=i.ActionContext.ensureActionContext(r),!t)switch(e.resultType){case"bindings":t="application/json";break;case"quads":t="application/trig";break;default:t="simple"}const n={...await a.finalToInternalResult(e),context:r};return(await this.actorInitQuery.mediatorQueryResultSerialize.mediate({context:r,handle:n,handleMediaType:t})).handle}invalidateHttpCache(e,t){return t=i.ActionContext.ensureActionContext(t),this.actorInitQuery.mediatorHttpInvalidate.mediate({url:e,context:t})}static internalToFinalResult(e){switch(e.type){case"bindings":return{resultType:"bindings",execute:async()=>e.bindingsStream,metadata:async()=>{const t=await e.metadata();return t.variables=t.variables.map((e=>e.variable)),t},context:e.context};case"quads":return{resultType:"quads",execute:async()=>e.quadStream,metadata:async()=>await e.metadata(),context:e.context};case"boolean":return{resultType:"boolean",execute:async()=>e.execute(),context:e.context};case"void":return{resultType:"void",execute:async()=>e.execute(),context:e.context}}}static async finalToInternalResult(e){switch(e.resultType){case"bindings":return{type:"bindings",bindingsStream:await e.execute(),metadata:async()=>{const t=await e.metadata();return t.variables=t.variables.map((e=>({variable:e,canBeUndef:!1}))),t}};case"quads":return{type:"quads",quadStream:await e.execute(),metadata:async()=>await e.metadata()};case"boolean":return{type:"boolean",execute:()=>e.execute()};case"void":return{type:"void",execute:()=>e.execute()}}}}t.QueryEngineBase=a},12301:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.QueryEngineBase=void 0,i(r(53638),t),i(r(20358),t);var a=r(76235);Object.defineProperty(t,"QueryEngineBase",{enumerable:!0,get:function(){return a.QueryEngineBase}})},85821:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperationAssignSourcesExhaustive=void 0;const n=r(38912),i=r(16657),a=r(90711),o=r(90412),s=r(67021),c=r(96331);class u extends n.ActorOptimizeQueryOperation{constructor(e){super(e)}async test(e){return(0,o.passTestVoid)()}async run(e){const t=e.context.getSafe(a.KeysInitQuery.dataFactory),r=new c.Factory(t),n=e.context.get(a.KeysQueryOperation.querySources)??[];if(0===n.length)return{operation:e.operation,context:e.context};if(1===n.length){const t=n[0],r=e.context.get(a.KeysRdfUpdateQuads.destination);if(!r||t.source.referenceValue===(0,i.getDataDestinationValue)(r))try{const r=await t.source.getSelectorShape(e.context);if((0,s.doesShapeAcceptOperation)(r,e.operation))return{operation:(0,s.assignOperationSource)(e.operation,t),context:e.context}}catch{}}return{operation:this.assignExhaustive(r,e.operation,n),context:e.context.delete(a.KeysInitQuery.queryString)}}assignExhaustive(e,t,r){const n=this;return c.Util.mapOperation(t,{[c.Algebra.types.PATTERN]:(e,t)=>1===r.length?{result:(0,s.assignOperationSource)(e,r[0]),recurse:!1}:{result:t.createUnion(r.map((t=>(0,s.assignOperationSource)(e,t)))),recurse:!1},[c.Algebra.types.LINK]:(e,t)=>1===r.length?{result:(0,s.assignOperationSource)(e,r[0]),recurse:!1}:{result:t.createAlt(r.map((t=>(0,s.assignOperationSource)(e,t)))),recurse:!1},[c.Algebra.types.NPS]:(e,t)=>1===r.length?{result:(0,s.assignOperationSource)(e,r[0]),recurse:!1}:{result:t.createAlt(r.map((t=>(0,s.assignOperationSource)(e,t)))),recurse:!1},[c.Algebra.types.SERVICE]:e=>({result:e,recurse:!1}),[c.Algebra.types.CONSTRUCT]:(t,i)=>({result:i.createConstruct(n.assignExhaustive(e,t.input,r),t.template),recurse:!1}),[c.Algebra.types.DELETE_INSERT]:(t,i)=>({result:i.createDeleteInsert(t.delete,t.insert,t.where?n.assignExhaustive(e,t.where,r):void 0),recurse:!1})},e)}}t.ActorOptimizeQueryOperationAssignSourcesExhaustive=u},2425:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(85821),t)},68219:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperationBgpToJoin=void 0;const n=r(38912),i=r(90711),a=r(90412),o=r(96331);class s extends n.ActorOptimizeQueryOperation{async test(e){return(0,a.passTestVoid)()}async run(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=new o.Factory(t);return{operation:o.Util.mapOperation(e.operation,{bgp:(e,t)=>({recurse:!1,result:t.createJoin(e.patterns)})},r),context:e.context}}}t.ActorOptimizeQueryOperationBgpToJoin=s},60192:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(68219),t)},25538:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperationConstructDistinct=void 0;const n=r(38912),i=r(19039),a=r(90412),o=r(96331);class s extends n.ActorOptimizeQueryOperation{constructor(e){super(e)}async test(e){return e.context.has(i.KeysInitQuery.distinctConstruct)?(0,a.passTestVoid)():(0,a.failTest)(`${this.name} was not enabled by the query.`)}async run(e){return{operation:o.Util.mapOperation(e.operation,{construct:(e,t)=>({recurse:!1,result:t.createDistinct(t.createConstruct(e.input,e.template))})}),context:e.context.delete(i.KeysInitQuery.distinctConstruct)}}}t.ActorOptimizeQueryOperationConstructDistinct=s},98832:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(25538),t)},43120:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperationDescribeToConstructsSubject=void 0;const n=r(38912),i=r(90711),a=r(90412),o=r(96331);class s extends n.ActorOptimizeQueryOperation{constructor(e){super(e)}async test(e){return e.operation.type!==o.Algebra.types.DESCRIBE?(0,a.failTest)(`Actor ${this.name} only supports describe operations, but got ${e.operation.type}`):(0,a.passTest)(!0)}async run(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=new o.Factory(t),n=e.operation,a=n.terms.filter((e=>"Variable"!==e.termType)).map((e=>{const r=[t.quad(e,t.variable("__predicate"),t.variable("__object"))];return r.forEach((e=>e.type="pattern")),{input:{type:o.Algebra.types.BGP,patterns:r},template:r,type:"construct"}}));if(a.length!==n.terms.length){let e=[];n.terms.filter((e=>"Variable"===e.termType)).forEach(((r,n)=>{const i=[t.quad(r,t.variable(`__predicate${n}`),t.variable(`__object${n}`))];i.forEach((e=>e.type="pattern")),e=[...e,...i]})),a.push({input:{type:o.Algebra.types.JOIN,input:[n.input,{type:o.Algebra.types.BGP,patterns:e}]},template:e,type:o.Algebra.types.CONSTRUCT})}return{operation:r.createUnion(a,!1),context:e.context}}}t.ActorOptimizeQueryOperationDescribeToConstructsSubject=s},31399:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(43120),t)},33704:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperationFilterPushdown=void 0;const n=r(38912),i=r(90711),a=r(90412),o=r(67021),s=r(3285),c=r(96331);class u extends n.ActorOptimizeQueryOperation{constructor(e){super(e)}async test(e){return(0,a.passTestVoid)()}async run(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=new c.Factory(t);let n=e.operation;const a=this;this.splitConjunctive&&(n=c.Util.mapOperation(n,{filter:(t,r)=>t.expression.expressionType===c.Algebra.expressionTypes.OPERATOR&&"&&"===t.expression.operator?(a.logDebug(e.context,`Split conjunctive filter into ${t.expression.args.length} nested filters`),{recurse:!0,result:t.expression.args.reduce(((e,t)=>r.createFilter(e,t)),t.input)}):{recurse:!0,result:t}},r));const o=this.getSources(n),s=new Map(await Promise.all(o.map((async t=>[t,await t.source.getSelectorShape(e.context)]))));let u=!0,l=0;for(;u&&l1&&a.logDebug(e.context,`Pushed down filters in ${l} iterations`),this.mergeConjunctive&&(n=c.Util.mapOperation(n,{filter(t,r){if(t.input.type===c.Algebra.types.FILTER){const{nestedExpressions:n,input:i}=a.getNestedFilterExpressions(t);return a.logDebug(e.context,`Merge ${n.length} nested filters into conjunctive filter`),{recurse:!0,result:r.createFilter(i,n.slice(1).reduce(((e,t)=>r.createOperatorExpression("&&",[e,t])),n[0]))}}return{recurse:!0,result:t}}})),{operation:n,context:e.context}}shouldAttemptPushDown(e,t,r){if(this.aggressivePushdown)return!0;const n=e.expression;return n.expressionType===c.Algebra.expressionTypes.OPERATOR&&"="===n.operator&&("term"===n.args[0].expressionType&&"Variable"!==n.args[0].term.termType&&"term"===n.args[1].expressionType&&"Variable"===n.args[1].term.termType||"term"===n.args[0].expressionType&&"Variable"===n.args[0].term.termType&&"term"===n.args[1].expressionType&&"Variable"!==n.args[1].term.termType)||!!t.some((t=>(0,o.doesShapeAcceptOperation)(r.get(t),e)))}getSources(e){const t=new Set,r=e=>{const r=(0,o.getOperationSource)(e);return r&&t.add(r),!1};return c.Util.recurseOperation(e,{[c.Algebra.types.PATTERN]:r,[c.Algebra.types.LINK]:r,[c.Algebra.types.NPS]:r,[c.Algebra.types.SERVICE]:r}),[...t]}getExpressionVariables(e){switch(e.expressionType){case c.Algebra.expressionTypes.AGGREGATE:case c.Algebra.expressionTypes.WILDCARD:throw new Error(`Getting expression variables is not supported for ${e.expressionType}`);case c.Algebra.expressionTypes.EXISTENCE:return c.Util.inScopeVariables(e.input);case c.Algebra.expressionTypes.NAMED:return[];case c.Algebra.expressionTypes.OPERATOR:return(0,s.uniqTerms)(e.args.flatMap((e=>this.getExpressionVariables(e))));case c.Algebra.expressionTypes.TERM:return"Variable"===e.term.termType?[e.term]:[]}}getOverlappingOperations(e,t){const r=[],n=[],i=[];for(const a of e.input){const e=c.Util.inScopeVariables(a);this.variablesSubSetOf(t,e)?r.push(a):this.variablesIntersect(t,e)?n.push(a):i.push(a)}return{fullyOverlapping:r,partiallyOverlapping:n,notOverlapping:i}}filterPushdown(e,t,r,n,i){if(this.isExpressionFalse(e))return[!0,n.createUnion([])];if(e.type===c.Algebra.types.EXPRESSION&&e.expressionType===c.Algebra.expressionTypes.EXISTENCE)return[!1,n.createFilter(r,e)];switch(r.type){case c.Algebra.types.EXTEND:return this.variablesIntersect([r.variable],t)?[!1,n.createFilter(r,e)]:[!0,n.createExtend(this.filterPushdown(e,t,r.input,n,i)[1],r.variable,r.expression)];case c.Algebra.types.FILTER:{const[a,o]=this.filterPushdown(e,t,r.input,n,i);return[a,n.createFilter(o,r.expression)]}case c.Algebra.types.JOIN:{if(0===r.input.length)return[!1,n.createFilter(r,e)];const{fullyOverlapping:a,partiallyOverlapping:o,notOverlapping:s}=this.getOverlappingOperations(r,t),c=[];let u=!1;return a.length>0&&(u=!0,c.push(n.createJoin(a.map((r=>this.filterPushdown(e,t,r,n,i)[1]))))),o.length>0&&c.push(n.createFilter(n.createJoin(o,!1),e)),s.length>0&&c.push(...s),c.length>1&&(u=!0),u&&this.logDebug(i,`Push down filter across join entries with ${a.length} fully overlapping, ${o.length} partially overlapping, and ${s.length} not overlapping`),[u,1===c.length?c[0]:n.createJoin(c)]}case c.Algebra.types.NOP:return[!0,r];case c.Algebra.types.PROJECT:return this.variablesIntersect(r.variables,t)?[!0,n.createProject(this.filterPushdown(e,t,r.input,n,i)[1],r.variables)]:[!0,r];case c.Algebra.types.UNION:{const{fullyOverlapping:a,partiallyOverlapping:o,notOverlapping:s}=this.getOverlappingOperations(r,t),c=[];let u=!1;return a.length>0&&(u=!0,c.push(n.createUnion(a.map((r=>this.filterPushdown(e,t,r,n,i)[1]))))),o.length>0&&c.push(n.createFilter(n.createUnion(o,!1),e)),s.length>0&&c.push(...s),c.length>1&&(u=!0),u&&this.logDebug(i,`Push down filter across union entries with ${a.length} fully overlapping, ${o.length} partially overlapping, and ${s.length} not overlapping`),[u,1===c.length?c[0]:n.createUnion(c)]}case c.Algebra.types.VALUES:return this.variablesIntersect(r.variables,t)?[!1,n.createFilter(r,e)]:[!0,r];case c.Algebra.types.LEFT_JOIN:if(this.pushIntoLeftJoins){const a=c.Util.inScopeVariables(r.input[1]);if(!this.variablesIntersect(t,a))return this.logDebug(i,"Push down filter into left join"),[!0,n.createLeftJoin(this.filterPushdown(e,t,r.input[0],n,i)[1],r.input[1],r.expression)]}return[!1,n.createFilter(r,e)];case c.Algebra.types.PATTERN:if(this.pushEqualityIntoPatterns){const t=this.getEqualityExpressionPushableIntoPattern(e);if(t){let e=!1;const a=r.metadata;if((r=(0,s.mapTermsNested)(r,(r=>r.equals(t.variable)?(e=!0,t.term):r))).type=c.Algebra.types.PATTERN,r.metadata=a,e)return this.logDebug(i,`Push down filter into pattern for ?${t.variable.value}`),[!0,n.createJoin([r,n.createValues([t.variable],[{[`?${t.variable.value}`]:t.term}])])]}}return[!1,n.createFilter(r,e)];case c.Algebra.types.PATH:if(this.pushEqualityIntoPatterns){const t=this.getEqualityExpressionPushableIntoPattern(e);if(t&&(r.subject.equals(t.variable)||r.object.equals(t.variable))){this.logDebug(i,`Push down filter into path for ?${t.variable.value}`);const e=r.metadata;return(r=n.createPath(r.subject.equals(t.variable)?t.term:r.subject,r.predicate,r.object.equals(t.variable)?t.term:r.object)).metadata=e,[!0,n.createJoin([r,n.createValues([t.variable],[{[`?${t.variable.value}`]:t.term}])])]}}return[!1,n.createFilter(r,e)];case c.Algebra.types.MINUS:case c.Algebra.types.ALT:case c.Algebra.types.ASK:case c.Algebra.types.BGP:case c.Algebra.types.CONSTRUCT:case c.Algebra.types.DESCRIBE:case c.Algebra.types.DISTINCT:case c.Algebra.types.EXPRESSION:case c.Algebra.types.FROM:case c.Algebra.types.GRAPH:case c.Algebra.types.GROUP:case c.Algebra.types.INV:case c.Algebra.types.LINK:case c.Algebra.types.NPS:case c.Algebra.types.ONE_OR_MORE_PATH:case c.Algebra.types.ORDER_BY:case c.Algebra.types.REDUCED:case c.Algebra.types.SEQ:case c.Algebra.types.SERVICE:case c.Algebra.types.SLICE:case c.Algebra.types.ZERO_OR_MORE_PATH:case c.Algebra.types.ZERO_OR_ONE_PATH:case c.Algebra.types.COMPOSITE_UPDATE:case c.Algebra.types.DELETE_INSERT:case c.Algebra.types.LOAD:case c.Algebra.types.CLEAR:case c.Algebra.types.CREATE:case c.Algebra.types.DROP:case c.Algebra.types.ADD:case c.Algebra.types.MOVE:case c.Algebra.types.COPY:return[!1,n.createFilter(r,e)]}}getEqualityExpressionPushableIntoPattern(e){if(e.expressionType===c.Algebra.expressionTypes.OPERATOR&&"="===e.operator){if("term"===e.args[0].expressionType&&"Variable"!==e.args[0].term.termType&&("Literal"!==e.args[0].term.termType||this.isLiteralWithCanonicalLexicalForm(e.args[0].term))&&"term"===e.args[1].expressionType&&"Variable"===e.args[1].term.termType)return{variable:e.args[1].term,term:e.args[0].term};if("term"===e.args[0].expressionType&&"Variable"===e.args[0].term.termType&&"term"===e.args[1].expressionType&&"Variable"!==e.args[1].term.termType&&("Literal"!==e.args[1].term.termType||this.isLiteralWithCanonicalLexicalForm(e.args[1].term)))return{variable:e.args[0].term,term:e.args[1].term}}}isLiteralWithCanonicalLexicalForm(e){if("Literal"===e.termType)switch(e.datatype.value){case"http://www.w3.org/2001/XMLSchema#string":case"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString":case"http://www.w3.org/2001/XMLSchema#normalizedString":case"http://www.w3.org/2001/XMLSchema#anyURI":case"http://www.w3.org/2001/XMLSchema#base64Binary":case"http://www.w3.org/2001/XMLSchema#language":case"http://www.w3.org/2001/XMLSchema#Name":case"http://www.w3.org/2001/XMLSchema#NCName":case"http://www.w3.org/2001/XMLSchema#NMTOKEN":case"http://www.w3.org/2001/XMLSchema#token":case"http://www.w3.org/2001/XMLSchema#hexBinary":return!0}return!1}variablesIntersect(e,t){return e.some((e=>t.some((t=>e.equals(t)))))}variablesSubSetOf(e,t){return e.length<=t.length&&e.every((e=>t.some((t=>e.equals(t)))))}isExpressionFalse(e){return e.term&&"Literal"===e.term.termType&&"false"===e.term.value}getNestedFilterExpressions(e){if(e.input.type===c.Algebra.types.FILTER){const t=this.getNestedFilterExpressions(e.input);return{nestedExpressions:[e.expression,...t.nestedExpressions],input:t.input}}return{nestedExpressions:[e.expression],input:e.input}}}t.ActorOptimizeQueryOperationFilterPushdown=u},62001:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(33704),t)},66284:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperationGroupSources=void 0;const n=r(38912),i=r(90711),a=r(90412),o=r(67021),s=r(96331);class c extends n.ActorOptimizeQueryOperation{constructor(e){super(e)}async test(e){return(0,o.getOperationSource)(e.operation)?(0,a.failTest)(`Actor ${this.name} does not work with top-level operation sources.`):(0,a.passTestVoid)()}async run(e){return{operation:await this.groupOperation(e.operation,e.context),context:e.context}}async groupOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=new s.Factory(r);if((0,o.getOperationSource)(e)??!("input"in e))return e;if(!Array.isArray(e.input)){const r=await this.groupOperation(e.input,t);if(r.metadata?.scopedSource){const n=(0,o.getOperationSource)(r);(0,o.doesShapeAcceptOperation)(await n.source.getSelectorShape(t),e)&&(this.logDebug(t,`Hoist 1 source-specific operation into a single ${e.type} operation for ${n.source.toString()}`),(0,o.removeOperationSource)(r),e=(0,o.assignOperationSource)(e,n))}return{...e,input:r}}const a=await Promise.all(e.input.map((e=>this.groupOperation(e,t)))),c=this.clusterOperationsWithEqualSources(a);if(1===c.length){const r=c[0],n=(0,o.getOperationSource)(c[0][0]);return{...await this.moveSourceAnnotationUpwardsIfPossible(e,r,n,t),input:r}}if(c.length===a.length)return{...e,input:a};let u;switch(e.type){case s.Algebra.types.JOIN:u=n.createJoin.bind(n);break;case s.Algebra.types.UNION:u=n.createUnion.bind(n);break;case s.Algebra.types.ALT:u=n.createAlt.bind(n);break;case s.Algebra.types.SEQ:u=n.createSeq.bind(n);break;default:throw new Error(`Unsupported operation '${e.type}' detected while grouping sources`)}return await this.groupOperationMulti(c,u,t)}async groupOperationMulti(e,t,r){let n=!0;const i=await Promise.all(e.map((async e=>{const i=(0,o.getOperationSource)(e[0]),a=await this.moveSourceAnnotationUpwardsIfPossible(t(e,!0),e,i,r);return(0,o.getOperationSource)(a)&&(n=!1),a})));return t(i,n)}clusterOperationsWithEqualSources(e){const t=new Map,r=[];for(const n of e){const e=(0,o.getOperationSource)(n);e?(t.has(e)||t.set(e,[]),t.get(e).push(n)):r.push(n)}const n=[];r.length>0&&n.push(r);for(const[e,r]of t.entries())n.push(r.map((t=>(0,o.assignOperationSource)(t,e))));return n}async moveSourceAnnotationUpwardsIfPossible(e,t,r,n){if(r&&(0,o.doesShapeAcceptOperation)(await r.source.getSelectorShape(n),e)){this.logDebug(n,`Hoist ${t.length} source-specific operations into a single ${e.type} operation for ${r.source.toString()}`),e=(0,o.assignOperationSource)(e,r);for(const e of t)(0,o.removeOperationSource)(e)}return e}}t.ActorOptimizeQueryOperationGroupSources=c},92012:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(66284),t)},13574:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperationJoinBgp=void 0;const n=r(38912),i=r(90711),a=r(90412),o=r(96331);class s extends n.ActorOptimizeQueryOperation{async test(e){return(0,a.passTestVoid)()}async run(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=new o.Factory(t);return{operation:o.Util.mapOperation(e.operation,{join:(e,t)=>e.input.every((e=>"bgp"===e.type))?{recurse:!1,result:t.createBgp(e.input.flatMap((e=>e.patterns)))}:{recurse:!1,result:e}},r),context:e.context}}}t.ActorOptimizeQueryOperationJoinBgp=s},34304:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(13574),t)},79646:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperationJoinConnected=void 0;const n=r(38912),i=r(90711),a=r(90412),o=r(96331);class s extends n.ActorOptimizeQueryOperation{async test(e){return(0,a.passTestVoid)()}async run(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=new o.Factory(t);return{operation:o.Util.mapOperation(e.operation,{join:(e,t)=>({recurse:!1,result:s.cluster(e,t)})},r),context:e.context}}static cluster(e,t){let r,n=e.input.map((e=>({inScopeVariables:Object.fromEntries(o.Util.inScopeVariables(e).map((e=>[e.value,!0]))),entries:[e]})));do{r=n,n=s.clusterIteration(r)}while(r.length!==n.length);const i=n.map((e=>1===e.entries.length?e.entries[0]:t.createJoin(e.entries)));return 1===i.length?i[0]:t.createJoin(i,!1)}static clusterIteration(e){const t=[];for(const r of e){let e=!1;for(const n of t)if(s.haveOverlappingVariables(r.inScopeVariables,n.inScopeVariables)){n.entries=[...n.entries,...r.entries],n.inScopeVariables={...n.inScopeVariables,...r.inScopeVariables},e=!0;break}e||t.push({inScopeVariables:r.inScopeVariables,entries:r.entries})}return t}static haveOverlappingVariables(e,t){for(const r of Object.keys(e))if(t[r])return!0;return!1}}t.ActorOptimizeQueryOperationJoinConnected=s},5118:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(79646),t)},1166:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperationPruneEmptySourceOperations=void 0;const n=r(38912),i=r(90711),a=r(90412),o=r(67021),s=r(96331);class c extends n.ActorOptimizeQueryOperation{constructor(e){super(e)}async test(e){return(0,o.getOperationSource)(e.operation)?(0,a.failTest)(`Actor ${this.name} does not work with top-level operation sources.`):(0,a.passTestVoid)()}async run(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=new s.Factory(t);let n=e.operation;const a=[],u=this;s.Util.recurseOperation(n,{[s.Algebra.types.UNION]:e=>(u.collectMultiOperationInputs(e.input,a,s.Algebra.types.PATTERN),!0),[s.Algebra.types.ALT]:e=>(u.collectMultiOperationInputs(e.input,a,s.Algebra.types.LINK),!1),[s.Algebra.types.SERVICE]:()=>!1});const l=new Set;return await Promise.all(a.map((async n=>{const i="link"===n.type?r.createPattern(t.variable("?s"),n.iri,t.variable("?o")):n;await this.hasSourceResults(r,(0,o.getOperationSource)(n),i,e.context)||l.add(n)}))),l.size>0&&(this.logDebug(e.context,`Pruning ${l.size} source-specific operations`),n=s.Util.mapOperation(n,{[s.Algebra.types.UNION]:(e,t)=>u.mapMultiOperation(e,l,(e=>t.createUnion(e))),[s.Algebra.types.ALT]:(e,t)=>u.mapMultiOperation(e,l,(e=>t.createAlt(e)))},r),n=s.Util.mapOperation(n,{[s.Algebra.types.PROJECT]:(e,t)=>c.hasEmptyOperation(e)?{recurse:!1,result:t.createUnion([])}:{recurse:!0,result:e},[s.Algebra.types.LEFT_JOIN]:e=>c.hasEmptyOperation(e.input[1])?{recurse:!0,result:e.input[0]}:{recurse:!0,result:e}},r)),{operation:n,context:e.context}}static hasEmptyOperation(e){let t=!1;return s.Util.recurseOperation(e,{[s.Algebra.types.UNION]:e=>(e.input.every((e=>c.hasEmptyOperation(e)))&&(t=!0),!1),[s.Algebra.types.ALT]:e=>(0===e.input.length&&(t=!0),!1),[s.Algebra.types.LEFT_JOIN]:e=>(c.hasEmptyOperation(e.input[0])&&(t=!0),!1)}),t}collectMultiOperationInputs(e,t,r){for(const n of e)(0,o.getOperationSource)(n)&&n.type===r&&t.push(n)}mapMultiOperation(e,t,r){const n=e.input.filter((e=>!t.has(e)));return n.length===e.input.length?{result:e,recurse:!0}:0===n.length?{result:r([]),recurse:!1}:1===n.length?{result:n[0],recurse:!0}:{result:r(n),recurse:!0}}async hasSourceResults(e,t,r,n){if(t.context?.get(i.KeysQuerySourceIdentify.traverse))return!0;if(this.useAskIfSupported){const i=e.createAsk(r);if((0,o.doesShapeAcceptOperation)(await t.source.getSelectorShape(n),i))return t.source.queryBoolean(i,n)}const a=t.source.queryBindings(r,n);return new Promise(((e,t)=>{a.on("error",t),a.getProperty("metadata",(t=>{a.destroy(),e(t.cardinality.value>0)}))}))}}t.ActorOptimizeQueryOperationPruneEmptySourceOperations=c},94731:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(1166),t)},83658:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperationRewriteAdd=void 0;const n=r(38912),i=r(90711),a=r(90412),o=r(47793),s=r(96331),c=new o.DataFactory;class u extends n.ActorOptimizeQueryOperation{constructor(e){super(e)}async test(e){return(0,a.passTestVoid)()}async run(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=new s.Factory(t);return{operation:s.Util.mapOperation(e.operation,{[s.Algebra.types.ADD](e,t){const r="DEFAULT"===e.destination?c.defaultGraph():e.destination,n="DEFAULT"===e.source?c.defaultGraph():e.source;return{result:t.createDeleteInsert(void 0,[t.createPattern(c.variable("s"),c.variable("p"),c.variable("o"),r)],t.createPattern(c.variable("s"),c.variable("p"),c.variable("o"),n)),recurse:!1}}},r),context:e.context}}}t.ActorOptimizeQueryOperationRewriteAdd=u},34406:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(83658),t)},42512:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperationRewriteCopy=void 0;const n=r(38912),i=r(90711),a=r(90412),o=r(96331);class s extends n.ActorOptimizeQueryOperation{constructor(e){super(e)}async test(e){return(0,a.passTestVoid)()}async run(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=new o.Factory(t);return{operation:o.Util.mapOperation(e.operation,{[o.Algebra.types.COPY](e,t){let r;return r="string"==typeof e.destination&&"string"==typeof e.source&&e.destination===e.source||"string"!=typeof e.destination&&"string"!=typeof e.source&&e.destination.equals(e.source)?t.createCompositeUpdate([]):t.createCompositeUpdate([t.createDrop(e.destination,!0),t.createAdd(e.source,e.destination,e.silent)]),{result:r,recurse:!1}}},r),context:e.context}}}t.ActorOptimizeQueryOperationRewriteCopy=s},20578:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(42512),t)},80664:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperationRewriteMove=void 0;const n=r(38912),i=r(90711),a=r(90412),o=r(96331);class s extends n.ActorOptimizeQueryOperation{constructor(e){super(e)}async test(e){return(0,a.passTestVoid)()}async run(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=new o.Factory(t);return{operation:o.Util.mapOperation(e.operation,{[o.Algebra.types.MOVE](e,t){let r;if("string"==typeof e.destination&&"string"==typeof e.source&&e.destination===e.source||"string"!=typeof e.destination&&"string"!=typeof e.source&&e.destination.equals(e.source))r=t.createCompositeUpdate([]);else{const n=[t.createDrop(e.destination,!0),t.createAdd(e.source,e.destination,e.silent),t.createDrop(e.source)];r=t.createCompositeUpdate(n)}return{result:r,recurse:!1}}},r),context:e.context}}}t.ActorOptimizeQueryOperationRewriteMove=s},12538:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(80664),t)},30152:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationAsk=void 0;const n=r(66490),i=r(90412),a=r(67021);class o extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,"ask")}async testOperation(e,t){return(0,i.passTestVoid)()}async runOperation(e,t){const r=await this.mediatorQueryOperation.mediate({operation:e.input,context:t}),{bindingsStream:n}=(0,a.getSafeBindings)(r);return{type:"boolean",execute:async()=>1===(await n.take(1).toArray()).length}}}t.ActorQueryOperationAsk=o},16682:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(30152),t)},12167:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationBgpJoin=void 0;const n=r(66490),i=r(90711),a=r(90412),o=r(96331);class s extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,"bgp")}async testOperation(e,t){return(0,a.passTestVoid)()}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=new o.Factory(r);return this.mediatorQueryOperation.mediate({operation:n.createJoin(e.patterns),context:t})}}t.ActorQueryOperationBgpJoin=s},38820:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(12167),t)},5336:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationConstruct=void 0;const n=r(66490),i=r(90711),a=r(90412),o=r(67021),s=r(3285),c=r(96331),u=r(77654);class l extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,"construct")}static getVariables(e){return(0,s.uniqTerms)([].concat.apply([],e.map((e=>(0,s.getVariables)((0,s.getTermsNested)(e))))))}async testOperation(e,t){return(0,a.passTestVoid)()}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=l.getVariables(e.template),a={type:c.Algebra.types.PROJECT,input:e.input,variables:n},s=(0,o.getSafeBindings)(await this.mediatorQueryOperation.mediate({operation:a,context:t}));return{metadata:()=>s.metadata().then((t=>({...t,order:void 0,cardinality:{type:t.cardinality.type,value:t.cardinality.value*e.template.length},availableOrders:void 0}))),quadStream:new u.BindingsToQuadsIterator(r,e.template,s.bindingsStream),type:"quads"}}}t.ActorQueryOperationConstruct=l},77654:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BindingsToQuadsIterator=void 0;const n=r(75627),i=r(3285);class a extends n.MultiTransformIterator{constructor(e,t,r){super(r,{autoStart:!1}),this.dataFactory=e,this.template=t,this.blankNodeCounter=0}static bindTerm(e,t){return"Variable"===t.termType?e.get(t):t}static bindQuad(e,t){try{return(0,i.mapTermsNested)(t,(t=>{const r=a.bindTerm(e,t);if(!r)throw new Error("Unbound term");return r}))}catch{}}static localizeBlankNode(e,t,r){return"BlankNode"===r.termType?e.blankNode(`${r.value}${t}`):r}static localizeQuad(e,t,r){return(0,i.mapTermsNested)(r,(r=>a.localizeBlankNode(e,t,r)))}bindTemplate(e,t,r){return t.map(a.localizeQuad.bind(null,this.dataFactory,r)).map((t=>a.bindQuad.bind(null,e)(t))).filter(Boolean)}_createTransformer(e){return new n.ArrayIterator(this.bindTemplate(e,this.template,this.blankNodeCounter++),{autoStart:!1})}}t.BindingsToQuadsIterator=a},34585:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(5336),t),i(r(77654),t)},46271:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationDistinctHash=void 0;const n=r(66490),i=r(90412),a=r(67021);class o extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,"distinct")}async testOperation(e,t){return(0,i.passTestVoid)()}async runOperation(e,t){const r=await this.mediatorQueryOperation.mediate({operation:e.input,context:t});if("quads"===r.type){const e=(0,a.getSafeQuads)(r);return{type:"quads",quadStream:e.quadStream.filter(await this.newHashFilterQuads(t)),metadata:e.metadata}}const n=(0,a.getSafeBindings)(r),i=(await n.metadata()).variables.map((e=>e.variable));return{type:"bindings",bindingsStream:n.bindingsStream.filter(await this.newHashFilter(t,i)),metadata:n.metadata}}async newHashFilter(e,t){const{hashFunction:r}=await this.mediatorHashBindings.mediate({context:e}),n={};return e=>{const i=r(e,t);return!(i in n)&&(n[i]=!0)}}async newHashFilterQuads(e){const{hashFunction:t}=await this.mediatorHashQuads.mediate({context:e}),r={};return e=>{const n=t(e);return!(n in r)&&(r[n]=!0)}}}t.ActorQueryOperationDistinctHash=o},24615:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(46271),t)},79904:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationExtend=void 0;const n=r(66490),i=r(90412),a=r(81926),o=r(77545),s=r(67021);class c extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,"extend"),this.mediatorExpressionEvaluatorFactory=e.mediatorExpressionEvaluatorFactory}async testOperation(){return(0,i.passTestVoid)()}async runOperation(e,t){const{expression:r,input:n,variable:i}=e,c=(0,s.getSafeBindings)(await this.mediatorQueryOperation.mediate({operation:n,context:t}));if((await c.metadata()).variables.some((e=>e.variable.equals(i))))throw new Error(`Illegal binding to variable '${i.value}' that has already been bound`);const u=await this.mediatorExpressionEvaluatorFactory.mediate({algExpr:r,context:t}),l=c.bindingsStream.transform({autoStart:!1,transform:async(e,r,n)=>{try{const t=await u.evaluate(e);n(e.set(i,t))}catch(r){(0,o.isExpressionError)(r)?(n(e),this.logWarn(t,`Expression error for extend operation (${r.message})with bindings '${(0,a.bindingsToString)(e)}'`)):l.emit("error",r)}r()}});return{type:"bindings",bindingsStream:l,async metadata(){const e=await c.metadata();return{...e,variables:[...e.variables,{variable:i,canBeUndef:!1}]}}}}}t.ActorQueryOperationExtend=c},12304:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(79904),t)},13824:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationFilter=void 0;const n=r(66490),i=r(90412),a=r(81926),o=r(77545),s=r(67021);class c extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,"filter"),this.mediatorExpressionEvaluatorFactory=e.mediatorExpressionEvaluatorFactory}async testOperation(){return(0,i.passTestVoid)()}async runOperation(e,t){const r=await this.mediatorQueryOperation.mediate({operation:e.input,context:t}),n=(0,s.getSafeBindings)(r);(0,s.validateQueryOutput)(n,"bindings");const i=await this.mediatorExpressionEvaluatorFactory.mediate({algExpr:e.expression,context:t}),c=n.bindingsStream.transform({transform:async(e,r,n)=>{try{await i.evaluateAsEBV(e)&&n(e)}catch(r){(0,o.isExpressionError)(r)?this.logWarn(t,"Error occurred while filtering.",(()=>({error:r,bindings:(0,a.bindingsToString)(e)}))):c.emit("error",r)}r()},autoStart:!1});return{type:"bindings",bindingsStream:c,metadata:n.metadata}}}t.ActorQueryOperationFilter=c},68350:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(13824),t)},20679:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationFromQuad=void 0;const n=r(66490),i=r(90711),a=r(90412),o=r(96331);class s extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,"from")}static copyOperation(e,t){const r={};for(const n of Object.keys(e))Array.isArray(e[n])&&"template"!==n?r[n]="variables"===n?e[n]:e[n].map(t):s.ALGEBRA_TYPES.includes(e[n].type)?r[n]=t(e[n]):r[n]=e[n];return r}static applyOperationDefaultGraph(e,t,r){if("bgp"===t.type&&t.patterns.length>0||"path"===t.type||"pattern"===t.type){if("bgp"===t.type)return s.joinOperations(e,t.patterns.map((t=>{if("DefaultGraph"!==t.graph.termType)return e.createBgp([t]);const n=r.map((r=>e.createBgp([Object.assign(e.createPattern(t.subject,t.predicate,t.object,r),{metadata:t.metadata})])));return s.unionOperations(e,n)})));if("DefaultGraph"!==t.graph.termType)return t;const n=r.map((r=>"path"===t.type?e.createPath(t.subject,t.predicate,t.object,r):Object.assign(e.createPattern(t.subject,t.predicate,t.object,r),{metadata:t.metadata})));return s.unionOperations(e,n)}return s.copyOperation(t,(t=>this.applyOperationDefaultGraph(e,t,r)))}static applyOperationNamedGraph(e,t,r,n){if("bgp"===t.type&&t.patterns.length>0||"path"===t.type||"pattern"===t.type){const i="bgp"===t.type?t.patterns[0].graph:t.graph;if("DefaultGraph"===i.termType)return{type:o.Algebra.types.BGP,patterns:[]};if("Variable"===i.termType){if(1===r.length){const n=r[0],a={};a[`?${i.value}`]=n;const o=e.createValues([i],[a]);let s;return s="bgp"===t.type?e.createBgp(t.patterns.map((t=>e.createPattern(t.subject,t.predicate,t.object,n)))):"path"===t.type?e.createPath(t.subject,t.predicate,t.object,n):e.createPattern(t.subject,t.predicate,t.object,n),e.createJoin([o,s])}return s.unionOperations(e,r.map((r=>s.applyOperationNamedGraph(e,t,[r],n))))}return[...r,...n].some((e=>e.equals(i)))?t:{type:o.Algebra.types.BGP,patterns:[]}}return s.copyOperation(t,(t=>this.applyOperationNamedGraph(e,t,r,n)))}static joinOperations(e,t){if(1===t.length)return t[0];if(t.length>1)return e.createJoin(t);throw new Error("A join can only be applied on at least one operation")}static unionOperations(e,t){if(1===t.length)return t[0];if(t.length>1)return e.createUnion(t);throw new Error("A union can only be applied on at least one operation")}static createOperation(e,t){let r=t.input;return t.default.length>0&&(r=s.applyOperationDefaultGraph(e,r,t.default)),(t.named.length>0||t.default.length>0)&&(r=s.applyOperationNamedGraph(e,r,t.named,t.default)),r}async testOperation(e,t){return(0,a.passTestVoid)()}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=new o.Factory(r),a=s.createOperation(n,e);return this.mediatorQueryOperation.mediate({operation:a,context:t})}}t.ActorQueryOperationFromQuad=s,s.ALGEBRA_TYPES=Object.keys(o.Algebra.types).map((e=>o.Algebra.types[e]))},22744:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(20679),t)},38300:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationGroup=void 0;const n=r(66490),i=r(90711),a=r(90412),o=r(81926),s=r(67021),c=r(75627),u=r(8902);class l extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,"group"),this.mediatorBindingsAggregatorFactory=e.mediatorBindingsAggregatorFactory}async testOperation(){return(0,a.passTestVoid)()}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=await o.BindingsFactory.create(this.mediatorMergeBindingsContext,t,r),{input:a,aggregates:l}=e,d=await this.mediatorQueryOperation.mediate({operation:a,context:t}),p=(0,s.getSafeBindings)(d),h=[...e.variables,...l.map((e=>e.variable))].map((e=>({variable:e,canBeUndef:!1}))),f=(await p.metadata()).variables.map((e=>e.variable));return{type:"bindings",bindingsStream:new c.TransformIterator((()=>new Promise(((r,i)=>{const a=new u.GroupsState(e,this.mediatorBindingsAggregatorFactory,t,n,f);p.bindingsStream.on("end",(async()=>{try{const e=new c.ArrayIterator(await a.collectResults(),{autoStart:!1});r(e)}catch(e){i(e)}})),p.bindingsStream.on("error",i),p.bindingsStream.on("data",(e=>{a.consumeBindings(e).catch(i)}))}))),{autoStart:!1}),metadata:async()=>({...await p.metadata(),variables:h})}}}t.ActorQueryOperationGroup=l},8902:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GroupsState=void 0;const n=r(90711),i=r(81926);t.GroupsState=class{constructor(e,t,r,n,i){this.pattern=e,this.mediatorBindingsAggregatorFactory=t,this.context=r,this.bindingsFactory=n,this.variables=i,this.groups=new Map,this.groupsInitializer=new Map,this.groupVariables=new Set(this.pattern.variables.map((e=>e.value))),this.waitCounter=1,this.resultHasBeenCalled=!1}consumeBindings(e){const t=this.resultCheck();if(t)return t;this.waitCounter++;const r=e.filter(((e,t)=>this.groupVariables.has(t.value))),n=this.hashBindings(r);let i,a=this.groupsInitializer.get(n);if(a){const t=a;i=(async()=>{const r=await t;await Promise.all(this.pattern.aggregates.map((async t=>{const n=t.variable.value;await r.aggregators[n].putBindings(e)})))})().then((async()=>{await this.subtractWaitCounterAndCollect()}))}else a=(async()=>{const t={};await Promise.all(this.pattern.aggregates.map((async r=>{const n=r.variable.value;t[n]=await this.mediatorBindingsAggregatorFactory.mediate({expr:r,context:this.context}),await t[n].putBindings(e)})));const i={aggregators:t,bindings:r};return this.groups.set(n,i),await this.subtractWaitCounterAndCollect(),i})(),this.groupsInitializer.set(n,a),i=a;return i}async subtractWaitCounterAndCollect(){0==--this.waitCounter&&await this.handleResultCollection()}async handleResultCollection(){const e=this.context.getSafe(n.KeysInitQuery.dataFactory);let t=await Promise.all([...this.groups].map((async([t,r])=>{const{bindings:n,aggregators:i}=r;let a=n;for(const t in i){const r=await i[t].result();r&&(a=a.set(e.variable(t),r))}return a})));if(0===t.length&&0===this.groupVariables.size){const e=[];await Promise.all(this.pattern.aggregates.map((async t=>{const r=t.variable,n=await this.mediatorBindingsAggregatorFactory.mediate({expr:t,context:this.context}),i=await n.result();void 0!==i&&e.push([r,i])}))),t=[this.bindingsFactory.bindings(e)]}this.waitResolver(t)}resultCheck(){if(this.resultHasBeenCalled)return Promise.reject(new Error("Calling any function after calling collectResult is invalid."))}async collectResults(){const e=this.resultCheck();if(e)return e;this.resultHasBeenCalled=!0;const t=new Promise((e=>{this.waitResolver=e}));return await this.subtractWaitCounterAndCollect(),t}hashBindings(e){return(0,i.bindingsToCompactString)(e,this.variables)}}},37515:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(38300),t)},27568:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationJoin=void 0;const n=r(66490),i=r(90412),a=r(67021);class o extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,"join")}async testOperation(e,t){return(0,i.passTestVoid)()}async runOperation(e,t){const r=(await Promise.all(e.input.map((async e=>({output:await this.mediatorQueryOperation.mediate({operation:e,context:t}),operation:e}))))).map((({output:e,operation:t})=>({output:(0,a.getSafeBindings)(e),operation:t})));return this.mediatorJoin.mediate({type:"inner",entries:r,context:t})}}t.ActorQueryOperationJoin=o},20240:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(27568),t)},35716:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationLeftJoin=void 0;const n=r(66490),i=r(90412),a=r(77545),o=r(67021);class s extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,"leftjoin"),this.mediatorExpressionEvaluatorFactory=e.mediatorExpressionEvaluatorFactory}async testOperation(e,t){return(0,i.passTestVoid)()}async runOperation(e,t){const r=(await Promise.all(e.input.map((async e=>({output:await this.mediatorQueryOperation.mediate({operation:e,context:t}),operation:e}))))).map((({output:e,operation:t})=>({output:(0,o.getSafeBindings)(e),operation:t}))),n=await this.mediatorJoin.mediate({type:"optional",entries:r,context:t});if(e.expression){const i=(await r[1].output.metadata()).variables,o=await this.mediatorExpressionEvaluatorFactory.mediate({algExpr:e.expression,context:t}),s=n.bindingsStream.transform({autoStart:!1,transform:async(e,r,n)=>{if(!i.every((t=>e.has(t.variable.value))))return n(e),r();try{await o.evaluateAsEBV(e)&&n(e)}catch(r){(0,a.isExpressionError)(r)?this.logWarn(t,"Error occurred while filtering.",(()=>({error:r,bindings:e}))):s.emit("error",r)}r()}});n.bindingsStream=s}return n}}t.ActorQueryOperationLeftJoin=s},75113:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(35716),t)},30626:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationMinus=void 0;const n=r(66490),i=r(90412),a=r(67021);class o extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,"minus")}async testOperation(e,t){return(0,i.passTestVoid)()}async runOperation(e,t){const r=(await Promise.all(e.input.map((async e=>({output:await this.mediatorQueryOperation.mediate({operation:e,context:t}),operation:e}))))).map((({output:e,operation:t})=>({output:(0,a.getSafeBindings)(e),operation:t})));return this.mediatorJoin.mediate({type:"minus",entries:r,context:t})}}t.ActorQueryOperationMinus=o},48952:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(30626),t)},98384:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationNop=void 0;const n=r(66490),i=r(90711),a=r(90412),o=r(81926),s=r(99214),c=r(75627);class u extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,"nop")}async testOperation(e,t){return(0,a.passTestVoid)()}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=await o.BindingsFactory.create(this.mediatorMergeBindingsContext,t,r);return{bindingsStream:new c.SingletonIterator(n.bindings()),metadata:()=>Promise.resolve({state:new s.MetadataValidationState,cardinality:{type:"exact",value:1},variables:[]}),type:"bindings"}}}t.ActorQueryOperationNop=u},79153:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(98384),t)},54064:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationOrderBy=void 0;const n=r(66490),i=r(90412),a=r(77545),o=r(67021),s=r(96331),c=r(14639);class u extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,"orderby"),this.window=e.window??Number.POSITIVE_INFINITY,this.mediatorExpressionEvaluatorFactory=e.mediatorExpressionEvaluatorFactory,this.mediatorTermComparatorFactory=e.mediatorTermComparatorFactory}async testOperation(){return(0,i.passTestVoid)()}async runOperation(e,t){const r=await this.mediatorQueryOperation.mediate({operation:e.input,context:t}),n=(0,o.getSafeBindings)(r),i={window:this.window};let{bindingsStream:s}=n;const u=await this.mediatorTermComparatorFactory.mediate({context:t});for(let r=e.expressions.length-1;r>=0;r--){let n=e.expressions[r];const o=this.isAscending(n);n=this.extractSortExpression(n);const l=await this.mediatorExpressionEvaluatorFactory.mediate({algExpr:n,context:t}),d=async(e,t,r)=>{try{r({bindings:e,result:await l.evaluate(e)})}catch(t){(0,a.isExpressionError)(t)||s.emit("error",t),r({bindings:e,result:void 0})}t()},p=s.transform({transform:d}),h=new c.SortIterator(p,((e,t)=>{let r=u.orderTypes(e.result,t.result);return o||(r*=-1),r}),i);s=h.map((({bindings:e})=>e))}return{type:"bindings",bindingsStream:s,metadata:n.metadata}}extractSortExpression(e){const{expressionType:t,operator:r}=e;return t!==s.Algebra.expressionTypes.OPERATOR?e:"desc"===r?e.args[0]:e}isAscending(e){const{expressionType:t,operator:r}=e;return t!==s.Algebra.expressionTypes.OPERATOR||"desc"!==r}}t.ActorQueryOperationOrderBy=u},14639:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SortIterator=void 0;const n=r(75627);class i extends n.TransformIterator{constructor(e,t,r){super(e,r);const n=r&&r.window;this.windowLength=Number.isFinite(n)&&n>0?n:Number.POSITIVE_INFINITY,this.sort=t,this.sorted=[]}_read(e,t){let r,{length:n}=this.sorted;for(;n!==this.windowLength&&(r=this.source.read(),null!==r);){let e,t,i=0,a=n-1;for(;i<=a;)e=Math.trunc((i+a)/2),t=this.sort(r,this.sorted[e]),t<0?i=e+1:t>0?a=e-1:(i=e,a=-1);this.sorted.splice(i,0,r),n++}n===this.windowLength&&this._push(this.sorted.pop()),t()}_flush(e){let{length:t}=this.sorted;for(;t--;)this._push(this.sorted.pop());e()}}t.SortIterator=i},73945:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(54064),t)},29111:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationPathAlt=void 0;const n=r(97091),i=r(43415),a=r(90711),o=r(67021),s=r(75627),c=r(96331);class u extends n.ActorAbstractPath{constructor(e){super(e,c.Algebra.types.ALT)}async runOperation(e,t){const r=t.getSafe(a.KeysInitQuery.dataFactory),n=new c.Factory(r),u=e.predicate,l=(await Promise.all(u.input.map((r=>this.mediatorQueryOperation.mediate({context:t,operation:n.createPath(e.subject,r,e.object,e.graph)}))))).map(o.getSafeBindings);return{type:"bindings",bindingsStream:new s.UnionIterator(l.map((e=>e.bindingsStream)),{autoStart:!1}),metadata:()=>Promise.all(l.map((e=>e.metadata()))).then((e=>i.ActorQueryOperationUnion.unionMetadata(e,!0,t,this.mediatorRdfMetadataAccumulate)))}}}t.ActorQueryOperationPathAlt=u},35529:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(29111),t)},42651:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationPathInv=void 0;const n=r(97091),i=r(90711),a=r(96331);class o extends n.ActorAbstractPath{constructor(e){super(e,a.Algebra.types.INV)}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=new a.Factory(r),o=e.predicate,s=n.createPath(e.object,o.path,e.subject,e.graph);return this.mediatorQueryOperation.mediate({operation:s,context:t})}}t.ActorQueryOperationPathInv=o},6809:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(42651),t)},45513:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationPathLink=void 0;const n=r(97091),i=r(90711),a=r(96331);class o extends n.ActorAbstractPath{constructor(e){super(e,a.Algebra.types.LINK)}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=new a.Factory(r),o=e.predicate,s=Object.assign(n.createPattern(e.subject,o.iri,e.object,e.graph),{metadata:o.metadata});return this.mediatorQueryOperation.mediate({operation:s,context:t})}}t.ActorQueryOperationPathLink=o},66218:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(45513),t)},59383:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationPathNps=void 0;const n=r(97091),i=r(90711),a=r(67021),o=r(96331);class s extends n.ActorAbstractPath{constructor(e){super(e,o.Algebra.types.NPS)}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=new o.Factory(r),s=e.predicate,c=this.generateVariable(r,e),u=Object.assign(n.createPattern(e.subject,c,e.object,e.graph),{metadata:s.metadata}),l=(0,a.getSafeBindings)(await this.mediatorQueryOperation.mediate({operation:u,context:t}));return{type:"bindings",bindingsStream:l.bindingsStream.map((e=>s.iris.some((t=>t.equals(e.get(c))))?null:e.delete(c))),metadata:l.metadata}}}t.ActorQueryOperationPathNps=s},54309:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(59383),t)},15541:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationPathOneOrMore=void 0;const n=r(97091),i=r(90711),a=r(81926),o=r(67021),s=r(75627),c=r(96331);class u extends n.ActorAbstractPath{constructor(e){super(e,c.Algebra.types.ONE_OR_MORE_PATH)}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=new c.Factory(r),u=await a.BindingsFactory.create(this.mediatorMergeBindingsContext,t,r),l=await this.isPathArbitraryLengthDistinct(n,t,e);if(l.operation)return l.operation;t=l.context;const d=e.predicate;if("Variable"!==e.subject.termType&&"Variable"===e.object.termType){const r=e.object,i=await this.getObjectsPredicateStarEval(e.subject,d.path,r,e.graph,t,!1,n,u),a=("Variable"===e.graph.termType?[r,e.graph]:[r]).map((e=>({variable:e,canBeUndef:!1})));return{type:"bindings",bindingsStream:i.bindingsStream,metadata:async()=>({...await i.metadata(),variables:a})}}if("Variable"===e.subject.termType&&"Variable"===e.object.termType){const r=n.createDistinct(n.createPath(e.subject,e.predicate.path,e.object,e.graph)),i=(0,o.getSafeBindings)(await this.mediatorQueryOperation.mediate({context:t,operation:r})),a=e.subject,c=e.object,l={},p=new s.MultiTransformIterator(i.bindingsStream,{multiTransform:r=>{const i=r.get(a),o=r.get(c),p="Variable"===e.graph.termType?r.get(e.graph):e.graph;return new s.TransformIterator((async()=>{const r=new s.BufferedIterator;return await this.getSubjectAndObjectBindingsPredicateStar(a,c,i,o,d.path,p,t,l,{},r,{count:0},n,u),r.transform({transform(t,r,n){"Variable"===e.graph.termType&&(t=t.set(e.graph,p)),n(t),r()}})}),{maxBufferSize:128})},autoStart:!1}),h=("Variable"===e.graph.termType?[a,c,e.graph]:[a,c]).map((e=>({variable:e,canBeUndef:!1})));return{type:"bindings",bindingsStream:p,metadata:async()=>({...await i.metadata(),variables:h})}}if("Variable"===e.subject.termType&&"Variable"!==e.object.termType)return this.mediatorQueryOperation.mediate({context:t,operation:n.createPath(e.object,n.createOneOrMorePath(n.createInv(d.path)),e.subject,e.graph)});const p=this.generateVariable(r),h=(0,o.getSafeBindings)(await this.mediatorQueryOperation.mediate({context:t,operation:n.createPath(e.subject,d,p,e.graph)}));return{type:"bindings",bindingsStream:h.bindingsStream.transform({filter:t=>e.object.equals(t.get(p)),transform(t,r,n){n("Variable"===e.graph.termType?u.bindings([[e.graph,t.get(e.graph)]]):u.bindings()),r()}}),metadata:async()=>({...await h.metadata(),variables:("Variable"===e.graph.termType?[e.graph]:[]).map((e=>({variable:e,canBeUndef:!1})))})}}}t.ActorQueryOperationPathOneOrMore=u},23654:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(15541),t)},92231:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationPathSeq=void 0;const n=r(97091),i=r(90711),a=r(67021),o=r(96331);class s extends n.ActorAbstractPath{constructor(e){super(e,o.Algebra.types.SEQ)}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=new o.Factory(r),s=e.predicate;let c=e.subject;const u=[],l=await Promise.all(s.input.map(((i,a)=>{const o=a===s.input.length-1?e.object:this.generateVariable(r,e,`b${a}`),l=n.createPath(c,i,o,e.graph),d=this.mediatorQueryOperation.mediate({context:t,operation:l});return c=o,a({output:(0,a.getSafeBindings)(await e),operation:t})))),d=(0,a.getSafeBindings)(await this.mediatorJoin.mediate({type:"inner",entries:l,context:t}));return{type:"bindings",bindingsStream:d.bindingsStream.transform({transform(e,t,r){for(const t of u)e=e.delete(t);r(e),t()}}),async metadata(){const e=await d.metadata(),t=e.variables.filter((e=>!u.some((t=>t.value===e.variable.value))));return{...e,variables:t}}}}}t.ActorQueryOperationPathSeq=s},75049:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(92231),t)},9553:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationPathZeroOrMore=void 0;const n=r(97091),i=r(90711),a=r(81926),o=r(67021),s=r(75627),c=r(43347),u=r(96331);class l extends n.ActorAbstractPath{constructor(e){super(e,u.Algebra.types.ZERO_OR_MORE_PATH)}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=new u.Factory(r),l=await a.BindingsFactory.create(this.mediatorMergeBindingsContext,t,r),d=await this.isPathArbitraryLengthDistinct(n,t,e);if(d.operation)return d.operation;t=d.context;const p=e.predicate,h=this.getPathSources(p),f="Variable"===e.subject.termType,y="Variable"===e.object.termType;if("Variable"===e.subject.termType&&"Variable"===e.object.termType){const i=this.generateVariable(r,e),a=this.assignPatternSources(n,n.createPattern(e.subject,i,e.object,e.graph),h),u=(0,o.getSafeBindings)(await this.mediatorQueryOperation.mediate({context:t,operation:a})),d=e.subject,f=e.object,y=new Set,g={},m=new s.MultiTransformIterator(u.bindingsStream,{multiTransform:r=>{const i=r.get(d),a=r.get(f),o="Variable"===e.graph.termType?r.get(e.graph):e.graph,u=(0,c.termToString)(i)+(0,c.termToString)(o),h=(0,c.termToString)(a)+(0,c.termToString)(o);return new s.TransformIterator((async()=>{if(y.has(u)&&y.has(h))return new s.EmptyIterator;const r=new s.BufferedIterator,c={count:0};return y.has(u)||(y.add(u),await this.getSubjectAndObjectBindingsPredicateStar(d,f,i,i,p.path,o,t,g,{},r,c,n,l)),y.has(h)||(y.add(h),await this.getSubjectAndObjectBindingsPredicateStar(d,f,a,a,p.path,o,t,g,{},r,c,n,l)),r.transform({transform(t,r,n){"Variable"===e.graph.termType&&(t=t.set(e.graph,o)),n(t),r()}})}))}}),b=("Variable"===e.graph.termType?[d,e.object,e.graph]:[d,e.object]).map((e=>({variable:e,canBeUndef:!1})));return{type:"bindings",bindingsStream:m,metadata:async()=>({...await u.metadata(),variables:b})}}if(!f&&!y){const i=this.generateVariable(r),a=await this.getObjectsPredicateStarEval(e.subject,p.path,i,e.graph,t,!0,n,l);return{type:"bindings",bindingsStream:a.bindingsStream.transform({filter:t=>e.object.equals(t.get(i)),transform(t,r,n){n("Variable"===e.graph.termType?l.bindings([[e.graph,t.get(e.graph)]]):l.bindings()),r()}}),metadata:async()=>({...await a.metadata(),variables:("Variable"===e.graph.termType?[e.graph]:[]).map((e=>({variable:e,canBeUndef:!1})))})}}const g=f?e.object:e.subject,m=f?e.subject:e.object,b=f?n.createInv(p.path):p.path,v=await this.getObjectsPredicateStarEval(g,b,m,e.graph,t,!0,n,l),_=("Variable"===e.graph.termType?[m,e.graph]:[m]).map((e=>({variable:e,canBeUndef:!1})));return{type:"bindings",bindingsStream:v.bindingsStream,metadata:async()=>({...await v.metadata(),variables:_})}}}t.ActorQueryOperationPathZeroOrMore=l},85928:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(9553),t)},82651:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationPathZeroOrOne=void 0;const n=r(97091),i=r(90711),a=r(81926),o=r(99214),s=r(67021),c=r(75627),u=r(96331);class l extends n.ActorAbstractPath{constructor(e){super(e,u.Algebra.types.ZERO_OR_ONE_PATH)}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=new u.Factory(r),l=await a.BindingsFactory.create(this.mediatorMergeBindingsContext,t,r),d=e.predicate,p=this.getPathSources(d),h=[];if("Variable"!==e.subject.termType&&"Variable"!==e.object.termType&&e.subject.equals(e.object))return{type:"bindings",bindingsStream:new c.SingletonIterator(l.bindings()),metadata:()=>Promise.resolve({state:new o.MetadataValidationState,cardinality:{type:"exact",value:1},variables:[]})};const f=await this.isPathArbitraryLengthDistinct(n,t,e);if(f.operation)return f.operation;t=f.context;const y=(0,s.getSafeBindings)(await this.mediatorQueryOperation.mediate({context:t,operation:n.createPath(e.subject,d.path,e.object,e.graph)}));let g;if("Variable"===e.subject.termType&&"Variable"===e.object.termType){const i=this.generateVariable(r,e),a=(0,s.getSafeBindings)(await this.mediatorQueryOperation.mediate({context:t,operation:n.createFilter(this.assignPatternSources(n,n.createPattern(e.subject,i,e.object,e.graph),p),n.createOperatorExpression("=",[n.createTermExpression(e.subject),n.createTermExpression(e.object)]))})).bindingsStream.map((e=>e.delete(i)));g=new c.UnionIterator([a,y.bindingsStream],{autoStart:!1})}else"Variable"===e.subject.termType&&h.push(l.bindings([[e.subject,e.object]])),"Variable"===e.object.termType&&h.push(l.bindings([[e.object,e.subject]])),g=y.bindingsStream.prepend(h);return{type:"bindings",bindingsStream:g,metadata:async()=>{const e=await y.metadata();return{...e,cardinality:{...e.cardinality,value:e.cardinality.value+1}}}}}}t.ActorQueryOperationPathZeroOrOne=l},8327:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(82651),t)},89760:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationProject=void 0;const n=r(66490),i=r(90711),a=r(90412),o=r(51296),s=r(67021);class c extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,"project")}async testOperation(e,t){return(0,a.passTestVoid)()}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=(0,s.getSafeBindings)(await this.mediatorQueryOperation.mediate({operation:e.input,context:t})),a=await n.metadata(),c=Object.fromEntries(a.variables.map((e=>[e.variable.value,e]))),u=e.variables.map((e=>({variable:e,canBeUndef:!1}))),l=Object.fromEntries(u.map((e=>[e.variable.value,e]))),d=a.variables.filter((e=>!(e.variable.value in l))),p=u.map((e=>({variable:e.variable,canBeUndef:!(e.variable.value in c)||c[e.variable.value].canBeUndef})));let h=0===d.length?n.bindingsStream:n.bindingsStream.map((e=>{for(const t of d)e=e.delete(t.variable);return e})),f=0;return h=h.map((e=>{f++;const t=new Map;return e.map((e=>{if(e instanceof o.BlankNodeBindingsScoped){let n=t.get(e.value);return n||(n=r.blankNode(`${e.value}${f}`),t.set(e.value,n)),n}return e}))})),{type:"bindings",bindingsStream:h,metadata:async()=>({...a,variables:p})}}}t.ActorQueryOperationProject=c},99817:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(89760),t)},77955:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationReducedHash=void 0;const n=r(66490),i=r(90412),a=r(67021),o=r(89096);class s extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,"reduced")}async testOperation(e,t){return(0,i.passTestVoid)()}async runOperation(e,t){const r=(0,a.getSafeBindings)(await this.mediatorQueryOperation.mediate({operation:e.input,context:t})),n=(await r.metadata()).variables.map((e=>e.variable));return{type:"bindings",bindingsStream:r.bindingsStream.filter(await this.newHashFilter(t,n)),metadata:r.metadata}}async newHashFilter(e,t){const{hashFunction:r}=await this.mediatorHashBindings.mediate({context:e}),n=new o.LRUCache({max:this.cacheSize});return e=>{const i=r(e,t);return!n.has(i)&&(n.set(i,!0),!0)}}}t.ActorQueryOperationReducedHash=s},66713:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(77955),t)},87420:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationService=void 0;const n=r(66490),i=r(90711),a=r(90412),o=r(81926),s=r(99214),c=r(67021),u=r(75627);class l extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,"service")}async testOperation(e,t){return"NamedNode"!==e.name.termType?(0,a.failTest)(`${this.name} can only query services by IRI, while a ${e.name.termType} was given.`):(0,a.passTestVoid)()}async runOperation(e,t){const{querySource:r}=await this.mediatorQuerySourceIdentify.mediate({querySourceUnidentified:{value:e.name.value,type:this.forceSparqlEndpoint?"sparql":void 0},context:t});let n;try{n=(0,c.getSafeBindings)(await this.mediatorQueryOperation.mediate({operation:(0,c.assignOperationSource)(e.input,r),context:t}))}catch(r){if(!e.silent)throw r;{const e=t.getSafe(i.KeysInitQuery.dataFactory),a=await o.BindingsFactory.create(this.mediatorMergeBindingsContext,t,e);n={bindingsStream:new u.SingletonIterator(a.bindings()),type:"bindings",metadata:async()=>({state:new s.MetadataValidationState,cardinality:{type:"exact",value:1},variables:[]})},this.logWarn(t,`An error occurred when executing a SERVICE clause: ${r.message}`)}}return n}}t.ActorQueryOperationService=l},89115:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(87420),t)},46342:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationSlice=void 0;const n=r(66490),i=r(90711),a=r(90412);class o extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,"slice")}async testOperation(e,t){return(0,a.passTestVoid)()}async runOperation(e,t){e.length&&(t=t.set(i.KeysQueryOperation.limitIndicator,e.length));const r=await this.mediatorQueryOperation.mediate({operation:e.input,context:t});return"bindings"===r.type?{type:"bindings",bindingsStream:this.sliceStream(r.bindingsStream,e),metadata:this.sliceMetadata(r,e)}:"quads"===r.type?{type:"quads",quadStream:this.sliceStream(r.quadStream,e),metadata:this.sliceMetadata(r,e)}:r}sliceStream(e,t){const r=Boolean(t.length)||0===t.length,{start:n}=t,i=r?t.start+t.length-1:Number.POSITIVE_INFINITY;return e.transform({offset:n,limit:Math.max(i-n+1,0),autoStart:!1})}sliceMetadata(e,t){const r=Boolean(t.length)||0===t.length;return()=>e.metadata().then((e=>{const n={...e.cardinality};return Number.isFinite(n.value)&&(n.value=Math.max(0,n.value-t.start),r&&(n.value=Math.min(n.value,t.length))),{...e,cardinality:n}}))}}t.ActorQueryOperationSlice=o},24718:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(46342),t)},7020:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationSource=void 0;const n=r(66490),i=r(90711),a=r(90412),o=r(99214),s=r(67021),c=r(96331);class u extends n.ActorQueryOperation{constructor(e){super(e)}async test(e){return(0,s.getOperationSource)(e.operation)?(0,a.passTest)({httpRequests:1}):(0,a.failTest)(`Actor ${this.name} requires an operation with source annotation.`)}async run(e){const t=e.context.get(i.KeysInitQuery.physicalQueryPlanLogger);t&&(t.logOperation(e.operation.type,void 0,e.operation,e.context.get(i.KeysInitQuery.physicalQueryPlanNode),this.name,{}),e.context=e.context.set(i.KeysInitQuery.physicalQueryPlanNode,e.operation));const r=(0,s.getOperationSource)(e.operation),n=r.context?e.context.merge(r.context):e.context;let a=!1;if(c.Util.recurseOperation(e.operation,{construct:()=>(a=!0,!1)}),a){const t=r.source.queryQuads(e.operation,n);return{type:"quads",quadStream:t,metadata:(0,o.getMetadataQuads)(t)}}switch(e.operation.type){case c.Algebra.types.ASK:return{type:"boolean",execute:()=>r.source.queryBoolean(e.operation,n)};case c.Algebra.types.COMPOSITE_UPDATE:case c.Algebra.types.DELETE_INSERT:case c.Algebra.types.LOAD:case c.Algebra.types.CLEAR:case c.Algebra.types.CREATE:case c.Algebra.types.DROP:case c.Algebra.types.ADD:case c.Algebra.types.MOVE:case c.Algebra.types.COPY:return{type:"void",execute:()=>r.source.queryVoid(e.operation,n)}}const u=r.source.queryBindings(e.operation,n);return{type:"bindings",bindingsStream:u,metadata:(0,o.getMetadataBindings)(u)}}}t.ActorQueryOperationSource=u},48169:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(7020),t)},31660:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationUnion=void 0;const n=r(66490),i=r(90412),a=r(99214),o=r(67021),s=r(75627);class c extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,"union")}static unionVariables(e){const t={};for(const r of e)for(const e of r){t[e.variable.value]||(t[e.variable.value]={variable:e.variable,canBeUndef:e.canBeUndef,occurrences:0});const r=t[e.variable.value];r.canBeUndef=r.canBeUndef||e.canBeUndef,r.occurrences++}return Object.values(t).map((t=>t.occurrences===e.length?{variable:t.variable,canBeUndef:t.canBeUndef}:{variable:t.variable,canBeUndef:!0}))}static async unionMetadata(e,t,r,n){let i=(await n.mediate({mode:"initialize",context:r})).metadata;for(const t of e)i={...t,...(await n.mediate({mode:"append",accumulatedMetadata:i,appendingMetadata:t,context:r})).metadata};i.state=new a.MetadataValidationState;const o=()=>i.state.invalidate();for(const t of e)t.state.addInvalidateListener(o);if(t){const t=e.map((e=>e.variables));i.variables=c.unionVariables(t)}return i}async testOperation(e,t){return(0,i.passTestVoid)()}async runOperation(e,t){const r=await Promise.all(e.input.map((e=>this.mediatorQueryOperation.mediate({operation:e,context:t}))));let n;for(const e of r)if(void 0===n)n=e.type;else if(n!==e.type)throw new Error(`Unable to union ${n} and ${e.type}`);if("bindings"===n||0===e.input.length){const e=r.map(o.getSafeBindings);return{type:"bindings",bindingsStream:new s.UnionIterator(e.map((e=>e.bindingsStream)),{autoStart:!1}),metadata:()=>Promise.all(e.map((e=>e.metadata()))).then((e=>c.unionMetadata(e,!0,t,this.mediatorRdfMetadataAccumulate)))}}if("quads"===n){const e=r.map(o.getSafeQuads);return{type:"quads",quadStream:new s.UnionIterator(e.map((e=>e.quadStream)),{autoStart:!1}),metadata:()=>Promise.all(e.map((e=>e.metadata()))).then((e=>c.unionMetadata(e,!1,t,this.mediatorRdfMetadataAccumulate)))}}throw new Error(`Unable to union ${n}`)}}t.ActorQueryOperationUnion=c},43415:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(31660),t)},40196:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationClear=void 0;const n=r(66490),i=r(90711),a=r(67021);class o extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,"clear")}async testOperation(e,t){return(0,a.testReadOnly)(t)}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory);let n;n="DEFAULT"===e.source?r.defaultGraph():"string"==typeof e.source?e.source:[e.source];const{execute:a}=await this.mediatorUpdateQuads.mediate({deleteGraphs:{graphs:n,requireExistence:!e.silent,dropGraphs:!1},context:t});return{type:"void",execute:a}}}t.ActorQueryOperationClear=o},84629:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(40196),t)},47113:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationUpdateCompositeUpdate=void 0;const n=r(66490),i=r(67021);class a extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,"compositeupdate")}async testOperation(e,t){return(0,i.testReadOnly)(t)}async runOperation(e,t){return{type:"void",execute:()=>(async()=>{for(const r of e.updates){const e=(0,i.getSafeVoid)(await this.mediatorQueryOperation.mediate({operation:r,context:t}));await e.execute()}})()}}}t.ActorQueryOperationUpdateCompositeUpdate=a},330:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(47113),t)},33688:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationCreate=void 0;const n=r(66490),i=r(67021);class a extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,"create")}async testOperation(e,t){return(0,i.testReadOnly)(t)}async runOperation(e,t){const{execute:r}=await this.mediatorUpdateQuads.mediate({createGraphs:{graphs:[e.source],requireNonExistence:!e.silent},context:t});return{type:"void",execute:r}}}t.ActorQueryOperationCreate=a},54672:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(33688),t)},14801:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationUpdateDeleteInsert=void 0;const n=r(34585),i=r(66490),a=r(90711),o=r(81926),s=r(67021),c=r(75627);class u extends i.ActorQueryOperationTypedMediated{constructor(e){super(e,"deleteinsert"),this.blankNodeCounter=0}async testOperation(e,t){return(0,s.testReadOnly)(t)}async runOperation(e,t){const r=t.getSafe(a.KeysInitQuery.dataFactory),i=await o.BindingsFactory.create(this.mediatorMergeBindingsContext,t,r),u=e.where?(0,s.getSafeBindings)(await this.mediatorQueryOperation.mediate({operation:e.where,context:t})).bindingsStream:new c.ArrayIterator([i.bindings()],{autoStart:!1});let l,d;e.insert&&(l=new n.BindingsToQuadsIterator(r,e.insert.map(n.BindingsToQuadsIterator.localizeQuad.bind(null,r,this.blankNodeCounter)),u.clone()),this.blankNodeCounter++),e.delete&&(d=new n.BindingsToQuadsIterator(r,e.delete.map(n.BindingsToQuadsIterator.localizeQuad.bind(null,r,this.blankNodeCounter)),u.clone()),this.blankNodeCounter++);const{execute:p}=await this.mediatorUpdateQuads.mediate({quadStreamInsert:l,quadStreamDelete:d,context:t});return{type:"void",execute:p}}}t.ActorQueryOperationUpdateDeleteInsert=u},63002:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(14801),t)},5008:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationDrop=void 0;const n=r(66490),i=r(90711),a=r(67021);class o extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,"drop")}async testOperation(e,t){return(0,a.testReadOnly)(t)}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory);let n;n="DEFAULT"===e.source?r.defaultGraph():"string"==typeof e.source?e.source:[e.source];const{execute:a}=await this.mediatorUpdateQuads.mediate({deleteGraphs:{graphs:n,requireExistence:!e.silent,dropGraphs:!0},context:t});return{type:"void",execute:a}}}t.ActorQueryOperationDrop=o},33181:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(5008),t)},35392:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationLoad=void 0;const n=r(66490),i=r(90711),a=r(67021),o=r(96331);class s extends n.ActorQueryOperationTypedMediated{constructor(e){super(e,"load")}async testOperation(e,t){return(0,a.testReadOnly)(t)}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=new o.Factory(r);let s=t;e.silent&&(s=s.set(i.KeysInitQuery.lenient,!0));const{querySource:c}=await this.mediatorQuerySourceIdentify.mediate({querySourceUnidentified:{value:e.source.value},context:s});let u=(0,a.getSafeQuads)(await this.mediatorQueryOperation.mediate({operation:n.createConstruct((0,a.assignOperationSource)(n.createPattern(r.variable("s"),r.variable("p"),r.variable("o")),c),[n.createPattern(r.variable("s"),r.variable("p"),r.variable("o"))]),context:s})).quadStream;e.destination&&(u=u.map((t=>r.quad(t.subject,t.predicate,t.object,e.destination))));const{execute:l}=await this.mediatorUpdateQuads.mediate({quadStreamInsert:u,context:t});return{type:"void",execute:l}}}t.ActorQueryOperationLoad=s},38392:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(35392),t)},20712:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationValues=void 0;const n=r(66490),i=r(90711),a=r(90412),o=r(81926),s=r(99214),c=r(75627);class u extends n.ActorQueryOperationTyped{constructor(e){super(e,"values")}async testOperation(e,t){return(0,a.passTestVoid)()}async runOperation(e,t){const r=t.getSafe(i.KeysInitQuery.dataFactory),n=await o.BindingsFactory.create(this.mediatorMergeBindingsContext,t,r);return{type:"bindings",bindingsStream:new c.ArrayIterator(e.bindings.map((e=>n.bindings(Object.entries(e).map((([e,t])=>[r.variable(e.slice(1)),t])))))),metadata:()=>Promise.resolve({state:new s.MetadataValidationState,cardinality:{type:"exact",value:e.bindings.length},variables:e.variables.map((t=>({variable:t,canBeUndef:e.bindings.some((e=>!(`?${t.value}`in e)))})))})}}}t.ActorQueryOperationValues=u},65178:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(20712),t)},19480:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryParseGraphql=void 0;const n=r(92180),i=r(90711),a=r(90412),o=r(33826);class s extends n.ActorQueryParse{constructor(e){super(e),this.graphqlToSparql=new o.Converter({requireContext:!0})}async test(e){return"graphql"!==e.queryFormat?.language?(0,a.failTest)("This actor can only parse GraphQL queries"):(0,a.passTestVoid)()}async run(e){const t=e.context.get(i.KeysInitQuery.jsonLdContext)||{},r={singularizeVariables:e.context.get(i.KeysInitQuery.graphqlSingularizeVariables)};return{operation:await this.graphqlToSparql.graphqlToSparqlAlgebra(e.query,t,r)}}}t.ActorQueryParseGraphql=s},4047:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(19480),t)},27256:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryParseSparql=void 0;const n=r(92180),i=r(90711),a=r(90412),o=r(96331),s=r(98082);class c extends n.ActorQueryParse{constructor(e){super(e),this.prefixes=Object.freeze(this.prefixes)}async test(e){return e.queryFormat&&"sparql"!==e.queryFormat.language?(0,a.failTest)("This actor can only parse SPARQL queries"):(0,a.passTestVoid)()}async run(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=new s.Parser({prefixes:this.prefixes,baseIRI:e.baseIRI,sparqlStar:!0,factory:t}).parse(e.query);return{baseIRI:"query"===r.type?r.base:void 0,operation:(0,o.translate)(r,{quads:!0,prefixes:this.prefixes,blankToVariable:!0,baseIRI:e.baseIRI,dataFactory:t})}}}t.ActorQueryParseSparql=c},8323:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(27256),t)},53819:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryProcessExplainLogical=void 0;const n=r(59478),i=r(90711),a=r(90412);class o extends n.ActorQueryProcess{constructor(e){super(e)}async test(e){return"logical"!==(e.context.get(i.KeysInitQuery.explain)??e.context.get(new a.ActionContextKey("explain")))?(0,a.failTest)(`${this.name} can only explain in 'logical' mode.`):(0,a.passTestVoid)()}async run(e){let{operation:t,context:r}=await this.queryProcessor.parse(e.query,e.context);return({operation:t,context:r}=await this.queryProcessor.optimize(t,r)),{result:{explain:!0,type:"logical",data:t}}}}t.ActorQueryProcessExplainLogical=o},42281:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(53819),t)},58481:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryProcessExplainParsed=void 0;const n=r(59478),i=r(90711),a=r(90412);class o extends n.ActorQueryProcess{constructor(e){super(e)}async test(e){return"parsed"!==(e.context.get(i.KeysInitQuery.explain)??e.context.get(new a.ActionContextKey("explain")))?(0,a.failTest)(`${this.name} can only explain in 'parsed' mode.`):(0,a.passTestVoid)()}async run(e){const{operation:t}=await this.queryProcessor.parse(e.query,e.context);return{result:{explain:!0,type:"parsed",data:t}}}}t.ActorQueryProcessExplainParsed=o},7779:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(58481),t)},86173:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryProcessExplainPhysical=void 0;const n=r(59478),i=r(90711),a=r(90412),o=r(93974);class s extends n.ActorQueryProcess{constructor(e){super(e)}async test(e){const t=e.context.get(i.KeysInitQuery.explain)??e.context.get(new a.ActionContextKey("explain"));return"physical"!==t&&"physical-json"!==t?(0,a.failTest)(`${this.name} can only explain in 'physical' or 'physical-json' mode.`):(0,a.passTestVoid)()}async run(e){let{operation:t,context:r}=await this.queryProcessor.parse(e.query,e.context);({operation:t,context:r}=await this.queryProcessor.optimize(t,r));const n=new o.MemoryPhysicalQueryPlanLogger;r=r.set(i.KeysInitQuery.physicalQueryPlanLogger,n);const s=await this.queryProcessor.evaluate(t,r);switch(s.type){case"bindings":await s.bindingsStream.toArray();break;case"quads":await s.quadStream.toArray();break;case"boolean":case"void":await s.execute()}const c=e.context.get(i.KeysInitQuery.explain)??e.context.getSafe(new a.ActionContextKey("explain"));return{result:{explain:!0,type:c,data:"physical"===c?n.toCompactString():n.toJson()}}}}t.ActorQueryProcessExplainPhysical=s},93974:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.numberToString=t.MemoryPhysicalQueryPlanLogger=void 0;const n=r(43347);function i(e){return e.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:3})}t.MemoryPhysicalQueryPlanLogger=class{constructor(){this.planNodes=new Map}logOperation(e,t,r,n,i,a){const o={actor:i,logicalOperator:e,physicalOperator:t,rawNode:r,children:[],metadata:a};if(this.planNodes.set(r,o),this.rootNode){if(!n)throw new Error("Detected more than one parent-less node");const e=this.planNodes.get(n);if(!e)throw new Error("Could not find parent node");e.children.push(o)}else{if(n)throw new Error("No root node has been set yet, while a parent is being referenced");this.rootNode=o}}stashChildren(e,t){const r=this.planNodes.get(e);if(!r)throw new Error("Could not find plan node");r.children=t?r.children.filter(t):[]}unstashChild(e,t){const r=this.planNodes.get(e);if(r){const e=this.planNodes.get(t);if(!e)throw new Error("Could not find plan parent node");e.children.push(r)}}appendMetadata(e,t){const r=this.planNodes.get(e);r&&(r.metadata={...r.metadata,...t})}toJson(){return this.rootNode?this.planNodeToJson(this.rootNode):{}}planNodeToJson(e){const t={logical:e.logicalOperator,physical:e.physicalOperator,...this.getLogicalMetadata(e.rawNode),...this.compactMetadata(e.metadata)};if(e.children.length>0&&(t.children=e.children.map((e=>this.planNodeToJson(e)))),"bind"===t.physical&&t.children){const e={};for(const r of t.children){const t=r.children?.at(-1)??r,n=this.getPlanHash(t).join(",");e[n]||(e[n]=[]),e[n].push(r)}const r=[];for(const t of Object.values(e))r.push({occurrences:t.length,firstOccurrence:t[0]});t.childrenCompact=r,delete t.children}return t}getPlanHash(e){let t=[`${e.logical}-${e.physical}`];return e.children?t=[...t,...e.children.flatMap((e=>this.getPlanHash(e)))]:e.childrenCompact&&(t=[...t,...e.childrenCompact.flatMap((e=>this.getPlanHash(e.firstOccurrence)))]),t}compactMetadata(e){return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,this.compactMetadataValue(t)])))}compactMetadataValue(e){return e&&"object"==typeof e&&"termType"in e?this.getLogicalMetadata(e):e}getLogicalMetadata(e){const t={};if("type"in e){const r=e;switch(r.metadata?.scopedSource&&(t.source=r.metadata.scopedSource.source.toString()),r.type){case"pattern":t.pattern=this.quadToString(r);break;case"project":t.variables=r.variables.map((e=>e.value))}}return t}quadToString(e){return`${(0,n.termToString)(e.subject)} ${(0,n.termToString)(e.predicate)} ${(0,n.termToString)(e.object)}${"DefaultGraph"===e.graph.termType?"":` ${(0,n.termToString)(e.graph)}`}`}toCompactString(){const e=this.toJson(),t=[],r=new Map;if("logical"in e?this.nodeToCompactString(t,r,"",e):t.push("Empty"),r.size>0){t.push(""),t.push("sources:");for(const[e,n]of r.entries())t.push(` ${n}: ${e}`)}return t.join("\n")}nodeToCompactString(e,t,r,n,a){let o;n.source&&(o=t.get(n.source),void 0===o&&(o=t.size,t.set(n.source,o))),e.push(`${r}${n.logical}${n.physical?`(${n.physical})`:""}${n.pattern?` (${n.pattern})`:""}${n.variables?` (${n.variables.join(",")})`:""}${n.bindOperation?` bindOperation:(${n.bindOperation.pattern}) bindCardEst:${"estimate"===n.bindOperationCardinality.type?"~":""}${i(n.bindOperationCardinality.value)}`:""}${n.cardinality?` cardEst:${"estimate"===n.cardinality.type?"~":""}${i(n.cardinality.value)}`:""}${n.source?` src:${o}`:""}${n.cardinalityReal?` cardReal:${n.cardinalityReal}`:""}${n.timeSelf?` timeSelf:${i(n.timeSelf)}ms`:""}${n.timeLife?` timeLife:${i(n.timeLife)}ms`:""}${a?` ${a}`:""}`);for(const i of n.children??[])this.nodeToCompactString(e,t,`${r} `,i);for(const i of n.childrenCompact??[])this.nodeToCompactString(e,t,`${r} `,i.firstOccurrence,`compacted-occurrences:${i.occurrences}`)}},t.numberToString=i},35191:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(86173),t),i(r(93974),t)},24960:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryProcessSequential=void 0;const n=r(59478),i=r(90711),a=r(90412),o=r(81926),s=r(67021),c=r(96331);class u extends n.ActorQueryProcess{constructor(e){super(e)}async test(e){return e.context.get(i.KeysInitQuery.explain)??e.context.get(new a.ActionContextKey("explain"))?(0,a.failTest)(`${this.name} is not able to explain queries.`):(0,a.passTestVoid)()}async run(e){let{operation:t,context:r}=await this.parse(e.query,e.context);return({operation:t,context:r}=await this.optimize(t,r)),{result:await this.evaluate(t,r)}}async parse(e,t){let r;if(t=(await this.mediatorContextPreprocess.mediate({context:t,initialize:!0})).context,"string"==typeof e){const n=(t=t.set(i.KeysInitQuery.queryString,e)).get(i.KeysInitQuery.baseIRI),a=t.get(i.KeysInitQuery.queryFormat),o=await this.mediatorQueryParse.mediate({context:t,query:e,queryFormat:a,baseIRI:n});r=o.operation,o.baseIRI&&(t=t.set(i.KeysInitQuery.baseIRI,o.baseIRI))}else r=e;if(t.has(i.KeysInitQuery.initialBindings)){const e=t.getSafe(i.KeysInitQuery.dataFactory),n=new c.Factory(e),a=await o.BindingsFactory.create(this.mediatorMergeBindingsContext,t,e);r=(0,s.materializeOperation)(r,t.get(i.KeysInitQuery.initialBindings),n,a),t=t.delete(i.KeysInitQuery.queryString)}return{operation:r,context:t}}async optimize(e,t){return t=t.set(i.KeysInitQuery.query,e),({operation:e,context:t}=await this.mediatorOptimizeQueryOperation.mediate({context:t,operation:e})),{operation:e,context:t=t.set(i.KeysInitQuery.query,e)}}async evaluate(e,t){const r=await this.mediatorQueryOperation.mediate({context:t,operation:e});return r.context=t,r}}t.ActorQueryProcessSequential=u},92423:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(24960),t)},30389:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryResultSerializeJson=void 0;const n=r(58871),i=r(90412),a=r(75627),o=r(43347),s=r(19198);class c extends n.ActorQueryResultSerializeFixedMediaTypes{constructor(e){super(e)}async testHandleChecked(e,t){return["bindings","quads","boolean"].includes(e.type)?(0,i.passTestVoid)():(0,i.failTest)("This actor can only handle bindings or quad streams.")}async runHandle(e,t,r){const n=new s.Readable;if(n._read=()=>{},"bindings"===e.type||"quads"===e.type){let t="bindings"===e.type?(0,a.wrap)(e.bindingsStream).map((e=>JSON.stringify(Object.fromEntries([...e].map((([e,t])=>[e.value,o.termToString(t)])))))):(0,a.wrap)(e.quadStream).map((e=>JSON.stringify(o.quadToStringQuad(e)))),r=!0;t=t.map((e=>{const t=`${r?"":","}\n${e}`;return r=!1,t})).prepend(["["]).append(["\n]\n"]),n.wrap(t)}else try{n.push(`${JSON.stringify(await e.execute())}\n`),n.push(null)}catch(e){setTimeout((()=>n.emit("error",e)))}return{data:n}}}t.ActorQueryResultSerializeJson=c},1359:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(30389),t)},98027:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryResultSerializeRdf=void 0;const n=r(58871),i=r(90412);class a extends n.ActorQueryResultSerialize{constructor(e){super(e)}async testHandle(e,t,r){if("quads"!==e.type)return(0,i.failTest)(`Actor ${this.name} can only handle quad streams`);const{mediaTypes:n}=await this.mediatorMediaTypeCombiner.mediate({context:r,mediaTypes:!0});return t in n?(0,i.passTestVoid)():(0,i.failTest)(`Actor ${this.name} can not handle media type ${t}. All available types: ${Object.keys(n)}`)}async runHandle(e,t,r){return(await this.mediatorRdfSerialize.mediate({context:r,handle:{context:r,quadStream:e.quadStream},handleMediaType:t})).handle}async testMediaType(e){return(0,i.passTestVoid)()}async getMediaTypes(e){return(await this.mediatorMediaTypeCombiner.mediate({context:e,mediaTypes:!0})).mediaTypes}async testMediaTypeFormats(e){return(0,i.passTestVoid)()}async getMediaTypeFormats(e){return(await this.mediatorMediaTypeFormatCombiner.mediate({context:e,mediaTypeFormats:!0})).mediaTypeFormats}}t.ActorQueryResultSerializeRdf=a},33275:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(98027),t)},36057:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryResultSerializeSimple=void 0;const n=r(58871),i=r(90412),a=r(75627),o=r(43347),s=r(19198);class c extends n.ActorQueryResultSerializeFixedMediaTypes{constructor(e){super(e)}async testHandleChecked(e,t){return["bindings","quads","boolean","void"].includes(e.type)?(0,i.passTestVoid)():(0,i.failTest)("This actor can only handle bindings streams, quad streams, booleans, or updates.")}static termToString(e){return"Quad"===e.termType?(0,o.termToString)(e):e.value}async runHandle(e,t,r){const n=new s.Readable;return"bindings"===e.type?n.wrap(e.bindingsStream.map((e=>`${[...e].map((([e,t])=>`?${e.value}: ${c.termToString(t)}`)).join("\n")}\n\n`))):"quads"===e.type?n.wrap(e.quadStream.map((e=>`subject: ${c.termToString(e.subject)}\npredicate: ${c.termToString(e.predicate)}\nobject: ${c.termToString(e.object)}\ngraph: ${c.termToString(e.graph)}\n\n`))):n.wrap((0,a.wrap)("boolean"===e.type?e.execute().then((e=>[`${e}\n`])):e.execute().then((()=>["ok\n"])))),{data:n}}}t.ActorQueryResultSerializeSimple=c},1595:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(36057),t)},66338:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryResultSerializeSparqlCsv=void 0;const n=r(58871),i=r(90412),a=r(19198);class o extends n.ActorQueryResultSerializeFixedMediaTypes{constructor(e){super(e)}static bindingToCsvBindings(e){if(!e)return"";let t=e.value;if("Literal"===e.termType)t=`${t}`;else if("BlankNode"===e.termType)t=`_:${t}`;else if("Quad"===e.termType){let r=o.bindingToCsvBindings(e.object);"Literal"===e.object.termType&&(r=`"${r.replaceAll('"','""')}"`),t=`<< ${o.bindingToCsvBindings(e.subject)} ${o.bindingToCsvBindings(e.predicate)} ${r} >>`}else t=`<${t}>`;return/[",\n\r]/u.test(t)&&(t=`"${t.replaceAll('"','""')}"`),t}async testHandleChecked(e,t){return"bindings"!==e.type?(0,i.failTest)("This actor can only handle bindings streams."):(0,i.passTestVoid)()}async runHandle(e,t,r){const n=e,i=new a.Readable,s=await n.metadata();return i.push(`${s.variables.map((e=>e.variable.value)).join(",")}\r\n`),i.wrap(n.bindingsStream.map((e=>`${s.variables.map((t=>o.bindingToCsvBindings(e.get(t.variable)))).join(",")}\r\n`))),{data:i}}}t.ActorQueryResultSerializeSparqlCsv=o},83657:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(66338),t)},40409:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActionObserverHttp=void 0;const n=r(90412);class i extends n.ActionObserver{constructor(e){super(e),this.requests=0,this.bus.subscribeObserver(this),this.httpInvalidator.addInvalidateListener((()=>{this.requests=0}))}onRun(e,t,r){this.requests++}}t.ActionObserverHttp=i},71186:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryResultSerializeSparqlJson=void 0;const n=r(58871),i=r(90412),a=r(75627),o=r(19198);class s extends n.ActorQueryResultSerializeFixedMediaTypes{constructor(e){super(e)}static bindingToJsonBindings(e){if("Literal"===e.termType){const t=e,r={value:t.value,type:"literal"},{language:n,datatype:i}=t;return n?r["xml:lang"]=n:i&&"http://www.w3.org/2001/XMLSchema#string"!==i.value&&(r.datatype=i.value),r}return"BlankNode"===e.termType?{value:e.value,type:"bnode"}:"Quad"===e.termType?{value:{subject:s.bindingToJsonBindings(e.subject),predicate:s.bindingToJsonBindings(e.predicate),object:s.bindingToJsonBindings(e.object)},type:"triple"}:{value:e.value,type:"uri"}}async testHandleChecked(e,t){return["bindings","boolean"].includes(e.type)?(0,i.passTestVoid)():(0,i.failTest)("This actor can only handle bindings streams or booleans.")}async runHandle(e,t,r){const n=new o.Readable,i={};if("bindings"===e.type){const c=await e.metadata();c.variables.length>0&&(i.vars=c.variables.map((e=>e.variable.value)))}if(n.push(`{"head": ${JSON.stringify(i)},\n`),"bindings"===e.type){const u=e.bindingsStream;n.push('"results": { "bindings": [\n');let l=!0;function*d(e){yield e()}n.wrap((0,a.wrap)(u).map((e=>{const t=`${l?"":",\n"}${JSON.stringify(Object.fromEntries([...e].map((([e,t])=>[e.value,s.bindingToJsonBindings(t)]))))}`;return l=!1,t})).append((0,a.wrap)(d((()=>`\n]}${this.emitMetadata?`,\n"metadata": { "httpRequests": ${this.httpObserver.requests} }`:""}}\n`)))))}else n.wrap((0,a.wrap)(e.execute().then((e=>[`"boolean":${e}\n}\n`]))));return{data:n}}}t.ActorQueryResultSerializeSparqlJson=s},13125:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(40409),t),i(r(71186),t)},86780:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryResultSerializeSparqlTsv=void 0;const n=r(58871),i=r(90412),a=r(46898),o=r(19198);class s extends n.ActorQueryResultSerializeFixedMediaTypes{constructor(e){super(e)}static bindingToTsvBindings(e){return e?(0,a.termToString)(e).replaceAll("\t","\\t").replaceAll("\n","\\n").replaceAll("\r","\\r"):""}async testHandleChecked(e,t){return"bindings"!==e.type?(0,i.failTest)("This actor can only handle bindings streams."):(0,i.passTestVoid)()}async runHandle(e,t,r){const n=e,i=new o.Readable,a=await n.metadata();return i.push(`${a.variables.map((e=>e.variable.value)).join("\t")}\n`),i.wrap(n.bindingsStream.map((e=>`${a.variables.map((t=>s.bindingToTsvBindings(e.get(t.variable)))).join("\t")}\n`))),{data:i}}}t.ActorQueryResultSerializeSparqlTsv=s},92796:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(86780),t)},13168:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryResultSerializeSparqlXml=void 0;const n=r(58871),i=r(90412),a=r(75627),o=r(19198),s=r(1861);class c extends n.ActorQueryResultSerializeFixedMediaTypes{constructor(e){super(e)}static bindingToXmlBindings(e,t){return{name:"binding",attributes:{name:t.value},children:[this.valueToXmlValue(e)]}}static valueToXmlValue(e){let t;switch(e.termType){case"Literal":return t=e.language?{"xml:lang":e.language}:e.datatype&&"http://www.w3.org/2001/XMLSchema#string"!==e.datatype.value?{datatype:e.datatype.value}:{},{name:"literal",attributes:t,children:e.value};case"BlankNode":return{name:"bnode",children:e.value};case"Quad":return{name:"triple",children:[{name:"subject",children:[this.valueToXmlValue(e.subject)]},{name:"predicate",children:[this.valueToXmlValue(e.predicate)]},{name:"object",children:[this.valueToXmlValue(e.object)]}]};default:return{name:"uri",children:e.value}}}async testHandleChecked(e,t){return["bindings","boolean"].includes(e.type)?(0,i.passTestVoid)():(0,i.failTest)("This actor can only handle bindings streams or booleans.")}async runHandle(e,t,r){const n=new o.Readable;n._read=()=>{};const i=new s.XmlSerializer,u=await e.metadata();if(n.push(s.XmlSerializer.header),n.push(i.open("sparql",{xmlns:"http://www.w3.org/2005/sparql-results#"})),n.push(i.serializeNode({name:"head",children:u.variables.map((e=>({name:"variable",attributes:{name:e.variable.value}})))})),"bindings"===e.type){function*l(){yield i.close(),yield i.close()}n.push(i.open("results"));const d=(0,a.wrap)(e.bindingsStream).map((e=>i.serializeNode({name:"result",children:[...e].map((([e,t])=>c.bindingToXmlBindings(t,e)))}))).append((0,a.wrap)(l()));n.wrap(d)}else try{const p=await e.execute();n.push(i.serializeNode({name:"boolean",children:p.toString()})),n.push(i.close()),setTimeout((()=>n.push(null)))}catch(h){setTimeout((()=>n.emit("error",h)))}return{data:n}}}t.ActorQueryResultSerializeSparqlXml=c},1861:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XmlSerializer=void 0;class r{constructor(){this.stack=[]}open(e,t){const r=`${this.identation()+this.formatTag(e,t,"open")}\n`;return this.stack.push(e),r}close(){const e=this.stack.pop();if(void 0===e)throw new Error("There is no tag left to close");return`${this.identation()+this.formatTag(e,{},"close")}\n`}serializeNode(e){if(void 0===e.children)return`${this.identation()+this.formatTag(e.name,e.attributes,"self-closing")}\n`;if("string"==typeof e.children)return`${this.identation()+this.formatTag(e.name,e.attributes,"open")+this.escape(e.children)+this.formatTag(e.name,{},"close")}\n`;const t=[];t.push(`${this.identation()+this.formatTag(e.name,e.attributes,"open")}\n`),this.stack.push(e.name);for(const r of e.children)t.push(this.serializeNode(r));return this.stack.pop(),t.push(`${this.identation()+this.formatTag(e.name,{},"close")}\n`),t.join("")}identation(){return this.stack.map((e=>" ")).join("")}formatTag(e,t,r){return`<${"close"===r?"/":""}${e}${Object.entries(t??{}).map((e=>` ${e[0]}="${this.escape(e[1])}"`))}${"self-closing"===r?"/":""}>`}escape(e){return e.replaceAll(/["&'<>]/gu,(e=>{switch(e){case"<":return"<";case">":return">";case"&":return"&";case"'":return"'";case'"':return"""}}))}}t.XmlSerializer=r,r.header='\n'},23200:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(13168),t)},94690:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActionObserverHttp=void 0;const n=r(90412);class i extends n.ActionObserver{constructor(e){super(e),this.requests=0,this.bus.subscribeObserver(this),this.httpInvalidator.addInvalidateListener((()=>{this.requests=0}))}onRun(e,t,r){this.requests++}}t.ActionObserverHttp=i},98329:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryResultSerializeStats=void 0;const n=r(58871),i=r(90711),a=r(90412),o=r(75627),s=r(19198);class c extends n.ActorQueryResultSerializeFixedMediaTypes{constructor(e){super(e)}async testHandleChecked(e,t){return["bindings","quads"].includes(e.type)?(0,a.passTestVoid)():(0,a.failTest)("This actor can only handle bindings streams or quad streams.")}pushHeader(e){const t=["Result","Delay (ms)","HTTP requests"].join(",");e.push(`${t}\n`)}createStat(e,t){return`${[t,this.delay(e),this.httpObserver.requests].join(",")}\n`}createSpecialLine(e,t){return`${[e,this.delay(t),this.httpObserver.requests].join(",")}\n`}async runHandle(e,t,r){const n=new s.Readable,a="bindings"===e.type?e.bindingsStream:e.quadStream,c=e.context.getSafe(i.KeysInitQuery.queryTimestampHighResolution);let u=1;const l=(0,o.wrap)(a).map((()=>this.createStat(c,u++))).prepend([this.createSpecialLine("PLANNING",c)]).append((0,o.wrap)(function*(e){yield e()}((()=>this.createSpecialLine("TOTAL",c)))));return this.pushHeader(n),n.wrap(l),{data:n}}now(){return performance.now()}delay(e){return this.now()-e}}t.ActorQueryResultSerializeStats=c},93408:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(94690),t),i(r(98329),t)},80991:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryResultSerializeTable=void 0;const n=r(58871),i=r(90711),a=r(90412),o=r(43347),s=r(3285),c=r(19198);class u extends n.ActorQueryResultSerializeFixedMediaTypes{constructor(e){super(e),this.padding=u.repeat(" ",this.columnWidth)}static repeat(e,t){return e.repeat(t)}async testHandleChecked(e,t){return["bindings","quads"].includes(e.type)?(0,a.passTestVoid)():(0,a.failTest)("This actor can only handle bindings or quad streams.")}termToString(e){return"Quad"===e.termType?(0,o.termToString)(e):e.value}pad(e){return e.length<=this.columnWidth?e+this.padding.slice(e.length):`${e.slice(0,this.columnWidth-1)}…`}pushHeader(e,t){const r=t.map((e=>this.pad(e.value))).join(" ");e.push(`${r}\n${u.repeat("-",r.length)}\n`)}createRow(e,t){return`${e.map((e=>t.has(e)?this.termToString(t.get(e)):"")).map((e=>this.pad(e))).join(" ")}\n`}async runHandle(e,t,r){const n=new c.Readable;let a;if("bindings"===e.type){a=e.bindingsStream.map((e=>this.createRow(t,e)));const t=(await e.metadata()).variables.map((e=>e.variable));this.pushHeader(n,t)}else{a=e.quadStream.map((e=>`${(0,s.getTerms)(e).map((e=>this.pad(this.termToString(e)))).join(" ")}\n`));const t=e.context.getSafe(i.KeysInitQuery.dataFactory);this.pushHeader(n,s.QUAD_TERM_NAMES.map((e=>t.variable(e))))}return n.wrap(a),{data:n}}}t.ActorQueryResultSerializeTable=u},17731:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(80991),t)},73505:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryResultSerializeTree=void 0;const n=r(58871),i=r(90711),a=r(90412),o=r(19198),s=r(12763);class c extends n.ActorQueryResultSerializeFixedMediaTypes{constructor(e){super(e)}static async bindingsStreamToGraphQl(e,t,r){const n=a.ActionContext.ensureActionContext(t),o=new s.Converter(r),c={singularizeVariables:n.get(i.KeysInitQuery.graphqlSingularizeVariables)??{}};return o.bindingsToTree(await e.map((e=>Object.fromEntries([...e].map((([e,t])=>[e.value,t]))))).toArray(),c)}async testHandleChecked(e){return"bindings"!==e.type?(0,a.failTest)("This actor can only handle bindings streams."):(0,a.passTestVoid)()}async runHandle(e,t){const r=new o.Readable;return r._read=()=>{r._read=()=>{},c.bindingsStreamToGraphQl(e.bindingsStream,e.context,{materializeRdfJsTerms:!0}).then((e=>{r.push(JSON.stringify(e,null," ")),r.push(null)})).catch((e=>r.emit("error",e)))},{data:r}}}t.ActorQueryResultSerializeTree=c},78149:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.bindingsStreamToGraphQl=void 0;const a=r(73505),{bindingsStreamToGraphQl:o}=a.ActorQueryResultSerializeTree;t.bindingsStreamToGraphQl=o,i(r(73505),t)},71644:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQuerySourceIdentifyHypermediaSparql=void 0;const n=r(62100),i=r(90711),a=r(90412),o=r(81926),s=r(96331),c=r(40229);class u extends n.ActorQuerySourceIdentifyHypermedia{constructor(e){super(e,"sparql")}async testMetadata(e){return e.forceSourceType||e.metadata.sparqlService||this.checkUrlSuffix&&e.url.endsWith("/sparql")?(0,a.passTest)({filterFactor:1}):(0,a.failTest)(`Actor ${this.name} could not detect a SPARQL service description or URL ending on /sparql.`)}async run(e){this.logInfo(e.context,`Identified ${e.url} as sparql source with service URL: ${e.metadata.sparqlService||e.url}`);const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=new s.Factory(t);return{source:new c.QuerySourceSparql(e.forceSourceType?e.url:e.metadata.sparqlService||e.url,e.context,this.mediatorHttp,this.bindMethod,t,r,await o.BindingsFactory.create(this.mediatorMergeBindingsContext,e.context,t),this.forceHttpGet,this.cacheSize,this.countTimeout)}}}t.ActorQuerySourceIdentifyHypermediaSparql=u},40229:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuerySourceSparql=void 0;const n=r(90711),i=r(90412),a=r(99214),o=r(75627),s=r(92603),c=r(89096),u=r(3285),l=r(96331),d={type:"estimate",value:Number.POSITIVE_INFINITY};class p{constructor(e,t,r,n,i,a,o,u,l,d){this.referenceValue=e,this.url=e,this.context=t,this.mediatorHttp=r,this.bindMethod=n,this.dataFactory=i,this.algebraFactory=a,this.bindingsFactory=o,this.endpointFetcher=new s.SparqlEndpointFetcher({method:u?"GET":"POST",fetch:(e,t)=>this.mediatorHttp.mediate({input:e,init:t,context:this.lastSourceContext}),prefixVariableQuestionMark:!0,dataFactory:i}),this.cache=l>0?new c.LRUCache({max:l}):void 0,this.countTimeout=d}async getSelectorShape(){return p.SELECTOR_SHAPE}queryBindings(e,t,r){let i;i=r?.joinBindings?p.addBindingsToOperation(this.algebraFactory,this.bindMethod,e,r.joinBindings):Promise.resolve(e);const a=new o.TransformIterator((async()=>{const e=await i,a=l.Util.inScopeVariables(e),o=t.get(n.KeysInitQuery.queryString),s=!r?.joinBindings&&o?o:p.operationToSelectQuery(this.algebraFactory,e,a),c=p.getOperationUndefs(e);return this.queryBindingsRemote(this.url,s,a,t,c)}),{autoStart:!1});return this.attachMetadata(a,t,i),a}queryQuads(e,t){this.lastSourceContext=this.context.merge(t);const r=this.endpointFetcher.fetchTriples(this.url,t.get(n.KeysInitQuery.queryString)??p.operationToQuery(e));this.lastSourceContext=void 0;const i=(0,o.wrap)(r,{autoStart:!1,maxBufferSize:Number.POSITIVE_INFINITY});return this.attachMetadata(i,t,Promise.resolve(e.input)),i}queryBoolean(e,t){this.lastSourceContext=this.context.merge(t);const r=this.endpointFetcher.fetchAsk(this.url,t.get(n.KeysInitQuery.queryString)??p.operationToQuery(e));return this.lastSourceContext=void 0,r}queryVoid(e,t){this.lastSourceContext=this.context.merge(t);const r=this.endpointFetcher.fetchUpdate(this.url,t.get(n.KeysInitQuery.queryString)??p.operationToQuery(e));return this.lastSourceContext=void 0,r}attachMetadata(e,t,r){let n=[];new Promise((async(e,i)=>{let a;try{const i=await r,o=l.Util.inScopeVariables(i);a=p.operationToCountQuery(this.dataFactory,this.algebraFactory,i);const s=p.getOperationUndefs(i);n=o.map((e=>({variable:e,canBeUndef:s.some((t=>t.equals(e)))})));const c=this.cache?.get(a);if(void 0!==c)return e(c);const u=setTimeout((()=>e(d)),this.countTimeout),h=this.dataFactory.variable("count"),f=await this.queryBindingsRemote(this.url,a,[h],t,[]);f.on("data",(t=>{clearTimeout(u);const r=t.get(h),n={type:"estimate",value:Number.POSITIVE_INFINITY};if(r){const e=Number.parseInt(r.value,10);Number.isNaN(e)||(n.type="exact",n.value=e,this.cache?.set(a,n))}return e(n)})),f.on("error",(()=>{clearTimeout(u),e(d)})),f.on("end",(()=>{clearTimeout(u),e(d)}))}catch(e){return i(e)}})).then((t=>{e.setProperty("metadata",{state:new a.MetadataValidationState,cardinality:t,variables:n})})).catch((()=>e.setProperty("metadata",{state:new a.MetadataValidationState,cardinality:d,variables:n})))}static async addBindingsToOperation(e,t,r,n){const i=await n.bindings.toArray();switch(t){case"values":return e.createJoin([e.createValues(n.metadata.variables.map((e=>e.variable)),i.map((e=>Object.fromEntries([...e].map((([e,t])=>[`?${e.value}`,t])))))),r],!1);case"union":throw new Error('Not implemented yet: "union" case');case"filter":throw new Error('Not implemented yet: "filter" case')}}static operationToSelectQuery(e,t,r){return p.operationToQuery(e.createProject(t,r))}static operationToCountQuery(e,t,r){return p.operationToQuery(t.createProject(t.createExtend(t.createGroup(r,[],[t.createBoundAggregate(e.variable("var0"),"count",t.createWildcardExpression(),!1)]),e.variable("count"),t.createTermExpression(e.variable("var0"))),[e.variable("count")]))}static operationToQuery(e){return(0,l.toSparql)(e,{sparqlStar:!0})}static getOperationUndefs(e){const t=[];return l.Util.recurseOperation(e,{leftjoin(e){const r=l.Util.inScopeVariables(e.input[0]),n=l.Util.inScopeVariables(e.input[1]);for(const e of n)r.some((t=>t.equals(e)))||t.push(e);return!1},values(e){for(const r of e.variables)e.bindings.some((e=>!(`?${r.value}`in e)))&&t.push(r);return!1},union(e){const r=e.input.map(l.Util.inScopeVariables);for(const e of(0,u.uniqTerms)(r.flat()))r.every((t=>t.some((t=>t.equals(e)))))||t.push(e);return!0}}),(0,u.uniqTerms)(t)}async queryBindingsRemote(e,t,r,n,a){const s=new Set;for(const e of a)s.add(e.value);this.lastSourceContext=this.context.merge(n);const c=await this.endpointFetcher.fetchBindings(e,t);return this.lastSourceContext=void 0,(0,o.wrap)(c,{autoStart:!1,maxBufferSize:Number.POSITIVE_INFINITY}).map((t=>this.bindingsFactory.bindings(r.map((r=>{const n=t[`?${r.value}`];return s.has(r.value)||n||i.Actor.getContextLogger(this.context)?.warn(`The endpoint ${e} failed to provide a binding for ${r.value}.`),[r,n]})).filter((([e,t])=>Boolean(t))))))}toString(){return`QuerySourceSparql(${this.url})`}}t.QuerySourceSparql=p,p.SELECTOR_SHAPE={type:"disjunction",children:[{type:"operation",operation:{operationType:"wildcard"},joinBindings:!0}]}},83101:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(71644),t),i(r(40229),t)},17685:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQuerySourceIdentifyHypermedia=void 0;const n=r(559),i=r(90711),a=r(90412),o=r(81926),s=r(20386);class c extends n.ActorQuerySourceIdentify{constructor(e){super(e)}async test(e){return"string"!=typeof e.querySourceUnidentified.value?(0,a.failTest)(`${this.name} requires a single query source with a URL value to be present in the context.`):(0,a.passTestVoid)()}async run(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory);return{querySource:{source:new s.QuerySourceHypermedia(this.cacheSize,e.querySourceUnidentified.value,e.querySourceUnidentified.type,this.maxIterators,this.aggregateTraversalStore&&Boolean(e.querySourceUnidentified.context?.get(i.KeysQuerySourceIdentify.traverse)),{mediatorMetadata:this.mediatorMetadata,mediatorMetadataExtract:this.mediatorMetadataExtract,mediatorMetadataAccumulate:this.mediatorMetadataAccumulate,mediatorDereferenceRdf:this.mediatorDereferenceRdf,mediatorQuerySourceIdentifyHypermedia:this.mediatorQuerySourceIdentifyHypermedia,mediatorRdfResolveHypermediaLinks:this.mediatorRdfResolveHypermediaLinks,mediatorRdfResolveHypermediaLinksQueue:this.mediatorRdfResolveHypermediaLinksQueue},(t=>this.logWarn(e.context,t)),t,await o.BindingsFactory.create(this.mediatorMergeBindingsContext,e.context,t)),context:e.querySourceUnidentified.context??new a.ActionContext}}}}t.ActorQuerySourceIdentifyHypermedia=c},17140:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedRdfSourcesAsyncRdfIterator=void 0;const n=r(90711),i=r(99214),a=r(75627);class o extends a.BufferedIterator{constructor(e,t,r,n,i,a,o,s){if(super({autoStart:!1,...s}),this.started=!1,this.currentIterators=[],this.iteratorsPendingCreation=0,this.iteratorsPendingTermination=0,this.accumulatedMetadata=Promise.resolve(void 0),this._reading=!1,this.cacheSize=e,this.operation=t,this.queryBindingsOptions=r,this.context=n,this.firstUrl=i,this.maxIterators=a,this.sourceStateGetter=o,this.maxIterators<=0)throw new Error(`LinkedRdfSourcesAsyncRdfIterator.maxIterators must be larger than zero, but got ${this.maxIterators}`)}kickstart(){this.started||this._fillBufferAsync()}getProperty(e,t){return"metadata"!==e||this.started||(this.preflightMetadata||(this.preflightMetadata=new Promise(((e,t)=>{this.sourceStateGetter({url:this.firstUrl},{}).then((t=>{const r=t.source.queryBindings(this.operation,this.context);r.getProperty("metadata",(n=>{n.state=new i.MetadataValidationState,r.destroy(),this.accumulateMetadata(t.metadata,n).then((r=>{const i={...t.metadata,...n,...r};e(i)})).catch((()=>{e({...t.metadata,state:new i.MetadataValidationState})}))}))})).catch(t)}))),this.preflightMetadata.then((e=>this.setProperty("metadata",e))).catch((()=>{}))),super.getProperty(e,t)}_end(e){for(const e of this.currentIterators)e.destroy();super._end(e)}_read(e,t){if(this.started){for(const t of this.currentIterators){for(;e>0;){const r=t.read();if(null===r)break;e--,this._push(r)}if(e<=0)break}e>=0&&this.canStartNewIterator()?this.sourceStateGetter({url:this.firstUrl},{}).then((e=>{this.startIteratorsForNextUrls(e.handledDatasets,!1),t()})):t()}else this.started=!0,this.sourceStateGetter({url:this.firstUrl},{}).then((e=>{this.startIterator(e),t()})).catch((e=>setTimeout((()=>this.destroy(e)))))}canStartNewIterator(){return this.currentIterators.length+this.iteratorsPendingCreation+this.iteratorsPendingTermination0}startIterator(e){try{const t=e.source.queryBindings(this.operation,this.context,this.queryBindingsOptions);this.currentIterators.push(t);let r=!1,n=!1;t._destination=this,t.on("error",(e=>this.destroy(e))),t.on("readable",(()=>this._fillBuffer())),t.on("end",(()=>{this.currentIterators.splice(this.currentIterators.indexOf(t),1),r=!0,n||this.iteratorsPendingTermination++,n&&this.startIteratorsForNextUrls(e.handledDatasets,!0)})),t.getProperty("metadata",(t=>{this.accumulatedMetadata=this.accumulatedMetadata.then((a=>(async()=>(a||(a=e.metadata),this.accumulateMetadata(a,t)))().then((a=>{const o={...e.metadata,...t,...a};return o.state=new i.MetadataValidationState,this.updateMetadata(o),this.preflightMetadata&&this.preflightMetadata.then((e=>e.state.invalidate())).catch((()=>{})),this.getSourceLinks(o,e).then((e=>Promise.all(e))).then((async t=>{const i=await this.getLinkQueue();for(const r of t)i.push(r,e.link);n=!0,r&&this.iteratorsPendingTermination--,this.startIteratorsForNextUrls(e.handledDatasets,!0)})).catch((e=>this.destroy(e))),o})))).catch((e=>(this.destroy(e),{})))}))}catch(e){this.destroy(e)}}updateMetadata(e){const t=this.getProperty("metadata");this.setProperty("metadata",e),t?.state.invalidate()}isRunning(){return!this.done}startIteratorsForNextUrls(e,t){this.getLinkQueue().then((r=>{for(;this.canStartNewIterator()&&this.isRunning();){const t=r.pop();if(!t)break;this.iteratorsPendingCreation++,this.sourceStateGetter(t,e).then((e=>{const t=this.context.get(n.KeysStatistics.dereferencedLinks);t&&t.updateStatistic({url:e.link.url,metadata:{...e.metadata,...e.link.metadata}},e.source),this.iteratorsPendingCreation--,this.startIterator(e)})).catch((e=>this.emit("error",e)))}t&&this.isCloseable(r,!0)&&this.close()})).catch((e=>this.destroy(e)))}isCloseable(e,t){return e.isEmpty()&&!this.areIteratorsRunning()}}t.LinkedRdfSourcesAsyncRdfIterator=o},10037:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediatedLinkedRdfSourcesAsyncRdfIterator=void 0;const n=r(90711),i=r(17140);class a extends i.LinkedRdfSourcesAsyncRdfIterator{constructor(e,t,r,n,i,a,o,s,c,u,l,d,p,h){super(e,t,r,n,a,o,s,c?{maxBufferSize:Number.POSITIVE_INFINITY}:void 0),this.wasForcefullyClosed=!1,this.forceSourceType=i,this.mediatorMetadataAccumulate=u,this.mediatorRdfResolveHypermediaLinks=l,this.mediatorRdfResolveHypermediaLinksQueue=d,this.handledUrls={[a]:!0},this.aggregatedStore=c,this.dataFactory=p,this.algebraFactory=h}close(){this.aggregatedStore?this.getLinkQueue().then((e=>{this.isCloseable(e,!1)?(this.aggregatedStore&&setTimeout((()=>this.aggregatedStore.end())),super.close()):this.wasForcefullyClosed=!0})).catch((e=>super.destroy(e))):super.close()}destroy(e){this.aggregatedStore?this.getLinkQueue().then((t=>{e??this.isCloseable(t,!1)?(this.aggregatedStore&&setTimeout((()=>this.aggregatedStore.end())),super.destroy(e)):this.wasForcefullyClosed=!0})).catch((e=>super.destroy(e))):super.destroy(e)}isCloseable(e,t){return(t?e.isEmpty():this.wasForcefullyClosed||e.isEmpty())&&!this.areIteratorsRunning()}canStartNewIterator(){return!this.wasForcefullyClosed&&this.aggregatedStore&&this.aggregatedStore.hasRunningIterators()||super.canStartNewIterator()}canStartNewIteratorConsiderReadable(){return!this.aggregatedStore}isRunning(){return this.aggregatedStore&&this.aggregatedStore.hasRunningIterators()||!this.done}getLinkQueue(){return this.linkQueue||(this.linkQueue=this.mediatorRdfResolveHypermediaLinksQueue.mediate({firstUrl:this.firstUrl,context:this.context}).then((e=>e.linkQueue))),this.linkQueue}async getSourceLinks(e,t){try{const{links:r}=await this.mediatorRdfResolveHypermediaLinks.mediate({context:this.context,metadata:e}),i=this.context.get(n.KeysStatistics.discoveredLinks);if(i)for(const e of r)i.updateStatistic({url:e.url,metadata:{...e.metadata}},t.link);return r.filter((e=>!this.handledUrls[e.url]&&(this.handledUrls[e.url]=!0,!0)))}catch{return[]}}startIterator(e){if(this.aggregatedStore&&!this.aggregatedStore.containedSources.has(e.link.url)){this.aggregatedStore?.containedSources.add(e.link.url);const t=e.source.queryBindings(this.algebraFactory.createPattern(this.dataFactory.variable("s"),this.dataFactory.variable("p"),this.dataFactory.variable("o"),this.dataFactory.variable("g")),this.context.set(n.KeysQueryOperation.unionDefaultGraph,!0)).map((e=>this.dataFactory.quad(e.get("s"),e.get("p"),e.get("o"),e.get("g"))));this.aggregatedStore.import(t).on("end",(()=>{super.startIterator(e)}))}else super.startIterator(e)}async accumulateMetadata(e,t){return(await this.mediatorMetadataAccumulate.mediate({mode:"append",accumulatedMetadata:e,appendingMetadata:t,context:this.context})).metadata}updateMetadata(e){super.updateMetadata(e),this.aggregatedStore?.setBaseMetadata(e,!0)}}t.MediatedLinkedRdfSourcesAsyncRdfIterator=a},20386:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuerySourceHypermedia=void 0;const n=r(20998),i=r(90711),a=r(75627),o=r(89096),s=r(19198),c=r(96331),u=r(10037),l=r(22573);t.QuerySourceHypermedia=class{constructor(e,t,r,n,i,a,s,c,u){this.referenceValue=t,this.cacheSize=e,this.firstUrl=t,this.forceSourceType=r,this.maxIterators=n,this.mediators=a,this.aggregateStore=i,this.logWarning=s,this.dataFactory=c,this.bindingsFactory=u,this.sourcesState=new o.LRUCache({max:this.cacheSize})}async getSelectorShape(e){return(await this.getSourceCached({url:this.firstUrl},{},e,this.getAggregateStore(e))).source.getSelectorShape(e)}queryBindings(e,t,r){const a=this.getAggregateStore(t);if(a&&"pattern"===e.type&&a.started)return new n.QuerySourceRdfJs(a,t.getSafe(i.KeysInitQuery.dataFactory),this.bindingsFactory).queryBindings(e,t);0===this.sourcesState.size&&this.getSourceCached({url:this.firstUrl},{},t,a).catch((e=>l.destroy(e)));const o=t.getSafe(i.KeysInitQuery.dataFactory),s=new c.Factory(o),l=new u.MediatedLinkedRdfSourcesAsyncRdfIterator(this.cacheSize,e,r,t,this.forceSourceType,this.firstUrl,this.maxIterators,((e,r)=>this.getSourceCached(e,r,t,a)),a,this.mediators.mediatorMetadataAccumulate,this.mediators.mediatorRdfResolveHypermediaLinks,this.mediators.mediatorRdfResolveHypermediaLinksQueue,o,s);if(a){a.started=!0;const e=()=>l.kickstart();a.addIteratorCreatedListener(e),l.on("end",(()=>a.removeIteratorCreatedListener(e)))}return l}queryQuads(e,t){return new a.TransformIterator((async()=>(await this.getSourceCached({url:this.firstUrl},{},t,this.getAggregateStore(t))).source.queryQuads(e,t)))}async queryBoolean(e,t){const r=await this.getSourceCached({url:this.firstUrl},{},t,this.getAggregateStore(t));return await r.source.queryBoolean(e,t)}async queryVoid(e,t){const r=await this.getSourceCached({url:this.firstUrl},{},t,this.getAggregateStore(t));return await r.source.queryVoid(e,t)}async getSource(e,t,r,n){e.context&&(r=r.merge(e.context));let i,a,o=e.url;try{const t=await this.mediators.mediatorDereferenceRdf.mediate({context:r,url:o});o=t.url;const n=await this.mediators.mediatorMetadata.mediate({context:r,url:o,quads:t.data,triples:t.metadata?.triples});n.data.on("error",(()=>{})),a=(await this.mediators.mediatorMetadataExtract.mediate({context:r,url:o,metadata:n.metadata,headers:t.headers,requestTime:t.requestTime})).metadata,i=n.data,e.transform&&(i=await e.transform(i))}catch(e){i=new s.Readable,i.read=()=>(setTimeout((()=>i.emit("error",e))),null),({metadata:a}=await this.mediators.mediatorMetadataAccumulate.mediate({context:r,mode:"initialize"})),this.logWarning(`Metadata extraction for ${o} failed: ${e.message}`)}n?.setBaseMetadata(a,!1),n?.containedSources.add(e.url),n?.import(i);const{source:c,dataset:u}=await this.mediators.mediatorQuerySourceIdentifyHypermedia.mediate({context:r,forceSourceType:e.url===this.firstUrl?this.forceSourceType:void 0,handledDatasets:t,metadata:a,quads:i,url:o});return u&&(t[u]=!0),{link:e,source:c,metadata:a,handledDatasets:t}}getSourceCached(e,t,r,n){let i=this.sourcesState.get(e.url);return i||(i=this.getSource(e,t,r,n),e.url!==this.firstUrl&&void 0!==n||this.sourcesState.set(e.url,i),i)}getAggregateStore(e){let t;if(this.aggregateStore){const r=e.get(i.KeysQuerySourceIdentify.hypermediaSourcesAggregatedStores);if(r)return t=r.get(this.firstUrl),t||(t=new l.StreamingStoreMetadata(void 0,(async(t,r)=>(await this.mediators.mediatorMetadataAccumulate.mediate({mode:"append",accumulatedMetadata:t,appendingMetadata:r,context:e})).metadata)),r.set(this.firstUrl,t)),t}}toString(){return`QuerySourceHypermedia(${this.firstUrl})`}}},22573:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StreamingStoreMetadata=void 0;const n=r(4809),i=r(99214),a=r(18962);class o extends a.StreamingStore{constructor(e,t){super(e),this.started=!1,this.containedSources=new Set,this.runningIterators=new Set,this.iteratorCreatedListeners=new Set,this.baseMetadata={state:new i.MetadataValidationState,cardinality:{type:"exact",value:0},variables:[]},this.metadataAccumulator=t}import(e){return this.ended||super.import(e),e}hasRunningIterators(){return this.runningIterators.size>0}match(e,t,r,a){const o=super.match(e,t,r,a),s=new n.ClosableTransformIterator(o,{autoStart:!1,onClose:()=>{this.runningIterators.delete(s)}});let c=this.getStore().countQuads(e,t,r,a);const u={state:new i.MetadataValidationState,cardinality:{type:"estimate",value:c}};s.setProperty("metadata",u),s.setProperty("lastCount",c),o.on("quad",(()=>{s.setProperty("lastCount",++c),this.updateMetadataState(s,c)})),this.runningIterators.add(s);for(const e of this.iteratorCreatedListeners)e();return s}setBaseMetadata(e,t){if(this.baseMetadata={...e},this.baseMetadata.cardinality={type:"exact",value:0},t)for(const e of this.runningIterators){const t=e.getProperty("lastCount");this.updateMetadataState(e,t)}}updateMetadataState(e,t){const r={state:new i.MetadataValidationState,cardinality:{type:"estimate",value:t},variables:[]};this.metadataAccumulator(this.baseMetadata,r).then((t=>{t.state=new i.MetadataValidationState;const r=e.getProperty("metadata");e.setProperty("metadata",t),r?.state.invalidate()})).catch((()=>{}))}addIteratorCreatedListener(e){this.iteratorCreatedListeners.add(e)}removeIteratorCreatedListener(e){this.iteratorCreatedListeners.delete(e)}}t.StreamingStoreMetadata=o},79881:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(17685),t),i(r(20386),t)},37859:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQuerySourceIdentifyRdfJs=void 0;const n=r(559),i=r(90711),a=r(90412),o=r(81926),s=r(70020);class c extends n.ActorQuerySourceIdentify{constructor(e){super(e)}async test(e){const t=e.querySourceUnidentified;return void 0!==t.type&&"rdfjs"!==t.type?(0,a.failTest)(`${this.name} requires a single query source with rdfjs type to be present in the context.`):"string"!=typeof t.value&&"match"in t.value?(0,a.passTestVoid)():(0,a.failTest)(`${this.name} received an invalid rdfjs query source.`)}async run(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory);return{querySource:{source:new s.QuerySourceRdfJs(e.querySourceUnidentified.value,t,await o.BindingsFactory.create(this.mediatorMergeBindingsContext,e.context,t)),context:e.querySourceUnidentified.context??new a.ActionContext}}}}t.ActorQuerySourceIdentifyRdfJs=c},31994:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},70020:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuerySourceRdfJs=void 0;const n=r(559),i=r(90711),a=r(99214),o=r(75627),s=r(3285),c=r(96331);class u{constructor(e,t,r){this.source=e,this.referenceValue=e,this.dataFactory=t,this.bindingsFactory=r;const n=new c.Factory(this.dataFactory);this.selectorShape={type:"operation",operation:{operationType:"pattern",pattern:n.createPattern(this.dataFactory.variable("s"),this.dataFactory.variable("p"),this.dataFactory.variable("o"))},variablesOptional:[this.dataFactory.variable("s"),this.dataFactory.variable("p"),this.dataFactory.variable("o")]}}static nullifyVariables(e,t){return!e||"Variable"===e.termType||!t&&"Quad"===e.termType&&(0,s.someTermsNested)(e,(e=>"Variable"===e.termType))?void 0:e}static hasDuplicateVariables(e){const t=(0,s.filterTermsNested)(e,(e=>"Variable"===e.termType));return t.length>1&&(0,s.uniqTerms)(t).lengths.destroy(e))),(0,n.quadsToBindings)(s,e,this.dataFactory,this.bindingsFactory,Boolean(t.get(i.KeysQueryOperation.unionDefaultGraph)))}async setMetadata(e,t){const r=Boolean(this.source.features?.quotedTripleFiltering);let n;if(this.source.countQuads)n=await this.source.countQuads(u.nullifyVariables(t.subject,r),u.nullifyVariables(t.predicate,r),u.nullifyVariables(t.object,r),u.nullifyVariables(t.graph,r));else{let e=0;n=await new Promise(((n,i)=>{const a=this.source.match(u.nullifyVariables(t.subject,r),u.nullifyVariables(t.predicate,r),u.nullifyVariables(t.object,r),u.nullifyVariables(t.graph,r));a.on("error",i),a.on("end",(()=>n(e))),a.on("data",(()=>e++))}))}const i=!r&&(0,s.someTerms)(t,(e=>"Quad"===e.termType))||u.hasDuplicateVariables(t);e.setProperty("metadata",{state:new a.MetadataValidationState,cardinality:{type:i?"estimate":"exact",value:n}})}queryQuads(e,t){throw new Error("queryQuads is not implemented in QuerySourceRdfJs")}queryBoolean(e,t){throw new Error("queryBoolean is not implemented in QuerySourceRdfJs")}queryVoid(e,t){throw new Error("queryVoid is not implemented in QuerySourceRdfJs")}toString(){return`QuerySourceRdfJs(${this.source.constructor.name})`}}t.QuerySourceRdfJs=u},20998:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(37859),t),i(r(31994),t),i(r(70020),t)},914:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinEntriesSortCardinality=void 0;const n=r(39195),i=r(90412);class a extends n.ActorRdfJoinEntriesSort{constructor(e){super(e)}async test(e){return(0,i.passTestVoid)()}async run(e){return{entries:[...e.entries].sort(((e,t)=>e.metadata.cardinality.value-t.metadata.cardinality.value))}}}t.ActorRdfJoinEntriesSortCardinality=a},4669:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(914),t)},17937:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinHash=void 0;const n=r(95445),i=r(90412),a=r(18888),o=r(4809),s=r(75627),c=r(25579),u=r(43347);class l extends n.ActorRdfJoin{constructor(e){super(e,{logicalType:"inner",physicalName:"hash-"+(e.canHandleUndefs?"undef":"def"),limitEntries:2,requiresVariableOverlap:!0,canHandleUndefs:e.canHandleUndefs})}async getOutput(e,t){const r=t.metadatas;let i;const l=n.ActorRdfJoin.overlappingVariables(r);if(this.canHandleUndefs){const e=t.entriesSorted[0].output,r=t.entriesSorted[1].output;i=new o.ClosableTransformIterator((async()=>{const t=new a.BindingsIndexUndef(l,(e=>e&&"Variable"!==e.termType?(0,u.termToString)(e):""),!0);return await new Promise((r=>{e.bindingsStream.on("data",(e=>{(t.getFirst(e,!1)??t.put(e,[])).push(e)})),e.bindingsStream.on("end",r),e.bindingsStream.on("error",(e=>{i.emit("error",e)}))})),new s.MultiTransformIterator(r.bindingsStream,{multiTransform:e=>new s.ArrayIterator(t.get(e).flat().map((t=>n.ActorRdfJoin.joinBindings(e,t))).filter((e=>null!==e)),{autoStart:!1}),autoStart:!1})}),{autoStart:!1,onClose(){e.bindingsStream.destroy(),r.bindingsStream.destroy()}})}else{const{hashFunction:r}=await this.mediatorHashBindings.mediate({context:e.context}),a=l.map((e=>e.variable));i=new c.HashJoin(t.entriesSorted[0].output.bindingsStream,t.entriesSorted[1].output.bindingsStream,(e=>r(e,a)),n.ActorRdfJoin.joinBindings)}return{result:{type:"bindings",bindingsStream:i,metadata:async()=>await this.constructResultMetadata(t.entriesSorted,r,e.context)}}}async getJoinCoefficients(e,t){let r=e.entries;t.metadatas[1].cardinality.value{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinMultiBindSource=void 0;const n=r(95445),i=r(90711),a=r(90412),o=r(4809),s=r(67021),c=r(75627),u=r(96331);class l extends n.ActorRdfJoin{constructor(e){super(e,{logicalType:"inner",physicalName:"bind-source",canHandleUndefs:!0})}async getOutput(e,t){const r=e.context.getSafe(i.KeysInitQuery.dataFactory),n=new u.Factory(r),a=t.entriesSorted;this.logDebug(e.context,"First entry for Bind Join Source: ",(()=>({entry:a[0].operation,metadata:a[0].metadata})));for(const[e,t]of a.entries())0!==e&&t.output.bindingsStream.close();const l=a[0].output,d=a[0].metadata,p=[...a];p.splice(0,1);const h=(0,s.getOperationSource)(p[0].operation),f=this.createOperationFromEntries(n,p),y=new o.ChunkedIterator(l.bindingsStream,this.blockSize,{autoStart:!1});return{result:{type:"bindings",bindingsStream:new c.UnionIterator(y.map((t=>h.source.queryBindings(f,h.context?e.context.merge(h.context):e.context,{joinBindings:{bindings:t,metadata:d}})))),metadata:()=>this.constructResultMetadata(a,a.map((e=>e.metadata)),e.context)},physicalPlanMetadata:{bindIndex:t.entriesUnsorted.indexOf(a[0])}}}async sortJoinEntries(e,t){const r=await n.ActorRdfJoin.sortJoinEntries(this.mediatorJoinEntriesSort,e,t);return r.isFailed()?r:(e=(e=r.get()).sort(((e,t)=>e.operationModified&&!t.operationModified?-1:0)),(0,a.passTest)(e))}async getJoinCoefficients(e,t){let{metadatas:r}=t;const o=e.context.getSafe(i.KeysInitQuery.dataFactory),c=new u.Factory(o),l=e.entries.map(((e,t)=>({...e,metadata:r[t]}))),d=await this.sortJoinEntries(l,e.context);if(d.isFailed())return d;const p=d.get();r=p.map((e=>e.metadata));const h=n.ActorRdfJoin.getRequestInitialTimes(r),f=n.ActorRdfJoin.getRequestItemTimes(r),y=[...p],g=[...h],m=[...f];y.splice(0,1),g.splice(0,1),m.splice(0,1);const b=y.map((e=>(0,s.getOperationSource)(e.operation)));if(b.some((e=>!e)))return(0,a.failTest)(`Actor ${this.name} can not bind on remaining operations without source annotation`);if(b.some((e=>e!==b[0])))return(0,a.failTest)(`Actor ${this.name} can not bind on remaining operations with non-equal source annotation`);const v=b[0],_=this.createOperationFromEntries(c,y),w=await v.source.getSelectorShape(e.context);if(!(0,s.doesShapeAcceptOperation)(w,_,{joinBindings:!0}))return(0,a.failTest)(`Actor ${this.name} detected a source that can not handle passing down join bindings`);const O=await Promise.all(y.map((async t=>(await this.mediatorJoinSelectivity.mediate({entries:[p[0],t],context:e.context})).selectivity*this.selectivityModifier))),T=y.map(((e,t)=>e.metadata.cardinality.value*O[t])).reduce(((e,t)=>e+t),0);return(0,a.passTestWithSideData)({iterations:1,persistedItems:r[0].cardinality.value,blockingItems:r[0].cardinality.value,requestTime:h[0]+r[0].cardinality.value*f[0]+h[1]+T*f[1]},{...t,entriesUnsorted:l,entriesSorted:p})}createOperationFromEntries(e,t){return 1===t.length?t[0].operation:e.createJoin(t.map((e=>e.operation)),!0)}}t.ActorRdfJoinMultiBindSource=l},79731:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(18697),t)},14652:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinMultiBind=void 0;const n=r(95445),i=r(90711),a=r(90412),o=r(81926),s=r(67021),c=r(75627),u=r(96331);class l extends n.ActorRdfJoin{constructor(e){super(e,{logicalType:"inner",physicalName:"bind",canHandleUndefs:!0,isLeaf:!1})}static createBindStream(e,t,r,n,i,a,o){const u="depth-first"===e,l=e=>{const t=r.map((t=>(0,s.materializeOperation)(t,e,a,o,{bindFilter:!0}))),i=t=>t.merge(e);return new c.TransformIterator((async()=>(await n(t,e)).transform({map:i})),{maxBufferSize:128,autoStart:u})};switch(e){case"depth-first":return new c.MultiTransformIterator(t,{autoStart:!1,multiTransform:l,optional:i});case"breadth-first":return new c.UnionIterator(t.transform({map:l,optional:i}),{autoStart:!1});default:throw new Error(`Received request for unknown bind order: ${e}`)}}async getOutput(e,t){const r=e.context.getSafe(i.KeysInitQuery.dataFactory),n=new u.Factory(r),a=await o.BindingsFactory.create(this.mediatorMergeBindingsContext,e.context,r),c=t.entriesSorted;this.logDebug(e.context,"First entry for Bind Join: ",(()=>({entry:c[0].operation,metadata:c[0].metadata})));for(const[e,t]of c.entries())0!==e&&t.output.bindingsStream.close();const d=c[0].output,p=[...c];p.splice(0,1);const h=e.context.set(i.KeysQueryOperation.joinLeftMetadata,c[0].metadata).set(i.KeysQueryOperation.joinRightMetadatas,p.map((e=>e.metadata)));return{result:{type:"bindings",bindingsStream:l.createBindStream(this.bindOrder,d.bindingsStream,p.map((e=>e.operation)),(async(e,t)=>{const r=1===e.length?e[0]:n.createJoin(e);return(0,s.getSafeBindings)(await this.mediatorQueryOperation.mediate({operation:r,context:h?.set(i.KeysQueryOperation.joinBindings,t)})).bindingsStream}),!1,n,a),metadata:()=>this.constructResultMetadata(c,c.map((e=>e.metadata)),e.context)},physicalPlanMetadata:{bindIndex:t.entriesUnsorted.indexOf(c[0]),bindOperation:c[0].operation,bindOperationCardinality:c[0].metadata.cardinality,bindOrder:this.bindOrder}}}canBindWithOperation(e){let t=!0;return u.Util.recurseOperation(e,{[u.Algebra.types.EXTEND]:()=>(t=!1,!1),[u.Algebra.types.GROUP]:()=>(t=!1,!1)}),t}async getJoinCoefficients(e,t){let{metadatas:r}=t;const i=e.entries.map(((e,t)=>({...e,metadata:r[t]}))),o=await n.ActorRdfJoin.sortJoinEntries(this.mediatorJoinEntriesSort,i,e.context);if(o.isFailed())return o;const s=o.get();r=s.map((e=>e.metadata));const c=n.ActorRdfJoin.getRequestInitialTimes(r),u=n.ActorRdfJoin.getRequestItemTimes(r),l=[...s],d=[...c],p=[...u];if(l.splice(0,1),d.splice(0,1),p.splice(0,1),l.some((e=>!this.canBindWithOperation(e.operation))))return(0,a.failTest)(`Actor ${this.name} can not bind on Extend and Group operations`);if(l.some((e=>e.operationModified)))return(0,a.failTest)(`Actor ${this.name} can not be used over remaining entries with modified operations`);if(r[0].cardinality.value*this.minMaxCardinalityRatio>Math.max(...r.map((e=>e.cardinality.value))))return(0,a.failTest)(`Actor ${this.name} can only run if the smallest stream is much smaller than largest stream`);const h=await Promise.all(l.map((async t=>(await this.mediatorJoinSelectivity.mediate({entries:[s[0],t],context:e.context})).selectivity*this.selectivityModifier))),f=l.map(((e,t)=>e.metadata.cardinality.value*h[t])).reduce(((e,t)=>e+t),0),y=d.reduce(((e,t)=>e+t),0),g=p.reduce(((e,t)=>e+t),0);return(0,a.passTestWithSideData)({iterations:r[0].cardinality.value*f,persistedItems:0,blockingItems:0,requestTime:c[0]+r[0].cardinality.value*(u[0]+y+f*g)},{...t,entriesUnsorted:i,entriesSorted:s})}}t.ActorRdfJoinMultiBind=l},42815:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(14652),t)},82e3:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinMultiEmpty=void 0;const n=r(95445),i=r(90711),a=r(90412),o=r(99214),s=r(75627);class c extends n.ActorRdfJoin{constructor(e){super(e,{logicalType:"inner",physicalName:"multi-empty",canHandleUndefs:!0})}async test(e){return(await n.ActorRdfJoin.getMetadatas(e.entries)).every((e=>n.ActorRdfJoin.getCardinality(e).value>0))?(0,a.failTest)(`Actor ${this.name} can only join entries where at least one is empty`):super.test(e)}async getOutput(e){for(const t of e.entries)t.output.bindingsStream.close();const t=e.context.getSafe(i.KeysInitQuery.dataFactory);return{result:{bindingsStream:new s.ArrayIterator([],{autoStart:!1}),metadata:async()=>({state:new o.MetadataValidationState,cardinality:{type:"exact",value:0},variables:n.ActorRdfJoin.joinVariables(t,await n.ActorRdfJoin.getMetadatas(e.entries))}),type:"bindings"}}}async getJoinCoefficients(e,t){return(0,a.passTestWithSideData)({iterations:0,persistedItems:0,blockingItems:0,requestTime:0},t)}}t.ActorRdfJoinMultiEmpty=c},25445:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(82e3),t)},90246:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinMultiSmallestFilterBindings=void 0;const n=r(95445),i=r(90711),a=r(90412),o=r(81926),s=r(4809),c=r(67021),u=r(75627),l=r(96331);class d extends n.ActorRdfJoin{constructor(e){super(e,{logicalType:"inner",physicalName:"multi-smallest-filter-bindings",limitEntries:2,limitEntriesMin:!0,isLeaf:!1})}async sortJoinEntries(e,t){let{entries:r}=await this.mediatorJoinEntriesSort.mediate({entries:e,context:t});r=r.sort(((e,t)=>e.operationModified&&!t.operationModified?-1:0));const n=r.splice(0,1)[0];let i,o=-1,s=0;for(const[e,t]of r.entries()){const r=n.metadata.variables.filter((e=>t.metadata.variables.some((t=>e.variable.equals(t.variable))))).length;(!i||r>s||r===s&&(t.metadata.variables.lengthp.metadata.variables.some((t=>e.variable.equals(t.variable))))),g={},m=f.clone().map((e=>e.filter(((e,t)=>y.some((e=>e.variable.equals(t))))))).filter((e=>{const t=(0,o.bindingsToString)(e);return!(t in g)&&(g[t]=!0)})),b=new s.ChunkedIterator(m,this.blockSize,{autoStart:!1}),v=(0,c.getOperationSource)(p.operation),_={output:{type:"bindings",bindingsStream:new u.UnionIterator(b.map((t=>v.source.queryBindings(p.operation,v.context?e.context.merge(v.context):e.context,{filterBindings:{bindings:t,metadata:d.metadata}})))),metadata:p.output.metadata},operation:p.operation,operationModified:!0};p.output.bindingsStream.destroy();const w={output:(0,c.getSafeBindings)(await this.mediatorJoin.mediate({type:e.type,entries:[d,_],context:e.context.set(i.KeysRdfJoin.lastPhysicalJoin,this.physicalName)})),operation:r.createJoin([d.operation,_.operation],!1),operationModified:!0},O=h;return O.unshift(w),{result:await this.mediatorJoin.mediate({type:e.type,entries:O,context:e.context}),physicalPlanMetadata:{firstIndex:a.indexOf(d),secondIndex:a.indexOf(p)}}}async getJoinCoefficients(e,t){let{metadatas:r}=t;if(e.context.get(i.KeysRdfJoin.lastPhysicalJoin)===this.physicalName)return(0,a.failTest)(`Actor ${this.name} can not be called recursively`);r=[...r];const o=await this.sortJoinEntries(e.entries.map(((e,t)=>({...e,metadata:r[t]}))),e.context);if(o.isFailed())return o;const{first:s,second:u,remaining:l}=o.get(),d=(0,c.getOperationSource)(u.operation);if(!d)return(0,a.failTest)(`Actor ${this.name} can only process if entries[1] has a source`);const p=u.operation,h=await d.source.getSelectorShape(e.context);if(!(0,c.doesShapeAcceptOperation)(h,p,{filterBindings:!0}))return(0,a.failTest)(`Actor ${this.name} can only process if entries[1] accept filterBindings`);r=[s.metadata,u.metadata,...l.map((e=>e.metadata))];const f=n.ActorRdfJoin.getRequestInitialTimes(r),y=n.ActorRdfJoin.getRequestItemTimes(r),{selectivity:g}=await this.mediatorJoinSelectivity.mediate({entries:[s,u],context:e.context}),m=l.reduce(((e,t)=>e*t.metadata.cardinality.value*this.selectivityModifier),1);return(0,a.passTestWithSideData)({iterations:g*this.selectivityModifier*u.metadata.cardinality.value*m,persistedItems:s.metadata.cardinality.value,blockingItems:s.metadata.cardinality.value,requestTime:f[0]+r[0].cardinality.value*y[0]+f[1]+m*y[1]},t)}}t.ActorRdfJoinMultiSmallestFilterBindings=d},30615:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(90246),t)},20268:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinMultiSmallest=void 0;const n=r(95445),i=r(90711),a=r(90412),o=r(67021),s=r(96331);class c extends n.ActorRdfJoin{constructor(e){super(e,{logicalType:"inner",physicalName:"multi-smallest",limitEntries:3,limitEntriesMin:!0,canHandleUndefs:!0,isLeaf:!1})}async sortJoinEntries(e,t){return(await this.mediatorJoinEntriesSort.mediate({entries:e,context:t})).entries}async getOutput(e,t){const r=e.context.getSafe(i.KeysInitQuery.dataFactory),n=new s.Factory(r),a=t.sortedEntries,c=a[0],u=a[1];a.splice(0,2);const l={output:(0,o.getSafeBindings)(await this.mediatorJoin.mediate({type:e.type,entries:[c,u],context:e.context})),operation:n.createJoin([c.operation,u.operation],!1)};return a.push(l),{result:await this.mediatorJoin.mediate({type:e.type,entries:a,context:e.context})}}async getJoinCoefficients(e,t){let{metadatas:r}=t;r=[...r];const i=await this.sortJoinEntries(e.entries.map(((e,t)=>({...e,metadata:r[t]}))),e.context);r=i.map((e=>e.metadata));const o=n.ActorRdfJoin.getRequestInitialTimes(r),s=n.ActorRdfJoin.getRequestItemTimes(r);return(0,a.passTestWithSideData)({iterations:r[0].cardinality.value*r[1].cardinality.value*r.slice(2).reduce(((e,t)=>e*t.cardinality.value),1),persistedItems:0,blockingItems:0,requestTime:o[0]+r[0].cardinality.value*s[0]+o[1]+r[1].cardinality.value*s[1]+r.slice(2).reduce(((e,t,r)=>e+o.slice(2)[r]+t.cardinality.value*s.slice(2)[r]),0)},{...t,sortedEntries:i})}}t.ActorRdfJoinMultiSmallest=c},25925:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(20268),t)},31523:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinNestedLoop=void 0;const n=r(95445),i=r(90412),a=r(25579);class o extends n.ActorRdfJoin{constructor(e){super(e,{logicalType:"inner",physicalName:"nested-loop",limitEntries:2,canHandleUndefs:!0})}async getOutput(e){return{result:{type:"bindings",bindingsStream:new a.NestedLoopJoin(e.entries[0].output.bindingsStream,e.entries[1].output.bindingsStream,n.ActorRdfJoin.joinBindings,{autoStart:!1}),metadata:async()=>await this.constructResultMetadata(e.entries,await n.ActorRdfJoin.getMetadatas(e.entries),e.context)}}}async getJoinCoefficients(e,t){const{metadatas:r}=t,a=n.ActorRdfJoin.getRequestInitialTimes(r),o=n.ActorRdfJoin.getRequestItemTimes(r);return(0,i.passTestWithSideData)({iterations:r[0].cardinality.value*r[1].cardinality.value,persistedItems:0,blockingItems:0,requestTime:a[0]+r[0].cardinality.value*o[0]+a[1]+r[1].cardinality.value*o[1]},t)}}t.ActorRdfJoinNestedLoop=o},36229:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(31523),t)},52729:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinNone=void 0;const n=r(95445),i=r(90711),a=r(90412),o=r(81926),s=r(99214),c=r(75627);class u extends n.ActorRdfJoin{constructor(e){super(e,{logicalType:"inner",physicalName:"none",limitEntries:0})}async test(e){return e.entries.length>0?(0,a.failTest)(`Actor ${this.name} can only join zero entries`):await this.getJoinCoefficients(e,void 0)}async getOutput(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=await o.BindingsFactory.create(this.mediatorMergeBindingsContext,e.context,t);return{result:{bindingsStream:new c.ArrayIterator([r.bindings()],{autoStart:!1}),metadata:()=>Promise.resolve({state:new s.MetadataValidationState,cardinality:{type:"exact",value:1},variables:[]}),type:"bindings"}}}async getJoinCoefficients(e,t){return(0,a.passTestWithSideData)({iterations:0,persistedItems:0,blockingItems:0,requestTime:0},t)}}t.ActorRdfJoinNone=u},88766:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(52729),t)},40721:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinSingle=void 0;const n=r(95445),i=r(90412);class a extends n.ActorRdfJoin{constructor(e){super(e,{logicalType:"inner",physicalName:"single",limitEntries:1}),this.includeInLogs=!1}async test(e){return 1!==e.entries.length?(0,i.failTest)(`Actor ${this.name} can only join a single entry`):await this.getJoinCoefficients(e,void 0)}async getOutput(e){return{result:e.entries[0].output}}async getJoinCoefficients(e,t){return(0,i.passTestWithSideData)({iterations:0,persistedItems:0,blockingItems:0,requestTime:0},t)}}t.ActorRdfJoinSingle=a},71924:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(40721),t)},42149:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinSymmetricHash=void 0;const n=r(95445),i=r(90412),a=r(25579);class o extends n.ActorRdfJoin{constructor(e){super(e,{logicalType:"inner",physicalName:"symmetric-hash",limitEntries:2,requiresVariableOverlap:!0})}async getOutput(e){const t=await n.ActorRdfJoin.getMetadatas(e.entries),r=n.ActorRdfJoin.overlappingVariables(t),{hashFunction:i}=await this.mediatorHashBindings.mediate({context:e.context}),o=r.map((e=>e.variable));return{result:{type:"bindings",bindingsStream:new a.SymmetricHashJoin(e.entries[0].output.bindingsStream,e.entries[1].output.bindingsStream,(e=>i(e,o)),n.ActorRdfJoin.joinBindings),metadata:async()=>await this.constructResultMetadata(e.entries,t,e.context)}}}async getJoinCoefficients(e,t){const{metadatas:r}=t,a=n.ActorRdfJoin.getRequestInitialTimes(r),o=n.ActorRdfJoin.getRequestItemTimes(r);return(0,i.passTestWithSideData)({iterations:r[0].cardinality.value+r[1].cardinality.value,persistedItems:r[0].cardinality.value+r[1].cardinality.value,blockingItems:0,requestTime:a[0]+r[0].cardinality.value*o[0]+a[1]+r[1].cardinality.value*o[1]},t)}}t.ActorRdfJoinSymmetricHash=o},96835:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(42149),t)},38729:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinMinusHash=void 0;const n=r(95445),i=r(90412),a=r(81926),o=r(18888),s=r(4809),c=r(43347);class u extends n.ActorRdfJoin{constructor(e){super(e,{logicalType:"minus",physicalName:"hash-"+(e.canHandleUndefs?"undef":"def"),limitEntries:2,canHandleUndefs:e.canHandleUndefs})}static constructIndex(e,t){return e?new o.BindingsIndexUndef(t,(e=>e&&"Variable"!==e.termType?(0,c.termToString)(e):""),!1):new o.BindingsIndexDef(t,a.bindingsToCompactString)}async getOutput(e){const t=e.entries[1].output,r=e.entries[0].output,i=await n.ActorRdfJoin.getMetadatas(e.entries),a=n.ActorRdfJoin.overlappingVariables(i);if(0===a.length)return t.bindingsStream.destroy(),{result:r};const o=new s.ClosableTransformIterator((async()=>{const e=u.constructIndex(this.canHandleUndefs,a);return await new Promise((r=>{t.bindingsStream.on("data",(t=>e.put(t,!0))),t.bindingsStream.on("end",r),t.bindingsStream.on("error",(e=>o.emit("error",e)))})),r.bindingsStream.filter((t=>!e.getFirst(t,!0)))}),{autoStart:!1,onClose(){t.bindingsStream.destroy(),r.bindingsStream.destroy()}});return{result:{type:"bindings",bindingsStream:o,metadata:r.metadata}}}async getJoinCoefficients(e,t){const{metadatas:r}=t,a=n.ActorRdfJoin.getRequestInitialTimes(r),o=n.ActorRdfJoin.getRequestItemTimes(r);let s=r[0].cardinality.value+r[1].cardinality.value;return this.canHandleUndefs||(s*=.8),(0,i.passTestWithSideData)({iterations:s,persistedItems:r[0].cardinality.value,blockingItems:r[0].cardinality.value,requestTime:a[0]+r[0].cardinality.value*o[0]+a[1]+r[1].cardinality.value*o[1]},t)}}t.ActorRdfJoinMinusHash=u},42004:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(38729),t)},75425:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinOptionalBind=void 0;const n=r(42815),i=r(95445),a=r(90711),o=r(90412),s=r(81926),c=r(67021),u=r(96331);class l extends i.ActorRdfJoin{constructor(e){super(e,{logicalType:"optional",physicalName:"bind",limitEntries:2,canHandleUndefs:!0,isLeaf:!1,requiresVariableOverlap:!0})}async getOutput(e){const t=e.context.getSafe(a.KeysInitQuery.dataFactory),r=new u.Factory(t),o=await s.BindingsFactory.create(this.mediatorMergeBindingsContext,e.context,t);e.entries[1].output.bindingsStream.close();const l=e.context.set(a.KeysQueryOperation.joinLeftMetadata,await e.entries[0].output.metadata()).set(a.KeysQueryOperation.joinRightMetadatas,[await e.entries[1].output.metadata()]);return{result:{type:"bindings",bindingsStream:n.ActorRdfJoinMultiBind.createBindStream(this.bindOrder,e.entries[0].output.bindingsStream,[e.entries[1].operation],(async(e,t)=>{const r=e[0];return(0,c.getSafeBindings)(await this.mediatorQueryOperation.mediate({operation:r,context:l?.set(a.KeysQueryOperation.joinBindings,t)})).bindingsStream}),!0,r,o),metadata:async()=>await this.constructResultMetadata(e.entries,await i.ActorRdfJoin.getMetadatas(e.entries),e.context,{},!0)}}}async getJoinCoefficients(e,t){const{metadatas:r}=t,n=i.ActorRdfJoin.getRequestInitialTimes(r),a=i.ActorRdfJoin.getRequestItemTimes(r);if(e.entries[1].operation.type===u.Algebra.types.EXTEND||e.entries[1].operation.type===u.Algebra.types.GROUP)return(0,o.failTest)(`Actor ${this.name} can not bind on Extend and Group operations`);const s=(await this.mediatorJoinSelectivity.mediate({entries:e.entries,context:e.context})).selectivity*this.selectivityModifier;return(0,o.passTestWithSideData)({iterations:r[0].cardinality.value*r[1].cardinality.value*s,persistedItems:0,blockingItems:0,requestTime:n[0]+r[0].cardinality.value*(a[0]+n[1]+s*r[1].cardinality.value*a[1])},t)}}t.ActorRdfJoinOptionalBind=l},97237:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(75425),t)},71923:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinOptionalHash=void 0;const n=r(95445),i=r(90412),a=r(81926),o=r(18888),s=r(4809),c=r(75627),u=r(43347);class l extends n.ActorRdfJoin{constructor(e){super(e,{logicalType:"optional",physicalName:`hash-${e.canHandleUndefs?"undef":"def"}-${e.blocking?"blocking":"nonblocking"}`,limitEntries:2,canHandleUndefs:e.canHandleUndefs,requiresVariableOverlap:!0})}static constructIndex(e,t){return e?new o.BindingsIndexUndef(t,(e=>e&&"Variable"!==e.termType?(0,u.termToString)(e):""),!0):new o.BindingsIndexDef(t,a.bindingsToCompactString)}async getOutput(e){const t=e.entries[1].output,r=e.entries[0].output,i=await n.ActorRdfJoin.getMetadatas(e.entries),a=n.ActorRdfJoin.overlappingVariables(i);let o;return o=this.blocking?new s.ClosableTransformIterator((async()=>{const e=l.constructIndex(this.canHandleUndefs,a);return await new Promise((r=>{t.bindingsStream.on("data",(t=>{(e.getFirst(t,!0)??e.put(t,[])).push(t)})),t.bindingsStream.on("end",r),t.bindingsStream.on("error",(e=>{o.emit("error",e)}))})),new c.MultiTransformIterator(r.bindingsStream,{multiTransform:t=>new c.ArrayIterator(e.get(t).flat().map((e=>n.ActorRdfJoin.joinBindings(t,e))).filter((e=>null!==e)),{autoStart:!1}),optional:!0,autoStart:!1})}),{autoStart:!1,onClose(){t.bindingsStream.destroy(),r.bindingsStream.destroy()}}):new s.ClosableTransformIterator((async()=>{const e=l.constructIndex(this.canHandleUndefs,a);let i=!0;return t.bindingsStream.on("data",(t=>{(e.getFirst(t,!0)??e.put(t,new c.BufferedIterator({autoStart:!1})))._push(t)})),t.bindingsStream.on("end",(()=>{for(const t of e.values())t.close();i=!1})),t.bindingsStream.on("error",(e=>{o.emit("error",e)})),new c.MultiTransformIterator(r.bindingsStream,{multiTransform:t=>{let r=e.get(t);return 0===r.length&&(r=i?[e.put(t,new c.BufferedIterator({autoStart:!1}))]:[]),new c.UnionIterator(r.map((e=>e.clone())),{autoStart:!1}).map((e=>n.ActorRdfJoin.joinBindings(t,e)))},optional:!0,autoStart:!1})}),{autoStart:!1,onClose(){t.bindingsStream.destroy(),r.bindingsStream.destroy()}}),{result:{type:"bindings",bindingsStream:o,metadata:async()=>await this.constructResultMetadata(e.entries,i,e.context,{},!0)}}}async getJoinCoefficients(e,t){const{metadatas:r}=t,a=n.ActorRdfJoin.getRequestInitialTimes(r),o=n.ActorRdfJoin.getRequestItemTimes(r);let s=r[0].cardinality.value+r[1].cardinality.value;return this.canHandleUndefs||(s*=.8),this.blocking&&(s*=.9),(0,i.passTestWithSideData)({iterations:s,persistedItems:r[0].cardinality.value,blockingItems:this.blocking?r[0].cardinality.value:0,requestTime:a[0]+r[0].cardinality.value*o[0]+a[1]+r[1].cardinality.value*o[1]},t)}}t.ActorRdfJoinOptionalHash=l},60146:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(71923),t)},66905:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinOptionalNestedLoop=void 0;const n=r(95445),i=r(90412),a=r(25579);class o extends n.ActorRdfJoin{constructor(e){super(e,{logicalType:"optional",physicalName:"nested-loop",limitEntries:2,canHandleUndefs:!0})}async getOutput(e){return{result:{type:"bindings",bindingsStream:new a.NestedLoopJoin(e.entries[0].output.bindingsStream,e.entries[1].output.bindingsStream,n.ActorRdfJoin.joinBindings,{optional:!0,autoStart:!1}),metadata:async()=>await this.constructResultMetadata(e.entries,await n.ActorRdfJoin.getMetadatas(e.entries),e.context,{},!0)}}}async getJoinCoefficients(e,t){const{metadatas:r}=t,a=n.ActorRdfJoin.getRequestInitialTimes(r),o=n.ActorRdfJoin.getRequestItemTimes(r);return(0,i.passTestWithSideData)({iterations:r[0].cardinality.value*r[1].cardinality.value,persistedItems:0,blockingItems:0,requestTime:a[0]+r[0].cardinality.value*o[0]+a[1]+r[1].cardinality.value*o[1]},t)}}t.ActorRdfJoinOptionalNestedLoop=o},65267:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(66905),t)},36750:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JoinTypes=t.ActorRdfJoinSelectivityVariableCounting=void 0;const n=r(95705),i=r(90412),a=r(96331);class o extends n.ActorRdfJoinSelectivity{constructor(e){super(e)}async test(e){return(0,i.passTest)({accuracy:.5})}static getPatternCost(e){let t=1;return"Variable"===e.subject.termType&&(t+=4),"Variable"!==e.predicate.termType&&e.type!==a.Algebra.types.PATH||(t+=1),"Variable"===e.object.termType&&(t+=2),"Variable"===e.graph.termType&&(t+=1),t/9}static getJoinTypes(e,t){const r=[];return"Variable"===e.subject.termType?(e.subject.equals(t.subject)&&r.push(s.unboundSS),"pattern"===t.type&&e.subject.equals(t.predicate)&&r.push(s.unboundSP),e.subject.equals(t.object)&&r.push(s.unboundSO),e.subject.equals(t.graph)&&r.push(s.unboundSG)):(e.subject.equals(t.subject)&&r.push(s.boundSS),"pattern"===t.type&&e.subject.equals(t.predicate)&&r.push(s.boundSP),e.subject.equals(t.object)&&r.push(s.boundSO),e.subject.equals(t.graph)&&r.push(s.boundSG)),"pattern"===e.type&&("Variable"===e.predicate.termType?(e.predicate.equals(t.subject)&&r.push(s.unboundPS),"pattern"===t.type&&e.predicate.equals(t.predicate)&&r.push(s.unboundPP),e.predicate.equals(t.object)&&r.push(s.unboundPO),e.predicate.equals(t.graph)&&r.push(s.unboundPG)):(e.predicate.equals(t.subject)&&r.push(s.boundPS),"pattern"===t.type&&e.predicate.equals(t.predicate)&&r.push(s.boundPP),e.predicate.equals(t.object)&&r.push(s.boundPO),e.predicate.equals(t.graph)&&r.push(s.boundPG))),"Variable"===e.object.termType?(e.object.equals(t.subject)&&r.push(s.unboundOS),"pattern"===t.type&&e.object.equals(t.predicate)&&r.push(s.unboundOP),e.object.equals(t.object)&&r.push(s.unboundOO),e.object.equals(t.graph)&&r.push(s.unboundOG)):(e.object.equals(t.subject)&&r.push(s.boundOS),"pattern"===t.type&&e.object.equals(t.predicate)&&r.push(s.boundOP),e.object.equals(t.object)&&r.push(s.boundOO),e.object.equals(t.graph)&&r.push(s.boundOG)),"Variable"===e.graph.termType?(e.graph.equals(t.subject)&&r.push(s.unboundGS),"pattern"===t.type&&e.graph.equals(t.predicate)&&r.push(s.unboundGP),e.graph.equals(t.object)&&r.push(s.unboundGO),e.graph.equals(t.graph)&&r.push(s.unboundGG)):(e.graph.equals(t.subject)&&r.push(s.boundGS),"pattern"===t.type&&e.graph.equals(t.predicate)&&r.push(s.boundGP),e.graph.equals(t.object)&&r.push(s.boundGO),e.graph.equals(t.graph)&&r.push(s.boundGG)),r}static getOperationsPairwiseJoinCost(e,t){let r=o.MAX_PAIRWISE_COST;for(const n of o.getJoinTypes(e,t))switch(n){case s.boundSS:r-=4;break;case s.boundSP:r-=6;break;case s.boundSO:r-=2;break;case s.boundSG:case s.boundPS:r-=6;break;case s.boundPP:return 1;case s.boundPO:case s.boundPG:r-=6;break;case s.boundOS:r-=2;break;case s.boundOP:r-=6;break;case s.boundOO:r-=2;break;case s.boundOG:case s.boundGS:case s.boundGP:case s.boundGO:case s.boundGG:r-=6;break;case s.unboundSS:r-=2;break;case s.unboundSP:r-=3;break;case s.unboundSO:r-=1;break;case s.unboundSG:case s.unboundPS:case s.unboundPP:case s.unboundPO:case s.unboundPG:r-=3;break;case s.unboundOS:r-=1;break;case s.unboundOP:r-=3;break;case s.unboundOO:r-=1;break;case s.unboundOG:case s.unboundGS:case s.unboundGP:case s.unboundGO:case s.unboundGG:r-=3}return r/o.MAX_PAIRWISE_COST}static getOperationsJoinCost(e){const t=[];for(const r of e)a.Util.recurseOperation(r,{[a.Algebra.types.PATTERN]:e=>(t.push(e),!1),[a.Algebra.types.PATH]:e=>(t.push(e),!1)});let r=0,n=0;for(const e of t)for(const i of t)e!==i&&(r+=o.getOperationsPairwiseJoinCost(e,i),n++);return 0===n?1:r/n*t.reduce(((e,t)=>e*o.getPatternCost(t)),1)}async run(e){return e.entries.length<=1?{selectivity:1}:{selectivity:o.getOperationsJoinCost(e.entries.map((e=>e.operation)))}}}var s;t.ActorRdfJoinSelectivityVariableCounting=o,o.MAX_PAIRWISE_COST=82,function(e){e[e.boundSS=0]="boundSS",e[e.boundSP=1]="boundSP",e[e.boundSO=2]="boundSO",e[e.boundSG=3]="boundSG",e[e.boundPS=4]="boundPS",e[e.boundPP=5]="boundPP",e[e.boundPO=6]="boundPO",e[e.boundPG=7]="boundPG",e[e.boundOS=8]="boundOS",e[e.boundOP=9]="boundOP",e[e.boundOO=10]="boundOO",e[e.boundOG=11]="boundOG",e[e.boundGS=12]="boundGS",e[e.boundGP=13]="boundGP",e[e.boundGO=14]="boundGO",e[e.boundGG=15]="boundGG",e[e.unboundSS=16]="unboundSS",e[e.unboundSP=17]="unboundSP",e[e.unboundSO=18]="unboundSO",e[e.unboundSG=19]="unboundSG",e[e.unboundPS=20]="unboundPS",e[e.unboundPP=21]="unboundPP",e[e.unboundPO=22]="unboundPO",e[e.unboundPG=23]="unboundPG",e[e.unboundOS=24]="unboundOS",e[e.unboundOP=25]="unboundOP",e[e.unboundOO=26]="unboundOO",e[e.unboundOG=27]="unboundOG",e[e.unboundGS=28]="unboundGS",e[e.unboundGP=29]="unboundGP",e[e.unboundGO=30]="unboundGO",e[e.unboundGG=31]="unboundGG"}(s||(t.JoinTypes=s={}))},3595:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(36750),t)},76063:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfMetadataAccumulateCardinality=void 0;const n=r(50433),i=r(90412);class a extends n.ActorRdfMetadataAccumulate{constructor(e){super(e)}async test(e){return(0,i.passTestVoid)()}async run(e){if("initialize"===e.mode)return{metadata:{cardinality:{type:"exact",value:0}}};const t={...e.accumulatedMetadata.cardinality};if(t.dataset){if(e.accumulatedMetadata.defaultGraph===t.dataset&&t.dataset!==e.appendingMetadata.cardinality.dataset)return{metadata:{cardinality:e.appendingMetadata.cardinality}};if(!e.appendingMetadata.cardinality.dataset)return{metadata:{cardinality:t}};if(t.dataset!==e.appendingMetadata.cardinality.dataset&&e.appendingMetadata.subsetOf===t.dataset)return{metadata:{cardinality:e.appendingMetadata.cardinality}};if(t.dataset===e.appendingMetadata.cardinality.dataset)return{metadata:{cardinality:t}};delete t.dataset}return e.appendingMetadata.cardinality&&Number.isFinite(e.appendingMetadata.cardinality.value)?("estimate"===e.appendingMetadata.cardinality.type&&(t.type="estimate"),t.value+=e.appendingMetadata.cardinality.value):(t.type="estimate",t.value=Number.POSITIVE_INFINITY),{metadata:{cardinality:t}}}}t.ActorRdfMetadataAccumulateCardinality=a},37143:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(76063),t)},80933:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfMetadataAccumulatePageSize=void 0;const n=r(50433),i=r(90412);class a extends n.ActorRdfMetadataAccumulate{constructor(e){super(e)}async test(e){return(0,i.passTestVoid)()}async run(e){return"initialize"===e.mode?{metadata:{}}:{metadata:{..."pageSize"in e.accumulatedMetadata||"pageSize"in e.appendingMetadata?{pageSize:(e.accumulatedMetadata.pageSize??0)+(e.appendingMetadata.pageSize??0)}:{}}}}}t.ActorRdfMetadataAccumulatePageSize=a},17215:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(80933),t)},16851:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfMetadataAccumulateRequestTime=void 0;const n=r(50433),i=r(90412);class a extends n.ActorRdfMetadataAccumulate{constructor(e){super(e)}async test(e){return(0,i.passTestVoid)()}async run(e){return"initialize"===e.mode?{metadata:{}}:{metadata:{..."requestTime"in e.accumulatedMetadata||"requestTime"in e.appendingMetadata?{requestTime:(e.accumulatedMetadata.requestTime??0)+(e.appendingMetadata.requestTime??0)}:{}}}}}t.ActorRdfMetadataAccumulateRequestTime=a},59075:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(16851),t)},77934:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfSerializeJsonLd=void 0;const n=r(81261),i=r(43549);class a extends n.ActorRdfSerializeFixedMediaTypes{constructor(e){super(e)}async runHandle(e,t,r){const n=new i.JsonLdSerializer({space:" ".repeat(this.jsonStringifyIndentSpaces)});let a;return"pipe"in e.quadStream?(e.quadStream.on("error",(e=>n.emit("error",e))),a=e.quadStream.pipe(n)):a=n.import(e.quadStream),{data:a}}}t.ActorRdfSerializeJsonLd=a},61515:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(77934),t)},38522:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfSerializeN3=void 0;const n=r(81261),i=r(82773);class a extends n.ActorRdfSerializeFixedMediaTypes{constructor(e){super(e)}async runHandle(e,t){const r=new i.StreamWriter({format:t});let n;return"pipe"in e.quadStream?(e.quadStream.on("error",(e=>r.emit("error",e))),n=e.quadStream.pipe(r)):n=r.import(e.quadStream),{data:n,triples:"text/turtle"===t||"application/n-triples"===t||"text/n3"===t}}}t.ActorRdfSerializeN3=a},42274:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(38522),t)},61186:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfSerializeShaclc=void 0;const n=r(81261),i=r(87435),a=r(19198),o=r(94174);class s extends n.ActorRdfSerializeFixedMediaTypes{constructor(e){super(e)}async runHandle(e,t){const r=new a.Readable;r._read=()=>{};try{const n={};e.quadStream.on("prefix",((e,t)=>{n[e]=t}));const{text:a}=await(0,o.write)(await(0,i.default)(e.quadStream),{errorOnUnused:!0,extendedSyntax:"text/shaclc-ext"===t,prefixes:n});r.push(a),r.push(null)}catch(e){r._read=()=>{r.emit("error",e)}}return{data:r,triples:!0}}}t.ActorRdfSerializeShaclc=s},98371:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(61186),t)},69160:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfUpdateQuadsRdfJsStore=void 0;const n=r(16657),i=r(90711),a=r(90412),o=r(29200);class s extends n.ActorRdfUpdateQuadsDestination{constructor(e){super(e)}async test(e){const t=(0,n.getContextDestination)(e.context);return!t||"string"==typeof t||!("remove"in t)&&"value"in t&&!t.value?.remove?(0,a.failTest)(`${this.name} received an invalid rdfjsStore.`):(0,a.passTestVoid)()}async getDestination(e){const t=(0,n.getContextDestination)(e);return new o.RdfJsQuadDestination(e.getSafe(i.KeysInitQuery.dataFactory),"remove"in t?t:t.value)}}t.ActorRdfUpdateQuadsRdfJsStore=s},29200:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RdfJsQuadDestination=void 0;const n=r(66486),i=r(43347);t.RdfJsQuadDestination=class{constructor(e,t){this.dataFactory=e,this.store=t}async update(e){e.delete&&await(0,n.promisifyEventEmitter)(this.store.remove(e.delete)),e.insert&&await(0,n.promisifyEventEmitter)(this.store.import(e.insert))}async deleteGraphs(e,t,r){switch(e){case"ALL":await(0,n.promisifyEventEmitter)(this.store.deleteGraph(this.dataFactory.defaultGraph()));case"NAMED":const t=this.store.match(),r={};t.on("data",(e=>{"DefaultGraph"!==e.graph.termType&&(r[(0,i.termToString)(e.graph)]=!0)})),await(0,n.promisifyEventEmitter)(t),await Promise.all(Object.keys(r).map((e=>(0,n.promisifyEventEmitter)(this.store.deleteGraph((0,i.stringToTerm)(e,this.dataFactory))))));break;default:for(const t of Array.isArray(e)?e:[e])await(0,n.promisifyEventEmitter)(this.store.deleteGraph(t))}}async createGraphs(e,t){if(t)for(const t of e){const e=this.store.match(void 0,void 0,void 0,t);await new Promise(((r,n)=>{e.once("data",(()=>{n(new Error(`Unable to create graph ${t.value} as it already exists`))})),e.on("end",r),e.on("error",n)}))}}}},53550:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(69160),t)},16166:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorTermComparatorFactoryExpressionEvaluator=void 0;const n=r(74448),i=r(14628),a=r(90711),o=r(90412),s=r(81926),c=r(77545),u=r(78605);class l extends i.ActorTermComparatorFactory{async test(e){return(0,o.passTestVoid)()}async run({context:e}){return e=c.prepareEvaluatorActionContext(e),new u.TermComparatorExpressionEvaluator(new n.InternalEvaluator(e,this.mediatorFunctionFactory,this.mediatorQueryOperation,await s.BindingsFactory.create(this.mediatorMergeBindingsContext,e,e.getSafe(a.KeysInitQuery.dataFactory))),await this.mediatorFunctionFactory.mediate({functionName:c.SparqlOperator.EQUAL,context:e,requireTermExpression:!0}),await this.mediatorFunctionFactory.mediate({functionName:c.SparqlOperator.LT,context:e,requireTermExpression:!0}))}}t.ActorTermComparatorFactoryExpressionEvaluator=l},78605:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermComparatorExpressionEvaluator=void 0,t.TermComparatorExpressionEvaluator=class{constructor(e,t,r){this.internalEvaluator=e,this.equalityFunction=t,this.lessThanFunction=r,this._TERM_ORDERING_PRIORITY={Variable:0,BlankNode:1,NamedNode:2,Literal:3,Quad:4,DefaultGraph:5}}orderTypes(e,t){if(e===t)return 0;if(void 0===e)return-1;if(void 0===t)return 1;if(e.termType!==t.termType)return this._TERM_ORDERING_PRIORITY[e.termType]{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorBindingsAggregatorFactory=void 0;const n=r(90412);class i extends n.Actor{constructor(e){super(e),this.mediatorExpressionEvaluatorFactory=e.mediatorExpressionEvaluatorFactory}}t.ActorBindingsAggregatorFactory=i},27421:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AggregateEvaluator=void 0;const n=r(90711),i=r(77545),a=r(43347);t.AggregateEvaluator=class{constructor(e,t,r=!1){this.evaluator=e,this.distinct=t,this.throwError=r,this.errorOccurred=!1,this.errorOccurred=!1,this.superTypeProvider=e.context.getSafe(n.KeysExpressionEvaluator.superTypeProvider),this.termTransformer=new i.TermTransformer(this.superTypeProvider),this.variableValues=new Set}emptyValueTerm(){}emptyValue(){const e=this.emptyValueTerm();if(void 0===e&&this.throwError)throw new i.EmptyAggregateError;return e}async putBindings(e){if(!this.errorOccurred)try{const t=await this.evaluator.evaluate(e);if(!t||this.errorOccurred)return;this.distinct&&this.variableValues.has(a.termToString(t))||(this.putTerm(t),this.distinct&&this.variableValues.add(a.termToString(t)))}catch(e){this.safeThrow(e)}}async result(){if(!this.errorOccurred)return this.termResult()}safeThrow(e){if(this.throwError)throw e;this.errorOccurred=!0}termToNumericOrError(e){if("Literal"!==e.termType)throw new Error(`Term with value ${e.value} has type ${e.termType} and is not a numeric literal`);if(!i.isSubTypeOf(e.datatype.value,i.TypeAlias.SPARQL_NUMERIC,this.superTypeProvider))throw new Error(`Term datatype ${e.datatype.value} with value ${e.value} has type ${e.termType} and is not a numeric literal`);return this.termTransformer.transformLiteral(e)}}},86581:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(7625),t),i(r(27421),t)},98862:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorContextPreprocess=void 0;const n=r(90412);class i extends n.Actor{constructor(e){super(e)}}t.ActorContextPreprocess=i},98926:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(98862),t)},23069:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorExpressionEvaluatorFactory=void 0;const n=r(90412);class i extends n.Actor{constructor(e){super(e),this.mediatorQueryOperation=e.mediatorQueryOperation,this.mediatorFunctionFactory=e.mediatorFunctionFactory,this.mediatorMergeBindingsContext=e.mediatorMergeBindingsContext}}t.ActorExpressionEvaluatorFactory=i},37811:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(23069),t)},1028:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediatorFunctionFactory=t.ActorFunctionFactory=void 0;const n=r(90412);class i extends n.Actor{constructor(e){super(e)}}t.ActorFunctionFactory=i;class a extends n.Mediator{}t.MediatorFunctionFactory=a},68307:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorFunctionFactoryDedicated=void 0;const n=r(90412),i=r(1028);class a extends i.ActorFunctionFactory{constructor(e){super(e)}async test(e){return!this.functionNames.includes(e.functionName)||!this.termFunction&&e.requireTermExpression?(0,n.failTest)(`Actor ${this.name} can not provide implementation for "${e.functionName}", only for ${this.termFunction?"":"non-termExpression "}${this.functionNames.join(" and ")}.`):(0,n.passTestVoid)()}}t.ActorFunctionFactoryDedicated=a},48061:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BusFunctionFactory=void 0;const n=r(90412);class i extends n.BusIndexed{constructor(e){super({...e,actorIdentifierFields:["functionNames"],actionIdentifierFields:["functionName"]})}}t.BusFunctionFactory=i},5673:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermFunctionBase=t.ExpressionFunctionBase=void 0;const n=r(90711),i=r(77545);class a{constructor({arity:e,operator:t,apply:r}){this.arity=e,this.operator=t,this.apply=r}checkArity(e){return Array.isArray(this.arity)?this.arity.includes(e.length):this.arity===Number.POSITIVE_INFINITY||e.length===this.arity}}t.ExpressionFunctionBase=a,t.TermFunctionBase=class extends a{constructor({arity:e,operator:t,overloads:r}){super({arity:e,operator:t,apply:async({args:e,exprEval:t,mapping:r})=>this.applyOnTerms(await Promise.all(e.map((e=>t.evaluatorExpressionEvaluation(e,r)))),t)}),this.supportsTermExpressions=!0,this.overloads=r}applyOnTerms(e,t){return(this.overloads.search(e,t.context.getSafe(n.KeysExpressionEvaluator.superTypeProvider),t.context.getSafe(n.KeysInitQuery.functionArgumentsCache))??this.handleInvalidTypes(e))(t)(e)}handleInvalidTypes(e){throw new i.InvalidArgumentTypes(e,this.operator)}}},77617:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(1028),t),i(r(68307),t),i(r(48061),t),i(r(5673),t)},67120:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorHashBindings=void 0;const n=r(90412);class i extends n.Actor{constructor(e){super(e)}}t.ActorHashBindings=i},16235:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(67120),t)},17136:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorHashQuads=void 0;const n=r(90412);class i extends n.Actor{constructor(e){super(e)}}t.ActorHashQuads=i},65239:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(17136),t)},4996:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorHttpInvalidate=void 0;const n=r(90412);class i extends n.Actor{constructor(e){super(e)}}t.ActorHttpInvalidate=i},34247:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorHttpInvalidateListenable=void 0;const n=r(90412),i=r(4996);class a extends i.ActorHttpInvalidate{constructor(e){super(e),this.invalidateListeners=[],this.invalidateListeners=[]}addInvalidateListener(e){this.invalidateListeners.push(e)}async test(e){return(0,n.passTestVoid)()}async run(e){for(const t of this.invalidateListeners)t(e);return{}}}t.ActorHttpInvalidateListenable=a},40332:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4996),t),i(r(34247),t)},3251:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorInit=void 0;const n=r(90412);class i extends n.Actor{constructor(e){super(e)}}t.ActorInit=i},6180:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(3251),t)},5603:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorOptimizeQueryOperation=void 0;const n=r(90412);class i extends n.Actor{constructor(e){super(e)}}t.ActorOptimizeQueryOperation=i},38912:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(5603),t)},31278:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperation=void 0;const n=r(90412);class i extends n.Actor{constructor(e){super(e)}}t.ActorQueryOperation=i},95816:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationTyped=void 0;const n=r(90711),i=r(90412),a=r(99214),o=r(31278);class s extends o.ActorQueryOperation{constructor(e,t){if(super({...e,operationName:t}),!this.operationName)throw new Error('A valid "operationName" argument must be provided.')}async test(e){if(!e.operation)return(0,i.failTest)("Missing field 'operation' in a query operation action.");if(e.operation.type!==this.operationName)return(0,i.failTest)(`Actor ${this.name} only supports ${this.operationName} operations, but got ${e.operation.type}`);const t=e.operation;return this.testOperation(t,e.context)}async run(e,t){const r=e.context.get(n.KeysInitQuery.physicalQueryPlanLogger);r&&(r.logOperation(e.operation.type,void 0,e.operation,e.context.get(n.KeysInitQuery.physicalQueryPlanNode),this.name,{}),e.context=e.context.set(n.KeysInitQuery.physicalQueryPlanNode,e.operation));const i=e.operation,o=e.context.set(n.KeysQueryOperation.operation,i),s=await this.runOperation(i,o,t);return"metadata"in s&&(s.metadata=(0,a.cachifyMetadata)(s.metadata)),s}}t.ActorQueryOperationTyped=s},33381:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryOperationTypedMediated=void 0;const n=r(95816);class i extends n.ActorQueryOperationTyped{constructor(e,t){super(e,t)}}t.ActorQueryOperationTypedMediated=i},74501:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BusQueryOperation=void 0;const n=r(90412);class i extends n.BusIndexed{constructor(e){super({...e,actorIdentifierFields:["operationName"],actionIdentifierFields:["operation","type"]})}}t.BusQueryOperation=i},66490:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(31278),t),i(r(95816),t),i(r(33381),t),i(r(74501),t)},39830:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryParse=void 0;const n=r(90412);class i extends n.Actor{constructor(e){super(e)}}t.ActorQueryParse=i},92180:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(39830),t)},60622:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryProcess=void 0;const n=r(90412);class i extends n.Actor{constructor(e){super(e)}}t.ActorQueryProcess=i},59478:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(60622),t)},74871:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryResultSerialize=void 0;const n=r(48092);class i extends n.ActorAbstractMediaTyped{constructor(e){super(e)}}t.ActorQueryResultSerialize=i},33152:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQueryResultSerializeFixedMediaTypes=void 0;const n=r(48092),i=r(90412);class a extends n.ActorAbstractMediaTypedFixed{constructor(e){super(e)}async testHandleChecked(e,t){return(0,i.passTestVoid)()}}t.ActorQueryResultSerializeFixedMediaTypes=a},58871:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(74871),t),i(r(33152),t)},23038:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQuerySourceIdentifyHypermedia=void 0;const n=r(90412);class i extends n.Actor{constructor(e,t){super(e),this.sourceType=t}async test(e){return e.forceSourceType&&this.sourceType!==e.forceSourceType?(0,n.failTest)(`Actor ${this.name} is not able to handle source type ${e.forceSourceType}.`):this.testMetadata(e)}}t.ActorQuerySourceIdentifyHypermedia=i},62100:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(23038),t)},21645:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorQuerySourceIdentify=void 0;const n=r(90412);class i extends n.Actor{constructor(e){super(e)}}t.ActorQuerySourceIdentify=i},33386:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.filterMatchingQuotedQuads=t.quadsOrderToBindingsOrder=t.quadsMetadataToBindingsMetadata=t.setMetadata=t.getDuplicateElementLinks=t.getVariables=t.isTermVariable=t.quadsToBindings=void 0;const n=r(4809),i=r(99214),a=r(43347),o=r(3285),s=r(64232);function c(e){return"Variable"===e.termType}function u(e){return(0,o.uniqTerms)((0,o.getTermsNested)(e).filter(c))}function l(e){const t={};let r=!1;if((0,o.forEachTermsNested)(e,((e,n)=>{if("Variable"===e.termType){const i=(0,a.termToString)(e),o=(t[i]||(t[i]=[])).push(n);r=r||o>1}})),!r)return;const n={};for(const e in t){const r=t[e],i=r.slice(1);i.length>0&&(n[r[0].join("_")]=i)}return n}function d(e,t,r,n,a,o){const s=s=>{o&&(s.cardinality.type="estimate"),t.setProperty("metadata",p(e,(0,i.validateMetadataQuads)(s),n,a)),s.state&&s.state.addInvalidateListener((()=>{d(e,t,r,n,a,o)}))},c=r.getProperty("metadata");c?s(c):r.getProperty("metadata",s)}function p(e,t,r,n){return{...t,order:t.order?h(e,t.order,r):void 0,availableOrders:t.availableOrders?t.availableOrders.map((t=>({cost:t.cost,terms:h(e,t.terms,r)}))):void 0,variables:n.map((e=>({variable:e,canBeUndef:!1})))}}function h(e,t,r){const n={};return t.map((t=>{const i=r[t.term];if(i&&!n[i])return n[i]=!0,{term:e.variable(i),direction:t.direction}})).filter(Boolean)}t.quadsToBindings=function(e,t,r,i,a){const s=u(t),c="Variable"===t.graph.termType&&!a,p=l(t),h=(0,o.reduceTermsNested)(t,((e,t,r)=>("Variable"===t.termType&&(e[r.join("_")]=t.value),e)),{});let f=e;c&&(f=f.filter((e=>"DefaultGraph"!==e.graph.termType))),p&&(f=f.filter((e=>{for(const t in p){const r=t.split("_"),n=(0,o.getValueNestedPath)(e,r);for(const r of p[t])if(!n.equals((0,o.getValueNestedPath)(e,r)))return!1}return!0})));const y=new n.ClosableIterator(f.map((e=>i.bindings(Object.keys(h).map((t=>{const n=t.split("_"),i=h[t],a=(0,o.getValueNestedPath)(e,n);return[r.variable(i),a]}))))),{onClose:()=>e.destroy()});return d(r,y,e,h,s,c||Boolean(p)),y},t.isTermVariable=c,t.getVariables=u,t.getDuplicateElementLinks=l,t.setMetadata=d,t.quadsMetadataToBindingsMetadata=p,t.quadsOrderToBindingsOrder=h,t.filterMatchingQuotedQuads=function(e,t){return(0,o.someTerms)(e,(e=>"Quad"===e.termType))&&(t=t.filter((t=>(0,s.matchPatternMappings)(t,e)))),t}},559:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(21645),t),i(r(33386),t)},39582:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinEntriesSort=void 0;const n=r(90412);class i extends n.Actor{constructor(e){super(e)}}t.ActorRdfJoinEntriesSort=i},39195:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(39582),t)},4945:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoinSelectivity=void 0;const n=r(90412);class i extends n.Actor{constructor(e){super(e)}}t.ActorRdfJoinSelectivity=i},95705:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4945),t)},57042:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfJoin=void 0;const n=r(90711),i=r(90412),a=r(4809),o=r(99214);class s extends i.Actor{constructor(e,t){super(e),this.includeInLogs=!0,this.logicalType=t.logicalType,this.physicalName=t.physicalName,this.limitEntries=t.limitEntries??Number.POSITIVE_INFINITY,this.limitEntriesMin=t.limitEntriesMin??!1,this.canHandleUndefs=t.canHandleUndefs??!1,this.isLeaf=t.isLeaf??!0,this.requiresVariableOverlap=t.requiresVariableOverlap??!1}static overlappingVariables(e){const t={};for(const r of e)for(const e of r.variables){t[e.variable.value]||(t[e.variable.value]={variable:e.variable,canBeUndef:e.canBeUndef,occurrences:0});const r=t[e.variable.value];r.canBeUndef=r.canBeUndef||e.canBeUndef,r.occurrences++}return Object.values(t).filter((t=>t.occurrences===e.length)).map((e=>({variable:e.variable,canBeUndef:e.canBeUndef})))}static joinVariables(e,t,r=!1){const n={};let i=!0;for(const e of t){for(const t of e.variables)n[t.variable.value]=n[t.variable.value]||t.canBeUndef||!i&&r&&!(t.variable.value in n);i=!1}return Object.entries(n).map((([t,r])=>({variable:e.variable(t),canBeUndef:r})))}static joinBindings(...e){if(0===e.length)return null;if(1===e.length)return e[0];let t=e[0];for(const r of e.slice(1)){const e=t.merge(r);if(!e)return null;t=e}return t}static getCardinality(e){return e.cardinality}static async getMetadatas(e){return await Promise.all(e.map((e=>e.output.metadata())))}static async getEntriesWithMetadatas(e){const t=await s.getMetadatas(e);return e.map(((e,r)=>({...e,metadata:t[r]})))}static getRequestInitialTimes(e){return e.map((e=>e.pageSize?0:e.requestTime??0))}static getRequestItemTimes(e){return e.map((e=>e.pageSize?(e.requestTime??0)/e.pageSize:0))}constructState(e){const t=new o.MetadataValidationState,r=()=>t.invalidate();for(const t of e)t.state.addInvalidateListener(r);return t}async constructResultMetadata(e,t,r,i={},a=!1){let o;return i.cardinality?o=i.cardinality:(o=t.reduce(((e,t)=>{const r=s.getCardinality(t);return{type:"estimate"===r.type?"estimate":e.type,value:e.value*(a?Math.max(1,r.value):r.value)}}),{type:"exact",value:1}),o.value*=(await this.mediatorJoinSelectivity.mediate({entries:e,context:r})).selectivity),{state:this.constructState(t),...i,cardinality:{type:o.type,value:o.value},variables:s.joinVariables(r.getSafe(n.KeysInitQuery.dataFactory),t,a)}}static async sortJoinEntries(e,t,r){if(t.some((e=>e.metadata.variables.some((e=>e.canBeUndef)))))return(0,i.passTest)(t);const n={};for(const e of t)for(const t of e.metadata.variables){let e=n[t.variable.value];e||(e=0),n[t.variable.value]=++e}const a=[];for(const[e,t]of Object.entries(n))t>=2&&a.push(e);if(0===a.length)return(0,i.failTest)("Bind join can only join entries with at least one common variable");const o=[];for(const e of t){let t=!1;for(const r of e.metadata.variables)if(a.includes(r.variable.value)){t=!0;break}t||o.push(e)}return(0,i.passTest)((await e.mediate({entries:t,context:r})).entries.sort(((e,t)=>{const r=o.includes(e);return r===o.includes(t)?0:r?1:-1})))}async test(e){if(e.type!==this.logicalType)return(0,i.failTest)(`${this.name} can only handle logical joins of type '${this.logicalType}', while '${e.type}' was given.`);if(e.entries.length<=1)return(0,i.failTest)(`${this.name} requires at least two join entries.`);if(this.limitEntriesMin?e.entries.lengththis.limitEntries)return(0,i.failTest)(`${this.name} requires ${this.limitEntries} join entries at ${this.limitEntriesMin?"least":"most"}. The input contained ${e.entries.length}.`);for(const t of e.entries)if("bindings"!==t.output.type)return(0,i.failTest)(`Invalid type of a join entry: Expected 'bindings' but got '${t.output.type}'`);const t=await s.getMetadatas(e.entries);let r;return!this.canHandleUndefs&&(r=s.overlappingVariables(t),r.some((e=>e.canBeUndef)))?(0,i.failTest)(`Actor ${this.name} can not join streams containing undefs`):this.requiresVariableOverlap&&0===(r??s.overlappingVariables(t)).length?(0,i.failTest)(`Actor ${this.name} can only join entries with at least one common variable`):await this.getJoinCoefficients(e,{metadatas:t})}async run(e,t){let r;e.context.has(n.KeysInitQuery.physicalQueryPlanLogger)&&(r=e.context.get(n.KeysInitQuery.physicalQueryPlanNode),e.context=e.context.set(n.KeysInitQuery.physicalQueryPlanNode,e));const i=e.context.get(n.KeysInitQuery.physicalQueryPlanLogger);let c;this.includeInLogs&&i&&(c={},i.stashChildren(r,(e=>e.logicalOperator.startsWith("join"))),i.logOperation(`join-${this.logicalType}`,this.physicalName,e,r,this.name,c));const{result:u,physicalPlanMetadata:l}=await this.getOutput(e,t);if(c){(0,a.instrumentIterator)(u.bindingsStream).then((t=>{i.appendMetadata(e,{cardinalityReal:t.count,timeSelf:t.timeSelf,timeLife:t.timeLife})})),Object.assign(c,l);const r=t.metadatas.map(s.getCardinality);if(c.cardinalities=r,c.joinCoefficients=(await this.getJoinCoefficients(e,t)).getOrThrow(),this.isLeaf)for(let t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfMetadataAccumulate=void 0;const n=r(90412);class i extends n.Actor{constructor(e){super(e)}}t.ActorRdfMetadataAccumulate=i},50433:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(12957),t)},17538:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfSerialize=void 0;const n=r(48092);class i extends n.ActorAbstractMediaTyped{constructor(e){super(e)}}t.ActorRdfSerialize=i},9527:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfSerializeFixedMediaTypes=void 0;const n=r(48092),i=r(90412);class a extends n.ActorAbstractMediaTypedFixed{constructor(e){super(e)}async testHandleChecked(){return(0,i.passTestVoid)()}}t.ActorRdfSerializeFixedMediaTypes=a},81261:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(17538),t),i(r(9527),t)},38291:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfUpdateQuads=void 0;const n=r(90412);class i extends n.Actor{constructor(e){super(e)}}t.ActorRdfUpdateQuads=i},85459:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorRdfUpdateQuadsDestination=t.deskolemize=t.deskolemizeStream=void 0;const n=r(21806),i=r(90711),a=r(90412),o=r(38291);function s(e,t,r){return t?.map((t=>(0,n.deskolemizeQuad)(e,t,r)))}function c(e){const t=e.context.getSafe(i.KeysInitQuery.dataFactory),r=e.context.get(i.KeysRdfUpdateQuads.destination),n=e.context.get(i.KeysQuerySourceIdentify.sourceIds)?.get(r);return n?{...e,quadStreamInsert:s(t,e.quadStreamInsert,n),quadStreamDelete:s(t,e.quadStreamDelete,n)}:e}t.deskolemizeStream=s,t.deskolemize=c;class u extends o.ActorRdfUpdateQuads{async test(e){return(0,a.passTestVoid)()}async run(e){const t=await this.getDestination(e.context);return await this.getOutput(t,c(e))}async getOutput(e,t){return{execute:async()=>{await e.update({insert:t.quadStreamInsert,delete:t.quadStreamDelete}),await(t.deleteGraphs?e.deleteGraphs(t.deleteGraphs.graphs,t.deleteGraphs.requireExistence,t.deleteGraphs.dropGraphs):Promise.resolve()),await(t.createGraphs?e.createGraphs(t.createGraphs.graphs,t.createGraphs.requireNonExistence):Promise.resolve())}}}}t.ActorRdfUpdateQuadsDestination=u},41937:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},16657:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(38291),t),i(r(85459),t),i(r(41937),t),i(r(52604),t)},52604:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getContextDestinationUrl=t.getContextDestination=t.getDataDestinationContext=t.getDataDestinationValue=t.getDataDestinationType=t.isDataDestinationRawType=void 0;const n=r(90711);function i(e){return"string"==typeof e||"remove"in e}function a(e){return i(e)?e:e.value}t.isDataDestinationRawType=i,t.getDataDestinationType=function(e){return"string"==typeof e?"":"remove"in e?"rdfjsStore":e.type},t.getDataDestinationValue=a,t.getDataDestinationContext=function(e,t){return"string"==typeof e||"remove"in e||!e.context?t:t.merge(e.context)},t.getContextDestination=function(e){return e.get(n.KeysRdfUpdateQuads.destination)},t.getContextDestinationUrl=function(e){if(e){let t=a(e);if("string"==typeof t){const e=t.indexOf("#");return e>=0&&(t=t.slice(0,e)),t}}}},77401:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActorTermComparatorFactory=void 0;const n=r(90412);class i extends n.Actor{constructor(e){super(e),this.mediatorQueryOperation=e.mediatorQueryOperation,this.mediatorFunctionFactory=e.mediatorFunctionFactory,this.mediatorMergeBindingsContext=e.mediatorMergeBindingsContext}}t.ActorTermComparatorFactory=i},14628:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(77401),t)},19039:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeysStatistics=t.KeysRdfJoin=t.KeysMergeBindingsContext=t.KeysRdfUpdateQuads=t.KeysQuerySourceIdentify=t.KeysRdfParseHtmlScript=t.KeysRdfParseJsonLd=t.KeysQueryOperation=t.KeysExpressionEvaluator=t.KeysInitQuery=t.KeysHttpProxy=t.KeysHttpMemento=t.KeysHttpWayback=t.KeysHttp=t.KeysCore=void 0;const n=r(90412);t.KeysCore={log:n.CONTEXT_KEY_LOGGER},t.KeysHttp={includeCredentials:new n.ActionContextKey("@comunica/bus-http:include-credentials"),auth:new n.ActionContextKey("@comunica/bus-http:auth"),fetch:new n.ActionContextKey("@comunica/bus-http:fetch"),httpTimeout:new n.ActionContextKey("@comunica/bus-http:http-timeout"),httpBodyTimeout:new n.ActionContextKey("@comunica/bus-http:http-body-timeout"),httpRetryCount:new n.ActionContextKey("@comunica/bus-http:http-retry-count"),httpRetryDelayFallback:new n.ActionContextKey("@comunica/bus-http:http-retry-delay-fallback"),httpRetryDelayLimit:new n.ActionContextKey("@comunica/bus-http:http-retry-delay-limit"),httpRetryStatusCodes:new n.ActionContextKey("@comunica/bus-http:http-retry-status-codes")},t.KeysHttpWayback={recoverBrokenLinks:new n.ActionContextKey("@comunica/bus-http:recover-broken-links")},t.KeysHttpMemento={datetime:new n.ActionContextKey("@comunica/actor-http-memento:datetime")},t.KeysHttpProxy={httpProxyHandler:new n.ActionContextKey("@comunica/actor-http-proxy:httpProxyHandler")},t.KeysInitQuery={querySourcesUnidentified:new n.ActionContextKey("@comunica/actor-init-query:querySourcesUnidentified"),initialBindings:new n.ActionContextKey("@comunica/actor-init-query:initialBindings"),queryFormat:new n.ActionContextKey("@comunica/actor-init-query:queryFormat"),graphqlSingularizeVariables:new n.ActionContextKey("@comunica/actor-init-query:singularizeVariables"),lenient:new n.ActionContextKey("@comunica/actor-init-query:lenient"),queryString:new n.ActionContextKey("@comunica/actor-init-query:queryString"),query:new n.ActionContextKey("@comunica/actor-init-query:query"),baseIRI:new n.ActionContextKey("@comunica/actor-init-query:baseIRI"),functionArgumentsCache:new n.ActionContextKey("@comunica/actor-init-query:functionArgumentsCache"),queryTimestamp:new n.ActionContextKey("@comunica/actor-init-query:queryTimestamp"),queryTimestampHighResolution:new n.ActionContextKey("@comunica/actor-init-query:queryTimestampHighResolution"),extensionFunctionCreator:new n.ActionContextKey("@comunica/actor-init-query:extensionFunctionCreator"),extensionFunctions:new n.ActionContextKey("@comunica/actor-init-query:extensionFunctions"),cliArgsHandlers:new n.ActionContextKey("@comunica/actor-init-query:cliArgsHandlers"),explain:new n.ActionContextKey("@comunica/actor-init-query:explain"),physicalQueryPlanLogger:new n.ActionContextKey("@comunica/actor-init-query:physicalQueryPlanLogger"),physicalQueryPlanNode:new n.ActionContextKey("@comunica/actor-init-query:physicalQueryPlanNode"),jsonLdContext:new n.ActionContextKey("@context"),invalidateCache:new n.ActionContextKey("@comunica/actor-init-query:invalidateCache"),dataFactory:new n.ActionContextKey("@comunica/actor-init-query:dataFactory"),distinctConstruct:new n.ActionContextKey("@comunica/actor-init-query:distinctConstruct")},t.KeysExpressionEvaluator={extensionFunctionCreator:new n.ActionContextKey("@comunica/utils-expression-evaluator:extensionFunctionCreator"),superTypeProvider:new n.ActionContextKey("@comunica/utils-expression-evaluator:superTypeProvider"),defaultTimeZone:new n.ActionContextKey("@comunica/utils-expression-evaluator:defaultTimeZone"),actionContext:new n.ActionContextKey("@comunica/utils-expression-evaluator:actionContext")},t.KeysQueryOperation={operation:new n.ActionContextKey("@comunica/bus-query-operation:operation"),joinLeftMetadata:new n.ActionContextKey("@comunica/bus-query-operation:joinLeftMetadata"),joinRightMetadatas:new n.ActionContextKey("@comunica/bus-query-operation:joinRightMetadatas"),joinBindings:new n.ActionContextKey("@comunica/bus-query-operation:joinBindings"),readOnly:new n.ActionContextKey("@comunica/bus-query-operation:readOnly"),isPathArbitraryLengthDistinctKey:new n.ActionContextKey("@comunica/bus-query-operation:isPathArbitraryLengthDistinct"),limitIndicator:new n.ActionContextKey("@comunica/bus-query-operation:limitIndicator"),unionDefaultGraph:new n.ActionContextKey("@comunica/bus-query-operation:unionDefaultGraph"),querySources:new n.ActionContextKey("@comunica/bus-query-operation:querySources")},t.KeysRdfParseJsonLd={documentLoader:new n.ActionContextKey("@comunica/actor-rdf-parse-jsonld:documentLoader"),strictValues:new n.ActionContextKey("@comunica/actor-rdf-parse-jsonld:strictValues"),parserOptions:new n.ActionContextKey("@comunica/actor-rdf-parse-jsonld:parserOptions")},t.KeysRdfParseHtmlScript={processingHtmlScript:new n.ActionContextKey("@comunica/actor-rdf-parse-html-script:processingHtmlScript"),extractAllScripts:new n.ActionContextKey("extractAllScripts")},t.KeysQuerySourceIdentify={sourceIds:new n.ActionContextKey("@comunica/bus-query-source-identify:sourceIds"),hypermediaSourcesAggregatedStores:new n.ActionContextKey("@comunica/bus-query-source-identify:hypermediaSourcesAggregatedStores"),traverse:new n.ActionContextKey("@comunica/bus-query-source-identify:traverse")},t.KeysRdfUpdateQuads={destination:new n.ActionContextKey("@comunica/bus-rdf-update-quads:destination")},t.KeysMergeBindingsContext={sourcesBinding:new n.ActionContextKey("@comunica/bus-merge-bindings-context:sourcesBinding")},t.KeysRdfJoin={lastPhysicalJoin:new n.ActionContextKey("@comunica/bus-rdf-join:lastPhysicalJoin")},t.KeysStatistics={discoveredLinks:new n.ActionContextKey("@comunica/bus-context-preprocess:discoveredLinks"),dereferencedLinks:new n.ActionContextKey("@comunica/bus-context-preprocess:dereferencedLinks")}},90711:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(19039),t)},94301:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActionContextKey=t.ActionContext=void 0;const n=r(49568);class i{constructor(e={}){this.map=(0,n.Map)(e)}setDefault(e,t){return this.has(e)?this:this.set(e,t)}set(e,t){return this.setRaw(e.name,t)}setRaw(e,t){return new i(this.map.set(e,t))}delete(e){return new i(this.map.delete(e.name))}get(e){return this.getRaw(e.name)}getRaw(e){return this.map.get(e)}getSafe(e){if(!this.has(e))throw new Error(`Context entry ${e.name} is required but not available`);return this.get(e)}has(e){return this.hasRaw(e.name)}hasRaw(e){return this.map.has(e)}merge(...e){let t=this;for(const r of e)for(const e of r.keys())t=t.set(e,r.get(e));return t}keys(){return[...this.map.keys()].map((e=>new a(e)))}toJS(){return this.map.toJS()}toString(){return`ActionContext(${JSON.stringify(this.map.toJS())})`}[Symbol.for("nodejs.util.inspect.custom")](){return`ActionContext(${JSON.stringify(this.map.toJS(),null," ")})`}static ensureActionContext(e){return e instanceof i?e:new i((0,n.Map)(e??{}))}}t.ActionContext=i;class a{constructor(e){this.name=e}}t.ActionContextKey=a},61782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActionObserver=void 0,t.ActionObserver=class{constructor(e){Object.assign(this,e)}}},681:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Actor=void 0;const n=r(84983);class i{constructor(e){this.beforeActors=[],Object.assign(this,e),this.bus.subscribe(this),this.beforeActors.length>0&&this.bus.addDependencies(this,this.beforeActors),e.busFailMessage&&(this.bus.failMessage=e.busFailMessage)}static getContextLogger(e){return e.get(n.CONTEXT_KEY_LOGGER)}runObservable(e,t){const r=this.run(e,t);return this.bus.onRun(this,e,r),r}getDefaultLogData(e,t){const r=t?t():{};return r.actor=this.name,r}logTrace(e,t,r){const n=i.getContextLogger(e);n&&n.trace(t,this.getDefaultLogData(e,r))}logDebug(e,t,r){const n=i.getContextLogger(e);n&&n.debug(t,this.getDefaultLogData(e,r))}logInfo(e,t,r){const n=i.getContextLogger(e);n&&n.info(t,this.getDefaultLogData(e,r))}logWarn(e,t,r){const n=i.getContextLogger(e);n&&n.warn(t,this.getDefaultLogData(e,r))}logError(e,t,r){const n=i.getContextLogger(e);n&&n.error(t,this.getDefaultLogData(e,r))}logFatal(e,t,r){const n=i.getContextLogger(e);n&&n.fatal(t,this.getDefaultLogData(e,r))}}t.Actor=i},92126:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Bus=void 0,t.Bus=class{constructor(e){this.actors=[],this.observers=[],this.dependencyLinks=new Map,Object.assign(this,e),this.failMessage=`All actors over bus ${this.name} failed to handle an action`}subscribe(e){this.actors.push(e),this.reorderForDependencies()}subscribeObserver(e){this.observers.push(e)}unsubscribe(e){const t=this.actors.indexOf(e);return t>=0&&(this.actors.splice(t,1),!0)}unsubscribeObserver(e){const t=this.observers.indexOf(e);return t>=0&&(this.observers.splice(t,1),!0)}publish(e){return this.actors.map((t=>({actor:t,reply:t.test(e)})))}onRun(e,t,r){for(const n of this.observers)n.onRun(e,t,r)}addDependencies(e,t){for(const r of t){let t=this.dependencyLinks.get(r);t||(t=[],this.dependencyLinks.set(r,t)),t.push(e)}this.reorderForDependencies()}reorderForDependencies(){if(this.dependencyLinks.size>0){const e=[];for(const t of this.dependencyLinks.keys()){const r=this.actors.indexOf(t);r>=0&&(this.actors.splice(r,1),e.push(t))}for(;e.length>0;){let t=-1;for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BusIndexed=void 0;const n=r(92126);class i extends n.Bus{constructor(e){super(e),this.actorsIndex={}}subscribe(e){const t=this.getActorIdentifiers(e)??["_undefined_"];for(const r of t){let t=this.actorsIndex[r];t||(t=this.actorsIndex[r]=[]),t.push(e),super.subscribe(e)}}unsubscribe(e){const t=this.getActorIdentifiers(e)??["_undefined_"];let r=!1;for(const n of t){const t=this.actorsIndex[n];if(t){const r=t.indexOf(e);r>=0&&t.splice(r,1),0===t.length&&delete this.actorsIndex[n]}r=r||super.unsubscribe(e)}return r}publish(e){const t=this.getActionIdentifier(e);return t?[...this.actorsIndex[t]||[],...this.actorsIndex._undefined_||[]].map((t=>({actor:t,reply:t.test(e)}))):super.publish(e)}getActorIdentifiers(e){const t=this.actorIdentifierFields.reduce(((e,t)=>e[t]),e);if(t)return Array.isArray(t)?t:[t]}getActionIdentifier(e){return this.actionIdentifierFields.reduce(((e,t)=>e[t]),e)}}t.BusIndexed=i},84983:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CONTEXT_KEY_LOGGER=void 0;const n=r(94301);t.CONTEXT_KEY_LOGGER=new n.ActionContextKey("@comunica/core:log")},65991:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Mediator=void 0;class r{constructor(e){Object.assign(this,e)}publish(e){const t=this.bus.publish(e);if(0===t.length)throw new Error(`No actors are able to reply to a message in the bus ${this.bus.name}`);return t}async mediateActor(e){return await this.mediateWith(e,this.publish(e))}async mediateTestable(e){return(await this.mediateActor(e)).mapAsync(((t,r)=>t.runObservable(e,r)))}async mediate(e){return(await this.mediateTestable(e)).getOrThrow()}constructFailureMessage(e,t){const n="\n ";return`${this.bus.failMessage.replaceAll(/\$\{(.*?)\}/gu,((t,n)=>r.getObjectValue({action:e},n.split("."))||t))}\n Error messages of failing actors:${n}${t.join(n)}`}static getObjectValue(e,t){return 0===t.length?e:e?r.getObjectValue(e[t[0]],t.slice(1)):void 0}}t.Mediator=r},14231:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestResultFailed=t.TestResultPassed=t.failTest=t.passTestVoidWithSideData=t.passTestWithSideData=t.passTestVoid=t.passTest=void 0,t.passTest=function(e){return new r(e,void 0)},t.passTestVoid=function(){return new r(!0,void 0)},t.passTestWithSideData=function(e,t){return new r(e,t)},t.passTestVoidWithSideData=function(e){return new r(!0,e)},t.failTest=function(e){return new n(e)};class r{constructor(e,t){this.value=e,this.sideData=t}isPassed(){return!0}isFailed(){return!1}get(){return this.value}getOrThrow(){return this.value}getSideData(){return this.sideData}getFailMessage(){}map(e){return new r(e(this.value,this.sideData),this.sideData)}async mapAsync(e){return new r(await e(this.value,this.sideData),this.sideData)}}t.TestResultPassed=r;class n{constructor(e){this.failMessage=e}isPassed(){return!1}isFailed(){return!0}get(){}getOrThrow(){throw new Error(this.getFailMessage())}getSideData(){throw new Error(this.getFailMessage())}getFailMessage(){return this.failMessage}map(){return this}async mapAsync(){return this}}t.TestResultFailed=n},90412:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(94301),t),i(r(92126),t),i(r(2437),t),i(r(84983),t),i(r(61782),t),i(r(681),t),i(r(65991),t),i(r(14231),t)},40932:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LoggerVoid=void 0;const n=r(42996);class i extends n.Logger{debug(){}error(){}fatal(){}info(){}trace(){}warn(){}}t.LoggerVoid=i},11832:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(40932),t)},60004:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediatorAll=void 0;const n=r(90412);class i extends n.Mediator{constructor(e){super(e)}async mediate(e){const t=[];let r;try{r=this.publish(e)}catch{r=[]}for(const e of r){const r=await e.reply;r.isPassed()&&t.push({actor:e.actor,sideData:r.getSideData()})}return(await Promise.all(t.map((t=>t.actor.runObservable(e,t.sideData)))))[0]}async mediateWith(){throw new Error("Unsupported operation: MediatorAll#mediateWith")}}t.MediatorAll=i},60504:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(60004),t)},6535:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediatorCombinePipeline=void 0;const n=r(90412);class i extends n.Mediator{constructor(e){super(e)}async mediate(e){let t;try{t=this.publish(e)}catch{return e}if(this.filterFailures){const e=[];for(const r of t)(await r.reply).isPassed()&&e.push(r);t=e}const r=[];if(t=await Promise.all(t.map((async({actor:t,reply:n},i)=>{try{const e=await n,a=e.getOrThrow();return r[i]=e.getSideData(),{actor:t,reply:a}}catch(t){throw new Error(this.constructFailureMessage(e,[t.message]))}}))),this.order){const e=e=>{const t=this.field?e[this.field]:e;if("number"!=typeof t)throw new TypeError("Cannot order elements that are not numbers.");return t};t=t.sort(((t,r)=>("increasing"===this.order?1:-1)*(e(t.reply)-e(r.reply))))}let n=e,i=0;for(const{actor:e}of t)n={...n,...await e.runObservable(n,r[i++])};return n}mediateWith(){throw new Error("Method not supported.")}}t.MediatorCombinePipeline=i},83223:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(6535),t)},1667:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediatorCombineUnion=void 0;const n=r(90412);class i extends n.Mediator{constructor(e){super(e),this.combiner=this.createCombiner()}async mediate(e){let t;try{t=this.publish(e)}catch{t=[]}if(this.filterFailures){const e=[];for(const r of t)(await r.reply).isPassed()&&e.push(r);t=e}const r=[];await Promise.all(t.map((async({reply:e},t)=>{const n=await e,i=n.getOrThrow();return r[t]=n.getSideData(),i})));const n=await Promise.all(t.map(((t,n)=>t.actor.runObservable(e,r[n]))));return this.combiner(n)}mediateWith(){throw new Error("Method not supported.")}createCombiner(){return e=>{const t={};return t[this.field]={},[{}].concat(e.map((e=>e[this.field]))).forEach((e=>{t[this.field]={...e,...t[this.field]}})),t}}}t.MediatorCombineUnion=i},54560:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(1667),t)},12278:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediatorJoinCoefficientsFixed=void 0;const n=r(90711),i=r(90412);class a extends i.Mediator{constructor(e){super(e)}async mediateWith(e,t){const r=[],a=t.map((({reply:e})=>e)),o=(await Promise.all(a)).map((e=>{if(!e.isFailed())return{value:e.get(),sideData:e.getSideData()};r.push(e.getFailMessage())}));let s=o.map((e=>{if(e)return e.value.iterations*this.cpuWeight+e.value.persistedItems*this.memoryWeight+e.value.blockingItems*this.timeWeight+e.value.requestTime*this.ioWeight}));const c=Math.max(...s.filter((e=>void 0!==e))),u=e.context.get(n.KeysQueryOperation.limitIndicator);u&&(s=s.map(((e,t)=>void 0!==e&&(o[t]?.value).blockingItems>0&&(o[t]?.value).iterations>u?e+c:e)));let l=-1,d=Number.POSITIVE_INFINITY;for(const[e,t]of s.entries())void 0!==t&&(-1===l||t(await e.output.metadata()).variables.map((e=>e.variable.value))))),costs:Object.fromEntries(s.map(((e,r)=>[`${t[r].actor.logicalType}-${t[r].actor.physicalName}`,e])).filter((e=>void 0!==e[1]))),coefficients:Object.fromEntries(o.map(((e,r)=>[`${t[r].actor.logicalType}-${t[r].actor.physicalName}`,e?.value])).filter((e=>void 0!==e[1])))}),(0,i.passTestWithSideData)(p,o[l].sideData)}}t.MediatorJoinCoefficientsFixed=a},47633:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(12278),t)},18202:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediatorNumber=void 0;const n=r(90412);class i extends n.Mediator{constructor(e){super(e),this.indexPicker=this.createIndexPicker()}createIndexPicker(){switch(this.type){case"min":return e=>e.reduce(((e,t,r)=>{const n=this.getOrDefault(t[this.field],Number.POSITIVE_INFINITY);return null!==n&&(Number.isNaN(e[0])||e[0]>n)?[n,r]:e}),[Number.NaN,-1])[1];case"max":return e=>e.reduce(((e,t,r)=>{const n=this.getOrDefault(t[this.field],Number.NEGATIVE_INFINITY);return null!==n&&(Number.isNaN(e[0])||e[0]e)));const i=[];if(this.ignoreFailures){const e={};e[this.field]=null,r=r.map((t=>t.isFailed()?(i.push(t.getFailMessage()),(0,n.passTestWithSideData)(e,void 0)):t))}const a=[],o=r.map(((e,t)=>{const r=e.getOrThrow();return a[t]=e.getSideData(),r})),s=this.indexPicker(o);return s<0?(0,n.failTest)(this.constructFailureMessage(e,i)):(0,n.passTestWithSideData)(t[s].actor,a[s])}}t.MediatorNumber=i},31588:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(18202),t)},15950:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediatorRace=void 0;const n=r(90412);class i extends n.Mediator{constructor(e){super(e)}mediateWith(e,t){return new Promise(((r,i)=>{const a=[];for(const o of t)o.reply.then((i=>{i.isPassed()?r((0,n.passTestWithSideData)(o.actor,i.getSideData())):(a.push(i.getFailMessage()),a.length===t.length&&r((0,n.failTest)(this.constructFailureMessage(e,a))))})).catch((e=>{i(e)}))}))}}t.MediatorRace=i},12740:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(15950),t)},98041:(e,t,r)=>{e.exports=function(e){const t=new(r(11832).LoggerVoid),n=new(r(90412).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-init/^4.0.0/components/ActorInit.jsonld#ActorInit_default_bus"}),i=new(r(90412).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-context-preprocess/^4.0.0/components/ActorContextPreprocess.jsonld#ActorContextPreprocess_default_bus"}),a=new(r(90412).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-hash-bindings/^4.0.0/components/ActorHashBindings.jsonld#ActorHashBindings_default_bus"}),o=new(r(90412).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-hash-quads/^4.0.0/components/ActorHashQuads.jsonld#ActorHashQuads_default_bus"}),s=new(r(90412).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-optimize-query-operation/^4.0.0/components/ActorOptimizeQueryOperation.jsonld#ActorOptimizeQueryOperation_default_bus"}),c=new(r(90412).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-parse/^4.0.0/components/ActorQueryParse.jsonld#ActorQueryParse_default_bus"}),u=new(r(90412).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-result-serialize/^4.0.0/components/ActorQueryResultSerialize.jsonld#ActorQueryResultSerialize_default_bus"}),l=new(r(90412).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-join-entries-sort/^4.0.0/components/ActorRdfJoinEntriesSort.jsonld#ActorRdfJoinEntriesSort_default_bus"}),d=new(r(90412).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-join-selectivity/^4.0.0/components/ActorRdfJoinSelectivity.jsonld#ActorRdfJoinSelectivity_default_bus"}),p=new(r(90412).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-metadata-accumulate/^4.0.0/components/ActorRdfMetadataAccumulate.jsonld#ActorRdfMetadataAccumulate_default_bus"}),h=new(r(90412).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-serialize/^4.0.0/components/ActorRdfSerialize.jsonld#ActorRdfSerialize_default_bus"}),f=new(r(90412).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-source-identify-hypermedia/^4.0.0/components/ActorQuerySourceIdentifyHypermedia.jsonld#ActorQuerySourceIdentifyHypermedia_default_bus"}),y=new(r(90412).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-update-quads/^4.0.0/components/ActorRdfUpdateQuads.jsonld#ActorRdfUpdateQuads_default_bus"}),g=new(r(90412).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-bindings-aggregator-factory/^4.0.0/components/ActorBindingsAggregatorFactory.jsonld#ActorBindingsAggregatorFactory_default_bus"}),m=new(r(90412).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-expression-evaluator-factory/^4.0.0/components/ActorExpressionEvaluatorFactory.jsonld#ActorExpressionEvaluatorFactory_default_bus"}),b=new(r(77617).BusFunctionFactory)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-function-factory/^4.0.0/components/ActorFunctionFactory.jsonld#ActorFunctionFactory_default_bus"}),v=new(r(66490).BusQueryOperation)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-operation/^4.0.0/components/ActorQueryOperation.jsonld#ActorQueryOperation_default_bus"}),_=new(r(90412).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-process/^4.0.0/components/ActorQueryProcess.jsonld#ActorQueryProcess_default_bus"}),w=new(r(90412).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-join/^4.0.0/components/ActorRdfJoin.jsonld#ActorRdfJoin_default_bus"}),O=new(r(90412).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-query-source-identify/^4.0.0/components/ActorQuerySourceIdentify.jsonld#ActorQuerySourceIdentify_default_bus"}),T=new(r(90412).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-term-comparator-factory/^4.0.0/components/ActorTermComparatorFactory.jsonld#ActorTermComparatorFactory_default_bus"}),S=new(r(90412).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-http-invalidate/^4.0.0/components/ActorHttpInvalidate.jsonld#ActorHttpInvalidate_default_bus"}),E=new(r(90412).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-http/^4.0.0/components/ActorHttp.jsonld#ActorHttp_default_bus"}),x=new(r(90412).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-http/^4.0.0/components/ActorHttp.jsonld#ActorHttp_fallback_bus"}),I=new(r(90412).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-merge-bindings-context/^4.0.0/components/ActorMergeBindingsContext.jsonld#ActorMergeBindingsContext_default_bus"}),A=new(r(90412).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-dereference-rdf/^4.0.0/components/ActorDereferenceRdf.jsonld#ActorDereferenceRdf_default_bus"}),j=new(r(90412).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-metadata/^4.0.0/components/ActorRdfMetadata.jsonld#ActorRdfMetadata_default_bus"}),N=new(r(90412).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-metadata-extract/^4.0.0/components/ActorRdfMetadataExtract.jsonld#ActorRdfMetadataExtract_default_bus"}),R=new(r(90412).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-resolve-hypermedia-links/^4.0.0/components/ActorRdfResolveHypermediaLinks.jsonld#ActorRdfResolveHypermediaLinks_default_bus"}),D=new(r(90412).Bus)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/bus-rdf-resolve-hypermedia-links-queue/^4.0.0/components/ActorRdfResolveHypermediaLinksQueue.jsonld#ActorRdfResolveHypermediaLinksQueue_default_bus"}),P=(new(r(71871).ActorContextPreprocessConvertShortcuts)({contextKeyShortcuts:{baseIRI:"@comunica/actor-init-query:baseIRI",dataFactory:"@comunica/actor-init-query:dataFactory",datetime:"@comunica/actor-http-memento:datetime",destination:"@comunica/bus-rdf-update-quads:destination",distinctConstruct:"@comunica/actor-init-query:distinctConstruct",explain:"@comunica/actor-init-query:explain",extensionFunctionCreator:"@comunica/actor-init-query:extensionFunctionCreator",extensionFunctions:"@comunica/actor-init-query:extensionFunctions",fetch:"@comunica/bus-http:fetch",functionArgumentsCache:"@comunica/actor-init-query:functionArgumentsCache",httpAuth:"@comunica/bus-http:auth",httpBodyTimeout:"@comunica/bus-http:http-body-timeout",httpIncludeCredentials:"@comunica/bus-http:include-credentials",httpProxyHandler:"@comunica/actor-http-proxy:httpProxyHandler",httpRetryCount:"@comunica/bus-http:http-retry-count",httpRetryDelayFallback:"@comunica/bus-http:http-retry-delay-fallback",httpRetryDelayLimit:"@comunica/bus-http:http-retry-delay-limit",httpTimeout:"@comunica/bus-http:http-timeout",initialBindings:"@comunica/actor-init-query:initialBindings",invalidateCache:"@comunica/actor-init-query:invalidateCache",lenient:"@comunica/actor-init-query:lenient",log:"@comunica/core:log",queryFormat:"@comunica/actor-init-query:queryFormat",queryTimestamp:"@comunica/actor-init-query:queryTimestamp",queryTimestampHighResolution:"@comunica/actor-init-query:queryTimestampHighResolution",readOnly:"@comunica/bus-query-operation:readOnly",recoverBrokenLinks:"@comunica/bus-http-wayback:recover-broken-links",sources:"@comunica/actor-init-query:querySourcesUnidentified",traverse:"@comunica/bus-query-source-identify:traverse",unionDefaultGraph:"@comunica/bus-query-operation:unionDefaultGraph"},name:"urn:comunica:default:context-preprocess/actors#convert-shortcuts",bus:i,busFailMessage:"Context preprocessing failed"}),new(r(10607).ActorContextPreprocessSetDefaults)({logger:t,name:"urn:comunica:default:context-preprocess/actors#set-defaults",bus:i,busFailMessage:"Context preprocessing failed"}),new(r(94410).ActorContextPreprocessSourceToDestination)({name:"urn:comunica:default:context-preprocess/actors#source-to-destination",bus:i,busFailMessage:"Context preprocessing failed"}),new(r(21806).ActorContextPreprocessQuerySourceSkolemize)({name:"urn:comunica:default:context-preprocess/actors#query-source-skolemize",bus:i,busFailMessage:"Context preprocessing failed"})),F=new(r(83223).MediatorCombinePipeline)({name:"urn:comunica:default:context-preprocess/mediators#main",bus:i}),C=(new(r(47111).ActorHashBindingsMurmur)({name:"urn:comunica:default:hash-bindings/actors#murmur",bus:a,busFailMessage:"Failed to obtaining hash functions for bindings"}),new(r(12740).MediatorRace)({name:"urn:comunica:default:hash-bindings/mediators#main",bus:a})),M=(new(r(33401).ActorHashQuadsMurmur)({name:"urn:comunica:default:hash-quads/actors#murmur",bus:o,busFailMessage:"Failed to obtaining hash functions for quads"}),new(r(12740).MediatorRace)({name:"urn:comunica:default:hash-quads/mediators#main",bus:o})),L=(new(r(20578).ActorOptimizeQueryOperationRewriteCopy)({name:"urn:comunica:default:optimize-query-operation/actors#rewrite-copy",bus:s,busFailMessage:"Query optimization failed: none of the configured actors were able to optimize"}),new(r(12538).ActorOptimizeQueryOperationRewriteMove)({name:"urn:comunica:default:optimize-query-operation/actors#rewrite-move",bus:s,busFailMessage:"Query optimization failed: none of the configured actors were able to optimize"}),new(r(34406).ActorOptimizeQueryOperationRewriteAdd)({name:"urn:comunica:default:optimize-query-operation/actors#rewrite-add",bus:s,busFailMessage:"Query optimization failed: none of the configured actors were able to optimize"}),new(r(92012).ActorOptimizeQueryOperationGroupSources)({name:"urn:comunica:default:optimize-query-operation/actors#group-sources",bus:s,busFailMessage:"Query optimization failed: none of the configured actors were able to optimize"})),k=(new(r(98832).ActorOptimizeQueryOperationConstructDistinct)({name:"urn:comunica:default:optimize-query-operation/actors#construct-distinct",bus:s,busFailMessage:"Query optimization failed: none of the configured actors were able to optimize"}),new(r(83223).MediatorCombinePipeline)({filterFailures:!0,name:"urn:comunica:default:optimize-query-operation/mediators#main",bus:s})),B=(new(r(8323).ActorQueryParseSparql)({prefixes:{dbpedia:"http://dbpedia.org/resource/","dbpedia-owl":"http://dbpedia.org/ontology/",dbpprop:"http://dbpedia.org/property/",dc:"http://purl.org/dc/terms/",dc11:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",foaf:"http://xmlns.com/foaf/0.1/",geo:"http://www.w3.org/2003/01/geo/wgs84_pos#",owl:"http://www.w3.org/2002/07/owl#",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",schema:"http://schema.org/",skos:"http://www.w3.org/2008/05/skos#",xsd:"http://www.w3.org/2001/XMLSchema#"},name:"urn:comunica:default:query-parse/actors#sparql",bus:c,busFailMessage:'Query parsing failed: none of the configured parsers were able to the query "${action.query}"'}),new(r(4047).ActorQueryParseGraphql)({name:"urn:comunica:default:query-parse/actors#graphql",bus:c,busFailMessage:'Query parsing failed: none of the configured parsers were able to the query "${action.query}"'}),new(r(12740).MediatorRace)({name:"urn:comunica:default:query-parse/mediators#main",bus:c})),U=(new(r(1359).ActorQueryResultSerializeJson)({mediaTypePriorities:{"application/json":1},mediaTypeFormats:{"application/json":"https://comunica.linkeddatafragments.org/#results_JSON"},name:"urn:comunica:default:query-result-serialize/actors#json",bus:u,busFailMessage:"Query result serialization failed: none of the configured actors were able to serialize for type ${action.handle.type}"}),new(r(1595).ActorQueryResultSerializeSimple)({mediaTypePriorities:{simple:.9},mediaTypeFormats:{simple:"https://comunica.linkeddatafragments.org/#results_simple"},name:"urn:comunica:default:query-result-serialize/actors#simple",bus:u,busFailMessage:"Query result serialization failed: none of the configured actors were able to serialize for type ${action.handle.type}"}),new(r(83657).ActorQueryResultSerializeSparqlCsv)({mediaTypePriorities:{"text/csv":.75},mediaTypeFormats:{"text/csv":"http://www.w3.org/ns/formats/SPARQL_Results_CSV"},name:"urn:comunica:default:query-result-serialize/actors#csv",bus:u,busFailMessage:"Query result serialization failed: none of the configured actors were able to serialize for type ${action.handle.type}"}),new(r(92796).ActorQueryResultSerializeSparqlTsv)({mediaTypePriorities:{"text/tab-separated-values":.75},mediaTypeFormats:{"text/tab-separated-values":"http://www.w3.org/ns/formats/SPARQL_Results_TSV"},name:"urn:comunica:default:query-result-serialize/actors#sparql-tsv",bus:u,busFailMessage:"Query result serialization failed: none of the configured actors were able to serialize for type ${action.handle.type}"}),new(r(23200).ActorQueryResultSerializeSparqlXml)({mediaTypePriorities:{"application/sparql-results+xml":.8},mediaTypeFormats:{"application/sparql-results+xml":"http://www.w3.org/ns/formats/SPARQL_Results_XML"},name:"urn:comunica:default:query-result-serialize/actors#sparql-xml",bus:u,busFailMessage:"Query result serialization failed: none of the configured actors were able to serialize for type ${action.handle.type}"}),new(r(17731).ActorQueryResultSerializeTable)({columnWidth:50,mediaTypePriorities:{table:.6},mediaTypeFormats:{table:"https://comunica.linkeddatafragments.org/#results_table"},name:"urn:comunica:default:query-result-serialize/actors#table",bus:u,busFailMessage:"Query result serialization failed: none of the configured actors were able to serialize for type ${action.handle.type}"}),new(r(78149).ActorQueryResultSerializeTree)({mediaTypePriorities:{tree:.5},mediaTypeFormats:{tree:"https://comunica.linkeddatafragments.org/#results_tree"},name:"urn:comunica:default:query-result-serialize/actors#tree",bus:u,busFailMessage:"Query result serialization failed: none of the configured actors were able to serialize for type ${action.handle.type}"}),new(r(12740).MediatorRace)({name:"urn:comunica:default:query-result-serialize/mediators#serialize",bus:u})),V=new(r(54560).MediatorCombineUnion)({field:"mediaTypes",name:"urn:comunica:default:query-result-serialize/mediators#mediaType",bus:u}),$=new(r(54560).MediatorCombineUnion)({field:"mediaTypeFormats",name:"urn:comunica:default:query-result-serialize/mediators#mediaTypeFormat",bus:u}),q=(new(r(4669).ActorRdfJoinEntriesSortCardinality)({name:"urn:comunica:default:rdf-join-entries-sort/actors#cardinality",bus:l,busFailMessage:"Sorting join entries failed: none of the configured actors were able to sort"}),new(r(12740).MediatorRace)({name:"urn:comunica:default:rdf-join-entries-sort/mediators#main",bus:l})),Q=(new(r(3595).ActorRdfJoinSelectivityVariableCounting)({name:"urn:comunica:default:rdf-join-selectivity/actors#variable-counting",bus:d,busFailMessage:"Determining join selectivity failed: none of the configured actors were able to calculate selectivities"}),new(r(31588).MediatorNumber)({field:"accuracy",type:"max",ignoreFailures:!0,name:"urn:comunica:default:rdf-join-selectivity/mediators#main",bus:d})),G=(new(r(37143).ActorRdfMetadataAccumulateCardinality)({name:"urn:comunica:default:rdf-metadata-accumulate/actors#cardinality",bus:p,busFailMessage:"Metadata accumulation failed: none of the configured actors were able to accumulate metadata in mode ${action.mode}"}),new(r(17215).ActorRdfMetadataAccumulatePageSize)({name:"urn:comunica:default:rdf-metadata-accumulate/actors#pagesize",bus:p,busFailMessage:"Metadata accumulation failed: none of the configured actors were able to accumulate metadata in mode ${action.mode}"}),new(r(59075).ActorRdfMetadataAccumulateRequestTime)({name:"urn:comunica:default:rdf-metadata-accumulate/actors#requesttime",bus:p,busFailMessage:"Metadata accumulation failed: none of the configured actors were able to accumulate metadata in mode ${action.mode}"}),new(r(54560).MediatorCombineUnion)({field:"metadata",name:"urn:comunica:default:rdf-metadata-accumulate/mediators#main",bus:p})),z=(new(r(42274).ActorRdfSerializeN3)({mediaTypePriorities:{"application/n-quads":1,"application/n-triples":.8,"application/trig":.95,"text/n3":.35,"text/turtle":.6},mediaTypeFormats:{"application/n-quads":"http://www.w3.org/ns/formats/N-Quads","application/n-triples":"http://www.w3.org/ns/formats/N-Triples","application/trig":"http://www.w3.org/ns/formats/TriG","text/n3":"http://www.w3.org/ns/formats/N3","text/turtle":"http://www.w3.org/ns/formats/Turtle"},name:"urn:comunica:default:rdf-serialize/actors#n3",bus:h,busFailMessage:"RDF serialization failed: none of the configured serializers were able to handle media type ${action.handleMediaType}"}),new(r(61515).ActorRdfSerializeJsonLd)({jsonStringifyIndentSpaces:2,mediaTypePriorities:{"application/ld+json":1},mediaTypeFormats:{"application/ld+json":"http://www.w3.org/ns/formats/JSON-LD"},priorityScale:.9,name:"urn:comunica:default:rdf-serialize/actors#jsonld",bus:h,busFailMessage:"RDF serialization failed: none of the configured serializers were able to handle media type ${action.handleMediaType}"}),new(r(98371).ActorRdfSerializeShaclc)({mediaTypePriorities:{"text/shaclc":1,"text/shaclc-ext":.5},mediaTypeFormats:{"text/shaclc":"http://www.w3.org/ns/formats/Shaclc","text/shaclc-ext":"http://www.w3.org/ns/formats/ShaclcExtended"},priorityScale:.1,name:"urn:comunica:default:rdf-serialize/actors#shaclc",bus:h,busFailMessage:"RDF serialization failed: none of the configured serializers were able to handle media type ${action.handleMediaType}"}),new(r(12740).MediatorRace)({name:"urn:comunica:default:rdf-serialize/mediators#serialize",bus:h})),H=new(r(54560).MediatorCombineUnion)({field:"mediaTypes",name:"urn:comunica:default:rdf-serialize/mediators#mediaType",bus:h}),K=new(r(54560).MediatorCombineUnion)({field:"mediaTypeFormats",name:"urn:comunica:default:rdf-serialize/mediators#mediaTypeFormat",bus:h}),X=new(r(31588).MediatorNumber)({field:"filterFactor",type:"max",ignoreFailures:!0,name:"urn:comunica:default:query-source-identify-hypermedia/mediators#main",bus:f}),J=(new(r(53550).ActorRdfUpdateQuadsRdfJsStore)({name:"urn:comunica:default:rdf-update-quads/actors#rdfjs-store",bus:y,busFailMessage:"RDF updating failed: none of the configured actors were able to handle an update"}),new(r(12740).MediatorRace)({name:"urn:comunica:default:rdf-update-quads/mediators#main",bus:y})),W=new(r(12740).MediatorRace)({name:"urn:comunica:default:bindings-aggregator-factory/mediators#main",bus:g}),Y=new(r(12740).MediatorRace)({name:"urn:comunica:default:expression-evaluator-factory/mediators#main",bus:m}),Z=(new(r(52598).ActorFunctionFactoryExpressionBnode)({name:"urn:comunica:default:function-factory/actors#expression-function-bnode",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(19856).ActorFunctionFactoryExpressionBound)({name:"urn:comunica:default:function-factory/actors#expression-function-bound",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(4475).ActorFunctionFactoryExpressionCoalesce)({name:"urn:comunica:default:function-factory/actors#expression-function-coalesce",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(85312).ActorFunctionFactoryExpressionConcat)({name:"urn:comunica:default:function-factory/actors#expression-function-concat",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(66478).ActorFunctionFactoryExpressionExtensions)({name:"urn:comunica:default:function-factory/actors#expression-function-extensions",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(40767).ActorFunctionFactoryExpressionIf)({name:"urn:comunica:default:function-factory/actors#expression-function-if",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(1223).ActorFunctionFactoryExpressionLogicalOr)({name:"urn:comunica:default:function-factory/actors#expression-function-logical-or",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(12067).ActorFunctionFactoryExpressionLogicalAnd)({name:"urn:comunica:default:function-factory/actors#expression-function-logical-and",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(14579).ActorFunctionFactoryExpressionSameTerm)({name:"urn:comunica:default:function-factory/actors#expression-function-same-term",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(59812).ActorFunctionFactoryTermAbs)({name:"urn:comunica:default:function-factory/actors#term-function-abs",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(91172).ActorFunctionFactoryTermAddition)({name:"urn:comunica:default:function-factory/actors#term-function-addition",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(30953).ActorFunctionFactoryTermCeil)({name:"urn:comunica:default:function-factory/actors#term-function-ceil",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(72945).ActorFunctionFactoryTermContains)({name:"urn:comunica:default:function-factory/actors#term-function-contains",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(24700).ActorFunctionFactoryTermDatatype)({name:"urn:comunica:default:function-factory/actors#term-function-datatype",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(99778).ActorFunctionFactoryTermDay)({name:"urn:comunica:default:function-factory/actors#term-function-day",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(30971).ActorFunctionFactoryTermEncodeForUri)({name:"urn:comunica:default:function-factory/actors#term-function-encode-for-uri",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(61103).ActorFunctionFactoryTermDivision)({name:"urn:comunica:default:function-factory/actors#term-function-division",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(61688).ActorFunctionFactoryTermEquality)({name:"urn:comunica:default:function-factory/actors#term-function-equality",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(56718).ActorFunctionFactoryTermFloor)({name:"urn:comunica:default:function-factory/actors#term-function-floor",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(54531).ActorFunctionFactoryTermHours)({name:"urn:comunica:default:function-factory/actors#term-function-hours",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(16686).ActorFunctionFactoryTermIri)({name:"urn:comunica:default:function-factory/actors#term-function-iri",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(92959).ActorFunctionFactoryTermIsBlank)({name:"urn:comunica:default:function-factory/actors#term-function-is-blank",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(11767).ActorFunctionFactoryTermIsIri)({name:"urn:comunica:default:function-factory/actors#term-function-is-iri",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(30254).ActorFunctionFactoryTermIsLiteral)({name:"urn:comunica:default:function-factory/actors#term-function-is-literal",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(6082).ActorFunctionFactoryTermIsNumeric)({name:"urn:comunica:default:function-factory/actors#term-function-is-numeric",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(61151).ActorFunctionFactoryTermIsTriple)({name:"urn:comunica:default:function-factory/actors#term-function-is-triple",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(33032).ActorFunctionFactoryTermLang)({name:"urn:comunica:default:function-factory/actors#term-function-lang",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(15769).ActorFunctionFactoryTermLangmatches)({name:"urn:comunica:default:function-factory/actors#term-function-langmatches",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(22460).ActorFunctionFactoryTermLcase)({name:"urn:comunica:default:function-factory/actors#term-function-lcase",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(12744).ActorFunctionFactoryTermMd5)({name:"urn:comunica:default:function-factory/actors#term-function-md5",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(24713).ActorFunctionFactoryTermMinutes)({name:"urn:comunica:default:function-factory/actors#term-function-minutes",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(32310).ActorFunctionFactoryTermMonth)({name:"urn:comunica:default:function-factory/actors#term-function-month",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(23610).ActorFunctionFactoryTermMultiplication)({name:"urn:comunica:default:function-factory/actors#term-function-multiplication",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(52505).ActorFunctionFactoryTermNot)({name:"urn:comunica:default:function-factory/actors#term-function-not",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(69636).ActorFunctionFactoryTermNow)({name:"urn:comunica:default:function-factory/actors#term-function-now",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(20379).ActorFunctionFactoryTermObject)({name:"urn:comunica:default:function-factory/actors#term-function-object",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(68545).ActorFunctionFactoryTermPredicate)({name:"urn:comunica:default:function-factory/actors#term-function-predicate",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(86155).ActorFunctionFactoryTermRand)({name:"urn:comunica:default:function-factory/actors#term-function-rand",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(98811).ActorFunctionFactoryTermRegex)({name:"urn:comunica:default:function-factory/actors#term-function-regex",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(52452).ActorFunctionFactoryTermReplace)({name:"urn:comunica:default:function-factory/actors#term-function-replace",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(80748).ActorFunctionFactoryTermRound)({name:"urn:comunica:default:function-factory/actors#term-function-round",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(9941).ActorFunctionFactoryTermSeconds)({name:"urn:comunica:default:function-factory/actors#term-function-seconds",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(45845).ActorFunctionFactoryTermSha1)({name:"urn:comunica:default:function-factory/actors#term-function-sha1",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(77267).ActorFunctionFactoryTermSha256)({name:"urn:comunica:default:function-factory/actors#term-function-sha256",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(96447).ActorFunctionFactoryTermSha384)({name:"urn:comunica:default:function-factory/actors#term-function-sha384",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(24742).ActorFunctionFactoryTermSha512)({name:"urn:comunica:default:function-factory/actors#term-function-sha512",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(30912).ActorFunctionFactoryTermStrAfter)({name:"urn:comunica:default:function-factory/actors#term-function-str-after",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(60649).ActorFunctionFactoryTermStrBefore)({name:"urn:comunica:default:function-factory/actors#term-function-str-before",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(49060).ActorFunctionFactoryTermStrEnds)({name:"urn:comunica:default:function-factory/actors#term-function-str-ends",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(93734).ActorFunctionFactoryTermStrDt)({name:"urn:comunica:default:function-factory/actors#term-function-str-dt",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(20554).ActorFunctionFactoryTermStrLang)({name:"urn:comunica:default:function-factory/actors#term-function-str-lang",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(27869).ActorFunctionFactoryTermStrLen)({name:"urn:comunica:default:function-factory/actors#term-function-str-len",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(94379).ActorFunctionFactoryTermStrStarts)({name:"urn:comunica:default:function-factory/actors#term-function-str-starts",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(53417).ActorFunctionFactoryTermStrUuid)({name:"urn:comunica:default:function-factory/actors#term-function-str-uuid",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(28699).ActorFunctionFactoryTermStr)({name:"urn:comunica:default:function-factory/actors#term-function-str",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(96404).ActorFunctionFactoryTermSubStr)({name:"urn:comunica:default:function-factory/actors#term-function-sub-str",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(51060).ActorFunctionFactoryTermSubject)({name:"urn:comunica:default:function-factory/actors#term-function-subject",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(4535).ActorFunctionFactoryTermTimezone)({name:"urn:comunica:default:function-factory/actors#term-function-timezone",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(55010).ActorFunctionFactoryTermSubtraction)({name:"urn:comunica:default:function-factory/actors#term-function-subtraction",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(31348).ActorFunctionFactoryTermTriple)({name:"urn:comunica:default:function-factory/actors#term-function-triple",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(4898).ActorFunctionFactoryTermTz)({name:"urn:comunica:default:function-factory/actors#term-function-tz",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(55711).ActorFunctionFactoryTermUcase)({name:"urn:comunica:default:function-factory/actors#term-function-ucase",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(67186).ActorFunctionFactoryTermUnaryMinus)({name:"urn:comunica:default:function-factory/actors#term-function-unary-minus",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(2810).ActorFunctionFactoryTermUnaryPlus)({name:"urn:comunica:default:function-factory/actors#term-function-unary-plus",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(2479).ActorFunctionFactoryTermUuid)({name:"urn:comunica:default:function-factory/actors#term-function-uuid",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(11554).ActorFunctionFactoryTermXsdToBoolean)({name:"urn:comunica:default:function-factory/actors#term-function-xsd-to-boolean",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(43406).ActorFunctionFactoryTermXsdToDate)({name:"urn:comunica:default:function-factory/actors#term-function-xsd-to-date",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(4523).ActorFunctionFactoryTermXsdToDatetime)({name:"urn:comunica:default:function-factory/actors#term-function-xsd-to-datetime",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(69721).ActorFunctionFactoryTermXsdToDayTimeDuration)({name:"urn:comunica:default:function-factory/actors#term-function-xsd-to-day-time-duration",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(48758).ActorFunctionFactoryTermXsdToDuration)({name:"urn:comunica:default:function-factory/actors#term-function-xsd-to-duration",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(25033).ActorFunctionFactoryTermXsdToDecimal)({name:"urn:comunica:default:function-factory/actors#term-function-xsd-to-decimal",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(99507).ActorFunctionFactoryTermXsdToDouble)({name:"urn:comunica:default:function-factory/actors#term-function-xsd-to-double",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(64068).ActorFunctionFactoryTermXsdToFloat)({name:"urn:comunica:default:function-factory/actors#term-function-xsd-to-float",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(8096).ActorFunctionFactoryTermXsdToInteger)({name:"urn:comunica:default:function-factory/actors#term-function-xsd-to-integer",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(91799).ActorFunctionFactoryTermXsdToString)({name:"urn:comunica:default:function-factory/actors#term-function-xsd-to-string",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(18895).ActorFunctionFactoryTermXsdToTime)({name:"urn:comunica:default:function-factory/actors#term-function-xsd-to-time",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(26143).ActorFunctionFactoryTermXsdToYearMonthDuration)({name:"urn:comunica:default:function-factory/actors#term-function-xsd-to-year-month-duration",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(22361).ActorFunctionFactoryTermYear)({name:"urn:comunica:default:function-factory/actors#term-function-year",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(12740).MediatorRace)({name:"urn:comunica:default:function-factory/mediators#main",bus:b})),ee=(new(r(48169).ActorQueryOperationSource)({name:"urn:comunica:default:query-operation/actors#source",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(31588).MediatorNumber)({field:"httpRequests",type:"min",ignoreFailures:!0,name:"urn:comunica:default:query-operation/mediators#main",bus:v})),te=new(r(12740).MediatorRace)({name:"urn:comunica:default:query-process/mediators#main",bus:_}),re=new(r(47633).MediatorJoinCoefficientsFixed)({cpuWeight:10,memoryWeight:1,timeWeight:2,ioWeight:10,name:"urn:comunica:default:rdf-join/mediators#main",bus:w}),ne=new(r(12740).MediatorRace)({name:"urn:comunica:default:query-source-identify/mediators#main",bus:O}),ie=new(r(12740).MediatorRace)({name:"urn:comunica:default:term-comparator-factory/mediators#main",bus:T}),ae=new(r(40332).ActorHttpInvalidateListenable)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-context-preprocess-query-source-identify/^4.0.0/components/ActorContextPreprocessQuerySourceIdentify.jsonld#IActorContextPreprocessQuerySourceIdentifyArgs_default_invalidator",bus:S,busFailMessage:"HTTP invalidation failed: none of the configured actors were able to invalidate ${action.url}"}),oe=new(r(60504).MediatorAll)({name:"urn:comunica:default:http-invalidate/mediators#main",bus:S}),se=new(r(40332).ActorHttpInvalidateListenable)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-result-serialize-sparql-json/^4.0.0/components/ActionObserverHttp.jsonld#IActionObserverHttpArgs_default_invalidator",bus:S,busFailMessage:"HTTP invalidation failed: none of the configured actors were able to invalidate ${action.url}"}),ce=new(r(40332).ActorHttpInvalidateListenable)({name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-result-serialize-stats/^4.0.0/components/ActionObserverHttp.jsonld#IActionObserverHttpArgs_default_invalidator",bus:S,busFailMessage:"HTTP invalidation failed: none of the configured actors were able to invalidate ${action.url}"}),ue=new(r(31588).MediatorNumber)({field:"time",type:"min",ignoreFailures:!0,name:"urn:comunica:default:http/mediators#main",bus:x}),le=new(r(54560).MediatorCombineUnion)({field:"mergeHandlers",name:"urn:comunica:default:merge-bindings-context/mediators#main",bus:I}),de=new(r(12740).MediatorRace)({name:"urn:comunica:default:dereference-rdf/mediators#main",bus:A}),pe=new(r(12740).MediatorRace)({name:"urn:comunica:default:rdf-metadata/mediators#main",bus:j}),he=new(r(54560).MediatorCombineUnion)({filterFailures:!0,field:"metadata",name:"urn:comunica:default:rdf-metadata-extract/mediators#main",bus:N}),fe=new(r(12740).MediatorRace)({name:"urn:comunica:default:rdf-resolve-hypermedia-links/mediators#main",bus:R}),ye=new(r(12740).MediatorRace)({name:"urn:comunica:default:rdf-resolve-hypermedia-links-queue/mediators#main",bus:D}),ge=(new(r(71924).ActorRdfJoinSingle)({mediatorJoinSelectivity:Q,name:"urn:comunica:default:rdf-join/actors#inner-single",bus:w,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"}),new(r(25445).ActorRdfJoinMultiEmpty)({mediatorJoinSelectivity:Q,name:"urn:comunica:default:rdf-join/actors#inner-multi-empty",bus:w,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"}),new(r(96848).ActorRdfJoinHash)({mediatorHashBindings:C,canHandleUndefs:!1,mediatorJoinSelectivity:Q,name:"urn:comunica:default:rdf-join/actors#inner-hash-def",bus:w,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"})),me=new(r(96848).ActorRdfJoinHash)({mediatorHashBindings:C,canHandleUndefs:!0,mediatorJoinSelectivity:Q,name:"urn:comunica:default:rdf-join/actors#inner-hash-undef",bus:w,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"}),be=new(r(96835).ActorRdfJoinSymmetricHash)({mediatorHashBindings:C,mediatorJoinSelectivity:Q,name:"urn:comunica:default:rdf-join/actors#inner-symmetric-hash",bus:w,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"}),ve=new(r(36229).ActorRdfJoinNestedLoop)({mediatorJoinSelectivity:Q,name:"urn:comunica:default:rdf-join/actors#inner-nested-loop",bus:w,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"}),_e=(new(r(42004).ActorRdfJoinMinusHash)({canHandleUndefs:!1,mediatorJoinSelectivity:Q,name:"urn:comunica:default:rdf-join/actors#minus-hash-def",bus:w,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"}),new(r(42004).ActorRdfJoinMinusHash)({canHandleUndefs:!0,mediatorJoinSelectivity:Q,name:"urn:comunica:default:rdf-join/actors#minus-hash-undef",bus:w,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"}),new(r(60146).ActorRdfJoinOptionalHash)({canHandleUndefs:!1,blocking:!1,mediatorJoinSelectivity:Q,name:"urn:comunica:default:rdf-join/actors#optional-hash-def-nonblocking",bus:w,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"}),new(r(60146).ActorRdfJoinOptionalHash)({canHandleUndefs:!1,blocking:!0,mediatorJoinSelectivity:Q,name:"urn:comunica:default:rdf-join/actors#optional-hash-def-blocking",bus:w,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"}),new(r(60146).ActorRdfJoinOptionalHash)({canHandleUndefs:!0,blocking:!1,mediatorJoinSelectivity:Q,name:"urn:comunica:default:rdf-join/actors#optional-hash-undef-nonblocking",bus:w,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"}),new(r(60146).ActorRdfJoinOptionalHash)({canHandleUndefs:!0,blocking:!0,mediatorJoinSelectivity:Q,name:"urn:comunica:default:rdf-join/actors#optional-hash-undef-blocking",bus:w,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"}),new(r(65267).ActorRdfJoinOptionalNestedLoop)({mediatorJoinSelectivity:Q,name:"urn:comunica:default:rdf-join/actors#optional-nested-loop",bus:w,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"}),new(r(33275).ActorQueryResultSerializeRdf)({mediatorRdfSerialize:z,mediatorMediaTypeCombiner:H,mediatorMediaTypeFormatCombiner:K,name:"urn:comunica:default:query-result-serialize/actors#rdf",bus:u,busFailMessage:"Query result serialization failed: none of the configured actors were able to serialize for type ${action.handle.type}"}),new(r(37779).ActorBindingsAggregatorFactoryGroupConcat)({mediatorExpressionEvaluatorFactory:Y,name:"urn:comunica:default:bindings-aggregator-factory/actors#group-concat",bus:g,busFailMessage:"Creation of Aggregator failed: none of the configured actors were able to handle ${action.expr.aggregator}"}),new(r(2236).ActorBindingsAggregatorFactoryCount)({mediatorExpressionEvaluatorFactory:Y,name:"urn:comunica:default:bindings-aggregator-factory/actors#count",bus:g,busFailMessage:"Creation of Aggregator failed: none of the configured actors were able to handle ${action.expr.aggregator}"}),new(r(71271).ActorBindingsAggregatorFactorySample)({mediatorExpressionEvaluatorFactory:Y,name:"urn:comunica:default:bindings-aggregator-factory/actors#sample",bus:g,busFailMessage:"Creation of Aggregator failed: none of the configured actors were able to handle ${action.expr.aggregator}"}),new(r(20489).ActorBindingsAggregatorFactoryWildcardCount)({mediatorExpressionEvaluatorFactory:Y,name:"urn:comunica:default:bindings-aggregator-factory/actors#wildcard-count",bus:g,busFailMessage:"Creation of Aggregator failed: none of the configured actors were able to handle ${action.expr.aggregator}"}),new(r(17352).ActorBindingsAggregatorFactoryAverage)({mediatorFunctionFactory:Z,mediatorExpressionEvaluatorFactory:Y,name:"urn:comunica:default:bindings-aggregator-factory/actors#average",bus:g,busFailMessage:"Creation of Aggregator failed: none of the configured actors were able to handle ${action.expr.aggregator}"}),new(r(26568).ActorBindingsAggregatorFactorySum)({mediatorFunctionFactory:Z,mediatorExpressionEvaluatorFactory:Y,name:"urn:comunica:default:bindings-aggregator-factory/actors#sum",bus:g,busFailMessage:"Creation of Aggregator failed: none of the configured actors were able to handle ${action.expr.aggregator}"}),new(r(94311).ActorFunctionFactoryExpressionIn)({mediatorFunctionFactory:Z,name:"urn:comunica:default:function-factory/actors#expression-function-in",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(63067).ActorFunctionFactoryExpressionNotIn)({mediatorFunctionFactory:Z,name:"urn:comunica:default:function-factory/actors#expression-function-not-in",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(8711).ActorFunctionFactoryTermGreaterThanEqual)({mediatorFunctionFactory:Z,name:"urn:comunica:default:function-factory/actors#term-function-greater-than-equal",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(31038).ActorFunctionFactoryTermGreaterThan)({mediatorFunctionFactory:Z,name:"urn:comunica:default:function-factory/actors#term-function-greater-than",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(76695).ActorFunctionFactoryTermInequality)({mediatorFunctionFactory:Z,name:"urn:comunica:default:function-factory/actors#term-function-inequality",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(38507).ActorFunctionFactoryTermLesserThanEqual)({mediatorFunctionFactory:Z,name:"urn:comunica:default:function-factory/actors#term-function-lesser-than-equal",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(95426).ActorFunctionFactoryTermLesserThan)({mediatorFunctionFactory:Z,name:"urn:comunica:default:function-factory/actors#term-function-lesser-than",bus:b,busFailMessage:"Creation of function evaluator failed: no configured actor was able to evaluate function ${action.functionName}"}),new(r(16682).ActorQueryOperationAsk)({mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#ask",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(38820).ActorQueryOperationBgpJoin)({mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#bgp",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(34585).ActorQueryOperationConstruct)({mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#construct",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(24615).ActorQueryOperationDistinctHash)({mediatorHashBindings:C,mediatorHashQuads:M,mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#distinct",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(12304).ActorQueryOperationExtend)({mediatorExpressionEvaluatorFactory:Y,mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#extend",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(68350).ActorQueryOperationFilter)({mediatorExpressionEvaluatorFactory:Y,mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#filter",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(22744).ActorQueryOperationFromQuad)({mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#from",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(99817).ActorQueryOperationProject)({mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#project",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(66713).ActorQueryOperationReducedHash)({mediatorHashBindings:C,cacheSize:100,mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#reduced",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(24718).ActorQueryOperationSlice)({mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#slice",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(43415).ActorQueryOperationUnion)({mediatorRdfMetadataAccumulate:G,mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#union",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(35529).ActorQueryOperationPathAlt)({mediatorRdfMetadataAccumulate:G,mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#path-alt",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(6809).ActorQueryOperationPathInv)({mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#path-inv",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(66218).ActorQueryOperationPathLink)({mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#path-link",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(54309).ActorQueryOperationPathNps)({mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#path-nps",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(84629).ActorQueryOperationClear)({mediatorUpdateQuads:J,mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#update-clear",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(330).ActorQueryOperationUpdateCompositeUpdate)({mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#update-composite",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(54672).ActorQueryOperationCreate)({mediatorUpdateQuads:J,mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#update-create",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(33181).ActorQueryOperationDrop)({mediatorUpdateQuads:J,mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#update-drop",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(20240).ActorQueryOperationJoin)({mediatorJoin:re,mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#join",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(75113).ActorQueryOperationLeftJoin)({mediatorJoin:re,mediatorExpressionEvaluatorFactory:Y,mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#leftjoin",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(48952).ActorQueryOperationMinus)({mediatorJoin:re,mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#minus",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(75049).ActorQueryOperationPathSeq)({mediatorJoin:re,mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#path-seq",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(25925).ActorRdfJoinMultiSmallest)({mediatorJoinEntriesSort:q,mediatorJoin:re,mediatorJoinSelectivity:Q,name:"urn:comunica:default:rdf-join/actors#inner-multi-smallest",bus:w,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"})),we=(new(r(38392).ActorQueryOperationLoad)({mediatorUpdateQuads:J,mediatorQuerySourceIdentify:ne,mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#update-load",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(51237).ActorBindingsAggregatorFactoryMax)({mediatorTermComparatorFactory:ie,mediatorExpressionEvaluatorFactory:Y,name:"urn:comunica:default:bindings-aggregator-factory/actors#max",bus:g,busFailMessage:"Creation of Aggregator failed: none of the configured actors were able to handle ${action.expr.aggregator}"}),new(r(13847).ActorBindingsAggregatorFactoryMin)({mediatorTermComparatorFactory:ie,mediatorExpressionEvaluatorFactory:Y,name:"urn:comunica:default:bindings-aggregator-factory/actors#min",bus:g,busFailMessage:"Creation of Aggregator failed: none of the configured actors were able to handle ${action.expr.aggregator}"}),new(r(73945).ActorQueryOperationOrderBy)({mediatorExpressionEvaluatorFactory:Y,mediatorTermComparatorFactory:ie,mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#orderby",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(62001).ActorOptimizeQueryOperationFilterPushdown)({aggressivePushdown:!1,maxIterations:10,splitConjunctive:!0,mergeConjunctive:!0,pushIntoLeftJoins:!0,pushEqualityIntoPatterns:!0,name:"urn:comunica:default:optimize-query-operation/actors#filter-pushdown",bus:s,busFailMessage:"Query optimization failed: none of the configured actors were able to optimize",beforeActors:[L]})),Oe=(new(r(38235).ActorContextPreprocessQuerySourceIdentify)({cacheSize:100,httpInvalidator:ae,mediatorQuerySourceIdentify:ne,mediatorContextPreprocess:F,name:"urn:comunica:default:context-preprocess/actors#query-source-identify",bus:i,busFailMessage:"Context preprocessing failed",beforeActors:[P]}),new(r(12301).ActorInitQuery)({mediatorQueryProcess:te,mediatorQueryResultSerialize:U,mediatorQueryResultSerializeMediaTypeCombiner:V,mediatorQueryResultSerializeMediaTypeFormatCombiner:$,mediatorHttpInvalidate:oe,defaultQueryInputFormat:"sparql",allowNoSources:!1,name:"urn:comunica:default:init/actors#query",bus:n,busFailMessage:"Initialization failed: none of the configured actors were to initialize"})),Te=new(r(13125).ActionObserverHttp)({httpInvalidator:se,name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-result-serialize-sparql-json/^4.0.0/components/ActorQueryResultSerializeSparqlJson.jsonld#ActorQueryResultSerializeSparqlJson_default_observer",bus:E}),Se=new(r(93408).ActionObserverHttp)({httpInvalidator:ce,name:"https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-query-result-serialize-stats/^4.0.0/components/ActorQueryResultSerializeStats.jsonld#ActorQueryResultSerializeStats_default_observer",bus:E}),Ee=(new(r(83101).ActorQuerySourceIdentifyHypermediaSparql)({mediatorHttp:ue,mediatorMergeBindingsContext:le,checkUrlSuffix:!0,forceHttpGet:!1,cacheSize:1024,bindMethod:"values",countTimeout:3e3,name:"urn:comunica:default:rdf-resolve-quad-pattern/actors#sparql",bus:f,busFailMessage:"Query source hypermedia identification failed: none of the configured actors were able to identify ${action.url}"}),new(r(76810).ActorExpressionEvaluatorFactoryDefault)({mediatorQueryOperation:ee,mediatorFunctionFactory:Z,mediatorMergeBindingsContext:le,name:"urn:comunica:default:expression-evaluator-factory/actors#default",bus:m,busFailMessage:"Creation of Expression Evaluator failed"}),new(r(37515).ActorQueryOperationGroup)({mediatorMergeBindingsContext:le,mediatorBindingsAggregatorFactory:W,mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#group",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(79153).ActorQueryOperationNop)({mediatorMergeBindingsContext:le,mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#nop",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(89115).ActorQueryOperationService)({forceSparqlEndpoint:!1,mediatorMergeBindingsContext:le,mediatorQuerySourceIdentify:ne,mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#service",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(65178).ActorQueryOperationValues)({mediatorMergeBindingsContext:le,name:"urn:comunica:default:query-operation/actors#values",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(23654).ActorQueryOperationPathOneOrMore)({mediatorMergeBindingsContext:le,mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#path-one-or-more",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(8327).ActorQueryOperationPathZeroOrOne)({mediatorMergeBindingsContext:le,mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#path-zero-or-one",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(85928).ActorQueryOperationPathZeroOrMore)({mediatorMergeBindingsContext:le,mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#path-zero-or-more",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(63002).ActorQueryOperationUpdateDeleteInsert)({mediatorUpdateQuads:J,mediatorMergeBindingsContext:le,mediatorQueryOperation:ee,name:"urn:comunica:default:query-operation/actors#update-delete-insert",bus:v,busFailMessage:"Query operation processing failed: none of the configured actors were able to handle the operation type ${action.operation.type}"}),new(r(92423).ActorQueryProcessSequential)({mediatorContextPreprocess:F,mediatorQueryParse:B,mediatorOptimizeQueryOperation:k,mediatorQueryOperation:ee,mediatorMergeBindingsContext:le,name:"urn:comunica:default:query-process/actors#sequential",bus:_,busFailMessage:'Query processing failed: none of the configured actor were process to the query "${action.query}"'})),xe=(new(r(88766).ActorRdfJoinNone)({mediatorMergeBindingsContext:le,mediatorJoinSelectivity:Q,name:"urn:comunica:default:rdf-join/actors#inner-none",bus:w,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"}),new(r(97237).ActorRdfJoinOptionalBind)({bindOrder:"depth-first",selectivityModifier:1e-6,mediatorQueryOperation:ee,mediatorMergeBindingsContext:le,mediatorJoinSelectivity:Q,name:"urn:comunica:default:rdf-join/actors#optional-bind",bus:w,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}"}),new(r(64468).ActorTermComparatorFactoryExpressionEvaluator)({mediatorQueryOperation:ee,mediatorFunctionFactory:Z,mediatorMergeBindingsContext:le,name:"urn:comunica:default:term-comparator-factory/actors#expression-evaluator",bus:T,busFailMessage:"Creation of term comparator failed"}),new(r(79881).ActorQuerySourceIdentifyHypermedia)({cacheSize:100,maxIterators:64,aggregateTraversalStore:!0,mediatorDereferenceRdf:de,mediatorMetadata:pe,mediatorMetadataExtract:he,mediatorMetadataAccumulate:G,mediatorQuerySourceIdentifyHypermedia:X,mediatorRdfResolveHypermediaLinks:fe,mediatorRdfResolveHypermediaLinksQueue:ye,mediatorMergeBindingsContext:le,name:"urn:comunica:default:query-source-identify/actors#hypermedia",bus:O,busFailMessage:"Query source identification failed: none of the configured actors were able to identify ${action.querySourceUnidentified.value}"})),Ie=new(r(42815).ActorRdfJoinMultiBind)({bindOrder:"depth-first",selectivityModifier:1e-4,minMaxCardinalityRatio:60,mediatorJoinEntriesSort:q,mediatorQueryOperation:ee,mediatorMergeBindingsContext:le,mediatorJoinSelectivity:Q,name:"urn:comunica:default:rdf-join/actors#inner-multi-bind",bus:w,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}",beforeActors:[_e,ge,me,be,ve]}),Ae=(new(r(30615).ActorRdfJoinMultiSmallestFilterBindings)({selectivityModifier:1e-4,blockSize:64,mediatorJoinEntriesSort:q,mediatorJoin:re,mediatorJoinSelectivity:Q,name:"urn:comunica:default:rdf-join/actors#inner-multi-smallest-filter-bindings",bus:w,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}",beforeActors:[_e,ge,me,be,ve]}),new(r(13125).ActorQueryResultSerializeSparqlJson)({emitMetadata:!0,httpObserver:Te,mediaTypePriorities:{"application/sparql-results+json":.8},mediaTypeFormats:{"application/sparql-results+json":"http://www.w3.org/ns/formats/SPARQL_Results_JSON"},name:"urn:comunica:default:query-result-serialize/actors#sparql-json",bus:u,busFailMessage:"Query result serialization failed: none of the configured actors were able to serialize for type ${action.handle.type}"}),new(r(93408).ActorQueryResultSerializeStats)({httpObserver:Se,mediaTypePriorities:{stats:.5},mediaTypeFormats:{stats:"https://comunica.linkeddatafragments.org/#results_stats"},name:"urn:comunica:default:query-result-serialize/actors#stats",bus:u,busFailMessage:"Query result serialization failed: none of the configured actors were able to serialize for type ${action.handle.type}"}),new(r(7779).ActorQueryProcessExplainParsed)({queryProcessor:Ee,name:"urn:comunica:default:query-process/actors#explain-parsed",bus:_,busFailMessage:'Query processing failed: none of the configured actor were process to the query "${action.query}"'}),new(r(42281).ActorQueryProcessExplainLogical)({queryProcessor:Ee,name:"urn:comunica:default:query-process/actors#explain-logical",bus:_,busFailMessage:'Query processing failed: none of the configured actor were process to the query "${action.query}"'}),new(r(35191).ActorQueryProcessExplainPhysical)({queryProcessor:Ee,name:"urn:comunica:default:query-process/actors#explain-physical",bus:_,busFailMessage:'Query processing failed: none of the configured actor were process to the query "${action.query}"'}),new(r(94731).ActorOptimizeQueryOperationPruneEmptySourceOperations)({useAskIfSupported:!1,name:"urn:comunica:default:optimize-query-operation/actors#prune-empty-source-operations",bus:s,busFailMessage:"Query optimization failed: none of the configured actors were able to optimize",beforeActors:[we]})),je=(new(r(20998).ActorQuerySourceIdentifyRdfJs)({mediatorMergeBindingsContext:le,name:"urn:comunica:default:query-source-identify/actors#rdfjs",bus:O,busFailMessage:"Query source identification failed: none of the configured actors were able to identify ${action.querySourceUnidentified.value}",beforeActors:[xe]}),new(r(79731).ActorRdfJoinMultiBindSource)({selectivityModifier:1e-4,blockSize:16,mediatorJoinEntriesSort:q,mediatorJoinSelectivity:Q,name:"urn:comunica:default:rdf-join/actors#inner-multi-bind-source",bus:w,busFailMessage:"RDF joining failed: none of the configured actors were able to handle the join type ${action.type}",beforeActors:[_e,Ie,ge,me,be,ve]}),new(r(5118).ActorOptimizeQueryOperationJoinConnected)({name:"urn:comunica:default:optimize-query-operation/actors#join-connected",bus:s,busFailMessage:"Query optimization failed: none of the configured actors were able to optimize",beforeActors:[Ae]})),Ne=new(r(60192).ActorOptimizeQueryOperationBgpToJoin)({name:"urn:comunica:default:optimize-query-operation/actors#bgp-to-join",bus:s,busFailMessage:"Query optimization failed: none of the configured actors were able to optimize",beforeActors:[je]}),Re=new(r(34304).ActorOptimizeQueryOperationJoinBgp)({name:"urn:comunica:default:optimize-query-operation/actors#join-bgp",bus:s,busFailMessage:"Query optimization failed: none of the configured actors were able to optimize",beforeActors:[Ne]}),De=new(r(2425).ActorOptimizeQueryOperationAssignSourcesExhaustive)({name:"urn:comunica:default:optimize-query-operation/actors#assign-sources-exhaustive",bus:s,busFailMessage:"Query optimization failed: none of the configured actors were able to optimize",beforeActors:[Re]});return new(r(31399).ActorOptimizeQueryOperationDescribeToConstructsSubject)({name:"urn:comunica:default:optimize-query-operation/actors#describe-to-constructs-subject",bus:s,busFailMessage:"Query optimization failed: none of the configured actors were able to optimize",beforeActors:[De]}),Oe}},92017:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QueryEngine=void 0;const n=r(12301),i=r(98041);class a extends n.QueryEngineBase{constructor(e=i()){super(e)}}t.QueryEngine=a},40090:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(92017),t)},41388:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},22545:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1707:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionType=void 0,function(e){e.Aggregate="aggregate",e.Existence="existence",e.Operator="operator",e.Term="term",e.Variable="variable"}(r||(t.ExpressionType=r={}))},65358:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},17169:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},53846:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},19383:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},85947:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},46671:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},10766:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},63599:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},57755:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},80220:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6841:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9243:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},51690:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},90602:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=void 0;class r{static getLevelOrdinal(e){return r.LEVELS[e]}}t.Logger=r,r.LEVELS={trace:0,debug:1,info:2,warn:3,error:4,fatal:5}},42996:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(41388),t),i(r(22545),t),i(r(65358),t),i(r(17169),t),i(r(53846),t),i(r(19383),t),i(r(85947),t),i(r(10766),t),i(r(63599),t),i(r(57755),t),i(r(80220),t),i(r(6841),t),i(r(9243),t),i(r(51690),t),i(r(39614),t),i(r(88680),t),i(r(46671),t),i(r(90602),t),i(r(1707),t)},88680:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},39614:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},16994:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Bindings=void 0;const n=r(90412),i=r(49568),a=r(18594);class o{constructor(e,t,r){this.type="bindings",this.dataFactory=e,this.entries=t,this.contextHolder=r}has(e){return this.entries.has("string"==typeof e?e:e.value)}get(e){return this.entries.get("string"==typeof e?e:e.value)}set(e,t){return new o(this.dataFactory,this.entries.set("string"==typeof e?e:e.value,t),this.contextHolder)}delete(e){return new o(this.dataFactory,this.entries.delete("string"==typeof e?e:e.value),this.contextHolder)}keys(){return this.mapIterable(this.iteratorToIterable(this.entries.keys()),(e=>this.dataFactory.variable(e)))}values(){return this.iteratorToIterable(this.entries.values())}forEach(e){for(const[t,r]of this.entries.entries())e(r,this.dataFactory.variable(t))}get size(){return this.entries.size}[Symbol.iterator](){return this.mapIterable(this.iteratorToIterable(this.entries.entries()),(([e,t])=>[this.dataFactory.variable(e),t]))[Symbol.iterator]()}equals(e){if(!e)return!1;if(this===e)return!0;if(this.size!==e.size)return!1;for(const t of this.keys())if(!this.get(t)?.equals(e.get(t)))return!1;return!0}filter(e){return new o(this.dataFactory,(0,i.Map)(this.entries.filter(((t,r)=>e(t,this.dataFactory.variable(r))))),this.contextHolder)}map(e){return new o(this.dataFactory,(0,i.Map)(this.entries.map(((t,r)=>e(t,this.dataFactory.variable(r))))),this.contextHolder)}merge(e){if(this.sizee.name))),c=t.keys().filter((e=>s.has(e.name)));for(const n of i){if(1===o[n.name])continue;o[n.name]=1;const i=c.some((e=>e.name===n.name));e[n.name]&&i?a[n.name]=e[n.name].run(t.get(n),r.get(n)):!e[n.name]&&i||(t.get(n)?r.get(n)||(a[n.name]=t.get(n)):a[n.name]=r.get(n))}return new n.ActionContext(a)}setContextEntry(e,t){return this.setContextEntryRaw(e,t)}setContextEntryRaw(e,t){return this.contextHolder&&this.contextHolder.context?new o(this.dataFactory,this.entries,{contextMergeHandlers:this.contextHolder.contextMergeHandlers,context:this.contextHolder.context.set(e,t)}):new o(this.dataFactory,this.entries,{contextMergeHandlers:this.contextHolder?.contextMergeHandlers??{},context:(new n.ActionContext).set(e,t)})}deleteContextEntry(e){return this.deleteContextEntryRaw(e)}deleteContextEntryRaw(e){return this.contextHolder?new o(this.dataFactory,this.entries,{contextMergeHandlers:this.contextHolder.contextMergeHandlers,context:this.contextHolder.context?.delete(e)}):new o(this.dataFactory,this.entries)}getContext(){return this.contextHolder?.context}getContextEntry(e){return this.getContext()?.get(e)}toString(){return(0,a.bindingsToString)(this)}*mapIterable(e,t){for(const r of e)yield t(r)}iteratorToIterable(e){return{[Symbol.iterator]:()=>e}}}t.Bindings=o},2922:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BindingsFactory=void 0;const n=r(49568),i=r(16994);class a{constructor(e,t){this.dataFactory=e,this.contextMergeHandlers=t}static async create(e,t,r){return new a(r,(await e.mediate({context:t})).mergeHandlers)}bindings(e=[]){return new i.Bindings(this.dataFactory,(0,n.Map)(e.map((([e,t])=>[e.value,t]))),this.contextMergeHandlers?{contextMergeHandlers:this.contextMergeHandlers}:void 0)}fromBindings(e){return this.bindings([...e])}fromRecord(e){return this.bindings(Object.entries(e).map((([e,t])=>[this.dataFactory.variable(e),t])))}}t.BindingsFactory=a},18594:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bindingsToCompactString=t.bindingsToString=void 0;const n=r(43347);t.bindingsToString=function(e){const t={};for(const r of e.keys())t[r.value]=(0,n.termToString)(e.get(r));return JSON.stringify(t,null," ")},t.bindingsToCompactString=function(e,t){return t.map((t=>{const r=e.get(t);return r?(0,n.termToString)(r):""})).join("")}},81926:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(16994),t),i(r(2922),t),i(r(18594),t)},4519:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BindingsIndexDef=void 0,t.BindingsIndexDef=class{constructor(e,t){this.keys=e.map((e=>e.variable)),this.hashFn=t,this.index={}}put(e,t){return this.index[this.hashFn(e,this.keys)]=t}get(e){const t=this.getFirst(e);return t?[t]:[]}getFirst(e){return this.index[this.hashFn(e,this.keys)]}values(){return Object.values(this.index)}}},30862:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BindingsIndexUndef=void 0,t.BindingsIndexUndef=class{constructor(e,t,r){this.data={},this.keys=e.map((e=>e.variable)),this.hashFn=t,this.allowDisjointDomains=r&&this.keys.length>0}put(e,t){if(this.allowDisjointDomains||this.isBindingsValid(e)){let r=this.data;for(let n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},18888:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4519),t),i(r(30862),t),i(r(73833),t)},11752:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BlankNodeBindingsScoped=void 0,t.BlankNodeBindingsScoped=class{constructor(e){this.termType="BlankNode",this.singleBindingsScope=!0,this.value=e}equals(e){return!!e&&"BlankNode"===e.termType&&e.value===this.value}}},4450:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BlankNodeScoped=void 0,t.BlankNodeScoped=class{constructor(e,t){this.termType="BlankNode",this.value=e,this.skolemized=t}equals(e){return!!e&&"BlankNode"===e.termType&&e.value===this.value}}},51296:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4450),t),i(r(11752),t)},80722:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Aggregate=void 0;const n=r(42996);t.Aggregate=class{constructor(e,t){this.name=e,this.expression=t,this.expressionType=n.ExpressionType.Aggregate}}},61013:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Existence=void 0;const n=r(42996);t.Existence=class{constructor(e){this.expression=e,this.expressionType=n.ExpressionType.Existence}}},79434:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.asTermType=void 0,t.asTermType=function(e){if("namedNode"===e||"literal"===e||"blankNode"===e||"quad"===e)return e}},54853:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Operator=void 0;const n=r(42996);t.Operator=class{constructor(e,t,r){this.name=e,this.args=t,this.apply=r,this.expressionType=n.ExpressionType.Operator}}},81791:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNonLexicalLiteral=t.NonLexicalLiteral=t.YearMonthDurationLiteral=t.DayTimeDurationLiteral=t.DurationLiteral=t.DateLiteral=t.TimeLiteral=t.DateTimeLiteral=t.StringLiteral=t.LangStringLiteral=t.BooleanLiteral=t.DoubleLiteral=t.FloatLiteral=t.DecimalLiteral=t.IntegerLiteral=t.NumericLiteral=t.Literal=t.isLiteralTermExpression=t.DefaultGraph=t.Quad=t.BlankNode=t.NamedNode=t.Term=void 0;const n=r(42996),i=r(64900),a=r(64900),o=r(98575),s=r(72374),c=r(86273);class u{constructor(){this.expressionType=n.ExpressionType.Term}str(){throw new o.InvalidArgumentTypes([this],i.SparqlOperator.STR)}coerceEBV(){throw new o.EBVCoercionError(this)}}t.Term=u,t.NamedNode=class extends u{constructor(e){super(),this.value=e,this.termType="namedNode"}toRDF(e){return e.namedNode(this.value)}str(){return this.value}},t.BlankNode=class extends u{constructor(e){super(),this.termType="blankNode",this.value=e}toRDF(e){return"string"==typeof this.value?e.blankNode(this.value):this.value}},t.Quad=class extends u{constructor(e,t,r,n){super(),this.subject=e,this.predicate=t,this.object=r,this.graph=n,this.termType="quad"}toRDF(e){return e.quad(this.subject.toRDF(e),this.predicate.toRDF(e),this.object.toRDF(e),this.graph.toRDF(e))}str(){return`Quad: [${this.subject.str()}, ${this.predicate.str()}, ${this.object.str()}, ${this.graph.str()}]`}},t.DefaultGraph=class extends u{constructor(){super(),this.termType="defaultGraph"}toRDF(e){return e.defaultGraph()}str(){return"DefaultGraph"}},t.isLiteralTermExpression=function(e){if("literal"===e.termType)return e};class l extends u{constructor(e,t,r,n){super(),this.typedValue=e,this.dataType=t,this.strValue=r,this.language=n,this.termType="literal"}toRDF(e){return e.literal(this.strValue??this.str(),this.language??e.namedNode(this.dataType))}str(){return this.strValue??this.typedValue.toString()}}t.Literal=l;class d extends l{constructor(e,t,r,n){super(e,t,r,n),this.typedValue=e,this.strValue=r,this.language=n}coerceEBV(){return Boolean(this.typedValue)}toRDF(e){const t=super.toRDF(e);return Number.isFinite(this.typedValue)||(t.value=t.value.replace("Infinity","INF")),t}str(){return this.strValue??this.specificFormatter(this.typedValue)}}t.NumericLiteral=d,t.IntegerLiteral=class extends d{constructor(e,t,r,n){super(e,t??a.TypeURL.XSD_INTEGER,r,n),this.typedValue=e,this.strValue=r,this.language=n}specificFormatter(e){return e.toFixed(0)}},t.DecimalLiteral=class extends d{constructor(e,t,r,n){super(e,t??a.TypeURL.XSD_DECIMAL,r,n),this.typedValue=e,this.strValue=r,this.language=n}specificFormatter(e){return e.toString()}},t.FloatLiteral=class extends d{constructor(e,t,r,n){super(e,t??a.TypeURL.XSD_FLOAT,r,n),this.typedValue=e,this.strValue=r,this.language=n}specificFormatter(e){return e.toString()}},t.DoubleLiteral=class extends d{constructor(e,t,r,n){super(e,t??a.TypeURL.XSD_DOUBLE,r,n),this.typedValue=e,this.strValue=r,this.language=n}specificFormatter(e){if(!Number.isFinite(e))return e>0?"INF":e<0?"-INF":"NaN";const t=e.toExponential(),[r,n]=t.split("e"),i=n.replace(/\+/u,"");return`${r.includes(".")?r:`${r}.0`}E${i}`}},t.BooleanLiteral=class extends l{constructor(e,t,r){super(e,r??a.TypeURL.XSD_BOOLEAN,t),this.typedValue=e,this.strValue=t}coerceEBV(){return this.typedValue}},t.LangStringLiteral=class extends l{constructor(e,t,r){super(e,r??a.TypeURL.RDF_LANG_STRING,e,t),this.typedValue=e,this.language=t}coerceEBV(){return this.str().length>0}},t.StringLiteral=class extends l{constructor(e,t){super(e,t??a.TypeURL.XSD_STRING,e),this.typedValue=e}coerceEBV(){return this.str().length>0}},t.DateTimeLiteral=class extends l{constructor(e,t,r){super(e,r??a.TypeURL.XSD_DATE_TIME,t),this.typedValue=e,this.strValue=t}str(){return(0,s.serializeDateTime)(this.typedValue)}},t.TimeLiteral=class extends l{constructor(e,t,r){super(e,r??a.TypeURL.XSD_TIME,t),this.typedValue=e,this.strValue=t}str(){return(0,s.serializeTime)(this.typedValue)}},t.DateLiteral=class extends l{constructor(e,t,r){super(e,r??a.TypeURL.XSD_DATE,t),this.typedValue=e,this.strValue=t}str(){return(0,s.serializeDate)(this.typedValue)}};class p extends l{constructor(e,t,r){super(e,r??a.TypeURL.XSD_DURATION,t),this.typedValue=e,this.strValue=t}str(){return(0,s.serializeDuration)(this.typedValue)}}t.DurationLiteral=p,t.DayTimeDurationLiteral=class extends p{constructor(e,t,r){super(e,t,r??a.TypeURL.XSD_DAY_TIME_DURATION),this.typedValue=e,this.strValue=t}},t.YearMonthDurationLiteral=class extends l{constructor(e,t,r){super(e,r??a.TypeURL.XSD_YEAR_MONTH_DURATION,t),this.typedValue=e,this.strValue=t}str(){return(0,s.serializeDuration)(this.typedValue,"P0M")}};class h extends l{constructor(e,t,r,n,i){super({toString:()=>"undefined"},t,n,i),this.openWorldType=r}coerceEBV(){if((0,c.isSubTypeOf)(this.dataType,a.TypeURL.XSD_BOOLEAN,this.openWorldType)||(0,c.isSubTypeOf)(this.dataType,a.TypeAlias.SPARQL_NUMERIC,this.openWorldType))return!1;throw new o.EBVCoercionError(this)}toRDF(e){return e.literal(this.str(),this.language??e.namedNode(this.dataType))}str(){return this.strValue??""}}t.NonLexicalLiteral=h,t.isNonLexicalLiteral=function(e){if(e instanceof h)return e}},33369:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Variable=void 0;const n=r(42996);t.Variable=class{constructor(e){this.expressionType=n.ExpressionType.Variable,this.name=e}}},54833:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(79434),t),i(r(33369),t),i(r(81791),t),i(r(54853),t),i(r(80722),t),i(r(61013),t)},97618:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.expressionToVar=t.dateTime=t.langString=t.string=t.double=t.float=t.decimal=t.integer=t.bool=t.Builder=t.declare=void 0;const n=r(90711),i=r(54833),a=r(54833),o=r(64900),s=r(64900),c=r(98575),u=r(34641);t.declare=function(e){return new l(e)};class l{constructor(e){this.overloadTree=new u.OverloadTree(e),this.collected=!1}collect(){if(this.collected)throw new Error("Builders can only be collected once!");return this.collected=!0,this.overloadTree}static wrapInvalidLexicalProtected(e){return t=>r=>{for(const[e,i]of r.entries())if(i instanceof a.NonLexicalLiteral)throw new c.InvalidLexicalForm(r[e].toRDF(t.context.getSafe(n.KeysInitQuery.dataFactory)));return e(t)(r)}}set(e,t,r=!0){return this.overloadTree.addOverload(e,r?l.wrapInvalidLexicalProtected(t):t),this}copy({from:e,to:t}){const r=this.overloadTree.getImplementationExact(e);if(!r)throw new c.UnexpectedError("Tried to copy implementation, but types not found",{from:e,to:t});return this.set(t,r)}onUnary(e,t,r=!0){return this.set([e],(e=>([r])=>t(e)(r)),r)}onUnaryTyped(e,t,r=!0){return this.set([e],(e=>([r])=>t(e)(r.typedValue)),r)}onBinary(e,t,r=!0){return this.set(e,(e=>([r,n])=>t(e)(r,n)),r)}onBinaryTyped(e,t,r=!0){return this.set(e,(e=>([r,n])=>t(e)(r.typedValue,n.typedValue)),r)}onTernaryTyped(e,t,r=!0){return this.set(e,(e=>([r,n,i])=>t(e)(r.typedValue,n.typedValue,i.typedValue)),r)}onTernary(e,t,r=!0){return this.set(e,(e=>([r,n,i])=>t(e)(r,n,i)),r)}onQuaternaryTyped(e,t,r=!0){return this.set(e,(e=>([r,n,i,a])=>t(e)(r.typedValue,n.typedValue,i.typedValue,a.typedValue)),r)}onTerm1(e,t=!1){return this.set(["term"],(t=>([r])=>e(t)(r)),t)}onTerm3(e){return this.set(["term","term","term"],(t=>([r,n,i])=>e(t)(r,n,i)))}onQuad1(e){return this.set(["quad"],(t=>([r])=>e(t)(r)))}onLiteral1(e,t=!0){return this.set(["literal"],(t=>([r])=>e(t)(r)),t)}onBoolean1(e,t=!0){return this.set([o.TypeURL.XSD_BOOLEAN],(t=>([r])=>e(t)(r)),t)}onBoolean1Typed(e,t=!0){return this.set([o.TypeURL.XSD_BOOLEAN],(t=>([r])=>e(t)(r.typedValue)),t)}onString1(e,t=!0){return this.set([o.TypeURL.XSD_STRING],(t=>([r])=>e(t)(r)),t)}onString1Typed(e,t=!0){return this.set([o.TypeURL.XSD_STRING],(t=>([r])=>e(t)(r.typedValue)),t)}onLangString1(e,t=!0){return this.set([o.TypeURL.RDF_LANG_STRING],(t=>([r])=>e(t)(r)),t)}onStringly1(e,t=!0){return this.set([o.TypeAlias.SPARQL_STRINGLY],(t=>([r])=>e(t)(r)),t)}onStringly1Typed(e,t=!0){return this.set([o.TypeAlias.SPARQL_STRINGLY],(t=>([r])=>e(t)(r.typedValue)),t)}onNumeric1(e,t=!0){return this.set([o.TypeAlias.SPARQL_NUMERIC],(t=>([r])=>e(t)(r)),t)}onDateTime1(e,t=!0){return this.set([o.TypeURL.XSD_DATE_TIME],(t=>([r])=>e(t)(r)),t)}numericConverter(e,t=!0){const r=t=>r=>e(t)(r.typedValue);return this.onUnary(s.TypeURL.XSD_INTEGER,(e=>t=>p(r(e)(t))),t).onUnary(s.TypeURL.XSD_DECIMAL,(e=>t=>h(r(e)(t))),t).onUnary(s.TypeURL.XSD_FLOAT,(e=>t=>f(r(e)(t))),t).onUnary(s.TypeURL.XSD_DOUBLE,(e=>t=>y(r(e)(t))),t)}arithmetic(e,t=!0){const r=t=>(r,n)=>e(t)(r.typedValue,n.typedValue);return this.onBinary([s.TypeURL.XSD_INTEGER,s.TypeURL.XSD_INTEGER],(e=>(t,n)=>p(r(e)(t,n))),t).onBinary([s.TypeURL.XSD_DECIMAL,s.TypeURL.XSD_DECIMAL],(e=>(t,n)=>h(r(e)(t,n))),t).onBinary([s.TypeURL.XSD_FLOAT,s.TypeURL.XSD_FLOAT],(e=>(t,n)=>f(r(e)(t,n))),t).onBinary([s.TypeURL.XSD_DOUBLE,s.TypeURL.XSD_DOUBLE],(e=>(t,n)=>y(r(e)(t,n))),t)}numberTest(e){return this.numeric((t=>([r,n])=>d(e(t)(r.typedValue,n.typedValue))))}stringTest(e,t=!0){return this.set([o.TypeURL.XSD_STRING,o.TypeURL.XSD_STRING],(t=>([r,n])=>d(e(t)(r.typedValue,n.typedValue))),t)}booleanTest(e,t=!0){return this.set([o.TypeURL.XSD_BOOLEAN,o.TypeURL.XSD_BOOLEAN],(t=>([r,n])=>d(e(t)(r.typedValue,n.typedValue))),t)}dateTimeTest(e,t=!0){return this.set([o.TypeURL.XSD_DATE_TIME,o.TypeURL.XSD_DATE_TIME],(t=>([r,n])=>d(e(t)(r.typedValue,n.typedValue))),t)}numeric(e){return this.set([o.TypeAlias.SPARQL_NUMERIC,o.TypeAlias.SPARQL_NUMERIC],e)}}function d(e){return new i.BooleanLiteral(e)}function p(e){return new i.IntegerLiteral(e)}function h(e){return new i.DecimalLiteral(e)}function f(e){return new i.FloatLiteral(e)}function y(e){return new i.DoubleLiteral(e)}t.Builder=l,t.bool=d,t.integer=p,t.decimal=h,t.float=f,t.double=y,t.string=function(e){return new i.StringLiteral(e)},t.langString=function(e,t){return new i.LangStringLiteral(e,t)},t.dateTime=function(e,t){return new i.DateTimeLiteral(e,t)},t.expressionToVar=function(e,t){return e.variable(t.name.slice(1))}},34641:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OverloadTree=void 0;const n=r(54833),i=r(86273);class a{constructor(e,t){this.identifier=e,this.implementation=void 0,this.generalOverloads=Object.create(null),this.literalOverLoads=[],this.depth=t??0,this.promotionCount=void 0}getSubtree(e){const t=(0,i.asGeneralType)(e);if(t)return this.generalOverloads[t];for(const[t,r]of this.literalOverLoads)if(e===t)return r}getImplementationExact(e){let t=this;for(const r of e)if(t=t.getSubtree(r),!t)return;return t.implementation}search(e,t,r){let i=r[this.identifier],a=0;for(;a({node:e,index:1}))));o.length>0;){const{index:n,node:i}=o.pop();if(n===e.length&&i.implementation)return this.addToCache(r,e,i.implementation),i.implementation;o.push(...i.getSubTreeWithArg(e[n],t).map((e=>({node:e,index:n+1}))))}}addToCache(e,t,r){function i(e,t){return t in e||(e[t]={}),e[t]}let a=i(e,this.identifier);for(const e of t){const t=(0,n.isLiteralTermExpression)(e),r=t?t.dataType:e.termType;a.cache=a.cache??{},a=i(a.cache,r)}a.func=r}addOverload(e,t){this._addOverload([...e],t,0)}_addOverload(e,t,r){const[n,...o]=e;if(!n)return void((void 0===this.promotionCount||r<=this.promotionCount)&&(this.promotionCount=r,this.implementation=t));let s=this.getSubtree(n);if(!s){const e=new a(this.identifier,this.depth+1),t=(0,i.asGeneralType)(n);t&&(this.generalOverloads[t]=e);const r=(0,i.asOverrideType)(n);r&&this.literalOverLoads.push([r,e]),s=e}if(s._addOverload(o,t,r),i.typePromotion[n])for(const e of i.typePromotion[n])this.addPromotedOverload(e.typeToPromote,t,e.conversionFunction,o,r)}addPromotedOverload(e,t,r,n,i){let o=this.getSubtree(e);if(!o){const t=new a(this.identifier,this.depth+1);this.literalOverLoads.push([e,t]),o=t}o._addOverload(n,(e=>n=>t(e)([...n.slice(0,this.depth),r(n[this.depth]),...n.slice(this.depth+1,n.length)])),i+1)}getSubTreeWithArg(e,t){const r=[],a=(0,n.isLiteralTermExpression)(e);if(this.generalOverloads.term&&r.push(this.generalOverloads.term),this.generalOverloads[e.termType]&&r.push(this.generalOverloads[e.termType]),a){const e=(0,i.asKnownLiteralType)(a.dataType);let n;n=e?i.superTypeDictTable[e]:(0,i.getSuperTypes)(a.dataType,t);const o=this.literalOverLoads.filter((([e,t])=>e in n)).map((([e,t])=>[n[e],t]));o.sort((([e,t],[r,n])=>e-r)),r.push(...o.map((([e,t])=>t)))}return r}}t.OverloadTree=a},77545:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LangStringLiteral=t.TimeLiteral=t.DurationLiteral=t.DateLiteral=t.DayTimeDurationLiteral=t.DateTimeLiteral=t.yearMonthDurationsToMonths=t.toUTCDate=t.toDateTimeRepresentation=t.negateDuration=t.extractRawTimeZone=t.defaultedYearMonthDurationRepresentation=t.defaultedDurationRepresentation=t.defaultedDayTimeDurationRepresentation=t.defaultedDateTimeRepresentation=t.dayTimeDurationsToSeconds=t.isSubTypeOf=t.SparqlOperator=t.TypeAlias=t.TypeURL=t.typedLiteral=t.InvalidArity=t.InvalidLexicalForm=t.ExtensionFunctionError=t.CastError=t.UnboundVariableError=t.NoAggregator=t.InError=t.CoalesceError=t.InvalidArgumentTypes=t.InvalidTimezoneCall=t.IncompatibleLanguageOperation=t.RDFEqualTypeError=t.EmptyAggregateError=t.isExpressionError=t.ExpressionError=t.Builder=t.expressionToVar=t.float=t.decimal=t.langString=t.dateTime=t.integer=t.double=t.string=t.bool=t.declare=t.prepareEvaluatorActionContext=t.OverloadTree=t.TermTransformer=void 0,t.trimToDayTimeDuration=t.trimToYearMonthDuration=t.parseDate=t.parseXSDFloat=t.parseXSDDecimal=t.parseYearMonthDuration=t.parseTime=t.parseDuration=t.parseDayTimeDuration=t.parseDateTime=t.elapsedDuration=t.addDurationToDateTime=t.isNonLexicalLiteral=t.StringLiteral=t.NonLexicalLiteral=t.FloatLiteral=t.IntegerLiteral=t.Literal=t.Existence=t.Aggregate=t.DoubleLiteral=t.DefaultGraph=t.DecimalLiteral=t.BlankNode=t.BooleanLiteral=t.NumericLiteral=t.Variable=t.NamedNode=t.Operator=t.Quad=t.YearMonthDurationLiteral=t.Term=void 0;var n=r(53119);Object.defineProperty(t,"TermTransformer",{enumerable:!0,get:function(){return n.TermTransformer}});var i=r(34641);Object.defineProperty(t,"OverloadTree",{enumerable:!0,get:function(){return i.OverloadTree}});var a=r(17845);Object.defineProperty(t,"prepareEvaluatorActionContext",{enumerable:!0,get:function(){return a.prepareEvaluatorActionContext}});var o=r(97618);Object.defineProperty(t,"declare",{enumerable:!0,get:function(){return o.declare}}),Object.defineProperty(t,"bool",{enumerable:!0,get:function(){return o.bool}}),Object.defineProperty(t,"string",{enumerable:!0,get:function(){return o.string}}),Object.defineProperty(t,"double",{enumerable:!0,get:function(){return o.double}}),Object.defineProperty(t,"integer",{enumerable:!0,get:function(){return o.integer}}),Object.defineProperty(t,"dateTime",{enumerable:!0,get:function(){return o.dateTime}}),Object.defineProperty(t,"langString",{enumerable:!0,get:function(){return o.langString}}),Object.defineProperty(t,"decimal",{enumerable:!0,get:function(){return o.decimal}}),Object.defineProperty(t,"float",{enumerable:!0,get:function(){return o.float}}),Object.defineProperty(t,"expressionToVar",{enumerable:!0,get:function(){return o.expressionToVar}}),Object.defineProperty(t,"Builder",{enumerable:!0,get:function(){return o.Builder}});var s=r(98575);Object.defineProperty(t,"ExpressionError",{enumerable:!0,get:function(){return s.ExpressionError}}),Object.defineProperty(t,"isExpressionError",{enumerable:!0,get:function(){return s.isExpressionError}}),Object.defineProperty(t,"EmptyAggregateError",{enumerable:!0,get:function(){return s.EmptyAggregateError}}),Object.defineProperty(t,"RDFEqualTypeError",{enumerable:!0,get:function(){return s.RDFEqualTypeError}}),Object.defineProperty(t,"IncompatibleLanguageOperation",{enumerable:!0,get:function(){return s.IncompatibleLanguageOperation}}),Object.defineProperty(t,"InvalidTimezoneCall",{enumerable:!0,get:function(){return s.InvalidTimezoneCall}}),Object.defineProperty(t,"InvalidArgumentTypes",{enumerable:!0,get:function(){return s.InvalidArgumentTypes}}),Object.defineProperty(t,"CoalesceError",{enumerable:!0,get:function(){return s.CoalesceError}}),Object.defineProperty(t,"InError",{enumerable:!0,get:function(){return s.InError}}),Object.defineProperty(t,"NoAggregator",{enumerable:!0,get:function(){return s.NoAggregator}}),Object.defineProperty(t,"UnboundVariableError",{enumerable:!0,get:function(){return s.UnboundVariableError}}),Object.defineProperty(t,"CastError",{enumerable:!0,get:function(){return s.CastError}}),Object.defineProperty(t,"ExtensionFunctionError",{enumerable:!0,get:function(){return s.ExtensionFunctionError}}),Object.defineProperty(t,"InvalidLexicalForm",{enumerable:!0,get:function(){return s.InvalidLexicalForm}}),Object.defineProperty(t,"InvalidArity",{enumerable:!0,get:function(){return s.InvalidArity}});var c=r(64900);Object.defineProperty(t,"typedLiteral",{enumerable:!0,get:function(){return c.typedLiteral}}),Object.defineProperty(t,"TypeURL",{enumerable:!0,get:function(){return c.TypeURL}}),Object.defineProperty(t,"TypeAlias",{enumerable:!0,get:function(){return c.TypeAlias}}),Object.defineProperty(t,"SparqlOperator",{enumerable:!0,get:function(){return c.SparqlOperator}});var u=r(86273);Object.defineProperty(t,"isSubTypeOf",{enumerable:!0,get:function(){return u.isSubTypeOf}});var l=r(31296);Object.defineProperty(t,"dayTimeDurationsToSeconds",{enumerable:!0,get:function(){return l.dayTimeDurationsToSeconds}}),Object.defineProperty(t,"defaultedDateTimeRepresentation",{enumerable:!0,get:function(){return l.defaultedDateTimeRepresentation}}),Object.defineProperty(t,"defaultedDayTimeDurationRepresentation",{enumerable:!0,get:function(){return l.defaultedDayTimeDurationRepresentation}}),Object.defineProperty(t,"defaultedDurationRepresentation",{enumerable:!0,get:function(){return l.defaultedDurationRepresentation}}),Object.defineProperty(t,"defaultedYearMonthDurationRepresentation",{enumerable:!0,get:function(){return l.defaultedYearMonthDurationRepresentation}}),Object.defineProperty(t,"extractRawTimeZone",{enumerable:!0,get:function(){return l.extractRawTimeZone}}),Object.defineProperty(t,"negateDuration",{enumerable:!0,get:function(){return l.negateDuration}}),Object.defineProperty(t,"toDateTimeRepresentation",{enumerable:!0,get:function(){return l.toDateTimeRepresentation}}),Object.defineProperty(t,"toUTCDate",{enumerable:!0,get:function(){return l.toUTCDate}}),Object.defineProperty(t,"yearMonthDurationsToMonths",{enumerable:!0,get:function(){return l.yearMonthDurationsToMonths}});var d=r(54833);Object.defineProperty(t,"DateTimeLiteral",{enumerable:!0,get:function(){return d.DateTimeLiteral}}),Object.defineProperty(t,"DayTimeDurationLiteral",{enumerable:!0,get:function(){return d.DayTimeDurationLiteral}}),Object.defineProperty(t,"DateLiteral",{enumerable:!0,get:function(){return d.DateLiteral}}),Object.defineProperty(t,"DurationLiteral",{enumerable:!0,get:function(){return d.DurationLiteral}}),Object.defineProperty(t,"TimeLiteral",{enumerable:!0,get:function(){return d.TimeLiteral}}),Object.defineProperty(t,"LangStringLiteral",{enumerable:!0,get:function(){return d.LangStringLiteral}}),Object.defineProperty(t,"Term",{enumerable:!0,get:function(){return d.Term}}),Object.defineProperty(t,"YearMonthDurationLiteral",{enumerable:!0,get:function(){return d.YearMonthDurationLiteral}}),Object.defineProperty(t,"Quad",{enumerable:!0,get:function(){return d.Quad}}),Object.defineProperty(t,"Operator",{enumerable:!0,get:function(){return d.Operator}}),Object.defineProperty(t,"NamedNode",{enumerable:!0,get:function(){return d.NamedNode}}),Object.defineProperty(t,"Variable",{enumerable:!0,get:function(){return d.Variable}}),Object.defineProperty(t,"NumericLiteral",{enumerable:!0,get:function(){return d.NumericLiteral}}),Object.defineProperty(t,"BooleanLiteral",{enumerable:!0,get:function(){return d.BooleanLiteral}}),Object.defineProperty(t,"BlankNode",{enumerable:!0,get:function(){return d.BlankNode}}),Object.defineProperty(t,"DecimalLiteral",{enumerable:!0,get:function(){return d.DecimalLiteral}}),Object.defineProperty(t,"DefaultGraph",{enumerable:!0,get:function(){return d.DefaultGraph}}),Object.defineProperty(t,"DoubleLiteral",{enumerable:!0,get:function(){return d.DoubleLiteral}}),Object.defineProperty(t,"Aggregate",{enumerable:!0,get:function(){return d.Aggregate}}),Object.defineProperty(t,"Existence",{enumerable:!0,get:function(){return d.Existence}}),Object.defineProperty(t,"Literal",{enumerable:!0,get:function(){return d.Literal}}),Object.defineProperty(t,"IntegerLiteral",{enumerable:!0,get:function(){return d.IntegerLiteral}}),Object.defineProperty(t,"FloatLiteral",{enumerable:!0,get:function(){return d.FloatLiteral}}),Object.defineProperty(t,"NonLexicalLiteral",{enumerable:!0,get:function(){return d.NonLexicalLiteral}}),Object.defineProperty(t,"StringLiteral",{enumerable:!0,get:function(){return d.StringLiteral}}),Object.defineProperty(t,"isNonLexicalLiteral",{enumerable:!0,get:function(){return d.isNonLexicalLiteral}});var p=r(84427);Object.defineProperty(t,"addDurationToDateTime",{enumerable:!0,get:function(){return p.addDurationToDateTime}}),Object.defineProperty(t,"elapsedDuration",{enumerable:!0,get:function(){return p.elapsedDuration}});var h=r(29658);Object.defineProperty(t,"parseDateTime",{enumerable:!0,get:function(){return h.parseDateTime}}),Object.defineProperty(t,"parseDayTimeDuration",{enumerable:!0,get:function(){return h.parseDayTimeDuration}}),Object.defineProperty(t,"parseDuration",{enumerable:!0,get:function(){return h.parseDuration}}),Object.defineProperty(t,"parseTime",{enumerable:!0,get:function(){return h.parseTime}}),Object.defineProperty(t,"parseYearMonthDuration",{enumerable:!0,get:function(){return h.parseYearMonthDuration}}),Object.defineProperty(t,"parseXSDDecimal",{enumerable:!0,get:function(){return h.parseXSDDecimal}}),Object.defineProperty(t,"parseXSDFloat",{enumerable:!0,get:function(){return h.parseXSDFloat}}),Object.defineProperty(t,"parseDate",{enumerable:!0,get:function(){return h.parseDate}});var f=r(31296);Object.defineProperty(t,"trimToYearMonthDuration",{enumerable:!0,get:function(){return f.trimToYearMonthDuration}}),Object.defineProperty(t,"trimToDayTimeDuration",{enumerable:!0,get:function(){return f.trimToDayTimeDuration}})},53119:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TermTransformer=void 0;const n=r(43347),i=r(96331),a=r(54833),o=r(64900),s=r(98575),c=r(98575),u=r(29658),l=r(29658),d=r(86273);t.TermTransformer=class{constructor(e){this.superTypeProvider=e}transformRDFTermUnsafe(e){return this.transformTerm({term:e,type:i.Algebra.types.EXPRESSION,expressionType:i.Algebra.expressionTypes.TERM})}transformTerm(e){if(!e.term)throw new s.InvalidExpression(e);switch(e.term.termType){case"Variable":return new a.Variable(n.termToString(e.term));case"Literal":return this.transformLiteral(e.term);case"NamedNode":return new a.NamedNode(e.term.value);case"BlankNode":return new a.BlankNode(e.term.value);case"Quad":return new a.Quad(this.transformRDFTermUnsafe(e.term.subject),this.transformRDFTermUnsafe(e.term.predicate),this.transformRDFTermUnsafe(e.term.object),this.transformRDFTermUnsafe(e.term.graph));case"DefaultGraph":return new a.DefaultGraph}}transformLiteral(e){if(!e.datatype||[null,void 0,""].includes(e.datatype.value))return e.language?new a.LangStringLiteral(e.value,e.language):new a.StringLiteral(e.value);const t=e.datatype.value,r=(0,d.getSuperTypeDict)(t,this.superTypeProvider);try{if(o.TypeURL.XSD_STRING in r)return new a.StringLiteral(e.value,t);if(o.TypeURL.RDF_LANG_STRING in r)return new a.LangStringLiteral(e.value,e.language);if(o.TypeURL.XSD_YEAR_MONTH_DURATION in r)return new a.YearMonthDurationLiteral((0,u.parseYearMonthDuration)(e.value),e.value,t);if(o.TypeURL.XSD_DAY_TIME_DURATION in r)return new a.DayTimeDurationLiteral((0,u.parseDayTimeDuration)(e.value),e.value,t);if(o.TypeURL.XSD_DURATION in r)return new a.DurationLiteral((0,u.parseDuration)(e.value),e.value,t);if(o.TypeURL.XSD_DATE_TIME in r){const r=new Date(e.value);return Number.isNaN(r.getTime())?new a.NonLexicalLiteral(void 0,t,this.superTypeProvider,e.value):new a.DateTimeLiteral((0,u.parseDateTime)(e.value),e.value,t)}if(o.TypeURL.XSD_DATE in r)return new a.DateLiteral((0,u.parseDate)(e.value),e.value,t);if(o.TypeURL.XSD_TIME in r)return new a.TimeLiteral((0,u.parseTime)(e.value),e.value,t);if(o.TypeURL.XSD_BOOLEAN in r)return"true"!==e.value&&"false"!==e.value&&"1"!==e.value&&"0"!==e.value?new a.NonLexicalLiteral(void 0,t,this.superTypeProvider,e.value):new a.BooleanLiteral("true"===e.value||"1"===e.value,e.value);if(o.TypeURL.XSD_DECIMAL in r){const n=l.parseXSDDecimal(e.value);return void 0===n?new a.NonLexicalLiteral(void 0,t,this.superTypeProvider,e.value):o.TypeURL.XSD_INTEGER in r?new a.IntegerLiteral(n,t,e.value):new a.DecimalLiteral(n,t,e.value)}const n=o.TypeURL.XSD_FLOAT in r,i=o.TypeURL.XSD_DOUBLE in r;if(n||i){const r=l.parseXSDFloat(e.value);return void 0===r?new a.NonLexicalLiteral(void 0,t,this.superTypeProvider,e.value):n?new a.FloatLiteral(r,t,e.value):new a.DoubleLiteral(r,t,e.value)}return new a.Literal(e.value,t,e.value)}catch(r){if((0,c.isExpressionError)(r))return new a.NonLexicalLiteral(void 0,t,this.superTypeProvider,e.value);throw r}}}},64900:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SparqlOperator=t.TypeURL=t.typedLiteral=t.TypeAlias=void 0;const n=r(47793);var i;!function(e){e.SPARQL_NUMERIC="SPARQL_NUMERIC",e.SPARQL_STRINGLY="SPARQL_STRINGLY"}(i||(t.TypeAlias=i={}));const a=new n.DataFactory;var o,s;t.typedLiteral=function(e,t){return a.literal(e,a.namedNode(t))},function(e){e.XSD_ANY_URI="http://www.w3.org/2001/XMLSchema#anyURI",e.XSD_STRING="http://www.w3.org/2001/XMLSchema#string",e.RDF_LANG_STRING="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",e.XSD_BOOLEAN="http://www.w3.org/2001/XMLSchema#boolean",e.XSD_DATE_TIME="http://www.w3.org/2001/XMLSchema#dateTime",e.XSD_DATE_TIME_STAMP="http://www.w3.org/2001/XMLSchema#dateTimeStamp",e.XSD_DATE="http://www.w3.org/2001/XMLSchema#date",e.XSD_G_MONTH="http://www.w3.org/2001/XMLSchema#gMonth",e.XSD_G_MONTHDAY="http://www.w3.org/2001/XMLSchema#gMonthDay",e.XSD_G_YEAR="http://www.w3.org/2001/XMLSchema#gYear",e.XSD_G_YEAR_MONTH="http://www.w3.org/2001/XMLSchema#gYearMonth",e.XSD_TIME="http://www.w3.org/2001/XMLSchema#time",e.XSD_G_DAY="http://www.w3.org/2001/XMLSchema#gDay",e.XSD_DECIMAL="http://www.w3.org/2001/XMLSchema#decimal",e.XSD_FLOAT="http://www.w3.org/2001/XMLSchema#float",e.XSD_DOUBLE="http://www.w3.org/2001/XMLSchema#double",e.XSD_INTEGER="http://www.w3.org/2001/XMLSchema#integer",e.XSD_NON_POSITIVE_INTEGER="http://www.w3.org/2001/XMLSchema#nonPositiveInteger",e.XSD_NEGATIVE_INTEGER="http://www.w3.org/2001/XMLSchema#negativeInteger",e.XSD_LONG="http://www.w3.org/2001/XMLSchema#long",e.XSD_INT="http://www.w3.org/2001/XMLSchema#int",e.XSD_SHORT="http://www.w3.org/2001/XMLSchema#short",e.XSD_BYTE="http://www.w3.org/2001/XMLSchema#byte",e.XSD_NON_NEGATIVE_INTEGER="http://www.w3.org/2001/XMLSchema#nonNegativeInteger",e.XSD_POSITIVE_INTEGER="http://www.w3.org/2001/XMLSchema#positiveInteger",e.XSD_UNSIGNED_LONG="http://www.w3.org/2001/XMLSchema#unsignedLong",e.XSD_UNSIGNED_INT="http://www.w3.org/2001/XMLSchema#unsignedInt",e.XSD_UNSIGNED_SHORT="http://www.w3.org/2001/XMLSchema#unsignedShort",e.XSD_UNSIGNED_BYTE="http://www.w3.org/2001/XMLSchema#unsignedByte",e.XSD_NORMALIZED_STRING="http://www.w3.org/2001/XMLSchema#normalizedString",e.XSD_TOKEN="http://www.w3.org/2001/XMLSchema#token",e.XSD_LANGUAGE="http://www.w3.org/2001/XMLSchema#language",e.XSD_NM_TOKEN="http://www.w3.org/2001/XMLSchema#NMTOKEN",e.XSD_NAME="http://www.w3.org/2001/XMLSchema#name",e.XSD_NC_NAME="http://www.w3.org/2001/XMLSchema#NCName",e.XSD_ENTITY="http://www.w3.org/2001/XMLSchema#ENTITY",e.XSD_ID="http://www.w3.org/2001/XMLSchema#ID",e.XSD_ID_REF="http://www.w3.org/2001/XMLSchema#IDREF",e.XSD_DURATION="http://www.w3.org/2001/XMLSchema#duration",e.XSD_YEAR_MONTH_DURATION="http://www.w3.org/2001/XMLSchema#yearMonthDuration",e.XSD_DAY_TIME_DURATION="http://www.w3.org/2001/XMLSchema#dayTimeDuration"}(o||(t.TypeURL=o={})),function(e){e.NOT="!",e.UMINUS="uminus",e.UPLUS="uplus",e.LOGICAL_OR="||",e.LOGICAL_AND="&&",e.EQUAL="=",e.NOT_EQUAL="!=",e.LT="<",e.GT=">",e.LTE="<=",e.GTE=">=",e.SAME_TERM="sameterm",e.IN="in",e.NOT_IN="notin",e.MULTIPLICATION="*",e.DIVISION="/",e.ADDITION="+",e.SUBTRACTION="-",e.IS_IRI="isiri",e.IS_URI="isuri",e.IS_BLANK="isblank",e.IS_LITERAL="isliteral",e.IS_NUMERIC="isnumeric",e.STR="str",e.LANG="lang",e.DATATYPE="datatype",e.IRI="iri",e.URI="uri",e.BNODE="bnode",e.STRDT="strdt",e.STRLANG="strlang",e.UUID="uuid",e.STRUUID="struuid",e.STRLEN="strlen",e.SUBSTR="substr",e.UCASE="ucase",e.LCASE="lcase",e.STRSTARTS="strstarts",e.STRENDS="strends",e.CONTAINS="contains",e.STRBEFORE="strbefore",e.STRAFTER="strafter",e.ENCODE_FOR_URI="encode_for_uri",e.CONCAT="concat",e.LANG_MATCHES="langmatches",e.REGEX="regex",e.REPLACE="replace",e.ABS="abs",e.ROUND="round",e.CEIL="ceil",e.FLOOR="floor",e.RAND="rand",e.NOW="now",e.YEAR="year",e.MONTH="month",e.DAY="day",e.HOURS="hours",e.MINUTES="minutes",e.SECONDS="seconds",e.TIMEZONE="timezone",e.TZ="tz",e.MD5="md5",e.SHA1="sha1",e.SHA256="sha256",e.SHA384="sha384",e.SHA512="sha512",e.TRIPLE="triple",e.SUBJECT="subject",e.PREDICATE="predicate",e.OBJECT="object",e.IS_TRIPLE="istriple",e.BOUND="bound",e.IF="if",e.COALESCE="coalesce"}(s||(t.SparqlOperator=s={}))},17845:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.prepareEvaluatorActionContext=void 0;const n=r(90711),i=r(89096),a=r(31296);t.prepareEvaluatorActionContext=function(e){let t=e;if(t.has(n.KeysInitQuery.extensionFunctionCreator)&&t.has(n.KeysInitQuery.extensionFunctions))throw new Error("Illegal simultaneous usage of extensionFunctionCreator and extensionFunctions in context");if(t.has(n.KeysInitQuery.extensionFunctionCreator))t=t.set(n.KeysExpressionEvaluator.extensionFunctionCreator,t.get(n.KeysInitQuery.extensionFunctionCreator));else if(t.has(n.KeysInitQuery.extensionFunctions)){const e=t.getSafe(n.KeysInitQuery.extensionFunctions);t=t.set(n.KeysExpressionEvaluator.extensionFunctionCreator,(async t=>e[t.value]))}else t=t.setDefault(n.KeysExpressionEvaluator.extensionFunctionCreator,(async()=>{}));return t=t.setDefault(n.KeysExpressionEvaluator.defaultTimeZone,(0,a.extractTimeZone)(t.getSafe(n.KeysInitQuery.queryTimestamp))),t=t.setDefault(n.KeysExpressionEvaluator.superTypeProvider,{cache:new i.LRUCache({max:1e3}),discoverer:()=>"term"}),t}},31296:(e,t)=>{"use strict";function r(e){return{day:e.day??0,hours:e.hours??0,minutes:e.minutes??0,seconds:e.seconds??0}}function n(e){return{year:e.year??0,month:e.month??0}}function i(e){return{...r(e),...n(e)}}function a(e){return{...e,day:e.day??1,hours:e.hours??0,month:e.month??1,year:e.year??0,seconds:e.seconds??0,minutes:e.minutes??0}}function o(e){const t=new Date(e.year,e.month-1,e.day,e.hours,e.minutes,Math.trunc(e.seconds),e.seconds%1*1e3);if(e.year>=0&&e.year<100){const e=1900;t.setFullYear(t.getFullYear()-e)}return t}Object.defineProperty(t,"__esModule",{value:!0}),t.extractTimeZone=t.extractRawTimeZone=t.dayTimeDurationsToSeconds=t.yearMonthDurationsToMonths=t.trimToDayTimeDuration=t.trimToYearMonthDuration=t.toUTCDate=t.toJSDate=t.negateDuration=t.toDateTimeRepresentation=t.defaultedDateTimeRepresentation=t.simplifyDurationRepresentation=t.defaultedDurationRepresentation=t.defaultedYearMonthDurationRepresentation=t.defaultedDayTimeDurationRepresentation=void 0,t.defaultedDayTimeDurationRepresentation=r,t.defaultedYearMonthDurationRepresentation=n,t.defaultedDurationRepresentation=i,t.simplifyDurationRepresentation=function(e){const t=i(e),r={},n=t.year+Math.trunc(t.month/12);n&&(r.year=n,t.month%=12),t.month&&(r.month=t.month);const a=t.day+Math.trunc(t.hours/24)+Math.trunc(t.minutes/1440)+Math.trunc(t.seconds/86400);a&&(r.day=a,t.hours%=24,t.minutes%=1440,t.seconds%=86400);const o=t.hours+Math.trunc(t.minutes/60)+Math.trunc(t.seconds/3600);o&&(r.hours=o,t.minutes%=60,t.seconds%=3600);const s=t.minutes+Math.trunc(t.seconds/60);return s&&(r.minutes=s,t.seconds%=60),t.seconds&&(r.seconds=t.seconds),r},t.defaultedDateTimeRepresentation=a,t.toDateTimeRepresentation=function({date:e,timeZone:t}){return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds(),zoneHours:t.zoneHours,zoneMinutes:t.zoneMinutes}},t.negateDuration=function(e){return{year:void 0===e.year?void 0:-1*e.year,month:void 0===e.month?void 0:-1*e.month,day:void 0===e.day?void 0:-1*e.day,hours:void 0===e.hours?void 0:-1*e.hours,minutes:void 0===e.minutes?void 0:-1*e.minutes,seconds:void 0===e.seconds?void 0:-1*e.seconds}},t.toJSDate=o,t.toUTCDate=function(e,t){const r=o(a(e)),n=r.getTimezoneOffset(),i=e.zoneHours??t.zoneHours,s=e.zoneMinutes??t.zoneMinutes;return new Date(r.getTime()-60*(n+60*i+s)*1e3)},t.trimToYearMonthDuration=function(e){return{year:e.year,month:e.month}},t.trimToDayTimeDuration=function(e){return{day:e.day,hours:e.hours,minutes:e.minutes,seconds:e.seconds}},t.yearMonthDurationsToMonths=function(e){return 12*e.year+e.month},t.dayTimeDurationsToSeconds=function(e){return 60*(60*(24*e.day+e.hours)+e.minutes)+e.seconds},t.extractRawTimeZone=function(e){return/(Z|([+-]\d\d:\d\d))?$/u.exec(e)[0]},t.extractTimeZone=function(e){return{zoneHours:e.getTimezoneOffset()/60,zoneMinutes:e.getTimezoneOffset()%60}}},98575:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoAggregator=t.ExtensionFunctionError=t.InvalidExpression=t.InvalidArity=t.UnexpectedError=t.ParseError=t.EmptyAggregateError=t.IncompatibleLanguageOperation=t.InvalidTimezoneCall=t.CastError=t.InvalidArgumentTypes=t.InError=t.CoalesceError=t.RDFEqualTypeError=t.EBVCoercionError=t.UnboundVariableError=t.InvalidLexicalForm=t.isExpressionError=t.ExpressionError=void 0;class r extends Error{}t.ExpressionError=r,t.isExpressionError=function(e){return e instanceof r},t.InvalidLexicalForm=class extends r{constructor(e){super(`Invalid lexical form '${c(e)}'`),this.arg=e}},t.UnboundVariableError=class extends r{constructor(e,t){super(`Unbound variable '${c(e)}'`),this.variable=e,this.bindings=t}},t.EBVCoercionError=class extends r{constructor(e){super(`Cannot coerce term to EBV '${c(e)}'`),this.arg=e}},t.RDFEqualTypeError=class extends r{constructor(e){super("Equality test for literals with unsupported datatypes"),this.args=e}},t.CoalesceError=class extends r{constructor(e){super("All COALESCE arguments threw errors"),this.errors=e}},t.InError=class extends r{constructor(e){super(`Some argument to IN errorred and none where equal. ${e.map((e=>`(${e.toString()}) `)).join("and ")}`),this.errors=e}},t.InvalidArgumentTypes=class extends r{constructor(e,t){super(`Argument types not valid for operator: '${c(t)}' with '${c(e)}`),this.args=e,this.op=t}},t.CastError=class extends r{constructor(e,t){super(`Invalid cast: '${c(e)}' to '${c(t)}'`),this.arg=e}},t.InvalidTimezoneCall=class extends r{constructor(e){super(`TIMEZONE call on ${e} which has no timezone`),this.dateString=e}},t.IncompatibleLanguageOperation=class extends r{constructor(e,t){super(`Operation on incompatible language literals '${c(e)}' and '${c(t)}'`),this.arg1=e,this.arg2=t}},t.EmptyAggregateError=class extends r{constructor(){super("Empty aggregate expression")}},t.ParseError=class extends r{constructor(e,t){super(`Failed to parse "${e}" as ${t}.`)}};class n extends Error{constructor(e,t){super(`Programmer Error '${e}'`),this.payload=t}}t.UnexpectedError=n;class i extends Error{constructor(e,t){super(`The number of args does not match the arity of the operator '${c(t)}'.`),this.args=e,this.op=t}}t.InvalidArity=i;class a extends Error{constructor(e){super(`Invalid SPARQL Expression '${c(e)}'`)}}t.InvalidExpression=a;class o extends Error{constructor(e,t){t instanceof Error?super(`Error thrown in ${e}: ${t.message}${t.stack?`\n${t.stack}`:""}`):super(`Error thrown in ${e}`)}}t.ExtensionFunctionError=o;class s extends Error{constructor(e){super(`Aggregate expression ${c(e)} found, but no aggregate hook provided.`)}}function c(e){return JSON.stringify(e)}t.NoAggregator=s},29658:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseDayTimeDuration=t.parseYearMonthDuration=t.parseDuration=t.parseTime=t.parseDate=t.parseDateTime=t.parseXSDDecimal=t.parseXSDFloat=void 0;const n=r(31296),i=r(98575),a=r(84427);function o(e){if(""===e)return{zoneHours:void 0,zoneMinutes:void 0};if("Z"===e)return{zoneHours:0,zoneMinutes:0};const t=e.replaceAll(/^([+|-])(\d\d):(\d\d)$/gu,"$11!$2!$3").split("!").map(Number);return{zoneHours:t[0]*t[1],zoneMinutes:t[0]*t[2]}}function s(e){const t=e.replaceAll(/^(-)?([123456789]*\d{4})-(\d\d)-(\d\d)(Z|([+-]\d\d:\d\d))?$/gu,"$11!$2!$3!$4!$5");if(t===e)throw new i.ParseError(e,"date");const r=t.split("!"),n=r.slice(0,-1).map(Number),s={year:n[0]*n[1],month:n[2],day:n[3],...o(r[4])};if(!(s.month>=1&&s.month<=12&&s.day>=1&&s.day<=(0,a.maximumDayInMonthFor)(s.year,s.month)))throw new i.ParseError(e,"date");return s}function c(e){const t=e.replaceAll(/^(\d\d):(\d\d):(\d\d(\.\d+)?)(Z|([+-]\d\d:\d\d))?$/gu,"$1!$2!$3!$5");if(t===e)throw new i.ParseError(e,"time");const r=t.split("!"),n=r.slice(0,-1).map(Number),a={hours:n[0],minutes:n[1],seconds:n[2],...o(r[3])};if(a.seconds>=60||a.minutes>=60||a.hours>24||24===a.hours&&(0!==a.minutes||0!==a.seconds))throw new i.ParseError(e,"time");return a}function u(e){const[t,r]=e.split("T"),a=t.replaceAll(/^(-)?P(\d+Y)?(\d+M)?(\d+D)?$/gu,"$11S!$2!$3!$4");if(a===t)throw new i.ParseError(e,"duration");const o=a.split("!");if(void 0!==r){const t=r.replaceAll(/^(\d+H)?(\d+M)?(\d+(\.\d+)?S)?$/gu,"$1!$2!$3");if(""===r||r===t)throw new i.ParseError(e,"duration");o.push(...t.split("!"))}const s=o.map((e=>e.slice(0,-1)));if(!s.slice(1).some(Boolean))throw new i.ParseError(e,"duration");const c=Number(s[0]);return(0,n.simplifyDurationRepresentation)({year:s[1]?c*Number(s[1]):void 0,month:s[2]?c*Number(s[2]):void 0,day:s[3]?c*Number(s[3]):void 0,hours:s[4]?c*Number(s[4]):void 0,minutes:s[5]?c*Number(s[5]):void 0,seconds:s[6]?c*Number(s[6]):void 0})}t.parseXSDFloat=function(e){const t=Number(e);return Number.isNaN(t)?"NaN"===e?Number.NaN:"INF"===e||"+INF"===e?Number.POSITIVE_INFINITY:"-INF"===e?Number.NEGATIVE_INFINITY:void 0:t},t.parseXSDDecimal=function(e){const t=Number(e);return Number.isNaN(t)?void 0:t},t.parseDateTime=function(e){const[t,r]=e.split("T");if(void 0===r)throw new i.ParseError(e,"dateTime");return{...s(t),...c(r)}},t.parseDate=s,t.parseTime=function(e){const t=c(e);return t.hours%=24,t},t.parseDuration=u,t.parseYearMonthDuration=function(e){const t=u(e);if(["hours","minutes","seconds","day"].some((e=>Boolean(t[e]))))throw new i.ParseError(e,"yearMonthDuration");return t},t.parseDayTimeDuration=function(e){const t=u(e);if(["year","month"].some((e=>Boolean(t[e]))))throw new i.ParseError(e,"dayTimeDuration");return t}},72374:(e,t)=>{"use strict";function r(e,t=2){return e.toLocaleString(void 0,{minimumIntegerDigits:t,useGrouping:!1})}function n(e){return void 0===e.zoneHours||void 0===e.zoneMinutes?"":0===e.zoneHours&&0===e.zoneMinutes?"Z":`${e.zoneHours>=0?`+${r(e.zoneHours)}`:r(e.zoneHours)}:${r(Math.abs(e.zoneMinutes))}`}function i(e){return`${r(e.year,4)}-${r(e.month)}-${r(e.day)}${n(e)}`}function a(e){return`${r(e.hours)}:${r(e.minutes)}:${r(e.seconds)}${n(e)}`}Object.defineProperty(t,"__esModule",{value:!0}),t.serializeDuration=t.serializeTime=t.serializeDate=t.serializeDateTime=void 0,t.serializeDateTime=function(e){return`${i({year:e.year,month:e.month,day:e.day})}T${a(e)}`},t.serializeDate=i,t.serializeTime=a,t.serializeDuration=function(e,t="PT0S"){if(!Object.values(e).some((e=>0!==(e||0))))return t;const r=`${Object.values(e).some((e=>(e||0)<0))?"-":""}P${e.year?`${Math.abs(e.year)}Y`:""}${e.month?`${Math.abs(e.month)}M`:""}${e.day?`${Math.abs(e.day)}D`:""}`;return e.hours||e.minutes||e.seconds?`${r}T${e.hours?`${Math.abs(e.hours)}H`:""}${e.minutes?`${Math.abs(e.minutes)}M`:""}${e.seconds?`${Math.abs(e.seconds)}S`:""}`:r}},84427:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.elapsedDuration=t.addDurationToDateTime=t.maximumDayInMonthFor=void 0;const n=r(31296);function i(e,t,r=0){const n=e-r,i=t-r,a=Math.floor(n/i);return{intDiv:a,remainder:e-a*i}}function a(e,t){const{intDiv:r,remainder:n}=i(t,13,1),a=e+r;return[1,3,5,7,8,10,12].includes(n)?31:[4,6,9,11].includes(n)?30:2===n&&(0===i(a,400).remainder||0!==i(a,100).remainder&&0===i(a,4).remainder)?29:28}t.maximumDayInMonthFor=a,t.addDurationToDateTime=function(e,t){const r={...e};let n=i(e.month+t.month,13,1);for(r.month=n.remainder,r.year=e.year+t.year+n.intDiv,n=i(e.seconds+t.seconds,60),r.seconds=n.remainder,n=i(e.minutes+t.minutes+n.intDiv,60),r.minutes=n.remainder,n=i(e.hours+t.hours+n.intDiv,24),r.hours=n.remainder,r.day=e.day+t.day+n.intDiv;;){let e;if(r.day<1)r.day+=a(r.year,r.month-1),e=-1;else{if(!(r.day>a(r.year,r.month)))break;r.day-=a(r.year,r.month),e=1}n=i(r.month+e,13,1),r.month=n.remainder,r.year+=n.intDiv}return r},t.elapsedDuration=function(e,t,r){const i=(0,n.toUTCDate)(e,r),a=(0,n.toUTCDate)(t,r),o=i.getTime()-a.getTime();return{day:Math.floor(o/864e5),hours:Math.floor(o%864e5/36e5),minutes:Math.floor(o%36e5/6e4),seconds:o%6e4}}},86273:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.typePromotion=t.isSubTypeOf=t.getSuperTypeDict=t.isInternalSubType=t.asGeneralType=t.asOverrideType=t.asKnownLiteralType=t.asTypeAlias=t.typeAliasCheck=t.extensionTableInit=t.getSuperTypes=t.superTypeDictTable=t.extensionTableInput=void 0;const n=r(54833),i=r(97618),a=r(64900);function o(e,r){const n=r.cache.get(e);if(n)return n;const i=r.discoverer(e);if("term"===i){const t=Object.create(null);return t.__depth=0,t[e]=0,r.cache.set(e,t),t}let a;const s=u(i);return a=s?{...t.superTypeDictTable[s]}:{...o(i,r)},a.__depth++,a[e]=a.__depth,r.cache.set(e,a),a}function s(){for(const[e,r]of Object.entries(t.extensionTableInput)){const n=e;t.superTypeDictTable[n]||c(n,r,t.superTypeDictTable)}}function c(e,r,n){if("term"===r||void 0===r){const t=Object.create(null);return t.__depth=0,t[e]=0,void(n[e]=t)}n[r]||c(r,t.extensionTableInput[r],n),n[e]={...n[r],[e]:n[r].__depth+1,__depth:n[r].__depth+1}}function u(e){if(e in t.superTypeDictTable)return e}function l(e,r){const n=u(e);return n?t.superTypeDictTable[n]:o(e,r)}t.extensionTableInput={[a.TypeURL.XSD_DATE_TIME_STAMP]:a.TypeURL.XSD_DATE_TIME,[a.TypeURL.XSD_DAY_TIME_DURATION]:a.TypeURL.XSD_DURATION,[a.TypeURL.XSD_YEAR_MONTH_DURATION]:a.TypeURL.XSD_DURATION,[a.TypeURL.RDF_LANG_STRING]:a.TypeAlias.SPARQL_STRINGLY,[a.TypeURL.XSD_STRING]:a.TypeAlias.SPARQL_STRINGLY,[a.TypeURL.XSD_NORMALIZED_STRING]:a.TypeURL.XSD_STRING,[a.TypeURL.XSD_TOKEN]:a.TypeURL.XSD_NORMALIZED_STRING,[a.TypeURL.XSD_LANGUAGE]:a.TypeURL.XSD_TOKEN,[a.TypeURL.XSD_NM_TOKEN]:a.TypeURL.XSD_TOKEN,[a.TypeURL.XSD_NAME]:a.TypeURL.XSD_TOKEN,[a.TypeURL.XSD_NC_NAME]:a.TypeURL.XSD_NAME,[a.TypeURL.XSD_ENTITY]:a.TypeURL.XSD_NC_NAME,[a.TypeURL.XSD_ID]:a.TypeURL.XSD_NC_NAME,[a.TypeURL.XSD_ID_REF]:a.TypeURL.XSD_NC_NAME,[a.TypeURL.XSD_DOUBLE]:a.TypeAlias.SPARQL_NUMERIC,[a.TypeURL.XSD_FLOAT]:a.TypeAlias.SPARQL_NUMERIC,[a.TypeURL.XSD_DECIMAL]:a.TypeAlias.SPARQL_NUMERIC,[a.TypeURL.XSD_INTEGER]:a.TypeURL.XSD_DECIMAL,[a.TypeURL.XSD_NON_POSITIVE_INTEGER]:a.TypeURL.XSD_INTEGER,[a.TypeURL.XSD_NEGATIVE_INTEGER]:a.TypeURL.XSD_NON_POSITIVE_INTEGER,[a.TypeURL.XSD_LONG]:a.TypeURL.XSD_INTEGER,[a.TypeURL.XSD_INT]:a.TypeURL.XSD_LONG,[a.TypeURL.XSD_SHORT]:a.TypeURL.XSD_INT,[a.TypeURL.XSD_BYTE]:a.TypeURL.XSD_SHORT,[a.TypeURL.XSD_NON_NEGATIVE_INTEGER]:a.TypeURL.XSD_INTEGER,[a.TypeURL.XSD_POSITIVE_INTEGER]:a.TypeURL.XSD_NON_NEGATIVE_INTEGER,[a.TypeURL.XSD_UNSIGNED_LONG]:a.TypeURL.XSD_NON_NEGATIVE_INTEGER,[a.TypeURL.XSD_UNSIGNED_INT]:a.TypeURL.XSD_UNSIGNED_LONG,[a.TypeURL.XSD_UNSIGNED_SHORT]:a.TypeURL.XSD_UNSIGNED_INT,[a.TypeURL.XSD_UNSIGNED_BYTE]:a.TypeURL.XSD_UNSIGNED_SHORT,[a.TypeURL.XSD_DATE_TIME]:"term",[a.TypeURL.XSD_BOOLEAN]:"term",[a.TypeURL.XSD_DATE]:"term",[a.TypeURL.XSD_G_MONTH]:"term",[a.TypeURL.XSD_G_MONTHDAY]:"term",[a.TypeURL.XSD_G_YEAR]:"term",[a.TypeURL.XSD_G_YEAR_MONTH]:"term",[a.TypeURL.XSD_TIME]:"term",[a.TypeURL.XSD_G_DAY]:"term",[a.TypeURL.XSD_DURATION]:"term",[a.TypeAlias.SPARQL_NUMERIC]:"term",[a.TypeAlias.SPARQL_STRINGLY]:"term",[a.TypeURL.XSD_ANY_URI]:"term"},t.superTypeDictTable=Object.create(null),t.getSuperTypes=o,t.extensionTableInit=s,s(),t.typeAliasCheck=Object.create(null),function(){for(const e of Object.values(a.TypeAlias))t.typeAliasCheck[e]=!0}(),t.asTypeAlias=function(e){if(e in t.typeAliasCheck)return e},t.asKnownLiteralType=u,t.asOverrideType=function(e){if(u(e)??"term"===e)return e},t.asGeneralType=function(e){if("term"===e||(0,n.asTermType)(e))return e},t.isInternalSubType=function(e,r){return"term"!==e&&t.superTypeDictTable[e]&&void 0!==t.superTypeDictTable[e][r]},t.getSuperTypeDict=l,t.isSubTypeOf=function(e,t,r){return"term"!==e&&void 0!==l(e,r)[t]},t.typePromotion={[a.TypeURL.XSD_STRING]:[{typeToPromote:a.TypeURL.XSD_ANY_URI,conversionFunction:e=>(0,i.string)(e.str())}],[a.TypeURL.XSD_DOUBLE]:[{typeToPromote:a.TypeURL.XSD_FLOAT,conversionFunction:e=>(0,i.double)(e.typedValue)},{typeToPromote:a.TypeURL.XSD_DECIMAL,conversionFunction:e=>(0,i.double)(e.typedValue)}],[a.TypeURL.XSD_FLOAT]:[{typeToPromote:a.TypeURL.XSD_DECIMAL,conversionFunction:e=>(0,i.float)(e.typedValue)}]}},77571:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChunkedIterator=void 0;const n=r(75627);class i extends n.TransformIterator{constructor(e,t,r){super(e,r),this.chunk=[],this.blockSize=t}consumeChunkAsIterator(){const e=new n.ArrayIterator(this.chunk,{autoStart:!1});return this.chunk=[],e}_transform(e,t,r){this.chunk.push(e),this.chunk.length>=this.blockSize&&r(this.consumeChunkAsIterator()),t()}_flush(e){this.chunk.length>0&&this._push(this.consumeChunkAsIterator()),super._flush(e)}}t.ChunkedIterator=i},40274:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClosableIterator=void 0;const n=r(75627);class i extends n.AsyncIterator{constructor(e,t){super(),this.onClose=t.onClose,this._source=e,this._source[n.DESTINATION]=this,this._source.on("end",s),this._source.on("error",o),this._source.on("readable",a),this.readable=this._source.readable}read(){const e=this._source.read();return e||(this.readable=!1,this._source.done&&this.close()),e}_end(e){this.onClose(),this._source.removeListener("end",s),this._source.removeListener("error",o),this._source.removeListener("readable",a),delete this._source[n.DESTINATION],this._source.destroy(),super._end(e)}}function a(){this[n.DESTINATION].readable=!0}function o(e){this[n.DESTINATION].emit("error",e)}function s(){this[n.DESTINATION].close()}t.ClosableIterator=i},54236:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClosableTransformIterator=void 0;const n=r(75627);class i extends n.TransformIterator{constructor(e,t){super(e,t),this.onClose=t.onClose}_end(e){this.onClose(),super._end(e)}}t.ClosableTransformIterator=i},4809:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(77571),t),i(r(40274),t),i(r(54236),t),i(r(44858),t)},44858:(e,t)=>{"use strict";function r(e,t,n){if(!("_profileInstrumented"in e)){if(e._profileInstrumented=!0,"_read"in e){const r=e._read;e._read=(n,i)=>{const a=performance.now();r.call(e,n,(()=>{t.timeSelf+=performance.now()-a,i()}))}}if("read"in e){const r=e.read;e.read=()=>{const i=performance.now(),a=r.call(e);return n&&a&&t.count++,t.timeSelf+=performance.now()-i,a}}if(n){const r=performance.now();e.on("end",(()=>{t.timeLife=performance.now()-r}))}"_source"in e&&r(e._source,t,!1)}}Object.defineProperty(t,"__esModule",{value:!0}),t.instrumentIterator=void 0,t.instrumentIterator=function(e){const t={count:0,timeSelf:0,timeLife:0};return r(e,t,!0),new Promise((r=>{e.on("end",(()=>{r(t)}))}))}},32549:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MetadataValidationState=void 0,t.MetadataValidationState=class{constructor(){this.invalidateListeners=[],this.valid=!0}addInvalidateListener(e){this.invalidateListeners.push(e)}invalidate(){if(this.valid){this.valid=!1;for(const e of this.invalidateListeners)e()}}}},2527:(e,t)=>{"use strict";function r(e){for(const t of["cardinality"])if(!(t in e))throw new Error(`Invalid metadata: missing ${t} in ${JSON.stringify(e)}`);return e}function n(e){for(const t of["cardinality","variables"])if(!(t in e))throw new Error(`Invalid metadata: missing ${t} in ${JSON.stringify(e)}`);return e}function i(e){let t;return()=>(t||(t=e(),t.then((e=>e.state.addInvalidateListener((()=>{t=void 0})))).catch((()=>{}))),t)}Object.defineProperty(t,"__esModule",{value:!0}),t.cachifyMetadata=t.validateMetadataBindings=t.validateMetadataQuads=t.getMetadataBindings=t.getMetadataQuads=void 0,t.getMetadataQuads=function(e){return i((()=>new Promise(((t,r)=>{e.getProperty("metadata",(e=>t(e))),e.on("error",r)})).then((e=>r(e)))))},t.getMetadataBindings=function(e){return i((()=>new Promise(((t,r)=>{e.getProperty("metadata",(e=>t(e))),e.on("error",r)})).then((e=>n(e)))))},t.validateMetadataQuads=r,t.validateMetadataBindings=n,t.cachifyMetadata=i},99214:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(32549),t),i(r(2527),t)},11582:(e,t)=>{"use strict";function r(e,t,i,a){if("conjunction"===t.type)return t.children.every((t=>r(e,t,i,a)));if("disjunction"===t.type)return t.children.some((t=>r(e,t,i,a)));if("arity"===t.type)return r(e,t.child,i,a);if((a?.joinBindings&&!t.joinBindings)??(a?.filterBindings&&!t.filterBindings))return!1;const o=t.operation;switch(o.operationType){case"type":return!!n(e,0,i,a)&&o.type===i.type;case"pattern":return!!n(e,0,i,a)&&o.pattern.type===i.type;case"wildcard":return!0}}function n(e,t,n,i){return!(n.input&&!(Array.isArray(n.input)?n.input:[n.input]).every((t=>r(e,e,t,i))))&&!(n.patterns&&!n.patterns.every((t=>r(e,e,t,i))))}Object.defineProperty(t,"__esModule",{value:!0}),t.doesShapeAcceptOperation=void 0,t.doesShapeAcceptOperation=function(e,t,n){return r(e,e,t,n)}},45534:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.materializeOperation=t.materializeTerm=void 0;const n=r(43347),i=r(3285),a=r(96331);function o(e,t){if("Variable"===e.termType){const r=t.get(e);if(r)return r}return"Quad"===e.termType&&(0,i.someTermsNested)(e,(e=>"Variable"===e.termType))?(0,i.mapTermsNested)(e,(e=>o(e,t))):e}function s(e,t,r){const i=[];for(const[a,o]of t)if(!r||r.some((e=>e.equals(a)))){const t={[(0,n.termToString)(a)]:o};i.push(e.createValues([a],[t]))}return i}t.materializeTerm=o,t.materializeOperation=function e(t,r,i,c,u={}){return u={strictTargetVariables:"strictTargetVariables"in u&&u.strictTargetVariables,bindFilter:!("bindFilter"in u)||u.bindFilter,originalBindings:"originalBindings"in u?u.originalBindings:r},a.Util.mapOperation(t,{path:(e,t)=>({recurse:!1,result:Object.assign(t.createPath(o(e.subject,r),e.predicate,o(e.object,r),o(e.graph,r)),{metadata:e.metadata})}),pattern:(e,t)=>({recurse:!1,result:Object.assign(t.createPattern(o(e.subject,r),o(e.predicate,r),o(e.object,r),o(e.graph,r)),{metadata:e.metadata})}),extend(t){if(r.has(t.variable)){if(u.strictTargetVariables)throw new Error(`Tried to bind variable ${(0,n.termToString)(t.variable)} in a BIND operator.`);return{recurse:!0,result:e(t.input,r,i,c,u)}}return{recurse:!0,result:t}},group(e,t){if(u.strictTargetVariables){for(const t of e.variables)if(r.has(t))throw new Error(`Tried to bind variable ${(0,n.termToString)(t)} in a GROUP BY operator.`);return{recurse:!0,result:e}}const i=e.variables.filter((e=>!r.has(e)));return{recurse:!0,result:t.createGroup(e.input,i,e.aggregates)}},filter(t,n){const a=u.originalBindings;if("operator"!==t.expression.expressionType||0===a.size)return{recurse:!1,result:t};const o=s(n,a),l=e(t.expression,r,i,c,u);let d=e(t.input,r,i,c,u);return o.length>0&&(d=n.createJoin([...o,d])),{recurse:!1,result:n.createFilter(d,l)}},project(t,a){if(u.strictTargetVariables){for(const e of t.variables)if(r.has(e))throw new Error(`Tried to bind variable ${(0,n.termToString)(e)} in a SELECT operator.`);return{recurse:!0,result:t}}for(const e of r.keys())for(const n of t.variables)if(n.equals(e)){r=r.delete(e);break}const o=s(a,u.originalBindings,t.variables);let l=e(t.input,r,i,c,u);return o.length>0&&(l=a.createJoin([...o,l])),{recurse:!1,result:a.createProject(l,t.variables)}},values(e,t){if(!u.strictTargetVariables){const i=e.variables.filter((e=>!r.has(e))),a=e.bindings.map((e=>{const t={...e};let i=!0;return r.forEach(((e,r)=>{const a=(0,n.termToString)(r);a in t&&(e.equals(t[a])||(i=!1),delete t[a])})),i?t:void 0})).filter(Boolean);return{recurse:!0,result:t.createValues(i,a)}}for(const t of e.variables)if(r.has(t))throw new Error(`Tried to bind variable ${(0,n.termToString)(t)} in a VALUES operator.`);return{recurse:!1,result:e}},expression(e,t){if(!u.bindFilter)return{recurse:!1,result:e};if("term"===e.expressionType)return{recurse:!1,result:t.createTermExpression(o(e.term,r))};if("operator"===e.expressionType)return"bound"===e.operator&&1===e.args.length&&"term"===e.args[0].expressionType&&[...r.keys()].some((t=>e.args[0].term.equals(t)))?{recurse:!1,result:t.createTermExpression(t.dataFactory.literal("true",t.dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#boolean")))}:{recurse:!0,result:e};if("aggregate"===e.expressionType&&"variable"in e&&r.has(e.variable)){if(u.strictTargetVariables)throw new Error(`Tried to bind ${(0,n.termToString)(e.variable)} in a ${e.aggregator} aggregate.`);return{recurse:!0,result:e}}return{recurse:!0,result:e}}},i)}},6072:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeOperationSource=t.assignOperationSource=t.getOperationSource=t.testReadOnly=t.validateQueryOutput=t.getSafeVoid=t.getSafeBoolean=t.getSafeQuads=t.getSafeBindings=void 0;const n=r(90711),i=r(90412);function a(e,t){if(e.type!==t)throw new Error(`Invalid query output type: Expected '${t}' but got '${e.type}'`)}t.getSafeBindings=function(e){return a(e,"bindings"),e},t.getSafeQuads=function(e){return a(e,"quads"),e},t.getSafeBoolean=function(e){return a(e,"boolean"),e},t.getSafeVoid=function(e){return a(e,"void"),e},t.validateQueryOutput=a,t.testReadOnly=function(e){return e.get(n.KeysQueryOperation.readOnly)?(0,i.failTest)("Attempted a write operation in read-only mode"):(0,i.passTestVoid)()},t.getOperationSource=function(e){return e.metadata?.scopedSource},t.assignOperationSource=function(e,t){return(e={...e}).metadata=e.metadata?{...e.metadata}:{},e.metadata.scopedSource=t,e},t.removeOperationSource=function(e){delete e.metadata?.scopedSource,e.metadata&&0===Object.keys(e.metadata).length&&delete e.metadata}},67021:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(11582),t),i(r(6072),t),i(r(45534),t)},62620:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fragment=void 0,t.fragment=function(e){let t=function(e){let t=e;(t.endsWith("/")||t.endsWith("#"))&&(t=t.slice(0,t.length-1));const r=[];t.lastIndexOf("/")>0&&r.push(t.lastIndexOf("/")),t.lastIndexOf("#")>0&&r.push(t.lastIndexOf("#"));const n=Math.max(...r);return t.slice(n+1)}(e);return t=t?function(e){var t;const r=null===(t=e.split(/[^a-z0-9]+/gi).filter((e=>""!==e)).map((e=>e[0].toUpperCase()+e.slice(1))).join("").match(/[a-z][a-z0-9]+/gi))||void 0===t?void 0:t[0];return void 0===r?void 0:r[0].toLowerCase()+r.slice(1)}(t):void 0,t||"v"}},35030:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.lookupAllPrefixes=t.prefixToUri=t.uriToPrefix=void 0;const i=r(62620),a=r(88993);t.uriToPrefix=function(e,t){return n(this,void 0,void 0,(function*(){let r;try{r=yield(0,a.lookupPrefix)(e,t)}catch(n){(null==t?void 0:t.mintOnUnknown)&&(r=(0,i.fragment)(e).slice(0,4))}if(void 0!==r&&"object"==typeof(null==t?void 0:t.existingPrefixes)&&r in t.existingPrefixes){let e=0;for(;`${r}${e}`in t.existingPrefixes;)e+=1;r=`${r}${e}`}return r}))},t.prefixToUri=function(e,t){return n(this,void 0,void 0,(function*(){try{return yield(0,a.lookupUri)(e,t)}catch(e){return}}))};var o=r(88993);Object.defineProperty(t,"lookupAllPrefixes",{enumerable:!0,get:function(){return o.lookupAllPrefixes}})},37338:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.fetchContext=t.fetchJson=void 0;const i=r(74945);function a(e,t){var r;return n(this,void 0,void 0,(function*(){const n=null!==(r=null==t?void 0:t.fetch)&&void 0!==r?r:i.fetch;return(yield n(e)).json()}))}t.fetchJson=a,t.fetchContext=function(e,t){return n(this,void 0,void 0,(function*(){return(yield a(e,t))["@context"]}))}},88993:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(51192),t),i(r(35535),t),i(r(45144),t)},45144:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.lookupAllPrefixes=void 0;const i=r(37338);t.lookupAllPrefixes=function(e){return n(this,void 0,void 0,(function*(){return(0,i.fetchContext)("https://prefix.cc/context",e)}))}},51192:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.lookupUri=void 0;const i=r(37338);t.lookupUri=function(e,t){return n(this,void 0,void 0,(function*(){const r=(yield(0,i.fetchContext)(`https://prefix.cc/${e}.file.jsonld`,t))[e];if("string"!=typeof r)throw new Error(`Expected uri to be a string, received: ${r} of type ${typeof r}`);return r}))}},35535:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.lookupPrefix=void 0;const i=r(37338);t.lookupPrefix=function(e,t){return n(this,void 0,void 0,(function*(){const r=new URL("https://prefix.cc/reverse");r.searchParams.append("uri",e),r.searchParams.append("format","jsonld");const n=Object.keys(yield(0,i.fetchContext)(r,t));if(0===n.length)throw new Error("No prefixes returned");return n[0]}))}},44459:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(93875),t),i(r(60806),t),i(r(98841),t),i(r(29706),t),i(r(60782),t),i(r(72335),t),i(r(34947),t)},93875:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContextParser=void 0;const n=r(70742),i=r(60806),a=r(98841),o=r(72335),s=r(34947);class c{constructor(e){e=e||{},this.documentLoader=e.documentLoader||new a.FetchDocumentLoader,this.documentCache={},this.validateContext=!e.skipValidation,this.expandContentTypeToBase=!!e.expandContentTypeToBase,this.remoteContextsDepthLimit=e.remoteContextsDepthLimit||32,this.redirectSchemaOrgHttps=!("redirectSchemaOrgHttps"in e)||!!e.redirectSchemaOrgHttps}static validateLanguage(e,t,r){if("string"!=typeof e)throw new i.ErrorCoded(`The value of an '@language' must be a string, got '${JSON.stringify(e)}'`,r);if(!s.Util.REGEX_LANGUAGE_TAG.test(e)){if(t)throw new i.ErrorCoded(`The value of an '@language' must be a valid language tag, got '${JSON.stringify(e)}'`,r);return!1}return!0}static validateDirection(e,t){if("string"!=typeof e)throw new i.ErrorCoded(`The value of an '@direction' must be a string, got '${JSON.stringify(e)}'`,i.ERROR_CODES.INVALID_BASE_DIRECTION);if(!s.Util.REGEX_DIRECTION_TAG.test(e)){if(t)throw new i.ErrorCoded(`The value of an '@direction' must be 'ltr' or 'rtl', got '${JSON.stringify(e)}'`,i.ERROR_CODES.INVALID_BASE_DIRECTION);return!1}return!0}idifyReverseTerms(e){for(const t of Object.keys(e)){let r=e[t];if(r&&"object"==typeof r&&r["@reverse"]&&!r["@id"]){if("string"!=typeof r["@reverse"]||s.Util.isValidKeyword(r["@reverse"]))throw new i.ErrorCoded(`Invalid @reverse value, must be absolute IRI or blank node: '${r["@reverse"]}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);r=e[t]=Object.assign(Object.assign({},r),{"@id":r["@reverse"]}),r["@id"]=r["@reverse"],s.Util.isPotentialKeyword(r["@reverse"])?delete r["@reverse"]:r["@reverse"]=!0}}return e}expandPrefixedTerms(e,t,r){const n=e.getContextRaw();for(const a of r||Object.keys(n))if(s.Util.EXPAND_KEYS_BLACKLIST.indexOf(a)<0&&!s.Util.isReservedInternalKeyword(a)){const r=n[a];if(s.Util.isPotentialKeyword(a)&&s.Util.ALIAS_DOMAIN_BLACKLIST.indexOf(a)>=0&&("@type"!==a||"object"==typeof n[a]&&!n[a]["@protected"]&&"@set"!==n[a]["@container"]))throw new i.ErrorCoded(`Keywords can not be aliased to something else.\nTried mapping ${a} to ${JSON.stringify(r)}`,i.ERROR_CODES.KEYWORD_REDEFINITION);if(s.Util.ALIAS_RANGE_BLACKLIST.indexOf(s.Util.getContextValueId(r))>=0)throw new i.ErrorCoded(`Aliasing to certain keywords is not allowed.\nTried mapping ${a} to ${JSON.stringify(r)}`,i.ERROR_CODES.INVALID_KEYWORD_ALIAS);if(r&&s.Util.isPotentialKeyword(s.Util.getContextValueId(r))&&!0===r["@prefix"])throw new i.ErrorCoded(`Tried to use keyword aliases as prefix: '${a}': '${JSON.stringify(r)}'`,i.ERROR_CODES.INVALID_TERM_DEFINITION);for(;s.Util.isPrefixValue(n[a]);){const r=n[a];let i=!1;if("string"==typeof r)n[a]=e.expandTerm(r,!0),i=i||r!==n[a];else{const o=r["@id"],c=r["@type"],u=!("@prefix"in r)||s.Util.isValidIri(a);if("@id"in r)null!=o&&"string"==typeof o&&(n[a]=Object.assign(Object.assign({},n[a]),{"@id":e.expandTerm(o,!0)}),i=i||o!==n[a]["@id"]);else if(!s.Util.isPotentialKeyword(a)&&u){const t=e.expandTerm(a,!0);t!==a&&(n[a]=Object.assign(Object.assign({},n[a]),{"@id":t}),i=!0)}if(c&&"string"==typeof c&&"@vocab"!==c&&(!r["@container"]||!r["@container"]["@type"])&&u){let r=e.expandTerm(c,!0);t&&c===r&&(r=e.expandTerm(c,!1)),r!==c&&(i=!0,n[a]=Object.assign(Object.assign({},n[a]),{"@type":r}))}}if(!i)break}}}normalize(e,{processingMode:t,normalizeLanguageTags:r}){if(r||1===t)for(const t of Object.keys(e))if("@language"===t&&"string"==typeof e[t])e[t]=e[t].toLowerCase();else{const r=e[t];if(r&&"object"==typeof r&&"string"==typeof r["@language"]){const n=r["@language"].toLowerCase();n!==r["@language"]&&(e[t]=Object.assign(Object.assign({},r),{"@language":n}))}}}containersToHash(e){for(const t of Object.keys(e)){const r=e[t];if(r&&"object"==typeof r)if("string"==typeof r["@container"])e[t]=Object.assign(Object.assign({},r),{"@container":{[r["@container"]]:!0}});else if(Array.isArray(r["@container"])){const n={};for(const e of r["@container"])n[e]=!0;e[t]=Object.assign(Object.assign({},r),{"@container":n})}}}applyScopedProtected(e,{processingMode:t},r){if(t&&t>=1.1&&e["@protected"]){for(const t of Object.keys(e))if(!s.Util.isReservedInternalKeyword(t)&&!s.Util.isPotentialKeyword(t)&&!s.Util.isTermProtected(e,t)){const n=e[t];n&&"object"==typeof n?"@protected"in e[t]||(e[t]=Object.assign(Object.assign({},e[t]),{"@protected":!0})):(e[t]={"@id":n,"@protected":!0},s.Util.isSimpleTermDefinitionPrefix(n,r)&&(e[t]=Object.assign(Object.assign({},e[t]),{"@prefix":!0})))}delete e["@protected"]}}validateKeywordRedefinitions(e,t,r,n){for(const r of null!=n?n:Object.keys(t))if(s.Util.isTermProtected(e,r)&&("string"==typeof t[r]?t[r]={"@id":t[r],"@protected":!0}:t[r]=Object.assign(Object.assign({},t[r]),{"@protected":!0}),!s.Util.deepEqual(e[r],t[r])))throw new i.ErrorCoded(`Attempted to override the protected keyword ${r} from ${JSON.stringify(s.Util.getContextValueId(e[r]))} to ${JSON.stringify(s.Util.getContextValueId(t[r]))}`,i.ERROR_CODES.PROTECTED_TERM_REDEFINITION)}validate(e,{processingMode:t}){for(const r of Object.keys(e)){if(s.Util.isReservedInternalKeyword(r))continue;if(""===r)throw new i.ErrorCoded(`The empty term is not allowed, got: '${r}': '${JSON.stringify(e[r])}'`,i.ERROR_CODES.INVALID_TERM_DEFINITION);const n=e[r],a=typeof n;if(s.Util.isPotentialKeyword(r)){switch(r.substr(1)){case"vocab":if(null!==n&&"string"!==a)throw new i.ErrorCoded(`Found an invalid @vocab IRI: ${n}`,i.ERROR_CODES.INVALID_VOCAB_MAPPING);break;case"base":if(null!==n&&"string"!==a)throw new i.ErrorCoded(`Found an invalid @base IRI: ${e[r]}`,i.ERROR_CODES.INVALID_BASE_IRI);break;case"language":null!==n&&c.validateLanguage(n,!0,i.ERROR_CODES.INVALID_DEFAULT_LANGUAGE);break;case"version":if(null!==n&&"number"!==a)throw new i.ErrorCoded(`Found an invalid @version number: ${n}`,i.ERROR_CODES.INVALID_VERSION_VALUE);break;case"direction":null!==n&&c.validateDirection(n,!0);break;case"propagate":if(1===t)throw new i.ErrorCoded(`Found an illegal @propagate keyword: ${n}`,i.ERROR_CODES.INVALID_CONTEXT_ENTRY);if(null!==n&&"boolean"!==a)throw new i.ErrorCoded(`Found an invalid @propagate value: ${n}`,i.ERROR_CODES.INVALID_PROPAGATE_VALUE)}if(s.Util.isValidKeyword(r)&&s.Util.isValidKeyword(s.Util.getContextValueId(n)))throw new i.ErrorCoded(`Illegal keyword alias in term value, found: '${r}': '${s.Util.getContextValueId(n)}'`,i.ERROR_CODES.KEYWORD_REDEFINITION)}else if(null!==n)switch(a){case"string":if(s.Util.getPrefix(n,e)===r)throw new i.ErrorCoded(`Detected cyclical IRI mapping in context entry: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.CYCLIC_IRI_MAPPING);if(s.Util.isValidIriWeak(r)){if("@type"===n)throw new i.ErrorCoded(`IRIs can not be mapped to @type, found: '${r}': '${n}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);if(s.Util.isValidIri(n)&&n!==new o.JsonLdContextNormalized(e).expandTerm(r))throw new i.ErrorCoded(`IRIs can not be mapped to other IRIs, found: '${r}': '${n}'`,i.ERROR_CODES.INVALID_IRI_MAPPING)}break;case"object":if(!(s.Util.isCompactIri(r)||"@id"in n||("@id"===n["@type"]?e["@base"]:e["@vocab"])))throw new i.ErrorCoded(`Missing @id in context entry: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);for(const u of Object.keys(n)){const l=n[u];if(l)switch(u){case"@id":if(s.Util.isValidKeyword(l)&&"@type"!==l&&"@id"!==l&&"@graph"!==l&&"@nest"!==l)throw new i.ErrorCoded(`Illegal keyword alias in term value, found: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);if(s.Util.isValidIriWeak(r)){if("@type"===l)throw new i.ErrorCoded(`IRIs can not be mapped to @type, found: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);if(s.Util.isValidIri(l)&&l!==new o.JsonLdContextNormalized(e).expandTerm(r))throw new i.ErrorCoded(`IRIs can not be mapped to other IRIs, found: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING)}if("string"!=typeof l)throw new i.ErrorCoded(`Detected non-string @id in context entry: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);if(s.Util.getPrefix(l,e)===r)throw new i.ErrorCoded(`Detected cyclical IRI mapping in context entry: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.CYCLIC_IRI_MAPPING);break;case"@type":if("@type"===n["@container"]&&"@id"!==l&&"@vocab"!==l)throw new i.ErrorCoded(`@container: @type only allows @type: @id or @vocab, but got: '${r}': '${l}'`,i.ERROR_CODES.INVALID_TYPE_MAPPING);if("string"!=typeof l)throw new i.ErrorCoded(`The value of an '@type' must be a string, got '${JSON.stringify(a)}'`,i.ERROR_CODES.INVALID_TYPE_MAPPING);if(!("@id"===l||"@vocab"===l||1!==t&&"@json"===l||1!==t&&"@none"===l||"_"!==l[0]&&s.Util.isValidIri(l)))throw new i.ErrorCoded(`A context @type must be an absolute IRI, found: '${r}': '${l}'`,i.ERROR_CODES.INVALID_TYPE_MAPPING);break;case"@reverse":if("string"==typeof l&&n["@id"]&&n["@id"]!==l)throw new i.ErrorCoded(`Found non-matching @id and @reverse term values in '${r}':'${l}' and '${n["@id"]}'`,i.ERROR_CODES.INVALID_REVERSE_PROPERTY);if("@nest"in n)throw new i.ErrorCoded(`@nest is not allowed in the reverse property '${r}'`,i.ERROR_CODES.INVALID_REVERSE_PROPERTY);break;case"@container":if(1===t&&(Object.keys(l).length>1||s.Util.CONTAINERS_1_0.indexOf(Object.keys(l)[0])<0))throw new i.ErrorCoded(`Invalid term @container for '${r}' ('${Object.keys(l)}') in 1.0, must be only one of ${s.Util.CONTAINERS_1_0.join(", ")}`,i.ERROR_CODES.INVALID_CONTAINER_MAPPING);for(const e of Object.keys(l)){if("@list"===e&&n["@reverse"])throw new i.ErrorCoded(`Term value can not be @container: @list and @reverse at the same time on '${r}'`,i.ERROR_CODES.INVALID_REVERSE_PROPERTY);if(s.Util.CONTAINERS.indexOf(e)<0)throw new i.ErrorCoded(`Invalid term @container for '${r}' ('${e}'), must be one of ${s.Util.CONTAINERS.join(", ")}`,i.ERROR_CODES.INVALID_CONTAINER_MAPPING)}break;case"@language":c.validateLanguage(l,!0,i.ERROR_CODES.INVALID_LANGUAGE_MAPPING);break;case"@direction":c.validateDirection(l,!0);break;case"@prefix":if(null!==l&&"boolean"!=typeof l)throw new i.ErrorCoded(`Found an invalid term @prefix boolean in: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_PREFIX_VALUE);if(!("@id"in n)&&!s.Util.isValidIri(r))throw new i.ErrorCoded(`Invalid @prefix definition for '${r}' ('${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_TERM_DEFINITION);break;case"@index":if(1===t||!n["@container"]||!n["@container"]["@index"])throw new i.ErrorCoded(`Attempt to add illegal key to value object: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_TERM_DEFINITION);break;case"@nest":if(s.Util.isPotentialKeyword(l)&&"@nest"!==l)throw new i.ErrorCoded(`Found an invalid term @nest value in: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_NEST_VALUE)}}break;default:throw new i.ErrorCoded(`Found an invalid term value: '${r}': '${n}'`,i.ERROR_CODES.INVALID_TERM_DEFINITION)}}}applyBaseEntry(e,t,r){return"string"==typeof e||(r&&!("@base"in e)&&t.parentContext&&"object"==typeof t.parentContext&&"@base"in t.parentContext&&(e["@base"]=t.parentContext["@base"],t.parentContext["@__baseDocument"]&&(e["@__baseDocument"]=!0)),t.baseIRI&&!t.external&&("@base"in e?null===e["@base"]||"string"!=typeof e["@base"]||s.Util.isValidIri(e["@base"])||(e["@base"]=(0,n.resolve)(e["@base"],t.parentContext&&t.parentContext["@base"]||t.baseIRI)):(e["@base"]=t.baseIRI,e["@__baseDocument"]=!0))),e}normalizeContextIri(e,t){if(!s.Util.isValidIri(e))try{e=(0,n.resolve)(e,t)}catch(t){throw new Error(`Invalid context IRI: ${e}`)}return this.redirectSchemaOrgHttps&&e.startsWith("http://schema.org")&&(e="https://schema.org/"),e}async parseInnerContexts(e,t,r){for(const n of null!=r?r:Object.keys(e)){const r=e[n];if(r&&"object"==typeof r&&"@context"in r&&null!==r["@context"]&&!t.ignoreScopedContexts){if(this.validateContext)try{const i=Object.assign(Object.assign({},e),{[n]:Object.assign({},e[n])});delete i[n]["@context"],await this.parse(r["@context"],Object.assign(Object.assign({},t),{external:!1,parentContext:i,ignoreProtection:!0,ignoreRemoteScopedContexts:!0,ignoreScopedContexts:!0}))}catch(e){throw new i.ErrorCoded(e.message,i.ERROR_CODES.INVALID_SCOPED_CONTEXT)}e[n]=Object.assign(Object.assign({},r),{"@context":(await this.parse(r["@context"],Object.assign(Object.assign({},t),{external:!1,minimalProcessing:!0,ignoreRemoteScopedContexts:!0,parentContext:e}))).getContextRaw()})}}return e}async parse(e,t={},r={}){const{baseIRI:n,parentContext:a,external:u,processingMode:l=c.DEFAULT_PROCESSING_MODE,normalizeLanguageTags:d,ignoreProtection:p,minimalProcessing:h}=t,f=t.remoteContexts||{};if(Object.keys(f).length>=this.remoteContextsDepthLimit)throw new i.ErrorCoded("Detected an overflow in remote context inclusions: "+Object.keys(f),i.ERROR_CODES.CONTEXT_OVERFLOW);if(null==e){if(!p&&a&&s.Util.hasProtectedTerms(a))throw new i.ErrorCoded("Illegal context nullification when terms are protected",i.ERROR_CODES.INVALID_CONTEXT_NULLIFICATION);return new o.JsonLdContextNormalized(this.applyBaseEntry({},t,!1))}if("string"==typeof e){const r=this.normalizeContextIri(e,n),i=this.getOverriddenLoad(r,t);if(i)return new o.JsonLdContextNormalized(i);const a=await this.parse(await this.load(r),Object.assign(Object.assign({},t),{baseIRI:r,external:!0,remoteContexts:Object.assign(Object.assign({},f),{[r]:!0})}));return this.applyBaseEntry(a.getContextRaw(),t,!0),a}if(Array.isArray(e)){const r=[],i=await Promise.all(e.map(((e,i)=>{if("string"==typeof e){const a=this.normalizeContextIri(e,n);r[i]=a;return this.getOverriddenLoad(a,t)||this.load(a)}return e})));if(h)return new o.JsonLdContextNormalized(i);const s=await i.reduce(((e,n,a)=>e.then((e=>this.parse(n,Object.assign(Object.assign({},t),{baseIRI:r[a]||t.baseIRI,external:!!r[a]||t.external,parentContext:e.getContextRaw(),remoteContexts:r[a]?Object.assign(Object.assign({},f),{[r[a]]:!0}):f}),{skipValidation:a=1.1))throw new i.ErrorCoded("Context importing is not supported in JSON-LD 1.0",i.ERROR_CODES.INVALID_CONTEXT_ENTRY);if("string"!=typeof e["@import"])throw new i.ErrorCoded("An @import value must be a string, but got "+typeof e["@import"],i.ERROR_CODES.INVALID_IMPORT_VALUE);f=await this.loadImportContext(this.normalizeContextIri(e["@import"],n)),delete e["@import"]}this.applyScopedProtected(f,{processingMode:l},o.defaultExpandOptions);const y=Object.assign(f,e);this.idifyReverseTerms(y),this.normalize(y,{processingMode:l,normalizeLanguageTags:d}),this.applyScopedProtected(y,{processingMode:l},o.defaultExpandOptions);const g=Object.keys(y),m=[];if("object"==typeof a)for(const e in a)e in y?m.push(e):y[e]=a[e];await this.parseInnerContexts(y,t,g);const b=new o.JsonLdContextNormalized(y);return(y&&y["@version"]||c.DEFAULT_PROCESSING_MODE)>=1.1&&(e["@vocab"]&&"string"==typeof e["@vocab"]||""===e["@vocab"])&&(a&&"@vocab"in a&&e["@vocab"].indexOf(":")<0?y["@vocab"]=a["@vocab"]+e["@vocab"]:(s.Util.isCompactIri(e["@vocab"])||e["@vocab"]in y)&&(y["@vocab"]=b.expandTerm(e["@vocab"],!0))),this.expandPrefixedTerms(b,this.expandContentTypeToBase,g),!p&&a&&l>=1.1&&this.validateKeywordRedefinitions(a,y,o.defaultExpandOptions,m),this.validateContext&&!r.skipValidation&&this.validate(y,{processingMode:l}),b}throw new i.ErrorCoded(`Tried parsing a context that is not a string, array or object, but got ${e}`,i.ERROR_CODES.INVALID_LOCAL_CONTEXT)}async load(e){const t=this.documentCache[e];if(t)return t;let r;try{r=await this.documentLoader.load(e)}catch(t){throw new i.ErrorCoded(`Failed to load remote context ${e}: ${t.message}`,i.ERROR_CODES.LOADING_REMOTE_CONTEXT_FAILED)}if(!("@context"in r))throw new i.ErrorCoded(`Missing @context in remote context at ${e}`,i.ERROR_CODES.INVALID_REMOTE_CONTEXT);return this.documentCache[e]=r["@context"]}getOverriddenLoad(e,t){if(e in(t.remoteContexts||{})){if(t.ignoreRemoteScopedContexts)return e;throw new i.ErrorCoded("Detected a cyclic context inclusion of "+e,i.ERROR_CODES.RECURSIVE_CONTEXT_INCLUSION)}return null}async loadImportContext(e){let t=await this.load(e);if("object"!=typeof t||Array.isArray(t))throw new i.ErrorCoded("An imported context must be a single object: "+e,i.ERROR_CODES.INVALID_REMOTE_CONTEXT);if("@import"in t)throw new i.ErrorCoded("An imported context can not import another context: "+e,i.ERROR_CODES.INVALID_CONTEXT_ENTRY);return t=Object.assign({},t),this.containersToHash(t),t}}c.DEFAULT_PROCESSING_MODE=1.1,t.ContextParser=c},60806:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERROR_CODES=t.ErrorCoded=void 0;class r extends Error{constructor(e,t){super(e),this.code=t}}var n;t.ErrorCoded=r,(n=t.ERROR_CODES||(t.ERROR_CODES={})).COLLIDING_KEYWORDS="colliding keywords",n.CONFLICTING_INDEXES="conflicting indexes",n.CYCLIC_IRI_MAPPING="cyclic IRI mapping",n.INVALID_ID_VALUE="invalid @id value",n.INVALID_INDEX_VALUE="invalid @index value",n.INVALID_NEST_VALUE="invalid @nest value",n.INVALID_PREFIX_VALUE="invalid @prefix value",n.INVALID_PROPAGATE_VALUE="invalid @propagate value",n.INVALID_REVERSE_VALUE="invalid @reverse value",n.INVALID_IMPORT_VALUE="invalid @import value",n.INVALID_VERSION_VALUE="invalid @version value",n.INVALID_BASE_IRI="invalid base IRI",n.INVALID_CONTAINER_MAPPING="invalid container mapping",n.INVALID_CONTEXT_ENTRY="invalid context entry",n.INVALID_CONTEXT_NULLIFICATION="invalid context nullification",n.INVALID_DEFAULT_LANGUAGE="invalid default language",n.INVALID_INCLUDED_VALUE="invalid @included value",n.INVALID_IRI_MAPPING="invalid IRI mapping",n.INVALID_JSON_LITERAL="invalid JSON literal",n.INVALID_KEYWORD_ALIAS="invalid keyword alias",n.INVALID_LANGUAGE_MAP_VALUE="invalid language map value",n.INVALID_LANGUAGE_MAPPING="invalid language mapping",n.INVALID_LANGUAGE_TAGGED_STRING="invalid language-tagged string",n.INVALID_LANGUAGE_TAGGED_VALUE="invalid language-tagged value",n.INVALID_LOCAL_CONTEXT="invalid local context",n.INVALID_REMOTE_CONTEXT="invalid remote context",n.INVALID_REVERSE_PROPERTY="invalid reverse property",n.INVALID_REVERSE_PROPERTY_MAP="invalid reverse property map",n.INVALID_REVERSE_PROPERTY_VALUE="invalid reverse property value",n.INVALID_SCOPED_CONTEXT="invalid scoped context",n.INVALID_SCRIPT_ELEMENT="invalid script element",n.INVALID_SET_OR_LIST_OBJECT="invalid set or list object",n.INVALID_TERM_DEFINITION="invalid term definition",n.INVALID_TYPE_MAPPING="invalid type mapping",n.INVALID_TYPE_VALUE="invalid type value",n.INVALID_TYPED_VALUE="invalid typed value",n.INVALID_VALUE_OBJECT="invalid value object",n.INVALID_VALUE_OBJECT_VALUE="invalid value object value",n.INVALID_VOCAB_MAPPING="invalid vocab mapping",n.IRI_CONFUSED_WITH_PREFIX="IRI confused with prefix",n.KEYWORD_REDEFINITION="keyword redefinition",n.LOADING_DOCUMENT_FAILED="loading document failed",n.LOADING_REMOTE_CONTEXT_FAILED="loading remote context failed",n.MULTIPLE_CONTEXT_LINK_HEADERS="multiple context link headers",n.PROCESSING_MODE_CONFLICT="processing mode conflict",n.PROTECTED_TERM_REDEFINITION="protected term redefinition",n.CONTEXT_OVERFLOW="context overflow",n.INVALID_BASE_DIRECTION="invalid base direction",n.RECURSIVE_CONTEXT_INCLUSION="recursive context inclusion",n.INVALID_STREAMING_KEY_ORDER="invalid streaming key order",n.INVALID_EMBEDDED_NODE="invalid embedded node",n.INVALID_ANNOTATION="invalid annotation"},98841:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FetchDocumentLoader=void 0;const n=r(60806),i=r(2384),a=r(70742);t.FetchDocumentLoader=class{constructor(e){this.fetcher=e}async load(e){const t=await(this.fetcher||fetch)(e,{headers:new Headers({accept:"application/ld+json"})});if(t.ok&&t.headers){let r=t.headers.get("Content-Type");if(r){const e=r.indexOf(";");e>0&&(r=r.substr(0,e))}if("application/ld+json"===r)return await t.json();if(t.headers.has("Link")){let r;if(t.headers.forEach(((t,n)=>{if("link"===n){const n=(0,i.parse)(t);for(const t of n.get("type","application/ld+json"))if("alternate"===t.rel){if(r)throw new Error("Multiple JSON-LD alternate links were found on "+e);r=(0,a.resolve)(t.uri,e)}}})),r)return this.load(r)}throw new n.ErrorCoded(`Unsupported JSON-LD media type ${r}`,n.ERROR_CODES.LOADING_DOCUMENT_FAILED)}throw new Error(t.statusText||`Status code: ${t.status}`)}}},29706:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},60782:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},72335:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultExpandOptions=t.JsonLdContextNormalized=void 0;const n=r(70742),i=r(60806),a=r(34947);t.JsonLdContextNormalized=class{constructor(e){this.contextRaw=e}getContextRaw(){return this.contextRaw}expandTerm(e,r,o=t.defaultExpandOptions){const s=this.contextRaw[e];if(null===s||s&&null===s["@id"])return null;let c=!0;if(s&&r){const t=a.Util.getContextValueId(s);if(t&&t!==e){if("string"==typeof t&&(a.Util.isValidIri(t)||a.Util.isValidKeyword(t)))return t;a.Util.isPotentialKeyword(t)||(c=!1)}}const u=a.Util.getPrefix(e,this.contextRaw),l=this.contextRaw["@vocab"],d=(!!l||""===l)&&l.indexOf(":")<0,p=this.contextRaw["@base"],h=a.Util.isPotentialKeyword(e);if(u){const t=this.contextRaw[u],r=a.Util.getContextValueId(t);if(r){if("string"!=typeof t&&o.allowPrefixForcing){if("_"!==r[0]&&!h&&!t["@prefix"]&&!(e in this.contextRaw))return e}else if(!a.Util.isSimpleTermDefinitionPrefix(r,o))return e;return r+e.substr(u.length+1)}}else{if(r&&(l||""===l||o.allowVocabRelativeToBase&&p&&d)&&!h&&!a.Util.isCompactIri(e)){if(d){if(o.allowVocabRelativeToBase)return(l||p?(0,n.resolve)(l,p):"")+e;throw new i.ErrorCoded(`Relative vocab expansion for term '${e}' with vocab '${l}' is not allowed.`,i.ERROR_CODES.INVALID_VOCAB_MAPPING)}return l+e}if(!r&&p&&!h&&!a.Util.isCompactIri(e))return(0,n.resolve)(e,p)}if(c)return e;throw new i.ErrorCoded(`Invalid IRI mapping found for context entry '${e}': '${JSON.stringify(s)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING)}compactIri(e,t){if(t&&this.contextRaw["@vocab"]&&e.startsWith(this.contextRaw["@vocab"]))return e.substr(this.contextRaw["@vocab"].length);if(!t&&this.contextRaw["@base"]&&e.startsWith(this.contextRaw["@base"]))return e.substr(this.contextRaw["@base"].length);const r={prefix:"",suffix:e};for(const n in this.contextRaw){const i=this.contextRaw[n];if(i&&!a.Util.isPotentialKeyword(n)){const o=a.Util.getContextValueId(i);if(e.startsWith(o)){const i=e.substr(o.length);if(i)i.length{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Util=void 0;class r{static isCompactIri(e){return e.indexOf(":")>0&&!(e&&"#"===e[0])}static getPrefix(e,t){if(e&&"#"===e[0])return null;const r=e.indexOf(":");if(r>=0){if(e.length>r+1&&"/"===e.charAt(r+1)&&"/"===e.charAt(r+2))return null;const n=e.substr(0,r);if("_"===n)return null;if(t[n])return n}return null}static getContextValueId(e){if(null===e||"string"==typeof e)return e;return e["@id"]||null}static isSimpleTermDefinitionPrefix(e,t){return!r.isPotentialKeyword(e)&&(t.allowPrefixNonGenDelims||"string"==typeof e&&("_"===e[0]||r.isPrefixIriEndingWithGenDelim(e)))}static isPotentialKeyword(e){return"string"==typeof e&&r.KEYWORD_REGEX.test(e)}static isPrefixIriEndingWithGenDelim(e){return r.ENDS_WITH_GEN_DELIM.test(e)}static isPrefixValue(e){return e&&("string"==typeof e||e&&"object"==typeof e)}static isValidIri(e){return Boolean(e&&r.IRI_REGEX.test(e))}static isValidIriWeak(e){return!!e&&":"!==e[0]&&r.IRI_REGEX_WEAK.test(e)}static isValidKeyword(e){return r.VALID_KEYWORDS[e]}static isTermProtected(e,t){const r=e[t];return!("string"==typeof r)&&r&&r["@protected"]}static hasProtectedTerms(e){for(const t of Object.keys(e))if(r.isTermProtected(e,t))return!0;return!1}static isReservedInternalKeyword(e){return e.startsWith("@__")}static deepEqual(e,t){const r=Object.keys(e),n=Object.keys(t);return r.length===n.length&&r.every((r=>{const n=e[r],i=t[r];return n===i||null!==n&&null!==i&&"object"==typeof n&&"object"==typeof i&&this.deepEqual(n,i)}))}}r.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^ "<>{}|\\\[\]`#]*(#[^#]*)?$/,r.IRI_REGEX_WEAK=/(?::[^:])|\//,r.KEYWORD_REGEX=/^@[a-z]+$/i,r.ENDS_WITH_GEN_DELIM=/[:/?#\[\]@]$/,r.REGEX_LANGUAGE_TAG=/^[a-zA-Z]+(-[a-zA-Z0-9]+)*$/,r.REGEX_DIRECTION_TAG=/^(ltr)|(rtl)$/,r.VALID_KEYWORDS={"@annotation":!0,"@base":!0,"@container":!0,"@context":!0,"@direction":!0,"@graph":!0,"@id":!0,"@import":!0,"@included":!0,"@index":!0,"@json":!0,"@language":!0,"@list":!0,"@nest":!0,"@none":!0,"@prefix":!0,"@propagate":!0,"@protected":!0,"@reverse":!0,"@set":!0,"@type":!0,"@value":!0,"@version":!0,"@vocab":!0},r.EXPAND_KEYS_BLACKLIST=["@base","@vocab","@language","@version","@direction"],r.ALIAS_DOMAIN_BLACKLIST=["@container","@graph","@id","@index","@list","@nest","@none","@prefix","@reverse","@set","@type","@value","@version"],r.ALIAS_RANGE_BLACKLIST=["@context","@preserve"],r.CONTAINERS=["@list","@set","@index","@language","@graph","@id","@type"],r.CONTAINERS_1_0=["@list","@set","@index"],t.Util=r},1106:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(96709),t)},87685:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContextTree=void 0;class r{constructor(){this.subTrees={}}getContext(e){if(e.length>0){const[t,...r]=e,n=this.subTrees[t];if(n){const e=n.getContext(r);if(e)return e.then((({context:e,depth:t})=>({context:e,depth:t+1})))}}return this.context?this.context.then((e=>({context:e,depth:0}))):null}setContext(e,t){if(0===e.length)this.context=t;else{const[n,...i]=e;let a=this.subTrees[n];a||(a=this.subTrees[n]=new r),a.setContext(i,t)}}removeContext(e){this.setContext(e,null)}}t.ContextTree=r},96709:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JsonLdParser=void 0;const n=r(50608),i=r(44459),a=r(19198),o=r(78141),s=r(73036),c=r(90498),u=r(16410),l=r(73105),d=r(37518),p=r(18541),h=r(44736),f=r(75230),y=r(60708),g=r(79942),m=r(11443),b=r(20187),v=r(67192),_=r(2384),w=r(96681);class O extends a.Transform{constructor(e){super({readableObjectMode:!0}),e=e||{},this.options=e,this.parsingContext=new b.ParsingContext(Object.assign({parser:this},e)),this.util=new v.Util({dataFactory:e.dataFactory,parsingContext:this.parsingContext}),this.jsonParser=new n,this.contextJobs=[],this.typeJobs=[],this.contextAwaitingJobs=[],this.lastDepth=0,this.lastKeys=[],this.lastOnValueJob=Promise.resolve(),this.attachJsonParserListeners(),this.on("end",(()=>{void 0!==this.jsonParser.mode&&this.emit("error",new Error("Unclosed document"))}))}static fromHttpResponse(e,t,r,n){let a,o,s=["application/activity+json"];if(n&&n.wellKnownMediaTypes&&(s=n.wellKnownMediaTypes),"application/ld+json"!==t&&!s.includes(t)){if("application/json"!==t&&!t.endsWith("+json"))throw new i.ErrorCoded(`Unsupported JSON-LD media type ${t}`,i.ERROR_CODES.LOADING_DOCUMENT_FAILED);if(r&&r.has("Link")&&r.forEach(((t,r)=>{if("link"===r){const r=(0,_.parse)(t);for(const t of r.get("rel","http://www.w3.org/ns/json-ld#context")){if(a)throw new i.ErrorCoded("Multiple JSON-LD context link headers were found on "+e,i.ERROR_CODES.MULTIPLE_CONTEXT_LINK_HEADERS);a=t.uri}}})),!a&&!(null==n?void 0:n.ignoreMissingContextLinkHeader))throw new i.ErrorCoded(`Missing context link header for media type ${t} on ${e}`,i.ERROR_CODES.LOADING_DOCUMENT_FAILED)}if(r&&r.has("Content-Type")){const e=r.get("Content-Type"),t=/; *profile=([^"]*)/.exec(e);t&&"http://www.w3.org/ns/json-ld#streaming"===t[1]&&(o=!0)}return new O(Object.assign({baseIRI:e,context:a,streamingProfile:o},n||{}))}import(e){if("pipe"in e){e.on("error",(e=>t.emit("error",e)));const t=e.pipe(new O(this.options));return t}{const t=new a.PassThrough({readableObjectMode:!0});e.on("error",(e=>r.emit("error",e))),e.on("data",(e=>t.push(e))),e.on("end",(()=>t.push(null)));const r=t.pipe(new O(this.options));return r}}_transform(e,t,r){this.jsonParser.write(e),this.lastOnValueJob.then((()=>r()),(e=>r(e)))}async newOnValueJob(e,t,r,n){let a=!0;if(n&&r1&&(l=this.parsingContext.validationStack[this.parsingContext.validationStack.length-1].property);for(let t=Math.max(1,this.parsingContext.validationStack.length-1);t=0?this.parsingContext.idStack[e-r-1]:[await this.util.getGraphContainerValue(t,e)];if(a)for(const t of a){this.parsingContext.emittedStack[e]=!0;for(const r of n)this.util.emitQuadChecked(e,i,r.predicate,r.object,t,r.reverse,r.isEmbedded)}else{const r=this.parsingContext.getUnidentifiedGraphBufferSafe(e-await this.util.getDepthOffsetGraph(e,t)-1);for(const e of n)e.reverse?r.push({object:i,predicate:e.predicate,subject:e.object,isEmbedded:e.isEmbedded}):r.push({object:e.object,predicate:e.predicate,subject:i,isEmbedded:e.isEmbedded})}}this.parsingContext.unidentifiedValuesBuffer.splice(e,1),this.parsingContext.literalStack.splice(e,1),this.parsingContext.jsonLiteralStack.splice(e,1)}const a=this.parsingContext.unidentifiedGraphsBuffer[e];if(a){for(const t of r){const r=1!==e||"BlankNode"!==t.termType||this.parsingContext.topLevelProperties?t:this.util.getDefaultGraph();this.parsingContext.emittedStack[e]=!0;for(const t of a)this.parsingContext.emitQuad(e,this.util.dataFactory.quad(t.subject,t.predicate,t.object,r))}this.parsingContext.unidentifiedGraphsBuffer.splice(e,1)}const o=this.parsingContext.annotationsBuffer[e];if(o){o.length>0&&1===e&&this.parsingContext.emitError(new i.ErrorCoded("Annotations can not be made on top-level nodes",i.ERROR_CODES.INVALID_ANNOTATION));const t=this.parsingContext.getAnnotationsBufferSafe(e-1);for(const e of o)t.push(e);delete this.parsingContext.annotationsBuffer[e]}}async validateKey(e,t,r){for(const n of O.ENTRY_HANDLERS)if(await n.validate(this.parsingContext,this.util,e,t,r))return{valid:!0,property:r||n.isPropertyHandler()};return{valid:!1,property:!1}}attachJsonParserListeners(){this.jsonParser.onValue=e=>{const t=this.jsonParser.stack.length,r=new Array(t+1).fill(0).map(((e,r)=>r===t?this.jsonParser.key:this.jsonParser.stack[r].key));if(!this.isParsingContextInner(t)){const n=()=>this.newOnValueJob(r,e,t,!0);if(this.parsingContext.streamingProfile||this.parsingContext.contextTree.getContext(r.slice(0,-1)))this.lastOnValueJob=this.lastOnValueJob.then(n);else if("@context"===r[t]){let e=this.contextJobs[t];e||(e=this.contextJobs[t]=[]),e.push(n)}else this.contextAwaitingJobs.push({job:n,keys:r,depth:t});this.parsingContext.streamingProfile||0!==t||(this.lastOnValueJob=this.lastOnValueJob.then((()=>this.executeBufferedJobs())))}},this.jsonParser.onError=e=>{this.emit("error",e)}}isParsingContextInner(e){for(let t=e;t>0;t--)if("@context"===this.jsonParser.stack[t-1].key)return!0;return!1}async executeBufferedJobs(){for(const e of this.contextJobs)if(e)for(const t of e)await t();this.parsingContext.unaliasedKeywordCacheStack.splice(0);const e=[];for(const t of this.contextAwaitingJobs)"@type"===await this.util.unaliasKeyword(t.keys[t.depth],t.keys,t.depth,!0)||"number"==typeof t.keys[t.depth]&&"@type"===await this.util.unaliasKeyword(t.keys[t.depth-1],t.keys,t.depth-1,!0)?this.typeJobs.push({job:t.job,keys:t.keys.slice(0,t.keys.length-1)}):e.push(t);for(const t of e){if(this.typeJobs.length>0){const e=[],r=[];for(let n=0;ne.keys.length-t.keys.length));for(const e of n)await e.job();const i=r.sort().reverse();for(const e of i)this.typeJobs.splice(e,1)}await t.job()}}}O.DEFAULT_PROCESSING_MODE="1.1",O.ENTRY_HANDLERS=[new o.EntryHandlerArrayValue,new l.EntryHandlerKeywordContext,new p.EntryHandlerKeywordId,new h.EntryHandlerKeywordIncluded,new d.EntryHandlerKeywordGraph,new f.EntryHandlerKeywordNest,new y.EntryHandlerKeywordType,new m.EntryHandlerKeywordValue,new w.EntryHandlerKeywordAnnotation,new s.EntryHandlerContainer,new g.EntryHandlerKeywordUnknownFallback,new u.EntryHandlerPredicate,new c.EntryHandlerInvalidFallback],t.JsonLdParser=O},20187:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ParsingContext=void 0;const n=r(44459),i=r(60806),a=r(87685),o=r(96709);class s{constructor(e){this.contextParser=new n.ContextParser({documentLoader:e.documentLoader,skipValidation:e.skipContextValidation}),this.streamingProfile=!!e.streamingProfile,this.baseIRI=e.baseIRI,this.produceGeneralizedRdf=!!e.produceGeneralizedRdf,this.allowSubjectList=!!e.allowSubjectList,this.processingMode=e.processingMode||o.JsonLdParser.DEFAULT_PROCESSING_MODE,this.strictValues=!!e.strictValues,this.validateValueIndexes=!!e.validateValueIndexes,this.defaultGraph=e.defaultGraph,this.rdfDirection=e.rdfDirection,this.normalizeLanguageTags=e.normalizeLanguageTags,this.streamingProfileAllowOutOfOrderPlainType=e.streamingProfileAllowOutOfOrderPlainType,this.rdfstar=!1!==e.rdfstar,this.rdfstarReverseInEmbedded=e.rdfstarReverseInEmbedded,this.topLevelProperties=!1,this.activeProcessingMode=parseFloat(this.processingMode),this.processingStack=[],this.processingType=[],this.emittedStack=[],this.idStack=[],this.graphStack=[],this.graphContainerTermStack=[],this.listPointerStack=[],this.contextTree=new a.ContextTree,this.literalStack=[],this.validationStack=[],this.unaliasedKeywordCacheStack=[],this.jsonLiteralStack=[],this.unidentifiedValuesBuffer=[],this.unidentifiedGraphsBuffer=[],this.annotationsBuffer=[],this.pendingContainerFlushBuffers=[],this.parser=e.parser,e.context?(this.rootContext=this.parseContext(e.context),this.rootContext.then((e=>this.validateContext(e)))):this.rootContext=Promise.resolve(new n.JsonLdContextNormalized(this.baseIRI?{"@base":this.baseIRI,"@__baseDocument":!0}:{}))}async parseContext(e,t,r){return this.contextParser.parse(e,{baseIRI:this.baseIRI,ignoreProtection:r,normalizeLanguageTags:this.normalizeLanguageTags,parentContext:t,processingMode:this.activeProcessingMode})}validateContext(e){const t=e.getContextRaw()["@version"];if(t){if(this.activeProcessingMode&&t>this.activeProcessingMode)throw new i.ErrorCoded(`Unsupported JSON-LD version '${t}' under active processing mode ${this.activeProcessingMode}.`,i.ERROR_CODES.PROCESSING_MODE_CONFLICT);if(this.activeProcessingMode&&t0&&!1===i.context.getContextRaw()["@propagate"]&&i.depth!==t&&!r);return 0===i.depth&&!1===i.context.getContextRaw()["@propagate"]&&i.depth!==t&&(i.context=new n.JsonLdContextNormalized({})),i}async newOnValueJob(e,t,r,n){await this.parser.newOnValueJob(e,t,r,n)}async handlePendingContainerFlushBuffers(){if(this.pendingContainerFlushBuffers.length>0){for(const e of this.pendingContainerFlushBuffers)await this.parser.flushBuffer(e.depth,e.keys),this.parser.flushStacks(e.depth);return this.pendingContainerFlushBuffers.splice(0,this.pendingContainerFlushBuffers.length),!0}return!1}emitQuad(e,t){1===e&&(this.topLevelProperties=!0),this.parser.push(t)}emitError(e){this.parser.emit("error",e)}emitContext(e){this.parser.emit("context",e)}getUnidentifiedValueBufferSafe(e){let t=this.unidentifiedValuesBuffer[e];return t||(t=[],this.unidentifiedValuesBuffer[e]=t),t}getUnidentifiedGraphBufferSafe(e){let t=this.unidentifiedGraphsBuffer[e];return t||(t=[],this.unidentifiedGraphsBuffer[e]=t),t}getAnnotationsBufferSafe(e){let t=this.annotationsBuffer[e];return t||(t=[],this.annotationsBuffer[e]=t),t}getExpandOptions(){return s.EXPAND_OPTIONS[this.activeProcessingMode]}shiftStack(e,t){const r=this.idStack[e+t];if(r&&(this.idStack[e]=r,this.emittedStack[e]=!0,delete this.idStack[e+t]),this.pendingContainerFlushBuffers.length)for(const r of this.pendingContainerFlushBuffers)r.depth>=e+t&&(r.depth-=t,r.keys.splice(e,t));this.unidentifiedValuesBuffer[e+t]&&(this.unidentifiedValuesBuffer[e]=this.unidentifiedValuesBuffer[e+t],delete this.unidentifiedValuesBuffer[e+t]),this.annotationsBuffer[e+t-1]&&(this.annotationsBuffer[e-1]||(this.annotationsBuffer[e-1]=[]),this.annotationsBuffer[e-1]=[...this.annotationsBuffer[e-1],...this.annotationsBuffer[e+t-1]],delete this.annotationsBuffer[e+t-1])}}s.EXPAND_OPTIONS={1:{allowPrefixForcing:!1,allowPrefixNonGenDelims:!1,allowVocabRelativeToBase:!1},1.1:{allowPrefixForcing:!0,allowPrefixNonGenDelims:!1,allowVocabRelativeToBase:!0}},t.ParsingContext=s},67192:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Util=void 0;const n=r(44459),i=r(47793),a=r(73036),o=r(82341);class s{constructor(e){this.parsingContext=e.parsingContext,this.dataFactory=e.dataFactory||new i.DataFactory,this.rdfFirst=this.dataFactory.namedNode(s.RDF+"first"),this.rdfRest=this.dataFactory.namedNode(s.RDF+"rest"),this.rdfNil=this.dataFactory.namedNode(s.RDF+"nil"),this.rdfType=this.dataFactory.namedNode(s.RDF+"type"),this.rdfJson=this.dataFactory.namedNode(s.RDF+"JSON")}static getContextValue(e,t,r,n){const i=e.getContextRaw()[r];if(!i)return n;const a=i[t];return void 0===a?n:a}static getContextValueContainer(e,t){return s.getContextValue(e,"@container",t,{"@set":!0})}static getContextValueType(e,t){const r=s.getContextValue(e,"@type",t,null);return"@none"===r?null:r}static getContextValueLanguage(e,t){return s.getContextValue(e,"@language",t,e.getContextRaw()["@language"]||null)}static getContextValueDirection(e,t){return s.getContextValue(e,"@direction",t,e.getContextRaw()["@direction"]||null)}static isContextValueReverse(e,t){return!!s.getContextValue(e,"@reverse",t,null)}static getContextValueIndex(e,t){return s.getContextValue(e,"@index",t,e.getContextRaw()["@index"]||null)}static isPropertyReverse(e,t,r){return"@reverse"===r!==s.isContextValueReverse(e,t)}static isPropertyInEmbeddedNode(e){return"@id"===e}static isPropertyInAnnotationObject(e){return"@annotation"===e}static isValidIri(e){return null!==e&&n.Util.isValidIri(e)}static isPrefixArray(e,t){if(e.length>t.length)return!1;for(let r=0;r1)throw new n.ErrorCoded(`Found illegal neighbouring entries next to @set for key: '${t}'`,n.ERROR_CODES.INVALID_SET_OR_LIST_OBJECT);return[]}if("@list"in r){if(Object.keys(r).length>1)throw new n.ErrorCoded(`Found illegal neighbouring entries next to @list for key: '${t}'`,n.ERROR_CODES.INVALID_SET_OR_LIST_OBJECT);const e=r["@list"];return Array.isArray(e)?0===e.length?[this.rdfNil]:this.parsingContext.idStack[i+1]||[]:await this.valueToTerm(await this.parsingContext.getContext(a),t,e,i-1,a.slice(0,-1))}if("@reverse"in r&&"boolean"==typeof r["@reverse"])return[];if("@graph"in s.getContextValueContainer(await this.parsingContext.getContext(a),t)){const e=this.parsingContext.graphContainerTermStack[i+1];return e?Object.values(e):[this.dataFactory.blankNode()]}if("@id"in r){if(Object.keys(r).length>1&&(e=await this.parsingContext.getContext(a,0)),"@context"in r&&(e=await this.parsingContext.parseContext(r["@context"],e.getContextRaw())),"@vocab"===r["@type"])return this.nullableTermToArray(this.createVocabOrBaseTerm(e,r["@id"]));{const t=r["@id"];let a;if("object"==typeof t){if(!this.parsingContext.rdfstar)throw new n.ErrorCoded(`Found illegal @id '${r}'`,n.ERROR_CODES.INVALID_ID_VALUE);a=this.parsingContext.idStack[i+1][0]}else a=this.resourceToTerm(e,t);return this.nullableTermToArray(a)}}return this.parsingContext.emittedStack[i+1]||r&&"object"==typeof r&&0===Object.keys(r).length?this.parsingContext.idStack[i+1]||(this.parsingContext.idStack[i+1]=[this.dataFactory.blankNode()]):[];case"string":return this.nullableTermToArray(this.stringValueToTerm(i,await this.getContextSelfOrPropertyScoped(e,t),t,r,null));case"boolean":return this.nullableTermToArray(this.stringValueToTerm(i,await this.getContextSelfOrPropertyScoped(e,t),t,Boolean(r).toString(),this.dataFactory.namedNode(s.XSD_BOOLEAN)));case"number":return this.nullableTermToArray(this.stringValueToTerm(i,await this.getContextSelfOrPropertyScoped(e,t),t,r,this.dataFactory.namedNode(r%1==0&&r<1e21?s.XSD_INTEGER:s.XSD_DOUBLE)));default:return this.parsingContext.emitError(new Error(`Could not determine the RDF type of a ${o}`)),[]}}async getContextSelfOrPropertyScoped(e,t){const r=e.getContextRaw()[t];return r&&"object"==typeof r&&"@context"in r&&(e=await this.parsingContext.parseContext(r,e.getContextRaw(),!0)),e}nullableTermToArray(e){return e?[e]:[]}predicateToTerm(e,t){const r=e.expandTerm(t,!0,this.parsingContext.getExpandOptions());return r?"_"===r[0]&&":"===r[1]?this.parsingContext.produceGeneralizedRdf?this.dataFactory.blankNode(r.substr(2)):null:s.isValidIri(r)?this.dataFactory.namedNode(r):r&&this.parsingContext.strictValues?(this.parsingContext.emitError(new n.ErrorCoded(`Invalid predicate IRI: ${r}`,n.ERROR_CODES.INVALID_IRI_MAPPING)),null):null:null}resourceToTerm(e,t){if(t.startsWith("_:"))return this.dataFactory.blankNode(t.substr(2));const r=e.expandTerm(t,!1,this.parsingContext.getExpandOptions());if(!s.isValidIri(r)){if(!r||!this.parsingContext.strictValues)return null;this.parsingContext.emitError(new Error(`Invalid resource IRI: ${r}`))}return this.dataFactory.namedNode(r)}createVocabOrBaseTerm(e,t){if(t.startsWith("_:"))return this.dataFactory.blankNode(t.substr(2));const r=this.parsingContext.getExpandOptions();let n=e.expandTerm(t,!0,r);if(n===t&&(n=e.expandTerm(t,!1,r)),!s.isValidIri(n)){if(!n||!this.parsingContext.strictValues||n.startsWith("@"))return null;this.parsingContext.emitError(new Error(`Invalid term IRI: ${n}`))}return this.dataFactory.namedNode(n)}intToString(e,t){return"number"==typeof e?Number.isFinite(e)?e%1!=0||t&&t.value===s.XSD_DOUBLE?e.toExponential(15).replace(/(\d)0*e\+?/,"$1E"):Number(e).toString():e>0?"INF":"-INF":e}stringValueToTerm(e,t,r,n,i){const a=s.getContextValueType(t,r);if(a)if("@id"===a){if(!i)return this.resourceToTerm(t,this.intToString(n,i))}else if("@vocab"===a){if(!i)return this.createVocabOrBaseTerm(t,this.intToString(n,i))}else i=this.dataFactory.namedNode(a);if(!i){const a=s.getContextValueLanguage(t,r),o=s.getContextValueDirection(t,r);return o&&this.parsingContext.rdfDirection?this.createLanguageDirectionLiteral(e,this.intToString(n,i),a,o):this.dataFactory.literal(this.intToString(n,i),a)}return this.dataFactory.literal(this.intToString(n,i),i)}createLanguageDirectionLiteral(e,t,r,n){if("i18n-datatype"===this.parsingContext.rdfDirection)return r||(r=""),this.dataFactory.literal(t,this.dataFactory.namedNode(`https://www.w3.org/ns/i18n#${r}_${n}`));{const i=this.dataFactory.blankNode(),a=this.getDefaultGraph();return this.parsingContext.emitQuad(e,this.dataFactory.quad(i,this.dataFactory.namedNode(s.RDF+"value"),this.dataFactory.literal(t),a)),r&&this.parsingContext.emitQuad(e,this.dataFactory.quad(i,this.dataFactory.namedNode(s.RDF+"language"),this.dataFactory.literal(r),a)),this.parsingContext.emitQuad(e,this.dataFactory.quad(i,this.dataFactory.namedNode(s.RDF+"direction"),this.dataFactory.literal(n),a)),i}}valueToJsonString(e){return o(e)}async unaliasKeyword(e,t,r,i,a){if(Number.isInteger(e))return e;if(!i){const e=this.parsingContext.unaliasedKeywordCacheStack[r];if(e)return e}if(!n.Util.isPotentialKeyword(e)){let r=(a=a||await this.parsingContext.getContext(t)).getContextRaw()[e];r&&"object"==typeof r&&(r=r["@id"]),n.Util.isValidKeyword(r)&&(e=r)}return i?e:this.parsingContext.unaliasedKeywordCacheStack[r]=e}async unaliasKeywordParent(e,t){return await this.unaliasKeyword(t>0&&e[t-1],e,t-1)}async unaliasKeywords(e,t,r,n){const i={};for(const a in e)i[await this.unaliasKeyword(a,t,r+1,!0,n)]=e[a];return i}async isLiteral(e,t){for(let r=t;r>=0;r--){if("@annotation"===await this.unaliasKeyword(e[r],e,r))return!1;if(this.parsingContext.literalStack[r]||this.parsingContext.jsonLiteralStack[r])return!0}return!1}async getDepthOffsetGraph(e,t){for(let r=e-1;r>0;r--)if("@graph"===await this.unaliasKeyword(t[r],t,r)){const n=(await a.EntryHandlerContainer.getContainerHandler(this.parsingContext,t,r)).containers;return a.EntryHandlerContainer.isComplexGraphContainer(n)?-1:e-r-1}return-1}validateReverseSubject(e){if("Literal"===e.termType)throw new n.ErrorCoded(`Found illegal literal in subject position: ${e.value}`,n.ERROR_CODES.INVALID_REVERSE_PROPERTY_VALUE)}getDefaultGraph(){return this.parsingContext.defaultGraph||this.dataFactory.defaultGraph()}async getGraphContainerValue(e,t){let r=this.getDefaultGraph();const{containers:n,depth:i}=await a.EntryHandlerContainer.getContainerHandler(this.parsingContext,e,t);if("@graph"in n){const t=a.EntryHandlerContainer.getContainerGraphIndex(n,i,e),o=this.parsingContext.graphContainerTermStack[i];if(r=o?o[t]:null,!r){let a=null;if("@id"in n){const t=await this.getContainerKey(e[i],e,i);null!==t&&(a=await this.resourceToTerm(await this.parsingContext.getContext(e),t))}a||(a=this.dataFactory.blankNode()),this.parsingContext.graphContainerTermStack[i]||(this.parsingContext.graphContainerTermStack[i]={}),r=this.parsingContext.graphContainerTermStack[i][t]=a}}return r}async getPropertiesDepth(e,t){let r=t;for(let n=t-1;n>0;n--)if("number"!=typeof e[n]){const t=await this.unaliasKeyword(e[n],e,n);if("@reverse"===t)return n;if("@nest"!==t)return r;r=n}return r}async getContainerKey(e,t,r){const n=await this.unaliasKeyword(e,t,r);return"@none"===n?null:n}validateReverseInEmbeddedNode(e,t,r){if(r&&t&&!this.parsingContext.rdfstarReverseInEmbedded)throw new n.ErrorCoded(`Illegal reverse property in embedded node in ${e}`,n.ERROR_CODES.INVALID_EMBEDDED_NODE)}emitQuadChecked(e,t,r,i,a,o,s){let c;if(o?(this.validateReverseSubject(i),c=this.dataFactory.quad(i,r,t,a)):c=this.dataFactory.quad(t,r,i,a),s){if("DefaultGraph"!==c.graph.termType&&(c=this.dataFactory.quad(c.subject,c.predicate,c.object)),this.parsingContext.idStack[e-1])throw new n.ErrorCoded("Illegal multiple properties in an embedded node",n.ERROR_CODES.INVALID_EMBEDDED_NODE);this.parsingContext.idStack[e-1]=[c]}else this.parsingContext.emitQuad(e,c);const u=this.parsingContext.annotationsBuffer[e];if(u){for(const t of u)this.emitAnnotation(e,c,t);delete this.parsingContext.annotationsBuffer[e]}}emitAnnotation(e,t,r){let n;r.reverse?(this.validateReverseSubject(r.object),n=this.dataFactory.quad(r.object,r.predicate,t)):n=this.dataFactory.quad(t,r.predicate,r.object),this.parsingContext.emitQuad(e,n);for(const t of r.nestedAnnotations)this.emitAnnotation(e,n,t)}}s.XSD="http://www.w3.org/2001/XMLSchema#",s.XSD_BOOLEAN=s.XSD+"boolean",s.XSD_INTEGER=s.XSD+"integer",s.XSD_DOUBLE=s.XSD+"double",s.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",t.Util=s},34946:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContainerHandlerIdentifier=void 0,t.ContainerHandlerIdentifier=class{canCombineWithGraph(){return!0}async handle(e,t,r,n,i,a){let o;if(t.emittedStack[a+1]&&t.idStack[a+1])o=t.idStack[a+1][0];else{const e=null!==await r.getContainerKey(n[a],n,a)?await r.resourceToTerm(await t.getContext(n),n[a]):r.dataFactory.blankNode();if(!e)return void(t.emittedStack[a]=!1);o=e,t.idStack[a+1]=[o]}let s=t.idStack[a];s||(s=t.idStack[a]=[]),s.some((e=>e.equals(o)))||s.push(o),await t.handlePendingContainerFlushBuffers()||(t.emittedStack[a]=!1)}}},5401:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContainerHandlerIndex=void 0;const n=r(44459),i=r(16410),a=r(67192);t.ContainerHandlerIndex=class{canCombineWithGraph(){return!0}async handle(e,t,r,o,s,c){if(!Array.isArray(s)){const u="@graph"in e,l=await t.getContext(o),d=o[c-1],p=a.Util.getContextValueIndex(l,d);if(p){if(n.Util.isPotentialKeyword(p))throw new n.ErrorCoded(`Keywords can not be used as @index value, got: ${p}`,n.ERROR_CODES.INVALID_TERM_DEFINITION);if("string"!=typeof p)throw new n.ErrorCoded(`@index values must be strings, got: ${p}`,n.ERROR_CODES.INVALID_TERM_DEFINITION);if("object"!=typeof s){if("@id"!==a.Util.getContextValueType(l,d))throw new n.ErrorCoded(`Property-based index containers require nodes as values or strings with @type: @id, but got: ${s}`,n.ERROR_CODES.INVALID_VALUE_OBJECT);const e=r.resourceToTerm(l,s);e&&(t.idStack[c+1]=[e])}const e=r.createVocabOrBaseTerm(l,p);if(e){const n=await r.valueToTerm(l,p,await r.getContainerKey(o[c],o,c),c,o);if(u){const i=await r.getGraphContainerValue(o,c+1);for(const a of n)t.emitQuad(c,r.dataFactory.quad(i,e,a,r.getDefaultGraph()))}else for(const a of n)await i.EntryHandlerPredicate.handlePredicateObject(t,r,o,c+1,e,a,!1,!1,!1)}}const h=u?2:1;await t.newOnValueJob(o.slice(0,o.length-h),s,c-h,!0),await t.handlePendingContainerFlushBuffers()}t.emittedStack[c]=!1}}},30903:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContainerHandlerLanguage=void 0;const n=r(44459);t.ContainerHandlerLanguage=class{canCombineWithGraph(){return!1}async handle(e,t,r,i,a,o){const s=await r.getContainerKey(i[o],i,o);if(Array.isArray(a))a=a.map((e=>({"@value":e,"@language":s})));else{if("string"!=typeof a)throw new n.ErrorCoded(`Got invalid language map value, got '${JSON.stringify(a)}', but expected string`,n.ERROR_CODES.INVALID_LANGUAGE_MAP_VALUE);a={"@value":a,"@language":s}}await t.newOnValueJob(i.slice(0,i.length-1),a,o-1,!0),t.emittedStack[o]=!1}}},90925:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContainerHandlerType=void 0;const n=r(16410),i=r(67192);t.ContainerHandlerType=class{canCombineWithGraph(){return!1}async handle(e,t,r,a,o,s){if(!Array.isArray(o)){if("string"==typeof o){const e=await t.getContext(a),n="@vocab"===i.Util.getContextValueType(e,a[s-1])?await r.createVocabOrBaseTerm(e,o):await r.resourceToTerm(e,o);if(n){const e={"@id":"NamedNode"===n.termType?n.value:o};await t.newOnValueJob(a.slice(0,a.length-1),e,s-1,!0),t.idStack[s+1]=[n]}}else{const e=!!t.idStack[s+1];e||delete t.idStack[s],await t.newOnValueJob(a.slice(0,a.length-1),o,s-1,!0),e||(t.idStack[s+1]=t.idStack[s])}const e=await r.getContainerKey(a[s],a,s),c=null!==e?r.createVocabOrBaseTerm(await t.getContext(a),e):null;c&&await n.EntryHandlerPredicate.handlePredicateObject(t,r,a,s+1,r.rdfType,c,!1,!1,!1),await t.handlePendingContainerFlushBuffers()}t.emittedStack[s]=!1}}},78141:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryHandlerArrayValue=void 0;const n=r(67192),i=r(44459);t.EntryHandlerArrayValue=class{isPropertyHandler(){return!1}isStackProcessor(){return!0}async validate(e,t,r,n,i){return this.test(e,t,null,r,n)}async test(e,t,r,n,i){return"number"==typeof n[i]}async handle(e,t,r,i,a,o){let s=await t.unaliasKeywordParent(i,o);if("@list"===s){let r=null,n=0;for(let e=o-2;e>0;e--){const t=i[e];if("string"==typeof t||"number"==typeof t){n=e,r=t;break}}if(null!==r){const s=await t.valueToTerm(await e.getContext(i),r,a,o,i);for(const r of s)await this.handleListElement(e,t,r,a,o,i.slice(0,n),n);0===s.length&&await this.handleListElement(e,t,null,a,o,i.slice(0,n),n)}}else if("@set"===s)await e.newOnValueJob(i.slice(0,-2),a,o-2,!1);else if(void 0!==s&&"@type"!==s){for(let e=o-1;e>0;e--)if("number"!=typeof i[e]){s=await t.unaliasKeyword(i[e],i,e);break}const r=await e.getContext(i.slice(0,-1));if("@list"in n.Util.getContextValueContainer(r,s)){e.emittedStack[o+1]=!0;const r=await t.valueToTerm(await e.getContext(i),s,a,o,i);for(const n of r)await this.handleListElement(e,t,n,a,o,i.slice(0,-1),o-1);0===r.length&&await this.handleListElement(e,t,null,a,o,i.slice(0,-1),o-1)}else e.shiftStack(o,1),await e.newOnValueJob(i.slice(0,-1),a,o-1,!1),e.contextTree.removeContext(i.slice(0,-1))}}async handleListElement(e,t,r,n,a,o,s){let c=e.listPointerStack[a];if(null!==n&&null!==(await t.unaliasKeywords(n,o,a))["@value"]){if(c&&c.value){const r=t.dataFactory.blankNode();e.emitQuad(a,t.dataFactory.quad(c.value,t.rdfRest,r,t.getDefaultGraph())),c.value=r}else{const e=t.dataFactory.blankNode();c={value:e,listRootDepth:s,listId:e}}r&&e.emitQuad(a,t.dataFactory.quad(c.value,t.rdfFirst,r,t.getDefaultGraph()))}else c||(c={listRootDepth:s,listId:t.rdfNil});e.listPointerStack[a]=c,e.rdfstar&&e.annotationsBuffer[a]&&e.emitError(new i.ErrorCoded("Found an illegal annotation inside a list",i.ERROR_CODES.INVALID_ANNOTATION))}}},73036:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryHandlerContainer=void 0;const n=r(34946),i=r(5401),a=r(30903),o=r(90925),s=r(67192);class c{static isSimpleGraphContainer(e){return"@graph"in e&&("@set"in e&&2===Object.keys(e).length||1===Object.keys(e).length)}static isComplexGraphContainer(e){return"@graph"in e&&("@set"in e&&Object.keys(e).length>2||!("@set"in e)&&Object.keys(e).length>1)}static getContainerGraphIndex(e,t,r){let n=c.isSimpleGraphContainer(e),i="";for(let e=t;e=0;e--)if("number"!=typeof t[e]){const r=s.Util.getContextValue(a,"@container",t[e],!1);if(r&&c.isSimpleGraphContainer(r))return{containers:r,depth:e+1,fallback:!1};const o=s.Util.getContextValue(a,"@container",t[e-1],!1);if(o){const t="@graph"in o;for(const r in c.CONTAINER_HANDLERS)if(o[r])return t?c.CONTAINER_HANDLERS[r].canCombineWithGraph()?{containers:o,depth:e,fallback:!1}:n:i?n:{containers:o,depth:e,fallback:!1};return n}if(i)return n;i=!0}return n}static async isBufferableContainerHandler(e,t,r){const n=await c.getContainerHandler(e,t,r);return!n.fallback&&!("@graph"in n.containers)}isPropertyHandler(){return!1}isStackProcessor(){return!0}async validate(e,t,r,n,i){return!!await this.test(e,t,null,r,n)}async test(e,t,r,n,i){const a=s.Util.getContextValueContainer(await e.getContext(n,2),n[i-1]);for(const e in c.CONTAINER_HANDLERS)if(a[e])return{containers:a,handler:c.CONTAINER_HANDLERS[e]};return null}async handle(e,t,r,n,i,a,o){return o.handler.handle(o.containers,e,t,n,i,a)}}c.CONTAINER_HANDLERS={"@id":new n.ContainerHandlerIdentifier,"@index":new i.ContainerHandlerIndex,"@language":new a.ContainerHandlerLanguage,"@type":new o.ContainerHandlerType},t.EntryHandlerContainer=c},90498:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryHandlerInvalidFallback=void 0,t.EntryHandlerInvalidFallback=class{isPropertyHandler(){return!1}isStackProcessor(){return!0}async validate(e,t,r,n,i){return!1}async test(e,t,r,n,i){return!0}async handle(e,t,r,n,i,a){e.emittedStack[a]=!1}}},16410:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryHandlerPredicate=void 0;const n=r(44459),i=r(67192);class a{static async handlePredicateObject(e,t,r,i,a,o,s,c,u){const l=await t.getPropertiesDepth(r,i),d=await t.getDepthOffsetGraph(i,r),p=i-d,h=e.idStack[l];if(h&&!u)for(const n of h)if(d>=0){const r=e.idStack[p-1];if(r)for(const e of r)t.emitQuadChecked(i,n,a,o,e,s,c);else s?(t.validateReverseSubject(o),e.getUnidentifiedGraphBufferSafe(p-1).push({subject:o,predicate:a,object:n,isEmbedded:c})):e.getUnidentifiedGraphBufferSafe(p-1).push({subject:n,predicate:a,object:o,isEmbedded:c})}else{const e=await t.getGraphContainerValue(r,l);t.emitQuadChecked(i,n,a,o,e,s,c)}else if(s&&t.validateReverseSubject(o),u){if(e.rdfstar){e.idStack[i]&&e.emitError(new n.ErrorCoded(`Found an illegal @id inside an annotation: ${e.idStack[i][0].value}`,n.ERROR_CODES.INVALID_ANNOTATION));for(let a=0;a=0;e--){const t=c[e];t.depth>l&&(u.nestedAnnotations.push(t),c.splice(e,1))}}}else e.getUnidentifiedValueBufferSafe(l).push({predicate:a,object:o,reverse:s,isEmbedded:c})}isPropertyHandler(){return!0}isStackProcessor(){return!0}async validate(e,t,r,n,a){const o=r[n];if(o){const a=await e.getContext(r);if(!e.jsonLiteralStack[n]&&await t.predicateToTerm(a,r[n]))return"@json"===i.Util.getContextValueType(a,o)&&(e.jsonLiteralStack[n+1]=!0),!0}return!1}async test(e,t,r,n,i){return n[i]}async handle(e,t,r,o,s,c,u){const l=o[c],d=await e.getContext(o),p=await t.predicateToTerm(d,r);if(p){const u=await t.valueToTerm(d,r,s,c,o);if(u.length)for(let h of u){let u=await t.unaliasKeywordParent(o,c);const f=i.Util.isPropertyReverse(d,l,u);let y=0;for(;"@reverse"===u||"number"==typeof u;)"number"==typeof u?y++:c--,u=await t.unaliasKeywordParent(o,c-y);const g=i.Util.isPropertyInEmbeddedNode(u);t.validateReverseInEmbeddedNode(r,f,g);const m=i.Util.isPropertyInAnnotationObject(u);if(s){const a="@list"in i.Util.getContextValueContainer(d,r);if(a||s["@list"]){if((a&&!Array.isArray(s)&&!s["@list"]||s["@list"]&&!Array.isArray(s["@list"]))&&h!==t.rdfNil){const r=t.dataFactory.blankNode();e.emitQuad(c,t.dataFactory.quad(r,t.rdfRest,t.rdfNil,t.getDefaultGraph())),e.emitQuad(c,t.dataFactory.quad(r,t.rdfFirst,h,t.getDefaultGraph())),h=r}if(f&&!e.allowSubjectList)throw new n.ErrorCoded(`Found illegal list value in subject position at ${r}`,n.ERROR_CODES.INVALID_REVERSE_PROPERTY_VALUE)}}await a.handlePredicateObject(e,t,o,c,p,h,f,g,m)}}}}t.EntryHandlerPredicate=a},13116:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryHandlerKeyword=void 0,t.EntryHandlerKeyword=class{constructor(e){this.keyword=e}isPropertyHandler(){return!1}isStackProcessor(){return!0}async validate(e,t,r,n,i){return!1}async test(e,t,r,n,i){return r===this.keyword}}},96681:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryHandlerKeywordAnnotation=void 0;const n=r(13116),i=r(44459);class a extends n.EntryHandlerKeyword{constructor(){super("@annotation")}async handle(e,t,r,n,a,o){("string"==typeof a||"object"==typeof a&&a["@value"])&&e.emitError(new i.ErrorCoded(`Found illegal annotation value: ${JSON.stringify(a)}`,i.ERROR_CODES.INVALID_ANNOTATION))}}t.EntryHandlerKeywordAnnotation=a},73105:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryHandlerKeywordContext=void 0;const n=r(44459),i=r(13116);class a extends i.EntryHandlerKeyword{constructor(){super("@context")}isStackProcessor(){return!1}async handle(e,t,r,i,a,o){e.streamingProfile&&(e.processingStack[o]||e.processingType[o]||void 0!==e.idStack[o])&&e.emitError(new n.ErrorCoded("Found an out-of-order context, while streaming is enabled.(disable `streamingProfile`)",n.ERROR_CODES.INVALID_STREAMING_KEY_ORDER));const s=e.getContext(i),c=e.parseContext(a,(await s).getContextRaw());e.contextTree.setContext(i.slice(0,-1),c),e.emitContext(a),await e.validateContext(await c)}}t.EntryHandlerKeywordContext=a},37518:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryHandlerKeywordGraph=void 0;const n=r(13116);class i extends n.EntryHandlerKeyword{constructor(){super("@graph")}async handle(e,t,r,n,i,a){e.graphStack[a+1]=!0}}t.EntryHandlerKeywordGraph=i},18541:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryHandlerKeywordId=void 0;const n=r(44459),i=r(13116);class a extends i.EntryHandlerKeyword{constructor(){super("@id")}isStackProcessor(){return!1}async handle(e,t,r,i,a,o){if("string"!=typeof a){if(e.rdfstar&&"object"==typeof a){const t=Object.keys(a);1===t.length&&"@id"===t[0]&&e.emitError(new n.ErrorCoded(`Invalid embedded node without property with @id ${a["@id"]}`,n.ERROR_CODES.INVALID_EMBEDDED_NODE))}else e.emitError(new n.ErrorCoded(`Found illegal @id '${a}'`,n.ERROR_CODES.INVALID_ID_VALUE));return}const s=await t.getPropertiesDepth(i,o);if(void 0!==e.idStack[s]&&(e.idStack[s][0].listHead?e.emitError(new n.ErrorCoded(`Found illegal neighbouring entries next to @list for key: '${i[o-1]}'`,n.ERROR_CODES.INVALID_SET_OR_LIST_OBJECT)):e.emitError(new n.ErrorCoded(`Found duplicate @ids '${e.idStack[s][0].value}' and '${a}'`,n.ERROR_CODES.COLLIDING_KEYWORDS))),e.rdfstar&&e.annotationsBuffer[o])for(const t of e.annotationsBuffer[o])t.depth===o&&e.emitError(new n.ErrorCoded(`Found an illegal @id inside an annotation: ${a}`,n.ERROR_CODES.INVALID_ANNOTATION));e.idStack[s]=t.nullableTermToArray(await t.resourceToTerm(await e.getContext(i),a))}}t.EntryHandlerKeywordId=a},44736:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryHandlerKeywordIncluded=void 0;const n=r(44459),i=r(13116);class a extends i.EntryHandlerKeyword{constructor(){super("@included")}async handle(e,t,r,i,a,o){"object"!=typeof a&&e.emitError(new n.ErrorCoded(`Found illegal @included '${a}'`,n.ERROR_CODES.INVALID_INCLUDED_VALUE));const s=await t.unaliasKeywords(a,i,o,await e.getContext(i));"@value"in s&&e.emitError(new n.ErrorCoded(`Found an illegal @included @value node '${JSON.stringify(a)}'`,n.ERROR_CODES.INVALID_INCLUDED_VALUE)),"@list"in s&&e.emitError(new n.ErrorCoded(`Found an illegal @included @list node '${JSON.stringify(a)}'`,n.ERROR_CODES.INVALID_INCLUDED_VALUE)),e.emittedStack[o]=!1}}t.EntryHandlerKeywordIncluded=a},75230:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryHandlerKeywordNest=void 0;const n=r(44459),i=r(13116);class a extends i.EntryHandlerKeyword{constructor(){super("@nest")}async handle(e,t,r,i,a,o){"object"!=typeof a&&e.emitError(new n.ErrorCoded(`Found invalid @nest entry for '${r}': '${a}'`,n.ERROR_CODES.INVALID_NEST_VALUE)),"@value"in await t.unaliasKeywords(a,i,o,await e.getContext(i))&&e.emitError(new n.ErrorCoded(`Found an invalid @value node for '${r}'`,n.ERROR_CODES.INVALID_NEST_VALUE)),e.emittedStack[o]=!1}}t.EntryHandlerKeywordNest=a},60708:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryHandlerKeywordType=void 0;const n=r(44459),i=r(67192),a=r(16410),o=r(13116);class s extends o.EntryHandlerKeyword{constructor(){super("@type")}isStackProcessor(){return!1}async handle(e,t,r,o,s,c){const u=o[c],l=await e.getContext(o),d=t.rdfType,p=await t.unaliasKeywordParent(o,c),h=i.Util.isPropertyReverse(l,u,p),f=i.Util.isPropertyInEmbeddedNode(p);t.validateReverseInEmbeddedNode(r,h,f);const y=i.Util.isPropertyInAnnotationObject(p),g=Array.isArray(s)?s:[s];for(const r of g){"string"!=typeof r&&e.emitError(new n.ErrorCoded(`Found illegal @type '${r}'`,n.ERROR_CODES.INVALID_TYPE_VALUE));const i=t.createVocabOrBaseTerm(l,r);i&&await a.EntryHandlerPredicate.handlePredicateObject(e,t,o,c,d,i,h,f,y)}let m=Promise.resolve(l),b=!1;for(const t of g.sort()){const r=i.Util.getContextValue(l,"@context",t,null);r&&(b=!0,m=m.then((t=>e.parseContext(r,t.getContextRaw()))))}!e.streamingProfile||!b&&e.streamingProfileAllowOutOfOrderPlainType||!e.processingStack[c]&&!e.idStack[c]||e.emitError(new n.ErrorCoded("Found an out-of-order type-scoped context, while streaming is enabled.(disable `streamingProfile`)",n.ERROR_CODES.INVALID_STREAMING_KEY_ORDER)),b&&(m=m.then((e=>!0!==e.getContextRaw()["@propagate"]?new n.JsonLdContextNormalized(Object.assign(Object.assign({},e.getContextRaw()),{"@propagate":!1,"@__propagateFallback":l.getContextRaw()})):e)),e.contextTree.setContext(o.slice(0,o.length-1),m)),e.processingType[c]=!0}}t.EntryHandlerKeywordType=s},79942:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryHandlerKeywordUnknownFallback=void 0;const n=r(44459);class i{isPropertyHandler(){return!1}isStackProcessor(){return!0}async validate(e,t,r,i,a){const o=await t.unaliasKeyword(r[i],r,i);return!(!n.Util.isPotentialKeyword(o)||!a&&"@list"===o)}async test(e,t,r,i,a){return n.Util.isPotentialKeyword(r)}async handle(e,t,r,a,o,s){const c=i.VALID_KEYWORDS_TYPES[r];void 0!==c?c&&typeof o!==c.type&&e.emitError(new n.ErrorCoded(`Invalid value type for '${r}' with value '${o}'`,c.errorCode)):e.strictValues&&e.emitError(new Error(`Unknown keyword '${r}' with value '${o}'`)),e.emittedStack[s]=!1}}i.VALID_KEYWORDS_TYPES={"@index":{type:"string",errorCode:n.ERROR_CODES.INVALID_INDEX_VALUE},"@list":null,"@reverse":{type:"object",errorCode:n.ERROR_CODES.INVALID_REVERSE_VALUE},"@set":null,"@value":null},t.EntryHandlerKeywordUnknownFallback=i},11443:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntryHandlerKeywordValue=void 0;const n=r(13116);class i extends n.EntryHandlerKeyword{constructor(){super("@value")}async validate(e,t,r,n,i){const a=r[n];return a&&!e.literalStack[n]&&await this.test(e,t,a,r,n)&&(e.literalStack[n]=!0),super.validate(e,t,r,n,i)}async test(e,t,r,n,i){return"@value"===await t.unaliasKeyword(n[i],n.slice(0,n.length-1),i-1,!0)}async handle(e,t,r,n,i,a){e.literalStack[a]=!0,delete e.unidentifiedValuesBuffer[a],delete e.unidentifiedGraphsBuffer[a],e.emittedStack[a]=!1}}t.EntryHandlerKeywordValue=i},55201:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SaxesParser=t.EVENTS=void 0;const n=r(31487),i=r(84797),a=r(60446);var o=n.isS,s=n.isChar,c=n.isNameStartChar,u=n.isNameChar,l=n.S_LIST,d=n.NAME_RE,p=i.isChar,h=a.isNCNameStartChar,f=a.isNCNameChar,y=a.NC_NAME_RE;const g="http://www.w3.org/XML/1998/namespace",m="http://www.w3.org/2000/xmlns/",b={__proto__:null,xml:g,xmlns:m},v={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},_=-1,w=-2,O=13,T=33,S=10,E=60,x=61,I=62,A=63,j=93,N=e=>34===e||39===e,R=[34,39],D=[...R,91,I],P=[...R,E,j],F=[x,A,...l],C=[...l,I,38,E];function M(e,t,r){switch(t){case"xml":r!==g&&e.fail(`xml prefix must be bound to ${g}.`);break;case"xmlns":r!==m&&e.fail(`xmlns prefix must be bound to ${m}.`)}switch(r){case m:e.fail(""===t?`the default namespace may not be set to ${r}.`:`may not assign a prefix (even "xmlns") to the URI ${m}.`);break;case g:switch(t){case"xml":break;case"":e.fail(`the default namespace may not be set to ${r}.`);break;default:e.fail("may not assign the xml namespace to another prefix.")}}}const L=e=>y.test(e),k=e=>d.test(e);t.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];const B={xmldecl:"xmldeclHandler",text:"textHandler",processinginstruction:"piHandler",doctype:"doctypeHandler",comment:"commentHandler",opentagstart:"openTagStartHandler",attribute:"attributeHandler",opentag:"openTagHandler",closetag:"closeTagHandler",cdata:"cdataHandler",error:"errorHandler",end:"endHandler",ready:"readyHandler"};t.SaxesParser=class{get closed(){return this._closed}constructor(e){this.opt=null!=e?e:{},this.fragmentOpt=!!this.opt.fragment;const t=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=!1!==this.opt.position,this.fileName=this.opt.fileName,t){this.nameStartCheck=h,this.nameCheck=f,this.isName=L,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},b);const e=this.opt.additionalNamespaces;null!=e&&(function(e,t){for(const r of Object.keys(t))M(e,r,t[r])}(this,e),Object.assign(this.ns,e))}else this.nameStartCheck=c,this.nameCheck=u,this.isName=k,this.processAttribs=this.processAttribsPlain,this.pushAttrib=this.pushAttribPlain;this.stateTable=[this.sBegin,this.sBeginWhitespace,this.sDoctype,this.sDoctypeQuote,this.sDTD,this.sDTDQuoted,this.sDTDOpenWaka,this.sDTDOpenWakaBang,this.sDTDComment,this.sDTDCommentEnding,this.sDTDCommentEnded,this.sDTDPI,this.sDTDPIEnding,this.sText,this.sEntity,this.sOpenWaka,this.sOpenWakaBang,this.sComment,this.sCommentEnding,this.sCommentEnded,this.sCData,this.sCDataEnding,this.sCDataEnding2,this.sPIFirstChar,this.sPIRest,this.sPIBody,this.sPIEnding,this.sXMLDeclNameStart,this.sXMLDeclName,this.sXMLDeclEq,this.sXMLDeclValueStart,this.sXMLDeclValue,this.sXMLDeclSeparator,this.sXMLDeclEnding,this.sOpenTag,this.sOpenTagSlash,this.sAttrib,this.sAttribName,this.sAttribNameSawWhite,this.sAttribValue,this.sAttribValueQuoted,this.sAttribValueClosed,this.sAttribValueUnquoted,this.sCloseTag,this.sCloseTagSawWhite],this._init()}_init(){var e;this.openWakaBang="",this.text="",this.name="",this.piTarget="",this.entity="",this.q=null,this.tags=[],this.tag=null,this.topNS=null,this.chunk="",this.chunkPosition=0,this.i=0,this.prevI=0,this.carriedFromPrevious=void 0,this.forbiddenState=0,this.attribList=[];const{fragmentOpt:t}=this;this.state=t?O:0,this.reportedTextBeforeRoot=this.reportedTextAfterRoot=this.closedRoot=this.sawRoot=t,this.xmlDeclPossible=!t,this.xmlDeclExpects=["version"],this.entityReturnState=void 0;let{defaultXMLVersion:r}=this.opt;if(void 0===r){if(!0===this.opt.forceXMLVersion)throw new Error("forceXMLVersion set but defaultXMLVersion is not set");r="1.0"}this.setXMLVersion(r),this.positionAtNewLine=0,this.doctype=!1,this._closed=!1,this.xmlDecl={version:void 0,encoding:void 0,standalone:void 0},this.line=1,this.column=0,this.ENTITIES=Object.create(v),null===(e=this.readyHandler)||void 0===e||e.call(this)}get position(){return this.chunkPosition+this.i}get columnIndex(){return this.position-this.positionAtNewLine}on(e,t){this[B[e]]=t}off(e){this[B[e]]=void 0}makeError(e){var t;let r=null!==(t=this.fileName)&&void 0!==t?t:"";return this.trackPosition&&(r.length>0&&(r+=":"),r+=`${this.line}:${this.column}`),r.length>0&&(r+=": "),new Error(r+e)}fail(e){const t=this.makeError(e),r=this.errorHandler;if(void 0===r)throw t;return r(t),this}write(e){if(this.closed)return this.fail("cannot write after close; assign an onready handler.");let t=!1;null===e?(t=!0,e=""):"object"==typeof e&&(e=e.toString()),void 0!==this.carriedFromPrevious&&(e=`${this.carriedFromPrevious}${e}`,this.carriedFromPrevious=void 0);let r=e.length;const n=e.charCodeAt(r-1);!t&&(13===n||n>=55296&&n<=56319)&&(this.carriedFromPrevious=e[r-1],r--,e=e.slice(0,r));const{stateTable:i}=this;for(this.chunk=e,this.i=0;this.i=e.length)return _;const r=e.charCodeAt(t);if(this.column++,r<55296){if(r>=32||9===r)return r;switch(r){case S:return this.line++,this.column=0,this.positionAtNewLine=this.position,S;case 13:return e.charCodeAt(t+1)===S&&(this.i=t+2),this.line++,this.column=0,this.positionAtNewLine=this.position,w;default:return this.fail("disallowed character."),r}}if(r>56319)return r>=57344&&r<=65533||this.fail("disallowed character."),r;const n=65536+1024*(r-55296)+(e.charCodeAt(t+1)-56320);return this.i=t+2,n>1114111&&this.fail("disallowed character."),n}getCode11(){const{chunk:e,i:t}=this;if(this.prevI=t,this.i=t+1,t>=e.length)return _;const r=e.charCodeAt(t);if(this.column++,r<55296){if(r>31&&r<127||r>159&&8232!==r||9===r)return r;switch(r){case S:return this.line++,this.column=0,this.positionAtNewLine=this.position,S;case 13:{const r=e.charCodeAt(t+1);r!==S&&133!==r||(this.i=t+2)}case 133:case 8232:return this.line++,this.column=0,this.positionAtNewLine=this.position,w;default:return this.fail("disallowed character."),r}}if(r>56319)return r>=57344&&r<=65533||this.fail("disallowed character."),r;const n=65536+1024*(r-55296)+(e.charCodeAt(t+1)-56320);return this.i=t+2,n>1114111&&this.fail("disallowed character."),n}getCodeNorm(){const e=this.getCode();return e===w?S:e}unget(){this.i=this.prevI,this.column--}captureTo(e){let{i:t}=this;const{chunk:r}=this;for(;;){const n=this.getCode(),i=n===w,a=i?S:n;if(a===_||e.includes(a))return this.text+=r.slice(t,this.prevI),a;i&&(this.text+=`${r.slice(t,this.prevI)}\n`,t=this.i)}}captureToChar(e){let{i:t}=this;const{chunk:r}=this;for(;;){let n=this.getCode();switch(n){case w:this.text+=`${r.slice(t,this.prevI)}\n`,t=this.i,n=S;break;case _:return this.text+=r.slice(t),!1}if(n===e)return this.text+=r.slice(t,this.prevI),!0}}captureNameChars(){const{chunk:e,i:t}=this;for(;;){const r=this.getCode();if(r===_)return this.name+=e.slice(t),_;if(!u(r))return this.name+=e.slice(t,this.prevI),r===w?S:r}}skipSpaces(){for(;;){const e=this.getCodeNorm();if(e===_||!o(e))return e}}setXMLVersion(e){this.currentXMLVersion=e,"1.0"===e?(this.isChar=s,this.getCode=this.getCode10):(this.isChar=p,this.getCode=this.getCode11)}sBegin(){65279===this.chunk.charCodeAt(0)&&(this.i++,this.column++),this.state=1}sBeginWhitespace(){const e=this.i,t=this.skipSpaces();switch(this.prevI!==e&&(this.xmlDeclPossible=!1),t){case E:if(this.state=15,0!==this.text.length)throw new Error("no-empty text at start");break;case _:break;default:this.unget(),this.state=O,this.xmlDeclPossible=!1}}sDoctype(){var e;const t=this.captureTo(D);switch(t){case I:null===(e=this.doctypeHandler)||void 0===e||e.call(this,this.text),this.text="",this.state=O,this.doctype=!0;break;case _:break;default:this.text+=String.fromCodePoint(t),91===t?this.state=4:N(t)&&(this.state=3,this.q=t)}}sDoctypeQuote(){const e=this.q;this.captureToChar(e)&&(this.text+=String.fromCodePoint(e),this.q=null,this.state=2)}sDTD(){const e=this.captureTo(P);e!==_&&(this.text+=String.fromCodePoint(e),e===j?this.state=2:e===E?this.state=6:N(e)&&(this.state=5,this.q=e))}sDTDQuoted(){const e=this.q;this.captureToChar(e)&&(this.text+=String.fromCodePoint(e),this.state=4,this.q=null)}sDTDOpenWaka(){const e=this.getCodeNorm();switch(this.text+=String.fromCodePoint(e),e){case 33:this.state=7,this.openWakaBang="";break;case A:this.state=11;break;default:this.state=4}}sDTDOpenWakaBang(){const e=String.fromCodePoint(this.getCodeNorm()),t=this.openWakaBang+=e;this.text+=e,"-"!==t&&(this.state="--"===t?8:4,this.openWakaBang="")}sDTDComment(){this.captureToChar(45)&&(this.text+="-",this.state=9)}sDTDCommentEnding(){const e=this.getCodeNorm();this.text+=String.fromCodePoint(e),this.state=45===e?10:8}sDTDCommentEnded(){const e=this.getCodeNorm();this.text+=String.fromCodePoint(e),e===I?this.state=4:(this.fail("malformed comment."),this.state=8)}sDTDPI(){this.captureToChar(A)&&(this.text+="?",this.state=12)}sDTDPIEnding(){const e=this.getCodeNorm();this.text+=String.fromCodePoint(e),e===I&&(this.state=4)}sText(){0!==this.tags.length?this.handleTextInRoot():this.handleTextOutsideRoot()}sEntity(){let{i:e}=this;const{chunk:t}=this;e:for(;;)switch(this.getCode()){case w:this.entity+=`${t.slice(e,this.prevI)}\n`,e=this.i;break;case 59:{const{entityReturnState:r}=this,n=this.entity+t.slice(e,this.prevI);let i;this.state=r,""===n?(this.fail("empty entity name."),i="&;"):(i=this.parseEntity(n),this.entity=""),r===O&&void 0===this.textHandler||(this.text+=i);break e}case _:this.entity+=t.slice(e);break e}}sOpenWaka(){const e=this.getCode();if(c(e))this.state=34,this.unget(),this.xmlDeclPossible=!1;else switch(e){case 47:this.state=43,this.xmlDeclPossible=!1;break;case 33:this.state=16,this.openWakaBang="",this.xmlDeclPossible=!1;break;case A:this.state=23;break;default:this.fail("disallowed character in tag name"),this.state=O,this.xmlDeclPossible=!1}}sOpenWakaBang(){switch(this.openWakaBang+=String.fromCodePoint(this.getCodeNorm()),this.openWakaBang){case"[CDATA[":this.sawRoot||this.reportedTextBeforeRoot||(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0),this.state=20,this.openWakaBang="";break;case"--":this.state=17,this.openWakaBang="";break;case"DOCTYPE":this.state=2,(this.doctype||this.sawRoot)&&this.fail("inappropriately located doctype declaration."),this.openWakaBang="";break;default:this.openWakaBang.length>=7&&this.fail("incorrect syntax.")}}sComment(){this.captureToChar(45)&&(this.state=18)}sCommentEnding(){var e;const t=this.getCodeNorm();45===t?(this.state=19,null===(e=this.commentHandler)||void 0===e||e.call(this,this.text),this.text=""):(this.text+=`-${String.fromCodePoint(t)}`,this.state=17)}sCommentEnded(){const e=this.getCodeNorm();e!==I?(this.fail("malformed comment."),this.text+=`--${String.fromCodePoint(e)}`,this.state=17):this.state=O}sCData(){this.captureToChar(j)&&(this.state=21)}sCDataEnding(){const e=this.getCodeNorm();e===j?this.state=22:(this.text+=`]${String.fromCodePoint(e)}`,this.state=20)}sCDataEnding2(){var e;const t=this.getCodeNorm();switch(t){case I:null===(e=this.cdataHandler)||void 0===e||e.call(this,this.text),this.text="",this.state=O;break;case j:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(t)}`,this.state=20}}sPIFirstChar(){const e=this.getCodeNorm();this.nameStartCheck(e)?(this.piTarget+=String.fromCodePoint(e),this.state=24):e===A||o(e)?(this.fail("processing instruction without a target."),this.state=e===A?26:25):(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(e),this.state=24)}sPIRest(){const{chunk:e,i:t}=this;for(;;){const r=this.getCodeNorm();if(r===_)return void(this.piTarget+=e.slice(t));if(!this.nameCheck(r)){this.piTarget+=e.slice(t,this.prevI);const n=r===A;n||o(r)?"xml"===this.piTarget?(this.xmlDeclPossible||this.fail("an XML declaration must be at the start of the document."),this.state=n?T:27):this.state=n?26:25:(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(r));break}}}sPIBody(){if(0===this.text.length){const e=this.getCodeNorm();e===A?this.state=26:o(e)||(this.text=String.fromCodePoint(e))}else this.captureToChar(A)&&(this.state=26)}sPIEnding(){var e;const t=this.getCodeNorm();if(t===I){const{piTarget:t}=this;"xml"===t.toLowerCase()&&this.fail("the XML declaration must appear at the start of the document."),null===(e=this.piHandler)||void 0===e||e.call(this,{target:t,body:this.text}),this.piTarget=this.text="",this.state=O}else t===A?this.text+="?":(this.text+=`?${String.fromCodePoint(t)}`,this.state=25);this.xmlDeclPossible=!1}sXMLDeclNameStart(){const e=this.skipSpaces();e!==A?e!==_&&(this.state=28,this.name=String.fromCodePoint(e)):this.state=T}sXMLDeclName(){const e=this.captureTo(F);if(e===A)return this.state=T,this.name+=this.text,this.text="",void this.fail("XML declaration is incomplete.");if(o(e)||e===x){if(this.name+=this.text,this.text="",!this.xmlDeclExpects.includes(this.name))switch(this.name.length){case 0:this.fail("did not expect any more name/value pairs.");break;case 1:this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);break;default:this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`)}this.state=e===x?30:29}}sXMLDeclEq(){const e=this.getCodeNorm();if(e===A)return this.state=T,void this.fail("XML declaration is incomplete.");o(e)||(e!==x&&this.fail("value required."),this.state=30)}sXMLDeclValueStart(){const e=this.getCodeNorm();if(e===A)return this.state=T,void this.fail("XML declaration is incomplete.");o(e)||(N(e)?this.q=e:(this.fail("value must be quoted."),this.q=32),this.state=31)}sXMLDeclValue(){const e=this.captureTo([this.q,A]);if(e===A)return this.state=T,this.text="",void this.fail("XML declaration is incomplete.");if(e===_)return;const t=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];const e=t;this.xmlDecl.version=e,/^1\.[0-9]+$/.test(e)?this.opt.forceXMLVersion||this.setXMLVersion(e):this.fail("version number must match /^1\\.[0-9]+$/.");break}case"encoding":/^[A-Za-z][A-Za-z0-9._-]*$/.test(t)||this.fail("encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/."),this.xmlDeclExpects=["standalone"],this.xmlDecl.encoding=t;break;case"standalone":"yes"!==t&&"no"!==t&&this.fail('standalone value must match "yes" or "no".'),this.xmlDeclExpects=[],this.xmlDecl.standalone=t}this.name="",this.state=32}sXMLDeclSeparator(){const e=this.getCodeNorm();e!==A?(o(e)||(this.fail("whitespace required."),this.unget()),this.state=27):this.state=T}sXMLDeclEnding(){var e;this.getCodeNorm()===I?("xml"!==this.piTarget?this.fail("processing instructions are not allowed before root."):"version"!==this.name&&this.xmlDeclExpects.includes("version")&&this.fail("XML declaration must contain a version."),null===(e=this.xmldeclHandler)||void 0===e||e.call(this,this.xmlDecl),this.name="",this.piTarget=this.text="",this.state=O):this.fail("The character ? is disallowed anywhere in XML declarations."),this.xmlDeclPossible=!1}sOpenTag(){var e;const t=this.captureNameChars();if(t===_)return;const r=this.tag={name:this.name,attributes:Object.create(null)};switch(this.name="",this.xmlnsOpt&&(this.topNS=r.ns=Object.create(null)),null===(e=this.openTagStartHandler)||void 0===e||e.call(this,r),this.sawRoot=!0,!this.fragmentOpt&&this.closedRoot&&this.fail("documents may contain only one root."),t){case I:this.openTag();break;case 47:this.state=35;break;default:o(t)||this.fail("disallowed character in tag name."),this.state=36}}sOpenTagSlash(){this.getCode()===I?this.openSelfClosingTag():(this.fail("forward-slash in opening tag not followed by >."),this.state=36)}sAttrib(){const e=this.skipSpaces();e!==_&&(c(e)?(this.unget(),this.state=37):e===I?this.openTag():47===e?this.state=35:this.fail("disallowed character in attribute name."))}sAttribName(){const e=this.captureNameChars();e===x?this.state=39:o(e)?this.state=38:e===I?(this.fail("attribute without value."),this.pushAttrib(this.name,this.name),this.name=this.text="",this.openTag()):e!==_&&this.fail("disallowed character in attribute name.")}sAttribNameSawWhite(){const e=this.skipSpaces();switch(e){case _:return;case x:this.state=39;break;default:this.fail("attribute without value."),this.text="",this.name="",e===I?this.openTag():c(e)?(this.unget(),this.state=37):(this.fail("disallowed character in attribute name."),this.state=36)}}sAttribValue(){const e=this.getCodeNorm();N(e)?(this.q=e,this.state=40):o(e)||(this.fail("unquoted attribute value."),this.state=42,this.unget())}sAttribValueQuoted(){const{q:e,chunk:t}=this;let{i:r}=this;for(;;)switch(this.getCode()){case e:return this.pushAttrib(this.name,this.text+t.slice(r,this.prevI)),this.name=this.text="",this.q=null,void(this.state=41);case 38:return this.text+=t.slice(r,this.prevI),this.state=14,void(this.entityReturnState=40);case S:case w:case 9:this.text+=`${t.slice(r,this.prevI)} `,r=this.i;break;case E:return this.text+=t.slice(r,this.prevI),void this.fail("disallowed character.");case _:return void(this.text+=t.slice(r))}}sAttribValueClosed(){const e=this.getCodeNorm();o(e)?this.state=36:e===I?this.openTag():47===e?this.state=35:c(e)?(this.fail("no whitespace between attributes."),this.unget(),this.state=37):this.fail("disallowed character in attribute name.")}sAttribValueUnquoted(){const e=this.captureTo(C);switch(e){case 38:this.state=14,this.entityReturnState=42;break;case E:this.fail("disallowed character.");break;case _:break;default:this.text.includes("]]>")&&this.fail('the string "]]>" is disallowed in char data.'),this.pushAttrib(this.name,this.text),this.name=this.text="",e===I?this.openTag():this.state=36}}sCloseTag(){const e=this.captureNameChars();e===I?this.closeTag():o(e)?this.state=44:e!==_&&this.fail("disallowed character in closing tag.")}sCloseTagSawWhite(){switch(this.skipSpaces()){case I:this.closeTag();break;case _:break;default:this.fail("disallowed character in closing tag.")}}handleTextInRoot(){let{i:e,forbiddenState:t}=this;const{chunk:r,textHandler:n}=this;e:for(;;)switch(this.getCode()){case E:if(this.state=15,void 0!==n){const{text:t}=this,i=r.slice(e,this.prevI);0!==t.length?(n(t+i),this.text=""):0!==i.length&&n(i)}t=0;break e;case 38:this.state=14,this.entityReturnState=O,void 0!==n&&(this.text+=r.slice(e,this.prevI)),t=0;break e;case j:switch(t){case 0:t=1;break;case 1:t=2;break;case 2:break;default:throw new Error("impossible state")}break;case I:2===t&&this.fail('the string "]]>" is disallowed in char data.'),t=0;break;case w:void 0!==n&&(this.text+=`${r.slice(e,this.prevI)}\n`),e=this.i,t=0;break;case _:void 0!==n&&(this.text+=r.slice(e));break e;default:t=0}this.forbiddenState=t}handleTextOutsideRoot(){let{i:e}=this;const{chunk:t,textHandler:r}=this;let n=!1;e:for(;;){const i=this.getCode();switch(i){case E:if(this.state=15,void 0!==r){const{text:n}=this,i=t.slice(e,this.prevI);0!==n.length?(r(n+i),this.text=""):0!==i.length&&r(i)}break e;case 38:this.state=14,this.entityReturnState=O,void 0!==r&&(this.text+=t.slice(e,this.prevI)),n=!0;break e;case w:void 0!==r&&(this.text+=`${t.slice(e,this.prevI)}\n`),e=this.i;break;case _:void 0!==r&&(this.text+=t.slice(e));break e;default:o(i)||(n=!0)}}n&&(this.sawRoot||this.reportedTextBeforeRoot||(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0))}pushAttribNS(e,t){var r;const{prefix:n,local:i}=this.qname(e),a={name:e,prefix:n,local:i,value:t};if(this.attribList.push(a),null===(r=this.attributeHandler)||void 0===r||r.call(this,a),"xmlns"===n){const e=t.trim();"1.0"===this.currentXMLVersion&&""===e&&this.fail("invalid attempt to undefine prefix in XML 1.0"),this.topNS[i]=e,M(this,i,e)}else if("xmlns"===e){const e=t.trim();this.topNS[""]=e,M(this,"",e)}}pushAttribPlain(e,t){var r;const n={name:e,value:t};this.attribList.push(n),null===(r=this.attributeHandler)||void 0===r||r.call(this,n)}end(){var e,t;this.sawRoot||this.fail("document must contain a root element.");const{tags:r}=this;for(;r.length>0;){const e=r.pop();this.fail(`unclosed tag: ${e.name}`)}0!==this.state&&this.state!==O&&this.fail("unexpected end.");const{text:n}=this;return 0!==n.length&&(null===(e=this.textHandler)||void 0===e||e.call(this,n),this.text=""),this._closed=!0,null===(t=this.endHandler)||void 0===t||t.call(this),this._init(),this}resolve(e){var t,r;let n=this.topNS[e];if(void 0!==n)return n;const{tags:i}=this;for(let t=i.length-1;t>=0;t--)if(n=i[t].ns[e],void 0!==n)return n;return n=this.ns[e],void 0!==n?n:null===(r=(t=this.opt).resolvePrefix)||void 0===r?void 0:r.call(t,e)}qname(e){const t=e.indexOf(":");if(-1===t)return{prefix:"",local:e};const r=e.slice(t+1),n=e.slice(0,t);return(""===n||""===r||r.includes(":"))&&this.fail(`malformed name: ${e}.`),{prefix:n,local:r}}processAttribsNS(){var e;const{attribList:t}=this,r=this.tag;{const{prefix:t,local:n}=this.qname(r.name);r.prefix=t,r.local=n;const i=r.uri=null!==(e=this.resolve(t))&&void 0!==e?e:"";""!==t&&("xmlns"===t&&this.fail('tags may not have "xmlns" as prefix.'),""===i&&(this.fail(`unbound namespace prefix: ${JSON.stringify(t)}.`),r.uri=t))}if(0===t.length)return;const{attributes:n}=r,i=new Set;for(const e of t){const{name:t,prefix:r,local:a}=e;let o,s;""===r?(o="xmlns"===t?m:"",s=t):(o=this.resolve(r),void 0===o&&(this.fail(`unbound namespace prefix: ${JSON.stringify(r)}.`),o=r),s=`{${o}}${a}`),i.has(s)&&this.fail(`duplicate attribute: ${s}.`),i.add(s),e.uri=o,n[t]=e}this.attribList=[]}processAttribsPlain(){const{attribList:e}=this,t=this.tag.attributes;for(const{name:r,value:n}of e)void 0!==t[r]&&this.fail(`duplicate attribute: ${r}.`),t[r]=n;this.attribList=[]}openTag(){var e;this.processAttribs();const{tags:t}=this,r=this.tag;r.isSelfClosing=!1,null===(e=this.openTagHandler)||void 0===e||e.call(this,r),t.push(r),this.state=O,this.name=""}openSelfClosingTag(){var e,t,r;this.processAttribs();const{tags:n}=this,i=this.tag;i.isSelfClosing=!0,null===(e=this.openTagHandler)||void 0===e||e.call(this,i),null===(t=this.closeTagHandler)||void 0===t||t.call(this,i),null===(this.tag=null!==(r=n[n.length-1])&&void 0!==r?r:null)&&(this.closedRoot=!0),this.state=O,this.name=""}closeTag(){const{tags:e,name:t}=this;if(this.state=O,this.name="",""===t)return this.fail("weird empty close tag."),void(this.text+="");const r=this.closeTagHandler;let n=e.length;for(;n-- >0;){const n=this.tag=e.pop();if(this.topNS=n.ns,null==r||r(n),n.name===t)break;this.fail("unexpected close tag.")}0===n?this.closedRoot=!0:n<0&&(this.fail(`unmatched closing tag: ${t}.`),this.text+=``)}parseEntity(e){if("#"!==e[0]){const t=this.ENTITIES[e];return void 0!==t?t:(this.fail(this.isName(e)?"undefined entity.":"disallowed character in entity name."),`&${e};`)}let t=NaN;return"x"===e[1]&&/^#x[0-9a-f]+$/i.test(e)?t=parseInt(e.slice(2),16):/^#[0-9]+$/.test(e)&&(t=parseInt(e.slice(1),10)),this.isChar(t)?String.fromCodePoint(t):(this.fail("malformed character entity."),`&${e};`)}}},25568:e=>{"use strict";const{AbortController:t,AbortSignal:r}="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;e.exports=t,e.exports.AbortSignal=r,e.exports.default=t},87435:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=[];return r=e.on("data",(e=>t.push(e))),n=t,new Promise(((e,t)=>{r.on("end",(()=>e(n))),r.on("error",t)}));var r,n}},25579:(e,t,r)=>{const n=r(2044),i=r(4518),a=r(12391),o=r(23111),s=r(32106);e.exports={DynamicNestedLoopJoin:n,HashJoin:i,NestedLoopJoin:a,SymmetricHashJoin:o,MergeStream:s}},2044:(e,t,r)=>{let n=r(75627),i=n.MultiTransformIterator,a=n.SimpleTransformIterator;e.exports=class extends i{constructor(e,t,r,n){super(e,n),this.funRight=t,this.funJoin=r}_createTransformer(e){return new a(this.funRight(e),{transform:(t,r,n)=>{let i=this.funJoin(e,t);null!==i&&n(i),r()}})}}},4518:(e,t,r)=>{let n=r(75627).AsyncIterator;e.exports=class extends n{constructor(e,t,r,n){super(),this.addedDataListener=!1,this.left=e,this.right=t,this.funHash=r,this.funJoin=n,this.leftMap=new Map,this.match=null,this.matches=[],this.matchIdx=0,this.left.on("error",(e=>this.destroy(e))),this.right.on("error",(e=>this.destroy(e))),this.readable=!1,this.left.on("end",function(){this.readable=!0,this.right.on("readable",(()=>this.readable=!0)),this.right.on("end",(()=>{this.hasResults()||this._end()}))}.bind(this)),this.on("newListener",(e=>{"data"===e&&this._addDataListenerIfNeeded()})),this.left.readable&&this._addDataListenerIfNeeded(),this.left.on("readable",(()=>this._addDataListenerIfNeeded()))}hasResults(){return!this.right.ended||this.matchIdx{const{MultiTransformIterator:n,SimpleTransformIterator:i,scheduleTask:a}=r(75627);e.exports=class extends n{constructor(e,t,r,n){super(e,n),this.right=t,this.funJoin=r,this.on("end",(()=>this.right.close()))}_end(){super._end(),a((()=>this.right.destroy()))}_createTransformer(e){return new i(this.right.clone(),{transform:(t,r,n)=>{let i=this.funJoin(e,t);null!==i&&n(i),r()}})}}},23111:(e,t,r)=>{let n=r(75627).AsyncIterator;e.exports=class extends n{constructor(e,t,r,n){super(),this.left=e,this.right=t,this.funHash=r,this.funJoin=n,this.usedLeft=!1,this.leftMap=new Map,this.rightMap=new Map,this.on("end",(()=>this._cleanup())),this.match=null,this.matches=[],this.matchIdx=0,(this.left.readable||this.right.readable)&&(this.readable=!0),this.left.on("error",(e=>this.destroy(e))),this.right.on("error",(e=>this.destroy(e))),this.left.on("readable",(()=>this.readable=!0)),this.right.on("readable",(()=>this.readable=!0)),this.left.on("end",(()=>{this.hasResults()||this._end()})),this.right.on("end",(()=>{this.hasResults()||this._end()}))}hasResults(){return!this.left.ended||!this.right.ended||!!this.matches&&this.matchIdx{let n=r(75627).AsyncIterator;e.exports=class extends n{constructor(e){super(),Array.isArray(e)||(e=Array.prototype.slice.call(arguments)),this.streams=e;for(let t of e)t.on("readable",(()=>this.emit("readable"))),t.on("end",(()=>this._removeStream(t)));0===this.streams.length&&this.close(),this.idx=this.streams.length-1}_removeStream(e){let t=this.streams.indexOf(e);t<0||(this.streams.splice(t,1),this.idx>=this.streams.length&&--this.idx,0===this.streams.length&&this._end())}close(){super.close();for(let e of this.streams)e.close()}read(){for(let e=0;e{"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,a=s(e),o=a[0],c=a[1],u=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,c)),l=0,d=c>0?o-4:o;for(r=0;r>16&255,u[l++]=t>>8&255,u[l++]=255&t;return 2===c&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[l++]=255&t),1===c&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=16383,s=0,u=n-i;su?u:s+o));return 1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),a.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=a[o],n[a.charCodeAt(o)]=o;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var i,a,o=[],s=t;s>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},61594:function(e,t,r){var n;!function(){"use strict";var i,a=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,o=Math.ceil,s=Math.floor,c="[BigNumber Error] ",u=c+"Number primitive has more than 15 significant digits: ",l=1e14,d=14,p=9007199254740991,h=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],f=1e7,y=1e9;function g(e){var t=0|e;return e>0||e===t?t:t-1}function m(e){for(var t,r,n=1,i=e.length,a=e[0]+"";nu^r?1:-1;for(s=(c=i.length)<(u=a.length)?c:u,o=0;oa[o]^r?1:-1;return c==u?0:c>u^r?1:-1}function v(e,t,r,n){if(er||e!==s(e))throw Error(c+(n||"Argument")+("number"==typeof e?er?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function _(e){var t=e.c.length-1;return g(e.e/d)==t&&e.c[t]%2!=0}function w(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function O(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else tL?m.c=m.e=null:e.e=10;h/=10,l++);return void(l>L?m.c=m.e=null:(m.e=l,m.c=[e]))}g=String(e)}else{if(!a.test(g=String(e)))return i(m,g,f);m.s=45==g.charCodeAt(0)?(g=g.slice(1),-1):1}(l=g.indexOf("."))>-1&&(g=g.replace(".","")),(h=g.search(/e/i))>0?(l<0&&(l=h),l+=+g.slice(h+1),g=g.substring(0,h)):l<0&&(l=g.length)}else{if(v(t,2,$.length,"Base"),10==t&&q)return K(m=new Q(e),D+m.e+1,P);if(g=String(e),f="number"==typeof e){if(0*e!=0)return i(m,g,f,t);if(m.s=1/e<0?(g=g.slice(1),-1):1,Q.DEBUG&&g.replace(/^0\.0*|\./,"").length>15)throw Error(u+e)}else m.s=45===g.charCodeAt(0)?(g=g.slice(1),-1):1;for(r=$.slice(0,t),l=h=0,y=g.length;hl){l=y;continue}}else if(!c&&(g==g.toUpperCase()&&(g=g.toLowerCase())||g==g.toLowerCase()&&(g=g.toUpperCase()))){c=!0,h=-1,l=0;continue}return i(m,String(e),f,t)}f=!1,(l=(g=n(g,t,10,m.s)).indexOf("."))>-1?g=g.replace(".",""):l=g.length}for(h=0;48===g.charCodeAt(h);h++);for(y=g.length;48===g.charCodeAt(--y););if(g=g.slice(h,++y)){if(y-=h,f&&Q.DEBUG&&y>15&&(e>p||e!==s(e)))throw Error(u+m.s*e);if((l=l-h-1)>L)m.c=m.e=null;else if(l=C)?w(c,o):O(c,o,"0");else if(a=(e=K(new Q(e),t,r)).e,s=(c=m(e.c)).length,1==n||2==n&&(t<=a||a<=F)){for(;ss){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=a-s)>0)for(a+1==s&&(c+=".");t--;c+="0");return e.s<0&&i?"-"+c:c}function z(e,t){for(var r,n,i=1,a=new Q(e[0]);i=10;i/=10,n++);return(r=n+r*d-1)>L?e.c=e.e=null:r=10;u/=10,i++);if((a=t-i)<0)a+=d,c=t,p=g[f=0],y=s(p/m[i-c-1]%10);else if((f=o((a+1)/d))>=g.length){if(!n)break e;for(;g.length<=f;g.push(0));p=y=0,i=1,c=(a%=d)-d+1}else{for(p=u=g[f],i=1;u>=10;u/=10,i++);y=(c=(a%=d)-d+i)<0?0:s(p/m[i-c-1]%10)}if(n=n||t<0||null!=g[f+1]||(c<0?p:p%m[i-c-1]),n=r<4?(y||n)&&(0==r||r==(e.s<0?3:2)):y>5||5==y&&(4==r||n||6==r&&(a>0?c>0?p/m[i-c]:0:g[f-1])%10&1||r==(e.s<0?8:7)),t<1||!g[0])return g.length=0,n?(t-=e.e+1,g[0]=m[(d-t%d)%d],e.e=-t||0):g[0]=e.e=0,e;if(0==a?(g.length=f,u=1,f--):(g.length=f+1,u=m[d-a],g[f]=c>0?s(p/m[i-c]%m[c])*u:0),n)for(;;){if(0==f){for(a=1,c=g[0];c>=10;c/=10,a++);for(c=g[0]+=u,u=1;c>=10;c/=10,u++);a!=u&&(e.e++,g[0]==l&&(g[0]=1));break}if(g[f]+=u,g[f]!=l)break;g[f--]=0,u=1}for(a=g.length;0===g[--a];g.pop());}e.e>L?e.c=e.e=null:e.e=C?w(t,r):O(t,r,"0"),e.s<0?"-"+t:t)}return Q.clone=e,Q.ROUND_UP=0,Q.ROUND_DOWN=1,Q.ROUND_CEIL=2,Q.ROUND_FLOOR=3,Q.ROUND_HALF_UP=4,Q.ROUND_HALF_DOWN=5,Q.ROUND_HALF_EVEN=6,Q.ROUND_HALF_CEIL=7,Q.ROUND_HALF_FLOOR=8,Q.EUCLID=9,Q.config=Q.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(c+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(v(r=e[t],0,y,t),D=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(v(r=e[t],0,8,t),P=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(v(r[0],-y,0,t),v(r[1],0,y,t),F=r[0],C=r[1]):(v(r,-y,y,t),F=-(C=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)v(r[0],-y,-1,t),v(r[1],1,y,t),M=r[0],L=r[1];else{if(v(r,-y,y,t),!r)throw Error(c+t+" cannot be zero: "+r);M=-(L=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(c+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw k=!r,Error(c+"crypto unavailable");k=r}else k=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(v(r=e[t],0,9,t),B=r),e.hasOwnProperty(t="POW_PRECISION")&&(v(r=e[t],0,y,t),U=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(c+t+" not an object: "+r);V=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(c+t+" invalid: "+r);q="0123456789"==r.slice(0,10),$=r}}return{DECIMAL_PLACES:D,ROUNDING_MODE:P,EXPONENTIAL_AT:[F,C],RANGE:[M,L],CRYPTO:k,MODULO_MODE:B,POW_PRECISION:U,FORMAT:V,ALPHABET:$}},Q.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!Q.DEBUG)return!0;var t,r,n=e.c,i=e.e,a=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===a||-1===a)&&i>=-y&&i<=y&&i===s(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%d)<1&&(t+=d),String(n[0]).length==t){for(t=0;t=l||r!==s(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===a||1===a||-1===a))return!0;throw Error(c+"Invalid BigNumber: "+e)},Q.maximum=Q.max=function(){return z(arguments,-1)},Q.minimum=Q.min=function(){return z(arguments,1)},Q.random=(T=9007199254740992,S=Math.random()*T&2097151?function(){return s(Math.random()*T)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,a,u=0,l=[],p=new Q(R);if(null==e?e=D:v(e,0,y),i=o(e/d),k)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));u>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[u]=r[0],t[u+1]=r[1]):(l.push(a%1e14),u+=2);u=i/2}else{if(!crypto.randomBytes)throw k=!1,Error(c+"crypto unavailable");for(t=crypto.randomBytes(i*=7);u=9e15?crypto.randomBytes(7).copy(t,u):(l.push(a%1e14),u+=7);u=i/7}if(!k)for(;u=10;a/=10,u++);ur-1&&(null==o[i+1]&&(o[i+1]=0),o[i+1]+=o[i]/r|0,o[i]%=r)}return o.reverse()}return function(n,i,a,o,s){var c,u,l,d,p,h,f,y,g=n.indexOf("."),b=D,v=P;for(g>=0&&(d=U,U=0,n=n.replace(".",""),h=(y=new Q(i)).pow(n.length-g),U=d,y.c=t(O(m(h.c),h.e,"0"),10,a,e),y.e=y.c.length),l=d=(f=t(n,i,a,s?(c=$,e):(c=e,$))).length;0==f[--d];f.pop());if(!f[0])return c.charAt(0);if(g<0?--l:(h.c=f,h.e=l,h.s=o,f=(h=r(h,y,b,v,a)).c,p=h.r,l=h.e),g=f[u=l+b+1],d=a/2,p=p||u<0||null!=f[u+1],p=v<4?(null!=g||p)&&(0==v||v==(h.s<0?3:2)):g>d||g==d&&(4==v||p||6==v&&1&f[u-1]||v==(h.s<0?8:7)),u<1||!f[0])n=p?O(c.charAt(1),-b,c.charAt(0)):c.charAt(0);else{if(f.length=u,p)for(--a;++f[--u]>a;)f[u]=0,u||(++l,f=[1].concat(f));for(d=f.length;!f[--d];);for(g=0,n="";g<=d;n+=c.charAt(f[g++]));n=O(n,l,c.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,i,a,o,s=0,c=e.length,u=t%f,l=t/f|0;for(e=e.slice();c--;)s=((i=u*(a=e[c]%f)+(n=l*a+(o=e[c]/f|0)*u)%f*f+s)/r|0)+(n/f|0)+l*o,e[c]=i%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var i,a;if(r!=n)a=r>n?1:-1;else for(i=a=0;it[i]?1:-1;break}return a}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]1;e.splice(0,1));}return function(n,i,a,o,c){var u,p,h,f,y,m,b,v,_,w,O,T,S,E,x,I,A,j=n.s==i.s?1:-1,N=n.c,R=i.c;if(!(N&&N[0]&&R&&R[0]))return new Q(n.s&&i.s&&(N?!R||N[0]!=R[0]:R)?N&&0==N[0]||!R?0*j:j/0:NaN);for(_=(v=new Q(j)).c=[],j=a+(p=n.e-i.e)+1,c||(c=l,p=g(n.e/d)-g(i.e/d),j=j/d|0),h=0;R[h]==(N[h]||0);h++);if(R[h]>(N[h]||0)&&p--,j<0)_.push(1),f=!0;else{for(E=N.length,I=R.length,h=0,j+=2,(y=s(c/(R[0]+1)))>1&&(R=e(R,y,c),N=e(N,y,c),I=R.length,E=N.length),S=I,O=(w=N.slice(0,I)).length;O=c/2&&x++;do{if(y=0,(u=t(R,w,I,O))<0){if(T=w[0],I!=O&&(T=T*c+(w[1]||0)),(y=s(T/x))>1)for(y>=c&&(y=c-1),b=(m=e(R,y,c)).length,O=w.length;1==t(m,w,b,O);)y--,r(m,I=10;j/=10,h++);K(v,a+(v.e=h+p*d-1)+1,o,f)}else v.e=p,v.r=+f;return v}}(),E=/^(-?)0([xbo])(?=\w[\w.]*$)/i,x=/^([^.]+)\.$/,I=/^\.([^.]+)$/,A=/^-?(Infinity|NaN)$/,j=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,a=r?t:t.replace(j,"");if(A.test(a))e.s=isNaN(a)?null:a<0?-1:1;else{if(!r&&(a=a.replace(E,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,a=a.replace(x,"$1").replace(I,"0.$1")),t!=a))return new Q(a,i);if(Q.DEBUG)throw Error(c+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},N.absoluteValue=N.abs=function(){var e=new Q(this);return e.s<0&&(e.s=1),e},N.comparedTo=function(e,t){return b(this,new Q(e,t))},N.decimalPlaces=N.dp=function(e,t){var r,n,i,a=this;if(null!=e)return v(e,0,y),null==t?t=P:v(t,0,8),K(new Q(a),e+a.e+1,t);if(!(r=a.c))return null;if(n=((i=r.length-1)-g(this.e/d))*d,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},N.dividedBy=N.div=function(e,t){return r(this,new Q(e,t),D,P)},N.dividedToIntegerBy=N.idiv=function(e,t){return r(this,new Q(e,t),0,1)},N.exponentiatedBy=N.pow=function(e,t){var r,n,i,a,u,l,p,h,f=this;if((e=new Q(e)).c&&!e.isInteger())throw Error(c+"Exponent not an integer: "+X(e));if(null!=t&&(t=new Q(t)),u=e.e>14,!f.c||!f.c[0]||1==f.c[0]&&!f.e&&1==f.c.length||!e.c||!e.c[0])return h=new Q(Math.pow(+X(f),u?e.s*(2-_(e)):+X(e))),t?h.mod(t):h;if(l=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new Q(NaN);(n=!l&&f.isInteger()&&t.isInteger())&&(f=f.mod(t))}else{if(e.e>9&&(f.e>0||f.e<-1||(0==f.e?f.c[0]>1||u&&f.c[1]>=24e7:f.c[0]<8e13||u&&f.c[0]<=9999975e7)))return a=f.s<0&&_(e)?-0:0,f.e>-1&&(a=1/a),new Q(l?1/a:a);U&&(a=o(U/d+2))}for(u?(r=new Q(.5),l&&(e.s=1),p=_(e)):p=(i=Math.abs(+X(e)))%2,h=new Q(R);;){if(p){if(!(h=h.times(f)).c)break;a?h.c.length>a&&(h.c.length=a):n&&(h=h.mod(t))}if(i){if(0===(i=s(i/2)))break;p=i%2}else if(K(e=e.times(r),e.e+1,1),e.e>14)p=_(e);else{if(0==(i=+X(e)))break;p=i%2}f=f.times(f),a?f.c&&f.c.length>a&&(f.c.length=a):n&&(f=f.mod(t))}return n?h:(l&&(h=R.div(h)),t?h.mod(t):a?K(h,U,P,void 0):h)},N.integerValue=function(e){var t=new Q(this);return null==e?e=P:v(e,0,8),K(t,t.e+1,e)},N.isEqualTo=N.eq=function(e,t){return 0===b(this,new Q(e,t))},N.isFinite=function(){return!!this.c},N.isGreaterThan=N.gt=function(e,t){return b(this,new Q(e,t))>0},N.isGreaterThanOrEqualTo=N.gte=function(e,t){return 1===(t=b(this,new Q(e,t)))||0===t},N.isInteger=function(){return!!this.c&&g(this.e/d)>this.c.length-2},N.isLessThan=N.lt=function(e,t){return b(this,new Q(e,t))<0},N.isLessThanOrEqualTo=N.lte=function(e,t){return-1===(t=b(this,new Q(e,t)))||0===t},N.isNaN=function(){return!this.s},N.isNegative=function(){return this.s<0},N.isPositive=function(){return this.s>0},N.isZero=function(){return!!this.c&&0==this.c[0]},N.minus=function(e,t){var r,n,i,a,o=this,s=o.s;if(t=(e=new Q(e,t)).s,!s||!t)return new Q(NaN);if(s!=t)return e.s=-t,o.plus(e);var c=o.e/d,u=e.e/d,p=o.c,h=e.c;if(!c||!u){if(!p||!h)return p?(e.s=-t,e):new Q(h?o:NaN);if(!p[0]||!h[0])return h[0]?(e.s=-t,e):new Q(p[0]?o:3==P?-0:0)}if(c=g(c),u=g(u),p=p.slice(),s=c-u){for((a=s<0)?(s=-s,i=p):(u=c,i=h),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(n=(a=(s=p.length)<(t=h.length))?s:t,s=t=0;t0)for(;t--;p[r++]=0);for(t=l-1;n>s;){if(p[--n]=0;){for(r=0,y=T[i]%_,m=T[i]/_|0,a=i+(o=c);a>i;)r=((u=y*(u=O[--o]%_)+(s=m*u+(p=O[o]/_|0)*y)%_*_+b[a]+r)/v|0)+(s/_|0)+m*p,b[a--]=u%v;b[a]=r}return r?++n:b.splice(0,1),H(e,b,n)},N.negated=function(){var e=new Q(this);return e.s=-e.s||null,e},N.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new Q(e,t)).s,!i||!t)return new Q(NaN);if(i!=t)return e.s=-t,n.minus(e);var a=n.e/d,o=e.e/d,s=n.c,c=e.c;if(!a||!o){if(!s||!c)return new Q(i/0);if(!s[0]||!c[0])return c[0]?e:new Q(s[0]?n:0*i)}if(a=g(a),o=g(o),s=s.slice(),i=a-o){for(i>0?(o=a,r=c):(i=-i,r=s),r.reverse();i--;r.push(0));r.reverse()}for((i=s.length)-(t=c.length)<0&&(r=c,c=s,s=r,t=i),i=0;t;)i=(s[--t]=s[t]+c[t]+i)/l|0,s[t]=l===s[t]?0:s[t]%l;return i&&(s=[i].concat(s),++o),H(e,s,o)},N.precision=N.sd=function(e,t){var r,n,i,a=this;if(null!=e&&e!==!!e)return v(e,1,y),null==t?t=P:v(t,0,8),K(new Q(a),e,t);if(!(r=a.c))return null;if(n=(i=r.length-1)*d+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&a.e+1>n&&(n=a.e+1),n},N.shiftedBy=function(e){return v(e,-9007199254740991,p),this.times("1e"+e)},N.squareRoot=N.sqrt=function(){var e,t,n,i,a,o=this,s=o.c,c=o.s,u=o.e,l=D+4,d=new Q("0.5");if(1!==c||!s||!s[0])return new Q(!c||c<0&&(!s||s[0])?NaN:s?o:1/0);if(0==(c=Math.sqrt(+X(o)))||c==1/0?(((t=m(s)).length+u)%2==0&&(t+="0"),c=Math.sqrt(+t),u=g((u+1)/2)-(u<0||u%2),n=new Q(t=c==1/0?"5e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):n=new Q(c+""),n.c[0])for((c=(u=n.e)+l)<3&&(c=0);;)if(a=n,n=d.times(a.plus(r(o,a,l,1))),m(a.c).slice(0,c)===(t=m(n.c)).slice(0,c)){if(n.e0&&y>0){for(a=y%s||s,d=f.substr(0,a);a0&&(d+=l+f.slice(a)),h&&(d="-"+d)}n=p?d+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?p.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):p):d}return(r.prefix||"")+n+(r.suffix||"")},N.toFraction=function(e){var t,n,i,a,o,s,u,l,p,f,y,g,b=this,v=b.c;if(null!=e&&(!(u=new Q(e)).isInteger()&&(u.c||1!==u.s)||u.lt(R)))throw Error(c+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+X(u));if(!v)return new Q(b);for(t=new Q(R),p=n=new Q(R),i=l=new Q(R),g=m(v),o=t.e=g.length-b.e-1,t.c[0]=h[(s=o%d)<0?d+s:s],e=!e||u.comparedTo(t)>0?o>0?t:p:u,s=L,L=1/0,u=new Q(g),l.c[0]=0;f=r(u,t,0,1),1!=(a=n.plus(f.times(i))).comparedTo(e);)n=i,i=a,p=l.plus(f.times(a=p)),l=a,t=u.minus(f.times(a=t)),u=a;return a=r(e.minus(n),i,0,1),l=l.plus(a.times(p)),n=n.plus(a.times(i)),l.s=p.s=b.s,y=r(p,i,o*=2,P).minus(b).abs().comparedTo(r(l,n,o,P).minus(b).abs())<1?[p,i]:[l,n],L=s,y},N.toNumber=function(){return+X(this)},N.toPrecision=function(e,t){return null!=e&&v(e,1,y),G(this,e,t,2)},N.toString=function(e){var t,r=this,i=r.s,a=r.e;return null===a?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=a<=F||a>=C?w(m(r.c),a):O(m(r.c),a,"0"):10===e&&q?t=O(m((r=K(new Q(r),D+a+1,P)).c),r.e,"0"):(v(e,2,$.length,"Base"),t=n(O(m(r.c),a,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},N.valueOf=N.toJSON=function(){return X(this)},N._isBigNumber=!0,null!=t&&Q.set(t),Q}(),i.default=i.BigNumber=i,void 0===(n=function(){return i}.call(t,r,t,e))||(e.exports=n)}()},48287:(e,t,r)=>{"use strict";const n=r(67526),i=r(251),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.SlowBuffer=function(e){return+e!=e&&(e=0),c.alloc(+e)},t.INSPECT_MAX_BYTES=50;const o=2147483647;function s(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=s(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(X(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return p(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(X(e,ArrayBuffer)||e&&X(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(X(e,SharedArrayBuffer)||e&&X(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const i=function(e){if(c.isBuffer(e)){const t=0|f(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||J(e.length)?s(0):p(e):"Buffer"===e.type&&Array.isArray(e.data)?p(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return l(e),s(e<0?0:0|f(e))}function p(e){const t=e.length<0?0:0|f(e.length),r=s(t);for(let n=0;n=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function y(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||X(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(e).length;default:if(i)return n?-1:z(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return N(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return A(this,t,r);case"latin1":case"binary":return j(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),J(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){let a,o=1,s=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,c/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){let n=-1;for(a=r;as&&(r=s-c),a=r;a>=0;a--){let r=!0;for(let n=0;ni&&(n=i):n=i;const a=t.length;let o;for(n>a/2&&(n=a/2),o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function E(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i239?4:t>223?3:t>191?2:1;if(i+o<=r){let r,n,s,c;switch(o){case 1:t<128&&(a=t);break;case 2:r=e[i+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(a=c));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(c=(15&t)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:r=e[i+1],n=e[i+2],s=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,c>65535&&c<1114112&&(a=c))}}null===a?(a=65533,o=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=o}return function(e){const t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},c.byteLength=y,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tr&&(e+=" ... "),""},a&&(c.prototype[a]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,i){if(X(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0);const s=Math.min(a,o),u=this.slice(n,i),l=e.slice(t,r);for(let e=0;e>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":case"latin1":case"binary":return O(this,e,t,r);case"base64":return T(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const I=4096;function A(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;in)&&(r=n);let i="";for(let n=t;nr)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,r,n,i,a){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function F(e,t,r,n,i){$(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function C(e,t,r,n,i){$(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r+7]=a,a>>=8,e[r+6]=a,a>>=8,e[r+5]=a,a>>=8,e[r+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function M(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,n,a){return t=+t,r>>>=0,a||M(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function k(e,t,r,n,a){return t=+t,r>>>=0,a||M(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||D(e,t,this.length);let n=this[e],i=1,a=0;for(;++a>>=0,t>>>=0,r||D(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=Y((function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Q(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Q(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<>>=0,t>>>=0,r||D(e,t,this.length);let n=this[e],i=1,a=0;for(;++a=i&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);let n=t,i=1,a=this[e+--n];for(;n>0&&(i*=256);)a+=this[e+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a},c.prototype.readInt8=function(e,t){return e>>>=0,t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||D(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||D(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=Y((function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Q(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Q(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<>>=0,t||D(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||D(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||D(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||D(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||P(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,a=0;for(this[t]=255&e;++a>>=0,r>>>=0,n||P(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=Y((function(e,t=0){return F(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=Y((function(e,t=0){return C(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);P(this,e,t,r,n-1,-n)}let i=0,a=1,o=0;for(this[t]=255&e;++i>>=0,!n){const n=Math.pow(2,8*r-1);P(this,e,t,r,n-1,-n)}let i=r-1,a=1,o=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/a|0)-o&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=Y((function(e,t=0){return F(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=Y((function(e,t=0){return C(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function $(e,t,r,n,i,a){if(e>r||e3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(a+1)}${n}`:`>= -(2${n} ** ${8*(a+1)-1}${n}) and < 2 ** ${8*(a+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new B.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){q(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||Q(t,e.length-(r+1))}(n,i,a)}function q(e,t){if("number"!=typeof e)throw new B.ERR_INVALID_ARG_TYPE(t,"number",e)}function Q(e,t,r){if(Math.floor(e)!==e)throw q(e,r),new B.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}U("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),U("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),U("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=V(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=V(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const G=/[^+/0-9A-Za-z-_]/g;function z(e,t){let r;t=t||1/0;const n=e.length;let i=null;const a=[];for(let o=0;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function H(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,r,n){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function X(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const W=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Y(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},82341: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,r,n)=>t+(0===n?"":",")+e(void 0===r||"symbol"==typeof r?null:r)),"")+"]":"{"+Object.keys(t).sort().reduce(((r,n,i)=>void 0===t[n]||"symbol"==typeof t[n]?r:r+(0===r.length?"":",")+e(n)+":"+e(t[n])),"")+"}"}},74945:function(e,t){var r="undefined"!=typeof self?self:this,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),a="FormData"in e,o="ArrayBuffer"in e;if(o)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function u(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function d(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function p(e){this.map={},e instanceof p?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function h(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function f(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function y(e){var t=new FileReader,r=f(t);return t.readAsArrayBuffer(e),r}function g(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:a&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():o&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o&&(ArrayBuffer.prototype.isPrototypeOf(e)||c(e))?this._bodyArrayBuffer=g(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=h(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(y)}),this.text=function(){var e,t,r,n=h(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=f(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function _(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function w(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new p(t.headers),this.url=t.url||"",this._initBody(e)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},m.call(v.prototype),m.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:0,statusText:""});return e.type="error",e};var O=[301,302,303,307,308];w.redirect=function(e,t){if(-1===O.indexOf(t))throw new RangeError("Invalid status code");return new w(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function T(e,r){return new Promise((function(n,a){var o=new v(e,r);if(o.signal&&o.signal.aborted)return a(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function c(){s.abort()}s.onload=function(){var e,t,r={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new p,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;n(new w(i,r))},s.onerror=function(){a(new TypeError("Network request failed"))},s.ontimeout=function(){a(new TypeError("Network request failed"))},s.onabort=function(){a(new t.DOMException("Aborted","AbortError"))},s.open(o.method,o.url,!0),"include"===o.credentials?s.withCredentials=!0:"omit"===o.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),o.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),o.signal&&(o.signal.addEventListener("abort",c),s.onreadystatechange=function(){4===s.readyState&&o.signal.removeEventListener("abort",c)}),s.send(void 0===o._bodyInit?null:o._bodyInit)}))}T.polyfill=!0,e.fetch||(e.fetch=T,e.Headers=p,e.Request=v,e.Response=w),t.Headers=p,t.Request=v,t.Response=w,t.fetch=T,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},66486:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.promisifyEventEmitter=void 0,t.promisifyEventEmitter=function(e,t){return new Promise(((r,n)=>{e.on("end",(()=>r(t))),e.on("error",n)}))}},37007:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,a),n(r)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}y(e,t,a,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&y(e,"error",t,{once:!0})}(e,i)}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var o=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function u(e,t,r,n){var i,a,o,u;if(s(r),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),o=a[t]),void 0===o)o=a[t]=r,++e._eventsCount;else if("function"==typeof o?o=a[t]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(i=c(e))>0&&o.length>i&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,u=l,console&&console.warn&&console.warn(u)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var c=a[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var u=c.length,l=f(c,u);for(r=0;r=0;a--)if(r[a]===t||r[a].listener===t){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},a.prototype.listeners=function(e){return p(this,e,!0)},a.prototype.rawListeners=function(e){return p(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},a.prototype.listenerCount=h,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},29252:e=>{"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,i,a;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(!e(t[i],r[i]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(i of t.entries())if(!r.has(i[0]))return!1;for(i of t.entries())if(!e(i[1],r.get(i[0])))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(i of t.entries())if(!r.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(r)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(t[i]!==r[i])return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(a=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,a[i]))return!1;for(i=n;0!=i--;){var o=a[i];if(!e(t[o],r[o]))return!1}return!0}return t!=t&&r!=r}},92603:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(59636),t)},59636:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SparqlEndpointFetcher=void 0;const i=r(31232),a=r(82773),o=r(65806),s=r(98082),c=r(916),u=r(75295),l=r(43789);class d{constructor(e){var t,r,n;this.method=null!==(t=null==e?void 0:e.method)&&void 0!==t?t:"POST",this.timeout=null==e?void 0:e.timeout,this.additionalUrlParams=null!==(r=null==e?void 0:e.additionalUrlParams)&&void 0!==r?r:new URLSearchParams,this.defaultHeaders=null!==(n=null==e?void 0:e.defaultHeaders)&&void 0!==n?n:new Headers,this.fetchCb=null==e?void 0:e.fetch,this.sparqlJsonParser=new c.SparqlJsonParser(e),this.sparqlXmlParser=new u.SparqlXmlParser(e),this.sparqlParsers={[d.CONTENTTYPE_SPARQL_JSON]:{parseBooleanStream:e=>this.sparqlJsonParser.parseJsonBooleanStream(e),parseResultsStream:e=>this.sparqlJsonParser.parseJsonResultsStream(e)},[d.CONTENTTYPE_SPARQL_XML]:{parseBooleanStream:e=>this.sparqlXmlParser.parseXmlBooleanStream(e),parseResultsStream:e=>this.sparqlXmlParser.parseXmlResultsStream(e)}}}getQueryType(e){const t=new s.Parser({sparqlStar:!0}).parse(e);return"query"===t.type?"DESCRIBE"===t.queryType?"CONSTRUCT":t.queryType:"UNKNOWN"}getUpdateTypes(e){const t=new s.Parser({sparqlStar:!0}).parse(e);if("update"===t.type){const e={};for(const r of t.updates)"type"in r?e[r.type]=!0:e[r.updateType]=!0;return e}return"UNKNOWN"}fetchBindings(e,t){return n(this,void 0,void 0,(function*(){const[r,n]=yield this.fetchRawStream(e,t,d.CONTENTTYPE_SPARQL),i=this.sparqlParsers[r];if(!i)throw new Error(`Unknown SPARQL results content type: ${r}`);return i.parseResultsStream(n)}))}fetchAsk(e,t){return n(this,void 0,void 0,(function*(){const[r,n]=yield this.fetchRawStream(e,t,d.CONTENTTYPE_SPARQL),i=this.sparqlParsers[r];if(!i)throw new Error(`Unknown SPARQL results content type: ${r}`);return i.parseBooleanStream(n)}))}fetchTriples(e,t){return n(this,void 0,void 0,(function*(){const[r,n]=yield this.fetchRawStream(e,t,d.CONTENTTYPE_TURTLE);return n.pipe(new a.StreamParser({format:r}))}))}fetchUpdate(e,t){return n(this,void 0,void 0,(function*(){const r=new AbortController,n={};this.defaultHeaders.forEach(((e,t)=>{n[t]=e}));const i={method:"POST",headers:Object.assign(Object.assign({},n),{"content-type":"application/sparql-update"}),body:t,signal:r.signal};yield this.handleFetchCall(e,i,{ignoreBody:!0}),r.abort()}))}fetchRawStream(e,t,r){return n(this,void 0,void 0,(function*(){let n,i="POST"===this.method?e:`${e}?query=${encodeURIComponent(t)}`;const a=new Headers(this.defaultHeaders);if(a.append("Accept",r),"POST"===this.method){a.append("Content-Type","application/x-www-form-urlencoded"),n=new URLSearchParams,n.set("query",t);for(const[e,t]of this.additionalUrlParams.entries())n.set(e,t);a.append("Content-Length",n.toString().length.toString())}else this.additionalUrlParams.toString().length>0&&(i+=`&${this.additionalUrlParams.toString()}`);return this.handleFetchCall(i,{headers:a,method:this.method,body:n})}))}handleFetchCall(e,t,r){return n(this,void 0,void 0,(function*(){var n,a,s;let c,u;if(this.timeout){const e=new AbortController;t.signal=e.signal,c=setTimeout((()=>e.abort()),this.timeout)}const d=yield(null!==(n=this.fetchCb)&&void 0!==n?n:fetch)(e,t);if(clearTimeout(c),!(null==r?void 0:r.ignoreBody)&&d.body&&(u=i(d.body)?d.body:(0,o.readableFromWeb)(d.body)),!d.ok||!u&&!(null==r?void 0:r.ignoreBody)){const t=e.split("?").at(0),r=u?yield l(u):"empty response";throw new Error(`Invalid SPARQL endpoint response from ${t} (HTTP status ${d.status}):\n${r}`)}return[null!==(s=null===(a=d.headers.get("Content-Type"))||void 0===a?void 0:a.split(";").at(0))&&void 0!==s?s:"",u]}))}}t.SparqlEndpointFetcher=d,d.CONTENTTYPE_SPARQL_JSON="application/sparql-results+json",d.CONTENTTYPE_SPARQL_XML="application/sparql-results+xml",d.CONTENTTYPE_TURTLE="text/turtle",d.CONTENTTYPE_SPARQL=`${d.CONTENTTYPE_SPARQL_JSON};q=1.0,${d.CONTENTTYPE_SPARQL_XML};q=0.7`},33826:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(70297),t),i(r(3062),t),i(r(65183),t),i(r(91475),t),i(r(97480),t)},3062:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Converter=void 0;const i=r(80425),a=r(70297),o=r(2307),s=r(65183),c=r(97480);class u{constructor(e){(e=e||{}).variableDelimiter=e.variableDelimiter||"_",e.expressionVariableCounter=e.expressionVariableCounter||0,this.util=new c.Util(e),this.initializeNodeHandlers(e)}static registerNodeHandlers(e,t){e.registerNodeHandler(new a.NodeHandlerDocument(e,t)),e.registerNodeHandler(new a.NodeHandlerDefinitionOperation(e,t)),e.registerNodeHandler(new a.NodeHandlerDefinitionFragment(e,t)),e.registerNodeHandler(new a.NodeHandlerSelectionFragmentSpread(e,t)),e.registerNodeHandler(new a.NodeHandlerSelectionInlineFragment(e,t)),e.registerNodeHandler(new a.NodeHandlerSelectionField(e,t))}static registerNodeValueHandlers(e,t){e.registerNodeValueHandler(new a.NodeValueHandlerVariable(e,t)),e.registerNodeValueHandler(new a.NodeValueHandlerInt(e,t)),e.registerNodeValueHandler(new a.NodeValueHandlerFloat(e,t)),e.registerNodeValueHandler(new a.NodeValueHandlerString(e,t)),e.registerNodeValueHandler(new a.NodeValueHandlerBoolean(e,t)),e.registerNodeValueHandler(new a.NodeValueHandlerNull(e,t)),e.registerNodeValueHandler(new a.NodeValueHandlerEnum(e,t)),e.registerNodeValueHandler(new a.NodeValueHandlerList(e,t)),e.registerNodeValueHandler(new a.NodeValueHandlerObject(e,t))}static registerDirectiveNodeHandlers(e,t){e.registerDirectiveNodeHandler(new o.DirectiveNodeHandlerInclude(e,t)),e.registerDirectiveNodeHandler(new o.DirectiveNodeHandlerOptional(e,t)),e.registerDirectiveNodeHandler(new o.DirectiveNodeHandlerPlural(e,t)),e.registerDirectiveNodeHandler(new o.DirectiveNodeHandlerSingle(e,t)),e.registerDirectiveNodeHandler(new o.DirectiveNodeHandlerSkip(e,t))}graphqlToSparqlAlgebra(e,t,r){return n(this,void 0,void 0,(function*(){return this.graphqlToSparqlAlgebraRawContext(e,yield this.util.contextParser.parse(t),r)}))}graphqlToSparqlAlgebraRawContext(e,t,r){r=r||{};const n="string"==typeof e?(0,i.parse)(e):e,a={context:t,fragmentDefinitions:this.indexFragments(n),graph:this.util.dataFactory.defaultGraph(),path:[],singularizeState:s.SingularizeState.PLURAL,singularizeVariables:r.singularizeVariables||{},subject:null,terminalVariables:[],variablesDict:r.variablesDict||{},variablesMetaDict:{}};return this.util.handleNode(n,a)}indexFragments(e){const t={},r=[];for(const n of e.definitions)"FragmentDefinition"===n.kind?t[n.name.value]=n:r.push(n);return e.definitions=r,t}initializeNodeHandlers(e){u.registerNodeHandlers(this.util,e),u.registerNodeValueHandlers(this.util,e),u.registerDirectiveNodeHandlers(this.util,e)}}t.Converter=u},65183:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SingularizeState=void 0,(r=t.SingularizeState||(t.SingularizeState={}))[r.SINGLE=0]="SINGLE",r[r.PLURAL=1]="PLURAL"},91475:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},97480:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Util=void 0;const n=r(47793),i=r(61082),a=r(96331);t.Util=class{constructor(e){this.nodeHandlers={},this.nodeValueHandlers={},this.directiveNodeHandlers={},this.settings=e,this.dataFactory=e.dataFactory||new n.DataFactory,this.operationFactory=new a.Factory(this.dataFactory),this.contextParser=new i.ContextParser}registerNodeHandler(e){this.nodeHandlers[e.targetKind]=e}registerNodeValueHandler(e){this.nodeValueHandlers[e.targetKind]=e}registerDirectiveNodeHandler(e){this.directiveNodeHandlers[e.targetKind]=e}handleNode(e,t){const r=this.nodeHandlers[e.kind];if(!r)throw new Error(`Unsupported GraphQL node '${e.kind}'`);return r.handle(e,t)}handleNodeValue(e,t,r){const n=this.nodeValueHandlers[e.kind];if(!n)throw new Error(`Unsupported GraphQL value node '${e.kind}'`);return n.handle(e,t,r)}handleDirectiveNode(e,t){const r=this.directiveNodeHandlers[e.directive.name.value];return r?r.handle(e,t):null}joinOperations(e){if(1===e.length)return e[0];const t=[],r=[];for(const n of e)"bgp"===n.type?t.push(n):r.push(n);if(t.length===e.length)return this.joinOperationsAsBgp(t);if(t.length===e.length-1&&"leftjoin"===r[0].type&&"bgp"===r[0].input[0].type){const e=r[0];return t.push(e.input[0]),this.operationFactory.createLeftJoin(this.joinOperationsAsBgp(t),e.input[1])}return r.length===e.length?this.joinOperationsAsNestedJoin(r):this.joinOperationsAsNestedJoin([this.joinOperationsAsBgp(t),this.joinOperationsAsNestedJoin(r)])}joinOperationsAsBgp(e){return this.operationFactory.createBgp([].concat.apply([],e.map((e=>e.patterns))))}joinOperationsAsNestedJoin(e){return this.operationFactory.createJoin(e)}appendFieldToPath(e,t){return e.concat([t])}getFieldLabel(e){return(e.alias?e.alias:e.name).value}nameToVariable(e,t){return this.dataFactory.variable((t.path.length?t.path.join(this.settings.variableDelimiter)+this.settings.variableDelimiter:"")+e)}valueToNamedNode(e,t){const r=t.expandTerm(e,!0);if(this.settings.requireContext&&!r)throw new Error("No context entry was found for "+e);return this.dataFactory.namedNode(r||e)}getArgument(e,t){if(e)for(const r of e)if(r.name.value===t)return r}newTypePattern(e,t,r){return this.operationFactory.createPattern(e,this.dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.valueToNamedNode(t.name.value,r.context),r.graph)}createQuadPattern(e,t,r,n,i){const a=this.valueToNamedNode(t.value,i);return i&&i.getContextRaw()[t.value]&&i.getContextRaw()[t.value]["@reverse"]?this.operationFactory.createPattern(r,a,e,n):this.operationFactory.createPattern(e,a,r,n)}createQuadPath(e,t,r,n,i,a){const o=this.valueToNamedNode(t.value,a);let s=this.operationFactory.createLink(o);for(const e of r.values){if("EnumValue"!==e.kind)throw new Error("Invalid value type for 'alt' argument, must be EnumValue, but got "+e.kind);s=this.operationFactory.createAlt([s,this.operationFactory.createLink(this.valueToNamedNode(e.value,a))])}return a&&a.getContextRaw()[t.value]&&a.getContextRaw()[t.value]["@reverse"]?this.operationFactory.createPath(n,s,e,i):this.operationFactory.createPath(e,s,n,i)}}},75566:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeHandlerAdapter=void 0,t.NodeHandlerAdapter=class{constructor(e,t,r){this.targetKind=e,this.util=t,this.settings=r}getNodeQuadContextSelectionSet(e,t,r){const n={};if(e)for(const t of e.selections)if("Field"===t.kind){const e=t;this.handleNodeQuadContextField(e,r,n,"id","subject"),this.handleNodeQuadContextField(e,r,n,"graph","graph")}return n}handleNodeQuadContextField(e,t,r,n,i){if(!r[i]&&e.name.value===n){if(!r[i]){const a=this.util.getArgument(e.arguments,"_");if(a){const o=this.util.handleNodeValue(a.value,e.name.value,t);if(1!==o.terms.length)throw new Error(`Only single values can be set as ${n}, but got ${o.terms.length} at ${e.name.value}`);r[i]=o.terms[0],o.auxiliaryPatterns&&(r.auxiliaryPatterns||(r.auxiliaryPatterns=[]),r.auxiliaryPatterns.concat(o.auxiliaryPatterns))}}if(!r[i]){const n=this.util.nameToVariable(this.util.getFieldLabel(e),t);t.terminalVariables.push(n),r[i]=n}}}getDirectiveOutputs(e,t,r){const n=[];if(e)for(const i of e){const e=this.util.handleDirectiveNode({directive:i,fieldLabel:t},r);if(e){if(e.ignore)return null;n.push(e)}}return n}handleDirectiveOutputs(e,t){for(const r of e){if(r.ignore)return this.util.operationFactory.createBgp([]);r.operationOverrider&&(t=r.operationOverrider(t))}return t}}},66337:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeHandlerDefinitionAdapter=void 0;const n=r(75566);class i extends n.NodeHandlerAdapter{constructor(e,t,r){super(e,t,r)}}t.NodeHandlerDefinitionAdapter=i},13260:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeHandlerDefinitionFragment=void 0;const n=r(66337);class i extends n.NodeHandlerDefinitionAdapter{constructor(e,t){super("FragmentDefinition",e,t)}handle(e,t){throw new Error("Illegal state: fragment definitions must be indexed and removed before processing")}}t.NodeHandlerDefinitionFragment=i},91891:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeHandlerDefinitionOperation=void 0;const n=r(66337);class i extends n.NodeHandlerDefinitionAdapter{constructor(e,t){super("OperationDefinition",e,t)}handle(e,t){if("query"!==e.operation)throw new Error("Unsupported definition operation: "+e.operation);if(e.variableDefinitions)for(const r of e.variableDefinitions){const e=r.variable.name.value;r.defaultValue&&(t.variablesDict[e]||(t.variablesDict[e]=r.defaultValue));let n=r.type;const i="NonNullType"===n.kind;i&&(n=n.type);const a="ListType"===n.kind;a&&(n=n.type);const o=n.name.value;t.variablesMetaDict[e]={mandatory:i,list:a,type:o}}const r=this.getDirectiveOutputs(e.directives,e.name?e.name.value:"",t);if(!r)return this.util.operationFactory.createBgp([]);const n=this.util.joinOperations(e.selectionSet.selections.map((e=>this.util.handleNode(e,t))));return this.handleDirectiveOutputs(r,n)}}t.NodeHandlerDefinitionOperation=i},98960:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeHandlerDocument=void 0;const n=r(96331),i=r(75566);class a extends i.NodeHandlerAdapter{constructor(e,t){super("Document",e,t)}handle(e,t){const r=e.definitions.map((e=>{const r=this.getNodeQuadContextDefinitionNode(e,Object.assign(Object.assign({},t),{ignoreUnknownVariables:!0})),n=Object.assign(Object.assign({},t),{graph:r.graph||t.graph,subject:r.subject||this.util.dataFactory.blankNode()});let i=this.util.handleNode(e,n);return r&&r.auxiliaryPatterns&&(i=this.util.joinOperations([i,this.util.operationFactory.createBgp(r.auxiliaryPatterns)])),i})),n=this.util.operationFactory.createProject(1===r.length?r[0]:this.util.operationFactory.createUnion(r),t.terminalVariables);return this.translateBlankNodesToVariables(n)}getNodeQuadContextDefinitionNode(e,t){if("OperationDefinition"===e.kind)return this.getNodeQuadContextSelectionSet(e.selectionSet,e.name?e.name.value:"",t);throw new Error(`Unsupported definition: ${e.kind}`)}translateBlankNodesToVariables(e){const t=this,r={},i=Array.from(e.variables).reduce(((e,t)=>(e[t.value]=!0,e)),{});return n.Util.mapOperation(e,{path:(e,t)=>({recurse:!1,result:t.createPath(a(e.subject),e.predicate,a(e.object),a(e.graph))}),pattern:(e,t)=>({recurse:!1,result:t.createPattern(a(e.subject),a(e.predicate),a(e.object),a(e.graph))})});function a(e){if("BlankNode"===e.termType){let a=r[e.value];return a||(a=n.Util.createUniqueVariable(e.value,i,t.util.dataFactory),i[a.value]=!0,r[e.value]=a),a}return e}}}t.NodeHandlerDocument=a},53284:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeHandlerSelectionAdapter=void 0;const n=r(96331),i=r(65183),a=r(75566);class o extends a.NodeHandlerAdapter{constructor(e,t,r){super(e,t,r)}getNodeQuadContextFieldNode(e,t,r){return this.getNodeQuadContextSelectionSet(e.selectionSet,t,Object.assign(Object.assign({},r),{path:this.util.appendFieldToPath(r.path,t)}))}fieldToOperation(e,t,r,a){const o=r;let s,c=0;if(("id"===t.name.value||"graph"===t.name.value)&&(r=!1,t.arguments))for(const r of t.arguments)"_"===r.name.value&&this.util.handleNodeValue(r.value,t.name.value,e);const u=this.util.getFieldLabel(t);if(e.singularizeState===i.SingularizeState.SINGLE&&(e.singularizeVariables[this.util.nameToVariable(u,e).value]=!0),r){const t=this.handleMetaField(e,u,a);if(t)return t}const l=a?[this.util.operationFactory.createBgp(a)]:[],d=this.getNodeQuadContextFieldNode(t,u,e);let p=d.subject||this.util.nameToVariable(u,e),h=d.graph||e.graph;d.auxiliaryPatterns&&l.push(this.util.operationFactory.createBgp(d.auxiliaryPatterns));let f=!0,y=null;if(r&&t.arguments&&t.arguments.length)for(const n of t.arguments){if("_"===n.name.value){const i=this.util.handleNodeValue(n.value,t.name.value,e);y=i.terms,l.push(this.util.operationFactory.createBgp(i.terms.map((r=>this.util.createQuadPattern(e.subject,t.name,r,e.graph,e.context))))),i.auxiliaryPatterns&&l.push(this.util.operationFactory.createBgp(i.auxiliaryPatterns)),r=!1;break}if("graph"===n.name.value){const r=this.util.handleNodeValue(n.value,t.name.value,e);if(1!==r.terms.length)throw new Error(`Only single values can be set as graph, but got ${r.terms.length} at ${t.name.value}`);h=r.terms[0],e=Object.assign(Object.assign({},e),{graph:h}),r.auxiliaryPatterns&&l.push(this.util.operationFactory.createBgp(r.auxiliaryPatterns));break}if("alt"===n.name.value){let r=n.value;"ListValue"!==r.kind&&(r={kind:"ListValue",values:[r]}),l.push(this.util.createQuadPath(e.subject,t.name,r,p,e.graph,e.context)),f=!1;break}}if(r&&f&&l.push(this.util.operationFactory.createBgp([this.util.createQuadPattern(e.subject,t.name,p,e.graph,e.context)])),t.arguments&&t.arguments.length)for(const r of t.arguments)if("_"===r.name.value||"graph"===r.name.value||"alt"===r.name.value);else if("first"===r.name.value){if("IntValue"!==r.value.kind)throw new Error("Invalid value type for 'first' argument: "+r.value.kind);s=parseInt(r.value.value,10)}else if("offset"===r.name.value){if("IntValue"!==r.value.kind)throw new Error("Invalid value type for 'offset' argument: "+r.value.kind);c=parseInt(r.value.value,10)}else{const t=this.util.handleNodeValue(r.value,r.name.value,e);l.push(this.util.operationFactory.createBgp(t.terms.map((t=>this.util.createQuadPattern(p,r.name,t,e.graph,e.context))))),t.auxiliaryPatterns&&l.push(this.util.operationFactory.createBgp(t.auxiliaryPatterns))}const g=this.getDirectiveOutputs(t.directives,u,e);if(!g)return this.util.operationFactory.createBgp([]);let m=this.util.joinOperations(l);if(t.selectionSet&&t.selectionSet.selections.length){if(y){if(1!==y.length)throw new Error(`Only single values can be set as id, but got ${y.length} at ${t.name.value}`);p=y[0]}const r=Object.assign(Object.assign(Object.assign({},e),o?{path:this.util.appendFieldToPath(e.path,u)}:{}),{graph:h,subject:o?p:e.subject});let n=!1;const i=t.selectionSet.selections.filter((e=>"Field"!==e.kind||"totalCount"!==e.name.value||(n=!0,!1)));let a=this.util.joinOperations(l.concat(i.map((e=>this.util.handleNode(e,r)))));if(n){const t=this.util.dataFactory.variable("var"+this.settings.expressionVariableCounter++),r=this.util.dataFactory.variable(p.value+this.settings.variableDelimiter+"totalCount"),n=this.util.operationFactory.createBoundAggregate(t,"count",this.util.operationFactory.createTermExpression(p),!1),o=this.util.operationFactory.createProject(this.util.operationFactory.createExtend(this.util.operationFactory.createGroup(m,[],[n]),r,this.util.operationFactory.createTermExpression(t)),[r]);e.terminalVariables.push(r),a=i.length?this.util.operationFactory.createJoin([this.util.operationFactory.createProject(a,[]),o]):o}m=a}else r&&"Variable"===p.termType&&e.terminalVariables.push(p);return(c||s)&&(m=this.util.operationFactory.createSlice(this.util.operationFactory.createProject(m,n.Util.inScopeVariables(m)),c,s)),this.handleDirectiveOutputs(g,m)}handleMetaField(e,t,r){if("__typename"===t){const n=this.util.nameToVariable(t,e);return e.terminalVariables.push(n),this.util.operationFactory.createBgp([this.util.operationFactory.createPattern(e.subject,this.util.dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.util.nameToVariable(t,e),e.graph)].concat(r||[]))}}}t.NodeHandlerSelectionAdapter=o},89275:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeHandlerSelectionField=void 0;const n=r(53284);class i extends n.NodeHandlerSelectionAdapter{constructor(e,t){super("Field",e,t)}handle(e,t){return this.fieldToOperation(t,e,!0)}}t.NodeHandlerSelectionField=i},16332:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeHandlerSelectionFragmentSpread=void 0;const n=r(53284);class i extends n.NodeHandlerSelectionAdapter{constructor(e,t){super("FragmentSpread",e,t)}handle(e,t){const r=t.fragmentDefinitions[e.name.value];if(!r)throw new Error("Undefined fragment definition: "+e.name.value);const n={alias:void 0,arguments:void 0,directives:r.directives,kind:"Field",name:e.name,selectionSet:r.selectionSet},i=[this.util.newTypePattern(t.subject,r.typeCondition,t)];return this.util.operationFactory.createLeftJoin(this.util.operationFactory.createBgp([]),this.fieldToOperation(t,n,!1,i))}}t.NodeHandlerSelectionFragmentSpread=i},29638:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeHandlerSelectionInlineFragment=void 0;const n=r(53284);class i extends n.NodeHandlerSelectionAdapter{constructor(e,t){super("InlineFragment",e,t)}handle(e,t){const r={alias:void 0,arguments:void 0,directives:e.directives,kind:"Field",name:{kind:"Name",value:t.subject.value},selectionSet:e.selectionSet},n=e.typeCondition?[this.util.newTypePattern(t.subject,e.typeCondition,t)]:[];return this.util.operationFactory.createLeftJoin(this.util.operationFactory.createBgp([]),this.fieldToOperation(t,r,!1,n))}}t.NodeHandlerSelectionInlineFragment=i},67797:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DirectiveNodeHandlerAdapter=void 0,t.DirectiveNodeHandlerAdapter=class{constructor(e,t,r){this.targetKind=e,this.util=t,this.settings=r}getDirectiveConditionalValue(e,t){const r=this.util.getArgument(e.arguments,"if");if(!r)throw new Error(`The directive ${e.name.value} is missing an if-argument.`);const n=this.util.handleNodeValue(r.value,r.name.value,t);if(1!==n.terms.length)throw new Error(`Can not apply the directive ${e.name.value} with a list.`);return n.terms[0]}isDirectiveScopeAll(e){const t=this.util.getArgument(e.arguments,"scope");return t&&"EnumValue"===t.value.kind&&"all"===t.value.value}}},85506:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DirectiveNodeHandlerInclude=void 0;const n=r(67797);class i extends n.DirectiveNodeHandlerAdapter{constructor(e,t){super("include",e,t)}handle(e,t){const r=this.getDirectiveConditionalValue(e.directive,t);return"Literal"===r.termType&&"false"===r.value?{ignore:!0}:{}}}t.DirectiveNodeHandlerInclude=i},53992:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DirectiveNodeHandlerOptional=void 0;const n=r(67797);class i extends n.DirectiveNodeHandlerAdapter{constructor(e,t){super("optional",e,t)}handle(e,t){return{operationOverrider:e=>this.util.operationFactory.createLeftJoin(this.util.operationFactory.createBgp([]),e)}}}t.DirectiveNodeHandlerOptional=i},95570:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DirectiveNodeHandlerPlural=void 0;const n=r(65183),i=r(67797);class a extends i.DirectiveNodeHandlerAdapter{constructor(e,t){super("plural",e,t)}handle(e,t){return this.isDirectiveScopeAll(e.directive)&&(t.singularizeState=n.SingularizeState.PLURAL),delete t.singularizeVariables[this.util.nameToVariable(e.fieldLabel,t).value],{}}}t.DirectiveNodeHandlerPlural=a},15064:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DirectiveNodeHandlerSingle=void 0;const n=r(65183),i=r(67797);class a extends i.DirectiveNodeHandlerAdapter{constructor(e,t){super("single",e,t)}handle(e,t){return this.isDirectiveScopeAll(e.directive)&&(t.singularizeState=n.SingularizeState.SINGLE),t.singularizeVariables[this.util.nameToVariable(e.fieldLabel,t).value]=!0,{}}}t.DirectiveNodeHandlerSingle=a},30879:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DirectiveNodeHandlerSkip=void 0;const n=r(67797);class i extends n.DirectiveNodeHandlerAdapter{constructor(e,t){super("skip",e,t)}handle(e,t){const r=this.getDirectiveConditionalValue(e.directive,t);return"Literal"===r.termType&&"true"===r.value?{ignore:!0}:{}}}t.DirectiveNodeHandlerSkip=i},2307:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(67797),t),i(r(85506),t),i(r(53992),t),i(r(95570),t),i(r(15064),t),i(r(30879),t)},70297:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(2307),t),i(r(4391),t),i(r(75566),t),i(r(66337),t),i(r(13260),t),i(r(91891),t),i(r(98960),t),i(r(53284),t),i(r(89275),t),i(r(16332),t),i(r(29638),t)},55009:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValueHandlerAdapter=void 0,t.NodeValueHandlerAdapter=class{constructor(e,t,r){this.targetKind=e,this.util=t,this.settings=r}}},22910:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValueHandlerBoolean=void 0;const n=r(55009);class i extends n.NodeValueHandlerAdapter{constructor(e,t){super("BooleanValue",e,t),this.datatype=this.util.dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#boolean")}handle(e,t,r){return{terms:[this.util.dataFactory.literal(e.value?"true":"false",this.datatype)]}}}t.NodeValueHandlerBoolean=i},67057:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValueHandlerEnum=void 0;const n=r(55009);class i extends n.NodeValueHandlerAdapter{constructor(e,t){super("EnumValue",e,t)}handle(e,t,r){return{terms:[this.util.valueToNamedNode(e.value,r.context)]}}}t.NodeValueHandlerEnum=i},968:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValueHandlerFloat=void 0;const n=r(55009);class i extends n.NodeValueHandlerAdapter{constructor(e,t){super("FloatValue",e,t),this.datatype=this.util.dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#float")}handle(e,t,r){return{terms:[this.util.dataFactory.literal(e.value,this.datatype)]}}}t.NodeValueHandlerFloat=i},1463:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValueHandlerInt=void 0;const n=r(55009);class i extends n.NodeValueHandlerAdapter{constructor(e,t){super("IntValue",e,t),this.datatype=this.util.dataFactory.namedNode("http://www.w3.org/2001/XMLSchema#integer")}handle(e,t,r){return{terms:[this.util.dataFactory.literal(e.value,this.datatype)]}}}t.NodeValueHandlerInt=i},57044:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValueHandlerList=void 0;const n=r(55009);class i extends n.NodeValueHandlerAdapter{constructor(e,t){super("ListValue",e,t),this.nodeFirst=this.util.dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#first"),this.nodeRest=this.util.dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"),this.nodeNil=this.util.dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil")}handle(e,t,r){const n=[];let i=[];for(const a of e.values){const e=this.util.handleNodeValue(a,t,r);for(const t of e.terms)n.push(t);e.auxiliaryPatterns&&(i=i.concat(e.auxiliaryPatterns))}if(this.settings.arraysToRdfLists){const e=this.util.dataFactory.blankNode();let t=e,a=n.length;for(const e of n){i.push(this.util.operationFactory.createPattern(t,this.nodeFirst,e,r.graph));const n=0==--a?this.nodeNil:this.util.dataFactory.blankNode();i.push(this.util.operationFactory.createPattern(t,this.nodeRest,n,r.graph)),t=n}return{terms:[e],auxiliaryPatterns:i}}return{terms:n,auxiliaryPatterns:i}}}t.NodeValueHandlerList=i},13381:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValueHandlerNull=void 0;const n=r(55009);class i extends n.NodeValueHandlerAdapter{constructor(e,t){super("NullValue",e,t),this.nil=this.util.dataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil")}handle(e,t,r){return{terms:[this.nil]}}}t.NodeValueHandlerNull=i},89339:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValueHandlerObject=void 0;const n=r(55009);class i extends n.NodeValueHandlerAdapter{constructor(e,t){super("ObjectValue",e,t)}handle(e,t,r){const n=this.util.dataFactory.blankNode();let i=[];for(const a of e.fields){const e=this.util.handleNodeValue(a.value,t,r);for(const t of e.terms)i.push(this.util.createQuadPattern(n,a.name,t,r.graph,r.context));e.auxiliaryPatterns&&(i=i.concat(e.auxiliaryPatterns))}return{terms:[n],auxiliaryPatterns:i}}}t.NodeValueHandlerObject=i},86085:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValueHandlerString=void 0;const n=r(55009);class i extends n.NodeValueHandlerAdapter{constructor(e,t){super("StringValue",e,t)}handle(e,t,r){const n=r.context.getContextRaw()[t];let i,a;return n&&"string"!=typeof n&&(n["@language"]?i=n["@language"]:n["@type"]&&(a=this.util.dataFactory.namedNode(n["@type"]))),{terms:[this.util.dataFactory.literal(e.value,i||a)]}}}t.NodeValueHandlerString=i},62784:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValueHandlerVariable=void 0;const n=r(55009);class i extends n.NodeValueHandlerAdapter{constructor(e,t){super("Variable",e,t)}handle(e,t,r){const n=e.name.value,i=r.variablesDict[n],a=r.variablesMetaDict[n];if(!i){if(r.ignoreUnknownVariables||a&&!a.mandatory){const e=this.util.dataFactory.variable(n);return r.terminalVariables.map((e=>e.value)).indexOf(n)<0&&r.terminalVariables.push(e),{terms:[e]}}throw new Error(`Undefined variable: ${n}`)}if("Variable"===i.kind)throw new Error(`Variable refers to another variable: ${n}`);if(a)if(a.list){if("ListValue"!==i.kind)throw new Error(`Expected a list, but got ${i.kind} for ${n}`);if(a.type){const e=i;for(const t of e.values)if(t.kind!==a.type)throw new Error(`Expected ${a.type}, but got ${t.kind} for ${n}`)}}else a.type;return this.util.handleNodeValue(i,t,r)}}t.NodeValueHandlerVariable=i},4391:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(55009),t),i(r(22910),t),i(r(67057),t),i(r(968),t),i(r(1463),t),i(r(57044),t),i(r(13381),t),i(r(89339),t),i(r(86085),t),i(r(62784),t)},61082:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(57930),t),i(r(44785),t),i(r(32176),t),i(r(16347),t),i(r(46043),t),i(r(63146),t),i(r(36624),t)},57930:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContextParser=void 0;const n=r(70742),i=r(44785),a=r(32176),o=r(63146),s=r(36624);class c{constructor(e){e=e||{},this.documentLoader=e.documentLoader||new a.FetchDocumentLoader,this.documentCache={},this.validateContext=!e.skipValidation,this.expandContentTypeToBase=!!e.expandContentTypeToBase,this.remoteContextsDepthLimit=e.remoteContextsDepthLimit||32,this.redirectSchemaOrgHttps=!("redirectSchemaOrgHttps"in e)||!!e.redirectSchemaOrgHttps}static validateLanguage(e,t,r){if("string"!=typeof e)throw new i.ErrorCoded(`The value of an '@language' must be a string, got '${JSON.stringify(e)}'`,r);if(!s.Util.REGEX_LANGUAGE_TAG.test(e)){if(t)throw new i.ErrorCoded(`The value of an '@language' must be a valid language tag, got '${JSON.stringify(e)}'`,r);return!1}return!0}static validateDirection(e,t){if("string"!=typeof e)throw new i.ErrorCoded(`The value of an '@direction' must be a string, got '${JSON.stringify(e)}'`,i.ERROR_CODES.INVALID_BASE_DIRECTION);if(!s.Util.REGEX_DIRECTION_TAG.test(e)){if(t)throw new i.ErrorCoded(`The value of an '@direction' must be 'ltr' or 'rtl', got '${JSON.stringify(e)}'`,i.ERROR_CODES.INVALID_BASE_DIRECTION);return!1}return!0}idifyReverseTerms(e){for(const t of Object.keys(e)){let r=e[t];if(r&&"object"==typeof r&&r["@reverse"]&&!r["@id"]){if("string"!=typeof r["@reverse"]||s.Util.isValidKeyword(r["@reverse"]))throw new i.ErrorCoded(`Invalid @reverse value, must be absolute IRI or blank node: '${r["@reverse"]}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);r=e[t]=Object.assign(Object.assign({},r),{"@id":r["@reverse"]}),r["@id"]=r["@reverse"],s.Util.isPotentialKeyword(r["@reverse"])?delete r["@reverse"]:r["@reverse"]=!0}}return e}expandPrefixedTerms(e,t,r){const n=e.getContextRaw();for(const a of r||Object.keys(n))if(s.Util.EXPAND_KEYS_BLACKLIST.indexOf(a)<0&&!s.Util.isReservedInternalKeyword(a)){const r=n[a];if(s.Util.isPotentialKeyword(a)&&s.Util.ALIAS_DOMAIN_BLACKLIST.indexOf(a)>=0&&("@type"!==a||"object"==typeof n[a]&&!n[a]["@protected"]&&"@set"!==n[a]["@container"]))throw new i.ErrorCoded(`Keywords can not be aliased to something else.\nTried mapping ${a} to ${JSON.stringify(r)}`,i.ERROR_CODES.KEYWORD_REDEFINITION);if(s.Util.ALIAS_RANGE_BLACKLIST.indexOf(s.Util.getContextValueId(r))>=0)throw new i.ErrorCoded(`Aliasing to certain keywords is not allowed.\nTried mapping ${a} to ${JSON.stringify(r)}`,i.ERROR_CODES.INVALID_KEYWORD_ALIAS);if(r&&s.Util.isPotentialKeyword(s.Util.getContextValueId(r))&&!0===r["@prefix"])throw new i.ErrorCoded(`Tried to use keyword aliases as prefix: '${a}': '${JSON.stringify(r)}'`,i.ERROR_CODES.INVALID_TERM_DEFINITION);for(;s.Util.isPrefixValue(n[a]);){const r=n[a];let i=!1;if("string"==typeof r)n[a]=e.expandTerm(r,!0),i=i||r!==n[a];else{const o=r["@id"],c=r["@type"],u=!("@prefix"in r)||s.Util.isValidIri(a);if("@id"in r)null!=o&&"string"==typeof o&&(n[a]=Object.assign(Object.assign({},n[a]),{"@id":e.expandTerm(o,!0)}),i=i||o!==n[a]["@id"]);else if(!s.Util.isPotentialKeyword(a)&&u){const t=e.expandTerm(a,!0);t!==a&&(n[a]=Object.assign(Object.assign({},n[a]),{"@id":t}),i=!0)}if(c&&"string"==typeof c&&"@vocab"!==c&&(!r["@container"]||!r["@container"]["@type"])&&u){let r=e.expandTerm(c,!0);t&&c===r&&(r=e.expandTerm(c,!1)),r!==c&&(i=!0,n[a]=Object.assign(Object.assign({},n[a]),{"@type":r}))}}if(!i)break}}}normalize(e,{processingMode:t,normalizeLanguageTags:r}){if(r||1===t)for(const t of Object.keys(e))if("@language"===t&&"string"==typeof e[t])e[t]=e[t].toLowerCase();else{const r=e[t];if(r&&"object"==typeof r&&"string"==typeof r["@language"]){const n=r["@language"].toLowerCase();n!==r["@language"]&&(e[t]=Object.assign(Object.assign({},r),{"@language":n}))}}}containersToHash(e){for(const t of Object.keys(e)){const r=e[t];if(r&&"object"==typeof r)if("string"==typeof r["@container"])e[t]=Object.assign(Object.assign({},r),{"@container":{[r["@container"]]:!0}});else if(Array.isArray(r["@container"])){const n={};for(const e of r["@container"])n[e]=!0;e[t]=Object.assign(Object.assign({},r),{"@container":n})}}}applyScopedProtected(e,{processingMode:t},r){if(t&&t>=1.1&&e["@protected"]){for(const t of Object.keys(e))if(!s.Util.isReservedInternalKeyword(t)&&!s.Util.isPotentialKeyword(t)&&!s.Util.isTermProtected(e,t)){const n=e[t];n&&"object"==typeof n?"@protected"in e[t]||(e[t]=Object.assign(Object.assign({},e[t]),{"@protected":!0})):(e[t]={"@id":n,"@protected":!0},s.Util.isSimpleTermDefinitionPrefix(n,r)&&(e[t]=Object.assign(Object.assign({},e[t]),{"@prefix":!0})))}delete e["@protected"]}}validateKeywordRedefinitions(e,t,r,n){for(const r of null!=n?n:Object.keys(t))if(s.Util.isTermProtected(e,r)&&("string"==typeof t[r]?t[r]={"@id":t[r],"@protected":!0}:t[r]=Object.assign(Object.assign({},t[r]),{"@protected":!0}),!s.Util.deepEqual(e[r],t[r])))throw new i.ErrorCoded(`Attempted to override the protected keyword ${r} from ${JSON.stringify(s.Util.getContextValueId(e[r]))} to ${JSON.stringify(s.Util.getContextValueId(t[r]))}`,i.ERROR_CODES.PROTECTED_TERM_REDEFINITION)}validate(e,{processingMode:t}){for(const r of Object.keys(e)){if(s.Util.isReservedInternalKeyword(r))continue;if(""===r)throw new i.ErrorCoded(`The empty term is not allowed, got: '${r}': '${JSON.stringify(e[r])}'`,i.ERROR_CODES.INVALID_TERM_DEFINITION);const n=e[r],a=typeof n;if(s.Util.isPotentialKeyword(r)){switch(r.substr(1)){case"vocab":if(null!==n&&"string"!==a)throw new i.ErrorCoded(`Found an invalid @vocab IRI: ${n}`,i.ERROR_CODES.INVALID_VOCAB_MAPPING);break;case"base":if(null!==n&&"string"!==a)throw new i.ErrorCoded(`Found an invalid @base IRI: ${e[r]}`,i.ERROR_CODES.INVALID_BASE_IRI);break;case"language":null!==n&&c.validateLanguage(n,!0,i.ERROR_CODES.INVALID_DEFAULT_LANGUAGE);break;case"version":if(null!==n&&"number"!==a)throw new i.ErrorCoded(`Found an invalid @version number: ${n}`,i.ERROR_CODES.INVALID_VERSION_VALUE);break;case"direction":null!==n&&c.validateDirection(n,!0);break;case"propagate":if(1===t)throw new i.ErrorCoded(`Found an illegal @propagate keyword: ${n}`,i.ERROR_CODES.INVALID_CONTEXT_ENTRY);if(null!==n&&"boolean"!==a)throw new i.ErrorCoded(`Found an invalid @propagate value: ${n}`,i.ERROR_CODES.INVALID_PROPAGATE_VALUE)}if(s.Util.isValidKeyword(r)&&s.Util.isValidKeyword(s.Util.getContextValueId(n)))throw new i.ErrorCoded(`Illegal keyword alias in term value, found: '${r}': '${s.Util.getContextValueId(n)}'`,i.ERROR_CODES.KEYWORD_REDEFINITION)}else if(null!==n)switch(a){case"string":if(s.Util.getPrefix(n,e)===r)throw new i.ErrorCoded(`Detected cyclical IRI mapping in context entry: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.CYCLIC_IRI_MAPPING);if(s.Util.isValidIriWeak(r)){if("@type"===n)throw new i.ErrorCoded(`IRIs can not be mapped to @type, found: '${r}': '${n}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);if(s.Util.isValidIri(n)&&n!==new o.JsonLdContextNormalized(e).expandTerm(r))throw new i.ErrorCoded(`IRIs can not be mapped to other IRIs, found: '${r}': '${n}'`,i.ERROR_CODES.INVALID_IRI_MAPPING)}break;case"object":if(!(s.Util.isCompactIri(r)||"@id"in n||("@id"===n["@type"]?e["@base"]:e["@vocab"])))throw new i.ErrorCoded(`Missing @id in context entry: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);for(const u of Object.keys(n)){const l=n[u];if(l)switch(u){case"@id":if(s.Util.isValidKeyword(l)&&"@type"!==l&&"@id"!==l&&"@graph"!==l&&"@nest"!==l)throw new i.ErrorCoded(`Illegal keyword alias in term value, found: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);if(s.Util.isValidIriWeak(r)){if("@type"===l)throw new i.ErrorCoded(`IRIs can not be mapped to @type, found: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);if(s.Util.isValidIri(l)&&l!==new o.JsonLdContextNormalized(e).expandTerm(r))throw new i.ErrorCoded(`IRIs can not be mapped to other IRIs, found: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING)}if("string"!=typeof l)throw new i.ErrorCoded(`Detected non-string @id in context entry: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);if(s.Util.getPrefix(l,e)===r)throw new i.ErrorCoded(`Detected cyclical IRI mapping in context entry: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.CYCLIC_IRI_MAPPING);break;case"@type":if("@type"===n["@container"]&&"@id"!==l&&"@vocab"!==l)throw new i.ErrorCoded(`@container: @type only allows @type: @id or @vocab, but got: '${r}': '${l}'`,i.ERROR_CODES.INVALID_TYPE_MAPPING);if("string"!=typeof l)throw new i.ErrorCoded(`The value of an '@type' must be a string, got '${JSON.stringify(a)}'`,i.ERROR_CODES.INVALID_TYPE_MAPPING);if(!("@id"===l||"@vocab"===l||1!==t&&"@json"===l||1!==t&&"@none"===l||"_"!==l[0]&&s.Util.isValidIri(l)))throw new i.ErrorCoded(`A context @type must be an absolute IRI, found: '${r}': '${l}'`,i.ERROR_CODES.INVALID_TYPE_MAPPING);break;case"@reverse":if("string"==typeof l&&n["@id"]&&n["@id"]!==l)throw new i.ErrorCoded(`Found non-matching @id and @reverse term values in '${r}':'${l}' and '${n["@id"]}'`,i.ERROR_CODES.INVALID_REVERSE_PROPERTY);if("@nest"in n)throw new i.ErrorCoded(`@nest is not allowed in the reverse property '${r}'`,i.ERROR_CODES.INVALID_REVERSE_PROPERTY);break;case"@container":if(1===t&&(Object.keys(l).length>1||s.Util.CONTAINERS_1_0.indexOf(Object.keys(l)[0])<0))throw new i.ErrorCoded(`Invalid term @container for '${r}' ('${Object.keys(l)}') in 1.0, must be only one of ${s.Util.CONTAINERS_1_0.join(", ")}`,i.ERROR_CODES.INVALID_CONTAINER_MAPPING);for(const e of Object.keys(l)){if("@list"===e&&n["@reverse"])throw new i.ErrorCoded(`Term value can not be @container: @list and @reverse at the same time on '${r}'`,i.ERROR_CODES.INVALID_REVERSE_PROPERTY);if(s.Util.CONTAINERS.indexOf(e)<0)throw new i.ErrorCoded(`Invalid term @container for '${r}' ('${e}'), must be one of ${s.Util.CONTAINERS.join(", ")}`,i.ERROR_CODES.INVALID_CONTAINER_MAPPING)}break;case"@language":c.validateLanguage(l,!0,i.ERROR_CODES.INVALID_LANGUAGE_MAPPING);break;case"@direction":c.validateDirection(l,!0);break;case"@prefix":if(null!==l&&"boolean"!=typeof l)throw new i.ErrorCoded(`Found an invalid term @prefix boolean in: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_PREFIX_VALUE);if(!("@id"in n)&&!s.Util.isValidIri(r))throw new i.ErrorCoded(`Invalid @prefix definition for '${r}' ('${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_TERM_DEFINITION);break;case"@index":if(1===t||!n["@container"]||!n["@container"]["@index"])throw new i.ErrorCoded(`Attempt to add illegal key to value object: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_TERM_DEFINITION);break;case"@nest":if(s.Util.isPotentialKeyword(l)&&"@nest"!==l)throw new i.ErrorCoded(`Found an invalid term @nest value in: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_NEST_VALUE)}}break;default:throw new i.ErrorCoded(`Found an invalid term value: '${r}': '${n}'`,i.ERROR_CODES.INVALID_TERM_DEFINITION)}}}applyBaseEntry(e,t,r){return"string"==typeof e||(r&&!("@base"in e)&&t.parentContext&&"object"==typeof t.parentContext&&"@base"in t.parentContext&&(e["@base"]=t.parentContext["@base"],t.parentContext["@__baseDocument"]&&(e["@__baseDocument"]=!0)),t.baseIRI&&!t.external&&("@base"in e?null===e["@base"]||"string"!=typeof e["@base"]||s.Util.isValidIri(e["@base"])||(e["@base"]=(0,n.resolve)(e["@base"],t.parentContext&&t.parentContext["@base"]||t.baseIRI)):(e["@base"]=t.baseIRI,e["@__baseDocument"]=!0))),e}normalizeContextIri(e,t){if(!s.Util.isValidIri(e))try{e=(0,n.resolve)(e,t)}catch(t){throw new Error(`Invalid context IRI: ${e}`)}return this.redirectSchemaOrgHttps&&e.startsWith("http://schema.org")&&(e="https://schema.org/"),e}async parseInnerContexts(e,t,r){for(const n of null!=r?r:Object.keys(e)){const r=e[n];if(r&&"object"==typeof r&&"@context"in r&&null!==r["@context"]&&!t.ignoreScopedContexts){if(this.validateContext)try{const i=Object.assign(Object.assign({},e),{[n]:Object.assign({},e[n])});delete i[n]["@context"],await this.parse(r["@context"],Object.assign(Object.assign({},t),{external:!1,parentContext:i,ignoreProtection:!0,ignoreRemoteScopedContexts:!0,ignoreScopedContexts:!0}))}catch(e){throw new i.ErrorCoded(e.message,i.ERROR_CODES.INVALID_SCOPED_CONTEXT)}e[n]=Object.assign(Object.assign({},r),{"@context":(await this.parse(r["@context"],Object.assign(Object.assign({},t),{external:!1,minimalProcessing:!0,ignoreRemoteScopedContexts:!0,parentContext:e}))).getContextRaw()})}}return e}async parse(e,t={},r={}){const{baseIRI:n,parentContext:a,external:u,processingMode:l=c.DEFAULT_PROCESSING_MODE,normalizeLanguageTags:d,ignoreProtection:p,minimalProcessing:h}=t,f=t.remoteContexts||{};if(Object.keys(f).length>=this.remoteContextsDepthLimit)throw new i.ErrorCoded("Detected an overflow in remote context inclusions: "+Object.keys(f),i.ERROR_CODES.CONTEXT_OVERFLOW);if(null==e){if(!p&&a&&s.Util.hasProtectedTerms(a))throw new i.ErrorCoded("Illegal context nullification when terms are protected",i.ERROR_CODES.INVALID_CONTEXT_NULLIFICATION);return new o.JsonLdContextNormalized(this.applyBaseEntry({},t,!1))}if("string"==typeof e){const r=this.normalizeContextIri(e,n),i=this.getOverriddenLoad(r,t);if(i)return new o.JsonLdContextNormalized(i);const a=await this.parse(await this.load(r),Object.assign(Object.assign({},t),{baseIRI:r,external:!0,remoteContexts:Object.assign(Object.assign({},f),{[r]:!0})}));return this.applyBaseEntry(a.getContextRaw(),t,!0),a}if(Array.isArray(e)){const r=[],i=await Promise.all(e.map(((e,i)=>{if("string"==typeof e){const a=this.normalizeContextIri(e,n);r[i]=a;return this.getOverriddenLoad(a,t)||this.load(a)}return e})));if(h)return new o.JsonLdContextNormalized(i);const s=await i.reduce(((e,n,a)=>e.then((e=>this.parse(n,Object.assign(Object.assign({},t),{baseIRI:r[a]||t.baseIRI,external:!!r[a]||t.external,parentContext:e.getContextRaw(),remoteContexts:r[a]?Object.assign(Object.assign({},f),{[r[a]]:!0}):f}),{skipValidation:a=1.1))throw new i.ErrorCoded("Context importing is not supported in JSON-LD 1.0",i.ERROR_CODES.INVALID_CONTEXT_ENTRY);if("string"!=typeof e["@import"])throw new i.ErrorCoded("An @import value must be a string, but got "+typeof e["@import"],i.ERROR_CODES.INVALID_IMPORT_VALUE);f=await this.loadImportContext(this.normalizeContextIri(e["@import"],n)),delete e["@import"]}this.applyScopedProtected(f,{processingMode:l},o.defaultExpandOptions);const y=Object.assign(f,e);this.idifyReverseTerms(y),this.normalize(y,{processingMode:l,normalizeLanguageTags:d}),this.applyScopedProtected(y,{processingMode:l},o.defaultExpandOptions);const g=Object.keys(y),m=[];if("object"==typeof a)for(const e in a)e in y?m.push(e):y[e]=a[e];await this.parseInnerContexts(y,t,g);const b=new o.JsonLdContextNormalized(y);return(y&&y["@version"]||c.DEFAULT_PROCESSING_MODE)>=1.1&&(e["@vocab"]&&"string"==typeof e["@vocab"]||""===e["@vocab"])&&(a&&"@vocab"in a&&e["@vocab"].indexOf(":")<0?y["@vocab"]=a["@vocab"]+e["@vocab"]:(s.Util.isCompactIri(e["@vocab"])||e["@vocab"]in y)&&(y["@vocab"]=b.expandTerm(e["@vocab"],!0))),this.expandPrefixedTerms(b,this.expandContentTypeToBase,g),!p&&a&&l>=1.1&&this.validateKeywordRedefinitions(a,y,o.defaultExpandOptions,m),this.validateContext&&!r.skipValidation&&this.validate(y,{processingMode:l}),b}throw new i.ErrorCoded(`Tried parsing a context that is not a string, array or object, but got ${e}`,i.ERROR_CODES.INVALID_LOCAL_CONTEXT)}async load(e){const t=this.documentCache[e];if(t)return t;let r;try{r=await this.documentLoader.load(e)}catch(t){throw new i.ErrorCoded(`Failed to load remote context ${e}: ${t.message}`,i.ERROR_CODES.LOADING_REMOTE_CONTEXT_FAILED)}if(!("@context"in r))throw new i.ErrorCoded(`Missing @context in remote context at ${e}`,i.ERROR_CODES.INVALID_REMOTE_CONTEXT);return this.documentCache[e]=r["@context"]}getOverriddenLoad(e,t){if(e in(t.remoteContexts||{})){if(t.ignoreRemoteScopedContexts)return e;throw new i.ErrorCoded("Detected a cyclic context inclusion of "+e,i.ERROR_CODES.RECURSIVE_CONTEXT_INCLUSION)}return null}async loadImportContext(e){let t=await this.load(e);if("object"!=typeof t||Array.isArray(t))throw new i.ErrorCoded("An imported context must be a single object: "+e,i.ERROR_CODES.INVALID_REMOTE_CONTEXT);if("@import"in t)throw new i.ErrorCoded("An imported context can not import another context: "+e,i.ERROR_CODES.INVALID_CONTEXT_ENTRY);return t=Object.assign({},t),this.containersToHash(t),t}}c.DEFAULT_PROCESSING_MODE=1.1,t.ContextParser=c},44785:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERROR_CODES=t.ErrorCoded=void 0;class r extends Error{constructor(e,t){super(e),this.code=t}}var n;t.ErrorCoded=r,(n=t.ERROR_CODES||(t.ERROR_CODES={})).COLLIDING_KEYWORDS="colliding keywords",n.CONFLICTING_INDEXES="conflicting indexes",n.CYCLIC_IRI_MAPPING="cyclic IRI mapping",n.INVALID_ID_VALUE="invalid @id value",n.INVALID_INDEX_VALUE="invalid @index value",n.INVALID_NEST_VALUE="invalid @nest value",n.INVALID_PREFIX_VALUE="invalid @prefix value",n.INVALID_PROPAGATE_VALUE="invalid @propagate value",n.INVALID_REVERSE_VALUE="invalid @reverse value",n.INVALID_IMPORT_VALUE="invalid @import value",n.INVALID_VERSION_VALUE="invalid @version value",n.INVALID_BASE_IRI="invalid base IRI",n.INVALID_CONTAINER_MAPPING="invalid container mapping",n.INVALID_CONTEXT_ENTRY="invalid context entry",n.INVALID_CONTEXT_NULLIFICATION="invalid context nullification",n.INVALID_DEFAULT_LANGUAGE="invalid default language",n.INVALID_INCLUDED_VALUE="invalid @included value",n.INVALID_IRI_MAPPING="invalid IRI mapping",n.INVALID_JSON_LITERAL="invalid JSON literal",n.INVALID_KEYWORD_ALIAS="invalid keyword alias",n.INVALID_LANGUAGE_MAP_VALUE="invalid language map value",n.INVALID_LANGUAGE_MAPPING="invalid language mapping",n.INVALID_LANGUAGE_TAGGED_STRING="invalid language-tagged string",n.INVALID_LANGUAGE_TAGGED_VALUE="invalid language-tagged value",n.INVALID_LOCAL_CONTEXT="invalid local context",n.INVALID_REMOTE_CONTEXT="invalid remote context",n.INVALID_REVERSE_PROPERTY="invalid reverse property",n.INVALID_REVERSE_PROPERTY_MAP="invalid reverse property map",n.INVALID_REVERSE_PROPERTY_VALUE="invalid reverse property value",n.INVALID_SCOPED_CONTEXT="invalid scoped context",n.INVALID_SCRIPT_ELEMENT="invalid script element",n.INVALID_SET_OR_LIST_OBJECT="invalid set or list object",n.INVALID_TERM_DEFINITION="invalid term definition",n.INVALID_TYPE_MAPPING="invalid type mapping",n.INVALID_TYPE_VALUE="invalid type value",n.INVALID_TYPED_VALUE="invalid typed value",n.INVALID_VALUE_OBJECT="invalid value object",n.INVALID_VALUE_OBJECT_VALUE="invalid value object value",n.INVALID_VOCAB_MAPPING="invalid vocab mapping",n.IRI_CONFUSED_WITH_PREFIX="IRI confused with prefix",n.KEYWORD_REDEFINITION="keyword redefinition",n.LOADING_DOCUMENT_FAILED="loading document failed",n.LOADING_REMOTE_CONTEXT_FAILED="loading remote context failed",n.MULTIPLE_CONTEXT_LINK_HEADERS="multiple context link headers",n.PROCESSING_MODE_CONFLICT="processing mode conflict",n.PROTECTED_TERM_REDEFINITION="protected term redefinition",n.CONTEXT_OVERFLOW="context overflow",n.INVALID_BASE_DIRECTION="invalid base direction",n.RECURSIVE_CONTEXT_INCLUSION="recursive context inclusion",n.INVALID_STREAMING_KEY_ORDER="invalid streaming key order",n.INVALID_EMBEDDED_NODE="invalid embedded node",n.INVALID_ANNOTATION="invalid annotation"},32176:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FetchDocumentLoader=void 0;const n=r(44785),i=r(2384),a=r(70742);t.FetchDocumentLoader=class{constructor(e){this.fetcher=e}async load(e){const t=await(this.fetcher||fetch)(e,{headers:new Headers({accept:"application/ld+json"})});if(t.ok&&t.headers){let r=t.headers.get("Content-Type");if(r){const e=r.indexOf(";");e>0&&(r=r.substr(0,e))}if("application/ld+json"===r)return await t.json();if(t.headers.has("Link")){let r;if(t.headers.forEach(((t,n)=>{if("link"===n){const n=(0,i.parse)(t);for(const t of n.get("type","application/ld+json"))if("alternate"===t.rel){if(r)throw new Error("Multiple JSON-LD alternate links were found on "+e);r=(0,a.resolve)(t.uri,e)}}})),r)return this.load(r)}throw new n.ErrorCoded(`Unsupported JSON-LD media type ${r}`,n.ERROR_CODES.LOADING_DOCUMENT_FAILED)}throw new Error(t.statusText||`Status code: ${t.status}`)}}},16347:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},46043:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},63146:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultExpandOptions=t.JsonLdContextNormalized=void 0;const n=r(70742),i=r(44785),a=r(36624);t.JsonLdContextNormalized=class{constructor(e){this.contextRaw=e}getContextRaw(){return this.contextRaw}expandTerm(e,r,o=t.defaultExpandOptions){const s=this.contextRaw[e];if(null===s||s&&null===s["@id"])return null;let c=!0;if(s&&r){const t=a.Util.getContextValueId(s);if(t&&t!==e){if("string"==typeof t&&(a.Util.isValidIri(t)||a.Util.isValidKeyword(t)))return t;a.Util.isPotentialKeyword(t)||(c=!1)}}const u=a.Util.getPrefix(e,this.contextRaw),l=this.contextRaw["@vocab"],d=(!!l||""===l)&&l.indexOf(":")<0,p=this.contextRaw["@base"],h=a.Util.isPotentialKeyword(e);if(u){const t=this.contextRaw[u],r=a.Util.getContextValueId(t);if(r){if("string"!=typeof t&&o.allowPrefixForcing){if("_"!==r[0]&&!h&&!t["@prefix"]&&!(e in this.contextRaw))return e}else if(!a.Util.isSimpleTermDefinitionPrefix(r,o))return e;return r+e.substr(u.length+1)}}else{if(r&&(l||""===l||o.allowVocabRelativeToBase&&p&&d)&&!h&&!a.Util.isCompactIri(e)){if(d){if(o.allowVocabRelativeToBase)return(l||p?(0,n.resolve)(l,p):"")+e;throw new i.ErrorCoded(`Relative vocab expansion for term '${e}' with vocab '${l}' is not allowed.`,i.ERROR_CODES.INVALID_VOCAB_MAPPING)}return l+e}if(!r&&p&&!h&&!a.Util.isCompactIri(e))return(0,n.resolve)(e,p)}if(c)return e;throw new i.ErrorCoded(`Invalid IRI mapping found for context entry '${e}': '${JSON.stringify(s)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING)}compactIri(e,t){if(t&&this.contextRaw["@vocab"]&&e.startsWith(this.contextRaw["@vocab"]))return e.substr(this.contextRaw["@vocab"].length);if(!t&&this.contextRaw["@base"]&&e.startsWith(this.contextRaw["@base"]))return e.substr(this.contextRaw["@base"].length);const r={prefix:"",suffix:e};for(const n in this.contextRaw){const i=this.contextRaw[n];if(i&&!a.Util.isPotentialKeyword(n)){const o=a.Util.getContextValueId(i);if(e.startsWith(o)){const i=e.substr(o.length);if(i)i.length{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Util=void 0;class r{static isCompactIri(e){return e.indexOf(":")>0&&!(e&&"#"===e[0])}static getPrefix(e,t){if(e&&"#"===e[0])return null;const r=e.indexOf(":");if(r>=0){if(e.length>r+1&&"/"===e.charAt(r+1)&&"/"===e.charAt(r+2))return null;const n=e.substr(0,r);if("_"===n)return null;if(t[n])return n}return null}static getContextValueId(e){if(null===e||"string"==typeof e)return e;return e["@id"]||null}static isSimpleTermDefinitionPrefix(e,t){return!r.isPotentialKeyword(e)&&(t.allowPrefixNonGenDelims||"string"==typeof e&&("_"===e[0]||r.isPrefixIriEndingWithGenDelim(e)))}static isPotentialKeyword(e){return"string"==typeof e&&r.KEYWORD_REGEX.test(e)}static isPrefixIriEndingWithGenDelim(e){return r.ENDS_WITH_GEN_DELIM.test(e)}static isPrefixValue(e){return e&&("string"==typeof e||e&&"object"==typeof e)}static isValidIri(e){return Boolean(e&&r.IRI_REGEX.test(e))}static isValidIriWeak(e){return!!e&&":"!==e[0]&&r.IRI_REGEX_WEAK.test(e)}static isValidKeyword(e){return r.VALID_KEYWORDS[e]}static isTermProtected(e,t){const r=e[t];return!("string"==typeof r)&&r&&r["@protected"]}static hasProtectedTerms(e){for(const t of Object.keys(e))if(r.isTermProtected(e,t))return!0;return!1}static isReservedInternalKeyword(e){return e.startsWith("@__")}static deepEqual(e,t){const r=Object.keys(e),n=Object.keys(t);return r.length===n.length&&r.every((r=>{const n=e[r],i=t[r];return n===i||null!==n&&null!==i&&"object"==typeof n&&"object"==typeof i&&this.deepEqual(n,i)}))}}r.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^ "<>{}|\\\[\]`#]*(#[^#]*)?$/,r.IRI_REGEX_WEAK=/(?::[^:])|\//,r.KEYWORD_REGEX=/^@[a-z]+$/i,r.ENDS_WITH_GEN_DELIM=/[:/?#\[\]@]$/,r.REGEX_LANGUAGE_TAG=/^[a-zA-Z]+(-[a-zA-Z0-9]+)*$/,r.REGEX_DIRECTION_TAG=/^(ltr)|(rtl)$/,r.VALID_KEYWORDS={"@annotation":!0,"@base":!0,"@container":!0,"@context":!0,"@direction":!0,"@graph":!0,"@id":!0,"@import":!0,"@included":!0,"@index":!0,"@json":!0,"@language":!0,"@list":!0,"@nest":!0,"@none":!0,"@prefix":!0,"@propagate":!0,"@protected":!0,"@reverse":!0,"@set":!0,"@type":!0,"@value":!0,"@version":!0,"@vocab":!0},r.EXPAND_KEYS_BLACKLIST=["@base","@vocab","@language","@version","@direction"],r.ALIAS_DOMAIN_BLACKLIST=["@container","@graph","@id","@index","@list","@nest","@none","@prefix","@reverse","@set","@type","@value","@version"],r.ALIAS_RANGE_BLACKLIST=["@context","@preserve"],r.CONTAINERS=["@list","@set","@index","@language","@graph","@id","@type"],r.CONTAINERS_1_0=["@list","@set","@index"],t.Util=r},61702:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.printError=w,t.GraphQLError=void 0;var i,a=(i=r(55569))&&i.__esModule?i:{default:i},o=r(25888),s=r(99530),c=r(40825);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(e,t){for(var r=0;r0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=o&&o.stack?(Object.defineProperty(h(b),"stack",{value:o.stack,writable:!0,configurable:!0}),p(b)):(Error.captureStackTrace?Error.captureStackTrace(h(b),f):Object.defineProperty(h(b),"stack",{value:Error().stack,writable:!0,configurable:!0}),b)}return n=f,(i=[{key:"toString",value:function(){return w(this)}},{key:o.SYMBOL_TO_STRING_TAG,get:function(){return"Object"}}])&&d(n.prototype,i),f}(f(Error));function _(e){return void 0===e||0===e.length?void 0:e}function w(e){var t=e.message;if(e.nodes)for(var r=0,n=e.nodes;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.syntaxError=function(e,t,r){return new n.GraphQLError("Syntax Error: ".concat(r),void 0,e,[t])};var n=r(61702)},63580:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.prototype.toJSON;"function"==typeof t||(0,n.default)(0),e.prototype.inspect=t,i.default&&(e.prototype[i.default]=t)};var n=a(r(61321)),i=a(r(98493));function a(e){return e&&e.__esModule?e:{default:e}}},93028:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!Boolean(e))throw new Error(t)}},29657:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return c(e,[])};var n,i=(n=r(98493))&&n.__esModule?n:{default:n};function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}var o=10,s=2;function c(e,t){switch(a(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var r=[].concat(t,[e]),n=function(e){var t=e[String(i.default)];return"function"==typeof t?t:"function"==typeof e.inspect?e.inspect:void 0}(e);if(void 0!==n){var a=n.call(e);if(a!==e)return"string"==typeof a?a:c(a,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>s)return"[Array]";for(var r=Math.min(o,e.length),n=e.length-r,i=[],a=0;a1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}(e,r);return function(e,t){var r=Object.keys(e);return 0===r.length?"{}":t.length>s?"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var r=e.constructor.name;if("string"==typeof r&&""!==r)return r}return t}(e)+"]":"{ "+r.map((function(r){return r+": "+c(e[r],t)})).join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}},79527:(e,t,r)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,(n=r(29657))&&n.__esModule;t.default=function(e,t){return e instanceof t}},61321:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}},55569:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return"object"==r(e)&&null!==e}},98493:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;t.default=r},76257:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNode=function(e){return null!=e&&"string"==typeof e.kind},t.Token=t.Location=void 0;var n,i=(n=r(63580))&&n.__esModule?n:{default:n},a=function(){function e(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();t.Location=a,(0,i.default)(a);var o=function(){function e(e,t,r,n,i,a,o){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=o,this.prev=a,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();t.Token=o,(0,i.default)(o)},69165:(e,t)=>{"use strict";function r(e){for(var t=0;to&&r(t[s-1]);)--s;return t.slice(o,s).join("\n")},t.getBlockStringIndentation=n,t.printBlockString=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=-1===e.indexOf("\n"),i=" "===e[0]||"\t"===e[0],a='"'===e[e.length-1],o="\\"===e[e.length-1],s=!n||a||o||r,c="";return!s||n&&i||(c+="\n"+t),c+=t?e.replace(/\n/g,"\n"+t):e,s&&(c+="\n"),'"""'+c.replace(/"""/g,'\\"""')+'"""'}},5919:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DirectiveLocation=void 0;var r=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});t.DirectiveLocation=r},80425:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Source",{enumerable:!0,get:function(){return n.Source}}),Object.defineProperty(t,"getLocation",{enumerable:!0,get:function(){return i.getLocation}}),Object.defineProperty(t,"printLocation",{enumerable:!0,get:function(){return a.printLocation}}),Object.defineProperty(t,"printSourceLocation",{enumerable:!0,get:function(){return a.printSourceLocation}}),Object.defineProperty(t,"Kind",{enumerable:!0,get:function(){return o.Kind}}),Object.defineProperty(t,"TokenKind",{enumerable:!0,get:function(){return s.TokenKind}}),Object.defineProperty(t,"Lexer",{enumerable:!0,get:function(){return c.Lexer}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return u.parse}}),Object.defineProperty(t,"parseValue",{enumerable:!0,get:function(){return u.parseValue}}),Object.defineProperty(t,"parseType",{enumerable:!0,get:function(){return u.parseType}}),Object.defineProperty(t,"print",{enumerable:!0,get:function(){return l.print}}),Object.defineProperty(t,"visit",{enumerable:!0,get:function(){return d.visit}}),Object.defineProperty(t,"visitInParallel",{enumerable:!0,get:function(){return d.visitInParallel}}),Object.defineProperty(t,"getVisitFn",{enumerable:!0,get:function(){return d.getVisitFn}}),Object.defineProperty(t,"BREAK",{enumerable:!0,get:function(){return d.BREAK}}),Object.defineProperty(t,"Location",{enumerable:!0,get:function(){return p.Location}}),Object.defineProperty(t,"Token",{enumerable:!0,get:function(){return p.Token}}),Object.defineProperty(t,"isDefinitionNode",{enumerable:!0,get:function(){return h.isDefinitionNode}}),Object.defineProperty(t,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return h.isExecutableDefinitionNode}}),Object.defineProperty(t,"isSelectionNode",{enumerable:!0,get:function(){return h.isSelectionNode}}),Object.defineProperty(t,"isValueNode",{enumerable:!0,get:function(){return h.isValueNode}}),Object.defineProperty(t,"isTypeNode",{enumerable:!0,get:function(){return h.isTypeNode}}),Object.defineProperty(t,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return h.isTypeSystemDefinitionNode}}),Object.defineProperty(t,"isTypeDefinitionNode",{enumerable:!0,get:function(){return h.isTypeDefinitionNode}}),Object.defineProperty(t,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return h.isTypeSystemExtensionNode}}),Object.defineProperty(t,"isTypeExtensionNode",{enumerable:!0,get:function(){return h.isTypeExtensionNode}}),Object.defineProperty(t,"DirectiveLocation",{enumerable:!0,get:function(){return f.DirectiveLocation}});var n=r(46876),i=r(99530),a=r(40825),o=r(7030),s=r(73038),c=r(46083),u=r(50246),l=r(70585),d=r(9111),p=r(76257),h=r(39187),f=r(5919)},7030:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Kind=void 0;var r=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});t.Kind=r},46083:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPunctuatorTokenKind=function(e){return e===a.TokenKind.BANG||e===a.TokenKind.DOLLAR||e===a.TokenKind.AMP||e===a.TokenKind.PAREN_L||e===a.TokenKind.PAREN_R||e===a.TokenKind.SPREAD||e===a.TokenKind.COLON||e===a.TokenKind.EQUALS||e===a.TokenKind.AT||e===a.TokenKind.BRACKET_L||e===a.TokenKind.BRACKET_R||e===a.TokenKind.BRACE_L||e===a.TokenKind.PIPE||e===a.TokenKind.BRACE_R},t.Lexer=void 0;var n=r(51352),i=r(76257),a=r(73038),o=r(69165),s=function(){function e(e){var t=new i.Token(a.TokenKind.SOF,0,0,0,0,null);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}var t=e.prototype;return t.advance=function(){return this.lastToken=this.token,this.token=this.lookahead()},t.lookahead=function(){var e=this.token;if(e.kind!==a.TokenKind.EOF)do{var t;e=null!==(t=e.next)&&void 0!==t?t:e.next=u(this,e)}while(e.kind===a.TokenKind.COMMENT);return e},e}();function c(e){return isNaN(e)?a.TokenKind.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function u(e,t){for(var r=e.source,o=r.body,s=o.length,c=t.end;c31||9===s));return new i.Token(a.TokenKind.COMMENT,t,u,r,n,o,c.slice(t+1,u))}function p(e,t,r,o,s,u){var l=e.body,d=r,p=t,f=!1;if(45===d&&(d=l.charCodeAt(++p)),48===d){if((d=l.charCodeAt(++p))>=48&&d<=57)throw(0,n.syntaxError)(e,p,"Invalid number, unexpected digit after 0: ".concat(c(d),"."))}else p=h(e,p,d),d=l.charCodeAt(p);if(46===d&&(f=!0,d=l.charCodeAt(++p),p=h(e,p,d),d=l.charCodeAt(p)),69!==d&&101!==d||(f=!0,43!==(d=l.charCodeAt(++p))&&45!==d||(d=l.charCodeAt(++p)),p=h(e,p,d),d=l.charCodeAt(p)),46===d||function(e){return 95===e||e>=65&&e<=90||e>=97&&e<=122}(d))throw(0,n.syntaxError)(e,p,"Invalid number, expected digit but got: ".concat(c(d),"."));return new i.Token(f?a.TokenKind.FLOAT:a.TokenKind.INT,t,p,o,s,u,l.slice(t,p))}function h(e,t,r){var i=e.body,a=t,o=r;if(o>=48&&o<=57){do{o=i.charCodeAt(++a)}while(o>=48&&o<=57);return a}throw(0,n.syntaxError)(e,a,"Invalid number, expected digit but got: ".concat(c(o),"."))}function f(e,t,r,o,s){for(var u,l,d,p,h=e.body,f=t+1,y=f,m=0,b="";f=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function m(e,t,r,n,o){for(var s=e.body,c=s.length,u=t+1,l=0;u!==c&&!isNaN(l=s.charCodeAt(u))&&(95===l||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122);)++u;return new i.Token(a.TokenKind.NAME,t,u,r,n,o,s.slice(t,u))}t.Lexer=s},99530:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLocation=function(e,t){for(var r,n=/\r\n|[\n\r]/g,i=1,a=t+1;(r=n.exec(e.body))&&r.index{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parse=function(e,t){return new l(e,t).parseDocument()},t.parseValue=function(e,t){var r=new l(e,t);r.expectToken(o.TokenKind.SOF);var n=r.parseValueLiteral(!1);return r.expectToken(o.TokenKind.EOF),n},t.parseType=function(e,t){var r=new l(e,t);r.expectToken(o.TokenKind.SOF);var n=r.parseTypeReference();return r.expectToken(o.TokenKind.EOF),n},t.Parser=void 0;var n=r(51352),i=r(7030),a=r(76257),o=r(73038),s=r(46876),c=r(5919),u=r(46083),l=function(){function e(e,t){var r=(0,s.isSource)(e)?e:new s.Source(e);this._lexer=new u.Lexer(r),this._options=t}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(o.TokenKind.NAME);return{kind:i.Kind.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:i.Kind.DOCUMENT,definitions:this.many(o.TokenKind.SOF,this.parseDefinition,o.TokenKind.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(o.TokenKind.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(o.TokenKind.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var e=this._lexer.token;if(this.peek(o.TokenKind.BRACE_L))return{kind:i.Kind.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var t,r=this.parseOperationType();return this.peek(o.TokenKind.NAME)&&(t=this.parseName()),{kind:i.Kind.OPERATION_DEFINITION,operation:r,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseOperationType=function(){var e=this.expectToken(o.TokenKind.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},t.parseVariableDefinitions=function(){return this.optionalMany(o.TokenKind.PAREN_L,this.parseVariableDefinition,o.TokenKind.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:i.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(o.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(o.TokenKind.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},t.parseVariable=function(){var e=this._lexer.token;return this.expectToken(o.TokenKind.DOLLAR),{kind:i.Kind.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:i.Kind.SELECTION_SET,selections:this.many(o.TokenKind.BRACE_L,this.parseSelection,o.TokenKind.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(o.TokenKind.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,r=this._lexer.token,n=this.parseName();return this.expectOptionalToken(o.TokenKind.COLON)?(e=n,t=this.parseName()):t=n,{kind:i.Kind.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(o.TokenKind.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(r)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(o.TokenKind.PAREN_L,t,o.TokenKind.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(o.TokenKind.COLON),{kind:i.Kind.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:i.Kind.ARGUMENT,name:this.parseName(),value:(this.expectToken(o.TokenKind.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(o.TokenKind.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(o.TokenKind.NAME)?{kind:i.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:i.Kind.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentDefinition=function(){var e,t=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(e=this._options)||void 0===e?void 0:e.experimentalFragmentVariables)?{kind:i.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}:{kind:i.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},t.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(e){var t=this._lexer.token;switch(t.kind){case o.TokenKind.BRACKET_L:return this.parseList(e);case o.TokenKind.BRACE_L:return this.parseObject(e);case o.TokenKind.INT:return this._lexer.advance(),{kind:i.Kind.INT,value:t.value,loc:this.loc(t)};case o.TokenKind.FLOAT:return this._lexer.advance(),{kind:i.Kind.FLOAT,value:t.value,loc:this.loc(t)};case o.TokenKind.STRING:case o.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case o.TokenKind.NAME:switch(this._lexer.advance(),t.value){case"true":return{kind:i.Kind.BOOLEAN,value:!0,loc:this.loc(t)};case"false":return{kind:i.Kind.BOOLEAN,value:!1,loc:this.loc(t)};case"null":return{kind:i.Kind.NULL,loc:this.loc(t)};default:return{kind:i.Kind.ENUM,value:t.value,loc:this.loc(t)}}case o.TokenKind.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:i.Kind.STRING,value:e.value,block:e.kind===o.TokenKind.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,r=this._lexer.token;return{kind:i.Kind.LIST,values:this.any(o.TokenKind.BRACKET_L,(function(){return t.parseValueLiteral(e)}),o.TokenKind.BRACKET_R),loc:this.loc(r)}},t.parseObject=function(e){var t=this,r=this._lexer.token;return{kind:i.Kind.OBJECT,fields:this.any(o.TokenKind.BRACE_L,(function(){return t.parseObjectField(e)}),o.TokenKind.BRACE_R),loc:this.loc(r)}},t.parseObjectField=function(e){var t=this._lexer.token,r=this.parseName();return this.expectToken(o.TokenKind.COLON),{kind:i.Kind.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(o.TokenKind.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(o.TokenKind.AT),{kind:i.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return this.expectOptionalToken(o.TokenKind.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(o.TokenKind.BRACKET_R),e={kind:i.Kind.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(o.TokenKind.BANG)?{kind:i.Kind.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:i.Kind.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},t.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===o.TokenKind.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},t.peekDescription=function(){return this.peek(o.TokenKind.STRING)||this.peek(o.TokenKind.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");var r=this.parseDirectives(!0),n=this.many(o.TokenKind.BRACE_L,this.parseOperationTypeDefinition,o.TokenKind.BRACE_R);return{kind:i.Kind.SCHEMA_DEFINITION,description:t,directives:r,operationTypes:n,loc:this.loc(e)}},t.parseOperationTypeDefinition=function(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(o.TokenKind.COLON);var r=this.parseNamedType();return{kind:i.Kind.OPERATION_TYPE_DEFINITION,operation:t,type:r,loc:this.loc(e)}},t.parseScalarTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var r=this.parseName(),n=this.parseDirectives(!0);return{kind:i.Kind.SCALAR_TYPE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var r=this.parseName(),n=this.parseImplementsInterfaces(),a=this.parseDirectives(!0),o=this.parseFieldsDefinition();return{kind:i.Kind.OBJECT_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:a,fields:o,loc:this.loc(e)}},t.parseImplementsInterfaces=function(){var e;if(!this.expectOptionalKeyword("implements"))return[];if(!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLImplementsInterfaces)){var t=[];this.expectOptionalToken(o.TokenKind.AMP);do{t.push(this.parseNamedType())}while(this.expectOptionalToken(o.TokenKind.AMP)||this.peek(o.TokenKind.NAME));return t}return this.delimitedMany(o.TokenKind.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var e;return!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLEmptyFields)&&this.peek(o.TokenKind.BRACE_L)&&this._lexer.lookahead().kind===o.TokenKind.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(o.TokenKind.BRACE_L,this.parseFieldDefinition,o.TokenKind.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseArgumentDefs();this.expectToken(o.TokenKind.COLON);var a=this.parseTypeReference(),s=this.parseDirectives(!0);return{kind:i.Kind.FIELD_DEFINITION,description:t,name:r,arguments:n,type:a,directives:s,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(o.TokenKind.PAREN_L,this.parseInputValueDef,o.TokenKind.PAREN_R)},t.parseInputValueDef=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName();this.expectToken(o.TokenKind.COLON);var n,a=this.parseTypeReference();this.expectOptionalToken(o.TokenKind.EQUALS)&&(n=this.parseValueLiteral(!0));var s=this.parseDirectives(!0);return{kind:i.Kind.INPUT_VALUE_DEFINITION,description:t,name:r,type:a,defaultValue:n,directives:s,loc:this.loc(e)}},t.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var r=this.parseName(),n=this.parseImplementsInterfaces(),a=this.parseDirectives(!0),o=this.parseFieldsDefinition();return{kind:i.Kind.INTERFACE_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:a,fields:o,loc:this.loc(e)}},t.parseUnionTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var r=this.parseName(),n=this.parseDirectives(!0),a=this.parseUnionMemberTypes();return{kind:i.Kind.UNION_TYPE_DEFINITION,description:t,name:r,directives:n,types:a,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(o.TokenKind.EQUALS)?this.delimitedMany(o.TokenKind.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var r=this.parseName(),n=this.parseDirectives(!0),a=this.parseEnumValuesDefinition();return{kind:i.Kind.ENUM_TYPE_DEFINITION,description:t,name:r,directives:n,values:a,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(o.TokenKind.BRACE_L,this.parseEnumValueDefinition,o.TokenKind.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseDirectives(!0);return{kind:i.Kind.ENUM_VALUE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var r=this.parseName(),n=this.parseDirectives(!0),a=this.parseInputFieldsDefinition();return{kind:i.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:r,directives:n,fields:a,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(o.TokenKind.BRACE_L,this.parseInputValueDef,o.TokenKind.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===o.TokenKind.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},t.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),r=this.optionalMany(o.TokenKind.BRACE_L,this.parseOperationTypeDefinition,o.TokenKind.BRACE_R);if(0===t.length&&0===r.length)throw this.unexpected();return{kind:i.Kind.SCHEMA_EXTENSION,directives:t,operationTypes:r,loc:this.loc(e)}},t.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),r=this.parseDirectives(!0);if(0===r.length)throw this.unexpected();return{kind:i.Kind.SCALAR_TYPE_EXTENSION,name:t,directives:r,loc:this.loc(e)}},t.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),a=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===a.length)throw this.unexpected();return{kind:i.Kind.OBJECT_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:a,loc:this.loc(e)}},t.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),a=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===a.length)throw this.unexpected();return{kind:i.Kind.INTERFACE_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:a,loc:this.loc(e)}},t.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseUnionMemberTypes();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:i.Kind.UNION_TYPE_EXTENSION,name:t,directives:r,types:n,loc:this.loc(e)}},t.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseEnumValuesDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:i.Kind.ENUM_TYPE_EXTENSION,name:t,directives:r,values:n,loc:this.loc(e)}},t.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseInputFieldsDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:i.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:r,fields:n,loc:this.loc(e)}},t.parseDirectiveDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(o.TokenKind.AT);var r=this.parseName(),n=this.parseArgumentDefs(),a=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var s=this.parseDirectiveLocations();return{kind:i.Kind.DIRECTIVE_DEFINITION,description:t,name:r,arguments:n,repeatable:a,locations:s,loc:this.loc(e)}},t.parseDirectiveLocations=function(){return this.delimitedMany(o.TokenKind.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==c.DirectiveLocation[t.value])return t;throw this.unexpected(e)},t.loc=function(e){var t;if(!0!==(null===(t=this._options)||void 0===t?void 0:t.noLocation))return new a.Location(e,this._lexer.lastToken,this._lexer.source)},t.peek=function(e){return this._lexer.token.kind===e},t.expectToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw(0,n.syntaxError)(this._lexer.source,t.start,"Expected ".concat(p(e),", found ").concat(d(t),"."))},t.expectOptionalToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},t.expectKeyword=function(e){var t=this._lexer.token;if(t.kind!==o.TokenKind.NAME||t.value!==e)throw(0,n.syntaxError)(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(d(t),"."));this._lexer.advance()},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===o.TokenKind.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=null!=e?e:this._lexer.token;return(0,n.syntaxError)(this._lexer.source,t.start,"Unexpected ".concat(d(t),"."))},t.any=function(e,t,r){this.expectToken(e);for(var n=[];!this.expectOptionalToken(r);)n.push(t.call(this));return n},t.optionalMany=function(e,t,r){if(this.expectOptionalToken(e)){var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n}return[]},t.many=function(e,t,r){this.expectToken(e);var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n},t.delimitedMany=function(e,t){this.expectOptionalToken(e);var r=[];do{r.push(t.call(this))}while(this.expectOptionalToken(e));return r},e}();function d(e){var t=e.value;return p(e.kind)+(null!=t?' "'.concat(t,'"'):"")}function p(e){return(0,u.isPunctuatorTokenKind)(e)?'"'.concat(e,'"'):e}t.Parser=l},39187:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDefinitionNode=function(e){return i(e)||a(e)||s(e)},t.isExecutableDefinitionNode=i,t.isSelectionNode=function(e){return e.kind===n.Kind.FIELD||e.kind===n.Kind.FRAGMENT_SPREAD||e.kind===n.Kind.INLINE_FRAGMENT},t.isValueNode=function(e){return e.kind===n.Kind.VARIABLE||e.kind===n.Kind.INT||e.kind===n.Kind.FLOAT||e.kind===n.Kind.STRING||e.kind===n.Kind.BOOLEAN||e.kind===n.Kind.NULL||e.kind===n.Kind.ENUM||e.kind===n.Kind.LIST||e.kind===n.Kind.OBJECT},t.isTypeNode=function(e){return e.kind===n.Kind.NAMED_TYPE||e.kind===n.Kind.LIST_TYPE||e.kind===n.Kind.NON_NULL_TYPE},t.isTypeSystemDefinitionNode=a,t.isTypeDefinitionNode=o,t.isTypeSystemExtensionNode=s,t.isTypeExtensionNode=c;var n=r(7030);function i(e){return e.kind===n.Kind.OPERATION_DEFINITION||e.kind===n.Kind.FRAGMENT_DEFINITION}function a(e){return e.kind===n.Kind.SCHEMA_DEFINITION||o(e)||e.kind===n.Kind.DIRECTIVE_DEFINITION}function o(e){return e.kind===n.Kind.SCALAR_TYPE_DEFINITION||e.kind===n.Kind.OBJECT_TYPE_DEFINITION||e.kind===n.Kind.INTERFACE_TYPE_DEFINITION||e.kind===n.Kind.UNION_TYPE_DEFINITION||e.kind===n.Kind.ENUM_TYPE_DEFINITION||e.kind===n.Kind.INPUT_OBJECT_TYPE_DEFINITION}function s(e){return e.kind===n.Kind.SCHEMA_EXTENSION||c(e)}function c(e){return e.kind===n.Kind.SCALAR_TYPE_EXTENSION||e.kind===n.Kind.OBJECT_TYPE_EXTENSION||e.kind===n.Kind.INTERFACE_TYPE_EXTENSION||e.kind===n.Kind.UNION_TYPE_EXTENSION||e.kind===n.Kind.ENUM_TYPE_EXTENSION||e.kind===n.Kind.INPUT_OBJECT_TYPE_EXTENSION}},40825:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.printLocation=function(e){return i(e.source,(0,n.getLocation)(e.source,e.start))},t.printSourceLocation=i;var n=r(99530);function i(e,t){var r=e.locationOffset.column-1,n=o(r)+e.body,i=t.line-1,s=e.locationOffset.line-1,c=t.line+s,u=1===t.line?r:0,l=t.column+u,d="".concat(e.name,":").concat(c,":").concat(l,"\n"),p=n.split(/\r\n|[\n\r]/g),h=p[i];if(h.length>120){for(var f=Math.floor(l/80),y=l%80,g=[],m=0;m{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.print=function(e){return(0,n.visit)(e,{leave:a})};var n=r(9111),i=r(69165),a={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return s(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,r=e.name,n=u("(",s(e.variableDefinitions,", "),")"),i=s(e.directives," "),a=e.selectionSet;return r||i||n||"query"!==t?s([t,s([r,n]),i,a]," "):a},VariableDefinition:function(e){var t=e.variable,r=e.type,n=e.defaultValue,i=e.directives;return t+": "+r+u(" = ",n)+u(" ",s(i," "))},SelectionSet:function(e){return c(e.selections)},Field:function(e){var t=e.alias,r=e.name,n=e.arguments,i=e.directives,a=e.selectionSet,o=u("",t,": ")+r,c=o+u("(",s(n,", "),")");return c.length>80&&(c=o+u("(\n",l(s(n,"\n")),"\n)")),s([c,s(i," "),a]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+u(" ",s(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,r=e.directives,n=e.selectionSet;return s(["...",u("on ",t),s(r," "),n]," ")},FragmentDefinition:function(e){var t=e.name,r=e.typeCondition,n=e.variableDefinitions,i=e.directives,a=e.selectionSet;return"fragment ".concat(t).concat(u("(",s(n,", "),")")," ")+"on ".concat(r," ").concat(u("",s(i," ")," "))+a},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var r=e.value;return e.block?(0,i.printBlockString)(r,"description"===t?"":" "):JSON.stringify(r)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+s(e.values,", ")+"]"},ObjectValue:function(e){return"{"+s(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+u("(",s(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:o((function(e){var t=e.directives,r=e.operationTypes;return s(["schema",s(t," "),c(r)]," ")})),OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:o((function(e){return s(["scalar",e.name,s(e.directives," ")]," ")})),ObjectTypeDefinition:o((function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return s(["type",t,u("implements ",s(r," & ")),s(n," "),c(i)]," ")})),FieldDefinition:o((function(e){var t=e.name,r=e.arguments,n=e.type,i=e.directives;return t+(p(r)?u("(\n",l(s(r,"\n")),"\n)"):u("(",s(r,", "),")"))+": "+n+u(" ",s(i," "))})),InputValueDefinition:o((function(e){var t=e.name,r=e.type,n=e.defaultValue,i=e.directives;return s([t+": "+r,u("= ",n),s(i," ")]," ")})),InterfaceTypeDefinition:o((function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return s(["interface",t,u("implements ",s(r," & ")),s(n," "),c(i)]," ")})),UnionTypeDefinition:o((function(e){var t=e.name,r=e.directives,n=e.types;return s(["union",t,s(r," "),n&&0!==n.length?"= "+s(n," | "):""]," ")})),EnumTypeDefinition:o((function(e){var t=e.name,r=e.directives,n=e.values;return s(["enum",t,s(r," "),c(n)]," ")})),EnumValueDefinition:o((function(e){return s([e.name,s(e.directives," ")]," ")})),InputObjectTypeDefinition:o((function(e){var t=e.name,r=e.directives,n=e.fields;return s(["input",t,s(r," "),c(n)]," ")})),DirectiveDefinition:o((function(e){var t=e.name,r=e.arguments,n=e.repeatable,i=e.locations;return"directive @"+t+(p(r)?u("(\n",l(s(r,"\n")),"\n)"):u("(",s(r,", "),")"))+(n?" repeatable":"")+" on "+s(i," | ")})),SchemaExtension:function(e){var t=e.directives,r=e.operationTypes;return s(["extend schema",s(t," "),c(r)]," ")},ScalarTypeExtension:function(e){return s(["extend scalar",e.name,s(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return s(["extend type",t,u("implements ",s(r," & ")),s(n," "),c(i)]," ")},InterfaceTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return s(["extend interface",t,u("implements ",s(r," & ")),s(n," "),c(i)]," ")},UnionTypeExtension:function(e){var t=e.name,r=e.directives,n=e.types;return s(["extend union",t,s(r," "),n&&0!==n.length?"= "+s(n," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,r=e.directives,n=e.values;return s(["extend enum",t,s(r," "),c(n)]," ")},InputObjectTypeExtension:function(e){var t=e.name,r=e.directives,n=e.fields;return s(["extend input",t,s(r," "),c(n)]," ")}};function o(e){return function(t){return s([t.description,e(t)],"\n")}}function s(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null==e?void 0:e.filter((function(e){return e})).join(r))&&void 0!==t?t:""}function c(e){return u("{\n",l(s(e,"\n")),"\n}")}function u(e,t){return null!=t&&""!==t?e+t+(arguments.length>2&&void 0!==arguments[2]?arguments[2]:""):""}function l(e){return u(" ",e.replace(/\n/g,"\n "))}function d(e){return-1!==e.indexOf("\n")}function p(e){return null!=e&&e.some(d)}},46876:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSource=function(e){return(0,o.default)(e,u)},t.Source=void 0;var n=r(25888),i=s(r(29657)),a=s(r(93028)),o=s(r(79527));function s(e){return e&&e.__esModule?e:{default:e}}function c(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"GraphQL request",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{line:1,column:1};"string"==typeof e||(0,a.default)(0,"Body must be a string. Received: ".concat((0,i.default)(e),".")),this.body=e,this.name=t,this.locationOffset=r,this.locationOffset.line>0||(0,a.default)(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,a.default)(0,"column in locationOffset is 1-indexed and must be positive.")}var t,r;return t=e,(r=[{key:n.SYMBOL_TO_STRING_TAG,get:function(){return"Source"}}])&&c(t.prototype,r),e}();t.Source=u},73038:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenKind=void 0;var r=Object.freeze({SOF:"",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});t.TokenKind=r},9111:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.visit=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=void 0,u=Array.isArray(e),l=[e],d=-1,p=[],h=void 0,f=void 0,y=void 0,g=[],m=[],b=e;do{var v=++d===l.length,_=v&&0!==p.length;if(v){if(f=0===m.length?void 0:g[g.length-1],h=y,y=m.pop(),_){if(u)h=h.slice();else{for(var w={},O=0,T=Object.keys(h);O{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SYMBOL_TO_STRING_TAG=t.SYMBOL_ASYNC_ITERATOR=t.SYMBOL_ITERATOR=void 0;var r="function"==typeof Symbol&&null!=Symbol.iterator?Symbol.iterator:"@@iterator";t.SYMBOL_ITERATOR=r;var n="function"==typeof Symbol&&null!=Symbol.asyncIterator?Symbol.asyncIterator:"@@asyncIterator";t.SYMBOL_ASYNC_ITERATOR=n;var i="function"==typeof Symbol&&null!=Symbol.toStringTag?Symbol.toStringTag:"@@toStringTag";t.SYMBOL_TO_STRING_TAG=i},77952:(e,t,r)=>{var n=t;n.utils=r(67426),n.common=r(66166),n.sha=r(46229),n.ripemd=r(46784),n.hmac=r(28948),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},66166:(e,t,r)=>{"use strict";var n=r(67426),i=r(43349);function a(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=a,a.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a{"use strict";var n=r(67426),i=r(43349);function a(e,t,r){if(!(this instanceof a))return new a(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=a,a.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t{"use strict";var n=r(67426),i=r(66166),a=n.rotl32,o=n.sum32,s=n.sum32_3,c=n.sum32_4,u=i.BlockHash;function l(){if(!(this instanceof l))return new l;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function d(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function p(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function h(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(l,u),t.ripemd160=l,l.blockSize=512,l.outSize=160,l.hmacStrength=192,l.padLength=64,l.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],u=this.h[3],l=this.h[4],b=r,v=n,_=i,w=u,O=l,T=0;T<80;T++){var S=o(a(c(r,d(T,n,i,u),e[f[T]+t],p(T)),g[T]),l);r=l,l=u,u=a(i,10),i=n,n=S,S=o(a(c(b,d(79-T,v,_,w),e[y[T]+t],h(T)),m[T]),O),b=O,O=w,w=a(_,10),_=v,v=S}S=s(this.h[1],i,w),this.h[1]=s(this.h[2],u,O),this.h[2]=s(this.h[3],l,b),this.h[3]=s(this.h[4],r,v),this.h[4]=s(this.h[0],n,_),this.h[0]=S},l.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var f=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],y=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],g=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],m=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},46229:(e,t,r)=>{"use strict";t.sha1=r(43917),t.sha224=r(47714),t.sha256=r(2287),t.sha384=r(21911),t.sha512=r(57766)},43917:(e,t,r)=>{"use strict";var n=r(67426),i=r(66166),a=r(66225),o=n.rotl32,s=n.sum32,c=n.sum32_5,u=a.ft_1,l=i.BlockHash,d=[1518500249,1859775393,2400959708,3395469782];function p(){if(!(this instanceof p))return new p;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(p,l),e.exports=p,p.blockSize=512,p.outSize=160,p.hmacStrength=80,p.padLength=64,p.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n{"use strict";var n=r(67426),i=r(2287);function a(){if(!(this instanceof a))return new a;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(a,i),e.exports=a,a.blockSize=512,a.outSize=224,a.hmacStrength=192,a.padLength=64,a.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},2287:(e,t,r)=>{"use strict";var n=r(67426),i=r(66166),a=r(66225),o=r(43349),s=n.sum32,c=n.sum32_4,u=n.sum32_5,l=a.ch32,d=a.maj32,p=a.s0_256,h=a.s1_256,f=a.g0_256,y=a.g1_256,g=i.BlockHash,m=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function b(){if(!(this instanceof b))return new b;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}n.inherits(b,g),e.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n{"use strict";var n=r(67426),i=r(57766);function a(){if(!(this instanceof a))return new a;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(a,i),e.exports=a,a.blockSize=1024,a.outSize=384,a.hmacStrength=192,a.padLength=128,a.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},57766:(e,t,r)=>{"use strict";var n=r(67426),i=r(66166),a=r(43349),o=n.rotr64_hi,s=n.rotr64_lo,c=n.shr64_hi,u=n.shr64_lo,l=n.sum64,d=n.sum64_hi,p=n.sum64_lo,h=n.sum64_4_hi,f=n.sum64_4_lo,y=n.sum64_5_hi,g=n.sum64_5_lo,m=i.BlockHash,b=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function v(){if(!(this instanceof v))return new v;m.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=b,this.W=new Array(160)}function _(e,t,r,n,i){var a=e&r^~e&i;return a<0&&(a+=4294967296),a}function w(e,t,r,n,i,a){var o=t&n^~t&a;return o<0&&(o+=4294967296),o}function O(e,t,r,n,i){var a=e&r^e&i^r&i;return a<0&&(a+=4294967296),a}function T(e,t,r,n,i,a){var o=t&n^t&a^n&a;return o<0&&(o+=4294967296),o}function S(e,t){var r=o(e,t,28)^o(t,e,2)^o(t,e,7);return r<0&&(r+=4294967296),r}function E(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function x(e,t){var r=s(e,t,14)^s(e,t,18)^s(t,e,9);return r<0&&(r+=4294967296),r}function I(e,t){var r=o(e,t,1)^o(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function A(e,t){var r=s(e,t,1)^s(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function j(e,t){var r=s(e,t,19)^s(t,e,29)^u(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(v,m),e.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n{"use strict";var n=r(67426).rotr32;function i(e,t,r){return e&t^~e&r}function a(e,t,r){return e&t^e&r^t&r}function o(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?o(t,r,n):2===e?a(t,r,n):void 0},t.ch32=i,t.maj32=a,t.p32=o,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},67426:(e,t,r)=>{"use strict";var n=r(43349),i=r(56698);function a(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function c(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i>6|192,r[n++]=63&o|128):a(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(i=0;i>>0}return o},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=255&a):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=255&a)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],a=n+e[t+1]>>>0,o=(a>>0,e[t+1]=a},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,a,o,s){var c=0,u=t;return c+=(u=u+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,i,a,o,s){return t+n+a+s>>>0},t.sum64_5_hi=function(e,t,r,n,i,a,o,s,c,u){var l=0,d=t;return l+=(d=d+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,i,a,o,s,c,u){return t+n+a+s+u>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},2384:e=>{"use strict";var t=/^utf-?8|ascii|utf-?16-?le|ucs-?2|base-?64|latin-?1$/i,r=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,n=/\s|\uFEFF|\xA0/,i=/\r?\n[\x20\x09]+/g,a=/[;,"]/,o=/[;,"]|\s/,s=/^[!#$%&'*+\-\.^_`|~\da-zA-Z]+$/;function c(e){return e.replace(r,"")}function u(e){return n.test(e)}function l(e,t){for(;u(e[t]);)t++;return t}function d(e){return o.test(e)||!s.test(e)}class p{constructor(e){this.refs=[],e&&this.parse(e)}rel(e){for(var t=[],r=e.toLowerCase(),n=0;n{return r=t,n=e,Object.keys(r).length===Object.keys(n).length&&Object.keys(r).every((e=>e in n&&r[e]===n[e]));var r,n}))||this.refs.push(e),this}has(e,t){e=e.toLowerCase(),t=t.toLowerCase();for(var r=0;r",t)))throw new Error("Expected end of URI delimiter at offset "+t);o={uri:e.slice(t+1,h)},t=h,r=2,t++}else if(2===r){if(u(e[t])){t++;continue}if(";"===e[t])r=4,t++;else{if(","!==e[t])throw new Error('Unexpected character "'+e[t]+'" at offset '+t);r=1,t++}}else{if(4!==r)throw new Error('Unknown parser state "'+r+'"');if(";"===e[t]||u(e[t])){t++;continue}-1===(h=e.indexOf("=",t))&&(h=e.indexOf(";",t)),-1===h&&(h=e.length);var s=c(e.slice(t,h)).toLowerCase(),d="";if('"'===e[t=l(e,t=h+1)])for(t++;t"),e.push(t);return e.join(", ")}}p.isCompatibleEncoding=function(e){return t.test(e)},p.parse=function(e,t){return(new p).parse(e,t)},p.isSingleOccurenceAttr=function(e){return"rel"===e||"type"===e||"media"===e||"title"===e||"title*"===e},p.isTokenAttr=function(e){return"rel"===e||"type"===e||"anchor"===e},p.escapeQuotes=function(e){return e.replace(/"/g,'\\"')},p.expandRelations=function(e){return e.rel.split(" ").map((function(t){var r=Object.assign({},e);return r.rel=t,r}))},p.parseExtendedValue=function(e){var t=/([^']+)?(?:'([^']*)')?(.+)/.exec(e);return{language:t[2].toLowerCase(),encoding:p.isCompatibleEncoding(t[1])?null:t[1].toLowerCase(),value:p.isCompatibleEncoding(t[1])?decodeURIComponent(t[3]):t[3]}},p.formatExtendedAttribute=function(e,t){var r=(t.encoding||"utf-8").toUpperCase();return e+"="+r+"'"+(t.language||"en")+"'"+(Buffer.isBuffer(t.value)&&p.isCompatibleEncoding(r)?t.value.toString(r):Buffer.isBuffer(t.value)?t.value.toString("hex").replace(/[0-9a-f]{2}/gi,"%$1"):encodeURIComponent(t.value))},p.formatAttribute=function(e,t){return Array.isArray(t)?t.map((t=>p.formatAttribute(e,t))).join("; "):"*"===e[e.length-1]||"string"!=typeof t?p.formatExtendedAttribute(e,t):(p.isTokenAttr(e)?t=d(t)?'"'+p.escapeQuotes(t)+'"':p.escapeQuotes(t):d(t)&&(t='"'+(t=(t=encodeURIComponent(t)).replace(/%20/g," ").replace(/%2C/g,",").replace(/%3B/g,";"))+'"'),e+"="+t)},e.exports=p},251:(e,t)=>{t.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,c=(1<>1,l=-7,d=r?i-1:0,p=r?-1:1,h=e[t+d];for(d+=p,a=h&(1<<-l)-1,h>>=-l,l+=s;l>0;a=256*a+e[t+d],d+=p,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=256*o+e[t+d],d+=p,l-=8);if(0===a)a=1-u;else{if(a===c)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,n),a-=u}return(h?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,c,u=8*a-i-1,l=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:a-1,f=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+d>=1?p/c:p*Math.pow(2,1-d))*c>=2&&(o++,c/=2),o+d>=l?(s=0,o=l):o+d>=1?(s=(t*c-1)*Math.pow(2,i),o+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[r+h]=255&s,h+=f,s/=256,i-=8);for(o=o<0;e[r+h]=255&o,h+=f,o/=256,u-=8);e[r+h-f]|=128*y}},49568:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Collection:()=>S,Iterable:()=>Sn,List:()=>ir,Map:()=>Ft,OrderedMap:()=>br,OrderedSet:()=>on,PairSorting:()=>dn,Range:()=>$r,Record:()=>pn,Repeat:()=>vn,Seq:()=>H,Set:()=>Cr,Stack:()=>Sr,default:()=>En,fromJS:()=>_n,get:()=>it,getIn:()=>qr,has:()=>nt,hasIn:()=>Gr,hash:()=>he,is:()=>ue,isAssociative:()=>T,isCollection:()=>b,isImmutable:()=>D,isIndexed:()=>O,isKeyed:()=>_,isList:()=>nr,isMap:()=>oe,isOrdered:()=>F,isOrderedMap:()=>se,isOrderedSet:()=>Rr,isPlainObject:()=>et,isRecord:()=>R,isSeq:()=>j,isSet:()=>Nr,isStack:()=>Tr,isValueObject:()=>ce,merge:()=>_t,mergeDeep:()=>Ot,mergeDeepWith:()=>Tt,mergeWith:()=>wt,remove:()=>ot,removeIn:()=>pt,set:()=>st,setIn:()=>lt,update:()=>ft,updateIn:()=>ct,version:()=>Tn});var n="delete",i=32,a=31,o={};function s(e){e&&(e.value=!0)}function c(){}function u(e){return void 0===e.size&&(e.size=e.__iterate(d)),e.size}function l(e,t){if("number"!=typeof t){var r=t>>>0;if(""+r!==t||4294967295===r)return NaN;t=r}return t<0?u(e)+t:t}function d(){return!0}function p(e,t,r){return(0===e&&!g(e)||void 0!==r&&e<=-r)&&(void 0===t||void 0!==r&&t>=r)}function h(e,t){return y(e,t,0)}function f(e,t){return y(e,t,t)}function y(e,t,r){return void 0===e?r:g(e)?t===1/0?t:0|Math.max(0,t+e):void 0===t||t===e?e:0|Math.min(t,e)}function g(e){return e<0||0===e&&1/e==-1/0}var m="@@__IMMUTABLE_ITERABLE__@@";function b(e){return Boolean(e&&e[m])}var v="@@__IMMUTABLE_KEYED__@@";function _(e){return Boolean(e&&e[v])}var w="@@__IMMUTABLE_INDEXED__@@";function O(e){return Boolean(e&&e[w])}function T(e){return _(e)||O(e)}var S=function(e){return b(e)?e:H(e)},E=function(e){function t(e){return _(e)?e:K(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(S),x=function(e){function t(e){return O(e)?e:X(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(S),I=function(e){function t(e){return b(e)&&!T(e)?e:J(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(S);S.Keyed=E,S.Indexed=x,S.Set=I;var A="@@__IMMUTABLE_SEQ__@@";function j(e){return Boolean(e&&e[A])}var N="@@__IMMUTABLE_RECORD__@@";function R(e){return Boolean(e&&e[N])}function D(e){return b(e)||R(e)}var P="@@__IMMUTABLE_ORDERED__@@";function F(e){return Boolean(e&&e[P])}var C="function"==typeof Symbol&&Symbol.iterator,M="@@iterator",L=C||M,k=function(e){this.next=e};function B(e,t,r,n){var i=0===e?t:1===e?r:[t,r];return n?n.value=i:n={value:i,done:!1},n}function U(){return{value:void 0,done:!0}}function V(e){return!!Array.isArray(e)||!!Q(e)}function $(e){return e&&"function"==typeof e.next}function q(e){var t=Q(e);return t&&t.call(e)}function Q(e){var t=e&&(C&&e[C]||e[M]);if("function"==typeof t)return t}k.prototype.toString=function(){return"[Iterator]"},k.KEYS=0,k.VALUES=1,k.ENTRIES=2,k.prototype.inspect=k.prototype.toSource=function(){return this.toString()},k.prototype[L]=function(){return this};var G=Object.prototype.hasOwnProperty;function z(e){return!(!Array.isArray(e)&&"string"!=typeof e)||e&&"object"==typeof e&&Number.isInteger(e.length)&&e.length>=0&&(0===e.length?1===Object.keys(e).length:e.hasOwnProperty(e.length-1))}var H=function(e){function t(e){return null==e?te():D(e)?e.toSeq():function(e){var t,r,n=ie(e);if(n)return(r=Q(t=e))&&r===t.entries?n.fromEntrySeq():function(e){var t=Q(e);return t&&t===e.keys}(e)?n.toSetSeq():n;if("object"==typeof e)return new Y(e);throw new TypeError("Expected Array or collection object of values, or keyed object: "+e)}(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq {","}")},t.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},t.prototype.__iterate=function(e,t){var r=this._cache;if(r){for(var n=r.length,i=0;i!==n;){var a=r[t?n-++i:i++];if(!1===e(a[1],a[0],this))break}return i}return this.__iterateUncached(e,t)},t.prototype.__iterator=function(e,t){var r=this._cache;if(r){var n=r.length,i=0;return new k((function(){if(i===n)return{value:void 0,done:!0};var a=r[t?n-++i:i++];return B(e,a[0],a[1])}))}return this.__iteratorUncached(e,t)},t}(S),K=function(e){function t(e){return null==e?te().toKeyedSeq():b(e)?_(e)?e.toSeq():e.fromEntrySeq():R(e)?e.toSeq():re(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toKeyedSeq=function(){return this},t}(H),X=function(e){function t(e){return null==e?te():b(e)?_(e)?e.entrySeq():e.toIndexedSeq():R(e)?e.toSeq().entrySeq():ne(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toIndexedSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq [","]")},t}(H),J=function(e){function t(e){return(b(e)&&!T(e)?e:X(e)).toSetSeq()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toSetSeq=function(){return this},t}(H);H.isSeq=j,H.Keyed=K,H.Set=J,H.Indexed=X,H.prototype[A]=!0;var W=function(e){function t(e){this._array=e,this.size=e.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e,t){return this.has(e)?this._array[l(this,e)]:t},t.prototype.__iterate=function(e,t){for(var r=this._array,n=r.length,i=0;i!==n;){var a=t?n-++i:i++;if(!1===e(r[a],a,this))break}return i},t.prototype.__iterator=function(e,t){var r=this._array,n=r.length,i=0;return new k((function(){if(i===n)return{value:void 0,done:!0};var a=t?n-++i:i++;return B(e,a,r[a])}))},t}(X),Y=function(e){function t(e){var t=Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]);this._object=e,this._keys=t,this.size=t.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},t.prototype.has=function(e){return G.call(this._object,e)},t.prototype.__iterate=function(e,t){for(var r=this._object,n=this._keys,i=n.length,a=0;a!==i;){var o=n[t?i-++a:a++];if(!1===e(r[o],o,this))break}return a},t.prototype.__iterator=function(e,t){var r=this._object,n=this._keys,i=n.length,a=0;return new k((function(){if(a===i)return{value:void 0,done:!0};var o=n[t?i-++a:a++];return B(e,o,r[o])}))},t}(K);Y.prototype[P]=!0;var Z,ee=function(e){function t(e){this._collection=e,this.size=e.length||e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var r=q(this._collection),n=0;if($(r))for(var i;!(i=r.next()).done&&!1!==e(i.value,n++,this););return n},t.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var r=q(this._collection);if(!$(r))return new k(U);var n=0;return new k((function(){var t=r.next();return t.done?t:B(e,n++,t.value)}))},t}(X);function te(){return Z||(Z=new W([]))}function re(e){var t=ie(e);if(t)return t.fromEntrySeq();if("object"==typeof e)return new Y(e);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+e)}function ne(e){var t=ie(e);if(t)return t;throw new TypeError("Expected Array or collection object of values: "+e)}function ie(e){return z(e)?new W(e):V(e)?new ee(e):void 0}var ae="@@__IMMUTABLE_MAP__@@";function oe(e){return Boolean(e&&e[ae])}function se(e){return oe(e)&&F(e)}function ce(e){return Boolean(e&&"function"==typeof e.equals&&"function"==typeof e.hashCode)}function ue(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!!(ce(e)&&ce(t)&&e.equals(t))}var le="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var r=65535&(e|=0),n=65535&(t|=0);return r*n+((e>>>16)*n+r*(t>>>16)<<16>>>0)|0};function de(e){return e>>>1&1073741824|3221225471&e}var pe=Object.prototype.valueOf;function he(e){if(null==e)return fe(e);if("function"==typeof e.hashCode)return de(e.hashCode(e));var t,r,n,i=(t=e).valueOf!==pe&&"function"==typeof t.valueOf?t.valueOf(t):t;if(null==i)return fe(i);switch(typeof i){case"boolean":return i?1108378657:1108378656;case"number":return function(e){if(e!=e||e===1/0)return 0;var t=0|e;for(t!==e&&(t^=4294967295*e);e>4294967295;)t^=e/=4294967295;return de(t)}(i);case"string":return i.length>Se?(void 0===(n=Ie[r=i])&&(n=ye(r),xe===Ee&&(xe=0,Ie={}),xe++,Ie[r]=n),n):ye(i);case"object":case"function":return function(e){var t;if(_e&&void 0!==(t=ve.get(e)))return t;if(void 0!==(t=e[Te]))return t;if(!me){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Te]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}if(t=be(),_e)ve.set(e,t);else{if(void 0!==ge&&!1===ge(e))throw new Error("Non-extensible objects are not allowed as keys.");if(me)Object.defineProperty(e,Te,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[Te]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[Te]=t}}return t}(i);case"symbol":return function(e){var t=we[e];return void 0!==t||(t=be(),we[e]=t),t}(i);default:if("function"==typeof i.toString)return ye(i.toString());throw new Error("Value type "+typeof i+" cannot be hashed.")}}function fe(e){return null===e?1108378658:1108378659}function ye(e){for(var t=0,r=0;r=0&&(c.get=function(t,r){return(t=l(this,t))>=0&&ta)return{value:void 0,done:!0};var e=i.next();return n||1===t||e.done?e:B(t,c-1,0===t?void 0:e.value[1],e)}))},c}function Le(e,t,r,n){var i=ze(e);return i.__iterateUncached=function(i,a){var o=this;if(a)return this.cacheResult().__iterate(i,a);var s=!0,c=0;return e.__iterate((function(e,a,u){if(!s||!(s=t.call(r,e,a,u)))return c++,i(e,n?a:c-1,o)})),c},i.__iteratorUncached=function(i,a){var o=this;if(a)return this.cacheResult().__iterator(i,a);var s=e.__iterator(2,a),c=!0,u=0;return new k((function(){var e,a,l;do{if((e=s.next()).done)return n||1===i?e:B(i,u++,0===i?void 0:e.value[1],e);var d=e.value;a=d[0],l=d[1],c&&(c=t.call(r,l,a,o))}while(c);return 2===i?e:B(i,a,l,e)}))},i}function ke(e,t,r){var n=ze(e);return n.__iterateUncached=function(i,a){if(a)return this.cacheResult().__iterate(i,a);var o=0,s=!1;return function e(c,u){c.__iterate((function(a,c){return(!t||u0}function $e(e,t,r,n){var i=ze(e),a=new W(r).map((function(e){return e.size}));return i.size=n?a.max():a.min(),i.__iterate=function(e,t){for(var r,n=this.__iterator(1,t),i=0;!(r=n.next()).done&&!1!==e(r.value,i++,this););return i},i.__iteratorUncached=function(e,i){var a=r.map((function(e){return e=S(e),q(i?e.reverse():e)})),o=0,s=!1;return new k((function(){var r;return s||(r=a.map((function(e){return e.next()})),s=n?r.every((function(e){return e.done})):r.some((function(e){return e.done}))),s?{value:void 0,done:!0}:B(e,o++,t.apply(null,r.map((function(e){return e.value}))))}))},i}function qe(e,t){return e===t?e:j(e)?t:e.constructor(t)}function Qe(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Ge(e){return _(e)?E:O(e)?x:I}function ze(e){return Object.create((_(e)?K:O(e)?X:J).prototype)}function He(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):H.prototype.cacheResult.call(this)}function Ke(e,t){return void 0===e&&void 0===t?0:void 0===e?1:void 0===t?-1:e>t?1:e0;)t[r]=arguments[r+1];if("function"!=typeof e)throw new TypeError("Invalid merger function: "+e);return vt(this,t,e)}function vt(e,t,r){for(var n=[],i=0;i0;)t[r]=arguments[r+1];return Et(e,t)}function wt(e,t){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return Et(t,r,e)}function Ot(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return St(e,t)}function Tt(e,t){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return St(t,r,e)}function St(e,t,r){return Et(e,t,function(e){return function t(r,n,i){return tt(r)&&tt(n)&&(a=n,o=H(r),s=H(a),O(o)===O(s)&&_(o)===_(s))?Et(r,[n],t):e?e(r,n,i):n;var a,o,s}}(r))}function Et(e,t,r){if(!tt(e))throw new TypeError("Cannot merge into non-data-structure value: "+e);if(D(e))return"function"==typeof r&&e.mergeWith?e.mergeWith.apply(e,[r].concat(t)):e.merge?e.merge.apply(e,t):e.concat.apply(e,t);for(var n=Array.isArray(e),i=e,a=n?x:E,o=n?function(t){i===e&&(i=at(i)),i.push(t)}:function(t,n){var a=G.call(i,n),o=a&&r?r(i[n],t,n):t;a&&o===i[n]||(i===e&&(i=at(i)),i[n]=o)},s=0;s0;)t[r]=arguments[r+1];return St(this,t,e)}function At(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return ct(this,e,zt(),(function(e){return Et(e,t)}))}function jt(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return ct(this,e,zt(),(function(e){return St(e,t)}))}function Nt(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this}function Rt(){return this.__ownerID?this:this.__ensureOwner(new c)}function Dt(){return this.__ensureOwner()}function Pt(){return this.__altered}var Ft=function(e){function t(t){return null==t?zt():oe(t)&&!F(t)?t:zt().withMutations((function(r){var n=e(t);We(n.size),n.forEach((function(e,t){return r.set(t,e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return zt().withMutations((function(t){for(var r=0;r=e.length)throw new Error("Missing value for key: "+e[r]);t.set(e[r],e[r+1])}}))},t.prototype.toString=function(){return this.__toString("Map {","}")},t.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},t.prototype.set=function(e,t){return Ht(this,e,t)},t.prototype.remove=function(e){return Ht(this,e,o)},t.prototype.deleteAll=function(e){var t=S(e);return 0===t.size?this:this.withMutations((function(e){t.forEach((function(t){return e.remove(t)}))}))},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):zt()},t.prototype.sort=function(e){return br(Be(this,e))},t.prototype.sortBy=function(e,t){return br(Be(this,t,e))},t.prototype.map=function(e,t){var r=this;return this.withMutations((function(n){n.forEach((function(i,a){n.set(a,e.call(t,i,a,r))}))}))},t.prototype.__iterator=function(e,t){return new $t(this,e,t)},t.prototype.__iterate=function(e,t){var r=this,n=0;return this._root&&this._root.iterate((function(t){return n++,e(t[1],t[0],r)}),t),n},t.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Gt(this.size,this._root,e,this.__hash):0===this.size?zt():(this.__ownerID=e,this.__altered=!1,this)},t}(E);Ft.isMap=oe;var Ct=Ft.prototype;Ct[ae]=!0,Ct[n]=Ct.remove,Ct.removeAll=Ct.deleteAll,Ct.setIn=dt,Ct.removeIn=Ct.deleteIn=ht,Ct.update=yt,Ct.updateIn=gt,Ct.merge=Ct.concat=mt,Ct.mergeWith=bt,Ct.mergeDeep=xt,Ct.mergeDeepWith=It,Ct.mergeIn=At,Ct.mergeDeepIn=jt,Ct.withMutations=Nt,Ct.wasAltered=Pt,Ct.asImmutable=Dt,Ct["@@transducer/init"]=Ct.asMutable=Rt,Ct["@@transducer/step"]=function(e,t){return e.set(t[0],t[1])},Ct["@@transducer/result"]=function(e){return e.asImmutable()};var Mt=function(e,t){this.ownerID=e,this.entries=t};Mt.prototype.get=function(e,t,r,n){for(var i=this.entries,a=0,o=i.length;a=Zt)return function(e,t,r,n){e||(e=new c);for(var i=new Ut(e,he(r),[r,n]),a=0;a>>e)&a),o=this.bitmap;return o&i?this.nodes[Wt(o&i-1)].get(e+5,t,r,n):n},Lt.prototype.update=function(e,t,r,n,s,c,u){void 0===r&&(r=he(n));var l=(0===t?r:r>>>t)&a,d=1<=er)return function(e,t,r,n,a){for(var o=0,s=new Array(i),c=0;0!==r;c++,r>>>=1)s[c]=1&r?t[o++]:void 0;return s[n]=a,new kt(e,o+1,s)}(e,y,p,l,m);if(h&&!m&&2===y.length&&Xt(y[1^f]))return y[1^f];if(h&&m&&1===y.length&&Xt(m))return m;var b=e&&e===this.ownerID,v=h?m?p:p^d:p|d,_=h?m?Yt(y,f,m,b):function(e,t,r){var n=e.length-1;if(r&&t===n)return e.pop(),e;for(var i=new Array(n),a=0,o=0;o>>e)&a,o=this.nodes[i];return o?o.get(e+5,t,r,n):n},kt.prototype.update=function(e,t,r,n,i,s,c){void 0===r&&(r=he(n));var u=(0===t?r:r>>>t)&a,l=i===o,d=this.nodes,p=d[u];if(l&&!p)return this;var h=Kt(p,e,t+5,r,n,i,s,c);if(h===p)return this;var f=this.count;if(p){if(!h&&--f>>r)&a,c=(0===r?n:n>>>r)&a,u=s===c?[Jt(e,t,r+5,n,i)]:(o=new Ut(t,n,i),s>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,127&(e+=e>>8)+(e>>16)}function Yt(e,t,r,n){var i=n?e:Xe(e);return i[t]=r,i}var Zt=8,er=16,tr=8,rr="@@__IMMUTABLE_LIST__@@";function nr(e){return Boolean(e&&e[rr])}var ir=function(e){function t(t){var r=dr();if(null==t)return r;if(nr(t))return t;var n=e(t),a=n.size;return 0===a?r:(We(a),a>0&&a=0&&e=e.size||t<0)return e.withMutations((function(e){t<0?yr(e,t).set(0,r):yr(e,0,t+1).set(t,r)}));t+=e._origin;var n=e._tail,i=e._root,a={value:!1};return t>=gr(e._capacity)?n=pr(n,e.__ownerID,0,t,r,a):i=pr(i,e.__ownerID,e._level,t,r,a),a.value?e.__ownerID?(e._root=i,e._tail=n,e.__hash=void 0,e.__altered=!0,e):lr(e._origin,e._capacity,e._level,i,n):e}(this,e,t)},t.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},t.prototype.insert=function(e,t){return this.splice(e,0,t)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=5,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):dr()},t.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations((function(r){yr(r,0,t+e.length);for(var n=0;n>>t&a;if(n>=this.array.length)return new or([],e);var i,o=0===n;if(t>0){var s=this.array[n];if((i=s&&s.removeBefore(e,t-5,r))===s&&o)return this}if(o&&!i)return this;var c=hr(this,e);if(!o)for(var u=0;u>>t&a;if(i>=this.array.length)return this;if(t>0){var o=this.array[i];if((n=o&&o.removeAfter(e,t-5,r))===o&&i===this.array.length-1)return this}var s=hr(this,e);return s.array.splice(i+1),n&&(s.array[i]=n),s};var sr,cr={};function ur(e,t){var r=e._origin,n=e._capacity,a=gr(n),o=e._tail;return function e(s,c,u){return 0===c?function(e,s){var c=s===a?o&&o.array:e&&e.array,u=s>r?0:r-s,l=n-s;return l>i&&(l=i),function(){if(u===l)return cr;var e=t?--l:u++;return c&&c[e]}}(s,u):function(a,o,s){var c,u=a&&a.array,l=s>r?0:r-s>>o,d=1+(n-s>>o);return d>i&&(d=i),function(){for(;;){if(c){var r=c();if(r!==cr)return r;c=null}if(l===d)return cr;var n=t?--d:l++;c=e(u&&u[n],o-5,s+(n<>>r&a,l=e&&u0){var d=e&&e.array[u],p=pr(d,t,r-5,n,i,o);return p===d?e:((c=hr(e,t)).array[u]=p,c)}return l&&e.array[u]===i?e:(o&&s(o),c=hr(e,t),void 0===i&&u===c.array.length-1?c.array.pop():c.array[u]=i,c)}function hr(e,t){return t&&e&&t===e.ownerID?e:new or(e?e.array.slice():[],t)}function fr(e,t){if(t>=gr(e._capacity))return e._tail;if(t<1<0;)r=r.array[t>>>n&a],n-=5;return r}}function yr(e,t,r){void 0!==t&&(t|=0),void 0!==r&&(r|=0);var n=e.__ownerID||new c,i=e._origin,o=e._capacity,s=i+t,u=void 0===r?o:r<0?o+r:i+r;if(s===i&&u===o)return e;if(s>=u)return e.clear();for(var l=e._level,d=e._root,p=0;s+p<0;)d=new or(d&&d.array.length?[void 0,d]:[],n),p+=1<<(l+=5);p&&(s+=p,i+=p,u+=p,o+=p);for(var h=gr(o),f=gr(u);f>=1<h?new or([],n):y;if(y&&f>h&&s5;b-=5){var v=h>>>b&a;m=m.array[v]=hr(m.array[v],n)}m.array[h>>>5&a]=y}if(u=f)s-=f,u-=f,l=5,d=null,g=g&&g.removeBefore(n,0,s);else if(s>i||f>>l&a;if(_!==f>>>l&a)break;_&&(p+=(1<i&&(d=d.removeBefore(n,l,s-p)),d&&f>>5<<5}var mr,br=function(e){function t(e){return null==e?_r():se(e)?e:_r().withMutations((function(t){var r=E(e);We(r.size),r.forEach((function(e,r){return t.set(r,e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("OrderedMap {","}")},t.prototype.get=function(e,t){var r=this._map.get(e);return void 0!==r?this._list.get(r)[1]:t},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):_r()},t.prototype.set=function(e,t){return wr(this,e,t)},t.prototype.remove=function(e){return wr(this,e,o)},t.prototype.__iterate=function(e,t){var r=this;return this._list.__iterate((function(t){return t&&e(t[1],t[0],r)}),t)},t.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},t.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),r=this._list.__ensureOwner(e);return e?vr(t,r,e,this.__hash):0===this.size?_r():(this.__ownerID=e,this.__altered=!1,this._map=t,this._list=r,this)},t}(Ft);function vr(e,t,r,n){var i=Object.create(br.prototype);return i.size=e?e.size:0,i._map=e,i._list=t,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function _r(){return mr||(mr=vr(zt(),dr()))}function wr(e,t,r){var n,a,s=e._map,c=e._list,u=s.get(t),l=void 0!==u;if(r===o){if(!l)return e;c.size>=i&&c.size>=2*s.size?(n=(a=c.filter((function(e,t){return void 0!==e&&u!==t}))).toKeyedSeq().map((function(e){return e[0]})).flip().toMap(),e.__ownerID&&(n.__ownerID=a.__ownerID=e.__ownerID)):(n=s.remove(t),a=u===c.size-1?c.pop():c.set(u,void 0))}else if(l){if(r===c.get(u)[1])return e;n=s,a=c.set(u,[t,r])}else n=s.set(t,c.size),a=c.set(c.size,[t,r]);return e.__ownerID?(e.size=n.size,e._map=n,e._list=a,e.__hash=void 0,e.__altered=!0,e):vr(n,a)}br.isOrderedMap=se,br.prototype[P]=!0,br.prototype[n]=br.prototype.remove;var Or="@@__IMMUTABLE_STACK__@@";function Tr(e){return Boolean(e&&e[Or])}var Sr=function(e){function t(e){return null==e?Ar():Tr(e)?e:Ar().pushAll(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("Stack [","]")},t.prototype.get=function(e,t){var r=this._head;for(e=l(this,e);r&&e--;)r=r.next;return r?r.value:t},t.prototype.peek=function(){return this._head&&this._head.value},t.prototype.push=function(){var e=arguments;if(0===arguments.length)return this;for(var t=this.size+arguments.length,r=this._head,n=arguments.length-1;n>=0;n--)r={value:e[n],next:r};return this.__ownerID?(this.size=t,this._head=r,this.__hash=void 0,this.__altered=!0,this):Ir(t,r)},t.prototype.pushAll=function(t){if(0===(t=e(t)).size)return this;if(0===this.size&&Tr(t))return t;We(t.size);var r=this.size,n=this._head;return t.__iterate((function(e){r++,n={value:e,next:n}}),!0),this.__ownerID?(this.size=r,this._head=n,this.__hash=void 0,this.__altered=!0,this):Ir(r,n)},t.prototype.pop=function(){return this.slice(1)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Ar()},t.prototype.slice=function(t,r){if(p(t,r,this.size))return this;var n=h(t,this.size);if(f(r,this.size)!==this.size)return e.prototype.slice.call(this,t,r);for(var i=this.size-n,a=this._head;n--;)a=a.next;return this.__ownerID?(this.size=i,this._head=a,this.__hash=void 0,this.__altered=!0,this):Ir(i,a)},t.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Ir(this.size,this._head,e,this.__hash):0===this.size?Ar():(this.__ownerID=e,this.__altered=!1,this)},t.prototype.__iterate=function(e,t){var r=this;if(t)return new W(this.toArray()).__iterate((function(t,n){return e(t,n,r)}),t);for(var n=0,i=this._head;i&&!1!==e(i.value,n++,this);)i=i.next;return n},t.prototype.__iterator=function(e,t){if(t)return new W(this.toArray()).__iterator(e,t);var r=0,n=this._head;return new k((function(){if(n){var t=n.value;return n=n.next,B(e,r++,t)}return{value:void 0,done:!0}}))},t}(x);Sr.isStack=Tr;var Er,xr=Sr.prototype;function Ir(e,t,r,n){var i=Object.create(xr);return i.size=e,i._head=t,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Ar(){return Er||(Er=Ir(0))}xr[Or]=!0,xr.shift=xr.pop,xr.unshift=xr.push,xr.unshiftAll=xr.pushAll,xr.withMutations=Nt,xr.wasAltered=Pt,xr.asImmutable=Dt,xr["@@transducer/init"]=xr.asMutable=Rt,xr["@@transducer/step"]=function(e,t){return e.unshift(t)},xr["@@transducer/result"]=function(e){return e.asImmutable()};var jr="@@__IMMUTABLE_SET__@@";function Nr(e){return Boolean(e&&e[jr])}function Rr(e){return Nr(e)&&F(e)}function Dr(e,t){if(e===t)return!0;if(!b(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||_(e)!==_(t)||O(e)!==O(t)||F(e)!==F(t))return!1;if(0===e.size&&0===t.size)return!0;var r=!T(e);if(F(e)){var n=e.entries();return t.every((function(e,t){var i=n.next().value;return i&&ue(i[1],e)&&(r||ue(i[0],t))}))&&n.next().done}var i=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{i=!0;var a=e;e=t,t=a}var s=!0,c=t.__iterate((function(t,n){if(r?!e.has(t):i?!ue(t,e.get(n,o)):!ue(e.get(n,o),t))return s=!1,!1}));return s&&e.size===c}function Pr(e,t){var r=function(r){e.prototype[r]=t[r]};return Object.keys(t).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(r),e}function Fr(e){if(!e||"object"!=typeof e)return e;if(!b(e)){if(!tt(e))return e;e=H(e)}if(_(e)){var t={};return e.__iterate((function(e,r){t[r]=Fr(e)})),t}var r=[];return e.__iterate((function(e){r.push(Fr(e))})),r}var Cr=function(e){function t(t){return null==t?Ur():Nr(t)&&!F(t)?t:Ur().withMutations((function(r){var n=e(t);We(n.size),n.forEach((function(e){return r.add(e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(e){return this(E(e).keySeq())},t.intersect=function(e){return(e=S(e).toArray()).length?Lr.intersect.apply(t(e.pop()),e):Ur()},t.union=function(e){return(e=S(e).toArray()).length?Lr.union.apply(t(e.pop()),e):Ur()},t.prototype.toString=function(){return this.__toString("Set {","}")},t.prototype.has=function(e){return this._map.has(e)},t.prototype.add=function(e){return kr(this,this._map.set(e,e))},t.prototype.remove=function(e){return kr(this,this._map.remove(e))},t.prototype.clear=function(){return kr(this,this._map.clear())},t.prototype.map=function(e,t){var r=this,n=!1,i=kr(this,this._map.mapEntries((function(i){var a=i[1],o=e.call(t,a,a,r);return o!==a&&(n=!0),[o,o]}),t));return n?i:this},t.prototype.union=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return 0===(t=t.filter((function(e){return 0!==e.size}))).length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations((function(r){for(var n=0;n=0&&t=0&&r>>-15,461845907),t=le(t<<13|t>>>-13,5),t=le((t=t+3864292196^e)^t>>>16,2246822507),t=de((t=le(t^t>>>13,3266489909))^t>>>16)}(e.__iterate(r?t?function(e,t){n=31*n+an(he(e),he(t))|0}:function(e,t){n=n+an(he(e),he(t))|0}:t?function(e){n=31*n+he(e)|0}:function(e){n=n+he(e)|0}),n)}(this))}});var Hr=S.prototype;Hr[m]=!0,Hr[L]=Hr.values,Hr.toJSON=Hr.toArray,Hr.__toStringMapper=rt,Hr.inspect=Hr.toSource=function(){return this.toString()},Hr.chain=Hr.flatMap,Hr.contains=Hr.includes,Pr(E,{flip:function(){return qe(this,De(this))},mapEntries:function(e,t){var r=this,n=0;return qe(this,this.toSeq().map((function(i,a){return e.call(t,[a,i],n++,r)})).fromEntrySeq())},mapKeys:function(e,t){var r=this;return qe(this,this.toSeq().flip().map((function(n,i){return e.call(t,n,i,r)})).flip())}});var Kr=E.prototype;Kr[v]=!0,Kr[L]=Hr.entries,Kr.toJSON=zr,Kr.__toStringMapper=function(e,t){return rt(t)+": "+rt(e)},Pr(x,{toKeyedSeq:function(){return new Ae(this,!1)},filter:function(e,t){return qe(this,Ce(this,e,t,!1))},findIndex:function(e,t){var r=this.findEntry(e,t);return r?r[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return qe(this,Fe(this,!1))},slice:function(e,t){return qe(this,Me(this,e,t,!1))},splice:function(e,t){var r=arguments.length;if(t=Math.max(t||0,0),0===r||2===r&&!t)return this;e=h(e,e<0?this.count():this.size);var n=this.slice(0,e);return qe(this,1===r?n:n.concat(Xe(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var r=this.findLastEntry(e,t);return r?r[0]:-1},first:function(e){return this.get(0,e)},flatten:function(e){return qe(this,ke(this,e,!1))},get:function(e,t){return(e=l(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find((function(t,r){return r===e}),void 0,t)},has:function(e){return(e=l(this,e))>=0&&(void 0!==this.size?this.size===1/0||et?-1:0}function an(e,t){return e^t+2654435769+(e<<6)+(e>>2)}Jr.has=Hr.includes,Jr.contains=Jr.includes,Jr.keys=Jr.values,Pr(K,Kr),Pr(X,Xr),Pr(J,Jr);var on=function(e){function t(e){return null==e?ln():Rr(e)?e:ln().withMutations((function(t){var r=I(e);We(r.size),r.forEach((function(e){return t.add(e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(e){return this(E(e).keySeq())},t.prototype.toString=function(){return this.__toString("OrderedSet {","}")},t}(Cr);on.isOrderedSet=Rr;var sn,cn=on.prototype;function un(e,t){var r=Object.create(cn);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}function ln(){return sn||(sn=un(_r()))}cn[P]=!0,cn.zip=Xr.zip,cn.zipWith=Xr.zipWith,cn.zipAll=Xr.zipAll,cn.__empty=ln,cn.__make=un;var dn={LeftThenRight:-1,RightThenLeft:1},pn=function(e,t){var r;!function(e){if(R(e))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(D(e))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===e||"object"!=typeof e)throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(e);var n=function(a){var o=this;if(a instanceof n)return a;if(!(this instanceof n))return new n(a);if(!r){r=!0;var s=Object.keys(e),c=i._indices={};i._name=t,i._keys=s,i._defaultValues=e;for(var u=0;u2?[]:void 0,{"":e})}function wn(e,t,r,n,i,a){if("string"!=typeof r&&!D(r)&&(z(r)||V(r)||et(r))){if(~e.indexOf(r))throw new TypeError("Cannot convert circular structure to Immutable");e.push(r),i&&""!==n&&i.push(n);var o=t.call(a,n,H(r).map((function(n,a){return wn(e,t,n,a,i,r)})),i&&i.slice());return e.pop(),i&&i.pop(),o}return r}function On(e,t){return O(t)?t.toList():_(t)?t.toMap():t.toSet()}var Tn="4.3.7",Sn=S;const En={version:Tn,Collection:S,Iterable:S,Seq:H,Map:Ft,OrderedMap:br,List:ir,Stack:Sr,Set:Cr,OrderedSet:on,PairSorting:dn,Record:pn,Range:$r,Repeat:vn,is:ue,fromJS:_n,hash:he,isImmutable:D,isCollection:b,isKeyed:_,isIndexed:O,isAssociative:T,isOrdered:F,isValueObject:ce,isPlainObject:et,isSeq:j,isList:nr,isMap:oe,isOrderedMap:se,isStack:Tr,isSet:Nr,isOrderedSet:Rr,isRecord:R,get:it,getIn:qr,has:nt,hasIn:Gr,merge:_t,mergeDeep:Ot,mergeWith:wt,mergeDeepWith:Tt,remove:ot,removeIn:pt,set:st,setIn:lt,update:ft,updateIn:ct}},24799:e=>{!function(){var t;function r(e,n){var i=this instanceof r?this:t;if(i.reset(n),"string"==typeof e&&e.length>0&&i.hash(e),i!==this)return i}r.prototype.hash=function(e){var t,r,n,i,a;switch(a=e.length,this.len+=a,r=this.k1,n=0,this.rem){case 0:r^=a>n?65535&e.charCodeAt(n++):0;case 1:r^=a>n?(65535&e.charCodeAt(n++))<<8:0;case 2:r^=a>n?(65535&e.charCodeAt(n++))<<16:0;case 3:r^=a>n?(255&e.charCodeAt(n))<<24:0,r^=a>n?(65280&e.charCodeAt(n++))>>8:0}if(this.rem=a+this.rem&3,(a-=this.rem)>0){for(t=this.h1;t=5*(t=(t^=r=13715*(r=(r=11601*r+3432906752*(65535&r)&4294967295)<<15|r>>>17)+461832192*(65535&r)&4294967295)<<13|t>>>19)+3864292196&4294967295,!(n>=a);)r=65535&e.charCodeAt(n++)^(65535&e.charCodeAt(n++))<<8^(65535&e.charCodeAt(n++))<<16,r^=(255&(i=e.charCodeAt(n++)))<<24^(65280&i)>>8;switch(r=0,this.rem){case 3:r^=(65535&e.charCodeAt(n+2))<<16;case 2:r^=(65535&e.charCodeAt(n+1))<<8;case 1:r^=65535&e.charCodeAt(n)}this.h1=t}return this.k1=r,this},r.prototype.result=function(){var e,t;return e=this.k1,t=this.h1,e>0&&(t^=e=13715*(e=(e=11601*e+3432906752*(65535&e)&4294967295)<<15|e>>>17)+461832192*(65535&e)&4294967295),t^=this.len,t=51819*(t^=t>>>16)+2246770688*(65535&t)&4294967295,t=44597*(t^=t>>>13)+3266445312*(65535&t)&4294967295,(t^=t>>>16)>>>0},r.prototype.reset=function(e){return this.h1="number"==typeof e?e:0,this.rem=this.k1=this.len=0,this},t=new r,e.exports=r}()},56698:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},31232:e=>{"use strict";const t=e=>null!==e&&"object"==typeof e&&"function"==typeof e.pipe;t.writable=e=>t(e)&&!1!==e.writable&&"function"==typeof e._write&&"object"==typeof e._writableState,t.readable=e=>t(e)&&!1!==e.readable&&"function"==typeof e._read&&"object"==typeof e._readableState,t.duplex=e=>t.writable(e)&&t.readable(e),t.transform=e=>t.duplex(e)&&"function"==typeof e._transform,e.exports=t},43549:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(77843),t),i(r(23317),t)},77843:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JsonLdSerializer=void 0;const n=r(25875),i=r(89250),a=r(23317),o=r(19198);class s extends o.Transform{constructor(e={}){super({objectMode:!0}),this.indentation=0,this.options=e,this.options.baseIRI&&!this.options.context&&(this.options.context={"@base":this.options.baseIRI}),this.options.context?(this.originalContext=this.options.context,this.context=(new n.ContextParser).parse(this.options.context,{baseIRI:this.options.baseIRI})):this.context=Promise.resolve(new n.JsonLdContextNormalized({}))}import(e){const t=new o.PassThrough({objectMode:!0});e.on("error",(e=>r.emit("error",e))),e.on("data",(e=>t.push(e))),e.on("end",(()=>t.push(null)));const r=t.pipe(new s(this.options));return r}_transform(e,t,r){this.context.then((t=>{this.transformQuad(e,t),r()})).catch(r)}async list(e){const t=await this.context;return{"@list":e.map((e=>a.Util.termToValue(e,t,this.options)))}}_flush(e){return this.opened||this.pushDocumentStart(),this.lastPredicate&&this.endPredicate(),this.lastSubject&&this.endSubject(),this.lastGraph&&"DefaultGraph"!==this.lastGraph.termType&&this.endGraph(),this.endDocument(),e(null,null)}transformQuad(e,t){this.opened||this.pushDocumentStart();const r=this.lastGraph&&"DefaultGraph"!==this.lastGraph.termType&&this.lastGraph.equals(e.subject);if(!(r||this.lastGraph&&e.graph.equals(this.lastGraph))){let r="DefaultGraph"!==e.graph.termType&&this.lastSubject&&this.lastSubject.equals(e.graph);this.lastGraph&&("DefaultGraph"!==this.lastGraph.termType?(this.endPredicate(),this.endSubject(),this.endGraph(!0),r=!1):r?(this.endPredicate(!0),this.lastSubject=null):(this.endPredicate(),this.endSubject(!0))),"DefaultGraph"!==e.graph.termType&&(r||this.pushId(e.graph,!0,t),this.pushSeparator(this.options.space?i.SeparatorType.GRAPH_FIELD_NONCOMPACT:i.SeparatorType.GRAPH_FIELD_COMPACT),this.indentation++),this.lastGraph=e.graph}this.lastSubject&&e.subject.equals(this.lastSubject)||(r?(this.endPredicate(),this.endSubject(),this.indentation--,this.pushSeparator(i.SeparatorType.ARRAY_END_COMMA),this.lastGraph=e.graph):(this.lastSubject&&(this.endPredicate(),this.endSubject(!0)),this.pushId(e.subject,!0,t)),this.lastSubject=e.subject),this.lastPredicate&&e.predicate.equals(this.lastPredicate)||(this.lastPredicate&&this.endPredicate(!0),this.pushPredicate(e.predicate,t)),this.pushObject(e.object,t)}pushDocumentStart(){this.opened=!0,this.originalContext&&!this.options.excludeContext?(this.pushSeparator(i.SeparatorType.OBJECT_START),this.indentation++,this.pushSeparator(i.SeparatorType.CONTEXT_FIELD),this.pushIndented(JSON.stringify(this.originalContext,null,this.options.space)+","),this.pushSeparator(this.options.space?i.SeparatorType.GRAPH_FIELD_NONCOMPACT:i.SeparatorType.GRAPH_FIELD_COMPACT),this.indentation++):(this.pushSeparator(i.SeparatorType.ARRAY_START),this.indentation++)}pushId(e,t,r){if("Quad"===e.termType)this.pushNestedQuad(e,!0,r);else{const n="BlankNode"===e.termType?"_:"+e.value:r.compactIri(e.value,!1);t?this.pushSeparator(i.SeparatorType.OBJECT_START):(this.push(i.SeparatorType.OBJECT_START.label),this.options.space&&this.push("\n")),this.indentation++,this.pushIndented(this.options.space?`"@id": "${n}",`:`"@id":"${n}",`)}}pushPredicate(e,t){let r=e.value;this.options.useRdfType||r!==a.Util.RDF_TYPE||(r="@type",this.objectOptions=Object.assign(Object.assign({},this.options),{compactIds:!0,vocab:!0}));const n=t.compactIri(r,!0);this.pushIndented(this.options.space?`"${n}": [`:`"${n}":[`),this.indentation++,this.lastPredicate=e}pushObject(e,t){if(this.hadObjectForPredicate?this.pushSeparator(i.SeparatorType.COMMA):this.hadObjectForPredicate=!0,"Quad"===e.termType){const r=this.lastSubject,n=this.lastPredicate;return this.hadObjectForPredicate=!1,this.pushNestedQuad(e,!1,t),this.endSubject(!1),this.hadObjectForPredicate=!0,this.lastPredicate=n,void(this.lastSubject=r)}let r;try{r=e["@list"]?e:a.Util.termToValue(e,t,this.objectOptions||this.options)}catch(e){return this.emit("error",e)}this.pushIndented(JSON.stringify(r,null,this.options.space))}pushNestedQuad(e,t,r){this.pushSeparator(i.SeparatorType.OBJECT_START),this.indentation++,this.pushIndented(this.options.space?'"@id": ':'"@id":',!1),"DefaultGraph"!==e.graph.termType&&this.emit("error",new Error(`Found a nested quad with the non-default graph: ${e.graph.value}`)),this.pushId(e.subject,!1,r),this.pushPredicate(e.predicate,r),this.pushObject(e.object,r),this.endPredicate(!1),this.endSubject(t)}endDocument(){this.opened=!1,this.originalContext&&!this.options.excludeContext?(this.indentation--,this.pushSeparator(i.SeparatorType.ARRAY_END),this.indentation--,this.pushSeparator(i.SeparatorType.OBJECT_END)):(this.indentation--,this.pushSeparator(i.SeparatorType.ARRAY_END))}endPredicate(e){this.indentation--,this.pushSeparator(e?i.SeparatorType.ARRAY_END_COMMA:i.SeparatorType.ARRAY_END),this.hadObjectForPredicate=!1,this.objectOptions=null,this.lastPredicate=null}endSubject(e){this.indentation--,this.pushSeparator(e?i.SeparatorType.OBJECT_END_COMMA:i.SeparatorType.OBJECT_END),this.lastSubject=null}endGraph(e){this.indentation--,this.pushSeparator(i.SeparatorType.ARRAY_END),this.indentation--,this.pushSeparator(e?i.SeparatorType.OBJECT_END_COMMA:i.SeparatorType.OBJECT_END),this.lastGraph=null}pushSeparator(e){this.pushIndented(e.label)}pushIndented(e,t=!0){const r=this.getIndentPrefix(),n=e.split("\n").map((e=>r+e)).join("\n");this.push(n),this.options.space&&t&&this.push("\n")}getIndentPrefix(){return this.options.space?this.options.space.repeat(this.indentation):""}}t.JsonLdSerializer=s},89250:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SeparatorType=void 0;class r{constructor(e){this.label=e}}t.SeparatorType=r,r.COMMA=new r(","),r.OBJECT_START=new r("{"),r.OBJECT_END=new r("}"),r.OBJECT_END_COMMA=new r("},"),r.ARRAY_START=new r("["),r.ARRAY_END=new r("]"),r.ARRAY_END_COMMA=new r("],"),r.GRAPH_FIELD_NONCOMPACT=new r('"@graph": ['),r.GRAPH_FIELD_COMPACT=new r('"@graph":['),r.CONTEXT_FIELD=new r('"@context":')},23317:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Util=void 0;const n=r(25875);class i{static termToValue(e,t,r={compactIds:!1,useNativeTypes:!1}){switch(e.termType){case"NamedNode":const a=t.compactIri(e.value,r.vocab);return r.compactIds?a:{"@id":a};case"DefaultGraph":return r.compactIds?e.value:{"@id":e.value};case"BlankNode":const o=`_:${e.value}`;return r.compactIds?o:{"@id":o};case"Literal":if(e.datatype.value===i.RDF_JSON){let t;try{t=JSON.parse(e.value)}catch(e){throw new n.ErrorCoded("Invalid JSON literal: "+e.message,n.ERROR_CODES.INVALID_JSON_LITERAL)}return{"@value":t,"@type":"@json"}}if("i18n-datatype"===r.rdfDirection&&e.datatype.value.startsWith(i.I18N)){const[t,r]=e.datatype.value.substr(i.I18N.length,e.datatype.value.length).split("_");return Object.assign(Object.assign({"@value":e.value},t?{"@language":t}:{}),r?{"@direction":r}:{})}const s=e.datatype.value===i.XSD_STRING,c={"@value":!s&&r.useNativeTypes?i.stringToNativeType(e.value,e.datatype.value):e.value};return e.language?Object.assign(Object.assign({},c),{"@language":e.language}):s||"string"!=typeof c["@value"]?c:Object.assign(Object.assign({},c),{"@type":e.datatype.value})}}static stringToNativeType(e,t){if(t.startsWith(i.XSD))switch(t.substr(i.XSD.length)){case"boolean":if("true"===e)return!0;if("false"===e)return!1;throw new Error(`Invalid xsd:boolean value '${e}'`);case"integer":case"number":case"int":case"byte":case"long":const t=parseInt(e,10);if(isNaN(t))throw new Error(`Invalid xsd:integer value '${e}'`);return t;case"float":case"double":const r=parseFloat(e);if(isNaN(r))throw new Error(`Invalid xsd:float value '${e}'`);return r}return e}}t.Util=i,i.XSD="http://www.w3.org/2001/XMLSchema#",i.XSD_STRING=i.XSD+"string",i.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i.RDF_TYPE=i.RDF+"type",i.RDF_JSON=i.RDF+"JSON",i.I18N="https://www.w3.org/ns/i18n#"},25875:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(41163),t),i(r(94142),t),i(r(48897),t),i(r(74482),t),i(r(64230),t),i(r(98087),t),i(r(44219),t)},41163:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContextParser=void 0;const n=r(70742),i=r(94142),a=r(48897),o=r(98087),s=r(44219);class c{constructor(e){e=e||{},this.documentLoader=e.documentLoader||new a.FetchDocumentLoader,this.documentCache={},this.validateContext=!e.skipValidation,this.expandContentTypeToBase=!!e.expandContentTypeToBase,this.remoteContextsDepthLimit=e.remoteContextsDepthLimit||32,this.redirectSchemaOrgHttps=!("redirectSchemaOrgHttps"in e)||!!e.redirectSchemaOrgHttps}static validateLanguage(e,t,r){if("string"!=typeof e)throw new i.ErrorCoded(`The value of an '@language' must be a string, got '${JSON.stringify(e)}'`,r);if(!s.Util.REGEX_LANGUAGE_TAG.test(e)){if(t)throw new i.ErrorCoded(`The value of an '@language' must be a valid language tag, got '${JSON.stringify(e)}'`,r);return!1}return!0}static validateDirection(e,t){if("string"!=typeof e)throw new i.ErrorCoded(`The value of an '@direction' must be a string, got '${JSON.stringify(e)}'`,i.ERROR_CODES.INVALID_BASE_DIRECTION);if(!s.Util.REGEX_DIRECTION_TAG.test(e)){if(t)throw new i.ErrorCoded(`The value of an '@direction' must be 'ltr' or 'rtl', got '${JSON.stringify(e)}'`,i.ERROR_CODES.INVALID_BASE_DIRECTION);return!1}return!0}idifyReverseTerms(e){for(const t of Object.keys(e)){let r=e[t];if(r&&"object"==typeof r&&r["@reverse"]&&!r["@id"]){if("string"!=typeof r["@reverse"]||s.Util.isValidKeyword(r["@reverse"]))throw new i.ErrorCoded(`Invalid @reverse value, must be absolute IRI or blank node: '${r["@reverse"]}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);r=e[t]=Object.assign(Object.assign({},r),{"@id":r["@reverse"]}),r["@id"]=r["@reverse"],s.Util.isPotentialKeyword(r["@reverse"])?delete r["@reverse"]:r["@reverse"]=!0}}return e}expandPrefixedTerms(e,t,r){const n=e.getContextRaw();for(const a of r||Object.keys(n))if(s.Util.EXPAND_KEYS_BLACKLIST.indexOf(a)<0&&!s.Util.isReservedInternalKeyword(a)){const r=n[a];if(s.Util.isPotentialKeyword(a)&&s.Util.ALIAS_DOMAIN_BLACKLIST.indexOf(a)>=0&&("@type"!==a||"object"==typeof n[a]&&!n[a]["@protected"]&&"@set"!==n[a]["@container"]))throw new i.ErrorCoded(`Keywords can not be aliased to something else.\nTried mapping ${a} to ${JSON.stringify(r)}`,i.ERROR_CODES.KEYWORD_REDEFINITION);if(s.Util.ALIAS_RANGE_BLACKLIST.indexOf(s.Util.getContextValueId(r))>=0)throw new i.ErrorCoded(`Aliasing to certain keywords is not allowed.\nTried mapping ${a} to ${JSON.stringify(r)}`,i.ERROR_CODES.INVALID_KEYWORD_ALIAS);if(r&&s.Util.isPotentialKeyword(s.Util.getContextValueId(r))&&!0===r["@prefix"])throw new i.ErrorCoded(`Tried to use keyword aliases as prefix: '${a}': '${JSON.stringify(r)}'`,i.ERROR_CODES.INVALID_TERM_DEFINITION);for(;s.Util.isPrefixValue(n[a]);){const r=n[a];let i=!1;if("string"==typeof r)n[a]=e.expandTerm(r,!0),i=i||r!==n[a];else{const o=r["@id"],c=r["@type"],u=!("@prefix"in r)||s.Util.isValidIri(a);if("@id"in r)null!=o&&"string"==typeof o&&(n[a]=Object.assign(Object.assign({},n[a]),{"@id":e.expandTerm(o,!0)}),i=i||o!==n[a]["@id"]);else if(!s.Util.isPotentialKeyword(a)&&u){const t=e.expandTerm(a,!0);t!==a&&(n[a]=Object.assign(Object.assign({},n[a]),{"@id":t}),i=!0)}if(c&&"string"==typeof c&&"@vocab"!==c&&(!r["@container"]||!r["@container"]["@type"])&&u){let r=e.expandTerm(c,!0);t&&c===r&&(r=e.expandTerm(c,!1)),r!==c&&(i=!0,n[a]=Object.assign(Object.assign({},n[a]),{"@type":r}))}}if(!i)break}}}normalize(e,{processingMode:t,normalizeLanguageTags:r}){if(r||1===t)for(const t of Object.keys(e))if("@language"===t&&"string"==typeof e[t])e[t]=e[t].toLowerCase();else{const r=e[t];if(r&&"object"==typeof r&&"string"==typeof r["@language"]){const n=r["@language"].toLowerCase();n!==r["@language"]&&(e[t]=Object.assign(Object.assign({},r),{"@language":n}))}}}containersToHash(e){for(const t of Object.keys(e)){const r=e[t];if(r&&"object"==typeof r)if("string"==typeof r["@container"])e[t]=Object.assign(Object.assign({},r),{"@container":{[r["@container"]]:!0}});else if(Array.isArray(r["@container"])){const n={};for(const e of r["@container"])n[e]=!0;e[t]=Object.assign(Object.assign({},r),{"@container":n})}}}applyScopedProtected(e,{processingMode:t},r){if(t&&t>=1.1&&e["@protected"]){for(const t of Object.keys(e))if(!s.Util.isReservedInternalKeyword(t)&&!s.Util.isPotentialKeyword(t)&&!s.Util.isTermProtected(e,t)){const n=e[t];n&&"object"==typeof n?"@protected"in e[t]||(e[t]=Object.assign(Object.assign({},e[t]),{"@protected":!0})):(e[t]={"@id":n,"@protected":!0},s.Util.isSimpleTermDefinitionPrefix(n,r)&&(e[t]=Object.assign(Object.assign({},e[t]),{"@prefix":!0})))}delete e["@protected"]}}validateKeywordRedefinitions(e,t,r,n){for(const r of null!=n?n:Object.keys(t))if(s.Util.isTermProtected(e,r)&&("string"==typeof t[r]?t[r]={"@id":t[r],"@protected":!0}:t[r]=Object.assign(Object.assign({},t[r]),{"@protected":!0}),!s.Util.deepEqual(e[r],t[r])))throw new i.ErrorCoded(`Attempted to override the protected keyword ${r} from ${JSON.stringify(s.Util.getContextValueId(e[r]))} to ${JSON.stringify(s.Util.getContextValueId(t[r]))}`,i.ERROR_CODES.PROTECTED_TERM_REDEFINITION)}validate(e,{processingMode:t}){for(const r of Object.keys(e)){if(s.Util.isReservedInternalKeyword(r))continue;if(""===r)throw new i.ErrorCoded(`The empty term is not allowed, got: '${r}': '${JSON.stringify(e[r])}'`,i.ERROR_CODES.INVALID_TERM_DEFINITION);const n=e[r],a=typeof n;if(s.Util.isPotentialKeyword(r)){switch(r.substr(1)){case"vocab":if(null!==n&&"string"!==a)throw new i.ErrorCoded(`Found an invalid @vocab IRI: ${n}`,i.ERROR_CODES.INVALID_VOCAB_MAPPING);break;case"base":if(null!==n&&"string"!==a)throw new i.ErrorCoded(`Found an invalid @base IRI: ${e[r]}`,i.ERROR_CODES.INVALID_BASE_IRI);break;case"language":null!==n&&c.validateLanguage(n,!0,i.ERROR_CODES.INVALID_DEFAULT_LANGUAGE);break;case"version":if(null!==n&&"number"!==a)throw new i.ErrorCoded(`Found an invalid @version number: ${n}`,i.ERROR_CODES.INVALID_VERSION_VALUE);break;case"direction":null!==n&&c.validateDirection(n,!0);break;case"propagate":if(1===t)throw new i.ErrorCoded(`Found an illegal @propagate keyword: ${n}`,i.ERROR_CODES.INVALID_CONTEXT_ENTRY);if(null!==n&&"boolean"!==a)throw new i.ErrorCoded(`Found an invalid @propagate value: ${n}`,i.ERROR_CODES.INVALID_PROPAGATE_VALUE)}if(s.Util.isValidKeyword(r)&&s.Util.isValidKeyword(s.Util.getContextValueId(n)))throw new i.ErrorCoded(`Illegal keyword alias in term value, found: '${r}': '${s.Util.getContextValueId(n)}'`,i.ERROR_CODES.KEYWORD_REDEFINITION)}else if(null!==n)switch(a){case"string":if(s.Util.getPrefix(n,e)===r)throw new i.ErrorCoded(`Detected cyclical IRI mapping in context entry: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.CYCLIC_IRI_MAPPING);if(s.Util.isValidIriWeak(r)){if("@type"===n)throw new i.ErrorCoded(`IRIs can not be mapped to @type, found: '${r}': '${n}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);if(s.Util.isValidIri(n)&&n!==new o.JsonLdContextNormalized(e).expandTerm(r))throw new i.ErrorCoded(`IRIs can not be mapped to other IRIs, found: '${r}': '${n}'`,i.ERROR_CODES.INVALID_IRI_MAPPING)}break;case"object":if(!(s.Util.isCompactIri(r)||"@id"in n||("@id"===n["@type"]?e["@base"]:e["@vocab"])))throw new i.ErrorCoded(`Missing @id in context entry: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);for(const u of Object.keys(n)){const l=n[u];if(l)switch(u){case"@id":if(s.Util.isValidKeyword(l)&&"@type"!==l&&"@id"!==l&&"@graph"!==l&&"@nest"!==l)throw new i.ErrorCoded(`Illegal keyword alias in term value, found: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);if(s.Util.isValidIriWeak(r)){if("@type"===l)throw new i.ErrorCoded(`IRIs can not be mapped to @type, found: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);if(s.Util.isValidIri(l)&&l!==new o.JsonLdContextNormalized(e).expandTerm(r))throw new i.ErrorCoded(`IRIs can not be mapped to other IRIs, found: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING)}if("string"!=typeof l)throw new i.ErrorCoded(`Detected non-string @id in context entry: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING);if(s.Util.getPrefix(l,e)===r)throw new i.ErrorCoded(`Detected cyclical IRI mapping in context entry: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.CYCLIC_IRI_MAPPING);break;case"@type":if("@type"===n["@container"]&&"@id"!==l&&"@vocab"!==l)throw new i.ErrorCoded(`@container: @type only allows @type: @id or @vocab, but got: '${r}': '${l}'`,i.ERROR_CODES.INVALID_TYPE_MAPPING);if("string"!=typeof l)throw new i.ErrorCoded(`The value of an '@type' must be a string, got '${JSON.stringify(a)}'`,i.ERROR_CODES.INVALID_TYPE_MAPPING);if(!("@id"===l||"@vocab"===l||1!==t&&"@json"===l||1!==t&&"@none"===l||"_"!==l[0]&&s.Util.isValidIri(l)))throw new i.ErrorCoded(`A context @type must be an absolute IRI, found: '${r}': '${l}'`,i.ERROR_CODES.INVALID_TYPE_MAPPING);break;case"@reverse":if("string"==typeof l&&n["@id"]&&n["@id"]!==l)throw new i.ErrorCoded(`Found non-matching @id and @reverse term values in '${r}':'${l}' and '${n["@id"]}'`,i.ERROR_CODES.INVALID_REVERSE_PROPERTY);if("@nest"in n)throw new i.ErrorCoded(`@nest is not allowed in the reverse property '${r}'`,i.ERROR_CODES.INVALID_REVERSE_PROPERTY);break;case"@container":if(1===t&&(Object.keys(l).length>1||s.Util.CONTAINERS_1_0.indexOf(Object.keys(l)[0])<0))throw new i.ErrorCoded(`Invalid term @container for '${r}' ('${Object.keys(l)}') in 1.0, must be only one of ${s.Util.CONTAINERS_1_0.join(", ")}`,i.ERROR_CODES.INVALID_CONTAINER_MAPPING);for(const e of Object.keys(l)){if("@list"===e&&n["@reverse"])throw new i.ErrorCoded(`Term value can not be @container: @list and @reverse at the same time on '${r}'`,i.ERROR_CODES.INVALID_REVERSE_PROPERTY);if(s.Util.CONTAINERS.indexOf(e)<0)throw new i.ErrorCoded(`Invalid term @container for '${r}' ('${e}'), must be one of ${s.Util.CONTAINERS.join(", ")}`,i.ERROR_CODES.INVALID_CONTAINER_MAPPING)}break;case"@language":c.validateLanguage(l,!0,i.ERROR_CODES.INVALID_LANGUAGE_MAPPING);break;case"@direction":c.validateDirection(l,!0);break;case"@prefix":if(null!==l&&"boolean"!=typeof l)throw new i.ErrorCoded(`Found an invalid term @prefix boolean in: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_PREFIX_VALUE);if(!("@id"in n)&&!s.Util.isValidIri(r))throw new i.ErrorCoded(`Invalid @prefix definition for '${r}' ('${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_TERM_DEFINITION);break;case"@index":if(1===t||!n["@container"]||!n["@container"]["@index"])throw new i.ErrorCoded(`Attempt to add illegal key to value object: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_TERM_DEFINITION);break;case"@nest":if(s.Util.isPotentialKeyword(l)&&"@nest"!==l)throw new i.ErrorCoded(`Found an invalid term @nest value in: '${r}': '${JSON.stringify(n)}'`,i.ERROR_CODES.INVALID_NEST_VALUE)}}break;default:throw new i.ErrorCoded(`Found an invalid term value: '${r}': '${n}'`,i.ERROR_CODES.INVALID_TERM_DEFINITION)}}}applyBaseEntry(e,t,r){return"string"==typeof e||(r&&!("@base"in e)&&t.parentContext&&"object"==typeof t.parentContext&&"@base"in t.parentContext&&(e["@base"]=t.parentContext["@base"],t.parentContext["@__baseDocument"]&&(e["@__baseDocument"]=!0)),t.baseIRI&&!t.external&&("@base"in e?null===e["@base"]||"string"!=typeof e["@base"]||s.Util.isValidIri(e["@base"])||(e["@base"]=(0,n.resolve)(e["@base"],t.parentContext&&t.parentContext["@base"]||t.baseIRI)):(e["@base"]=t.baseIRI,e["@__baseDocument"]=!0))),e}normalizeContextIri(e,t){if(!s.Util.isValidIri(e))try{e=(0,n.resolve)(e,t)}catch(t){throw new Error(`Invalid context IRI: ${e}`)}return this.redirectSchemaOrgHttps&&e.startsWith("http://schema.org")&&(e="https://schema.org/"),e}async parseInnerContexts(e,t,r){for(const n of null!=r?r:Object.keys(e)){const r=e[n];if(r&&"object"==typeof r&&"@context"in r&&null!==r["@context"]&&!t.ignoreScopedContexts){if(this.validateContext)try{const i=Object.assign(Object.assign({},e),{[n]:Object.assign({},e[n])});delete i[n]["@context"],await this.parse(r["@context"],Object.assign(Object.assign({},t),{external:!1,parentContext:i,ignoreProtection:!0,ignoreRemoteScopedContexts:!0,ignoreScopedContexts:!0}))}catch(e){throw new i.ErrorCoded(e.message,i.ERROR_CODES.INVALID_SCOPED_CONTEXT)}e[n]=Object.assign(Object.assign({},r),{"@context":(await this.parse(r["@context"],Object.assign(Object.assign({},t),{external:!1,minimalProcessing:!0,ignoreRemoteScopedContexts:!0,parentContext:e}))).getContextRaw()})}}return e}async parse(e,t={},r={}){const{baseIRI:n,parentContext:a,external:u,processingMode:l=c.DEFAULT_PROCESSING_MODE,normalizeLanguageTags:d,ignoreProtection:p,minimalProcessing:h}=t,f=t.remoteContexts||{};if(Object.keys(f).length>=this.remoteContextsDepthLimit)throw new i.ErrorCoded("Detected an overflow in remote context inclusions: "+Object.keys(f),i.ERROR_CODES.CONTEXT_OVERFLOW);if(null==e){if(!p&&a&&s.Util.hasProtectedTerms(a))throw new i.ErrorCoded("Illegal context nullification when terms are protected",i.ERROR_CODES.INVALID_CONTEXT_NULLIFICATION);return new o.JsonLdContextNormalized(this.applyBaseEntry({},t,!1))}if("string"==typeof e){const r=this.normalizeContextIri(e,n),i=this.getOverriddenLoad(r,t);if(i)return new o.JsonLdContextNormalized(i);const a=await this.parse(await this.load(r),Object.assign(Object.assign({},t),{baseIRI:r,external:!0,remoteContexts:Object.assign(Object.assign({},f),{[r]:!0})}));return this.applyBaseEntry(a.getContextRaw(),t,!0),a}if(Array.isArray(e)){const r=[],i=await Promise.all(e.map(((e,i)=>{if("string"==typeof e){const a=this.normalizeContextIri(e,n);r[i]=a;return this.getOverriddenLoad(a,t)||this.load(a)}return e})));if(h)return new o.JsonLdContextNormalized(i);const s=await i.reduce(((e,n,a)=>e.then((e=>this.parse(n,Object.assign(Object.assign({},t),{baseIRI:r[a]||t.baseIRI,external:!!r[a]||t.external,parentContext:e.getContextRaw(),remoteContexts:r[a]?Object.assign(Object.assign({},f),{[r[a]]:!0}):f}),{skipValidation:a=1.1))throw new i.ErrorCoded("Context importing is not supported in JSON-LD 1.0",i.ERROR_CODES.INVALID_CONTEXT_ENTRY);if("string"!=typeof e["@import"])throw new i.ErrorCoded("An @import value must be a string, but got "+typeof e["@import"],i.ERROR_CODES.INVALID_IMPORT_VALUE);f=await this.loadImportContext(this.normalizeContextIri(e["@import"],n)),delete e["@import"]}this.applyScopedProtected(f,{processingMode:l},o.defaultExpandOptions);const y=Object.assign(f,e);this.idifyReverseTerms(y),this.normalize(y,{processingMode:l,normalizeLanguageTags:d}),this.applyScopedProtected(y,{processingMode:l},o.defaultExpandOptions);const g=Object.keys(y),m=[];if("object"==typeof a)for(const e in a)e in y?m.push(e):y[e]=a[e];await this.parseInnerContexts(y,t,g);const b=new o.JsonLdContextNormalized(y);return(y&&y["@version"]||c.DEFAULT_PROCESSING_MODE)>=1.1&&(e["@vocab"]&&"string"==typeof e["@vocab"]||""===e["@vocab"])&&(a&&"@vocab"in a&&e["@vocab"].indexOf(":")<0?y["@vocab"]=a["@vocab"]+e["@vocab"]:(s.Util.isCompactIri(e["@vocab"])||e["@vocab"]in y)&&(y["@vocab"]=b.expandTerm(e["@vocab"],!0))),this.expandPrefixedTerms(b,this.expandContentTypeToBase,g),!p&&a&&l>=1.1&&this.validateKeywordRedefinitions(a,y,o.defaultExpandOptions,m),this.validateContext&&!r.skipValidation&&this.validate(y,{processingMode:l}),b}throw new i.ErrorCoded(`Tried parsing a context that is not a string, array or object, but got ${e}`,i.ERROR_CODES.INVALID_LOCAL_CONTEXT)}async load(e){const t=this.documentCache[e];if(t)return t;let r;try{r=await this.documentLoader.load(e)}catch(t){throw new i.ErrorCoded(`Failed to load remote context ${e}: ${t.message}`,i.ERROR_CODES.LOADING_REMOTE_CONTEXT_FAILED)}if(!("@context"in r))throw new i.ErrorCoded(`Missing @context in remote context at ${e}`,i.ERROR_CODES.INVALID_REMOTE_CONTEXT);return this.documentCache[e]=r["@context"]}getOverriddenLoad(e,t){if(e in(t.remoteContexts||{})){if(t.ignoreRemoteScopedContexts)return e;throw new i.ErrorCoded("Detected a cyclic context inclusion of "+e,i.ERROR_CODES.RECURSIVE_CONTEXT_INCLUSION)}return null}async loadImportContext(e){let t=await this.load(e);if("object"!=typeof t||Array.isArray(t))throw new i.ErrorCoded("An imported context must be a single object: "+e,i.ERROR_CODES.INVALID_REMOTE_CONTEXT);if("@import"in t)throw new i.ErrorCoded("An imported context can not import another context: "+e,i.ERROR_CODES.INVALID_CONTEXT_ENTRY);return t=Object.assign({},t),this.containersToHash(t),t}}c.DEFAULT_PROCESSING_MODE=1.1,t.ContextParser=c},94142:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERROR_CODES=t.ErrorCoded=void 0;class r extends Error{constructor(e,t){super(e),this.code=t}}var n;t.ErrorCoded=r,(n=t.ERROR_CODES||(t.ERROR_CODES={})).COLLIDING_KEYWORDS="colliding keywords",n.CONFLICTING_INDEXES="conflicting indexes",n.CYCLIC_IRI_MAPPING="cyclic IRI mapping",n.INVALID_ID_VALUE="invalid @id value",n.INVALID_INDEX_VALUE="invalid @index value",n.INVALID_NEST_VALUE="invalid @nest value",n.INVALID_PREFIX_VALUE="invalid @prefix value",n.INVALID_PROPAGATE_VALUE="invalid @propagate value",n.INVALID_REVERSE_VALUE="invalid @reverse value",n.INVALID_IMPORT_VALUE="invalid @import value",n.INVALID_VERSION_VALUE="invalid @version value",n.INVALID_BASE_IRI="invalid base IRI",n.INVALID_CONTAINER_MAPPING="invalid container mapping",n.INVALID_CONTEXT_ENTRY="invalid context entry",n.INVALID_CONTEXT_NULLIFICATION="invalid context nullification",n.INVALID_DEFAULT_LANGUAGE="invalid default language",n.INVALID_INCLUDED_VALUE="invalid @included value",n.INVALID_IRI_MAPPING="invalid IRI mapping",n.INVALID_JSON_LITERAL="invalid JSON literal",n.INVALID_KEYWORD_ALIAS="invalid keyword alias",n.INVALID_LANGUAGE_MAP_VALUE="invalid language map value",n.INVALID_LANGUAGE_MAPPING="invalid language mapping",n.INVALID_LANGUAGE_TAGGED_STRING="invalid language-tagged string",n.INVALID_LANGUAGE_TAGGED_VALUE="invalid language-tagged value",n.INVALID_LOCAL_CONTEXT="invalid local context",n.INVALID_REMOTE_CONTEXT="invalid remote context",n.INVALID_REVERSE_PROPERTY="invalid reverse property",n.INVALID_REVERSE_PROPERTY_MAP="invalid reverse property map",n.INVALID_REVERSE_PROPERTY_VALUE="invalid reverse property value",n.INVALID_SCOPED_CONTEXT="invalid scoped context",n.INVALID_SCRIPT_ELEMENT="invalid script element",n.INVALID_SET_OR_LIST_OBJECT="invalid set or list object",n.INVALID_TERM_DEFINITION="invalid term definition",n.INVALID_TYPE_MAPPING="invalid type mapping",n.INVALID_TYPE_VALUE="invalid type value",n.INVALID_TYPED_VALUE="invalid typed value",n.INVALID_VALUE_OBJECT="invalid value object",n.INVALID_VALUE_OBJECT_VALUE="invalid value object value",n.INVALID_VOCAB_MAPPING="invalid vocab mapping",n.IRI_CONFUSED_WITH_PREFIX="IRI confused with prefix",n.KEYWORD_REDEFINITION="keyword redefinition",n.LOADING_DOCUMENT_FAILED="loading document failed",n.LOADING_REMOTE_CONTEXT_FAILED="loading remote context failed",n.MULTIPLE_CONTEXT_LINK_HEADERS="multiple context link headers",n.PROCESSING_MODE_CONFLICT="processing mode conflict",n.PROTECTED_TERM_REDEFINITION="protected term redefinition",n.CONTEXT_OVERFLOW="context overflow",n.INVALID_BASE_DIRECTION="invalid base direction",n.RECURSIVE_CONTEXT_INCLUSION="recursive context inclusion",n.INVALID_STREAMING_KEY_ORDER="invalid streaming key order",n.INVALID_EMBEDDED_NODE="invalid embedded node",n.INVALID_ANNOTATION="invalid annotation"},48897:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FetchDocumentLoader=void 0;const n=r(94142),i=r(2384),a=r(70742);t.FetchDocumentLoader=class{constructor(e){this.fetcher=e}async load(e){const t=await(this.fetcher||fetch)(e,{headers:new Headers({accept:"application/ld+json"})});if(t.ok&&t.headers){let r=t.headers.get("Content-Type");if(r){const e=r.indexOf(";");e>0&&(r=r.substr(0,e))}if("application/ld+json"===r)return await t.json();if(t.headers.has("Link")){let r;if(t.headers.forEach(((t,n)=>{if("link"===n){const n=(0,i.parse)(t);for(const t of n.get("type","application/ld+json"))if("alternate"===t.rel){if(r)throw new Error("Multiple JSON-LD alternate links were found on "+e);r=(0,a.resolve)(t.uri,e)}}})),r)return this.load(r)}throw new n.ErrorCoded(`Unsupported JSON-LD media type ${r}`,n.ERROR_CODES.LOADING_DOCUMENT_FAILED)}throw new Error(t.statusText||`Status code: ${t.status}`)}}},74482:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},64230:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},98087:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultExpandOptions=t.JsonLdContextNormalized=void 0;const n=r(70742),i=r(94142),a=r(44219);t.JsonLdContextNormalized=class{constructor(e){this.contextRaw=e}getContextRaw(){return this.contextRaw}expandTerm(e,r,o=t.defaultExpandOptions){const s=this.contextRaw[e];if(null===s||s&&null===s["@id"])return null;let c=!0;if(s&&r){const t=a.Util.getContextValueId(s);if(t&&t!==e){if("string"==typeof t&&(a.Util.isValidIri(t)||a.Util.isValidKeyword(t)))return t;a.Util.isPotentialKeyword(t)||(c=!1)}}const u=a.Util.getPrefix(e,this.contextRaw),l=this.contextRaw["@vocab"],d=(!!l||""===l)&&l.indexOf(":")<0,p=this.contextRaw["@base"],h=a.Util.isPotentialKeyword(e);if(u){const t=this.contextRaw[u],r=a.Util.getContextValueId(t);if(r){if("string"!=typeof t&&o.allowPrefixForcing){if("_"!==r[0]&&!h&&!t["@prefix"]&&!(e in this.contextRaw))return e}else if(!a.Util.isSimpleTermDefinitionPrefix(r,o))return e;return r+e.substr(u.length+1)}}else{if(r&&(l||""===l||o.allowVocabRelativeToBase&&p&&d)&&!h&&!a.Util.isCompactIri(e)){if(d){if(o.allowVocabRelativeToBase)return(l||p?(0,n.resolve)(l,p):"")+e;throw new i.ErrorCoded(`Relative vocab expansion for term '${e}' with vocab '${l}' is not allowed.`,i.ERROR_CODES.INVALID_VOCAB_MAPPING)}return l+e}if(!r&&p&&!h&&!a.Util.isCompactIri(e))return(0,n.resolve)(e,p)}if(c)return e;throw new i.ErrorCoded(`Invalid IRI mapping found for context entry '${e}': '${JSON.stringify(s)}'`,i.ERROR_CODES.INVALID_IRI_MAPPING)}compactIri(e,t){if(t&&this.contextRaw["@vocab"]&&e.startsWith(this.contextRaw["@vocab"]))return e.substr(this.contextRaw["@vocab"].length);if(!t&&this.contextRaw["@base"]&&e.startsWith(this.contextRaw["@base"]))return e.substr(this.contextRaw["@base"].length);const r={prefix:"",suffix:e};for(const n in this.contextRaw){const i=this.contextRaw[n];if(i&&!a.Util.isPotentialKeyword(n)){const o=a.Util.getContextValueId(i);if(e.startsWith(o)){const i=e.substr(o.length);if(i)i.length{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Util=void 0;class r{static isCompactIri(e){return e.indexOf(":")>0&&!(e&&"#"===e[0])}static getPrefix(e,t){if(e&&"#"===e[0])return null;const r=e.indexOf(":");if(r>=0){if(e.length>r+1&&"/"===e.charAt(r+1)&&"/"===e.charAt(r+2))return null;const n=e.substr(0,r);if("_"===n)return null;if(t[n])return n}return null}static getContextValueId(e){if(null===e||"string"==typeof e)return e;return e["@id"]||null}static isSimpleTermDefinitionPrefix(e,t){return!r.isPotentialKeyword(e)&&(t.allowPrefixNonGenDelims||"string"==typeof e&&("_"===e[0]||r.isPrefixIriEndingWithGenDelim(e)))}static isPotentialKeyword(e){return"string"==typeof e&&r.KEYWORD_REGEX.test(e)}static isPrefixIriEndingWithGenDelim(e){return r.ENDS_WITH_GEN_DELIM.test(e)}static isPrefixValue(e){return e&&("string"==typeof e||e&&"object"==typeof e)}static isValidIri(e){return Boolean(e&&r.IRI_REGEX.test(e))}static isValidIriWeak(e){return!!e&&":"!==e[0]&&r.IRI_REGEX_WEAK.test(e)}static isValidKeyword(e){return r.VALID_KEYWORDS[e]}static isTermProtected(e,t){const r=e[t];return!("string"==typeof r)&&r&&r["@protected"]}static hasProtectedTerms(e){for(const t of Object.keys(e))if(r.isTermProtected(e,t))return!0;return!1}static isReservedInternalKeyword(e){return e.startsWith("@__")}static deepEqual(e,t){const r=Object.keys(e),n=Object.keys(t);return r.length===n.length&&r.every((r=>{const n=e[r],i=t[r];return n===i||null!==n&&null!==i&&"object"==typeof n&&"object"==typeof i&&this.deepEqual(n,i)}))}}r.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^ "<>{}|\\\[\]`#]*(#[^#]*)?$/,r.IRI_REGEX_WEAK=/(?::[^:])|\//,r.KEYWORD_REGEX=/^@[a-z]+$/i,r.ENDS_WITH_GEN_DELIM=/[:/?#\[\]@]$/,r.REGEX_LANGUAGE_TAG=/^[a-zA-Z]+(-[a-zA-Z0-9]+)*$/,r.REGEX_DIRECTION_TAG=/^(ltr)|(rtl)$/,r.VALID_KEYWORDS={"@annotation":!0,"@base":!0,"@container":!0,"@context":!0,"@direction":!0,"@graph":!0,"@id":!0,"@import":!0,"@included":!0,"@index":!0,"@json":!0,"@language":!0,"@list":!0,"@nest":!0,"@none":!0,"@prefix":!0,"@propagate":!0,"@protected":!0,"@reverse":!0,"@set":!0,"@type":!0,"@value":!0,"@version":!0,"@vocab":!0},r.EXPAND_KEYS_BLACKLIST=["@base","@vocab","@language","@version","@direction"],r.ALIAS_DOMAIN_BLACKLIST=["@container","@graph","@id","@index","@list","@nest","@none","@prefix","@reverse","@set","@type","@value","@version"],r.ALIAS_RANGE_BLACKLIST=["@context","@preserve"],r.CONTAINERS=["@list","@set","@index","@language","@graph","@id","@type"],r.CONTAINERS_1_0=["@list","@set","@index"],t.Util=r},47034:(e,t,r)=>{"use strict";const{isArray:n,isObject:i,isString:a}=r(7382),{asArray:o}=r(59263),{prependBase:s}=r(30470),c=r(82207),u=r(37532);function l(e){throw new c("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:e})}function d({context:e,base:t}){if(!e)return;const r=e["@context"];if(a(r))e["@context"]=s(t,r);else if(n(r))for(let e=0;e10)throw new c("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"loading remote context failed":"context overflow",max:10});if(o.has(t))throw new c("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"recursive context inclusion":"context overflow",url:t});let s,u;o.add(t);try{u=await r(t),s=u.document||null,a(s)&&(s=JSON.parse(s))}catch(e){throw new c("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(!i(s))throw new c("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":{}},u.contextUrl&&(n(s["@context"])||(s["@context"]=[s["@context"]]),s["@context"].push(u.contextUrl)),{context:s,remoteDoc:u}}}},82207:e=>{"use strict";e.exports=class extends Error{constructor(e="An unspecified JSON-LD error occurred.",t="jsonld.Error",r={}){super(e),this.name=t,this.message=e,this.details=r}}},45445: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,r){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(t,r)},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}},68229:(e,t,r)=>{"use strict";e.exports=r(28023).NQuads},73743: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]}}}},37532:(e,t,r)=>{"use strict";const n=r(1235);e.exports=class{constructor({document:e}){this.document=e,this.cache=new n({max:10})}getProcessed(e){return this.cache.get(e)}setProcessed(e,t){this.cache.set(e,t)}}},21058:(e,t,r)=>{"use strict";const n=r(82207),{isArray:i,isObject:a,isString:o,isUndefined:s}=r(7382),{isList:c,isValue:u,isGraph:l,isSimpleGraph:d,isSubjectReference:p}=r(3978),{expandIri:h,getContextValue:f,isKeyword:y,process:g,processingMode:m}=r(51972),{removeBase:b,prependBase:v}=r(30470),{REGEX_KEYWORD:_,addValue:w,asArray:O,compareShortestLeast:T}=r(59263),S={};function E(e,t,r){if("@nest"!==h(e,t,{vocab:!0},r))throw new n("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}e.exports=S,S.compact=async({activeCtx:e,activeProperty:t=null,element:r,options:h={}})=>{if(i(r)){let n=[];for(let i=0;i1&&(x=Array.from(x).sort());const I=e;for(const t of x){const r=S.compactIri({activeCtx:I,iri:t,relativeTo:{vocab:!0}}),n=f(_,r,"@context");s(n)||(e=await g({activeCtx:e,localCtx:n,options:h,propagate:!1}))}const A=Object.keys(r).sort();for(const s of A){const p=r[s];if("@id"!==s)if("@type"!==s)if("@reverse"!==s)if("@preserve"!==s)if("@index"!==s)if("@graph"!==s&&"@list"!==s&&"@included"!==s&&y(s)){const t=S.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});w(v,t,p)}else{if(!i(p))throw new n("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===p.length){const t=S.compactIri({activeCtx:e,iri:s,value:p,relativeTo:{vocab:!0},reverse:b}),r=e.mappings.has(t)?e.mappings.get(t)["@nest"]:null;let n=v;r&&(E(e,r,h),a(v[r])||(v[r]={}),n=v[r]),w(n,t,p,{propertyIsArray:!0})}for(const t of p){const r=S.compactIri({activeCtx:e,iri:s,value:t,relativeTo:{vocab:!0},reverse:b}),n=e.mappings.has(r)?e.mappings.get(r)["@nest"]:null;let p=v;n&&(E(e,n,h),a(v[n])||(v[n]={}),p=v[n]);const y=f(e,r,"@container")||[],g=l(t),m=c(t);let _;m?_=t["@list"]:g&&(_=t["@graph"]);let T=await S.compact({activeCtx:e,activeProperty:r,element:m||g?_:t,options:h});if(m){if(i(T)||(T=[T]),y.includes("@list")){w(p,r,T,{valueIsArray:!0,allowDuplicate:!0});continue}T={[S.compactIri({activeCtx:e,iri:"@list",relativeTo:{vocab:!0}})]:T},"@index"in t&&(T[S.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"])}if(g)if(y.includes("@graph")&&(y.includes("@id")||y.includes("@index")&&d(t))){let n;p.hasOwnProperty(r)?n=p[r]:p[r]=n={};const i=(y.includes("@id")?t["@id"]:t["@index"])||S.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}});w(n,i,T,{propertyIsArray:!h.compactArrays||y.includes("@set")})}else y.includes("@graph")&&d(t)?(i(T)&&T.length>1&&(T={"@included":T}),w(p,r,T,{propertyIsArray:!h.compactArrays||y.includes("@set")})):(i(T)&&1===T.length&&h.compactArrays&&(T=T[0]),T={[S.compactIri({activeCtx:e,iri:"@graph",relativeTo:{vocab:!0}})]:T},"@id"in t&&(T[S.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t["@id"]),"@index"in t&&(T[S.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"]),w(p,r,T,{propertyIsArray:!h.compactArrays||y.includes("@set")}));else if(y.includes("@language")||y.includes("@index")||y.includes("@id")||y.includes("@type")){let n,i;if(p.hasOwnProperty(r)?n=p[r]:p[r]=n={},y.includes("@language"))u(T)&&(T=T["@value"]),i=t["@language"];else if(y.includes("@index")){const n=f(e,r,"@index")||"@index",a=S.compactIri({activeCtx:e,iri:n,relativeTo:{vocab:!0}});if("@index"===n)i=t["@index"],delete T[a];else{let e;if([i,...e]=O(T[n]||[]),o(i))switch(e.length){case 0:delete T[n];break;case 1:T[n]=e[0];break;default:T[n]=e}else i=null}}else if(y.includes("@id")){const t=S.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}});i=T[t],delete T[t]}else if(y.includes("@type")){const n=S.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}});let a;switch([i,...a]=O(T[n]||[]),a.length){case 0:delete T[n];break;case 1:T[n]=a[0];break;default:T[n]=a}1===Object.keys(T).length&&"@id"in t&&(T=await S.compact({activeCtx:e,activeProperty:r,element:{"@id":t["@id"]},options:h}))}i||(i=S.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}})),w(n,i,T,{propertyIsArray:y.includes("@set")})}else{const e=!h.compactArrays||y.includes("@set")||y.includes("@list")||i(T)&&0===T.length||"@list"===s||"@graph"===s;w(p,r,T,{propertyIsArray:e})}}}else{if((f(e,t,"@container")||[]).includes("@index"))continue;const r=S.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});w(v,r,p)}else{const r=await S.compact({activeCtx:e,activeProperty:t,element:p,options:h});i(r)&&0===r.length||w(v,s,r)}else{const t=await S.compact({activeCtx:e,activeProperty:"@reverse",element:p,options:h});for(const r in t)if(e.mappings.has(r)&&e.mappings.get(r).reverse){const n=t[r],i=(f(e,r,"@container")||[]).includes("@set")||!h.compactArrays;w(v,r,n,{propertyIsArray:i}),delete t[r]}if(Object.keys(t).length>0){const r=S.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});w(v,r,t)}}else{let t=O(p).map((e=>S.compactIri({activeCtx:_,iri:e,relativeTo:{vocab:!0}})));1===t.length&&(t=t[0]);const r=S.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}}),n=(f(e,r,"@container")||[]).includes("@set")&&m(e,1.1)||i(t)&&0===p.length;w(v,r,t,{propertyIsArray:n})}else{let t=O(p).map((t=>S.compactIri({activeCtx:e,iri:t,relativeTo:{vocab:!1},base:h.base})));1===t.length&&(t=t[0]),v[S.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t}}return v}return r},S.compactIri=({activeCtx:e,iri:t,value:r=null,relativeTo:i={vocab:!1},reverse:o=!1,base:s=null})=>{if(null===t)return t;e.isPropertyTermScoped&&e.previousContext&&(e=e.previousContext);const d=e.getInverse();if(y(t)&&t in d&&"@none"in d[t]&&"@type"in d[t]["@none"]&&"@none"in d[t]["@none"]["@type"])return d[t]["@none"]["@type"]["@none"];if(i.vocab&&t in d){const n=e["@language"]||"@none",i=[];a(r)&&"@index"in r&&!("@graph"in r)&&i.push("@index","@index@set"),a(r)&&"@preserve"in r&&(r=r["@preserve"][0]),l(r)?("@index"in r&&i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in r&&i.push("@graph@id","@graph@id@set"),i.push("@graph","@graph@set","@set"),"@index"in r||i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in r||i.push("@graph@id","@graph@id@set")):a(r)&&!u(r)&&i.push("@id","@id@set","@type","@set@type");let s="@language",d="@null";if(o)s="@type",d="@reverse",i.push("@set");else if(c(r)){"@index"in r||i.push("@list");const e=r["@list"];if(0===e.length)s="@any",d="@none";else{let t=0===e.length?n:null,r=null;for(let n=0;ne.includes("_")));e&&s.push(e.replace(/^[^_]+_/,"_"))}s.push("@none");const c=e.inverse[t];for(const e of n){if(!(e in c))continue;const t=c[e][i];for(const e of s)if(e in t)return t[e]}return null}(e,t,r,i,s,d);if(null!==p)return p}if(i.vocab&&"@vocab"in e){const r=e["@vocab"];if(0===t.indexOf(r)&&t!==r){const n=t.substr(r.length);if(!e.mappings.has(n))return n}}let p=null;const h=[];let f=e.fastCurieMap;const g=t.length-1;for(let e=0;e=0;--n){const i=h[n],a=i.terms;for(const n of a){const a=n+":"+t.substr(i.iri.length);e.mappings.get(n)._prefix&&(!e.mappings.has(a)||null===r&&e.mappings.get(a)["@id"]===t)&&(null===p||T(a,p)<0)&&(p=a)}}if(null!==p)return p;for(const[r,i]of e.mappings)if(i&&i._prefix&&t.startsWith(r+":"))throw new n(`Absolute IRI "${t}" confused with prefix "${r}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:e});if(!i.vocab){if("@base"in e){if(e["@base"]){const r=b(v(s,e["@base"]),t);return _.test(r)?`./${r}`:r}return t}return b(s,t)}return t},S.compactValue=({activeCtx:e,activeProperty:t,value:r,options:n})=>{if(u(r)){const n=f(e,t,"@type"),i=f(e,t,"@language"),a=f(e,t,"@direction"),s=f(e,t,"@container")||[],c="@index"in r&&!s.includes("@index");if(!c&&"@none"!==n){if(r["@type"]===n)return r["@value"];if("@language"in r&&r["@language"]===i&&"@direction"in r&&r["@direction"]===a)return r["@value"];if("@language"in r&&r["@language"]===i)return r["@value"];if("@direction"in r&&r["@direction"]===a)return r["@value"]}const u=Object.keys(r).length,l=1===u||2===u&&"@index"in r&&!c,d="@language"in e,p=o(r["@value"]),h=e.mappings.has(t)&&null===e.mappings.get(t)["@language"];if(l&&"@none"!==n&&(!d||!p||h))return r["@value"];const y={};return c&&(y[S.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=r["@index"]),"@type"in r?y[S.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}})]=S.compactIri({activeCtx:e,iri:r["@type"],relativeTo:{vocab:!0}}):"@language"in r&&(y[S.compactIri({activeCtx:e,iri:"@language",relativeTo:{vocab:!0}})]=r["@language"]),"@direction"in r&&(y[S.compactIri({activeCtx:e,iri:"@direction",relativeTo:{vocab:!0}})]=r["@direction"]),y[S.compactIri({activeCtx:e,iri:"@value",relativeTo:{vocab:!0}})]=r["@value"],y}const i=h(e,t,{vocab:!0},n),a=f(e,t,"@type"),s=S.compactIri({activeCtx:e,iri:r["@id"],relativeTo:{vocab:"@vocab"===a},base:n.base});return"@id"===a||"@vocab"===a||"@graph"===i?s:{[S.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]:s}}},49378:e=>{"use strict";const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#",r="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:r,XSD_BOOLEAN:r+"boolean",XSD_DOUBLE:r+"double",XSD_INTEGER:r+"integer",XSD_STRING:r+"string"}},51972:(e,t,r)=>{"use strict";const n=r(59263),i=r(82207),{isArray:a,isObject:o,isString:s,isUndefined:c}=r(7382),{isAbsolute:u,isRelative:l,prependBase:d}=r(30470),{handleEvent:p}=r(92246),{REGEX_BCP47:h,REGEX_KEYWORD:f,asArray:y,compareShortestLeast:g}=r(59263),m=new Map,b={};function v(e,t,r,n,i,a){if(null===t||!s(t)||b.isKeyword(t))return t;if(t.match(f))return null;if(n&&n.hasOwnProperty(t)&&!0!==i.get(t)&&b.createTermDefinition({activeCtx:e,localCtx:n,term:t,defined:i,options:a}),(r=r||{}).vocab){const r=e.mappings.get(t);if(null===r)return null;if(o(r)&&"@id"in r)return r["@id"]}const c=t.indexOf(":");if(c>0){const r=t.substr(0,c),o=t.substr(c+1);if("_"===r||0===o.indexOf("//"))return t;n&&n.hasOwnProperty(r)&&b.createTermDefinition({activeCtx:e,localCtx:n,term:r,defined:i,options:a});const s=e.mappings.get(r);if(s&&s._prefix)return s["@id"]+o;if(u(t))return t}if(r.vocab&&"@vocab"in e)t=e["@vocab"]+t;else if(r.base){let r,n;"@base"in e?e["@base"]?(n=d(a.base,e["@base"]),r=d(n,t)):(n=e["@base"],r=t):(n=a.base,r=d(a.base,t)),t=r}return t}function _(e,t){if(!e||"object"!=typeof e||!t||"object"!=typeof t)return e===t;const r=Array.isArray(e);if(r!==Array.isArray(t))return!1;if(r){if(e.length!==t.length)return!1;for(let r=0;r{if(o(t)&&"@context"in t&&a(t["@context"])&&(t=t["@context"]),0===y(t).length)return e;const g=[],m=[({event:e,next:t})=>{g.push(e),t()}];r.eventHandler&&m.push(r.eventHandler);const _=r;r={...r,eventHandler:m};const w=await r.contextResolver.resolve({activeCtx:e,context:t,documentLoader:r.documentLoader,base:r.base});o(w[0].document)&&"boolean"==typeof w[0].document["@propagate"]&&(n=w[0].document["@propagate"]);let O=e;n||O.previousContext||(O=O.clone(),O.previousContext=e);for(const n of w){let{document:a}=n;if(e=O,null===a){if(!c&&0!==Object.keys(e.protected).length)throw new i("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});O=e=b.getInitialContext(r).clone();continue}const y=n.getProcessed(e);if(y){if(_.eventHandler)for(const e of y.events)p({event:e,options:_});O=e=y.context;continue}if(o(a)&&"@context"in a&&(a=a["@context"]),!o(a))throw new i("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:a});O=O.clone();const m=new Map;if("@version"in a){if(1.1!==a["@version"])throw new i("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 i("@version: "+a["@version"]+" not compatible with "+e.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:a});O.processingMode="json-ld-1.1",O["@version"]=a["@version"],m.set("@version",!0)}if(O.processingMode=O.processingMode||e.processingMode,"@base"in a){let e=a["@base"];if(null===e||u(e));else{if(!l(e))throw new i('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=d(O["@base"],e)}O["@base"]=e,m.set("@base",!0)}if("@vocab"in a){const e=a["@vocab"];if(null===e)delete O["@vocab"];else{if(!s(e))throw new i('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(!u(e)&&b.processingMode(O,1))throw new i('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=v(O,e,{vocab:!0,base:!0},void 0,void 0,r);u(t)||r.eventHandler&&p({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:t}},options:r}),O["@vocab"]=t}}m.set("@vocab",!0)}if("@language"in a){const e=a["@language"];if(null===e)delete O["@language"];else{if(!s(e))throw new i('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)||r.eventHandler&&p({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:r}),O["@language"]=e.toLowerCase()}m.set("@language",!0)}if("@direction"in a){const t=a["@direction"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @direction not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:a});if(null===t)delete O["@direction"];else{if("ltr"!==t&&"rtl"!==t)throw new i('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});O["@direction"]=t}m.set("@direction",!0)}if("@propagate"in a){const r=a["@propagate"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @propagate not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:a});if("boolean"!=typeof r)throw new i("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:t});m.set("@propagate",!0)}if("@import"in a){const n=a["@import"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @import not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:a});if(!s(n))throw new i("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:t});const o=await r.contextResolver.resolve({activeCtx:e,context:n,documentLoader:r.documentLoader,base:r.base});if(1!==o.length)throw new i("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:t});const c=o[0].getProcessed(e);if(c)a=c;else{const r=o[0].document;if("@import"in r)throw new i("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:t});for(const e in r)a.hasOwnProperty(e)||(a[e]=r[e]);o[0].setProcessed(e,a)}m.set("@import",!0)}m.set("@protected",a["@protected"]||!1);for(const e in a)if(b.createTermDefinition({activeCtx:O,localCtx:a,term:e,defined:m,options:r,overrideProtected:c}),o(a[e])&&"@context"in a[e]){const t=a[e]["@context"];let n=!0;if(s(t)){const e=d(r.base,t);f.has(e)?n=!1:f.add(e)}if(n)try{await b.process({activeCtx:O.clone(),localCtx:a[e]["@context"],overrideProtected:!0,options:r,cycles:f})}catch(t){throw new i("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:a[e]["@context"],term:e})}}n.setProcessed(e,{context:O,events:g})}return O},b.createTermDefinition=({activeCtx:e,localCtx:t,term:r,defined:n,options:c,overrideProtected:l=!1})=>{if(n.has(r)){if(n.get(r))return;throw new i("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:t,term:r})}let d;if(n.set(r,!1),t.hasOwnProperty(r)&&(d=t[r]),"@type"===r&&o(d)&&"@set"===(d["@container"]||"@set")&&b.processingMode(e,1.1)){const e=["@container","@id","@protected"],n=Object.keys(d);if(0===n.length||n.some((t=>!e.includes(t))))throw new i("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:r})}else{if(b.isKeyword(r))throw new i("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:r});if(r.match(f))return void(c.eventHandler&&p({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:r}},options:c}));if(""===r)throw new i("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:t})}const h=e.mappings.get(r);e.mappings.has(r)&&e.mappings.delete(r);let y=!1;if((s(d)||null===d)&&(y=!0,d={"@id":d}),!o(d))throw new i("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(r,g),g.reverse=!1;const m=["@container","@id","@language","@reverse","@type"];b.processingMode(e,1.1)&&m.push("@context","@direction","@index","@nest","@prefix","@protected");for(const e in d)if(!m.includes(e))throw new i("Invalid JSON-LD syntax; a term definition must not contain "+e,"jsonld.SyntaxError",{code:"invalid term definition",context:t});const w=r.indexOf(":");if(g._termHasColon=w>0,"@reverse"in d){if("@id"in d)throw new i("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});if("@nest"in d)throw new i("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});const a=d["@reverse"];if(!s(a))throw new i("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 c.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:c}),void(h?e.mappings.set(r,h):e.mappings.delete(r));const o=v(e,a,{vocab:!0,base:!1},t,n,c);if(!u(o))throw new i("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"]=o,g.reverse=!0}else if("@id"in d){let a=d["@id"];if(a&&!s(a))throw new i("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(!b.isKeyword(a)&&a.match(f))return c.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:c}),void(h?e.mappings.set(r,h):e.mappings.delete(r));if(a!==r){if(a=v(e,a,{vocab:!0,base:!1},t,n,c),!u(a)&&!b.isKeyword(a))throw new i("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(r.match(/(?::[^:])|\//)&&v(e,r,{vocab:!0,base:!1},t,new Map(n).set(r,!0),c)!==a)throw new i("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=y&&!g._termHasColon&&null!==a.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in g))if(g._termHasColon){const i=r.substr(0,w);if(t.hasOwnProperty(i)&&b.createTermDefinition({activeCtx:e,localCtx:t,term:i,defined:n,options:c}),e.mappings.has(i)){const t=r.substr(w+1);g["@id"]=e.mappings.get(i)["@id"]+t}else g["@id"]=r}else if("@type"===r)g["@id"]=r;else{if(!("@vocab"in e))throw new i("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t,term:r});g["@id"]=e["@vocab"]+r}if((!0===d["@protected"]||!0===n.get("@protected")&&!1!==d["@protected"])&&(e.protected[r]=!0,g.protected=!0),n.set(r,!0),"@type"in d){let r=d["@type"];if(!s(r))throw new i("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if("@json"===r||"@none"===r){if(b.processingMode(e,1))throw new i(`Invalid JSON-LD syntax; an @context @type value must not be "${r}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else if("@id"!==r&&"@vocab"!==r){if(r=v(e,r,{vocab:!0,base:!1},t,n,c),!u(r))throw new i("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if(0===r.indexOf("_:"))throw new i("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"]=r}if("@container"in d){const r=s(d["@container"])?[d["@container"]]:d["@container"]||[],n=["@list","@set","@index","@language"];let o=!0;const c=r.includes("@set");if(b.processingMode(e,1.1)){if(n.push("@graph","@id","@type"),r.includes("@list")){if(1!==r.length)throw new i("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else if(r.includes("@graph")){if(r.some((e=>"@graph"!==e&&"@id"!==e&&"@index"!==e&&"@set"!==e)))throw new i("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 o&=r.length<=(c?2:1);if(r.includes("@type")&&(g["@type"]=g["@type"]||"@id",!["@id","@vocab"].includes(g["@type"])))throw new i("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else o&=!a(d["@container"]),o&=r.length<=1;if(o&=r.every((e=>n.includes(e))),o&=!(c&&r.includes("@list")),!o)throw new i("Invalid JSON-LD syntax; @context @container value must be one of the following: "+n.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:t});if(g.reverse&&!r.every((e=>["@index","@set"].includes(e))))throw new i("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"]=r}if("@index"in d){if(!("@container"in d)||!g["@container"].includes("@index"))throw new i(`Invalid JSON-LD syntax; @index without @index in @container: "${d["@index"]}" on term "${r}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});if(!s(d["@index"])||0===d["@index"].indexOf("@"))throw new i(`Invalid JSON-LD syntax; @index must expand to an IRI: "${d["@index"]}" on term "${r}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});g["@index"]=d["@index"]}if("@context"in d&&(g["@context"]=d["@context"]),"@language"in d&&!("@type"in d)){let e=d["@language"];if(null!==e&&!s(e))throw new i("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 d){if(r.match(/:|\//))throw new i("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:t});if(b.isKeyword(g["@id"]))throw new i("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:t});if("boolean"!=typeof d["@prefix"])throw new i("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:t});g._prefix=!0===d["@prefix"]}if("@direction"in d){const e=d["@direction"];if(null!==e&&"ltr"!==e&&"rtl"!==e)throw new i('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 d){const e=d["@nest"];if(!s(e)||"@nest"!==e&&0===e.indexOf("@"))throw new i("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 O=g["@id"];if("@context"===O||"@preserve"===O)throw new i("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:t});if(h&&h.protected&&!l&&(e.protected[r]=!0,g.protected=!0,!_(h,g)))throw new i("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:t,term:r})},b.expandIri=(e,t,r,n)=>v(e,t,r,void 0,void 0,n),b.getInitialContext=e=>{const t=JSON.stringify({processingMode:e.processingMode}),r=m.get(t);if(r)return r;const i={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){const e=this;if(e.inverse)return e.inverse;const t=e.inverse={},r=e.fastCurieMap={},n={},i=(e["@language"]||"@none").toLowerCase(),s=e["@direction"],c=e.mappings,u=[...c.keys()].sort(g);for(const e of u){const a=c.get(e);if(null===a)continue;let u=a["@container"]||"@none";if(u=[].concat(u).sort().join(""),null===a["@id"])continue;const l=y(a["@id"]);for(const c of l){let l=t[c];const d=b.isKeyword(c);if(l)d||a._termHasColon||n[c].push(e);else if(t[c]=l={},!d&&!a._termHasColon){n[c]=[e];const t={iri:c,terms:n[c]};c[0]in r?r[c[0]].push(t):r[c[0]]=[t]}if(l[u]||(l[u]={"@language":{},"@type":{},"@any":{}}),l=l[u],o(e,l["@any"],"@none"),a.reverse)o(e,l["@type"],"@reverse");else if("@none"===a["@type"])o(e,l["@any"],"@none"),o(e,l["@language"],"@none"),o(e,l["@type"],"@none");else if("@type"in a)o(e,l["@type"],a["@type"]);else if("@language"in a&&"@direction"in a){const t=a["@language"],r=a["@direction"];o(e,l["@language"],t&&r?`${t}_${r}`.toLowerCase():t?t.toLowerCase():r?`_${r}`:"@null")}else"@language"in a?o(e,l["@language"],(a["@language"]||"@null").toLowerCase()):"@direction"in a?a["@direction"]?o(e,l["@language"],`_${a["@direction"]}`):o(e,l["@language"],"@none"):s?(o(e,l["@language"],`_${s}`),o(e,l["@language"],"@none"),o(e,l["@type"],"@none")):(o(e,l["@language"],i),o(e,l["@language"],"@none"),o(e,l["@type"],"@none"))}}for(const e in r)a(r,e,1);return t},clone:function(){const e={};return e.mappings=n.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=n.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===m.size&&m.clear(),m.set(t,i),i;function a(e,t,r){const n=e[t],i=e[t]={};let o,s;for(const e of n)o=e.iri,s=r>=o.length?"":o[r],s in i?i[s].push(e):i[s]=[e];for(const e in i)""!==e&&a(i,e,r+1)}function o(e,t,r){t.hasOwnProperty(r)||(t[r]=e)}},b.getContextValue=(e,t,r)=>{if(null===t){if("@context"===r)return;return null}if(e.mappings.has(t)){const n=e.mappings.get(t);if(c(r))return n;if(n.hasOwnProperty(r))return n[r]}return"@language"===r&&r in e||"@direction"===r&&r in e?e[r]:"@context"!==r?null:void 0},b.processingMode=(e,t)=>t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():"json-ld-1.0"===e.processingMode,b.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}},86957:(e,t,r)=>{"use strict";const{parseLinkHeader:n,buildHeaders:i}=r(59263),{LINK_HEADER_CONTEXT:a}=r(49378),o=r(82207),s=r(73743),{prependBase:c}=r(30470),u=/(^|(\r\n))link:/i;e.exports=({secure:e,headers:t={},xhr:r}={headers:{}})=>(t=i(t),(new s).wrapLoader((async function i(s){if(0!==s.indexOf("http:")&&0!==s.indexOf("https:"))throw new o('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 o('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 l;try{l=await function(e,t,r){const n=new(e=e||XMLHttpRequest);return new Promise(((e,i)=>{n.onload=()=>e(n),n.onerror=e=>i(e),n.open("GET",t,!0);for(const e in r)n.setRequestHeader(e,r[e]);n.send()}))}(r,s,t)}catch(e){throw new o("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:s,cause:e})}if(l.status>=400)throw new o("URL could not be dereferenced: "+l.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:s,httpStatusCode:l.status});let d={contextUrl:null,documentUrl:s,document:l.response},p=null;const h=l.getResponseHeader("Content-Type");let f;if(u.test(l.getAllResponseHeaders())&&(f=l.getResponseHeader("Link")),f&&"application/ld+json"!==h){const e=n(f),t=e[a];if(Array.isArray(t))throw new o("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:s});t&&(d.contextUrl=t.target),p=e.alternate,p&&"application/ld+json"==p.type&&!(h||"").match(/^application\/(\w*\+)?json$/)&&(d=await i(c(s,p.target)))}return d})))},92246:(e,t,r)=>{"use strict";const n=r(82207),{isArray:i}=r(7382),{asArray:a}=r(59263),o={};function s({event:e,handlers:t}){let r=!0;for(let a=0;r&&a{r=!0}});else{if("object"!=typeof o)throw new n("Invalid event handler.","jsonld.InvalidEventHandler",{event:e});e.code in o?o[e.code]({event:e,next:()=>{r=!0}}):r=!0}}return r}e.exports=o,o.defaultEventHandler=null,o.setupEventHandler=({options:e={}})=>{const t=[].concat(e.safe?o.safeEventHandler:[],e.eventHandler?a(e.eventHandler):[],o.defaultEventHandler?o.defaultEventHandler:[]);return 0===t.length?null:t},o.handleEvent=({event:e,options:t})=>{s({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"]);o.safeEventHandler=function({event:e,next:t}){if("warning"===e.level&&c.has(e.code))throw new n("Safe mode validation error.","jsonld.ValidationError",{event:e});t()},o.logEventHandler=function({event:e,next:t}){console.log(`EVENT: ${e.message}`,{event:e}),t()},o.logWarningEventHandler=function({event:e,next:t}){"warning"===e.level&&console.warn(`WARNING: ${e.message}`,{event:e}),t()},o.unhandledEventHandler=function({event:e}){throw new n("No handler for event.","jsonld.UnhandledEvent",{event:e})},o.setDefaultEventHandler=function({eventHandler:e}={}){o.defaultEventHandler=e?a(e):null}},34019:(e,t,r)=>{"use strict";const n=r(82207),{isArray:i,isObject:a,isEmptyObject:o,isString:s,isUndefined:c}=r(7382),{isList:u,isValue:l,isGraph:d,isSubject:p}=r(3978),{expandIri:h,getContextValue:f,isKeyword:y,process:g,processingMode:m}=r(51972),{isAbsolute:b}=r(30470),{REGEX_BCP47:v,REGEX_KEYWORD:_,addValue:w,asArray:O,getValues:T,validateTypeValue:S}=r(59263),{handleEvent:E}=r(92246),x={};function I({value:e,count:t,options:r}){if(0===t||"@value"in e||"@list"in e||1===t&&"@id"in e){if(r.eventHandler){let n,i;0===t?(n="empty object",i="Dropping empty object."):"@value"in e?(n="object with only @value",i="Dropping object with only @value."):"@list"in e?(n="object with only @list",i="Dropping object with only @list."):1===t&&"@id"in e&&(n="object with only @id",i="Dropping object with only @id."),E({event:{type:["JsonLdEvent"],code:n,level:"warning",message:i,details:{value:e}},options:r})}return null}return e}async function A({activeCtx:e,activeProperty:t,expandedActiveProperty:r,element:d,expandedParent:_,options:T={},insideList:j,typeKey:D,typeScopedContext:P}){const F=Object.keys(d).sort(),C=[];let M;const L=d[D]&&"@json"===h(e,i(d[D])?d[D][0]:d[D],{vocab:!0},{...T,typeExpansion:!0});for(const A of F){let j,D=d[A];if("@context"===A)continue;const F=h(e,A,{vocab:!0},T);if(null===F||!b(F)&&!y(F)){T.eventHandler&&E({event:{type:["JsonLdEvent"],code:"invalid property",level:"warning",message:"Dropping property that did not expand into an absolute IRI or keyword.",details:{property:A,expandedProperty:F}},options:T});continue}if(y(F)){if("@reverse"===r)throw new n("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:D});if(F in _&&"@included"!==F&&"@type"!==F)throw new n("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:F})}if("@id"===F){if(!s(D)){if(!T.isFrame)throw new n('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:D});if(a(D)){if(!o(D))throw new n('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:D})}else{if(!i(D))throw new n('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:D});if(!D.every((e=>s(e))))throw new n('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:D})}}w(_,"@id",O(D).map((t=>{if(s(t)){const r=h(e,t,{base:!0},T);return T.eventHandler&&(null===r?E(null===t?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:t}},options:T}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:t}},options:T}):b(r)||E({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:t,expandedId:r}},options:T})),r}return t})),{propertyIsArray:T.isFrame});continue}if("@type"===F){a(D)&&(D=Object.fromEntries(Object.entries(D).map((([e,t])=>[h(P,e,{vocab:!0}),O(t).map((e=>h(P,e,{base:!0,vocab:!0},{...T,typeExpansion:!0})))])))),S(D,T.isFrame),w(_,"@type",O(D).map((e=>{if(s(e)){const t=h(P,e,{base:!0,vocab:!0},{...T,typeExpansion:!0});return"@json"===t||b(t)||T.eventHandler&&E({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:e}},options:T}),t}return e})),{propertyIsArray:!!T.isFrame});continue}if("@included"===F&&m(e,1.1)){const r=O(await x.expand({activeCtx:e,activeProperty:t,element:D,options:T}));if(!r.every((e=>p(e))))throw new n("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:D});w(_,"@included",r,{propertyIsArray:!0});continue}if("@graph"===F&&!a(D)&&!i(D))throw new n('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:D});if("@value"===F){M=D,L&&m(e,1.1)?_["@value"]=D:w(_,"@value",D,{propertyIsArray:T.isFrame});continue}if("@language"===F){if(null===D)continue;if(!s(D)&&!T.isFrame)throw new n('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:D});D=O(D).map((e=>s(e)?e.toLowerCase():e));for(const e of D)s(e)&&!e.match(v)&&T.eventHandler&&E({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:T});w(_,"@language",D,{propertyIsArray:T.isFrame});continue}if("@direction"===F){if(!s(D)&&!T.isFrame)throw new n('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:D});D=O(D);for(const e of D)if(s(e)&&"ltr"!==e&&"rtl"!==e)throw new n('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:D});w(_,"@direction",D,{propertyIsArray:T.isFrame});continue}if("@index"===F){if(!s(D))throw new n('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:D});w(_,"@index",D);continue}if("@reverse"===F){if(!a(D))throw new n('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:D});if(j=await x.expand({activeCtx:e,activeProperty:"@reverse",element:D,options:T}),"@reverse"in j)for(const e in j["@reverse"])w(_,e,j["@reverse"][e],{propertyIsArray:!0});let t=_["@reverse"]||null;for(const e in j){if("@reverse"===e)continue;null===t&&(t=_["@reverse"]={}),w(t,e,[],{propertyIsArray:!0});const r=j[e];for(let i=0;i"@id"===e||"@index"===e))){if(j=O(j),T.isFrame||(j=j.filter((e=>null!==I({value:e,count:Object.keys(e).length,options:T})))),0===j.length)continue;j=j.map((e=>({"@graph":O(e)})))}if(k.mappings.has(A)&&k.mappings.get(A).reverse){const e=_["@reverse"]=_["@reverse"]||{};j=O(j);for(let t=0;t"@value"===h(e,t,{vocab:!0},T))))throw new n("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:i});await A({activeCtx:e,activeProperty:t,expandedActiveProperty:r,element:i,expandedParent:_,options:T,insideList:j,typeScopedContext:P,typeKey:D})}}}function j({activeCtx:e,activeProperty:t,value:r,options:n}){if(null==r)return null;const i=h(e,t,{vocab:!0},n);if("@id"===i)return h(e,r,{base:!0},n);if("@type"===i)return h(e,r,{vocab:!0,base:!0},{...n,typeExpansion:!0});const a=f(e,t,"@type");if(("@id"===a||"@graph"===i)&&s(r)){const i=h(e,r,{base:!0},n);return null===i&&r.match(_)&&n.eventHandler&&E({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:t}},options:n}),{"@id":i}}if("@vocab"===a&&s(r))return{"@id":h(e,r,{vocab:!0,base:!0},n)};if(y(i))return r;const o={};if(a&&!["@id","@vocab","@none"].includes(a))o["@type"]=a;else if(s(r)){const r=f(e,t,"@language");null!==r&&(o["@language"]=r);const n=f(e,t,"@direction");null!==n&&(o["@direction"]=n)}return["boolean","number","string"].includes(typeof r)||(r=r.toString()),o["@value"]=r,o}function N(e,t,r,a){const o=[],c=Object.keys(t).sort();for(const u of c){const c=h(e,u,{vocab:!0},a);let l=t[u];i(l)||(l=[l]);for(const e of l){if(null===e)continue;if(!s(e))throw new n("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:t});const i={"@value":e};"@none"!==c&&(u.match(v)||a.eventHandler&&E({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:u}},options:a}),i["@language"]=u.toLowerCase()),r&&(i["@direction"]=r),o.push(i)}}return o}async function R({activeCtx:e,options:t,activeProperty:r,value:a,asGraph:o,indexKey:s,propertyIndex:u}){const p=[],y=Object.keys(a).sort(),m="@type"===s;for(let b of y){if(m){const r=f(e,b,"@context");c(r)||(e=await g({activeCtx:e,localCtx:r,propagate:!1,options:t}))}let y,v=a[b];i(v)||(v=[v]),v=await x.expand({activeCtx:e,activeProperty:r,element:v,options:t,insideList:!1,insideIndex:!0}),y=u?"@none"===b?"@none":j({activeCtx:e,activeProperty:s,value:b,options:t}):h(e,b,{vocab:!0},t),"@id"===s?b=h(e,b,{base:!0},t):m&&(b=y);for(let e of v){if(o&&!d(e)&&(e={"@graph":[e]}),"@type"===s)"@none"===y||(e["@type"]?e["@type"]=[b].concat(e["@type"]):e["@type"]=[b]);else{if(l(e)&&!["@language","@type","@index"].includes(s))throw new n(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${s}".`,"jsonld.SyntaxError",{code:"invalid value object",value:e});u?"@none"!==y&&w(e,u,y,{propertyIsArray:!0,prependValue:!0}):"@none"===y||s in e||(e[s]=b)}p.push(e)}}return p}e.exports=x,x.expand=async({activeCtx:e,activeProperty:t=null,element:r,options:u={},insideList:l=!1,insideIndex:d=!1,typeScopedContext:p=null})=>{if(null==r)return null;if("@default"===t&&(u=Object.assign({},u,{isFrame:!1})),!i(r)&&!a(r))return l||null!==t&&"@graph"!==h(e,t,{vocab:!0},u)?j({activeCtx:e,activeProperty:t,value:r,options:u}):(u.eventHandler&&E({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:r}},options:u}),null);if(i(r)){let n=[];const a=f(e,t,"@container")||[];l=l||a.includes("@list");for(let a=0;a1?n.slice().sort():n:[n];for(const t of i){const r=f(p,t,"@context");c(r)||(e=await g({activeCtx:e,localCtx:r,options:u,propagate:!1}))}}let N={};await A({activeCtx:e,activeProperty:t,expandedActiveProperty:y,element:r,expandedParent:N,options:u,insideList:l,typeKey:S,typeScopedContext:p}),_=Object.keys(N);let R=_.length;if("@value"in N){if("@type"in N&&("@language"in N||"@direction"in N))throw new n('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:N});let t=R-1;if("@type"in N&&(t-=1),"@index"in N&&(t-=1),"@language"in N&&(t-=1),"@direction"in N&&(t-=1),0!==t)throw new n('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:N});const r=null===N["@value"]?[]:O(N["@value"]),i=T(N,"@type");if(m(e,1.1)&&i.includes("@json")&&1===i.length);else if(0===r.length)u.eventHandler&&E({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:N}},options:u}),N=null;else{if(!r.every((e=>s(e)||o(e)))&&"@language"in N)throw new n("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:N});if(!i.every((e=>b(e)&&!(s(e)&&0===e.indexOf("_:"))||o(e))))throw new n('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:N})}}else if("@type"in N&&!i(N["@type"]))N["@type"]=[N["@type"]];else if("@set"in N||"@list"in N){if(R>1&&(2!==R||!("@index"in N)))throw new n('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:N});"@set"in N&&(N=N["@set"],_=Object.keys(N),R=_.length)}else 1===R&&"@language"in N&&(u.eventHandler&&E({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:N}},options:u}),N=null);return!a(N)||u.keepFreeFloatingNodes||l||null!==t&&"@graph"!==y&&!(f(e,t,"@container")||[]).includes("@graph")||(N=I({value:N,count:R,options:u})),N}},5229:(e,t,r)=>{"use strict";const{isSubjectReference:n}=r(3978),{createMergedNodeMap:i}=r(9233),a={};e.exports=a,a.flatten=e=>{const t=i(e),r=[],a=Object.keys(t).sort();for(let e=0;e{"use strict";const{isKeyword:n}=r(51972),i=r(3978),a=r(7382),o=r(59263),s=r(30470),c=r(82207),{createNodeMap:u,mergeNodeMapGraphs:l}=r(9233),d={};function p(e){const t={};for(const r in e)void 0!==e[r]&&(t["@"+r]=[e[r]]);return[t]}function h(e,t,r){for(let n=r.length-1;n>=0;--n){const i=r[n];if(i.graph===t&&i.subject["@id"]===e["@id"])return!0}return!1}function f(e,t,r){const n="@"+r;let i=n in e?e[n][0]:t[r];if("embed"===r)if(!0===i)i="@once";else if(!1===i)i="@never";else if("@always"!==i&&"@never"!==i&&"@link"!==i&&"@first"!==i&&"@last"!==i&&"@once"!==i)throw new c("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:e});return i}function y(e){if(!a.isArray(e)||1!==e.length||!a.isObject(e[0]))throw new c("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 o.asArray(e[0]["@id"]))if(!a.isObject(t)&&!s.isAbsolute(t)||a.isString(t)&&0===t.indexOf("_:"))throw new c("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e});if("@type"in e[0])for(const t of o.asArray(e[0]["@type"]))if(!a.isObject(t)&&!s.isAbsolute(t)&&"@json"!==t||a.isString(t)&&0===t.indexOf("_:"))throw new c("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}function g(e,t,r,s){let c=!0,u=!1;for(const l in r){let d=!1;const p=o.getValues(t,l),h=0===o.getValues(r,l).length;if("@id"===l){if(a.isEmptyObject(r["@id"][0]||{})?d=!0:r["@id"].length>=0&&(d=r["@id"].includes(p[0])),!s.requireAll)return d}else if("@type"===l){if(c=!1,h){if(p.length>0)return!1;d=!0}else if(1===r["@type"].length&&a.isEmptyObject(r["@type"][0]))d=p.length>0;else for(const e of r["@type"])d=!(!a.isObject(e)||!("@default"in e))||d||p.some((t=>t===e));if(!s.requireAll)return d}else{if(n(l))continue;{const t=o.getValues(r,l)[0];let n=!1;if(t&&(y([t]),n="@default"in t),c=!1,0===p.length&&n)continue;if(p.length>0&&h)return!1;if(void 0===t){if(p.length>0)return!1;d=!0}else if(i.isList(t)){const r=t["@list"][0];if(i.isList(p[0])){const t=p[0]["@list"];i.isValue(r)?d=t.some((e=>w(r,e))):(i.isSubject(r)||i.isSubjectReference(r))&&(d=t.some((t=>_(e,r,t,s))))}}else d=i.isValue(t)?p.some((e=>w(t,e))):i.isSubjectReference(t)?p.some((r=>_(e,t,r,s))):!!a.isObject(t)&&p.length>0}}if(!d&&s.requireAll)return!1;u=u||d}return c||u}function m(e,t){const r=e.uniqueEmbeds[e.graph],n=r[t],i=n.parent,s=n.property,c={"@id":t};if(a.isArray(i)){for(let e=0;e{const t=Object.keys(r);for(const n of t)n in r&&a.isObject(r[n].parent)&&r[n].parent["@id"]===e&&(delete r[n],u(n))};u(t)}function b(e,t){if(a.isArray(e))return e.map((e=>b(e,t)));if(a.isObject(e)){if("@preserve"in e)return e["@preserve"][0];if(i.isValue(e))return e;if(i.isList(e))return e["@list"]=b(e["@list"],t),e;if("@id"in e){const r=e["@id"];if(t.link.hasOwnProperty(r)){const n=t.link[r].indexOf(e);if(-1!==n)return t.link[r][n];t.link[r].push(e)}else t.link[r]=[e]}for(const r in e)"@id"===r&&t.bnodesToClear.includes(e[r])?delete e["@id"]:e[r]=b(e[r],t)}return e}function v(e,t,r){a.isObject(e)?o.addValue(e,t,r,{propertyIsArray:!0}):e.push(r)}function _(e,t,r,n){if(!("@id"in r))return!1;const i=e.subjects[r["@id"]];return i&&g(e,i,t,n)}function w(e,t){const r=t["@value"],n=t["@type"],i=t["@language"],o=e["@value"]?a.isArray(e["@value"])?e["@value"]:[e["@value"]]:[],s=e["@type"]?a.isArray(e["@type"])?e["@type"]:[e["@type"]]:[],c=e["@language"]?a.isArray(e["@language"])?e["@language"]:[e["@language"]]:[];return 0===o.length&&0===s.length&&0===c.length||!(!o.includes(r)&&!a.isEmptyObject(o[0]))&&!!(!n&&0===s.length||s.includes(n)||n&&a.isEmptyObject(s[0]))&&!!(!i&&0===c.length||c.includes(i)||i&&a.isEmptyObject(c[0]))}e.exports=d,d.frameMergedOrDefault=(e,t,r)=>{const n={options:r,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},i=new o.IdentifierIssuer("_:b");u(e,n.graphMap,"@default",i),r.merged&&(n.graphMap["@merged"]=l(n.graphMap),n.graph="@merged"),n.subjects=n.graphMap[n.graph];const a=[];return d.frame(n,Object.keys(n.subjects).sort(),t,a),r.pruneBlankNodeIdentifiers&&(r.bnodesToClear=Object.keys(n.bnodeMap).filter((e=>1===n.bnodeMap[e].length))),r.link={},b(a,r)},d.frame=(e,t,r,s,u=null)=>{y(r),r=r[0];const l=e.options,b={embed:f(r,l,"embed"),explicit:f(r,l,"explicit"),requireAll:f(r,l,"requireAll")};e.link.hasOwnProperty(e.graph)||(e.link[e.graph]={});const _=e.link[e.graph],O=function(e,t,r,n){const i={};for(const a of t){const t=e.graphMap[e.graph][a];g(e,t,r,n)&&(i[a]=t)}return i}(e,t,r,b),T=Object.keys(O).sort();for(const y of T){const g=O[y];if(null===u?e.uniqueEmbeds={[e.graph]:{}}:e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},"@link"===b.embed&&y in _){v(s,u,_[y]);continue}const T={"@id":y};if(0===y.indexOf("_:")&&o.addValue(e.bnodeMap,y,T,{propertyIsArray:!0}),_[y]=T,("@first"===b.embed||"@last"===b.embed)&&e.is11)throw new c("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:r});if(e.embedded||!e.uniqueEmbeds[e.graph].hasOwnProperty(y))if(!e.embedded||"@never"!==b.embed&&!h(g,e.graph,e.subjectStack))if(!e.embedded||"@first"!=b.embed&&"@once"!=b.embed||!e.uniqueEmbeds[e.graph].hasOwnProperty(y)){if("@last"===b.embed&&y in e.uniqueEmbeds[e.graph]&&m(e,y),e.uniqueEmbeds[e.graph][y]={parent:s,property:u},e.subjectStack.push({subject:g,graph:e.graph}),y in e.graphMap){let t=!1,n=null;"@graph"in r?(n=r["@graph"][0],t=!("@merged"===y||"@default"===y),a.isObject(n)||(n={})):(t="@merged"!==e.graph,n={}),t&&d.frame({...e,graph:y,embedded:!1},Object.keys(e.graphMap[y]).sort(),[n],T,"@graph")}"@included"in r&&d.frame({...e,embedded:!1},t,r["@included"],T,"@included");for(const t of Object.keys(g).sort())if(n(t)){if(T[t]=o.clone(g[t]),"@type"===t)for(const t of g["@type"])0===t.indexOf("_:")&&o.addValue(e.bnodeMap,t,T,{propertyIsArray:!0})}else if(!b.explicit||t in r)for(const n of g[t]){const a=t in r?r[t]:p(b);if(i.isList(n)){const a=r[t]&&r[t][0]&&r[t][0]["@list"]?r[t][0]["@list"]:p(b),s={"@list":[]};v(T,t,s);const c=n["@list"];for(const t of c)i.isSubjectReference(t)?d.frame({...e,embedded:!0},[t["@id"]],a,s,"@list"):v(s,"@list",o.clone(t))}else i.isSubjectReference(n)?d.frame({...e,embedded:!0},[n["@id"]],a,T,t):w(a[0],n)&&v(T,t,o.clone(n))}for(const e of Object.keys(r).sort()){if("@type"===e){if(!a.isObject(r[e][0])||!("@default"in r[e][0]))continue}else if(n(e))continue;const t=r[e][0]||{};if(!f(t,l,"omitDefault")&&!(e in T)){let r="@null";"@default"in t&&(r=o.clone(t["@default"])),a.isArray(r)||(r=[r]),T[e]=[{"@preserve":r}]}}for(const t of Object.keys(r["@reverse"]||{}).sort()){const n=r["@reverse"][t];for(const r of Object.keys(e.subjects))o.getValues(e.subjects[r],t).some((e=>e["@id"]===y))&&(T["@reverse"]=T["@reverse"]||{},o.addValue(T["@reverse"],t,[],{propertyIsArray:!0}),d.frame({...e,embedded:!0},[r],n,T["@reverse"][t],u))}v(s,u,T),e.subjectStack.pop()}else v(s,u,T);else v(s,u,T)}},d.cleanupNull=(e,t)=>{if(a.isArray(e))return e.map((e=>d.cleanupNull(e,t))).filter((e=>e));if("@null"===e)return null;if(a.isObject(e)){if("@id"in e){const r=e["@id"];if(t.link.hasOwnProperty(r)){const n=t.link[r].indexOf(e);if(-1!==n)return t.link[r][n];t.link[r].push(e)}else t.link[r]=[e]}for(const r in e)e[r]=d.cleanupNull(e[r],t)}return e}},43947:(e,t,r)=>{"use strict";const n=r(82207),i=r(3978),a=r(7382),{REGEX_BCP47:o,addValue:s}=r(59263),{handleEvent:c}=r(92246),{RDF_LIST:u,RDF_FIRST:l,RDF_REST:d,RDF_NIL:p,RDF_TYPE:h,RDF_JSON_LITERAL:f,XSD_BOOLEAN:y,XSD_DOUBLE:g,XSD_INTEGER:m,XSD_STRING:b}=r(49378),v={};function _(e,t,r,i){if(e.termType.endsWith("Node"))return{"@id":e.value};const s={"@value":e.value};if(e.language)e.language.match(o)||i.eventHandler&&c({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e.language}},options:i}),s["@language"]=e.language;else{let u=e.datatype.value;if(u||(u=b),u===f){u="@json";try{s["@value"]=JSON.parse(s["@value"])}catch(e){throw new n("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:s["@value"],cause:e})}}if(t){if(u===y)"true"===s["@value"]?s["@value"]=!0:"false"===s["@value"]&&(s["@value"]=!1);else if(a.isNumeric(s["@value"]))if(u===m){const e=parseInt(s["@value"],10);e.toFixed(0)===s["@value"]&&(s["@value"]=e)}else u===g&&(s["@value"]=parseFloat(s["@value"]));[y,m,g,b].includes(u)||(s["@type"]=u)}else if("i18n-datatype"===r&&u.startsWith("https://www.w3.org/ns/i18n#")){const[,e,t]=u.split(/[#_]/);e.length>0&&(s["@language"]=e,e.match(o)||i.eventHandler&&c({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:i})),s["@direction"]=t}else u!==b&&(s["@type"]=u)}return s}e.exports=v,v.fromRDF=async(e,t)=>{const{useRdfType:r=!1,useNativeTypes:o=!1,rdfDirection:c=null}=t,f={},y={"@default":f},g={};if(c){if("compound-literal"===c)throw new n("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:c});if("i18n-datatype"!==c)throw new n("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:c})}for(const n of e){const e="DefaultGraph"===n.graph.termType?"@default":n.graph.value;e in y||(y[e]={}),"@default"===e||e in f||(f[e]={"@id":e});const i=y[e],a=n.subject.value,u=n.predicate.value,l=n.object;a in i||(i[a]={"@id":a});const d=i[a],m=l.termType.endsWith("Node");if(m&&!(l.value in i)&&(i[l.value]={"@id":l.value}),u===h&&!r&&m){s(d,"@type",l.value,{propertyIsArray:!0});continue}const b=_(l,o,c,t);if(s(d,u,b,{propertyIsArray:!0}),m)if(l.value===p){const e=i[l.value];"usages"in e||(e.usages=[]),e.usages.push({node:d,property:u,value:b})}else l.value in g?g[l.value]=!1:g[l.value]={node:d,property:u,value:b}}for(const e in y){const t=y[e];if(!(p in t))continue;const r=t[p];if(r.usages){for(let e of r.usages){let r=e.node,n=e.property,o=e.value;const s=[],c=[];let p=Object.keys(r).length;for(;n===d&&a.isObject(g[r["@id"]])&&a.isArray(r[l])&&1===r[l].length&&a.isArray(r[d])&&1===r[d].length&&(3===p||4===p&&a.isArray(r["@type"])&&1===r["@type"].length&&r["@type"][0]===u)&&(s.push(r[l][0]),c.push(r["@id"]),e=g[r["@id"]],r=e.node,n=e.property,o=e.value,p=Object.keys(r).length,i.isBlankNode(r)););delete o["@id"],o["@list"]=s.reverse();for(const e of c)delete t[e]}delete r.usages}}const m=[],b=Object.keys(f).sort();for(const e of b){const t=f[e];if(e in y){const r=t["@graph"]=[],n=y[e],a=Object.keys(n).sort();for(const e of a){const t=n[e];i.isSubjectReference(t)||r.push(t)}}i.isSubjectReference(t)||m.push(t)}return m}},3978:(e,t,r)=>{"use strict";const n=r(7382),i={};e.exports=i,i.isSubject=e=>!(!n.isObject(e)||"@value"in e||"@set"in e||"@list"in e)&&(Object.keys(e).length>1||!("@id"in e)),i.isSubjectReference=e=>n.isObject(e)&&1===Object.keys(e).length&&"@id"in e,i.isValue=e=>n.isObject(e)&&"@value"in e,i.isList=e=>n.isObject(e)&&"@list"in e,i.isGraph=e=>n.isObject(e)&&"@graph"in e&&1===Object.keys(e).filter((e=>"@id"!==e&&"@index"!==e)).length,i.isSimpleGraph=e=>i.isGraph(e)&&!("@id"in e),i.isBlankNode=e=>{if(n.isObject(e)){if("@id"in e){const t=e["@id"];return!n.isString(t)||0===t.indexOf("_:")}return 0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e)}return!1}},34841:(e,t,r)=>{const n=r(28023),i=r(60701),a=r(59263),o=r(47034),s=a.IdentifierIssuer,c=r(82207),u=r(1235),l=r(68229),{expand:d}=r(34019),{flatten:p}=r(5229),{fromRDF:h}=r(43947),{toRDF:f}=r(99180),{frameMergedOrDefault:y,cleanupNull:g}=r(47946),{isArray:m,isObject:b,isString:v}=r(7382),{isSubjectReference:_}=r(3978),{expandIri:w,getInitialContext:O,process:T,processingMode:S}=r(51972),{compact:E,compactIri:x}=r(21058),{createNodeMap:I,createMergedNodeMap:A,mergeNodeMaps:j}=r(9233),{logEventHandler:N,logWarningEventHandler:R,safeEventHandler:D,setDefaultEventHandler:P,setupEventHandler:F,strictEventHandler:C,unhandledEventHandler:M}=r(92246),L=function(e){const t={},L=new u({max:100});function k(t,{documentLoader:r=e.documentLoader,...n}){if(t&&"compactionMap"in t)throw new c('"compactionMap" not supported.',"jsonld.OptionsError");if(t&&"expansionMap"in t)throw new c('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:r},n,t,{eventHandler:F({options:t})})}return e.compact=async function(t,r,n){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===r)throw new c("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===t)return null;let i;(n=k(n,{base:v(t)?t:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new s("_:b"),contextResolver:new o({sharedCache:L})})).link&&(n.skipExpansion=!0),n.compactToRelative||delete n.base,i=n.skipExpansion?t:await e.expand(t,n);const u=await e.processContext(O(n),r,n);let l=await E({activeCtx:u,element:i,options:n});n.compactArrays&&!n.graph&&m(l)?1===l.length?l=l[0]:0===l.length&&(l={}):n.graph&&b(l)&&(l=[l]),b(r)&&"@context"in r&&(r=r["@context"]),r=a.clone(r),m(r)||(r=[r]);const d=r;r=[];for(let e=0;e0)&&r.push(d[e]);const p=r.length>0;if(1===r.length&&(r=r[0]),m(l)){const e=x({activeCtx:u,iri:"@graph",relativeTo:{vocab:!0}}),t=l;l={},p&&(l["@context"]=r),l[e]=t}else if(b(l)&&p){const e=l;l={"@context":r};for(const t in e)l[t]=e[t]}return l},e.expand=async function(t,r){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");const n={},i=[];if("expandContext"in(r=k(r,{keepFreeFloatingNodes:!1,contextResolver:new o({sharedCache:L})}))){const e=a.clone(r.expandContext);b(e)&&"@context"in e?n.expandContext=e:n.expandContext={"@context":e},i.push(n.expandContext)}let s;if(v(t)){const a=await e.get(t,r);s=a.documentUrl,n.input=a.document,a.contextUrl&&(n.remoteContext={"@context":a.contextUrl},i.push(n.remoteContext))}else n.input=a.clone(t);"base"in r||(r.base=s||"");let c=O(r);for(const e of i)c=await T({activeCtx:c,localCtx:e,options:r});let u=await d({activeCtx:c,element:n.input,options:r});return b(u)&&"@graph"in u&&1===Object.keys(u).length?u=u["@graph"]:null===u&&(u=[]),m(u)||(u=[u]),u},e.flatten=async function(t,r,n){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");r="function"==typeof r?null:r||null,n=k(n,{base:v(t)?t:"",contextResolver:new o({sharedCache:L})});const i=await e.expand(t,n),a=p(i);return null===r?a:(n.graph=!0,n.skipExpansion=!0,await e.compact(a,r,n))},e.frame=async function(t,r,n){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(n=k(n,{base:v(t)?t:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new o({sharedCache:L})}),v(r)){const t=await e.get(r,n);if(r=t.document,t.contextUrl){let e=r["@context"];e?m(e)?e.push(t.contextUrl):e=[e,t.contextUrl]:e=t.contextUrl,r["@context"]=e}}const i=r&&r["@context"]||{},a=await e.processContext(O(n),i,n);n.hasOwnProperty("omitGraph")||(n.omitGraph=S(a,1.1)),n.hasOwnProperty("pruneBlankNodeIdentifiers")||(n.pruneBlankNodeIdentifiers=S(a,1.1));const s=await e.expand(t,n),c={...n};c.isFrame=!0,c.keepFreeFloatingNodes=!0;const u=await e.expand(r,c),l=Object.keys(r).map((e=>w(a,e,{vocab:!0})));c.merged=!l.includes("@graph"),c.is11=S(a,1.1);const d=y(s,u,c);c.graph=!n.omitGraph,c.skipExpansion=!0,c.link={},c.framing=!0;let p=await e.compact(d,i,c);return c.link={},p=g(p,c),p},e.link=async function(t,r,n){const i={};return r&&(i["@context"]=r),i["@embed"]="@link",e.frame(t,i,n)},e.normalize=e.canonize=async function(t,r){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(r=k(r,{base:v(t)?t:null,algorithm:"URDNA2015",skipExpansion:!1,safe:!0,contextResolver:new o({sharedCache:L})}))){if("application/n-quads"!==r.inputFormat&&"application/nquads"!==r.inputFormat)throw new c("Unknown canonicalization input format.","jsonld.CanonizeError");const e=l.parse(t);return n.canonize(e,r)}const i={...r};delete i.format,i.produceGeneralizedRdf=!1;const a=await e.toRDF(t,i);return n.canonize(a,r)},e.fromRDF=async function(e,r){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");r=k(r,{format:v(e)?"application/n-quads":void 0});const{format:n}=r;let{rdfParser:i}=r;if(n){if(i=i||t[n],!i)throw new c("Unknown input format.","jsonld.UnknownFormat",{format:n})}else i=()=>e;const a=await i(e);return h(a,r)},e.toRDF=async function(t,r){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let n;n=(r=k(r,{base:v(t)?t:"",skipExpansion:!1,contextResolver:new o({sharedCache:L})})).skipExpansion?t:await e.expand(t,r);const i=f(n,r);if(r.format){if("application/n-quads"===r.format||"application/nquads"===r.format)return l.serialize(i);throw new c("Unknown output format.","jsonld.UnknownFormat",{format:r.format})}return i},e.createNodeMap=async function(t,r){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");r=k(r,{base:v(t)?t:"",contextResolver:new o({sharedCache:L})});const n=await e.expand(t,r);return A(n,r)},e.merge=async function(t,r,n){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!m(t))throw new TypeError('Could not merge, "docs" must be an array.');r="function"==typeof r?null:r||null,n=k(n,{contextResolver:new o({sharedCache:L})});const i=await Promise.all(t.map((t=>{const r={...n};return e.expand(t,r)})));let c=!0;"mergeNodes"in n&&(c=n.mergeNodes);const u=n.issuer||new s("_:b"),l={"@default":{}};for(let e=0;ee._documentLoader,set:t=>e._documentLoader=t}),e.documentLoader=async e=>{throw new c("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,r){let n;n="function"==typeof r.documentLoader?r.documentLoader:e.documentLoader;const i=await n(t);try{if(!i.document)throw new c("No remote document found at the given URL.","jsonld.NullRemoteDocument");v(i.document)&&(i.document=JSON.parse(i.document))}catch(e){throw new c("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:e,remoteDoc:i})}return i},e.processContext=async function(e,t,r){return r=k(r,{base:"",contextResolver:new o({sharedCache:L})}),null===t?O(r):(t=a.clone(t),b(t)&&"@context"in t||(t={"@context":t}),T({activeCtx:e,localCtx:t,options:r}))},e.getContextValue=r(51972).getContextValue,e.documentLoaders={},e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new c('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,r){t[e]=r},e.unregisterRDFParser=function(e){delete t[e]},e.registerRDFParser("application/n-quads",l.parse),e.registerRDFParser("application/nquads",l.parse),e.url=r(30470),e.logEventHandler=N,e.logWarningEventHandler=R,e.safeEventHandler=D,e.setDefaultEventHandler=P,e.strictEventHandler=C,e.unhandledEventHandler=M,e.util=a,Object.assign(e,a),e.promises=e,e.RequestQueue=r(73743),e.JsonLdProcessor=r(45445)(e),i.setupGlobals(e),i.setupDocumentLoaders(e),e},k=function(){return L((function(){return k()}))};L(k),e.exports=k},9233:(e,t,r)=>{"use strict";const{isKeyword:n}=r(51972),i=r(3978),a=r(7382),o=r(59263),s=r(82207),c={};e.exports=c,c.createMergedNodeMap=(e,t)=>{const r=(t=t||{}).issuer||new o.IdentifierIssuer("_:b"),n={"@default":{}};return c.createNodeMap(e,n,"@default",r),c.mergeNodeMaps(n)},c.createNodeMap=(e,t,r,u,l,d)=>{if(a.isArray(e)){for(const n of e)c.createNodeMap(n,t,r,u,void 0,d);return}if(!a.isObject(e))return void(d&&d.push(e));if(i.isValue(e)){if("@type"in e){let t=e["@type"];0===t.indexOf("_:")&&(e["@type"]=t=u.getId(t))}return void(d&&d.push(e))}if(d&&i.isList(e)){const n=[];return c.createNodeMap(e["@list"],t,r,u,l,n),void d.push({"@list":n})}if("@type"in e){const t=e["@type"];for(const e of t)0===e.indexOf("_:")&&u.getId(e)}a.isUndefined(l)&&(l=i.isBlankNode(e)?u.getId(e["@id"]):e["@id"]),d&&d.push({"@id":l});const p=t[r],h=p[l]=p[l]||{};h["@id"]=l;const f=Object.keys(e).sort();for(let a of f){if("@id"===a)continue;if("@reverse"===a){const n={"@id":l},a=e["@reverse"];for(const e in a){const s=a[e];for(const a of s){let s=a["@id"];i.isBlankNode(a)&&(s=u.getId(s)),c.createNodeMap(a,t,r,u,s),o.addValue(p[s],e,n,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===a){l in t||(t[l]={}),c.createNodeMap(e[a],t,l,u);continue}if("@included"===a){c.createNodeMap(e[a],t,r,u);continue}if("@type"!==a&&n(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 d=e[a];if(0===a.indexOf("_:")&&(a=u.getId(a)),0!==d.length)for(let e of d)if("@type"===a&&(e=0===e.indexOf("_:")?u.getId(e):e),i.isSubject(e)||i.isSubjectReference(e)){if("@id"in e&&!e["@id"])continue;const n=i.isBlankNode(e)?u.getId(e["@id"]):e["@id"];o.addValue(h,a,{"@id":n},{propertyIsArray:!0,allowDuplicate:!1}),c.createNodeMap(e,t,r,u,n)}else if(i.isValue(e))o.addValue(h,a,e,{propertyIsArray:!0,allowDuplicate:!1});else if(i.isList(e)){const n=[];c.createNodeMap(e["@list"],t,r,u,l,n),e={"@list":n},o.addValue(h,a,e,{propertyIsArray:!0,allowDuplicate:!1})}else c.createNodeMap(e,t,r,u,l),o.addValue(h,a,e,{propertyIsArray:!0,allowDuplicate:!1});else o.addValue(h,a,[],{propertyIsArray:!0})}},c.mergeNodeMapGraphs=e=>{const t={};for(const r of Object.keys(e).sort())for(const i of Object.keys(e[r]).sort()){const a=e[r][i];i in t||(t[i]={"@id":i});const s=t[i];for(const e of Object.keys(a).sort())if(n(e)&&"@type"!==e)s[e]=o.clone(a[e]);else for(const t of a[e])o.addValue(s,e,o.clone(t),{propertyIsArray:!0,allowDuplicate:!1})}return t},c.mergeNodeMaps=e=>{const t=e["@default"],r=Object.keys(e).sort();for(const n of r){if("@default"===n)continue;const r=e[n];let a=t[n];a?"@graph"in a||(a["@graph"]=[]):t[n]=a={"@id":n,"@graph":[]};const o=a["@graph"];for(const e of Object.keys(r).sort()){const t=r[e];i.isSubjectReference(t)||o.push(t)}}return t}},60701:(e,t,r)=>{"use strict";const n=r(86957),i={};e.exports=i,i.setupDocumentLoaders=function(e){"undefined"!=typeof XMLHttpRequest&&(e.documentLoaders.xhr=n,e.useDocumentLoader("xhr"))},i.setupGlobals=function(e){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:e.JsonLdProcessor})}},99180:(e,t,r)=>{"use strict";const{createNodeMap:n}=r(9233),{isKeyword:i}=r(51972),a=r(3978),o=r(82341),s=r(82207),c=r(7382),u=r(59263),{handleEvent:l}=r(92246),{RDF_FIRST:d,RDF_REST:p,RDF_NIL:h,RDF_TYPE:f,RDF_JSON_LITERAL:y,RDF_LANGSTRING:g,XSD_BOOLEAN:m,XSD_DOUBLE:b,XSD_INTEGER:v,XSD_STRING:_}=r(49378),{isAbsolute:w}=r(30470),O={};function T(e,t,r,n,a){const o=Object.keys(t).sort();for(const s of o){const o=t[s],c=Object.keys(o).sort();for(let t of c){const c=o[t];if("@type"===t)t=f;else if(i(t))continue;for(const i of c){const o={termType:s.startsWith("_:")?"BlankNode":"NamedNode",value:s};if(!w(s)){a.eventHandler&&l({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:s}},options:a});continue}const c={termType:t.startsWith("_:")?"BlankNode":"NamedNode",value:t};if(!w(t)){a.eventHandler&&l({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:t}},options:a});continue}if("BlankNode"===c.termType&&!a.produceGeneralizedRdf){a.eventHandler&&l({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:n.getOldIds().find((e=>n.getId(e)===t))}},options:a});continue}const u=S(i,n,e,r,a.rdfDirection,a);u&&e.push({subject:o,predicate:c,object:u,graph:r})}}}}function S(e,t,r,n,i,u){const f={};if(a.isValue(e)){f.termType="Literal",f.value=void 0,f.datatype={termType:"NamedNode"};let t=e["@value"];const r=e["@type"]||null;if("@json"===r)f.value=o(t),f.datatype.value=y;else if(c.isBoolean(t))f.value=t.toString(),f.datatype.value=r||m;else if(c.isDouble(t)||r===b)c.isDouble(t)||(t=parseFloat(t)),f.value=t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),f.datatype.value=r||b;else if(c.isNumber(t))f.value=t.toFixed(0),f.datatype.value=r||v;else if("@direction"in e&&"i18n-datatype"===i){const r=`https://www.w3.org/ns/i18n#${(e["@language"]||"").toLowerCase()}_${e["@direction"]}`;f.datatype.value=r,f.value=t}else{if("@direction"in e&&"compound-literal"===i)throw new s("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:i});if("@direction"in e&&i)throw new s("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:i});"@language"in e?("@direction"in e&&!i&&u.eventHandler&&l({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:f.value}},options:u}),f.value=t,f.datatype.value=r||g,f.language=e["@language"]):("@direction"in e&&!i&&u.eventHandler&&l({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:f.value}},options:u}),f.value=t,f.datatype.value=r||_)}}else if(a.isList(e)){const a=function(e,t,r,n,i,a){const o={termType:"NamedNode",value:d},s={termType:"NamedNode",value:p},c={termType:"NamedNode",value:h},u=e.pop(),l=u?{termType:"BlankNode",value:t.getId()}:c;let f=l;for(const c of e){const e=S(c,t,r,n,i,a),u={termType:"BlankNode",value:t.getId()};r.push({subject:f,predicate:o,object:e,graph:n}),r.push({subject:f,predicate:s,object:u,graph:n}),f=u}if(u){const e=S(u,t,r,n,i,a);r.push({subject:f,predicate:o,object:e,graph:n}),r.push({subject:f,predicate:s,object:c,graph:n})}return l}(e["@list"],t,r,n,i,u);f.termType=a.termType,f.value=a.value}else{const t=c.isObject(e)?e["@id"]:e;f.termType=t.startsWith("_:")?"BlankNode":"NamedNode",f.value=t}return"NamedNode"!==f.termType||w(f.value)?f:(u.eventHandler&&l({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:f.value}},options:u}),null)}e.exports=O,O.toRDF=(e,t)=>{const r=new u.IdentifierIssuer("_:b"),i={"@default":{}};n(e,i,"@default",r);const a=[],o=Object.keys(i).sort();for(const e of o){let n;if("@default"===e)n={termType:"DefaultGraph",value:""};else{if(!w(e)){t.eventHandler&&l({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:e}},options:t});continue}n=e.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},n.value=e}T(a,i[e],n,r,t)}return a}},7382: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},30470:(e,t,r)=>{"use strict";const n=r(7382),i={};e.exports=i,i.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*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},i.parse=(e,t)=>{const r={},n=i.parsers[t||"full"],a=n.regex.exec(e);let o=n.keys.length;for(;o--;)r[n.keys[o]]=void 0===a[o]?null:a[o];return("https"===r.scheme&&"443"===r.port||"http"===r.scheme&&"80"===r.port)&&(r.href=r.href.replace(":"+r.port,""),r.authority=r.authority.replace(":"+r.port,""),r.port=null),r.normalizedPath=i.removeDotSegments(r.path),r},i.prependBase=(e,t)=>{if(null===e)return t;if(i.isAbsolute(t))return t;e&&!n.isString(e)||(e=i.parse(e||""));const r=i.parse(t),a={protocol:e.protocol||""};if(null!==r.authority)a.authority=r.authority,a.path=r.path,a.query=r.query;else if(a.authority=e.authority,""===r.path)a.path=e.path,null!==r.query?a.query=r.query:a.query=e.query;else{if(0===r.path.indexOf("/"))a.path=r.path;else{let t=e.path;t=t.substr(0,t.lastIndexOf("/")+1),(t.length>0||e.authority)&&"/"!==t.substr(-1)&&(t+="/"),t+=r.path,a.path=t}a.query=r.query}""!==r.path&&(a.path=i.removeDotSegments(a.path));let o=a.protocol;return null!==a.authority&&(o+="//"+a.authority),o+=a.path,null!==a.query&&(o+="?"+a.query),null!==r.fragment&&(o+="#"+r.fragment),""===o&&(o="./"),o},i.removeBase=(e,t)=>{if(null===e)return t;e&&!n.isString(e)||(e=i.parse(e||""));let r="";if(""!==e.href?r+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(r+="//"),0!==t.indexOf(r))return t;const a=i.parse(t.substr(r.length)),o=e.normalizedPath.split("/"),s=a.normalizedPath.split("/"),c=a.fragment||a.query?0:1;for(;o.length>0&&s.length>c&&o[0]===s[0];)o.shift(),s.shift();let u="";if(o.length>0){o.pop();for(let e=0;e{if(0===e.length)return"";const t=e.split("/"),r=[];for(;t.length>0;){const e=t.shift(),n=0===t.length;"."!==e?".."!==e?r.push(e):(r.pop(),n&&r.push("")):n&&r.push("")}return"/"===e[0]&&r.length>0&&""!==r[0]&&r.unshift(""),1===r.length&&""===r[0]?"/":r.join("/")};const a=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;i.isAbsolute=e=>n.isString(e)&&a.test(e),i.isRelative=e=>n.isString(e)},59263:(e,t,r)=>{"use strict";const n=r(3978),i=r(7382),a=r(28023).IdentifierIssuer,o=r(82207),s=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,c=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,u=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,l="application/ld+json, application/json",d={};function p(e,t){if(i.isArray(t))for(let r=0;r{if(Object.keys(e).some((e=>"accept"===e.toLowerCase())))throw new RangeError('Accept header may not be specified; only "'+l+'" is supported.');return Object.assign({Accept:l},e)},d.parseLinkHeader=e=>{const t={},r=e.match(s);for(let e=0;e{if(!(i.isString(e)||i.isArray(e)&&e.every((e=>i.isString(e))))){if(t&&i.isObject(e))switch(Object.keys(e).length){case 0:return;case 1:if("@default"in e&&d.asArray(e["@default"]).every((e=>i.isString(e))))return}throw new o('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})}},d.hasProperty=(e,t)=>{if(e.hasOwnProperty(t)){const r=e[t];return!i.isArray(r)||r.length>0}return!1},d.hasValue=(e,t,r)=>{if(d.hasProperty(e,t)){let a=e[t];const o=n.isList(a);if(i.isArray(a)||o){o&&(a=a["@list"]);for(let e=0;e{if("propertyIsArray"in(n=n||{})||(n.propertyIsArray=!1),"valueIsArray"in n||(n.valueIsArray=!1),"allowDuplicate"in n||(n.allowDuplicate=!0),"prependValue"in n||(n.prependValue=!1),n.valueIsArray)e[t]=r;else if(i.isArray(r)){0===r.length&&n.propertyIsArray&&!e.hasOwnProperty(t)&&(e[t]=[]),n.prependValue&&(r=r.concat(e[t]),e[t]=[]);for(let i=0;i[].concat(e[t]||[]),d.removeProperty=(e,t)=>{delete e[t]},d.removeValue=(e,t,r,n)=>{"propertyIsArray"in(n=n||{})||(n.propertyIsArray=!1);const i=d.getValues(e,t).filter((e=>!d.compareValues(e,r)));0===i.length?d.removeProperty(e,t):1!==i.length||n.propertyIsArray?e[t]=i:e[t]=i[0]},d.relabelBlankNodes=(e,t)=>p((t=t||{}).issuer||new a("_:b"),e),d.compareValues=(e,t)=>e===t||!(!n.isValue(e)||!n.isValue(t)||e["@value"]!==t["@value"]||e["@type"]!==t["@type"]||e["@language"]!==t["@language"]||e["@index"]!==t["@index"])||!!(i.isObject(e)&&"@id"in e&&i.isObject(t)&&"@id"in t)&&e["@id"]===t["@id"],d.compareShortestLeast=(e,t)=>e.length{"use strict";const n=r(28799),i=Symbol("max"),a=Symbol("length"),o=Symbol("lengthCalculator"),s=Symbol("allowStale"),c=Symbol("maxAge"),u=Symbol("dispose"),l=Symbol("noDisposeOnSet"),d=Symbol("lruList"),p=Symbol("cache"),h=Symbol("updateAgeOnGet"),f=()=>1,y=(e,t,r)=>{const n=e[p].get(t);if(n){const t=n.value;if(g(e,t)){if(b(e,n),!e[s])return}else r&&(e[h]&&(n.value.now=Date.now()),e[d].unshiftNode(n));return t.value}},g=(e,t)=>{if(!t||!t.maxAge&&!e[c])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[c]&&r>e[c]},m=e=>{if(e[a]>e[i])for(let t=e[d].tail;e[a]>e[i]&&null!==t;){const r=t.prev;b(e,t),t=r}},b=(e,t)=>{if(t){const r=t.value;e[u]&&e[u](r.key,r.value),e[a]-=r.length,e[p].delete(r.key),e[d].removeNode(t)}};class v{constructor(e,t,r,n,i){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=i||0}}const _=(e,t,r,n)=>{let i=r.value;g(e,i)&&(b(e,r),e[s]||(i=void 0)),i&&t.call(n,i.value,i.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[i]=e.max||1/0;const t=e.length||f;if(this[o]="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[c]=e.maxAge||0,this[u]=e.dispose,this[l]=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[i]=e||1/0,m(this)}get max(){return this[i]}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[c]=e,m(this)}get maxAge(){return this[c]}set lengthCalculator(e){"function"!=typeof e&&(e=f),e!==this[o]&&(this[o]=e,this[a]=0,this[d].forEach((e=>{e.length=this[o](e.value,e.key),this[a]+=e.length}))),m(this)}get lengthCalculator(){return this[o]}get length(){return this[a]}get itemCount(){return this[d].length}rforEach(e,t){t=t||this;for(let r=this[d].tail;null!==r;){const n=r.prev;_(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[d].head;null!==r;){const n=r.next;_(this,e,r,t),r=n}}keys(){return this[d].toArray().map((e=>e.key))}values(){return this[d].toArray().map((e=>e.value))}reset(){this[u]&&this[d]&&this[d].length&&this[d].forEach((e=>this[u](e.key,e.value))),this[p]=new Map,this[d]=new n,this[a]=0}dump(){return this[d].map((e=>!g(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[d]}set(e,t,r){if((r=r||this[c])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,s=this[o](t,e);if(this[p].has(e)){if(s>this[i])return b(this,this[p].get(e)),!1;const o=this[p].get(e).value;return this[u]&&(this[l]||this[u](e,o.value)),o.now=n,o.maxAge=r,o.value=t,this[a]+=s-o.length,o.length=s,this.get(e),m(this),!0}const h=new v(e,t,s,n,r);return h.length>this[i]?(this[u]&&this[u](e,t),!1):(this[a]+=h.length,this[d].unshift(h),this[p].set(e,this[d].head),m(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 y(this,e,!0)}peek(e){return y(this,e,!1)}pop(){const e=this[d].tail;return e?(b(this,e),e.value):null}del(e){b(this,this[p].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{const e=i-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[p].forEach(((e,t)=>y(this,t,!1)))}}},28023:(e,t,r)=>{e.exports=r(43335)},77259:e=>{"use strict";e.exports=class e{constructor(e,t=new Map,r=0){this.prefix=e,this._existing=t,this.counter=r}clone(){const{prefix:t,_existing:r,counter:n}=this;return new e(t,new Map(r),n)}getId(e){const t=e&&this._existing.get(e);if(t)return t;const r=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,r),r}hasId(e){return this._existing.has(e)}getOldIds(){return[...this._existing.keys()]}}},6441:(e,t,r)=>{"use strict";r(42791);const n=self.crypto||self.msCrypto;e.exports=class{constructor(e){if(!n||!n.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 n.subtle.digest(this.algorithm,e));let r="";for(let e=0;e{"use strict";const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",r="http://www.w3.org/2001/XMLSchema#string",n="NamedNode",i="BlankNode",a="Literal",o="DefaultGraph",s={};(()=>{const e="(?:<([^:]+:[^>]*)>)",t="A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_",r=t+"0-9-·̀-ͯ‿-⁀",n="(_:(?:["+t+"0-9])(?:(?:["+r+".])*(?:["+r+"]))?)",i="[ \\t]+",a="[ \\t]*",o="(?:"+e+"|"+n+")"+i,c=e+i,u="(?:"+e+"|"+n+'|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^'+e+")|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))"+a,l="(?:\\.|(?:(?:"+e+"|"+n+")"+a+"\\.))";s.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,s.empty=new RegExp("^"+a+"$"),s.quad=new RegExp("^"+a+o+c+u+l+a+"$")})(),e.exports=class e{static parse(e){const c=[],l={},d=e.split(s.eoln);let p=0;for(const e of d){if(p++,s.empty.test(e))continue;const d=e.match(s.quad);if(null===d)throw new Error("N-Quads parse error on line "+p+".");const y={subject:null,predicate:null,object:null,graph:null};if(void 0!==d[1]?y.subject={termType:n,value:d[1]}:y.subject={termType:i,value:d[2]},y.predicate={termType:n,value:d[3]},void 0!==d[4]?y.object={termType:n,value:d[4]}:void 0!==d[5]?y.object={termType:i,value:d[5]}:(y.object={termType:a,value:void 0,datatype:{termType:n}},void 0!==d[7]?y.object.datatype.value=d[7]:void 0!==d[8]?(y.object.datatype.value=t,y.object.language=d[8]):y.object.datatype.value=r,y.object.value=d[6].replace(u,(function(e,t,r,n){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(r)return String.fromCharCode(parseInt(r,16));if(n)throw new Error("Unsupported U escape")}))),void 0!==d[9]?y.graph={termType:n,value:d[9]}:void 0!==d[10]?y.graph={termType:i,value:d[10]}:y.graph={termType:o,value:""},y.graph.value in l){let e=!0;const t=l[y.graph.value];for(const r of t)if(f=y,(h=r).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(y),c.push(y))}else l[y.graph.value]=[y],c.push(y)}var h,f;return c}static serialize(t){Array.isArray(t)||(t=e.legacyDatasetToQuads(t));const r=[];for(const n of t)r.push(e.serializeQuad(n));return r.sort().join("")}static serializeQuadComponents(e,a,o,s){let u="";return e.termType===n?u+=`<${e.value}>`:u+=`${e.value}`,u+=` <${a.value}> `,o.termType===n?u+=`<${o.value}>`:o.termType===i?u+=o.value:(u+=`"${function(e){return e.replace(c,(function(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}}))}(o.value)}"`,o.datatype.value===t?o.language&&(u+=`@${o.language}`):o.datatype.value!==r&&(u+=`^^<${o.datatype.value}>`)),s.termType===n?u+=` <${s.value}>`:s.termType===i&&(u+=` ${s.value}`),u+=" .\n",u}static serializeQuad(t){return e.serializeQuadComponents(t.subject,t.predicate,t.object,t.graph)}static legacyDatasetToQuads(e){const s=[],c={"blank node":i,IRI:n,literal:a};for(const u in e)e[u].forEach((e=>{const l={};for(const i in e){const o=e[i],s={termType:c[o.type],value:o.value};s.termType===a&&(s.datatype={termType:n},"datatype"in o&&(s.datatype.value=o.datatype),"language"in o?("datatype"in o||(s.datatype.value=t),s.language=o.language):"datatype"in o||(s.datatype.value=r)),l[i]=s}l.graph="@default"===u?{termType:o,value:""}:{termType:u.startsWith("_:")?i:n,value:u},s.push(l)}));return s}};const c=/["\\\n\r]/g,u=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},43343:e=>{"use strict";e.exports=class{constructor(e){this.current=e.sort(),this.done=!1,this.dir=new Map;for(let t=0;tn)&&(s&&r>0&&o>e[r-1]||!s&&re[r+1])&&(n=o,i=r)}if(null===n)this.done=!0;else{const r=t.get(n)?i-1:i+1;e[i]=e[r],e[r]=n;for(const r of e)r>n&&t.set(r,!t.get(r))}return r}}},70171:(e,t,r)=>{"use strict";const n=r(77259),i=r(6441),a=r(43343),o=r(65181);function s(e,t){return e.hasht.hash?1:0}e.exports=class{constructor({createMessageDigest:e=()=>new i("sha256"),canonicalIdMap:t=new Map,maxDeepIterations:r=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new n("_:c14n",t),this.createMessageDigest=e,this.maxDeepIterations=r,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,r=[...this.blankNodeInfo.keys()];let i=0;for(const e of r)++i%100==0&&await this._yield(),await this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const a=[...t.keys()].sort(),c=[];for(const e of a){const r=t.get(e);if(r.length>1){c.push(r);continue}const n=r[0];this.canonicalIssuer.getId(n)}for(const e of c){const t=[];for(const r of e){if(this.canonicalIssuer.hasId(r))continue;const e=new n("_:b");e.getId(r);const i=await this.hashNDegreeQuads(r,e);t.push(i)}t.sort(s);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const u=[];for(const e of this.quads){const t=o.serializeQuadComponents(this._componentWithCanonicalId(e.subject),e.predicate,this._componentWithCanonicalId(e.object),this._componentWithCanonicalId(e.graph));u.push(t)}return u.sort(),u.join("")}async hashFirstDegreeQuads(e){const t=[],r=this.blankNodeInfo.get(e),n=r.quads;for(const r of n){const n={subject:null,predicate:r.predicate,object:null,graph:null};n.subject=this.modifyFirstDegreeComponent(e,r.subject,"subject"),n.object=this.modifyFirstDegreeComponent(e,r.object,"object"),n.graph=this.modifyFirstDegreeComponent(e,r.graph,"graph"),t.push(o.serializeQuad(n))}t.sort();const i=this.createMessageDigest();for(const e of t)i.update(e);return r.hash=await i.digest(),r.hash}async hashRelatedBlankNode(e,t,r,n){let i;i=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):r.hasId(e)?r.getId(e):this.blankNodeInfo.get(e).hash;const a=this.createMessageDigest();return a.update(n),"g"!==n&&a.update(this.getRelatedPredicate(t)),a.update(i),a.digest()}async hashNDegreeQuads(e,t){const r=this.deepIterations.get(e)||0;if(r>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,r+1);const n=this.createMessageDigest(),i=await this.createHashToRelated(e,t),o=[...i.keys()].sort();for(const e of o){n.update(e);let r,o="";const s=new a(i.get(e));let c=0;for(;s.hasNext();){const e=s.next();++c%3==0&&await this._yield();let n=t.clone(),i="";const a=[];let u=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?i+=this.canonicalIssuer.getId(t):(n.hasId(t)||a.push(t),i+=n.getId(t)),0!==o.length&&i>o){u=!0;break}if(!u){for(const e of a){const t=await this.hashNDegreeQuads(e,n);if(i+=n.getId(e),i+=`<${t.hash}>`,n=t.issuer,0!==o.length&&i>o){u=!0;break}}u||(0===o.length||i`}async createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;let i=0;for(const a of n)++i%100==0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:a,component:a.subject,position:"s",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:a,component:a.object,position:"o",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:a,component:a.graph,position:"g",id:e,issuer:t,hashToRelated:r})]);return r}async _hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const r=await this.hashFirstDegreeQuads(e),n=t.get(r);n?n.push(e):t.set(r,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const r=t.value,n=this.blankNodeInfo.get(r);n?n.quads.add(e):this.blankNodeInfo.set(r,{quads:new Set([e]),hash:null})}async _addRelatedBlankNodeHash({quad:e,component:t,position:r,id:n,issuer:i,hashToRelated:a}){if("BlankNode"!==t.termType||t.value===n)return;const o=t.value,s=await this.hashRelatedBlankNode(o,e,i,r),c=a.get(s);c?c.push(o):a.set(s,[o])}_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)))}}},41820:(e,t,r)=>{"use strict";const n=r(77259),i=r(6441),a=r(43343),o=r(65181);function s(e,t){return e.hasht.hash?1:0}e.exports=class{constructor({createMessageDigest:e=()=>new i("sha256"),canonicalIdMap:t=new Map,maxDeepIterations:r=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new n("_:c14n",t),this.createMessageDigest=e,this.maxDeepIterations=r,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,r=[...this.blankNodeInfo.keys()];for(const e of r)this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const i=[...t.keys()].sort(),a=[];for(const e of i){const r=t.get(e);if(r.length>1){a.push(r);continue}const n=r[0];this.canonicalIssuer.getId(n)}for(const e of a){const t=[];for(const r of e){if(this.canonicalIssuer.hasId(r))continue;const e=new n("_:b");e.getId(r);const i=this.hashNDegreeQuads(r,e);t.push(i)}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=o.serializeQuadComponents(this._componentWithCanonicalId({component:e.subject}),e.predicate,this._componentWithCanonicalId({component:e.object}),this._componentWithCanonicalId({component:e.graph}));c.push(t)}return c.sort(),c.join("")}hashFirstDegreeQuads(e){const t=[],r=this.blankNodeInfo.get(e),n=r.quads;for(const r of n){const n={subject:null,predicate:r.predicate,object:null,graph:null};n.subject=this.modifyFirstDegreeComponent(e,r.subject,"subject"),n.object=this.modifyFirstDegreeComponent(e,r.object,"object"),n.graph=this.modifyFirstDegreeComponent(e,r.graph,"graph"),t.push(o.serializeQuad(n))}t.sort();const i=this.createMessageDigest();for(const e of t)i.update(e);return r.hash=i.digest(),r.hash}hashRelatedBlankNode(e,t,r,n){let i;i=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):r.hasId(e)?r.getId(e):this.blankNodeInfo.get(e).hash;const a=this.createMessageDigest();return a.update(n),"g"!==n&&a.update(this.getRelatedPredicate(t)),a.update(i),a.digest()}hashNDegreeQuads(e,t){const r=this.deepIterations.get(e)||0;if(r>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,r+1);const n=this.createMessageDigest(),i=this.createHashToRelated(e,t),o=[...i.keys()].sort();for(const e of o){n.update(e);let r,o="";const s=new a(i.get(e));for(;s.hasNext();){const e=s.next();let n=t.clone(),i="";const a=[];let c=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?i+=this.canonicalIssuer.getId(t):(n.hasId(t)||a.push(t),i+=n.getId(t)),0!==o.length&&i>o){c=!0;break}if(!c){for(const e of a){const t=this.hashNDegreeQuads(e,n);if(i+=n.getId(e),i+=`<${t.hash}>`,n=t.issuer,0!==o.length&&i>o){c=!0;break}}c||(0===o.length||i`}createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;for(const i of n)this._addRelatedBlankNodeHash({quad:i,component:i.subject,position:"s",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:i,component:i.object,position:"o",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:i,component:i.graph,position:"g",id:e,issuer:t,hashToRelated:r});return r}_hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const r=this.hashFirstDegreeQuads(e),n=t.get(r);n?n.push(e):t.set(r,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const r=t.value,n=this.blankNodeInfo.get(r);n?n.quads.add(e):this.blankNodeInfo.set(r,{quads:new Set([e]),hash:null})}_addRelatedBlankNodeHash({quad:e,component:t,position:r,id:n,issuer:i,hashToRelated:a}){if("BlankNode"!==t.termType||t.value===n)return;const o=t.value,s=this.hashRelatedBlankNode(o,e,i,r),c=a.get(s);c?c.push(o):a.set(s,[o])}_componentWithCanonicalId({component:e}){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}}},12191:(e,t,r)=>{"use strict";const n=r(6441),i=r(70171);e.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new n("sha1")}modifyFirstDegreeComponent(e,t,r){return"BlankNode"!==t.termType?t:"graph"===r?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}async createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;let i=0;for(const a of n){let n,o;if("BlankNode"===a.subject.termType&&a.subject.value!==e)o=a.subject.value,n="p";else{if("BlankNode"!==a.object.termType||a.object.value===e)continue;o=a.object.value,n="r"}++i%100==0&&await this._yield();const s=await this.hashRelatedBlankNode(o,a,t,n),c=r.get(s);c?c.push(o):r.set(s,[o])}return r}}},9272:(e,t,r)=>{"use strict";const n=r(6441),i=r(41820);e.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new n("sha1")}modifyFirstDegreeComponent(e,t,r){return"BlankNode"!==t.termType?t:"graph"===r?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;for(const i of n){let n,a;if("BlankNode"===i.subject.termType&&i.subject.value!==e)a=i.subject.value,n="p";else{if("BlankNode"!==i.object.termType||i.object.value===e)continue;a=i.object.value,n="r"}const o=this.hashRelatedBlankNode(a,i,t,n),s=r.get(o);s?s.push(a):r.set(o,[a])}return r}}},43335:(e,t,r)=>{"use strict";const n=r(70171),i=r(12191),a=r(41820),o=r(9272);let s;try{s=r(61895)}catch(e){}function c(e){return Array.isArray(e)?e:t.NQuads.legacyDatasetToQuads(e)}t.NQuads=r(65181),t.IdentifierIssuer=r(77259),t._rdfCanonizeNative=function(e){return e&&(s=e),s},t.canonize=async function(e,t){const r=c(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,n)=>s.canonize(r,t,((t,r)=>t?n(t):e(r)))))}if("URDNA2015"===t.algorithm)return new n(t).main(r);if("URGNA2012"===t.algorithm){if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new i(t).main(r)}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 r=c(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(r,t)}if("URDNA2015"===t.algorithm)return new a(t).main(r);if("URGNA2012"===t.algorithm){if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new o(t).main(r)}if(!("algorithm"in t))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm)}},51873:(e,t,r)=>{var n=r(9325).Symbol;e.exports=n},72552:(e,t,r)=>{var n=r(51873),i=r(659),a=r(59350),o=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?i(e):a(e)}},54128:(e,t,r)=>{var n=r(31800),i=/^\s+/;e.exports=function(e){return e?e.slice(0,n(e)+1).replace(i,""):e}},34840:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},659:(e,t,r)=>{var n=r(51873),i=Object.prototype,a=i.hasOwnProperty,o=i.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=a.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=o.call(e);return n&&(t?e[s]=r:delete e[s]),i}},59350:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},9325:(e,t,r)=>{var n=r(34840),i="object"==typeof self&&self&&self.Object===Object&&self,a=n||i||Function("return this")();e.exports=a},31800:e=>{var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},12177:(e,t,r)=>{var n=r(61489);e.exports=function(e,t){var r;if("function"!=typeof t)throw new TypeError("Expected a function");return e=n(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}},23805:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},40346:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},44394:(e,t,r)=>{var n=r(72552),i=r(40346);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==n(e)}},58059:(e,t,r)=>{var n=r(12177);e.exports=function(e){return n(2,e)}},17400:(e,t,r)=>{var n=r(99374),i=1/0;e.exports=function(e){return e?(e=n(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},61489:(e,t,r)=>{var n=r(17400);e.exports=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}},99374:(e,t,r)=>{var n=r(54128),i=r(23805),a=r(44394),o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=s.test(e);return r||c.test(e)?u(e.slice(2),r?2:8):o.test(e)?NaN:+e}},43349:e=>{function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},65852:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});const n="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i="http://www.w3.org/2001/XMLSchema#",a="http://www.w3.org/2000/10/swap/",o={xsd:{decimal:`${i}decimal`,boolean:`${i}boolean`,double:`${i}double`,integer:`${i}integer`,string:`${i}string`},rdf:{type:`${n}type`,nil:`${n}nil`,first:`${n}first`,rest:`${n}rest`,langString:`${n}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${a}reify#forSome`,forAll:`${a}reify#forAll`},log:{implies:`${a}log#implies`}}},28612:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>u,FL:()=>m,PB:()=>h,Yo:()=>d,iN:()=>g,kO:()=>b,n7:()=>b,rT:()=>f,uS:()=>p,x1:()=>l,yV:()=>y});var n=r(65852);const{rdf:i,xsd:a}=n.A;let o,s=0;const c={namedNode:v,blankNode:_,variable:O,literal:w,defaultGraph:function(){return o},quad:T,triple:T,fromTerm:S,fromQuad:E},u=c;class l{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof l?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}class d extends l{get termType(){return"NamedNode"}}class p extends l{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let t=e.lastIndexOf('"')+1;return t0?"INF":"-INF")))),""===r||r===a.string?new p(`"${e}"`):new p(`"${e}"^^${r}`)}function O(e){return new f(e)}function T(e,t,r,n){return new b(e,t,r,n)}function S(e){if(e instanceof l)return e;switch(e.termType){case"NamedNode":return v(e.value);case"BlankNode":return _(e.value);case"Variable":return O(e.value);case"DefaultGraph":return o;case"Literal":return w(e.value,e.language||e.datatype);case"Quad":return E(e);default:throw new Error(`Unexpected termType: ${e.termType}`)}}function E(e){if(e instanceof b)return e;if("Quad"!==e.termType)throw new Error(`Unexpected termType: ${e.termType}`);return T(S(e.subject),S(e.predicate),S(e.object),S(e.graph))}},3524:(e,t,r)=>{"use strict";r.d(t,{A:()=>h});var n=r(48287),i=r(79596),a=r.n(i),o=r(65852);const{xsd:s}=o.A,c=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,u={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},l=/[\x00-\x20<>\\"\{\}\|\^\`]/,d={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},p=/$0^/;class h{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,e=e||{},this._lineMode=!!e.lineMode){this._n3Mode=!1;for(const e in this)!(e in d)&&this[e]instanceof RegExp&&(this[e]=p)}else this._n3Mode=!1!==e.n3;this.comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let r=this._input,n=r.length;for(;;){let e,o;for(;e=this._newline.exec(r);)this.comments&&(o=this._comment.exec(e[0]))&&i("comment",o[1],"",this._line,e[0].length),r=r.substr(e[0].length,r.length),n=r.length,this._line++;if(!e&&(e=this._whitespace.exec(r))&&(r=r.substr(e[0].length,r.length)),this._endOfFile.test(r))return t&&(this.comments&&(o=this._comment.exec(r))&&i("comment",o[1],"",this._line,r.length),r=null,i("eof","","",this._line,0)),this._input=r;const c=this._line,u=r[0];let d="",p="",h="",f=null,y=0,g=!1;switch(u){case"^":if(r.length<3)break;if("^"!==r[1]){this._n3Mode&&(y=1,d="^");break}if(this._previousMarker="^^",r=r.substr(2),"<"!==r[0]){g=!0;break}case"<":if(f=this._unescapedIri.exec(r))d="IRI",p=f[1];else if(f=this._iri.exec(r)){if(p=this._unescape(f[1]),null===p||l.test(p))return a(this);d="IRI"}else r.length>1&&"<"===r[1]?(d="<<",y=2):this._n3Mode&&r.length>1&&"="===r[1]&&(d="inverse",y=2,p=">");break;case">":r.length>1&&">"===r[1]&&(d=">>",y=2);break;case"_":((f=this._blank.exec(r))||t&&(f=this._blank.exec(`${r} `)))&&(d="blank",h="_",p=f[1]);break;case'"':if(f=this._simpleQuotedString.exec(r))p=f[1];else if(({value:p,matchLength:y}=this._parseLiteral(r)),null===p)return a(this);null===f&&0===y||(d="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(f=this._simpleApostropheString.exec(r))p=f[1];else if(({value:p,matchLength:y}=this._parseLiteral(r)),null===p)return a(this);null===f&&0===y||(d="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(f=this._variable.exec(r))&&(d="var",p=f[0]);break;case"@":"literal"===this._previousMarker&&(f=this._langcode.exec(r))?(d="langcode",p=f[1]):(f=this._keyword.exec(r))&&(d=f[0]);break;case".":if(1===r.length?t:r[1]<"0"||r[1]>"9"){d=".",y=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(f=this._number.exec(r)||t&&(f=this._number.exec(`${r} `)))&&(d="literal",p=f[0],h="string"==typeof f[1]?s.double:"string"==typeof f[2]?s.decimal:s.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(f=this._sparqlKeyword.exec(r))?d=f[0].toUpperCase():g=!0;break;case"f":case"t":(f=this._boolean.exec(r))?(d="literal",p=f[0],h=s.boolean):g=!0;break;case"a":(f=this._shortPredicates.exec(r))?(d="abbreviation",p="a"):g=!0;break;case"=":this._n3Mode&&r.length>1&&(d="abbreviation",">"!==r[1]?(y=1,p="="):(y=2,p=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(y=1,d=u);break;case"{":!this._lineMode&&r.length>=2&&("|"===r[1]?(d="{|",y=2):(d=u,y=1));break;case"|":r.length>=2&&"}"===r[1]&&(d="|}",y=2);break;default:g=!0}if(g&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(f=this._prefix.exec(r))?((f=this._prefixed.exec(r))||t&&(f=this._prefixed.exec(`${r} `)))&&(d="prefixed",h=f[1]||"",p=this._unescape(f[2])):(d="prefix",p=f[1]||"")),"^^"===this._previousMarker)switch(d){case"prefixed":d="type";break;case"IRI":d="typeIRI";break;default:d=""}if(!d)return t||!/^'''|^"""/.test(r)&&/\n|\r/.test(r)?a(this):this._input=r;const m=y||f[0].length,b=i(d,p,h,c,m);this.previousToken=b,this._previousMarker=d,r=r.substr(m,r.length)}function i(t,i,a,o,s){const c=r?n-r.length:n,u={type:t,value:i,prefix:a,line:o,start:c,end:c+s};return e(null,u),u}function a(t){e(t._syntaxError(/^\S*/.exec(r)[0]))}}_unescape(e){let t=!1;const r=e.replace(c,((e,r,n,i)=>{if("string"==typeof r)return String.fromCharCode(Number.parseInt(r,16));if("string"==typeof n){let e=Number.parseInt(n,16);return e<=65535?String.fromCharCode(Number.parseInt(n,16)):String.fromCharCode(55296+((e-=65536)>>10),56320+(1023&e))}return i in u?u[i]:(t=!0,"")}));return t?null:r}_parseLiteral(e){if(e.length>=3){const t=e.match(/^(?:"""|"|'''|'|)/)[0],r=t.length;let n=Math.max(this._literalClosingPos,r);for(;(n=e.indexOf(t,n))>0;){let t=0;for(;"\\"===e[n-t-1];)t++;if(t%2==0){const t=e.substring(r,n),i=t.split(/\r\n|\r|\n/).length-1,a=n+r;if(1===r&&0!==i||3===r&&this._lineMode)break;return this._line+=i,{value:this._unescape(t),matchLength:a}}n++}this._literalClosingPos=e.length-r+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const t=new Error(`Unexpected "${e}" on line ${this._line}.`);return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}_readStartingBom(e){return e.startsWith("\ufeff")?e.substr(1):e}tokenize(e,t){if(this._line=1,"string"==typeof e){if(this._input=this._readStartingBom(e),"function"!=typeof t){const e=[];let t;if(this._tokenizeToEnd(((r,n)=>r?t=r:e.push(n)),!0),t)throw t;return e}a()((()=>this._tokenizeToEnd(t,!0)))}else this._pendingBuffer=null,"function"==typeof e.setEncoding&&e.setEncoding("utf8"),e.on("data",(e=>{null!==this._input&&0!==e.length&&(this._pendingBuffer&&(e=n.Buffer.concat([this._pendingBuffer,e]),this._pendingBuffer=null),128&e[e.length-1]?this._pendingBuffer=e:(void 0===this._input?this._input=this._readStartingBom("string"==typeof e?e:e.toString()):this._input+=e,this._tokenizeToEnd(t,!1)))})),e.on("end",(()=>{"string"==typeof this._input&&this._tokenizeToEnd(t,!0)})),e.on("error",t)}}},33291:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(3524),i=r(28612),a=r(65852);let o=0;class s{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&u(this,e.factory);const t="string"==typeof e.format?e.format.match(/\w*$/)[0].toLowerCase():"",r=/turtle/.test(t),i=/trig/.test(t),a=/triple/.test(t),o=/quad/.test(t),s=this._n3Mode=/n3/.test(t),c=a||o;(this._supportsNamedGraphs=!(r||s))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(r||i||a||s),this._supportsRDFStar=""===t||/star|\*$/.test(t),c&&(this._resolveRelativeIRI=e=>null),this._blankNodePrefix="string"!=typeof e.blankNodePrefix?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new n.A({lineMode:c,n3:s}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){o=0}_setBase(e){if(e){const t=e.indexOf("#");t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}else this._base="",this._basePath=""}_saveContext(e,t,r,n,i){const a=this._n3Mode;this._contextStack.push({type:e,subject:r,predicate:n,object:i,graph:t,inverse:!!a&&this._inversePredicate,blankPrefix:a?this._prefixes._:"",quantified:a?this._quantified:null}),a&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,t){const r=this._contextStack.pop();if(!r||r.type!==e)return this._error(`Unexpected ${t.type}`,t);this._subject=r.subject,this._predicate=r.predicate,this._object=r.object,this._graph=r.graph,this._n3Mode&&(this._inversePredicate=r.inverse,this._prefixes._=r.blankPrefix,this._quantified=r.quantified)}_readInTopContext(e){switch(e.type){case"eof":return null!==this._graph?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,t){let r;switch(e.type){case"IRI":case"typeIRI":const t=this._resolveIRI(e.value);if(null===t)return this._error("Invalid IRI",e);r=this._namedNode(t);break;case"type":case"prefixed":const n=this._prefixes[e.prefix];if(void 0===n)return this._error(`Undefined prefix "${e.prefix}:"`,e);r=this._namedNode(n+e.value);break;case"blank":r=this._blankNode(this._prefixes[e.prefix]+e.value);break;case"var":r=this._variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!t&&this._n3Mode&&r.id in this._quantified&&(r=this._quantified[r.id]),r}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(0===e.prefix.length)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._literal(e.value,this._namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",e);default:if(void 0===(this._subject=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){const t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${t}`,e):(this._subject=null,"]"===t?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if(void 0===(this._predicate=this._readEntity(e)))return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(0===e.prefix.length)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._literal(e.value,this._namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",e);default:if(void 0===(this._object=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return"{"===e.type?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return"{"!==e.type?this._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return"]"===e.type?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}_readBlankNodeTail(e){if("]"!==e.type)return this._readBlankNodePunctuation(e);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const t=null===this._predicate;return this._restoreContext("blank",e),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let t=null,r=null,n=this._readListItem;const i=this._subject,a=this._contextStack,o=a[a.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,r=this._blankNode(),this.RDF_FIRST,this._subject=t=this._blankNode()),n=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,r=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),0!==a.length&&"list"===a[a.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(n=this._readPredicate,this._subject===this.RDF_NIL)return n}else if(n=this._getContextEndReader(),this._object===this.RDF_NIL)return n;r=this.RDF_NIL;break;case"literal":0===e.prefix.length?(this._literalValue=e.value,n=this._readListItemDataTypeOrLang):(t=this._literal(e.value,this._namedNode(e.prefix)),n=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if(void 0===(t=this._readEntity(e)))return}if(null===r&&(this._subject=r=this._blankNode()),null===i?null===o.predicate?o.subject=r:o.object=r:this._emit(i,this.RDF_REST,r,this._graph),null!==t){if(this._n3Mode&&("IRI"===e.type||"prefixed"===e.type))return this._saveContext("item",this._graph,r,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(r,this.RDF_FIRST,t,this._graph)}return n}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let t=this._literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const r=this._readEntity(e);if(void 0===r)return;t=this._literal(this._literalValue,r),e=null;break;case"langcode":t=this._literal(this._literalValue,e.value),e=null}return{token:e,literal:t}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){const r=this._completeLiteral(e);if(r)return this._object=r.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===r.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(r.token))}_readFormulaTail(e){return"}"!==e.type?this._readPunctuation(e):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let t,r=this._graph;const n=this._subject,i=this._inversePredicate;switch(e.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,i&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;case"{|":if(!this._supportsRDFStar)return this._error("Unexpected RDF-star syntax",e);const a=this._predicate,o=this._object;this._subject=this._quad(n,a,o,this.DEFAULTGRAPH),t=this._readPredicate;break;case"|}":if("Quad"!==this._subject.termType)return this._error("Unexpected asserted triple closing",e);this._subject=null,t=this._readPunctuation;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(r=this._readEntity(e))){t=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(null!==n){const e=this._predicate,t=this._object;i?this._emit(t,e,n,r):this._emit(n,e,t,r)}return t}_readBlankNodePunctuation(e){let t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}_readQuadPunctuation(e){return"."!==e.type?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return"prefix"!==e.type?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if("IRI"!==e.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){const t="IRI"===e.type&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return"]"!==e.type?this._error("Invalid graph label",e):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):"."!==e.type?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let t;switch(e.type){case"IRI":case"prefixed":if(void 0!==(t=this._readEntity(e,!0)))break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return","===e.type?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const t=this._contextStack,r=t.length&&t[t.length-1];if(r&&"item"===r.type){const t=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,t,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,r;const n=this._blankNode();if(void 0!==(r=this._readEntity(e)))return null===this._predicate?(t=this._subject,this._subject=n):(t=this._object,this._object=n),this._emit(t,r,n,this._graph),this._readPath}_readBackwardPath(e){const t=this._blankNode();let r,n;if(void 0!==(r=this._readEntity(e)))return null===this._predicate?(n=this._subject,this._subject=t):(n=this._object,this._object=t),this._emit(t,r,n,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return">>"!==e.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(e))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(">>"!==e.type)return this._error(`Expected >> but got ${e.type}`,e);const t=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),null===this._subject?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_getContextEndReader(){const e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,t,r,n){this._callback(null,this._quad(e,t,r,n||this.DEFAULTGRAPH))}_error(e,t){const r=new Error(`${e} on line ${t.line}.`);r.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(r),this._callback=c}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return("/"===e[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;const t=e.length;let r="",n=-1,i=-1,a=0,o="/";for(;n=i&&(r=r.substr(0,a)),"/"!==o)return`${r}/${e.substr(n+1)}`;a=n+1}}}o=e[++n]}return r+e.substring(a)}parse(e,t,r){let n,i,a;if(t&&(t.onQuad||t.onPrefix||t.onComment)?(n=t.onQuad,i=t.onPrefix,a=t.onComment):(n=t,i=r),this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${o++}_`,this._prefixCallback=i||c,this._inversePredicate=!1,this._quantified=Object.create(null),!n){const t=[];let r;if(this._callback=(e,n)=>{e?r=e:n&&t.push(n)},this._lexer.tokenize(e).every((e=>this._readCallback=this._readCallback(e))),r)throw r;return t}let s=(e,t)=>{null!==e?(this._callback(e),this._callback=c):this._readCallback&&(this._readCallback=this._readCallback(t))};a&&(this._lexer.comments=!0,s=(e,t)=>{null!==e?(this._callback(e),this._callback=c):this._readCallback&&("comment"===t.type?a(t.value):this._readCallback=this._readCallback(t))}),this._callback=n,this._lexer.tokenize(e,s)}}function c(){}function u(e,t){const r=t.namedNode;e._namedNode=r,e._blankNode=t.blankNode,e._literal=t.literal,e._variable=t.variable,e._quad=t.quad,e.DEFAULTGRAPH=t.defaultGraph(),e.RDF_FIRST=r(a.A.rdf.first),e.RDF_REST=r(a.A.rdf.rest),e.RDF_NIL=r(a.A.rdf.nil),e.N3_FORALL=r(a.A.r.forAll),e.N3_FORSOME=r(a.A.r.forSome),e.ABBREVIATIONS={a:r(a.A.rdf.type),"=":r(a.A.owl.sameAs),">":r(a.A.log.implies)},e.QUANTIFIERS_GRAPH=r("urn:n3:quantifiers")}u(s.prototype,i.Ay)},30611:(e,t,r)=>{"use strict";r.d(t,{A:()=>h,J:()=>p});var n=r(19198),i=r(28612),a=r(65852),o=r(69980),s=r(86987);const c=Symbol("iter");function u(e,t,r=4){if(0===r)return Object.assign(e,t);for(const n in t)e[n]=u(e[n]||Object.create(null),t[n],r-1);return e}function l(e,t,r=4){let n=!1;for(const i in e)if(i in t){const a=0===r?null:l(e[i],t[i],r-1);if(!1!==a)n=n||Object.create(null),n[i]=a;else if(3===r)return!1}return n}function d(e,t,r=4){let n=!1;for(const i in e)if(i in t){if(0!==r){const a=d(e[i],t[i],r-1);if(!1!==a)n=n||Object.create(null),n[i]=a;else if(3===r)return!1}}else n=n||Object.create(null),n[i]=0===r?null:u({},e[i],r-1);return n}class p{constructor(e={}){this._id=1,this._ids=Object.create(null),this._ids[""]=1,this._entities=Object.create(null),this._entities[1]="",this._blankNodeIndex=0,this._factory=e.factory||i.Ay}_termFromId(e){if("."===e[0]){const t=this._entities,r=e.split(".");return this._factory.quad(this._termFromId(t[r[1]]),this._termFromId(t[r[2]]),this._termFromId(t[r[3]]),r[4]&&this._termFromId(t[r[4]]))}return(0,i.iN)(e,this._factory)}_termToNumericId(e){if("Quad"===e.termType){const t=this._termToNumericId(e.subject),r=this._termToNumericId(e.predicate),n=this._termToNumericId(e.object);let i;return t&&r&&n&&((0,o.isDefaultGraph)(e.graph)||(i=this._termToNumericId(e.graph)))&&this._ids[i?`.${t}.${r}.${n}.${i}`:`.${t}.${r}.${n}`]}return this._ids[(0,i.FL)(e)]}_termToNewNumericId(e){const t=e&&"Quad"===e.termType?`.${this._termToNewNumericId(e.subject)}.${this._termToNewNumericId(e.predicate)}.${this._termToNewNumericId(e.object)}${(0,o.isDefaultGraph)(e.graph)?"":`.${this._termToNewNumericId(e.graph)}`}`:(0,i.FL)(e);return this._ids[t]||(this._ids[this._entities[++this._id]=t]=this._id)}createBlankNode(e){let t,r;if(e)for(t=e=`_:${e}`,r=1;this._ids[t];)t=e+r++;else do{t="_:b"+this._blankNodeIndex++}while(this._ids[t]);return this._ids[t]=++this._id,this._entities[this._id]=t,this._factory.blankNode(t.substr(2))}}class h{constructor(e,t){this._size=0,this._graphs=Object.create(null),t||!e||e[0]||(t=e,e=null),t=t||{},this._factory=t.factory||i.Ay,this._entityIndex=t.entityIndex||new p({factory:this._factory}),this._entities=this._entityIndex._entities,this._termFromId=this._entityIndex._termFromId.bind(this._entityIndex),this._termToNumericId=this._entityIndex._termToNumericId.bind(this._entityIndex),this._termToNewNumericId=this._entityIndex._termToNewNumericId.bind(this._entityIndex),e&&this.addQuads(e)}get size(){let e=this._size;if(null!==e)return e;e=0;const t=this._graphs;let r,n;for(const i in t)for(const a in r=t[i].subjects)for(const t in n=r[a])e+=Object.keys(n[t]).length;return this._size=e}_addToIndex(e,t,r,n){const i=e[t]||(e[t]={}),a=i[r]||(i[r]={}),o=n in a;return o||(a[n]=null),!o}_removeFromIndex(e,t,r,n){const i=e[t],a=i[r];delete a[n];for(const e in a)return;delete i[r];for(const e in i)return;delete e[t]}*_findInIndex(e,t,r,n,i,a,o,s){let c,u,l;const d=this._entities,p=this._termFromId(d[s]),h={subject:null,predicate:null,object:null};t&&((c=e,e={})[t]=c[t]);for(const t in e)if(u=e[t]){h[i]=this._termFromId(d[t]),r&&((c=u,u={})[r]=c[r]);for(const e in u)if(l=u[e]){h[a]=this._termFromId(d[e]);const t=n?n in l?[n]:[]:Object.keys(l);for(let e=0;e{r in t||(t[r]=!0,e(this._termFromId(this._entities[r],this._factory)))}}add(e){return this.addQuad(e),this}addQuad(e,t,r,n){t||(n=e.graph,r=e.object,t=e.predicate,e=e.subject),n=n?this._termToNewNumericId(n):1;let i=this._graphs[n];return i||(i=this._graphs[n]={subjects:{},predicates:{},objects:{}},Object.freeze(i)),e=this._termToNewNumericId(e),t=this._termToNewNumericId(t),r=this._termToNewNumericId(r),!!this._addToIndex(i.subjects,e,t,r)&&(this._addToIndex(i.predicates,t,r,e),this._addToIndex(i.objects,r,e,t),this._size=null,!0)}addQuads(e){for(let t=0;t{this.addQuad(e)})),e}removeQuad(e,t,r,n){t||({subject:e,predicate:t,object:r,graph:n}=e),n=n?this._termToNumericId(n):1;const i=this._graphs;let a,o,s;if(!((e=e&&this._termToNumericId(e))&&(t=t&&this._termToNumericId(t))&&(r=r&&this._termToNumericId(r))&&(a=i[n])&&(o=a.subjects[e])&&(s=o[t])&&r in s))return!1;for(e in this._removeFromIndex(a.subjects,e,t,r),this._removeFromIndex(a.predicates,t,r,e),this._removeFromIndex(a.objects,r,e,t),null!==this._size&&this._size--,a.subjects)return!0;return delete i[n],!0}removeQuads(e){for(let t=0;t{this.removeQuad(e)})),e}removeMatches(e,t,r,i){const a=new n.Readable({objectMode:!0}),o=this.readQuads(e,t,r,i);return a._read=e=>{for(;--e>=0;){const{done:e,value:t}=o.next();if(e)return void a.push(null);a.push(t)}},this.remove(a)}deleteGraph(e){return this.removeMatches(null,null,null,e)}getQuads(e,t,r,n){return[...this.readQuads(e,t,r,n)]}*readQuads(e,t,r,n){const i=this._getGraphs(n);let a,o,s,c;if(!(e&&!(o=this._termToNumericId(e))||t&&!(s=this._termToNumericId(t))||r&&!(c=this._termToNumericId(r))))for(const e in i)(a=i[e])&&(o?c?yield*this._findInIndex(a.objects,c,o,s,"object","subject","predicate",e):yield*this._findInIndex(a.subjects,o,s,null,"subject","predicate","object",e):s?yield*this._findInIndex(a.predicates,s,c,null,"predicate","object","subject",e):c?yield*this._findInIndex(a.objects,c,null,null,"object","subject","predicate",e):yield*this._findInIndex(a.subjects,null,null,null,"subject","predicate","object",e))}match(e,t,r,n){return new y(this,e,t,r,n,{entityIndex:this._entityIndex})}countQuads(e,t,r,n){const i=this._getGraphs(n);let a,o,s,c,u=0;if(e&&!(o=this._termToNumericId(e))||t&&!(s=this._termToNumericId(t))||r&&!(c=this._termToNumericId(r)))return 0;for(const n in i)(a=i[n])&&(u+=e?r?this._countInIndex(a.objects,c,o,s):this._countInIndex(a.subjects,o,s,c):t?this._countInIndex(a.predicates,s,c,o):this._countInIndex(a.objects,c,o,s));return u}forEach(e,t,r,n,i){this.some((t=>(e(t,this),!1)),t,r,n,i)}every(e,t,r,n,i){return!this.some((t=>!e(t,this)),t,r,n,i)}some(e,t,r,n,i){for(const a of this.readQuads(t,r,n,i))if(e(a))return!0;return!1}getSubjects(e,t,r){const n=[];return this.forSubjects((e=>{n.push(e)}),e,t,r),n}forSubjects(e,t,r,n){const i=this._getGraphs(n);let a,o,s;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||r&&!(s=this._termToNumericId(r))))for(n in i)(a=i[n])&&(o?s?this._loopBy2Keys(a.predicates,o,s,e):this._loopByKey1(a.subjects,o,e):s?this._loopByKey0(a.objects,s,e):this._loop(a.subjects,e))}getPredicates(e,t,r){const n=[];return this.forPredicates((e=>{n.push(e)}),e,t,r),n}forPredicates(e,t,r,n){const i=this._getGraphs(n);let a,o,s;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||r&&!(s=this._termToNumericId(r))))for(n in i)(a=i[n])&&(o?s?this._loopBy2Keys(a.objects,s,o,e):this._loopByKey0(a.subjects,o,e):s?this._loopByKey1(a.predicates,s,e):this._loop(a.predicates,e))}getObjects(e,t,r){const n=[];return this.forObjects((e=>{n.push(e)}),e,t,r),n}forObjects(e,t,r,n){const i=this._getGraphs(n);let a,o,s;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||r&&!(s=this._termToNumericId(r))))for(n in i)(a=i[n])&&(o?s?this._loopBy2Keys(a.subjects,o,s,e):this._loopByKey1(a.objects,o,e):s?this._loopByKey0(a.predicates,s,e):this._loop(a.objects,e))}getGraphs(e,t,r){const n=[];return this.forGraphs((e=>{n.push(e)}),e,t,r),n}forGraphs(e,t,r,n){for(const i in this._graphs)this.some((t=>(e(t.graph),!0)),t,r,n,this._termFromId(this._entities[i]))}createBlankNode(e){return this._entityIndex.createBlankNode(e)}extractLists({remove:e=!1,ignoreErrors:t=!1}={}){const r={},n=t?()=>!0:(e,t)=>{throw new Error(`${e.value} ${t}`)},i=this.getQuads(null,a.A.rdf.rest,a.A.rdf.nil,null),o=e?[...i]:[];return i.forEach((t=>{const i=[];let s,c,u=!1;const l=t.graph;let d=t.subject;for(;d&&!u;){const e=this.getQuads(null,null,d,null),t=this.getQuads(d,null,null,null);let r,p=null,h=null,f=null;for(let i=0;ithis.has(e)));const t=this._graphs,r=e._graphs;let n,i,a,o,s;for(const e in r){if(!(n=t[e]))return!1;n=n.subjects;for(const t in i=r[e].subjects){if(!(a=n[t]))return!1;for(const e in o=i[t]){if(!(s=a[e]))return!1;for(const t in o[e])if(!(t in s))return!1}}}return!0}deleteMatches(e,t,r,n){for(const i of this.match(e,t,r,n))this.removeQuad(i);return this}difference(e){if(e&&e instanceof y&&(e=e.filtered),e===this)return new h({entityIndex:this._entityIndex});if(e instanceof h&&e._entityIndex===this._entityIndex){const t=new h({entityIndex:this._entityIndex}),r=d(this._graphs,e._graphs);return r&&(t._graphs=r,t._size=null),t}return this.filter((t=>!e.has(t)))}equals(e){return e instanceof y&&(e=e.filtered),e===this||this.size===e.size&&this.contains(e)}filter(e){const t=new h({entityIndex:this._entityIndex});for(const r of this)e(r,this)&&t.add(r);return t}intersection(e){if(e instanceof y&&(e=e.filtered),e===this){const e=new h({entityIndex:this._entityIndex});return e._graphs=u(Object.create(null),this._graphs),e._size=this._size,e}if(e instanceof h&&this._entityIndex===e._entityIndex){const t=new h({entityIndex:this._entityIndex}),r=l(e._graphs,this._graphs);return r&&(t._graphs=r,t._size=null),t}return this.filter((t=>e.has(t)))}map(e){const t=new h({entityIndex:this._entityIndex});for(const r of this)t.add(e(r,this));return t}reduce(e,t){const r=this.readQuads();let n=void 0===t?r.next().value:t;for(const t of r)n=e(n,t,this);return n}toArray(){return this.getQuads()}toCanonical(){throw new Error("not implemented")}toStream(){return this.match()}toString(){return(new s.A).quadsToString(this)}union(e){const t=new h({entityIndex:this._entityIndex});return t._graphs=u(Object.create(null),this._graphs),t._size=this._size,t.addAll(e),t}*[Symbol.iterator](){yield*this.readQuads()}}function f(e,t,r=0){const n=t[r];if(n&&!(n in e))return!1;let i=!1;for(const a in n?{[n]:e[n]}:e){const n=2===r?null:f(e[a],t,r+1);!1!==n&&(i=i||Object.create(null),i[a]=n)}return i}class y extends n.Readable{constructor(e,t,r,n,i,a){super({objectMode:!0}),Object.assign(this,{n3Store:e,subject:t,predicate:r,object:n,graph:i,options:a})}get filtered(){if(!this._filtered){const{n3Store:e,graph:t,object:r,predicate:n,subject:i}=this,a=this._filtered=new h({factory:e._factory,entityIndex:this.options.entityIndex});let o,s,c;if(i&&!(o=a._termToNumericId(i))||n&&!(s=a._termToNumericId(n))||r&&!(c=a._termToNumericId(r)))return a;const u=e._getGraphs(t);for(const e in u){let t,r,n;!o&&s?(r=f(u[e].predicates,[s,c,o]))&&(t=f(u[e].subjects,[o,s,c]),n=f(u[e].objects,[c,o,s])):c?(n=f(u[e].objects,[c,o,s]))&&(t=f(u[e].subjects,[o,s,c]),r=f(u[e].predicates,[s,c,o])):(t=f(u[e].subjects,[o,s,c]))&&(r=f(u[e].predicates,[s,c,o]),n=f(u[e].objects,[c,o,s])),t&&(a._graphs[e]={subjects:t,predicates:r,objects:n})}a._size=null}return this._filtered}get size(){return this.filtered.size}_read(e){e>0&&!this[c]&&(this[c]=this[Symbol.iterator]());const t=this[c];for(;--e>=0;){const{done:e,value:r}=t.next();if(e)return void this.push(null);this.push(r)}}addAll(e){return this.filtered.addAll(e)}contains(e){return this.filtered.contains(e)}deleteMatches(e,t,r,n){return this.filtered.deleteMatches(e,t,r,n)}difference(e){return this.filtered.difference(e)}equals(e){return this.filtered.equals(e)}every(e,t,r,n,i){return this.filtered.every(e,t,r,n,i)}filter(e){return this.filtered.filter(e)}forEach(e,t,r,n,i){return this.filtered.forEach(e,t,r,n,i)}import(e){return this.filtered.import(e)}intersection(e){return this.filtered.intersection(e)}map(e){return this.filtered.map(e)}some(e,t,r,n,i){return this.filtered.some(e,t,r,n,i)}toCanonical(){return this.filtered.toCanonical()}toStream(){return this._filtered?this._filtered.toStream():this.n3Store.match(this.subject,this.predicate,this.object,this.graph)}union(e){return this._filtered?this._filtered.union(e):this.n3Store.match(this.subject,this.predicate,this.object,this.graph).addAll(e)}toArray(){return this._filtered?this._filtered.toArray():this.n3Store.getQuads(this.subject,this.predicate,this.object,this.graph)}reduce(e,t){return this.filtered.reduce(e,t)}toString(){return(new s.A).quadsToString(this)}add(e){return this.filtered.add(e)}delete(e){return this.filtered.delete(e)}has(e){return this.filtered.has(e)}match(e,t,r,n){return new y(this.filtered,e,t,r,n,this.options)}*[Symbol.iterator](){yield*this._filtered||this.n3Store.readQuads(this.subject,this.predicate,this.object,this.graph)}}},66731:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(19198),i=r(33291);class a extends n.Transform{constructor(e){super({decodeStrings:!0}),this._readableState.objectMode=!0;const t=new i.A(e);let r,n;const a={onQuad:(e,t)=>{e&&this.emit("error",e)||t&&this.push(t)},onPrefix:(e,t)=>{this.emit("prefix",e,t)}};e&&e.comments&&(a.onComment=e=>{this.emit("comment",e)}),t.parse({on:(e,t)=>{switch(e){case"data":r=t;break;case"end":n=t}}},a),this._transform=(e,t,n)=>{r(e),n()},this._flush=e=>{n(),e()}}import(e){return e.on("data",(e=>{this.write(e)})),e.on("end",(()=>{this.end()})),e.on("error",(e=>{this.emit("error",e)})),this}}},69980:(e,t,r)=>{"use strict";r.r(t),r.d(t,{inDefaultGraph:()=>u,isBlankNode:()=>a,isDefaultGraph:()=>c,isLiteral:()=>o,isNamedNode:()=>i,isVariable:()=>s,prefix:()=>l,prefixes:()=>d});var n=r(28612);function i(e){return!!e&&"NamedNode"===e.termType}function a(e){return!!e&&"BlankNode"===e.termType}function o(e){return!!e&&"Literal"===e.termType}function s(e){return!!e&&"Variable"===e.termType}function c(e){return!!e&&"DefaultGraph"===e.termType}function u(e){return c(e.graph)}function l(e,t){return d({"":e.value||e},t)("")}function d(e,t){const r=Object.create(null);for(const t in e)i(t,e[t]);function i(e,n){if("string"==typeof n){const i=Object.create(null);r[e]=e=>i[e]||(i[e]=t.namedNode(n+e))}else if(!(e in r))throw new Error(`Unknown prefix: ${e}`);return r[e]}return t=t||n.Ay,i}},86987:(e,t,r)=>{"use strict";r.d(t,{A:()=>h});var n=r(65852),i=r(28612),a=r(69980);const o=i.Ay.defaultGraph(),{rdf:s,xsd:c}=n.A,u=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,l=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,d={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class p extends i.x1{equals(e){return e===this}}class h{constructor(e,t){if(this._prefixRegex=/$0^/,e&&"function"!=typeof e.write&&(t=e,e=null),t=t||{},this._lists=t.lists,e)this._outputStream=e,this._endStream=void 0===t.end||!!t.end;else{let e="";this._outputStream={write(t,r,n){e+=t,n&&n()},end:t=>{t&&t(null,e)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(t.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=o,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes),t.baseIRI&&(this._baseMatcher=new RegExp(`^${y(t.baseIRI)}${t.baseIRI.endsWith("/")?"":"[#?]"}`),this._baseLength=t.baseIRI.length))}get _inDefaultGraph(){return o.equals(this._graph)}_write(e,t){this._outputStream.write(e,"utf8",t)}_writeQuad(e,t,r,n,i){try{n.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(o.equals(n)?"":`${this._encodeIriOrBlank(n)} {\n`)),this._graph=n,this._subject=null),e.equals(this._subject)?t.equals(this._predicate)?this._write(`, ${this._encodeObject(r)}`,i):this._write(`;\n ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(r)}`,i):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(r)}`,i)}catch(e){i&&i(e)}}_writeQuadLine(e,t,r,n,i){delete this._prefixMatch,this._write(this.quadToString(e,t,r,n),i)}quadToString(e,t,r,n){return`${this._encodeSubject(e)} ${this._encodeIriOrBlank(t)} ${this._encodeObject(r)}${n&&n.value?` ${this._encodeIriOrBlank(n)} .\n`:" .\n"}`}quadsToString(e){let t="";for(const r of e)t+=this.quadToString(r.subject,r.predicate,r.object,r.graph);return t}_encodeSubject(e){return"Quad"===e.termType?this._encodeQuad(e):this._encodeIriOrBlank(e)}_encodeIriOrBlank(e){if("NamedNode"!==e.termType)return this._lists&&e.value in this._lists&&(e=this.list(this._lists[e.value])),"id"in e?e.id:`_:${e.value}`;let t=e.value;this._baseMatcher&&this._baseMatcher.test(t)&&(t=t.substr(this._baseLength)),u.test(t)&&(t=t.replace(l,f));const r=this._prefixRegex.exec(t);return r?r[1]?this._prefixIRIs[r[1]]+r[2]:t:`<${t}>`}_encodeLiteral(e){let t=e.value;if(u.test(t)&&(t=t.replace(l,f)),e.language)return`"${t}"@${e.language}`;if(this._lineMode){if(e.datatype.value===c.string)return`"${t}"`}else switch(e.datatype.value){case c.string:return`"${t}"`;case c.boolean:if("true"===t||"false"===t)return t;break;case c.integer:if(/^[+-]?\d+$/.test(t))return t;break;case c.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case c.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t}return`"${t}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===s.type?"a":this._encodeIriOrBlank(e)}_encodeObject(e){switch(e.termType){case"Quad":return this._encodeQuad(e);case"Literal":return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}_encodeQuad({subject:e,predicate:t,object:r,graph:n}){return`<<${this._encodeSubject(e)} ${this._encodePredicate(t)} ${this._encodeObject(r)}${(0,a.isDefaultGraph)(n)?"":` ${this._encodeIriOrBlank(n)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,t,r,n,i){void 0===r?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):"function"==typeof n?this._writeQuad(e,t,r,o,n):this._writeQuad(e,t,r,n||o,i)}addQuads(e){for(let t=0;t.\n`)}if(r){let e="",t="";for(const r in this._prefixIRIs)e+=e?`|${r}`:r,t+=(t?"|":"")+this._prefixIRIs[r];e=y(e),this._prefixRegex=new RegExp(`^(?:${t})[^/]*$|^(${e})([_a-zA-Z0-9][\\-_a-zA-Z0-9]*)$`)}this._write(r?"\n":"",t)}blank(e,t){let r,n,i=e;switch(void 0===e?i=[]:e.termType?i=[{predicate:e,object:t}]:"length"in e||(i=[e]),n=i.length){case 0:return new p("[]");case 1:if(r=i[0],!(r.object instanceof p))return new p(`[ ${this._encodePredicate(r.predicate)} ${this._encodeObject(r.object)} ]`);default:let t="[";for(let a=0;a{t=null,e(r,n)});if(this._endStream)try{return this._outputStream.end(t)}catch(e){}t&&t()}}function f(e){let t=d[e];return void 0===t&&(1===e.length?(t=e.charCodeAt(0).toString(16),t="\\u0000".substr(0,6-t.length)+t):(t=(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)+9216).toString(16),t="\\U00000000".substr(0,10-t.length)+t)),t}function y(e){return e.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}},82773:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BlankNode:()=>c.PB,DataFactory:()=>c.Ay,DefaultGraph:()=>c.yV,EntityIndex:()=>o.J,Lexer:()=>n.A,Literal:()=>c.uS,NamedNode:()=>c.Yo,Parser:()=>i.A,Quad:()=>c.kO,Reasoner:()=>l,Store:()=>o.A,StoreFactory:()=>s,StreamParser:()=>h.A,StreamWriter:()=>y,Term:()=>c.x1,Triple:()=>c.n7,Util:()=>g,Variable:()=>c.rT,Writer:()=>a.A,default:()=>m,getRulesFromDataset:()=>u,termFromId:()=>c.iN,termToId:()=>c.FL});var n=r(3524),i=r(33291),a=r(86987),o=r(30611);class s{dataset(e){return new o.A(e)}}var c=r(28612);function u(e){const t=[];for(const{subject:r,object:n}of e.match(null,c.Ay.namedNode("http://www.w3.org/2000/10/swap/log#implies"),null,c.Ay.defaultGraph())){const i=[...e.match(null,null,null,r)],a=[...e.match(null,null,null,n)];t.push({premise:i,conclusion:a})}return t}class l{constructor(e){this._store=e}_add(e,t,r,n,i){this._store._addToIndex(n.subjects,e,t,r)&&(this._store._addToIndex(n.predicates,t,r,e),this._store._addToIndex(n.objects,r,e,t),i())}_evaluatePremise(e,t,r,n=0){let i,a,o,s,c;const[u,l,d]=e.premise[n].value,p=t[e.premise[n].content],h=!(o=u.value);for(o in h?p:{[o]:p[o]})if(s=p[o]){for(o in h&&(u.value=Number(o)),i=!(o=l.value),i?s:{[o]:s[o]})if(c=s[o]){for(o in i&&(l.value=Number(o)),a=!(o=d.value),a?c:{[o]:c[o]})a&&(d.value=Number(o)),n===e.premise.length-1?e.conclusion.forEach((e=>{this._add(e.subject.value,e.predicate.value,e.object.value,t,(()=>{r(e)}))})):this._evaluatePremise(e,t,r,n+1);a&&(d.value=null)}i&&(l.value=null)}h&&(u.value=null)}_evaluateRules(e,t,r){for(let n=0;n{r.push([e.subject.value,e.predicate.value,e.object.value,t])}))}const i=e=>{e.forEach((e=>{this._add(e.subject.value,e.predicate.value,e.object.value,t,(()=>{n(e)}))}))};let a;for(this._evaluateRules(e,t,n);void 0!==(a=r.pop());){const[e,r,o,s]=a,c=s.basePremise.subject.value;c||(s.basePremise.subject.value=e);const u=s.basePremise.predicate.value;u||(s.basePremise.predicate.value=r);const l=s.basePremise.object.value;l||(s.basePremise.object.value=o),0===s.premise.length?i(s.conclusion):this._evaluatePremise(s,t,n),c||(s.basePremise.subject.value=null),u||(s.basePremise.predicate.value=null),l||(s.basePremise.object.value=null)}}_createRule({premise:e,conclusion:t}){const r={},n=e=>"Variable"===e.termType?r[e.value]=r[e.value]||{}:{value:this._store._termToNewNumericId(e)},i=e=>({subject:n(e.subject),predicate:n(e.predicate),object:n(e.object)});return{premise:e.map((e=>i(e))),conclusion:t.map((e=>i(e))),variables:Object.values(r)}}reason(e){Array.isArray(e)||(e=u(e)),e=e.map((e=>this._createRule(e)));for(const t of e)for(const r of e)for(let e=0;e{e.value=null}))}}for(const t of e){const e=new Set;t.premise=t.premise.map((t=>d(t,e)))}const t=this._store._getGraphs();for(const r in t)this._reasonGraphNaive(e,t[r]);this._store._size=null}}function d({subject:e,predicate:t,object:r},n){const i=e.value||n.has(e)||(n.add(e),!1),a=t.value||n.has(t)||(n.add(t),!1),o=r.value||n.has(r)||(n.add(r),!1);return!i&&a?{content:"predicates",value:[t,r,e]}:o?{content:"objects",value:[r,e,t]}:{content:"subjects",value:[e,t,r]}}function p(e,t){return null===e.value&&(e.value=t.value),e.value===t.value}var h=r(66731),f=r(19198);class y extends f.Transform{constructor(e){super({encoding:"utf8",writableObjectMode:!0});const t=this._writer=new a.A({write:(e,t,r)=>{this.push(e),r&&r()},end:e=>{this.push(null),e&&e()}},e);this._transform=(e,r,n)=>{t.addQuad(e,n)},this._flush=e=>{t.end(e)}}import(e){return e.on("data",(e=>{this.write(e)})),e.on("end",(()=>{this.end()})),e.on("error",(e=>{this.emit("error",e)})),e.on("prefix",((e,t)=>{this._writer.addPrefix(e,t)})),this}}var g=r(69980);const m={Lexer:n.A,Parser:i.A,Writer:a.A,Store:o.A,StoreFactory:s,EntityIndex:o.J,StreamParser:h.A,StreamWriter:y,Util:g,Reasoner:l,DataFactory:c.Ay,Term:c.x1,NamedNode:c.Yo,Literal:c.uS,BlankNode:c.PB,Variable:c.rT,DefaultGraph:c.yV,Quad:c.kO,Triple:c.n7,termFromId:c.iN,termToId:c.FL}},65606:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,c=[],u=!1,l=-1;function d(){u&&s&&(u=!1,s.length?c=s.concat(c):l=-1,c.length&&p())}function p(){if(!u){var e=o(d);u=!0;for(var t=c.length;t;){for(s=c,c=[];++l1)for(var r=1;r{!function(){var t;t="object"==typeof window&&window?window:r.g,e.exports?e.exports=t.Promise?t.Promise:o:t.Promise||(t.Promise=o);var n=t.setImmediate||function(e){setTimeout(e,1)};function i(e,t){return function(){e.apply(t,arguments)}}var a=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],p(e,i(c,this),i(u,this))}function s(e){var t=this;null!==this._state?n((function(){var r=t._state?e.onFulfilled:e.onRejected;if(null!==r){var n;try{n=r(t._value)}catch(t){return void e.reject(t)}e.resolve(n)}else(t._state?e.resolve:e.reject)(t._value)})):this._deferreds.push(e)}function c(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if("function"==typeof t)return void p(i(t,e),i(c,this),i(u,this))}this._state=!0,this._value=e,l.call(this)}catch(e){u.call(this,e)}}function u(e){this._state=!1,this._value=e,l.call(this)}function l(){for(var e=0,t=this._deferreds.length;e{let n;e.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):e=>(n||(n=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)))},32985:e=>{"use strict";e.exports=class e{constructor(e,t=new Map,r=0){this.prefix=e,this._existing=t,this.counter=r}clone(){const{prefix:t,_existing:r,counter:n}=this;return new e(t,new Map(r),n)}getId(e){const t=e&&this._existing.get(e);if(t)return t;const r=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,r),r}hasId(e){return this._existing.has(e)}getOldIds(){return[...this._existing.keys()]}}},97920:(e,t,r)=>{"use strict";const{bufferToHex:n,crypto:i}=r(44991),a=new Map([["sha256","SHA-256"],["SHA256","SHA-256"],["SHA-256","SHA-256"],["sha384","SHA-384"],["SHA384","SHA-384"],["SHA-384","SHA-384"],["sha512","SHA-512"],["SHA512","SHA-512"],["SHA-512","SHA-512"]]);e.exports=class{constructor(e){if(!i||!i.subtle)throw new Error("crypto.subtle not found.");if(!a.has(e))throw new Error(`Unsupported algorithm "${e}".`);this.algorithm=a.get(e),this._content=""}update(e){this._content+=e}async digest(){const e=(new TextEncoder).encode(this._content),t=await i.subtle.digest(this.algorithm,e);return n(t)}}},11227:e=>{"use strict";const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",r="http://www.w3.org/2001/XMLSchema#string",n="NamedNode",i="BlankNode",a="Literal",o={};(()=>{const e="A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_",t=e+"0-9-·̀-ͯ‿-⁀",r="_:((?:["+e+"0-9])(?:(?:["+t+".])*(?:["+t+"]))?)",n='(?:<((?:[^\0- <>"{}|^`\\\\]|\\\\u[0-9A-Fa-f]{4}|\\\\U[0-9A-Fa-f]{8})*)>)',i="[ \\t]+",a="[ \\t]*",s="(?:"+n+"|"+r+")"+i,c=n+i,u="(?:"+n+"|"+r+'|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^'+n+")|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))"+a,l="(?:\\.|(?:(?:"+n+"|"+r+")"+a+"\\.))";o.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,o.empty=new RegExp("^"+a+"$"),o.quad=new RegExp("^"+a+s+c+u+l+a+"$")})(),e.exports=class e{static parse(e){const s=[],c={},l=e.split(o.eoln);let d=0;for(const e of l){if(d++,o.empty.test(e))continue;const l=e.match(o.quad);if(null===l)throw new Error("N-Quads parse error on line "+d+".");const g={subject:null,predicate:null,object:null,graph:null};if(void 0!==l[1]?g.subject={termType:n,value:f(l[1])}:g.subject={termType:i,value:l[2]},g.predicate={termType:n,value:f(l[3])},void 0!==l[4]?g.object={termType:n,value:f(l[4])}:void 0!==l[5]?g.object={termType:i,value:l[5]}:(g.object={termType:a,value:void 0,datatype:{termType:n}},void 0!==l[7]?g.object.datatype.value=f(l[7]):void 0!==l[8]?(g.object.datatype.value=t,g.object.language=l[8]):g.object.datatype.value=r,g.object.value=(y=l[6],u.test(y)?y.replace(u,(function(e,t,r,n){if(t)switch(t){case"b":return"\b";case"t":return"\t";case"n":return"\n";case"f":return"\f";case"r":return"\r";case'"':return'"';case"'":return"'";case"\\":return"\\"}return r?String.fromCharCode(parseInt(r,16)):n?String.fromCodePoint(parseInt(n,16)):void 0})):y)),void 0!==l[9]?g.graph={termType:n,value:f(l[9])}:void 0!==l[10]?g.graph={termType:i,value:l[10]}:g.graph={termType:"DefaultGraph",value:""},g.graph.value in c){let e=!0;const t=c[g.graph.value];for(const r of t)if(h=g,(p=r).subject.termType===h.subject.termType&&p.object.termType===h.object.termType&&p.subject.value===h.subject.value&&p.predicate.value===h.predicate.value&&p.object.value===h.object.value&&(p.object.termType!==a||p.object.datatype.termType===h.object.datatype.termType&&p.object.language===h.object.language&&p.object.datatype.value===h.object.datatype.value)){e=!1;break}e&&(t.push(g),s.push(g))}else c[g.graph.value]=[g],s.push(g)}var p,h,y;return s}static serialize(t){const r=[];for(const n of t)r.push(e.serializeQuad(n));return r.sort().join("")}static serializeQuadComponents(e,a,o,u){let l="";return e.termType===n?l+=`<${p(e.value)}>`:l+=`_:${e.value}`,a.termType===n?l+=` <${p(a.value)}> `:l+=` _:${a.value} `,o.termType===n?l+=`<${p(o.value)}>`:o.termType===i?l+=`_:${o.value}`:(l+=`"${function(e){return s.test(e)?e.replace(s,(function(e){return c[e.codePointAt(0)]})):e}(o.value)}"`,o.datatype.value===t?o.language&&(l+=`@${o.language}`):o.datatype.value!==r&&(l+=`^^<${p(o.datatype.value)}>`)),u.termType===n?l+=` <${p(u.value)}>`:u.termType===i&&(l+=` _:${u.value}`),l+=" .\n",l}static serializeQuad(t){return e.serializeQuadComponents(t.subject,t.predicate,t.object,t.graph)}};const s=/[\u0000-\u001F\u007F"\\]/g,c=[];for(let e=0;e<=127;++e)s.test(String.fromCharCode(e))&&(c[e]="\\u"+e.toString(16).toUpperCase().padStart(4,"0"),s.lastIndex=0);c["\b".codePointAt(0)]="\\b",c["\t".codePointAt(0)]="\\t",c["\n".codePointAt(0)]="\\n",c["\f".codePointAt(0)]="\\f",c["\r".codePointAt(0)]="\\r",c['"'.codePointAt(0)]='\\"',c["\\".codePointAt(0)]="\\\\";const u=/(?:\\([btnfr"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g;const l=/[\u0000-\u0020<>"{}|^`\\]/g,d=[];for(let e=0;e<=127;++e)l.test(String.fromCharCode(e))&&(d[e]="\\u"+e.toString(16).toUpperCase().padStart(4,"0"),l.lastIndex=0);function p(e){return l.test(e)?e.replace(l,(function(e){return d[e.codePointAt(0)]})):e}const h=/(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g;function f(e){return h.test(e)?e.replace(h,(function(e,t,r){return t?String.fromCharCode(parseInt(t,16)):r?String.fromCodePoint(parseInt(r,16)):void 0})):e}},29925:e=>{"use strict";e.exports=class{constructor(e){this.current=e.sort(),this.done=!1,this.dir=new Map;for(let t=0;tn)&&(s&&r>0&&o>e[r-1]||!s&&re[r+1])&&(n=o,i=r)}if(null===n)this.done=!0;else{const r=t.get(n)?i-1:i+1;e[i]=e[r],e[r]=n;for(const r of e)r>n&&t.set(r,!t.get(r))}return r}}},60202:(e,t,r)=>{"use strict";const n=r(32985),i=r(97920),a=r(29925),o=r(11227);function s(e,t){return e.hasht.hash?1:0}e.exports=class{constructor({createMessageDigest:e=null,messageDigestAlgorithm:t="sha256",canonicalIdMap:r=new Map,maxWorkFactor:a=1,maxDeepIterations:o=-1,timeout:s=0}={}){this.name="RDFC-1.0",this.blankNodeInfo=new Map,this.canonicalIssuer=new n("c14n",r),this.createMessageDigest=e||(()=>new i(t)),this.maxWorkFactor=a,this.maxDeepIterations=o,this.remainingDeepIterations=0,this.timeout=s,s>0&&(this.startTime=Date.now()),this.quads=null}main(e){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,r=[...this.blankNodeInfo.keys()];for(const e of r)this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const i=[...t.keys()].sort(),a=[];for(const e of i){const r=t.get(e);if(r.length>1){a.push(r);continue}const n=r[0];this.canonicalIssuer.getId(n)}if(this.maxDeepIterations<0)if(0===this.maxWorkFactor)this.maxDeepIterations=0;else if(this.maxWorkFactor===1/0)this.maxDeepIterations=1/0;else{const e=a.reduce(((e,t)=>e+t.length),0);this.maxDeepIterations=e**this.maxWorkFactor}this.maxDeepIterations>Number.MAX_SAFE_INTEGER&&(this.maxDeepIterations=1/0),this.remainingDeepIterations=this.maxDeepIterations;for(const e of a){const t=[];for(const r of e){if(this.canonicalIssuer.hasId(r))continue;const e=new n("b");e.getId(r);const i=this.hashNDegreeQuads(r,e);t.push(i)}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=o.serializeQuadComponents(this._componentWithCanonicalId(e.subject),e.predicate,this._componentWithCanonicalId(e.object),this._componentWithCanonicalId(e.graph));c.push(t)}return c.sort(),c.join("")}hashFirstDegreeQuads(e){const t=[],r=this.blankNodeInfo.get(e),n=r.quads;for(const r of n)t.push(o.serializeQuadComponents(this.modifyFirstDegreeComponent(e,r.subject,"subject"),r.predicate,this.modifyFirstDegreeComponent(e,r.object,"object"),this.modifyFirstDegreeComponent(e,r.graph,"graph")));t.sort();const i=this.createMessageDigest();for(const e of t)i.update(e);return r.hash=i.digest(),r.hash}hashRelatedBlankNode(e,t,r,n){const i=this.createMessageDigest();let a;return i.update(n),"g"!==n&&i.update(this.getRelatedPredicate(t)),a=this.canonicalIssuer.hasId(e)?"_:"+this.canonicalIssuer.getId(e):r.hasId(e)?"_:"+r.getId(e):this.blankNodeInfo.get(e).hash,i.update(a),i.digest()}hashNDegreeQuads(e,t){if(0===this.remainingDeepIterations)throw new Error(`Maximum deep iterations exceeded (${this.maxDeepIterations}).`);this.remainingDeepIterations--;const r=this.createMessageDigest(),n=this.createHashToRelated(e,t),i=[...n.keys()].sort();for(const e of i){r.update(e);let i,o="";const s=new a(n.get(e));let c=0;for(;s.hasNext();){const e=s.next();if(++c%3==0&&this.timeout>0&&Date.now()-this.startTime>this.timeout)throw new Error("Canonize timeout.");let r=t.clone(),n="";const a=[];let u=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?n+="_:"+this.canonicalIssuer.getId(t):(r.hasId(t)||a.push(t),n+="_:"+r.getId(t)),0!==o.length&&n>o){u=!0;break}if(!u){for(const e of a){const t=this.hashNDegreeQuads(e,r);if(n+="_:"+r.getId(e),n+=`<${t.hash}>`,r=t.issuer,0!==o.length&&n>o){u=!0;break}}u||(0===o.length||n`}createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;for(const i of n)this._addRelatedBlankNodeHash({quad:i,component:i.subject,position:"s",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:i,component:i.object,position:"o",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:i,component:i.graph,position:"g",id:e,issuer:t,hashToRelated:r});return r}_hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const r=this.hashFirstDegreeQuads(e),n=t.get(r);n?n.push(e):t.set(r,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const r=t.value,n=this.blankNodeInfo.get(r);n?n.quads.add(e):this.blankNodeInfo.set(r,{quads:new Set([e]),hash:null})}_addRelatedBlankNodeHash({quad:e,component:t,position:r,id:n,issuer:i,hashToRelated:a}){if("BlankNode"!==t.termType||t.value===n)return;const o=t.value,s=this.hashRelatedBlankNode(o,e,i,r),c=a.get(s);c?c.push(o):a.set(s,[o])}_componentWithCanonicalId(e){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}}},44991:(e,t,r)=>{"use strict";r(42791),t.setImmediate=setImmediate,t.crypto=globalThis.crypto;const n=[];for(let e=0;e<=255;++e)n.push(e.toString(16).padStart(2,"0"));t.bufferToHex=function(e){let t="";const r=new Uint8Array(e);for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BlankNode=void 0,t.BlankNode=class{constructor(e){this.termType="BlankNode",this.value=e}equals(e){return!!e&&"BlankNode"===e.termType&&e.value===this.value}}},88483:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DataFactory=void 0;const n=r(49931),i=r(92142),a=r(62426),o=r(43988),s=r(36754),c=r(88401);let u=0;t.DataFactory=class{constructor(e){this.blankNodeCounter=0,e=e||{},this.blankNodePrefix=e.blankNodePrefix||`df_${u++}_`}namedNode(e){return new o.NamedNode(e)}blankNode(e){return new n.BlankNode(e||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(e,t){return new a.Literal(e,t)}variable(e){return new c.Variable(e)}defaultGraph(){return i.DefaultGraph.INSTANCE}quad(e,t,r,n){return new s.Quad(e,t,r,n||this.defaultGraph())}fromTerm(e){switch(e.termType){case"NamedNode":return this.namedNode(e.value);case"BlankNode":return this.blankNode(e.value);case"Literal":return e.language?this.literal(e.value,e.language):e.datatype.equals(a.Literal.XSD_STRING)?this.literal(e.value):this.literal(e.value,this.fromTerm(e.datatype));case"Variable":return this.variable(e.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(e.subject),this.fromTerm(e.predicate),this.fromTerm(e.object),this.fromTerm(e.graph))}}fromQuad(e){return this.fromTerm(e)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},92142:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultGraph=void 0;class r{constructor(){this.termType="DefaultGraph",this.value=""}equals(e){return!!e&&"DefaultGraph"===e.termType}}t.DefaultGraph=r,r.INSTANCE=new r},62426:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Literal=void 0;const n=r(43988);class i{constructor(e,t){this.termType="Literal",this.value=e,"string"==typeof t?(this.language=t,this.datatype=i.RDF_LANGUAGE_STRING):t?(this.language="",this.datatype=t):(this.language="",this.datatype=i.XSD_STRING)}equals(e){return!!e&&"Literal"===e.termType&&e.value===this.value&&e.language===this.language&&this.datatype.equals(e.datatype)}}t.Literal=i,i.RDF_LANGUAGE_STRING=new n.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),i.XSD_STRING=new n.NamedNode("http://www.w3.org/2001/XMLSchema#string")},43988:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NamedNode=void 0,t.NamedNode=class{constructor(e){this.termType="NamedNode",this.value=e}equals(e){return!!e&&"NamedNode"===e.termType&&e.value===this.value}}},36754:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Quad=void 0,t.Quad=class{constructor(e,t,r,n){this.termType="Quad",this.value="",this.subject=e,this.predicate=t,this.object=r,this.graph=n}equals(e){return!!e&&("Quad"===e.termType||!e.termType)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.object.equals(e.object)&&this.graph.equals(e.graph)}}},88401:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Variable=void 0,t.Variable=class{constructor(e){this.termType="Variable",this.value=e}equals(e){return!!e&&"Variable"===e.termType&&e.value===this.value}}},62699:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(35694),t)},35694:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isTermGrounded=t.termToSignature=t.quadToSignature=t.sha1hex=t.hashTerm=t.hashTerms=t.getGraphBlankNodes=t.uniqGraph=t.deindexGraph=t.indexGraph=t.getQuadsWithoutBlankNodes=t.getQuadsWithBlankNodes=t.hasValue=t.hashValues=t.getBijectionInner=t.getBijection=t.isomorphic=void 0;const n=r(77952),i=r(43347),a=r(3285);function o(e,t){const r=h(p(e)),n=h(p(t));if(Object.keys(r).length!==Object.keys(n).length)return null;for(const e in r)if(r[e]!==n[e])return null;return s(y(d(e)),y(d(t)),g(e),g(t))}function s(e,t,r,n,a,o){a||(a={}),o||(o={});const[d,p]=m(e,r,a),[h,f]=m(t,n,o);if(Object.keys(d).length!==Object.keys(h).length)return null;for(const e in d)if(!l(h,d[e]))return null;let y={};for(const e of r){const t=i.termToString(e),r=p[t];for(const e in f)if(f[e]===r){y[t]=e,delete f[e];break}}if(!c(Object.keys(y).sort(),r.map(i.termToString).sort())||!c(u(y).sort(),n.map(i.termToString).sort())){y=null;for(const a of r){const o=i.termToString(a);if(!d[o])for(const a of n){const c=i.termToString(a);if(!h[c]&&p[o]===f[c]){const i=v(o);y=s(e,t,r,n,Object.assign(Object.assign({},d),{[o]:i}),Object.assign(Object.assign({},h),{[c]:i}))}}}}return y}function c(e,t){if(e.length!==t.length)return!1;for(let r=e.length;r--;)if(e[r]!==t[r])return!1;return!0}function u(e){const t=[];for(const r in e)t.push(e[r]);return t}function l(e,t){for(const r in e)if(e[r]===t)return!0;return!1}function d(e){return e.filter((e=>a.someTerms(e,(e=>"BlankNode"===e.termType||"Quad"===e.termType&&a.getTermsNested(e).some((e=>"BlankNode"===e.termType))))))}function p(e){return e.filter((e=>a.everyTerms(e,(e=>"BlankNode"!==e.termType&&!("Quad"===e.termType&&a.getTermsNested(e).some((e=>"BlankNode"===e.termType)))))))}function h(e){const t={};for(const r of e)t[JSON.stringify(i.quadToStringQuad(r))]=!0;return t}function f(e){return Object.keys(e).map((e=>i.stringQuadToQuad(JSON.parse(e))))}function y(e){return f(h(e))}function g(e){return a.uniqTerms(e.map((e=>a.getBlankNodes(a.getTermsNested(e)))).reduce(((e,t)=>e.concat(t)),[]))}function m(e,t,r){const n=Object.assign({},r),a={};let o=!0;for(;o;){const r=Object.keys(n).length;for(const r of t){const t=i.termToString(r);if(!n[t]){const[i,o]=b(r,e,n);i&&(n[t]=o),a[t]=o}}const s={};for(const e in a){const t=a[e];void 0===s[t]?s[t]=e:s[t]=!1}for(const e in s){const t=s[e];t&&(n[t]=e)}o=r!==Object.keys(n).length}return[n,a]}function b(e,t,r){const n=[];let i=!0;for(const o of t){const t=a.getTermsNested(o);if(t.some((t=>t.equals(e)))){n.push(_(o,r,e));for(const n of t)O(n,r)||n.equals(e)||(i=!1)}}return[i,v(n.sort().join(""))]}function v(e){return n.sha1().update(e).digest("hex")}function _(e,t,r){return a.getTerms(e).map((e=>w(e,t,r))).join("|")}function w(e,t,r){return e.equals(r)?"@self":"BlankNode"===e.termType?t[i.termToString(e)]||"@blank":"Quad"===e.termType?`<${_(e,t,r)}>`:i.termToString(e)}function O(e,t){return"BlankNode"!==e.termType&&!("Quad"===e.termType&&a.getTermsNested(e).some((e=>!O(e,t))))||!!t[i.termToString(e)]}t.isomorphic=function(e,t){return!!o(e,t)},t.getBijection=o,t.getBijectionInner=s,t.hashValues=u,t.hasValue=l,t.getQuadsWithBlankNodes=d,t.getQuadsWithoutBlankNodes=p,t.indexGraph=h,t.deindexGraph=f,t.uniqGraph=y,t.getGraphBlankNodes=g,t.hashTerms=m,t.hashTerm=b,t.sha1hex=v,t.quadToSignature=_,t.termToSignature=w,t.isTermGrounded=O},99349:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.getSupportedJavaScriptPrimitives=t.getSupportedRdfDatatypes=t.getTermRaw=t.toRdf=t.fromRdf=void 0;const a=r(47793),o=r(94802),s=r(30103);i(r(94802),t),i(r(5448),t),i(r(30103),t);const c=new a.DataFactory,u=new s.Translator;function l(e,t){return u.fromRdf(e,t)}u.registerHandler(new o.TypeHandlerString,o.TypeHandlerString.TYPES.map((e=>c.namedNode(e))),["string"]),u.registerHandler(new o.TypeHandlerBoolean,[o.TypeHandlerBoolean.TYPE].map((e=>c.namedNode(e))),["boolean"]),u.registerHandler(new o.TypeHandlerNumberDouble,o.TypeHandlerNumberDouble.TYPES.map((e=>c.namedNode(e))),["number"]),u.registerHandler(new o.TypeHandlerNumberInteger,o.TypeHandlerNumberInteger.TYPES.map((e=>c.namedNode(e))),["number"]),u.registerHandler(new o.TypeHandlerDate,o.TypeHandlerDate.TYPES.map((e=>c.namedNode(e))),["object"]),t.fromRdf=l,t.toRdf=function(e,t){return t&&"namedNode"in t&&(t={dataFactory:t}),(t=t||{})&&!t.dataFactory&&(t.dataFactory=c),u.toRdf(e,t)},t.getTermRaw=function(e,t){return"Literal"===e.termType?l(e,t):e.value},t.getSupportedRdfDatatypes=function(){return u.getSupportedRdfDatatypes()},t.getSupportedJavaScriptPrimitives=function(){return u.getSupportedJavaScriptPrimitives()}},5448:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},30103:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Translator=void 0,t.Translator=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(e){throw new Error(`Invalid RDF ${e.datatype.value} value: '${e.value}'`)}registerHandler(e,t,r){for(const r of t)this.supportedRdfDatatypes.push(r),this.fromRdfHandlers[r.value]=e;for(const t of r){let r=this.toRdfHandlers[t];r||(this.toRdfHandlers[t]=r=[]),r.push(e)}}fromRdf(e,t){const r=this.fromRdfHandlers[e.datatype.value];return r?r.fromRdf(e,t):e.value}toRdf(e,t){const r=this.toRdfHandlers[typeof e];if(r)for(const n of r){const r=n.toRdf(e,t);if(r)return r}throw new Error(`Invalid JavaScript value: '${e}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},92:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerBoolean=void 0;const n=r(30103);class i{fromRdf(e,t){switch(e.value){case"true":case"1":return!0;case"false":case"0":return!1}return t&&n.Translator.incorrectRdfDataType(e),!1}toRdf(e,{datatype:t,dataFactory:r}){return r.literal(e?"true":"false",t||r.namedNode(i.TYPE))}}i.TYPE="http://www.w3.org/2001/XMLSchema#boolean",t.TypeHandlerBoolean=i},37258:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerDate=void 0;const n=r(30103);class i{fromRdf(e,t){switch(t&&!e.value.match(i.VALIDATORS[e.datatype.value.substr(33,e.datatype.value.length)])&&n.Translator.incorrectRdfDataType(e),e.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(e.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":const t=e.value.split("-");return new Date(0,parseInt(t[0],10)-1,parseInt(t[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(e.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(e.value+"-01");default:return new Date(e.value)}}toRdf(e,{datatype:t,dataFactory:r}){if(t=t||r.namedNode(i.TYPES[0]),!(e instanceof Date))return null;const n=e;let a;switch(t.value){case"http://www.w3.org/2001/XMLSchema#gDay":a=String(n.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":a=n.getUTCMonth()+1+"-"+n.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":a=String(n.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":a=n.getUTCFullYear()+"-"+(n.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":a=n.toISOString().replace(/T.*$/,"");break;default:a=n.toISOString()}return r.literal(a,t)}}i.TYPES=["http://www.w3.org/2001/XMLSchema#dateTime","http://www.w3.org/2001/XMLSchema#date","http://www.w3.org/2001/XMLSchema#gDay","http://www.w3.org/2001/XMLSchema#gMonthDay","http://www.w3.org/2001/XMLSchema#gYear","http://www.w3.org/2001/XMLSchema#gYearMonth"],i.VALIDATORS={date:/^[0-9]+-[0-9][0-9]-[0-9][0-9]Z?$/,dateTime:/^[0-9]+-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9](\.[0-9][0-9][0-9])?((Z?)|([\+-][0-9][0-9]:[0-9][0-9]))$/,gDay:/^[0-9]+$/,gMonthDay:/^[0-9]+-[0-9][0-9]$/,gYear:/^[0-9]+$/,gYearMonth:/^[0-9]+-[0-9][0-9]$/},t.TypeHandlerDate=i},82406:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerNumberDouble=void 0;const n=r(30103);class i{fromRdf(e,t){const r=parseFloat(e.value);return t&&isNaN(r)&&n.Translator.incorrectRdfDataType(e),r}toRdf(e,{datatype:t,dataFactory:r}){return t=t||r.namedNode(i.TYPES[0]),isNaN(e)?r.literal("NaN",t):isFinite(e)?e%1==0?null:r.literal(e.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),t):r.literal(e>0?"INF":"-INF",t)}}i.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"],t.TypeHandlerNumberDouble=i},96925:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerNumberInteger=void 0;const n=r(30103);class i{fromRdf(e,t){const r=parseInt(e.value,10);return t&&(isNaN(r)||e.value.indexOf(".")>=0)&&n.Translator.incorrectRdfDataType(e),r}toRdf(e,{datatype:t,dataFactory:r}){return r.literal(String(e),t||(e<=i.MAX_INT&&e>=i.MIN_INT?r.namedNode(i.TYPES[0]):r.namedNode(i.TYPES[1])))}}i.TYPES=["http://www.w3.org/2001/XMLSchema#integer","http://www.w3.org/2001/XMLSchema#long","http://www.w3.org/2001/XMLSchema#int","http://www.w3.org/2001/XMLSchema#byte","http://www.w3.org/2001/XMLSchema#short","http://www.w3.org/2001/XMLSchema#negativeInteger","http://www.w3.org/2001/XMLSchema#nonNegativeInteger","http://www.w3.org/2001/XMLSchema#nonPositiveInteger","http://www.w3.org/2001/XMLSchema#positiveInteger","http://www.w3.org/2001/XMLSchema#unsignedByte","http://www.w3.org/2001/XMLSchema#unsignedInt","http://www.w3.org/2001/XMLSchema#unsignedLong","http://www.w3.org/2001/XMLSchema#unsignedShort"],i.MAX_INT=2147483647,i.MIN_INT=-2147483648,t.TypeHandlerNumberInteger=i},14191:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerString=void 0;class r{fromRdf(e){return e.value}toRdf(e,{datatype:t,dataFactory:r}){return r.literal(e,t)}}r.TYPES=["http://www.w3.org/2001/XMLSchema#string","http://www.w3.org/2001/XMLSchema#normalizedString","http://www.w3.org/2001/XMLSchema#anyURI","http://www.w3.org/2001/XMLSchema#base64Binary","http://www.w3.org/2001/XMLSchema#language","http://www.w3.org/2001/XMLSchema#Name","http://www.w3.org/2001/XMLSchema#NCName","http://www.w3.org/2001/XMLSchema#NMTOKEN","http://www.w3.org/2001/XMLSchema#token","http://www.w3.org/2001/XMLSchema#hexBinary","http://www.w3.org/1999/02/22-rdf-syntax-ns#langString","http://www.w3.org/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"],t.TypeHandlerString=r},94802:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(92),t),i(r(37258),t),i(r(82406),t),i(r(96925),t),i(r(14191),t)},18962:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(23598),t),i(r(83893),t)},23598:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PendingStreamsIndex=void 0;const n=r(43347),i=r(3285);class a{constructor(){this.indexedStreams=new Map,this.allStreams=[]}termToString(e){return e&&"Variable"!==e.termType?(0,n.termToString)(e):a.ID_VARIABLE}addPatternListener(e,t,r,n,i){this.allStreams.push(e);const o=`${this.termToString(t)}${a.ID_SEPARATOR}${this.termToString(r)}${a.ID_SEPARATOR}${this.termToString(n)}${a.ID_SEPARATOR}${this.termToString(i)}`;let s=this.indexedStreams.get(o);s||(s=[],this.indexedStreams.set(o,s)),s.push(e)}getPendingStreamsForQuad(e){let t=[(0,i.getTerms)(e).map((e=>(0,n.termToString)(e)))];for(let e=0;e1||c(e,t)}))})}function c(e,t){try{(r=a[e](t)).value instanceof i?Promise.resolve(r.value.v).then(u,l):d(o[0][2],r)}catch(e){d(o[0][3],e)}var r}function u(e){c("next",e)}function l(e){c("throw",e)}function d(e,t){e(t),o.shift(),o.length&&c(o[0][0],o[0][1])}};Object.defineProperty(t,"__esModule",{value:!0}),t.StreamingStore=void 0;const o=r(82773),s=r(19198),c=r(23598);class u{constructor(e=new o.Store){this.pendingStreams=new c.PendingStreamsIndex,this.ended=!1,this.store=e}end(){this.ended=!0;for(const e of this.pendingStreams.allStreams)e.push(null)}importToListeners(e){e.on("data",(e=>{if(!this.ended&&!this.store.countQuads(e.subject,e.predicate,e.object,e.graph))for(const t of this.pendingStreams.getPendingStreamsForQuad(e))t.isInitialized&&(t.push(e),t.emit("quad",e))}))}static concatStreams(e){return a(this,arguments,(function*(){var t,r,a,o;for(const l of e)try{for(var s,c=!0,u=(r=void 0,n(l));!(t=(s=yield i(u.next())).done);){o=s.value,c=!1;try{const e=o;yield yield i(e)}finally{c=!0}}}catch(e){r={error:e}}finally{try{c||t||!(a=u.return)||(yield i(a.call(u)))}finally{if(r)throw r.error}}}))}import(e){if(this.ended)throw new Error("Attempted to import into an ended StreamingStore");return this.importToListeners(e),this.store.import(e)}match(e,t,r,n){const i=this.store.match(e,t,r,n);let a=i;if(!this.ended){const o=new s.PassThrough({objectMode:!0});this.pendingStreams.addPatternListener(o,e,t,r,n),a=s.Readable.from(u.concatStreams([i,o])),a._pipeSource=i;const c=i._read;i._read=e=>{o.isInitialized=!0,c.call(i,e)}}return a}getStore(){return this.store}}t.StreamingStore=u},46898:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.termToString=t.stringToTerm=t.stringQuadToQuad=t.quadToStringQuad=t.getLiteralValue=t.getLiteralType=t.getLiteralLanguage=void 0;const n=r(19858);Object.defineProperty(t,"getLiteralLanguage",{enumerable:!0,get:function(){return n.getLiteralLanguage}}),Object.defineProperty(t,"getLiteralType",{enumerable:!0,get:function(){return n.getLiteralType}}),Object.defineProperty(t,"getLiteralValue",{enumerable:!0,get:function(){return n.getLiteralValue}}),Object.defineProperty(t,"quadToStringQuad",{enumerable:!0,get:function(){return n.quadToStringQuad}}),Object.defineProperty(t,"stringQuadToQuad",{enumerable:!0,get:function(){return n.stringQuadToQuad}}),Object.defineProperty(t,"stringToTerm",{enumerable:!0,get:function(){return n.stringToTerm}}),Object.defineProperty(t,"termToString",{enumerable:!0,get:function(){return n.termToString}})},19858:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringQuadToQuad=t.quadToStringQuad=t.stringToTerm=t.getLiteralLanguage=t.getLiteralType=t.getLiteralValue=t.termToString=void 0;const n=new(r(47793).DataFactory);function i(e){var t,r;if(e)switch(e.termType){case"NamedNode":return`<${t=e.value,t.replace(u,d)}>`;case"BlankNode":return`_:${e.value}`;case"Literal":{const t=e;return`"${r=t.value,u.test(r)&&(r=r.replace(u,d)),r}"${t.datatype&&"http://www.w3.org/2001/XMLSchema#string"!==t.datatype.value&&"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"!==t.datatype.value?`^^<${t.datatype.value}>`:""}${t.language?`@${t.language}`:""}`}case"Quad":return`<<${i(e.subject)} ${i(e.predicate)} ${i(e.object)}${"DefaultGraph"===e.graph.termType?"":` ${i(e.graph)}`}>>`;case"Variable":return`?${e.value}`;case"DefaultGraph":return e.value}}function a(e){const t=/^"([^]*)"((\^\^.*)|(@.*))?$/u.exec(e);if(!t)throw new Error(`${e} is not a literal`);return t[1].replace(/\\"/gu,'"')}function o(e){const t=/^"[^]*"(?:\^\^<([^"]+)>|(@)[^@"]+)?$/u.exec(e);if(!t)throw new Error(`${e} is not a literal`);return t[1]||(t[2]?"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString":"http://www.w3.org/2001/XMLSchema#string")}function s(e){const t=/^"[^]*"(?:@([^@"]+)|\^\^[^"]+)?$/u.exec(e);if(!t)throw new Error(`${e} is not a literal`);return t[1]?t[1].toLowerCase():""}function c(e,t){if(t=t||n,!e||0===e.length)return t.defaultGraph();switch(e[0]){case"_":return t.blankNode(e.slice(2));case"?":if(!t.variable)throw new Error("Missing 'variable()' method on the given DataFactory");return t.variable(e.slice(1));case'"':{const r=s(e),n=t.namedNode(o(e));return t.literal(a(e),r||n)}default:if(e.startsWith("<<")&&e.endsWith(">>")){const r=e.slice(2,-2),n=[];let i=0,a=0;for(let t=0;t"===o){if(0===i)throw new Error(`Found closing tag without opening tag in ${e}`);i--}" "===o&&0===i&&(n.push(r.slice(a,t)),a=t+1)}if(0!==i)throw new Error(`Found opening tag without closing tag in ${e}`);if(n.push(r.slice(a,r.length)),3!==n.length&&4!==n.length)throw new Error(`Nested quad syntax error ${e}`);return t.quad(c(n[0]),c(n[1]),c(n[2]),n[3]?c(n[3]):void 0)}if(!e.startsWith("<")||!e.endsWith(">"))throw new Error(`Detected invalid iri for named node (must be wrapped in <>): ${e}`);return t.namedNode(e.slice(1,-1))}}t.termToString=i,t.getLiteralValue=a,t.getLiteralType=o,t.getLiteralLanguage=s,t.stringToTerm=c,t.quadToStringQuad=function(e){return{subject:i(e.subject),predicate:i(e.predicate),object:i(e.object),graph:i(e.graph)}},t.stringQuadToQuad=function(e,t){return(t=t||n).quad(c(e.subject,t),c(e.predicate,t),c(e.object,t),c(e.graph,t))};const u=/["\\\t\n\r\b\f\u0000-\u0019]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,l=new Map([["\\","\\\\"],['"','\\"'],["\t","\\t"],["\n","\\n"],["\r","\\r"],["\b","\\b"],["\f","\\f"]]);function d(e){const t=l.get(e);if(!t){if(1===e.length){const t=e.charCodeAt(0).toString(16);return`${"\\u0000".slice(0,-t.length)}${t}`}const t=(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)+9216).toString(16);return`${"\\U00000000".slice(0,-t.length)}${t}`}return t}},43347:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.termToString=t.stringToTerm=t.stringQuadToQuad=t.quadToStringQuad=t.getLiteralValue=t.getLiteralType=t.getLiteralLanguage=void 0;const n=r(23585);Object.defineProperty(t,"getLiteralLanguage",{enumerable:!0,get:function(){return n.getLiteralLanguage}}),Object.defineProperty(t,"getLiteralType",{enumerable:!0,get:function(){return n.getLiteralType}}),Object.defineProperty(t,"getLiteralValue",{enumerable:!0,get:function(){return n.getLiteralValue}}),Object.defineProperty(t,"quadToStringQuad",{enumerable:!0,get:function(){return n.quadToStringQuad}}),Object.defineProperty(t,"stringQuadToQuad",{enumerable:!0,get:function(){return n.stringQuadToQuad}}),Object.defineProperty(t,"stringToTerm",{enumerable:!0,get:function(){return n.stringToTerm}}),Object.defineProperty(t,"termToString",{enumerable:!0,get:function(){return n.termToString}})},23585:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringQuadToQuad=t.quadToStringQuad=t.stringToTerm=t.getLiteralLanguage=t.getLiteralType=t.getLiteralValue=t.termToString=void 0;const n=new(r(47793).DataFactory);function i(e){if(e)switch(e.termType){case"NamedNode":case"DefaultGraph":return e.value;case"BlankNode":return"_:"+e.value;case"Literal":const t=e;return'"'+t.value+'"'+(t.datatype&&"http://www.w3.org/2001/XMLSchema#string"!==t.datatype.value&&"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"!==t.datatype.value?"^^"+t.datatype.value:"")+(t.language?"@"+t.language:"");case"Quad":return`<<${i(e.subject)} ${i(e.predicate)} ${i(e.object)}${"DefaultGraph"===e.graph.termType?"":" "+i(e.graph)}>>`;case"Variable":return"?"+e.value}}function a(e){const t=/^"([^]*)"/.exec(e);if(!t)throw new Error(e+" is not a literal");return t[1]}function o(e){const t=/^"[^]*"(?:\^\^([^"]+)|(@)[^@"]+)?$/.exec(e);if(!t)throw new Error(e+" is not a literal");return t[1]||(t[2]?"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString":"http://www.w3.org/2001/XMLSchema#string")}function s(e){const t=/^"[^]*"(?:@([^@"]+)|\^\^[^"]+)?$/.exec(e);if(!t)throw new Error(e+" is not a literal");return t[1]?t[1].toLowerCase():""}function c(e,t){if(t=t||n,!e||!e.length)return t.defaultGraph();switch(e[0]){case"_":return t.blankNode(e.substr(2));case"?":if(!t.variable)throw new Error("Missing 'variable()' method on the given DataFactory");return t.variable(e.substr(1));case'"':const r=s(e),n=t.namedNode(o(e));return t.literal(a(e),r||n);default:if("<"===e[0]&&e.length>4&&"<"===e[1]&&">"===e[e.length-1]&&">"===e[e.length-2]){const r=e.slice(2,-2).trim();let n=[],i=0,a=0,o=!1;for(let t=0;t"===s){if(0===i)throw new Error("Found closing tag without opening tag in "+e);i--}if('"'===s){let e=!1,n=t;for(;n-- >0&&"\\"===r[n];)e=!e;e||(o=!o)}if(" "===s&&!o&&0===i){for(n.push(r.slice(a,t));" "===r[t+1];)t+=1;a=t+1}}if(0!==i)throw new Error("Found opening tag without closing tag in "+e);if(n.push(r.slice(a,r.length)),3!==n.length&&4!==n.length)throw new Error("Nested quad syntax error "+e);return n=n.map((e=>e.startsWith("<")&&!e.includes(" ")?e.slice(1,-1):e)),t.quad(c(n[0]),c(n[1]),c(n[2]),n[3]?c(n[3]):void 0)}return t.namedNode(e)}}t.termToString=i,t.getLiteralValue=a,t.getLiteralType=o,t.getLiteralLanguage=s,t.stringToTerm=c,t.quadToStringQuad=function(e){return{subject:i(e.subject),predicate:i(e.predicate),object:i(e.object),graph:i(e.graph)}},t.stringQuadToQuad=function(e,t){return(t=t||n).quad(c(e.subject,t),c(e.predicate,t),c(e.object,t),c(e.graph,t))}},3285:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(64232),t),i(r(70071),t)},64232:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matchPatternMappings=t.matchPatternComplete=t.matchPattern=t.matchTerm=t.getValueNestedPath=t.someTermsNested=t.someTerms=t.everyTermsNested=t.everyTerms=t.reduceTermsNested=t.reduceTerms=t.mapTermsNested=t.mapTerms=t.filterQuadTermNamesNested=t.filterQuadTermNames=t.filterTermsNested=t.filterTerms=t.forEachTermsNested=t.forEachTerms=t.collectNamedTerms=t.getNamedTerms=t.getTermsNested=t.getTerms=t.TRIPLE_TERM_NAMES=t.QUAD_TERM_NAMES=void 0;const n=new(r(47793).DataFactory);function i(e,t){return t&&"DefaultGraph"===e.graph.termType?[e.subject,e.predicate,e.object]:[e.subject,e.predicate,e.object,e.graph]}function a(e,t){return t(e.subject,"subject")&&t(e.predicate,"predicate")&&t(e.object,"object")&&t(e.graph,"graph")}function o(e,t){return!t||"Variable"===t.termType||"Quad"===t.termType&&"Quad"===e.termType&&c(e,t)||t.equals(e)}function s(e,t,r,n,i){return o(e.subject,t)&&o(e.predicate,r)&&o(e.object,n)&&o(e.graph,i)}function c(e,t){return s(e,t.subject,t.predicate,t.object,t.graph)}t.QUAD_TERM_NAMES=["subject","predicate","object","graph"],t.TRIPLE_TERM_NAMES=["subject","predicate","object"],t.getTerms=i,t.getTermsNested=function e(t,r){const n=[];for(const a of i(t,r))"Quad"===a.termType?e(a,r).forEach((e=>n.push(e))):n.push(a);return n},t.getNamedTerms=function(e){return[{key:"subject",value:e.subject},{key:"predicate",value:e.predicate},{key:"object",value:e.object},{key:"graph",value:e.graph}]},t.collectNamedTerms=function(e,t,r){const i={};return e.forEach((e=>i[e.key]=e.value)),t&&(i.subject=i.subject||t("subject"),i.predicate=i.predicate||t("predicate"),i.object=i.object||t("object"),i.graph=i.graph||t("graph")),(r||n).quad(i.subject,i.predicate,i.object,i.graph)},t.forEachTerms=function(e,t){t(e.subject,"subject"),t(e.predicate,"predicate"),t(e.object,"object"),t(e.graph,"graph")},t.forEachTermsNested=function e(t,r,n=[]){"Quad"===t.subject.termType?e(t.subject,r,[...n,"subject"]):r(t.subject,[...n,"subject"]),"Quad"===t.predicate.termType?e(t.predicate,r,[...n,"predicate"]):r(t.predicate,[...n,"predicate"]),"Quad"===t.object.termType?e(t.object,r,[...n,"object"]):r(t.object,[...n,"object"]),"Quad"===t.graph.termType?e(t.graph,r,[...n,"graph"]):r(t.graph,[...n,"graph"])},t.filterTerms=function(e,t){const r=[];return t(e.subject,"subject")&&r.push(e.subject),t(e.predicate,"predicate")&&r.push(e.predicate),t(e.object,"object")&&r.push(e.object),t(e.graph,"graph")&&r.push(e.graph),r},t.filterTermsNested=function e(t,r,n=[]){let i=[];return"Quad"===t.subject.termType?i=[...i,...e(t.subject,r,[...n,"subject"])]:r(t.subject,[...n,"subject"])&&i.push(t.subject),"Quad"===t.predicate.termType?i=[...i,...e(t.predicate,r,[...n,"predicate"])]:r(t.predicate,[...n,"predicate"])&&i.push(t.predicate),"Quad"===t.object.termType?i=[...i,...e(t.object,r,[...n,"object"])]:r(t.object,[...n,"object"])&&i.push(t.object),"Quad"===t.graph.termType?i=[...i,...e(t.graph,r,[...n,"graph"])]:r(t.graph,[...n,"graph"])&&i.push(t.graph),i},t.filterQuadTermNames=function(e,t){const r=[];return t(e.subject,"subject")&&r.push("subject"),t(e.predicate,"predicate")&&r.push("predicate"),t(e.object,"object")&&r.push("object"),t(e.graph,"graph")&&r.push("graph"),r},t.filterQuadTermNamesNested=function e(t,r,n=[]){let i=[];const a=[...n,"subject"];"Quad"===t.subject.termType?i=[...i,...e(t.subject,r,a)]:r(t.subject,a)&&i.push(a);const o=[...n,"predicate"];"Quad"===t.predicate.termType?i=[...i,...e(t.predicate,r,o)]:r(t.predicate,o)&&i.push(o);const s=[...n,"object"];"Quad"===t.object.termType?i=[...i,...e(t.object,r,s)]:r(t.object,s)&&i.push(s);const c=[...n,"graph"];return"Quad"===t.graph.termType?i=[...i,...e(t.graph,r,c)]:r(t.graph,c)&&i.push(c),i},t.mapTerms=function(e,t,r){return(r||n).quad(t(e.subject,"subject"),t(e.predicate,"predicate"),t(e.object,"object"),t(e.graph,"graph"))},t.mapTermsNested=function e(t,r,i,a=[]){return(i||n).quad("Quad"===t.subject.termType?e(t.subject,r,i,[...a,"subject"]):r(t.subject,[...a,"subject"]),"Quad"===t.predicate.termType?e(t.predicate,r,i,[...a,"predicate"]):r(t.predicate,[...a,"predicate"]),"Quad"===t.object.termType?e(t.object,r,i,[...a,"object"]):r(t.object,[...a,"object"]),"Quad"===t.graph.termType?e(t.graph,r,i,[...a,"graph"]):r(t.graph,[...a,"graph"]))},t.reduceTerms=function(e,t,r){let n=r;return n=t(n,e.subject,"subject"),n=t(n,e.predicate,"predicate"),n=t(n,e.object,"object"),t(n,e.graph,"graph")},t.reduceTermsNested=function e(t,r,n,i=[]){let a=n;return a="Quad"===t.subject.termType?e(t.subject,r,a,[...i,"subject"]):r(a,t.subject,[...i,"subject"]),a="Quad"===t.predicate.termType?e(t.predicate,r,a,[...i,"predicate"]):r(a,t.predicate,[...i,"predicate"]),a="Quad"===t.object.termType?e(t.object,r,a,[...i,"object"]):r(a,t.object,[...i,"object"]),a="Quad"===t.graph.termType?e(t.graph,r,a,[...i,"graph"]):r(a,t.graph,[...i,"graph"]),a},t.everyTerms=a,t.everyTermsNested=function e(t,r,n=[]){return("Quad"===t.subject.termType?e(t.subject,r,[...n,"subject"]):r(t.subject,[...n,"subject"]))&&("Quad"===t.predicate.termType?e(t.predicate,r,[...n,"predicate"]):r(t.predicate,[...n,"predicate"]))&&("Quad"===t.object.termType?e(t.object,r,[...n,"object"]):r(t.object,[...n,"object"]))&&("Quad"===t.graph.termType?e(t.graph,r,[...n,"graph"]):r(t.graph,[...n,"graph"]))},t.someTerms=function(e,t){return t(e.subject,"subject")||t(e.predicate,"predicate")||t(e.object,"object")||t(e.graph,"graph")},t.someTermsNested=function e(t,r,n=[]){return("Quad"===t.subject.termType?e(t.subject,r,[...n,"subject"]):r(t.subject,[...n,"subject"]))||("Quad"===t.predicate.termType?e(t.predicate,r,[...n,"predicate"]):r(t.predicate,[...n,"predicate"]))||("Quad"===t.object.termType?e(t.object,r,[...n,"object"]):r(t.object,[...n,"object"]))||("Quad"===t.graph.termType?e(t.graph,r,[...n,"graph"]):r(t.graph,[...n,"graph"]))},t.getValueNestedPath=function e(t,r){if(0===r.length)return t;if("Quad"===t.termType)return e(t[r[0]],r.slice(1));throw new Error(`Tried to get ${r[0]} from term of type ${t.termType}`)},t.matchTerm=o,t.matchPattern=s,t.matchPatternComplete=c,t.matchPatternMappings=function(e,t,r={}){const n={};return function e(t,i){return a(t,((t,a)=>{var o,s;const c=i[a];switch(t.termType){case"Variable":return r.skipVarMapping&&"Variable"===c.termType||(null!==(s=null===(o=n[t.value])||void 0===o?void 0:o.equals(c))&&void 0!==s?s:(n[t.value]=c,!0));case"Quad":return"Quad"===c.termType&&e(t,c);default:return t.equals(c)}}))}(t,e)&&(!r.returnMappings||n)}},70071:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getQuads=t.getDefaultGraphs=t.getVariables=t.getLiterals=t.getBlankNodes=t.getNamedNodes=t.getTermsOfType=t.uniqTerms=t.TERM_TYPES=void 0;const n=r(43347);function i(e,t){return e.filter((e=>e.termType===t))}t.TERM_TYPES=["NamedNode","BlankNode","Literal","Variable","DefaultGraph","Quad"],t.uniqTerms=function(e){const t={};return e.filter((e=>{const r=(0,n.termToString)(e);return!(r in t)&&(t[r]=!0)}))},t.getTermsOfType=i,t.getNamedNodes=function(e){return i(e,"NamedNode")},t.getBlankNodes=function(e){return i(e,"BlankNode")},t.getLiterals=function(e){return i(e,"Literal")},t.getVariables=function(e){return i(e,"Variable")},t.getDefaultGraphs=function(e){return i(e,"DefaultGraph")},t.getQuads=function(e){return i(e,"Quad")}},75611:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(68225),t)},5916:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ParseError=void 0;class r extends Error{constructor(e,t){const r=e.saxParser;super(e.trackPosition?`Line ${r.line} column ${r.column+1}: ${t}`:t)}}t.ParseError=r},68225:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ParseType=t.RdfXmlParser=void 0;const n=r(70742),i=r(55201),a=r(19198),o=r(5916),s=r(47793),c=r(17024);class u extends a.Transform{constructor(e){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},e&&(Object.assign(this,e),this.options=e),this.dataFactory||(this.dataFactory=new s.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),!1!==this.validateUri&&(this.validateUri=!0),this.iriValidationStrategy||(this.iriValidationStrategy=this.validateUri?c.IriValidationStrategy.Pragmatic:c.IriValidationStrategy.None),this.saxParser=new i.SaxesParser({xmlns:!0,position:this.trackPosition}),this.attachSaxListeners()}import(e){const t=new a.PassThrough({readableObjectMode:!0});e.on("error",(e=>r.emit("error",e))),e.on("data",(e=>t.push(e))),e.on("end",(()=>t.push(null)));const r=t.pipe(new u(this.options));return r}_transform(e,t,r){try{this.saxParser.write(e)}catch(e){return r(e)}r()}newParseError(e){return new o.ParseError(this,e)}valueToUri(e,t){return this.uriToNamedNode((0,n.resolve)(e,t.baseIRI))}uriToNamedNode(e){const t=(0,c.validateIri)(e,this.iriValidationStrategy);if(t instanceof Error)throw this.newParseError(t.message);return this.dataFactory.namedNode(e)}validateNcname(e){if(!u.NCNAME_MATCHER.test(e))throw this.newParseError(`Not a valid NCName: ${e}`)}attachSaxListeners(){this.saxParser.on("error",(e=>this.emit("error",e))),this.saxParser.on("opentag",this.onTag.bind(this)),this.saxParser.on("text",this.onText.bind(this)),this.saxParser.on("cdata",this.onText.bind(this)),this.saxParser.on("closetag",this.onCloseTag.bind(this)),this.saxParser.on("doctype",this.onDoctype.bind(this))}onTag(e){const t=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let r=l.RESOURCE;if(t&&(t.hadChildren=!0,r=t.childrenParseType),t&&t.childrenStringTags){const r=e.name;let n="";for(const t in e.attributes)n+=` ${t}="${e.attributes[t].value}"`;const i=`<${r}${n}>`;t.childrenStringTags.push(i);const a={childrenStringTags:t.childrenStringTags};return a.childrenStringEmitClosingTag=``,void this.activeTagStack.push(a)}const n={};t?(n.language=t.language,n.baseIRI=t.baseIRI):n.baseIRI=this.baseIRI,this.activeTagStack.push(n),r===l.RESOURCE?this.onTagResource(e,n,t,!t):this.onTagProperty(e,n,t)}onTagResource(e,t,r,i){t.childrenParseType=l.PROPERTY;let a=!0;if(e.uri===u.RDF){if(!i&&u.FORBIDDEN_NODE_ELEMENTS.indexOf(e.local)>=0)throw this.newParseError(`Illegal node element name: ${e.local}`);switch(e.local){case"RDF":t.childrenParseType=l.RESOURCE;case"Description":a=!1}}const o=[],s=[];let c=null,d=!1,p=!1,h=null;for(const i in e.attributes){const a=e.attributes[i];if(r&&a.uri===u.RDF)switch(a.local){case"about":if(c)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${a.value} and ${c} where found.`);c=a.value;continue;case"ID":if(c)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${a.value} and ${c} where found.`);this.validateNcname(a.value),c="#"+a.value,d=!0;continue;case"nodeID":if(c)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${a.value} and ${c} where found.`);this.validateNcname(a.value),c=a.value,p=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":h=a.value;continue;case"aboutEach":throw this.newParseError("rdf:aboutEach is not supported.");case"aboutEachPrefix":throw this.newParseError("rdf:aboutEachPrefix is not supported.");case"li":throw this.newParseError("rdf:li on node elements are not supported.")}else if(a.uri===u.XML){if("lang"===a.local){t.language=""===a.value?null:a.value.toLowerCase();continue}if("base"===a.local){t.baseIRI=(0,n.resolve)(a.value,t.baseIRI);continue}}"xml"===a.prefix||"xmlns"===a.prefix||""===a.prefix&&"xmlns"===a.local||!a.uri||(o.push(this.uriToNamedNode(a.uri+a.local)),s.push(a.value))}if(null!==c&&(t.subject=p?this.dataFactory.blankNode(c):this.valueToUri(c,t),d&&this.claimNodeId(t.subject)),t.subject||(t.subject=this.dataFactory.blankNode()),a){const n=this.uriToNamedNode(e.uri+e.local);this.emitTriple(t.subject,this.dataFactory.namedNode(u.RDF+"type"),n,r?r.reifiedStatementId:null)}if(r){if(r.predicate)if(r.childrenCollectionSubject){const e=this.dataFactory.blankNode();this.emitTriple(r.childrenCollectionSubject,r.childrenCollectionPredicate,e,r.reifiedStatementId),this.emitTriple(e,this.dataFactory.namedNode(u.RDF+"first"),t.subject,t.reifiedStatementId),r.childrenCollectionSubject=e,r.childrenCollectionPredicate=this.dataFactory.namedNode(u.RDF+"rest")}else{this.emitTriple(r.subject,r.predicate,t.subject,r.reifiedStatementId);for(let e=0;e=0)throw this.newParseError(`Illegal property element name: ${e.local}`);t.predicateSubPredicates=[],t.predicateSubObjects=[];let n=!1,i=!1,a=null,o=!0;const s=[],c=[];for(const r in e.attributes){const d=e.attributes[r];if(d.uri===u.RDF)switch(d.local){case"resource":if(a)throw this.newParseError(`Found both rdf:resource (${d.value}) and rdf:nodeID (${a}).`);if(n)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${d.value})`);t.hadChildren=!0,a=d.value,o=!1;continue;case"datatype":if(i)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${d.value}).`);if(n)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${d.value})`);t.datatype=this.valueToUri(d.value,t);continue;case"nodeID":if(i)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${d.value}).`);if(t.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${d.value}).`);if(n)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${d.value})`);this.validateNcname(d.value),t.hadChildren=!0,a=d.value,o=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(i)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(t.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${t.datatype.value})`);if(a)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${a})`);if("Resource"===d.value){n=!0,t.childrenParseType=l.PROPERTY;const e=this.dataFactory.blankNode();this.emitTriple(t.subject,t.predicate,e,t.reifiedStatementId),t.subject=e,t.predicate=null}else"Collection"===d.value?(n=!0,t.hadChildren=!0,t.childrenCollectionSubject=t.subject,t.childrenCollectionPredicate=t.predicate,o=!1):"Literal"===d.value&&(n=!0,t.childrenTagsToString=!0,t.childrenStringTags=[]);continue;case"ID":this.validateNcname(d.value),t.reifiedStatementId=this.valueToUri("#"+d.value,t),this.claimNodeId(t.reifiedStatementId);continue}else if(d.uri===u.XML&&"lang"===d.local){t.language=""===d.value?null:d.value.toLowerCase();continue}if("xml"!==d.prefix&&"xmlns"!==d.prefix&&(""!==d.prefix||"xmlns"!==d.local)&&d.uri){if(n||t.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${d.value}`);t.hadChildren=!0,i=!0,s.push(this.uriToNamedNode(d.uri+d.local)),c.push(this.dataFactory.literal(d.value,t.datatype||t.language))}}if(null!==a){const e=t.subject;t.subject=o?this.dataFactory.blankNode(a):this.valueToUri(a,t),this.emitTriple(e,t.predicate,t.subject,t.reifiedStatementId);for(let e=0;e/g,((e,t,r)=>(this.saxParser.ENTITIES[t]=r,"")))}}var l;t.RdfXmlParser=u,u.MIME_TYPE="application/rdf+xml",u.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",u.XML="http://www.w3.org/XML/1998/namespace",u.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],u.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],u.NCNAME_MATCHER=/^([A-Za-z\xC0-\xD6\xD8-\xF6\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}_])([A-Za-z\xC0-\xD6\xD8-\xF6\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}_\-.0-9#xB7\u{0300}-\u{036F}\u{203F}-\u{2040}])*$/u,function(e){e[e.RESOURCE=0]="RESOURCE",e[e.PROPERTY=1]="PROPERTY"}(l||(t.ParseType=l={}))},4147:(e,t,r)=>{"use strict";const{SymbolDispose:n}=r(24134),{AbortError:i,codes:a}=r(76371),{isNodeStream:o,isWebStream:s,kControllerErrorFunction:c}=r(16115),u=r(86238),{ERR_INVALID_ARG_TYPE:l}=a;let d;e.exports.addAbortSignal=function(t,r){if((e=>{if("object"!=typeof e||!("aborted"in e))throw new l("signal","AbortSignal",e)})(t),!o(r)&&!s(r))throw new l("stream",["ReadableStream","WritableStream","Stream"],r);return e.exports.addAbortSignalNoValidate(t,r)},e.exports.addAbortSignalNoValidate=function(e,t){if("object"!=typeof e||!("aborted"in e))return t;const a=o(t)?()=>{t.destroy(new i(void 0,{cause:e.reason}))}:()=>{t[c](new i(void 0,{cause:e.reason}))};if(e.aborted)a();else{d=d||r(57760).addAbortListener;const i=d(e,a);u(t,i[n])}return t}},80345:(e,t,r)=>{"use strict";const{StringPrototypeSlice:n,SymbolIterator:i,TypedArrayPrototypeSet:a,Uint8Array:o}=r(24134),{Buffer:s}=r(48287),{inspect:c}=r(57760);e.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){const t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){const t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}shift(){if(0===this.length)return;const e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(0===this.length)return"";let t=this.head,r=""+t.data;for(;null!==(t=t.next);)r+=e+t.data;return r}concat(e){if(0===this.length)return s.alloc(0);const t=s.allocUnsafe(e>>>0);let r=this.head,n=0;for(;r;)a(t,r.data,n),n+=r.data.length,r=r.next;return t}consume(e,t){const r=this.head.data;if(ea.length)){e===a.length?(t+=a,++i,r.next?this.head=r.next:this.head=this.tail=null):(t+=n(a,0,e),this.head=r,r.data=n(a,e));break}t+=a,e-=a.length,++i}while(null!==(r=r.next));return this.length-=i,t}_getBuffer(e){const t=s.allocUnsafe(e),r=e;let n=this.head,i=0;do{const s=n.data;if(!(e>s.length)){e===s.length?(a(t,s,r-e),++i,n.next?this.head=n.next:this.head=this.tail=null):(a(t,new o(s.buffer,s.byteOffset,e),r-e),this.head=n,n.data=s.slice(e));break}a(t,s,r-e),e-=s.length,++i}while(null!==(n=n.next));return this.length-=i,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return c(this,{...t,depth:0,customInspect:!1})}}},47830:(e,t,r)=>{"use strict";const{pipeline:n}=r(57758),i=r(93370),{destroyer:a}=r(75896),{isNodeStream:o,isReadable:s,isWritable:c,isWebStream:u,isTransformStream:l,isWritableStream:d,isReadableStream:p}=r(16115),{AbortError:h,codes:{ERR_INVALID_ARG_VALUE:f,ERR_MISSING_ARGS:y}}=r(76371),g=r(86238);e.exports=function(...e){if(0===e.length)throw new y("streams");if(1===e.length)return i.from(e[0]);const t=[...e];if("function"==typeof e[0]&&(e[0]=i.from(e[0])),"function"==typeof e[e.length-1]){const t=e.length-1;e[t]=i.from(e[t])}for(let r=0;r0&&!(c(e[r])||d(e[r])||l(e[r])))throw new f(`streams[${r}]`,t[r],"must be writable")}let r,m,b,v,_;const w=e[0],O=n(e,(function(e){const t=v;v=null,t?t(e):e?_.destroy(e):S||T||_.destroy()})),T=!!(c(w)||d(w)||l(w)),S=!!(s(O)||p(O)||l(O));if(_=new i({writableObjectMode:!(null==w||!w.writableObjectMode),readableObjectMode:!(null==O||!O.readableObjectMode),writable:T,readable:S}),T){if(o(w))_._write=function(e,t,n){w.write(e,t)?n():r=n},_._final=function(e){w.end(),m=e},w.on("drain",(function(){if(r){const e=r;r=null,e()}}));else if(u(w)){const e=(l(w)?w.writable:w).getWriter();_._write=async function(t,r,n){try{await e.ready,e.write(t).catch((()=>{})),n()}catch(e){n(e)}},_._final=async function(t){try{await e.ready,e.close().catch((()=>{})),m=t}catch(e){t(e)}}}const e=l(O)?O.readable:O;g(e,(()=>{if(m){const e=m;m=null,e()}}))}if(S)if(o(O))O.on("readable",(function(){if(b){const e=b;b=null,e()}})),O.on("end",(function(){_.push(null)})),_._read=function(){for(;;){const e=O.read();if(null===e)return void(b=_._read);if(!_.push(e))return}};else if(u(O)){const e=(l(O)?O.readable:O).getReader();_._read=async function(){for(;;)try{const{value:t,done:r}=await e.read();if(!_.push(t))return;if(r)return void _.push(null)}catch{return}}}return _._destroy=function(e,t){e||null===v||(e=new h),b=null,r=null,m=null,null===v?t(e):(v=t,o(O)&&a(O,e))},_}},75896:(e,t,r)=>{"use strict";const n=r(65606),{aggregateTwoErrors:i,codes:{ERR_MULTIPLE_CALLBACK:a},AbortError:o}=r(76371),{Symbol:s}=r(24134),{kIsDestroyed:c,isDestroyed:u,isFinished:l,isServerRequest:d}=r(16115),p=s("kDestroy"),h=s("kConstruct");function f(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function y(e,t,r){let i=!1;function a(t){if(i)return;i=!0;const a=e._readableState,o=e._writableState;f(t,o,a),o&&(o.closed=!0),a&&(a.closed=!0),"function"==typeof r&&r(t),t?n.nextTick(g,e,t):n.nextTick(m,e)}try{e._destroy(t||null,a)}catch(t){a(t)}}function g(e,t){b(e,t),m(e)}function m(e){const t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(null!=r&&r.emitClose||null!=t&&t.emitClose)&&e.emit("close")}function b(e,t){const r=e._readableState,n=e._writableState;null!=n&&n.errorEmitted||null!=r&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function v(e,t,r){const i=e._readableState,a=e._writableState;if(null!=a&&a.destroyed||null!=i&&i.destroyed)return this;null!=i&&i.autoDestroy||null!=a&&a.autoDestroy?e.destroy(t):t&&(t.stack,a&&!a.errored&&(a.errored=t),i&&!i.errored&&(i.errored=t),r?n.nextTick(b,e,t):b(e,t))}function _(e){let t=!1;function r(r){if(t)return void v(e,null!=r?r:new a);t=!0;const i=e._readableState,o=e._writableState,s=o||i;i&&(i.constructed=!0),o&&(o.constructed=!0),s.destroyed?e.emit(p,r):r?v(e,r,!0):n.nextTick(w,e)}try{e._construct((e=>{n.nextTick(r,e)}))}catch(e){n.nextTick(r,e)}}function w(e){e.emit(h)}function O(e){return(null==e?void 0:e.setHeader)&&"function"==typeof e.abort}function T(e){e.emit("close")}function S(e,t){e.emit("error",t),n.nextTick(T,e)}e.exports={construct:function(e,t){if("function"!=typeof e._construct)return;const r=e._readableState,i=e._writableState;r&&(r.constructed=!1),i&&(i.constructed=!1),e.once(h,t),e.listenerCount(h)>1||n.nextTick(_,e)},destroyer:function(e,t){e&&!u(e)&&(t||l(e)||(t=new o),d(e)?(e.socket=null,e.destroy(t)):O(e)?e.abort():O(e.req)?e.req.abort():"function"==typeof e.destroy?e.destroy(t):"function"==typeof e.close?e.close():t?n.nextTick(S,e,t):n.nextTick(T,e),e.destroyed||(e[c]=!0))},destroy:function(e,t){const r=this._readableState,n=this._writableState,a=n||r;return null!=n&&n.destroyed||null!=r&&r.destroyed?("function"==typeof t&&t(),this):(f(e,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),a.constructed?y(this,e,t):this.once(p,(function(r){y(this,i(r,e),t)})),this)},undestroy:function(){const e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=!1===e.readable,e.endEmitted=!1===e.readable),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=!1===t.writable,t.ending=!1===t.writable,t.finished=!1===t.writable)},errorOrDestroy:v}},93370:(e,t,r)=>{"use strict";const{ObjectDefineProperties:n,ObjectGetOwnPropertyDescriptor:i,ObjectKeys:a,ObjectSetPrototypeOf:o}=r(24134);e.exports=u;const s=r(57576),c=r(78584);o(u.prototype,s.prototype),o(u,s);{const e=a(c.prototype);for(let t=0;t{const n=r(65606),i=r(48287),{isReadable:a,isWritable:o,isIterable:s,isNodeStream:c,isReadableNodeStream:u,isWritableNodeStream:l,isDuplexNodeStream:d,isReadableStream:p,isWritableStream:h}=r(16115),f=r(86238),{AbortError:y,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:m}}=r(76371),{destroyer:b}=r(75896),v=r(93370),_=r(57576),w=r(78584),{createDeferredPromise:O}=r(57760),T=r(96532),S=globalThis.Blob||i.Blob,E=void 0!==S?function(e){return e instanceof S}:function(e){return!1},x=globalThis.AbortController||r(25568).AbortController,{FunctionPrototypeCall:I}=r(24134);class A extends v{constructor(e){super(e),!1===(null==e?void 0:e.readable)&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===(null==e?void 0:e.writable)&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}function j(e){const t=e.readable&&"function"!=typeof e.readable.read?_.wrap(e.readable):e.readable,r=e.writable;let n,i,s,c,u,l=!!a(t),d=!!o(r);function p(e){const t=c;c=null,t?t(e):e&&u.destroy(e)}return u=new A({readableObjectMode:!(null==t||!t.readableObjectMode),writableObjectMode:!(null==r||!r.writableObjectMode),readable:l,writable:d}),d&&(f(r,(e=>{d=!1,e&&b(t,e),p(e)})),u._write=function(e,t,i){r.write(e,t)?i():n=i},u._final=function(e){r.end(),i=e},r.on("drain",(function(){if(n){const e=n;n=null,e()}})),r.on("finish",(function(){if(i){const e=i;i=null,e()}}))),l&&(f(t,(e=>{l=!1,e&&b(t,e),p(e)})),t.on("readable",(function(){if(s){const e=s;s=null,e()}})),t.on("end",(function(){u.push(null)})),u._read=function(){for(;;){const e=t.read();if(null===e)return void(s=u._read);if(!u.push(e))return}}),u._destroy=function(e,a){e||null===c||(e=new y),s=null,n=null,i=null,null===c?a(e):(c=a,b(r,e),b(t,e))},u}e.exports=function e(t,r){if(d(t))return t;if(u(t))return j({readable:t});if(l(t))return j({writable:t});if(c(t))return j({writable:!1,readable:!1});if(p(t))return j({readable:_.fromWeb(t)});if(h(t))return j({writable:w.fromWeb(t)});if("function"==typeof t){const{value:e,write:i,final:a,destroy:o}=function(e){let{promise:t,resolve:r}=O();const i=new x,a=i.signal;return{value:e(async function*(){for(;;){const e=t;t=null;const{chunk:i,done:o,cb:s}=await e;if(n.nextTick(s),o)return;if(a.aborted)throw new y(void 0,{cause:a.reason});({promise:t,resolve:r}=O()),yield i}}(),{signal:a}),write(e,t,n){const i=r;r=null,i({chunk:e,done:!1,cb:n})},final(e){const t=r;r=null,t({done:!0,cb:e})},destroy(e,t){i.abort(),t(e)}}}(t);if(s(e))return T(A,e,{objectMode:!0,write:i,final:a,destroy:o});const c=null==e?void 0:e.then;if("function"==typeof c){let t;const r=I(c,e,(e=>{if(null!=e)throw new m("nully","body",e)}),(e=>{b(t,e)}));return t=new A({objectMode:!0,readable:!1,write:i,final(e){a((async()=>{try{await r,n.nextTick(e,null)}catch(t){n.nextTick(e,t)}}))},destroy:o})}throw new m("Iterable, AsyncIterable or AsyncFunction",r,e)}if(E(t))return e(t.arrayBuffer());if(s(t))return T(A,t,{objectMode:!0,writable:!1});if(p(null==t?void 0:t.readable)&&h(null==t?void 0:t.writable))return A.fromWeb(t);if("object"==typeof(null==t?void 0:t.writable)||"object"==typeof(null==t?void 0:t.readable))return j({readable:null!=t&&t.readable?u(null==t?void 0:t.readable)?null==t?void 0:t.readable:e(t.readable):void 0,writable:null!=t&&t.writable?l(null==t?void 0:t.writable)?null==t?void 0:t.writable:e(t.writable):void 0});const i=null==t?void 0:t.then;if("function"==typeof i){let e;return I(i,t,(t=>{null!=t&&e.push(t),e.push(null)}),(t=>{b(e,t)})),e=new A({objectMode:!0,writable:!1,read(){}})}throw new g(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)}},86238:(e,t,r)=>{const n=r(65606),{AbortError:i,codes:a}=r(76371),{ERR_INVALID_ARG_TYPE:o,ERR_STREAM_PREMATURE_CLOSE:s}=a,{kEmptyObject:c,once:u}=r(57760),{validateAbortSignal:l,validateFunction:d,validateObject:p,validateBoolean:h}=r(277),{Promise:f,PromisePrototypeThen:y,SymbolDispose:g}=r(24134),{isClosed:m,isReadable:b,isReadableNodeStream:v,isReadableStream:_,isReadableFinished:w,isReadableErrored:O,isWritable:T,isWritableNodeStream:S,isWritableStream:E,isWritableFinished:x,isWritableErrored:I,isNodeStream:A,willEmitClose:j,kIsClosedPromise:N}=r(16115);let R;const D=()=>{};function P(e,t,a){var h,f;if(2===arguments.length?(a=t,t=c):null==t?t=c:p(t,"options"),d(a,"callback"),l(t.signal,"options.signal"),a=u(a),_(e)||E(e))return function(e,t,a){let o=!1,s=D;if(t.signal)if(s=()=>{o=!0,a.call(e,new i(void 0,{cause:t.signal.reason}))},t.signal.aborted)n.nextTick(s);else{R=R||r(57760).addAbortListener;const n=R(t.signal,s),i=a;a=u(((...t)=>{n[g](),i.apply(e,t)}))}const c=(...t)=>{o||n.nextTick((()=>a.apply(e,t)))};return y(e[N].promise,c,c),D}(e,t,a);if(!A(e))throw new o("stream",["ReadableStream","WritableStream","Stream"],e);const P=null!==(h=t.readable)&&void 0!==h?h:v(e),F=null!==(f=t.writable)&&void 0!==f?f:S(e),C=e._writableState,M=e._readableState,L=()=>{e.writable||U()};let k=j(e)&&v(e)===P&&S(e)===F,B=x(e,!1);const U=()=>{B=!0,e.destroyed&&(k=!1),(!k||e.readable&&!P)&&(P&&!V||a.call(e))};let V=w(e,!1);const $=()=>{V=!0,e.destroyed&&(k=!1),(!k||e.writable&&!F)&&(F&&!B||a.call(e))},q=t=>{a.call(e,t)};let Q=m(e);const G=()=>{Q=!0;const t=I(e)||O(e);return t&&"boolean"!=typeof t?a.call(e,t):P&&!V&&v(e,!0)&&!w(e,!1)?a.call(e,new s):!F||B||x(e,!1)?void a.call(e):a.call(e,new s)},z=()=>{Q=!0;const t=I(e)||O(e);if(t&&"boolean"!=typeof t)return a.call(e,t);a.call(e)},H=()=>{e.req.on("finish",U)};!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?F&&!C&&(e.on("end",L),e.on("close",L)):(e.on("complete",U),k||e.on("abort",G),e.req?H():e.on("request",H)),k||"boolean"!=typeof e.aborted||e.on("aborted",G),e.on("end",$),e.on("finish",U),!1!==t.error&&e.on("error",q),e.on("close",G),Q?n.nextTick(G):null!=C&&C.errorEmitted||null!=M&&M.errorEmitted?k||n.nextTick(z):(P||k&&!b(e)||!B&&!1!==T(e))&&(F||k&&!T(e)||!V&&!1!==b(e))?M&&e.req&&e.aborted&&n.nextTick(z):n.nextTick(z);const K=()=>{a=D,e.removeListener("aborted",G),e.removeListener("complete",U),e.removeListener("abort",G),e.removeListener("request",H),e.req&&e.req.removeListener("finish",U),e.removeListener("end",L),e.removeListener("close",L),e.removeListener("finish",U),e.removeListener("end",$),e.removeListener("error",q),e.removeListener("close",G)};if(t.signal&&!Q){const o=()=>{const r=a;K(),r.call(e,new i(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)n.nextTick(o);else{R=R||r(57760).addAbortListener;const n=R(t.signal,o),i=a;a=u(((...t)=>{n[g](),i.apply(e,t)}))}}return K}e.exports=P,e.exports.finished=function(e,t){var r;let n=!1;return null===t&&(t=c),null!==(r=t)&&void 0!==r&&r.cleanup&&(h(t.cleanup,"cleanup"),n=t.cleanup),new f(((r,i)=>{const a=P(e,t,(e=>{n&&a(),e?i(e):r()}))}))}},96532:(e,t,r)=>{"use strict";const n=r(65606),{PromisePrototypeThen:i,SymbolAsyncIterator:a,SymbolIterator:o}=r(24134),{Buffer:s}=r(48287),{ERR_INVALID_ARG_TYPE:c,ERR_STREAM_NULL_VALUES:u}=r(76371).codes;e.exports=function(e,t,r){let l,d;if("string"==typeof t||t instanceof s)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});if(t&&t[a])d=!0,l=t[a]();else{if(!t||!t[o])throw new c("iterable",["Iterable"],t);d=!1,l=t[o]()}const p=new e({objectMode:!0,highWaterMark:1,...r});let h=!1;return p._read=function(){h||(h=!0,async function(){for(;;){try{const{value:e,done:t}=d?await l.next():l.next();if(t)p.push(null);else{const t=e&&"function"==typeof e.then?await e:e;if(null===t)throw h=!1,new u;if(p.push(t))continue;h=!1}}catch(e){p.destroy(e)}break}}())},p._destroy=function(e,t){i(async function(e){const t=null!=e,r="function"==typeof l.throw;if(t&&r){const{value:t,done:r}=await l.throw(e);if(await t,r)return}if("function"==typeof l.return){const{value:e}=await l.return();await e}}(e),(()=>n.nextTick(t,e)),(r=>n.nextTick(t,r||e)))},p}},94259:(e,t,r)=>{"use strict";const{ArrayIsArray:n,ObjectSetPrototypeOf:i}=r(24134),{EventEmitter:a}=r(37007);function o(e){a.call(this,e)}function s(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?n(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}i(o.prototype,a.prototype),i(o,a),o.prototype.pipe=function(e,t){const r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",c),r.on("close",u));let o=!1;function c(){o||(o=!0,e.end())}function u(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){d(),0===a.listenerCount(this,"error")&&this.emit("error",e)}function d(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",c),r.removeListener("close",u),r.removeListener("error",l),e.removeListener("error",l),r.removeListener("end",d),r.removeListener("close",d),e.removeListener("close",d)}return s(r,"error",l),s(e,"error",l),r.on("end",d),r.on("close",d),e.on("close",d),e.emit("pipe",r),e},e.exports={Stream:o,prependListener:s}},60823:(e,t,r)=>{"use strict";const n=globalThis.AbortController||r(25568).AbortController,{codes:{ERR_INVALID_ARG_VALUE:i,ERR_INVALID_ARG_TYPE:a,ERR_MISSING_ARGS:o,ERR_OUT_OF_RANGE:s},AbortError:c}=r(76371),{validateAbortSignal:u,validateInteger:l,validateObject:d}=r(277),p=r(24134).Symbol("kWeak"),h=r(24134).Symbol("kResistStopPropagation"),{finished:f}=r(86238),y=r(47830),{addAbortSignalNoValidate:g}=r(4147),{isWritable:m,isNodeStream:b}=r(16115),{deprecate:v}=r(57760),{ArrayPrototypePush:_,Boolean:w,MathFloor:O,Number:T,NumberIsNaN:S,Promise:E,PromiseReject:x,PromiseResolve:I,PromisePrototypeThen:A,Symbol:j}=r(24134),N=j("kEmpty"),R=j("kEof");function D(e,t){if("function"!=typeof e)throw new a("fn",["Function","AsyncFunction"],e);null!=t&&d(t,"options"),null!=(null==t?void 0:t.signal)&&u(t.signal,"options.signal");let n=1;null!=(null==t?void 0:t.concurrency)&&(n=O(t.concurrency));let i=n-1;return null!=(null==t?void 0:t.highWaterMark)&&(i=O(t.highWaterMark)),l(n,"options.concurrency",1),l(i,"options.highWaterMark",0),i+=n,async function*(){const a=r(57760).AbortSignalAny([null==t?void 0:t.signal].filter(w)),o=this,s=[],u={signal:a};let l,d,p=!1,h=0;function f(){p=!0,y()}function y(){h-=1,g()}function g(){d&&!p&&h=i||h>=n)&&await new E((e=>{d=e}))}s.push(R)}catch(e){const t=x(e);A(t,y,f),s.push(t)}finally{p=!0,l&&(l(),l=null)}}();try{for(;;){for(;s.length>0;){const e=await s[0];if(e===R)return;if(a.aborted)throw new c;e!==N&&(yield e),s.shift(),g()}await new E((e=>{l=e}))}}finally{p=!0,d&&(d(),d=null)}}.call(this)}async function P(e,t=void 0){for await(const r of F.call(this,e,t))return!0;return!1}function F(e,t){if("function"!=typeof e)throw new a("fn",["Function","AsyncFunction"],e);return D.call(this,(async function(t,r){return await e(t,r)?t:N}),t)}class C extends o{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}function M(e){if(e=T(e),S(e))return 0;if(e<0)throw new s("number",">= 0",e);return e}e.exports.streamReturningOperators={asIndexedPairs:v((function(e=void 0){return null!=e&&d(e,"options"),null!=(null==e?void 0:e.signal)&&u(e.signal,"options.signal"),async function*(){let t=0;for await(const n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new c({cause:e.signal.reason});yield[t++,n]}}.call(this)}),"readable.asIndexedPairs will be removed in a future version."),drop:function(e,t=void 0){return null!=t&&d(t,"options"),null!=(null==t?void 0:t.signal)&&u(t.signal,"options.signal"),e=M(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new c;for await(const r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new c;e--<=0&&(yield r)}}.call(this)},filter:F,flatMap:function(e,t){const r=D.call(this,e,t);return async function*(){for await(const e of r)yield*e}.call(this)},map:D,take:function(e,t=void 0){return null!=t&&d(t,"options"),null!=(null==t?void 0:t.signal)&&u(t.signal,"options.signal"),e=M(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new c;for await(const r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new c;if(e-- >0&&(yield r),e<=0)return}}.call(this)},compose:function(e,t){if(null!=t&&d(t,"options"),null!=(null==t?void 0:t.signal)&&u(t.signal,"options.signal"),b(e)&&!m(e))throw new i("stream",e,"must be writable");const r=y(this,e);return null!=t&&t.signal&&g(t.signal,r),r}},e.exports.promiseReturningOperators={every:async function(e,t=void 0){if("function"!=typeof e)throw new a("fn",["Function","AsyncFunction"],e);return!await P.call(this,(async(...t)=>!await e(...t)),t)},forEach:async function(e,t){if("function"!=typeof e)throw new a("fn",["Function","AsyncFunction"],e);for await(const r of D.call(this,(async function(t,r){return await e(t,r),N}),t));},reduce:async function(e,t,r){var i;if("function"!=typeof e)throw new a("reducer",["Function","AsyncFunction"],e);null!=r&&d(r,"options"),null!=(null==r?void 0:r.signal)&&u(r.signal,"options.signal");let o=arguments.length>1;if(null!=r&&null!==(i=r.signal)&&void 0!==i&&i.aborted){const e=new c(void 0,{cause:r.signal.reason});throw this.once("error",(()=>{})),await f(this.destroy(e)),e}const s=new n,l=s.signal;if(null!=r&&r.signal){const e={once:!0,[p]:this,[h]:!0};r.signal.addEventListener("abort",(()=>s.abort()),e)}let y=!1;try{for await(const n of this){var g;if(y=!0,null!=r&&null!==(g=r.signal)&&void 0!==g&&g.aborted)throw new c;o?t=await e(t,n,{signal:l}):(t=n,o=!0)}if(!y&&!o)throw new C}finally{s.abort()}return t},toArray:async function(e){null!=e&&d(e,"options"),null!=(null==e?void 0:e.signal)&&u(e.signal,"options.signal");const t=[];for await(const n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new c(void 0,{cause:e.signal.reason});_(t,n)}return t},some:P,find:async function(e,t){for await(const r of F.call(this,e,t))return r}}},86524:(e,t,r)=>{"use strict";const{ObjectSetPrototypeOf:n}=r(24134);e.exports=a;const i=r(17382);function a(e){if(!(this instanceof a))return new a(e);i.call(this,e)}n(a.prototype,i.prototype),n(a,i),a.prototype._transform=function(e,t,r){r(null,e)}},57758:(e,t,r)=>{const n=r(65606),{ArrayIsArray:i,Promise:a,SymbolAsyncIterator:o,SymbolDispose:s}=r(24134),c=r(86238),{once:u}=r(57760),l=r(75896),d=r(93370),{aggregateTwoErrors:p,codes:{ERR_INVALID_ARG_TYPE:h,ERR_INVALID_RETURN_VALUE:f,ERR_MISSING_ARGS:y,ERR_STREAM_DESTROYED:g,ERR_STREAM_PREMATURE_CLOSE:m},AbortError:b}=r(76371),{validateFunction:v,validateAbortSignal:_}=r(277),{isIterable:w,isReadable:O,isReadableNodeStream:T,isNodeStream:S,isTransformStream:E,isWebStream:x,isReadableStream:I,isReadableFinished:A}=r(16115),j=globalThis.AbortController||r(25568).AbortController;let N,R,D;function P(e,t,r){let n=!1;return e.on("close",(()=>{n=!0})),{destroy:t=>{n||(n=!0,l.destroyer(e,t||new g("pipe")))},cleanup:c(e,{readable:t,writable:r},(e=>{n=!e}))}}function F(e){if(w(e))return e;if(T(e))return async function*(e){R||(R=r(57576)),yield*R.prototype[o].call(e)}(e);throw new h("val",["Readable","Iterable","AsyncIterable"],e)}async function C(e,t,r,{end:n}){let i,o=null;const s=e=>{if(e&&(i=e),o){const e=o;o=null,e()}},u=()=>new a(((e,t)=>{i?t(i):o=()=>{i?t(i):e()}}));t.on("drain",s);const l=c(t,{readable:!1},s);try{t.writableNeedDrain&&await u();for await(const r of e)t.write(r)||await u();n&&(t.end(),await u()),r()}catch(e){r(i!==e?p(i,e):e)}finally{l(),t.off("drain",s)}}async function M(e,t,r,{end:n}){E(t)&&(t=t.writable);const i=t.getWriter();try{for await(const t of e)await i.ready,i.write(t).catch((()=>{}));await i.ready,n&&await i.close(),r()}catch(e){try{await i.abort(e),r(e)}catch(e){r(e)}}}function L(e,t,a){if(1===e.length&&i(e[0])&&(e=e[0]),e.length<2)throw new y("streams");const o=new j,c=o.signal,u=null==a?void 0:a.signal,l=[];function p(){U(new b)}let g,m,v;_(u,"options.signal"),D=D||r(57760).addAbortListener,u&&(g=D(u,p));const A=[];let R,L=0;function B(e){U(e,0==--L)}function U(e,r){var i;if(!e||m&&"ERR_STREAM_PREMATURE_CLOSE"!==m.code||(m=e),m||r){for(;A.length;)A.shift()(m);null===(i=g)||void 0===i||i[s](),o.abort(),r&&(m||l.forEach((e=>e())),n.nextTick(t,m,v))}}for(let Q=0;Q0,K=z||!1!==(null==a?void 0:a.end),X=Q===e.length-1;if(S(G)){if(K){const{destroy:J,cleanup:W}=P(G,z,H);A.push(J),O(G)&&X&&l.push(W)}function V(e){e&&"AbortError"!==e.name&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code&&B(e)}G.on("error",V),O(G)&&X&&l.push((()=>{G.removeListener("error",V)}))}if(0===Q)if("function"==typeof G){if(R=G({signal:c}),!w(R))throw new f("Iterable, AsyncIterable or Stream","source",R)}else R=w(G)||T(G)||E(G)?G:d.from(G);else if("function"==typeof G){var $;if(R=E(R)?F(null===($=R)||void 0===$?void 0:$.readable):F(R),R=G(R,{signal:c}),z){if(!w(R,!0))throw new f("AsyncIterable",`transform[${Q-1}]`,R)}else{var q;N||(N=r(86524));const Y=new N({objectMode:!0}),Z=null===(q=R)||void 0===q?void 0:q.then;if("function"==typeof Z)L++,Z.call(R,(e=>{v=e,null!=e&&Y.write(e),K&&Y.end(),n.nextTick(B)}),(e=>{Y.destroy(e),n.nextTick(B,e)}));else if(w(R,!0))L++,C(R,Y,B,{end:K});else{if(!I(R)&&!E(R))throw new f("AsyncIterable or Promise","destination",R);{const re=R.readable||R;L++,C(re,Y,B,{end:K})}}R=Y;const{destroy:ee,cleanup:te}=P(R,!1,!0);A.push(ee),X&&l.push(te)}}else if(S(G)){if(T(R)){L+=2;const ne=k(R,G,B,{end:K});O(G)&&X&&l.push(ne)}else if(E(R)||I(R)){const ie=R.readable||R;L++,C(ie,G,B,{end:K})}else{if(!w(R))throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],R);L++,C(R,G,B,{end:K})}R=G}else if(x(G)){if(T(R))L++,M(F(R),G,B,{end:K});else if(I(R)||w(R))L++,M(R,G,B,{end:K});else{if(!E(R))throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],R);L++,M(R.readable,G,B,{end:K})}R=G}else R=d.from(G)}return(null!=c&&c.aborted||null!=u&&u.aborted)&&n.nextTick(p),R}function k(e,t,r,{end:i}){let a=!1;if(t.on("close",(()=>{a||r(new m)})),e.pipe(t,{end:!1}),i){function o(){a=!0,t.end()}A(e)?n.nextTick(o):e.once("end",o)}else r();return c(e,{readable:!0,writable:!1},(t=>{const n=e._readableState;t&&"ERR_STREAM_PREMATURE_CLOSE"===t.code&&n&&n.ended&&!n.errored&&!n.errorEmitted?e.once("end",r).once("error",r):r(t)})),c(t,{readable:!1,writable:!0},r)}e.exports={pipelineImpl:L,pipeline:function(...e){return L(e,u(function(e){return v(e[e.length-1],"streams[stream.length - 1]"),e.pop()}(e)))}}},57576:(e,t,r)=>{const n=r(65606),{ArrayPrototypeIndexOf:i,NumberIsInteger:a,NumberIsNaN:o,NumberParseInt:s,ObjectDefineProperties:c,ObjectKeys:u,ObjectSetPrototypeOf:l,Promise:d,SafeSet:p,SymbolAsyncDispose:h,SymbolAsyncIterator:f,Symbol:y}=r(24134);e.exports=H,H.ReadableState=z;const{EventEmitter:g}=r(37007),{Stream:m,prependListener:b}=r(94259),{Buffer:v}=r(48287),{addAbortSignal:_}=r(4147),w=r(86238);let O=r(57760).debuglog("stream",(e=>{O=e}));const T=r(80345),S=r(75896),{getHighWaterMark:E,getDefaultHighWaterMark:x}=r(65291),{aggregateTwoErrors:I,codes:{ERR_INVALID_ARG_TYPE:A,ERR_METHOD_NOT_IMPLEMENTED:j,ERR_OUT_OF_RANGE:N,ERR_STREAM_PUSH_AFTER_EOF:R,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:D},AbortError:P}=r(76371),{validateObject:F}=r(277),C=y("kPaused"),{StringDecoder:M}=r(83141),L=r(96532);l(H.prototype,m.prototype),l(H,m);const k=()=>{},{errorOrDestroy:B}=S,U=1,V=16,$=32,q=2048,Q=4096;function G(e){return{enumerable:!1,get(){return!!(this.state&e)},set(t){t?this.state|=e:this.state&=~e}}}function z(e,t,n){"boolean"!=typeof n&&(n=t instanceof r(93370)),this.state=q|Q|V|$,e&&e.objectMode&&(this.state|=U),n&&e&&e.readableObjectMode&&(this.state|=U),this.highWaterMark=e?E(this,e,"readableHighWaterMark",n):x(!1),this.buffer=new T,this.length=0,this.pipes=[],this.flowing=null,this[C]=null,e&&!1===e.emitClose&&(this.state&=~q),e&&!1===e.autoDestroy&&(this.state&=~Q),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new M(e.encoding),this.encoding=e.encoding)}function H(e){if(!(this instanceof H))return new H(e);const t=this instanceof r(93370);this._readableState=new z(e,this,t),e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&!t&&_(e.signal,this)),m.call(this,e),S.construct(this,(()=>{this._readableState.needReadable&&Z(this,this._readableState)}))}function K(e,t,r,n){O("readableAddChunk",t);const i=e._readableState;let a;if(i.state&U||("string"==typeof t?(r=r||i.defaultEncoding,i.encoding!==r&&(n&&i.encoding?t=v.from(t,r).toString(i.encoding):(t=v.from(t,r),r=""))):t instanceof v?r="":m._isUint8Array(t)?(t=m._uint8ArrayToBuffer(t),r=""):null!=t&&(a=new A("chunk",["string","Buffer","Uint8Array"],t))),a)B(e,a);else if(null===t)i.state&=-9,function(e,t){if(O("onEofChunk"),!t.ended){if(t.decoder){const e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}t.ended=!0,t.sync?W(e):(t.needReadable=!1,t.emittedReadable=!0,Y(e))}}(e,i);else if(i.state&U||t&&t.length>0)if(n)if(4&i.state)B(e,new D);else{if(i.destroyed||i.errored)return!1;X(e,i,t,!0)}else if(i.ended)B(e,new R);else{if(i.destroyed||i.errored)return!1;i.state&=-9,i.decoder&&!r?(t=i.decoder.write(t),i.objectMode||0!==t.length?X(e,i,t,!1):Z(e,i)):X(e,i,t,!1)}else n||(i.state&=-9,Z(e,i));return!i.ended&&(i.length0?(65536&t.state?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),64&t.state&&W(e)),Z(e,t)}function J(e,t){return e<=0||0===t.length&&t.ended?0:t.state&U?1:o(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}function W(e){const t=e._readableState;O("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(O("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(Y,e))}function Y(e){const t=e._readableState;O("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||t.errored||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,ie(e)}function Z(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,n.nextTick(ee,e,t))}function ee(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!1===t[C]?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function re(e){O("readable nexttick read 0"),e.read(0)}function ne(e,t){O("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),ie(e),t.flowing&&!t.reading&&e.read(0)}function ie(e){const t=e._readableState;for(O("flow",t.flowing);t.flowing&&null!==e.read(););}function ae(e,t){"function"!=typeof e.read&&(e=H.wrap(e,{objectMode:!0}));const r=async function*(e,t){let r,n=k;function i(t){this===e?(n(),n=k):n=t}e.on("readable",i);const a=w(e,{writable:!1},(e=>{r=e?I(r,e):null,n(),n=k}));try{for(;;){const t=e.destroyed?null:e.read();if(null!==t)yield t;else{if(r)throw r;if(null===r)return;await new d(i)}}}catch(e){throw r=I(r,e),r}finally{!r&&!1===(null==t?void 0:t.destroyOnReturn)||void 0!==r&&!e._readableState.autoDestroy?(e.off("readable",i),a()):S.destroyer(e,null)}}(e,t);return r.stream=e,r}function oe(e,t){if(0===t.length)return null;let r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function se(e){const t=e._readableState;O("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(ce,t,e))}function ce(e,t){if(O("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&0===e.length)if(e.endEmitted=!0,t.emit("end"),t.writable&&!1===t.allowHalfOpen)n.nextTick(ue,t);else if(e.autoDestroy){const e=t._writableState;(!e||e.autoDestroy&&(e.finished||!1===e.writable))&&t.destroy()}}function ue(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}let le;function de(){return void 0===le&&(le={}),le}c(z.prototype,{objectMode:G(U),ended:G(2),endEmitted:G(4),reading:G(8),constructed:G(V),sync:G($),needReadable:G(64),emittedReadable:G(128),readableListening:G(256),resumeScheduled:G(512),errorEmitted:G(1024),emitClose:G(q),autoDestroy:G(Q),destroyed:G(8192),closed:G(16384),closeEmitted:G(32768),multiAwaitDrain:G(65536),readingMore:G(1<<17),dataEmitted:G(1<<18)}),H.prototype.destroy=S.destroy,H.prototype._undestroy=S.undestroy,H.prototype._destroy=function(e,t){t(e)},H.prototype[g.captureRejectionSymbol]=function(e){this.destroy(e)},H.prototype[h]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new P,this.destroy(e)),new d(((t,r)=>w(this,(n=>n&&n!==e?r(n):t(null)))))},H.prototype.push=function(e,t){return K(this,e,t,!1)},H.prototype.unshift=function(e,t){return K(this,e,t,!0)},H.prototype.isPaused=function(){const e=this._readableState;return!0===e[C]||!1===e.flowing},H.prototype.setEncoding=function(e){const t=new M(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;const r=this._readableState.buffer;let n="";for(const e of r)n+=t.write(e);return r.clear(),""!==n&&r.push(n),this._readableState.length=n.length,this},H.prototype.read=function(e){O("read",e),void 0===e?e=NaN:a(e)||(e=s(e,10));const t=this._readableState,r=e;if(e>t.highWaterMark&&(t.highWaterMark=function(e){if(e>1073741824)throw new N("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,++e}(e)),0!==e&&(t.state&=-129),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return O("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?se(this):W(this),null;if(0===(e=J(e,t))&&t.ended)return 0===t.length&&se(this),null;let n,i=!!(64&t.state);if(O("need readable",i),(0===t.length||t.length-e0?oe(e,t):null,null===n?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&se(this)),null===n||t.errorEmitted||t.closeEmitted||(t.dataEmitted=!0,this.emit("data",n)),n},H.prototype._read=function(e){throw new j("_read()")},H.prototype.pipe=function(e,t){const r=this,i=this._readableState;1===i.pipes.length&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new p(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(e),O("pipe count=%d opts=%j",i.pipes.length,t);const a=t&&!1===t.end||e===n.stdout||e===n.stderr?y:o;function o(){O("onend"),e.end()}let s;i.endEmitted?n.nextTick(a):r.once("end",a),e.on("unpipe",(function t(n,a){O("onunpipe"),n===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,O("cleanup"),e.removeListener("close",h),e.removeListener("finish",f),s&&e.removeListener("drain",s),e.removeListener("error",d),e.removeListener("unpipe",t),r.removeListener("end",o),r.removeListener("end",y),r.removeListener("data",l),c=!0,s&&i.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&s())}));let c=!1;function u(){c||(1===i.pipes.length&&i.pipes[0]===e?(O("false write response, pause",0),i.awaitDrainWriters=e,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(e)&&(O("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(e)),r.pause()),s||(s=function(e,t){return function(){const r=e._readableState;r.awaitDrainWriters===t?(O("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(O("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(t)),r.awaitDrainWriters&&0!==r.awaitDrainWriters.size||!e.listenerCount("data")||e.resume()}}(r,e),e.on("drain",s))}function l(t){O("ondata");const r=e.write(t);O("dest.write",r),!1===r&&u()}function d(t){if(O("onerror",t),y(),e.removeListener("error",d),0===e.listenerCount("error")){const r=e._writableState||e._readableState;r&&!r.errorEmitted?B(e,t):e.emit("error",t)}}function h(){e.removeListener("finish",f),y()}function f(){O("onfinish"),e.removeListener("close",h),y()}function y(){O("unpipe"),r.unpipe(e)}return r.on("data",l),b(e,"error",d),e.once("close",h),e.once("finish",f),e.emit("pipe",r),!0===e.writableNeedDrain?u():i.flowing||(O("pipe resume"),r.resume()),e},H.prototype.unpipe=function(e){const t=this._readableState;if(0===t.pipes.length)return this;if(!e){const e=t.pipes;t.pipes=[],this.pause();for(let t=0;t0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,O("on readable",i.length,i.reading),i.length?W(this):i.reading||n.nextTick(re,this))),r},H.prototype.addListener=H.prototype.on,H.prototype.removeListener=function(e,t){const r=m.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(te,this),r},H.prototype.off=H.prototype.removeListener,H.prototype.removeAllListeners=function(e){const t=m.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(te,this),t},H.prototype.resume=function(){const e=this._readableState;return e.flowing||(O("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(ne,e,t))}(this,e)),e[C]=!1,this},H.prototype.pause=function(){return O("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(O("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[C]=!0,this},H.prototype.wrap=function(e){let t=!1;e.on("data",(r=>{!this.push(r)&&e.pause&&(t=!0,e.pause())})),e.on("end",(()=>{this.push(null)})),e.on("error",(e=>{B(this,e)})),e.on("close",(()=>{this.destroy()})),e.on("destroy",(()=>{this.destroy()})),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};const r=u(e);for(let t=1;t{"use strict";const{MathFloor:n,NumberIsInteger:i}=r(24134),{validateInteger:a}=r(277),{ERR_INVALID_ARG_VALUE:o}=r(76371).codes;let s=16384,c=16;function u(e){return e?c:s}e.exports={getHighWaterMark:function(e,t,r,a){const s=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,a,r);if(null!=s){if(!i(s)||s<0)throw new o(a?`options.${r}`:"options.highWaterMark",s);return n(s)}return u(e.objectMode)},getDefaultHighWaterMark:u,setDefaultHighWaterMark:function(e,t){a(t,"value",0),e?c=t:s=t}}},17382:(e,t,r)=>{"use strict";const{ObjectSetPrototypeOf:n,Symbol:i}=r(24134);e.exports=u;const{ERR_METHOD_NOT_IMPLEMENTED:a}=r(76371).codes,o=r(93370),{getHighWaterMark:s}=r(65291);n(u.prototype,o.prototype),n(u,o);const c=i("kCallback");function u(e){if(!(this instanceof u))return new u(e);const t=e?s(this,e,"readableHighWaterMark",!0):null;0===t&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),o.call(this,e),this._readableState.sync=!1,this[c]=null,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",d)}function l(e){"function"!=typeof this._flush||this.destroyed?(this.push(null),e&&e()):this._flush(((t,r)=>{t?e?e(t):this.destroy(t):(null!=r&&this.push(r),this.push(null),e&&e())}))}function d(){this._final!==l&&l.call(this)}u.prototype._final=l,u.prototype._transform=function(e,t,r){throw new a("_transform()")},u.prototype._write=function(e,t,r){const n=this._readableState,i=this._writableState,a=n.length;this._transform(e,t,((e,t)=>{e?r(e):(null!=t&&this.push(t),i.ended||a===n.length||n.length{"use strict";const{SymbolAsyncIterator:n,SymbolIterator:i,SymbolFor:a}=r(24134),o=a("nodejs.stream.destroyed"),s=a("nodejs.stream.errored"),c=a("nodejs.stream.readable"),u=a("nodejs.stream.writable"),l=a("nodejs.stream.disturbed"),d=a("nodejs.webstream.isClosedPromise"),p=a("nodejs.webstream.controllerErrorFunction");function h(e,t=!1){var r;return!(!e||"function"!=typeof e.pipe||"function"!=typeof e.on||t&&("function"!=typeof e.pause||"function"!=typeof e.resume)||e._writableState&&!1===(null===(r=e._readableState)||void 0===r?void 0:r.readable)||e._writableState&&!e._readableState)}function f(e){var t;return!(!e||"function"!=typeof e.write||"function"!=typeof e.on||e._readableState&&!1===(null===(t=e._writableState)||void 0===t?void 0:t.writable))}function y(e){return e&&(e._readableState||e._writableState||"function"==typeof e.write&&"function"==typeof e.on||"function"==typeof e.pipe&&"function"==typeof e.on)}function g(e){return!(!e||y(e)||"function"!=typeof e.pipeThrough||"function"!=typeof e.getReader||"function"!=typeof e.cancel)}function m(e){return!(!e||y(e)||"function"!=typeof e.getWriter||"function"!=typeof e.abort)}function b(e){return!(!e||y(e)||"object"!=typeof e.readable||"object"!=typeof e.writable)}function v(e){if(!y(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[o]||null!=n&&n.destroyed)}function _(e){if(!f(e))return null;if(!0===e.writableEnded)return!0;const t=e._writableState;return(null==t||!t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)}function w(e,t){if(!h(e))return null;const r=e._readableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.endEmitted)?null:!!(r.endEmitted||!1===t&&!0===r.ended&&0===r.length))}function O(e){return e&&null!=e[c]?e[c]:"boolean"!=typeof(null==e?void 0:e.readable)?null:!v(e)&&h(e)&&e.readable&&!w(e)}function T(e){return e&&null!=e[u]?e[u]:"boolean"!=typeof(null==e?void 0:e.writable)?null:!v(e)&&f(e)&&e.writable&&!_(e)}function S(e){return"boolean"==typeof e._closed&&"boolean"==typeof e._defaultKeepAlive&&"boolean"==typeof e._removedConnection&&"boolean"==typeof e._removedContLen}function E(e){return"boolean"==typeof e._sent100&&S(e)}e.exports={isDestroyed:v,kIsDestroyed:o,isDisturbed:function(e){var t;return!(!e||!(null!==(t=e[l])&&void 0!==t?t:e.readableDidRead||e.readableAborted))},kIsDisturbed:l,isErrored:function(e){var t,r,n,i,a,o,c,u,l,d;return!(!e||!(null!==(t=null!==(r=null!==(n=null!==(i=null!==(a=null!==(o=e[s])&&void 0!==o?o:e.readableErrored)&&void 0!==a?a:e.writableErrored)&&void 0!==i?i:null===(c=e._readableState)||void 0===c?void 0:c.errorEmitted)&&void 0!==n?n:null===(u=e._writableState)||void 0===u?void 0:u.errorEmitted)&&void 0!==r?r:null===(l=e._readableState)||void 0===l?void 0:l.errored)&&void 0!==t?t:null===(d=e._writableState)||void 0===d?void 0:d.errored))},kIsErrored:s,isReadable:O,kIsReadable:c,kIsClosedPromise:d,kControllerErrorFunction:p,kIsWritable:u,isClosed:function(e){if(!y(e))return null;if("boolean"==typeof e.closed)return e.closed;const t=e._writableState,r=e._readableState;return"boolean"==typeof(null==t?void 0:t.closed)||"boolean"==typeof(null==r?void 0:r.closed)?(null==t?void 0:t.closed)||(null==r?void 0:r.closed):"boolean"==typeof e._closed&&S(e)?e._closed:null},isDuplexNodeStream:function(e){return!(!e||"function"!=typeof e.pipe||!e._readableState||"function"!=typeof e.on||"function"!=typeof e.write)},isFinished:function(e,t){return y(e)?!(!v(e)&&(!1!==(null==t?void 0:t.readable)&&O(e)||!1!==(null==t?void 0:t.writable)&&T(e))):null},isIterable:function(e,t){return null!=e&&(!0===t?"function"==typeof e[n]:!1===t?"function"==typeof e[i]:"function"==typeof e[n]||"function"==typeof e[i])},isReadableNodeStream:h,isReadableStream:g,isReadableEnded:function(e){if(!h(e))return null;if(!0===e.readableEnded)return!0;const t=e._readableState;return!(!t||t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)},isReadableFinished:w,isReadableErrored:function(e){var t,r;return y(e)?e.readableErrored?e.readableErrored:null!==(t=null===(r=e._readableState)||void 0===r?void 0:r.errored)&&void 0!==t?t:null:null},isNodeStream:y,isWebStream:function(e){return g(e)||m(e)||b(e)},isWritable:T,isWritableNodeStream:f,isWritableStream:m,isWritableEnded:_,isWritableFinished:function(e,t){if(!f(e))return null;if(!0===e.writableFinished)return!0;const r=e._writableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.finished)?null:!!(r.finished||!1===t&&!0===r.ended&&0===r.length))},isWritableErrored:function(e){var t,r;return y(e)?e.writableErrored?e.writableErrored:null!==(t=null===(r=e._writableState)||void 0===r?void 0:r.errored)&&void 0!==t?t:null:null},isServerRequest:function(e){var t;return"boolean"==typeof e._consuming&&"boolean"==typeof e._dumped&&void 0===(null===(t=e.req)||void 0===t?void 0:t.upgradeOrConnect)},isServerResponse:E,willEmitClose:function(e){if(!y(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!n&&E(e)||!!(n&&n.autoDestroy&&n.emitClose&&!1===n.closed)},isTransformStream:b}},78584:(e,t,r)=>{const n=r(65606),{ArrayPrototypeSlice:i,Error:a,FunctionPrototypeSymbolHasInstance:o,ObjectDefineProperty:s,ObjectDefineProperties:c,ObjectSetPrototypeOf:u,StringPrototypeToLowerCase:l,Symbol:d,SymbolHasInstance:p}=r(24134);e.exports=F,F.WritableState=D;const{EventEmitter:h}=r(37007),f=r(94259).Stream,{Buffer:y}=r(48287),g=r(75896),{addAbortSignal:m}=r(4147),{getHighWaterMark:b,getDefaultHighWaterMark:v}=r(65291),{ERR_INVALID_ARG_TYPE:_,ERR_METHOD_NOT_IMPLEMENTED:w,ERR_MULTIPLE_CALLBACK:O,ERR_STREAM_CANNOT_PIPE:T,ERR_STREAM_DESTROYED:S,ERR_STREAM_ALREADY_FINISHED:E,ERR_STREAM_NULL_VALUES:x,ERR_STREAM_WRITE_AFTER_END:I,ERR_UNKNOWN_ENCODING:A}=r(76371).codes,{errorOrDestroy:j}=g;function N(){}u(F.prototype,f.prototype),u(F,f);const R=d("kOnFinished");function D(e,t,n){"boolean"!=typeof n&&(n=t instanceof r(93370)),this.objectMode=!(!e||!e.objectMode),n&&(this.objectMode=this.objectMode||!(!e||!e.writableObjectMode)),this.highWaterMark=e?b(this,e,"writableHighWaterMark",n):v(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const i=!(!e||!1!==e.decodeStrings);this.decodeStrings=!i,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=k.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,P(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||!1!==e.emitClose,this.autoDestroy=!e||!1!==e.autoDestroy,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[R]=[]}function P(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}function F(e){const t=this instanceof r(93370);if(!t&&!o(F,this))return new F(e);this._writableState=new D(e,this,t),e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&m(e.signal,this)),f.call(this,e),g.construct(this,(()=>{const e=this._writableState;e.writing||$(this,e),Q(this,e)}))}function C(e,t,r,i){const a=e._writableState;if("function"==typeof r)i=r,r=a.defaultEncoding;else{if(r){if("buffer"!==r&&!y.isEncoding(r))throw new A(r)}else r=a.defaultEncoding;"function"!=typeof i&&(i=N)}if(null===t)throw new x;if(!a.objectMode)if("string"==typeof t)!1!==a.decodeStrings&&(t=y.from(t,r),r="buffer");else if(t instanceof y)r="buffer";else{if(!f._isUint8Array(t))throw new _("chunk",["string","Buffer","Uint8Array"],t);t=f._uint8ArrayToBuffer(t),r="buffer"}let o;return a.ending?o=new I:a.destroyed&&(o=new S("write")),o?(n.nextTick(i,o),j(e,o,!0),o):(a.pendingcb++,function(e,t,r,n,i){const a=t.objectMode?1:r.length;t.length+=a;const o=t.lengthr.bufferedIndex&&$(e,r),i?null!==r.afterWriteTickInfo&&r.afterWriteTickInfo.cb===a?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:a,stream:e,state:r},n.nextTick(B,r.afterWriteTickInfo)):U(e,r,1,a))):j(e,new O)}function B({stream:e,state:t,count:r,cb:n}){return t.afterWriteTickInfo=null,U(e,t,r,n)}function U(e,t,r,n){for(!t.ending&&!e.destroyed&&0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));r-- >0;)t.pendingcb--,n();t.destroyed&&V(t),Q(e,t)}function V(e){if(e.writing)return;for(let r=e.bufferedIndex;r1&&e._writev){t.pendingcb-=o-1;const n=t.allNoop?N:e=>{for(let t=s;t256?(r.splice(0,s),t.bufferedIndex=0):t.bufferedIndex=s}t.bufferProcessing=!1}function q(e){return e.ending&&!e.destroyed&&e.constructed&&0===e.length&&!e.errored&&0===e.buffered.length&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function Q(e,t,r){q(t)&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.finalCalled=!0,function(e,t){let r=!1;function i(i){if(r)j(e,null!=i?i:O());else if(r=!0,t.pendingcb--,i){const r=t[R].splice(0);for(let e=0;e{q(t)?G(e,t):t.pendingcb--}),e,t)):q(t)&&(t.pendingcb++,G(e,t))))}function G(e,t){t.pendingcb--,t.finished=!0;const r=t[R].splice(0);for(let e=0;e{"use strict";const{ArrayIsArray:n,ArrayPrototypeIncludes:i,ArrayPrototypeJoin:a,ArrayPrototypeMap:o,NumberIsInteger:s,NumberIsNaN:c,NumberMAX_SAFE_INTEGER:u,NumberMIN_SAFE_INTEGER:l,NumberParseInt:d,ObjectPrototypeHasOwnProperty:p,RegExpPrototypeExec:h,String:f,StringPrototypeToUpperCase:y,StringPrototypeTrim:g}=r(24134),{hideStackFrames:m,codes:{ERR_SOCKET_BAD_PORT:b,ERR_INVALID_ARG_TYPE:v,ERR_INVALID_ARG_VALUE:_,ERR_OUT_OF_RANGE:w,ERR_UNKNOWN_SIGNAL:O}}=r(76371),{normalizeEncoding:T}=r(57760),{isAsyncFunction:S,isArrayBufferView:E}=r(57760).types,x={},I=/^[0-7]+$/,A=m(((e,t,r=l,n=u)=>{if("number"!=typeof e)throw new v(t,"number",e);if(!s(e))throw new w(t,"an integer",e);if(en)throw new w(t,`>= ${r} && <= ${n}`,e)})),j=m(((e,t,r=-2147483648,n=2147483647)=>{if("number"!=typeof e)throw new v(t,"number",e);if(!s(e))throw new w(t,"an integer",e);if(en)throw new w(t,`>= ${r} && <= ${n}`,e)})),N=m(((e,t,r=!1)=>{if("number"!=typeof e)throw new v(t,"number",e);if(!s(e))throw new w(t,"an integer",e);const n=r?1:0,i=4294967295;if(ei)throw new w(t,`>= ${n} && <= ${i}`,e)}));function R(e,t){if("string"!=typeof e)throw new v(t,"string",e)}const D=m(((e,t,r)=>{if(!i(r,e)){const n=a(o(r,(e=>"string"==typeof e?`'${e}'`:f(e))),", ");throw new _(t,e,"must be one of: "+n)}}));function P(e,t){if("boolean"!=typeof e)throw new v(t,"boolean",e)}function F(e,t,r){return null!=e&&p(e,t)?e[t]:r}const C=m(((e,t,r=null)=>{const i=F(r,"allowArray",!1),a=F(r,"allowFunction",!1);if(!F(r,"nullable",!1)&&null===e||!i&&n(e)||"object"!=typeof e&&(!a||"function"!=typeof e))throw new v(t,"Object",e)})),M=m(((e,t)=>{if(null!=e&&"object"!=typeof e&&"function"!=typeof e)throw new v(t,"a dictionary",e)})),L=m(((e,t,r=0)=>{if(!n(e))throw new v(t,"Array",e);if(e.length{if(!E(e))throw new v(t,["Buffer","TypedArray","DataView"],e)})),B=m(((e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new v(t,"AbortSignal",e)})),U=m(((e,t)=>{if("function"!=typeof e)throw new v(t,"Function",e)})),V=m(((e,t)=>{if("function"!=typeof e||S(e))throw new v(t,"Function",e)})),$=m(((e,t)=>{if(void 0!==e)throw new v(t,"undefined",e)})),q=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Q(e,t){if(void 0===e||!h(q,e))throw new _(t,e,'must be an array or string of format "; rel=preload; as=style"')}e.exports={isInt32:function(e){return e===(0|e)},isUint32:function(e){return e===e>>>0},parseFileMode:function(e,t,r){if(void 0===e&&(e=r),"string"==typeof e){if(null===h(I,e))throw new _(t,e,"must be a 32-bit unsigned integer or an octal string");e=d(e,8)}return N(e,t),e},validateArray:L,validateStringArray:function(e,t){L(e,t);for(let r=0;rn||(null!=r||null!=n)&&c(e))throw new w(t,`${null!=r?`>= ${r}`:""}${null!=r&&null!=n?" && ":""}${null!=n?`<= ${n}`:""}`,e)},validateObject:C,validateOneOf:D,validatePlainFunction:V,validatePort:function(e,t="Port",r=!0){if("number"!=typeof e&&"string"!=typeof e||"string"==typeof e&&0===g(e).length||+e!=+e>>>0||e>65535||0===e&&!r)throw new b(t,e,r);return 0|e},validateSignalName:function(e,t="signal"){if(R(e,t),void 0===x[e]){if(void 0!==x[y(e)])throw new O(e+" (signals must use all capital letters)");throw new O(e)}},validateString:R,validateUint32:N,validateUndefined:$,validateUnion:function(e,t,r){if(!i(r,e))throw new v(t,`('${a(r,"|")}')`,e)},validateAbortSignal:B,validateLinkHeaderValue:function(e){if("string"==typeof e)return Q(e,"hints"),e;if(n(e)){const t=e.length;let r="";if(0===t)return r;for(let n=0;n; rel=preload; as=style"')}}},19198:(e,t,r)=>{"use strict";const n=r(63125),i=r(43095),a=n.Readable.destroy;e.exports=n.Readable,e.exports._uint8ArrayToBuffer=n._uint8ArrayToBuffer,e.exports._isUint8Array=n._isUint8Array,e.exports.isDisturbed=n.isDisturbed,e.exports.isErrored=n.isErrored,e.exports.isReadable=n.isReadable,e.exports.Readable=n.Readable,e.exports.Writable=n.Writable,e.exports.Duplex=n.Duplex,e.exports.Transform=n.Transform,e.exports.PassThrough=n.PassThrough,e.exports.addAbortSignal=n.addAbortSignal,e.exports.finished=n.finished,e.exports.destroy=n.destroy,e.exports.destroy=a,e.exports.pipeline=n.pipeline,e.exports.compose=n.compose,Object.defineProperty(n,"promises",{configurable:!0,enumerable:!0,get:()=>i}),e.exports.Stream=n.Stream,e.exports.default=e.exports},76371:(e,t,r)=>{"use strict";const{format:n,inspect:i,AggregateError:a}=r(57760),o=globalThis.AggregateError||a,s=Symbol("kIsNodeError"),c=["string","function","number","object","Function","Object","boolean","bigint","symbol"],u=/^([A-Z][a-z0-9]*)+$/,l={};function d(e,t){if(!e)throw new l.ERR_INTERNAL_ASSERTION(t)}function p(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function h(e,t,r){r||(r=Error);class i extends r{constructor(...r){super(function(e,t,r){if("function"==typeof t)return d(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);const i=(t.match(/%[dfijoOs]/g)||[]).length;return d(i===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${i}).`),0===r.length?t:n(t,...r)}(e,t,r))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(i.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=e,i.prototype[s]=!0,l[e]=i}function f(e){const t="__node_internal_"+e.name;return Object.defineProperty(e,"name",{value:t}),e}class y extends Error{constructor(e="The operation was aborted",t=void 0){if(void 0!==t&&"object"!=typeof t)throw new l.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}}h("ERR_ASSERTION","%s",Error),h("ERR_INVALID_ARG_TYPE",((e,t,r)=>{d("string"==typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";e.endsWith(" argument")?n+=`${e} `:n+=`"${e}" ${e.includes(".")?"property":"argument"} `,n+="must be ";const a=[],o=[],s=[];for(const e of t)d("string"==typeof e,"All expected entries have to be of type string"),c.includes(e)?a.push(e.toLowerCase()):u.test(e)?o.push(e):(d("object"!==e,'The value "object" should be written as "Object"'),s.push(e));if(o.length>0){const e=a.indexOf("object");-1!==e&&(a.splice(a,e,1),o.push("Object"))}if(a.length>0){switch(a.length){case 1:n+=`of type ${a[0]}`;break;case 2:n+=`one of type ${a[0]} or ${a[1]}`;break;default:{const e=a.pop();n+=`one of type ${a.join(", ")}, or ${e}`}}(o.length>0||s.length>0)&&(n+=" or ")}if(o.length>0){switch(o.length){case 1:n+=`an instance of ${o[0]}`;break;case 2:n+=`an instance of ${o[0]} or ${o[1]}`;break;default:{const e=o.pop();n+=`an instance of ${o.join(", ")}, or ${e}`}}s.length>0&&(n+=" or ")}switch(s.length){case 0:break;case 1:s[0].toLowerCase()!==s[0]&&(n+="an "),n+=`${s[0]}`;break;case 2:n+=`one of ${s[0]} or ${s[1]}`;break;default:{const e=s.pop();n+=`one of ${s.join(", ")}, or ${e}`}}if(null==r)n+=`. Received ${r}`;else if("function"==typeof r&&r.name)n+=`. Received function ${r.name}`;else if("object"==typeof r){var l;null!==(l=r.constructor)&&void 0!==l&&l.name?n+=`. Received an instance of ${r.constructor.name}`:n+=`. Received ${i(r,{depth:-1})}`}else{let e=i(r,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),n+=`. Received type ${typeof r} (${e})`}return n}),TypeError),h("ERR_INVALID_ARG_VALUE",((e,t,r="is invalid")=>{let n=i(t);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${n}`}),TypeError),h("ERR_INVALID_RETURN_VALUE",((e,t,r)=>{var n;return`Expected ${e} to be returned from the "${t}" function but got ${null!=r&&null!==(n=r.constructor)&&void 0!==n&&n.name?`instance of ${r.constructor.name}`:"type "+typeof r}.`}),TypeError),h("ERR_MISSING_ARGS",((...e)=>{let t;d(e.length>0,"At least one arg needs to be specified");const r=e.length;switch(e=(Array.isArray(e)?e:[e]).map((e=>`"${e}"`)).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{const r=e.pop();t+=`The ${e.join(", ")}, and ${r} arguments`}}return`${t} must be specified`}),TypeError),h("ERR_OUT_OF_RANGE",((e,t,r)=>{let n;return d(t,'Missing "range" argument'),Number.isInteger(r)&&Math.abs(r)>2**32?n=p(String(r)):"bigint"==typeof r?(n=String(r),(r>2n**32n||r<-(2n**32n))&&(n=p(n)),n+="n"):n=i(r),`The value of "${e}" is out of range. It must be ${t}. Received ${n}`}),RangeError),h("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),h("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),h("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),h("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),h("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),h("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),h("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),h("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),h("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),h("ERR_STREAM_WRITE_AFTER_END","write after end",Error),h("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),e.exports={AbortError:y,aggregateTwoErrors:f((function(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;const r=new o([t,e],t.message);return r.code=t.code,r}return e||t})),hideStackFrames:f,codes:l}},24134:e=>{"use strict";e.exports={ArrayIsArray:e=>Array.isArray(e),ArrayPrototypeIncludes:(e,t)=>e.includes(t),ArrayPrototypeIndexOf:(e,t)=>e.indexOf(t),ArrayPrototypeJoin:(e,t)=>e.join(t),ArrayPrototypeMap:(e,t)=>e.map(t),ArrayPrototypePop:(e,t)=>e.pop(t),ArrayPrototypePush:(e,t)=>e.push(t),ArrayPrototypeSlice:(e,t,r)=>e.slice(t,r),Error,FunctionPrototypeCall:(e,t,...r)=>e.call(t,...r),FunctionPrototypeSymbolHasInstance:(e,t)=>Function.prototype[Symbol.hasInstance].call(e,t),MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:(e,t)=>Object.defineProperties(e,t),ObjectDefineProperty:(e,t,r)=>Object.defineProperty(e,t,r),ObjectGetOwnPropertyDescriptor:(e,t)=>Object.getOwnPropertyDescriptor(e,t),ObjectKeys:e=>Object.keys(e),ObjectSetPrototypeOf:(e,t)=>Object.setPrototypeOf(e,t),Promise,PromisePrototypeCatch:(e,t)=>e.catch(t),PromisePrototypeThen:(e,t,r)=>e.then(t,r),PromiseReject:e=>Promise.reject(e),PromiseResolve:e=>Promise.resolve(e),ReflectApply:Reflect.apply,RegExpPrototypeTest:(e,t)=>e.test(t),SafeSet:Set,String,StringPrototypeSlice:(e,t,r)=>e.slice(t,r),StringPrototypeToLowerCase:e=>e.toLowerCase(),StringPrototypeToUpperCase:e=>e.toUpperCase(),StringPrototypeTrim:e=>e.trim(),Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet:(e,t,r)=>e.set(t,r),Boolean,Uint8Array}},57760:(e,t,r)=>{"use strict";const n=r(48287),{kResistStopPropagation:i,SymbolDispose:a}=r(24134),o=globalThis.AbortSignal||r(25568).AbortSignal,s=globalThis.AbortController||r(25568).AbortController,c=Object.getPrototypeOf((async function(){})).constructor,u=globalThis.Blob||n.Blob,l=void 0!==u?function(e){return e instanceof u}:function(e){return!1},d=(e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new ERR_INVALID_ARG_TYPE(t,"AbortSignal",e)};class p extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError("Expected input to be an Array, got "+typeof e);let t="";for(let r=0;r{e=r,t=n})),resolve:e,reject:t}},promisify:e=>new Promise(((t,r)=>{e(((e,...n)=>e?r(e):t(...n)))})),debuglog:()=>function(){},format:(e,...t)=>e.replace(/%([sdifj])/g,(function(...[e,r]){const n=t.shift();return"f"===r?n.toFixed(6):"j"===r?JSON.stringify(n):"s"===r&&"object"==typeof n?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()})),inspect(e){switch(typeof e){case"string":if(e.includes("'")){if(!e.includes('"'))return`"${e}"`;if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}},types:{isAsyncFunction:e=>e instanceof c,isArrayBufferView:e=>ArrayBuffer.isView(e)},isBlob:l,deprecate:(e,t)=>e,addAbortListener:r(37007).addAbortListener||function(e,t){if(void 0===e)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);let r;return d(e,"signal"),(e=>{if("function"!=typeof e)throw new ERR_INVALID_ARG_TYPE("listener","Function",e)})(t),e.aborted?queueMicrotask((()=>t())):(e.addEventListener("abort",t,{__proto__:null,once:!0,[i]:!0}),r=()=>{e.removeEventListener("abort",t)}),{__proto__:null,[a](){var e;null===(e=r)||void 0===e||e()}}},AbortSignalAny:o.any||function(e){if(1===e.length)return e[0];const t=new s,r=()=>t.abort();return e.forEach((e=>{d(e,"signals"),e.addEventListener("abort",r,{once:!0})})),t.signal.addEventListener("abort",(()=>{e.forEach((e=>e.removeEventListener("abort",r)))}),{once:!0}),t.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},63125:(e,t,r)=>{const{Buffer:n}=r(48287),{ObjectDefineProperty:i,ObjectKeys:a,ReflectApply:o}=r(24134),{promisify:{custom:s}}=r(57760),{streamReturningOperators:c,promiseReturningOperators:u}=r(60823),{codes:{ERR_ILLEGAL_CONSTRUCTOR:l}}=r(76371),d=r(47830),{setDefaultHighWaterMark:p,getDefaultHighWaterMark:h}=r(65291),{pipeline:f}=r(57758),{destroyer:y}=r(75896),g=r(86238),m=r(43095),b=r(16115),v=e.exports=r(94259).Stream;v.isDestroyed=b.isDestroyed,v.isDisturbed=b.isDisturbed,v.isErrored=b.isErrored,v.isReadable=b.isReadable,v.isWritable=b.isWritable,v.Readable=r(57576);for(const O of a(c)){const T=c[O];function _(...e){if(new.target)throw l();return v.Readable.from(o(T,this,e))}i(_,"name",{__proto__:null,value:T.name}),i(_,"length",{__proto__:null,value:T.length}),i(v.Readable.prototype,O,{__proto__:null,value:_,enumerable:!1,configurable:!0,writable:!0})}for(const S of a(u)){const E=u[S];function _(...e){if(new.target)throw l();return o(E,this,e)}i(_,"name",{__proto__:null,value:E.name}),i(_,"length",{__proto__:null,value:E.length}),i(v.Readable.prototype,S,{__proto__:null,value:_,enumerable:!1,configurable:!0,writable:!0})}v.Writable=r(78584),v.Duplex=r(93370),v.Transform=r(17382),v.PassThrough=r(86524),v.pipeline=f;const{addAbortSignal:w}=r(4147);v.addAbortSignal=w,v.finished=g,v.destroy=y,v.compose=d,v.setDefaultHighWaterMark=p,v.getDefaultHighWaterMark=h,i(v,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>m}),i(f,s,{__proto__:null,enumerable:!0,get:()=>m.pipeline}),i(g,s,{__proto__:null,enumerable:!0,get:()=>m.finished}),v.Stream=v,v._isUint8Array=function(e){return e instanceof Uint8Array},v._uint8ArrayToBuffer=function(e){return n.from(e.buffer,e.byteOffset,e.byteLength)}},43095:(e,t,r)=>{"use strict";const{ArrayPrototypePop:n,Promise:i}=r(24134),{isIterable:a,isNodeStream:o,isWebStream:s}=r(16115),{pipelineImpl:c}=r(57758),{finished:u}=r(86238);r(63125),e.exports={finished:u,pipeline:function(...e){return new i(((t,r)=>{let i,u;const l=e[e.length-1];if(l&&"object"==typeof l&&!o(l)&&!a(l)&&!s(l)){const t=n(e);i=t.signal,u=t.end}c(e,((e,n)=>{e?r(e):t(n)}),{signal:i,end:u})}))}}},70742:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(24806),t)},24806:(e,t)=>{"use strict";function r(e){const t=[];let r=0;for(;re.join(""))).join("/")}function n(e,t){let n=t+1;t>=0?"/"===e[t+1]&&"/"===e[t+2]&&(n=t+3):"/"===e[0]&&"/"===e[1]&&(n=2);const i=e.indexOf("/",n);return i<0?e:e.substr(0,i)+r(e.substr(i))}function i(e){return!e||"#"===e||"?"===e||"/"===e}Object.defineProperty(t,"__esModule",{value:!0}),t.removeDotSegmentsOfPath=t.removeDotSegments=t.resolve=void 0,t.resolve=function(e,t){const i=(t=t||"").indexOf("#");if(i>0&&(t=t.substr(0,i)),!e.length){if(t.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${t}' for value '${e}'`);return t}if(e.startsWith("?")){const r=t.indexOf("?");return r>0&&(t=t.substr(0,r)),t+e}if(e.startsWith("#"))return t+e;if(!t.length){const t=e.indexOf(":");if(t<0)throw new Error(`Found invalid relative IRI '${e}' for a missing baseIRI`);return n(e,t)}const a=e.indexOf(":");if(a>=0)return n(e,a);const o=t.indexOf(":");if(o<0)throw new Error(`Found invalid baseIRI '${t}' for value '${e}'`);const s=t.substr(0,o+1);if(0===e.indexOf("//"))return s+n(e,a);let c;if(t.indexOf("//",o)===o+1){if(c=t.indexOf("/",o+3),c<0)return t.length>o+3?t+"/"+n(e,a):s+n(e,a)}else if(c=t.indexOf("/",o+1),c<0)return s+n(e,a);if(0===e.indexOf("/"))return t.substr(0,c)+r(e);let u=t.substr(c);const l=u.lastIndexOf("/");return l>=0&&l{var n=r(48287),i=n.Buffer;function a(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(a(n,t),t.Buffer=o),o.prototype=Object.create(i.prototype),a(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},42791:function(e,t,r){!function(e){"use strict";if(!e.setImmediate){var t,r,n,i,a,o=1,s={},c=!1,u=e.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(e);l=l&&l.setTimeout?l:e,"[object process]"==={}.toString.call(e.process)?t=function(e){process.nextTick((function(){p(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(i="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(i)&&p(+t.data.slice(i.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),t=function(t){e.postMessage(i+t,"*")}):e.MessageChannel?((n=new MessageChannel).port1.onmessage=function(e){p(e.data)},t=function(e){n.port2.postMessage(e)}):u&&"onreadystatechange"in u.createElement("script")?(r=u.documentElement,t=function(e){var t=u.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):t=function(e){setTimeout(p,0,e)},l.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var r=new Array(arguments.length-1),n=0;n(0,o.uriToPrefix)(e,{fetch:this.fetch,mintOnUnknown:!0,existingPrefixes:t}).then((r=>{this.prefixes[r]=e,t[r]=e,this.prefixRev[e]=r})))))}const t=new Set([...this.store.getSubjects(null,null,null),...this.store.getPredicates(null,null,null),...this.store.getObjects(null,null,null)].filter((e=>"NamedNode"===e.termType)).map((e=>p(e.value))).filter((e=>"string"==typeof e)));for(const e in this.prefixRev)t.has(e)||(delete this.prefixes[this.prefixRev[e]],delete this.prefixRev[e]);if(yield this.writePrefixes(),this.prefixes=Object.assign(Object.assign({},this.prefixes),f),this.prefixRev=Object.assign(Object.assign({},this.prefixRev),h),this.writer.newLine(),yield this.writeShapes(),this.extendedSyntax){const e=this.store.getSubjects(null,null,null);e.length>0&&this.writer.newLine(1);for(const t of e)this.writer.add(yield this.termToString(t,!0,!0)),this.writer.add(" "),this.writer.indent(),yield this.writeTurtlePredicates(t),this.writer.deindent();e.length>0&&(this.writer.add(" ."),this.writer.newLine())}if(this.errorOnExtraQuads&&this.store.size>0)throw new Error(`Dataset contains quads that cannot be written in SHACLC [\n${new a.Writer({prefixes:this.prefixes}).quadsToString(this.store.getQuads(null,null,null,null))}]`);this.writer.end()}))}writeImports(e){return n(this,void 0,void 0,(function*(){const t=this.store.getObjectsOnce(e,new a.NamedNode("http://www.w3.org/2002/07/owl#imports"),null);if(t.length>0)for(const e of t)this.writer.add(`IMPORTS <${e.value}>`,!0)}))}writePrefixes(){return n(this,void 0,void 0,(function*(){const e=Object.keys(this.prefixes).filter((e=>!(e in l.default))).sort();if(e.length>0)for(const t of e)this.writer.add(`PREFIX ${t}: <${this.prefixes[t]}>`,!0)}))}termToString(e,t=!1,r=!1){return n(this,void 0,void 0,(function*(){try{if(t)throw new Error("Shacl name disabled");return(0,c.getShaclName)(e)}catch(e){}if("NamedNode"===e.termType){const t=p(e.value);return t&&t in this.prefixRev&&t in this.prefixRev?`${this.prefixRev[t]}:${e.value.slice(t.length)}`:(0,s.termToString)(e)}if("Literal"===e.termType)return"http://www.w3.org/2001/XMLSchema#integer"===e.datatypeString||"http://www.w3.org/2001/XMLSchema#boolean"===e.datatypeString?e.value:(0,s.termToString)(e);throw"BlankNode"===e.termType&&r&&(0,s.termToString)(e),new Error(`Invalid term type for extra statement ${e.value} (${e.termType})`)}))}writeShapes(){return n(this,void 0,void 0,(function*(){for(const e of this.store.getSubjectsOnce(new a.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),new a.NamedNode("http://www.w3.org/ns/shacl#NodeShape"),null)){this.store.getQuadsOnce(e,new a.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),new a.NamedNode("http://www.w3.org/2000/01/rdf-schema#Class"),null).length>0?this.writer.add("shapeClass "):this.writer.add("shape "),this.writer.add(yield this.termToString(e)),this.writer.add(" ");const t=this.store.getObjectsOnce(e,new a.NamedNode("http://www.w3.org/ns/shacl#targetClass"),null);if(t.length>0){this.writer.add("-> ");for(const e of t)"NamedNode"===e.termType?this.writer.add(yield this.termToString(e)):(this.writer.add("!"),this.writer.add(yield this.termToString(this.singleObject(e,new a.NamedNode("http://www.w3.org/ns/shacl#not"),!0)))),this.writer.add(" ")}const r=this.store.getPredicates(e,null,null).filter((e=>[new a.NamedNode("http://www.w3.org/ns/shacl#targetClass"),new a.NamedNode("http://www.w3.org/ns/shacl#property"),new a.NamedNode("http://www.w3.org/ns/shacl#or"),...Object.keys(d.default).map((e=>new a.NamedNode("http://www.w3.org/ns/shacl#"+e)))].every((t=>!e.equals(t)))));r.length>0&&(this.writer.add(";"),this.writer.indent(),this.writer.newLine(1)),this.extendedSyntax&&(yield this.writeGivenTurtlePredicates(e,r)),r.length>0&&(this.writer.add(" "),this.writer.deindent()),yield this.writeShapeBody(e,!1)}}))}getSingleProperty(e,t){let r=[e];try{let n=(0,c.getShaclName)(e.predicate),i="pred";if("not"===n){const t=this.store.getQuadsOnce(e.object,null,null,null);if(r=r.concat(t),1!==t.length)throw new Error("Can only handle having one predicate of 'not'");[e]=t,n=(0,c.getShaclName)(e.predicate),i="not"}if(!(n in t))throw new Error(`${n} is not allowed`);return{name:n,type:i,object:e.object}}catch(e){this.store.addQuads(r)}}singleLayerPropertiesList(e,t){const r=[];for(const n of this.store.getQuadsOnce(e,null,null,null)){const e=this.getSingleProperty(n,t);e&&r.push(e)}return r}expectOneProperty(e,t){const r=this.store.getQuadsOnce(e,null,null,null);if(1===r.length){const e=this.getSingleProperty(r[0],t);if(e)return e}this.store.addQuads(r)}orProperties(e,t){const r=[];for(const n of this.store.getQuadsOnce(e,new a.NamedNode("http://www.w3.org/ns/shacl#or"),null,null)){const e=[];for(const r of this.getList(n.object)){const i=this.expectOneProperty(r,t);if(!i)throw this.store.addQuad(n),new Error("Each entry of the 'or' statement must declare exactly one property");e.push(i)}r.push(e)}return r}getList(e){let t=e;const r=[];for(;!t.equals(new a.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"));)r.push(this.singleObject(t,new a.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#first"),!0)),t=this.singleObject(t,new a.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"),!0);return r}writeIriLiteralOrArray(e){return n(this,void 0,void 0,(function*(){if("BlankNode"===e.termType){this.writer.add("[");let t=!0;for(const r of this.getList(e))t?t=!1:this.writer.add(" "),this.writer.add(yield this.termToString(r));this.writer.add("]")}else this.writer.add(yield this.termToString(e))}))}singleObject(e,t,r){var n;return null===(n=this.singleQuad(e,t,r))||void 0===n?void 0:n.object}singleQuad(e,t,r=!1){const n=this.store.getQuadsOnce(e,t,null,null);if(r&&1!==n.length)throw this.store.addQuads(n),new Error(`The subject and predicate ${null==e?void 0:e.value} ${null==t?void 0:t.value} must have exactly one object. Instead has ${n.length}`);if(n.length>1)throw this.store.addQuads(n),new Error(`The subject and predicate ${null==e?void 0:e.value} ${null==t?void 0:t.value} can have at most one object. Instead has ${n.length}`);return 1===n.length?n[0]:void 0}writeAssigment({name:e,type:t,object:r}){return n(this,void 0,void 0,(function*(){"not"===t&&this.writer.add("!"),this.writer.add(e),this.writer.add("="),yield this.writeIriLiteralOrArray(r)}))}writeAtom({name:e,type:t,object:r}){return n(this,void 0,void 0,(function*(){switch("not"===t&&this.writer.add("!"),e){case"node":if("NamedNode"===r.termType)this.writer.add(`@${yield this.termToString(r)}`);else{if("BlankNode"!==r.termType)throw new Error("Invalid nested shape, must be blank node or IRI");yield this.writeShapeBody(r)}return;case"nodeKind":return void this.writer.add((0,c.getShaclName)(r));case"class":case"datatype":return void this.writer.add(yield this.termToString(r));default:this.writer.add(e),this.writer.add("="),yield this.writeIriLiteralOrArray(r)}}))}writeAssigments(e,t=" ",r=!0,i){return n(this,void 0,void 0,(function*(){for(const n of e)r?r=!1:this.writer.add(t),i?yield this.writeAtom(n):yield this.writeAssigment(n)}))}writeParams(e,t=!0,r,i=!1,a=!1){return n(this,void 0,void 0,(function*(){const n=this.orProperties(e,r),o=this.singleLayerPropertiesList(e,r);a&&(n.length>0||o.length>0)&&this.writer.newLine(1);for(const e of n)t?t=!1:this.writer.add(" "),yield this.writeAssigments(e,"|",!0,i);yield this.writeAssigments(o," ",t,i),a&&(n.length>0||o.length>0)&&this.writer.add(" .")}))}writeShapeBody(e,t=!0){return n(this,void 0,void 0,(function*(){this.writer.add("{").indent();const r=this.store.getObjectsOnce(e,new a.NamedNode("http://www.w3.org/ns/shacl#property"),null);yield this.writeParams(e,!0,d.default,!1,!0);for(const e of r)this.writer.newLine(1),yield this.writeProperty(e);this.writer.deindent().newLine(1),t?this.writer.add("} ."):this.writer.add("}").newLine(1)}))}writeProperty(e){return n(this,void 0,void 0,(function*(){yield this.writePath(this.singleObject(e,new a.NamedNode("http://www.w3.org/ns/shacl#path"),!0));const t=this.singleObject(e,new a.NamedNode("http://www.w3.org/ns/shacl#minCount")),r=this.singleObject(e,new a.NamedNode("http://www.w3.org/ns/shacl#maxCount")),n=this.singleObject(e,new a.NamedNode("http://www.w3.org/ns/shacl#nodeKind")),i=this.singleObject(e,new a.NamedNode("http://www.w3.org/ns/shacl#class")),o=this.singleObject(e,new a.NamedNode("http://www.w3.org/ns/shacl#datatype")),s=this.store.getObjectsOnce(e,new a.NamedNode("http://www.w3.org/ns/shacl#node"),null);if(n&&(this.writer.add(" "),this.writer.add((0,c.getShaclName)(n))),i&&(this.writer.add(" "),this.writer.add(yield this.termToString(i))),o&&(this.writer.add(" "),this.writer.add(yield this.termToString(o))),void 0!==t||void 0!==r){if(this.writer.add(" ["),t){if("Literal"!==t.termType||"http://www.w3.org/2001/XMLSchema#integer"!==t.datatypeString)throw new Error("Invalid min value, must me an integer literal");this.writer.add(t.value)}else this.writer.add("0");if(this.writer.add(".."),r){if("Literal"!==r.termType||"http://www.w3.org/2001/XMLSchema#integer"!==r.datatypeString)throw new Error("Invalid max value, must me an integer literal");this.store.removeMatches(e,new a.NamedNode("http://www.w3.org/ns/shacl#maxCount"),void 0,void 0),this.writer.add(r.value)}else this.writer.add("*");this.writer.add("]")}yield this.writeParams(e,!1,u.default,!0);const l=[];for(const e of s)if("NamedNode"===e.termType)this.writer.add(" "),this.writer.add(`@${yield this.termToString(e)}`);else{if("BlankNode"!==e.termType)throw new Error("Invalid nested shape, must be blank node or IRI");l.push(e)}for(const e of l)this.writer.add(" "),yield this.writeShapeBody(e);this.extendedSyntax&&this.store.getQuads(e,null,null,null).length>0&&(this.writer.add(" %"),this.writer.indent(),this.writer.newLine(1),yield this.writeTurtlePredicates(e),this.writer.deindent(),this.writer.newLine(1),this.writer.add("%")),0===l.length&&this.writer.add(" .")}))}writeTurtlePredicates(e){return n(this,void 0,void 0,(function*(){return this.writeGivenTurtlePredicates(e,this.store.getPredicates(e,null,null))}))}writeGivenTurtlePredicates(e,t){return n(this,void 0,void 0,(function*(){let r=!1;if(t.some((e=>e.equals(a.DataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"))))){const t=this.store.getObjectsOnce(e,a.DataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),null);t.length>0&&(r=!0,this.writer.add("a "),yield this.writeTurtleObjects(t))}for(const n of t)n.equals(a.DataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"))||(r?(this.writer.add(" ;"),this.writer.newLine(1)):r=!0,this.writer.add(yield this.termToString(n,!0)),this.writer.add(" "),yield this.writeTurtleObjects(this.store.getObjectsOnce(e,n,null)))}))}writeTurtleObjects(e){return n(this,void 0,void 0,(function*(){const t=[],r=[];for(const n of e)"BlankNode"===n.termType&&0===[...this.store.match(null,null,n),...this.store.match(null,n,null)].length?t.push(n):r.push(n);this.writer.add((yield Promise.all(r.map((e=>this.termToString(e,!0,!0))))).join(", "));let n=r.length>0;if(t.length>0)for(const e of t)n?this.writer.add(", "):n=!0,(yield this.writeList(e))||(this.writer.add("["),this.writer.indent(),this.writer.newLine(1),yield this.writeTurtlePredicates(e),this.writer.deindent(),this.writer.newLine(1),this.writer.add("]"))}))}writeList(e){return n(this,void 0,void 0,(function*(){let t=e;const r=[],n=[];for(;!t.equals(a.DataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"));){const e=this.store.getQuadsOnce(t,a.DataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#first"),null,null),i=this.store.getQuadsOnce(t,a.DataFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"),null,null);if(n.push(...e,...i),1!==e.length||1!==i.length||0!==this.store.getQuads(t,null,null,null).length)return this.store.addQuads(n),!1;r.push(e[0].object),t=i[0].object}let i=!1;this.writer.add("(");for(const e of r)i?this.writer.add(" "):i=!0,yield this.writeTurtleObjects([e]);return this.writer.add(")"),!0}))}writePath(e,t=!1){return n(this,void 0,void 0,(function*(){if("NamedNode"===e.termType)this.writer.add(yield this.termToString(e));else{if("BlankNode"!==e.termType)throw new Error("Path should be named node or blank node");{const r=this.store.getQuadsOnce(e,null,null,null);if(1===r.length){const{predicate:n,object:i}=r[0];switch(n.value){case"http://www.w3.org/ns/shacl#inversePath":return this.writer.add("^"),void(yield this.writePath(i,!0));case"http://www.w3.org/ns/shacl#alternativePath":{const e=this.getList(i);if(0===e.length)throw new Error("Invalid Alternative Path - no options");if(1===e.length)yield this.writePath(e[0]);else{t&&this.writer.add("(");let r=!0;for(const t of e)r?r=!1:this.writer.add("|"),yield this.writePath(t,!0);t&&this.writer.add(")")}return}case"http://www.w3.org/ns/shacl#zeroOrMorePath":return yield this.writePath(i,!0),void this.writer.add("*");case"http://www.w3.org/ns/shacl#oneOrMorePath":return yield this.writePath(i,!0),void this.writer.add("+");case"http://www.w3.org/ns/shacl#zeroOrOnePath":return yield this.writePath(i,!0),void this.writer.add("?");default:throw new Error(`Invalid path type ${e.value}`)}}else{this.store.addQuads(r);const n=this.getList(e);if(0===n.length)throw new Error("Invalid Path");{t&&this.writer.add("(");let e=!0;for(const t of n)e?e=!1:this.writer.add("/"),yield this.writePath(t,!0);t&&this.writer.add(")")}}}}}))}}},28630:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={owl:"http://www.w3.org/2002/07/owl#",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",sh:"http://www.w3.org/ns/shacl#",xsd:"http://www.w3.org/2001/XMLSchema#"}},94174:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.write=void 0;const a=r(82773),o=i(r(55977)),s=i(r(51167)),c=i(r(18996));t.write=function(e,t){return n(this,void 0,void 0,(function*(){return new Promise(((r,i)=>n(this,void 0,void 0,(function*(){try{let n="";const i=new c.default(e),u=i.getGraphs(null,null,null);if(u.length>1)throw new Error("More than one graph found - can serialize in the default graph");if(1===u.length&&!u[0].equals(a.DataFactory.defaultGraph()))throw new Error(`Expected all triples to be in the default graph, instead triples were in ${u[0].value}`);const l=new s.default({write:e=>{n+=e},end:()=>{let e=i.getQuads(null,null,null,null);0===e.length&&(e=void 0),r({text:n,extraQuads:e})}}),d=new o.default(i,l,null==t?void 0:t.prefixes,void 0,!1!==(null==t?void 0:t.errorOnUnused),null==t?void 0:t.mintPrefixes,null==t?void 0:t.fetch,null==t?void 0:t.extendedSyntax);yield d.write()}catch(e){i(e)}}))))}))}},76588:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={targetNode:!0,targetObjectsOf:!0,targetSubjectsOf:!0,deactivated:!0,severity:!0,message:!0,class:!0,datatype:!0,nodeKind:!0,minExclusive:!0,minInclusive:!0,maxExclusive:!0,maxInclusive:!0,minLength:!0,maxLength:!0,pattern:!0,flags:!0,languageIn:!0,equals:!0,disjoint:!0,closed:!0,ignoredProperties:!0,hasValue:!0,in:!0}},11501:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={deactivated:!0,severity:!0,message:!0,class:!0,datatype:!0,nodeKind:!0,minExclusive:!0,minInclusive:!0,maxExclusive:!0,maxInclusive:!0,minLength:!0,maxLength:!0,pattern:!0,flags:!0,languageIn:!0,uniqueLang:!0,equals:!0,disjoint:!0,lessThan:!0,lessThanOrEquals:!0,qualifiedValueShape:!0,qualifiedMinCount:!0,qualifiedMaxCount:!0,qualifiedValueShapesDisjoint:!0,closed:!0,ignoredProperties:!0,hasValue:!0,in:!0,node:!0}},73423:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getShaclName=void 0,t.getShaclName=function(e){if("NamedNode"!==e.termType||!e.value.startsWith("http://www.w3.org/ns/shacl#"))throw new Error(`Term ${e.value} is not part of the SHACL namespace`);return e.value.slice(27)}},18996:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(82773);class i extends n.Store{getQuadsOnce(e,t,r,n){const i=this.getQuads(e,t,r,n);return this.removeQuads(i),i}getSubjectsOnce(e,t,r){return this.getQuadsOnce(null,e,t,r).map((e=>e.subject))}getObjectsOnce(e,t,r){return this.getQuadsOnce(e,t,null,r).map((e=>e.object))}}t.default=i},51167:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(e){this.indents=0,this.write=e.write,this.end=e.end}indent(){return this.indents+=1,this}deindent(){if(this.indents<1)throw new Error(`Trying to deindent when indent is only ${this.indents}`);return this.indents-=1,this}add(e,t=!1){return this.write(t?`\n${"\t".repeat(this.indents)}${e}`:e,"utf-8"),this}newLine(e=2){return this.write("\n".repeat(e)+"\t".repeat(this.indents),"utf-8"),this}}},75735:e=>{e.exports=function(){"use strict";var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function t(e,t){var r=e[0],n=e[1],i=e[2],a=e[3];n=((n+=((i=((i+=((a=((a+=((r=((r+=(n&i|~n&a)+t[0]-680876936|0)<<7|r>>>25)+n|0)&n|~r&i)+t[1]-389564586|0)<<12|a>>>20)+r|0)&r|~a&n)+t[2]+606105819|0)<<17|i>>>15)+a|0)&a|~i&r)+t[3]-1044525330|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n&i|~n&a)+t[4]-176418897|0)<<7|r>>>25)+n|0)&n|~r&i)+t[5]+1200080426|0)<<12|a>>>20)+r|0)&r|~a&n)+t[6]-1473231341|0)<<17|i>>>15)+a|0)&a|~i&r)+t[7]-45705983|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n&i|~n&a)+t[8]+1770035416|0)<<7|r>>>25)+n|0)&n|~r&i)+t[9]-1958414417|0)<<12|a>>>20)+r|0)&r|~a&n)+t[10]-42063|0)<<17|i>>>15)+a|0)&a|~i&r)+t[11]-1990404162|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n&i|~n&a)+t[12]+1804603682|0)<<7|r>>>25)+n|0)&n|~r&i)+t[13]-40341101|0)<<12|a>>>20)+r|0)&r|~a&n)+t[14]-1502002290|0)<<17|i>>>15)+a|0)&a|~i&r)+t[15]+1236535329|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n&a|i&~a)+t[1]-165796510|0)<<5|r>>>27)+n|0)&i|n&~i)+t[6]-1069501632|0)<<9|a>>>23)+r|0)&n|r&~n)+t[11]+643717713|0)<<14|i>>>18)+a|0)&r|a&~r)+t[0]-373897302|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n&a|i&~a)+t[5]-701558691|0)<<5|r>>>27)+n|0)&i|n&~i)+t[10]+38016083|0)<<9|a>>>23)+r|0)&n|r&~n)+t[15]-660478335|0)<<14|i>>>18)+a|0)&r|a&~r)+t[4]-405537848|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n&a|i&~a)+t[9]+568446438|0)<<5|r>>>27)+n|0)&i|n&~i)+t[14]-1019803690|0)<<9|a>>>23)+r|0)&n|r&~n)+t[3]-187363961|0)<<14|i>>>18)+a|0)&r|a&~r)+t[8]+1163531501|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n&a|i&~a)+t[13]-1444681467|0)<<5|r>>>27)+n|0)&i|n&~i)+t[2]-51403784|0)<<9|a>>>23)+r|0)&n|r&~n)+t[7]+1735328473|0)<<14|i>>>18)+a|0)&r|a&~r)+t[12]-1926607734|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n^i^a)+t[5]-378558|0)<<4|r>>>28)+n|0)^n^i)+t[8]-2022574463|0)<<11|a>>>21)+r|0)^r^n)+t[11]+1839030562|0)<<16|i>>>16)+a|0)^a^r)+t[14]-35309556|0)<<23|n>>>9)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n^i^a)+t[1]-1530992060|0)<<4|r>>>28)+n|0)^n^i)+t[4]+1272893353|0)<<11|a>>>21)+r|0)^r^n)+t[7]-155497632|0)<<16|i>>>16)+a|0)^a^r)+t[10]-1094730640|0)<<23|n>>>9)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n^i^a)+t[13]+681279174|0)<<4|r>>>28)+n|0)^n^i)+t[0]-358537222|0)<<11|a>>>21)+r|0)^r^n)+t[3]-722521979|0)<<16|i>>>16)+a|0)^a^r)+t[6]+76029189|0)<<23|n>>>9)+i|0,n=((n+=((i=((i+=((a=((a+=((r=((r+=(n^i^a)+t[9]-640364487|0)<<4|r>>>28)+n|0)^n^i)+t[12]-421815835|0)<<11|a>>>21)+r|0)^r^n)+t[15]+530742520|0)<<16|i>>>16)+a|0)^a^r)+t[2]-995338651|0)<<23|n>>>9)+i|0,n=((n+=((a=((a+=(n^((r=((r+=(i^(n|~a))+t[0]-198630844|0)<<6|r>>>26)+n|0)|~i))+t[7]+1126891415|0)<<10|a>>>22)+r|0)^((i=((i+=(r^(a|~n))+t[14]-1416354905|0)<<15|i>>>17)+a|0)|~r))+t[5]-57434055|0)<<21|n>>>11)+i|0,n=((n+=((a=((a+=(n^((r=((r+=(i^(n|~a))+t[12]+1700485571|0)<<6|r>>>26)+n|0)|~i))+t[3]-1894986606|0)<<10|a>>>22)+r|0)^((i=((i+=(r^(a|~n))+t[10]-1051523|0)<<15|i>>>17)+a|0)|~r))+t[1]-2054922799|0)<<21|n>>>11)+i|0,n=((n+=((a=((a+=(n^((r=((r+=(i^(n|~a))+t[8]+1873313359|0)<<6|r>>>26)+n|0)|~i))+t[15]-30611744|0)<<10|a>>>22)+r|0)^((i=((i+=(r^(a|~n))+t[6]-1560198380|0)<<15|i>>>17)+a|0)|~r))+t[13]+1309151649|0)<<21|n>>>11)+i|0,n=((n+=((a=((a+=(n^((r=((r+=(i^(n|~a))+t[4]-145523070|0)<<6|r>>>26)+n|0)|~i))+t[11]-1120210379|0)<<10|a>>>22)+r|0)^((i=((i+=(r^(a|~n))+t[2]+718787259|0)<<15|i>>>17)+a|0)|~r))+t[9]-343485551|0)<<21|n>>>11)+i|0,e[0]=r+e[0]|0,e[1]=n+e[1]|0,e[2]=i+e[2]|0,e[3]=a+e[3]|0}function r(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return r}function n(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return r}function i(e){var n,i,a,o,s,c,u=e.length,l=[1732584193,-271733879,-1732584194,271733878];for(n=64;n<=u;n+=64)t(l,r(e.substring(n-64,n)));for(i=(e=e.substring(n-64)).length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=0;n>2]|=e.charCodeAt(n)<<(n%4<<3);if(a[n>>2]|=128<<(n%4<<3),n>55)for(t(l,a),n=0;n<16;n+=1)a[n]=0;return o=(o=8*u).toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(o[2],16),c=parseInt(o[1],16)||0,a[14]=s,a[15]=c,t(l,a),l}function a(t){var r,n="";for(r=0;r<4;r+=1)n+=e[t>>8*r+4&15]+e[t>>8*r&15];return n}function o(e){var t;for(t=0;tu?new ArrayBuffer(0):(n=u-c,i=new ArrayBuffer(n),a=new Uint8Array(i),o=new Uint8Array(this,c,n),a.set(o),i)}}(),u.prototype.append=function(e){return this.appendBinary(s(e)),this},u.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var n,i=this._buff.length;for(n=64;n<=i;n+=64)t(this._hash,r(this._buff.substring(n-64,n)));return this._buff=this._buff.substring(n-64),this},u.prototype.end=function(e){var t,r,n=this._buff,i=n.length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t>2]|=n.charCodeAt(t)<<(t%4<<3);return this._finish(a,i),r=o(this._hash),e&&(r=c(r)),this.reset(),r},u.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},u.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},u.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,this._hash=e.hash,this},u.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},u.prototype._finish=function(e,r){var n,i,a,o=r;if(e[o>>2]|=128<<(o%4<<3),o>55)for(t(this._hash,e),o=0;o<16;o+=1)e[o]=0;n=(n=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(n[2],16),a=parseInt(n[1],16)||0,e[14]=i,e[15]=a,t(this._hash,e)},u.hash=function(e,t){return u.hashBinary(s(e),t)},u.hashBinary=function(e,t){var r=o(i(e));return t?c(r):r},u.ArrayBuffer=function(){this.reset()},u.ArrayBuffer.prototype.append=function(e){var r,i,a,o,s,c=(i=this._buff.buffer,a=e,o=!0,(s=new Uint8Array(i.byteLength+a.byteLength)).set(new Uint8Array(i)),s.set(new Uint8Array(a),i.byteLength),o?s:s.buffer),u=c.length;for(this._length+=e.byteLength,r=64;r<=u;r+=64)t(this._hash,n(c.subarray(r-64,r)));return this._buff=r-64>2]|=n[t]<<(t%4<<3);return this._finish(a,i),r=o(this._hash),e&&(r=c(r)),this.reset(),r},u.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},u.ArrayBuffer.prototype.getState=function(){var e,t=u.prototype.getState.call(this);return t.buff=(e=t.buff,String.fromCharCode.apply(null,new Uint8Array(e))),t},u.ArrayBuffer.prototype.setState=function(e){return e.buff=function(e,t){var r,n=e.length,i=new ArrayBuffer(n),a=new Uint8Array(i);for(r=0;r>2]|=e[r]<<(r%4<<3);if(a[r>>2]|=128<<(r%4<<3),r>55)for(t(l,a),r=0;r<16;r+=1)a[r]=0;return o=(o=8*u).toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(o[2],16),c=parseInt(o[1],16)||0,a[14]=s,a[15]=c,t(l,a),l}(new Uint8Array(e)));return r?c(i):i},u}()},96331:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Util=t.toSparqlJs=t.toSparql=t.Factory=t.Algebra=t.translate=void 0;const s=o(r(73776));t.translate=s.default;const c=a(r(13079));t.Algebra=c;const u=o(r(91409));t.Factory=u.default;const l=r(3698);Object.defineProperty(t,"toSparql",{enumerable:!0,get:function(){return l.toSparql}}),Object.defineProperty(t,"toSparqlJs",{enumerable:!0,get:function(){return l.toSparqlJs}});const d=o(r(64995));t.Util=d.default},13079:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.expressionTypes=t.types=void 0,(n=t.types||(t.types={})).ALT="alt",n.ASK="ask",n.BGP="bgp",n.CONSTRUCT="construct",n.DESCRIBE="describe",n.DISTINCT="distinct",n.EXPRESSION="expression",n.EXTEND="extend",n.FILTER="filter",n.FROM="from",n.GRAPH="graph",n.GROUP="group",n.INV="inv",n.JOIN="join",n.LEFT_JOIN="leftjoin",n.LINK="link",n.MINUS="minus",n.NOP="nop",n.NPS="nps",n.ONE_OR_MORE_PATH="OneOrMorePath",n.ORDER_BY="orderby",n.PATH="path",n.PATTERN="pattern",n.PROJECT="project",n.REDUCED="reduced",n.SEQ="seq",n.SERVICE="service",n.SLICE="slice",n.UNION="union",n.VALUES="values",n.ZERO_OR_MORE_PATH="ZeroOrMorePath",n.ZERO_OR_ONE_PATH="ZeroOrOnePath",n.COMPOSITE_UPDATE="compositeupdate",n.DELETE_INSERT="deleteinsert",n.LOAD="load",n.CLEAR="clear",n.CREATE="create",n.DROP="drop",n.ADD="add",n.MOVE="move",n.COPY="copy",(r=t.expressionTypes||(t.expressionTypes={})).AGGREGATE="aggregate",r.EXISTENCE="existence",r.NAMED="named",r.OPERATOR="operator",r.TERM="term",r.WILDCARD="wildcard"},91409:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const o=a(r(13079)),s=r(47793),c=r(43347),u=r(98082);t.default=class{constructor(e){this.dataFactory=e||new s.DataFactory,this.stringType=this.createTerm("http://www.w3.org/2001/XMLSchema#string")}createAlt(e,t=!0){return this.flattenMulti({type:o.types.ALT,input:e},t)}createAsk(e){return{type:o.types.ASK,input:e}}createBoundAggregate(e,t,r,n,i){const a=this.createAggregateExpression(t,r,n,i);return a.variable=e,a}createBgp(e){return{type:o.types.BGP,patterns:e}}createConstruct(e,t){return{type:o.types.CONSTRUCT,input:e,template:t}}createDescribe(e,t){return{type:o.types.DESCRIBE,input:e,terms:t}}createDistinct(e){return{type:o.types.DISTINCT,input:e}}createExtend(e,t,r){return{type:o.types.EXTEND,input:e,variable:t,expression:r}}createFrom(e,t,r){return{type:o.types.FROM,input:e,default:t,named:r}}createFilter(e,t){return{type:o.types.FILTER,input:e,expression:t}}createGraph(e,t){return{type:o.types.GRAPH,input:e,name:t}}createGroup(e,t,r){return{type:o.types.GROUP,input:e,variables:t,aggregates:r}}createInv(e){return{type:o.types.INV,path:e}}createJoin(e,t=!0){return this.flattenMulti({type:o.types.JOIN,input:e},t)}createLeftJoin(e,t,r){return r?{type:o.types.LEFT_JOIN,input:[e,t],expression:r}:{type:o.types.LEFT_JOIN,input:[e,t]}}createLink(e){return{type:o.types.LINK,iri:e}}createMinus(e,t){return{type:o.types.MINUS,input:[e,t]}}createNop(){return{type:o.types.NOP}}createNps(e){return{type:o.types.NPS,iris:e}}createOneOrMorePath(e){return{type:o.types.ONE_OR_MORE_PATH,path:e}}createOrderBy(e,t){return{type:o.types.ORDER_BY,input:e,expressions:t}}createPath(e,t,r,n){return n?{type:o.types.PATH,subject:e,predicate:t,object:r,graph:n}:{type:o.types.PATH,subject:e,predicate:t,object:r,graph:this.dataFactory.defaultGraph()}}createPattern(e,t,r,n){const i=this.dataFactory.quad(e,t,r,n);return i.type=o.types.PATTERN,i}createProject(e,t){return{type:o.types.PROJECT,input:e,variables:t}}createReduced(e){return{type:o.types.REDUCED,input:e}}createSeq(e,t=!0){return this.flattenMulti({type:o.types.SEQ,input:e},t)}createService(e,t,r){return{type:o.types.SERVICE,input:e,name:t,silent:Boolean(r)}}createSlice(e,t,r){return t=t||0,void 0!==r?{type:o.types.SLICE,input:e,start:t,length:r}:{type:o.types.SLICE,input:e,start:t}}createUnion(e,t=!0){return this.flattenMulti({type:o.types.UNION,input:e},t)}createValues(e,t){return{type:o.types.VALUES,variables:e,bindings:t}}createZeroOrMorePath(e){return{type:o.types.ZERO_OR_MORE_PATH,path:e}}createZeroOrOnePath(e){return{type:o.types.ZERO_OR_ONE_PATH,path:e}}createAggregateExpression(e,t,r,n){return n?{type:o.types.EXPRESSION,expressionType:o.expressionTypes.AGGREGATE,aggregator:e,expression:t,separator:n,distinct:r}:{type:o.types.EXPRESSION,expressionType:o.expressionTypes.AGGREGATE,aggregator:e,expression:t,distinct:r}}createExistenceExpression(e,t){return{type:o.types.EXPRESSION,expressionType:o.expressionTypes.EXISTENCE,not:e,input:t}}createNamedExpression(e,t){return{type:o.types.EXPRESSION,expressionType:o.expressionTypes.NAMED,name:e,args:t}}createOperatorExpression(e,t){return{type:o.types.EXPRESSION,expressionType:o.expressionTypes.OPERATOR,operator:e,args:t}}createTermExpression(e){return{type:o.types.EXPRESSION,expressionType:o.expressionTypes.TERM,term:e}}createWildcardExpression(){return{type:o.types.EXPRESSION,expressionType:o.expressionTypes.WILDCARD,wildcard:new u.Wildcard}}createTerm(e){return"$"===e[0]&&(e=e.replace("$","?")),(0,c.stringToTerm)(e,this.dataFactory)}createCompositeUpdate(e){return{type:o.types.COMPOSITE_UPDATE,updates:e}}createDeleteInsert(e,t,r){const n={type:o.types.DELETE_INSERT};return e&&(n.delete=e),t&&(n.insert=t),r&&(n.where=r),n}createLoad(e,t,r){const n={type:o.types.LOAD,source:e};return t&&(n.destination=t),this.addSilent(n,Boolean(r))}createClear(e,t){return this.addSilent({type:o.types.CLEAR,source:e},Boolean(t))}createCreate(e,t){return this.addSilent({type:o.types.CREATE,source:e},Boolean(t))}createDrop(e,t){return this.addSilent({type:o.types.DROP,source:e},Boolean(t))}createAdd(e,t,r){return this.addSilent({type:o.types.ADD,source:e,destination:t},Boolean(r))}createMove(e,t,r){return this.addSilent({type:o.types.MOVE,source:e,destination:t},Boolean(r))}createCopy(e,t,r){return this.addSilent({type:o.types.COPY,source:e,destination:t},Boolean(r))}addSilent(e,t){return t&&(e.silent=t),e}flattenMulti(e,t){if(!t)return e;const r=e.type,n=e.input;let i=[];for(const e of n)e.type===r?i.push(...e.input):i.push(e);return e.input=i,e}}},3698:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.toSparqlJs=t.toSparql=void 0;const s=r(62699),c=r(43347),u=r(98082),l=a(r(13079)),d=o(r(91409)),p=o(r(64995)),h=l.types,f=l.expressionTypes;let y;const g=new d.default;function m(e){b();let t=v(e=function(e){return D(e,[])}(e));return"group"===t.type?t.patterns[0]:t}function b(){y={project:!1,extend:[],group:[],aggregates:[],order:[]}}function v(e){switch(e.type!==h.EXTEND&&e.type!==h.ORDER_BY&&e.type!==h.GRAPH&&(y.project=!1),e.type){case h.EXPRESSION:return _(e);case h.ASK:return I(e,h.ASK);case h.BGP:return function(e){let t=e.patterns.map(E);return 0===t.length?null:{type:"bgp",triples:t}}(e);case h.CONSTRUCT:return function(e){return{type:"query",prefixes:{},queryType:"CONSTRUCT",template:e.template.map(E),where:p.default.flatten([v(e.input)])}}(e);case h.DESCRIBE:return I(e,h.DESCRIBE);case h.DISTINCT:return function(e){let t=v(e.input);return t.patterns[0].distinct=!0,t}(e);case h.EXTEND:return function(e){return y.project?(y.extend.push(e),v(e.input)):p.default.flatten([v(e.input),{type:"bind",variable:e.variable,expression:_(e.expression)}])}(e);case h.FROM:return function(e){const t=v(e.input);let r=t;return"group"===t.type&&(r=t.patterns[0]),r.from={default:e.default,named:e.named},t}(e);case h.FILTER:return function(e){return{type:"group",patterns:p.default.flatten([v(e.input),{type:"filter",expression:_(e.expression)}])}}(e);case h.GRAPH:return function(e){return{type:"graph",patterns:p.default.flatten([v(e.input)]),name:e.name}}(e);case h.GROUP:return function(e){const t=v(e.input),r=e.aggregates.map(S);return y.aggregates.push(...r),y.group.push(...e.variables),t}(e);case h.JOIN:return function(e){return p.default.flatten(e.input.map(v)).reduce(((e,t)=>("bgp"!==t.type||0==e.length||"bgp"!==e[e.length-1].type?e.push(t):e[e.length-1].triples.push(...t.triples),e)),[])}(e);case h.LEFT_JOIN:return function(e){const t={type:"optional",patterns:[v(e.input[1])]};return e.expression&&t.patterns.push({type:"filter",expression:_(e.expression)}),t.patterns=p.default.flatten(t.patterns),p.default.flatten([v(e.input[0]),t])}(e);case h.MINUS:return function(e){let t=v(e.input[1]);return"group"===t.type&&(t=t.patterns),Array.isArray(t)||(t=[t]),p.default.flatten([v(e.input[0]),{type:"minus",patterns:t}])}(e);case h.NOP:return{};case h.ORDER_BY:return function(e){return y.order.push(...e.expressions),v(e.input)}(e);case h.PATH:return function(e){return{type:"bgp",triples:[{subject:e.subject,predicate:w(e.predicate),object:e.object}]}}(e);case h.PATTERN:return E(e);case h.PROJECT:return I(e,h.PROJECT);case h.REDUCED:return function(e){let t=v(e.input);return t.patterns[0].reduced=!0,t}(e);case h.SERVICE:return function(e){let t=v(e.input);return"group"===t.type&&(t=t.patterns),Array.isArray(t)||(t=[t]),{type:"service",name:e.name,silent:e.silent,patterns:t}}(e);case h.SLICE:return function(e){let t=v(e.input),r=t;return t.type&&"group"===t.type&&(r=t.patterns[0]),0!==e.start&&(r.offset=e.start),void 0!==e.length&&(r.limit=e.length),t}(e);case h.UNION:return function(e){return{type:"union",patterns:e.input.map(v).map(T)}}(e);case h.VALUES:return function(e){return{type:"values",values:e.bindings.map((t=>{let r={};for(let n of e.variables){let e=`?${n.value}`;t[e]?r[e]=t[e]:r[e]=void 0}return r}))}}(e);case h.COMPOSITE_UPDATE:return function(e){return{prefixes:{},type:"update",updates:e.updates.map((e=>v(e).updates[0]))}}(e);case h.DELETE_INSERT:return function(e){var t;let r,n=e.where;if(n&&n.type===h.FROM){let e=n;n=e.input,r={default:e.default,named:e.named}}const i=[{updateType:"insertdelete",delete:R(e.delete||[]),insert:R(e.insert||[])}];if(r&&(i[0].using=r),!n||n.type===h.BGP&&0===n.patterns.length)i[0].where=[];else{const e=[];let r=v(D(n,e));if("group"===r.type?i[0].where=r.patterns:i[0].where=[r],e.length>0){if(1!==e.length)throw new Error("This is unexpected and might indicate an error in graph handling for updates.");""!==(null===(t=e[0])||void 0===t?void 0:t.value)&&(i[0].where=[{type:"graph",patterns:i[0].where,name:e[0]}])}}return e.delete||e.where?e.insert||e.where?!e.insert&&e.where&&"bgp"===e.where.type&&(0,s.isomorphic)(e.delete,e.where.patterns)&&(delete i[0].where,i[0].updateType="deletewhere"):(delete i[0].insert,delete i[0].where,e.delete.some((e=>"Variable"===e.subject.termType||"Variable"===e.predicate.termType||"Variable"===e.object.termType))?i[0].updateType="deletewhere":i[0].updateType="delete"):(i[0].updateType="insert",delete i[0].delete,delete i[0].where),{prefixes:{},type:"update",updates:i}}(e);case h.LOAD:return function(e){const t=[{type:"load",silent:Boolean(e.silent),source:e.source}];return e.destination&&(t[0].destination=e.destination),{prefixes:{},type:"update",updates:t}}(e);case h.CLEAR:return function(e){return j(e,"clear")}(e);case h.CREATE:return function(e){return j(e,"create")}(e);case h.DROP:return function(e){return j(e,"drop")}(e);case h.ADD:return function(e){return N(e,"add")}(e);case h.MOVE:return function(e){return N(e,"move")}(e);case h.COPY:return function(e){return N(e,"copy")}(e)}throw new Error(`Unknown Operation type ${e.type}`)}function _(e){switch(e.expressionType){case f.AGGREGATE:return function(e){const t={expression:_(e.expression),type:"aggregate",aggregation:e.aggregator,distinct:e.distinct};return e.separator&&(t.separator=e.separator),t}(e);case f.EXISTENCE:return function(e){return{type:"operation",operator:e.not?"notexists":"exists",args:[{type:"group",patterns:p.default.flatten([v(e.input)])}]}}(e);case f.NAMED:return function(e){return{type:"functionCall",function:e.name,args:e.args.map(_)}}(e);case f.OPERATOR:return function(e){if("desc"===e.operator){return{expression:_(e.args[0]),descending:!0}}const t={type:"operation",operator:e.operator,args:e.args.map(_)};return"in"!==t.operator&&"notin"!==t.operator||(t.args=[t.args[0]].concat([t.args.slice(1)])),t}(e);case f.TERM:return function(e){return e.term}(e);case f.WILDCARD:return function(e){return e.wildcard}(e)}throw new Error(`Unknown Expression Operation type ${e.expressionType}`)}function w(e){switch(e.type){case h.ALT:return function(e){const t=e.input.map(w);return t.every((e=>"pathType"in e&&"!"===e.pathType))?{type:"path",pathType:"!",items:[{type:"path",pathType:"|",items:p.default.flatten(t.map((e=>e.items)))}]}:{type:"path",pathType:"|",items:t}}(e);case h.INV:return function(e){if(e.path.type===h.NPS){const t=e.path.iris.map((e=>({type:"path",pathType:"^",items:[e]})));return t.length<=1?{type:"path",pathType:"!",items:t}:{type:"path",pathType:"!",items:[{type:"path",pathType:"|",items:t}]}}return{type:"path",pathType:"^",items:[w(e.path)]}}(e);case h.LINK:return function(e){return e.iri}(e);case h.NPS:return function(e){return e.iris.length<=1?{type:"path",pathType:"!",items:e.iris}:{type:"path",pathType:"!",items:[{type:"path",pathType:"|",items:e.iris}]}}(e);case h.ONE_OR_MORE_PATH:return function(e){return{type:"path",pathType:"+",items:[w(e.path)]}}(e);case h.SEQ:return function(e){return{type:"path",pathType:"/",items:e.input.map(w)}}(e);case h.ZERO_OR_MORE_PATH:return function(e){return{type:"path",pathType:"*",items:[w(e.path)]}}(e);case h.ZERO_OR_ONE_PATH:return function(e){return{type:"path",pathType:"?",items:[w(e.path)]}}(e)}throw new Error(`Unknown Path type ${e.type}`)}function O(e){return(0,c.termToString)(e)}function T(e){return Array.isArray(e)?1===e.length?e[0]:{type:"group",patterns:e}:e}function S(e){return e}function E(e){return{subject:e.subject,predicate:e.predicate,object:e.object}}function x(e,t){let r=p.default.isSimpleTerm(e)?O(e):e;if("string"==typeof r){if(t[r])return t[r]}else if(Array.isArray(e))e=e.map((e=>x(e,t)));else for(let r of Object.keys(e))e[r]=x(e[r],t);return e}function I(e,t){const r={type:"query",prefixes:{}},n=r;let i;t===h.PROJECT?(r.queryType="SELECT",i=e.variables):t===h.ASK?r.queryType="ASK":t===h.DESCRIBE&&(r.queryType="DESCRIBE",i=e.terms);const a=y.extend,o=y.group,s=y.aggregates,l=y.order;b(),y.project=!0;let d=p.default.flatten([v(e.input)]);1===d.length&&"group"===d[0].type&&(d=d[0].patterns),r.where=d;let f={};for(let e of y.aggregates)f[O(e.variable)]=_(e);let g={};for(let e=y.extend.length-1;e>=0;--e){let t=y.extend[e];g[O(t.variable)]=x(_(t.expression),f)}y.group.length>0&&(n.group=y.group.map((e=>{let t=O(e);if(g[t]){let r=g[t];return delete g[t],{variable:e,expression:r}}return{expression:e}}))),y.order.length>0&&(n.order=y.order.map(v).map((e=>e.descending?e:{expression:e}))),i&&(n.variables=i.map((e=>{let t=O(e);if(g[t]){let r=g[t];return delete g[t],{variable:e,expression:r}}return e})),0===n.variables.length&&(n.variables=[new u.Wildcard]));const m=Object.entries(g);if(m.length>0){n.where=n.where||[];for(const[e,t]of m)n.where.push({type:"bind",variable:(0,c.stringToTerm)(e),expression:t})}if(r.where.length>0&&"filter"===r.where[r.where.length-1].type){const e=r.where[r.where.length-1];A(e,Object.keys(f))&&(n.having=p.default.flatten([x(e.expression,f)]),r.where.splice(-1))}return y.extend=a,y.group=o,y.aggregates=s,y.order=l,{type:"group",patterns:[n]}}function A(e,t){return p.default.isSimpleTerm(e)?t.indexOf(O(e))>=0:Array.isArray(e)?e.some((e=>A(e,t))):e===Object(e)?Object.keys(e).some((r=>A(e[r],t))):t.indexOf(e)>=0}function j(e,t){const r=[{type:t,silent:Boolean(e.silent)}];return"DEFAULT"===e.source?r[0].graph={default:!0}:"NAMED"===e.source?r[0].graph={named:!0}:"ALL"===e.source?r[0].graph={all:!0}:r[0].graph={type:"graph",name:e.source},{prefixes:{},type:"update",updates:r}}function N(e,t){const r=[{type:t,silent:Boolean(e.silent)}];return r[0].source="DEFAULT"===e.source?{type:"graph",default:!0}:{type:"graph",name:e.source},r[0].destination="DEFAULT"===e.destination?{type:"graph",default:!0}:{type:"graph",name:e.destination},{prefixes:{},type:"update",updates:r}}function R(e){if(!e)return[];const t={};return e.forEach((e=>{const r=e.graph.value;t[r]||(t[r]=[]),t[r].push(e)})),Object.keys(t).map((e=>""===e?{type:"bgp",triples:t[e].map(E)}:{type:"graph",triples:t[e].map(E),name:t[e][0].graph}))}function D(e,t){if(Array.isArray(e))return e.map((e=>D(e,t)));if(!e.type)return e;if(e.type===h.DELETE_INSERT)return e;if((e.type===h.PATTERN||e.type===h.PATH)&&e.graph)return t.push(e.graph),""!==e.graph.name?e.type===h.PATTERN?g.createPattern(e.subject,e.predicate,e.object):g.createPath(e.subject,e.predicate,e.object):e;const r={},n={},i={};for(let t of Object.keys(e)){const a=[];if(r[t]=D(e[t],a),a.length>0){n[t]=a;for(const e of a)i[e.value]=e}}const a=Object.keys(i);if(a.length>0)if(1!==a.length||[h.PROJECT,h.SERVICE].includes(e.type)){if(e.type===h.BGP)return function(e,t){var r;const n={};for(let i=0;i""===n[e][0].value?t:g.createGraph(t,n[e][r]))):""!==n[e][0].value&&(r[e]=g.createGraph(t,n[e][0]))}}else t.push(i[a[0]]);return r}t.toSparql=function(e,t={}){return new u.Generator(t).stringify(m(e))},t.toSparqlJs=m},73776:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(29252),c=r(43347),u=a(r(13079)),l=o(r(91409)),d=o(r(64995)),p=r(98082).Parser,h=u.types;let f,y=new Set,g=0,m=!1;function b(e,t,r){if(y=new Set,g=0,m=Boolean(t),!e.type)return f.createNop();if("query"!==e.type&&"update"!==e.type)throw new Error("Translate only works on complete query or update objects.");let n;var i;return w(e),"query"===e.type?(n=T({type:"group",patterns:e.where||[]}),n=function(e,t){const r=e,n=[],i={};if(r.variables=r.variables&&r.variables.map((e=>F(e,i))),r.having=r.having&&r.having.map((e=>F(e,i))),r.order=r.order&&r.order.map((e=>F(e,i))),r.group||Object.keys(i).length>0){const e=Object.keys(i).map((e=>function(e,t){if("aggregate"!==e.type||!e.aggregation)throw new Error(`Unexpected input: ${JSON.stringify(e)}`);const r=S(e);return r.variable=t,r}(i[e],f.createTerm(e)))),n=[];if(r.group)for(const e of r.group)if(d.default.isSimpleTerm(e.expression))n.push(e.expression);else{const r="variable"in e?e.variable:I();t=f.createExtend(t,r,S(e.expression)),n.push(r)}t=f.createGroup(t,n,e)}if(r.having)for(let e of r.having)t=f.createFilter(t,S(e));e.values&&(t=f.createJoin([t,P(e)]));let a=[];if("SELECT"===e.queryType||"DESCRIBE"===e.queryType)if(e.variables.some((e=>e&&d.default.isWildcard(e))))a=Object.values(O(e)).sort(((e,t)=>e.value.localeCompare(t.value)));else for(let t of e.variables)_(t)||!("variable"in t)?a.push(t):t.variable&&(a.push(t.variable),n.push(t));for(let e of n)t=f.createExtend(t,e.variable,S(e.expression));return r.order&&(t=f.createOrderBy(t,r.order.map((e=>{let t=S(e.expression);return e.descending&&(t=f.createOperatorExpression("desc",[t])),t})))),"SELECT"===e.queryType&&(t=f.createProject(t,a)),r.distinct&&(t=f.createDistinct(t)),r.reduced&&(t=f.createReduced(t)),"CONSTRUCT"===e.queryType?t=f.createConstruct(t,(e.template||[]).map(A)):"ASK"===e.queryType?t=f.createAsk(t):"DESCRIBE"===e.queryType&&(t=f.createDescribe(t,a)),(r.offset||r.limit)&&(t=f.createSlice(t,r.offset||0,r.limit)),r.from&&(t=f.createFrom(t,r.from.default,r.from.named)),t}(e,n)):"update"===e.type&&(n=1===(i=e).updates.length?C(i.updates[0]):f.createCompositeUpdate(i.updates.map(C))),r&&(n=L(n)),n}function v(e){return Boolean(null==e?void 0:e.termType)}function _(e){return"Variable"===(null==e?void 0:e.termType)}function w(e){if(v(e))_(e)&&y.add(`?${e.value}`);else if(Array.isArray(e))for(const t of e)w(t);else if(e&&"object"==typeof e)for(let t of Object.keys(e))t.startsWith("?")?y.add(t):t.startsWith("$")&&y.add(`?${t.slice(1)}`),w(e[t])}function O(e){let t={};if((r=e).subject&&r.predicate&&r.object){const r=[O(e.subject),O(e.predicate),O(e.object),e.graph?O(e.graph):{}];Object.assign(t,...r)}else if(v(e))_(e)&&(t[e.value]=e);else if("bgp"===e.type){const r=e.triples;Object.assign(t,...r.map(O))}else if("path"===e.type)Object.assign(t,...e.items.map(O));else if("group"===e.type||"union"===e.type||"optional"===e.type)Object.assign(t,...e.patterns.map(O));else if("service"===e.type||"graph"===e.type)Object.assign(t,O(e.name)),Object.assign(t,...e.patterns.map(O));else if("bind"===e.type)Object.assign(t,O(e.variable));else if("values"===e.type){if(e.values.length>0){const r=Object.keys(e.values[0]).map((e=>f.createTerm(e)));Object.assign(t,...r.map(O))}}else if("query"===e.type&&("SELECT"===e.queryType||"DESCRIBE"===e.queryType)){e.where&&e.variables.some(d.default.isWildcard)&&Object.assign(t,...e.where.map(O));for(const r of e.variables)_(r)?Object.assign(t,O(r)):r.variable&&Object.assign(t,O(r.variable));if("SELECT"===e.queryType){if(e.group)for(const r of e.group)r.variable&&Object.assign(t,O(r.variable));if(e.values){const r={type:"values",values:e.values};Object.assign(t,O(r))}}}var r;return t}function T(e){if("bgp"===e.type)return function(e){let t=[],r=[];for(let i of e.triples)if("pathType"in i.predicate){let e=x((n=i).subject,E(n.predicate),n.object);for(let n of e)n.type===h.PATH?(t.length>0&&r.push(f.createBgp(t)),t=[],r.push(n)):t.push(n)}else t.push(A(i));var n;return t.length>0&&r.push(f.createBgp(t)),1===r.length?r[0]:f.createJoin(r)}(e);if("union"===e.type)return f.createUnion(e.patterns.map((e=>("group"!==e.type&&(e={type:"group",patterns:[e]}),T(e)))));if("graph"===e.type){let t=T({type:"group",patterns:e.patterns});return t=m?N(t,e.name):f.createGraph(t,e.name),t}if("values"===e.type)return P(e);if("query"===e.type)return b(e,m,!1);if("group"===e.type){let t=[],r=[];for(let n of e.patterns)("filter"===n.type?t:r).push(n);let n=r.reduce(R,f.createBgp([])),i=t.map((e=>S(e.expression)));return i.length>0&&(n=f.createFilter(n,i.reduce(((e,t)=>f.createOperatorExpression("&&",[e,t]))))),n}throw new Error(`Unexpected type: ${e.type}`)}function S(e){if(d.default.isSimpleTerm(e))return f.createTermExpression(e);if(d.default.isQuad(e))return d.default.hasQuadVariables(e)?f.createOperatorExpression("triple",[S(e.subject),S(e.predicate),S(e.object)]):f.createTermExpression(e);if(d.default.isWildcard(e))return f.createWildcardExpression();if("aggregation"in e)return f.createAggregateExpression(e.aggregation,S(e.expression),Boolean(e.distinct),e.separator);if("function"in e)return f.createNamedExpression(e.function,e.args.map(S));if("operator"in e)return"exists"===e.operator||"notexists"===e.operator?f.createExistenceExpression("notexists"===e.operator,T(e.args[0])):("in"!==e.operator&&"notin"!==e.operator||(e.args=[e.args[0]].concat(e.args[1])),f.createOperatorExpression(e.operator,e.args.map(S)));throw new Error(`Unknown expression: ${JSON.stringify(e)}`)}function E(e){if(d.default.isSimpleTerm(e)){if("NamedNode"===e.termType)return f.createLink(e);throw new Error(`Path predicate should be a NamedNode, got ${JSON.stringify(e)}`)}if("^"===e.pathType)return f.createInv(E(e.items[0]));if("!"===e.pathType){let t,r=[],n=[];t="pathType"in e.items[0]&&"|"===e.items[0].pathType?e.items[0].items:e.items;for(let e of t)if(d.default.isSimpleTerm(e))r.push(e);else{if("^"!==e.pathType)throw new Error(`Unexpected item: ${JSON.stringify(e)}`);n.push(e.items[0])}let i=f.createNps(r),a=f.createInv(f.createNps(n));return 0===n.length?i:0===r.length?a:f.createAlt([i,a])}if("/"===e.pathType)return f.createSeq(e.items.map(E));if("|"===e.pathType)return f.createAlt(e.items.map(E));if("*"===e.pathType)return f.createZeroOrMorePath(E(e.items[0]));if("+"===e.pathType)return f.createOneOrMorePath(E(e.items[0]));if("?"===e.pathType)return f.createZeroOrOnePath(E(e.items[0]));throw new Error(`Unable to translate path expression ${JSON.stringify(e)}`)}function x(e,t,r){if(t.type===h.LINK)return[f.createPattern(e,t.iri,r)];if(t.type===h.INV)return x(r,t.path,e);if(t.type===h.SEQ){let n=e;return d.default.flatten(t.input.map(((e,i)=>{const a=i===t.input.length-1?r:I(),o=x(n,e,a);return"Variable"===a.termType&&(n=a),o})))}return[f.createPath(e,t,r)]}function I(){let e="?var"+g++;return y.has(e)?I():(y.add(e),f.createTerm(e))}function A(e){if("pathType"in e.predicate)throw new Error("Trying to translate property path to quad.");return f.createPattern(e.subject,e.predicate,e.object,e.graph)}t.default=function(e,t){let r;if(t=t||{},f=new l.default(t.dataFactory),"string"==typeof e){let n=new p(t);n._resetBlanks(),r=n.parse(e)}else r=e;return b(r,t.quads,t.blankToVariable)};let j=Object.values(h);function N(e,t,r){if(e.type===h.GRAPH){if(r)throw new Error("Recursing through nested GRAPH statements with a replacement is impossible.");e=N(e.input,e.name)}else if(e.type===h.SERVICE);else if(e.type===h.BGP)e.patterns=e.patterns.map((e=>(r&&(e.subject.equals(t)&&(e.subject=r),e.predicate.equals(t)&&(e.predicate=r),e.object.equals(t)&&(e.object=r)),"DefaultGraph"===e.graph.termType&&(e.graph=t),e)));else if(e.type===h.PATH)r&&(e.subject.equals(t)&&(e.subject=r),e.object.equals(t)&&(e.object=r)),"DefaultGraph"===e.graph.termType&&(e.graph=t);else if(e.type!==h.PROJECT||r)if(e.type!==h.EXTEND||r)for(let n of Object.keys(e))Array.isArray(e[n])?e[n]=e[n].map((e=>N(e,t,r))):j.indexOf(e[n].type)>=0?e[n]=N(e[n],t,r):r&&_(e[n])&&e[n].equals(t)&&(e[n]=r);else e.variable.equals(t)&&(r=I()),e.input=N(e.input,t,r);else e.variables.some((e=>e.equals(t)))||(r=I()),e.input=N(e.input,t,r);return e}function R(e,t){if("optional"===t.type){const r=T({type:"group",patterns:t.patterns});e=r.type===h.FILTER?f.createLeftJoin(e,r.input,r.expression):f.createLeftJoin(e,r)}else if("minus"===t.type){const r=T({type:"group",patterns:t.patterns});e=f.createMinus(e,r)}else if("bind"===t.type)e=f.createExtend(e,t.variable,S(t.expression));else if("service"===t.type){const r={type:"group",patterns:t.patterns};e=D(e,f.createService(T(r),t.name,t.silent))}else e=D(e,T(t));return e}function D(e,t){return e.type===h.BGP&&t.type===h.BGP?e=f.createBgp([...e.patterns,...t.patterns]):e.type===h.BGP&&0===e.patterns.length?e=t:t.type===h.BGP&&0===t.patterns.length||(e=f.createJoin([e,t])),e}function P(e){let t=(0===e.values.length?[]:Object.keys(e.values[0])).map(f.createTerm.bind(f)),r=e.values.map((e=>{let t=Object.keys(e);t=t.filter((t=>void 0!==e[t]));let r={};for(let n of t)r[n]=e[n];return r}));return f.createValues(t,r)}function F(e,t){if("type"in e&&"aggregate"===e.type){let r,n=!1;for(let i of Object.keys(t))if(s(t[i],e)){r=f.createTerm(i),n=!0;break}return n||(r=I(),t[(0,c.termToString)(r)]=e),r}return"expression"in e&&e.expression?{...e,expression:F(e.expression,t)}:"args"in e&&e.args?{...e,args:e.args.map((e=>F(e,t)))}:e}function C(e){if("type"in e){if("load"===e.type)return function(e){return f.createLoad(e.source,e.destination,e.silent)}(e);if("clear"===e.type||"create"===e.type||"drop"===e.type)return function(e){let t;switch(t=d.default.isSimpleTerm(e.graph)?e.graph:e.graph.all?"ALL":e.graph.default?"DEFAULT":e.graph.named?"NAMED":e.graph.name,e.type){case"clear":return f.createClear(t,e.silent);case"create":return f.createCreate(t,e.silent);case"drop":return f.createDrop(t,e.silent)}}(e);if("add"===e.type||"copy"===e.type||"move"===e.type)return function(e){const t=e.source.default?"DEFAULT":e.source.name,r=e.destination.default?"DEFAULT":e.destination.name;switch(e.type){case"copy":return f.createCopy(t,r,e.silent);case"move":return f.createMove(t,r,e.silent);case"add":return f.createAdd(t,r,e.silent)}}(e)}else if("insertdelete"===e.updateType||"deletewhere"===e.updateType||"delete"===e.updateType||"insert"===e.updateType)return function(e){if(!m)throw new Error("INSERT/DELETE operations are only supported with quads option enabled");let t,r=[],n=[];if(e.delete&&(r=d.default.flatten(e.delete.map((t=>M(t,e.graph))))),e.insert&&(n=d.default.flatten(e.insert.map((t=>M(t,e.graph))))),e.where&&e.where.length>0){t=T({type:"group",patterns:e.where});const r=e.using;r?t=f.createFrom(t,r.default,r.named):e.graph&&(t=N(t,e.graph))}else"deletewhere"===e.updateType&&r.length>0&&(t=f.createBgp(r));return f.createDeleteInsert(r.length>0?r:void 0,n.length>0?n:void 0,t)}(e);throw new Error(`Unknown update type ${JSON.stringify(e)}`)}function M(e,t){let r=t;"graph"===e.type&&(r=e.name);let n=e.triples;return r&&(n=n.map((e=>Object.assign(e,{graph:r})))),n.map(A)}function L(e){const t={},r=Array.from(y).reduce(((e,t)=>(e[t]=!0,e)),{});return d.default.mapOperation(e,{[u.types.DELETE_INSERT]:e=>({result:f.createDeleteInsert(e.delete,e.insert,e.where&&L(e.where)),recurse:!1}),[u.types.PATH]:(e,t)=>({result:t.createPath(n(e.subject),e.predicate,n(e.object),n(e.graph)),recurse:!1}),[u.types.PATTERN]:(e,t)=>({result:t.createPattern(n(e.subject),n(e.predicate),n(e.object),n(e.graph)),recurse:!1}),[u.types.CONSTRUCT]:e=>({result:f.createConstruct(L(e.input),e.template),recurse:!1})});function n(e){if("BlankNode"===e.termType){let n=t[e.value];return n||(n=d.default.createUniqueVariable(e.value,r,f.dataFactory),r[n.value]=!0,t[e.value]=n),n}return e}}},64995:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(13079),a=n(r(91409)),o=r(3285);class s{static flatten(e){return Array.prototype.concat(...e).filter((e=>e))}static objectify(e){if(e.termType){if("Quad"===e.termType)return{type:"pattern",termType:"Quad",subject:s.objectify(e.subject),predicate:s.objectify(e.predicate),object:s.objectify(e.object),graph:s.objectify(e.graph)};{let t={termType:e.termType,value:e.value};return e.language&&(t.language=e.language),e.datatype&&(t.datatype=s.objectify(e.datatype)),t}}if(Array.isArray(e))return e.map((e=>s.objectify(e)));if(e===Object(e)){let t={};for(let r of Object.keys(e))t[r]=s.objectify(e[r]);return t}return e}static inScopeVariables(e){const t=[];function r(e){t.find((t=>e.value===t.value))||t.push(e)}function n(e){"Variable"===e.subject.termType&&r(e.subject),"Variable"===e.predicate.termType&&r(e.predicate),"Variable"===e.object.termType&&r(e.object),"Variable"===e.graph.termType&&r(e.graph),"Quad"===e.subject.termType&&n(e.subject),"Quad"===e.predicate.termType&&n(e.predicate),"Quad"===e.object.termType&&n(e.object),"Quad"===e.graph.termType&&n(e.graph)}return s.recurseOperation(e,{[i.types.EXPRESSION]:e=>(e.expressionType===i.expressionTypes.AGGREGATE&&e.variable&&r(e.variable),!0),[i.types.EXTEND]:e=>(r(e.variable),!0),[i.types.GRAPH]:e=>("Variable"===e.name.termType&&r(e.name),!0),[i.types.GROUP]:e=>(e.variables.forEach(r),!0),[i.types.PATH]:e=>("Variable"===e.subject.termType&&r(e.subject),"Variable"===e.object.termType&&r(e.object),"Variable"===e.graph.termType&&r(e.graph),"Quad"===e.subject.termType&&n(e.subject),"Quad"===e.object.termType&&n(e.object),"Quad"===e.graph.termType&&n(e.graph),!0),[i.types.PATTERN]:e=>(n(e),!0),[i.types.PROJECT]:e=>(e.variables.forEach(r),!1),[i.types.SERVICE]:e=>("Variable"===e.name.termType&&r(e.name),!0),[i.types.VALUES]:e=>(e.variables.forEach(r),!0)}),t}static recurseOperation(e,t){let r=e,n=!0;const a=t[e.type];if(a&&(n=a(e)),!n)return;let o=e=>s.recurseOperation(e,t);switch(r.type){case i.types.ALT:r.input.map(o);break;case i.types.ASK:o(r.input);break;case i.types.BGP:r.patterns.forEach(o);break;case i.types.CONSTRUCT:o(r.input),r.template.map(o);break;case i.types.DESCRIBE:case i.types.DISTINCT:o(r.input);break;case i.types.EXPRESSION:r.expressionType===i.expressionTypes.EXISTENCE&&o(r.input);break;case i.types.EXTEND:case i.types.FILTER:o(r.input),o(r.expression);break;case i.types.FROM:case i.types.GRAPH:o(r.input);break;case i.types.GROUP:o(r.input),r.aggregates.forEach(o);break;case i.types.INV:o(r.path);break;case i.types.JOIN:r.input.map(o);break;case i.types.LEFT_JOIN:r.input.map(o),r.expression&&o(r.expression);break;case i.types.LINK:break;case i.types.MINUS:r.input.map(o);break;case i.types.NOP:case i.types.NPS:break;case i.types.ONE_OR_MORE_PATH:o(r.path);break;case i.types.ORDER_BY:o(r.input),r.expressions.forEach(o);break;case i.types.PATH:o(r.predicate);break;case i.types.PATTERN:break;case i.types.PROJECT:case i.types.REDUCED:o(r.input);break;case i.types.SEQ:r.input.map(o);break;case i.types.SERVICE:case i.types.SLICE:o(r.input);break;case i.types.UNION:r.input.map(o);break;case i.types.VALUES:break;case i.types.ZERO_OR_MORE_PATH:case i.types.ZERO_OR_ONE_PATH:o(r.path);break;case i.types.COMPOSITE_UPDATE:r.updates.forEach((e=>o(e)));break;case i.types.DELETE_INSERT:r.delete&&r.delete.forEach((e=>o(e))),r.insert&&r.insert.forEach((e=>o(e))),r.where&&o(r.where);break;case i.types.LOAD:case i.types.CLEAR:case i.types.CREATE:case i.types.DROP:case i.types.ADD:case i.types.MOVE:case i.types.COPY:break;default:throw new Error(`Unknown Operation type ${r.type}`)}}static mapOperation(e,t,r){let n=e,o=!0,c=!0;r=r||new a.default;const u=t[e.type];if(u){const t=u(e,r);n=t.result,o=t.recurse,c=!1!==t.copyMetadata}let l;if(c&&(n.metadata||e.metadata)&&(l={...n.metadata,...e.metadata}),!o)return l&&(n.metadata=l),n;let d=e=>s.mapOperation(e,t,r);switch(n.type){case i.types.ALT:n=r.createAlt(n.input.map(d));break;case i.types.ASK:n=r.createAsk(d(n.input));break;case i.types.BGP:n=r.createBgp(n.patterns.map(d));break;case i.types.CONSTRUCT:n=r.createConstruct(d(n.input),n.template.map(d));break;case i.types.DESCRIBE:n=r.createDescribe(d(n.input),n.terms);break;case i.types.DISTINCT:n=r.createDistinct(d(n.input));break;case i.types.EXPRESSION:n=s.mapExpression(n,t,r);break;case i.types.EXTEND:n=r.createExtend(d(n.input),n.variable,d(n.expression));break;case i.types.FILTER:n=r.createFilter(d(n.input),d(n.expression));break;case i.types.FROM:n=r.createFrom(d(n.input),[...n.default],[...n.named]);break;case i.types.GRAPH:n=r.createGraph(d(n.input),n.name);break;case i.types.GROUP:n=r.createGroup(d(n.input),[].concat(n.variables),n.aggregates.map(d));break;case i.types.INV:n=r.createInv(d(n.path));break;case i.types.JOIN:n=r.createJoin(n.input.map(d));break;case i.types.LEFT_JOIN:n=r.createLeftJoin(d(n.input[0]),d(n.input[1]),n.expression?d(n.expression):void 0);break;case i.types.LINK:n=r.createLink(n.iri);break;case i.types.MINUS:n=r.createMinus(d(n.input[0]),d(n.input[1]));break;case i.types.NOP:n=r.createNop();break;case i.types.NPS:n=r.createNps([].concat(n.iris));break;case i.types.ONE_OR_MORE_PATH:n=r.createOneOrMorePath(d(n.path));break;case i.types.ORDER_BY:n=r.createOrderBy(d(n.input),n.expressions.map(d));break;case i.types.PATH:n=r.createPath(n.subject,d(n.predicate),n.object,n.graph);break;case i.types.PATTERN:n=r.createPattern(n.subject,n.predicate,n.object,n.graph);break;case i.types.PROJECT:n=r.createProject(d(n.input),[...n.variables]);break;case i.types.REDUCED:n=r.createReduced(d(n.input));break;case i.types.SEQ:n=r.createSeq(n.input.map(d));break;case i.types.SERVICE:n=r.createService(d(n.input),n.name,n.silent);break;case i.types.SLICE:n=r.createSlice(d(n.input),n.start,n.length);break;case i.types.UNION:n=r.createUnion(n.input.map(d));break;case i.types.VALUES:n=r.createValues([].concat(n.variables),n.bindings.map((e=>Object.assign({},e))));break;case i.types.ZERO_OR_MORE_PATH:n=r.createZeroOrMorePath(d(n.path));break;case i.types.ZERO_OR_ONE_PATH:n=r.createZeroOrOnePath(d(n.path));break;case i.types.COMPOSITE_UPDATE:n=r.createCompositeUpdate(n.updates.map(d));break;case i.types.DELETE_INSERT:n=r.createDeleteInsert(n.delete?n.delete.map(d):void 0,n.insert?n.insert.map(d):void 0,n.where?d(n.where):void 0);break;case i.types.LOAD:n=r.createLoad(n.source,n.destination,n.silent);break;case i.types.CLEAR:n=r.createClear(n.source,n.silent);break;case i.types.CREATE:n=r.createCreate(n.source,n.silent);break;case i.types.DROP:n=r.createDrop(n.source,n.silent);break;case i.types.ADD:n=r.createAdd(n.source,n.destination);break;case i.types.MOVE:n=r.createMove(n.source,n.destination);break;case i.types.COPY:n=r.createCopy(n.source,n.destination);break;default:throw new Error(`Unknown Operation type ${n.type}`)}return l&&(n.metadata=l),n}static mapExpression(e,t,r){let n=e,o=!0;r=r||new a.default;const c=t[e.expressionType];if(c&&({result:n,recurse:o}=c(e,r)),!o)return n;let u=e=>s.mapOperation(e,t,r);switch(e.expressionType){case i.expressionTypes.AGGREGATE:return e.variable?r.createBoundAggregate(e.variable,e.aggregator,u(e.expression),e.distinct,e.separator):r.createAggregateExpression(e.aggregator,u(e.expression),e.distinct,e.separator);case i.expressionTypes.EXISTENCE:return r.createExistenceExpression(e.not,u(e.input));case i.expressionTypes.NAMED:return r.createNamedExpression(e.name,e.args.map(u));case i.expressionTypes.OPERATOR:return r.createOperatorExpression(e.operator,e.args.map(u));case i.expressionTypes.TERM:return r.createTermExpression(e.term);case i.expressionTypes.WILDCARD:return r.createWildcardExpression();default:throw new Error(`Unknown Expression type ${e.expressionType}`)}}static cloneOperation(e){return s.mapOperation(e,{})}static cloneExpression(e){return s.mapExpression(e,{})}static createUniqueVariable(e,t,r){let n=0,i=e;for(;t[i];)i=`${e}${n++}`;return r.variable(i)}static isSimpleTerm(e){return void 0!==e.termType&&"Quad"!==e.termType&&"Wildcard"!==e.termType}static isQuad(e){return"Quad"===e.termType}static hasQuadVariables(e){return(0,o.someTermsNested)(e,(e=>"Variable"===e.termType))}static isWildcard(e){return"Wildcard"===e.termType}}t.default=s},23825:e=>{function t(e){this._options=e=e||{};var t=e.prefixes||{};this._prefixByIri={};var r=[];for(var n in t){var i=t[n];o(i)&&(this._prefixByIri[i]=n,r.push(i))}var a=r.join("|").replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&");this._prefixRegex=new RegExp("^("+a+")([a-zA-Z][\\-_a-zA-Z0-9]*)$"),this._usedPrefixes={},this._sparqlStar=e.sparqlStar,this._indent=o(e.indent)?e.indent:" ",this._newline=o(e.newline)?e.newline:"\n",this._explicitDatatype=Boolean(e.explicitDatatype)}t.prototype.toQuery=function(e){var t="";return e.queryType&&(t+=e.queryType.toUpperCase()+" "),e.reduced&&(t+="REDUCED "),e.distinct&&(t+="DISTINCT "),e.variables?t+=u(e.variables,void 0,(function(e){return/^[?$]/.test(e)?e:s(e)?this.toEntity(e):"("+this.toExpression(e.expression)+" AS "+a(e.variable)+")"}),this)+" ":e.template&&(t+=this.group(e.template,!0)+this._newline),e.from&&(t+=this.graphs("FROM ",e.from.default)+this.graphs("FROM NAMED ",e.from.named)),e.where&&(t+="WHERE "+this.group(e.where,!0)+this._newline),e.updates&&(t+=u(e.updates,";"+this._newline,this.toUpdate,this)),e.group&&(t+="GROUP BY "+u(e.group,void 0,(function(e){var t=s(e.expression)?this.toEntity(e.expression):"("+this.toExpression(e.expression)+")";return e.variable?"("+t+" AS "+a(e.variable)+")":t}),this)+this._newline),e.having&&(t+="HAVING ("+u(e.having,void 0,this.toExpression,this)+")"+this._newline),e.order&&(t+="ORDER BY "+u(e.order,void 0,(function(e){var t="("+this.toExpression(e.expression)+")";return e.descending?"DESC "+t:t}),this)+this._newline),e.offset&&(t+="OFFSET "+e.offset+this._newline),e.limit&&(t+="LIMIT "+e.limit+this._newline),e.values&&(t+=this.values(e)),(t=this.baseAndPrefixes(e)+t).trim()},t.prototype.baseAndPrefixes=function(e){var t=e.base?"BASE <"+e.base+">"+this._newline:"",r="";for(var n in e.prefixes)(this._options.allPrefixes||this._usedPrefixes[n])&&(r+="PREFIX "+n+": <"+e.prefixes[n]+">"+this._newline);return t+r},t.prototype.toPattern=function(e){var t=e.type||e instanceof Array&&"array"||(e.subject&&e.predicate&&e.object?"triple":"");if(!(t in this))throw new Error("Unknown entry type: "+t);return this[t](e)},t.prototype.triple=function(e){return this.toEntity(e.subject)+" "+this.toEntity(e.predicate)+" "+this.toEntity(e.object)+"."},t.prototype.array=function(e){return u(e,this._newline,this.toPattern,this)},t.prototype.bgp=function(e){return this.encodeTriples(e.triples)},t.prototype.encodeTriples=function(e){if(!e.length)return"";for(var t=[],r=void 0,n=void 0,i=0;i":case">=":case"<=":case"&&":case"||":case"=":case"!=":case"+":case"-":case"*":case"/":return(s(i[0])?this.toEntity(i[0]):"("+this.toExpression(i[0])+")")+" "+t+" "+(s(i[1])?this.toEntity(i[1]):"("+this.toExpression(i[1])+")");case"!":return"!("+this.toExpression(i[0])+")";case"uplus":return"+("+this.toExpression(i[0])+")";case"uminus":return"-("+this.toExpression(i[0])+")";case"notin":t="NOT IN";case"in":return this.toExpression(i[0])+" "+t+"("+(o(i[1])?i[1]:u(i[1],", ",this.toExpression,this))+")";case"notexists":t="NOT EXISTS";case"exists":return t+" "+this.group(i[0],!0);default:return t+"("+u(i,", ",this.toExpression,this)+")"}default:throw new Error("Unknown expression type: "+e.type)}},t.prototype.toEntity=function(e){if(s(e))switch(e.termType){case"Wildcard":return"*";case"Variable":return a(e);case"BlankNode":return"_:"+e.value;case"Literal":var t=e.value||"",i=e.language||"",o=e.datatype;if(e='"'+t.replace(r,n)+'"',i)e+="@"+i;else if(o){if(!this._explicitDatatype)switch(o.value){case"http://www.w3.org/2001/XMLSchema#string":return e;case"http://www.w3.org/2001/XMLSchema#integer":if(/^\d+$/.test(t))return t+" "}e+="^^"+this.encodeIRI(o.value)}return e;case"Quad":if(!this._sparqlStar)throw new Error("SPARQL* support is not enabled");return e.graph&&"DefaultGraph"!==e.graph.termType?"<< GRAPH "+this.toEntity(e.graph)+" { "+this.toEntity(e.subject)+" "+this.toEntity(e.predicate)+" "+this.toEntity(e.object)+" } >>":"<< "+this.toEntity(e.subject)+" "+this.toEntity(e.predicate)+" "+this.toEntity(e.object)+" >>";default:return this.encodeIRI(e.value)}else{var c=e.items.map(this.toEntity,this),u=e.pathType;switch(u){case"^":case"!":return u+c[0];case"*":case"+":case"?":return"("+c[0]+u+")";default:return"("+c.join(u)+")"}}};var r=/["\\\t\n\r\b\f]/g,n=function(e){return i[e]},i={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};function a(e){return"?"+e.value}function o(e){return"string"==typeof e}function s(e){return"string"==typeof e.termType}function c(e,t){if(!e||!s(e))return!1;if(!t||!s(t))return!1;if(e.termType!==t.termType)return!1;switch(e.termType){case"Literal":return e.value===t.value&&e.language===t.language&&c(e.datatype,t.datatype);case"Quad":return c(e.subject,t.subject)&&c(e.predicate,t.predicate)&&c(e.object,t.object)&&c(e.graph,t.graph);default:return e.value===t.value}}function u(e,t,r,n){return e.map(r,n).join(o(t)?t:" ")}t.prototype.encodeIRI=function(e){var t=this._prefixRegex.exec(e);if(t){var r=this._prefixByIri[t[1]];return this._usedPrefixes[r]=!0,r+":"+t[2]}return"<"+e+">"},t.prototype.toUpdate=function(e){switch(e.type||e.updateType){case"load":return"LOAD"+(e.source?" "+this.toEntity(e.source):"")+(e.destination?" INTO GRAPH "+this.toEntity(e.destination):"");case"insert":return"INSERT DATA "+this.group(e.insert,!0);case"delete":return"DELETE DATA "+this.group(e.delete,!0);case"deletewhere":return"DELETE WHERE "+this.group(e.delete,!0);case"insertdelete":return(e.graph?"WITH "+this.toEntity(e.graph)+this._newline:"")+(e.delete.length?"DELETE "+this.group(e.delete,!0)+this._newline:"")+(e.insert.length?"INSERT "+this.group(e.insert,!0)+this._newline:"")+(e.using?this.graphs("USING ",e.using.default):"")+(e.using?this.graphs("USING NAMED ",e.using.named):"")+"WHERE "+this.group(e.where,!0);case"add":case"copy":case"move":return e.type.toUpperCase()+" "+(e.silent?"SILENT ":"")+(e.source.default?"DEFAULT":this.toEntity(e.source.name))+" TO "+this.toEntity(e.destination.name);case"create":case"clear":case"drop":return e.type.toUpperCase()+(e.silent?" SILENT ":" ")+(e.graph.default?"DEFAULT":e.graph.named?"NAMED":e.graph.all?"ALL":"GRAPH "+this.toEntity(e.graph.name));default:throw new Error("Unknown update query type: "+e.type)}},t.prototype.indent=function(e){return e.replace(/^/gm,this._indent)},e.exports={Generator:function(e={}){return{stringify:function(r){var n=Object.create(e);return n.prefixes=r.prefixes,new t(n).toQuery(r)},createGenerator:function(){return new t(e)}}}}},83849:(e,t,r)=>{var n=function(){var e=function(e,t,r,n){for(r=r||{},n=e.length;n--;r[e[n]]=t);return r},t=[6,12,13,15,16,24,32,36,41,45,100,110,113,115,116,123,126,131,197,224,229,308,329,330,331,332,333],n=[2,247],i=[100,110,113,115,116,123,126,131,329,330,331,332,333],a=[2,409],o=[1,18],s=[1,27],c=[13,16,45,197,224,229,308],u=[28,29,53],l=[28,53],d=[1,42],p=[1,45],h=[1,41],f=[1,44],y=[123,126],g=[1,67],m=[39,45,87],b=[13,16,45,197,224,308],v=[1,87],_=[2,281],w=[1,86],O=[13,16,45,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],T=[6,28,29,53,63,70,73,81,83,85],S=[6,13,16,28,29,53,63,70,73,81,83,85,87,308],E=[6,13,16,28,29,45,53,63,70,73,81,82,83,85,87,89,197,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314],x=[6,13,16,28,29,31,39,45,47,48,53,63,70,73,81,82,83,85,87,89,109,112,121,123,126,128,159,160,161,163,164,174,193,197,224,229,231,232,242,246,250,263,265,272,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,337,338,340,341,342,343,344,345,346],I=[13,16,308],A=[112,132,327,334],j=[13,16,112,132,308],N=[1,111],R=[1,117],D=[112,132,327,328,334],P=[13,16,112,132,308,328],F=[28,29,45,53,87],C=[1,138],M=[1,151],L=[1,128],k=[1,127],B=[1,129],U=[1,140],V=[1,141],$=[1,142],q=[1,143],Q=[1,144],G=[1,145],z=[1,147],H=[1,148],K=[2,457],X=[1,158],J=[1,159],W=[1,160],Y=[1,152],Z=[1,153],ee=[1,156],te=[1,171],re=[1,172],ne=[1,173],ie=[1,174],ae=[1,175],oe=[1,176],se=[1,167],ce=[1,168],ue=[1,169],le=[1,170],de=[1,157],pe=[1,166],he=[1,161],fe=[1,162],ye=[1,163],ge=[1,164],me=[1,165],be=[6,13,16,29,31,45,82,85,87,89,112,159,160,161,163,164,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335],ve=[1,195],_e=[6,31,73,81,83,85],we=[2,285],Oe=[1,199],Te=[1,201],Se=[6,31,70,73,81,83,85],Ee=[2,283],xe=[1,207],Ie=[1,218],Ae=[1,223],je=[1,219],Ne=[1,225],Re=[1,226],De=[1,224],Pe=[6,63,70,73,81,83,85],Fe=[1,236],Ce=[2,334],Me=[1,243],Le=[1,241],ke=[6,193],Be=[2,349],Ue=[2,339],Ve=[28,128],$e=[47,48,193,272],qe=[47,48,193,242,272],Qe=[47,48,193,242,246,272],Ge=[47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,341,342,343,344,345,346],ze=[39,47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,338,341,342,343,344,345,346],He=[1,271],Ke=[1,270],Xe=[6,13,16,29,31,39,45,47,48,70,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,231,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,338,341,342,343,344,345,346,347,348,349,350,351],Je=[1,281],We=[1,280],Ye=[13,16,29,31,39,45,47,48,82,85,87,89,112,159,160,161,163,164,174,193,197,224,229,231,232,242,246,250,263,265,272,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,338,341,342,343,344,345,346],Ze=[45,89],et=[13,16,29,31,39,45,47,48,82,85,87,89,112,159,160,161,163,164,174,193,197,224,229,231,232,242,246,250,263,265,272,290,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,338,341,342,343,344,345,346],tt=[13,16,31,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],rt=[31,89],nt=[48,87],it=[6,13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,337,338],at=[6,13,16,39,45,48,82,87,89,231,263,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,337,338,340],ot=[1,313],st=[6,85],ct=[6,31,81,83,85],ut=[2,361],lt=[2,353],dt=[1,343],pt=[31,112,335],ht=[13,16,29,31,45,48,82,85,87,89,112,159,160,161,163,164,193,197,224,229,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],ft=[13,16,29,31,45,48,82,85,87,89,112,159,160,161,163,164,193,197,224,229,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335],yt=[6,109,193],gt=[31,112],mt=[13,16,45,82,87,224,263,265,268,269,270,271,273,274,276,277,279,280,283,285,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312,346,347,348,349,350,351],bt=[1,390],vt=[1,391],_t=[13,16,87,197,308,314],wt=[13,16,39,45,82,87,224,263,265,268,269,270,271,273,274,276,277,279,280,283,285,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312,346,347,348,349,350,351],Ot=[1,417],Tt=[1,418],St=[13,16,48,197,229,308],Et=[6,31,85],xt=[6,13,16,31,45,73,81,83,85,268,269,270,271,273,274,276,277,279,280,283,285,308,346,347,348,349,350,351],It=[6,13,16,29,31,45,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,231,268,269,270,271,273,274,276,277,279,280,283,285,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,346,347,348,349,350,351],At=[29,31,85,112,159,160,161,163,164],jt=[1,443],Nt=[1,444],Rt=[1,449],Dt=[31,112,193,232,318,335],Pt=[13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],Ft=[13,16,31,45,48,82,87,89,112,193,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],Ct=[13,16,29,31,45,48,82,85,87,89,112,159,160,161,163,164,193,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],Mt=[13,16,31,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],Lt=[31,45],kt=[1,507],Bt=[1,508],Ut=[6,13,16,29,31,39,45,47,48,63,70,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,231,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,336,338,341,342,343,344,345,346,347,348,349,350,351],Vt=[29,31,85,112,159,160,161,163,164,335],$t=[6,13,16,31,45,70,73,81,83,85,87,268,269,270,271,273,274,276,277,279,280,283,285,308,346,347,348,349,350,351],qt=[13,16,31,45,48,82,87,89,112,193,197,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],Qt=[2,352],Gt=[13,16,197,308,314],zt=[1,565],Ht=[6,13,16,31,45,76,78,81,83,85,87,268,269,270,271,273,274,276,277,279,280,283,285,308,346,347,348,349,350,351],Kt=[13,16,29,31,45,82,85,87,89,112,159,160,161,163,164,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],Xt=[13,16,29,31,45,82,85,87,89,112,159,160,161,163,164,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335],Jt=[13,16,87,308],Wt=[2,364],Yt=[29,31,85,112,159,160,161,163,164,193,232,318,335],Zt=[31,112,193,232,272,318,335],er=[2,359],tr=[13,16,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],rr=[29,31,85,112,159,160,161,163,164,193,232,272,318,335],nr=[13,16,31,45,82,87,89,112,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],ir=[2,347],ar={trace:function(){},yy:{},symbols_:{error:2,QueryOrUpdate:3,Prologue:4,QueryOrUpdate_group0:5,EOF:6,Query:7,Qry:8,Query_option0:9,Prologue_repetition0:10,BaseDecl:11,BASE:12,IRIREF:13,PrefixDecl:14,PREFIX:15,PNAME_NS:16,SelectClauseWildcard:17,Qry_repetition0:18,WhereClause:19,SolutionModifierNoGroup:20,SelectClauseVars:21,Qry_repetition1:22,SolutionModifier:23,CONSTRUCT:24,ConstructTemplate:25,Qry_repetition2:26,Qry_repetition3:27,WHERE:28,"{":29,Qry_option0:30,"}":31,DESCRIBE:32,Qry_group0:33,Qry_repetition4:34,Qry_option1:35,ASK:36,Qry_repetition5:37,SelectClauseBase:38,"*":39,SelectClauseVars_repetition_plus0:40,SELECT:41,SelectClauseBase_option0:42,SelectClauseItem:43,Var:44,"(":45,Expression:46,AS:47,")":48,SubSelect:49,SubSelect_option0:50,SubSelect_option1:51,DatasetClause:52,FROM:53,DatasetClause_option0:54,iri:55,WhereClause_option0:56,GroupGraphPattern:57,SolutionModifier_option0:58,SolutionModifierNoGroup_option0:59,SolutionModifierNoGroup_option1:60,SolutionModifierNoGroup_option2:61,GroupClause:62,GROUP:63,BY:64,GroupClause_repetition_plus0:65,GroupCondition:66,BuiltInCall:67,FunctionCall:68,HavingClause:69,HAVING:70,HavingClause_repetition_plus0:71,OrderClause:72,ORDER:73,OrderClause_repetition_plus0:74,OrderCondition:75,ASC:76,BrackettedExpression:77,DESC:78,Constraint:79,LimitOffsetClauses:80,LIMIT:81,INTEGER:82,OFFSET:83,ValuesClause:84,VALUES:85,InlineData:86,VAR:87,InlineData_repetition0:88,NIL:89,InlineData_repetition1:90,InlineData_repetition_plus2:91,InlineData_repetition3:92,DataBlock:93,DataBlockValueList:94,DataBlockValueList_repetition_plus0:95,Update:96,Update_repetition0:97,Update1:98,Update_option0:99,LOAD:100,Update1_option0:101,Update1_option1:102,Update1_group0:103,Update1_option2:104,GraphRefAll:105,Update1_group1:106,Update1_option3:107,GraphOrDefault:108,TO:109,CREATE:110,Update1_option4:111,GRAPH:112,INSERTDATA:113,QuadPattern:114,DELETEDATA:115,DELETEWHERE:116,Update1_option5:117,InsertDeleteClause:118,Update1_repetition0:119,IntoGraphClause:120,INTO:121,GraphRef:122,DELETE:123,InsertDeleteClause_option0:124,InsertClause:125,INSERT:126,UsingClause:127,USING:128,UsingClause_option0:129,WithClause:130,WITH:131,DEFAULT:132,GraphOrDefault_option0:133,GraphRefAll_group0:134,Quads:135,Quads_option0:136,Quads_repetition0:137,QuadsNotTriples:138,VarOrIri:139,QuadsNotTriples_option0:140,QuadsNotTriples_option1:141,QuadsNotTriples_option2:142,TriplesTemplate:143,TriplesTemplate_repetition0:144,TriplesSameSubject:145,TriplesTemplate_option0:146,GroupGraphPatternSub:147,GroupGraphPatternSub_option0:148,GroupGraphPatternSub_repetition0:149,GroupGraphPatternSubTail:150,GraphPatternNotTriples:151,GroupGraphPatternSubTail_option0:152,GroupGraphPatternSubTail_option1:153,TriplesBlock:154,TriplesBlock_repetition0:155,TriplesSameSubjectPath:156,TriplesBlock_option0:157,GroupOrUnionGraphPattern:158,OPTIONAL:159,MINUS:160,SERVICE:161,GraphPatternNotTriples_option0:162,FILTER:163,BIND:164,InlineDataOneVar:165,InlineDataFull:166,InlineDataOneVar_repetition0:167,InlineDataFull_repetition0:168,InlineDataFull_repetition_plus1:169,InlineDataFull_repetition2:170,DataBlockValue:171,Literal:172,QuotedTriple:173,UNDEF:174,GroupOrUnionGraphPattern_repetition0:175,ArgList:176,ArgList_option0:177,ArgList_repetition0:178,ExpressionList:179,ExpressionList_repetition0:180,ConstructTemplate_option0:181,ConstructTriples:182,ConstructTriples_repetition0:183,ConstructTriples_option0:184,VarOrTermOrQuotedTP:185,PropertyListNotEmpty:186,TriplesNode:187,PropertyList:188,PropertyList_option0:189,VerbObjectList:190,PropertyListNotEmpty_repetition0:191,SemiOptionalVerbObjectList:192,";":193,SemiOptionalVerbObjectList_option0:194,Verb:195,ObjectList:196,a:197,ObjectList_repetition0:198,Object:199,GraphNode:200,Object_option0:201,PropertyListPathNotEmpty:202,TriplesNodePath:203,TriplesSameSubjectPath_option0:204,O:205,PropertyListPathNotEmpty_repetition0:206,PropertyListPathNotEmptyTail:207,O_group0:208,ObjectListPath:209,ObjectListPath_repetition0:210,ObjectPath:211,GraphNodePath:212,ObjectPath_option0:213,Path:214,Path_repetition0:215,PathSequence:216,PathSequence_repetition0:217,PathEltOrInverse:218,PathElt:219,PathPrimary:220,PathElt_option0:221,PathEltOrInverse_option0:222,IriOrA:223,"!":224,PathNegatedPropertySet:225,PathOneInPropertySet:226,PathNegatedPropertySet_repetition0:227,PathNegatedPropertySet_option0:228,"^":229,TriplesNode_repetition_plus0:230,"[":231,"]":232,TriplesNodePath_repetition_plus0:233,VarOrTermOrQuotedTPExpr:234,VarOrTerm:235,GraphTerm:236,BlankNode:237,ConditionalOrExpression:238,ConditionalAndExpression:239,ConditionalOrExpression_repetition0:240,ConditionalOrExpressionTail:241,"||":242,RelationalExpression:243,ConditionalAndExpression_repetition0:244,ConditionalAndExpressionTail:245,"&&":246,NumericExpression:247,RelationalExpression_group0:248,RelationalExpression_option0:249,IN:250,MultiplicativeExpression:251,NumericExpression_repetition0:252,AdditiveExpressionTail:253,AdditiveExpressionTail_group0:254,NumericLiteralPositive:255,AdditiveExpressionTail_repetition0:256,NumericLiteralNegative:257,AdditiveExpressionTail_repetition1:258,UnaryExpression:259,MultiplicativeExpression_repetition0:260,MultiplicativeExpressionTail:261,MultiplicativeExpressionTail_group0:262,"+":263,PrimaryExpression:264,"-":265,ExprQuotedTP:266,Aggregate:267,FUNC_ARITY0:268,FUNC_ARITY1:269,FUNC_ARITY1_SPARQL_STAR:270,FUNC_ARITY2:271,",":272,FUNC_ARITY3:273,FUNC_ARITY3_SPARQL_STAR:274,BuiltInCall_group0:275,BOUND:276,BNODE:277,BuiltInCall_option0:278,EXISTS:279,COUNT:280,Aggregate_option0:281,Aggregate_group0:282,FUNC_AGGREGATE:283,Aggregate_option1:284,GROUP_CONCAT:285,Aggregate_option2:286,Aggregate_option3:287,GroupConcatSeparator:288,SEPARATOR:289,"=":290,String:291,LANGTAG:292,"^^":293,DECIMAL:294,DOUBLE:295,BOOLEAN:296,INTEGER_POSITIVE:297,DECIMAL_POSITIVE:298,DOUBLE_POSITIVE:299,INTEGER_NEGATIVE:300,DECIMAL_NEGATIVE:301,DOUBLE_NEGATIVE:302,STRING_LITERAL1:303,STRING_LITERAL2:304,STRING_LITERAL_LONG1:305,STRING_LITERAL_LONG2:306,PrefixedName:307,PNAME_LN:308,BLANK_NODE_LABEL:309,ANON:310,QuotedTP:311,"<<":312,qtSubjectOrObject:313,">>":314,DataValueTerm:315,AnnotationPattern:316,"{|":317,"|}":318,AnnotationPatternPath:319,ExprVarOrTerm:320,QueryOrUpdate_group0_option0:321,Prologue_repetition0_group0:322,Qry_group0_repetition_plus0:323,SelectClauseBase_option0_group0:324,DISTINCT:325,REDUCED:326,NAMED:327,SILENT:328,CLEAR:329,DROP:330,ADD:331,MOVE:332,COPY:333,ALL:334,".":335,UNION:336,"|":337,"/":338,PathElt_option0_group0:339,"?":340,"!=":341,"<":342,">":343,"<=":344,">=":345,NOT:346,CONCAT:347,COALESCE:348,SUBSTR:349,REGEX:350,REPLACE:351,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",12:"BASE",13:"IRIREF",15:"PREFIX",16:"PNAME_NS",24:"CONSTRUCT",28:"WHERE",29:"{",31:"}",32:"DESCRIBE",36:"ASK",39:"*",41:"SELECT",45:"(",47:"AS",48:")",53:"FROM",63:"GROUP",64:"BY",70:"HAVING",73:"ORDER",76:"ASC",78:"DESC",81:"LIMIT",82:"INTEGER",83:"OFFSET",85:"VALUES",87:"VAR",89:"NIL",100:"LOAD",109:"TO",110:"CREATE",112:"GRAPH",113:"INSERTDATA",115:"DELETEDATA",116:"DELETEWHERE",121:"INTO",123:"DELETE",126:"INSERT",128:"USING",131:"WITH",132:"DEFAULT",159:"OPTIONAL",160:"MINUS",161:"SERVICE",163:"FILTER",164:"BIND",174:"UNDEF",193:";",197:"a",224:"!",229:"^",231:"[",232:"]",242:"||",246:"&&",250:"IN",263:"+",265:"-",268:"FUNC_ARITY0",269:"FUNC_ARITY1",270:"FUNC_ARITY1_SPARQL_STAR",271:"FUNC_ARITY2",272:",",273:"FUNC_ARITY3",274:"FUNC_ARITY3_SPARQL_STAR",276:"BOUND",277:"BNODE",279:"EXISTS",280:"COUNT",283:"FUNC_AGGREGATE",285:"GROUP_CONCAT",289:"SEPARATOR",290:"=",292:"LANGTAG",293:"^^",294:"DECIMAL",295:"DOUBLE",296:"BOOLEAN",297:"INTEGER_POSITIVE",298:"DECIMAL_POSITIVE",299:"DOUBLE_POSITIVE",300:"INTEGER_NEGATIVE",301:"DECIMAL_NEGATIVE",302:"DOUBLE_NEGATIVE",303:"STRING_LITERAL1",304:"STRING_LITERAL2",305:"STRING_LITERAL_LONG1",306:"STRING_LITERAL_LONG2",308:"PNAME_LN",309:"BLANK_NODE_LABEL",310:"ANON",312:"<<",314:">>",317:"{|",318:"|}",325:"DISTINCT",326:"REDUCED",327:"NAMED",328:"SILENT",329:"CLEAR",330:"DROP",331:"ADD",332:"MOVE",333:"COPY",334:"ALL",335:".",336:"UNION",337:"|",338:"/",340:"?",341:"!=",342:"<",343:">",344:"<=",345:">=",346:"NOT",347:"CONCAT",348:"COALESCE",349:"SUBSTR",350:"REGEX",351:"REPLACE"},productions_:[0,[3,3],[7,2],[4,1],[11,2],[14,3],[8,4],[8,4],[8,5],[8,7],[8,5],[8,4],[17,2],[21,2],[38,2],[43,1],[43,5],[49,4],[49,4],[52,3],[19,2],[23,2],[20,3],[62,3],[66,1],[66,1],[66,3],[66,5],[66,1],[69,2],[72,3],[75,2],[75,2],[75,1],[75,1],[80,2],[80,2],[80,4],[80,4],[84,2],[86,4],[86,4],[86,6],[86,2],[94,3],[96,3],[98,4],[98,3],[98,5],[98,4],[98,2],[98,2],[98,2],[98,5],[120,2],[118,3],[118,1],[125,2],[127,3],[130,2],[108,1],[108,2],[122,2],[105,1],[105,1],[114,3],[135,2],[138,7],[143,3],[57,3],[57,3],[147,2],[150,3],[154,3],[151,1],[151,2],[151,2],[151,3],[151,4],[151,2],[151,6],[151,1],[93,1],[93,1],[165,4],[166,4],[166,6],[171,1],[171,1],[171,1],[171,1],[158,2],[79,1],[79,1],[79,1],[68,2],[176,1],[176,5],[179,1],[179,4],[25,3],[182,3],[145,2],[145,2],[188,1],[186,2],[192,2],[190,2],[195,1],[195,1],[196,2],[199,2],[156,2],[156,2],[202,2],[207,1],[207,2],[205,2],[209,2],[211,2],[214,2],[216,2],[219,2],[218,2],[220,1],[220,2],[220,3],[225,1],[225,1],[225,4],[226,1],[226,2],[187,3],[187,3],[203,3],[203,3],[200,1],[200,1],[212,1],[212,1],[234,1],[235,1],[235,1],[139,1],[139,1],[44,1],[236,1],[236,1],[236,1],[236,1],[46,1],[238,2],[241,2],[239,2],[245,2],[243,1],[243,3],[243,4],[247,2],[253,2],[253,2],[253,2],[251,2],[261,2],[259,2],[259,2],[259,2],[259,1],[264,1],[264,1],[264,1],[264,1],[264,1],[264,1],[264,1],[77,3],[67,1],[67,2],[67,4],[67,4],[67,6],[67,8],[67,8],[67,2],[67,4],[67,2],[67,4],[67,3],[267,5],[267,5],[267,6],[288,4],[172,1],[172,2],[172,3],[172,1],[172,1],[172,1],[172,1],[172,1],[172,1],[255,1],[255,1],[255,1],[257,1],[257,1],[257,1],[291,1],[291,1],[291,1],[291,1],[55,1],[55,1],[307,1],[307,1],[237,1],[237,1],[311,5],[173,5],[313,1],[313,1],[313,1],[313,1],[313,1],[315,1],[315,1],[315,1],[185,1],[185,1],[185,1],[316,3],[319,3],[266,5],[320,1],[320,1],[320,1],[223,1],[223,1],[321,0],[321,1],[5,1],[5,1],[5,1],[9,0],[9,1],[322,1],[322,1],[10,0],[10,2],[18,0],[18,2],[22,0],[22,2],[26,0],[26,2],[27,0],[27,2],[30,0],[30,1],[323,1],[323,2],[33,1],[33,1],[34,0],[34,2],[35,0],[35,1],[37,0],[37,2],[40,1],[40,2],[324,1],[324,1],[42,0],[42,1],[50,0],[50,1],[51,0],[51,1],[54,0],[54,1],[56,0],[56,1],[58,0],[58,1],[59,0],[59,1],[60,0],[60,1],[61,0],[61,1],[65,1],[65,2],[71,1],[71,2],[74,1],[74,2],[88,0],[88,2],[90,0],[90,2],[91,1],[91,2],[92,0],[92,2],[95,1],[95,2],[97,0],[97,4],[99,0],[99,2],[101,0],[101,1],[102,0],[102,1],[103,1],[103,1],[104,0],[104,1],[106,1],[106,1],[106,1],[107,0],[107,1],[111,0],[111,1],[117,0],[117,1],[119,0],[119,2],[124,0],[124,1],[129,0],[129,1],[133,0],[133,1],[134,1],[134,1],[134,1],[136,0],[136,1],[137,0],[137,2],[140,0],[140,1],[141,0],[141,1],[142,0],[142,1],[144,0],[144,3],[146,0],[146,1],[148,0],[148,1],[149,0],[149,2],[152,0],[152,1],[153,0],[153,1],[155,0],[155,3],[157,0],[157,1],[162,0],[162,1],[167,0],[167,2],[168,0],[168,2],[169,1],[169,2],[170,0],[170,2],[175,0],[175,3],[177,0],[177,1],[178,0],[178,3],[180,0],[180,3],[181,0],[181,1],[183,0],[183,3],[184,0],[184,1],[189,0],[189,1],[191,0],[191,2],[194,0],[194,1],[198,0],[198,3],[201,0],[201,1],[204,0],[204,1],[206,0],[206,2],[208,1],[208,1],[210,0],[210,3],[213,0],[213,1],[215,0],[215,3],[217,0],[217,3],[339,1],[339,1],[339,1],[221,0],[221,1],[222,0],[222,1],[227,0],[227,3],[228,0],[228,1],[230,1],[230,2],[233,1],[233,2],[240,0],[240,2],[244,0],[244,2],[248,1],[248,1],[248,1],[248,1],[248,1],[248,1],[249,0],[249,1],[252,0],[252,2],[254,1],[254,1],[256,0],[256,2],[258,0],[258,2],[260,0],[260,2],[262,1],[262,1],[275,1],[275,1],[275,1],[275,1],[275,1],[278,0],[278,1],[281,0],[281,1],[282,1],[282,1],[284,0],[284,1],[286,0],[286,1],[287,0],[287,1]],performAction:function(e,t,r,n,i,a,o){var s,c,u,l,d=a.length-1;switch(i){case 1:if(a[d-1]=a[d-1]||{},nn.base&&(a[d-1].base=nn.base),nn.base="",a[d-1].prefixes=nn.prefixes,nn.prefixes=null,nn.pathOnly){if("path"===a[d-1].type||"termType"in a[d-1])return a[d-1];throw new Error("Received full SPARQL query in path only mode")}if("path"===a[d-1].type||"termType"in a[d-1])throw new Error("Received only path in full SPARQL mode");if("update"===a[d-1].type){const e={};for(const t of a[d-1].updates)if("insert"===t.updateType){const r={};for(const e of t.insert)if("bgp"===e.type||"graph"===e.type)for(const t of e.triples)"BlankNode"===t.subject.termType&&(r[t.subject.value]=!0),"BlankNode"===t.predicate.termType&&(r[t.predicate.value]=!0),"BlankNode"===t.object.termType&&(r[t.object.value]=!0);for(const t of Object.keys(r)){if(e[t])throw new Error("Detected reuse blank node across different INSERT DATA clauses");e[t]=!0}}}return a[d-1];case 2:this.$={...a[d-1],...a[d],type:"query"};break;case 4:nn.base=Er(a[d]);break;case 5:nn.prefixes||(nn.prefixes={}),a[d-1]=a[d-1].substr(0,a[d-1].length-1),a[d]=Er(a[d]),nn.prefixes[a[d-1]]=a[d];break;case 6:this.$={...a[d-3],...Rr(a[d-2]),...a[d-1],...a[d]};break;case 7:if(!nn.skipValidation&&(Kr(a[d-3].variables.map((e=>zr(e.expression)))).some((e=>"count"===e.aggregation&&!(e.expression instanceof or)))||a[d].group))for(const e of a[d-3].variables)if("Variable"===e.termType){if(!a[d].group||!a[d].group.map((e=>Gr(e))).includes(Gr(e)))throw Error("Projection of ungrouped variable (?"+Gr(e)+")")}else if(0===zr(e.expression).length){const t=Hr(e.expression);for(const e of t)if(!a[d].group||!a[d].group.map||!a[d].group.map((e=>Gr(e))).includes(Gr(e)))throw Error("Use of ungrouped variable in projection of operation (?"+Gr(e)+")")}const e=a[d-1].where.filter((e=>"query"===e.type));if(e.length>0){const t=a[d-3].variables.filter((e=>e.variable&&e.variable.value)).map((e=>e.variable.value)),r=Kr(e.map((e=>e.variables))).map((e=>e.value||e.variable.value));for(const e of t)if(r.indexOf(e)>=0)throw Error("Target id of 'AS' (?"+e+") already used in subquery")}this.$=Tr(a[d-3],Rr(a[d-2]),a[d-1],a[d]);break;case 8:this.$=Tr({queryType:"CONSTRUCT",template:a[d-3]},Rr(a[d-2]),a[d-1],a[d]);break;case 9:this.$=Tr({queryType:"CONSTRUCT",template:a[d-2]=a[d-2]?a[d-2].triples:[]},Rr(a[d-5]),{where:[{type:"bgp",triples:Or([],a[d-2])}]},a[d]);break;case 10:this.$=Tr({queryType:"DESCRIBE",variables:"*"===a[d-3]?[new or]:a[d-3]},Rr(a[d-2]),a[d-1],a[d]);break;case 11:this.$=Tr({queryType:"ASK"},Rr(a[d-2]),a[d-1],a[d]);break;case 12:this.$=Tr(a[d-1],{variables:[new or]});break;case 13:const t=function(e){const t=e.slice().sort(),r=[];for(let e=0;ee.value||e.variable.value)));if(t.length>0)throw Error("Two or more of the resulting columns have the same name (?"+t[0]+")");this.$=Tr(a[d-1],{variables:a[d]});break;case 14:this.$=Tr({queryType:"SELECT"},a[d]&&(a[d-1]=_r(a[d]),a[d]={},a[d][a[d-1]]=!0,a[d]));break;case 16:case 27:this.$=Ar(a[d-3],{variable:a[d-1]});break;case 17:case 18:this.$=Tr(a[d-3],a[d-2],a[d-1],a[d],{type:"query"});break;case 19:case 58:this.$={iri:a[d],named:!!a[d-1]};break;case 20:this.$={where:a[d].patterns};break;case 21:this.$=Tr(a[d-1],a[d]);break;case 22:this.$=Tr(a[d-2],a[d-1],a[d]);break;case 23:this.$={group:a[d]};break;case 24:case 25:case 28:case 31:case 33:case 34:this.$=Ar(a[d]);break;case 26:this.$=Ar(a[d-1]);break;case 29:this.$={having:a[d]};break;case 30:this.$={order:a[d]};break;case 32:this.$=Ar(a[d],{descending:!0});break;case 35:this.$={limit:Dr(a[d])};break;case 36:this.$={offset:Dr(a[d])};break;case 37:this.$={limit:Dr(a[d-2]),offset:Dr(a[d])};break;case 38:this.$={limit:Dr(a[d]),offset:Dr(a[d-2])};break;case 39:case 43:this.$={type:"values",values:a[d]};break;case 40:case 84:this.$=a[d-1].map((e=>({[a[d-3]]:e})));break;case 41:case 85:this.$=a[d-1].map((()=>({})));break;case 42:case 86:var p=a[d-4].length;a[d-4]=a[d-4].map(xr),this.$=a[d-1].map((function(e){if(e.length!==p)throw Error("Inconsistent VALUES length");for(var t={},r=0;r"bind"===e.type))){const t=a[d-1].indexOf(e),r=new Set;for(const e of a[d-1].slice(0,t))"group"!==e.type&&"bgp"!==e.type||Jr(e).forEach((e=>r.add(e)));if(r.has(e.variable.value))throw Error("Variable used to bind is already bound (?"+e.variable.value+")")}this.$={type:"group",patterns:a[d-1]};break;case 71:this.$=a[d-1]?Sr([a[d-1]],a[d]):Sr(a[d]);break;case 72:this.$=a[d]?[a[d-2],a[d]]:a[d-2];break;case 75:this.$=Tr(a[d],{type:"optional"});break;case 76:this.$=Tr(a[d],{type:"minus"});break;case 77:this.$=Tr(a[d],{type:"graph",name:a[d-1]});break;case 78:this.$=Tr(a[d],{type:"service",name:a[d-1],silent:!!a[d-2]});break;case 79:this.$={type:"filter",expression:a[d]};break;case 80:this.$={type:"bind",variable:a[d-1],expression:a[d-3]};break;case 89:this.$=Wr(a[d]);break;case 90:this.$=void 0;break;case 91:this.$=a[d-1].length?{type:"union",patterns:Sr(a[d-1].map(Pr),[Pr(a[d])])}:a[d];break;case 95:this.$={...a[d],function:a[d-1]};break;case 96:this.$={type:"functionCall",args:[]};break;case 97:this.$={type:"functionCall",args:wr(a[d-2],a[d-1]),distinct:!!a[d-3]};break;case 98:case 115:case 128:case 247:case 249:case 251:case 253:case 255:case 263:case 267:case 297:case 299:case 303:case 307:case 328:case 341:case 349:case 355:case 361:case 367:case 369:case 373:case 375:case 379:case 381:case 385:case 391:case 395:case 401:case 405:case 409:case 411:case 420:case 428:case 430:case 440:case 444:case 446:case 448:this.$=[];break;case 99:this.$=wr(a[d-2],a[d-1]);break;case 101:this.$=Sr(a[d-2],[a[d-1]]);break;case 102:case 112:this.$=Zr(a[d].map((e=>Tr(Mr(a[d-1]),e))));break;case 103:this.$=Zr(Or(a[d].map((e=>Tr(Mr(a[d-1].entity),e))),a[d-1].triples));break;case 105:this.$=Sr([a[d-1]],a[d]);break;case 106:this.$=Sr(a[d]);break;case 107:this.$=Qr(a[d-1],a[d]);break;case 109:case 237:this.$=nn.factory.namedNode(cr);break;case 110:case 118:this.$=wr(a[d-1],a[d]);break;case 111:this.$=a[d]?{annotation:a[d],object:a[d-1]}:a[d-1];break;case 113:this.$=a[d]?Zr(Or(a[d].map((e=>Tr(Mr(a[d-1].entity),e))),a[d-1].triples)):a[d-1].triples;break;case 114:this.$=Qr(...a[d-1],a[d]);break;case 116:this.$=Qr(...a[d]);break;case 117:case 159:case 163:this.$=[a[d-1],a[d]];break;case 119:this.$=a[d]?{object:a[d-1],annotation:a[d]}:a[d-1];break;case 120:this.$=a[d-1].length?jr("|",wr(a[d-1],a[d])):a[d];break;case 121:this.$=a[d-1].length?jr("/",wr(a[d-1],a[d])):a[d];break;case 122:this.$=a[d]?jr(a[d],[a[d-1]]):a[d-1];break;case 123:this.$=a[d-1]?jr(a[d-1],[a[d]]):a[d];break;case 125:case 131:this.$=jr(a[d-1],[a[d]]);break;case 129:this.$=jr("|",wr(a[d-2],a[d-1]));break;case 132:case 134:this.$=function(e){var t=Lr(),r=t,n=[],i=[];e.forEach((function(e){n.push(e.entity),Or(i,e.triples)}));for(var a=0,o=0,s=n.length,c=Array(2*s);a2&&E.push("'"+this.terminals_[O]+"'");I=d.showPosition?"Parse error on line "+(s+1)+":\n"+d.showPosition()+"\nExpecting "+E.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(s+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(I,{text:d.match,token:this.terminals_[m]||m,line:d.yylineno,loc:f,expected:E})}if(_[0]instanceof Array&&_.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+m);switch(_[0]){case 1:r.push(m),n.push(d.yytext),i.push(d.yylloc),r.push(_[1]),m=null,b?(m=b,b=null):(c=d.yyleng,o=d.yytext,s=d.yylineno,f=d.yylloc,u>0&&u--);break;case 2:if(T=this.productions_[_[1]][1],x.$=n[n.length-T],x._$={first_line:i[i.length-(T||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(T||1)].first_column,last_column:i[i.length-1].last_column},g&&(x._$.range=[i[i.length-(T||1)].range[0],i[i.length-1].range[1]]),void 0!==(w=this.performAction.apply(x,[o,c,s,p.yy,_[1],n,i].concat(l))))return w;T&&(r=r.slice(0,-1*T*2),n=n.slice(0,-1*T),i=i.slice(0,-1*T)),r.push(this.productions_[_[1]][0]),n.push(x.$),i.push(x._$),S=a[r[r.length-2]][r[r.length-1]],r.push(S);break;case 3:return!0}}return!0}},or=r(23637).Wildcard,sr="http://www.w3.org/1999/02/22-rdf-syntax-ns#",cr=sr+"type",ur=sr+"first",lr=sr+"rest",dr=sr+"nil",pr="http://www.w3.org/2001/XMLSchema#",hr=pr+"integer",fr=pr+"decimal",yr=pr+"double",gr=pr+"boolean",mr="",br="",vr="";function _r(e){return e.toLowerCase()}function wr(e,t){return e.push(t),e}function Or(e,t){return e.push.apply(e,t),e}function Tr(e){e||(e={});for(var t,r=1,n=arguments.length;r>10),56320+(1023&i))}var a=Ur[n];if(!a)throw new Error;return a}))}catch(e){return""}if(Vr.exec(e))throw new Error("Invalid unicode codepoint of surrogate pair without corresponding codepoint in "+e);return e}function Qr(e,t,r){var n=[],i=[];return t.forEach((function(t){let r=null;t.annotation&&(r=t.annotation,t=t.object),n.push(Mr(null,e,t.entity,r)),Or(i,t.triples)})),Sr(n,r||[],i)}function Gr(e){return e.variable?e.variable.value:e.value||e.expression.value}function zr(e){if(!e)return[];if("aggregate"===e.type)return[e];if("operation"===e.type){const t=[];for(const r of e.args)t.push(...zr(r));return t}return[]}function Hr(e){const t=new Set,r=function(e){e&&("Variable"===e.termType?t.add(e):"operation"===e.type&&e.args.forEach(r))};return r(e),t}function Kr(e,t=1,r=[]){for(const n of e)t>0&&n instanceof Array?Kr(n,t-1,r):r.push(n);return r}function Xr(e){return"Variable"===e.termType}function Jr(e){if(e.triples){const t=[];for(const r of e.triples)Xr(r.subject)&&t.push(r.subject.value),Xr(r.predicate)&&t.push(r.predicate.value),Xr(r.object)&&t.push(r.object.value);return t}if(e.patterns){const t=[];for(const r of e.patterns)t.push(...Jr(r));return t}return[]}function Wr(e){if(!nn.sparqlStar)throw new Error("SPARQL-star support is not enabled");return e}function Yr(e,t,r){for(const n of t){const t=Mr("subject"in n?n.subject:e,n.predicate,n.object);r.push(t),n.annotations&&Yr(Cr(e,n.predicate,n.object),n.annotations,r)}}function Zr(e){if(nn.sparqlStar){const t=[];return e.forEach((e=>{const r=Mr(e.subject,e.predicate,e.object);t.push(r),e.annotations&&Yr(Cr(e.subject,e.predicate,e.object),e.annotations,t)})),t}return e}function en(e){for(const t of e){if("graph"===t.type&&"Variable"===t.name.termType)throw new Error("Detected illegal variable in GRAPH");if("bgp"===t.type||"graph"===t.type)for(const e of t.triples)if("Variable"===e.subject.termType||"Variable"===e.predicate.termType||"Variable"===e.object.termType)throw new Error("Detected illegal variable in BGP")}return e}function tn(e){for(const t of e)if("bgp"===t.type)for(const e of t.triples)if("BlankNode"===e.subject.termType||"BlankNode"===e.predicate.termType||"BlankNode"===e.object.termType)throw new Error("Detected illegal blank node in BGP");return e}var rn={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,r=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},test_match:function(e,t){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(n=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],r=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var e,t,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;at[0].length)){if(t=r,n=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(r,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[n]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{flex:!0,"case-insensitive":!0},performAction:function(e,t,r,n){switch(r){case 0:break;case 1:return 12;case 2:return 15;case 3:return 41;case 4:return 325;case 5:return 326;case 6:return 45;case 7:return 47;case 8:return 48;case 9:return 39;case 10:return 24;case 11:return 28;case 12:return 29;case 13:return 31;case 14:return 32;case 15:return 36;case 16:return 53;case 17:return 327;case 18:return 63;case 19:return 64;case 20:return 70;case 21:return 73;case 22:return 76;case 23:return 78;case 24:return 81;case 25:return 83;case 26:return 85;case 27:return 193;case 28:return 100;case 29:return 328;case 30:return 121;case 31:return 329;case 32:return 330;case 33:return 110;case 34:return 331;case 35:return 109;case 36:return 332;case 37:return 333;case 38:return 113;case 39:return 115;case 40:return 116;case 41:return 131;case 42:return 123;case 43:return 126;case 44:return 128;case 45:return 132;case 46:return 112;case 47:return 334;case 48:return 335;case 49:return 159;case 50:return 161;case 51:return 164;case 52:return 174;case 53:return 160;case 54:return 336;case 55:return 163;case 56:return 312;case 57:return 314;case 58:return 317;case 59:return 318;case 60:return 272;case 61:return 197;case 62:return 337;case 63:return 338;case 64:return 229;case 65:return 340;case 66:return 263;case 67:return 224;case 68:return 231;case 69:return 232;case 70:return 242;case 71:return 246;case 72:return 290;case 73:return 341;case 74:return 342;case 75:return 343;case 76:return 344;case 77:return 345;case 78:return 250;case 79:return 346;case 80:return 265;case 81:return 276;case 82:return 277;case 83:return 268;case 84:return 269;case 85:return 270;case 86:return 271;case 87:return 347;case 88:return 348;case 89:return 273;case 90:return 274;case 91:return 350;case 92:return 349;case 93:return 351;case 94:return 279;case 95:return 280;case 96:return 283;case 97:return 285;case 98:return 289;case 99:return 293;case 100:return 296;case 101:return 13;case 102:return 16;case 103:return 308;case 104:return 309;case 105:return 87;case 106:return 292;case 107:return 82;case 108:return 294;case 109:return 295;case 110:return 297;case 111:return 298;case 112:return 299;case 113:return 300;case 114:return 301;case 115:return 302;case 116:return"EXPONENT";case 117:return 303;case 118:return 304;case 119:return 305;case 120:return 306;case 121:return 89;case 122:return 310;case 123:return 6;case 124:return"INVALID";case 125:console.log(t.yytext)}},rules:[/^(?:\s+|(#[^\n\r]*))/i,/^(?:BASE)/i,/^(?:PREFIX)/i,/^(?:SELECT)/i,/^(?:DISTINCT)/i,/^(?:REDUCED)/i,/^(?:\()/i,/^(?:AS)/i,/^(?:\))/i,/^(?:\*)/i,/^(?:CONSTRUCT)/i,/^(?:WHERE)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:DESCRIBE)/i,/^(?:ASK)/i,/^(?:FROM)/i,/^(?:NAMED)/i,/^(?:GROUP)/i,/^(?:BY)/i,/^(?:HAVING)/i,/^(?:ORDER)/i,/^(?:ASC)/i,/^(?:DESC)/i,/^(?:LIMIT)/i,/^(?:OFFSET)/i,/^(?:VALUES)/i,/^(?:;)/i,/^(?:LOAD)/i,/^(?:SILENT)/i,/^(?:INTO)/i,/^(?:CLEAR)/i,/^(?:DROP)/i,/^(?:CREATE)/i,/^(?:ADD)/i,/^(?:TO)/i,/^(?:MOVE)/i,/^(?:COPY)/i,/^(?:INSERT((\s+|(#[^\n\r]*)\n\r?)+)DATA)/i,/^(?:DELETE((\s+|(#[^\n\r]*)\n\r?)+)DATA)/i,/^(?:DELETE((\s+|(#[^\n\r]*)\n\r?)+)WHERE)/i,/^(?:WITH)/i,/^(?:DELETE)/i,/^(?:INSERT)/i,/^(?:USING)/i,/^(?:DEFAULT)/i,/^(?:GRAPH)/i,/^(?:ALL)/i,/^(?:\.)/i,/^(?:OPTIONAL)/i,/^(?:SERVICE)/i,/^(?:BIND)/i,/^(?:UNDEF)/i,/^(?:MINUS)/i,/^(?:UNION)/i,/^(?:FILTER)/i,/^(?:<<)/i,/^(?:>>)/i,/^(?:\{\|)/i,/^(?:\|\})/i,/^(?:,)/i,/^(?:a)/i,/^(?:\|)/i,/^(?:\/)/i,/^(?:\^)/i,/^(?:\?)/i,/^(?:\+)/i,/^(?:!)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:\|\|)/i,/^(?:&&)/i,/^(?:=)/i,/^(?:!=)/i,/^(?:<)/i,/^(?:>)/i,/^(?:<=)/i,/^(?:>=)/i,/^(?:IN)/i,/^(?:NOT)/i,/^(?:-)/i,/^(?:BOUND)/i,/^(?:BNODE)/i,/^(?:(RAND|NOW|UUID|STRUUID))/i,/^(?:(LANG|DATATYPE|IRI|URI|ABS|CEIL|FLOOR|ROUND|STRLEN|STR|UCASE|LCASE|ENCODE_FOR_URI|YEAR|MONTH|DAY|HOURS|MINUTES|SECONDS|TIMEZONE|TZ|MD5|SHA1|SHA256|SHA384|SHA512|isIRI|isURI|isBLANK|isLITERAL|isNUMERIC))/i,/^(?:(SUBJECT|PREDICATE|OBJECT|isTRIPLE))/i,/^(?:(LANGMATCHES|CONTAINS|STRSTARTS|STRENDS|STRBEFORE|STRAFTER|STRLANG|STRDT|sameTerm))/i,/^(?:CONCAT)/i,/^(?:COALESCE)/i,/^(?:IF)/i,/^(?:TRIPLE)/i,/^(?:REGEX)/i,/^(?:SUBSTR)/i,/^(?:REPLACE)/i,/^(?:EXISTS)/i,/^(?:COUNT)/i,/^(?:SUM|MIN|MAX|AVG|SAMPLE)/i,/^(?:GROUP_CONCAT)/i,/^(?:SEPARATOR)/i,/^(?:\^\^)/i,/^(?:true|false)/i,/^(?:(<(?:[^<>\"\{\}\|\^`\\\u0000-\u0020])*>))/i,/^(?:((([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])(?:(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|\.)*(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040]))?)?:))/i,/^(?:(((([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])(?:(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|\.)*(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040]))?)?:)((?:((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|:|[0-9]|((%([0-9A-Fa-f])([0-9A-Fa-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))(?:(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|\.|:|((%([0-9A-Fa-f])([0-9A-Fa-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))*(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|:|((%([0-9A-Fa-f])([0-9A-Fa-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%)))))?)))/i,/^(?:(_:(?:((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|[0-9])(?:(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|\.)*(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040]))?))/i,/^(?:([\?\$]((?:((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|[0-9])(?:((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])*)))/i,/^(?:(@[a-zA-Z]+(?:-[a-zA-Z0-9]+)*))/i,/^(?:([0-9]+))/i,/^(?:([0-9]*\.[0-9]+))/i,/^(?:([0-9]+\.[0-9]*([eE][+-]?[0-9]+)|\.([0-9])+([eE][+-]?[0-9]+)|([0-9])+([eE][+-]?[0-9]+)))/i,/^(?:(\+([0-9]+)))/i,/^(?:(\+([0-9]*\.[0-9]+)))/i,/^(?:(\+([0-9]+\.[0-9]*([eE][+-]?[0-9]+)|\.([0-9])+([eE][+-]?[0-9]+)|([0-9])+([eE][+-]?[0-9]+))))/i,/^(?:(-([0-9]+)))/i,/^(?:(-([0-9]*\.[0-9]+)))/i,/^(?:(-([0-9]+\.[0-9]*([eE][+-]?[0-9]+)|\.([0-9])+([eE][+-]?[0-9]+)|([0-9])+([eE][+-]?[0-9]+))))/i,/^(?:([eE][+-]?[0-9]+))/i,/^(?:('(?:(?:[^\u0027\u005C\u000A\u000D])|(\\[tbnrf\\\"']|\\u([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])|\\U([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])))*'))/i,/^(?:("(?:(?:[^\u0022\u005C\u000A\u000D])|(\\[tbnrf\\\"']|\\u([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])|\\U([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])))*"))/i,/^(?:('''(?:(?:'|'')?(?:[^'\\]|(\\[tbnrf\\\"']|\\u([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])|\\U([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f]))))*'''))/i,/^(?:("""(?:(?:"|"")?(?:[^\"\\]|(\\[tbnrf\\\"']|\\u([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])|\\U([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f]))))*"""))/i,/^(?:(\((\u0020|\u0009|\u000D|\u000A)*\)))/i,/^(?:(\[(\u0020|\u0009|\u000D|\u000A)*\]))/i,/^(?:$)/i,/^(?:.)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125],inclusive:!0}}};function nn(){this.yy={}}return ar.lexer=rn,nn.prototype=ar,ar.Parser=nn,new nn}();e.exports=n},23637:e=>{class t{constructor(){return r||this}equals(e){return e&&this.termType===e.termType}}Object.defineProperty(t.prototype,"value",{enumerable:!0,value:"*"}),Object.defineProperty(t.prototype,"termType",{enumerable:!0,value:"Wildcard"});var r=new t;e.exports.Wildcard=t},98082:(e,t,r)=>{const{Parser:n}=r(83849),{Generator:i}=r(23825),{Wildcard:a}=r(23637),{DataFactory:o}=r(47793);e.exports={Parser:function({prefixes:e,baseIRI:t,factory:r,pathOnly:i,sparqlStar:a,skipValidation:s,skipUngroupedVariableCheck:c}={}){const u={};for(const t in e??{})u[t]=e[t];const l=new n;return l.parse=function(){return n.base=t||"",n.prefixes=Object.create(u),n.factory=r||new o,n.sparqlStar=Boolean(a),n.pathOnly=Boolean(i),n.skipValidation=Boolean(s)||Boolean(c),n.prototype.parse.apply(l,arguments)},l._resetBlanks=n._resetBlanks,l},Generator:i,Wildcard:a}},916:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(71142),t)},71142:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SparqlJsonParser=void 0;const n=r(47793),i=r(19198),a=r(50608);t.SparqlJsonParser=class{constructor(e){var t;e=e||{},this.dataFactory=e.dataFactory||new n.DataFactory,this.prefixVariableQuestionMark=!!e.prefixVariableQuestionMark,this.suppressMissingStreamResultsError=null===(t=e.suppressMissingStreamResultsError)||void 0===t||t}parseJsonResults(e){return e.results.bindings.map((e=>this.parseJsonBindings(e)))}parseJsonResultsStream(e){const t=e=>s.emit("error",e);e.on("error",t);const r=new a;r.onError=t;let n=!1,o=!1;r.onValue=e=>{if("vars"===r.key&&2===r.stack.length&&"head"===r.stack[1].key)s.emit("variables",e.map((e=>this.dataFactory.variable(e)))),n=!0;else if("results"===r.key&&1===r.stack.length)o=!0;else if("number"==typeof r.key&&3===r.stack.length&&"results"===r.stack[1].key&&"bindings"===r.stack[2].key)try{s.push(this.parseJsonBindings(e))}catch(e){s.emit("error",e)}else"metadata"===r.key&&1===r.stack.length&&s.emit("metadata",e)};const s=e.on("end",(e=>{o||this.suppressMissingStreamResultsError?n||s.emit("variables",[]):s.emit("error",new Error("No valid SPARQL query results were found."))})).pipe(new i.Transform({objectMode:!0,transform(e,t,n){r.write(e),n()}}));return s}parseJsonBindings(e){const t={};for(const r in e){const n=e[r];t[this.prefixVariableQuestionMark?"?"+r:r]=this.parseJsonValue(n)}return t}parseJsonValue(e){let t;switch(e.type){case"bnode":t=this.dataFactory.blankNode(e.value);break;case"literal":t=e["xml:lang"]?this.dataFactory.literal(e.value,e["xml:lang"]):e.datatype?this.dataFactory.literal(e.value,this.dataFactory.namedNode(e.datatype)):this.dataFactory.literal(e.value);break;case"typed-literal":t=this.dataFactory.literal(e.value,this.dataFactory.namedNode(e.datatype));break;case"triple":const r=e.value;if(!(r&&r.subject&&r.predicate&&r.object))throw new Error("Invalid quoted triple: "+JSON.stringify(e));t=this.dataFactory.quad(this.parseJsonValue(r.subject),this.parseJsonValue(r.predicate),this.parseJsonValue(r.object));break;default:t=this.dataFactory.namedNode(e.value)}return t}parseJsonBoolean(e){if("boolean"in e)return e.boolean;throw new Error("No valid ASK response was found.")}parseJsonBooleanStream(e){return new Promise(((t,r)=>{const n=new a;n.onError=r,n.onValue=e=>{"boolean"===n.key&&"boolean"==typeof e&&1===n.stack.length&&t(e)},e.on("error",r).on("data",(e=>n.write(e))).on("end",(()=>r(new Error("No valid ASK response was found."))))}))}}},12763:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(52875),t)},52875:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Converter=void 0;const n=r(99349),i=r(916);class a{constructor(e){(e=e||{delimiter:"_"}).prefixVariableQuestionMark=!1,this.delimiter=e.delimiter||"_",this.parser=new i.SparqlJsonParser(e),this.materializeRdfJsTerms=e.materializeRdfJsTerms}static addValueToTree(e,t,r,n,i,o){const s=t[0],c=n?n+o+s:s,u=i.singularizeVariables[c];if(1===t.length)u?e[s]||(e[s]=r):(e[s]||(e[s]=[]),e[s].push(r));else{let n;u?(e[s]||(e[s]={}),n=e[s]):(e[s]||(e[s]=[{}]),n=e[s][0]),a.addValueToTree(n,t.slice(1),r,c,i,o)}}static mergeTrees(e,t){if(typeof e!=typeof t)throw new Error(`Two incompatible tree nodes were found: ${typeof e} and ${typeof t}`);if(Array.isArray(e)!==Array.isArray(t))throw new Error(`Two incompatible tree nodes were found: Array?${Array.isArray(e)} and Array?${Array.isArray(t)}`);if("object"==typeof e&&"object"==typeof t){if(e.termType&&t.termType)return e.equals(t)?{valid:!0,result:e}:{valid:!1,result:e};if(Array.isArray(e)&&Array.isArray(t)){if(e.length>0){const r=[];let n=!1;for(const i of e){const e=a.mergeTrees(i,t[0]);e.valid?(n=!0,r.push(e.result)):r.push(i)}if(n)return{valid:!0,result:r}}return{valid:!0,result:e.concat(t)}}{const r={};for(const e in t)r[e]=t[e];for(const t in e)if(r[t]){const n=a.mergeTrees(e[t],r[t]);if(!n.valid)return{valid:!1,result:e};r[t]=n.result}else r[t]=e[t];return{valid:!0,result:r}}}throw new Error(`Unmergable tree types: ${typeof e} and ${typeof t}`)}static materializeTree(e){if(e.termType)return(0,n.getTermRaw)(e);if(Array.isArray(e))return e.map(a.materializeTree);{const t={};for(const r in e)t[r]=a.materializeTree(e[r]);return t}}sparqlJsonResultsToTree(e,t){return this.bindingsToTree(this.parser.parseJsonResults(e),t||{singularizeVariables:{}})}bindingsToTree(e,t){const r=t&&t.singularizeVariables[""];let n=r?{}:[];for(const i of e){const e=r?{}:[{}];for(const n in i){const o=n.split(this.delimiter),s=i[n];a.addValueToTree(r?e:e[0],o,s,"",t,this.delimiter)}n=a.mergeTrees(n,e).result}return this.materializeRdfJsTerms&&(n=a.materializeTree(n)),n}}t.Converter=a},75295:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(48642),t)},48642:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SparqlXmlParser=void 0;const n=r(47793),i=r(55201),a=r(19198);t.SparqlXmlParser=class{constructor(e){e=e||{},this.dataFactory=e.dataFactory||new n.DataFactory,this.prefixVariableQuestionMark=!!e.prefixVariableQuestionMark}parseXmlResultsStream(e){const t=e=>y.emit("error",e);e.on("error",t);const r=new i.SaxesParser,n=[];let o=!1,s=!1;const c=[];let u,l={},d="",p="",h="",f=[];r.on("error",t),r.on("opentag",(e=>{"variable"===e.name&&this.stackEquals(n,["sparql","head"])?c.push(this.dataFactory.variable(e.attributes.name)):"results"===e.name&&this.stackEquals(n,["sparql"])?s=!0:"result"===e.name&&this.stackEquals(n,["sparql","results"])?l={}:"binding"===e.name&&this.stackEquals(n,["sparql","results","result"])?(d=e.attributes.name||"",p="",u="",h="",f=[]):"triple"===e.name&&this.stackBeginsWith(n,["sparql","results","result"])?f.push({components:{}}):"triple"===n[n.length-1]&&this.stackBeginsWith(n,["sparql","results","result","binding"])?(p="",u="",h="",["subject","predicate","object"].includes(e.name)?f[f.length-1].currentComponent=e.name:t(new Error(`Illegal quoted triple component '${e.name}' found on line ${r.line+1}`))):this.stackBeginsWith(n,["sparql","results","result","binding"])&&(p=e.name,u="xml:lang"in e.attributes?e.attributes["xml:lang"]:"datatype"in e.attributes?this.dataFactory.namedNode(e.attributes.datatype):void 0),n.push(e.name)})),r.on("closetag",(e=>{if(this.stackEquals(n,["sparql","head"])&&(y.emit("variables",c),o=!0),this.stackEquals(n,["sparql","results","result"])&&y.push(l),this.stackBeginsWith(n,["sparql","results","result","binding"])){let e;if(!d&&p)t(new Error(`Terms should have a name on line ${r.line+1}`));else if("uri"===p)e=this.dataFactory.namedNode(h);else if("bnode"===p)e=this.dataFactory.blankNode(h);else if("literal"===p)e=this.dataFactory.literal(h,u);else if("triple"===n[n.length-1]){const n=f.pop();n&&n.components.subject&&n.components.predicate&&n.components.object?e=this.dataFactory.quad(n.components.subject,n.components.predicate,n.components.object):t(new Error(`Incomplete quoted triple on line ${r.line+1}`))}else p&&t(new Error(`Invalid term type '${p}' on line ${r.line+1}`));if(e)if(f.length>0){const n=f[f.length-1];n.components[n.currentComponent]&&t(new Error(`The ${n.currentComponent} in a quoted triple on line ${r.line+1} was already defined before`)),n.components[n.currentComponent]=e}else{const t=this.prefixVariableQuestionMark?"?"+d:d;l[t]=e}p=void 0}n.pop()})),r.on("text",(e=>{this.stackBeginsWith(n,["sparql","results","result","binding"])&&n[n.length-1]===p&&(h=e)}));const y=e.on("end",(e=>{s?o||y.emit("variables",[]):y.emit("error",new Error("No valid SPARQL query results were found."))})).pipe(new a.Transform({objectMode:!0,transform(e,t,n){r.write(e),n()}}));return y}parseXmlBooleanStream(e){return new Promise(((t,r)=>{const n=new i.SaxesParser,a=[];n.on("error",r),n.on("opentag",(e=>{a.push(e.name)})),n.on("closetag",(e=>{a.pop()})),n.on("text",(e=>{this.stackEquals(a,["sparql","boolean"])&&t("true"===e)})),e.on("error",r).on("data",(e=>n.write(e))).on("end",(()=>r(new Error("No valid ASK response was found."))))}))}stackEquals(e,t){return e.length===t.length&&e.every(((e,r)=>t[r]===e))}stackBeginsWith(e,t){return e.length>=t.length&&t.every(((t,r)=>e[r]===t))}}},43789:(e,t,r)=>{var n=r(13559);e.exports=function(e,t,r){"function"==typeof t&&(r=t,t=null);var i="",a=new n((function(r,n){e.on("data",(function(e){i+="string"==typeof t?e.toString(t):e.toString()})),e.on("end",(function(){r(i)})),e.on("error",n)}));return r&&a.then((function(e){r(null,e)}),r),a}},83141:(e,t,r)=>{"use strict";var n=r(92861).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=l,this.end=d,t=3;break;default:return this.write=p,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function p(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},22831:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NIL",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"v1",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"v3",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"v4",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"v5",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"validate",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return c.default}});var n=p(r(13518)),i=p(r(14948)),a=p(r(45073)),o=p(r(77186)),s=p(r(14808)),c=p(r(7775)),u=p(r(37037)),l=p(r(49910)),d=p(r(96792));function p(e){return e&&e.__esModule?e:{default:e}}},22311:(e,t)=>{"use strict";function r(e){return 14+(e+64>>>9<<4)+1}function n(e,t){const r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function i(e,t,r,i,a,o){return n((s=n(n(t,e),n(i,o)))<<(c=a)|s>>>32-c,r);var s,c}function a(e,t,r,n,a,o,s){return i(t&r|~t&n,e,t,a,o,s)}function o(e,t,r,n,a,o,s){return i(t&n|r&~n,e,t,a,o,s)}function s(e,t,r,n,a,o,s){return i(t^r^n,e,t,a,o,s)}function c(e,t,r,n,a,o,s){return i(r^(t|~n),e,t,a,o,s)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let r=0;r>5]>>>i%32&255,a=parseInt(n.charAt(r>>>4&15)+n.charAt(15&r),16);t.push(a)}return t}(function(e,t){e[t>>5]|=128<>5]|=(255&e[r/8])<{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};t.default=r},14808:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default="00000000-0000-0000-0000-000000000000"},96792:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(37037))&&n.__esModule?n:{default:n};t.default=function(e){if(!(0,i.default)(e))throw TypeError("Invalid UUID");let t;const r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r}},27656:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},2858:(e,t)=>{"use strict";let r;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){if(!r&&(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!r))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(n)};const n=new Uint8Array(16)},9042:(e,t)=>{"use strict";function r(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:case 3:return t^r^n;case 2:return t&r^t&n^r&n}}function n(e,t){return e<>>32-t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=function(e){const t=[1518500249,1859775393,2400959708,3395469782],i=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let r=0;r>>0;d=l,l=u,u=n(c,30)>>>0,c=o,o=s}i[0]=i[0]+o>>>0,i[1]=i[1]+c>>>0,i[2]=i[2]+u>>>0,i[3]=i[3]+l>>>0,i[4]=i[4]+d>>>0}return[i[0]>>24&255,i[0]>>16&255,i[0]>>8&255,255&i[0],i[1]>>24&255,i[1]>>16&255,i[1]>>8&255,255&i[1],i[2]>>24&255,i[2]>>16&255,i[2]>>8&255,255&i[2],i[3]>>24&255,i[3]>>16&255,i[3]>>8&255,255&i[3],i[4]>>24&255,i[4]>>16&255,i[4]>>8&255,255&i[4]]}},49910:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.unsafeStringify=o;var n,i=(n=r(37037))&&n.__esModule?n:{default:n};const a=[];for(let e=0;e<256;++e)a.push((e+256).toString(16).slice(1));function o(e,t=0){return a[e[t+0]]+a[e[t+1]]+a[e[t+2]]+a[e[t+3]]+"-"+a[e[t+4]]+a[e[t+5]]+"-"+a[e[t+6]]+a[e[t+7]]+"-"+a[e[t+8]]+a[e[t+9]]+"-"+a[e[t+10]]+a[e[t+11]]+a[e[t+12]]+a[e[t+13]]+a[e[t+14]]+a[e[t+15]]}t.default=function(e,t=0){const r=o(e,t);if(!(0,i.default)(r))throw TypeError("Stringified UUID is invalid");return r}},13518:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(2858))&&n.__esModule?n:{default:n},a=r(49910);let o,s,c=0,u=0;t.default=function(e,t,r){let n=t&&r||0;const l=t||new Array(16);let d=(e=e||{}).node||o,p=void 0!==e.clockseq?e.clockseq:s;if(null==d||null==p){const t=e.random||(e.rng||i.default)();null==d&&(d=o=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==p&&(p=s=16383&(t[6]<<8|t[7]))}let h=void 0!==e.msecs?e.msecs:Date.now(),f=void 0!==e.nsecs?e.nsecs:u+1;const y=h-c+(f-u)/1e4;if(y<0&&void 0===e.clockseq&&(p=p+1&16383),(y<0||h>c)&&void 0===e.nsecs&&(f=0),f>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");c=h,u=f,s=p,h+=122192928e5;const g=(1e4*(268435455&h)+f)%4294967296;l[n++]=g>>>24&255,l[n++]=g>>>16&255,l[n++]=g>>>8&255,l[n++]=255&g;const m=h/4294967296*1e4&268435455;l[n++]=m>>>8&255,l[n++]=255&m,l[n++]=m>>>24&15|16,l[n++]=m>>>16&255,l[n++]=p>>>8|128,l[n++]=255&p;for(let e=0;e<6;++e)l[n+e]=d[e];return t||(0,a.unsafeStringify)(l)}},14948:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=a(r(59025)),i=a(r(22311));function a(e){return e&&e.__esModule?e:{default:e}}var o=(0,n.default)("v3",48,i.default);t.default=o},59025:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=void 0,t.default=function(e,t,r){function n(e,n,o,s){var c;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=o(r(46140)),i=o(r(2858)),a=r(49910);function o(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t,r){if(n.default.randomUUID&&!t&&!e)return n.default.randomUUID();const o=(e=e||{}).random||(e.rng||i.default)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=o[e];return t}return(0,a.unsafeStringify)(o)}},77186:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=a(r(59025)),i=a(r(9042));function a(e){return e&&e.__esModule?e:{default:e}}var o=(0,n.default)("v5",80,i.default);t.default=o},37037:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(27656))&&n.__esModule?n:{default:n};t.default=function(e){return"string"==typeof e&&i.default.test(e)}},7775:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,i=(n=r(37037))&&n.__esModule?n:{default:n};t.default=function(e){if(!(0,i.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}},17024:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(32300),t)},32300:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateIri=t.IriValidationStrategy=void 0;const r=function(){const e="[!$&'()*+,;=]",t="%[a-fA-F0-9]{2}",r="([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",n=`${r}\\.${r}\\.${r}\\.${r}`,i="[a-fA-F0-9]{1,4}",a=`(${i}:${i}|${n})`,o="[a-zA-Z0-9\\-._~ -퟿豈-﷏ﷰ-￯𐀀-🿽𠀀-𯿽𰀀-𿿽񀀀-񏿽񐀀-񟿽񠀀-񯿽񰀀-񿿽򀀀-򏿽򐀀-򟿽򠀀-򯿽򰀀-򿿽󀀀-󏿽󐀀-󟿽󡀀-󯿽]",s=`(${o}|${t}|${e}|[:@])*`,c=`(${s})+`,u=`(${s})*`;return new RegExp(`^[a-zA-Z][a-zA-Z0-9+\\-.]*:(\\/\\/((${o}|${t}|${e}|:)*@)?(\\[(((${i}:){6}${a}|::(${i}:){5}${a}|(${i})?::(${i}:){4}${a}|((${i}:){0,1}${i})?::(${i}:){3}${a}|((${i}:){0,2}${i})?::(${i}:){2}${a}|((${i}:){0,3}${i})?::${i}:${a}|((${i}:){0,4}${i})?::${a}|((${i}:){0,5}${i})?::${i}|((${i}:){0,6}${i})?::)|v[a-fA-F0-9]+\\.(${e}|${e}|":)+)\\]|${n}|(${o}|${t}|${e})*)(:[0-9]*)?(\\/${u})*|\\/(${c}(\\/${u})*)?|${c}(\\/${u})*|)(\\?(${s}|[-󰀀-󿿽􀀀-􏿽]|[\\/?])*)?(#(${s}|[\\/?])*)?$`,"u")}(),n=/^[A-Za-z][\d+-.A-Za-z]*:[^\u0000-\u0020"<>\\^`{|}]*$/u;var i;!function(e){e.Strict="strict",e.Pragmatic="pragmatic",e.None="none"}(i=t.IriValidationStrategy||(t.IriValidationStrategy={})),t.validateIri=function(e,t=i.Strict){switch(t){case i.Strict:return r.test(e)?void 0:new Error(`Invalid IRI according to RFC 3987: '${e}'`);case i.Pragmatic:return n.test(e)?void 0:new Error(`Invalid IRI according to RDF Turtle: '${e}'`);case i.None:return;default:return new Error(`Not supported validation strategy "${t}"`)}}},31487:(e,t)=>{"use strict";function r(e){return e>=65&&e<=90||e>=97&&e<=122||58===e||95===e||8204===e||8205===e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}Object.defineProperty(t,"__esModule",{value:!0}),t.CHAR="\t\n\r -퟿-�𐀀-􏿿",t.S=" \t\r\n",t.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿",t.NAME_CHAR="-"+t.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",t.CHAR_RE=new RegExp("^["+t.CHAR+"]$","u"),t.S_RE=new RegExp("^["+t.S+"]+$","u"),t.NAME_START_CHAR_RE=new RegExp("^["+t.NAME_START_CHAR+"]$","u"),t.NAME_CHAR_RE=new RegExp("^["+t.NAME_CHAR+"]$","u"),t.NAME_RE=new RegExp("^["+t.NAME_START_CHAR+"]["+t.NAME_CHAR+"]*$","u"),t.NMTOKEN_RE=new RegExp("^["+t.NAME_CHAR+"]+$","u"),t.S_LIST=[32,10,13,9],t.isChar=function(e){return e>=32&&e<=55295||10===e||13===e||9===e||e>=57344&&e<=65533||e>=65536&&e<=1114111},t.isS=function(e){return 32===e||10===e||13===e||9===e},t.isNameStartChar=r,t.isNameChar=function(e){return r(e)||e>=48&&e<=57||45===e||46===e||183===e||e>=768&&e<=879||e>=8255&&e<=8256}},84797:(e,t)=>{"use strict";function r(e){return e>=65&&e<=90||e>=97&&e<=122||58===e||95===e||8204===e||8205===e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}Object.defineProperty(t,"__esModule",{value:!0}),t.CHAR="-퟿-�𐀀-􏿿",t.RESTRICTED_CHAR="-\b\v\f--„†-Ÿ",t.S=" \t\r\n",t.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿",t.NAME_CHAR="-"+t.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",t.CHAR_RE=new RegExp("^["+t.CHAR+"]$","u"),t.RESTRICTED_CHAR_RE=new RegExp("^["+t.RESTRICTED_CHAR+"]$","u"),t.S_RE=new RegExp("^["+t.S+"]+$","u"),t.NAME_START_CHAR_RE=new RegExp("^["+t.NAME_START_CHAR+"]$","u"),t.NAME_CHAR_RE=new RegExp("^["+t.NAME_CHAR+"]$","u"),t.NAME_RE=new RegExp("^["+t.NAME_START_CHAR+"]["+t.NAME_CHAR+"]*$","u"),t.NMTOKEN_RE=new RegExp("^["+t.NAME_CHAR+"]+$","u"),t.S_LIST=[32,10,13,9],t.isChar=function(e){return e>=1&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111},t.isRestrictedChar=function(e){return e>=1&&e<=8||11===e||12===e||e>=14&&e<=31||e>=127&&e<=132||e>=134&&e<=159},t.isCharAndNotRestricted=function(e){return 9===e||10===e||13===e||e>31&&e<127||133===e||e>159&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111},t.isS=function(e){return 32===e||10===e||13===e||9===e},t.isNameStartChar=r,t.isNameChar=function(e){return r(e)||e>=48&&e<=57||45===e||46===e||183===e||e>=768&&e<=879||e>=8255&&e<=8256}},60446:(e,t)=>{"use strict";function r(e){return e>=65&&e<=90||95===e||e>=97&&e<=122||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}Object.defineProperty(t,"__esModule",{value:!0}),t.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿",t.NC_NAME_CHAR="-"+t.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",t.NC_NAME_START_CHAR_RE=new RegExp("^["+t.NC_NAME_START_CHAR+"]$","u"),t.NC_NAME_CHAR_RE=new RegExp("^["+t.NC_NAME_CHAR+"]$","u"),t.NC_NAME_RE=new RegExp("^["+t.NC_NAME_START_CHAR+"]["+t.NC_NAME_CHAR+"]*$","u"),t.isNCNameStartChar=r,t.isNCNameChar=function(e){return r(e)||45===e||46===e||e>=48&&e<=57||183===e||e>=768&&e<=879||e>=8255&&e<=8256}},40259:e=>{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},28799:(e,t,r)=>{"use strict";function n(e){var t=this;if(t instanceof n||(t=new n),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 r=0,i=arguments.length;r1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=e(r,n.value,i),n=n.next;return r},n.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=e(r,n.value,i),n=n.prev;return r},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(tthis.length&&(t=this.length);for(var i=0,a=this.head;null!==a&&ithis.length&&(t=this.length);for(var i=this.length,a=this.tail;null!==a&&i>t;i--)a=a.prev;for(;null!==a&&i>e;i--,a=a.prev)r.push(a.value);return r},n.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,a=this.head;null!==a&&n{},75627:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isIterator=t.isIterable=t.isSourceExpression=t.isPromise=t.isEventEmitter=t.isFunction=t.range=t.union=t.fromIterable=t.fromIterator=t.fromArray=t.single=t.empty=t.wrap=t.WrappingIterator=t.ClonedIterator=t.UnionIterator=t.MultiTransformIterator=t.SimpleTransformIterator=t.TransformIterator=t.BufferedIterator=t.MappingIterator=t.DESTINATION=t.identity=t.IntegerIterator=t.ArrayIterator=t.SingletonIterator=t.EmptyIterator=t.AsyncIterator=t.DESTROYED=t.ENDED=t.CLOSED=t.CLOSING=t.OPEN=t.INIT=t.setTaskScheduler=t.getTaskScheduler=t.scheduleTask=t.LinkedList=void 0;const n=r(37007),i=r(40288);Object.defineProperty(t,"LinkedList",{enumerable:!0,get:function(){return i.LinkedList}});let a=r(34683).createTaskScheduler();t.scheduleTask=function(e){a(e)},t.getTaskScheduler=function(){return a},t.setTaskScheduler=function(e){a=e},t.INIT=1,t.OPEN=2,t.CLOSING=4,t.CLOSED=8,t.ENDED=16,t.DESTROYED=32;class o extends n.EventEmitter{constructor(e=t.OPEN){super(),this._readable=!1,this._state=e,this.on("newListener",s)}_changeState(e,r=!1){const n=e>this._state&&this._statethis.emit("end"))):this.emit("end"))),n}read(){return null}forEach(e,t){this.on("data",P(e,t))}close(){this._changeState(t.CLOSED)&&this._endAsync()}destroy(e){this.done||this._destroy(e,(t=>{(e=e||t)&&this.emit("error",e),this._end(!0)}))}_destroy(e,t){t()}_end(e=!1){this._changeState(e?t.DESTROYED:t.ENDED)&&(this._readable=!1,this.removeAllListeners("readable"),this.removeAllListeners("data"),this.removeAllListeners("end"))}_endAsync(){a((()=>this._end()))}get readable(){return this._readable}set readable(e){e=Boolean(e)&&!this.done,this._readable!==e&&(this._readable=e,e&&a((()=>this.emit("readable"))))}get closed(){return this._state>=t.CLOSING}get ended(){return this._state===t.ENDED}get destroyed(){return this._state===t.DESTROYED}get done(){return this._state>=t.ENDED}toString(){const e=this._toStringDetails();return`[${this.constructor.name}${e?` ${e}`:""}]`}_toStringDetails(){return""}toArray(e){const t=[],r="number"==typeof(null==e?void 0:e.limit)?e.limit:1/0;return this.ended||r<=0?Promise.resolve(t):new Promise(((e,n)=>{const i=()=>e(t),a=o=>{t.push(o),t.length>=r&&(this.removeListener("error",n),this.removeListener("data",a),this.removeListener("end",i),e(t))};this.on("error",n),this.on("data",a),this.on("end",i)}))}getProperty(e,t){const r=this._properties;if(!t)return r&&r[e];if(r&&e in r)a((()=>t(r[e])));else{let r;(r=this._propertyCallbacks)||(this._propertyCallbacks=r=Object.create(null)),e in r?r[e].push(t):r[e]=[t]}}setProperty(e,t){(this._properties||(this._properties=Object.create(null)))[e]=t;const r=this._propertyCallbacks||{},n=r[e];if(n){for(e in delete r[e],a((()=>{for(const e of n)e(t)})),r)return;delete this._propertyCallbacks}}getProperties(){const e=this._properties,t={};for(const r in e)t[r]=e[r];return t}setProperties(e){for(const t in e)this.setProperty(t,e[t])}copyProperties(e,t){for(const r of t)e.getProperty(r,(e=>this.setProperty(r,e)))}transform(e){return new S(this,e)}map(e,t){return new y(this,P(e,t))}filter(e,t){return this.map((function(r){return e.call(t||this,r)?r:null}))}uniq(e=f){const t=new Set;return this.filter((function(r){const n=e.call(this,r);return!t.has(n)&&(t.add(n),!0)}))}prepend(e){return this.transform({prepend:e})}append(e){return this.transform({append:e})}surround(e,t){return this.transform({prepend:e,append:t})}skip(e){return this.map((t=>e-- >0?null:t))}take(e){return this.transform({limit:e})}range(e,t){return this.transform({offset:e,limit:Math.max(t-e+1,0)})}clone(){return new I(this)}[Symbol.asyncIterator](){const e=this;let t=null,r=null,n=null;function i(){if(null!==t)if(null!==n)a(n);else if(e.done)t({done:!0,value:void 0}),t=r=null,o();else{const n=e.read();null!==n&&(t({done:!1,value:n}),t=r=null)}}function a(e){null!==r?(r(e),t=r=n=null,o()):null===n&&(n=e)}function o(){e.removeListener("readable",i),e.removeListener("end",i),e.removeListener("error",a)}return e.addListener("readable",i),e.addListener("end",i),e.addListener("error",a),{next:()=>new Promise(((e,n)=>{t=e,r=n,i()}))}}}function s(e){"data"===e&&(this.removeListener("newListener",s),u(this,"readable",c),this.readable&&a((()=>c.call(this))))}function c(){let e;for(;0!==this.listenerCount("data")&&null!==(e=this.read());)this.emit("data",e);0!==this.listenerCount("data")||this.done||(this.removeListener("readable",c),u(this,"newListener",s))}function u(e,t,r){e.listeners(t).includes(r)||e.on(t,r)}t.AsyncIterator=o;class l extends o{constructor(){super(),this._changeState(t.ENDED,!0)}}t.EmptyIterator=l;class d extends o{constructor(e){super(),this._item=e,null===e?this.close():this.readable=!0}read(){const e=this._item;return this._item=null,this.close(),e}_toStringDetails(){return null===this._item?"":`(${this._item})`}}t.SingletonIterator=d;class p extends o{constructor(e=[],{autoStart:t=!0,preserve:r=!0}={}){super();const n=r||!Array.isArray(e)?[...e]:e;this._index=0,this._sourceStarted=!1!==t,this._truncateThreshold=r?-1:64,this._sourceStarted&&0===n.length?this.close():this._buffer=n,this.readable=!0}read(){this._sourceStarted||(this._sourceStarted=!0);let e=null;return this._buffer&&(this._index=t&&this.close(),Promise.resolve(i)}}t.ArrayIterator=p;class h extends o{constructor({start:e=0,step:t=1,end:r}={}){super(),Number.isFinite(e)&&(e=Math.trunc(e)),this._next=e,Number.isFinite(t)&&(t=Math.trunc(t)),this._step=t;const n=t>=0,i=n?1/0:-1/0;Number.isFinite(r)?r=Math.trunc(r):r!==-i&&(r=i),this._last=r,!Number.isFinite(e)||(n?e>r:e=0?n>r:nthis._init(r))),this._sourceStarted=!1!==r}get maxBufferSize(){return this._maxBufferSize}set maxBufferSize(e){e!==1/0&&(e=Number.isFinite(e)?Math.max(Math.trunc(e),1):4),this._maxBufferSize!==e&&(this._maxBufferSize=e,this._state===t.OPEN&&this._fillBuffer())}_init(e){let r=!1;this._reading=!0,this._begin((()=>{if(r)throw new Error("done callback called multiple times");r=!0,this._reading=!1,this._changeState(t.OPEN),e?this._fillBufferAsync():this.readable=!0}))}_begin(e){e()}read(){if(this.done)return null;this._sourceStarted||(this._sourceStarted=!0);const e=this._buffer;let t;return e.empty?(t=null,this.readable=!1):t=e.shift(),!this._reading&&e.length0&&(this._pushedCount=0,this._reading=!0,this._read(e,(()=>{if(!e)throw new Error("done callback called multiple times");e=0,this._reading=!1,this.closed?this._completeClose():this._pushedCount&&(this.readable=!0,this._buffer.length{this._reading=!1,this._fillBuffer()})))}close(){this._reading?this._changeState(t.CLOSING):this._completeClose()}_completeClose(){this._changeState(t.CLOSED)&&(this._reading=!0,this._flush((()=>{if(!this._reading)throw new Error("done callback called multiple times");this._reading=!1,this._buffer.empty&&this._endAsync()})))}_destroy(e,t){this._buffer.clear(),t()}_flush(e){e()}_toStringDetails(){const e=this._buffer;return`{${e.empty?"":`next: ${e.first}, `}buffer: ${e.length}}`}}t.BufferedIterator=m;class b extends m{constructor(e,t=e||{}){super(t),this._boundPush=e=>this._push(e),L(e)||(e=t.source),C(e)?this.source=e:e&&(this._createSource=M(e)?()=>e:e,this._sourceStarted&&this._loadSourceAsync()),this._optional=Boolean(t.optional),this._destroySource=!1!==t.destroySource}get source(){return F(this._createSource)&&this._loadSourceAsync(),this._source}set source(e){const r=this._source=this._validateSource(e);r[t.DESTINATION]=this,this.done?this._destroySource&&r.destroy():r.done?this.close():(r.on("end",O),r.on("readable",T),r.on("error",_))}_loadSourceAsync(){F(this._createSource)&&(Promise.resolve(this._createSource()).then((e=>{delete this._createSource,this.source=e,this._fillBuffer()}),(e=>this.emit("error",e))),this._createSource=null)}_validateSource(e,t=!1){if(this._source||void 0!==this._createSource)throw new Error("The source cannot be changed after it has been set");return g(e,t)}_read(e,t){const r=()=>{this._pushedCountthis._readAndTransform(r,t))):t()};this._readAndTransform(r,t)}_readAndTransform(e,t){let r;const n=this.source;!n||n.done||null===(r=n.read())?t():this._optional?this._optionalTransform(r,e):this._transform(r,e,this._boundPush)}_optionalTransform(e,t){const r=this._pushedCount;this._transform(e,(()=>{r===this._pushedCount&&this._push(e),t()}),this._boundPush)}_transform(e,t,r){r(e),t()}_closeWhenDone(){this.close()}_end(e){const r=this._source;r&&(r.removeListener("end",O),r.removeListener("error",_),r.removeListener("readable",T),delete r[t.DESTINATION],this._destroySource&&r.destroy()),super._end(e)}}function v(){this[t.DESTINATION].readable=!0}function _(e){this[t.DESTINATION].emit("error",e)}function w(){this[t.DESTINATION].close()}function O(){this[t.DESTINATION]._closeWhenDone()}function T(){!1!==this[t.DESTINATION]._sourceStarted&&this[t.DESTINATION]._fillBuffer()}t.TransformIterator=b;class S extends b{constructor(e,t){if(super(e,t),this._offset=0,this._limit=1/0,this._filter=e=>!0,t=t||(L(e)?null:e)){const e=F(t)?t:t.transform,{limit:r,offset:n,filter:i,map:a,prepend:o,append:s}=t;n===1/0||r===-1/0?this._limit=0:(Number.isFinite(n)&&(this._offset=Math.max(Math.trunc(n),0)),Number.isFinite(r)&&(this._limit=Math.max(Math.trunc(r),0)),F(i)&&(this._filter=i),F(a)&&(this._map=a),this._transform=F(e)?e:null),o&&(this._prepender=C(o)?o:D(o)),s&&(this._appender=C(s)?s:D(s))}}_read(e,t){const r=()=>this._readAndTransformSimple(e,n,t);function n(){a(r)}this._readAndTransformSimple(e,n,t)}_readAndTransformSimple(e,t,r){let n;const{source:i}=this;if(i&&!i.done){for(0===this._limit&&this.close();!this.closed&&this._pushedCountthis._push(e);!e||e.done?t():(e.on("data",r),e.on("end",(function n(){e.removeListener("data",r),e.removeListener("end",n),t()})))}}t.SimpleTransformIterator=S,t.MultiTransformIterator=class extends b{constructor(e,t){if(super(e,t),this._transformerQueue=[],t){const e=F(t)?t:t.multiTransform;e&&(this._createTransformer=e)}}_read(e,r){const n=this._transformerQueue,i=this._optional;let a,o;for(;(a=n[0])&&a.transformer.done;){i&&null!==a.item&&(e--,this._push(a.item)),n.shift();const{transformer:t}=a;t.removeListener("end",T),t.removeListener("readable",T),t.removeListener("error",_)}const{source:s}=this;for(;s&&!s.done&&n.length0&&null!==(o=t.read());)this._push(o),i&&(a.item=null)}else s&&s.done&&this.close();r()}_createTransformer(e){return new d(e)}_closeWhenDone(){this._transformerQueue.length||this.close()}_end(e){if(super._end(e),this._destroySource)for(const e of this._transformerQueue)e.transformer.destroy()}};class E extends m{constructor(e,t={}){super(t),this._sources=[],this._currentSource=-1;const r=!1!==t.autoStart;if(C(e))e.on("error",(e=>this.emit("error",e))),this._pending={loading:!1,sources:e},r&&this._loadSources();else if(Array.isArray(e)&&e.length>0)for(const t of e)this._addSource(t);else r&&this.close();this._destroySources=!1!==t.destroySources}_loadSources(){const e=this._pending.sources;this._pending.loading=!0,e.done?(delete this._pending,this.close()):(e.on("data",(e=>{this._addSource(e),this._fillBufferAsync()})),e.on("end",(()=>{delete this._pending,this._fillBuffer()})))}_addSource(e){M(e)&&(e=N(e)),e.done||(this._sources.push(e),e[t.DESTINATION]=this,e.on("error",_),e.on("readable",T),e.on("end",x))}_removeEmptySources(){this._sources=this._sources.filter(((e,t)=>(e.done&&t<=this._currentSource&&this._currentSource--,!e.done))),this._fillBuffer()}_read(e,t){var r;!1===(null===(r=this._pending)||void 0===r?void 0:r.loading)&&this._loadSources();let n,i=0;for(;i!==(i=e);)for(let t=0;t0;t++)this._currentSource=(this._currentSource+1)%this._sources.length,null!==(n=this._sources[this._currentSource].read())&&(e--,this._push(n));this._pending||0!==this._sources.length||this.close(),t()}_end(e=!1){if(super._end(e),this._destroySources){for(const e of this._sources)e.destroy();this._pending&&(this._pending.sources.destroy(),delete this._pending)}}}function x(){this[t.DESTINATION]._removeEmptySources()}t.UnionIterator=E;class I extends b{constructor(e){super(e,{autoStart:!1}),this._readPosition=0,this._reading=!1,e&&(this.readable=!0)}_init(){}close(){o.prototype.close.call(this)}get source(){return super.source}set source(e){const r=this._source=this._validateSource(e),n=r&&r[t.DESTINATION]||(r[t.DESTINATION]=new A(r));this.done?this._destroySource&&r.destroy():n.endsAt(0)?this.close():(n.register(this),!1!==r._sourceStarted&&null===n.readAt(0)||(this.readable=!0));const i=this._propertyCallbacks;for(const e in i){const t=i[e];for(const r of t)this._getSourceProperty(e,r)}}_validateSource(e,r=!1){const n=e&&e[t.DESTINATION];return super._validateSource(e,!n||n instanceof A)}getProperty(e,t){const{source:r}=this,n=this._properties,i=n&&e in n;if(!t)return i?n&&n[e]:r&&r.getProperty(e);super.getProperty(e,t),r&&!i&&this._getSourceProperty(e,t)}_getSourceProperty(e,t){this.source.getProperty(e,(r=>{this._properties&&e in this._properties||t(r)}))}getProperties(){const e=this.source?this.source.getProperties():{},t=this._properties;for(const r in t)e[r]=t[r];return e}_toStringDetails(){return`{source: ${this.source?this.source.toString():"none"}}`}read(){this._sourceStarted||(this._sourceStarted=!0);const e=this.source;let r=null;if(!this.done&&e){const n=e[t.DESTINATION];null!==(r=n.readAt(this._readPosition))?this._readPosition++:this.readable=!1,n.endsAt(this._readPosition)&&this.close()}return r}_end(e){const r=this.source,n=null==r?void 0:r[t.DESTINATION];n&&n.unregister(this),m.prototype._end.call(this,e)}}t.ClonedIterator=I;class A{constructor(e){if(this._history=[],this._trackers=new Set,this._source=e,!e.done){const t=()=>{for(const e of this._trackers)e.readable=!0},r=e=>{for(const t of this._trackers)t.emit("error",e)},n=()=>{for(const e of this._trackers)!1!==e._sourceStarted&&e._readPosition===this._history.length&&e.close();this._trackers.clear(),e.removeListener("end",n),e.removeListener("error",r),e.removeListener("readable",t)};e.on("end",n),e.on("error",r),e.on("readable",t)}}register(e){this._source.done||this._trackers.add(e)}unregister(e){this._trackers.delete(e)}readAt(e){let t=null;return e{this._source=null,this.source=e})).catch((e=>this.emit("error",e)))):e&&(this.source=e)}set source(e){let r=e;if(null!==this._source)throw new Error("The source cannot be changed after it has been set");if(k(r)&&(r=r[Symbol.iterator]()),B(r)){let e=r;r=new n.EventEmitter,r.read=()=>{if(null!==e){let t;for(;!(t=e.next()).done;)if(null!==t.value)return t.value;e=null,this.close()}return null}}else r=g(r);this.done?this._destroySource&&F(r.destroy)&&r.destroy():(r[t.DESTINATION]=this,r.on("end",w),r.on("error",_),r.on("readable",v),this._source=r,this.readable=!1!==r.readable)}read(){if(null!==this._source&&!1!==this._source.readable){const e=this._source.read();if(null!==e)return e;this.readable=!1}return null}_end(e=!1){null!==this._source&&(this._source.removeListener("end",w),this._source.removeListener("error",_),this._source.removeListener("readable",v),delete this._source[t.DESTINATION],this._destroySource&&F(this._source.destroy)&&this._source.destroy(),this._source=null),super._end(e)}}function N(e,t){if(t&&("autoStart"in t||"optional"in t||"source"in t||"maxBufferSize"in t))return e&&!C(e)&&(e=new j(e)),new b(e,t);if(!e)return R();if(M(e))return new j(e,t);if(e instanceof o)return e;if(Array.isArray(e))return D(e);if(k(e)||B(e)||C(e))return new j(e,t);throw new TypeError(`Invalid source: ${e}`)}function R(){return new l}function D(e){return new p(e)}function P(e,t){return t?e.bind(t):e}function F(e){return"function"==typeof e}function C(e){return F(null==e?void 0:e.on)}function M(e){return F(null==e?void 0:e.then)}function L(e){return e&&(C(e)||M(e)||F(e))}function k(e){return e&&Symbol.iterator in e}function B(e){return F(null==e?void 0:e.next)}t.WrappingIterator=j,t.wrap=N,t.empty=R,t.single=function(e){return new d(e)},t.fromArray=D,t.fromIterator=function(e){return new j(e)},t.fromIterable=function(e){return new j(e)},t.union=function(e){return new E(e)},t.range=function(e,t,r){return new h({start:e,end:t,step:r})},t.isFunction=F,t.isEventEmitter=C,t.isPromise=M,t.isSourceExpression=L,t.isIterable=k,t.isIterator=B},40288:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedList=void 0,t.LinkedList=class{constructor(){this._length=0,this._head=null,this._tail=null}get length(){return this._length}get first(){var e;return null===(e=this._head)||void 0===e?void 0:e.value}get last(){var e;return null===(e=this._tail)||void 0===e?void 0:e.value}get empty(){return null===this._head}push(e){const t={value:e,next:null};null===this._tail?this._head=this._tail=t:this._tail.next=this._tail=t,this._length++}shift(){if(null===this._head)return;const{value:e,next:t}=this._head;return this._head=t,null===t&&(this._tail=null),this._length--,e}clear(){this._length=0,this._head=this._tail=null}}},34683:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTaskScheduler=void 0;const r=Promise.resolve(void 0);t.createTaskScheduler=function(){const e="function"==typeof queueMicrotask?queueMicrotask:e=>r.then(e),t="function"==typeof setImmediate?setImmediate:e=>setTimeout(e,0);let n=0,i=null;return r=>{null!==i?i.push(r):++n<100?e(r):(i=[r],t((()=>{for(const t of i)e(t);i=null,n=0})))}}},89096:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=void 0;const r="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,n=new Set,i="object"==typeof process&&process?process:{},a=(e,t,r,n)=>{"function"==typeof i.emitWarning?i.emitWarning(e,t,r,n):console.error(`[${r}] ${t}: ${e}`)};let o=globalThis.AbortController,s=globalThis.AbortSignal;if(void 0===o){s=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},o=class{constructor(){t()}signal=new s;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(const t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e="1"!==i.env?.LRU_CACHE_IGNORE_AC_WARNING;const t=()=>{e&&(e=!1,a("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}Symbol("type");const c=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),u=e=>c(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?l:null:null;class l extends Array{constructor(e){super(e),this.fill(0)}}class d{heap;length;static#e=!1;static create(e){const t=u(e);if(!t)return[];d.#e=!0;const r=new d(e,t);return d.#e=!1,r}constructor(e,t){if(!d.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class p{#t;#r;#n;#i;#a;#o;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#s;#c;#u;#l;#d;#p;#h;#f;#y;#g;#m;#b;#v;#_;#w;#O;#T;static unsafeExposeInternals(e){return{starts:e.#v,ttls:e.#_,sizes:e.#b,keyMap:e.#u,keyList:e.#l,valList:e.#d,next:e.#p,prev:e.#h,get head(){return e.#f},get tail(){return e.#y},free:e.#g,isBackgroundFetch:t=>e.#S(t),backgroundFetch:(t,r,n,i)=>e.#E(t,r,n,i),moveToTail:t=>e.#x(t),indexes:t=>e.#I(t),rindexes:t=>e.#A(t),isStale:t=>e.#j(t)}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#c}get size(){return this.#s}get fetchMethod(){return this.#a}get memoMethod(){return this.#o}get dispose(){return this.#n}get disposeAfter(){return this.#i}constructor(e){const{max:t=0,ttl:r,ttlResolution:i=1,ttlAutopurge:o,updateAgeOnGet:s,updateAgeOnHas:l,allowStale:h,dispose:f,disposeAfter:y,noDisposeOnSet:g,noUpdateTTL:m,maxSize:b=0,maxEntrySize:v=0,sizeCalculation:_,fetchMethod:w,memoMethod:O,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:E,allowStaleOnFetchAbort:x,ignoreFetchAbort:I}=e;if(0!==t&&!c(t))throw new TypeError("max option must be a nonnegative integer");const A=t?u(t):Array;if(!A)throw new Error("invalid max value: "+t);if(this.#t=t,this.#r=b,this.maxEntrySize=v||this.#r,this.sizeCalculation=_,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==O&&"function"!=typeof O)throw new TypeError("memoMethod must be a function if defined");if(this.#o=O,void 0!==w&&"function"!=typeof w)throw new TypeError("fetchMethod must be a function if specified");if(this.#a=w,this.#O=!!w,this.#u=new Map,this.#l=new Array(t).fill(void 0),this.#d=new Array(t).fill(void 0),this.#p=new A(t),this.#h=new A(t),this.#f=0,this.#y=0,this.#g=d.create(t),this.#s=0,this.#c=0,"function"==typeof f&&(this.#n=f),"function"==typeof y?(this.#i=y,this.#m=[]):(this.#i=void 0,this.#m=void 0),this.#w=!!this.#n,this.#T=!!this.#i,this.noDisposeOnSet=!!g,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!T,this.allowStaleOnFetchRejection=!!E,this.allowStaleOnFetchAbort=!!x,this.ignoreFetchAbort=!!I,0!==this.maxEntrySize){if(0!==this.#r&&!c(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!c(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#N()}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!l,this.ttlResolution=c(i)||0===i?i:1,this.ttlAutopurge=!!o,this.ttl=r||0,this.ttl){if(!c(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#R()}if(0===this.#t&&0===this.ttl&&0===this.#r)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){const e="LRU_CACHE_UNBOUNDED";(e=>!n.has(e))(e)&&(n.add(e),a("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",e,p))}}getRemainingTTL(e){return this.#u.has(e)?1/0:0}#R(){const e=new l(this.#t),t=new l(this.#t);this.#_=e,this.#v=t,this.#D=(n,i,a=r.now())=>{if(t[n]=0!==i?a:0,e[n]=i,0!==i&&this.ttlAutopurge){const e=setTimeout((()=>{this.#j(n)&&this.#P(this.#l[n],"expire")}),i+1);e.unref&&e.unref()}},this.#F=n=>{t[n]=0!==e[n]?r.now():0},this.#C=(r,a)=>{if(e[a]){const o=e[a],s=t[a];if(!o||!s)return;r.ttl=o,r.start=s,r.now=n||i();const c=r.now-s;r.remainingTTL=o-c}};let n=0;const i=()=>{const e=r.now();if(this.ttlResolution>0){n=e;const t=setTimeout((()=>n=0),this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=r=>{const a=this.#u.get(r);if(void 0===a)return 0;const o=e[a],s=t[a];return o&&s?o-((n||i())-s):1/0},this.#j=r=>{const a=t[r],o=e[r];return!!o&&!!a&&(n||i())-a>o}}#F=()=>{};#C=()=>{};#D=()=>{};#j=()=>!1;#N(){const e=new l(this.#t);this.#c=0,this.#b=e,this.#M=t=>{this.#c-=e[t],e[t]=0},this.#L=(e,t,r,n)=>{if(this.#S(t))return 0;if(!c(r)){if(!n)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof n)throw new TypeError("sizeCalculation must be a function");if(r=n(t,e),!c(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.#k=(t,r,n)=>{if(e[t]=r,this.#r){const r=this.#r-e[t];for(;this.#c>r;)this.#B(!0)}this.#c+=e[t],n&&(n.entrySize=r,n.totalCalculatedSize=this.#c)}}#M=e=>{};#k=(e,t,r)=>{};#L=(e,t,r,n)=>{if(r||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#I({allowStale:e=this.allowStale}={}){if(this.#s)for(let t=this.#y;this.#U(t)&&(!e&&this.#j(t)||(yield t),t!==this.#f);)t=this.#h[t]}*#A({allowStale:e=this.allowStale}={}){if(this.#s)for(let t=this.#f;this.#U(t)&&(!e&&this.#j(t)||(yield t),t!==this.#y);)t=this.#p[t]}#U(e){return void 0!==e&&this.#u.get(this.#l[e])===e}*entries(){for(const e of this.#I())void 0===this.#d[e]||void 0===this.#l[e]||this.#S(this.#d[e])||(yield[this.#l[e],this.#d[e]])}*rentries(){for(const e of this.#A())void 0===this.#d[e]||void 0===this.#l[e]||this.#S(this.#d[e])||(yield[this.#l[e],this.#d[e]])}*keys(){for(const e of this.#I()){const t=this.#l[e];void 0===t||this.#S(this.#d[e])||(yield t)}}*rkeys(){for(const e of this.#A()){const t=this.#l[e];void 0===t||this.#S(this.#d[e])||(yield t)}}*values(){for(const e of this.#I())void 0===this.#d[e]||this.#S(this.#d[e])||(yield this.#d[e])}*rvalues(){for(const e of this.#A())void 0===this.#d[e]||this.#S(this.#d[e])||(yield this.#d[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(const r of this.#I()){const n=this.#d[r],i=this.#S(n)?n.__staleWhileFetching:n;if(void 0!==i&&e(i,this.#l[r],this))return this.get(this.#l[r],t)}}forEach(e,t=this){for(const r of this.#I()){const n=this.#d[r],i=this.#S(n)?n.__staleWhileFetching:n;void 0!==i&&e.call(t,i,this.#l[r],this)}}rforEach(e,t=this){for(const r of this.#A()){const n=this.#d[r],i=this.#S(n)?n.__staleWhileFetching:n;void 0!==i&&e.call(t,i,this.#l[r],this)}}purgeStale(){let e=!1;for(const t of this.#A({allowStale:!0}))this.#j(t)&&(this.#P(this.#l[t],"expire"),e=!0);return e}info(e){const t=this.#u.get(e);if(void 0===t)return;const n=this.#d[t],i=this.#S(n)?n.__staleWhileFetching:n;if(void 0===i)return;const a={value:i};if(this.#_&&this.#v){const e=this.#_[t],n=this.#v[t];if(e&&n){const t=e-(r.now()-n);a.ttl=t,a.start=Date.now()}}return this.#b&&(a.size=this.#b[t]),a}dump(){const e=[];for(const t of this.#I({allowStale:!0})){const n=this.#l[t],i=this.#d[t],a=this.#S(i)?i.__staleWhileFetching:i;if(void 0===a||void 0===n)continue;const o={value:a};if(this.#_&&this.#v){o.ttl=this.#_[t];const e=r.now()-this.#v[t];o.start=Math.floor(Date.now()-e)}this.#b&&(o.size=this.#b[t]),e.unshift([n,o])}return e}load(e){this.clear();for(const[t,n]of e){if(n.start){const e=Date.now()-n.start;n.start=r.now()-e}this.set(t,n.value,n)}}set(e,t,r={}){if(void 0===t)return this.delete(e),this;const{ttl:n=this.ttl,start:i,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:s}=r;let{noUpdateTTL:c=this.noUpdateTTL}=r;const u=this.#L(e,t,r.size||0,o);if(this.maxEntrySize&&u>this.maxEntrySize)return s&&(s.set="miss",s.maxEntrySizeExceeded=!0),this.#P(e,"set"),this;let l=0===this.#s?void 0:this.#u.get(e);if(void 0===l)l=0===this.#s?this.#y:0!==this.#g.length?this.#g.pop():this.#s===this.#t?this.#B(!1):this.#s,this.#l[l]=e,this.#d[l]=t,this.#u.set(e,l),this.#p[this.#y]=l,this.#h[l]=this.#y,this.#y=l,this.#s++,this.#k(l,u,s),s&&(s.set="add"),c=!1;else{this.#x(l);const r=this.#d[l];if(t!==r){if(this.#O&&this.#S(r)){r.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:t}=r;void 0===t||a||(this.#w&&this.#n?.(t,e,"set"),this.#T&&this.#m?.push([t,e,"set"]))}else a||(this.#w&&this.#n?.(r,e,"set"),this.#T&&this.#m?.push([r,e,"set"]));if(this.#M(l),this.#k(l,u,s),this.#d[l]=t,s){s.set="replace";const e=r&&this.#S(r)?r.__staleWhileFetching:r;void 0!==e&&(s.oldValue=e)}}else s&&(s.set="update")}if(0===n||this.#_||this.#R(),this.#_&&(c||this.#D(l,n,i),s&&this.#C(s,l)),!a&&this.#T&&this.#m){const e=this.#m;let t;for(;t=e?.shift();)this.#i?.(...t)}return this}pop(){try{for(;this.#s;){const e=this.#d[this.#f];if(this.#B(!0),this.#S(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#T&&this.#m){const e=this.#m;let t;for(;t=e?.shift();)this.#i?.(...t)}}}#B(e){const t=this.#f,r=this.#l[t],n=this.#d[t];return this.#O&&this.#S(n)?n.__abortController.abort(new Error("evicted")):(this.#w||this.#T)&&(this.#w&&this.#n?.(n,r,"evict"),this.#T&&this.#m?.push([n,r,"evict"])),this.#M(t),e&&(this.#l[t]=void 0,this.#d[t]=void 0,this.#g.push(t)),1===this.#s?(this.#f=this.#y=0,this.#g.length=0):this.#f=this.#p[t],this.#u.delete(r),this.#s--,t}has(e,t={}){const{updateAgeOnHas:r=this.updateAgeOnHas,status:n}=t,i=this.#u.get(e);if(void 0!==i){const e=this.#d[i];if(this.#S(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#j(i))return r&&this.#F(i),n&&(n.has="hit",this.#C(n,i)),!0;n&&(n.has="stale",this.#C(n,i))}else n&&(n.has="miss");return!1}peek(e,t={}){const{allowStale:r=this.allowStale}=t,n=this.#u.get(e);if(void 0===n||!r&&this.#j(n))return;const i=this.#d[n];return this.#S(i)?i.__staleWhileFetching:i}#E(e,t,r,n){const i=void 0===t?void 0:this.#d[t];if(this.#S(i))return i;const a=new o,{signal:s}=r;s?.addEventListener("abort",(()=>a.abort(s.reason)),{signal:a.signal});const c={signal:a.signal,options:r,context:n},u=(n,i=!1)=>{const{aborted:o}=a.signal,s=r.ignoreFetchAbort&&void 0!==n;if(r.status&&(o&&!i?(r.status.fetchAborted=!0,r.status.fetchError=a.signal.reason,s&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),o&&!s&&!i)return l(a.signal.reason);const u=d;return this.#d[t]===d&&(void 0===n?u.__staleWhileFetching?this.#d[t]=u.__staleWhileFetching:this.#P(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,n,c.options))),n},l=n=>{const{aborted:i}=a.signal,o=i&&r.allowStaleOnFetchAbort,s=o||r.allowStaleOnFetchRejection,c=s||r.noDeleteOnFetchRejection,u=d;if(this.#d[t]===d&&(c&&void 0!==u.__staleWhileFetching?o||(this.#d[t]=u.__staleWhileFetching):this.#P(e,"fetch")),s)return r.status&&void 0!==u.__staleWhileFetching&&(r.status.returnedStale=!0),u.__staleWhileFetching;if(u.__returned===u)throw n};r.status&&(r.status.fetchDispatched=!0);const d=new Promise(((t,n)=>{const o=this.#a?.(e,i,c);o&&o instanceof Promise&&o.then((e=>t(void 0===e?void 0:e)),n),a.signal.addEventListener("abort",(()=>{r.ignoreFetchAbort&&!r.allowStaleOnFetchAbort||(t(void 0),r.allowStaleOnFetchAbort&&(t=e=>u(e,!0)))}))})).then(u,(e=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=e),l(e)))),p=Object.assign(d,{__abortController:a,__staleWhileFetching:i,__returned:void 0});return void 0===t?(this.set(e,p,{...c.options,status:void 0}),t=this.#u.get(e)):this.#d[t]=p,p}#S(e){if(!this.#O)return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof o}async fetch(e,t={}){const{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:s=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:l=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:h=this.allowStaleOnFetchAbort,context:f,forceRefresh:y=!1,status:g,signal:m}=t;if(!this.#O)return g&&(g.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,status:g});const b={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,ttl:a,noDisposeOnSet:o,size:s,sizeCalculation:c,noUpdateTTL:u,noDeleteOnFetchRejection:l,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:h,ignoreFetchAbort:p,status:g,signal:m};let v=this.#u.get(e);if(void 0===v){g&&(g.fetch="miss");const t=this.#E(e,v,b,f);return t.__returned=t}{const t=this.#d[v];if(this.#S(t)){const e=r&&void 0!==t.__staleWhileFetching;return g&&(g.fetch="inflight",e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}const i=this.#j(v);if(!y&&!i)return g&&(g.fetch="hit"),this.#x(v),n&&this.#F(v),g&&this.#C(g,v),t;const a=this.#E(e,v,b,f),o=void 0!==a.__staleWhileFetching&&r;return g&&(g.fetch=i?"stale":"refresh",o&&i&&(g.returnedStale=!0)),o?a.__staleWhileFetching:a.__returned=a}}async forceFetch(e,t={}){const r=await this.fetch(e,t);if(void 0===r)throw new Error("fetch() returned undefined");return r}memo(e,t={}){const r=this.#o;if(!r)throw new Error("no memoMethod provided to constructor");const{context:n,forceRefresh:i,...a}=t,o=this.get(e,a);if(!i&&void 0!==o)return o;const s=r(e,o,{options:a,context:n});return this.set(e,s,a),s}get(e,t={}){const{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:a}=t,o=this.#u.get(e);if(void 0!==o){const t=this.#d[o],s=this.#S(t);return a&&this.#C(a,o),this.#j(o)?(a&&(a.get="stale"),s?(a&&r&&void 0!==t.__staleWhileFetching&&(a.returnedStale=!0),r?t.__staleWhileFetching:void 0):(i||this.#P(e,"expire"),a&&r&&(a.returnedStale=!0),r?t:void 0)):(a&&(a.get="hit"),s?t.__staleWhileFetching:(this.#x(o),n&&this.#F(o),t))}a&&(a.get="miss")}#V(e,t){this.#h[t]=e,this.#p[e]=t}#x(e){e!==this.#y&&(e===this.#f?this.#f=this.#p[e]:this.#V(this.#h[e],this.#p[e]),this.#V(this.#y,e),this.#y=e)}delete(e){return this.#P(e,"delete")}#P(e,t){let r=!1;if(0!==this.#s){const n=this.#u.get(e);if(void 0!==n)if(r=!0,1===this.#s)this.#$(t);else{this.#M(n);const r=this.#d[n];if(this.#S(r)?r.__abortController.abort(new Error("deleted")):(this.#w||this.#T)&&(this.#w&&this.#n?.(r,e,t),this.#T&&this.#m?.push([r,e,t])),this.#u.delete(e),this.#l[n]=void 0,this.#d[n]=void 0,n===this.#y)this.#y=this.#h[n];else if(n===this.#f)this.#f=this.#p[n];else{const e=this.#h[n];this.#p[e]=this.#p[n];const t=this.#p[n];this.#h[t]=this.#h[n]}this.#s--,this.#g.push(n)}}if(this.#T&&this.#m?.length){const e=this.#m;let t;for(;t=e?.shift();)this.#i?.(...t)}return r}clear(){return this.#$("delete")}#$(e){for(const t of this.#A({allowStale:!0})){const r=this.#d[t];if(this.#S(r))r.__abortController.abort(new Error("deleted"));else{const n=this.#l[t];this.#w&&this.#n?.(r,n,e),this.#T&&this.#m?.push([r,n,e])}}if(this.#u.clear(),this.#d.fill(void 0),this.#l.fill(void 0),this.#_&&this.#v&&(this.#_.fill(0),this.#v.fill(0)),this.#b&&this.#b.fill(0),this.#f=0,this.#y=0,this.#g.length=0,this.#c=0,this.#s=0,this.#T&&this.#m){const e=this.#m;let t;for(;t=e?.shift();)this.#i?.(...t)}}}t.LRUCache=p},50952:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readableFromWeb=t.ReadableFromWeb=void 0;const n=r(19198);class i extends n.Readable{constructor(e,t){super(t),this.reader=e.getReader(),this.readerClosed=!1,this.reader.closed.then((()=>{this.readerClosed=!0})).catch((e=>{this.readerClosed=!0,this.destroy(e)}))}_read(){this.reader.read().then((e=>this.push(e.done?null:e.value))).catch((e=>this.destroy(e)))}destroy(e){return this.readerClosed||this.reader.cancel(e).then().catch((()=>{})),super.destroy(e)}}t.ReadableFromWeb=i,t.readableFromWeb=function(e,t){return new i(e,t)}},65806:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readableFromWeb=void 0;var n=r(50952);Object.defineProperty(t,"readableFromWeb",{enumerable:!0,get:function(){return n.readableFromWeb}})}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};r.r(e),r.d(e,{anyAtomicType:()=>ze,anySimpleType:()=>Ge,anyURI:()=>ht,base64Binary:()=>pt,boolean:()=>Ye,byte:()=>St,date:()=>at,dateTime:()=>nt,dateTimeStamp:()=>Pt,dayTimeDuration:()=>Dt,decimal:()=>Ze,double:()=>tt,duration:()=>rt,float:()=>et,gDay:()=>ut,gMonth:()=>lt,gMonthDay:()=>ct,gYear:()=>st,gYearMonth:()=>ot,hexBinary:()=>dt,int:()=>Ot,integer:()=>bt,language:()=>mt,long:()=>wt,negativeInteger:()=>_t,nonNegativeInteger:()=>Et,nonPositiveInteger:()=>vt,normalizedString:()=>yt,positiveInteger:()=>Nt,short:()=>Tt,string:()=>We,time:()=>it,token:()=>gt,unsignedByte:()=>jt,unsignedInt:()=>It,unsignedLong:()=>xt,unsignedShort:()=>At,yearMonthDuration:()=>Rt});var t=r(33291),n=r(86987),i=r(30611),a=r(40090);const o=function(e){return"<"+e.value+">"},s=/["\\\\\n\r]/,c=/["\\\\\n\r]/g,u={'"':'\\"',"\\":"\\\\","\n":"\\n","\r":"\\r"};function l(e){return u[e]}const d=function e(t){if(!t)return null;if("BlankNode"===t.termType)return"_:"+t.value;if("DefaultGraph"===t.termType)return"";if("Literal"===t.termType)return function(e){const t=(r=e.value,s.test(r)?r.replace(c,l):r);var r;return"http://www.w3.org/2001/XMLSchema#string"===e.datatype.value?'"'+t+'"':"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"===e.datatype.value?'"'+t+'"@'+e.language:'"'+t+'"^^'+o(e.datatype)}(t);if("NamedNode"===t.termType)return o(t);if("Quad"===t.termType||t.subject&&t.predicate&&t.object&&t.graph)return function(e,t){const r=t(e.subject),n=t(e.predicate),i=t(e.object),a=t(e.graph);return`${r} ${n} ${i} ${a?a+" ":""}.`}(t,e);if("Variable"===t.termType)return"?"+t.value;if(t[Symbol.iterator])return function(e,t){return[...e].map((e=>t(e))).join("\n")+"\n"}(t,e);throw new Error(`unknown termType ${t.termType}`)};class p{constructor(e){if(this.index=new Map,e)for(const[t,r]of e)this.set(t,r)}get size(){return this.index.size}clear(){this.index.clear()}delete(e){return this.index.delete(d(e))}*entries(){for(const[,{term:e,value:t}]of this.index)yield[e,t]}forEach(e,t){for(const r of this.entries())e.call(t,r[1],r[0],this)}get(e){const t=this.index.get(d(e));return t&&t.value}has(e){return this.index.has(d(e))}*keys(){for(const[,{term:e}]of this.index)yield e}set(e,t){const r=d(e);return this.index.set(r,{term:e,value:t}),this}*values(){for(const[,{value:e}]of this.index)yield e}[Symbol.iterator](){return this.entries()[Symbol.iterator]()}}const h=p;function f(e,{factory:t}){const r=function(e,{factory:t}){const r=y(e,{factory:t});return e=>{const n=r(e.subject),i=r(e.predicate),a=r(e.object);return n===e.subject&&i===e.predicate&&a===e.object?e:t.quad(n,i,a,e.graph)}}(e,{factory:t});return e=>{for(const t of[...e]){const n=r(t);n!==t&&(e.delete(t),e.add(n))}}}function y(e,{factory:t}){return r=>"NamedNode"!==r.termType||/^[a-z]+:\/\//.test(r.value)?r:t.namedNode(new URL(r.value,e.value).toString())}const g=/^[a-z][a-z0-9+.-]*:/;function m(e,t,{factory:r}){const n=function(e,t,{factory:r}){const n=function(e,t,{factory:r}){return n=>"NamedNode"!==n.termType?n:n.value.startsWith(e.value)?g.test(n.value)!==g.test(e.value)?n:r.namedNode(t.value+n.value.slice(e.value.length)):n}(e,t,{factory:r});return e=>{const t=n(e.subject),i=n(e.predicate),a=n(e.object);return t===e.subject&&i===e.predicate&&a===e.object?e:r.quad(t,i,a,e.graph)}}(e,t,{factory:r});return e=>{for(const t of[...e]){const r=n(t);r!==t&&(e.delete(t),e.add(r))}}}function b(e,t,{factory:r}){const n=function(e,t,{factory:r}){const n=function(e,t){return r=>r.equals(e)?t:r}(e,t);return e=>{const t=n(e.subject),i=n(e.predicate),a=n(e.object);return t===e.subject&&i===e.predicate&&a===e.object?e:r.quad(t,i,a,e.graph)}}(e,t,{factory:r});return t=>{const r=[...t.match(e),...t.match(null,e),...t.match(null,null,e)];for(const e of r){const r=n(e);r!==e&&(t.delete(e),t.add(r))}}}function v(e){try{return d(e)}catch(e){return null}}class _{constructor(e){if(this.index=new Map,e)for(const t of e)this.add(t)}get size(){return this.index.size}add(e){const t=d(e);return this.index.has(t)||this.index.set(t,e),this}clear(){this.index.clear()}delete(e){return!!e&&this.index.delete(v(e))}entries(){return this.values().entries()}forEach(e,t){return this.values().forEach(e,t)}has(e){return!!e&&this.index.has(v(e))}values(){return new Set(this.index.values())}keys(){return this.values()}[Symbol.iterator](){return this.index.values()}}const w=_,O=class{constructor({dataset:e,end:t,quad:r,start:n}){this.dataset=e,this.end=t,this.quad=r,this.start=n}get term(){return this.quad[this.end]}get graph(){return this.quad.graph}get startTerm(){return this.quad[this.start]}};class T{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}T.prototype.termType="BlankNode";const S=T;class E{equals(e){return!!e&&e.termType===this.termType}}E.prototype.termType="DefaultGraph",E.prototype.value="";const x=E,I=function(e,t){if(!t)return null;if("BlankNode"===t.termType)return e.blankNode(t.value);if("DefaultGraph"===t.termType)return e.defaultGraph();if("Literal"===t.termType)return e.literal(t.value,t.language||e.namedNode(t.datatype.value));if("NamedNode"===t.termType)return e.namedNode(t.value);if("Quad"===t.termType){const r=e.fromTerm(t.subject),n=e.fromTerm(t.predicate),i=e.fromTerm(t.object),a=e.fromTerm(t.graph);return e.quad(r,n,i,a)}if("Variable"===t.termType)return e.variable(t.value);throw new Error(`unknown termType ${t.termType}`)};class A{constructor(e,t,r){this.value=e,this.language=t,this.datatype=r}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value&&e.language===this.language&&e.datatype.equals(this.datatype)}}A.prototype.termType="Literal";const j=A;class N{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}N.prototype.termType="NamedNode";const R=N;class D{constructor(e,t,r,n){this.subject=e,this.predicate=t,this.object=r,this.graph=n}equals(e){return!!e&&("Quad"===e.termType||!e.termType)&&e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)}}D.prototype.termType="Quad",D.prototype.value="";const P=D;class F{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}F.prototype.termType="Variable";const C=F,M=new R("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),L=new R("http://www.w3.org/2001/XMLSchema#string");class k{constructor(){this.init()}init(){this._data={blankNodeCounter:0,defaultGraph:new x}}namedNode(e){return new R(e)}blankNode(e){return e=e||"b"+ ++this._data.blankNodeCounter,new S(e)}literal(e,t){return"string"==typeof t?new j(e,t,M):new j(e,"",t||L)}variable(e){return new C(e)}defaultGraph(){return this._data.defaultGraph}quad(e,t,r,n=this.defaultGraph()){return new P(e,t,r,n)}fromTerm(e){return I(this,e)}fromQuad(e){return I(this,e)}}k.exports=["blankNode","defaultGraph","fromQuad","fromTerm","literal","namedNode","quad","variable"];const B=new k,U={apply:(e,t,r)=>e(r[0]),get:(e,t)=>e(t)},V=function(e,{factory:t=B}={}){const r=(r="")=>t.namedNode(`${e}${r.raw||r}`);return"undefined"==typeof Proxy?r:new Proxy(r,U)},$=(V("http://www.w3.org/2001/XMLSchema#"),V("http://www.w3.org/1999/02/22-rdf-syntax-ns#"));V("http://www.w3.org/2000/01/rdf-schema#");class q{static add({ptr:e,start:t,end:r,subjects:n=[null],predicates:i=[null],objects:a=[null],graphs:o,callback:s}={}){if(!e.factory)throw new Error("add operation requires a factory");let c=()=>{};s&&(c=n=>{s(new O({dataset:e.dataset,start:t,end:r,quad:n}))});for(const r of n)for(const n of i)for(const i of a)for(const a of o){const o={subject:r,predicate:n,object:i,graph:a};o[t]=e.term;const s=e.factory.quad(o.subject,o.predicate,o.object,o.graph);e.dataset.add(s),c(s)}return e}static addList({ptr:e,predicates:t,items:r,graphs:n}){if(e.isAny())throw new Error("can't attach a list to an any ptr");for(const i of t)for(const t of n){const n=r.map((()=>e.factory.blankNode()));e.dataset.add(e.factory.quad(e.term,i,n[0]||$.nil,t));for(let i=0;i!u.has(e.term)))),e=c,l=[...l,...c],u=new w(l.map((e=>e.term)))}while(c.length>0);return l}static traverseOne({ptr:e,start:t,end:r,subjects:n,predicates:i,objects:a,graphs:o,callback:s=(e,t)=>t.extend(e)}={}){const c=[];for(const u of n)for(const n of i)for(const i of a)for(const a of o){const o={subject:u,predicate:n,object:i,graph:a};o[t]=e.term;for(const n of e.dataset.match(o.subject,o.predicate,o.object,o.graph))c.push(s(new O({dataset:e.dataset,end:r,quad:n,start:t}),e))}return c}}const Q=q;function G(e,t){return t?r=>t(e.extend(r)):()=>{}}const z=class{constructor({dataset:e,edges:t=[],factory:r,graph:n,term:i}){if(!e&&0===t.length)throw new Error("dataset or edges is required");if(0===t.length&&void 0===i)throw new Error("edges or term must be given");if(t.length>0&&i)throw new Error("edges or term must be given");this.dataset=e||t[t.length-1].dataset,this.edges=t,this.factory=r,this._graph=n,0===t.length&&(this._term=i)}get edge(){return this.edges[this.edges.length-1]}get graph(){return"object"==typeof this._graph?this._graph:this.edge&&this.edge.graph}get length(){return void 0!==this._term?1:this.edges.length+1}get startTerm(){return this._term||this.edges[0].startTerm}get term(){return void 0!==this._term?this._term:this.edge.term}get value(){const e=this.term;return null===e?void 0:e.value}addIn(e,t,r){return Q.add({ptr:this,start:"object",end:"subject",subjects:t,predicates:e,graphs:[this.graph||this.factory.defaultGraph()],callback:G(this,r)})}addList(e,t){return Q.addList({ptr:this,predicates:e,graphs:[this.graph||this.factory.defaultGraph()],items:t})}addOut(e,t,r){return Q.add({ptr:this,start:"subject",end:"object",predicates:e,objects:t,graphs:[this.graph||this.factory.defaultGraph()],callback:G(this,r)})}deleteIn(e,t){return Q.delete({ptr:this,start:"object",subjects:t,predicates:e})}deleteList(e){return Q.deleteList({ptr:this,predicates:e})}deleteOut(e,t){return Q.delete({ptr:this,start:"subject",predicates:e,objects:t})}execute({operation:e,quantifier:t,start:r,end:n,subjects:i,predicates:a,objects:o,graphs:s,items:c,callback:u}){return Q.execute({ptr:this,operation:e,quantifier:t,start:r,end:n,subjects:i,predicates:a,objects:o,graphs:s,items:c,callback:u})}extend(e){return new this.constructor({dataset:this.dataset,edges:[...this.edges,e],factory:this.factory,graph:this._graph})}hasIn(e,t){return Q.traverse({ptr:this,start:"object",end:"object",subjects:t,predicates:e,graphs:[this.graph]})}hasOut(e,t){return Q.traverse({ptr:this,start:"subject",end:"subject",predicates:e,objects:t,graphs:[this.graph]})}in(e,t){return Q.traverse({ptr:this,start:"object",end:"subject",subjects:t,predicates:e,graphs:[this.graph]})}isAny(){return!this.term}isList(){return Q.isList({ptr:this})}list(){return Q.list({ptr:this})}*nodes(){for(let e=0;ee?yield{dataset:this.edges[e].dataset,term:this.edges[e].startTerm}:this.edges.length===e&&(yield{dataset:this.edges[e-1].dataset,term:this.edges[e-1].term})}out(e,t){return Q.traverse({ptr:this,predicates:e,objects:t,graphs:[this.graph]})}*quads(){for(const{quad:e}of this.edges)yield e}trim(){return new this.constructor({dataset:this.dataset,factory:this.factory,graph:this.graph,term:this.term})}},H=function(e,{factory:t}){if(null===e)return null;if(void 0===e)return;if("string"==typeof e)return t.literal(e);if("URL"===e.constructor.name)return t.namedNode(e.toString());if(e.termType)return e;const r=e.term;if(void 0!==r)return r;throw new Error(`can't convert ${e.toString()} to a Term object`)},K=function(e,{dataset:t,factory:r,graph:n}){return null===e?null:void 0!==e?function(e){return e instanceof z}(e)?e:function(e){return"object"==typeof e.term&&"object"==typeof e.dataset}(e)?new z({dataset:e.dataset,graph:e.graph,term:e.term,factory:e.factory||r}):new z({dataset:t,graph:n,term:H(e,{factory:r}),factory:r}):void 0},X=function(e,{factory:t}){try{e=[H(e,{factory:t})]}catch(e){}return e[Symbol.iterator]&&(e=[...e]),e.map((e=>H(e,{factory:t})))},J=function(e,t){return e?e.equals(t):e===t};function W(e,t){return t?r=>t(new e.constructor({factory:e.factory,ptrs:[r]})):()=>{}}class Y{constructor({dataset:e,factory:t,ptrs:r,terms:n,graphs:i}){if(this.factory=t,r)this.ptrs=[...r];else{this.ptrs=[];for(const r of n||[null])for(const n of i||[null])this.ptrs.push(new z({dataset:e,factory:t,graph:n,term:r}))}}get dataset(){const e=new Set(this.datasets);return 1!==e.size?null:e[Symbol.iterator]().next().value}get datasets(){return this.ptrs.map((e=>e.dataset))}get term(){const e=new w(this.terms);if(1===e.size)return e[Symbol.iterator]().next().value}get terms(){return this.ptrs.map((e=>e.term))}get value(){const e=this.term;return null==e?void 0:e.value}get values(){return this.ptrs.map((e=>e.value))}addIn(e,t,r){const n=W(this,r);for(const r of this.ptrs)r.addIn(e,t,n);return this}addList(e,t){if(this.isAny())throw new Error("can't attach a list to an any ptr");for(const r of this.ptrs)r.addList(e,t);return this}addOut(e,t,r){const n=W(this,r);for(const r of this.ptrs)r.addOut(e,t,n);return this}clone(e){return new this.constructor({factory:this.factory,ptrs:this.ptrs,...e})}deleteIn(e,t){for(const r of this.ptrs)r.deleteIn(e,t);return this}deleteList(e){for(const t of this.ptrs)t.deleteList(e);return this}deleteOut(e,t){for(const r of this.ptrs)r.deleteOut(e,t);return this}distinct(){const e=this.ptrs.reduce(((e,t)=>(e.some((e=>{return n=t,(r=e).dataset===n.dataset&&!!J(r.graph,n.graph)&&!!J(r.term,n.term);var r,n}))||e.push(t.trim()),e)),[]);return this.clone({ptrs:e})}execute(e){return this.clone({ptrs:this.ptrs.flatMap((t=>t.execute(e)))})}executeAll(e){let t=this;for(const r of e)t=t.execute(r);return t}filter(e){return this.clone({ptrs:[...this].filter(e).map((e=>e.ptrs[0]))})}hasIn(e,t){return this.clone({ptrs:this.ptrs.flatMap((r=>r.hasIn(e,t)))})}hasOut(e,t){return this.clone({ptrs:this.ptrs.flatMap((r=>r.hasOut(e,t)))})}in(e,t){return this.clone({ptrs:this.ptrs.flatMap((r=>r.in(e,t)))})}isAny(){return this.ptrs.length>0&&this.ptrs.some((e=>e.isAny()))}isList(){return 1===this.ptrs.length&&this.ptrs[0].isList()}list(){if(!this.isList())return;const e=this.ptrs[0].list(),t=this;return function*(){for(const r of e)yield t.clone({ptrs:[r]})}()}map(e){return[...this].map(e)}node(e){const t=this.dataset,r=[...e].map((e=>new z({dataset:t,factory:this.factory,term:e})));return this.clone({ptrs:r})}out(e,t){return this.clone({ptrs:this.ptrs.flatMap((r=>r.out(e,t)))})}*quads(){for(const{edges:e}of this.ptrs)for(const{quad:t}of e)yield t}trim(){return this.clone({ptrs:this.ptrs.map((e=>e.trim()))})}*[Symbol.iterator](){for(const e of this.ptrs)yield this.clone({ptrs:[e]})}}const Z=Y,ee=class extends Z{constructor({dataset:e,factory:t,ptrs:r,term:n,terms:i,graph:a,graphs:o}){(n||i)&&(i=i||n),(a||o)&&(o=o||a),!r&&i&&(r=function(e,{dataset:t,factory:r,graph:n}){try{e=[K(e,{dataset:t,factory:r,graph:n})]}catch(e){}return e[Symbol.iterator]&&(e=[...e]),e.flatMap((e=>X(n,{factory:r}).flatMap((n=>K(e,{dataset:t,factory:r,graph:n})))))}(i,{dataset:e,factory:t,graph:o})),super({dataset:e,factory:t,ptrs:r,graphs:o})}_toTerm(e){return H(e,{factory:this.factory})}_toTermArray(e){return X(e,{factory:this.factory})}addIn(e,t,r){return"function"==typeof t&&(r=t,t=null),t||(t=[this.factory.blankNode()]),super.addIn(this._toTermArray(e),this._toTermArray(t),r)}addList(e,t){return super.addList(this._toTermArray(e),this._toTermArray(t))}addOut(e,t,r){return"function"==typeof t&&(r=t,t=null),t||(t=[this.factory.blankNode()]),super.addOut(this._toTermArray(e),this._toTermArray(t),r)}base(e){if(!e)throw new Error("base parameter is required");e=this._toTerm(e);for(const t of this.ptrs)f(e,{factory:this.factory})(t.dataset);return this.node(y(e,{factory:this.factory})(this.term))}best(e){return this.score(e,{limit:1})}deleteIn(e,t){return super.deleteIn(this._toTermArray(e),this._toTermArray(t))}deleteList(e){return super.deleteList(this._toTermArray(e))}deleteOut(e,t){return super.deleteOut(this._toTermArray(e),this._toTermArray(t))}hasIn(e,t){return super.hasIn(this._toTermArray(e),this._toTermArray(t))}hasOut(e,t){return super.hasOut(this._toTermArray(e),this._toTermArray(t))}in(e,t){return super.in(this._toTermArray(e),this._toTermArray(t))}out(e,t){return super.out(this._toTermArray(e),this._toTermArray(t))}node(e=null){return super.node(this._toTermArray(e))}rebase(e){if(!e)throw new Error("base parameter is required");e=this._toTerm(e);for(const t of this.ptrs)m(t.term,e,{factory:this.factory})(t.dataset);return this.node(e)}replace(e){if(!e)throw new Error("replacement parameter is required");e=this._toTerm(e);for(const t of this.ptrs)b(t.term,e,{factory:this.factory})(t.dataset);return this.node(e)}score(e,{limit:t=1/0,offset:r=0}={}){const n=(i=e(this),i.slice().sort(((e,t)=>{const r=t.score-e.score;return 0!==r?r:e.term.value.localeCompare(t.term.value)}))).slice(r,r+t).map((e=>new z({...e,factory:this.factory})));var i;return this.clone({ptrs:n})}};V("http://www.w3.org/2002/07/owl#");const te=V("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),re=V("http://www.w3.org/2000/01/rdf-schema#"),ne=V("http://www.w3.org/ns/shacl#"),ie=V("https://schemas.link/shacl-next#"),ae=V("http://www.w3.org/2001/XMLSchema#");var oe=r(58059);const se=class{constructor({details:e,factory:t,options:r,results:n=[]}={}){this.details=e,this.factory=t,this.options=r,this.results=n,this._conforms=oe((()=>!this.results.some((e=>e.severity.equals(ne.Info)||e.severity.equals(ne.Violation)||e.severity.equals(ne.Warning))))),this._ptr=oe((()=>this.build()))}get conforms(){return this._conforms()}get dataset(){return this.ptr.dataset}get ptr(){return this._ptr()}get term(){return this.ptr.term}build(){const e=new Z({dataset:this.factory.dataset(),factory:this.factory,terms:[this.factory.blankNode()]});e.addOut([te.type],[ne.ValidationReport]).addOut([ne.conforms],[this.factory.literal(this.conforms.toString(),ae.boolean)]);for(const t of this.results)e.addOut([ne.result],[this.factory.blankNode()],(e=>{t.build(e,this.options)}));return e}coverage(){return this.results.flatMap((e=>e.coverage()))}},ce=class{constructor({args:e={},constraintComponent:t,factory:r,focusNode:n,message:i=[],path:a,results:o=[],severity:s,shape:c,source:u=[],value:l,valuePaths:p=[]}={}){this.args=e,this.constraintComponent=t,this.factory=r,this.focusNode=n,this.path=a||c.path,this.results=o,this.severity=s,this.shape=c,this.source=u,this.value=l,this.valuePaths=p,this._message=oe((()=>(this.shape.message.length>0&&(i=this.shape.message),0===i.length&&(i=this.shape.ptr.node([this.constraintComponent]).out([ne.message]).terms),i.map((t=>r.literal(function(e,t){return Object.entries(t).reduce(((e,[t,r])=>(r&&r.termType&&(r=d(r)),e.replace(`{$${t}}`,r).replace(`{?${t}}`,r))),e)}(t.value,e),t.language||null))))))}get message(){return this._message()}build(e,{details:t}={}){e.addOut([te.type],[ne.ValidationResult]).addOut([ne.focusNode],this.focusNode.terms).addOut([ne.resultSeverity],[this.severity]).addOut([ne.sourceConstraint],this.source).addOut([ne.sourceConstraintComponent],[this.constraintComponent]).addOut([ne.sourceShape],this.shape.ptr.terms),this.message&&e.addOut([ne.resultMessage],this.message);const r=t=>"one"===t.quantifier?t.predicates.length>1?e.node([this.factory.blankNode()]).addList([ne.alternativePath],t.predicates):"object"===t.start?e.node([this.factory.blankNode()]).addOut([ne.inversePath],[t.predicates[0]]):e.node([t.predicates[0]]):"oneOrMore"===t.quantifier?e.node([this.factory.blankNode()]).addOut([ne.oneOrMorePath],[t.predicates[0]]):"zeroOrMore"===t.quantifier?e.node([this.factory.blankNode()]).addOut([ne.zeroOrMorePath],[t.predicates[0]]):"zeroOrOne"===t.quantifier?e.node([this.factory.blankNode()]).addOut([ne.zeroOrOnePath],[t.predicates[0]]):void 0;if(this.path&&(1===this.path.length?e.addOut([ne.resultPath],r(this.path[0]).terms):e.addList([ne.resultPath],this.path.map((e=>r(e).term)))),void 0!==this.value&&e.addOut([ne.value],this.value.terms),t)for(const r of this.results)e.addOut([ne.detail],[this.factory.blankNode()],(e=>{r.build(e,{details:t})}))}coverage(){return[...this.valuePaths.flatMap((e=>[...e.quads()])),...this.results.flatMap((e=>e.coverage()))]}};class ue{constructor({factory:e,focusNode:t,options:r={debug:!1,details:!1},processed:n=new Set,report:i=new se({factory:e,options:r}),results:a=new Map,shape:o,value:s,valueOrNode:c,valuePaths:u,values:l}={}){this.factory=e,this.focusNode=t,this.options=r,this.processed=n,this.report=i,this.results=a,this.shape=o,this.value=s,this.valuePaths=u,this.valueOrNode=c,this.values=l}create({child:e,focusNode:t=this.focusNode,shape:r=this.shape,value:n=this.value,valueOrNode:i=this.valueOrNode,valuePaths:a=this.valuePaths,values:o=this.values}={}){return new ue({factory:this.factory,focusNode:t,options:this.options,processed:this.processed,report:e?new se({factory:this.factory,options:this.options}):this.report,results:this.results,shape:r,value:n,valueOrNode:i,valuePaths:a,values:o})}id({shape:e=this.shape}={}){return`${d(e.ptr.term)} - ${d(this.focusNode.term)} - ${t=this.valuePaths,t?`{${t.map((e=>function(e){return e?`{${[...e.quads()].map((e=>d(e))).join(" ")}}`:"{}"}(e))).join(" ")}}`:"{}"}`;var t}result(e){const t=new ce({factory:this.factory,focusNode:this.focusNode,shape:this.shape,value:this.value,valuePaths:this.valuePaths,...e}),r=this.id();this.results.has(r)?this.results.get(r).add(t):this.results.set(r,new Set([t])),this.report.results.push(t)}debug(e,t){this.options.debug&&this.result({severity:ie.Debug,constraintComponent:e,...t})}trace(e,t){this.options.trace&&this.result({severity:ie.Trace,constraintComponent:e,...t})}test(e,t,r){e?this.debug(t,r):this.violation(t,r)}violation(e,t){this.result({constraintComponent:e,severity:this.shape.severity||ne.Violation,...t})}}const le=ue;function de(){return{generic:e=>{e.trace(ie.TraversalConstraintComponent,{args:{},message:[e.factory.literal("Traversal")],value:e.valueOrNode})}}}const pe=class{constructor(e){this.validations=new h(e)}compile(e){const t=e.validator.options.coverage;if(e.deactivated)return[];let r=!1;const n=new Set;for(const t of e.ptr.execute({start:"subject",end:"predicate"})){const e=this.validations.get(t.term);e&&(n.add(e),t.term.equals(ne.property)&&(r=!0))}return t&&e.isPropertyShape&&!r&&n.add(de),[...n].map((t=>t(e))).filter(Boolean)}};var he=r(99349);function fe(e){if("BlankNode"!==e.term.termType)return{quantifier:"one",start:"subject",end:"object",predicates:[e.term]};const t=e.out([ne.alternativePath]);if(1===t.ptrs.length&&t.ptrs[0].isList())return{quantifier:"one",start:"subject",end:"object",predicates:[...t.list()].map((e=>e.term))};const r=e.out([ne.inversePath]);if(r.term)return{quantifier:"one",start:"object",end:"subject",predicates:[r.term]};const n=e.out([ne.oneOrMorePath]);if(n.term)return{quantifier:"oneOrMore",start:"subject",end:"object",predicates:[n.term]};const i=e.out([ne.zeroOrMorePath]);if(i.term)return{quantifier:"zeroOrMore",start:"subject",end:"object",predicates:[i.term]};const a=e.out([ne.zeroOrOnePath]);return a.term?{quantifier:"zeroOrOne",start:"subject",end:"object",predicates:[a.term]}:void 0}const ye=class{constructor(e){this.shape=e,this._compiled=oe((()=>this.shape.validator.registry.compile(e)))}get compiled(){return this._compiled()}async validate(e){return 0===e.focusNode.dataset.size||(this.shape.isPropertyShape?await this.validateProperty(e):await this.validateNode(e)),e}async validateNode(e){const t=e.create({shape:this.shape,valueOrNode:e.value||e.focusNode});for(const e of this.compiled)e.node&&await e.node(t),e.generic&&await e.generic(t)}async validateProperty(e){let t;t=this.shape.isSparqlShape?e.focusNode:e.focusNode.executeAll(this.shape.path);const r=t.node(new w(t.terms)),n=[...t].reduce(((e,r)=>{const n=r.term,i=t.node([n]);return e.has(n)||e.set(n,{value:i,valuePaths:[]}),e.get(n).valuePaths.push(r),e}),new h).values(),i=e.create({shape:this.shape,values:r});for(const e of this.compiled)e.property&&await e.property(i);for(const{value:t,valuePaths:r}of n){const n=e.create({shape:this.shape,value:t,valueOrNode:t,valuePaths:r});for(const e of this.compiled)e.generic&&await e.generic(n)}}},ge=function(e){const t=new w,r=new Z({dataset:e.dataset,terms:e.terms}).execute({quantifier:"zeroOrMore",start:"object",end:"subject",predicates:[re.subClassOf]});for(const e of r.ptrs)for(const{term:r}of e.nodes())t.add(r);return t},me=class{constructor(e){this.targetClass=new w([...ge(e.hasOut([te.type],[ne.NodeShape])),...ge(e.out([ne.targetClass]))]),this.targetNode=e.out([ne.targetNode]).terms,this.targetObjectsOf=e.out([ne.targetObjectsOf]).terms,this.targetSubjectsOf=e.out([ne.targetSubjectsOf]).terms}resolve(e){const t=e.focusNode.node([null]),r=[...e.focusNode.hasOut([te.type],this.targetClass).ptrs,...e.focusNode.node(this.targetNode).ptrs,...t.execute({start:"object",end:"object",predicates:this.targetObjectsOf}).ptrs,...t.execute({start:"subject",end:"subject",predicates:this.targetSubjectsOf}).ptrs],n=e.focusNode.clone({ptrs:r});return n.node([...new w(n.terms)])}},be=class{constructor(e,{validator:t}){this.ptr=e,this.validator=t,this._deactivated=oe((()=>{const e=this.ptr.out([ne.deactivated]).term;return e&&(0,he.fromRdf)(e)})),this._message=oe((()=>this.ptr.out([ne.message]).terms)),this._path=oe((()=>function(e){return 0===e.terms.length?null:e.ptrs[0].isList()?[...e.list()].map((e=>fe(e))):[fe(e)]}(this.ptr.out([ne.path])))),this._severity=oe((()=>this.ptr.out([ne.severity]).term)),this._shapeValidator=oe((()=>new ye(this))),this._sparql=oe((()=>this.ptr.out([ne.sparql]))),this._targetResolver=oe((()=>new me(this.ptr)))}get deactivated(){return this._deactivated()}get isPropertyShape(){return Boolean(this.path)}get isSparqlShape(){return this.sparql.terms.length>0}get path(){return this._path()}get targetResolver(){return this._targetResolver()}get message(){return this._message()}get severity(){return this._severity()}get shapeValidator(){return this._shapeValidator()}get sparql(){return this._sparql()}resolveTargets(e){return this.targetResolver.resolve(e)}async validate(e){const t=e.id({shape:this});if(e.processed.has(t)){if(e.results.has(t))for(const r of e.results.get(t))e.report.results.push(r);return e}return e.processed.add(t),this.shapeValidator.validate(e)}};async function ve(e,t){return Promise.all(e.map(t))}function _e(e){return t=>{t.test(e.equals(t.valueOrNode.term),ne.HasValueConstraintComponent,{args:{hasValue:e},message:[t.factory.literal("Value must be {$hasValue}")]})}}function we(e){return t=>{const r=[...t.values].some((t=>e.equals(t.term)));t.test(r,ne.HasValueConstraintComponent,{args:{hasValue:e},message:[t.factory.literal("Missing expected value {$hasValue}")]})}}function Oe(e){return ae.dateTime.equals(e.datatype)&&/^.*(((\+|-)\d{2}:\d{2})|Z)$/.test(e.value)}const Te=function(e,t){if(!e||"Literal"!==e.termType)return null;if(!t||"Literal"!==t.termType)return null;if(Oe(e)!==Oe(t))return null;const r=(0,he.fromRdf)(e),n=(0,he.fromRdf)(t);return typeof r!=typeof n?null:"string"==typeof r?r.localeCompare(n):r-n};function Se(e){return t=>{const r=t.focusNode.out([e]),n=r.filter((e=>!e.term.equals(t.focusNode.term))),i=0!==r.terms.length&&0===n.terms.length;t.test(i,ne.EqualsConstraintComponent,{args:{equals:e},message:[t.factory.literal("Must have same values as {$equals}")],value:n.terms[0]&&t.focusNode.node([n.terms[0]])||t.focusNode})}}function Ee(e){return t=>{const r=new w(t.focusNode.out([e]).terms),n=new w(t.values.terms),i=[...[...n].filter((e=>!r.has(e))),...[...r].filter((e=>!n.has(e)))];for(const r of i)t.violation(ne.EqualsConstraintComponent,{args:{equals:e},message:[t.factory.literal("Must have same values as {$equals}")],value:t.focusNode.node([r])});0===i.length&&t.debug(ne.EqualsConstraintComponent,{args:{equals:e},message:[t.factory.literal("Must have same values as {$equals}")]})}}function xe(e,t,r,n){return async i=>{const a=[];let o=[];t&&(o=new Set(i.shape.ptr.in([ne.property]).out([ne.property]).out([ne.qualifiedValueShape]).filter((t=>!t.term.equals(e.ptr.term))).map((e=>i.shape.validator.shape(e)))));const s=(await async function(t){return(await Promise.all(t.map((t=>(async t=>{const r=(await e.validate(i.create({child:!0,focusNode:t}))).report;if(a.push(r.results),!r.conforms)return!1;if(0===o.length)return!0;if(i.options.debug||i.options.details){const e=await ve([...o],(async e=>(await e.validate(i.create({child:!0,focusNode:t}))).report));return a.push(e.flatMap((e=>e.results))),!e.every((e=>e.conforms))}return!await async function(e,t){for(const r of e)if(!await t(r))return!1;return!0}([...o],(async e=>(await e.validate(i.create({child:!0,focusNode:t}))).report.conforms))})(t))))).filter(Boolean)}(i.values)).length;null!==r&&i.test(s<=r,ne.QualifiedMaxCountConstraintComponent,{args:{qualifiedMaxCount:r,qualifiedValueShape:e.ptr.term,qualifiedValueShapesDisjoint:t},message:[i.factory.literal("More than {$qualifiedMaxCount} values have shape {$qualifiedValueShape}")],results:a.flat()}),null!==n&&i.test(s>=n,ne.QualifiedMinCountConstraintComponent,{args:{qualifiedMinCount:n,qualifiedValueShape:e.ptr.term,qualifiedValueShapesDisjoint:t},message:[i.factory.literal("Less than {$qualifiedMinCount} values have shape {$qualifiedValueShape}")],results:a.flat()})}}function Ie(e,t,r){return n=>{n.test(r.test(n.valueOrNode.term.value),ne.PatternConstraintComponent,{args:{flags:t,pattern:e},message:[n.factory.literal('Value does not match pattern "{$pattern}"')],value:n.valueOrNode})}}const Ae=V("http://www.w3.org/ns/shacl#"),je=V("https://schemas.link/shacl-next#"),Ne=class{constructor({results:e=[]}={}){this.results=e}get conforms(){return!this.results.some((e=>e.severity.equals(Ae.Info)||e.severity.equals(Ae.Violation)||e.severity.equals(Ae.Warning)))}},Re=class{constructor({args:e={},factory:t,message:r=[],severity:n=Ae.Violation}={}){this.severity=n,this.message=r.map((r=>t.literal(function(e,t){return Object.entries(t).reduce(((e,[t,r])=>(r&&r.termType&&(r=d(r)),e.replace(`{$${t}}`,r).replace(`{?${t}}`,r))),e)}(r.value,e),r.language||null)))}};class De{constructor({factory:e=B}={}){this.factory=e}clone({factory:e}={}){return new De({factory:e||this.factory})}validate(){return new Ne}validateSimple(){return!0}}const Pe=De;class Fe extends Pe{constructor({datatypes:e,factory:t}={}){super({factory:t}),this.datatypes=[];for(const t of Array.isArray(e)?e:[e])t&&this.datatypes.push(this.factory.fromTerm(t))}clone({factory:e}={}){return new Fe({datatypes:this.datatypes,factory:e||this.factory})}}const Ce=Fe,Me=class{constructor({factory:e=B,validations:t}={}){if(this.factory=e,this.validations=new h,t)for(const e of Object.values(t)){const t=e.clone({factory:this.factory});for(const e of t.datatypes)this.validations.set(e,t)}}validate(e){const t=this.validations.get(e.datatype);return t?t.validate(e):new Ne}validateSimple(e){const t=this.validations.get(e.datatype);return!t||t.validateSimple(e)}};class Le extends Ce{constructor(e,t,{factory:r}={}){super({datatypes:t,factory:r}),this.message=[this.factory.literal("term value {$this} matches pattern {$pattern}")],this.patterns=Array.isArray(e)?e:[e]}clone({factory:e}={}){return new Le(this.patterns,this.datatypes,{factory:e||this.factory})}validate(e){const t=this.patterns.map((t=>{let r;t.test(e.value)&&(r=je.Debug);const n={pattern:this.factory.literal(t.toString()),this:e};return new Re({args:n,factory:this.factory,message:this.message,severity:r})}));return new Ne({results:t})}validateSimple(e){return this.patterns.every((t=>t.test(e.value)))}}const ke=Le,Be=/^([-+]?[0-9]+)$/;class Ue extends ke{constructor(e=null,t=null,r,{factory:n}={}){super(Be,r,{factory:n}),this.maxInclusive=null,this.minInclusive=null,"string"==typeof t&&(this.maxInclusive=BigInt(t)),"string"==typeof e&&(this.minInclusive=BigInt(e))}clone({factory:e}={}){return new Ue(this.minInclusive?.toString(),this.maxInclusive?.toString(),this.datatypes,{factory:e||this.factory})}validate(e){const t=super.validate(e).results;if(!je.Debug.equals(t[0].severity))return new Ne({results:t});const r=BigInt(e.value);if(null!==this.minInclusive&&rthis.maxInclusive){const r=`term value "${e.value}" is greater than "${this.maxInclusive.toString()}"`,n=[this.factory.literal(r)];t.push(new Re({factory:this.factory,message:n}))}return new Ne({results:t})}validateSimple(e){if(!super.validateSimple(e))return!1;const t=BigInt(e.value);return!(null!==this.minInclusive&&tthis.maxInclusive)}}const Ve=Ue;class $e extends Ce{constructor(e,t,{factory:r}={}){super({datatypes:t,factory:r}),this.values=new Set(e)}clone({factory:e}={}){return new $e(this.values,this.datatypes,{factory:e||this.factory})}validate(e){const t=[];if(!this.values.has(e.value)){const r=`term value "${e.value}" is not included in the list: ${[...this.values].join(",")}`,n=[this.factory.literal(r)];t.push(new Re({factory:this.factory,message:n}))}return new Ne({results:t})}validateSimple(e){return this.values.has(e.value)}}const qe=$e,Qe={xsd:V("http://www.w3.org/2001/XMLSchema#")},Ge=new Ce({datatypes:Qe.xsd.anySimpleType}),ze=new Ce({datatypes:Qe.xsd.anyAtomicType}),He=/^([^\ud8ff-\udfff\ufffe-\uffff]*)$/,Ke=/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)([Ee](\+|-)?[0-9]+)?|(\+|-)?INF|NaN)$/,Xe=/^(-?P((([0-9]+Y([0-9]+M)?([0-9]+D)?|([0-9]+M)([0-9]+D)?|([0-9]+D))(T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\.[0-9]+)?S)?|([0-9]+(\.[0-9]+)?S)))?)|(T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\.[0-9]+)?S)?|([0-9]+(\.[0-9]+)?S)))))$/,Je=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,We=new ke(He,Qe.xsd.string),Ye=new qe(["1","true","0","false"],Qe.xsd.boolean),Ze=new ke(/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+))$/,Qe.xsd.decimal),et=new ke(Ke,Qe.xsd.float),tt=new ke(Ke,Qe.xsd.double),rt=new ke(Xe,Qe.xsd.duration),nt=new ke(Je,Qe.xsd.dateTime),it=new ke(/^((([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Qe.xsd.time),at=new ke(/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Qe.xsd.date),ot=new ke(/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Qe.xsd.gYearMonth),st=new ke(/^(-?([1-9][0-9]{3,}|0[0-9]{3})(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Qe.xsd.gYear),ct=new ke(/^(--(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Qe.xsd.gMonthDay),ut=new ke(/^(---(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Qe.xsd.gDay),lt=new ke(/^(--(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Qe.xsd.gMonth),dt=new ke(/^(([0-9a-fA-F]{2})*)$/,Qe.xsd.hexBinary),pt=new ke(/^(((([A-Za-z0-9+/] ?){4})*(([A-Za-z0-9+/] ?){3}[A-Za-z0-9+/]|([A-Za-z0-9+/] ?){2}[AEIMQUYcgkosw048] ?=|[A-Za-z0-9+/] ?[AQgw] ?= ?=))?)$/,Qe.xsd.base64Binary),ht=new ke(He,Qe.xsd.anyURI),ft=/^([^\u000d\u000a\u0009]*)$/,yt=new ke([He,ft],Qe.xsd.normalizedString),gt=new ke([He,ft,/^([^ ]+( [^ ]+)*)*$/],Qe.xsd.token),mt=new ke(/^([a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*)$/,Qe.xsd.language),bt=new Ve(null,null,Qe.xsd.integer),vt=new Ve(null,"0",Qe.xsd.nonPositiveInteger),_t=new Ve(null,"-1",Qe.xsd.negativeInteger),wt=new Ve("-9223372036854775808","9223372036854775807",Qe.xsd.long),Ot=new Ve("-2147483648","2147483647",Qe.xsd.int),Tt=new Ve("-32768","32767",Qe.xsd.short),St=new Ve("-128","127",Qe.xsd.byte),Et=new Ve("0",null,Qe.xsd.nonNegativeInteger),xt=new Ve("0","18446744073709551615",Qe.xsd.unsignedLong),It=new Ve("0","4294967295",Qe.xsd.unsignedInt),At=new Ve("0","65535",Qe.xsd.unsignedShort),jt=new Ve("0","255",Qe.xsd.unsignedByte),Nt=new Ve("1",null,Qe.xsd.positiveInteger),Rt=new ke([Xe,/^([^DT]*)$/],Qe.xsd.yearMonthDuration),Dt=new ke([Xe,/^([^YM]*[DT].*)$/],Qe.xsd.dayTimeDuration),Pt=new ke([Je,/^(.*(Z|(\+|-)[0-9][0-9]:[0-9][0-9]))$/],Qe.xsd.dateTimeStamp),Ft=class extends Me{constructor({factory:t}={}){super({factory:t,validations:{...e}})}},Ct=new h([[ne.BlankNode,new Set(["BlankNode"])],[ne.BlankNodeOrIRI,new Set(["BlankNode","NamedNode"])],[ne.BlankNodeOrLiteral,new Set(["BlankNode","Literal"])],[ne.IRI,new Set(["NamedNode"])],[ne.IRIOrLiteral,new Set(["NamedNode","Literal"])],[ne.Literal,new Set(["Literal"])]]);function Mt(e,t){return r=>{r.test(t.has(r.valueOrNode.term.termType),ne.NodeKindConstraintComponent,{args:{nodeKind:e},message:[r.factory.literal("Value does not have node kind {$nodeKind}")],value:r.valueOrNode})}}const Lt=new h([[ne.maxCount,function(e){return{property:(t=parseInt(e.ptr.out([ne.maxCount]).value),e=>{e.test(e.values.terms.length<=t,ne.MaxCountConstraintComponent,{args:{maxCount:t},message:[e.factory.literal("More than {$maxCount} values")]})})};var t}],[ne.minCount,function(e){return{property:(t=parseInt(e.ptr.out([ne.minCount]).value),e=>{e.test(e.values.terms.length>=t,ne.MinCountConstraintComponent,{args:{minCount:t},message:[e.factory.literal("Less than {$minCount} values")]})})};var t}],[ne.and,function(e){return{generic:(t=[...e.ptr.out([ne.and])].flatMap((e=>[...e.list()])).map((t=>e.validator.shape(t))),async e=>{const r=await ve(t,(async t=>(await t.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report)),n=r.every((e=>e.conforms));e.test(n,ne.AndConstraintComponent,{results:r.flatMap((e=>e.results)),value:e.valueOrNode})})};var t}],[ne.not,function(e){return{generic:(t=e.validator.shape(e.ptr.out([ne.not])),async e=>{const r=(await t.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report,n=!r.conforms;e.test(n,ne.NotConstraintComponent,{args:{not:t.ptr.term},message:[e.factory.literal("Value does have shape {$not}")],results:r.results,value:e.valueOrNode})})};var t}],[ne.or,function(e){return{generic:(t=[...e.ptr.out([ne.or])].flatMap((e=>[...e.list()])).map((t=>e.validator.shape(t))),async e=>{let r,n=[];if(e.options.debug||e.options.details){const i=await ve(t,(async t=>(await t.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report));n=i.flatMap((e=>e.results)),r=i.some((e=>e.conforms))}else r=await async function(e,t){for(const r of e)if(await t(r))return!0;return!1}(t,(async t=>(await t.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report.conforms));e.test(r,ne.OrConstraintComponent,{results:n,value:e.valueOrNode})})};var t}],[ne.xone,function(e){return{generic:(t=[...e.ptr.out([ne.xone])].flatMap((e=>[...e.list()])).map((t=>e.validator.shape(t))),async e=>{const r=await ve(t,(async t=>(await t.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report)),n=1===r.filter((e=>e.conforms)).length;e.test(n,ne.XoneConstraintComponent,{results:r.flatMap((e=>e.results)),value:e.valueOrNode})})};var t}],[ne.closed,function(e){if(!(0,he.fromRdf)(e.ptr.out([ne.closed]).term))return null;const t=e.ptr.out([ne.property]).map((t=>e.validator.shape(t)));return{node:(r=new w(t.filter((e=>!e.deactivated)).map((e=>e.path[0].predicates[0]))),n=new w([...e.ptr.out([ne.ignoredProperties]).list()||[]].map((e=>e.term))),e=>{const t=e.focusNode.execute({start:"subject",end:"predicate"}).filter((e=>!n.has(e.term)&&!r.has(e.term)));if(t.ptrs.length>0)for(const r of t)e.violation(ne.ClosedConstraintComponent,{message:[e.factory.literal("Predicate is not allowed (closed shape)")],path:[{quantifier:"one",start:"subject",end:"object",predicates:[r.term]}],value:e.focusNode.node([[...r.quads()][0].object])});else e.debug(ne.ClosedConstraintComponent)})};var r,n}],[ne.hasValue,function(e){const t=e.ptr.out([ne.hasValue]).term;return{node:_e(t),property:we(t)}}],[ne.in,function(e){return{generic:(t=new w([...e.ptr.out([ne.in]).list()].map((e=>e.term))),e=>{e.test(t.has(e.valueOrNode.term),ne.InConstraintComponent,{args:{in:[...t].map((e=>e.value)).join(", ")},message:[e.factory.literal("Value is not in {$in}")],value:e.valueOrNode})})};var t}],[ne.disjoint,function(e){return{generic:(t=e.ptr.out([ne.disjoint]).term,e=>{const r=e.focusNode.dataset.match(e.focusNode.term,t,e.valueOrNode.term);e.test(0===r.size,ne.DisjointConstraintComponent,{args:{disjoint:t},message:[e.factory.literal("Value node must not also be one of the values of {$disjoint}")],value:e.valueOrNode})})};var t}],[ne.equals,function(e){const t=e.ptr.out([ne.equals]).term;return{node:Se(t),property:Ee(t)}}],[ne.lessThan,function(e){return{property:(t=e.ptr.out([ne.lessThan]).term,e=>{const r=e.focusNode.out([t]).terms;for(const n of e.values)for(const i of r){const r=Te(n.term,i);null===r||r>=0?e.violation(ne.LessThanConstraintComponent,{args:{lessThan:t},message:[e.factory.literal("Value is not less than value of {$lessThan}")],value:n}):e.debug(ne.LessThanConstraintComponent,{args:{lessThan:t},message:[e.factory.literal("Value is not less than value of {$lessThan}")],value:n})}})};var t}],[ne.lessThanOrEquals,function(e){return{property:(t=e.ptr.out([ne.lessThanOrEquals]).term,e=>{const r=e.focusNode.out([t]).terms;for(const n of e.values)for(const i of r){const r=Te(n.term,i);null===r||r>0?e.violation(ne.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:t},message:[e.factory.literal("Value is not less than or equal to value of {$lessThanOrEquals}")],value:n}):e.debug(ne.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:t},message:[e.factory.literal("Value is not less than or equal to value of {$lessThanOrEquals}")],value:n})}})};var t}],[ne.maxExclusive,function(e){return{generic:(t=e.ptr.out([ne.maxExclusive]).term,e=>{const r=Te(e.valueOrNode.term,t);e.test(null!==r&&r<0,ne.MaxExclusiveConstraintComponent,{args:{maxExclusive:t},message:[e.factory.literal("Value is not less than {$maxExclusive}")],value:e.valueOrNode})})};var t}],[ne.maxInclusive,function(e){return{generic:(t=e.ptr.out([ne.maxInclusive]).term,e=>{const r=Te(e.valueOrNode.term,t);e.test(null!==r&&r<=0,ne.MaxInclusiveConstraintComponent,{args:{maxInclusive:t},message:[e.factory.literal("Value is not less than or equal to {$maxInclusive}")],value:e.valueOrNode})})};var t}],[ne.minExclusive,function(e){return{generic:(t=e.ptr.out([ne.minExclusive]).term,e=>{const r=Te(e.valueOrNode.term,t);e.test(null!==r&&r>0,ne.MinExclusiveConstraintComponent,{args:{minExclusive:t},message:[e.factory.literal("Value is not greater than {$minExclusive}")],value:e.valueOrNode})})};var t}],[ne.minInclusive,function(e){return{generic:(t=e.ptr.out([ne.minInclusive]).term,e=>{const r=Te(e.valueOrNode.term,t);e.test(null!==r&&r>=0,ne.MinInclusiveConstraintComponent,{args:{minInclusive:t},message:[e.factory.literal("Value is not greater than or equal to {$minInclusive}")],value:e.valueOrNode})})};var t}],[ne.node,function(e){return{generic:(t=[...e.ptr.out([ne.node])].map((t=>e.validator.shape(t))),async e=>{for(const r of t){const t=await r.validate(e.create({child:!0,focusNode:e.valueOrNode}));e.test(t.report.conforms,ne.NodeConstraintComponent,{args:{node:r.ptr.term},message:[e.factory.literal("Value does not have shape {$node}")],results:t.report.results,value:e.valueOrNode})}})};var t}],[ne.property,function(e){return{generic:(t=[...e.ptr.out([ne.property])].map((t=>e.validator.shape(t))),async e=>{const r=e.create({focusNode:e.valueOrNode});for(const e of t)await e.validate(r)})};var t}],[ne.qualifiedValueShape,function(e){const t=e.validator.shape(e.ptr.out([ne.qualifiedValueShape])),r=e.ptr.out([ne.qualifiedValueShapesDisjoint]).term,n=!!r&&(0,he.fromRdf)(r),i=e.ptr.out([ne.qualifiedMaxCount]).term,a=i?parseInt(i.value):null,o=e.ptr.out([ne.qualifiedMinCount]).term;return{property:xe(t,n,a,o?parseInt(o.value):null)}}],[ne.languageIn,function(e){return{generic:(t=[...new Set([...e.ptr.out([ne.languageIn]).list()].map((e=>e.value)))],e=>{const r=t.some((t=>function(e,t){return!!t&&t.slice(0,e.length)===e}(t,e.valueOrNode.term.language)));e.test(r,ne.LanguageInConstraintComponent,{args:{languageIn:t.join(", ")},message:[e.factory.literal("Language does not match any of {$languageIn}")],value:e.valueOrNode})})};var t}],[ne.maxLength,function(e){return{generic:(t=parseInt(e.ptr.out([ne.maxLength]).value),e=>{const r="BlankNode"!==e.valueOrNode.term.termType&&e.valueOrNode.value.length<=t;e.test(r,ne.MaxLengthConstraintComponent,{args:{maxLength:t},message:[e.factory.literal("Value has more than {$maxLength} characters")],value:e.valueOrNode})})};var t}],[ne.minLength,function(e){return{generic:(t=parseInt(e.ptr.out([ne.minLength]).value),e=>{const r="BlankNode"!==e.valueOrNode.term.termType&&e.valueOrNode.value.length>=t;e.test(r,ne.MinLengthConstraintComponent,{args:{minLength:t},message:[e.factory.literal("Value has less than {$minLength} characters")],value:e.valueOrNode})})};var t}],[ne.pattern,function(e){const t=e.ptr.out([ne.pattern]).value,r=e.ptr.out([ne.flags]).value;return{generic:Ie(t,r,new RegExp(t,r))}}],[ne.uniqueLang,function(e){const t=e.ptr.out([ne.uniqueLang]).term;return"true"===t.value&&ae.boolean.equals(t.datatype)?{property:e=>{const t=Object.entries(e.values.terms.reduce(((e,t)=>(t.language&&(e[t.language]=(e[t.language]||0)+1),e)),{})),r=t.filter((([,e])=>e>1));for(const[t]of r)e.violation(ne.UniqueLangConstraintComponent,{args:{lang:t},message:[e.factory.literal('Language "{?lang}" used more than once')]});0===r.length&&e.debug(ne.UniqueLangConstraintComponent)}}:null}],[ne.class,function(e){return{generic:(t=e.ptr.out([ne.class]).map((e=>ge(e))),e=>{const r=new w(e.valueOrNode.out([te.type]).terms);for(const n of t){const t=[...r].some((e=>n.has(e)));e.test(t,ne.ClassConstraintComponent,{value:e.valueOrNode})}})};var t}],[ne.datatype,function(e){return{generic:(t=e.ptr.out([ne.datatype]).term,r=new Ft,e=>{const n=t.equals(e.valueOrNode.term.datatype)&&r.validateSimple(e.valueOrNode.term);e.test(n,ne.DatatypeConstraintComponent,{args:{datatype:t},message:[e.factory.literal("Value does not have datatype {$datatype}")],value:e.valueOrNode})})};var t,r}],[ne.nodeKind,function(e){const t=e.ptr.out([ne.nodeKind]).term;return{generic:Mt(t,Ct.get(t))}}]]),kt=Lt,Bt=class{constructor(e,{factory:t,...r}){if(this.factory=t,this.options=r,this.registry=new pe(kt),this.shapesPtr=new Z({dataset:e,factory:t}),this.shapes=new h,this.options.coverage&&(this.options.debug=!0,this.options.details=!0,this.options.trace=!0),this.options.validations)for(const[e,t]of this.options.validations)this.registry.validations.set(e,t);const n=[...this.shapesPtr.hasOut([ne.targetClass]),...this.shapesPtr.hasOut([ne.targetNode]),...this.shapesPtr.hasOut([ne.targetObjectsOf]),...this.shapesPtr.hasOut([ne.targetSubjectsOf]),...this.shapesPtr.hasOut([te.type],[ne.NodeShape]),...this.shapesPtr.hasOut([te.type],[ne.PropertyShape])];for(const e of n)this.shape(e)}shape(e){if(!e.term)return null;let t=this.shapes.get(e.term);return t||(t=new be(e,{validator:this}),this.shapes.set(e.term,t)),t}async validate(e,t){const r=new Z({...e,factory:this.factory}),n=new le({factory:this.factory,focusNode:r,options:this.options,validator:this});t=t?t.map((e=>this.shape(this.shapesPtr.node(e.terms)))):this.shapes.values();for(const e of t){const t=n.create({shape:e});let i;i=r.isAny()?e.resolveTargets(t):r;for(const r of i)await e.validate(t.create({focusNode:r}))}return n.report}};class Ut{constructor(e,{bind:t=!1}={}){this._factories=e.slice();for(const e of this._factories){"function"==typeof e.prototype.init&&e.prototype.init.call(this);for(const r of e.exports||[])this[r]=t?e.prototype[r].bind(this):e.prototype[r]}}clone(){const e=new Ut(this._factories);for(const t of e._factories)"function"==typeof t.prototype.clone&&t.prototype.clone.call(e,this);return e}}const Vt=Ut;var $t=r(19198),qt=r(83141);const Qt=async function(e,t){const r=new qt.StringDecoder(t);let n="";for await(const t of e)n+=r.write(t);return n+=r.end(),n},Gt=async function(e,t,r){const n="PUT"===t.method?"write":"read",i="read"===n?"from":"to";if(!r.ok)throw new Error(`can't ${n} data ${i} <${e.toString()}>[${r.status}]: ${await r.text()}`)},zt=new Map([["json","application/ld+json"],["n3","text/n3"],["nq","application/n-quads"],["nt","application/n-triples"],["rdf","application/rdf+xml"],["trig","application/trig"],["ttl","text/turtle"]]),Ht=function(e,t){const r=new Headers,n=e.toString().match(/\.([a-z]+)$/),i=zt.get(n&&n[1]);return i&&r.set("content-type",i),{method:"PUT",headers:r,body:t}},Kt=new Set(["_write","_writableState","writable"]),Xt=function(e){return new Proxy(e,{has(e,t){return!Kt.has(t)&&Reflect.has(...arguments)},get(e,t){if(Kt.has(t))return;const r=Reflect.get(...arguments);return r&&"function"==typeof r.bind?r.bind(e):r},set(e,t,r){if(!Kt.has(t))return Reflect.set(...arguments)}})};class Jt{namespace(e){return V(e,{factory:this})}}Jt.exports=["namespace"];const Wt=Jt;class Yt extends Map{constructor(e=[],{factory:t}){super(e),this.factory=t}resolve(e){if(e.value.includes("://"))return null;const[t,r]=e.value.split(":",2);return void 0===r?null:this.has(t)?this.factory.namedNode(`${this.get(t).value}${r}`):null}shrink(e){if(!e)return null;const[t]=[...this].filter((([,t])=>e.value.startsWith(t.value))).sort(((e,t)=>t[1].value.length-e[1].value.length));return void 0===t?null:this.factory.namedNode(`${t[0]}:${e.value.slice(t[1].value.length)}`)}import(e){return e.on("prefix",((e,t)=>{this.set(e,t)})),new Promise(((t,r)=>{(0,$t.finished)(e,(e=>{e?r(e):t(this)}))}))}export(e){for(const[t,r]of this)e.emit("prefix",t,r);return this}}const Zt=Yt;class er{init(){this.prefixes=new Zt([],{factory:this})}clone(e){if(e.prefixes)for(const[t,r]of e.prefixes)this.prefixes.set(t,r)}prefixMap(e){return new Zt(e,{factory:this})}}er.exports=["prefixMap"];const tr=er,rr=function({factor:e,score:t}){return({dataset:r,graph:n,terms:i=[]})=>t({dataset:r,graph:n,terms:i}).map((t=>(t.score*=e,t)))};class nr extends Set{constructor(e=[]){super(),this._index=new Map;for(const t of e)this.add(t)}add(e){return this._index.set(nr.key(e),e),super.add(e)}delete(e){const t=this._index.get(nr.key(e));return super.delete(t)}has(e){return this._index.has(nr.key(e))}static key(e){return e.map((e=>e&&d(e)||"undefined")).join(" ")}}const ir=nr;class ar extends Map{constructor(e=[]){super(),this._keys=new Map;for(const[t,r]of e)this.set(t,r)}delete(e){const t=ar.key(e);return this._keys.delete(t),super.delete(t)}get(e){return super.get(ar.key(e))}has(e){return super.has(ar.key(e))}keys(){return new ir(this._keys.values())}set(e,t){const r=ar.key(e);return this._keys.set(r,e),super.set(r,t)}static key(e){return e.map((e=>e&&d(e)||"undefined")).join(" ")}}const or=ar,sr=function(e){return({dataset:t,graph:r,terms:n=[]})=>{const i=new or;for(let a=0;arr({factor:t,score:e}))))}cr.prioritized=function(e){const t=2/(e.length*(e.length+1)),r=e.map(((r,n)=>{const i=(e.length-n)*t;return rr({factor:i,score:r})}));return sr(r)};const ur=cr,lr=function(e){return({dataset:t,graph:r,terms:n=[]})=>e.flatMap((e=>e({dataset:t,graph:r,terms:n})))},dr=function({graph:e,object:t,predicate:r,subject:n=!0}={}){const i={subject:n,predicate:r,object:t,graph:e};return({dataset:e,graph:t,terms:r=[]})=>{const n=new h;let a=0;const o=i=>{for(const o of r){const r=["subject"===i&&o,"predicate"===i&&o,"object"===i&&o,t||"graph"===i&&o],s=e.match(...r);for(const e of s){const t=e[i],r=n.get(t)||{count:0};n.has(t)||n.set(t,r),r.count++,a++}}};for(const e of["subject","predicate","object","graph"])i[e]&&o(e);const s=[];for(const[r,i]of n)s.push({dataset:e,graph:t,term:r,score:i.count/a});return s}},pr=function(e){const t=new or;for(const r of e){const e=t.get([r.term,r.graph]);e?e.score{for(const n of r){const r=[{dataset:e,graph:t,term:n,score:1}];if(i.subject&&i.subject.equals(n)&&e.match(n,null,null,t).size>0)return r;if(i.predicate&&i.predicate.equals(n)&&e.match(null,n,null,t).size>0)return r;if(i.object&&i.object.equals(n)&&e.match(null,null,n,t).size>0)return r;if(i.graph&&i.graph.equals(n)&&(!t||i.graph.equals(t))&&e.match(null,null,null,t).size>0)return r}return[]}},fr=function(e){return({dataset:t,graph:r,terms:n=[]})=>{for(const i of e){const e=i({dataset:t,graph:r,terms:n});if(e.length>0)return e}return[]}},yr=function(e){const t=e;return({dataset:e,graph:r,terms:n=[]})=>{for(const i of n)if(i.equals(t))return[{dataset:e,graph:r,term:i,score:1}];return[]}},gr=function(e){const t=new Map;let r;for(const[n,i]of Object.entries(e)){const a=1-n/e.length;"*"===i?r=a:t.set(i,a)}return({dataset:e,graph:n,terms:i=[]})=>{const a=[];for(const o of i){let i=t.get(o.language);void 0===i&&"string"==typeof o.language&&r&&(i=r),void 0!==i&&a.push({dataset:e,graph:n,term:o,score:i})}return a}},mr=function({alpha:e=.85,epsilon:t=1e-6}={}){return({dataset:r,graph:n,terms:i})=>{i=new w(i);const a=new h,o=1/i.size;let s=1;for(const e of i){const t=r.match(null,null,e,n);a.set(e,{weight:o,outbound:t.size,subjects:[...t].map((e=>e.subject)).filter((e=>i.has(e)))})}for(;s>t;){const t=new h;let r=0;for(const[e,n]of a)t.set(e,n.weight),0===n.outbound&&(r+=n.weight),n.weight=0;r*=e;for(const[n,i]of a){for(const r of i.subjects)a.get(r).weight+=e*t.get(n)/i.outbound;i.weight+=(1-e)*o+r*o}s=0;for(const[e,r]of a)s+=Math.abs(r.weight-t.get(e))}const c=[];for(const[e,t]of a)c.push({dataset:r,graph:n,term:e,score:t.weight});return c}},br=function(){return({dataset:e,graph:t,terms:r=[]})=>{const n=[];for(const i of r){let r=Number.EPSILON;if("NamedNode"===i.termType){let e=new URL(i.value).pathname;e.endsWith("/")&&(e=e.slice(0,-1)),r=1/e.split("/").length}n.push({dataset:e,graph:t,term:i,score:r})}return n}},vr=function(e){return({dataset:t,graph:r,terms:n=[]})=>{const i=[],a=2/(e.length*(e.length+1));for(let o=0;o{if(0===e.length)return[];const i=e[0]({dataset:t,graph:r,terms:n}),a=new or(i.map((e=>[[e.term,r],e])));for(let i=1;i{const r=t.score-e.score;return 0!==r?r:e.term.value.localeCompare(t.term.value)}))},Or=function({dataset:e,objects:t,score:r,termCallback:n=e=>e.term}={}){const i=new h(t.map((e=>[n(e),e]))),a=t.map((e=>n(e)));return wr(pr(r({dataset:e,terms:a}))).map((({term:e})=>i.get(e)))},Tr=function(e){const t={rdf:{type:B.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")}};return({dataset:r,graph:n,terms:i=[]})=>{const a=[];for(const o of i)for(const i of r.match(o,t.rdf.type,e,n))a.push({dataset:r,graph:i.graph,term:o,score:1});return a}};class Sr{termMap(e){return new h(e)}}Sr.exports=["termMap"];const Er=Sr;class xr{termSet(e){return new w(e)}}xr.exports=["termSet"];const Ir=xr;class Ar{constructor(){this.quadLevel=new Map}add(e,t){this.quadLevel.set(d(e),t)}has(e,t){const r=this.quadLevel.get(d(e));return void 0!==r&&r<=t}}function jr({backward:e,callback:t,dataset:r,filter:n,forward:i,term:a,visited:o=new Ar}){const s=(a,c)=>{const u=a=>{for(const u of a){if(o.has(u,c))continue;o.add(u,c);const a={dataset:r,level:c,quad:u};n(a)&&(t(a),i&&s(u.object,c+1),e&&s(u.subject,c+1))}};i&&u(r.match(a)),e&&u(r.match(null,null,a))};s(a,0)}const Nr=class{constructor(e,{backward:t=!1,factory:r,forward:n=!0}){this.backward=t,this.factory=r,this.filter=e,this.forward=n}forEach({term:e,dataset:t},r){jr({backward:this.backward,callback:r,dataset:t,filter:this.filter,forward:this.forward,term:e})}match({term:e,dataset:t}){const r=this.factory.dataset();return jr({backward:this.backward,callback:({quad:e})=>r.add(e),dataset:t,filter:this.filter,forward:this.forward,term:e}),r}reduce({term:e,dataset:t},r,n){let i=n;return jr({backward:this.backward,callback:e=>{i=r(e,i)},dataset:t,filter:this.filter,forward:this.forward,term:e}),i}};class Rr{traverser(e,{backward:t=!1,forward:r=!0}={}){return new Nr(e,{backward:t,factory:this,forward:r})}}Rr.exports=["traverser"];const Dr=Rr;class Pr{grapoi({...e}={}){return e.dataset||"function"!=typeof this.dataset||(e.dataset=this.dataset()),function(e){return new ee(e)}({...e,factory:this})}}Pr.exports=["grapoi"];const Fr=Pr,Cr=class extends S{toCanonical(){return d(this)}toString(){return this.toCanonical()}},Mr=class extends x{toCanonical(){return d(this)}toString(){return this.toCanonical()}},Lr=class extends j{toCanonical(){return d(this)}toString(){return this.value}},kr=class extends R{toCanonical(){return d(this)}toString(){return this.value}toURL(){return new URL(this.value)}},Br=class extends P{toCanonical(){return d(this)}toString(){return this.toCanonical()}},Ur=class extends C{toCanonical(){return d(this)}toString(){return this.toCanonical()}},Vr=new kr("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),$r=new kr("http://www.w3.org/2001/XMLSchema#string");class qr{init(){this._data={blankNodeCounter:0,defaultGraph:new Mr}}namedNode(e){return"string"!=typeof e&&(e=e.toString()),new kr(e)}blankNode(e){return e=e||"b"+ ++this._data.blankNodeCounter,new Cr(e)}literal(e,t){return"string"==typeof t?new Lr(e,t,Vr):new Lr(e,"",t||$r)}variable(e){return new Ur(e)}defaultGraph(){return this._data.defaultGraph}quad(e,t,r,n=this.defaultGraph()){return new Br(e,t,r,n)}fromTerm(e){return I(this,e)}fromQuad(e){return I(this,e)}}qr.exports=["namedNode","blankNode","literal","variable","defaultGraph","quad","fromTerm","fromQuad"];const Qr=qr;function Gr(e){return"string"==typeof e||e instanceof String}function zr(e){if("string"==typeof e)return e;if(!e)return"";if(void 0!==e.id&&"Quad"!==e.termType)return e.id;let t,r,n,i;switch(e.termType){case"NamedNode":return e.value;case"BlankNode":return`_:${e.value}`;case"Variable":return`?${e.value}`;case"DefaultGraph":return"";case"Literal":return e.language?`"${e.value}"@${e.language}`:`"${e.value}"${e.datatype&&"http://www.w3.org/2001/XMLSchema#string"!==e.datatype.value?`^^${e.datatype.value}`:""}`;case"Quad":return t=Kr(zr(e.subject)),r=Kr(zr(e.predicate)),n=Kr(zr(e.object)),i="DefaultGraph"===e.graph.termType?"":` ${zr(e.graph)}`,`<<${t} ${r} ${n}${i}>>`;default:throw new Error(`Unexpected termType: ${e.termType}`)}}const Hr=/^"(.*".*)(?="[^"]*$)/;function Kr(e){return e.replace(Hr,((e,t)=>`"${t.replace(/"/g,'""')}`))}class Xr{constructor(e){if(this._size=0,this._graphs=Object.create(null),this._id=0,this._ids=Object.create(null),this._ids["><"]=0,this._entities=Object.create(null),this._quads=new Map,e)for(const t of e)this.add(t)}get size(){let e=this._size;if(null!==e)return e;e=0;const t=this._graphs;let r,n;for(const i in t)for(const a in r=t[i].subjects)for(const t in n=r[a])e+=Object.keys(n[t]).length;return this._size=e,this._size}add(e){let t=zr(e.subject),r=zr(e.predicate),n=zr(e.object);const i=zr(e.graph);let a=this._graphs[i];a||(a=this._graphs[i]={subjects:{},predicates:{},objects:{}},Object.freeze(a));const o=this._ids,s=this._entities;return t=o[t]||(o[s[++this._id]=t]=this._id),r=o[r]||(o[s[++this._id]=r]=this._id),n=o[n]||(o[s[++this._id]=n]=this._id),this._addToIndex(a.subjects,t,r,n),this._addToIndex(a.predicates,r,n,t),this._addToIndex(a.objects,n,t,r),this._setQuad(t,r,n,i,e),this._size=null,this}delete(e){let t=zr(e.subject),r=zr(e.predicate),n=zr(e.object);const i=zr(e.graph),a=this._ids,o=this._graphs;let s,c,u;if(!((t=a[t])&&(r=a[r])&&(n=a[n])&&(s=o[i])&&(c=s.subjects[t])&&(u=c[r])&&n in u))return this;for(t in this._removeFromIndex(s.subjects,t,r,n),this._removeFromIndex(s.predicates,r,n,t),this._removeFromIndex(s.objects,n,t,r),null!==this._size&&this._size--,this._deleteQuad(t,r,n,i),s.subjects)return this;return delete o[i],this}has(e){const t=zr(e.subject),r=zr(e.predicate),n=zr(e.object),i=zr(e.graph),a=this._graphs[i];if(!a)return!1;const o=this._ids;let s,c,u;return!(Gr(t)&&!(s=o[t])||Gr(r)&&!(c=o[r])||Gr(n)&&!(u=o[n]))&&1===this._countInIndex(a.objects,u,s,c)}match(e,t,r,n){return this._createDataset(this._match(e,t,r,n))}[Symbol.iterator](){return this._match()[Symbol.iterator]()}_addToIndex(e,t,r,n){const i=e[t]||(e[t]={}),a=i[r]||(i[r]={}),o=n in a;return o||(a[n]=null),!o}_removeFromIndex(e,t,r,n){const i=e[t],a=i[r];delete a[n];for(const e in a)return;delete i[r];for(const e in i)return;delete e[t]}_findInIndex(e,t,r,n,i,a,o,s,c,u){let l,d,p;t&&((l=e,e={})[t]=l[t]);for(const t in e)if(d=e[t],d){r&&((l=d,d={})[r]=l[r]);for(const e in d)if(p=d[e],p){const r=n?n in p?[n]:[]:Object.keys(p);for(let n=0;nfunction(e){return{subject:Yr(e.subject),predicate:Yr(e.predicate),object:Yr(e.object),graph:Yr(e.graph)}}(e)))}(e))};function en(e,t){return new e.constructor(t)}const tn=class extends Jr{addAll(e){for(const t of e)this.add(t);return this}clone(){return en(this,this)}deleteMatches(e,t,r,n){for(const i of this.match(e,t,r,n))this.delete(i);return this}difference(e){return this.filter((t=>!e.has(t)))}equals(e){return this.toCanonical()===e.toCanonical()}every(e){return Array.from(this).every((t=>e(t,this)))}filter(e){return en(this,Array.from(this).filter((t=>e(t,this))))}forEach(e){Array.from(this).forEach((t=>e(t,this)))}import(e){return e.on("data",(e=>this.add(e))),new Promise(((t,r)=>{(0,$t.finished)(e,(e=>{e?r(e):t(this)}))}))}intersection(e){return this.filter((t=>e.has(t)))}map(e){return en(this,Array.from(this).map((t=>e(t,this))))}merge(e){return this.clone().addAll(e)}reduce(e,t){return Array.from(this).reduce(((t,r,n)=>e(t,r,n,this)),t)}some(e){return Array.from(this).some((t=>e(t,this)))}toCanonical(){return Zr(this)}toStream(){return $t.Readable.from(this)}toString(){return d(this)}};class rn{dataset(e,t){const r=new tn;if(e)if(t)for(const n of e)r.add(this.quad(n.subject,n.predicate,n.object,t));else r.addAll(e);return r}}rn.exports=["dataset"];const nn=rn,an=async function(e={}){if(!e.body||!e.body.readable)return e;const t=await async function(e){const t=[];for await(const r of e)t.push(r);return t}(e.body);return t.length>0?1===t[0].BYTES_PER_ELEMENT?e.body=function(e){const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return r}(t):e.body=t.join(""):e.body="",e};class on{constructor(e,t){this.obj=e;for(const[e,r]of Object.entries(t))this[e]=r;for(const t of on.properties(e))t in this||("function"==typeof this.obj[t]?this[t]=(...r)=>this.obj[t].call(e,r):Object.defineProperty(this,t,{get:()=>this.obj[t],set:e=>{this.obj[t]=e},enumerable:!0,configurable:!0}))}static properties(e){return Object.getOwnPropertyNames(Object.getPrototypeOf(e))}}const sn=on,cn=function(e){if(e.bodyUsed){const t=new $t.Readable({read:()=>t.destroy(new Error("body already in use"))});return e.body=t,e}return e.body&&e.body.readable?e:e.body&&"function"==typeof e.body.getReader?new sn(e,{body:(r=e.body.getReader(),new $t.Readable({read:async function(){try{let e,t;do{e=await r.read(),e.done?this.push(null):t=!this.push(e.value)}while(!e.done&&!t)}catch(e){this.destroy(e)}}}))}):(e.body=(t=()=>e.arrayBuffer(),new $t.Readable({read:oe((async function(){try{this.push(new Uint8Array(await t())),this.push(null)}catch(e){this.destroy(e)}}))})),e);var t,r},un=window.Headers;function ln(e,t){return an(t).then((t=>fetch(e,t).then((e=>cn(e)))))}const dn=/<(.*)>/,pn=function(e,t,r){e.quadStream=async()=>{if(!e.headers.get("content-type"))throw new Error("Content-Type header missing: couldn't determine parser");let n=e.headers.get("content-type").split(";")[0];const i=function(e,t){if("application/json"!==t)return null;if(!e.headers.has("link"))return null;const r=e.headers.get("link").split(",").map((e=>e.trim())).find((e=>e.includes('rel="http://www.w3.org/ns/json-ld#context"')));if(!r)return null;const n=(dn.exec(r)||[]).slice(-1)[0];return n?new URL(n,e.url).toString():null}(e,n);if(i&&(n="application/ld+json"),!r.has(n))return Promise.reject(new Error(`unknown content type: ${n}`));let a;return i&&(a=await t(i).then((e=>e.json()))),r.import(n,e.body,{baseIRI:e.url,context:a})}};function hn(e){const t=function(t,r={}){const n="function"==typeof e.dataset?e:null;return async function(e,t={}){const r=t.factory,n=t.fetch||ln,i=t.formats;if(!i)throw new Error("no formats given");t=function(e,t){if(e.headers=new un(e.headers),e.headers.has("accept")||e.headers.set("accept",[...t.parsers.keys()].join(", ")),!e.body)return e;if("string"==typeof e.body)return e;let r=e.headers.get("content-type");if(r&&!t.serializers.has(r))throw new Error(`no serializer found for media type: ${e.headers.get("content-type")}`);return r||(r=t.serializers.keys().next().value,e.headers.set("content-type",r)),!function(e,{checkOpen:t=!0}={}){return function(e,{checkOpen:t=!0}={}){return null!==e&&"object"==typeof e&&(e.writable||e.readable||!t||void 0===e.writable&&void 0===e.readable)&&"function"==typeof e.pipe}(e,{checkOpen:t})&&(e.readable||!t)&&"function"==typeof e.read&&"boolean"==typeof e.readable&&"boolean"==typeof e.readableObjectMode&&"function"==typeof e.destroy&&"boolean"==typeof e.destroyed}(e.body)&&e.body[Symbol.iterator]&&(e.body=$t.Readable.from(e.body)),e.body=t.serializers.import(r,e.body,{prefixes:e.prefixes}),e}(t,i);return function(e,t,r,n){const i=[...e.headers.keys()].some((e=>e.startsWith("content-"))),a="chunked"===e.headers.get("transfer-encoding");return(i||a)&&(pn(e,r,n),t&&function(e,t){e.dataset=async()=>{const r=await e.quadStream();return async function(e,t){for await(const r of t)e.add(r);return e}(t.dataset(),r)}}(e,t)),e}(await n(e,t),r,n,i.parsers)}(t,{fetch:e._fetch.fetch,formats:e.formats,...r,factory:n})};return t.config=function(t,r){e._fetch[t]=r},t.Headers=un,t}const fn=class{init(){this._fetch={fetch:null},this.fetch=hn(this)}clone(e){for(const[t,r]of Object.entries(e._fetch))this._fetch[t]=r}},yn=ln,gn=class{constructor(e,t){this.Impl=e,this.options=t}import(e,t){const r=new this.Impl(e,{...this.options,...t});return e.on("end",(()=>{r.readable||r.emit("end")})),e.on("error",(e=>{r.emit("error",e)})),r}};var mn=r(1106);const bn="null:";const vn=class{constructor(e,{baseIRI:t=bn,context:r=null,documentLoader:n,factory:i=B}={}){const a=new mn.JsonLdParser({baseIRI:t,context:r,dataFactory:i,documentLoader:n,streamingProfile:!1});e.pipe(a);const o=function(e){const t=function(e){return t=>"NamedNode"!==t.termType?null:t.value.startsWith(bn)?e.namedNode(t.value.slice(5)):null}(e);return r=>{const n=t(r.subject),i=t(r.predicate),a=t(r.object),o=t(r.graph);return n||i||a||o?e.quad(n||r.subject,i||r.predicate,a||r.object,o||r.graph):r}}(i),s=new $t.Transform({objectMode:!0,transform:(e,t,r)=>{r(null,o(e))}});return a.on("context",(e=>{Object.entries(e).forEach((([e,t])=>{s.emit("prefix",e,i.namedNode(t))}))})),a.on("error",(e=>s.destroy(e))),a.pipe(s),Xt(s)}};var _n=r(66731);const wn=class{constructor(e,{baseIRI:t="",factory:r=B,...n}={}){const i={blankNode:r.blankNode.bind(r),defaultGraph:r.defaultGraph.bind(r),literal:r.literal.bind(r),namedNode:r.namedNode.bind(r),quad:r.quad.bind(r)},a=new _n.A({baseIRI:t,factory:i,...n});return e.pipe(a),Xt(a)}},On=class extends gn{constructor(e){super(wn,e)}},Tn=class{constructor(e){const t=new $t.Transform({objectMode:!0,transform:(e,t,r)=>{r(null,`${d(e)}\n`)}});return e.pipe(t),Xt(t)}},Sn=class extends gn{constructor(){super(Tn)}};V("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),V("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),V("http://www.w3.org/2001/XMLSchema#"),$t.Readable;class En extends Map{import(e,t,r){const n=this.get(e);return n?n.import(t,r):null}}const xn=En,In=class{constructor(e){this.stream=e,this.array=[]}push(e){this.array.push(e)}end(){this.stream.push(this.array),this.stream.push(null)}},An=class{constructor(e){this.stream=e,this.first=!0,this.stream.push("[")}push(e){this.first?this.first=!1:this.stream.push(","),this.stream.push(JSON.stringify(e))}end(){this.stream.push("]"),this.stream.push(null)}};class jn extends $t.Readable{constructor(e,{encoding:t="object"}={}){if(super({objectMode:!0,read:()=>{}}),"object"===t&&(this.encoder=new In(this)),"string"===t&&(this.encoder=new An(this)),!this.encoder)throw new Error(`unknown encoding: ${t}`);e.on("data",(e=>{const t={};let r=t;"DefaultGraph"!==e.graph.termType&&(t["@id"]=e.graph.value,t["@graph"]={},r=t["@graph"]),r["@id"]=jn.subjectValue(e.subject),"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===e.predicate.value?r["@type"]=jn.subjectValue(e.object):r[e.predicate.value]=jn.objectValue(e.object),this.encoder.push(t)})),e.on("end",(()=>this.encoder.end())),e.on("error",(e=>this.emit("error",e)))}static subjectValue(e){return"BlankNode"===e.termType?"_:"+e.value:e.value}static objectValue(e){return"NamedNode"===e.termType?{"@id":e.value}:"BlankNode"===e.termType?{"@id":"_:"+e.value}:e.language?{"@language":e.language,"@value":e.value}:e.datatype&&"http://www.w3.org/2001/XMLSchema#string"!==e.datatype.value?{"@type":e.datatype.value,"@value":e.value}:e.value}}const Nn=jn,Rn=class extends gn{constructor(e){super(Nn,e)}};r(34841),$t.Readable;var Dn=r(75611);class Pn extends Dn.RdfXmlParser{constructor({factory:e,...t}={}){super({...t,dataFactory:e})}}const Fn=Pn,Cn={parsers:new xn([["application/ld+json",new class extends gn{constructor(e){super(vn,e)}}],["application/trig",new On],["application/n-quads",new On],["application/n-triples",new On],["text/n3",new On],["text/turtle",new On],["application/rdf+xml",new Fn]]),serializers:new xn([["application/ld+json",new class extends Rn{constructor({...e}={}){super({...e,encoding:"string"})}}],["application/n-quads",new Sn],["application/n-triples",new Sn],["text/n3",new Sn],["text/turtle",new Sn]])},Mn=class{constructor({factory:e}){this.factory=e,this.parsers=new xn,this.serializers=new xn}import(e){if(e.parsers)for(const[t,r]of e.parsers)this.parsers.set(t,new r.constructor({factory:this.factory}));if(e.serializers)for(const[t,r]of e.serializers)this.serializers.set(t,new r.constructor({factory:this.factory}));return this}},Ln=class{init(){this.formats=new Mn({factory:this})}clone(e){this.formats.import(e.formats)}},kn=new Vt([Qr,nn,class extends fn{init(){super.init(),this.fetch.config("fetch",yn)}},class extends Ln{init(){super.init(),this.formats.import(Cn)}},Fr,class{init(){this.io={dataset:{fromText:(e,t,r)=>async function(e,t,{factory:r,...n}){const i=r.formats.parsers.get(e);if(!i)throw new Error(`unknown media type: ${e}`);const a=r.dataset(),o=i.import($t.Readable.from([t]),n);for await(const e of o)a.add(e);return a}(e,t,{...r,factory:this}),fromURL:(e,t)=>async function(e,{factory:t,mediaType:r,...n}){const i=await t.fetch(e,{...n,method:"GET"});return await Gt(e,{},i),r&&i.headers.set("content-type",r),i.dataset()}(e,{...t,factory:this}),toText:(e,t,r)=>async function(e,t,{factory:r,prefixes:n,...i}){const a=r.formats.serializers.get(e);if(!a)throw new Error(`unknown media type: ${e}`);const o=a.import($t.Readable.from(t),{...i,prefixes:n});return Qt(o,"utf-8")}(e,t,{...r,factory:this}),toURL:(e,t,r)=>async function(e,t,{factory:r,prefixes:n,...i}){const a=Ht(e,$t.Readable.from(t)),o=await r.fetch(e,{...i,...a,prefixes:n});await Gt(e,a,o)}(e,t,{...r,factory:this})},stream:{fromText:(e,t,r)=>function(e,t,{factory:r,...n}){const i=r.formats.parsers.get(e);return i?i.import($t.Readable.from([t]),n):new $t.Readable({read(){this.destroy(new Error(`unknown media type: ${e}`))}})}(e,t,{...r,factory:this}),fromURL:(e,t)=>function(e,{factory:t,mediaType:r,...n}){const i=new $t.PassThrough({objectMode:!0});return setTimeout((async()=>{try{const a=await t.fetch(e,{...n,method:"GET"});await Gt(e,{},a),r&&a.headers.set("content-type",r),(await a.quadStream()).on("error",(e=>i.destroy(e))).pipe(i)}catch(e){i.destroy(e)}}),0),Xt(i)}(e,{...t,factory:this}),toText:(e,t,r)=>async function(e,t,{factory:r,prefixes:n,...i}){const a=r.formats.serializers.get(e);if(!a)throw new Error(`unknown media type: ${e}`);const o=a.import(t,{...i,prefixes:n});return Qt(o,"utf-8")}(e,t,{...r,factory:this}),toURL:(e,t,r)=>async function(e,t,{factory:r,prefixes:n,...i}){const a=Ht(e,t),o=await r.fetch(e,{...i,...a,prefixes:n});await Gt(e,a,o)}(e,{...r,factory:this})}}}},Wt,tr,class{init(){this.score={combine:ur,concat:lr,count:dr,distinct:pr,exists:hr,fallback:fr,fixed:yr,language:gr,pageRank:mr,pathDepth:br,prioritized:vr,product:_r,scale:rr,sort:wr,sortObjects:Or,sum:sr,type:Tr}}},Er,Ir,Dr],{bind:!0});window.bundle={newParser:function(){return new t.A},newWriter:function(e){return new n.A(e)},newStore:function(){return new i.A},newQueryEngine:function(){return new a.QueryEngine},getRdfFactory:function(){return kn},newValidator:function(e,t){return new Bt(e,t)}}})()})(); \ No newline at end of file diff --git a/assets/bundle.js.LICENSE.txt b/assets/bundle.js.LICENSE.txt new file mode 100644 index 0000000..ff5017b --- /dev/null +++ b/assets/bundle.js.LICENSE.txt @@ -0,0 +1,115 @@ +/*! + * Copyright (c) 2016-2021 Digital Bazaar, Inc. All rights reserved. + */ + +/*! + * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved. + */ + +/*! + * Copyright (c) 2016-2023 Digital Bazaar, Inc. All rights reserved. + */ + +/*! + * Copyright (c) 2023 Digital Bazaar, Inc. All rights reserved. + */ + +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ + +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ + +/*! queue-microtask. MIT License. Feross Aboukhadijeh */ + +/*! safe-buffer. MIT License. Feross Aboukhadijeh */ + +/** + * @preserve + * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) + * + * @author Jens Taylor + * @see http://github.com/homebrewing/brauhaus-diff + * @author Gary Court + * @see http://github.com/garycourt/murmurhash-js + * @author Austin Appleby + * @see http://sites.google.com/site/murmurhash/ + */ + +/** + * A JavaScript implementation of the JSON-LD API. + * + * @author Dave Longley + * + * @license BSD 3-Clause License + * Copyright (c) 2011-2022 Digital Bazaar, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * Neither the name of the Digital Bazaar, Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * Character class utilities for XML NS 1.0 edition 3. + * + * @author Louis-Dominique Dubeau + * @license MIT + * @copyright Louis-Dominique Dubeau + */ + +/** + * Character classes and associated utilities for the 2nd edition of XML 1.1. + * + * @author Louis-Dominique Dubeau + * @license MIT + * @copyright Louis-Dominique Dubeau + */ + +/** + * Character classes and associated utilities for the 5th edition of XML 1.0. + * + * @author Louis-Dominique Dubeau + * @license MIT + * @copyright Louis-Dominique Dubeau + */ + +/** + * Removes the @preserve keywords from expanded result of framing. + * + * @param input the framed, framed output. + * @param options the framing options used. + * + * @return the resulting output. + */ + +// disallow aliasing @context and @preserve + +// remove @preserve + +// remove @preserve from results diff --git a/assets/drawflow.min.css b/assets/drawflow.min.css new file mode 100644 index 0000000..c9c9442 --- /dev/null +++ b/assets/drawflow.min.css @@ -0,0 +1 @@ +.drawflow,.drawflow .parent-node{position:relative}.parent-drawflow{display:flex;overflow:hidden;touch-action:none;outline:0}.drawflow{width:100%;height:100%;user-select:none;perspective:0}.drawflow .drawflow-node{display:flex;align-items:center;position:absolute;background:#0ff;width:160px;min-height:40px;border-radius:4px;border:2px solid #000;color:#000;z-index:2;padding:15px}.drawflow .drawflow-node.selected{background:red}.drawflow .drawflow-node:hover{cursor:move}.drawflow .drawflow-node .inputs,.drawflow .drawflow-node .outputs{width:0}.drawflow .drawflow-node .drawflow_content_node{width:100%;display:block}.drawflow .drawflow-node .input,.drawflow .drawflow-node .output{position:relative;width:20px;height:20px;background:#fff;border-radius:50%;border:2px solid #000;cursor:crosshair;z-index:1;margin-bottom:5px}.drawflow .drawflow-node .input{left:-27px;top:2px;background:#ff0}.drawflow .drawflow-node .output{right:-3px;top:2px}.drawflow svg{z-index:0;position:absolute;overflow:visible!important}.drawflow .connection{position:absolute;pointer-events:none;aspect-ratio:1/1}.drawflow .connection .main-path{fill:none;stroke-width:5px;stroke:#4682b4;pointer-events:all}.drawflow .connection .main-path:hover{stroke:#1266ab;cursor:pointer}.drawflow .connection .main-path.selected{stroke:#43b993}.drawflow .connection .point{cursor:move;stroke:#000;stroke-width:2;fill:#fff;pointer-events:all}.drawflow .connection .point.selected,.drawflow .connection .point:hover{fill:#1266ab}.drawflow .main-path{fill:none;stroke-width:5px;stroke:#4682b4}.drawflow-delete{position:absolute;display:block;width:30px;height:30px;background:#000;color:#fff;z-index:4;border:2px solid #fff;line-height:30px;font-weight:700;text-align:center;border-radius:50%;font-family:monospace;cursor:pointer}.drawflow>.drawflow-delete{margin-left:-15px;margin-top:15px}.parent-node .drawflow-delete{right:-15px;top:-15px} \ No newline at end of file diff --git a/assets/drawflow.min.js b/assets/drawflow.min.js new file mode 100644 index 0000000..ebdcbdd --- /dev/null +++ b/assets/drawflow.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Drawflow=t():e.Drawflow=t()}("undefined"!=typeof self?self:this,(function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var s=t[i]={i:i,l:!1,exports:{}};return e[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)n.d(i,s,function(t){return e[t]}.bind(null,s));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return i}));class i{constructor(e,t=null,n=null){this.events={},this.container=e,this.precanvas=null,this.nodeId=1,this.ele_selected=null,this.node_selected=null,this.drag=!1,this.reroute=!1,this.reroute_fix_curvature=!1,this.curvature=.5,this.reroute_curvature_start_end=.5,this.reroute_curvature=.5,this.reroute_width=6,this.drag_point=!1,this.editor_selected=!1,this.connection=!1,this.connection_ele=null,this.connection_selected=null,this.canvas_x=0,this.canvas_y=0,this.pos_x=0,this.pos_x_start=0,this.pos_y=0,this.pos_y_start=0,this.mouse_x=0,this.mouse_y=0,this.line_path=5,this.first_click=null,this.force_first_input=!1,this.draggable_inputs=!0,this.useuuid=!1,this.parent=n,this.noderegister={},this.render=t,this.drawflow={drawflow:{Home:{data:{}}}},this.module="Home",this.editor_mode="edit",this.zoom=1,this.zoom_max=1.6,this.zoom_min=.5,this.zoom_value=.1,this.zoom_last_value=1,this.evCache=new Array,this.prevDiff=-1}start(){this.container.classList.add("parent-drawflow"),this.container.tabIndex=0,this.precanvas=document.createElement("div"),this.precanvas.classList.add("drawflow"),this.container.appendChild(this.precanvas),this.container.addEventListener("mouseup",this.dragEnd.bind(this)),this.container.addEventListener("mousemove",this.position.bind(this)),this.container.addEventListener("mousedown",this.click.bind(this)),this.container.addEventListener("touchend",this.dragEnd.bind(this)),this.container.addEventListener("touchmove",this.position.bind(this)),this.container.addEventListener("touchstart",this.click.bind(this)),this.container.addEventListener("contextmenu",this.contextmenu.bind(this)),this.container.addEventListener("keydown",this.key.bind(this)),this.container.addEventListener("wheel",this.zoom_enter.bind(this)),this.container.addEventListener("input",this.updateNodeValue.bind(this)),this.container.addEventListener("dblclick",this.dblclick.bind(this)),this.container.onpointerdown=this.pointerdown_handler.bind(this),this.container.onpointermove=this.pointermove_handler.bind(this),this.container.onpointerup=this.pointerup_handler.bind(this),this.container.onpointercancel=this.pointerup_handler.bind(this),this.container.onpointerout=this.pointerup_handler.bind(this),this.container.onpointerleave=this.pointerup_handler.bind(this),this.load()}pointerdown_handler(e){this.evCache.push(e)}pointermove_handler(e){for(var t=0;t100&&(n>this.prevDiff&&this.zoom_in(),n=n&&(n=parseInt(e)+1)}))})),this.nodeId=n}removeReouteConnectionSelected(){this.dispatch("connectionUnselected",!0),this.reroute_fix_curvature&&this.connection_selected.parentElement.querySelectorAll(".main-path").forEach((e,t)=>{e.classList.remove("selected")})}click(e){if(this.dispatch("click",e),"fixed"===this.editor_mode){if("parent-drawflow"!==e.target.classList[0]&&"drawflow"!==e.target.classList[0])return!1;this.ele_selected=e.target.closest(".parent-drawflow"),e.preventDefault()}else"view"===this.editor_mode?(null!=e.target.closest(".drawflow")||e.target.matches(".parent-drawflow"))&&(this.ele_selected=e.target.closest(".parent-drawflow"),e.preventDefault()):(this.first_click=e.target,this.ele_selected=e.target,0===e.button&&this.contextmenuDel(),null!=e.target.closest(".drawflow_content_node")&&(this.ele_selected=e.target.closest(".drawflow_content_node").parentElement));switch(this.ele_selected.classList[0]){case"drawflow-node":null!=this.node_selected&&(this.node_selected.classList.remove("selected"),this.node_selected!=this.ele_selected&&this.dispatch("nodeUnselected",!0)),null!=this.connection_selected&&(this.connection_selected.classList.remove("selected"),this.removeReouteConnectionSelected(),this.connection_selected=null),this.node_selected!=this.ele_selected&&this.dispatch("nodeSelected",this.ele_selected.id.slice(5)),this.node_selected=this.ele_selected,this.node_selected.classList.add("selected"),this.draggable_inputs?"SELECT"!==e.target.tagName&&(this.drag=!0):"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&"SELECT"!==e.target.tagName&&!0!==e.target.hasAttribute("contenteditable")&&(this.drag=!0);break;case"output":this.connection=!0,null!=this.node_selected&&(this.node_selected.classList.remove("selected"),this.node_selected=null,this.dispatch("nodeUnselected",!0)),null!=this.connection_selected&&(this.connection_selected.classList.remove("selected"),this.removeReouteConnectionSelected(),this.connection_selected=null),this.drawConnection(e.target);break;case"parent-drawflow":case"drawflow":null!=this.node_selected&&(this.node_selected.classList.remove("selected"),this.node_selected=null,this.dispatch("nodeUnselected",!0)),null!=this.connection_selected&&(this.connection_selected.classList.remove("selected"),this.removeReouteConnectionSelected(),this.connection_selected=null),this.editor_selected=!0;break;case"main-path":null!=this.node_selected&&(this.node_selected.classList.remove("selected"),this.node_selected=null,this.dispatch("nodeUnselected",!0)),null!=this.connection_selected&&(this.connection_selected.classList.remove("selected"),this.removeReouteConnectionSelected(),this.connection_selected=null),this.connection_selected=this.ele_selected,this.connection_selected.classList.add("selected");const t=this.connection_selected.parentElement.classList;t.length>1&&(this.dispatch("connectionSelected",{output_id:t[2].slice(14),input_id:t[1].slice(13),output_class:t[3],input_class:t[4]}),this.reroute_fix_curvature&&this.connection_selected.parentElement.querySelectorAll(".main-path").forEach((e,t)=>{e.classList.add("selected")}));break;case"point":this.drag_point=!0,this.ele_selected.classList.add("selected");break;case"drawflow-delete":this.node_selected&&this.removeNodeId(this.node_selected.id),this.connection_selected&&this.removeConnection(),null!=this.node_selected&&(this.node_selected.classList.remove("selected"),this.node_selected=null,this.dispatch("nodeUnselected",!0)),null!=this.connection_selected&&(this.connection_selected.classList.remove("selected"),this.removeReouteConnectionSelected(),this.connection_selected=null)}"touchstart"===e.type?(this.pos_x=e.touches[0].clientX,this.pos_x_start=e.touches[0].clientX,this.pos_y=e.touches[0].clientY,this.pos_y_start=e.touches[0].clientY,this.mouse_x=e.touches[0].clientX,this.mouse_y=e.touches[0].clientY):(this.pos_x=e.clientX,this.pos_x_start=e.clientX,this.pos_y=e.clientY,this.pos_y_start=e.clientY),["input","output","main-path"].includes(this.ele_selected.classList[0])&&e.preventDefault(),this.dispatch("clickEnd",e)}position(e){if("touchmove"===e.type)var t=e.touches[0].clientX,n=e.touches[0].clientY;else t=e.clientX,n=e.clientY;if(this.connection&&this.updateConnection(t,n),this.editor_selected&&(i=this.canvas_x+-(this.pos_x-t),s=this.canvas_y+-(this.pos_y-n),this.dispatch("translate",{x:i,y:s}),this.precanvas.style.transform="translate("+i+"px, "+s+"px) scale("+this.zoom+")"),this.drag){e.preventDefault();var i=(this.pos_x-t)*this.precanvas.clientWidth/(this.precanvas.clientWidth*this.zoom),s=(this.pos_y-n)*this.precanvas.clientHeight/(this.precanvas.clientHeight*this.zoom);this.pos_x=t,this.pos_y=n,this.ele_selected.style.top=this.ele_selected.offsetTop-s+"px",this.ele_selected.style.left=this.ele_selected.offsetLeft-i+"px",this.drawflow.drawflow[this.module].data[this.ele_selected.id.slice(5)].pos_x=this.ele_selected.offsetLeft-i,this.drawflow.drawflow[this.module].data[this.ele_selected.id.slice(5)].pos_y=this.ele_selected.offsetTop-s,this.updateConnectionNodes(this.ele_selected.id)}if(this.drag_point){i=(this.pos_x-t)*this.precanvas.clientWidth/(this.precanvas.clientWidth*this.zoom),s=(this.pos_y-n)*this.precanvas.clientHeight/(this.precanvas.clientHeight*this.zoom);this.pos_x=t,this.pos_y=n;var o=this.pos_x*(this.precanvas.clientWidth/(this.precanvas.clientWidth*this.zoom))-this.precanvas.getBoundingClientRect().x*(this.precanvas.clientWidth/(this.precanvas.clientWidth*this.zoom)),l=this.pos_y*(this.precanvas.clientHeight/(this.precanvas.clientHeight*this.zoom))-this.precanvas.getBoundingClientRect().y*(this.precanvas.clientHeight/(this.precanvas.clientHeight*this.zoom));this.ele_selected.setAttributeNS(null,"cx",o),this.ele_selected.setAttributeNS(null,"cy",l);const e=this.ele_selected.parentElement.classList[2].slice(9),c=this.ele_selected.parentElement.classList[1].slice(13),d=this.ele_selected.parentElement.classList[3],a=this.ele_selected.parentElement.classList[4];let r=Array.from(this.ele_selected.parentElement.children).indexOf(this.ele_selected)-1;if(this.reroute_fix_curvature){r-=this.ele_selected.parentElement.querySelectorAll(".main-path").length-1,r<0&&(r=0)}const h=e.slice(5),u=this.drawflow.drawflow[this.module].data[h].outputs[d].connections.findIndex((function(e,t){return e.node===c&&e.output===a}));this.drawflow.drawflow[this.module].data[h].outputs[d].connections[u].points[r]={pos_x:o,pos_y:l};const p=this.ele_selected.parentElement.classList[2].slice(9);this.updateConnectionNodes(p)}"touchmove"===e.type&&(this.mouse_x=t,this.mouse_y=n),this.dispatch("mouseMove",{x:t,y:n})}dragEnd(e){if("touchend"===e.type)var t=this.mouse_x,n=this.mouse_y,i=document.elementFromPoint(t,n);else t=e.clientX,n=e.clientY,i=e.target;if(this.drag&&(this.pos_x_start==t&&this.pos_y_start==n||this.dispatch("nodeMoved",this.ele_selected.id.slice(5))),this.drag_point&&(this.ele_selected.classList.remove("selected"),this.pos_x_start==t&&this.pos_y_start==n||this.dispatch("rerouteMoved",this.ele_selected.parentElement.classList[2].slice(14))),this.editor_selected&&(this.canvas_x=this.canvas_x+-(this.pos_x-t),this.canvas_y=this.canvas_y+-(this.pos_y-n),this.editor_selected=!1),!0===this.connection)if("input"===i.classList[0]||this.force_first_input&&(null!=i.closest(".drawflow_content_node")||"drawflow-node"===i.classList[0])){if(!this.force_first_input||null==i.closest(".drawflow_content_node")&&"drawflow-node"!==i.classList[0])s=i.parentElement.parentElement.id,o=i.classList[1];else{if(null!=i.closest(".drawflow_content_node"))var s=i.closest(".drawflow_content_node").parentElement.id;else var s=i.id;if(0===Object.keys(this.getNodeFromId(s.slice(5)).inputs).length)var o=!1;else var o="input_1"}var l=this.ele_selected.parentElement.parentElement.id,c=this.ele_selected.classList[1];if(l!==s&&!1!==o){if(0===this.container.querySelectorAll(".connection.node_in_"+s+".node_out_"+l+"."+c+"."+o).length){this.connection_ele.classList.add("node_in_"+s),this.connection_ele.classList.add("node_out_"+l),this.connection_ele.classList.add(c),this.connection_ele.classList.add(o);var d=s.slice(5),a=l.slice(5);this.drawflow.drawflow[this.module].data[a].outputs[c].connections.push({node:d,output:o}),this.drawflow.drawflow[this.module].data[d].inputs[o].connections.push({node:a,input:c}),this.updateConnectionNodes("node-"+a),this.updateConnectionNodes("node-"+d),this.dispatch("connectionCreated",{output_id:a,input_id:d,output_class:c,input_class:o})}else this.dispatch("connectionCancel",!0),this.connection_ele.remove();this.connection_ele=null}else this.dispatch("connectionCancel",!0),this.connection_ele.remove(),this.connection_ele=null}else this.dispatch("connectionCancel",!0),this.connection_ele.remove(),this.connection_ele=null;this.drag=!1,this.drag_point=!1,this.connection=!1,this.ele_selected=null,this.editor_selected=!1,this.dispatch("mouseUp",e)}contextmenu(e){if(this.dispatch("contextmenu",e),e.preventDefault(),"fixed"===this.editor_mode||"view"===this.editor_mode)return!1;if(this.precanvas.getElementsByClassName("drawflow-delete").length&&this.precanvas.getElementsByClassName("drawflow-delete")[0].remove(),this.node_selected||this.connection_selected){var t=document.createElement("div");t.classList.add("drawflow-delete"),t.innerHTML="x",this.node_selected&&this.node_selected.appendChild(t),this.connection_selected&&this.connection_selected.parentElement.classList.length>1&&(t.style.top=e.clientY*(this.precanvas.clientHeight/(this.precanvas.clientHeight*this.zoom))-this.precanvas.getBoundingClientRect().y*(this.precanvas.clientHeight/(this.precanvas.clientHeight*this.zoom))+"px",t.style.left=e.clientX*(this.precanvas.clientWidth/(this.precanvas.clientWidth*this.zoom))-this.precanvas.getBoundingClientRect().x*(this.precanvas.clientWidth/(this.precanvas.clientWidth*this.zoom))+"px",this.precanvas.appendChild(t))}}contextmenuDel(){this.precanvas.getElementsByClassName("drawflow-delete").length&&this.precanvas.getElementsByClassName("drawflow-delete")[0].remove()}key(e){if(this.dispatch("keydown",e),"fixed"===this.editor_mode||"view"===this.editor_mode)return!1;("Delete"===e.key||"Backspace"===e.key&&e.metaKey)&&(null!=this.node_selected&&"INPUT"!==this.first_click.tagName&&"TEXTAREA"!==this.first_click.tagName&&!0!==this.first_click.hasAttribute("contenteditable")&&this.removeNodeId(this.node_selected.id),null!=this.connection_selected&&this.removeConnection())}zoom_enter(e,t){e.ctrlKey&&(e.preventDefault(),e.deltaY>0?this.zoom_out():this.zoom_in())}zoom_refresh(){this.dispatch("zoom",this.zoom),this.canvas_x=this.canvas_x/this.zoom_last_value*this.zoom,this.canvas_y=this.canvas_y/this.zoom_last_value*this.zoom,this.zoom_last_value=this.zoom,this.precanvas.style.transform="translate("+this.canvas_x+"px, "+this.canvas_y+"px) scale("+this.zoom+")"}zoom_in(){this.zoomthis.zoom_min&&(this.zoom-=this.zoom_value,this.zoom_refresh())}zoom_reset(){1!=this.zoom&&(this.zoom=1,this.zoom_refresh())}createCurvature(e,t,n,i,s,o){var l=e,c=t,d=n,a=i,r=s;switch(o){case"open":if(e>=n)var h=l+Math.abs(d-l)*r,u=d-Math.abs(d-l)*(-1*r);else h=l+Math.abs(d-l)*r,u=d-Math.abs(d-l)*r;return" M "+l+" "+c+" C "+h+" "+c+" "+u+" "+a+" "+d+" "+a;case"close":if(e>=n)h=l+Math.abs(d-l)*(-1*r),u=d-Math.abs(d-l)*r;else h=l+Math.abs(d-l)*r,u=d-Math.abs(d-l)*r;return" M "+l+" "+c+" C "+h+" "+c+" "+u+" "+a+" "+d+" "+a;case"other":if(e>=n)h=l+Math.abs(d-l)*(-1*r),u=d-Math.abs(d-l)*(-1*r);else h=l+Math.abs(d-l)*r,u=d-Math.abs(d-l)*r;return" M "+l+" "+c+" C "+h+" "+c+" "+u+" "+a+" "+d+" "+a;default:return" M "+l+" "+c+" C "+(h=l+Math.abs(d-l)*r)+" "+c+" "+(u=d-Math.abs(d-l)*r)+" "+a+" "+d+" "+a}}drawConnection(e){var t=document.createElementNS("http://www.w3.org/2000/svg","svg");this.connection_ele=t;var n=document.createElementNS("http://www.w3.org/2000/svg","path");n.classList.add("main-path"),n.setAttributeNS(null,"d",""),t.classList.add("connection"),t.appendChild(n),this.precanvas.appendChild(t);var i=e.parentElement.parentElement.id.slice(5),s=e.classList[1];this.dispatch("connectionStart",{output_id:i,output_class:s})}updateConnection(e,t){const n=this.precanvas,i=this.zoom;let s=n.clientWidth/(n.clientWidth*i);s=s||0;let o=n.clientHeight/(n.clientHeight*i);o=o||0;var l=this.connection_ele.children[0],c=this.ele_selected.offsetWidth/2+(this.ele_selected.getBoundingClientRect().x-n.getBoundingClientRect().x)*s,d=this.ele_selected.offsetHeight/2+(this.ele_selected.getBoundingClientRect().y-n.getBoundingClientRect().y)*o,a=e*(this.precanvas.clientWidth/(this.precanvas.clientWidth*this.zoom))-this.precanvas.getBoundingClientRect().x*(this.precanvas.clientWidth/(this.precanvas.clientWidth*this.zoom)),r=t*(this.precanvas.clientHeight/(this.precanvas.clientHeight*this.zoom))-this.precanvas.getBoundingClientRect().y*(this.precanvas.clientHeight/(this.precanvas.clientHeight*this.zoom)),h=this.curvature,u=this.createCurvature(c,d,a,r,h,"openclose");l.setAttributeNS(null,"d",u)}addConnection(e,t,n,i){var s=this.getModuleFromNodeId(e);if(s===this.getModuleFromNodeId(t)){var o=this.getNodeFromId(e),l=!1;for(var c in o.outputs[n].connections){var d=o.outputs[n].connections[c];d.node==t&&d.output==i&&(l=!0)}if(!1===l){if(this.drawflow.drawflow[s].data[e].outputs[n].connections.push({node:t.toString(),output:i}),this.drawflow.drawflow[s].data[t].inputs[i].connections.push({node:e.toString(),input:n}),this.module===s){var a=document.createElementNS("http://www.w3.org/2000/svg","svg"),r=document.createElementNS("http://www.w3.org/2000/svg","path");r.classList.add("main-path"),r.setAttributeNS(null,"d",""),a.classList.add("connection"),a.classList.add("node_in_node-"+t),a.classList.add("node_out_node-"+e),a.classList.add(n),a.classList.add(i),a.appendChild(r),this.precanvas.appendChild(a),this.updateConnectionNodes("node-"+e),this.updateConnectionNodes("node-"+t)}this.dispatch("connectionCreated",{output_id:e,input_id:t,output_class:n,input_class:i})}}}updateConnectionNodes(e){const t="node_in_"+e,n="node_out_"+e;this.line_path;const i=this.container,s=this.precanvas,o=this.curvature,l=this.createCurvature,c=this.reroute_curvature,d=this.reroute_curvature_start_end,a=this.reroute_fix_curvature,r=this.reroute_width,h=this.zoom;let u=s.clientWidth/(s.clientWidth*h);u=u||0;let p=s.clientHeight/(s.clientHeight*h);p=p||0;const f=i.querySelectorAll("."+n);Object.keys(f).map((function(t,n){if(null===f[t].querySelector(".point")){var m=i.querySelector("#"+e),g=f[t].classList[1].replace("node_in_",""),_=i.querySelector("#"+g).querySelectorAll("."+f[t].classList[4])[0],w=_.offsetWidth/2+(_.getBoundingClientRect().x-s.getBoundingClientRect().x)*u,v=_.offsetHeight/2+(_.getBoundingClientRect().y-s.getBoundingClientRect().y)*p,y=m.querySelectorAll("."+f[t].classList[3])[0],C=y.offsetWidth/2+(y.getBoundingClientRect().x-s.getBoundingClientRect().x)*u,x=y.offsetHeight/2+(y.getBoundingClientRect().y-s.getBoundingClientRect().y)*p;const n=l(C,x,w,v,o,"openclose");f[t].children[0].setAttributeNS(null,"d",n)}else{const n=f[t].querySelectorAll(".point");let o="";const m=[];n.forEach((t,a)=>{if(0===a&&n.length-1==0){var f=i.querySelector("#"+e),g=((x=t).getBoundingClientRect().x-s.getBoundingClientRect().x)*u+r,_=(x.getBoundingClientRect().y-s.getBoundingClientRect().y)*p+r,w=(L=f.querySelectorAll("."+t.parentElement.classList[3])[0]).offsetWidth/2+(L.getBoundingClientRect().x-s.getBoundingClientRect().x)*u,v=L.offsetHeight/2+(L.getBoundingClientRect().y-s.getBoundingClientRect().y)*p,y=l(w,v,g,_,d,"open");o+=y,m.push(y);f=t;var C=t.parentElement.classList[1].replace("node_in_",""),x=(E=i.querySelector("#"+C)).querySelectorAll("."+t.parentElement.classList[4])[0];g=(R=E.querySelectorAll("."+t.parentElement.classList[4])[0]).offsetWidth/2+(R.getBoundingClientRect().x-s.getBoundingClientRect().x)*u,_=R.offsetHeight/2+(R.getBoundingClientRect().y-s.getBoundingClientRect().y)*p,w=(f.getBoundingClientRect().x-s.getBoundingClientRect().x)*u+r,v=(f.getBoundingClientRect().y-s.getBoundingClientRect().y)*p+r,y=l(w,v,g,_,d,"close");o+=y,m.push(y)}else if(0===a){var L;f=i.querySelector("#"+e),g=((x=t).getBoundingClientRect().x-s.getBoundingClientRect().x)*u+r,_=(x.getBoundingClientRect().y-s.getBoundingClientRect().y)*p+r,w=(L=f.querySelectorAll("."+t.parentElement.classList[3])[0]).offsetWidth/2+(L.getBoundingClientRect().x-s.getBoundingClientRect().x)*u,v=L.offsetHeight/2+(L.getBoundingClientRect().y-s.getBoundingClientRect().y)*p,y=l(w,v,g,_,d,"open");o+=y,m.push(y);f=t,g=((x=n[a+1]).getBoundingClientRect().x-s.getBoundingClientRect().x)*u+r,_=(x.getBoundingClientRect().y-s.getBoundingClientRect().y)*p+r,w=(f.getBoundingClientRect().x-s.getBoundingClientRect().x)*u+r,v=(f.getBoundingClientRect().y-s.getBoundingClientRect().y)*p+r,y=l(w,v,g,_,c,"other");o+=y,m.push(y)}else if(a===n.length-1){var E,R;f=t,C=t.parentElement.classList[1].replace("node_in_",""),x=(E=i.querySelector("#"+C)).querySelectorAll("."+t.parentElement.classList[4])[0],g=(R=E.querySelectorAll("."+t.parentElement.classList[4])[0]).offsetWidth/2+(R.getBoundingClientRect().x-s.getBoundingClientRect().x)*u,_=R.offsetHeight/2+(R.getBoundingClientRect().y-s.getBoundingClientRect().y)*p,w=(f.getBoundingClientRect().x-s.getBoundingClientRect().x)*(s.clientWidth/(s.clientWidth*h))+r,v=(f.getBoundingClientRect().y-s.getBoundingClientRect().y)*(s.clientHeight/(s.clientHeight*h))+r,y=l(w,v,g,_,d,"close");o+=y,m.push(y)}else{f=t,g=((x=n[a+1]).getBoundingClientRect().x-s.getBoundingClientRect().x)*(s.clientWidth/(s.clientWidth*h))+r,_=(x.getBoundingClientRect().y-s.getBoundingClientRect().y)*(s.clientHeight/(s.clientHeight*h))+r,w=(f.getBoundingClientRect().x-s.getBoundingClientRect().x)*(s.clientWidth/(s.clientWidth*h))+r,v=(f.getBoundingClientRect().y-s.getBoundingClientRect().y)*(s.clientHeight/(s.clientHeight*h))+r,y=l(w,v,g,_,c,"other");o+=y,m.push(y)}}),a?m.forEach((e,n)=>{f[t].children[n].setAttributeNS(null,"d",e)}):f[t].children[0].setAttributeNS(null,"d",o)}}));const m=i.querySelectorAll("."+t);Object.keys(m).map((function(t,n){if(null===m[t].querySelector(".point")){var h=i.querySelector("#"+e),f=m[t].classList[2].replace("node_out_",""),g=i.querySelector("#"+f).querySelectorAll("."+m[t].classList[3])[0],_=g.offsetWidth/2+(g.getBoundingClientRect().x-s.getBoundingClientRect().x)*u,w=g.offsetHeight/2+(g.getBoundingClientRect().y-s.getBoundingClientRect().y)*p,v=(h=h.querySelectorAll("."+m[t].classList[4])[0]).offsetWidth/2+(h.getBoundingClientRect().x-s.getBoundingClientRect().x)*u,y=h.offsetHeight/2+(h.getBoundingClientRect().y-s.getBoundingClientRect().y)*p;const n=l(_,w,v,y,o,"openclose");m[t].children[0].setAttributeNS(null,"d",n)}else{const n=m[t].querySelectorAll(".point");let o="";const h=[];n.forEach((t,a)=>{if(0===a&&n.length-1==0){var f=i.querySelector("#"+e),m=((C=t).getBoundingClientRect().x-s.getBoundingClientRect().x)*u+r,g=(C.getBoundingClientRect().y-s.getBoundingClientRect().y)*p+r,_=(E=f.querySelectorAll("."+t.parentElement.classList[4])[0]).offsetWidth/2+(E.getBoundingClientRect().x-s.getBoundingClientRect().x)*u,w=E.offsetHeight/2+(E.getBoundingClientRect().y-s.getBoundingClientRect().y)*p,v=l(m,g,_,w,d,"close");o+=v,h.push(v);f=t;var y=t.parentElement.classList[2].replace("node_out_",""),C=(L=i.querySelector("#"+y)).querySelectorAll("."+t.parentElement.classList[3])[0];m=(x=L.querySelectorAll("."+t.parentElement.classList[3])[0]).offsetWidth/2+(x.getBoundingClientRect().x-s.getBoundingClientRect().x)*u,g=x.offsetHeight/2+(x.getBoundingClientRect().y-s.getBoundingClientRect().y)*p,_=(f.getBoundingClientRect().x-s.getBoundingClientRect().x)*u+r,w=(f.getBoundingClientRect().y-s.getBoundingClientRect().y)*p+r,v=l(m,g,_,w,d,"open");o+=v,h.push(v)}else if(0===a){var x;f=t,y=t.parentElement.classList[2].replace("node_out_",""),C=(L=i.querySelector("#"+y)).querySelectorAll("."+t.parentElement.classList[3])[0],m=(x=L.querySelectorAll("."+t.parentElement.classList[3])[0]).offsetWidth/2+(x.getBoundingClientRect().x-s.getBoundingClientRect().x)*u,g=x.offsetHeight/2+(x.getBoundingClientRect().y-s.getBoundingClientRect().y)*p,_=(f.getBoundingClientRect().x-s.getBoundingClientRect().x)*u+r,w=(f.getBoundingClientRect().y-s.getBoundingClientRect().y)*p+r,v=l(m,g,_,w,d,"open");o+=v,h.push(v);f=t,_=((C=n[a+1]).getBoundingClientRect().x-s.getBoundingClientRect().x)*u+r,w=(C.getBoundingClientRect().y-s.getBoundingClientRect().y)*p+r,m=(f.getBoundingClientRect().x-s.getBoundingClientRect().x)*u+r,g=(f.getBoundingClientRect().y-s.getBoundingClientRect().y)*p+r,v=l(m,g,_,w,c,"other");o+=v,h.push(v)}else if(a===n.length-1){var L,E;f=t,y=t.parentElement.classList[1].replace("node_in_",""),C=(L=i.querySelector("#"+y)).querySelectorAll("."+t.parentElement.classList[4])[0],_=(E=L.querySelectorAll("."+t.parentElement.classList[4])[0]).offsetWidth/2+(E.getBoundingClientRect().x-s.getBoundingClientRect().x)*u,w=E.offsetHeight/2+(E.getBoundingClientRect().y-s.getBoundingClientRect().y)*p,m=(f.getBoundingClientRect().x-s.getBoundingClientRect().x)*u+r,g=(f.getBoundingClientRect().y-s.getBoundingClientRect().y)*p+r,v=l(m,g,_,w,d,"close");o+=v,h.push(v)}else{f=t,_=((C=n[a+1]).getBoundingClientRect().x-s.getBoundingClientRect().x)*u+r,w=(C.getBoundingClientRect().y-s.getBoundingClientRect().y)*p+r,m=(f.getBoundingClientRect().x-s.getBoundingClientRect().x)*u+r,g=(f.getBoundingClientRect().y-s.getBoundingClientRect().y)*p+r,v=l(m,g,_,w,c,"other");o+=v,h.push(v)}}),a?h.forEach((e,n)=>{m[t].children[n].setAttributeNS(null,"d",e)}):m[t].children[0].setAttributeNS(null,"d",o)}}))}dblclick(e){null!=this.connection_selected&&this.reroute&&this.createReroutePoint(this.connection_selected),"point"===e.target.classList[0]&&this.removeReroutePoint(e.target)}createReroutePoint(e){this.connection_selected.classList.remove("selected");const t=this.connection_selected.parentElement.classList[2].slice(9),n=this.connection_selected.parentElement.classList[1].slice(13),i=this.connection_selected.parentElement.classList[3],s=this.connection_selected.parentElement.classList[4];this.connection_selected=null;const o=document.createElementNS("http://www.w3.org/2000/svg","circle");o.classList.add("point");var l=this.pos_x*(this.precanvas.clientWidth/(this.precanvas.clientWidth*this.zoom))-this.precanvas.getBoundingClientRect().x*(this.precanvas.clientWidth/(this.precanvas.clientWidth*this.zoom)),c=this.pos_y*(this.precanvas.clientHeight/(this.precanvas.clientHeight*this.zoom))-this.precanvas.getBoundingClientRect().y*(this.precanvas.clientHeight/(this.precanvas.clientHeight*this.zoom));o.setAttributeNS(null,"cx",l),o.setAttributeNS(null,"cy",c),o.setAttributeNS(null,"r",this.reroute_width);let d=0;if(this.reroute_fix_curvature){const t=e.parentElement.querySelectorAll(".main-path").length;var a=document.createElementNS("http://www.w3.org/2000/svg","path");if(a.classList.add("main-path"),a.setAttributeNS(null,"d",""),e.parentElement.insertBefore(a,e.parentElement.children[t]),1===t)e.parentElement.appendChild(o);else{const n=Array.from(e.parentElement.children).indexOf(e);d=n,e.parentElement.insertBefore(o,e.parentElement.children[n+t+1])}}else e.parentElement.appendChild(o);const r=t.slice(5),h=this.drawflow.drawflow[this.module].data[r].outputs[i].connections.findIndex((function(e,t){return e.node===n&&e.output===s}));void 0===this.drawflow.drawflow[this.module].data[r].outputs[i].connections[h].points&&(this.drawflow.drawflow[this.module].data[r].outputs[i].connections[h].points=[]),this.reroute_fix_curvature?(d>0||this.drawflow.drawflow[this.module].data[r].outputs[i].connections[h].points!==[]?this.drawflow.drawflow[this.module].data[r].outputs[i].connections[h].points.splice(d,0,{pos_x:l,pos_y:c}):this.drawflow.drawflow[this.module].data[r].outputs[i].connections[h].points.push({pos_x:l,pos_y:c}),e.parentElement.querySelectorAll(".main-path").forEach((e,t)=>{e.classList.remove("selected")})):this.drawflow.drawflow[this.module].data[r].outputs[i].connections[h].points.push({pos_x:l,pos_y:c}),this.dispatch("addReroute",r),this.updateConnectionNodes(t)}removeReroutePoint(e){const t=e.parentElement.classList[2].slice(9),n=e.parentElement.classList[1].slice(13),i=e.parentElement.classList[3],s=e.parentElement.classList[4];let o=Array.from(e.parentElement.children).indexOf(e);const l=t.slice(5),c=this.drawflow.drawflow[this.module].data[l].outputs[i].connections.findIndex((function(e,t){return e.node===n&&e.output===s}));if(this.reroute_fix_curvature){const t=e.parentElement.querySelectorAll(".main-path").length;e.parentElement.children[t-1].remove(),o-=t,o<0&&(o=0)}else o--;this.drawflow.drawflow[this.module].data[l].outputs[i].connections[c].points.splice(o,1),e.remove(),this.dispatch("removeReroute",l),this.updateConnectionNodes(t)}registerNode(e,t,n=null,i=null){this.noderegister[e]={html:t,props:n,options:i}}getNodeFromId(e){var t=this.getModuleFromNodeId(e);return JSON.parse(JSON.stringify(this.drawflow.drawflow[t].data[e]))}getNodesFromName(e){var t=[];const n=this.drawflow.drawflow;return Object.keys(n).map((function(i,s){for(var o in n[i].data)n[i].data[o].name==e&&t.push(n[i].data[o].id)})),t}addNode(e,t,n,i,s,o,l,c,d=!1){if(this.useuuid)var a=this.getUuid();else a=this.nodeId;const r=document.createElement("div");r.classList.add("parent-node");const h=document.createElement("div");h.innerHTML="",h.setAttribute("id","node-"+a),h.classList.add("drawflow-node"),""!=o&&h.classList.add(...o.split(" "));const u=document.createElement("div");u.classList.add("inputs");const p=document.createElement("div");p.classList.add("outputs");const f={};for(var m=0;me(this.noderegister[c].html,{props:this.noderegister[c].props}),...this.noderegister[c].options}).$mount();_.appendChild(e.$el)}Object.entries(l).forEach((function(e,t){if("object"==typeof e[1])!function e(t,n,i){if(null===t)t=l[n];else t=t[n];null!==t&&Object.entries(t).forEach((function(n,s){if("object"==typeof n[1])e(t,n[0],i+"-"+n[0]);else for(var o=_.querySelectorAll("[df-"+i+"-"+n[0]+"]"),l=0;lt(this.noderegister[e.html].html,{props:this.noderegister[e.html].props}),...this.noderegister[e.html].options}).$mount();c.appendChild(t.$el)}Object.entries(e.data).forEach((function(t,n){if("object"==typeof t[1])!function t(n,i,s){if(null===n)n=e.data[i];else n=n[i];null!==n&&Object.entries(n).forEach((function(e,i){if("object"==typeof e[1])t(n,e[0],s+"-"+e[0]);else for(var o=c.querySelectorAll("[df-"+s+"-"+e[0]+"]"),l=0;l{const a=e.outputs[s].connections[o].node,r=e.outputs[s].connections[o].output,h=i.querySelector(".connection.node_in_node-"+a+".node_out_node-"+e.id+"."+s+"."+r);if(n&&0===d)for(var u=0;u{this.removeSingleConnection(e.id_output,e.id,e.output_class,e.input_class)}),delete this.drawflow.drawflow[n].data[e].inputs[t];const o=[],l=this.drawflow.drawflow[n].data[e].inputs;Object.keys(l).map((function(e,t){o.push(l[e])})),this.drawflow.drawflow[n].data[e].inputs={};const c=t.slice(6);let d=[];if(o.forEach((t,i)=>{t.connections.forEach((e,t)=>{d.push(e)}),this.drawflow.drawflow[n].data[e].inputs["input_"+(i+1)]=t}),d=new Set(d.map(e=>JSON.stringify(e))),d=Array.from(d).map(e=>JSON.parse(e)),this.module===n){this.container.querySelectorAll("#node-"+e+" .inputs .input").forEach((e,t)=>{const n=e.classList[1].slice(6);parseInt(c){this.drawflow.drawflow[n].data[t.node].outputs[t.input].connections.forEach((i,s)=>{if(i.node==e){const o=i.output.slice(6);if(parseInt(c){this.removeSingleConnection(e.id,e.id_input,e.output_class,e.input_class)}),delete this.drawflow.drawflow[n].data[e].outputs[t];const o=[],l=this.drawflow.drawflow[n].data[e].outputs;Object.keys(l).map((function(e,t){o.push(l[e])})),this.drawflow.drawflow[n].data[e].outputs={};const c=t.slice(7);let d=[];if(o.forEach((t,i)=>{t.connections.forEach((e,t)=>{d.push({node:e.node,output:e.output})}),this.drawflow.drawflow[n].data[e].outputs["output_"+(i+1)]=t}),d=new Set(d.map(e=>JSON.stringify(e))),d=Array.from(d).map(e=>JSON.parse(e)),this.module===n){this.container.querySelectorAll("#node-"+e+" .outputs .output").forEach((e,t)=>{const n=e.classList[1].slice(7);parseInt(c){this.drawflow.drawflow[n].data[t.node].inputs[t.output].connections.forEach((i,s)=>{if(i.node==e){const o=i.input.slice(7);if(parseInt(c)-1){this.module===s&&this.container.querySelector(".connection.node_in_node-"+t+".node_out_node-"+e+"."+n+"."+i).remove();var o=this.drawflow.drawflow[s].data[e].outputs[n].connections.findIndex((function(e,n){return e.node==t&&e.output===i}));this.drawflow.drawflow[s].data[e].outputs[n].connections.splice(o,1);var l=this.drawflow.drawflow[s].data[t].inputs[i].connections.findIndex((function(t,i){return t.node==e&&t.input===n}));return this.drawflow.drawflow[s].data[t].inputs[i].connections.splice(l,1),this.dispatch("connectionRemoved",{output_id:e,input_id:t,output_class:n,input_class:i}),!0}return!1}return!1}removeConnectionNodeId(e){const t="node_in_"+e,n="node_out_"+e,i=this.container.querySelectorAll("."+n);for(var s=i.length-1;s>=0;s--){var o=i[s].classList,l=this.drawflow.drawflow[this.module].data[o[1].slice(13)].inputs[o[4]].connections.findIndex((function(e,t){return e.node===o[2].slice(14)&&e.input===o[3]}));this.drawflow.drawflow[this.module].data[o[1].slice(13)].inputs[o[4]].connections.splice(l,1);var c=this.drawflow.drawflow[this.module].data[o[2].slice(14)].outputs[o[3]].connections.findIndex((function(e,t){return e.node===o[1].slice(13)&&e.output===o[4]}));this.drawflow.drawflow[this.module].data[o[2].slice(14)].outputs[o[3]].connections.splice(c,1),i[s].remove(),this.dispatch("connectionRemoved",{output_id:o[2].slice(14),input_id:o[1].slice(13),output_class:o[3],input_class:o[4]})}const d=this.container.querySelectorAll("."+t);for(s=d.length-1;s>=0;s--){o=d[s].classList,c=this.drawflow.drawflow[this.module].data[o[2].slice(14)].outputs[o[3]].connections.findIndex((function(e,t){return e.node===o[1].slice(13)&&e.output===o[4]}));this.drawflow.drawflow[this.module].data[o[2].slice(14)].outputs[o[3]].connections.splice(c,1);l=this.drawflow.drawflow[this.module].data[o[1].slice(13)].inputs[o[4]].connections.findIndex((function(e,t){return e.node===o[2].slice(14)&&e.input===o[3]}));this.drawflow.drawflow[this.module].data[o[1].slice(13)].inputs[o[4]].connections.splice(l,1),d[s].remove(),this.dispatch("connectionRemoved",{output_id:o[2].slice(14),input_id:o[1].slice(13),output_class:o[3],input_class:o[4]})}}getModuleFromNodeId(e){var t;const n=this.drawflow.drawflow;return Object.keys(n).map((function(i,s){Object.keys(n[i].data).map((function(n,s){n==e&&(t=i)}))})),t}addModule(e){this.drawflow.drawflow[e]={data:{}},this.dispatch("moduleCreated",e)}changeModule(e){this.dispatch("moduleChanged",e),this.module=e,this.precanvas.innerHTML="",this.canvas_x=0,this.canvas_y=0,this.pos_x=0,this.pos_y=0,this.mouse_x=0,this.mouse_y=0,this.zoom=1,this.zoom_last_value=1,this.precanvas.style.transform="",this.import(this.drawflow,!1)}removeModule(e){this.module===e&&this.changeModule("Home"),delete this.drawflow.drawflow[e],this.dispatch("moduleRemoved",e)}clearModuleSelected(){this.precanvas.innerHTML="",this.drawflow.drawflow[this.module]={data:{}}}clear(){this.precanvas.innerHTML="",this.drawflow={drawflow:{Home:{data:{}}}}}export(){const e=JSON.parse(JSON.stringify(this.drawflow));return this.dispatch("export",e),e}import(e,t=!0){this.clear(),this.drawflow=JSON.parse(JSON.stringify(e)),this.load(),t&&this.dispatch("import","import")}on(e,t){return"function"!=typeof t?(console.error("The listener callback must be a function, the given type is "+typeof t),!1):"string"!=typeof e?(console.error("The event name must be a string, the given type is "+typeof e),!1):(void 0===this.events[e]&&(this.events[e]={listeners:[]}),void this.events[e].listeners.push(t))}removeListener(e,t){if(!this.events[e])return!1;const n=this.events[e].listeners,i=n.indexOf(t);i>-1&&n.splice(i,1)}dispatch(e,t){if(void 0===this.events[e])return!1;this.events[e].listeners.forEach(e=>{e(t)})}getUuid(){for(var e=[],t=0;t<36;t++)e[t]="0123456789abcdef".substr(Math.floor(16*Math.random()),1);return e[14]="4",e[19]="0123456789abcdef".substr(3&e[19]|8,1),e[8]=e[13]=e[18]=e[23]="-",e.join("")}}}]).default})); \ No newline at end of file diff --git a/assets/latest-console-repo-commit.txt b/assets/latest-console-repo-commit.txt new file mode 100644 index 0000000..d8a5521 --- /dev/null +++ b/assets/latest-console-repo-commit.txt @@ -0,0 +1 @@ +358446d5e3f20e5e931405a7685f9474d82af7fd diff --git a/assets/latest-rps-repo-commit.txt b/assets/latest-rps-repo-commit.txt new file mode 100644 index 0000000..0eaa80c --- /dev/null +++ b/assets/latest-rps-repo-commit.txt @@ -0,0 +1 @@ +15a805f5754478f504359e33e8256e1bcb92acbb diff --git a/assets/requirement-profiles/LICENSE b/assets/requirement-profiles/LICENSE new file mode 100644 index 0000000..21d052f --- /dev/null +++ b/assets/requirement-profiles/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 FörderFunke + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/assets/requirement-profiles/README.md b/assets/requirement-profiles/README.md new file mode 100644 index 0000000..c57eb96 --- /dev/null +++ b/assets/requirement-profiles/README.md @@ -0,0 +1,6 @@ +# requirement-profiles +Requirement profiles, details about datafields and materialization queries. + +Used in the [FörderFunke app](https://github.com/Citizen-Knowledge-Graph/foerderfunke-react-app) together with the [matching-engine](https://github.com/Citizen-Knowledge-Graph/matching-engine). + +The URIs in our namespace can be resolved in the browser via the [foerderfunke-react-app](https://github.com/Citizen-Knowledge-Graph/foerderfunke-react-app). For instance: [https://foerderfunke.org/default#geburtsdatum](https://foerderfunke.org/default#geburtsdatum). diff --git a/assets/requirement-profiles/datafields.ttl b/assets/requirement-profiles/datafields.ttl new file mode 100644 index 0000000..3500bab --- /dev/null +++ b/assets/requirement-profiles/datafields.ttl @@ -0,0 +1,363 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix xsd: . +@prefix fim: . +@prefix ff: . +@prefix sh: . +@prefix foaf: . +@prefix dcterms: . + +ff:hasFirstNames a ff:FimDataFieldProperty, ff:DataField ; + ff:hasFimId fim:F00000154 ; + ff:hasFimVersion "1.3" ; + ff:hasFimUrl "https://schema.fim.fitko.net/fields/baukasten/F00000154/1.3" ; + rdfs:label "Vorname" ; # Vornamen + rdfs:comment "Vorname + Mittelnamen" ; + ff:similarDatafield foaf:firstName ; # owl equivalentProperty/class? TODO + ff:hasShaclShape ff:FirstNamesShape . +ff:FirstNamesShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:hasFirstNames ; + sh:datatype xsd:string ; + sh:maxCount 1 ; + ] . + +ff:hasFamilyName a ff:FimDataFieldProperty, ff:DataField ; + ff:hasFimId fim:F00000013 ; + ff:hasFimVersion "1.5" ; + ff:hasFimUrl "https://schema.fim.fitko.net/fields/baukasten/F00000013/1.5" ; + rdfs:label "Nachname" ; # Familienname + rdfs:comment "Familienname einer natürlichen Person bestehend aus Nachname, Zuname bzw. Familienname." ; + ff:similarDatafield foaf:lastName ; + ff:hasShaclShape ff:FamilyNameShape . +ff:FamilyNameShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:hasFamilyName ; + sh:datatype xsd:string ; + sh:maxCount 1 ; + ] . + +ff:hasBirthday a ff:FimDataFieldProperty, ff:DataField ; + ff:hasFimId fim:F03008235 ; + ff:hasFimVersion "2.0" ; + ff:hasFimUrl "https://schema.fim.fitko.net/fields/baukasten/F03008235/2.0" ; + rdfs:label "Geburtsdatum" ; + rdfs:comment "Dieses Feld beinhaltet das Geburtsdatum, also Tag, Monat und Jahr der Vollendung der Geburt." ; + ff:similarDatafield foaf:birthday ; + ff:hasShaclShape ff:BirthdayShape . +ff:BirthdayShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:hasBirthday ; + sh:datatype xsd:date ; + sh:maxCount 1 ; + ] . + +ff:hasGender a ff:FimDataFieldProperty, ff:DataField ; + ff:hasFimId fim:F60000332 ; + ff:hasFimVersion "1.3" ; + ff:hasFimUrl "https://schema.fim.fitko.net/fields/baukasten/F60000332/1.3" ; + rdfs:label "Geschlecht" ; + rdfs:comment "Beschreibt das Geschlecht einer Person. Folgende Angaben sind möglich: divers, männlich, weiblich, keine Angabe" ; + ff:hasShaclShape ff:GenderShape . +ff:GenderShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:hasGender ; + sh:in ("weiblich" "männlich" "divers" "keine Angabe") ; + sh:maxCount 1 ; + rdfs:seeAlso + ] . + +ff:hasBirthPlace a ff:FimDataFieldProperty, ff:DataField ; + ff:hasFimId fim:F00000067 ; + ff:hasFimVersion "1.3" ; + ff:hasFimUrl "https://schema.fim.fitko.net/fields/baukasten/F00000067/1.3" ; + rdfs:label "Geburtsort" ; + rdfs:comment "Der Ort der Geburt einer natürlichen Person." ; + ff:hasShaclShape ff:BirthPlaceShape . +ff:BirthPlaceShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:hasBirthPlace ; + sh:datatype xsd:string ; + sh:maxCount 1 ; + ] . + +ff:hasResidence a ff:FimDataFieldProperty, ff:DataField ; + ff:hasFimId fim:F03010085 ; + ff:hasFimVersion "1.0" ; + ff:hasFimUrl "https://schema.fim.fitko.net/fields/baukasten/F03010085/1.0" ; + rdfs:label "Wohnort" ; + rdfs:comment "Enthält den Namen eines Ortes (Gemeinde, Ortschaft oder Stadt)." ; + ff:hasShaclShape ff:ResidenceShape . +ff:ResidenceShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:hasResidence ; + sh:datatype xsd:string ; + sh:maxCount 1 ; + ] . + +ff:hasMaritalStatus a ff:FimDataFieldProperty, ff:DataField ; + ff:hasFimId fim:F00000559 ; + ff:hasFimVersion "1.3" ; + ff:hasFimUrl "https://schema.fim.fitko.net/fields/baukasten/F00000559/1.3" ; + rdfs:label "Familienstand" ; + ff:hasShaclShape ff:MaritalStatusShape . +ff:MaritalStatusShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:hasMaritalStatus ; + sh:in ("LD" "VH" "VW" "GS" "EA" "LP" "LV" "LA" "LE" "NB") ; + sh:maxCount 1 ; + ff:shInAbbrevationsStandFor ("ledig" "verheiratet" "verwitwet" "geschieden" "Ehe aufgehoben" "in eingetragener Lebenspartnerschaft" "durch Tod aufgelöste Lebenspartnerschaft" "aufgehobene Lebenspartnerschaft" "durch Todeserklärung aufgelöste Lebenspartnerschaft" "nicht bekannt") ; + rdfs:seeAlso + ] . + +ff:eligibleForSocialSupport a ff:DataField ; + rdfs:label "Sozialbedürftig" ; + rdfs:comment "This is a shortcut for demo purposes" ; + ff:hasShaclShape ff:EligibleForSocialSupportShape . +ff:EligibleForSocialSupportShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:eligibleForSocialSupport ; + sh:datatype xsd:boolean ; + ] . + +ff:worksAsFreelancer a ff:DataField ; + rdfs:label "Selbstständige Tätigkeiten" ; + ff:hasShaclShape ff:WorksAsFreelancerShape . +ff:WorksAsFreelancerShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:worksAsFreelancer ; + sh:datatype xsd:boolean ; + ] . + +# ------------------------------------------------------ + +ff:hasAge a ff:DataField ; + rdfs:label "Alter" ; + ff:similarDatafield foaf:age ; + ff:hasShaclShape ff:AgeShape . +ff:AgeShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:hasAge ; + sh:datatype xsd:integer ; + sh:minInclusive 0 ; + sh:maxCount 1 ; + ] . + +ff:paysRentCold a ff:FimDataFieldProperty, ff:DataField ; + ff:hasFimId fim:F00000240 ; + ff:hasFimVersion "1.5" ; + rdfs:label "Höhe der Miete" ; + ff:hasShaclShape ff:paysRentColdShape . +ff:paysRentColdShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:paysRentCold ; + sh:datatype xsd:integer ; + sh:maxCount 1 ; + sh:minInclusive 0 ; + ] . + +ff:hasLivingArea a ff:FimDataFieldProperty, ff:DataField ; + ff:hasFimId fim:F00003175 ; + ff:hasFimVersion "1.0" ; + rdfs:label "Wohnfläche in m²" ; + ff:hasShaclShape ff:hasLivingAreaShape . +ff:hasLivingAreaShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:hasLivingArea ; + sh:datatype xsd:integer ; + sh:minInclusive 0 ; + sh:maxCount 1 ; + ] . + +ff:hasNumberOfChildren a ff:FimDataFieldProperty, ff:DataField ; + ff:hasFimId fim:F05011522 ; + ff:hasFimVersion "1.0" ; + rdfs:label "Anzahl Kinder" ; + rdfs:comment "Angabe der Anzahl der im Haushalt lebenden Kinder." . +ff:hasNumberOfChildrenShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:hasNumberOfChildren ; + sh:datatype xsd:integer ; + sh:minInclusive 0 ; + sh:maxCount 1 ; + ] . + +ff:hasIncomeBrutto a ff:FimDataFieldProperty, ff:DataField ; + ff:hasFimId fim:F00000575 ; + ff:hasFimVersion "1.1" ; + rdfs:label "Höhe des Einkommens (Brutto)" ; + ff:hasShaclShape ff:hasIncomeBruttoShape . +ff:hasIncomeBruttoShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:hasIncomeBrutto ; + sh:datatype xsd:integer ; + sh:minInclusive 0 ; + sh:maxCount 1 ; + ] . + +ff:hasIncomeNetto a ff:FimDataFieldProperty, ff:DataField ; + ff:hasFimId fim:F00001158 ; + ff:hasFimVersion "1.0" ; + rdfs:label "Nettoeinkommen monatlich" ; + ff:hasShaclShape ff:hasIncomeNettoShape . +ff:hasIncomeNettoShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:hasIncomeNetto ; + sh:datatype xsd:integer ; + sh:minInclusive 0 ; + sh:maxCount 1 ; + ] . + +ff:receivesKindergeld a ff:FimLeistung, ff:DataField ; + ff:hasFimId 576982 ; + ff:hasLeiKaId 99041008000000 ; + rdfs:label "Kindergeld" . + +ff:parentingSetup a ff:DataField ; + rdfs:label "Erziehungsverantwortung" ; +ff:hasShaclShape ff:parentingSetupShape . +ff:parentingSetupShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:parentingSetup ; + sh:in (ff:Alleinerziehend ff:Elternpaar) ; + ] . + +ff:receivesWohngeld a ff:DataField ; + rdfs:label "Wohngeld" ; + ff:hasShaclShape ff:receivesWohngeldShape . +ff:receivesWohngeldShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:receivesWohngeld ; + sh:datatype xsd:integer ; + sh:minInclusive 0 ; + sh:maxCount 1 ; + ] . + +ff:hasChild a ff:DataField ; + rdfs:label "Kind" ; + ff:hasShaclShape ff:hasChildShape . +ff:hasChildShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:hasChild ; + sh:class ff:Child ; + ] . + +ff:Child a ff:Class ; + rdfs:label "Kind" . + +ff:hasToy a ff:DataField ; + rdfs:label "Spielzeug" ; + ff:hasShaclShape ff:hasToyShape . +ff:hasToyShape a sh:NodeShape ; + sh:targetClass ff:Child ; + sh:property [ + sh:path ff:hasToy ; + sh:class ff:Toy ; + ] . + +ff:Toy a ff:Class ; + rdfs:label "Spielzeug" . + +ff:hasEmploymentStatus a ff:DataField ; + rdfs:label "Beschäftigungsverhältnis" ; + ff:hasShaclShape ff:hasEmploymentStatusShape . + +ff:hasEmploymentStatusShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + ff:modelledAfter ; + sh:property [ + sh:path ff:hasEmploymentStatus ; + sh:in ( "Angestellt" "Selbststaendig" "Ausbildung" "Arbeitslos" "Gefoerderte Ausbildung" ) ; + ] . + +ff:hasCompliedRequirementProfile a ff:DataField ; + rdfs:label "Bereits erfülltes Anforderungsprofil" ; + ff:hasShaclShape ff:hasCompliedRequirementProfileShape . +ff:hasCompliedRequirementProfileShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:hasCompliedRequirementProfile ; + sh:class ff:CompliedRequirementProfile ; + ] . + +ff:CompliedRequirementProfile a ff:Class ; + rdfs:label "Bereits erfülltes Anforderungsprofil" ; + ff:hasShaclShape ff:CompliedRequirementProfileShape . +ff:CompliedRequirementProfileShape a sh:NodeShape ; + sh:targetClass ff:CompliedRequirementProfile ; + sh:property [ + sh:path ff:hasRpUri ; + sh:nodeKind sh:IRI ; # "sh:class ff:RequirementProfile ;" would be better, but would require to throw the RPs into the user profile validation because those triples are defined there, e.g.: ff:kinderzuschlag a ff:RequirementProfile + sh:minCount 1 ; + sh:maxCount 1 ; + ] . + +ff:hasRpUri a ff:DataField ; + rdfs:label "Anforderungsprofil" . + +ff:residesInState a ff:DataField ; + rdfs:label "Bundesland" . + +ff:hasDeferred a ff:DataField ; + rdfs:label "Zurückgestellt" ; + ff:hasShaclShape ff:hasDeferredShape . + ff:hasDeferredShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:hasDeferred ; + sh:class ff:Deferment ; + ] . + +ff:Deferment a ff:Class ; + rdfs:label "Zurückstellung" ; + ff:hasShaclShape ff:DefermentShape . +ff:DefermentShape a sh:NodeShape ; + sh:targetClass ff:Deferment ; + sh:property [ + sh:path dcterms:created ; + sh:datatype xsd:date ; + ] ; + sh:property [ + sh:path dcterms:type ; + sh:in ( ff:MaterializationRule ff:CompliedRequirementProfile ff:MissingDataField ) ; # was suggested to user via one of these + ] ; + sh:property [ + sh:path dcterms:source ; + sh:nodeKind sh:IRI ; + ] ; + sh:property [ + sh:path rdf:subject ; + sh:nodeKind sh:IRI ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:path rdf:predicate ; + sh:nodeKind sh:IRI ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] . + +dcterms:created a ff:DataField ; rdfs:label "erstellt" . +dcterms:type a ff:DataField ; rdfs:label "Typ" . +dcterms:source a ff:DataField ; rdfs:label "Quelle" . +rdf:subject a ff:DataField ; rdfs:label "Subjekt" . +rdf:predicate a ff:DataField ; rdfs:label "Attribut" . diff --git a/assets/requirement-profiles/experimental/ausbildungsfoerderung.ttl b/assets/requirement-profiles/experimental/ausbildungsfoerderung.ttl new file mode 100644 index 0000000..d9bb73b --- /dev/null +++ b/assets/requirement-profiles/experimental/ausbildungsfoerderung.ttl @@ -0,0 +1,22 @@ +@prefix sh: . +@prefix xsd: . +@prefix ff: . +@prefix rdfs: . +@prefix schema: . + +ff:ausbildungsfoerderung a ff:RequirementProfile ; + ff:title "Ausbildungsförderung" . + +ff:MainPersonShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:occupation ; + sh:minCount 1 ; + sh:in (ff:ausbildung) ; + ] ; + sh:property [ + sh:path ff:residesInCounty ; + sh:minCount 1 ; + sh:in ("Nordfriesland") ; + sh:message "This Ausbildungsförderung is available only for residents of Nordfriesland" ; + ] . diff --git a/assets/requirement-profiles/experimental/datafields.ttl b/assets/requirement-profiles/experimental/datafields.ttl new file mode 100644 index 0000000..ccbf0d9 --- /dev/null +++ b/assets/requirement-profiles/experimental/datafields.ttl @@ -0,0 +1,13 @@ +@prefix ff: . + +ff:hasBirthday a ff:DataField ; + ff:modifiable false . + +ff:residesInCounty a ff:DataField ; + ff:modifiable true . + +ff:fundingAmountRequired a ff:DataField ; + ff:modifiable true . + +ff:fundingTarget a ff:DataField ; + ff:modifiable true . diff --git a/assets/requirement-profiles/experimental/materialization.ttl b/assets/requirement-profiles/experimental/materialization.ttl new file mode 100644 index 0000000..8400e94 --- /dev/null +++ b/assets/requirement-profiles/experimental/materialization.ttl @@ -0,0 +1,28 @@ +@prefix rdfs: . +@prefix xsd: . +@prefix ff: . + +ff:DeriveCountyFromCity a ff:MaterializationRule ; + ff:sparqlConstructQuery """ + PREFIX ff: + CONSTRUCT { + ?person ff:residesInCounty ?county . + } WHERE { + ?person ff:hasResidence ?city . + ff:CityCountyMap ff:mappedCountyToState ?mapping . + ?mapping ff:city ?city ; + ff:county ?county . + } + """ . + +# CONSTANTS + +ff:CityCountyMap a ff:MapOfConstants ; + ff:mappedCountyToState [ + ff:city "Heide" ; + ff:county "Dithmarschen" + ] ; + ff:mappedCountyToState [ + ff:city "Husum" ; + ff:county "Nordfriesland" + ] . diff --git a/assets/requirement-profiles/experimental/municipality-foerderung-spielplatz.ttl b/assets/requirement-profiles/experimental/municipality-foerderung-spielplatz.ttl new file mode 100644 index 0000000..6521e30 --- /dev/null +++ b/assets/requirement-profiles/experimental/municipality-foerderung-spielplatz.ttl @@ -0,0 +1,23 @@ +@prefix sh: . +@prefix xsd: . +@prefix ff: . +@prefix rdfs: . +@prefix schema: . + +ff:municipality-foerderung-x a ff:RequirementProfile ; + ff:title "Förderung zum Spielplatzbau" . + +ff:MainEntityShape a sh:NodeShape ; + sh:targetClass ff:Municipality ; + sh:property [ + sh:path ff:fundingAmountRequired ; + sh:minCount 1 ; + sh:maxExclusive 1000000 ; + sh:message "Der Maximalbetrag beträgt 1M, aber u.U. ist mehr möglich." ; + ] ; + sh:property [ + sh:path ff:fundingTarget ; + sh:minCount 1 ; + sh:in (ff:Spielplatz) ; + sh:message "Die Förderung ist für den Bau eines Spielplatzes." + ] . diff --git a/assets/requirement-profiles/experimental/municipality-profile.ttl b/assets/requirement-profiles/experimental/municipality-profile.ttl new file mode 100644 index 0000000..9f5cbc1 --- /dev/null +++ b/assets/requirement-profiles/experimental/municipality-profile.ttl @@ -0,0 +1,9 @@ +@prefix ff: . + +ff:mainEntity a ff:Municipality ; + ff:hasScenarioProfile ff:scenarioProfile1 . + +ff:scenarioMunicipality1 a ff:Municipality, ff:ScenarioProfile ; + ff:residents 15000 ; + ff:fundingAmountRequired 1200000 ; + ff:fundingTarget ff:Jugendtreff . diff --git a/assets/requirement-profiles/experimental/user-profile.ttl b/assets/requirement-profiles/experimental/user-profile.ttl new file mode 100644 index 0000000..e9d2b9b --- /dev/null +++ b/assets/requirement-profiles/experimental/user-profile.ttl @@ -0,0 +1,10 @@ +@prefix ff: . + +ff:mainPerson a ff:Citizen ; + ff:hasScenarioProfile ff:scenarioPerson1 . + +ff:scenarioPerson1 a ff:Citizen, ff:ScenarioProfile ; + ff:hasResidence "Heide" ; + ff:occupation ff:ausbildung . + # ff:scenarioTarget "Myself" ; + # ff:temporalScenarioTarget "Near Future" ; diff --git a/assets/requirement-profiles/manifest.ttl b/assets/requirement-profiles/manifest.ttl new file mode 100644 index 0000000..d52d007 --- /dev/null +++ b/assets/requirement-profiles/manifest.ttl @@ -0,0 +1,21 @@ +@prefix ff: . +@prefix schema: . +@prefix dcterms: . + +ff:datafieldsFile a schema:DigitalDocument ; + schema:identifier "datafields-file" ; + dcterms:format "text/turtle" ; + ff:relativePath "datafields.ttl" . + +ff:materializationFile a schema:DigitalDocument ; + schema:identifier "materialization-file" ; + dcterms:format "text/turtle" ; + ff:relativePath "materialization.ttl" . + +ff:requirementProfilesFolder a schema:Collection ; + schema:identifier "requirement-profiles-folder" ; + ff:relativePath "shacl/" . + +ff:userProfileExamplesFolder a schema:Collection ; + schema:identifier "user-profile-examples-folder" ; + ff:relativePath "user-profile-examples/" . diff --git a/assets/requirement-profiles/materialization.ttl b/assets/requirement-profiles/materialization.ttl new file mode 100644 index 0000000..0e94f5f --- /dev/null +++ b/assets/requirement-profiles/materialization.ttl @@ -0,0 +1,54 @@ +@prefix rdfs: . +@prefix xsd: . +@prefix ff: . + +# MATERIALIZATION RULES + +ff:CalculateAgeFromBirthdate a ff:MaterializationRule, ff:SparqlRule ; + rdfs:label "Calculate the age from the birthdate" ; + ff:input ff:hasBirthday ; + ff:output ff:hasAge ; + ff:suggestPermanentMaterialization true ; + ff:ifPermanentlyMaterializedAddPeriodicCheck "on-app-startup" ; + ff:sparqlConstructQuery """ + PREFIX ff: + CONSTRUCT { + ?person ff:hasAge ?age . + } WHERE { + ?person ff:hasBirthday ?bday . + BIND(YEAR(NOW()) - YEAR(?bday) - IF(MONTH(NOW()) < MONTH(?bday) || (MONTH(NOW()) = MONTH(?bday) && DAY(NOW()) < DAY(?bday)), 1, 0) AS ?age) . + } + """ . + +ff:DeriveStateFromCity a ff:MaterializationRule, ff:SparqlRule ; + rdfs:label "Derive the federal state someone lives in based on their residence city" ; + ff:input ff:hasResidence ; + ff:output ff:residesInState ; + ff:sparqlConstructQuery """ + PREFIX ff: + CONSTRUCT { + ?person ff:residesInState ?state . + } WHERE { + ?person ff:hasResidence ?city . + ff:CityStateMap ff:mappedCityToState ?mapping . + ?mapping ff:city ?city ; + ff:state ?state . + } + """ . + +# CONSTANTS + +ff:CityStateMap a ff:MapOfConstants ; + rdfs:comment "Mapping of German cities to their respective federal states (Bundesland)" ; + ff:mappedCityToState [ + ff:city "Jena" ; + ff:state "Thüringen" + ] ; + ff:mappedCityToState [ + ff:city "München" ; + ff:state "Bayern" + ] ; + ff:mappedCityToState [ + ff:city "Berlin" ; + ff:state "Berlin" + ] . diff --git a/assets/requirement-profiles/meta.ttl b/assets/requirement-profiles/meta.ttl new file mode 100644 index 0000000..92aea73 --- /dev/null +++ b/assets/requirement-profiles/meta.ttl @@ -0,0 +1,34 @@ +@prefix ff: . + +# Core Criterion and Core Evidence Vocabulary https://github.com/SEMICeu/CCCEV +@prefix cccev: . + +ff:RequirementProfile a cccev:Criterion . +ff:EligibilityConstraint a cccev:Constraint . +ff:DataField a cccev:Evidence . + +# Data Product Ontology (DPROD) +@prefix dprod: . + +ff:FoerderFunkeDataProduct a dprod:DataProduct ; + dct:title "FörderFunke Data Product"@en ; + dprod:purpose "To match user profiles with requirement profiles."@en ; + dprod:dataProductOwner ff:FoerderFunkeUG ; + dprod:inputDataset ff:UserProfileDataset, ff:RequirementProfilesDataset ; + dprod:outputDataset ff:MatchingResultsDataset . + +ff:UserProfileDataset a dcat:Dataset ; + dct:title "User Profile"@en ; + dct:description "The user profile in RDF format."@en ; + dprod:informationSensitivityClassification ff:SensitivityClassification-PersonalData . + +ff:RequirementProfilesDataset a dcat:Dataset ; + dct:title "Requirement Profiles"@en ; + dct:description "SHACL shapes defining criteria for user profile data points."@en . + +ff:MatchingResultsDataset a dcat:Dataset ; + dct:title "Matching Results"@en ; + dct:description "Results indicating the matches for the user profile. Plus a prioritised list of missing data points."@en ; + dprod:informationSensitivityClassification ff:SensitivityClassification-PersonalData . + +# dprod:inputPort, dprod:outputPort, ... diff --git a/assets/requirement-profiles/shacl/arbeitslosengeld.ttl b/assets/requirement-profiles/shacl/arbeitslosengeld.ttl new file mode 100644 index 0000000..2661033 --- /dev/null +++ b/assets/requirement-profiles/shacl/arbeitslosengeld.ttl @@ -0,0 +1,33 @@ +@prefix sh: . +@prefix xsd: . +@prefix ff: . +@prefix fim: . +@prefix rdfs: . + +ff:arbeitslosengeld a ff:RequirementProfile ; + ff:author ff:benglaeser ; + ff:created "2024-04-04"^^xsd:date ; + ff:title "Arbeitslosengeld" ; + ff:category ff:Sozialleistung ; + rdfs:seeAlso + . + +ff:MainPersonShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ sh:path ff:hasEmploymentStatus ; + sh:minCount 1 ; + sh:maxCount 1 ; ] ; + sh:property [ sh:path ff:hasAnwartschaftszeit ; + sh:minCount 1 ; + sh:maxCount 1 ; ] . + +ff:EmploymentStatusCheckShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ sh:path ff:hasEmploymentStatus ; + sh:in ( "Arbeitslos" "Gefoerderte Ausbildung" ) ] . + +ff:AnwartschaftszeitCheckShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ sh:path ff:hasAnwartschaftszeit ; + sh:datatype xsd:integer ; + sh:minInclusive 12 ] . diff --git a/assets/requirement-profiles/shacl/bildungsgutschein.ttl b/assets/requirement-profiles/shacl/bildungsgutschein.ttl new file mode 100644 index 0000000..9e121ae --- /dev/null +++ b/assets/requirement-profiles/shacl/bildungsgutschein.ttl @@ -0,0 +1,18 @@ +@prefix sh: . +@prefix xsd: . +@prefix ff: . +@prefix rdfs: . + +ff:bildungsgutschein a ff:RequirementProfile ; + ff:author ff:benglaeser ; + ff:created "2024-04-02"^^xsd:date ; + ff:title "Bildungsgutschein" ; + ff:category ff:Bildungsteilhabe ; + rdfs:comment "Checks for eligibility for the Bildungsgutschein" ; + rdfs:seeAlso . + +ff:BildungsgutscheinCitizenshipShape + a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:nodeKind sh:IRI ; + sh:message "The entity must be of type ff:Citizen to be eligible for Bildungsgutschein." . diff --git a/assets/requirement-profiles/shacl/dev-child-toy.ttl b/assets/requirement-profiles/shacl/dev-child-toy.ttl new file mode 100644 index 0000000..0ad93ee --- /dev/null +++ b/assets/requirement-profiles/shacl/dev-child-toy.ttl @@ -0,0 +1,40 @@ +@prefix sh: . +@prefix ff: . + +ff:childToy a ff:RequirementProfile ; + ff:title "Spielzeug dev" . + +ff:MainPersonShape a sh:NodeShape, ff:EligibilityConstraint ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:hasChild ; + sh:node ff:ChildShape ; + sh:minCount 1 ; + sh:message "The child doesn't exist or doesn't fulfill all criteria" ; + ] . + +ff:ChildShape a sh:NodeShape ; + sh:targetObjectsOf ff:hasChild ; + sh:property [ + sh:path ff:hasAge ; + sh:maxExclusive 18 ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:message "The child must be under 18 years old" ; + ] ; + sh:property [ + sh:path ff:hasToy ; + sh:node ff:ToyShape ; + sh:minCount 1 ; + sh:message "The toy of the child doesn't exist or doesn't fulfill all criteria" ; + ] . + +ff:ToyShape a sh:NodeShape ; + sh:targetObjectsOf ff:hasToy ; + sh:property [ + sh:path ff:hasAge ; + sh:maxExclusive 5 ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:message "The toy must be under 5 years old" ; + ] . diff --git a/assets/requirement-profiles/shacl/dev-daemmung.ttl b/assets/requirement-profiles/shacl/dev-daemmung.ttl new file mode 100644 index 0000000..1e77561 --- /dev/null +++ b/assets/requirement-profiles/shacl/dev-daemmung.ttl @@ -0,0 +1,16 @@ +@prefix ff: . +@prefix sh: . +@prefix xsd: . +@prefix rdf: . + +ff:daemmung a ff:RequirementProfile ; + ff:title "Dämmungszuschuss" ; + ff:category ff:Waermewende . + +ff:MainPersonShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:hasIncomeBrutto ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] . diff --git a/assets/requirement-profiles/shacl/dev-eauto.ttl b/assets/requirement-profiles/shacl/dev-eauto.ttl new file mode 100644 index 0000000..f897d36 --- /dev/null +++ b/assets/requirement-profiles/shacl/dev-eauto.ttl @@ -0,0 +1,17 @@ +@prefix ff: . +@prefix sh: . +@prefix xsd: . +@prefix rdf: . + +ff:eauto a ff:RequirementProfile ; + ff:title "E-Auto Zuschuss" ; + ff:category ff:Klimaschutz . + +ff:MainPersonShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:hasResidence ; + sh:in ("Berlin") ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] . diff --git a/assets/requirement-profiles/shacl/dev-kindergeld.ttl b/assets/requirement-profiles/shacl/dev-kindergeld.ttl new file mode 100644 index 0000000..21deb92 --- /dev/null +++ b/assets/requirement-profiles/shacl/dev-kindergeld.ttl @@ -0,0 +1,16 @@ +@prefix sh: . +@prefix ff: . +@prefix xsd: . +@prefix rdf: . + +ff:kindergeld a ff:RequirementProfile ; + ff:title "Kindergeld" ; + ff:category ff:Sozialleistung . + +ff:MainPersonShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:hasIncomeBrutto ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] . diff --git a/assets/requirement-profiles/shacl/dev-solar.ttl b/assets/requirement-profiles/shacl/dev-solar.ttl new file mode 100644 index 0000000..a3f8cff --- /dev/null +++ b/assets/requirement-profiles/shacl/dev-solar.ttl @@ -0,0 +1,21 @@ +@prefix ff: . +@prefix sh: . +@prefix xsd: . +@prefix rdf: . + +ff:solar a ff:RequirementProfile ; + ff:author ff:benjaminaaron ; + ff:created "2023-10-26"^^xsd:date ; + ff:title "Solarpanel Förderung" ; + ff:category ff:Waermewende, ff:Klimaschutz ; + ff:targetGroup ff:Citizen ; + ff:fundingProvider ff:GermanState . + +ff:MainPersonShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:hasResidence ; + sh:in ("Berlin") ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] . diff --git a/assets/requirement-profiles/shacl/dev-wohngeld.ttl b/assets/requirement-profiles/shacl/dev-wohngeld.ttl new file mode 100644 index 0000000..84edd5f --- /dev/null +++ b/assets/requirement-profiles/shacl/dev-wohngeld.ttl @@ -0,0 +1,19 @@ +@prefix ff: . +@prefix sh: . +@prefix xsd: . +@prefix rdf: . + +ff:wohngelddev a ff:RequirementProfile ; + ff:author ff:benjaminaaron ; + ff:created "2023-11-01"^^xsd:date ; + ff:title "Wohngeld dev" ; + ff:targetGroup ff:Citizen ; + ff:fundingProvider ff:GermanState . + +ff:MainPersonShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:paysRentCold ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] . diff --git a/assets/requirement-profiles/shacl/kinderzuschlag.ttl b/assets/requirement-profiles/shacl/kinderzuschlag.ttl new file mode 100644 index 0000000..6a8ff67 --- /dev/null +++ b/assets/requirement-profiles/shacl/kinderzuschlag.ttl @@ -0,0 +1,249 @@ +@prefix sh: . +@prefix xsd: . +@prefix ff: . +@prefix rdfs: . + +ff:kinderzuschlag a ff:RequirementProfile ; + ff:author ff:benjaminaaron ; + ff:created "2024-03-14"^^xsd:date ; + ff:title "Kinderzuschlag" ; + ff:category ff:Sozialleistung ; + ff:validFor "P6M"^^xsd:duration ; # suggest setting up reminder TODO + rdfs:seeAlso ; + ff:onlineEligibilityCheckingTool . + +# CONDITIONS + +ff:MainPersonShape a sh:NodeShape, ff:EligibilityConstraint ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:parentingSetup ; + sh:minCount 1 ; + sh:maxCount 1 ; # Rely on datafields.ttl to ensure this? + ] ; + sh:property [ + sh:path ff:hasIncomeBrutto ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:path ff:hasIncomeNetto ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:path ff:paysRentCold ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:path ff:receivesWohngeld ; + sh:message "[optional]" ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:path ff:hasChild ; + sh:qualifiedValueShape ff:ChildShape; + sh:qualifiedMinCount 1; + sh:message "The child doesn't exist or doesn't fulfill all criteria" ; + ] ; + sh:property [ + sh:path ff:hasGesamtbedarf ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:path ff:hasGesamtverfuegung ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:path ff:hasGesamtverfuegungPlusKinderzuschlag ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] . + +ff:ChildShape a sh:NodeShape ; + sh:property [ + sh:path ff:hasAge ; + sh:maxExclusive 25 ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:message "The child must be under 25 years old" ; + ] ; + sh:property [ + sh:path ff:hasMaritalStatus ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:not [ + sh:in ( "VH" "LP" ) ; + ] ; + sh:message "The child can't be married or in a civil union" ; + ] ; + sh:property [ + sh:path ff:receiveKindergeld ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:message "You must receive Kindergeld for the child" ; + ] . + +ff:IncomeCheckShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:sparql [ + a sh:SPARQLConstraint ; + sh:message "Für Alleinerziehende muss das Bruttoeinkommen mindestens 600 sein, für Elternpaare mindestens 900." ; + sh:select """ + PREFIX ff: + SELECT $this WHERE { + $this ff:parentingSetup ?parentingSetup . + $this ff:hasIncomeBrutto ?income . + FILTER ( + (?parentingSetup = ff:Alleinerziehend && ?income < 600) || + (?parentingSetup = ff:Elternpaar && ?income < 900) + ) + } + """ ; + ] . + +ff:GesamtverfuegungGeringerAlsGesamtbedarfShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:sparql [ + a sh:SPARQLConstraint ; + sh:message "Die Familie kann mit ihrer Gesamtverfügung ohne Kinderzuschlag ihren Gesamtbedarf decken --> ein Anspruch auf Kinderzuschlag besteht daher nicht" ; + sh:select """ + PREFIX ff: + SELECT $this WHERE { + $this ff:hasGesamtbedarf ?gesamtbedarf . + $this ff:hasGesamtverfuegung ?gesamtverfuegung . + FILTER(?gesamtbedarf < ?gesamtverfuegung) . + } + """ ; + ] . + +ff:GesamtverfuegungPlusKinderzuschlagDecktGesamtbedarfShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:sparql [ + a sh:SPARQLConstraint ; + sh:message "Die Familie kann mit ihrer Gesamtverfügung plus Kinderzuschlag ihren Gesamtbedarf nicht decken --> es besteht eine Hilfebedürftigkeit nach dem SGB 2, ein Anspruch auf Kinderzuschlag besteht daher nicht" ; + sh:select """ + PREFIX ff: + SELECT $this WHERE { + $this ff:hasGesamtbedarf ?gesamtbedarf . + $this ff:hasGesamtverfuegungPlusKinderzuschlag ?gesamtverfuegungPlus . + FILTER(?gesamtbedarf > ?gesamtverfuegungPlus) . + } + """ ; + ] . + +# CONSTANTS + +ff:RegelbedarfeSgb2 a ff:TableOfConstants ; + rdfs:comment "Werte gültig seit 2024-01-01" ; + rdfs:seeAlso ; + ff:hasRow ff:Alleinerziehend ; + ff:hasRow ff:Elternpaar ; + ff:hasRow ff:KindU6 ; + ff:hasRow ff:Kind6_U14 ; + ff:hasRow ff:Jugendliche14_U18 ; + ff:hasRow ff:VolljaehrigesKind18_U25 . + +ff:Alleinerziehend ff:hatRegelbedarfParent 563 . +ff:Elternpaar ff:hatRegelbedarfParent 1012 ; + rdfs:comment "Zusammensetzung: 2 * 506" . +ff:KindU6 ff:hatRegelbedarfChild 357 ; + xsd:minInclusive 0 ; + xsd:maxExclusive 6 . +ff:Kind6_U14 ff:hatRegelbedarfChild 390 ; + xsd:minInclusive 6 ; + xsd:maxExclusive 14 . +ff:Jugendliche14_U18 ff:hatRegelbedarfChild 471 ; + xsd:minInclusive 14 ; + xsd:maxExclusive 18 . +ff:VolljaehrigesKind18_U25 ff:hatRegelbedarfChild 451 ; + xsd:minInclusive 18 ; + xsd:maxExclusive 25 . + +ff:KinderzuschlagPerChild a ff:Constant ; + ff:hasValue 292 . + +# MATERIALIZATION + +ff:CalculateGesamtbedarfFamilie a ff:SparqlFormula ; + rdfs:label "Berechne den Gesamtbedarf einer Familie" ; + ff:input ff:hasAge ; + ff:output ff:hasGesamtbedarf ; + ff:suggestPermanentMaterialization false ; + ff:sparqlConstructQuery """ + PREFIX ff: + + CONSTRUCT { + ff:mainPerson ff:hasGesamtbedarf ?gesamtbedarf . + } WHERE { + SELECT (SUM(?bedarf) AS ?gesamtbedarf) WHERE { + { + ff:mainPerson ff:parentingSetup ?parentingSetup . + ?parentingSetup ff:hatRegelbedarfParent ?bedarf . + } UNION { + ff:mainPerson ff:hasChild ?child . + ?child ff:hasAge ?age . + ?ageGroup xsd:minInclusive ?min ; + xsd:maxExclusive ?max . + FILTER(?age >= ?min && ?age < ?max) . + ?ageGroup ff:hatRegelbedarfChild ?bedarf . + } UNION { + ff:mainPerson ff:paysRentCold ?bedarf . + } + } + } + """ . + +ff:CalculateGesamtverfuegungFamilie a ff:SparqlFormula ; + rdfs:label "Berechne die Gesamtverfügung einer Familie" ; + ff:output ff:hasGesamtverfuegung ; + ff:suggestPermanentMaterialization false ; + ff:sparqlConstructQuery """ + PREFIX ff: + + CONSTRUCT { + ff:mainPerson ff:hasGesamtverfuegung ?gesamtverfuegung . + } WHERE { + SELECT (SUM(?income) AS ?gesamtverfuegung) WHERE { + { + ff:mainPerson ff:hasChild ?child . + ?child ff:receiveKindergeld ?income . + } UNION { + ff:mainPerson ff:hasIncomeNetto ?income . + } UNION { + ff:mainPerson ff:receivesWohngeld ?income . + } + } + } + """ . + +ff:CalculateGesamtverfuegungPlusKinderzuschlagFamilie a ff:SparqlFormula ; + rdfs:label "Berechne die Gesamtverfügung plus Kinderzuschläge einer Familie" ; + ff:input ff:hasGesamtverfuegung ; + ff:output ff:hasGesamtverfuegungPlusKinderzuschlag ; + ff:suggestPermanentMaterialization false ; + ff:sparqlConstructQuery """ + PREFIX ff: + + CONSTRUCT { + ff:mainPerson ff:hasGesamtverfuegungPlusKinderzuschlag ?total . + } WHERE { + SELECT (?gesamtverfuegung + ?kinderzuschlagSum AS ?total) WHERE { + ff:mainPerson ff:hasGesamtverfuegung ?gesamtverfuegung . + { + SELECT (?childrenCount * ?value AS ?kinderzuschlagSum) WHERE { + ff:KinderzuschlagPerChild ff:hasValue ?value . + { + SELECT (COUNT(?child) AS ?childrenCount) WHERE { + ff:mainPerson ff:hasChild ?child . + } + } + } + } + } + } + """ . diff --git a/assets/requirement-profiles/shacl/opendva-existenzgruendungspass-thueringen.ttl b/assets/requirement-profiles/shacl/opendva-existenzgruendungspass-thueringen.ttl new file mode 100644 index 0000000..db466bd --- /dev/null +++ b/assets/requirement-profiles/shacl/opendva-existenzgruendungspass-thueringen.ttl @@ -0,0 +1,29 @@ +@prefix sh: . +@prefix xsd: . +@prefix ff: . +@prefix rdfs: . + +ff:existenzgruendungspassthueringen a ff:RequirementProfile ; + ff:author ff:benjaminaaron ; + ff:created "2024-04-09"^^xsd:date ; + ff:title "Existenzgründungspass Thüringen" ; + rdfs:seeAlso . + +# CONDITIONS + +ff:MainPersonShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:worksAsFreelancer ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:message "Eine selbständige Tätigkeit darf noch nicht begonnen worden sein" ; + sh:in (false) ; + ] ; + sh:property [ + sh:path ff:residesInState ; + sh:in ("Thüringen") ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:message "Der Wohnort muss in Thüringen sein" + ] . diff --git a/assets/requirement-profiles/shacl/opendva-jenabonus.ttl b/assets/requirement-profiles/shacl/opendva-jenabonus.ttl new file mode 100644 index 0000000..0b6be8b --- /dev/null +++ b/assets/requirement-profiles/shacl/opendva-jenabonus.ttl @@ -0,0 +1,31 @@ +@prefix sh: . +@prefix xsd: . +@prefix ff: . +@prefix rdfs: . + +ff:jenabonus a ff:RequirementProfile ; + ff:author ff:benjaminaaron ; + ff:created "2024-04-09"^^xsd:date ; + ff:title "Jenabonus" ; + ff:category ff:Sozialleistung ; + ff:validFor "P1Y"^^xsd:duration ; + rdfs:seeAlso . + +# CONDITIONS + +ff:MainPersonShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:eligibleForSocialSupport ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:in (true) ; + sh:message "Eine Form von Sozialhilfe ist Voraussetzung" + ] ; + sh:property [ + sh:path ff:hasResidence ; + sh:in ("Jena") ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:message "Der Wohnort muss Jena sein" + ] . diff --git a/assets/requirement-profiles/shacl/senioren-bahncard.ttl b/assets/requirement-profiles/shacl/senioren-bahncard.ttl new file mode 100644 index 0000000..afae4f3 --- /dev/null +++ b/assets/requirement-profiles/shacl/senioren-bahncard.ttl @@ -0,0 +1,22 @@ +@prefix sh: . +@prefix xsd: . +@prefix ff: . +@prefix rdfs: . + +ff:seniorenbahncard a ff:RequirementProfile ; + ff:author ff:benjaminaaron ; + ff:created "2024-04-16"^^xsd:date ; + ff:title "Senioren BahnCard" ; + rdfs:seeAlso . + +# CONDITIONS + +ff:MainPersonShape a sh:NodeShape ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:hasAge ; + sh:minInclusive 65 ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:message "The age must be at least 65" ; + ] . diff --git a/assets/requirement-profiles/sozialplattform/chatgpt_prompts.txt b/assets/requirement-profiles/sozialplattform/chatgpt_prompts.txt new file mode 100644 index 0000000..1a875a8 --- /dev/null +++ b/assets/requirement-profiles/sozialplattform/chatgpt_prompts.txt @@ -0,0 +1,208 @@ +------------------------------------------------------------ +DATAFIELDS +------------------------------------------------------------ + +I will successively share definitions of data fields and their allowed answers in JSON format with you. My goal is to transform them all to SHACL syntax. I did this transformation manually for two of them and would like you to do it for the rest. +Furthermore I would like to ask you to "slugify" the questionKeys, so "Staatsbürgerschaft" for instance should become "staatsbuergerschaft". And also in the value/label pairs of the answerOptions, please find sensible ways to slugify the value. +Also note that I am using "sh:maxCount 1" to indicate "answerType singleOption" whereas "answerType multiOption" doesn't need a count-restriction. + +These are the SHACL prefixes I am using: + +@prefix sh: . +@prefix xsd: . +@prefix ff: . +@prefix rdfs: . +@prefix schema: . + +Here are the two transformations I did manually so that you understand what I need: + +----- +JSON: +{ + "questionKey": "Geburtsdatum", + "questionText": "Wie lautet Ihr Geburtsdatum?", + "placeholder": "", + "noteCitizen": "", + "answerType": "date", + "answerOptions": [] +} + +SHACL: + +ff:geburtsdatum a ff:DataField, ff:SozialleistungsfinderDataField ; + schema:category ff:persoenliche-angaben ; + rdfs:label "Geburtsdatum" ; + schema:question "Wie lautet Ihr Geburtsdatum?" ; + ff:objectConstraints [ + a sh:PropertyShape ; + sh:targetObjectsOf ff:geburtsdatum ; + sh:datatype xsd:date ; + ] ; + ff:usageConstraints [ + a sh:NodeShape ; + sh:targetSubjectsOf ff:geburtsdatum ; + sh:property [ + sh:path ff:geburtsdatum ; + sh:maxCount 1 ; + ] ; + ] . +----- +JSON: +{ + "questionKey": "Aufenthaltsort", + "questionText": "Wo ist Ihr tatsächlicher Aufenthaltsort an dem Sie erreichbar sind?", + "placeholder": "", + "noteCitizen": "Das ist der Ort, wo Sie sich wirklich aufhalten. Es ist egal, ob Sie dort gemeldet sind oder das Recht haben, hier zu leben. Das kann auch eine Pflegeeinrichtung, ein Frauenhaus, ein Stadtteil oder Ähnliches sein.", + "answerType": "singleSelect", + "answerOptions": [ + { + "value": "außerhalb", + "label": "außerhalb Deutschlands" + }, + { + "value": "innerhalb", + "label": "innerhalb Deutschlands" + } + ] +} + +SHACL: +ff:aufenthaltsort a ff:DataField, ff:SozialleistungsfinderDataField ; + schema:category ff:persoenliche-angaben ; + rdfs:label "Aufenthaltsort" ; + schema:question "Wo ist Ihr tatsächlicher Aufenthaltsort an dem Sie erreichbar sind?" ; + rdfs:comment "Das ist der Ort, wo Sie sich wirklich aufhalten. Es ist egal, ob Sie dort gemeldet sind oder das Recht haben, hier zu leben. Das kann auch eine Pflegeeinrichtung, ein Frauenhaus, ein Stadtteil oder Ähnliches sein." ; + ff:objectConstraints [ + a sh:PropertyShape ; + sh:targetObjectsOf ff:aufenthaltsort ; + sh:in (ff:aufenthaltsort-ao-ausserhalb ff:aufenthaltsort-ao-innerhalb) ; + ] ; + ff:usageConstraints [ + a sh:NodeShape ; + sh:targetSubjectsOf ff:aufenthaltsort ; + sh:property [ + sh:path ff:aufenthaltsort ; + sh:maxCount 1 ; + ] ; + ] . +ff:aufenthaltsort-ao-ausserhalb a ff:AnswerOption ; rdfs:label "außerhalb Deutschlands" . +ff:aufenthaltsort-ao-innerhalb a ff:AnswerOption ; rdfs:label "innerhalb Deutschlands" . +----- + +Does this make sense? Can I share more JSON definitions for you to transform them to SHACL following the examples I gave you? + + +------------------------------------------------------------ +ADDING ENGLISH TRANSLATIONS AND LANGUAGE TAGS +------------------------------------------------------------ + +I used the German version of a JSON file to transform the data fields into SHACL. Now I would like to add the English translations also. Would it work for you, if I give you SHACL shapes and the English JSON and you can add "string"@en triples? You would have to focus on these predicates: rdfs:label, schema:question and rdfs:comment. However, please only do the rdfs:label of ff:AnswerOption triples. And under no circumstances invent anything yourself, just copy paste things into the right places, ok? And please also add @de to the German strings also. + + +------------------------------------------------------------ +BENEFIT RULES +------------------------------------------------------------ + +I would like your help in translating rules from a JSON format to a SHACL format. I have done this transformation once manually and would like you to apply the same pattern to more JSON rules. However, to interpret this correctly, I need to supply you with a definition file of the data fields in use. I uploaded it together with this message. + +This is the example transformation: + +JSON: + +[ + { + "questionKey": "Aufenthaltsort", + "type": "singleSelect", + "operator": "equals", + "expectedValue": "innerhalb", + "rules": [] + }, + { + "questionKey": "Aufenthaltsort", + "type": "singleSelect", + "operator": "equalsNot", + "expectedValue": "außerhalb", + "rules": [] + }, + { + "questionKey": "Geburtsdatum", + "type": "date", + "modifier": "Pensionable", + "operator": "equals", + "expectedValue": "false", + "rules": [] + }, + { + "questionKey": "Erwerbsfähig_neu", + "type": "singleOption", + "operator": "equalsNot", + "expectedValue": "nein >6 Monate", + "rules": [] + }, + { + "questionKey": "Erwerbsfähig_neu", + "type": "singleOption", + "operator": "equals", + "expectedValue": "nein <6 Monate", + "rules": [] + }, + { + "questionKey": "Beruf_neu", + "type": "singleOption", + "operator": "equalsNot", + "expectedValue": "ALG", + "rules": [] + }, + { + "questionKey": "Einkommen_neu", + "type": "multiOption", + "operator": "containsNot", + "expectedValue": "ALG", + "rules": [] + }, + { + "questionKey": "Einkommen_neu", + "type": "multiOption", + "operator": "containsNot", + "expectedValue": "ALG II", + "rules": [] + } +] + +--- + +SHACL: + +ff:MainPersonShape a sh:NodeShape, ff:EligibilityConstraint ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:aufenthaltsort ; + sh:minCount 1 ; + sh:hasValue ff:aufenthaltsort-ao-innerhalb ; + ] ; + sh:property [ + sh:path ff:pensionable ; + sh:minCount 1 ; + sh:hasValue false ; + ] ; + sh:property [ + sh:path ff:erwerbsfaehig_neu ; + sh:minCount 1 ; + sh:hasValue ff:erwerbsfaehig_neu-ao-nein-weniger-6-monate ; + ] ; + sh:property [ + sh:path ff:beruf_neu ; + sh:minCount 1 ; + sh:not [ + sh:hasValue ff:beruf_neu-ao-alg ; + ] ; + ] ; + sh:property [ + sh:path ff:einkommen_neu ; + sh:minCount 1 ; + sh:not [ + sh:in (ff:einkommen_neu-ao-alg ff:einkommen_neu-ao-alg-ii) ; + ] ; + ] . + +Does this make sense? Can I provide you with the next set of JSON rules for you to transform it to SHACL? diff --git a/assets/requirement-profiles/sozialplattform/datafields.ttl b/assets/requirement-profiles/sozialplattform/datafields.ttl new file mode 100644 index 0000000..c9b7585 --- /dev/null +++ b/assets/requirement-profiles/sozialplattform/datafields.ttl @@ -0,0 +1,429 @@ +@prefix sh: . +@prefix xsd: . +@prefix ff: . +@prefix rdfs: . +@prefix schema: . + +# BENEFIT CATEGORIES + +ff:arbeitslosigkeit-bc-kategorie a ff:BenefitCategory ; + rdfs:label "Arbeitslosigkeit & Arbeitsuche"@de, "Unemployment & Job Search"@en ; + rdfs:seeAlso . + +ff:sozialhilfe-grundsicherung-bc-kategorie a ff:BenefitCategory ; + rdfs:label "Sozialhilfe & Grundsicherung"@de, "Social & Basic welfare"@en ; + rdfs:seeAlso . + +ff:wohnen-bc-kategorie a ff:BenefitCategory ; + rdfs:label "Wohnen"@de, "Housing"@en ; + rdfs:seeAlso . + +ff:schule-studium-ausbildung-bc-kategorie a ff:BenefitCategory ; + rdfs:label "Schule, Studium, Ausbildung"@de, "Vocational Training & Studies"@en ; + rdfs:seeAlso . + +ff:leistungen-fuer-familien-bc-kategorie a ff:BenefitCategory ; + rdfs:label "Leistungen für Familien"@de, "Family & Children"@en ; + rdfs:seeAlso . + +ff:migration-asyl-bc-kategorie a ff:BenefitCategory ; + rdfs:label "Migration & Asyl"@de, "Migration & Asylum"@en ; + rdfs:seeAlso . + +ff:alter-ruhestand-bc-kategorie a ff:BenefitCategory ; + rdfs:label "Alter und Ruhestand"@de, "Aging & Retirement"@en ; + rdfs:seeAlso . + +ff:gesundheit-pflege-bc-kategorie a ff:BenefitCategory ; + rdfs:label "Gesundheit & Pflege"@de, "Health & Care"@en ; + rdfs:seeAlso . + +# DATAFIELD CATEGORIES + +ff:persoenliche-angaben-df-kategorie a ff:DatafieldCategory ; rdfs:label "Persönliche Angaben"@de, "Personal information"@en . +ff:kinder-df-kategorie a ff:DatafieldCategory ; rdfs:label "Kinder"@de, "Children"@en . +ff:erwerbstaetigkeit-df-kategorie a ff:DatafieldCategory ; rdfs:label "Erwerbstätigkeit"@de, "Employment"@en . +ff:lebenssituation-df-kategorie a ff:DatafieldCategory ; rdfs:label "Lebenssituation"@de, "Living situation"@en . +ff:gesundheit-df-kategorie a ff:DatafieldCategory ; rdfs:label "Gesundheit"@de, "Health"@en . + +# DATAFIELDS + +# Persönliche Angaben + +ff:geburtsdatum a ff:DataField, ff:SozialleistungsfinderDataField ; + schema:category ff:persoenliche-angaben-df-kategorie; + rdfs:label "Geburtsdatum"@de , "Date of Birth"@en ; + schema:question "Wie lautet Ihr Geburtsdatum?"@de , "What is your date of birth?"@en ; + ff:objectConstraints [ + a sh:PropertyShape ; + sh:targetObjectsOf ff:geburtsdatum ; + sh:datatype xsd:date ; + ] ; + ff:usageConstraints [ + a sh:NodeShape ; + sh:targetSubjectsOf ff:geburtsdatum ; + sh:property [ + sh:path ff:geburtsdatum ; + sh:maxCount 1 ; + ] ; + ] . + +ff:staatsbuergerschaft a ff:DataField, ff:SozialleistungsfinderDataField ; + schema:category ff:persoenliche-angaben-df-kategorie; + rdfs:label "Staatsbürgerschaft"@de , "Citizenship"@en ; + schema:question "Welche Staatsbürgerschaft haben Sie?"@de , "What is your citizenship?"@en ; + rdfs:comment "Welches Land steht auf Ihrem Pass oder Ausweis? Meistens ist das Deutschland. Mitgliedstaaten der Europäischen Union sind: Belgien, Bulgarien, Dänemark, Deutschland, Estland, Finnland, Frankreich, Griechenland, Irland, Italien, Kroatien, Lettland, Litauen, Luxemburg, Malta, die Niederlande, Österreich, Polen, Portugal, Rumänien, Schweden, die Slowakei, Slowenien, Spanien, die Tschechische Republik, Ungarn und Zypern."@de , + "Which country is on your passport or ID card? Mostly it is Germany. Member states of the European Union are: Austria, Belgium, Bulgaria, Croatia, Cyprus, Czech Republic, Denmark, Estonia, Finland, France, Germany, Greece, Hungary, Ireland, Italy, Latvia, Lithuania, Luxembourg, Malta, Netherlands, Poland, Portugal, Romania, Slovakia, Slovenia, Spain, Sweden."@en ; + ff:objectConstraints [ + a sh:PropertyShape ; + sh:targetObjectsOf ff:staatsbuergerschaft ; + sh:in (ff:staatsbuergerschaft-ao-ger ff:staatsbuergerschaft-ao-eu ff:staatsbuergerschaft-ao-3rd) ; + ] ; + ff:usageConstraints [ + a sh:NodeShape ; + sh:targetSubjectsOf ff:staatsbuergerschaft ; + sh:property [ + sh:path ff:staatsbuergerschaft ; + sh:maxCount 1 ; + ] ; + ] . +ff:staatsbuergerschaft-ao-ger a ff:AnswerOption ; rdfs:label "Deutsch"@de , "German"@en . +ff:staatsbuergerschaft-ao-eu a ff:AnswerOption ; rdfs:label "EU"@de , "EU"@en . +ff:staatsbuergerschaft-ao-3rd a ff:AnswerOption ; rdfs:label "Drittstaat (Nicht-EU)"@de , "Third country (non-EU)"@en . + +ff:aufenthalt a ff:DataField, ff:SozialleistungsfinderDataField ; + schema:category ff:persoenliche-angaben-df-kategorie; + rdfs:label "Aufenthaltsberechtigung"@de , "Right of residence"@en ; + schema:question "Sind Sie in Deutschland aufenthaltsberechtigt?"@de , "Are you entitled to stay in Germany?"@en ; + rdfs:comment "Wenn Sie Ausländer:in sind und eine Aufenthaltsberechtigung haben (diese wurden zwischen 1991 und 2004 ausgestellt) oder eine Niederlassungsberechtigung (seit 2005), klicken Sie „ja“ an. Wenn Sie das nicht haben, klicken Sie „nein“ an."@de , + "If you are a foreigner and have a residence permit (these were issued between 1991 and 2004) or a settlement permit (since 2005), click \"yes\". If you do not have one, click \"no\"."@en ; + ff:objectConstraints [ + a sh:PropertyShape ; + sh:targetObjectsOf ff:aufenthalt ; + sh:datatype xsd:boolean ; + ] ; + ff:usageConstraints [ + a sh:NodeShape ; + sh:targetSubjectsOf ff:aufenthalt ; + sh:property [ + sh:path ff:aufenthalt ; + sh:maxCount 1 ; + ] ; + ] . + +ff:aufenthaltsort a ff:DataField, ff:SozialleistungsfinderDataField ; + schema:category ff:persoenliche-angaben-df-kategorie; + rdfs:label "Aufenthaltsort"@de , "Actual Residence"@en ; + schema:question "Wo ist Ihr tatsächlicher Aufenthaltsort an dem Sie erreichbar sind?"@de , + "Where is your actual residence where you can be reached?"@en ; + rdfs:comment "Das ist der Ort, wo Sie sich wirklich aufhalten. Es ist egal, ob Sie dort gemeldet sind oder das Recht haben, hier zu leben. Das kann auch eine Pflegeeinrichtung, ein Frauenhaus, ein Stadtteil oder Ähnliches sein."@de , + "This is the place where you are actually staying. It does not matter whether you are registered there or have the right to live here. This can also be a care facility, a women's shelter, a city district or the like."@en ; + ff:objectConstraints [ + a sh:PropertyShape ; + sh:targetObjectsOf ff:aufenthaltsort ; + sh:in (ff:aufenthaltsort-ao-ausserhalb ff:aufenthaltsort-ao-innerhalb) ; + ] ; + ff:usageConstraints [ + a sh:NodeShape ; + sh:targetSubjectsOf ff:aufenthaltsort ; + sh:property [ + sh:path ff:aufenthaltsort ; + sh:maxCount 1 ; + ] ; + ] . +ff:aufenthaltsort-ao-ausserhalb a ff:AnswerOption ; rdfs:label "Außerhalb Deutschlands"@de , "Outside Germany"@en . +ff:aufenthaltsort-ao-innerhalb a ff:AnswerOption ; rdfs:label "Innerhalb Deutschlands"@de , "Inside Germany"@en . + +# Kinder + +ff:kinder a ff:DataField, ff:SozialleistungsfinderDataField ; + schema:category ff:kinder-df-kategorie ; + rdfs:label "Kinder"@de , "Children"@en ; + schema:question "Haben Sie ein oder mehrere Kinder?"@de , "Do you have one or more children?"@en ; + rdfs:comment "Bitte geben Sie an, ob Kinder in Ihrem Haushalt leben."@de , + "Please specify if there are children living in your household."@en ; + ff:objectConstraints [ + a sh:PropertyShape ; + sh:targetObjectsOf ff:kinder ; + sh:datatype xsd:boolean ; + ] ; + ff:usageConstraints [ + a sh:NodeShape ; + sh:targetSubjectsOf ff:kinder ; + sh:property [ + sh:path ff:kinder ; + sh:maxCount 1 ; + ] ; + ] . + +ff:kinder_unter_18 a ff:DataField, ff:SozialleistungsfinderDataField ; + schema:category ff:kinder-df-kategorie ; + rdfs:label "Kinder unter 18"@de , "Children under 18"@en ; + schema:question "Haben Sie Kinder unter 18 Jahren?"@de , "Do you have children younger than 18 years old?"@en ; + ff:objectConstraints [ + a sh:PropertyShape ; + sh:targetObjectsOf ff:kinder_unter_18 ; + sh:datatype xsd:boolean ; + ] ; + ff:usageConstraints [ + a sh:NodeShape ; + sh:targetSubjectsOf ff:kinder_unter_18 ; + sh:property [ + sh:path ff:kinder_unter_18 ; + sh:maxCount 1 ; + ] ; + ] . + +ff:kinder_18_25 a ff:DataField, ff:SozialleistungsfinderDataField ; + schema:category ff:kinder-df-kategorie ; + rdfs:label "Kinder 18-25"@de , "Children 18-25"@en ; + schema:question "Haben Sie Kinder zwischen 18-25 Jahren?"@de , "Do you have children between the ages of 18 and 25?"@en ; + ff:objectConstraints [ + a sh:PropertyShape ; + sh:targetObjectsOf ff:kinder_18_25 ; + sh:datatype xsd:boolean ; + ] ; + ff:usageConstraints [ + a sh:NodeShape ; + sh:targetSubjectsOf ff:kinder_18_25 ; + sh:property [ + sh:path ff:kinder_18_25 ; + sh:maxCount 1 ; + ] ; + ] . + +ff:kinder_in_ausbildung a ff:DataField, ff:SozialleistungsfinderDataField ; + schema:category ff:kinder-df-kategorie ; + rdfs:label "Kinder in Ausbildung"@de , "Children in Education"@en ; + schema:question "Haben Sie Kinder zwischen 18 und 25 Jahren, die sich noch in Schule, Ausbildung oder Studium befinden?"@de , + "Do you have children between the ages of 18 and 25 who are still in school, training or studying?"@en ; + ff:objectConstraints [ + a sh:PropertyShape ; + sh:targetObjectsOf ff:kinder_in_ausbildung ; + sh:datatype xsd:boolean ; + ] ; + ff:usageConstraints [ + a sh:NodeShape ; + sh:targetSubjectsOf ff:kinder_in_ausbildung ; + sh:property [ + sh:path ff:kinder_in_ausbildung ; + sh:maxCount 1 ; + ] ; + ] . + +ff:kindergeld a ff:DataField, ff:SozialleistungsfinderDataField ; + schema:category ff:kinder-df-kategorie ; + rdfs:label "Kindergeld"@de , "Child Benefit"@en ; + schema:question "Beziehen Sie Kindergeld für ein oder mehrere Kinder?"@de , + "Do you receive child benefit for one or more children?"@en ; + ff:objectConstraints [ + a sh:PropertyShape ; + sh:targetObjectsOf ff:kindergeld ; + sh:datatype xsd:boolean ; + ] ; + ff:usageConstraints [ + a sh:NodeShape ; + sh:targetSubjectsOf ff:kindergeld ; + sh:property [ + sh:path ff:kindergeld ; + sh:maxCount 1 ; + ] ; + ] . + +# Erwerbstätigkeit + +ff:erwerbsfaehig_neu a ff:DataField, ff:SozialleistungsfinderDataField ; + schema:category ff:erwerbstaetigkeit-df-kategorie ; + rdfs:label "Erwerbsfähig"@de , "Fit for Work"@en ; + schema:question "Sind Sie erwerbsfähig und können täglich mindestens 3 Stunden arbeiten?"@de , + "Are you fit for work and able to work at least 3 hours a day?"@en ; + rdfs:comment "Sie sind erwerbsfähig, wenn Sie mindestens 3 Stunden am Tag normal arbeiten können. Wenn Sie es wegen längerer Krankheit oder Behinderung nicht schaffen, so lange zu arbeiten, geben Sie „nein“ an."@de , + "You are fit for work if you can work normally for at least 3 hours a day. If you cannot manage to work that long because of a prolonged illness or disability, click “no”."@en ; + ff:objectConstraints [ + a sh:PropertyShape ; + sh:targetObjectsOf ff:erwerbsfaehig_neu ; + sh:in (ff:erwerbsfaehig_neu-ao-ja ff:erwerbsfaehig_neu-ao-nein-ueber-6-monate ff:erwerbsfaehig_neu-ao-nein-weniger-6-monate) ; + ] ; + ff:usageConstraints [ + a sh:NodeShape ; + sh:targetSubjectsOf ff:erwerbsfaehig_neu ; + sh:property [ + sh:path ff:erwerbsfaehig_neu ; + sh:maxCount 1 ; + ] ; + ] . +ff:erwerbsfaehig_neu-ao-ja a ff:AnswerOption ; rdfs:label "ja"@de , "yes"@en . +ff:erwerbsfaehig_neu-ao-nein-ueber-6-monate a ff:AnswerOption ; rdfs:label "Nein, dauerhaft erwerbsunfähig (über 6 Monate)"@de , "No, permanently unable to work (more than 6 months)"@en . +ff:erwerbsfaehig_neu-ao-nein-weniger-6-monate a ff:AnswerOption ; rdfs:label "Nein, temporär erwerbsunfähig (weniger als 6 Monate)"@de , "No, temporarily unable to work (less than 6 months)"@en . + +ff:beruf_neu a ff:DataField, ff:SozialleistungsfinderDataField ; + schema:category ff:erwerbstaetigkeit-df-kategorie ; + rdfs:label "Beruf"@de , "Profession"@en ; + schema:question "Wie ist Ihre berufliche Situation?"@de , "What is your professional situation?"@en ; + ff:objectConstraints [ + a sh:PropertyShape ; + sh:targetObjectsOf ff:beruf_neu ; + sh:in (ff:beruf_neu-ao-selbstaendig ff:beruf_neu-ao-soz ff:beruf_neu-ao-alg ff:beruf_neu-ao-ausbildung ff:beruf_neu-ao-bfd ff:beruf_neu-ao-rente ff:beruf_neu-ao-eltern) ; + ] ; + ff:usageConstraints [ + a sh:NodeShape ; + sh:targetSubjectsOf ff:beruf_neu ; + sh:property [ + sh:path ff:beruf_neu ; + sh:maxCount 1 ; + ] ; + ] . +ff:beruf_neu-ao-selbstaendig a ff:AnswerOption ; rdfs:label "Selbständig in einer Beschäftigung von mehr als 15 Stunden pro Woche"@de , "Self-employed, working more than 15 hours per week"@en . +ff:beruf_neu-ao-soz a ff:AnswerOption ; rdfs:label "Berufstätig in einer sozialversicherungspflichtigen Beschäftigung"@de , "Employed in a job subject to social security contributions"@en . +ff:beruf_neu-ao-alg a ff:AnswerOption ; rdfs:label "Arbeitslos"@de , "Unemployed"@en . +ff:beruf_neu-ao-ausbildung a ff:AnswerOption ; rdfs:label "Schule/Ausbildung/Studium"@de , "School/vocational training/studies"@en . +ff:beruf_neu-ao-bfd a ff:AnswerOption ; rdfs:label "Bundesfreiwilligendienst"@de , "Federal voluntary service"@en . +ff:beruf_neu-ao-rente a ff:AnswerOption ; rdfs:label "Regelaltersrente/Pension"@de , "Standard old-age pension/retirement"@en . +ff:beruf_neu-ao-eltern a ff:AnswerOption ; rdfs:label "Elternzeit"@de , "Parental leave"@en . + +ff:einkommen_neu a ff:DataField, ff:SozialleistungsfinderDataField ; + schema:category ff:erwerbstaetigkeit-df-kategorie ; + rdfs:label "Einkommen"@de , "Income"@en ; + schema:question "Wie erzielen Sie Ihr Einkommen? (Mehrfachnennung möglich)"@de , + "How do you earn your income? (multiple answers possible)"@en ; + ff:objectConstraints [ + a sh:PropertyShape ; + sh:targetObjectsOf ff:einkommen_neu ; + sh:in (ff:einkommen_neu-ao-selbstaendig ff:einkommen_neu-ao-soz ff:einkommen_neu-ao-alg ff:einkommen_neu-ao-alg-ii ff:einkommen_neu-ao-ausbildung ff:einkommen_neu-ao-bafoeg ff:einkommen_neu-ao-rente ff:einkommen_neu-ao-elterngeld ff:einkommen_neu-ao-mutterschaftsgeld ff:einkommen_neu-ao-wohngeld ff:einkommen_neu-ao-sonstige) ; + ] . +ff:einkommen_neu-ao-selbstaendig a ff:AnswerOption ; rdfs:label "Selbstständige Arbeit in einer Beschäftigung von mehr als 15 Stunden pro Woche"@de , "Self-employed work of more than 15 hours per week"@en . +ff:einkommen_neu-ao-soz a ff:AnswerOption ; rdfs:label "Sozialversicherungspflichtige Beschäftigung"@de , "Employment subject to social security contributions"@en . +ff:einkommen_neu-ao-alg a ff:AnswerOption ; rdfs:label "Arbeitslosengeld"@de , "Unemployment benefit"@en . +ff:einkommen_neu-ao-alg-ii a ff:AnswerOption ; rdfs:label "Bürgergeld (früher ALG II)"@de , "Citizen's income (formerly unemployment benefit II)"@en . +ff:einkommen_neu-ao-ausbildung a ff:AnswerOption ; rdfs:label "Ausbildungsvergütung"@de , "Training allowance"@en . +ff:einkommen_neu-ao-bafoeg a ff:AnswerOption ; rdfs:label "BAföG"@de , "Student support (BAföG)"@en . +ff:einkommen_neu-ao-rente a ff:AnswerOption ; rdfs:label "Regelaltersrente"@de , "Standard retirement pension"@en . +ff:einkommen_neu-ao-elterngeld a ff:AnswerOption ; rdfs:label "Elterngeld"@de , "Parental benefit"@en . +ff:einkommen_neu-ao-mutterschaftsgeld a ff:AnswerOption ; rdfs:label "Mutterschaftsgeld"@de , "Maternity pay"@en . +ff:einkommen_neu-ao-wohngeld a ff:AnswerOption ; rdfs:label "Wohngeld"@de , "Housing benefit"@en . +ff:einkommen_neu-ao-sonstige a ff:AnswerOption ; rdfs:label "Sonstige"@de , "Other"@en . + +ff:einkommen_familie a ff:DataField, ff:SozialleistungsfinderDataField ; + schema:category ff:erwerbstaetigkeit-df-kategorie ; + rdfs:label "Einkommen Familie"@de , "Family Income"@en ; + schema:question "Wie beschreiben Sie das Einkommen Ihrer Familie?"@de , "How do you describe your family's income?"@en ; + ff:objectConstraints [ + a sh:PropertyShape ; + sh:targetObjectsOf ff:einkommen_familie ; + sh:in (ff:einkommen_familie-ao-monatsbrutto-ueber-900-600 ff:einkommen_familie-ao-monatsbrutto-unter-900-600) ; + ] ; + ff:usageConstraints [ + a sh:NodeShape ; + sh:targetSubjectsOf ff:einkommen_familie ; + sh:property [ + sh:path ff:einkommen_familie ; + sh:maxCount 1 ; + ] ; + ] . +ff:einkommen_familie-ao-monatsbrutto-ueber-900-600 a ff:AnswerOption ; rdfs:label "Die Familie hat ein monatliches Brutto-Einkommen von mindestens 900 Euro (Gemeinsam erziehend) bzw. 600 Euro (Alleinerziehende)"@de , "The family has a monthly gross income of at least 900 euros (joint parents) or 600 euros (single parents)."@en . +ff:einkommen_familie-ao-monatsbrutto-unter-900-600 a ff:AnswerOption ; rdfs:label "Die Familie hat kein monatliches Brutto-Einkommen von mindestens 900 Euro (Gemeinsam erziehend) bzw. 600 Euro (Alleinerziehende)"@de , "The family does not have a monthly gross income of at least 900 euros (joint parents) or 600 euros (single parents)."@en . + +# Lebenssituation + +ff:lebenssituation a ff:DataField, ff:SozialleistungsfinderDataField ; + schema:category ff:lebenssituation-df-kategorie ; + rdfs:label "Lebenssituation"@de , "Living Situation"@en ; + schema:question "Wie ist Ihre Lebenssituation?"@de , "What is your living situation?"@en ; + ff:objectConstraints [ + a sh:PropertyShape ; + sh:targetObjectsOf ff:lebenssituation ; + sh:in (ff:lebenssituation-ao-allein ff:lebenssituation-ao-gemeinschaft ff:lebenssituation-ao-allein-mit-kind) ; + ] ; + ff:usageConstraints [ + a sh:NodeShape ; + sh:targetSubjectsOf ff:lebenssituation ; + sh:property [ + sh:path ff:lebenssituation ; + sh:maxCount 1 ; + ] ; + ] . +ff:lebenssituation-ao-allein a ff:AnswerOption ; rdfs:label "Alleinlebend"@de , "Single household"@en . +ff:lebenssituation-ao-gemeinschaft a ff:AnswerOption ; rdfs:label "Gemeinsam lebend (Ehe, Partnerschaft, eingetragene Lebenspartnerschaft), ggf. mit Kindern"@de , "Joint household (marriage, partnership, registered partnership), possibly with children"@en . +ff:lebenssituation-ao-allein-mit-kind a ff:AnswerOption ; rdfs:label "Alleinerziehend mit mind. einem Kind"@de , "Single parent with at least one child"@en . + +ff:lebenslage a ff:DataField, ff:SozialleistungsfinderDataField ; + schema:category ff:lebenssituation-df-kategorie ; + rdfs:label "Lebenslage"@de , "Living Situation"@en ; + schema:question "Befinden Sie sich in einer sozial schwierigen Lebenslage?"@de , + "Are you in a difficult social situation?"@en ; + rdfs:comment "Schwierige Lebenslagen oder Notsituationen sind zum Beispiel: Sie haben keine Wohnung mehr (Obdachlosigkeit), Sie haben ein Suchtproblem, Sie wissen nicht, wovon Sie leben sollen oder wurden ein Opfer von Gewalt in der Familie."@de , + "Difficult living situations or emergency situations are, for example: you no longer have a home (homelessness), you have an addiction problem, you do not know how to cover your living expenses, or you have been a victim of violence in the family."@en ; + ff:objectConstraints [ + a sh:PropertyShape ; + sh:targetObjectsOf ff:lebenslage ; + sh:datatype xsd:boolean ; + ] ; + ff:usageConstraints [ + a sh:NodeShape ; + sh:targetSubjectsOf ff:lebenslage ; + sh:property [ + sh:path ff:lebenslage ; + sh:maxCount 1 ; + ] ; + ] . + +# Gesundheit + +ff:krankenversicherung a ff:DataField, ff:SozialleistungsfinderDataField ; + schema:category ff:gesundheit-df-kategorie ; + rdfs:label "Krankenversicherung"@de , "Health Insurance"@en ; + schema:question "Haben Sie eine Krankenversicherung?"@de , "Do you have health insurance?"@en ; + ff:objectConstraints [ + a sh:PropertyShape ; + sh:targetObjectsOf ff:krankenversicherung ; + sh:datatype xsd:boolean ; + ] ; + ff:usageConstraints [ + a sh:NodeShape ; + sh:targetSubjectsOf ff:krankenversicherung ; + sh:property [ + sh:path ff:krankenversicherung ; + sh:maxCount 1 ; + ] ; + ] . + +ff:pflegeversicherung a ff:DataField, ff:SozialleistungsfinderDataField ; + schema:category ff:gesundheit-df-kategorie ; + rdfs:label "Pflegeversicherung"@de , "Nursing Care Insurance"@en ; + schema:question "Haben Sie eine Pflegeversicherung?"@de , "Do you have nursing care insurance?"@en ; + ff:objectConstraints [ + a sh:PropertyShape ; + sh:targetObjectsOf ff:pflegeversicherung ; + sh:datatype xsd:boolean ; + ] ; + ff:usageConstraints [ + a sh:NodeShape ; + sh:targetSubjectsOf ff:pflegeversicherung ; + sh:property [ + sh:path ff:pflegeversicherung ; + sh:maxCount 1 ; + ] ; + ] . + +ff:pflege a ff:DataField, ff:SozialleistungsfinderDataField ; + schema:category ff:gesundheit-df-kategorie ; + rdfs:label "Pflege"@de , "Care"@en ; + schema:question "Sind Sie pflegebedürftig?"@de , "Are you in need of care?"@en ; + rdfs:comment "Die Pflegebedürftigkeit wird von einem Gutachter des Medizinischen Dienstes der Krankenversicherung (MDK) festgestellt. Nach der Prüfung entscheidet die Pflegekasse über Pflegebedürftigkeit und Pflegegrad."@de , + "The need for care is determined by an expert from the health insurance's medical service (MDK). After the examination, the care fund (Pflegekasse) decides on the need for care and the degree of care."@en ; + ff:objectConstraints [ + a sh:PropertyShape ; + sh:targetObjectsOf ff:pflege ; + sh:datatype xsd:boolean ; + ] ; + ff:usageConstraints [ + a sh:NodeShape ; + sh:targetSubjectsOf ff:pflege ; + sh:property [ + sh:path ff:pflege ; + sh:maxCount 1 ; + ] ; + ] . + +ff:pensionable a ff:DataField, ff:MaterializableDataField ; rdfs:label "Pensionable"@en, "Rentenberechtigt"@de . +ff:hasAge a ff:DataField, ff:MaterializableDataField ; rdfs:label "Age"@en, "Alter"@de . diff --git a/assets/requirement-profiles/sozialplattform/materialization.ttl b/assets/requirement-profiles/sozialplattform/materialization.ttl new file mode 100644 index 0000000..3a70800 --- /dev/null +++ b/assets/requirement-profiles/sozialplattform/materialization.ttl @@ -0,0 +1,110 @@ +@prefix rdfs: . +@prefix xsd: . +@prefix ff: . + +# MATERIALIZATION RULES + +ff:CalculateAgeFromBirthdate a ff:MaterializationRule, ff:SparqlRule ; + rdfs:label "Berechnung des Alters basierend auf dem Geburtsdatum"@de, "Calculate the age from the birthdate"@en ; + ff:input ff:geburtsdatum ; + ff:output ff:hasAge ; + ff:sparqlConstructQuery """ + PREFIX ff: + CONSTRUCT { + ?person ff:hasAge ?age . + } WHERE { + ?person ff:geburtsdatum ?bday . + BIND(YEAR(NOW()) - YEAR(?bday) - IF(MONTH(NOW()) < MONTH(?bday) || (MONTH(NOW()) = MONTH(?bday) && DAY(NOW()) < DAY(?bday)), 1, 0) AS ?age) . + } + """ . + +ff:PensionableFromBirthdate a ff:MaterializationRule, ff:SparqlRule ; + rdfs:label "Feststellung der Pensionsberechtigung basierend auf dem Geburtsdatum"@de, "Determining qualification for pension from the birthdate"@en ; + ff:input ff:geburtsdatum ; + ff:output ff:pensionable ; + ff:sparqlConstructQuery """ + PREFIX ff: + PREFIX xsd: + CONSTRUCT { + ?person ff:pensionable ?pensionable . + } WHERE { + ?person ff:geburtsdatum ?bday . + BIND(YEAR(?bday) AS ?birthYear) BIND(MONTH(?bday) AS ?birthMonth) BIND(DAY(?bday) AS ?birthDay) + OPTIONAL { + ?yearRow ff:appliesToBirthYear ?birthYear ; + ff:hasPensionAgeYears ?pensionAgeYears ; + ff:hasPensionAgeMonths ?pensionAgeMonths . + } + BIND(COALESCE(?pensionAgeYears, 67) AS ?finalPensionAgeYears) + BIND(COALESCE(?pensionAgeMonths, 0) AS ?finalPensionAgeMonths) + BIND(?birthYear + ?finalPensionAgeYears AS ?pensionYear) + BIND(?birthMonth + ?finalPensionAgeMonths AS ?monthsSum) + BIND(IF(?monthsSum > 12, ?monthsSum - 12, ?monthsSum) AS ?pensionMonth) + BIND(IF(?monthsSum > 12, ?pensionYear + 1, ?pensionYear) AS ?adjustedPensionYear) + BIND(CONCAT( + STR(?adjustedPensionYear), "-", + IF(STRLEN(STR(?pensionMonth)) = 1, CONCAT("0", STR(?pensionMonth)), STR(?pensionMonth)), "-", + IF(STRLEN(STR(?birthDay)) = 1, CONCAT("0", STR(?birthDay)), STR(?birthDay)), + "T00:00:00" + ) AS ?pensionDateStr) + BIND(xsd:dateTime(?pensionDateStr) AS ?pensionDate) + BIND(IF(NOW() >= ?pensionDate, true, false) AS ?pensionable) + } + """ . + +ff:PensionAgeTable a ff:TableOfConstants ; + ff:hasRow ff:Year1947 ; ff:hasRow ff:Year1948 ; ff:hasRow ff:Year1949 ; ff:hasRow ff:Year1950 ; ff:hasRow ff:Year1951 ; + ff:hasRow ff:Year1952 ; ff:hasRow ff:Year1953 ; ff:hasRow ff:Year1954 ; ff:hasRow ff:Year1955 ; ff:hasRow ff:Year1956 ; + ff:hasRow ff:Year1957 ; ff:hasRow ff:Year1958 ; ff:hasRow ff:Year1959 ; ff:hasRow ff:Year1960 ; ff:hasRow ff:Year1961 ; + ff:hasRow ff:Year1962 ; ff:hasRow ff:Year1963 ; ff:hasRow ff:Year1964 . +ff:Year1947 ff:hasPensionAgeYears 65 ; ff:hasPensionAgeMonths 0 ; ff:appliesToBirthYear 1947 . +ff:Year1948 ff:hasPensionAgeYears 65 ; ff:hasPensionAgeMonths 1 ; ff:appliesToBirthYear 1948 . +ff:Year1949 ff:hasPensionAgeYears 65 ; ff:hasPensionAgeMonths 2 ; ff:appliesToBirthYear 1949 . +ff:Year1950 ff:hasPensionAgeYears 65 ; ff:hasPensionAgeMonths 3 ; ff:appliesToBirthYear 1950 . +ff:Year1951 ff:hasPensionAgeYears 65 ; ff:hasPensionAgeMonths 4 ; ff:appliesToBirthYear 1951 . +ff:Year1952 ff:hasPensionAgeYears 65 ; ff:hasPensionAgeMonths 5 ; ff:appliesToBirthYear 1952 . +ff:Year1953 ff:hasPensionAgeYears 65 ; ff:hasPensionAgeMonths 6 ; ff:appliesToBirthYear 1953 . +ff:Year1954 ff:hasPensionAgeYears 65 ; ff:hasPensionAgeMonths 7 ; ff:appliesToBirthYear 1954 . +ff:Year1955 ff:hasPensionAgeYears 65 ; ff:hasPensionAgeMonths 8 ; ff:appliesToBirthYear 1955 . +ff:Year1956 ff:hasPensionAgeYears 65 ; ff:hasPensionAgeMonths 9 ; ff:appliesToBirthYear 1956 . +ff:Year1957 ff:hasPensionAgeYears 65 ; ff:hasPensionAgeMonths 10 ; ff:appliesToBirthYear 1957 . +ff:Year1958 ff:hasPensionAgeYears 65 ; ff:hasPensionAgeMonths 11 ; ff:appliesToBirthYear 1958 . +ff:Year1959 ff:hasPensionAgeYears 66 ; ff:hasPensionAgeMonths 0 ; ff:appliesToBirthYear 1959 . +ff:Year1960 ff:hasPensionAgeYears 66 ; ff:hasPensionAgeMonths 2 ; ff:appliesToBirthYear 1960 . +ff:Year1961 ff:hasPensionAgeYears 66 ; ff:hasPensionAgeMonths 4 ; ff:appliesToBirthYear 1961 . +ff:Year1962 ff:hasPensionAgeYears 66 ; ff:hasPensionAgeMonths 6 ; ff:appliesToBirthYear 1962 . +ff:Year1963 ff:hasPensionAgeYears 66 ; ff:hasPensionAgeMonths 8 ; ff:appliesToBirthYear 1963 . +ff:Year1964 ff:hasPensionAgeYears 66 ; ff:hasPensionAgeMonths 10 ; ff:appliesToBirthYear 1964 . + +ff:NoKidsImpliesNoKidsInAgeRanges a ff:MaterializationRule, ff:SparqlRule ; + rdfs:label "Wenn jemand keine Kinder hat, hat er auch keine Kinder in diesen beiden Altersspannen"@de, "If someone has no children, they also have no children in these two age ranges"@en ; + ff:input ff:kinder ; + ff:output ff:kinder_unter_18 ; + ff:output ff:kinder_18_25 ; + ff:sparqlConstructQuery """ + PREFIX ff: + CONSTRUCT { + ?person ff:kinder_unter_18 false . + ?person ff:kinder_18_25 false . + } WHERE { + ?person ff:kinder false . + } + """ . + +ff:KidsInAgeRangesMeansHavingKids a ff:MaterializationRule, ff:SparqlRule ; + rdfs:label "Wenn jemand Kinder in Altersspannen hat, hat die Person Kinder"@de, "If someone has children in age ranges, the person has children"@en ; + ff:input ff:kinder_unter_18 ; + ff:input ff:kinder_18_25 ; + ff:output ff:kinder ; + ff:sparqlConstructQuery """ + PREFIX ff: + CONSTRUCT { + ?person ff:kinder true . + } WHERE { + { + ?person ff:kinder_unter_18 true . + } UNION { + ?person ff:kinder_18_25 true . + } + } + """ . diff --git a/assets/requirement-profiles/sozialplattform/shacl/01-hilfe-zum-lebensunterhalt.ttl b/assets/requirement-profiles/sozialplattform/shacl/01-hilfe-zum-lebensunterhalt.ttl new file mode 100644 index 0000000..4a2f8e9 --- /dev/null +++ b/assets/requirement-profiles/sozialplattform/shacl/01-hilfe-zum-lebensunterhalt.ttl @@ -0,0 +1,52 @@ +@prefix sh: . +@prefix xsd: . +@prefix ff: . +@prefix rdfs: . +@prefix schema: . + +ff:hilfe-zum-lebensunterhalt a ff:RequirementProfile ; + ff:leikaId "99107012017000" ; + ff:title "Hilfe zum Lebensunterhalt"@de , "Cost-of-living assistance"@en ; + ff:category ff:sozialhilfe-grundsicherung-bc-kategorie, ff:leistungen-fuer-familien-bc-kategorie, ff:gesundheit-pflege-bc-kategorie ; + rdfs:seeAlso ; + ff:benefitInfo "Die „Hilfe zum Lebensunterhalt“ richtet sich an Menschen, die eine Zeit lang nicht oder nur wenig arbeiten können. Sie dient dazu grundlegende Bedürfnisse wie Essen, Kleidung und Miete zu bezahlen. Hilfe zum Lebensunterhalt erhalten Personen, für die andere staatliche Leistungen, wie etwa Rente oder Bürgergeld (früher ALG II), nicht infrage kommen."@de , + "If you are currently unable to work due to health reasons, you may be entitled to cost of living assistance. The prerequisite is that you are temporarily unable to earn your living yourself or with the help of other people, for example a partner or your family."@en ; + ff:ineligibleGeneralExplanation "Wahrscheinlich haben Sie keinen Anspruch auf diese Leistung. Einen Anspruch auf Hilfe zum Lebensunterhalt haben erwerbsunfähige Menschen, die ihren Lebensunterhalt nicht aus eigenen Mitteln bestreiten können, weil sie z.B. längerfristig erkrankt sind oder wegen Erwerbsminderung nur eine geringe Rente bekommen. Es dient dazu, das Existenzminimum zu sichern, wenn weder ein Anspruch auf Bürgergeld (früher ALG II) noch auf Grundsicherung im Alter und bei Erwerbsminderung besteht."@de , + "You are probably not entitled to this benefit. People who are unable to work and who cannot earn their living from their own means, because they are ill for a long time or only receive a small pension due to a reduced earning capacity, are entitled to cost-of-living assistance. It serves to secure the subsistence level if there is neither an entitlement to unemployment benefit II nor to basic security in old age and in the event of reduced earning capacity."@en ; + ff:hasMainPersonShape ff:hilfe-zum-lebensunterhaltMainPersonShape . + +ff:hilfe-zum-lebensunterhaltMainPersonShape a sh:NodeShape, ff:EligibilityConstraint ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:aufenthaltsort ; + sh:minCount 1 ; + sh:in (ff:aufenthaltsort-ao-innerhalb) ; + ] ; + sh:property [ + sh:path ff:geburtsdatum ; # find a way to not have to declare this explicitly? reverse materialization logic? TODO + sh:minCount 1 ; + ] ; + sh:property [ + sh:path ff:pensionable ; + sh:minCount 1 ; + sh:in (false) ; + ] ; + sh:property [ + sh:path ff:erwerbsfaehig_neu ; + sh:minCount 1 ; + sh:in (ff:erwerbsfaehig_neu-ao-nein-weniger-6-monate) ; + ] ; + sh:property [ + sh:path ff:beruf_neu ; + sh:minCount 1 ; + sh:not [ + sh:in (ff:beruf_neu-ao-alg) ; + ] ; + ] ; + sh:property [ + sh:path ff:einkommen_neu ; + sh:minCount 1 ; + sh:not [ + sh:in (ff:einkommen_neu-ao-alg ff:einkommen_neu-ao-alg-ii) ; + ] ; + ] . diff --git a/assets/requirement-profiles/sozialplattform/shacl/02-kindergeld.ttl b/assets/requirement-profiles/sozialplattform/shacl/02-kindergeld.ttl new file mode 100644 index 0000000..e1bd88e --- /dev/null +++ b/assets/requirement-profiles/sozialplattform/shacl/02-kindergeld.ttl @@ -0,0 +1,75 @@ +@prefix sh: . +@prefix xsd: . +@prefix ff: . +@prefix rdfs: . + +ff:kindergeld a ff:RequirementProfile ; + ff:leikaId "99041008017000" ; + ff:title "Kindergeld"@de , "Child benefit"@en ; + ff:category ff:leistungen-fuer-familien-bc-kategorie ; + rdfs:seeAlso ; + ff:benefitInfo "Das Kindergeld ist eine staatliche Förderung, die Eltern und Erziehungsberechtigte ab der Geburt des ersten Kindes beantragen können. Damit soll die Grundversorgung eines Kindes gesichert werden. Kindergeld wird mindestens bis zum 18. und höchstens bis zum 25. Geburtstag eines Kindes gezahlt. Alle Familien erhalten Kindergeld, unabhängig davon, wie viel sie verdienen."@de , + "Parents and guardians are entitled to receive child benefit from the state starting with their first child. Find out here whether you qualify for child benefit and how you can apply."@en ; + ff:ineligibleGeneralExplanation "Wahrscheinlich haben Sie keinen Anspruch auf diese Leistung. Wenn Ihr Kind unter 18 Jahren alt ist, haben Sie Anspruch auf Kindergeld, wenn Sie Ihren Wohnsitz oder gewöhnlichen Aufenthalt in Deutschland oder einem anderen Land der EU, Norwegen, Lichtenstein, Island oder der Schweiz haben und Ihr Kind in Ihrem Haushalt lebt. Soweit Ihr Kind zwischen 18 und 25 Jahre alt ist, ist zusätzlich erforderlich, dass es eine Ausbildung oder ein Studium absolviert, sich zwischen Schulabschluss und Ausbildungs- oder Studienbeginn in einer Übergangszeit befindet oder sich ernsthaft um eine Ausbildung bemüht."@de , + "You are probably not entitled to this benefit. If your child is under the age of 18, you are entitled to child benefit if you are domiciled or habitually resident in Germany or another EU country, Norway, Lichtenstein, Iceland or Switzerland and your child lives in your household. If your child is between 18 and 25 years old, it is also required that it is completing an apprenticeship or study, is in a transitional period between leaving school and starting training or study, or is seriously trying to get an apprenticeship."@en ; + ff:hasMainPersonShape ff:kindergeldMainPersonShape . + +ff:kindergeldMainPersonShape a sh:NodeShape, ff:EligibilityConstraint ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:kinder_unter_18 ; + sh:minCount 1 ; + ] ; + sh:property [ + sh:path ff:kinder_18_25 ; + sh:minCount 1 ; + ] ; + sh:property [ + sh:path ff:kinder ; + sh:minCount 1 ; + sh:in (true) ; + ] ; + sh:property [ + sh:path ff:geburtsdatum ; + sh:minCount 1 ; + ] ; + sh:property [ + sh:path ff:pensionable ; + sh:minCount 1 ; + sh:in (false) ; + ] ; + sh:property [ + sh:path ff:aufenthaltsort ; + sh:minCount 1 ; + sh:in (ff:aufenthaltsort-ao-innerhalb) ; + ] ; + sh:or ([ + sh:property [ + sh:path ff:kinder_18_25 ; + sh:in (true) ; + ] + ] [ + sh:property [ + sh:path ff:kinder_unter_18 ; + sh:in (true) ; + ] + ]) ; + sh:property [ + sh:path ff:beruf_neu ; + sh:minCount 1 ; + sh:not [ + sh:in (ff:beruf_neu-ao-bfd ff:beruf_neu-ao-rente) ; + ] ; + ] ; + sh:property [ + sh:path ff:einkommen_neu ; + sh:minCount 1 ; + sh:not [ + sh:in (ff:einkommen_neu-ao-alg ff:einkommen_neu-ao-bafoeg ff:einkommen_neu-ao-rente) ; + ] ; + ] ; + sh:property [ + sh:path ff:kindergeld ; + sh:minCount 1 ; + sh:in (false) ; + ] . diff --git a/assets/requirement-profiles/sozialplattform/shacl/03-kinderzuschlag.ttl b/assets/requirement-profiles/sozialplattform/shacl/03-kinderzuschlag.ttl new file mode 100644 index 0000000..eb35efa --- /dev/null +++ b/assets/requirement-profiles/sozialplattform/shacl/03-kinderzuschlag.ttl @@ -0,0 +1,76 @@ +@prefix sh: . +@prefix xsd: . +@prefix ff: . +@prefix rdfs: . + +ff:kinderzuschlag a ff:RequirementProfile ; + ff:leikaId "99107016017000" ; + ff:title "Kinderzuschlag"@de , "Child allowance"@en ; + ff:category ff:leistungen-fuer-familien-bc-kategorie ; + rdfs:seeAlso ; + ff:benefitInfo "Wenn Sie ein geringes Einkommen haben und Kindergeld beziehen, können Sie zusätzlich den Kinderzuschlag, abgekürzt auch KiZ genannt, beantragen."@de , + "If you are a low-earner and receive child benefit, you can also apply for the child allowance."@en ; + ff:ineligibleGeneralExplanation "Wahrscheinlich haben Sie keinen Anspruch auf diese Leistung. Der Kinderzuschlag ist ein Zuschlag zum Kindergeld für Eltern, die genug verdienen, um für sich selbst zu sorgen, das Einkommen aber nicht oder nur knapp für die gesamte Familie reicht. Einkommen und Vermögen der Eltern und des Kindes werden auf den Kinderzuschlag teilweise angerechnet und reduzieren die Höhe. Mit dem Kinderzuschlag sind weitere Vergünstigungen möglich, z. B. Bildungs- und Teilhabeleistungen für die Kinder oder eine Befreiung von den KiTa-Gebühren."@de , + "You are probably not entitled to this benefit. The child allowance is a supplement to child benefit for parents who earn enough to take care of themselves, but the income is not or only just enough for the entire family. Income and assets of the parents and the child are partly offset against the child allowance and reduce the amount. Additional discounts are possible with the child allowance, e.g. education and participation services for the children or an exemption from the childcare fees."@en ; + ff:hasMainPersonShape ff:kinderzuschlagMainPersonShape . + +ff:kinderzuschlagMainPersonShape a sh:NodeShape, ff:EligibilityConstraint ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:kinder_unter_18 ; + sh:minCount 1 ; + ] ; + sh:property [ + sh:path ff:kinder_18_25 ; + sh:minCount 1 ; + ] ; + sh:property [ + sh:path ff:aufenthalt ; + sh:minCount 1 ; + sh:in (true) ; + ] ; + sh:property [ + sh:path ff:kinder ; + sh:minCount 1 ; + sh:in (true) ; + ] ; + sh:property [ + sh:path ff:lebenssituation ; + sh:minCount 1 ; + sh:not [ + sh:in (ff:lebenssituation-ao-allein) ; + ] ; + ] ; + sh:property [ + sh:path ff:aufenthaltsort ; + sh:minCount 1 ; + sh:in (ff:aufenthaltsort-ao-innerhalb) ; + ] ; + sh:property [ + sh:path ff:einkommen_familie ; + sh:minCount 1 ; + sh:in (ff:einkommen_familie-ao-monatsbrutto-ueber-900-600) ; + ] ; + sh:or ([ + sh:property [ + sh:path ff:kinder_18_25 ; + sh:in (true) ; + ] + ] [ + sh:property [ + sh:path ff:kinder_unter_18 ; + sh:in (true) ; + ] + ]) ; + sh:property [ + sh:path ff:kindergeld ; + sh:minCount 1 ; + sh:in (true) ; + ] ; + sh:property [ + sh:path ff:einkommen_neu ; + sh:minCount 1 ; + sh:not [ + sh:in (ff:einkommen_neu-ao-alg-ii) ; + ] ; + ] . diff --git a/assets/requirement-profiles/sozialplattform/shacl/04-bafoeg.ttl b/assets/requirement-profiles/sozialplattform/shacl/04-bafoeg.ttl new file mode 100644 index 0000000..b517eb0 --- /dev/null +++ b/assets/requirement-profiles/sozialplattform/shacl/04-bafoeg.ttl @@ -0,0 +1,61 @@ +@prefix sh: . +@prefix xsd: . +@prefix ff: . +@prefix rdfs: . + +ff:bafoeg a ff:RequirementProfile ; + ff:title "BAföG"@de , "Student support (BAföG)"@en ; + ff:category ff:schule-studium-ausbildung-bc-kategorie ; + rdfs:seeAlso ; + ff:benefitInfo "Mit dem Bundesausbildungsförderungsgesetz (BAföG) werden junge Menschen finanziell bei der Schulausbildung und dem Studium unterstützt. Es gibt zwei Arten von BAföG: das Schüler-BAföG und das Studenten-BAföG. Schülerinnen und Schüler sowie Studierende können einen Zuschuss oder ein zinsloses Darlehen erhalten. Die Höhe der Förderung ist von den Lebensumständen der Antragstellerinnen und Antragsteller abhängig."@de , + "Are you looking to study or complete your secondary school education and require financial support? Then BAföG is just what you need. Keep reading to find out all the details about Germany’s student support scheme and how to apply for BAföG."@en ; + ff:ineligibleGeneralExplanation "Wahrscheinlich haben Sie keinen Anspruch auf diese Leistung. Es handelt sich um eine Ausbildungsförderung, die jungen Menschen ermöglichen soll, unabhängig von ihrer sozialen und wirtschaftlichen Situation eine Schul- bzw. Hochschulausbildung zu absolvieren. Sie kann für den eigenen Lebensunterhalt und für die Ausbildung verwendet werden."@de , + "You are probably not entitled to this benefit. This is a training grant that is intended to enable young people to complete school or university education regardless of their social and economic situation. It can be used for one's own livelihood and for education."@en ; + ff:hasMainPersonShape ff:bafoegMainPersonShape . + +ff:bafoegMainPersonShape a sh:NodeShape, ff:EligibilityConstraint ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:geburtsdatum ; + sh:minCount 1 ; + ] ; + sh:property [ + sh:path ff:hasAge ; + sh:minCount 1 ; + sh:minInclusive 15 ; + sh:maxExclusive 36 ; + ] ; + sh:property [ + sh:path ff:lebenslage ; + sh:minCount 1 ; + sh:in (false) ; + ] ; + sh:property [ + sh:path ff:krankenversicherung ; + sh:minCount 1 ; + sh:in (true) ; + ] ; + sh:property [ + sh:path ff:pflegeversicherung ; + sh:minCount 1 ; + sh:in (true) ; + ] ; + sh:property [ + sh:path ff:erwerbsfaehig_neu ; + sh:minCount 1 ; + sh:not [ + sh:in (ff:erwerbsfaehig_neu-ao-nein-ueber-6-monate) ; + ] ; + ] ; + sh:property [ + sh:path ff:beruf_neu ; + sh:minCount 1 ; + sh:in (ff:beruf_neu-ao-ausbildung) ; + ] ; + sh:property [ + sh:path ff:einkommen_neu ; + sh:minCount 1 ; + sh:not [ + sh:in (ff:einkommen_neu-ao-bafoeg ff:einkommen_neu-ao-rente) ; + ] ; + ] . diff --git a/assets/requirement-profiles/sozialplattform/shacl/05-buergergeld.ttl b/assets/requirement-profiles/sozialplattform/shacl/05-buergergeld.ttl new file mode 100644 index 0000000..6beba45 --- /dev/null +++ b/assets/requirement-profiles/sozialplattform/shacl/05-buergergeld.ttl @@ -0,0 +1,63 @@ +@prefix sh: . +@prefix xsd: . +@prefix ff: . +@prefix rdfs: . + +ff:buergergeld a ff:RequirementProfile ; + ff:leikaId "99107108017000" ; + ff:title "Bürgergeld"@de , "Citizen's benefit"@en ; + ff:category ff:arbeitslosigkeit-bc-kategorie, ff:leistungen-fuer-familien-bc-kategorie ; + rdfs:seeAlso ; + ff:benefitInfo "Das Bürgergeld (vorher ALG II) ist Teil der sogenannten Grundsicherung für Arbeitsuchende. Bürgergeld wird oft im Anschluss an das Arbeitslosengeld gezahlt, wenn weiterhin Unterstützung notwendig ist. Bürgergeld erhalten auch Personen, die noch nie gearbeitet oder ein geringes Einkommen haben. Für das Bürgergeld sind die Jobcenter zuständig."@de , + "If you are not currently employed and are not entitled to unemployment benefit, you may be entitled to unemployment benefit II. This also applies if you earn so little that you cannot meet your living costs."@en ; + ff:ineligibleGeneralExplanation "Wahrscheinlich haben Sie keinen Anspruch auf diese Leistung. Beim Bürgergeld (vorher ALG II), handelt es sich um eine Sozialleistung für Arbeitsuchende und Aufstocker des Arbeitslosengelds zur Sicherung des Lebensunterhalts. Arbeitsuchend können auch Arbeitnehmer und Selbständige sein. Voraussetzung ist, dass Sie mindestens 15 Jahre alt sind, jedoch die Altersgrenze für Ihre Rente noch nicht erreicht haben, und in der Lage sind, mindestens 3 Stunden täglich zu arbeiten. Zudem muss Ihr gewöhnlicher Aufenthalt in der Bundesrepublik Deutschland sein und Sie oder Mitglieder Ihrer Bedarfsgemeinschaft müssen hilfebedürftig sein."@de , + "You are probably not entitled to this benefit. Unemployment benefit II is a social benefit for job seekers and top-up unemployment benefit to secure a living. Jobseekers can also be employed and self-employed. The prerequisite is that you are at least 15 years old but have not yet reached the age limit for your pension and are able to work at least 3 hours a day. In addition, your habitual residence must be in the Federal Republic of Germany and you or members of your benefit community must be in need of assistance."@en ; + ff:hasMainPersonShape ff:buergergeldMainPersonShape . + +ff:buergergeldMainPersonShape a sh:NodeShape, ff:EligibilityConstraint ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:aufenthalt ; + sh:minCount 1 ; + sh:in (true) ; + ] ; + sh:property [ + sh:path ff:aufenthaltsort ; + sh:minCount 1 ; + sh:in (ff:aufenthaltsort-ao-innerhalb) ; + ] ; + sh:property [ + sh:path ff:geburtsdatum ; + sh:minCount 1 ; + ] ; + sh:property [ + sh:path ff:hasAge ; + sh:minCount 1 ; + sh:minInclusive 15 ; + ] ; + sh:property [ + sh:path ff:pensionable ; + sh:minCount 1 ; + sh:in (false) ; + ] ; + sh:property [ + sh:path ff:erwerbsfaehig_neu ; + sh:minCount 1 ; + sh:not [ + sh:in (ff:erwerbsfaehig_neu-ao-nein-ueber-6-monate) ; + ] ; + ] ; + sh:property [ + sh:path ff:beruf_neu ; + sh:minCount 1 ; + sh:not [ + sh:in (ff:beruf_neu-ao-ausbildung ff:beruf_neu-ao-selbstaendig ff:beruf_neu-ao-rente) ; + ] ; + ] ; + sh:property [ + sh:path ff:einkommen_neu ; + sh:minCount 1 ; + sh:not [ + sh:in (ff:einkommen_neu-ao-alg-ii ff:einkommen_neu-ao-rente ff:einkommen_neu-ao-wohngeld) ; + ] ; + ] . diff --git a/assets/requirement-profiles/sozialplattform/shacl/06-arbeitslosengeld.ttl b/assets/requirement-profiles/sozialplattform/shacl/06-arbeitslosengeld.ttl new file mode 100644 index 0000000..5af43a2 --- /dev/null +++ b/assets/requirement-profiles/sozialplattform/shacl/06-arbeitslosengeld.ttl @@ -0,0 +1,54 @@ +@prefix sh: . +@prefix xsd: . +@prefix ff: . +@prefix rdfs: . + +ff:arbeitslosengeld a ff:RequirementProfile ; + ff:leikaId "99038001017000" ; + ff:title "Arbeitslosengeld"@de , "Unemployment benefit"@en ; + ff:category ff:arbeitslosigkeit-bc-kategorie ; + rdfs:seeAlso ; + ff:benefitInfo "Das Arbeitslosengeld (ALG) sichert Sie sozial ab, wenn Sie Ihre Arbeit oder Ihren Ausbildungsplatz verlieren. Es ersetzt einen Teil Ihres fehlenden Einkommens, damit Sie weiterhin Ihren Lebensunterhalt bestreiten können. Sie haben Anspruch auf diese Leistung, wenn Sie vor Ihrer Arbeitslosigkeit eine bestimmte Zeit pflichtversichert oder freiwillig versichert waren und monatlich Versicherungsbeiträge gezahlt haben."@de , + "Unemployment benefit, or ALG (from the German word Arbeitslosengeld), provides a social safety net in case you lose your job or training position. It replaces part of your missing income so that you can continue to pay your bills."@en ; + ff:ineligibleGeneralExplanation "Wahrscheinlich haben Sie keinen Anspruch auf diese Leistung. Für den Anspruch auf Arbeitslosengeld gelten im Wesentlichen diese Voraussetzungen: Sie erfüllen die Anwartschaftszeit. Das bedeutet meist: Sie waren in den 30 Monaten vor Arbeitslosmeldung mindestens 12 Monate versicherungspflichtig beschäftigt. Dabei können mehrere Beschäftigungen zusammengerechnet werden. Sie haben sich bei Ihrer Agentur für Arbeit arbeitslos gemeldet. Sie sind ohne Beschäftigung, können aber eine versicherungspflichtige Beschäftigung ausüben (mindestens 15 Stunden pro Woche). Sie suchen eine versicherungspflichtige Beschäftigung und arbeiten dabei mit der Agentur für Arbeit zusammen. Waren Sie häufig befristet beschäftigt, gilt unter bestimmten Voraussetzungen eine kürzere Anwartschaftszeit: Dann genügen mindestens 6 Monate versicherungspflichtiger Beschäftigung in den 30 Monaten vor Arbeitslosmeldung. Zu den Voraussetzungen gehört, dass die meisten Beschäftigungen auf bis zu 14 Wochen befristet waren."@de , + "You are probably not entitled to this benefit. The main requirements for entitlement to unemployment benefit are as follows: You fulfill the qualifying period. This usually means that you were employed for at least 12 months in the 30 months prior to registering as unemployed. Several jobs can be added together. You have registered as unemployed with your employment agency. You are unemployed, but you can work in a job that is subject to compulsory insurance (at least 15 hours per week). You are looking for employment that is subject to compulsory insurance and you are working together with the employment agency. If you were often in temporary employment, a shorter entitlement period applies under certain conditions: At least 6 months of employment subject to compulsory insurance in the 30 months before registering as unemployed are then sufficient. One of the requirements is that most jobs were limited to up to 14 weeks."@en ; + ff:hasMainPersonShape ff:arbeitslosengeldainPersonShape . + +ff:arbeitslosengeldainPersonShape a sh:NodeShape, ff:EligibilityConstraint ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:geburtsdatum ; + sh:minCount 1 ; + ] ; + sh:property [ + sh:path ff:pensionable ; + sh:minCount 1 ; + sh:in (false) ; + ] ; + sh:property [ + sh:path ff:aufenthalt ; + sh:minCount 1 ; + sh:in (true) ; + ] ; + sh:property [ + sh:path ff:aufenthaltsort ; + sh:minCount 1 ; + sh:in (ff:aufenthaltsort-ao-innerhalb) ; + ] ; + sh:property [ + sh:path ff:erwerbsfaehig_neu ; + sh:minCount 1 ; + sh:in (ff:erwerbsfaehig_neu-ao-ja) ; + ] ; + sh:property [ + sh:path ff:beruf_neu ; + sh:minCount 1 ; + sh:in (ff:beruf_neu-ao-alg) ; + ] ; + sh:property [ + sh:path ff:einkommen_neu ; + sh:minCount 1 ; + sh:not [ + sh:in (ff:einkommen_neu-ao-selbstaendig ff:einkommen_neu-ao-soz ff:einkommen_neu-ao-mutterschaftsgeld ff:einkommen_neu-ao-alg ff:einkommen_neu-ao-rente) ; + ] ; + ] . diff --git a/assets/requirement-profiles/sozialplattform/shacl/07-berufsausbildungsbeihilfe-bab.ttl b/assets/requirement-profiles/sozialplattform/shacl/07-berufsausbildungsbeihilfe-bab.ttl new file mode 100644 index 0000000..78ad8da --- /dev/null +++ b/assets/requirement-profiles/sozialplattform/shacl/07-berufsausbildungsbeihilfe-bab.ttl @@ -0,0 +1,49 @@ +@prefix sh: . +@prefix xsd: . +@prefix ff: . +@prefix rdfs: . + +ff:berufsausbildungsbeihilfe-bab a ff:RequirementProfile ; + ff:leikaId "99007004017000" ; + ff:title "Berufsausbildungsbeihilfe (BAB)"@de , "Vocational training allowance (BAB)"@en ; + ff:category ff:schule-studium-ausbildung-bc-kategorie ; + rdfs:seeAlso ; + ff:benefitInfo "Berufsausbildungsbeihilfe (BAB) ist ein finanzieller Zuschuss für junge Menschen in ihrer ersten Berufsausbildung. Sie hilft zum Beispiel dabei, Miete, Lebensmittel oder Fahrtkosten zu bezahlen."@de , + "Vocational training allowance, or Berufsausbildungsbeihilfe (BAB), is a form of financial assistance for young people who are in vocational training for the first time. It helps them pay for things like rent, food or transport costs."@en ; + ff:ineligibleGeneralExplanation "Wahrscheinlich haben Sie keinen Anspruch auf diese Leistung. Sie müssen bestimmte Voraussetzungen erfüllen, damit Sie Anspruch auf Berufsausbildungsbeihilfe haben. Einer der folgenden Fälle sollte auf Sie zutreffen, damit Ihr Antrag erfolgreich ist: Sie nehmen an einer berufsvorbereitenden Bildungsmaßnahme (BvB) teil – vielleicht auch, um sich nachträglich auf einen Hauptschulabschluss oder gleichwertigen Schulabschluss vorzubereiten. Sie machen eine betriebliche oder außerbetriebliche Berufsausbildung in einem anerkannten Ausbildungsberuf. Ihr Ausbildungsbetrieb ist zu weit von Ihren Eltern entfernt, um zuhause wohnen zu bleiben. Sie machen eine betriebliche oder außerbetriebliche Berufsausbildung in einem anerkannten Ausbildungsberuf. Außerdem sind Sie über 18 Jahre alt oder verheiratet beziehungsweise leben mit Ihrer Partnerin oder Ihrem Partner zusammen. Sie machen eine betriebliche oder außerbetriebliche Berufsausbildung in einem anerkannten Ausbildungsberuf. Sie haben mindestens ein Kind und leben nicht in der Wohnung Ihrer Eltern. Trifft einer der folgenden Fälle auf Sie zu, haben Sie keinen Anspruch auf finanzielle Unterstützung in Form von BAB: Sie machen eine schulische Ausbildung (zum Beispiel zur Physiotherapeutin beziehungsweise zum Physiotherapeut). Sie erhalten bereits Leistungen von einer anderen Behörde, die mit der BAB vergleichbar sind."@de , + "You are probably not entitled to this benefit. You have to meet certain requirements in order to be entitled to a vocational training grant. One of the following cases should apply to you for your application to be successful: You are taking part in a pre-vocational training program – perhaps also in order to prepare for a lower secondary school certificate or an equivalent school certificate. You are doing in-company or external vocational training in a recognized training occupation. Your training company is too far away from your parents to stay at home. You are doing in-company or external vocational training in a recognized training occupation. In addition, you are over 18 years old or married or live with your partner. You are doing in-company or external vocational training in a recognized training occupation. You have at least one child and do not live in your parents' home. If one of the following applies to you, you are not entitled to financial support in the form of BAB: They are doing school-based training (e.g. to become a physiotherapist). You are already receiving services from another authority that are comparable to BAB."@en ; + ff:hasMainPersonShape ff:berufsausbildungsbeihilfe-babMainPersonShape . + +ff:berufsausbildungsbeihilfe-babMainPersonShape a sh:NodeShape, ff:EligibilityConstraint ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:geburtsdatum ; + sh:minCount 1 ; + ] ; + sh:property [ + sh:path ff:pensionable ; + sh:minCount 1 ; + sh:in (false) ; + ] ; + sh:property [ + sh:path ff:aufenthaltsort ; + sh:minCount 1 ; + sh:in (ff:aufenthaltsort-ao-innerhalb) ; + ] ; + sh:property [ + sh:path ff:pflege ; + sh:minCount 1 ; + sh:in (true) ; + ] ; + sh:property [ + sh:path ff:beruf_neu ; + sh:minCount 1 ; + sh:in (ff:beruf_neu-ao-ausbildung) ; + ] ; + sh:property [ + sh:path ff:einkommen_neu ; + sh:minCount 1 ; + sh:not [ + sh:in (ff:einkommen_neu-ao-alg ff:einkommen_neu-ao-bafoeg ff:einkommen_neu-ao-rente) ; + ] ; + ] . diff --git a/assets/requirement-profiles/sozialplattform/shacl/08-wohngeld.ttl b/assets/requirement-profiles/sozialplattform/shacl/08-wohngeld.ttl new file mode 100644 index 0000000..85dd08b --- /dev/null +++ b/assets/requirement-profiles/sozialplattform/shacl/08-wohngeld.ttl @@ -0,0 +1,51 @@ +@prefix sh: . +@prefix xsd: . +@prefix ff: . +@prefix rdfs: . + +ff:wohngeld a ff:RequirementProfile ; + ff:leikaId "99107023037000" ; + ff:title "Wohngeld"@de , "Housing benefit"@en ; + ff:category ff:wohnen-bc-kategorie, ff:schule-studium-ausbildung-bc-kategorie, ff:alter-ruhestand-bc-kategorie ; + rdfs:seeAlso ; + ff:benefitInfo "Das „Wohngeld“ ist ein finanzieller Zuschuss zur Miete oder zu den Kosten, die entstehen, falls Sie ein Haus oder eine Eigentumswohnung besitzen. Um Wohngeld zu bekommen, müssen Sie einen Antrag stellen. Die Gemeindeverwaltung in Ihrer Stadt prüft den Antrag und gibt ihnen Bescheid, ob Sie Wohngeld erhalten."@de , + "In the event that you earn too little to pay for your apartment, you can apply for housing benefit."@en ; + ff:ineligibleGeneralExplanation "Wahrscheinlich haben Sie keinen Anspruch auf diese Leistung. Wohngeld bekommen Personen mit wenig Einkommen. Bei Mieterinnen/Mietern wird von Mietzuschuss und bei Eigentümerinnen/Eigentümern, die in ihrem Haus wohnen, von Lastenzuschuss gesprochen. Wohngeld wird nur an Personen gezahlt, die keine Transferleistungen (wie z. B. Bürgergeld (früher ALG II), Sozialhilfe, Grundsicherung im Alter und bei Erwerbsminderung) bekommen, da bei Transferleistungen die Unterkunftskosten schon berücksichtigt werden."@de , + "You are probably not entitled to this benefit. Housing benefit is given to people on low incomes. Tenants are referred to as rent subsidy, and owners who live in their house are referred to as load subsidy. Housing benefit is only paid to people who do not receive any transfer payments (e.g. unemployment benefit II, social assistance, basic security in old age and in the case of reduced earning capacity), since the accommodation costs are already taken into account in the case of transfer payments."@en ; + ff:hasMainPersonShape ff:wohngeldMainPersonShape . + +ff:wohngeldMainPersonShape a sh:NodeShape, ff:EligibilityConstraint ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:aufenthaltsort ; + sh:minCount 1 ; + sh:in (ff:aufenthaltsort-ao-innerhalb) ; + ] ; + sh:property [ + sh:path ff:geburtsdatum ; + sh:minCount 1 ; + ] ; + sh:property [ + sh:path ff:hasAge ; + sh:minCount 1 ; + sh:minInclusive 15 ; + ] ; + sh:property [ + sh:path ff:pensionable ; + sh:minCount 1 ; + sh:in (false) ; + ] ; + sh:property [ + sh:path ff:beruf_neu ; + sh:minCount 1 ; + sh:not [ + sh:in (ff:beruf_neu-ao-ausbildung) ; + ] ; + ] ; + sh:property [ + sh:path ff:einkommen_neu ; + sh:minCount 1 ; + sh:not [ + sh:in (ff:einkommen_neu-ao-wohngeld ff:einkommen_neu-ao-bafoeg ff:einkommen_neu-ao-alg-ii) ; + ] ; + ] . diff --git a/assets/requirement-profiles/sozialplattform/shacl/09-grundsicherung-im-alter-und-bei-erwerbsminderung.ttl b/assets/requirement-profiles/sozialplattform/shacl/09-grundsicherung-im-alter-und-bei-erwerbsminderung.ttl new file mode 100644 index 0000000..4f25604 --- /dev/null +++ b/assets/requirement-profiles/sozialplattform/shacl/09-grundsicherung-im-alter-und-bei-erwerbsminderung.ttl @@ -0,0 +1,49 @@ +@prefix sh: . +@prefix xsd: . +@prefix ff: . +@prefix rdfs: . + +ff:grundsicherung-im-alter-und-bei-erwerbsminderung a ff:RequirementProfile ; + ff:leikaId "99107009017000" ; + ff:title "Grundsicherung im Alter und bei Erwerbsminderung"@de , "Basic welfare for the elderly and people with reduced earnings capacity"@en ; + ff:category ff:sozialhilfe-grundsicherung-bc-kategorie, ff:alter-ruhestand-bc-kategorie ; + rdfs:seeAlso ; + ff:benefitInfo "Sie sind im Rentenalter, aber Ihr Geld reicht nicht aus, um Ihren Lebensunterhalt zu bezahlen? Oder sind Sie zwar noch jünger, können aber aus gesundheitlichen Gründen dauerhaft nicht arbeiten? Dann können Sie die finanzielle „Grundsicherung im Alter und bei Erwerbsminderung“ beantragen."@de , + "Are you receiving your pension but don’t have enough money to get by? Or are you younger but unable to work for health-related reasons? If so, you may be entitled to claim basic financial welfare for the elderly and people with reduced earnings capacity."@en ; + ff:ineligibleGeneralExplanation "Wahrscheinlich haben Sie keinen Anspruch auf diese Leistung. Grundsicherung im Alter und bei Erwerbsminderung können Sie als bedürftiger Mensch bekommen, wenn Sie entweder die Regelaltersgrenze - das ist der Zeitpunkt, an dem Sie die reguläre Altersrente beziehen können – erreicht haben oder mindestens 18 Jahre alt und dauerhaft voll erwerbsgemindert sind oder das Eingangs- und den Berufsbildungsbereich einer Werkstatt für behinderte Menschen durchlaufen oder in einem Ausbildungsverhältnis stehen, für welches Sie ein Budget für die Ausbildung erhalten. Sie müssen außerdem in Deutschland wohnen."@de , + "You are probably not entitled to this benefit. You can receive basic welfare for the elderly and people with reduced earnings capacity as a needy person if you have either reached the standard retirement age - that is the point at which you can draw the regular old-age pension - or are at least 18 years old and permanently fully disabled or have the initial and go through the vocational training area of a workshop for disabled people or are in an apprenticeship for which you receive a budget for the apprenticeship. You must also live in Germany."@en ; + ff:hasMainPersonShape ff:grundsicherung-im-alter-und-bei-erwerbsminderungMainPersonShape . + +ff:grundsicherung-im-alter-und-bei-erwerbsminderungMainPersonShape a sh:NodeShape, ff:EligibilityConstraint ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:geburtsdatum ; + sh:minCount 1 ; + ] ; + sh:property [ + sh:path ff:pensionable ; + sh:minCount 1 ; + sh:in (true) ; + ] ; + sh:property [ + sh:path ff:aufenthaltsort ; + sh:minCount 1 ; + sh:in (ff:aufenthaltsort-ao-innerhalb) ; + ] ; + sh:property [ + sh:path ff:erwerbsfaehig_neu ; + sh:minCount 1 ; + sh:in (ff:erwerbsfaehig_neu-ao-nein-ueber-6-monate) ; + ] ; + sh:property [ + sh:path ff:beruf_neu ; + sh:minCount 1 ; + sh:in (ff:beruf_neu-ao-rente) ; + ] ; + sh:property [ + sh:path ff:einkommen_neu ; + sh:minCount 1 ; + sh:not [ + sh:in (ff:einkommen_neu-ao-alg ff:einkommen_neu-ao-ausbildung ff:einkommen_neu-ao-bafoeg) ; + ] ; + ] . diff --git a/assets/requirement-profiles/sozialplattform/shacl/10-bildung-und-teilhabe-bei-bezug-von-buergergeld.ttl b/assets/requirement-profiles/sozialplattform/shacl/10-bildung-und-teilhabe-bei-bezug-von-buergergeld.ttl new file mode 100644 index 0000000..3672ae6 --- /dev/null +++ b/assets/requirement-profiles/sozialplattform/shacl/10-bildung-und-teilhabe-bei-bezug-von-buergergeld.ttl @@ -0,0 +1,70 @@ +@prefix sh: . +@prefix xsd: . +@prefix ff: . +@prefix rdfs: . + +ff:bildung-und-teilhabe-bei-bezug-von-buergergeld a ff:RequirementProfile ; + ff:leikaId "99107032017007" ; + ff:title "Bildung und Teilhabe - bei Bezug von Bürgergeld"@de , "Education and participation - with citizen's benefit"@en ; + ff:category ff:arbeitslosigkeit-bc-kategorie, ff:sozialhilfe-grundsicherung-bc-kategorie, ff:schule-studium-ausbildung-bc-kategorie, ff:leistungen-fuer-familien-bc-kategorie ; + rdfs:seeAlso ; + rdfs:seeAlso ; + ff:benefitInfo "In Deutschland sollen Kinder, Jugendliche und junge Erwachsene die gleichen Chancen haben. Wichtige Voraussetzungen für Chancengleichheit sind Bildung und die Teilnahme am sozialen und kulturellen Leben. Deswegen fördert der Staat Leistungen zur Bildung und Teilhabe, auch Bildungs- und Teilhabepaket genannt."@de , + "In Germany, children, teens and young adults are supposed to have equal opportunities. Education and participation in social and cultural activities are important factors in ensuring equal opportunity. For this reason, the state provides benefits to support education and participation. This is also known as the education and participation package."@en ; + ff:ineligibleGeneralExplanation "Wahrscheinlich haben Sie keinen Anspruch auf diese Leistung. Verschiedene Leistungen für Bildung und Teilhabe sollen Kindern und Jugendlichen aus bedürftigen Familien ermöglichen, besser am sozialen und kulturellen Leben in der Schule und Freizeit teilzunehmen. Die Leistungen können Sie zusätzlich zu anderen Leistungen, wie z.B. Bürgergeld (früher ALG II), Sozialhilfe, Kinderzuschlag oder Wohngeld, bekommen."@de , + "You are probably not entitled to this benefit. Various services for education and participation are intended to enable children and young people from needy families to participate better in social and cultural life at school and in their free time. You can receive the benefits in addition to other benefits, such as unemployment benefit II, social assistance, child allowance or housing benefit."@en ; + ff:hasMainPersonShape ff:bildung-und-teilhabe-bei-bezug-von-buergergeldMainPersonShape . + +ff:bildung-und-teilhabe-bei-bezug-von-buergergeldMainPersonShape a sh:NodeShape, ff:EligibilityConstraint ; + sh:targetClass ff:Citizen ; + sh:property [ + sh:path ff:kinder_unter_18 ; + sh:minCount 1 ; + ] ; + sh:property [ + sh:path ff:kinder_18_25 ; + sh:minCount 1 ; + ] ; + sh:property [ + sh:path ff:einkommen_neu ; + sh:minCount 2 ; + ] ; + sh:property [ + sh:path ff:kinder ; + sh:minCount 1 ; + sh:in (true) ; + ] ; + sh:property [ + sh:path ff:lebenssituation ; + sh:minCount 1 ; + sh:not [ + sh:in (ff:lebenssituation-ao-allein) ; + ] ; + ] ; + sh:property [ + sh:path ff:aufenthaltsort ; + sh:minCount 1 ; + sh:in (ff:aufenthaltsort-ao-innerhalb) ; + ] ; + sh:or ([ + sh:property [ + sh:path ff:kinder_18_25 ; + sh:in (true) ; + ] + ] [ + sh:property [ + sh:path ff:kinder_unter_18 ; + sh:in (true) ; + ] + ]) ; + sh:and ([ + sh:property [ + sh:path ff:einkommen_neu ; + sh:in (ff:einkommen_neu-ao-alg-ii) ; + ] + ] [ + sh:property [ + sh:path ff:einkommen_neu ; + sh:in (ff:einkommen_neu-ao-wohngeld) ; + ] + ]) . diff --git a/assets/requirement-profiles/sozialplattform/user-profile-dev.ttl b/assets/requirement-profiles/sozialplattform/user-profile-dev.ttl new file mode 100644 index 0000000..77160bc --- /dev/null +++ b/assets/requirement-profiles/sozialplattform/user-profile-dev.ttl @@ -0,0 +1,41 @@ +@prefix xsd: . +@prefix ff: . + +ff:mainPerson a ff:Citizen ; +# # ff:hilfe-zum-lebensunterhalt +# ff:aufenthaltsort ff:aufenthaltsort-ao-innerhalb ; +# ff:geburtsdatum "1992-05-17"^^xsd:date ; +# # ff:pensionable false ; +# ff:erwerbsfaehig_neu ff:erwerbsfaehig_neu-ao-nein-weniger-6-monate ; +# ff:beruf_neu ff:beruf_neu-ao-soz ; # not ff:beruf_neu-ao-alg +# ff:einkommen_neu ff:einkommen_neu-ao-soz . # not ff:einkommen_neu-ao-alg ff:einkommen_neu-ao-alg-ii + +# # ff:kindergeld +# ff:aufenthaltsort ff:aufenthaltsort-ao-innerhalb ; +# ff:geburtsdatum "1992-05-17"^^xsd:date ; +# ff:kinder true ; +# ff:kinder_unter_18 true ; +# ff:kinder_18_25 false ; +# ff:beruf_neu ff:beruf_neu-ao-soz ; +# ff:einkommen_neu ff:einkommen_neu-ao-soz ; +# ff:kindergeld false . + +# # ff:kinderzuschlag +# ff:aufenthalt true ; +# ff:kinder true ; +# ff:lebenssituation ff:lebenssituation-ao-gemeinschaft ; +# ff:aufenthaltsort ff:aufenthaltsort-ao-innerhalb ; +# ff:einkommen_familie ff:einkommen_familie-ao-monatsbrutto-ueber-900-600 ; +# ff:kinder_unter_18 true ; +# ff:kinder_18_25 false ; +# ff:kindergeld true ; +# ff:einkommen_neu ff:einkommen_neu-ao-soz . + +# # ff:bildung-und-teilhabe-bei-bezug-von-buergergeld + ff:kinder true ; + ff:lebenssituation ff:lebenssituation-ao-gemeinschaft; + ff:aufenthaltsort ff:aufenthaltsort-ao-innerhalb ; + ff:kinder_18_25 true ; + ff:kinder_unter_18 true ; + ff:einkommen_neu ff:einkommen_neu-ao-alg-ii ; + ff:einkommen_neu ff:einkommen_neu-ao-wohngeld . diff --git a/assets/requirement-profiles/user-profile-examples-registry.json b/assets/requirement-profiles/user-profile-examples-registry.json new file mode 100644 index 0000000..4672ca2 --- /dev/null +++ b/assets/requirement-profiles/user-profile-examples-registry.json @@ -0,0 +1,14 @@ +{ + "kinderzuschlag-user-profile": { + "name": "Kinderzuschlag User", + "description": "This is profile A" + }, + "opendva-user-profile": { + "name": "OpenDVA User", + "description": "This is profile B" + }, + "user-template": { + "name": "Template for new user", + "description": "This is Profile C" + } +} diff --git a/assets/requirement-profiles/user-profile-examples/dev-child-toy-user-profile.ttl b/assets/requirement-profiles/user-profile-examples/dev-child-toy-user-profile.ttl new file mode 100644 index 0000000..9ad0608 --- /dev/null +++ b/assets/requirement-profiles/user-profile-examples/dev-child-toy-user-profile.ttl @@ -0,0 +1,11 @@ +@prefix ff: . + +ff:mainPerson a ff:Citizen ; + ff:hasChild ff:child0 . + +ff:child0 a ff:Child ; + ff:hasAge 14 ; + ff:hasToy ff:toy0 . + +ff:toy0 a ff:Toy ; + ff:hasAge 3 . diff --git a/assets/requirement-profiles/user-profile-examples/dev-complied-rp-user-profile.ttl b/assets/requirement-profiles/user-profile-examples/dev-complied-rp-user-profile.ttl new file mode 100644 index 0000000..df66c19 --- /dev/null +++ b/assets/requirement-profiles/user-profile-examples/dev-complied-rp-user-profile.ttl @@ -0,0 +1,11 @@ +@prefix xsd: . +@prefix ff: . + +ff:mainPerson a ff:Citizen ; + ff:hasCompliedRequirementProfile ff:compliedrequirementprofile0 ; + ff:hasBirthday "1990-01-02"^^xsd:date . + # ff:hasResidence "Jena" ; + # ff:eligibleForSocialSupport true . + +ff:compliedrequirementprofile0 a ff:CompliedRequirementProfile ; + ff:hasRpUri ff:jenabonus . diff --git a/assets/requirement-profiles/user-profile-examples/dev-deferment-user-profile.ttl b/assets/requirement-profiles/user-profile-examples/dev-deferment-user-profile.ttl new file mode 100644 index 0000000..43504ea --- /dev/null +++ b/assets/requirement-profiles/user-profile-examples/dev-deferment-user-profile.ttl @@ -0,0 +1,28 @@ +@prefix rdf: . +@prefix xsd: . +@prefix ff: . +@prefix dcterms: . + +ff:mainPerson a ff:Citizen ; + ff:hasCompliedRequirementProfile ff:compliedrequirementprofile0 ; + ff:hasBirthday "1990-01-02"^^xsd:date ; + ff:hasDeferred ff:deferment0 ; + ff:hasDeferred ff:deferment1 ; + ff:hasDeferred ff:deferment2 . + # ff:jenabonus --> ff:hasResidence "Jena" ; + # ff:jenabonus --> ff:eligibleForSocialSupport true . + +ff:compliedrequirementprofile0 a ff:CompliedRequirementProfile ; + ff:hasRpUri ff:jenabonus . + +ff:deferment0 a ff:Deferment ; # via materialization + rdf:subject ff:mainPerson ; + rdf:predicate ff:hasAge . + +ff:deferment1 a ff:Deferment ; # via complied requirement profile + rdf:subject ff:mainPerson ; + rdf:predicate ff:eligibleForSocialSupport . + +ff:deferment2 a ff:Deferment ; # via missing data field + rdf:subject ff:mainPerson ; + rdf:predicate ff:hasChild . diff --git a/assets/requirement-profiles/user-profile-examples/empty-user-profile.ttl b/assets/requirement-profiles/user-profile-examples/empty-user-profile.ttl new file mode 100644 index 0000000..b9551f4 --- /dev/null +++ b/assets/requirement-profiles/user-profile-examples/empty-user-profile.ttl @@ -0,0 +1,3 @@ +@prefix ff: . + +ff:mainPerson a ff:Citizen . diff --git a/assets/requirement-profiles/user-profile-examples/kinderzuschlag-user-profile.ttl b/assets/requirement-profiles/user-profile-examples/kinderzuschlag-user-profile.ttl new file mode 100644 index 0000000..77a07cd --- /dev/null +++ b/assets/requirement-profiles/user-profile-examples/kinderzuschlag-user-profile.ttl @@ -0,0 +1,34 @@ +@prefix xsd: . +@prefix ff: . + +ff:mainPerson a ff:Citizen ; + ff:hasFirstNames "Max" ; + ff:hasFamilyName "Mustermann" ; + ff:hasBirthday "1992-05-17"^^xsd:date ; + ff:paysRentCold 900 ; + ff:hasLivingArea 80 ; + ff:hasResidence "Berlin" ; + ff:parentingSetup ff:Elternpaar ; + ff:receivesWohngeld 450 ; + ff:hasIncomeBrutto 2700 ; + ff:hasIncomeNetto 1600 ; + ff:hasChild ff:child0 ; + ff:hasChild ff:child1 . + # following the example calculation on page 8 here: https://www.arbeitsagentur.de/datei/kiz2-merkblattkinderzuschlag_ba034485.pdf + # ff:hasGesamtbedarf 2773 ; + # ff:hasGesamtverfuegung 2550 ; + # ff:hasGesamtverfuegungPlusKinderzuschlag 3134 . + +ff:child0 a ff:Child ; + ff:hasFirstNames "Maria" ; + ff:hasFamilyName "Mustermann" ; + ff:hasBirthday "2013-01-23"^^xsd:date ; + # ff:hasAge 11 ; + ff:hasMaritalStatus "LD" ; # ledig + ff:receiveKindergeld 250 . + +ff:child1 a ff:Child ; + ff:hasBirthday "2008-02-15"^^xsd:date ; + # ff:hasAge 16 ; + ff:hasMaritalStatus "LD" ; + ff:receiveKindergeld 250 . diff --git a/assets/requirement-profiles/user-profile-examples/opendva-user-profile.ttl b/assets/requirement-profiles/user-profile-examples/opendva-user-profile.ttl new file mode 100644 index 0000000..a4024b5 --- /dev/null +++ b/assets/requirement-profiles/user-profile-examples/opendva-user-profile.ttl @@ -0,0 +1,14 @@ +@prefix xsd: . +@prefix ff: . + +ff:mainPerson a ff:Citizen ; + ff:hasFirstNames "Maria" ; + ff:hasFamilyName "Mustermann" ; + ff:hasBirthday "1994-12-06"^^xsd:date ; + ff:hasGender "weiblich" ; + ff:hasResidence "Jena" ; + ff:eligibleForSocialSupport true ; + ff:worksAsFreelancer false . + # ff:hasBirthPlace "Jena" ; + # ff:hasMaritalStatus "VH" ; + # ff:residesInState "Thüringen" ; <-- gets materialized in-memory during validation diff --git a/assets/rps-dir.txt b/assets/rps-dir.txt new file mode 100644 index 0000000..6eaee20 --- /dev/null +++ b/assets/rps-dir.txt @@ -0,0 +1,61 @@ +.: +LICENSE +README.md +datafields.ttl +experimental +manifest.ttl +materialization.ttl +meta.ttl +shacl +sozialplattform +user-profile-examples +user-profile-examples-registry.json + +./experimental: +ausbildungsfoerderung.ttl +datafields.ttl +materialization.ttl +municipality-foerderung-spielplatz.ttl +municipality-profile.ttl +user-profile.ttl + +./shacl: +arbeitslosengeld.ttl +bildungsgutschein.ttl +dev-child-toy.ttl +dev-daemmung.ttl +dev-eauto.ttl +dev-kindergeld.ttl +dev-solar.ttl +dev-wohngeld.ttl +kinderzuschlag.ttl +opendva-existenzgruendungspass-thueringen.ttl +opendva-jenabonus.ttl +senioren-bahncard.ttl + +./sozialplattform: +chatgpt_prompts.txt +datafields.ttl +materialization.ttl +shacl +user-profile-dev.ttl + +./sozialplattform/shacl: +01-hilfe-zum-lebensunterhalt.ttl +02-kindergeld.ttl +03-kinderzuschlag.ttl +04-bafoeg.ttl +05-buergergeld.ttl +06-arbeitslosengeld.ttl +07-berufsausbildungsbeihilfe-bab.ttl +08-wohngeld.ttl +09-grundsicherung-im-alter-und-bei-erwerbsminderung.ttl +10-bildung-und-teilhabe-bei-bezug-von-buergergeld.ttl + +./user-profile-examples: +dev-child-toy-user-profile.ttl +dev-complied-rp-user-profile.ttl +dev-deferment-user-profile.ttl +empty-user-profile.ttl +kinderzuschlag-user-profile.ttl +opendva-user-profile.ttl diff --git a/check-repo-updates.js b/check-repo-updates.js new file mode 100644 index 0000000..607dda5 --- /dev/null +++ b/check-repo-updates.js @@ -0,0 +1,28 @@ +let commits = { + rps: { + uponPageLoad: "", + lastNotified: "" + }, + console: { + uponPageLoad: "", + lastNotified: "" + } +} + +async function checkForNewRepoCommits() { + console.log("checking") + await doCheck("rps") + await doCheck("console") +} + +async function doCheck(repo) { + let currentCommit = await fetchAsset("latest-" + repo + "-repo-commit.txt") + if (!commits[repo].uponPageLoad) { + commits[repo].uponPageLoad = currentCommit + commits[repo].lastNotified = currentCommit + } + if (commits[repo].lastNotified !== currentCommit) { + console.log(repo + " repo was updated since this page loaded: from commit " + commits[repo].uponPageLoad + " to " + currentCommit) + commits[repo].lastNotified = currentCommit + } +} diff --git a/drawflow.css b/drawflow.css new file mode 100644 index 0000000..d6c43f5 --- /dev/null +++ b/drawflow.css @@ -0,0 +1,366 @@ +/* Copied from https://github.com/jerosoler/Drawflow/blob/master/docs/beautiful.css */ + +:root { + --border-color: #cacaca; + --background-color: #ffffff; + + --background-box-title: #f7f7f7; +} + +html, body { + margin: 0px; + padding: 0px; + width: 100vw; + height: 100vh; + overflow: hidden; + font-family: 'Roboto', sans-serif; +} + +header { + height: 66px; + border-bottom: 1px solid var(--border-color); + padding-left: 20px; +} +header h2 { + margin: 0px; + line-height: 66px; +} +header a { + color: black; +} +.them-edit-link { + position: absolute; + top: 10px; + right: 100px; + color: black; + font-size: 40px; +} +.them-edit-link a { + text-decoration: none; +} + +.github-link{ + position: absolute; + top: 10px; + right: 20px; + color: black; +} + +.wrapper { + width: 100%; + height: calc(100vh - 67px); + display: flex; +} + +.col { + overflow: auto; + width: 300px; + height: 100%; + border-right: 1px solid var(--border-color); +} + +.drag-drawflow { + line-height: 50px; + border-bottom: 1px solid var(--border-color); + padding-left: 20px; + cursor: move; + user-select: none; +} +.menu { + position: absolute; + height: 40px; + display: block; + background: white; + width: 100%; +} +.menu ul { + padding: 0px; + margin: 0px; + line-height: 40px; +} + +.menu ul li { + display: inline-block; + margin-left: 10px; + border-right: 1px solid var(--border-color); + padding-right: 10px; + line-height: 40px; + cursor: pointer; +} + +.menu ul li.selected { + font-weight: bold; +} + +.btn-export { + float: right; + position: absolute; + top: 10px; + right: 10px; + color: white; + font-weight: bold; + border: 1px solid #0e5ba3; + background: #4ea9ff; + padding: 5px 10px; + border-radius: 4px; + cursor: pointer; + z-index: 5; +} + +.btn-clear { + float: right; + position: absolute; + top: 10px; + right: 85px; + color: white; + font-weight: bold; + border: 1px solid #96015b; + background: #e3195a; + padding: 5px 10px; + border-radius: 4px; + cursor: pointer; + z-index: 5; +} +.swal-wide{ + width:80% !important; +} + +.btn-lock { + float: right; + position: absolute; + bottom: 10px; + right: 140px; + display: flex; + font-size: 24px; + color: white; + padding: 5px 10px; + background: #555555; + border-radius: 4px; + border-right: 1px solid var(--border-color); + z-index: 5; + cursor: pointer; +} + +.bar-zoom { + float: right; + position: absolute; + bottom: 10px; + right: 10px; + display: flex; + font-size: 24px; + color: white; + padding: 5px 10px; + background: #555555; + border-radius: 4px; + border-right: 1px solid var(--border-color); + z-index: 5; +} +.bar-zoom svg { + cursor: pointer; + padding-left: 10px; +} +.bar-zoom svg:nth-child(1) { + padding-left: 0px; +} + +#drawflow { + position: relative; + width: calc(100vw - 301px); + height: calc(100% - 50px); + top: 40px; + background: var(--background-color); + background-size: 25px 25px; + background-image: + linear-gradient(to right, #f1f1f1 1px, transparent 1px), + linear-gradient(to bottom, #f1f1f1 1px, transparent 1px); +} + +@media only screen and (max-width: 768px) { + .col { + width: 50px; + } + .col .drag-drawflow span { + display:none; + } + #drawflow { + width: calc(100vw - 51px); + } +} + + + +/* Editing Drawflow */ + +.drawflow .drawflow-node { + background: var(--background-color); + border: 1px solid var(--border-color); + -webkit-box-shadow: 0 2px 15px 2px var(--border-color); + box-shadow: 0 2px 15px 2px var(--border-color); + padding: 0px; + width: 200px; +} + +.drawflow .drawflow-node.selected { + background: white; + border: 1px solid #4ea9ff; + -webkit-box-shadow: 0 2px 20px 2px #4ea9ff; + box-shadow: 0 2px 20px 2px #4ea9ff; +} + +.drawflow .drawflow-node.selected .title-box { + color: #22598c; + /*border-bottom: 1px solid #4ea9ff;*/ +} + +.drawflow .connection .main-path { + stroke: #4ea9ff; + stroke-width: 3px; +} + +.drawflow .drawflow-node .input, .drawflow .drawflow-node .output { + height: 15px; + width: 15px; + border: 2px solid var(--border-color); +} + +.drawflow .drawflow-node .input:hover, .drawflow .drawflow-node .output:hover { + background: #4ea9ff; +} + +.drawflow .drawflow-node .output { + right: 10px; +} + +.drawflow .drawflow-node .input { + left: -10px; + background: white; +} + +.drawflow > .drawflow-delete { + border: 2px solid #43b993; + background: white; + color: #43b993; + -webkit-box-shadow: 0 2px 20px 2px #43b993; + box-shadow: 0 2px 20px 2px #43b993; +} + +.drawflow-delete { + border: 2px solid #4ea9ff; + background: white; + color: #4ea9ff; + -webkit-box-shadow: 0 2px 20px 2px #4ea9ff; + box-shadow: 0 2px 20px 2px #4ea9ff; +} + +.drawflow-node .title-box { + height: 50px; + line-height: 50px; + background: var(--background-box-title); + border-bottom: 1px solid #e9e9e9; + border-radius: 4px 4px 0px 0px; + padding-left: 10px; +} +.drawflow .title-box svg { + position: initial; +} +.drawflow-node .box { + padding: 10px 20px 20px 20px; + font-size: 14px; + color: #555555; + +} +.drawflow-node .box p { + margin-top: 5px; + margin-bottom: 5px; +} + +.drawflow-node.welcome { + width: 250px; +} + +.drawflow-node.slack .title-box { + border-radius: 4px; +} + +.drawflow-node input, .drawflow-node select, .drawflow-node textarea { + border-radius: 4px; + border: 1px solid var(--border-color); + height: 30px; + line-height: 30px; + font-size: 16px; + width: 158px; + color: #555555; +} + +.drawflow-node textarea { + height: 100px; +} + + +.drawflow-node.personalized { + background: red; + height: 200px; + text-align: center; + color: white; +} +.drawflow-node.personalized .input { + background: yellow; +} +.drawflow-node.personalized .output { + background: green; +} + +.drawflow-node.personalized.selected { + background: blue; +} + +.drawflow .connection .point { + stroke: var(--border-color); + stroke-width: 2; + fill: white; + +} + +.drawflow .connection .point.selected, .drawflow .connection .point:hover { + fill: #4ea9ff; +} + + +/* Modal */ +.modal { + display: none; + position: fixed; + z-index: 7; + left: 0; + top: 0; + width: 100vw; + height: 100vh; + overflow: auto; + background-color: rgb(0,0,0); + background-color: rgba(0,0,0,0.7); + +} + +.modal-content { + position: relative; + background-color: #fefefe; + margin: 15% auto; /* 15% from the top and centered */ + padding: 20px; + border: 1px solid #888; + width: 400px; /* Could be more or less, depending on screen size */ +} + +/* The Close Button */ +.modal .close { + color: #aaa; + float: right; + font-size: 28px; + font-weight: bold; + cursor:pointer; +} + +@media only screen and (max-width: 768px) { + .modal-content { + width: 80%; + } +} diff --git a/index.html b/index.html new file mode 100644 index 0000000..f947d5b --- /dev/null +++ b/index.html @@ -0,0 +1,281 @@ + + + + + FörderFunke + + + + + + + + + + + + + + + +
+ + + diff --git a/main.js b/main.js new file mode 100644 index 0000000..8acb3f8 --- /dev/null +++ b/main.js @@ -0,0 +1,26 @@ +setInterval(checkForNewRepoCommits, 60 * 1000) + +async function func() { + let query = "SELECT * WHERE { ?s ?p ?o }" + let rdfStr = ` + @prefix ex: . + ex:sub ex:pred ex:obj . + ` + let result = await runSparqlSelectQueryOnRdfString(query, rdfStr) + console.log(result) +} + +async function dev() { + let rpsDir = await fetchAsset("rps-dir.txt") + console.log(rpsDir) +} + +/*document.getElementById("fileUpload").addEventListener("change", function() { + const reader = new FileReader() + reader.onload = function(event) { + const content = event.target.result + console.log("File content:", content) + } + const file = this.files[0] + reader.readAsText(file) +})*/ diff --git a/utils.js b/utils.js new file mode 100644 index 0000000..ee1b5d1 --- /dev/null +++ b/utils.js @@ -0,0 +1,97 @@ +async function fetchAsset(relPath) { + const response = await fetch("assets/" + relPath, { + method: "GET", + cache: "reload" + }) + return await response.text() +} + +// type: "text/turtle" +async function download(content, type, filename) { + let blob = new Blob([content], {type: type}) + let url = URL.createObjectURL(blob) + let a = document.createElement("a") + a.href = url + a.download = filename + document.body.appendChild(a) + a.click() + document.body.removeChild(a) + window.URL.revokeObjectURL(url) +} + +async function runSparqlSelectQueryOnRdfString(query, rdfStr) { + let store = window.bundle.newStore() + await addRdfStringToStore(rdfStr, store) + const queryEngine = window.bundle.newQueryEngine() + let bindingsStream = await queryEngine.queryBindings(query, { sources: [ store ] }) + return await bindingsStream.toArray() +} + +async function runSparqlConstructQueryOnRdfString(query, rdfStr) { + let store = window.bundle.newStore() + await addRdfStringToStore(rdfStr, store) + const queryEngine = window.bundle.newQueryEngine() + let quadsStream = await queryEngine.queryQuads(query, { sources: [ store ] }) + return await quadsStream.toArray() +} + +function addRdfStringToStore(rdfStr, store) { + return new Promise((resolve, reject) => { + const parser = window.bundle.newParser() + parser.parse(rdfStr, (err, quad) => { + if (err) { + console.error(err) + reject(err) + } + if (quad) { + store.add(quad) + } else { + resolve(store) + } + }) + }) +} + +function serializeStoreToTurtle(store) { + return new Promise((resolve, reject) => { + let writer = window.bundle.newWriter({ + prefixes: { + ff: "https://foerderfunke.org/default#" + } + }) + store.getQuads().forEach(quad => writer.addQuad(quad)) + writer.end((error, result) => { + if (error) { + reject(error) + } else { + resolve(result) + } + }) + }) +} + +function serializeDatasetToTurtle(dataset) { + return new Promise((resolve, reject) => { + let writer = window.bundle.newWriter({ + prefixes: { + ff: "https://foerderfunke.org/default#", + sh: "http://www.w3.org/ns/shacl#", + } + }) + dataset.forEach(quad => writer.addQuad(quad)) + writer.end((error, result) => { + if (error) { + reject(error) + } else { + resolve(result) + } + }) + }) +} + +async function runValidationOnStore(store) { + let rdf = window.bundle.getRdfFactory() + let dataset = rdf.dataset(store.getQuads()) + let validator = window.bundle.newValidator(dataset, { factory: rdf, debug: false }) + return await validator.validate({ dataset: dataset }) +}