From 0a59a4e63d278c92e0e7528f26d3faea84a3e7ad Mon Sep 17 00:00:00 2001 From: splattater Date: Mon, 19 Aug 2024 14:23:59 +0000 Subject: [PATCH] deploy: f45db393965b48cdb9e5c491c3ef672c03a1035d --- index.html | 2 +- ...View-8D4yJgwJ.js => AboutView-qWIyL1Yy.js} | 2 +- ...-oP_o-Ja_.js => DashboardView-DcVz4jBx.js} | 2 +- ...tForm-uEtOdnsK.js => EditForm-Blgk6tMk.js} | 2 +- pad/assets/FormDemo-B-6k6oiB.js | 129 ++++++++++++++++++ pad/assets/FormDemo-DXTcTxJi.js | 125 ----------------- ...Form-Du3E-_8t.js => InputForm-BkXAP2gv.js} | 2 +- ...t-AVehQBSG.js => InstanceList-DoIEMcR8.js} | 2 +- ...{Source-DLJIiKEC.js => Source-DTEjL7Kq.js} | 2 +- .../{Term-CKdvsSUc.js => Term-Blmh2NdX.js} | 2 +- ...{VocPad-D_dUwJLt.js => VocPad-Ccm15vTJ.js} | 2 +- .../{index-CWflGvq2.js => index-DjCaYEkD.js} | 4 +- ...are-B4Bu77vD.js => n3-compare-Q4z2T_H1.js} | 2 +- pad/index.html | 2 +- 14 files changed, 142 insertions(+), 138 deletions(-) rename pad/assets/{AboutView-8D4yJgwJ.js => AboutView-qWIyL1Yy.js} (84%) rename pad/assets/{DashboardView-oP_o-Ja_.js => DashboardView-DcVz4jBx.js} (95%) rename pad/assets/{EditForm-uEtOdnsK.js => EditForm-Blgk6tMk.js} (97%) create mode 100644 pad/assets/FormDemo-B-6k6oiB.js delete mode 100644 pad/assets/FormDemo-DXTcTxJi.js rename pad/assets/{InputForm-Du3E-_8t.js => InputForm-BkXAP2gv.js} (94%) rename pad/assets/{InstanceList-AVehQBSG.js => InstanceList-DoIEMcR8.js} (76%) rename pad/assets/{Source-DLJIiKEC.js => Source-DTEjL7Kq.js} (65%) rename pad/assets/{Term-CKdvsSUc.js => Term-Blmh2NdX.js} (92%) rename pad/assets/{VocPad-D_dUwJLt.js => VocPad-Ccm15vTJ.js} (99%) rename pad/assets/{index-CWflGvq2.js => index-DjCaYEkD.js} (99%) rename pad/assets/{n3-compare-B4Bu77vD.js => n3-compare-Q4z2T_H1.js} (99%) diff --git a/index.html b/index.html index 221402e..3e9d387 100644 --- a/index.html +++ b/index.html @@ -23,7 +23,7 @@ - + Skip to the content. diff --git a/pad/assets/AboutView-8D4yJgwJ.js b/pad/assets/AboutView-qWIyL1Yy.js similarity index 84% rename from pad/assets/AboutView-8D4yJgwJ.js rename to pad/assets/AboutView-qWIyL1Yy.js index 0a006b5..e2bfdb4 100644 --- a/pad/assets/AboutView-8D4yJgwJ.js +++ b/pad/assets/AboutView-qWIyL1Yy.js @@ -1 +1 @@ -import{_ as o,c as e,o as a,F as n,a as t}from"./index-CWflGvq2.js";const s={},c=t("h1",null,"OntoPad",-1),l=t("ul",null,[t("li",null,[t("a",{href:"https://github.com/AKSW/OntoPad/"},"https://github.com/AKSW/OntoPad/")]),t("li",null,[t("a",{href:"https://ontopad.aksw.org/"},"https://ontopad.aksw.org/")])],-1);function r(_,h){return a(),e(n,null,[c,l],64)}const d=o(s,[["render",r]]);export{d as default}; +import{_ as o,c as e,o as a,F as n,a as t}from"./index-DjCaYEkD.js";const s={},c=t("h1",null,"OntoPad",-1),l=t("ul",null,[t("li",null,[t("a",{href:"https://github.com/AKSW/OntoPad/"},"https://github.com/AKSW/OntoPad/")]),t("li",null,[t("a",{href:"https://ontopad.aksw.org/"},"https://ontopad.aksw.org/")])],-1);function r(_,h){return a(),e(n,null,[c,l],64)}const d=o(s,[["render",r]]);export{d as default}; diff --git a/pad/assets/DashboardView-oP_o-Ja_.js b/pad/assets/DashboardView-DcVz4jBx.js similarity index 95% rename from pad/assets/DashboardView-oP_o-Ja_.js rename to pad/assets/DashboardView-DcVz4jBx.js index f58850e..2442dac 100644 --- a/pad/assets/DashboardView-oP_o-Ja_.js +++ b/pad/assets/DashboardView-DcVz4jBx.js @@ -1 +1 @@ -import{T as R}from"./Term-CKdvsSUc.js";import{u as k,b as _,f as d,m as C,q as S,_ as f,r as y,o as n,c,a as t,t as M,d as o,F as w,e as N,g as j,w as i,h as m,i as p,M as v,p as I,j as V}from"./index-CWflGvq2.js";import D from"./InstanceList-AVehQBSG.js";const Q={name:"PropertyView",setup(){const e=k(),a=_();return{store:e,selection:a}},components:{Term:R},data(){return{dataModel:{},subject:d.namedNode("")}},computed:{...C(_,["resource_iri"]),label(){if(this.dataModel.getQuads!==void 0){const e=this.dataModel.getQuads(d.namedNode(this.resource_iri),d.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),null)[0];if(e)return e.object}return""},description(){if(this.dataModel.getQuads!==void 0){const e=this.dataModel.getQuads(d.namedNode(this.resource_iri),d.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),null)[0];if(e)return e.object}return""}},mounted(){this.getResource()},watch:{resource_iri(e){this.getResource()}},methods:{async getResource(){this.subject=d.namedNode(this.resource_iri),console.log("get resource: "+this.resource_iri);const e=await this.store.getResource(this.resource_iri);this.dataModel=(await S(e)).store},selectResource(e){this.selection.changeResourceIri(e)}}},U=t("dt",null,"IRI",-1),T=t("dt",null,"Label",-1),x=t("dt",null,"Description",-1),B={key:0,width:"100%"},P=t("tr",null,[t("th",{scope:"col",width:"45%"},"Predicate"),t("th",{scope:"col",width:"auto"},"Object")],-1);function q(e,a,g,O,h,r){const l=y("Term");return n(),c("div",null,[t("dl",null,[U,t("dd",null,M(e.resource_iri),1),T,t("dd",null,[o(l,{term:r.label,"onUpdate:term":a[0]||(a[0]=s=>r.label=s),onClick:r.selectResource},null,8,["term","onClick"])]),x,t("dd",null,[o(l,{term:r.description,"onUpdate:term":a[1]||(a[1]=s=>r.description=s),onClick:r.selectResource},null,8,["term","onClick"])])]),h.dataModel.getQuads!==void 0?(n(),c("table",B,[P,(n(!0),c(w,null,N(h.dataModel.getQuads(null,null,null),(s,b)=>(n(),c("tr",{key:b},[t("td",null,[o(l,{term:s.predicate,"onUpdate:term":u=>s.predicate=u,onClick:r.selectResource},null,8,["term","onUpdate:term","onClick"])]),t("td",null,[o(l,{term:s.object,"onUpdate:term":u=>s.object=u,onClick:r.selectResource},null,8,["term","onUpdate:term","onClick"])])]))),128))])):j("",!0)])}const z=f(Q,[["render",q]]),F=e=>(I("data-v-f8555f28"),e=e(),V(),e),L=F(()=>t("strong",null,"Resource Dashboard",-1)),E={__name:"DashboardView",setup(e){return(a,g)=>(n(),c(w,null,[L,o(m(v),{class:"default-theme"},{default:i(()=>[o(m(p),{size:"70"},{default:i(()=>[o(z)]),_:1}),o(m(p),{size:"30"},{default:i(()=>[o(D,{style:{height:"80vh","overflow-y":"scroll"}})]),_:1})]),_:1})],64))}},J=f(E,[["__scopeId","data-v-f8555f28"]]);export{J as default}; +import{T as R}from"./Term-Blmh2NdX.js";import{u as k,b as _,f as d,m as C,q as S,_ as f,r as y,o as n,c,a as t,t as M,d as o,F as w,e as N,g as j,w as i,h as m,i as p,M as v,p as I,j as V}from"./index-DjCaYEkD.js";import D from"./InstanceList-DoIEMcR8.js";const Q={name:"PropertyView",setup(){const e=k(),a=_();return{store:e,selection:a}},components:{Term:R},data(){return{dataModel:{},subject:d.namedNode("")}},computed:{...C(_,["resource_iri"]),label(){if(this.dataModel.getQuads!==void 0){const e=this.dataModel.getQuads(d.namedNode(this.resource_iri),d.namedNode("http://www.w3.org/2000/01/rdf-schema#label"),null)[0];if(e)return e.object}return""},description(){if(this.dataModel.getQuads!==void 0){const e=this.dataModel.getQuads(d.namedNode(this.resource_iri),d.namedNode("http://www.w3.org/2000/01/rdf-schema#comment"),null)[0];if(e)return e.object}return""}},mounted(){this.getResource()},watch:{resource_iri(e){this.getResource()}},methods:{async getResource(){this.subject=d.namedNode(this.resource_iri),console.log("get resource: "+this.resource_iri);const e=await this.store.getResource(this.resource_iri);this.dataModel=(await S(e)).store},selectResource(e){this.selection.changeResourceIri(e)}}},U=t("dt",null,"IRI",-1),T=t("dt",null,"Label",-1),x=t("dt",null,"Description",-1),B={key:0,width:"100%"},P=t("tr",null,[t("th",{scope:"col",width:"45%"},"Predicate"),t("th",{scope:"col",width:"auto"},"Object")],-1);function q(e,a,g,O,h,r){const l=y("Term");return n(),c("div",null,[t("dl",null,[U,t("dd",null,M(e.resource_iri),1),T,t("dd",null,[o(l,{term:r.label,"onUpdate:term":a[0]||(a[0]=s=>r.label=s),onClick:r.selectResource},null,8,["term","onClick"])]),x,t("dd",null,[o(l,{term:r.description,"onUpdate:term":a[1]||(a[1]=s=>r.description=s),onClick:r.selectResource},null,8,["term","onClick"])])]),h.dataModel.getQuads!==void 0?(n(),c("table",B,[P,(n(!0),c(w,null,N(h.dataModel.getQuads(null,null,null),(s,b)=>(n(),c("tr",{key:b},[t("td",null,[o(l,{term:s.predicate,"onUpdate:term":u=>s.predicate=u,onClick:r.selectResource},null,8,["term","onUpdate:term","onClick"])]),t("td",null,[o(l,{term:s.object,"onUpdate:term":u=>s.object=u,onClick:r.selectResource},null,8,["term","onUpdate:term","onClick"])])]))),128))])):j("",!0)])}const z=f(Q,[["render",q]]),F=e=>(I("data-v-f8555f28"),e=e(),V(),e),L=F(()=>t("strong",null,"Resource Dashboard",-1)),E={__name:"DashboardView",setup(e){return(a,g)=>(n(),c(w,null,[L,o(m(v),{class:"default-theme"},{default:i(()=>[o(m(p),{size:"70"},{default:i(()=>[o(z)]),_:1}),o(m(p),{size:"30"},{default:i(()=>[o(D,{style:{height:"80vh","overflow-y":"scroll"}})]),_:1})]),_:1})],64))}},J=f(E,[["__scopeId","data-v-f8555f28"]]);export{J as default}; diff --git a/pad/assets/EditForm-uEtOdnsK.js b/pad/assets/EditForm-Blgk6tMk.js similarity index 97% rename from pad/assets/EditForm-uEtOdnsK.js rename to pad/assets/EditForm-Blgk6tMk.js index 10eb30b..101956f 100644 --- a/pad/assets/EditForm-uEtOdnsK.js +++ b/pad/assets/EditForm-Blgk6tMk.js @@ -1,4 +1,4 @@ -import{_ as g,u as f,T as y,f as n,m as k,r as v,c as i,a as e,d as m,F as h,e as w,g as b,C as _,t as u,b as j,o as l}from"./index-CWflGvq2.js";import{l as M,d as R}from"./n3-compare-B4Bu77vD.js";const C={name:"EditForm",setup(){return{store:f()}},components:{TermInput:y},mounted(){this.getResource()},watch:{resource_iri(s){this.getResource()}},data(){return{debug:!1,subject:n.namedNode(""),originalDataModel:[],dataModel:[]}},computed:{...k(j,["graph_iri","resource_iri"])},methods:{newTriple(s){s||(s=0),this.dataModel.splice(s+1,0,n.quad(this.subject,n.namedNode(""),n.namedNode(""),n.namedNode(this.graph_iri)))},delTriple(s){this.dataModel.splice(s,1)},async getResource(){this.subject=n.namedNode(this.resource_iri),this.originalDataModel=await(await this.store.getResource(this.resource_iri)).toArray(),this.dataModel=M.cloneDeep(this.originalDataModel)},async updateResource(){const s=R(this.originalDataModel,this.dataModel);try{await this.store.deleteInsertData({deleteArray:s.del,insertArray:s.add}),this.getResource()}catch(t){console.error(t)}}}},T={class:"Form"},N=e("label",{for:"resourceUriInput"},"Resource IRI (Subject)",-1),D={width:"100%"},I=e("tr",null,[e("th",{scope:"col",width:"45%"},"Predicate"),e("th",{scope:"col",width:"auto"},"Object"),e("th",{scope:"col",width:"90px"})],-1),U=["onClick"],S=["onClick"],F={key:1},E={style:{overflow:"scroll",height:"400px"}},V={class:"container"},A={class:"row"},B={class:"col"},q={class:"col"};function x(s,t,L,O,o,d){const p=v("TermInput");return l(),i(h,null,[e("div",T,[e("form",null,[N,m(p,{term:o.subject,"onUpdate:term":t[0]||(t[0]=r=>o.subject=r),type:"iri",id:"resourceUriInput"},null,8,["term"]),e("table",D,[I,(l(!0),i(h,null,w(o.dataModel,(r,a)=>(l(),i("tr",{key:a},[e("td",null,[m(p,{id:"form-pred-"+a,term:r.predicate,"onUpdate:term":c=>r.predicate=c,type:"iri"},null,8,["id","term","onUpdate:term"])]),e("td",null,[m(p,{id:"form-obj-"+a,term:r.object,"onUpdate:term":c=>r.object=c},null,8,["id","term","onUpdate:term"])]),e("td",null,[e("button",{type:"button",class:"btn btn-outline-dark mb-0",onClick:c=>d.newTriple(a)},"+",8,U),e("button",{type:"button",class:"btn btn-outline-dark mb-0",onClick:c=>d.delTriple(a)},"-",8,S)])]))),128))]),o.dataModel.length<1?(l(),i("button",{key:0,type:"button",class:"btn btn-outline-dark mb-0",onClick:t[1]||(t[1]=r=>d.newTriple())},"+")):b("",!0),e("button",{type:"button",class:"btn btn-outline-primary mb-0",onClick:t[2]||(t[2]=(...r)=>d.updateResource&&d.updateResource(...r))},"Update Resource")])]),o.debug==!1?(l(),i("a",{key:0,onClick:t[3]||(t[3]=r=>o.debug=!0)},"(show debug)")):b("",!0),o.debug?(l(),i("div",F,[e("a",{onClick:t[4]||(t[4]=r=>o.debug=!1)},"(hide debug)"),e("div",E,[e("div",V,[e("div",A,[e("div",B,[_(" new "),e("pre",null,"subject: "+u(o.subject)+` +import{_ as g,u as f,T as y,f as n,m as k,r as v,c as i,a as e,d as m,F as h,e as w,g as b,C as _,t as u,b as j,o as l}from"./index-DjCaYEkD.js";import{l as M,d as R}from"./n3-compare-Q4z2T_H1.js";const C={name:"EditForm",setup(){return{store:f()}},components:{TermInput:y},mounted(){this.getResource()},watch:{resource_iri(s){this.getResource()}},data(){return{debug:!1,subject:n.namedNode(""),originalDataModel:[],dataModel:[]}},computed:{...k(j,["graph_iri","resource_iri"])},methods:{newTriple(s){s||(s=0),this.dataModel.splice(s+1,0,n.quad(this.subject,n.namedNode(""),n.namedNode(""),n.namedNode(this.graph_iri)))},delTriple(s){this.dataModel.splice(s,1)},async getResource(){this.subject=n.namedNode(this.resource_iri),this.originalDataModel=await(await this.store.getResource(this.resource_iri)).toArray(),this.dataModel=M.cloneDeep(this.originalDataModel)},async updateResource(){const s=R(this.originalDataModel,this.dataModel);try{await this.store.deleteInsertData({deleteArray:s.del,insertArray:s.add}),this.getResource()}catch(t){console.error(t)}}}},T={class:"Form"},N=e("label",{for:"resourceUriInput"},"Resource IRI (Subject)",-1),D={width:"100%"},I=e("tr",null,[e("th",{scope:"col",width:"45%"},"Predicate"),e("th",{scope:"col",width:"auto"},"Object"),e("th",{scope:"col",width:"90px"})],-1),U=["onClick"],S=["onClick"],F={key:1},E={style:{overflow:"scroll",height:"400px"}},V={class:"container"},A={class:"row"},B={class:"col"},q={class:"col"};function x(s,t,L,O,o,d){const p=v("TermInput");return l(),i(h,null,[e("div",T,[e("form",null,[N,m(p,{term:o.subject,"onUpdate:term":t[0]||(t[0]=r=>o.subject=r),type:"iri",id:"resourceUriInput"},null,8,["term"]),e("table",D,[I,(l(!0),i(h,null,w(o.dataModel,(r,a)=>(l(),i("tr",{key:a},[e("td",null,[m(p,{id:"form-pred-"+a,term:r.predicate,"onUpdate:term":c=>r.predicate=c,type:"iri"},null,8,["id","term","onUpdate:term"])]),e("td",null,[m(p,{id:"form-obj-"+a,term:r.object,"onUpdate:term":c=>r.object=c},null,8,["id","term","onUpdate:term"])]),e("td",null,[e("button",{type:"button",class:"btn btn-outline-dark mb-0",onClick:c=>d.newTriple(a)},"+",8,U),e("button",{type:"button",class:"btn btn-outline-dark mb-0",onClick:c=>d.delTriple(a)},"-",8,S)])]))),128))]),o.dataModel.length<1?(l(),i("button",{key:0,type:"button",class:"btn btn-outline-dark mb-0",onClick:t[1]||(t[1]=r=>d.newTriple())},"+")):b("",!0),e("button",{type:"button",class:"btn btn-outline-primary mb-0",onClick:t[2]||(t[2]=(...r)=>d.updateResource&&d.updateResource(...r))},"Update Resource")])]),o.debug==!1?(l(),i("a",{key:0,onClick:t[3]||(t[3]=r=>o.debug=!0)},"(show debug)")):b("",!0),o.debug?(l(),i("div",F,[e("a",{onClick:t[4]||(t[4]=r=>o.debug=!1)},"(hide debug)"),e("div",E,[e("div",V,[e("div",A,[e("div",B,[_(" new "),e("pre",null,"subject: "+u(o.subject)+` `+u(o.dataModel)+` `,1)]),e("div",q,[_(" old "),e("pre",null,"subject: "+u(o.subject)+` `+u(o.originalDataModel)+` diff --git a/pad/assets/FormDemo-B-6k6oiB.js b/pad/assets/FormDemo-B-6k6oiB.js new file mode 100644 index 0000000..ec0a392 --- /dev/null +++ b/pad/assets/FormDemo-B-6k6oiB.js @@ -0,0 +1,129 @@ +import{T as hn}from"./Term-Blmh2NdX.js";import{L as fn,_ as pn,u as gn,b as wr,M as mn,i as yn,f as gt,m as bn,q as vn,N as wn,O as _n,P as xn,Q as Sn,r as mt,n as jn,w as Ct,o as In,d as yt,a as We,t as En}from"./index-DjCaYEkD.js";import Nn from"./InstanceList-DoIEMcR8.js";/*! For license information please see form-default.js.LICENSE.txt */var Tn={5568:s=>{const{AbortController:e,AbortSignal:t}=typeof self<"u"?self:typeof window<"u"?window:void 0;s.exports=e,s.exports.AbortSignal=t,s.exports.default=e},7526:(s,e)=>{e.byteLength=function(o){var c=d(o),p=c[0],v=c[1];return 3*(p+v)/4-v},e.toByteArray=function(o){var c,p,v=d(o),f=v[0],h=v[1],w=new n(function(j,A,Q){return 3*(A+Q)/4-Q}(0,f,h)),g=0,x=h>0?f-4:f;for(p=0;p>16&255,w[g++]=c>>8&255,w[g++]=255&c;return h===2&&(c=r[o.charCodeAt(p)]<<2|r[o.charCodeAt(p+1)]>>4,w[g++]=255&c),h===1&&(c=r[o.charCodeAt(p)]<<10|r[o.charCodeAt(p+1)]<<4|r[o.charCodeAt(p+2)]>>2,w[g++]=c>>8&255,w[g++]=255&c),w},e.fromByteArray=function(o){for(var c,p=o.length,v=p%3,f=[],h=16383,w=0,g=p-v;wg?g:w+h));return v===1?(c=o[p-1],f.push(t[c>>2]+t[c<<4&63]+"==")):v===2&&(c=(o[p-2]<<8)+o[p-1],f.push(t[c>>10]+t[c>>4&63]+t[c<<2&63]+"=")),f.join("")};for(var t=[],r=[],n=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0;l<64;++l)t[l]=a[l],r[a.charCodeAt(l)]=l;function d(o){var c=o.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var p=o.indexOf("=");return p===-1&&(p=c),[p,p===c?0:4-p%4]}function i(o,c,p){for(var v,f,h=[],w=c;w>18&63]+t[f>>12&63]+t[f>>6&63]+t[63&f]);return h.join("")}r[45]=62,r[95]=63},8287:(s,e,t)=>{const r=t(7526),n=t(251),a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=i,e.SlowBuffer=function(u){return+u!=u&&(u=0),i.alloc(+u)},e.INSPECT_MAX_BYTES=50;const l=2147483647;function d(u){if(u>l)throw new RangeError('The value "'+u+'" is invalid for option "size"');const m=new Uint8Array(u);return Object.setPrototypeOf(m,i.prototype),m}function i(u,m,_){if(typeof u=="number"){if(typeof m=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return p(u)}return o(u,m,_)}function o(u,m,_){if(typeof u=="string")return function(re,ce){if(typeof ce=="string"&&ce!==""||(ce="utf8"),!i.isEncoding(ce))throw new TypeError("Unknown encoding: "+ce);const he=0|w(re,ce);let pe=d(he);const me=pe.write(re,ce);return me!==he&&(pe=pe.slice(0,me)),pe}(u,m);if(ArrayBuffer.isView(u))return function(re){if(R(re,Uint8Array)){const ce=new Uint8Array(re);return f(ce.buffer,ce.byteOffset,ce.byteLength)}return v(re)}(u);if(u==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof u);if(R(u,ArrayBuffer)||u&&R(u.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(R(u,SharedArrayBuffer)||u&&R(u.buffer,SharedArrayBuffer)))return f(u,m,_);if(typeof u=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const F=u.valueOf&&u.valueOf();if(F!=null&&F!==u)return i.from(F,m,_);const G=function(re){if(i.isBuffer(re)){const ce=0|h(re.length),he=d(ce);return he.length===0||re.copy(he,0,0,ce),he}return re.length!==void 0?typeof re.length!="number"||ne(re.length)?d(0):v(re):re.type==="Buffer"&&Array.isArray(re.data)?v(re.data):void 0}(u);if(G)return G;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof u[Symbol.toPrimitive]=="function")return i.from(u[Symbol.toPrimitive]("string"),m,_);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof u)}function c(u){if(typeof u!="number")throw new TypeError('"size" argument must be of type number');if(u<0)throw new RangeError('The value "'+u+'" is invalid for option "size"')}function p(u){return c(u),d(u<0?0:0|h(u))}function v(u){const m=u.length<0?0:0|h(u.length),_=d(m);for(let F=0;F=l)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+l.toString(16)+" bytes");return 0|u}function w(u,m){if(i.isBuffer(u))return u.length;if(ArrayBuffer.isView(u)||R(u,ArrayBuffer))return u.byteLength;if(typeof u!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof u);const _=u.length,F=arguments.length>2&&arguments[2]===!0;if(!F&&_===0)return 0;let G=!1;for(;;)switch(m){case"ascii":case"latin1":case"binary":return _;case"utf8":case"utf-8":return W(u).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*_;case"hex":return _>>>1;case"base64":return z(u).length;default:if(G)return F?-1:W(u).length;m=(""+m).toLowerCase(),G=!0}}function g(u,m,_){let F=!1;if((m===void 0||m<0)&&(m=0),m>this.length||((_===void 0||_>this.length)&&(_=this.length),_<=0)||(_>>>=0)<=(m>>>=0))return"";for(u||(u="utf8");;)switch(u){case"hex":return se(this,m,_);case"utf8":case"utf-8":return b(this,m,_);case"ascii":return N(this,m,_);case"latin1":case"binary":return K(this,m,_);case"base64":return k(this,m,_);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return q(this,m,_);default:if(F)throw new TypeError("Unknown encoding: "+u);u=(u+"").toLowerCase(),F=!0}}function x(u,m,_){const F=u[m];u[m]=u[_],u[_]=F}function j(u,m,_,F,G){if(u.length===0)return-1;if(typeof _=="string"?(F=_,_=0):_>2147483647?_=2147483647:_<-2147483648&&(_=-2147483648),ne(_=+_)&&(_=G?0:u.length-1),_<0&&(_=u.length+_),_>=u.length){if(G)return-1;_=u.length-1}else if(_<0){if(!G)return-1;_=0}if(typeof m=="string"&&(m=i.from(m,F)),i.isBuffer(m))return m.length===0?-1:A(u,m,_,F,G);if(typeof m=="number")return m&=255,typeof Uint8Array.prototype.indexOf=="function"?G?Uint8Array.prototype.indexOf.call(u,m,_):Uint8Array.prototype.lastIndexOf.call(u,m,_):A(u,[m],_,F,G);throw new TypeError("val must be string, number or Buffer")}function A(u,m,_,F,G){let re,ce=1,he=u.length,pe=m.length;if(F!==void 0&&((F=String(F).toLowerCase())==="ucs2"||F==="ucs-2"||F==="utf16le"||F==="utf-16le")){if(u.length<2||m.length<2)return-1;ce=2,he/=2,pe/=2,_/=2}function me(ge,_e){return ce===1?ge[_e]:ge.readUInt16BE(_e*ce)}if(G){let ge=-1;for(re=_;rehe&&(_=he-pe),re=_;re>=0;re--){let ge=!0;for(let _e=0;_eG&&(F=G):F=G;const re=m.length;let ce;for(F>re/2&&(F=re/2),ce=0;ce>8,pe=ce%256,me.push(pe),me.push(he);return me}(m,u.length-_),u,_,F)}function k(u,m,_){return m===0&&_===u.length?r.fromByteArray(u):r.fromByteArray(u.slice(m,_))}function b(u,m,_){_=Math.min(u.length,_);const F=[];let G=m;for(;G<_;){const re=u[G];let ce=null,he=re>239?4:re>223?3:re>191?2:1;if(G+he<=_){let pe,me,ge,_e;switch(he){case 1:re<128&&(ce=re);break;case 2:pe=u[G+1],(192&pe)==128&&(_e=(31&re)<<6|63&pe,_e>127&&(ce=_e));break;case 3:pe=u[G+1],me=u[G+2],(192&pe)==128&&(192&me)==128&&(_e=(15&re)<<12|(63&pe)<<6|63&me,_e>2047&&(_e<55296||_e>57343)&&(ce=_e));break;case 4:pe=u[G+1],me=u[G+2],ge=u[G+3],(192&pe)==128&&(192&me)==128&&(192&ge)==128&&(_e=(15&re)<<18|(63&pe)<<12|(63&me)<<6|63&ge,_e>65535&&_e<1114112&&(ce=_e))}}ce===null?(ce=65533,he=1):ce>65535&&(ce-=65536,F.push(ce>>>10&1023|55296),ce=56320|1023&ce),F.push(ce),G+=he}return function(re){const ce=re.length;if(ce<=L)return String.fromCharCode.apply(String,re);let he="",pe=0;for(;pe"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}}),i.poolSize=8192,i.from=function(u,m,_){return o(u,m,_)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array),i.alloc=function(u,m,_){return function(F,G,re){return c(F),F<=0?d(F):G!==void 0?typeof re=="string"?d(F).fill(G,re):d(F).fill(G):d(F)}(u,m,_)},i.allocUnsafe=function(u){return p(u)},i.allocUnsafeSlow=function(u){return p(u)},i.isBuffer=function(u){return u!=null&&u._isBuffer===!0&&u!==i.prototype},i.compare=function(u,m){if(R(u,Uint8Array)&&(u=i.from(u,u.offset,u.byteLength)),R(m,Uint8Array)&&(m=i.from(m,m.offset,m.byteLength)),!i.isBuffer(u)||!i.isBuffer(m))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(u===m)return 0;let _=u.length,F=m.length;for(let G=0,re=Math.min(_,F);GF.length?(i.isBuffer(re)||(re=i.from(re)),re.copy(F,G)):Uint8Array.prototype.set.call(F,re,G);else{if(!i.isBuffer(re))throw new TypeError('"list" argument must be an Array of Buffers');re.copy(F,G)}G+=re.length}return F},i.byteLength=w,i.prototype._isBuffer=!0,i.prototype.swap16=function(){const u=this.length;if(u%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let m=0;mm&&(u+=" ... "),""},a&&(i.prototype[a]=i.prototype.inspect),i.prototype.compare=function(u,m,_,F,G){if(R(u,Uint8Array)&&(u=i.from(u,u.offset,u.byteLength)),!i.isBuffer(u))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof u);if(m===void 0&&(m=0),_===void 0&&(_=u?u.length:0),F===void 0&&(F=0),G===void 0&&(G=this.length),m<0||_>u.length||F<0||G>this.length)throw new RangeError("out of range index");if(F>=G&&m>=_)return 0;if(F>=G)return-1;if(m>=_)return 1;if(this===u)return 0;let re=(G>>>=0)-(F>>>=0),ce=(_>>>=0)-(m>>>=0);const he=Math.min(re,ce),pe=this.slice(F,G),me=u.slice(m,_);for(let ge=0;ge>>=0,isFinite(_)?(_>>>=0,F===void 0&&(F="utf8")):(F=_,_=void 0)}const G=this.length-m;if((_===void 0||_>G)&&(_=G),u.length>0&&(_<0||m<0)||m>this.length)throw new RangeError("Attempt to write outside buffer bounds");F||(F="utf8");let re=!1;for(;;)switch(F){case"hex":return Q(this,u,m,_);case"utf8":case"utf-8":return S(this,u,m,_);case"ascii":case"latin1":case"binary":return y(this,u,m,_);case"base64":return O(this,u,m,_);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,u,m,_);default:if(re)throw new TypeError("Unknown encoding: "+F);F=(""+F).toLowerCase(),re=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const L=4096;function N(u,m,_){let F="";_=Math.min(u.length,_);for(let G=m;G<_;++G)F+=String.fromCharCode(127&u[G]);return F}function K(u,m,_){let F="";_=Math.min(u.length,_);for(let G=m;G<_;++G)F+=String.fromCharCode(u[G]);return F}function se(u,m,_){const F=u.length;(!m||m<0)&&(m=0),(!_||_<0||_>F)&&(_=F);let G="";for(let re=m;re<_;++re)G+=Y[u[re]];return G}function q(u,m,_){const F=u.slice(m,_);let G="";for(let re=0;re_)throw new RangeError("Trying to access beyond buffer length")}function X(u,m,_,F,G,re){if(!i.isBuffer(u))throw new TypeError('"buffer" argument must be a Buffer instance');if(m>G||mu.length)throw new RangeError("Index out of range")}function I(u,m,_,F,G){le(m,F,G,u,_,7);let re=Number(m&BigInt(4294967295));u[_++]=re,re>>=8,u[_++]=re,re>>=8,u[_++]=re,re>>=8,u[_++]=re;let ce=Number(m>>BigInt(32)&BigInt(4294967295));return u[_++]=ce,ce>>=8,u[_++]=ce,ce>>=8,u[_++]=ce,ce>>=8,u[_++]=ce,_}function B(u,m,_,F,G){le(m,F,G,u,_,7);let re=Number(m&BigInt(4294967295));u[_+7]=re,re>>=8,u[_+6]=re,re>>=8,u[_+5]=re,re>>=8,u[_+4]=re;let ce=Number(m>>BigInt(32)&BigInt(4294967295));return u[_+3]=ce,ce>>=8,u[_+2]=ce,ce>>=8,u[_+1]=ce,ce>>=8,u[_]=ce,_+8}function U(u,m,_,F,G,re){if(_+F>u.length)throw new RangeError("Index out of range");if(_<0)throw new RangeError("Index out of range")}function P(u,m,_,F,G){return m=+m,_>>>=0,G||U(u,0,_,4),n.write(u,m,_,F,23,4),_+4}function J(u,m,_,F,G){return m=+m,_>>>=0,G||U(u,0,_,8),n.write(u,m,_,F,52,8),_+8}i.prototype.slice=function(u,m){const _=this.length;(u=~~u)<0?(u+=_)<0&&(u=0):u>_&&(u=_),(m=m===void 0?_:~~m)<0?(m+=_)<0&&(m=0):m>_&&(m=_),m>>=0,m>>>=0,_||C(u,m,this.length);let F=this[u],G=1,re=0;for(;++re>>=0,m>>>=0,_||C(u,m,this.length);let F=this[u+--m],G=1;for(;m>0&&(G*=256);)F+=this[u+--m]*G;return F},i.prototype.readUint8=i.prototype.readUInt8=function(u,m){return u>>>=0,m||C(u,1,this.length),this[u]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(u,m){return u>>>=0,m||C(u,2,this.length),this[u]|this[u+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(u,m){return u>>>=0,m||C(u,2,this.length),this[u]<<8|this[u+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(u,m){return u>>>=0,m||C(u,4,this.length),(this[u]|this[u+1]<<8|this[u+2]<<16)+16777216*this[u+3]},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(u,m){return u>>>=0,m||C(u,4,this.length),16777216*this[u]+(this[u+1]<<16|this[u+2]<<8|this[u+3])},i.prototype.readBigUInt64LE=ie(function(u){ee(u>>>=0,"offset");const m=this[u],_=this[u+7];m!==void 0&&_!==void 0||M(u,this.length-8);const F=m+256*this[++u]+65536*this[++u]+this[++u]*2**24,G=this[++u]+256*this[++u]+65536*this[++u]+_*2**24;return BigInt(F)+(BigInt(G)<>>=0,"offset");const m=this[u],_=this[u+7];m!==void 0&&_!==void 0||M(u,this.length-8);const F=m*2**24+65536*this[++u]+256*this[++u]+this[++u],G=this[++u]*2**24+65536*this[++u]+256*this[++u]+_;return(BigInt(F)<>>=0,m>>>=0,_||C(u,m,this.length);let F=this[u],G=1,re=0;for(;++re=G&&(F-=Math.pow(2,8*m)),F},i.prototype.readIntBE=function(u,m,_){u>>>=0,m>>>=0,_||C(u,m,this.length);let F=m,G=1,re=this[u+--F];for(;F>0&&(G*=256);)re+=this[u+--F]*G;return G*=128,re>=G&&(re-=Math.pow(2,8*m)),re},i.prototype.readInt8=function(u,m){return u>>>=0,m||C(u,1,this.length),128&this[u]?-1*(255-this[u]+1):this[u]},i.prototype.readInt16LE=function(u,m){u>>>=0,m||C(u,2,this.length);const _=this[u]|this[u+1]<<8;return 32768&_?4294901760|_:_},i.prototype.readInt16BE=function(u,m){u>>>=0,m||C(u,2,this.length);const _=this[u+1]|this[u]<<8;return 32768&_?4294901760|_:_},i.prototype.readInt32LE=function(u,m){return u>>>=0,m||C(u,4,this.length),this[u]|this[u+1]<<8|this[u+2]<<16|this[u+3]<<24},i.prototype.readInt32BE=function(u,m){return u>>>=0,m||C(u,4,this.length),this[u]<<24|this[u+1]<<16|this[u+2]<<8|this[u+3]},i.prototype.readBigInt64LE=ie(function(u){ee(u>>>=0,"offset");const m=this[u],_=this[u+7];m!==void 0&&_!==void 0||M(u,this.length-8);const F=this[u+4]+256*this[u+5]+65536*this[u+6]+(_<<24);return(BigInt(F)<>>=0,"offset");const m=this[u],_=this[u+7];m!==void 0&&_!==void 0||M(u,this.length-8);const F=(m<<24)+65536*this[++u]+256*this[++u]+this[++u];return(BigInt(F)<>>=0,m||C(u,4,this.length),n.read(this,u,!0,23,4)},i.prototype.readFloatBE=function(u,m){return u>>>=0,m||C(u,4,this.length),n.read(this,u,!1,23,4)},i.prototype.readDoubleLE=function(u,m){return u>>>=0,m||C(u,8,this.length),n.read(this,u,!0,52,8)},i.prototype.readDoubleBE=function(u,m){return u>>>=0,m||C(u,8,this.length),n.read(this,u,!1,52,8)},i.prototype.writeUintLE=i.prototype.writeUIntLE=function(u,m,_,F){u=+u,m>>>=0,_>>>=0,F||X(this,u,m,_,Math.pow(2,8*_)-1,0);let G=1,re=0;for(this[m]=255&u;++re<_&&(G*=256);)this[m+re]=u/G&255;return m+_},i.prototype.writeUintBE=i.prototype.writeUIntBE=function(u,m,_,F){u=+u,m>>>=0,_>>>=0,F||X(this,u,m,_,Math.pow(2,8*_)-1,0);let G=_-1,re=1;for(this[m+G]=255&u;--G>=0&&(re*=256);)this[m+G]=u/re&255;return m+_},i.prototype.writeUint8=i.prototype.writeUInt8=function(u,m,_){return u=+u,m>>>=0,_||X(this,u,m,1,255,0),this[m]=255&u,m+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(u,m,_){return u=+u,m>>>=0,_||X(this,u,m,2,65535,0),this[m]=255&u,this[m+1]=u>>>8,m+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(u,m,_){return u=+u,m>>>=0,_||X(this,u,m,2,65535,0),this[m]=u>>>8,this[m+1]=255&u,m+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(u,m,_){return u=+u,m>>>=0,_||X(this,u,m,4,4294967295,0),this[m+3]=u>>>24,this[m+2]=u>>>16,this[m+1]=u>>>8,this[m]=255&u,m+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(u,m,_){return u=+u,m>>>=0,_||X(this,u,m,4,4294967295,0),this[m]=u>>>24,this[m+1]=u>>>16,this[m+2]=u>>>8,this[m+3]=255&u,m+4},i.prototype.writeBigUInt64LE=ie(function(u,m=0){return I(this,u,m,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeBigUInt64BE=ie(function(u,m=0){return B(this,u,m,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeIntLE=function(u,m,_,F){if(u=+u,m>>>=0,!F){const he=Math.pow(2,8*_-1);X(this,u,m,_,he-1,-he)}let G=0,re=1,ce=0;for(this[m]=255&u;++G<_&&(re*=256);)u<0&&ce===0&&this[m+G-1]!==0&&(ce=1),this[m+G]=(u/re|0)-ce&255;return m+_},i.prototype.writeIntBE=function(u,m,_,F){if(u=+u,m>>>=0,!F){const he=Math.pow(2,8*_-1);X(this,u,m,_,he-1,-he)}let G=_-1,re=1,ce=0;for(this[m+G]=255&u;--G>=0&&(re*=256);)u<0&&ce===0&&this[m+G+1]!==0&&(ce=1),this[m+G]=(u/re|0)-ce&255;return m+_},i.prototype.writeInt8=function(u,m,_){return u=+u,m>>>=0,_||X(this,u,m,1,127,-128),u<0&&(u=255+u+1),this[m]=255&u,m+1},i.prototype.writeInt16LE=function(u,m,_){return u=+u,m>>>=0,_||X(this,u,m,2,32767,-32768),this[m]=255&u,this[m+1]=u>>>8,m+2},i.prototype.writeInt16BE=function(u,m,_){return u=+u,m>>>=0,_||X(this,u,m,2,32767,-32768),this[m]=u>>>8,this[m+1]=255&u,m+2},i.prototype.writeInt32LE=function(u,m,_){return u=+u,m>>>=0,_||X(this,u,m,4,2147483647,-2147483648),this[m]=255&u,this[m+1]=u>>>8,this[m+2]=u>>>16,this[m+3]=u>>>24,m+4},i.prototype.writeInt32BE=function(u,m,_){return u=+u,m>>>=0,_||X(this,u,m,4,2147483647,-2147483648),u<0&&(u=4294967295+u+1),this[m]=u>>>24,this[m+1]=u>>>16,this[m+2]=u>>>8,this[m+3]=255&u,m+4},i.prototype.writeBigInt64LE=ie(function(u,m=0){return I(this,u,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeBigInt64BE=ie(function(u,m=0){return B(this,u,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeFloatLE=function(u,m,_){return P(this,u,m,!0,_)},i.prototype.writeFloatBE=function(u,m,_){return P(this,u,m,!1,_)},i.prototype.writeDoubleLE=function(u,m,_){return J(this,u,m,!0,_)},i.prototype.writeDoubleBE=function(u,m,_){return J(this,u,m,!1,_)},i.prototype.copy=function(u,m,_,F){if(!i.isBuffer(u))throw new TypeError("argument should be a Buffer");if(_||(_=0),F||F===0||(F=this.length),m>=u.length&&(m=u.length),m||(m=0),F>0&&F<_&&(F=_),F===_||u.length===0||this.length===0)return 0;if(m<0)throw new RangeError("targetStart out of bounds");if(_<0||_>=this.length)throw new RangeError("Index out of range");if(F<0)throw new RangeError("sourceEnd out of bounds");F>this.length&&(F=this.length),u.length-m>>=0,_=_===void 0?this.length:_>>>0,u||(u=0),typeof u=="number")for(G=m;G<_;++G)this[G]=u;else{const re=i.isBuffer(u)?u:i.from(u,F),ce=re.length;if(ce===0)throw new TypeError('The value "'+u+'" is invalid for argument "value"');for(G=0;G<_-m;++G)this[G+m]=re[G%ce]}return this};const D={};function V(u,m,_){D[u]=class extends _{constructor(){super(),Object.defineProperty(this,"message",{value:m.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${u}]`,this.stack,delete this.name}get code(){return u}set code(F){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:F,writable:!0})}toString(){return`${this.name} [${u}]: ${this.message}`}}}function te(u){let m="",_=u.length;const F=u[0]==="-"?1:0;for(;_>=F+4;_-=3)m=`_${u.slice(_-3,_)}${m}`;return`${u.slice(0,_)}${m}`}function le(u,m,_,F,G,re){if(u>_||u3?m===0||m===BigInt(0)?`>= 0${ce} and < 2${ce} ** ${8*(re+1)}${ce}`:`>= -(2${ce} ** ${8*(re+1)-1}${ce}) and < 2 ** ${8*(re+1)-1}${ce}`:`>= ${m}${ce} and <= ${_}${ce}`,new D.ERR_OUT_OF_RANGE("value",he,u)}(function(ce,he,pe){ee(he,"offset"),ce[he]!==void 0&&ce[he+pe]!==void 0||M(he,ce.length-(pe+1))})(F,G,re)}function ee(u,m){if(typeof u!="number")throw new D.ERR_INVALID_ARG_TYPE(m,"number",u)}function M(u,m,_){throw Math.floor(u)!==u?(ee(u,_),new D.ERR_OUT_OF_RANGE(_||"offset","an integer",u)):m<0?new D.ERR_BUFFER_OUT_OF_BOUNDS:new D.ERR_OUT_OF_RANGE(_||"offset",`>= ${_?1:0} and <= ${m}`,u)}V("ERR_BUFFER_OUT_OF_BOUNDS",function(u){return u?`${u} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),V("ERR_INVALID_ARG_TYPE",function(u,m){return`The "${u}" argument must be of type number. Received type ${typeof m}`},TypeError),V("ERR_OUT_OF_RANGE",function(u,m,_){let F=`The value of "${u}" is out of range.`,G=_;return Number.isInteger(_)&&Math.abs(_)>2**32?G=te(String(_)):typeof _=="bigint"&&(G=String(_),(_>BigInt(2)**BigInt(32)||_<-(BigInt(2)**BigInt(32)))&&(G=te(G)),G+="n"),F+=` It must be ${m}. Received ${G}`,F},RangeError);const E=/[^+/0-9A-Za-z-_]/g;function W(u,m){let _;m=m||1/0;const F=u.length;let G=null;const re=[];for(let ce=0;ce55295&&_<57344){if(!G){if(_>56319){(m-=3)>-1&&re.push(239,191,189);continue}if(ce+1===F){(m-=3)>-1&&re.push(239,191,189);continue}G=_;continue}if(_<56320){(m-=3)>-1&&re.push(239,191,189),G=_;continue}_=65536+(G-55296<<10|_-56320)}else G&&(m-=3)>-1&&re.push(239,191,189);if(G=null,_<128){if((m-=1)<0)break;re.push(_)}else if(_<2048){if((m-=2)<0)break;re.push(_>>6|192,63&_|128)}else if(_<65536){if((m-=3)<0)break;re.push(_>>12|224,_>>6&63|128,63&_|128)}else{if(!(_<1114112))throw new Error("Invalid code point");if((m-=4)<0)break;re.push(_>>18|240,_>>12&63|128,_>>6&63|128,63&_|128)}}return re}function z(u){return r.toByteArray(function(m){if((m=(m=m.split("=")[0]).trim().replace(E,"")).length<2)return"";for(;m.length%4!=0;)m+="=";return m}(u))}function Z(u,m,_,F){let G;for(G=0;G=m.length||G>=u.length);++G)m[G+_]=u[G];return G}function R(u,m){return u instanceof m||u!=null&&u.constructor!=null&&u.constructor.name!=null&&u.constructor.name===m.name}function ne(u){return u!=u}const Y=function(){const u="0123456789abcdef",m=new Array(256);for(let _=0;_<16;++_){const F=16*_;for(let G=0;G<16;++G)m[F+G]=u[_]+u[G]}return m}();function ie(u){return typeof BigInt>"u"?oe:u}function oe(){throw new Error("BigInt not supported")}},2341:s=>{s.exports=function e(t){return t===null||typeof t!="object"||t.toJSON!=null?JSON.stringify(t):Array.isArray(t)?"["+t.reduce((r,n,a)=>r+(a===0?"":",")+e(n===void 0||typeof n=="symbol"?null:n),"")+"]":"{"+Object.keys(t).sort().reduce((r,n,a)=>t[n]===void 0||typeof t[n]=="symbol"?r:r+(r.length===0?"":",")+e(n)+":"+e(t[n]),"")+"}"}},7007:s=>{var e,t=typeof Reflect=="object"?Reflect:null,r=t&&typeof t.apply=="function"?t.apply:function(g,x,j){return Function.prototype.apply.call(g,x,j)};e=t&&typeof t.ownKeys=="function"?t.ownKeys:Object.getOwnPropertySymbols?function(g){return Object.getOwnPropertyNames(g).concat(Object.getOwnPropertySymbols(g))}:function(g){return Object.getOwnPropertyNames(g)};var n=Number.isNaN||function(g){return g!=g};function a(){a.init.call(this)}s.exports=a,s.exports.once=function(g,x){return new Promise(function(j,A){function Q(y){g.removeListener(x,S),A(y)}function S(){typeof g.removeListener=="function"&&g.removeListener("error",Q),j([].slice.call(arguments))}w(g,x,S,{once:!0}),x!=="error"&&function(y,O){typeof y.on=="function"&&w(y,"error",O,{once:!0})}(g,Q)})},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var l=10;function d(g){if(typeof g!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof g)}function i(g){return g._maxListeners===void 0?a.defaultMaxListeners:g._maxListeners}function o(g,x,j,A){var Q,S,y,O;if(d(j),(S=g._events)===void 0?(S=g._events=Object.create(null),g._eventsCount=0):(S.newListener!==void 0&&(g.emit("newListener",x,j.listener?j.listener:j),S=g._events),y=S[x]),y===void 0)y=S[x]=j,++g._eventsCount;else if(typeof y=="function"?y=S[x]=A?[j,y]:[y,j]:A?y.unshift(j):y.push(j),(Q=i(g))>0&&y.length>Q&&!y.warned){y.warned=!0;var T=new Error("Possible EventEmitter memory leak detected. "+y.length+" "+String(x)+" listeners added. Use emitter.setMaxListeners() to increase limit");T.name="MaxListenersExceededWarning",T.emitter=g,T.type=x,T.count=y.length,O=T,console&&console.warn&&console.warn(O)}return g}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(g,x,j){var A={fired:!1,wrapFn:void 0,target:g,type:x,listener:j},Q=c.bind(A);return Q.listener=j,A.wrapFn=Q,Q}function v(g,x,j){var A=g._events;if(A===void 0)return[];var Q=A[x];return Q===void 0?[]:typeof Q=="function"?j?[Q.listener||Q]:[Q]:j?function(S){for(var y=new Array(S.length),O=0;O0&&(S=x[0]),S instanceof Error)throw S;var y=new Error("Unhandled error."+(S?" ("+S.message+")":""));throw y.context=S,y}var O=Q[g];if(O===void 0)return!1;if(typeof O=="function")r(O,this,x);else{var T=O.length,k=h(O,T);for(j=0;j=0;S--)if(j[S]===x||j[S].listener===x){y=j[S].listener,Q=S;break}if(Q<0)return this;Q===0?j.shift():function(O,T){for(;T+1=0;A--)this.removeListener(g,x[A]);return this},a.prototype.listeners=function(g){return v(this,g,!0)},a.prototype.rawListeners=function(g){return v(this,g,!1)},a.listenerCount=function(g,x){return typeof g.listenerCount=="function"?g.listenerCount(x):f.call(g,x)},a.prototype.listenerCount=f,a.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},251:(s,e)=>{e.read=function(t,r,n,a,l){var d,i,o=8*l-a-1,c=(1<>1,v=-7,f=n?l-1:0,h=n?-1:1,w=t[r+f];for(f+=h,d=w&(1<<-v)-1,w>>=-v,v+=o;v>0;d=256*d+t[r+f],f+=h,v-=8);for(i=d&(1<<-v)-1,d>>=-v,v+=a;v>0;i=256*i+t[r+f],f+=h,v-=8);if(d===0)d=1-p;else{if(d===c)return i?NaN:1/0*(w?-1:1);i+=Math.pow(2,a),d-=p}return(w?-1:1)*i*Math.pow(2,d-a)},e.write=function(t,r,n,a,l,d){var i,o,c,p=8*d-l-1,v=(1<>1,h=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=a?0:d-1,g=a?1:-1,x=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(o=isNaN(r)?1:0,i=v):(i=Math.floor(Math.log(r)/Math.LN2),r*(c=Math.pow(2,-i))<1&&(i--,c*=2),(r+=i+f>=1?h/c:h*Math.pow(2,1-f))*c>=2&&(i++,c/=2),i+f>=v?(o=0,i=v):i+f>=1?(o=(r*c-1)*Math.pow(2,l),i+=f):(o=r*Math.pow(2,f-1)*Math.pow(2,l),i=0));l>=8;t[n+w]=255&o,w+=g,o/=256,l-=8);for(i=i<0;t[n+w]=255&i,w+=g,i/=256,p-=8);t[n+w-g]|=128*x}},7034:(s,e,t)=>{const{isArray:r,isObject:n,isString:a}=t(7382),{asArray:l}=t(9263),{prependBase:d}=t(470),i=t(2207),o=t(7532);function c(v){throw new i("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:v})}function p({context:v,base:f}){if(!v)return;const h=v["@context"];if(a(h))v["@context"]=d(f,h);else if(r(h))for(let w=0;w10)throw new i("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:v.processingMode==="json-ld-1.0"?"loading remote context failed":"context overflow",max:10});if(w.has(f))throw new i("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:v.processingMode==="json-ld-1.0"?"recursive context inclusion":"context overflow",url:f});let g,x;w.add(f);try{x=await h(f),g=x.document||null,a(g)&&(g=JSON.parse(g))}catch(j){throw new i("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:f,cause:j})}if(!n(g))throw new i("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:f});return g="@context"in g?{"@context":g["@context"]}:{"@context":{}},x.contextUrl&&(r(g["@context"])||(g["@context"]=[g["@context"]]),g["@context"].push(x.contextUrl)),{context:g,remoteDoc:x}}}},2207:s=>{s.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}}},5445:s=>{s.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(r,n){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(r,n)},t.expand=function(r){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(r)},t.flatten=function(r){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(r)},t}},8229:(s,e,t)=>{s.exports=t(989).NQuads},3743:s=>{s.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]}}}},7532:(s,e,t)=>{const r=t(9749);s.exports=class{constructor({document:n}){this.document=n,this.cache=new r({max:10})}getProcessed(n){return this.cache.get(n)}setProcessed(n,a){this.cache.set(n,a)}}},1058:(s,e,t)=>{const r=t(2207),{isArray:n,isObject:a,isString:l,isUndefined:d}=t(7382),{isList:i,isValue:o,isGraph:c,isSimpleGraph:p,isSubjectReference:v}=t(3978),{expandIri:f,getContextValue:h,isKeyword:w,process:g,processingMode:x}=t(1972),{removeBase:j,prependBase:A}=t(470),{REGEX_KEYWORD:Q,addValue:S,asArray:y,compareShortestLeast:O}=t(9263),T={};function k(b,L,N){if(f(b,L,{vocab:!0},N)!=="@nest")throw new r("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}s.exports=T,T.compact=async({activeCtx:b,activeProperty:L=null,element:N,options:K={}})=>{if(n(N)){let q=[];for(let C=0;C1&&(B=Array.from(B).sort());const U=b;for(const J of B){const D=T.compactIri({activeCtx:U,iri:J,relativeTo:{vocab:!0}}),V=h(X,D,"@context");d(V)||(b=await g({activeCtx:b,localCtx:V,options:K,propagate:!1}))}const P=Object.keys(N).sort();for(const J of P){const D=N[J];if(J!=="@id")if(J!=="@type")if(J!=="@reverse")if(J!=="@preserve")if(J!=="@index")if(J!=="@graph"&&J!=="@list"&&J!=="@included"&&w(J)){const V=T.compactIri({activeCtx:b,iri:J,relativeTo:{vocab:!0}});S(C,V,D)}else{if(!n(D))throw new r("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(D.length===0){const V=T.compactIri({activeCtx:b,iri:J,value:D,relativeTo:{vocab:!0},reverse:q}),te=b.mappings.has(V)?b.mappings.get(V)["@nest"]:null;let le=C;te&&(k(b,te,K),a(C[te])||(C[te]={}),le=C[te]),S(le,V,D,{propertyIsArray:!0})}for(const V of D){const te=T.compactIri({activeCtx:b,iri:J,value:V,relativeTo:{vocab:!0},reverse:q}),le=b.mappings.has(te)?b.mappings.get(te)["@nest"]:null;let ee=C;le&&(k(b,le,K),a(C[le])||(C[le]={}),ee=C[le]);const M=h(b,te,"@container")||[],E=c(V),W=i(V);let z;W?z=V["@list"]:E&&(z=V["@graph"]);let Z=await T.compact({activeCtx:b,activeProperty:te,element:W||E?z:V,options:K});if(W){if(n(Z)||(Z=[Z]),M.includes("@list")){S(ee,te,Z,{valueIsArray:!0,allowDuplicate:!0});continue}Z={[T.compactIri({activeCtx:b,iri:"@list",relativeTo:{vocab:!0}})]:Z},"@index"in V&&(Z[T.compactIri({activeCtx:b,iri:"@index",relativeTo:{vocab:!0}})]=V["@index"])}if(E)if(M.includes("@graph")&&(M.includes("@id")||M.includes("@index")&&p(V))){let R;ee.hasOwnProperty(te)?R=ee[te]:ee[te]=R={};const ne=(M.includes("@id")?V["@id"]:V["@index"])||T.compactIri({activeCtx:b,iri:"@none",relativeTo:{vocab:!0}});S(R,ne,Z,{propertyIsArray:!K.compactArrays||M.includes("@set")})}else M.includes("@graph")&&p(V)?(n(Z)&&Z.length>1&&(Z={"@included":Z}),S(ee,te,Z,{propertyIsArray:!K.compactArrays||M.includes("@set")})):(n(Z)&&Z.length===1&&K.compactArrays&&(Z=Z[0]),Z={[T.compactIri({activeCtx:b,iri:"@graph",relativeTo:{vocab:!0}})]:Z},"@id"in V&&(Z[T.compactIri({activeCtx:b,iri:"@id",relativeTo:{vocab:!0}})]=V["@id"]),"@index"in V&&(Z[T.compactIri({activeCtx:b,iri:"@index",relativeTo:{vocab:!0}})]=V["@index"]),S(ee,te,Z,{propertyIsArray:!K.compactArrays||M.includes("@set")}));else if(M.includes("@language")||M.includes("@index")||M.includes("@id")||M.includes("@type")){let R,ne;if(ee.hasOwnProperty(te)?R=ee[te]:ee[te]=R={},M.includes("@language"))o(Z)&&(Z=Z["@value"]),ne=V["@language"];else if(M.includes("@index")){const Y=h(b,te,"@index")||"@index",ie=T.compactIri({activeCtx:b,iri:Y,relativeTo:{vocab:!0}});if(Y==="@index")ne=V["@index"],delete Z[ie];else{let oe;if([ne,...oe]=y(Z[Y]||[]),l(ne))switch(oe.length){case 0:delete Z[Y];break;case 1:Z[Y]=oe[0];break;default:Z[Y]=oe}else ne=null}}else if(M.includes("@id")){const Y=T.compactIri({activeCtx:b,iri:"@id",relativeTo:{vocab:!0}});ne=Z[Y],delete Z[Y]}else if(M.includes("@type")){const Y=T.compactIri({activeCtx:b,iri:"@type",relativeTo:{vocab:!0}});let ie;switch([ne,...ie]=y(Z[Y]||[]),ie.length){case 0:delete Z[Y];break;case 1:Z[Y]=ie[0];break;default:Z[Y]=ie}Object.keys(Z).length===1&&"@id"in V&&(Z=await T.compact({activeCtx:b,activeProperty:te,element:{"@id":V["@id"]},options:K}))}ne||(ne=T.compactIri({activeCtx:b,iri:"@none",relativeTo:{vocab:!0}})),S(R,ne,Z,{propertyIsArray:M.includes("@set")})}else{const R=!K.compactArrays||M.includes("@set")||M.includes("@list")||n(Z)&&Z.length===0||J==="@list"||J==="@graph";S(ee,te,Z,{propertyIsArray:R})}}}else{if((h(b,L,"@container")||[]).includes("@index"))continue;const V=T.compactIri({activeCtx:b,iri:J,relativeTo:{vocab:!0}});S(C,V,D)}else{const V=await T.compact({activeCtx:b,activeProperty:L,element:D,options:K});n(V)&&V.length===0||S(C,J,V)}else{const V=await T.compact({activeCtx:b,activeProperty:"@reverse",element:D,options:K});for(const te in V)if(b.mappings.has(te)&&b.mappings.get(te).reverse){const le=V[te],ee=(h(b,te,"@container")||[]).includes("@set")||!K.compactArrays;S(C,te,le,{propertyIsArray:ee}),delete V[te]}if(Object.keys(V).length>0){const te=T.compactIri({activeCtx:b,iri:J,relativeTo:{vocab:!0}});S(C,te,V)}}else{let V=y(D).map(ee=>T.compactIri({activeCtx:X,iri:ee,relativeTo:{vocab:!0}}));V.length===1&&(V=V[0]);const te=T.compactIri({activeCtx:b,iri:"@type",relativeTo:{vocab:!0}}),le=(h(b,te,"@container")||[]).includes("@set")&&x(b,1.1)||n(V)&&D.length===0;S(C,te,V,{propertyIsArray:le})}else{let V=y(D).map(te=>T.compactIri({activeCtx:b,iri:te,relativeTo:{vocab:!1},base:K.base}));V.length===1&&(V=V[0]),C[T.compactIri({activeCtx:b,iri:"@id",relativeTo:{vocab:!0}})]=V}}return C}return N},T.compactIri=({activeCtx:b,iri:L,value:N=null,relativeTo:K={vocab:!1},reverse:se=!1,base:q=null})=>{if(L===null)return L;b.isPropertyTermScoped&&b.previousContext&&(b=b.previousContext);const C=b.getInverse();if(w(L)&&L in C&&"@none"in C[L]&&"@type"in C[L]["@none"]&&"@none"in C[L]["@none"]["@type"])return C[L]["@none"]["@type"]["@none"];if(K.vocab&&L in C){const P=b["@language"]||"@none",J=[];a(N)&&"@index"in N&&!("@graph"in N)&&J.push("@index","@index@set"),a(N)&&"@preserve"in N&&(N=N["@preserve"][0]),c(N)?("@index"in N&&J.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in N&&J.push("@graph@id","@graph@id@set"),J.push("@graph","@graph@set","@set"),"@index"in N||J.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in N||J.push("@graph@id","@graph@id@set")):a(N)&&!o(N)&&J.push("@id","@id@set","@type","@set@type");let D="@language",V="@null";if(se)D="@type",V="@reverse",J.push("@set");else if(i(N)){"@index"in N||J.push("@list");const le=N["@list"];if(le.length===0)D="@any",V="@none";else{let ee=le.length===0?P:null,M=null;for(let E=0;EY.includes("_"));ne&&Z.push(ne.replace(/^[^_]+_/,"_"))}Z.push("@none");const R=le.inverse[ee];for(const ne of E){if(!(ne in R))continue;const Y=R[ne][W];for(const ie of Z)if(ie in Y)return Y[ie]}return null}(b,L,N,J,D,V);if(te!==null)return te}if(K.vocab&&"@vocab"in b){const P=b["@vocab"];if(L.indexOf(P)===0&&L!==P){const J=L.substr(P.length);if(!b.mappings.has(J))return J}}let X=null;const I=[];let B=b.fastCurieMap;const U=L.length-1;for(let P=0;P=0;--P){const J=I[P],D=J.terms;for(const V of D){const te=V+":"+L.substr(J.iri.length);b.mappings.get(V)._prefix&&(!b.mappings.has(te)||N===null&&b.mappings.get(te)["@id"]===L)&&(X===null||O(te,X)<0)&&(X=te)}}if(X!==null)return X;for(const[P,J]of b.mappings)if(J&&J._prefix&&L.startsWith(P+":"))throw new r(`Absolute IRI "${L}" confused with prefix "${P}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:b});if(!K.vocab){if("@base"in b){if(b["@base"]){const P=j(A(q,b["@base"]),L);return Q.test(P)?`./${P}`:P}return L}return j(q,L)}return L},T.compactValue=({activeCtx:b,activeProperty:L,value:N,options:K})=>{if(o(N)){const X=h(b,L,"@type"),I=h(b,L,"@language"),B=h(b,L,"@direction"),U=h(b,L,"@container")||[],P="@index"in N&&!U.includes("@index");if(!P&&X!=="@none"&&(N["@type"]===X||"@language"in N&&N["@language"]===I&&"@direction"in N&&N["@direction"]===B||"@language"in N&&N["@language"]===I||"@direction"in N&&N["@direction"]===B))return N["@value"];const J=Object.keys(N).length,D=J===1||J===2&&"@index"in N&&!P,V="@language"in b,te=l(N["@value"]),le=b.mappings.has(L)&&b.mappings.get(L)["@language"]===null;if(D&&X!=="@none"&&(!V||!te||le))return N["@value"];const ee={};return P&&(ee[T.compactIri({activeCtx:b,iri:"@index",relativeTo:{vocab:!0}})]=N["@index"]),"@type"in N?ee[T.compactIri({activeCtx:b,iri:"@type",relativeTo:{vocab:!0}})]=T.compactIri({activeCtx:b,iri:N["@type"],relativeTo:{vocab:!0}}):"@language"in N&&(ee[T.compactIri({activeCtx:b,iri:"@language",relativeTo:{vocab:!0}})]=N["@language"]),"@direction"in N&&(ee[T.compactIri({activeCtx:b,iri:"@direction",relativeTo:{vocab:!0}})]=N["@direction"]),ee[T.compactIri({activeCtx:b,iri:"@value",relativeTo:{vocab:!0}})]=N["@value"],ee}const se=f(b,L,{vocab:!0},K),q=h(b,L,"@type"),C=T.compactIri({activeCtx:b,iri:N["@id"],relativeTo:{vocab:q==="@vocab"},base:K.base});return q==="@id"||q==="@vocab"||se==="@graph"?C:{[T.compactIri({activeCtx:b,iri:"@id",relativeTo:{vocab:!0}})]:C}}},9378:s=>{const e="http://www.w3.org/1999/02/22-rdf-syntax-ns#",t="http://www.w3.org/2001/XMLSchema#";s.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:e,RDF_LIST:e+"List",RDF_FIRST:e+"first",RDF_REST:e+"rest",RDF_NIL:e+"nil",RDF_TYPE:e+"type",RDF_PLAIN_LITERAL:e+"PlainLiteral",RDF_XML_LITERAL:e+"XMLLiteral",RDF_JSON_LITERAL:e+"JSON",RDF_OBJECT:e+"object",RDF_LANGSTRING:e+"langString",XSD:t,XSD_BOOLEAN:t+"boolean",XSD_DOUBLE:t+"double",XSD_INTEGER:t+"integer",XSD_STRING:t+"string"}},1972:(s,e,t)=>{const r=t(9263),n=t(2207),{isArray:a,isObject:l,isString:d,isUndefined:i}=t(7382),{isAbsolute:o,isRelative:c,prependBase:p}=t(470),{handleEvent:v}=t(2246),{REGEX_BCP47:f,REGEX_KEYWORD:h,asArray:w,compareShortestLeast:g}=t(9263),x=new Map,j={};function A(S,y,O,T,k,b){if(y===null||!d(y)||j.isKeyword(y))return y;if(y.match(h))return null;if(T&&T.hasOwnProperty(y)&&k.get(y)!==!0&&j.createTermDefinition({activeCtx:S,localCtx:T,term:y,defined:k,options:b}),(O=O||{}).vocab){const N=S.mappings.get(y);if(N===null)return null;if(l(N)&&"@id"in N)return N["@id"]}const L=y.indexOf(":");if(L>0){const N=y.substr(0,L),K=y.substr(L+1);if(N==="_"||K.indexOf("//")===0)return y;T&&T.hasOwnProperty(N)&&j.createTermDefinition({activeCtx:S,localCtx:T,term:N,defined:k,options:b});const se=S.mappings.get(N);if(se&&se._prefix)return se["@id"]+K;if(o(y))return y}if(O.vocab&&"@vocab"in S)y=S["@vocab"]+y;else if(O.base){let N,K;"@base"in S?S["@base"]?(K=p(b.base,S["@base"]),N=p(K,y)):(K=S["@base"],N=y):(K=b.base,N=p(b.base,y)),y=N}return y}function Q(S,y){if(!S||typeof S!="object"||!y||typeof y!="object")return S===y;const O=Array.isArray(S);if(O!==Array.isArray(y))return!1;if(O){if(S.length!==y.length)return!1;for(let b=0;b{if(l(y)&&"@context"in y&&a(y["@context"])&&(y=y["@context"]),w(y).length===0)return S;const L=[],N=[({event:C,next:X})=>{L.push(C),X()}];O.eventHandler&&N.push(O.eventHandler);const K=O;O={...O,eventHandler:N};const se=await O.contextResolver.resolve({activeCtx:S,context:y,documentLoader:O.documentLoader,base:O.base});l(se[0].document)&&typeof se[0].document["@propagate"]=="boolean"&&(T=se[0].document["@propagate"]);let q=S;T||q.previousContext||(q=q.clone(),q.previousContext=S);for(const C of se){let{document:X}=C;if(S=q,X===null){if(!k&&Object.keys(S.protected).length!==0)throw new n("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});q=S=j.getInitialContext(O).clone();continue}const I=C.getProcessed(S);if(I){if(K.eventHandler)for(const U of I.events)v({event:U,options:K});q=S=I.context;continue}if(l(X)&&"@context"in X&&(X=X["@context"]),!l(X))throw new n("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:X});q=q.clone();const B=new Map;if("@version"in X){if(X["@version"]!==1.1)throw new n("Unsupported JSON-LD version: "+X["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:X});if(S.processingMode&&S.processingMode==="json-ld-1.0")throw new n("@version: "+X["@version"]+" not compatible with "+S.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:X});q.processingMode="json-ld-1.1",q["@version"]=X["@version"],B.set("@version",!0)}if(q.processingMode=q.processingMode||S.processingMode,"@base"in X){let U=X["@base"];if(!(U===null||o(U))){if(!c(U))throw new n('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:X});U=p(q["@base"],U)}q["@base"]=U,B.set("@base",!0)}if("@vocab"in X){const U=X["@vocab"];if(U===null)delete q["@vocab"];else{if(!d(U))throw new n('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:X});if(!o(U)&&j.processingMode(q,1))throw new n('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:X});{const P=A(q,U,{vocab:!0,base:!0},void 0,void 0,O);o(P)||O.eventHandler&&v({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:P}},options:O}),q["@vocab"]=P}}B.set("@vocab",!0)}if("@language"in X){const U=X["@language"];if(U===null)delete q["@language"];else{if(!d(U))throw new n('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:X});U.match(f)||O.eventHandler&&v({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:U}},options:O}),q["@language"]=U.toLowerCase()}B.set("@language",!0)}if("@direction"in X){const U=X["@direction"];if(S.processingMode==="json-ld-1.0")throw new n("Invalid JSON-LD syntax; @direction not compatible with "+S.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:X});if(U===null)delete q["@direction"];else{if(U!=="ltr"&&U!=="rtl")throw new n('Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:X});q["@direction"]=U}B.set("@direction",!0)}if("@propagate"in X){const U=X["@propagate"];if(S.processingMode==="json-ld-1.0")throw new n("Invalid JSON-LD syntax; @propagate not compatible with "+S.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:X});if(typeof U!="boolean")throw new n("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:y});B.set("@propagate",!0)}if("@import"in X){const U=X["@import"];if(S.processingMode==="json-ld-1.0")throw new n("Invalid JSON-LD syntax; @import not compatible with "+S.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:X});if(!d(U))throw new n("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:y});const P=await O.contextResolver.resolve({activeCtx:S,context:U,documentLoader:O.documentLoader,base:O.base});if(P.length!==1)throw new n("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:y});const J=P[0].getProcessed(S);if(J)X=J;else{const D=P[0].document;if("@import"in D)throw new n("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:y});for(const V in D)X.hasOwnProperty(V)||(X[V]=D[V]);P[0].setProcessed(S,X)}B.set("@import",!0)}B.set("@protected",X["@protected"]||!1);for(const U in X)if(j.createTermDefinition({activeCtx:q,localCtx:X,term:U,defined:B,options:O,overrideProtected:k}),l(X[U])&&"@context"in X[U]){const P=X[U]["@context"];let J=!0;if(d(P)){const D=p(O.base,P);b.has(D)?J=!1:b.add(D)}if(J)try{await j.process({activeCtx:q.clone(),localCtx:X[U]["@context"],overrideProtected:!0,options:O,cycles:b})}catch{throw new n("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:X[U]["@context"],term:U})}}C.setProcessed(S,{context:q,events:L})}return q},j.createTermDefinition=({activeCtx:S,localCtx:y,term:O,defined:T,options:k,overrideProtected:b=!1})=>{if(T.has(O)){if(T.get(O))return;throw new n("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:y,term:O})}let L;if(T.set(O,!1),y.hasOwnProperty(O)&&(L=y[O]),O==="@type"&&l(L)&&(L["@container"]||"@set")==="@set"&&j.processingMode(S,1.1)){const I=["@container","@id","@protected"],B=Object.keys(L);if(B.length===0||B.some(U=>!I.includes(U)))throw new n("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:y,term:O})}else{if(j.isKeyword(O))throw new n("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:y,term:O});if(O.match(h))return void(k.eventHandler&&v({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:O}},options:k}));if(O==="")throw new n("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:y})}const N=S.mappings.get(O);S.mappings.has(O)&&S.mappings.delete(O);let K=!1;if((d(L)||L===null)&&(K=!0,L={"@id":L}),!l(L))throw new n("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:y});const se={};S.mappings.set(O,se),se.reverse=!1;const q=["@container","@id","@language","@reverse","@type"];j.processingMode(S,1.1)&&q.push("@context","@direction","@index","@nest","@prefix","@protected");for(const I in L)if(!q.includes(I))throw new n("Invalid JSON-LD syntax; a term definition must not contain "+I,"jsonld.SyntaxError",{code:"invalid term definition",context:y});const C=O.indexOf(":");if(se._termHasColon=C>0,"@reverse"in L){if("@id"in L)throw new n("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:y});if("@nest"in L)throw new n("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:y});const I=L["@reverse"];if(!d(I))throw new n("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y});if(I.match(h))return k.eventHandler&&v({event:{type:["JsonLdEvent"],code:"reserved @reverse value",level:"warning",message:'@reverse values beginning with "@" are reserved for future use and dropped.',details:{reverse:I}},options:k}),void(N?S.mappings.set(O,N):S.mappings.delete(O));const B=A(S,I,{vocab:!0,base:!1},y,T,k);if(!o(B))throw new n("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:y});se["@id"]=B,se.reverse=!0}else if("@id"in L){let I=L["@id"];if(I&&!d(I))throw new n("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y});if(I===null)se["@id"]=null;else{if(!j.isKeyword(I)&&I.match(h))return k.eventHandler&&v({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:'@id values beginning with "@" are reserved for future use and dropped.',details:{id:I}},options:k}),void(N?S.mappings.set(O,N):S.mappings.delete(O));if(I!==O){if(I=A(S,I,{vocab:!0,base:!1},y,T,k),!o(I)&&!j.isKeyword(I))throw new n("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:y});if(O.match(/(?::[^:])|\//)&&A(S,O,{vocab:!0,base:!1},y,new Map(T).set(O,!0),k)!==I)throw new n("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y});se["@id"]=I,se._prefix=K&&!se._termHasColon&&I.match(/[:\/\?#\[\]@]$/)!==null}}}if(!("@id"in se))if(se._termHasColon){const I=O.substr(0,C);if(y.hasOwnProperty(I)&&j.createTermDefinition({activeCtx:S,localCtx:y,term:I,defined:T,options:k}),S.mappings.has(I)){const B=O.substr(C+1);se["@id"]=S.mappings.get(I)["@id"]+B}else se["@id"]=O}else if(O==="@type")se["@id"]=O;else{if(!("@vocab"in S))throw new n("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y,term:O});se["@id"]=S["@vocab"]+O}if((L["@protected"]===!0||T.get("@protected")===!0&&L["@protected"]!==!1)&&(S.protected[O]=!0,se.protected=!0),T.set(O,!0),"@type"in L){let I=L["@type"];if(!d(I))throw new n("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:y});if(I==="@json"||I==="@none"){if(j.processingMode(S,1))throw new n(`Invalid JSON-LD syntax; an @context @type value must not be "${I}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:y})}else if(I!=="@id"&&I!=="@vocab"){if(I=A(S,I,{vocab:!0,base:!1},y,T,k),!o(I))throw new n("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:y});if(I.indexOf("_:")===0)throw new n("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:y})}se["@type"]=I}if("@container"in L){const I=d(L["@container"])?[L["@container"]]:L["@container"]||[],B=["@list","@set","@index","@language"];let U=!0;const P=I.includes("@set");if(j.processingMode(S,1.1)){if(B.push("@graph","@id","@type"),I.includes("@list")){if(I.length!==1)throw new n("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:y})}else if(I.includes("@graph")){if(I.some(J=>J!=="@graph"&&J!=="@id"&&J!=="@index"&&J!=="@set"))throw new n("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:y})}else U&=I.length<=(P?2:1);if(I.includes("@type")&&(se["@type"]=se["@type"]||"@id",!["@id","@vocab"].includes(se["@type"])))throw new n("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:y})}else U&=!a(L["@container"]),U&=I.length<=1;if(U&=I.every(J=>B.includes(J)),U&=!(P&&I.includes("@list")),!U)throw new n("Invalid JSON-LD syntax; @context @container value must be one of the following: "+B.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:y});if(se.reverse&&!I.every(J=>["@index","@set"].includes(J)))throw new n("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:y});se["@container"]=I}if("@index"in L){if(!("@container"in L)||!se["@container"].includes("@index"))throw new n(`Invalid JSON-LD syntax; @index without @index in @container: "${L["@index"]}" on term "${O}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:y});if(!d(L["@index"])||L["@index"].indexOf("@")===0)throw new n(`Invalid JSON-LD syntax; @index must expand to an IRI: "${L["@index"]}" on term "${O}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:y});se["@index"]=L["@index"]}if("@context"in L&&(se["@context"]=L["@context"]),"@language"in L&&!("@type"in L)){let I=L["@language"];if(I!==null&&!d(I))throw new n("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:y});I!==null&&(I=I.toLowerCase()),se["@language"]=I}if("@prefix"in L){if(O.match(/:|\//))throw new n("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:y});if(j.isKeyword(se["@id"]))throw new n("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:y});if(typeof L["@prefix"]!="boolean")throw new n("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:y});se._prefix=L["@prefix"]===!0}if("@direction"in L){const I=L["@direction"];if(I!==null&&I!=="ltr"&&I!=="rtl")throw new n('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:y});se["@direction"]=I}if("@nest"in L){const I=L["@nest"];if(!d(I)||I!=="@nest"&&I.indexOf("@")===0)throw new n("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:y});se["@nest"]=I}const X=se["@id"];if(X==="@context"||X==="@preserve")throw new n("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:y});if(N&&N.protected&&!b&&(S.protected[O]=!0,se.protected=!0,!Q(N,se)))throw new n("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:y,term:O})},j.expandIri=(S,y,O,T)=>A(S,y,O,void 0,void 0,T),j.getInitialContext=S=>{const y=JSON.stringify({processingMode:S.processingMode}),O=x.get(y);if(O)return O;const T={processingMode:S.processingMode,mappings:new Map,inverse:null,getInverse:function(){const L=this;if(L.inverse)return L.inverse;const N=L.inverse={},K=L.fastCurieMap={},se={},q=(L["@language"]||"@none").toLowerCase(),C=L["@direction"],X=L.mappings,I=[...X.keys()].sort(g);for(const B of I){const U=X.get(B);if(U===null)continue;let P=U["@container"]||"@none";if(P=[].concat(P).sort().join(""),U["@id"]===null)continue;const J=w(U["@id"]);for(const D of J){let V=N[D];const te=j.isKeyword(D);if(V)te||U._termHasColon||se[D].push(B);else if(N[D]=V={},!te&&!U._termHasColon){se[D]=[B];const le={iri:D,terms:se[D]};D[0]in K?K[D[0]].push(le):K[D[0]]=[le]}if(V[P]||(V[P]={"@language":{},"@type":{},"@any":{}}),V=V[P],b(B,V["@any"],"@none"),U.reverse)b(B,V["@type"],"@reverse");else if(U["@type"]==="@none")b(B,V["@any"],"@none"),b(B,V["@language"],"@none"),b(B,V["@type"],"@none");else if("@type"in U)b(B,V["@type"],U["@type"]);else if("@language"in U&&"@direction"in U){const le=U["@language"],ee=U["@direction"];b(B,V["@language"],le&&ee?`${le}_${ee}`.toLowerCase():le?le.toLowerCase():ee?`_${ee}`:"@null")}else"@language"in U?b(B,V["@language"],(U["@language"]||"@null").toLowerCase()):"@direction"in U?U["@direction"]?b(B,V["@language"],`_${U["@direction"]}`):b(B,V["@language"],"@none"):C?(b(B,V["@language"],`_${C}`),b(B,V["@language"],"@none"),b(B,V["@type"],"@none")):(b(B,V["@language"],q),b(B,V["@language"],"@none"),b(B,V["@type"],"@none"))}}for(const B in K)k(K,B,1);return N},clone:function(){const L={};return L.mappings=r.clone(this.mappings),L.clone=this.clone,L.inverse=null,L.getInverse=this.getInverse,L.protected=r.clone(this.protected),this.previousContext&&(L.previousContext=this.previousContext.clone()),L.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(L["@base"]=this["@base"]),"@language"in this&&(L["@language"]=this["@language"]),"@vocab"in this&&(L["@vocab"]=this["@vocab"]),L},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return x.size===1e4&&x.clear(),x.set(y,T),T;function k(L,N,K){const se=L[N],q=L[N]={};let C,X;for(const I of se)C=I.iri,X=K>=C.length?"":C[K],X in q?q[X].push(I):q[X]=[I];for(const I in q)I!==""&&k(q,I,K+1)}function b(L,N,K){N.hasOwnProperty(K)||(N[K]=L)}},j.getContextValue=(S,y,O)=>{if(y===null)return O==="@context"?void 0:null;if(S.mappings.has(y)){const T=S.mappings.get(y);if(i(O))return T;if(T.hasOwnProperty(O))return T[O]}return O==="@language"&&O in S||O==="@direction"&&O in S?S[O]:O!=="@context"?null:void 0},j.processingMode=(S,y)=>y.toString()>="1.1"?!S.processingMode||S.processingMode>="json-ld-"+y.toString():S.processingMode==="json-ld-1.0",j.isKeyword=S=>{if(!d(S)||S[0]!=="@")return!1;switch(S){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}},6957:(s,e,t)=>{const{parseLinkHeader:r,buildHeaders:n}=t(9263),{LINK_HEADER_CONTEXT:a}=t(9378),l=t(2207),d=t(3743),{prependBase:i}=t(470),o=/(^|(\r\n))link:/i;s.exports=({secure:c,headers:p={},xhr:v}={headers:{}})=>(p=n(p),new d().wrapLoader(async function f(h){if(h.indexOf("http:")!==0&&h.indexOf("https:")!==0)throw new l('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:h});if(c&&h.indexOf("https")!==0)throw new l(`URL could not be dereferenced; secure mode is enabled and the URL's scheme is not "https".`,"jsonld.InvalidUrl",{code:"loading document failed",url:h});let w;try{w=await function(Q,S,y){const O=new(Q=Q||XMLHttpRequest);return new Promise((T,k)=>{O.onload=()=>T(O),O.onerror=b=>k(b),O.open("GET",S,!0);for(const b in y)O.setRequestHeader(b,y[b]);O.send()})}(v,h,p)}catch(Q){throw new l("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:h,cause:Q})}if(w.status>=400)throw new l("URL could not be dereferenced: "+w.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:h,httpStatusCode:w.status});let g={contextUrl:null,documentUrl:h,document:w.response},x=null;const j=w.getResponseHeader("Content-Type");let A;if(o.test(w.getAllResponseHeaders())&&(A=w.getResponseHeader("Link")),A&&j!=="application/ld+json"){const Q=r(A),S=Q[a];if(Array.isArray(S))throw new l("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:h});S&&(g.contextUrl=S.target),x=Q.alternate,x&&x.type=="application/ld+json"&&!(j||"").match(/^application\/(\w*\+)?json$/)&&(g=await f(i(h,x.target)))}return g}))},2246:(s,e,t)=>{const r=t(2207),{isArray:n}=t(7382),{asArray:a}=t(9263),l={};function d({event:o,handlers:c}){let p=!0;for(let v=0;p&&v{p=!0}});else{if(typeof f!="object")throw new r("Invalid event handler.","jsonld.InvalidEventHandler",{event:o});o.code in f?f[o.code]({event:o,next:()=>{p=!0}}):p=!0}}return p}s.exports=l,l.defaultEventHandler=null,l.setupEventHandler=({options:o={}})=>{const c=[].concat(o.safe?l.safeEventHandler:[],o.eventHandler?a(o.eventHandler):[],l.defaultEventHandler?l.defaultEventHandler:[]);return c.length===0?null:c},l.handleEvent=({event:o,options:c})=>{d({event:o,handlers:c.eventHandler})};const i=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"]);l.safeEventHandler=function({event:o,next:c}){if(o.level==="warning"&&i.has(o.code))throw new r("Safe mode validation error.","jsonld.ValidationError",{event:o});c()},l.logEventHandler=function({event:o,next:c}){console.log(`EVENT: ${o.message}`,{event:o}),c()},l.logWarningEventHandler=function({event:o,next:c}){o.level==="warning"&&console.warn(`WARNING: ${o.message}`,{event:o}),c()},l.unhandledEventHandler=function({event:o}){throw new r("No handler for event.","jsonld.UnhandledEvent",{event:o})},l.setDefaultEventHandler=function({eventHandler:o}={}){l.defaultEventHandler=o?a(o):null}},4019:(s,e,t)=>{const r=t(2207),{isArray:n,isObject:a,isEmptyObject:l,isString:d,isUndefined:i}=t(7382),{isList:o,isValue:c,isGraph:p,isSubject:v}=t(3978),{expandIri:f,getContextValue:h,isKeyword:w,process:g,processingMode:x}=t(1972),{isAbsolute:j}=t(470),{REGEX_BCP47:A,REGEX_KEYWORD:Q,addValue:S,asArray:y,getValues:O,validateTypeValue:T}=t(9263),{handleEvent:k}=t(2246),b={};function L({value:C,count:X,options:I}){if(X===0||"@value"in C||"@list"in C||X===1&&"@id"in C){if(I.eventHandler){let B,U;X===0?(B="empty object",U="Dropping empty object."):"@value"in C?(B="object with only @value",U="Dropping object with only @value."):"@list"in C?(B="object with only @list",U="Dropping object with only @list."):X===1&&"@id"in C&&(B="object with only @id",U="Dropping object with only @id."),k({event:{type:["JsonLdEvent"],code:B,level:"warning",message:U,details:{value:C}},options:I})}return null}return C}async function N({activeCtx:C,activeProperty:X,expandedActiveProperty:I,element:B,expandedParent:U,options:P={},insideList:J,typeKey:D,typeScopedContext:V}){const te=Object.keys(B).sort(),le=[];let ee;const M=B[D]&&f(C,n(B[D])?B[D][0]:B[D],{vocab:!0},{...P,typeExpansion:!0})==="@json";for(const E of te){let W,z=B[E];if(E==="@context")continue;const Z=f(C,E,{vocab:!0},P);if(Z===null||!j(Z)&&!w(Z)){P.eventHandler&&k({event:{type:["JsonLdEvent"],code:"invalid property",level:"warning",message:"Dropping property that did not expand into an absolute IRI or keyword.",details:{property:E,expandedProperty:Z}},options:P});continue}if(w(Z)){if(I==="@reverse")throw new r("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:z});if(Z in U&&Z!=="@included"&&Z!=="@type")throw new r("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:Z})}if(Z==="@id"){if(!d(z)){if(!P.isFrame)throw new r('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:z});if(a(z)){if(!l(z))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z})}else{if(!n(z))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z});if(!z.every(ie=>d(ie)))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z})}}S(U,"@id",y(z).map(ie=>{if(d(ie)){const oe=f(C,ie,{base:!0},P);return P.eventHandler&&(oe===null?k(ie===null?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:ie}},options:P}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:ie}},options:P}):j(oe)||k({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:ie,expandedId:oe}},options:P})),oe}return ie}),{propertyIsArray:P.isFrame});continue}if(Z==="@type"){a(z)&&(z=Object.fromEntries(Object.entries(z).map(([ie,oe])=>[f(V,ie,{vocab:!0}),y(oe).map(u=>f(V,u,{base:!0,vocab:!0},{...P,typeExpansion:!0}))]))),T(z,P.isFrame),S(U,"@type",y(z).map(ie=>{if(d(ie)){const oe=f(V,ie,{base:!0,vocab:!0},{...P,typeExpansion:!0});return oe==="@json"||j(oe)||P.eventHandler&&k({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:ie}},options:P}),oe}return ie}),{propertyIsArray:!!P.isFrame});continue}if(Z==="@included"&&x(C,1.1)){const ie=y(await b.expand({activeCtx:C,activeProperty:X,element:z,options:P}));if(!ie.every(oe=>v(oe)))throw new r("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:z});S(U,"@included",ie,{propertyIsArray:!0});continue}if(Z==="@graph"&&!a(z)&&!n(z))throw new r('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:z});if(Z==="@value"){ee=z,M&&x(C,1.1)?U["@value"]=z:S(U,"@value",z,{propertyIsArray:P.isFrame});continue}if(Z==="@language"){if(z===null)continue;if(!d(z)&&!P.isFrame)throw new r('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:z});z=y(z).map(ie=>d(ie)?ie.toLowerCase():ie);for(const ie of z)d(ie)&&!ie.match(A)&&P.eventHandler&&k({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:ie}},options:P});S(U,"@language",z,{propertyIsArray:P.isFrame});continue}if(Z==="@direction"){if(!d(z)&&!P.isFrame)throw new r('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:z});z=y(z);for(const ie of z)if(d(ie)&&ie!=="ltr"&&ie!=="rtl")throw new r('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:z});S(U,"@direction",z,{propertyIsArray:P.isFrame});continue}if(Z==="@index"){if(!d(z))throw new r('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:z});S(U,"@index",z);continue}if(Z==="@reverse"){if(!a(z))throw new r('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:z});if(W=await b.expand({activeCtx:C,activeProperty:"@reverse",element:z,options:P}),"@reverse"in W)for(const oe in W["@reverse"])S(U,oe,W["@reverse"][oe],{propertyIsArray:!0});let ie=U["@reverse"]||null;for(const oe in W){if(oe==="@reverse")continue;ie===null&&(ie=U["@reverse"]={}),S(ie,oe,[],{propertyIsArray:!0});const u=W[oe];for(let m=0;mie==="@id"||ie==="@index")){if(W=y(W),P.isFrame||(W=W.filter(ie=>L({value:ie,count:Object.keys(ie).length,options:P})!==null)),W.length===0)continue;W=W.map(ie=>({"@graph":y(ie)}))}if(R.mappings.has(E)&&R.mappings.get(E).reverse){const ie=U["@reverse"]=U["@reverse"]||{};W=y(W);for(let oe=0;oef(C,Z,{vocab:!0},P)==="@value"))throw new r("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:z});await N({activeCtx:C,activeProperty:X,expandedActiveProperty:I,element:z,expandedParent:U,options:P,insideList:J,typeScopedContext:V,typeKey:D})}}}function K({activeCtx:C,activeProperty:X,value:I,options:B}){if(I==null)return null;const U=f(C,X,{vocab:!0},B);if(U==="@id")return f(C,I,{base:!0},B);if(U==="@type")return f(C,I,{vocab:!0,base:!0},{...B,typeExpansion:!0});const P=h(C,X,"@type");if((P==="@id"||U==="@graph")&&d(I)){const D=f(C,I,{base:!0},B);return D===null&&I.match(Q)&&B.eventHandler&&k({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:X}},options:B}),{"@id":D}}if(P==="@vocab"&&d(I))return{"@id":f(C,I,{vocab:!0,base:!0},B)};if(w(U))return I;const J={};if(P&&!["@id","@vocab","@none"].includes(P))J["@type"]=P;else if(d(I)){const D=h(C,X,"@language");D!==null&&(J["@language"]=D);const V=h(C,X,"@direction");V!==null&&(J["@direction"]=V)}return["boolean","number","string"].includes(typeof I)||(I=I.toString()),J["@value"]=I,J}function se(C,X,I,B){const U=[],P=Object.keys(X).sort();for(const J of P){const D=f(C,J,{vocab:!0},B);let V=X[J];n(V)||(V=[V]);for(const te of V){if(te===null)continue;if(!d(te))throw new r("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:X});const le={"@value":te};D!=="@none"&&(J.match(A)||B.eventHandler&&k({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:J}},options:B}),le["@language"]=J.toLowerCase()),I&&(le["@direction"]=I),U.push(le)}}return U}async function q({activeCtx:C,options:X,activeProperty:I,value:B,asGraph:U,indexKey:P,propertyIndex:J}){const D=[],V=Object.keys(B).sort(),te=P==="@type";for(let le of V){if(te){const E=h(C,le,"@context");i(E)||(C=await g({activeCtx:C,localCtx:E,propagate:!1,options:X}))}let ee,M=B[le];n(M)||(M=[M]),M=await b.expand({activeCtx:C,activeProperty:I,element:M,options:X,insideList:!1,insideIndex:!0}),ee=J?le==="@none"?"@none":K({activeCtx:C,activeProperty:P,value:le,options:X}):f(C,le,{vocab:!0},X),P==="@id"?le=f(C,le,{base:!0},X):te&&(le=ee);for(let E of M){if(U&&!p(E)&&(E={"@graph":[E]}),P==="@type")ee==="@none"||(E["@type"]?E["@type"]=[le].concat(E["@type"]):E["@type"]=[le]);else{if(c(E)&&!["@language","@type","@index"].includes(P))throw new r(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${P}".`,"jsonld.SyntaxError",{code:"invalid value object",value:E});J?ee!=="@none"&&S(E,J,ee,{propertyIsArray:!0,prependValue:!0}):ee==="@none"||P in E||(E[P]=le)}D.push(E)}}return D}s.exports=b,b.expand=async({activeCtx:C,activeProperty:X=null,element:I,options:B={},insideList:U=!1,insideIndex:P=!1,typeScopedContext:J=null})=>{if(I==null)return null;if(X==="@default"&&(B=Object.assign({},B,{isFrame:!1})),!n(I)&&!a(I))return U||X!==null&&f(C,X,{vocab:!0},B)!=="@graph"?K({activeCtx:C,activeProperty:X,value:I,options:B}):(B.eventHandler&&k({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:I}},options:B}),null);if(n(I)){let W=[];const z=h(C,X,"@container")||[];U=U||z.includes("@list");for(let Z=0;Z1?z.slice().sort():z:[z];for(const R of Z){const ne=h(J,R,"@context");i(ne)||(C=await g({activeCtx:C,localCtx:ne,options:B,propagate:!1}))}}let M={};await N({activeCtx:C,activeProperty:X,expandedActiveProperty:D,element:I,expandedParent:M,options:B,insideList:U,typeKey:ee,typeScopedContext:J}),te=Object.keys(M);let E=te.length;if("@value"in M){if("@type"in M&&("@language"in M||"@direction"in M))throw new r('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:M});let W=E-1;if("@type"in M&&(W-=1),"@index"in M&&(W-=1),"@language"in M&&(W-=1),"@direction"in M&&(W-=1),W!==0)throw new r('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:M});const z=M["@value"]===null?[]:y(M["@value"]),Z=O(M,"@type");if(!(x(C,1.1)&&Z.includes("@json")&&Z.length===1))if(z.length===0)B.eventHandler&&k({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:M}},options:B}),M=null;else{if(!z.every(R=>d(R)||l(R))&&"@language"in M)throw new r("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:M});if(!Z.every(R=>j(R)&&!(d(R)&&R.indexOf("_:")===0)||l(R)))throw new r('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:M})}}else if("@type"in M&&!n(M["@type"]))M["@type"]=[M["@type"]];else if("@set"in M||"@list"in M){if(E>1&&(E!==2||!("@index"in M)))throw new r('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:M});"@set"in M&&(M=M["@set"],te=Object.keys(M),E=te.length)}else E===1&&"@language"in M&&(B.eventHandler&&k({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:M}},options:B}),M=null);return!a(M)||B.keepFreeFloatingNodes||U||X!==null&&D!=="@graph"&&!(h(C,X,"@container")||[]).includes("@graph")||(M=L({value:M,count:E,options:B})),M}},5229:(s,e,t)=>{const{isSubjectReference:r}=t(3978),{createMergedNodeMap:n}=t(9233),a={};s.exports=a,a.flatten=l=>{const d=n(l),i=[],o=Object.keys(d).sort();for(let c=0;c{const{isKeyword:r}=t(1972),n=t(3978),a=t(7382),l=t(9263),d=t(470),i=t(2207),{createNodeMap:o,mergeNodeMapGraphs:c}=t(9233),p={};function v(y){const O={};for(const T in y)y[T]!==void 0&&(O["@"+T]=[y[T]]);return[O]}function f(y,O,T){for(let k=T.length-1;k>=0;--k){const b=T[k];if(b.graph===O&&b.subject["@id"]===y["@id"])return!0}return!1}function h(y,O,T){const k="@"+T;let b=k in y?y[k][0]:O[T];if(T==="embed"){if(b===!0)b="@once";else if(b===!1)b="@never";else if(b!=="@always"&&b!=="@never"&&b!=="@link"&&b!=="@first"&&b!=="@last"&&b!=="@once")throw new i("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:y})}return b}function w(y){if(!a.isArray(y)||y.length!==1||!a.isObject(y[0]))throw new i("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:y});if("@id"in y[0]){for(const O of l.asArray(y[0]["@id"]))if(!a.isObject(O)&&!d.isAbsolute(O)||a.isString(O)&&O.indexOf("_:")===0)throw new i("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:y})}if("@type"in y[0]){for(const O of l.asArray(y[0]["@type"]))if(!a.isObject(O)&&!d.isAbsolute(O)&&O!=="@json"||a.isString(O)&&O.indexOf("_:")===0)throw new i("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:y})}}function g(y,O,T,k){let b=!0,L=!1;for(const N in T){let K=!1;const se=l.getValues(O,N),q=l.getValues(T,N).length===0;if(N==="@id"){if(a.isEmptyObject(T["@id"][0]||{})?K=!0:T["@id"].length>=0&&(K=T["@id"].includes(se[0])),!k.requireAll)return K}else if(N==="@type"){if(b=!1,q){if(se.length>0)return!1;K=!0}else if(T["@type"].length===1&&a.isEmptyObject(T["@type"][0]))K=se.length>0;else for(const C of T["@type"])K=!(!a.isObject(C)||!("@default"in C))||K||se.some(X=>X===C);if(!k.requireAll)return K}else{if(r(N))continue;{const C=l.getValues(T,N)[0];let X=!1;if(C&&(w([C]),X="@default"in C),b=!1,se.length===0&&X)continue;if(se.length>0&&q)return!1;if(C===void 0){if(se.length>0)return!1;K=!0}else if(n.isList(C)){const I=C["@list"][0];if(n.isList(se[0])){const B=se[0]["@list"];n.isValue(I)?K=B.some(U=>S(I,U)):(n.isSubject(I)||n.isSubjectReference(I))&&(K=B.some(U=>Q(y,I,U,k)))}}else K=n.isValue(C)?se.some(I=>S(C,I)):n.isSubjectReference(C)?se.some(I=>Q(y,C,I,k)):!!a.isObject(C)&&se.length>0}}if(!K&&k.requireAll)return!1;L=L||K}return b||L}function x(y,O){const T=y.uniqueEmbeds[y.graph],k=T[O],b=k.parent,L=k.property,N={"@id":O};if(a.isArray(b)){for(let se=0;se{const q=Object.keys(T);for(const C of q)C in T&&a.isObject(T[C].parent)&&T[C].parent["@id"]===se&&(delete T[C],K(C))};K(O)}function j(y,O){if(a.isArray(y))return y.map(T=>j(T,O));if(a.isObject(y)){if("@preserve"in y)return y["@preserve"][0];if(n.isValue(y))return y;if(n.isList(y))return y["@list"]=j(y["@list"],O),y;if("@id"in y){const T=y["@id"];if(O.link.hasOwnProperty(T)){const k=O.link[T].indexOf(y);if(k!==-1)return O.link[T][k];O.link[T].push(y)}else O.link[T]=[y]}for(const T in y)T==="@id"&&O.bnodesToClear.includes(y[T])?delete y["@id"]:y[T]=j(y[T],O)}return y}function A(y,O,T){a.isObject(y)?l.addValue(y,O,T,{propertyIsArray:!0}):y.push(T)}function Q(y,O,T,k){if(!("@id"in T))return!1;const b=y.subjects[T["@id"]];return b&&g(y,b,O,k)}function S(y,O){const T=O["@value"],k=O["@type"],b=O["@language"],L=y["@value"]?a.isArray(y["@value"])?y["@value"]:[y["@value"]]:[],N=y["@type"]?a.isArray(y["@type"])?y["@type"]:[y["@type"]]:[],K=y["@language"]?a.isArray(y["@language"])?y["@language"]:[y["@language"]]:[];return L.length===0&&N.length===0&&K.length===0||!(!L.includes(T)&&!a.isEmptyObject(L[0]))&&!!(!k&&N.length===0||N.includes(k)||k&&a.isEmptyObject(N[0]))&&!!(!b&&K.length===0||K.includes(b)||b&&a.isEmptyObject(K[0]))}s.exports=p,p.frameMergedOrDefault=(y,O,T)=>{const k={options:T,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},b=new l.IdentifierIssuer("_:b");o(y,k.graphMap,"@default",b),T.merged&&(k.graphMap["@merged"]=c(k.graphMap),k.graph="@merged"),k.subjects=k.graphMap[k.graph];const L=[];return p.frame(k,Object.keys(k.subjects).sort(),O,L),T.pruneBlankNodeIdentifiers&&(T.bnodesToClear=Object.keys(k.bnodeMap).filter(N=>k.bnodeMap[N].length===1)),T.link={},j(L,T)},p.frame=(y,O,T,k,b=null)=>{w(T),T=T[0];const L=y.options,N={embed:h(T,L,"embed"),explicit:h(T,L,"explicit"),requireAll:h(T,L,"requireAll")};y.link.hasOwnProperty(y.graph)||(y.link[y.graph]={});const K=y.link[y.graph],se=function(C,X,I,B){const U={};for(const P of X){const J=C.graphMap[C.graph][P];g(C,J,I,B)&&(U[P]=J)}return U}(y,O,T,N),q=Object.keys(se).sort();for(const C of q){const X=se[C];if(b===null?y.uniqueEmbeds={[y.graph]:{}}:y.uniqueEmbeds[y.graph]=y.uniqueEmbeds[y.graph]||{},N.embed==="@link"&&C in K){A(k,b,K[C]);continue}const I={"@id":C};if(C.indexOf("_:")===0&&l.addValue(y.bnodeMap,C,I,{propertyIsArray:!0}),K[C]=I,(N.embed==="@first"||N.embed==="@last")&&y.is11)throw new i("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:T});if(y.embedded||!y.uniqueEmbeds[y.graph].hasOwnProperty(C))if(!y.embedded||N.embed!=="@never"&&!f(X,y.graph,y.subjectStack))if(!y.embedded||N.embed!="@first"&&N.embed!="@once"||!y.uniqueEmbeds[y.graph].hasOwnProperty(C)){if(N.embed==="@last"&&C in y.uniqueEmbeds[y.graph]&&x(y,C),y.uniqueEmbeds[y.graph][C]={parent:k,property:b},y.subjectStack.push({subject:X,graph:y.graph}),C in y.graphMap){let B=!1,U=null;"@graph"in T?(U=T["@graph"][0],B=!(C==="@merged"||C==="@default"),a.isObject(U)||(U={})):(B=y.graph!=="@merged",U={}),B&&p.frame({...y,graph:C,embedded:!1},Object.keys(y.graphMap[C]).sort(),[U],I,"@graph")}"@included"in T&&p.frame({...y,embedded:!1},O,T["@included"],I,"@included");for(const B of Object.keys(X).sort())if(r(B)){if(I[B]=l.clone(X[B]),B==="@type")for(const U of X["@type"])U.indexOf("_:")===0&&l.addValue(y.bnodeMap,U,I,{propertyIsArray:!0})}else if(!N.explicit||B in T)for(const U of X[B]){const P=B in T?T[B]:v(N);if(n.isList(U)){const J=T[B]&&T[B][0]&&T[B][0]["@list"]?T[B][0]["@list"]:v(N),D={"@list":[]};A(I,B,D);const V=U["@list"];for(const te of V)n.isSubjectReference(te)?p.frame({...y,embedded:!0},[te["@id"]],J,D,"@list"):A(D,"@list",l.clone(te))}else n.isSubjectReference(U)?p.frame({...y,embedded:!0},[U["@id"]],P,I,B):S(P[0],U)&&A(I,B,l.clone(U))}for(const B of Object.keys(T).sort()){if(B==="@type"){if(!a.isObject(T[B][0])||!("@default"in T[B][0]))continue}else if(r(B))continue;const U=T[B][0]||{};if(!h(U,L,"omitDefault")&&!(B in I)){let P="@null";"@default"in U&&(P=l.clone(U["@default"])),a.isArray(P)||(P=[P]),I[B]=[{"@preserve":P}]}}for(const B of Object.keys(T["@reverse"]||{}).sort()){const U=T["@reverse"][B];for(const P of Object.keys(y.subjects))l.getValues(y.subjects[P],B).some(J=>J["@id"]===C)&&(I["@reverse"]=I["@reverse"]||{},l.addValue(I["@reverse"],B,[],{propertyIsArray:!0}),p.frame({...y,embedded:!0},[P],U,I["@reverse"][B],b))}A(k,b,I),y.subjectStack.pop()}else A(k,b,I);else A(k,b,I)}},p.cleanupNull=(y,O)=>{if(a.isArray(y))return y.map(T=>p.cleanupNull(T,O)).filter(T=>T);if(y==="@null")return null;if(a.isObject(y)){if("@id"in y){const T=y["@id"];if(O.link.hasOwnProperty(T)){const k=O.link[T].indexOf(y);if(k!==-1)return O.link[T][k];O.link[T].push(y)}else O.link[T]=[y]}for(const T in y)y[T]=p.cleanupNull(y[T],O)}return y}},3947:(s,e,t)=>{const r=t(2207),n=t(3978),a=t(7382),{REGEX_BCP47:l,addValue:d}=t(9263),{handleEvent:i}=t(2246),{RDF_LIST:o,RDF_FIRST:c,RDF_REST:p,RDF_NIL:v,RDF_TYPE:f,RDF_JSON_LITERAL:h,XSD_BOOLEAN:w,XSD_DOUBLE:g,XSD_INTEGER:x,XSD_STRING:j}=t(9378),A={};function Q(S,y,O,T){if(S.termType.endsWith("Node"))return{"@id":S.value};const k={"@value":S.value};if(S.language)S.language.match(l)||T.eventHandler&&i({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:S.language}},options:T}),k["@language"]=S.language;else{let b=S.datatype.value;if(b||(b=j),b===h){b="@json";try{k["@value"]=JSON.parse(k["@value"])}catch(L){throw new r("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:k["@value"],cause:L})}}if(y){if(b===w)k["@value"]==="true"?k["@value"]=!0:k["@value"]==="false"&&(k["@value"]=!1);else if(a.isNumeric(k["@value"]))if(b===x){const L=parseInt(k["@value"],10);L.toFixed(0)===k["@value"]&&(k["@value"]=L)}else b===g&&(k["@value"]=parseFloat(k["@value"]));[w,x,g,j].includes(b)||(k["@type"]=b)}else if(O==="i18n-datatype"&&b.startsWith("https://www.w3.org/ns/i18n#")){const[,L,N]=b.split(/[#_]/);L.length>0&&(k["@language"]=L,L.match(l)||T.eventHandler&&i({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:L}},options:T})),k["@direction"]=N}else b!==j&&(k["@type"]=b)}return k}s.exports=A,A.fromRDF=async(S,y)=>{const{useRdfType:O=!1,useNativeTypes:T=!1,rdfDirection:k=null}=y,b={},L={"@default":b},N={};if(k){if(k==="compound-literal")throw new r("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:k});if(k!=="i18n-datatype")throw new r("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:k})}for(const q of S){const C=q.graph.termType==="DefaultGraph"?"@default":q.graph.value;C in L||(L[C]={}),C==="@default"||C in b||(b[C]={"@id":C});const X=L[C],I=q.subject.value,B=q.predicate.value,U=q.object;I in X||(X[I]={"@id":I});const P=X[I],J=U.termType.endsWith("Node");if(J&&!(U.value in X)&&(X[U.value]={"@id":U.value}),B===f&&!O&&J){d(P,"@type",U.value,{propertyIsArray:!0});continue}const D=Q(U,T,k,y);if(d(P,B,D,{propertyIsArray:!0}),J)if(U.value===v){const V=X[U.value];"usages"in V||(V.usages=[]),V.usages.push({node:P,property:B,value:D})}else U.value in N?N[U.value]=!1:N[U.value]={node:P,property:B,value:D}}for(const q in L){const C=L[q];if(!(v in C))continue;const X=C[v];if(X.usages){for(let I of X.usages){let B=I.node,U=I.property,P=I.value;const J=[],D=[];let V=Object.keys(B).length;for(;U===p&&a.isObject(N[B["@id"]])&&a.isArray(B[c])&&B[c].length===1&&a.isArray(B[p])&&B[p].length===1&&(V===3||V===4&&a.isArray(B["@type"])&&B["@type"].length===1&&B["@type"][0]===o)&&(J.push(B[c][0]),D.push(B["@id"]),I=N[B["@id"]],B=I.node,U=I.property,P=I.value,V=Object.keys(B).length,n.isBlankNode(B)););delete P["@id"],P["@list"]=J.reverse();for(const te of D)delete C[te]}delete X.usages}}const K=[],se=Object.keys(b).sort();for(const q of se){const C=b[q];if(q in L){const X=C["@graph"]=[],I=L[q],B=Object.keys(I).sort();for(const U of B){const P=I[U];n.isSubjectReference(P)||X.push(P)}}n.isSubjectReference(C)||K.push(C)}return K}},3978:(s,e,t)=>{const r=t(7382),n={};s.exports=n,n.isSubject=a=>!(!r.isObject(a)||"@value"in a||"@set"in a||"@list"in a)&&(Object.keys(a).length>1||!("@id"in a)),n.isSubjectReference=a=>r.isObject(a)&&Object.keys(a).length===1&&"@id"in a,n.isValue=a=>r.isObject(a)&&"@value"in a,n.isList=a=>r.isObject(a)&&"@list"in a,n.isGraph=a=>r.isObject(a)&&"@graph"in a&&Object.keys(a).filter(l=>l!=="@id"&&l!=="@index").length===1,n.isSimpleGraph=a=>n.isGraph(a)&&!("@id"in a),n.isBlankNode=a=>{if(r.isObject(a)){if("@id"in a){const l=a["@id"];return!r.isString(l)||l.indexOf("_:")===0}return Object.keys(a).length===0||!("@value"in a||"@set"in a||"@list"in a)}return!1}},4841:(s,e,t)=>{const r=t(989),n=t(701),a=t(9263),l=t(7034),d=a.IdentifierIssuer,i=t(2207),o=t(9749),c=t(8229),{expand:p}=t(4019),{flatten:v}=t(5229),{fromRDF:f}=t(3947),{toRDF:h}=t(9180),{frameMergedOrDefault:w,cleanupNull:g}=t(7946),{isArray:x,isObject:j,isString:A}=t(7382),{isSubjectReference:Q}=t(3978),{expandIri:S,getInitialContext:y,process:O,processingMode:T}=t(1972),{compact:k,compactIri:b}=t(1058),{createNodeMap:L,createMergedNodeMap:N,mergeNodeMaps:K}=t(9233),{logEventHandler:se,logWarningEventHandler:q,safeEventHandler:C,setDefaultEventHandler:X,setupEventHandler:I,strictEventHandler:B,unhandledEventHandler:U}=t(2246),P=function(D){const V={},te=new o({max:100});function le(ee,{documentLoader:M=D.documentLoader,...E}){if(ee&&"compactionMap"in ee)throw new i('"compactionMap" not supported.',"jsonld.OptionsError");if(ee&&"expansionMap"in ee)throw new i('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:M},E,ee,{eventHandler:I({options:ee})})}return D.compact=async function(ee,M,E){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(M===null)throw new i("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(ee===null)return null;let W;(E=le(E,{base:A(ee)?ee:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new d("_:b"),contextResolver:new l({sharedCache:te})})).link&&(E.skipExpansion=!0),E.compactToRelative||delete E.base,W=E.skipExpansion?ee:await D.expand(ee,E);const z=await D.processContext(y(E),M,E);let Z=await k({activeCtx:z,element:W,options:E});E.compactArrays&&!E.graph&&x(Z)?Z.length===1?Z=Z[0]:Z.length===0&&(Z={}):E.graph&&j(Z)&&(Z=[Z]),j(M)&&"@context"in M&&(M=M["@context"]),M=a.clone(M),x(M)||(M=[M]);const R=M;M=[];for(let Y=0;Y0)&&M.push(R[Y]);const ne=M.length>0;if(M.length===1&&(M=M[0]),x(Z)){const Y=b({activeCtx:z,iri:"@graph",relativeTo:{vocab:!0}}),ie=Z;Z={},ne&&(Z["@context"]=M),Z[Y]=ie}else if(j(Z)&&ne){const Y=Z;Z={"@context":M};for(const ie in Y)Z[ie]=Y[ie]}return Z},D.expand=async function(ee,M){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");const E={},W=[];if("expandContext"in(M=le(M,{keepFreeFloatingNodes:!1,contextResolver:new l({sharedCache:te})}))){const ne=a.clone(M.expandContext);j(ne)&&"@context"in ne?E.expandContext=ne:E.expandContext={"@context":ne},W.push(E.expandContext)}let z;if(A(ee)){const ne=await D.get(ee,M);z=ne.documentUrl,E.input=ne.document,ne.contextUrl&&(E.remoteContext={"@context":ne.contextUrl},W.push(E.remoteContext))}else E.input=a.clone(ee);"base"in M||(M.base=z||"");let Z=y(M);for(const ne of W)Z=await O({activeCtx:Z,localCtx:ne,options:M});let R=await p({activeCtx:Z,element:E.input,options:M});return j(R)&&"@graph"in R&&Object.keys(R).length===1?R=R["@graph"]:R===null&&(R=[]),x(R)||(R=[R]),R},D.flatten=async function(ee,M,E){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");M=typeof M=="function"?null:M||null,E=le(E,{base:A(ee)?ee:"",contextResolver:new l({sharedCache:te})});const W=await D.expand(ee,E),z=v(W);return M===null?z:(E.graph=!0,E.skipExpansion=!0,await D.compact(z,M,E))},D.frame=async function(ee,M,E){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(E=le(E,{base:A(ee)?ee:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new l({sharedCache:te})}),A(M)){const u=await D.get(M,E);if(M=u.document,u.contextUrl){let m=M["@context"];m?x(m)?m.push(u.contextUrl):m=[m,u.contextUrl]:m=u.contextUrl,M["@context"]=m}}const W=M&&M["@context"]||{},z=await D.processContext(y(E),W,E);E.hasOwnProperty("omitGraph")||(E.omitGraph=T(z,1.1)),E.hasOwnProperty("pruneBlankNodeIdentifiers")||(E.pruneBlankNodeIdentifiers=T(z,1.1));const Z=await D.expand(ee,E),R={...E};R.isFrame=!0,R.keepFreeFloatingNodes=!0;const ne=await D.expand(M,R),Y=Object.keys(M).map(u=>S(z,u,{vocab:!0}));R.merged=!Y.includes("@graph"),R.is11=T(z,1.1);const ie=w(Z,ne,R);R.graph=!E.omitGraph,R.skipExpansion=!0,R.link={},R.framing=!0;let oe=await D.compact(ie,W,R);return R.link={},oe=g(oe,R),oe},D.link=async function(ee,M,E){const W={};return M&&(W["@context"]=M),W["@embed"]="@link",D.frame(ee,W,E)},D.normalize=D.canonize=async function(ee,M){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(M=le(M,{base:A(ee)?ee:null,algorithm:"URDNA2015",skipExpansion:!1,safe:!0,contextResolver:new l({sharedCache:te})}))){if(M.inputFormat!=="application/n-quads"&&M.inputFormat!=="application/nquads")throw new i("Unknown canonicalization input format.","jsonld.CanonizeError");const z=c.parse(ee);return r.canonize(z,M)}const E={...M};delete E.format,E.produceGeneralizedRdf=!1;const W=await D.toRDF(ee,E);return r.canonize(W,M)},D.fromRDF=async function(ee,M){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");M=le(M,{format:A(ee)?"application/n-quads":void 0});const{format:E}=M;let{rdfParser:W}=M;if(E){if(W=W||V[E],!W)throw new i("Unknown input format.","jsonld.UnknownFormat",{format:E})}else W=()=>ee;const z=await W(ee);return f(z,M)},D.toRDF=async function(ee,M){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let E;E=(M=le(M,{base:A(ee)?ee:"",skipExpansion:!1,contextResolver:new l({sharedCache:te})})).skipExpansion?ee:await D.expand(ee,M);const W=h(E,M);if(M.format){if(M.format==="application/n-quads"||M.format==="application/nquads")return c.serialize(W);throw new i("Unknown output format.","jsonld.UnknownFormat",{format:M.format})}return W},D.createNodeMap=async function(ee,M){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");M=le(M,{base:A(ee)?ee:"",contextResolver:new l({sharedCache:te})});const E=await D.expand(ee,M);return N(E,M)},D.merge=async function(ee,M,E){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!x(ee))throw new TypeError('Could not merge, "docs" must be an array.');M=typeof M=="function"?null:M||null,E=le(E,{contextResolver:new l({sharedCache:te})});const W=await Promise.all(ee.map(oe=>{const u={...E};return D.expand(oe,u)}));let z=!0;"mergeNodes"in E&&(z=E.mergeNodes);const Z=E.issuer||new d("_:b"),R={"@default":{}};for(let oe=0;oeD._documentLoader,set:ee=>D._documentLoader=ee}),D.documentLoader=async ee=>{throw new i("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:ee})},D.get=async function(ee,M){let E;E=typeof M.documentLoader=="function"?M.documentLoader:D.documentLoader;const W=await E(ee);try{if(!W.document)throw new i("No remote document found at the given URL.","jsonld.NullRemoteDocument");A(W.document)&&(W.document=JSON.parse(W.document))}catch(z){throw new i("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:z,remoteDoc:W})}return W},D.processContext=async function(ee,M,E){return E=le(E,{base:"",contextResolver:new l({sharedCache:te})}),M===null?y(E):(M=a.clone(M),j(M)&&"@context"in M||(M={"@context":M}),O({activeCtx:ee,localCtx:M,options:E}))},D.getContextValue=t(1972).getContextValue,D.documentLoaders={},D.useDocumentLoader=function(ee){if(!(ee in D.documentLoaders))throw new i('Unknown document loader type: "'+ee+'"',"jsonld.UnknownDocumentLoader",{type:ee});D.documentLoader=D.documentLoaders[ee].apply(D,Array.prototype.slice.call(arguments,1))},D.registerRDFParser=function(ee,M){V[ee]=M},D.unregisterRDFParser=function(ee){delete V[ee]},D.registerRDFParser("application/n-quads",c.parse),D.registerRDFParser("application/nquads",c.parse),D.url=t(470),D.logEventHandler=se,D.logWarningEventHandler=q,D.safeEventHandler=C,D.setDefaultEventHandler=X,D.strictEventHandler=B,D.unhandledEventHandler=U,D.util=a,Object.assign(D,a),D.promises=D,D.RequestQueue=t(3743),D.JsonLdProcessor=t(5445)(D),n.setupGlobals(D),n.setupDocumentLoaders(D),D},J=function(){return P(function(){return J()})};P(J),s.exports=J},9233:(s,e,t)=>{const{isKeyword:r}=t(1972),n=t(3978),a=t(7382),l=t(9263),d=t(2207),i={};s.exports=i,i.createMergedNodeMap=(o,c)=>{const p=(c=c||{}).issuer||new l.IdentifierIssuer("_:b"),v={"@default":{}};return i.createNodeMap(o,v,"@default",p),i.mergeNodeMaps(v)},i.createNodeMap=(o,c,p,v,f,h)=>{if(a.isArray(o)){for(const j of o)i.createNodeMap(j,c,p,v,void 0,h);return}if(!a.isObject(o))return void(h&&h.push(o));if(n.isValue(o)){if("@type"in o){let j=o["@type"];j.indexOf("_:")===0&&(o["@type"]=j=v.getId(j))}return void(h&&h.push(o))}if(h&&n.isList(o)){const j=[];return i.createNodeMap(o["@list"],c,p,v,f,j),void h.push({"@list":j})}if("@type"in o){const j=o["@type"];for(const A of j)A.indexOf("_:")===0&&v.getId(A)}a.isUndefined(f)&&(f=n.isBlankNode(o)?v.getId(o["@id"]):o["@id"]),h&&h.push({"@id":f});const w=c[p],g=w[f]=w[f]||{};g["@id"]=f;const x=Object.keys(o).sort();for(let j of x){if(j==="@id")continue;if(j==="@reverse"){const Q={"@id":f},S=o["@reverse"];for(const y in S){const O=S[y];for(const T of O){let k=T["@id"];n.isBlankNode(T)&&(k=v.getId(k)),i.createNodeMap(T,c,p,v,k),l.addValue(w[k],y,Q,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if(j==="@graph"){f in c||(c[f]={}),i.createNodeMap(o[j],c,f,v);continue}if(j==="@included"){i.createNodeMap(o[j],c,p,v);continue}if(j!=="@type"&&r(j)){if(j==="@index"&&j in g&&(o[j]!==g[j]||o[j]["@id"]!==g[j]["@id"]))throw new d("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:g});g[j]=o[j];continue}const A=o[j];if(j.indexOf("_:")===0&&(j=v.getId(j)),A.length!==0)for(let Q of A)if(j==="@type"&&(Q=Q.indexOf("_:")===0?v.getId(Q):Q),n.isSubject(Q)||n.isSubjectReference(Q)){if("@id"in Q&&!Q["@id"])continue;const S=n.isBlankNode(Q)?v.getId(Q["@id"]):Q["@id"];l.addValue(g,j,{"@id":S},{propertyIsArray:!0,allowDuplicate:!1}),i.createNodeMap(Q,c,p,v,S)}else if(n.isValue(Q))l.addValue(g,j,Q,{propertyIsArray:!0,allowDuplicate:!1});else if(n.isList(Q)){const S=[];i.createNodeMap(Q["@list"],c,p,v,f,S),Q={"@list":S},l.addValue(g,j,Q,{propertyIsArray:!0,allowDuplicate:!1})}else i.createNodeMap(Q,c,p,v,f),l.addValue(g,j,Q,{propertyIsArray:!0,allowDuplicate:!1});else l.addValue(g,j,[],{propertyIsArray:!0})}},i.mergeNodeMapGraphs=o=>{const c={};for(const p of Object.keys(o).sort())for(const v of Object.keys(o[p]).sort()){const f=o[p][v];v in c||(c[v]={"@id":v});const h=c[v];for(const w of Object.keys(f).sort())if(r(w)&&w!=="@type")h[w]=l.clone(f[w]);else for(const g of f[w])l.addValue(h,w,l.clone(g),{propertyIsArray:!0,allowDuplicate:!1})}return c},i.mergeNodeMaps=o=>{const c=o["@default"],p=Object.keys(o).sort();for(const v of p){if(v==="@default")continue;const f=o[v];let h=c[v];h?"@graph"in h||(h["@graph"]=[]):c[v]=h={"@id":v,"@graph":[]};const w=h["@graph"];for(const g of Object.keys(f).sort()){const x=f[g];n.isSubjectReference(x)||w.push(x)}}return c}},701:(s,e,t)=>{const r=t(6957),n={};s.exports=n,n.setupDocumentLoaders=function(a){typeof XMLHttpRequest<"u"&&(a.documentLoaders.xhr=r,a.useDocumentLoader("xhr"))},n.setupGlobals=function(a){globalThis.JsonLdProcessor===void 0&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:a.JsonLdProcessor})}},9180:(s,e,t)=>{const{createNodeMap:r}=t(9233),{isKeyword:n}=t(1972),a=t(3978),l=t(2341),d=t(2207),i=t(7382),o=t(9263),{handleEvent:c}=t(2246),{RDF_FIRST:p,RDF_REST:v,RDF_NIL:f,RDF_TYPE:h,RDF_JSON_LITERAL:w,RDF_LANGSTRING:g,XSD_BOOLEAN:x,XSD_DOUBLE:j,XSD_INTEGER:A,XSD_STRING:Q}=t(9378),{isAbsolute:S}=t(470),y={};function O(k,b,L,N,K){const se=Object.keys(b).sort();for(const q of se){const C=b[q],X=Object.keys(C).sort();for(let I of X){const B=C[I];if(I==="@type")I=h;else if(n(I))continue;for(const U of B){const P={termType:q.startsWith("_:")?"BlankNode":"NamedNode",value:q};if(!S(q)){K.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:q}},options:K});continue}const J={termType:I.startsWith("_:")?"BlankNode":"NamedNode",value:I};if(!S(I)){K.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:I}},options:K});continue}if(J.termType==="BlankNode"&&!K.produceGeneralizedRdf){K.eventHandler&&c({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:N.getOldIds().find(V=>N.getId(V)===I)}},options:K});continue}const D=T(U,N,k,L,K.rdfDirection,K);D&&k.push({subject:P,predicate:J,object:D,graph:L})}}}}function T(k,b,L,N,K,se){const q={};if(a.isValue(k)){q.termType="Literal",q.value=void 0,q.datatype={termType:"NamedNode"};let C=k["@value"];const X=k["@type"]||null;if(X==="@json")q.value=l(C),q.datatype.value=w;else if(i.isBoolean(C))q.value=C.toString(),q.datatype.value=X||x;else if(i.isDouble(C)||X===j)i.isDouble(C)||(C=parseFloat(C)),q.value=C.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),q.datatype.value=X||j;else if(i.isNumber(C))q.value=C.toFixed(0),q.datatype.value=X||A;else if("@direction"in k&&K==="i18n-datatype"){const I=`https://www.w3.org/ns/i18n#${(k["@language"]||"").toLowerCase()}_${k["@direction"]}`;q.datatype.value=I,q.value=C}else{if("@direction"in k&&K==="compound-literal")throw new d("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:K});if("@direction"in k&&K)throw new d("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:K});"@language"in k?("@direction"in k&&!K&&se.eventHandler&&c({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:q.value}},options:se}),q.value=C,q.datatype.value=X||g,q.language=k["@language"]):("@direction"in k&&!K&&se.eventHandler&&c({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:q.value}},options:se}),q.value=C,q.datatype.value=X||Q)}}else if(a.isList(k)){const C=function(X,I,B,U,P,J){const D={termType:"NamedNode",value:p},V={termType:"NamedNode",value:v},te={termType:"NamedNode",value:f},le=X.pop(),ee=le?{termType:"BlankNode",value:I.getId()}:te;let M=ee;for(const E of X){const W=T(E,I,B,U,P,J),z={termType:"BlankNode",value:I.getId()};B.push({subject:M,predicate:D,object:W,graph:U}),B.push({subject:M,predicate:V,object:z,graph:U}),M=z}if(le){const E=T(le,I,B,U,P,J);B.push({subject:M,predicate:D,object:E,graph:U}),B.push({subject:M,predicate:V,object:te,graph:U})}return ee}(k["@list"],b,L,N,K,se);q.termType=C.termType,q.value=C.value}else{const C=i.isObject(k)?k["@id"]:k;q.termType=C.startsWith("_:")?"BlankNode":"NamedNode",q.value=C}return q.termType!=="NamedNode"||S(q.value)?q:(se.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:q.value}},options:se}),null)}s.exports=y,y.toRDF=(k,b)=>{const L=new o.IdentifierIssuer("_:b"),N={"@default":{}};r(k,N,"@default",L);const K=[],se=Object.keys(N).sort();for(const q of se){let C;if(q==="@default")C={termType:"DefaultGraph",value:""};else{if(!S(q)){b.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:q}},options:b});continue}C=q.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},C.value=q}O(K,N[q],C,L,b)}return K}},7382:s=>{const e={};s.exports=e,e.isArray=Array.isArray,e.isBoolean=t=>typeof t=="boolean"||Object.prototype.toString.call(t)==="[object Boolean]",e.isDouble=t=>e.isNumber(t)&&(String(t).indexOf(".")!==-1||Math.abs(t)>=1e21),e.isEmptyObject=t=>e.isObject(t)&&Object.keys(t).length===0,e.isNumber=t=>typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]",e.isNumeric=t=>!isNaN(parseFloat(t))&&isFinite(t),e.isObject=t=>Object.prototype.toString.call(t)==="[object Object]",e.isString=t=>typeof t=="string"||Object.prototype.toString.call(t)==="[object String]",e.isUndefined=t=>t===void 0},470:(s,e,t)=>{const r=t(7382),n={};s.exports=n,n.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*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},n.parse=(l,d)=>{const i={},o=n.parsers[d||"full"],c=o.regex.exec(l);let p=o.keys.length;for(;p--;)i[o.keys[p]]=c[p]===void 0?null:c[p];return(i.scheme==="https"&&i.port==="443"||i.scheme==="http"&&i.port==="80")&&(i.href=i.href.replace(":"+i.port,""),i.authority=i.authority.replace(":"+i.port,""),i.port=null),i.normalizedPath=n.removeDotSegments(i.path),i},n.prependBase=(l,d)=>{if(l===null||n.isAbsolute(d))return d;l&&!r.isString(l)||(l=n.parse(l||""));const i=n.parse(d),o={protocol:l.protocol||""};if(i.authority!==null)o.authority=i.authority,o.path=i.path,o.query=i.query;else if(o.authority=l.authority,i.path==="")o.path=l.path,i.query!==null?o.query=i.query:o.query=l.query;else{if(i.path.indexOf("/")===0)o.path=i.path;else{let p=l.path;p=p.substr(0,p.lastIndexOf("/")+1),(p.length>0||l.authority)&&p.substr(-1)!=="/"&&(p+="/"),p+=i.path,o.path=p}o.query=i.query}i.path!==""&&(o.path=n.removeDotSegments(o.path));let c=o.protocol;return o.authority!==null&&(c+="//"+o.authority),c+=o.path,o.query!==null&&(c+="?"+o.query),i.fragment!==null&&(c+="#"+i.fragment),c===""&&(c="./"),c},n.removeBase=(l,d)=>{if(l===null)return d;l&&!r.isString(l)||(l=n.parse(l||""));let i="";if(l.href!==""?i+=(l.protocol||"")+"//"+(l.authority||""):d.indexOf("//")&&(i+="//"),d.indexOf(i)!==0)return d;const o=n.parse(d.substr(i.length)),c=l.normalizedPath.split("/"),p=o.normalizedPath.split("/"),v=o.fragment||o.query?0:1;for(;c.length>0&&p.length>v&&c[0]===p[0];)c.shift(),p.shift();let f="";if(c.length>0){c.pop();for(let h=0;h{if(l.length===0)return"";const d=l.split("/"),i=[];for(;d.length>0;){const o=d.shift(),c=d.length===0;o!=="."?o!==".."?i.push(o):(i.pop(),c&&i.push("")):c&&i.push("")}return l[0]==="/"&&i.length>0&&i[0]!==""&&i.unshift(""),i.length===1&&i[0]===""?"/":i.join("/")};const a=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;n.isAbsolute=l=>r.isString(l)&&a.test(l),n.isRelative=l=>r.isString(l)},9263:(s,e,t)=>{const r=t(3978),n=t(7382),a=t(989).IdentifierIssuer,l=t(2207),d=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,i=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,o=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,c="application/ld+json, application/json",p={};function v(f,h){if(n.isArray(h))for(let w=0;w{if(Object.keys(f).some(h=>h.toLowerCase()==="accept"))throw new RangeError('Accept header may not be specified; only "'+c+'" is supported.');return Object.assign({Accept:c},f)},p.parseLinkHeader=f=>{const h={},w=f.match(d);for(let g=0;g{if(!(n.isString(f)||n.isArray(f)&&f.every(w=>n.isString(w)))){if(h&&n.isObject(f))switch(Object.keys(f).length){case 0:return;case 1:if("@default"in f&&p.asArray(f["@default"]).every(w=>n.isString(w)))return}throw new l('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:f})}},p.hasProperty=(f,h)=>{if(f.hasOwnProperty(h)){const w=f[h];return!n.isArray(w)||w.length>0}return!1},p.hasValue=(f,h,w)=>{if(p.hasProperty(f,h)){let g=f[h];const x=r.isList(g);if(n.isArray(g)||x){x&&(g=g["@list"]);for(let j=0;j{if("propertyIsArray"in(g=g||{})||(g.propertyIsArray=!1),"valueIsArray"in g||(g.valueIsArray=!1),"allowDuplicate"in g||(g.allowDuplicate=!0),"prependValue"in g||(g.prependValue=!1),g.valueIsArray)f[h]=w;else if(n.isArray(w)){w.length===0&&g.propertyIsArray&&!f.hasOwnProperty(h)&&(f[h]=[]),g.prependValue&&(w=w.concat(f[h]),f[h]=[]);for(let x=0;x[].concat(f[h]||[]),p.removeProperty=(f,h)=>{delete f[h]},p.removeValue=(f,h,w,g)=>{"propertyIsArray"in(g=g||{})||(g.propertyIsArray=!1);const x=p.getValues(f,h).filter(j=>!p.compareValues(j,w));x.length===0?p.removeProperty(f,h):x.length!==1||g.propertyIsArray?f[h]=x:f[h]=x[0]},p.relabelBlankNodes=(f,h)=>v((h=h||{}).issuer||new a("_:b"),f),p.compareValues=(f,h)=>f===h||!(!r.isValue(f)||!r.isValue(h)||f["@value"]!==h["@value"]||f["@type"]!==h["@type"]||f["@language"]!==h["@language"]||f["@index"]!==h["@index"])||!!(n.isObject(f)&&"@id"in f&&n.isObject(h)&&"@id"in h)&&f["@id"]===h["@id"],p.compareShortestLeast=(f,h)=>f.length{var r=t(9325).Symbol;s.exports=r},2552:(s,e,t)=>{var r=t(1873),n=t(659),a=t(9350),l=r?r.toStringTag:void 0;s.exports=function(d){return d==null?d===void 0?"[object Undefined]":"[object Null]":l&&l in Object(d)?n(d):a(d)}},4128:(s,e,t)=>{var r=t(1800),n=/^\s+/;s.exports=function(a){return a&&a.slice(0,r(a)+1).replace(n,"")}},4840:(s,e,t)=>{var r=typeof t.g=="object"&&t.g&&t.g.Object===Object&&t.g;s.exports=r},659:(s,e,t)=>{var r=t(1873),n=Object.prototype,a=n.hasOwnProperty,l=n.toString,d=r?r.toStringTag:void 0;s.exports=function(i){var o=a.call(i,d),c=i[d];try{i[d]=void 0;var p=!0}catch{}var v=l.call(i);return p&&(o?i[d]=c:delete i[d]),v}},9350:s=>{var e=Object.prototype.toString;s.exports=function(t){return e.call(t)}},9325:(s,e,t)=>{var r=t(4840),n=typeof self=="object"&&self&&self.Object===Object&&self,a=r||n||Function("return this")();s.exports=a},1800:s=>{var e=/\s/;s.exports=function(t){for(var r=t.length;r--&&e.test(t.charAt(r)););return r}},2177:(s,e,t)=>{var r=t(1489);s.exports=function(n,a){var l;if(typeof a!="function")throw new TypeError("Expected a function");return n=r(n),function(){return--n>0&&(l=a.apply(this,arguments)),n<=1&&(a=void 0),l}}},3805:s=>{s.exports=function(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}},346:s=>{s.exports=function(e){return e!=null&&typeof e=="object"}},4394:(s,e,t)=>{var r=t(2552),n=t(346);s.exports=function(a){return typeof a=="symbol"||n(a)&&r(a)=="[object Symbol]"}},8059:(s,e,t)=>{var r=t(2177);s.exports=function(n){return r(2,n)}},7400:(s,e,t)=>{var r=t(9374),n=1/0;s.exports=function(a){return a?(a=r(a))===n||a===-1/0?17976931348623157e292*(a<0?-1:1):a==a?a:0:a===0?a:0}},1489:(s,e,t)=>{var r=t(7400);s.exports=function(n){var a=r(n),l=a%1;return a==a?l?a-l:a:0}},9374:(s,e,t)=>{var r=t(4128),n=t(3805),a=t(4394),l=/^[-+]0x[0-9a-f]+$/i,d=/^0b[01]+$/i,i=/^0o[0-7]+$/i,o=parseInt;s.exports=function(c){if(typeof c=="number")return c;if(a(c))return NaN;if(n(c)){var p=typeof c.valueOf=="function"?c.valueOf():c;c=n(p)?p+"":p}if(typeof c!="string")return c===0?c:+c;c=r(c);var v=d.test(c);return v||i.test(c)?o(c.slice(2),v?2:8):l.test(c)?NaN:+c}},9749:(s,e,t)=>{const r=t(8799),n=Symbol("max"),a=Symbol("length"),l=Symbol("lengthCalculator"),d=Symbol("allowStale"),i=Symbol("maxAge"),o=Symbol("dispose"),c=Symbol("noDisposeOnSet"),p=Symbol("lruList"),v=Symbol("cache"),f=Symbol("updateAgeOnGet"),h=()=>1,w=(S,y,O)=>{const T=S[v].get(y);if(T){const k=T.value;if(g(S,k)){if(j(S,T),!S[d])return}else O&&(S[f]&&(T.value.now=Date.now()),S[p].unshiftNode(T));return k.value}},g=(S,y)=>{if(!y||!y.maxAge&&!S[i])return!1;const O=Date.now()-y.now;return y.maxAge?O>y.maxAge:S[i]&&O>S[i]},x=S=>{if(S[a]>S[n])for(let y=S[p].tail;S[a]>S[n]&&y!==null;){const O=y.prev;j(S,y),y=O}},j=(S,y)=>{if(y){const O=y.value;S[o]&&S[o](O.key,O.value),S[a]-=O.length,S[v].delete(O.key),S[p].removeNode(y)}};class A{constructor(y,O,T,k,b){this.key=y,this.value=O,this.length=T,this.now=k,this.maxAge=b||0}}const Q=(S,y,O,T)=>{let k=O.value;g(S,k)&&(j(S,O),S[d]||(k=void 0)),k&&y.call(T,k.value,k.key,S)};s.exports=class{constructor(S){if(typeof S=="number"&&(S={max:S}),S||(S={}),S.max&&(typeof S.max!="number"||S.max<0))throw new TypeError("max must be a non-negative number");this[n]=S.max||1/0;const y=S.length||h;if(this[l]=typeof y!="function"?h:y,this[d]=S.stale||!1,S.maxAge&&typeof S.maxAge!="number")throw new TypeError("maxAge must be a number");this[i]=S.maxAge||0,this[o]=S.dispose,this[c]=S.noDisposeOnSet||!1,this[f]=S.updateAgeOnGet||!1,this.reset()}set max(S){if(typeof S!="number"||S<0)throw new TypeError("max must be a non-negative number");this[n]=S||1/0,x(this)}get max(){return this[n]}set allowStale(S){this[d]=!!S}get allowStale(){return this[d]}set maxAge(S){if(typeof S!="number")throw new TypeError("maxAge must be a non-negative number");this[i]=S,x(this)}get maxAge(){return this[i]}set lengthCalculator(S){typeof S!="function"&&(S=h),S!==this[l]&&(this[l]=S,this[a]=0,this[p].forEach(y=>{y.length=this[l](y.value,y.key),this[a]+=y.length})),x(this)}get lengthCalculator(){return this[l]}get length(){return this[a]}get itemCount(){return this[p].length}rforEach(S,y){y=y||this;for(let O=this[p].tail;O!==null;){const T=O.prev;Q(this,S,O,y),O=T}}forEach(S,y){y=y||this;for(let O=this[p].head;O!==null;){const T=O.next;Q(this,S,O,y),O=T}}keys(){return this[p].toArray().map(S=>S.key)}values(){return this[p].toArray().map(S=>S.value)}reset(){this[o]&&this[p]&&this[p].length&&this[p].forEach(S=>this[o](S.key,S.value)),this[v]=new Map,this[p]=new r,this[a]=0}dump(){return this[p].map(S=>!g(this,S)&&{k:S.key,v:S.value,e:S.now+(S.maxAge||0)}).toArray().filter(S=>S)}dumpLru(){return this[p]}set(S,y,O){if((O=O||this[i])&&typeof O!="number")throw new TypeError("maxAge must be a number");const T=O?Date.now():0,k=this[l](y,S);if(this[v].has(S)){if(k>this[n])return j(this,this[v].get(S)),!1;const L=this[v].get(S).value;return this[o]&&(this[c]||this[o](S,L.value)),L.now=T,L.maxAge=O,L.value=y,this[a]+=k-L.length,L.length=k,this.get(S),x(this),!0}const b=new A(S,y,k,T,O);return b.length>this[n]?(this[o]&&this[o](S,y),!1):(this[a]+=b.length,this[p].unshift(b),this[v].set(S,this[p].head),x(this),!0)}has(S){if(!this[v].has(S))return!1;const y=this[v].get(S).value;return!g(this,y)}get(S){return w(this,S,!0)}peek(S){return w(this,S,!1)}pop(){const S=this[p].tail;return S?(j(this,S),S.value):null}del(S){j(this,this[v].get(S))}load(S){this.reset();const y=Date.now();for(let O=S.length-1;O>=0;O--){const T=S[O],k=T.e||0;if(k===0)this.set(T.k,T.v);else{const b=k-y;b>0&&this.set(T.k,T.v,b)}}}prune(){this[v].forEach((S,y)=>w(this,y,!1))}}},5606:s=>{var e,t,r=s.exports={};function n(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function l(w){if(e===setTimeout)return setTimeout(w,0);if((e===n||!e)&&setTimeout)return e=setTimeout,setTimeout(w,0);try{return e(w,0)}catch{try{return e.call(null,w,0)}catch{return e.call(this,w,0)}}}(function(){try{e=typeof setTimeout=="function"?setTimeout:n}catch{e=n}try{t=typeof clearTimeout=="function"?clearTimeout:a}catch{t=a}})();var d,i=[],o=!1,c=-1;function p(){o&&d&&(o=!1,d.length?i=d.concat(i):c=-1,i.length&&v())}function v(){if(!o){var w=l(p);o=!0;for(var g=i.length;g;){for(d=i,i=[];++c1)for(var x=1;x{let r;s.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:t.g):n=>(r||(r=Promise.resolve())).then(n).catch(a=>setTimeout(()=>{throw a},0))},989:(s,e,t)=>{s.exports=t(4005)},2985:s=>{s.exports=class Hr{constructor(t,r=new Map,n=0){this.prefix=t,this._existing=r,this.counter=n}clone(){const{prefix:t,_existing:r,counter:n}=this;return new Hr(t,new Map(r),n)}getId(t){const r=t&&this._existing.get(t);if(r)return r;const n=this.prefix+this.counter;return this.counter++,t&&this._existing.set(t,n),n}hasId(t){return this._existing.has(t)}getOldIds(){return[...this._existing.keys()]}}},3751:(s,e,t)=>{t(2791);const r=self.crypto||self.msCrypto;s.exports=class{constructor(n){if(!r||!r.subtle)throw new Error("crypto.subtle not found.");if(n==="sha256")this.algorithm={name:"SHA-256"};else{if(n!=="sha1")throw new Error(`Unsupported algorithm "${n}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(n){this._content+=n}async digest(){const n=new TextEncoder().encode(this._content),a=new Uint8Array(await r.subtle.digest(this.algorithm,n));let l="";for(let d=0;d{const e="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",t="http://www.w3.org/2001/XMLSchema#string",r="NamedNode",n="BlankNode",a="Literal",l="DefaultGraph",d={};(()=>{const c="(?:<([^:]+:[^>]*)>)",p="A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_",v=p+"0-9-·̀-ͯ‿-⁀",f="(_:(?:["+p+"0-9])(?:(?:["+v+".])*(?:["+v+"]))?)",h="[ \\t]+",w="[ \\t]*",g="(?:"+c+"|"+f+")"+h,x=c+h,j="(?:"+c+"|"+f+'|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^'+c+")|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))"+w,A="(?:\\.|(?:(?:"+c+"|"+f+")"+w+"\\.))";d.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,d.empty=new RegExp("^"+w+"$"),d.quad=new RegExp("^"+w+g+x+j+A+w+"$")})(),s.exports=class xt{static parse(p){const v=[],f={},h=p.split(d.eoln);let w=0;for(const j of h){if(w++,d.empty.test(j))continue;const A=j.match(d.quad);if(A===null)throw new Error("N-Quads parse error on line "+w+".");const Q={subject:null,predicate:null,object:null,graph:null};if(A[1]!==void 0?Q.subject={termType:r,value:A[1]}:Q.subject={termType:n,value:A[2]},Q.predicate={termType:r,value:A[3]},A[4]!==void 0?Q.object={termType:r,value:A[4]}:A[5]!==void 0?Q.object={termType:n,value:A[5]}:(Q.object={termType:a,value:void 0,datatype:{termType:r}},A[7]!==void 0?Q.object.datatype.value=A[7]:A[8]!==void 0?(Q.object.datatype.value=e,Q.object.language=A[8]):Q.object.datatype.value=t,Q.object.value=A[6].replace(o,function(S,y,O,T){if(y)switch(y){case"t":return" ";case"b":return"\b";case"n":return` +`;case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(O)return String.fromCharCode(parseInt(O,16));if(T)throw new Error("Unsupported U escape")})),A[9]!==void 0?Q.graph={termType:r,value:A[9]}:A[10]!==void 0?Q.graph={termType:n,value:A[10]}:Q.graph={termType:l,value:""},Q.graph.value in f){let S=!0;const y=f[Q.graph.value];for(const O of y)if(x=Q,(g=O).subject.termType===x.subject.termType&&g.object.termType===x.object.termType&&g.subject.value===x.subject.value&&g.predicate.value===x.predicate.value&&g.object.value===x.object.value&&(g.object.termType!==a||g.object.datatype.termType===x.object.datatype.termType&&g.object.language===x.object.language&&g.object.datatype.value===x.object.datatype.value)){S=!1;break}S&&(y.push(Q),v.push(Q))}else f[Q.graph.value]=[Q],v.push(Q)}var g,x;return v}static serialize(p){Array.isArray(p)||(p=xt.legacyDatasetToQuads(p));const v=[];for(const f of p)v.push(xt.serializeQuad(f));return v.sort().join("")}static serializeQuadComponents(p,v,f,h){let w="";return p.termType===r?w+=`<${p.value}>`:w+=`${p.value}`,w+=` <${v.value}> `,f.termType===r?w+=`<${f.value}>`:f.termType===n?w+=f.value:(w+=`"${function(g){return g.replace(i,function(x){switch(x){case'"':return'\\"';case"\\":return"\\\\";case` +`:return"\\n";case"\r":return"\\r"}})}(f.value)}"`,f.datatype.value===e?f.language&&(w+=`@${f.language}`):f.datatype.value!==t&&(w+=`^^<${f.datatype.value}>`)),h.termType===r?w+=` <${h.value}>`:h.termType===n&&(w+=` ${h.value}`),w+=` . +`,w}static serializeQuad(p){return xt.serializeQuadComponents(p.subject,p.predicate,p.object,p.graph)}static legacyDatasetToQuads(p){const v=[],f={"blank node":n,IRI:r,literal:a};for(const h in p)p[h].forEach(w=>{const g={};for(const x in w){const j=w[x],A={termType:f[j.type],value:j.value};A.termType===a&&(A.datatype={termType:r},"datatype"in j&&(A.datatype.value=j.datatype),"language"in j?("datatype"in j||(A.datatype.value=e),A.language=j.language):"datatype"in j||(A.datatype.value=t)),g[x]=A}g.graph=h==="@default"?{termType:l,value:""}:{termType:h.startsWith("_:")?n:r,value:h},v.push(g)});return v}};const i=/["\\\n\r]/g,o=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},9925:s=>{s.exports=class{constructor(e){this.current=e.sort(),this.done=!1,this.dir=new Map;for(let t=0;tn)&&(o&&d>0&&i>e[d-1]||!o&&de[d+1])&&(n=i,a=d)}if(n===null)this.done=!0;else{const d=t.get(n)?a-1:a+1;e[a]=e[d],e[d]=n;for(const i of e)i>n&&t.set(i,!t.get(i))}return r}}},3513:(s,e,t)=>{const r=t(2985),n=t(3751),a=t(9925),l=t(1227);function d(i,o){return i.hasho.hash?1:0}s.exports=class{constructor({createMessageDigest:i=()=>new n("sha256"),canonicalIdMap:o=new Map,maxDeepIterations:c=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new r("_:c14n",o),this.createMessageDigest=i,this.maxDeepIterations=c,this.quads=null,this.deepIterations=null}async main(i){this.deepIterations=new Map,this.quads=i;for(const w of i)this._addBlankNodeQuadInfo({quad:w,component:w.subject}),this._addBlankNodeQuadInfo({quad:w,component:w.object}),this._addBlankNodeQuadInfo({quad:w,component:w.graph});const o=new Map,c=[...this.blankNodeInfo.keys()];let p=0;for(const w of c)++p%100==0&&await this._yield(),await this._hashAndTrackBlankNode({id:w,hashToBlankNodes:o});const v=[...o.keys()].sort(),f=[];for(const w of v){const g=o.get(w);if(g.length>1){f.push(g);continue}const x=g[0];this.canonicalIssuer.getId(x)}for(const w of f){const g=[];for(const x of w){if(this.canonicalIssuer.hasId(x))continue;const j=new r("_:b");j.getId(x);const A=await this.hashNDegreeQuads(x,j);g.push(A)}g.sort(d);for(const x of g){const j=x.issuer.getOldIds();for(const A of j)this.canonicalIssuer.getId(A)}}const h=[];for(const w of this.quads){const g=l.serializeQuadComponents(this._componentWithCanonicalId(w.subject),w.predicate,this._componentWithCanonicalId(w.object),this._componentWithCanonicalId(w.graph));h.push(g)}return h.sort(),h.join("")}async hashFirstDegreeQuads(i){const o=[],c=this.blankNodeInfo.get(i),p=c.quads;for(const f of p){const h={subject:null,predicate:f.predicate,object:null,graph:null};h.subject=this.modifyFirstDegreeComponent(i,f.subject,"subject"),h.object=this.modifyFirstDegreeComponent(i,f.object,"object"),h.graph=this.modifyFirstDegreeComponent(i,f.graph,"graph"),o.push(l.serializeQuad(h))}o.sort();const v=this.createMessageDigest();for(const f of o)v.update(f);return c.hash=await v.digest(),c.hash}async hashRelatedBlankNode(i,o,c,p){let v;v=this.canonicalIssuer.hasId(i)?this.canonicalIssuer.getId(i):c.hasId(i)?c.getId(i):this.blankNodeInfo.get(i).hash;const f=this.createMessageDigest();return f.update(p),p!=="g"&&f.update(this.getRelatedPredicate(o)),f.update(v),f.digest()}async hashNDegreeQuads(i,o){const c=this.deepIterations.get(i)||0;if(c>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(i,c+1);const p=this.createMessageDigest(),v=await this.createHashToRelated(i,o),f=[...v.keys()].sort();for(const h of f){p.update(h);let w,g="";const x=new a(v.get(h));let j=0;for(;x.hasNext();){const A=x.next();++j%3==0&&await this._yield();let Q=o.clone(),S="";const y=[];let O=!1;for(const T of A)if(this.canonicalIssuer.hasId(T)?S+=this.canonicalIssuer.getId(T):(Q.hasId(T)||y.push(T),S+=Q.getId(T)),g.length!==0&&S>g){O=!0;break}if(!O){for(const T of y){const k=await this.hashNDegreeQuads(T,Q);if(S+=Q.getId(T),S+=`<${k.hash}>`,Q=k.issuer,g.length!==0&&S>g){O=!0;break}}O||(g.length===0||S`}async createHashToRelated(i,o){const c=new Map,p=this.blankNodeInfo.get(i).quads;let v=0;for(const f of p)++v%100==0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:f,component:f.subject,position:"s",id:i,issuer:o,hashToRelated:c}),this._addRelatedBlankNodeHash({quad:f,component:f.object,position:"o",id:i,issuer:o,hashToRelated:c}),this._addRelatedBlankNodeHash({quad:f,component:f.graph,position:"g",id:i,issuer:o,hashToRelated:c})]);return c}async _hashAndTrackBlankNode({id:i,hashToBlankNodes:o}){const c=await this.hashFirstDegreeQuads(i),p=o.get(c);p?p.push(i):o.set(c,[i])}_addBlankNodeQuadInfo({quad:i,component:o}){if(o.termType!=="BlankNode")return;const c=o.value,p=this.blankNodeInfo.get(c);p?p.quads.add(i):this.blankNodeInfo.set(c,{quads:new Set([i]),hash:null})}async _addRelatedBlankNodeHash({quad:i,component:o,position:c,id:p,issuer:v,hashToRelated:f}){if(o.termType!=="BlankNode"||o.value===p)return;const h=o.value,w=await this.hashRelatedBlankNode(h,i,v,c),g=f.get(w);g?g.push(h):f.set(w,[h])}_componentWithCanonicalId(i){return i.termType!=="BlankNode"||i.value.startsWith(this.canonicalIssuer.prefix)?i:{termType:"BlankNode",value:this.canonicalIssuer.getId(i.value)}}async _yield(){return new Promise(i=>setImmediate(i))}}},2438:(s,e,t)=>{const r=t(2985),n=t(3751),a=t(9925),l=t(1227);function d(i,o){return i.hasho.hash?1:0}s.exports=class{constructor({createMessageDigest:i=()=>new n("sha256"),canonicalIdMap:o=new Map,maxDeepIterations:c=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new r("_:c14n",o),this.createMessageDigest=i,this.maxDeepIterations=c,this.quads=null,this.deepIterations=null}main(i){this.deepIterations=new Map,this.quads=i;for(const h of i)this._addBlankNodeQuadInfo({quad:h,component:h.subject}),this._addBlankNodeQuadInfo({quad:h,component:h.object}),this._addBlankNodeQuadInfo({quad:h,component:h.graph});const o=new Map,c=[...this.blankNodeInfo.keys()];for(const h of c)this._hashAndTrackBlankNode({id:h,hashToBlankNodes:o});const p=[...o.keys()].sort(),v=[];for(const h of p){const w=o.get(h);if(w.length>1){v.push(w);continue}const g=w[0];this.canonicalIssuer.getId(g)}for(const h of v){const w=[];for(const g of h){if(this.canonicalIssuer.hasId(g))continue;const x=new r("_:b");x.getId(g);const j=this.hashNDegreeQuads(g,x);w.push(j)}w.sort(d);for(const g of w){const x=g.issuer.getOldIds();for(const j of x)this.canonicalIssuer.getId(j)}}const f=[];for(const h of this.quads){const w=l.serializeQuadComponents(this._componentWithCanonicalId({component:h.subject}),h.predicate,this._componentWithCanonicalId({component:h.object}),this._componentWithCanonicalId({component:h.graph}));f.push(w)}return f.sort(),f.join("")}hashFirstDegreeQuads(i){const o=[],c=this.blankNodeInfo.get(i),p=c.quads;for(const f of p){const h={subject:null,predicate:f.predicate,object:null,graph:null};h.subject=this.modifyFirstDegreeComponent(i,f.subject,"subject"),h.object=this.modifyFirstDegreeComponent(i,f.object,"object"),h.graph=this.modifyFirstDegreeComponent(i,f.graph,"graph"),o.push(l.serializeQuad(h))}o.sort();const v=this.createMessageDigest();for(const f of o)v.update(f);return c.hash=v.digest(),c.hash}hashRelatedBlankNode(i,o,c,p){let v;v=this.canonicalIssuer.hasId(i)?this.canonicalIssuer.getId(i):c.hasId(i)?c.getId(i):this.blankNodeInfo.get(i).hash;const f=this.createMessageDigest();return f.update(p),p!=="g"&&f.update(this.getRelatedPredicate(o)),f.update(v),f.digest()}hashNDegreeQuads(i,o){const c=this.deepIterations.get(i)||0;if(c>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(i,c+1);const p=this.createMessageDigest(),v=this.createHashToRelated(i,o),f=[...v.keys()].sort();for(const h of f){p.update(h);let w,g="";const x=new a(v.get(h));for(;x.hasNext();){const j=x.next();let A=o.clone(),Q="";const S=[];let y=!1;for(const O of j)if(this.canonicalIssuer.hasId(O)?Q+=this.canonicalIssuer.getId(O):(A.hasId(O)||S.push(O),Q+=A.getId(O)),g.length!==0&&Q>g){y=!0;break}if(!y){for(const O of S){const T=this.hashNDegreeQuads(O,A);if(Q+=A.getId(O),Q+=`<${T.hash}>`,A=T.issuer,g.length!==0&&Q>g){y=!0;break}}y||(g.length===0||Q`}createHashToRelated(i,o){const c=new Map,p=this.blankNodeInfo.get(i).quads;for(const v of p)this._addRelatedBlankNodeHash({quad:v,component:v.subject,position:"s",id:i,issuer:o,hashToRelated:c}),this._addRelatedBlankNodeHash({quad:v,component:v.object,position:"o",id:i,issuer:o,hashToRelated:c}),this._addRelatedBlankNodeHash({quad:v,component:v.graph,position:"g",id:i,issuer:o,hashToRelated:c});return c}_hashAndTrackBlankNode({id:i,hashToBlankNodes:o}){const c=this.hashFirstDegreeQuads(i),p=o.get(c);p?p.push(i):o.set(c,[i])}_addBlankNodeQuadInfo({quad:i,component:o}){if(o.termType!=="BlankNode")return;const c=o.value,p=this.blankNodeInfo.get(c);p?p.quads.add(i):this.blankNodeInfo.set(c,{quads:new Set([i]),hash:null})}_addRelatedBlankNodeHash({quad:i,component:o,position:c,id:p,issuer:v,hashToRelated:f}){if(o.termType!=="BlankNode"||o.value===p)return;const h=o.value,w=this.hashRelatedBlankNode(h,i,v,c),g=f.get(w);g?g.push(h):f.set(w,[h])}_componentWithCanonicalId({component:i}){return i.termType!=="BlankNode"||i.value.startsWith(this.canonicalIssuer.prefix)?i:{termType:"BlankNode",value:this.canonicalIssuer.getId(i.value)}}}},3845:(s,e,t)=>{const r=t(3751),n=t(3513);s.exports=class extends n{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new r("sha1")}modifyFirstDegreeComponent(a,l,d){return l.termType!=="BlankNode"?l:d==="graph"?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:l.value===a?"_:a":"_:z"}}getRelatedPredicate(a){return a.predicate.value}async createHashToRelated(a,l){const d=new Map,i=this.blankNodeInfo.get(a).quads;let o=0;for(const c of i){let p,v;if(c.subject.termType==="BlankNode"&&c.subject.value!==a)v=c.subject.value,p="p";else{if(c.object.termType!=="BlankNode"||c.object.value===a)continue;v=c.object.value,p="r"}++o%100==0&&await this._yield();const f=await this.hashRelatedBlankNode(v,c,l,p),h=d.get(f);h?h.push(v):d.set(f,[v])}return d}}},378:(s,e,t)=>{const r=t(3751),n=t(2438);s.exports=class extends n{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new r("sha1")}modifyFirstDegreeComponent(a,l,d){return l.termType!=="BlankNode"?l:d==="graph"?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:l.value===a?"_:a":"_:z"}}getRelatedPredicate(a){return a.predicate.value}createHashToRelated(a,l){const d=new Map,i=this.blankNodeInfo.get(a).quads;for(const o of i){let c,p;if(o.subject.termType==="BlankNode"&&o.subject.value!==a)p=o.subject.value,c="p";else{if(o.object.termType!=="BlankNode"||o.object.value===a)continue;p=o.object.value,c="r"}const v=this.hashRelatedBlankNode(p,o,l,c),f=d.get(v);f?f.push(p):d.set(v,[p])}return d}}},4005:(s,e,t)=>{const r=t(3513),n=t(3845),a=t(2438),l=t(378);let d;try{d=t(7789)}catch{}function i(o){return Array.isArray(o)?o:e.NQuads.legacyDatasetToQuads(o)}e.NQuads=t(1227),e.IdentifierIssuer=t(2985),e._rdfCanonizeNative=function(o){return o&&(d=o),d},e.canonize=async function(o,c){const p=i(o);if(c.useNative){if(!d)throw new Error("rdf-canonize-native not available");if(c.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise((v,f)=>d.canonize(p,c,(h,w)=>h?f(h):v(w)))}if(c.algorithm==="URDNA2015")return new r(c).main(p);if(c.algorithm==="URGNA2012"){if(c.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new n(c).main(p)}throw"algorithm"in c?new Error("Invalid RDF Dataset Canonicalization algorithm: "+c.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")},e._canonizeSync=function(o,c){const p=i(o);if(c.useNative){if(!d)throw new Error("rdf-canonize-native not available");if(c.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return d.canonizeSync(p,c)}if(c.algorithm==="URDNA2015")return new a(c).main(p);if(c.algorithm==="URGNA2012"){if(c.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new l(c).main(p)}throw"algorithm"in c?new Error("Invalid RDF Dataset Canonicalization algorithm: "+c.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}},7793:function(s,e,t){var r=this&&this.__createBinding||(Object.create?function(a,l,d,i){i===void 0&&(i=d),Object.defineProperty(a,i,{enumerable:!0,get:function(){return l[d]}})}:function(a,l,d,i){i===void 0&&(i=d),a[i]=l[d]}),n=this&&this.__exportStar||function(a,l){for(var d in a)d==="default"||Object.prototype.hasOwnProperty.call(l,d)||r(l,a,d)};Object.defineProperty(e,"__esModule",{value:!0}),n(t(9931),e),n(t(8483),e),n(t(2142),e),n(t(2426),e),n(t(3988),e),n(t(6754),e),n(t(8401),e)},9931:(s,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BlankNode=void 0,e.BlankNode=class{constructor(t){this.termType="BlankNode",this.value=t}equals(t){return!!t&&t.termType==="BlankNode"&&t.value===this.value}}},8483:(s,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DataFactory=void 0;const r=t(9931),n=t(2142),a=t(2426),l=t(3988),d=t(6754),i=t(8401);let o=0;e.DataFactory=class{constructor(c){this.blankNodeCounter=0,c=c||{},this.blankNodePrefix=c.blankNodePrefix||`df_${o++}_`}namedNode(c){return new l.NamedNode(c)}blankNode(c){return new r.BlankNode(c||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(c,p){return new a.Literal(c,p)}variable(c){return new i.Variable(c)}defaultGraph(){return n.DefaultGraph.INSTANCE}quad(c,p,v,f){return new d.Quad(c,p,v,f||this.defaultGraph())}fromTerm(c){switch(c.termType){case"NamedNode":return this.namedNode(c.value);case"BlankNode":return this.blankNode(c.value);case"Literal":return c.language?this.literal(c.value,c.language):c.datatype.equals(a.Literal.XSD_STRING)?this.literal(c.value):this.literal(c.value,this.fromTerm(c.datatype));case"Variable":return this.variable(c.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(c.subject),this.fromTerm(c.predicate),this.fromTerm(c.object),this.fromTerm(c.graph))}}fromQuad(c){return this.fromTerm(c)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},2142:(s,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DefaultGraph=void 0;class t{constructor(){this.termType="DefaultGraph",this.value=""}equals(n){return!!n&&n.termType==="DefaultGraph"}}e.DefaultGraph=t,t.INSTANCE=new t},2426:(s,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Literal=void 0;const r=t(3988);class n{constructor(l,d){this.termType="Literal",this.value=l,typeof d=="string"?(this.language=d,this.datatype=n.RDF_LANGUAGE_STRING):d?(this.language="",this.datatype=d):(this.language="",this.datatype=n.XSD_STRING)}equals(l){return!!l&&l.termType==="Literal"&&l.value===this.value&&l.language===this.language&&this.datatype.equals(l.datatype)}}e.Literal=n,n.RDF_LANGUAGE_STRING=new r.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),n.XSD_STRING=new r.NamedNode("http://www.w3.org/2001/XMLSchema#string")},3988:(s,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NamedNode=void 0,e.NamedNode=class{constructor(t){this.termType="NamedNode",this.value=t}equals(t){return!!t&&t.termType==="NamedNode"&&t.value===this.value}}},6754:(s,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Quad=void 0,e.Quad=class{constructor(t,r,n,a){this.termType="Quad",this.value="",this.subject=t,this.predicate=r,this.object=n,this.graph=a}equals(t){return!!t&&(t.termType==="Quad"||!t.termType)&&this.subject.equals(t.subject)&&this.predicate.equals(t.predicate)&&this.object.equals(t.object)&&this.graph.equals(t.graph)}}},8401:(s,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Variable=void 0,e.Variable=class{constructor(t){this.termType="Variable",this.value=t}equals(t){return!!t&&t.termType==="Variable"&&t.value===this.value}}},9349:function(s,e,t){var r=this&&this.__createBinding||(Object.create?function(p,v,f,h){h===void 0&&(h=f);var w=Object.getOwnPropertyDescriptor(v,f);w&&!("get"in w?!v.__esModule:w.writable||w.configurable)||(w={enumerable:!0,get:function(){return v[f]}}),Object.defineProperty(p,h,w)}:function(p,v,f,h){h===void 0&&(h=f),p[h]=v[f]}),n=this&&this.__exportStar||function(p,v){for(var f in p)f==="default"||Object.prototype.hasOwnProperty.call(v,f)||r(v,p,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.getSupportedJavaScriptPrimitives=e.getSupportedRdfDatatypes=e.getTermRaw=e.toRdf=e.fromRdf=void 0;const a=t(7793),l=t(4802),d=t(103);n(t(4802),e),n(t(5448),e),n(t(103),e);const i=new a.DataFactory,o=new d.Translator;function c(p,v){return o.fromRdf(p,v)}o.registerHandler(new l.TypeHandlerString,l.TypeHandlerString.TYPES.map(p=>i.namedNode(p)),["string"]),o.registerHandler(new l.TypeHandlerBoolean,[l.TypeHandlerBoolean.TYPE].map(p=>i.namedNode(p)),["boolean"]),o.registerHandler(new l.TypeHandlerNumberDouble,l.TypeHandlerNumberDouble.TYPES.map(p=>i.namedNode(p)),["number"]),o.registerHandler(new l.TypeHandlerNumberInteger,l.TypeHandlerNumberInteger.TYPES.map(p=>i.namedNode(p)),["number"]),o.registerHandler(new l.TypeHandlerDate,l.TypeHandlerDate.TYPES.map(p=>i.namedNode(p)),["object"]),e.fromRdf=c,e.toRdf=function(p,v){return v&&"namedNode"in v&&(v={dataFactory:v}),(v=v||{})&&!v.dataFactory&&(v.dataFactory=i),o.toRdf(p,v)},e.getTermRaw=function(p,v){return p.termType==="Literal"?c(p,v):p.value},e.getSupportedRdfDatatypes=function(){return o.getSupportedRdfDatatypes()},e.getSupportedJavaScriptPrimitives=function(){return o.getSupportedJavaScriptPrimitives()}},5448:(s,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},103:(s,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Translator=void 0,e.Translator=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(t){throw new Error(`Invalid RDF ${t.datatype.value} value: '${t.value}'`)}registerHandler(t,r,n){for(const a of r)this.supportedRdfDatatypes.push(a),this.fromRdfHandlers[a.value]=t;for(const a of n){let l=this.toRdfHandlers[a];l||(this.toRdfHandlers[a]=l=[]),l.push(t)}}fromRdf(t,r){const n=this.fromRdfHandlers[t.datatype.value];return n?n.fromRdf(t,r):t.value}toRdf(t,r){const n=this.toRdfHandlers[typeof t];if(n)for(const a of n){const l=a.toRdf(t,r);if(l)return l}throw new Error(`Invalid JavaScript value: '${t}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},92:(s,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerBoolean=void 0;const r=t(103);class n{fromRdf(l,d){switch(l.value){case"true":case"1":return!0;case"false":case"0":return!1}return d&&r.Translator.incorrectRdfDataType(l),!1}toRdf(l,{datatype:d,dataFactory:i}){return i.literal(l?"true":"false",d||i.namedNode(n.TYPE))}}n.TYPE="http://www.w3.org/2001/XMLSchema#boolean",e.TypeHandlerBoolean=n},7258:(s,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerDate=void 0;const r=t(103);class n{fromRdf(l,d){switch(d&&!l.value.match(n.VALIDATORS[l.datatype.value.substr(33,l.datatype.value.length)])&&r.Translator.incorrectRdfDataType(l),l.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(l.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":const i=l.value.split("-");return new Date(0,parseInt(i[0],10)-1,parseInt(i[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(l.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(l.value+"-01");default:return new Date(l.value)}}toRdf(l,{datatype:d,dataFactory:i}){if(d=d||i.namedNode(n.TYPES[0]),!(l instanceof Date))return null;const o=l;let c;switch(d.value){case"http://www.w3.org/2001/XMLSchema#gDay":c=String(o.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":c=o.getUTCMonth()+1+"-"+o.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":c=String(o.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":c=o.getUTCFullYear()+"-"+(o.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":c=o.toISOString().replace(/T.*$/,"");break;default:c=o.toISOString()}return i.literal(c,d)}}n.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"],n.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]$/},e.TypeHandlerDate=n},2406:(s,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerNumberDouble=void 0;const r=t(103);class n{fromRdf(l,d){const i=parseFloat(l.value);return d&&isNaN(i)&&r.Translator.incorrectRdfDataType(l),i}toRdf(l,{datatype:d,dataFactory:i}){return d=d||i.namedNode(n.TYPES[0]),isNaN(l)?i.literal("NaN",d):isFinite(l)?l%1==0?null:i.literal(l.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),d):i.literal(l>0?"INF":"-INF",d)}}n.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"],e.TypeHandlerNumberDouble=n},6925:(s,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerNumberInteger=void 0;const r=t(103);class n{fromRdf(l,d){const i=parseInt(l.value,10);return d&&(isNaN(i)||l.value.indexOf(".")>=0)&&r.Translator.incorrectRdfDataType(l),i}toRdf(l,{datatype:d,dataFactory:i}){return i.literal(String(l),d||(l<=n.MAX_INT&&l>=n.MIN_INT?i.namedNode(n.TYPES[0]):i.namedNode(n.TYPES[1])))}}n.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"],n.MAX_INT=2147483647,n.MIN_INT=-2147483648,e.TypeHandlerNumberInteger=n},4191:(s,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerString=void 0;class t{fromRdf(n){return n.value}toRdf(n,{datatype:a,dataFactory:l}){return l.literal(n,a)}}t.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"],e.TypeHandlerString=t},4802:function(s,e,t){var r=this&&this.__createBinding||(Object.create?function(a,l,d,i){i===void 0&&(i=d);var o=Object.getOwnPropertyDescriptor(l,d);o&&!("get"in o?!l.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(a,i,o)}:function(a,l,d,i){i===void 0&&(i=d),a[i]=l[d]}),n=this&&this.__exportStar||function(a,l){for(var d in a)d==="default"||Object.prototype.hasOwnProperty.call(l,d)||r(l,a,d)};Object.defineProperty(e,"__esModule",{value:!0}),n(t(92),e),n(t(7258),e),n(t(2406),e),n(t(6925),e),n(t(4191),e)},4147:(s,e,t)=>{const{SymbolDispose:r}=t(4134),{AbortError:n,codes:a}=t(6371),{isNodeStream:l,isWebStream:d,kControllerErrorFunction:i}=t(6115),o=t(6238),{ERR_INVALID_ARG_TYPE:c}=a;let p;s.exports.addAbortSignal=function(v,f){if((h=>{if(typeof h!="object"||!("aborted"in h))throw new c("signal","AbortSignal",h)})(v),!l(f)&&!d(f))throw new c("stream",["ReadableStream","WritableStream","Stream"],f);return s.exports.addAbortSignalNoValidate(v,f)},s.exports.addAbortSignalNoValidate=function(v,f){if(typeof v!="object"||!("aborted"in v))return f;const h=l(f)?()=>{f.destroy(new n(void 0,{cause:v.reason}))}:()=>{f[i](new n(void 0,{cause:v.reason}))};if(v.aborted)h();else{p=p||t(7760).addAbortListener;const w=p(v,h);o(f,w[r])}return f}},345:(s,e,t)=>{const{StringPrototypeSlice:r,SymbolIterator:n,TypedArrayPrototypeSet:a,Uint8Array:l}=t(4134),{Buffer:d}=t(8287),{inspect:i}=t(7760);s.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(o){const c={data:o,next:null};this.length>0?this.tail.next=c:this.head=c,this.tail=c,++this.length}unshift(o){const c={data:o,next:this.head};this.length===0&&(this.tail=c),this.head=c,++this.length}shift(){if(this.length===0)return;const o=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,o}clear(){this.head=this.tail=null,this.length=0}join(o){if(this.length===0)return"";let c=this.head,p=""+c.data;for(;(c=c.next)!==null;)p+=o+c.data;return p}concat(o){if(this.length===0)return d.alloc(0);const c=d.allocUnsafe(o>>>0);let p=this.head,v=0;for(;p;)a(c,p.data,v),v+=p.data.length,p=p.next;return c}consume(o,c){const p=this.head.data;if(of.length)){o===f.length?(c+=f,++v,p.next?this.head=p.next:this.head=this.tail=null):(c+=r(f,0,o),this.head=p,p.data=r(f,o));break}c+=f,o-=f.length,++v}while((p=p.next)!==null);return this.length-=v,c}_getBuffer(o){const c=d.allocUnsafe(o),p=o;let v=this.head,f=0;do{const h=v.data;if(!(o>h.length)){o===h.length?(a(c,h,p-o),++f,v.next?this.head=v.next:this.head=this.tail=null):(a(c,new l(h.buffer,h.byteOffset,o),p-o),this.head=v,v.data=h.slice(o));break}a(c,h,p-o),o-=h.length,++f}while((v=v.next)!==null);return this.length-=f,c}[Symbol.for("nodejs.util.inspect.custom")](o,c){return i(this,{...c,depth:0,customInspect:!1})}}},7830:(s,e,t)=>{const{pipeline:r}=t(7758),n=t(3370),{destroyer:a}=t(5896),{isNodeStream:l,isReadable:d,isWritable:i,isWebStream:o,isTransformStream:c,isWritableStream:p,isReadableStream:v}=t(6115),{AbortError:f,codes:{ERR_INVALID_ARG_VALUE:h,ERR_MISSING_ARGS:w}}=t(6371),g=t(6238);s.exports=function(...x){if(x.length===0)throw new w("streams");if(x.length===1)return n.from(x[0]);const j=[...x];if(typeof x[0]=="function"&&(x[0]=n.from(x[0])),typeof x[x.length-1]=="function"){const N=x.length-1;x[N]=n.from(x[N])}for(let N=0;N0&&!(i(x[N])||p(x[N])||c(x[N])))throw new h(`streams[${N}]`,j[N],"must be writable")}let A,Q,S,y,O;const T=x[0],k=r(x,function(N){const K=y;y=null,K?K(N):N?O.destroy(N):L||b||O.destroy()}),b=!!(i(T)||p(T)||c(T)),L=!!(d(k)||v(k)||c(k));if(O=new n({writableObjectMode:!(T==null||!T.writableObjectMode),readableObjectMode:!(k==null||!k.readableObjectMode),writable:b,readable:L}),b){if(l(T))O._write=function(K,se,q){T.write(K,se)?q():A=q},O._final=function(K){T.end(),Q=K},T.on("drain",function(){if(A){const K=A;A=null,K()}});else if(o(T)){const K=(c(T)?T.writable:T).getWriter();O._write=async function(se,q,C){try{await K.ready,K.write(se).catch(()=>{}),C()}catch(X){C(X)}},O._final=async function(se){try{await K.ready,K.close().catch(()=>{}),Q=se}catch(q){se(q)}}}const N=c(k)?k.readable:k;g(N,()=>{if(Q){const K=Q;Q=null,K()}})}if(L){if(l(k))k.on("readable",function(){if(S){const N=S;S=null,N()}}),k.on("end",function(){O.push(null)}),O._read=function(){for(;;){const N=k.read();if(N===null)return void(S=O._read);if(!O.push(N))return}};else if(o(k)){const N=(c(k)?k.readable:k).getReader();O._read=async function(){for(;;)try{const{value:K,done:se}=await N.read();if(!O.push(K))return;if(se)return void O.push(null)}catch{return}}}}return O._destroy=function(N,K){N||y===null||(N=new f),S=null,A=null,Q=null,y===null?K(N):(y=K,l(k)&&a(k,N))},O}},5896:(s,e,t)=>{const r=t(5606),{aggregateTwoErrors:n,codes:{ERR_MULTIPLE_CALLBACK:a},AbortError:l}=t(6371),{Symbol:d}=t(4134),{kIsDestroyed:i,isDestroyed:o,isFinished:c,isServerRequest:p}=t(6115),v=d("kDestroy"),f=d("kConstruct");function h(k,b,L){k&&(k.stack,b&&!b.errored&&(b.errored=k),L&&!L.errored&&(L.errored=k))}function w(k,b,L){let N=!1;function K(se){if(N)return;N=!0;const q=k._readableState,C=k._writableState;h(se,C,q),C&&(C.closed=!0),q&&(q.closed=!0),typeof L=="function"&&L(se),se?r.nextTick(g,k,se):r.nextTick(x,k)}try{k._destroy(b||null,K)}catch(se){K(se)}}function g(k,b){j(k,b),x(k)}function x(k){const b=k._readableState,L=k._writableState;L&&(L.closeEmitted=!0),b&&(b.closeEmitted=!0),(L!=null&&L.emitClose||b!=null&&b.emitClose)&&k.emit("close")}function j(k,b){const L=k._readableState,N=k._writableState;N!=null&&N.errorEmitted||L!=null&&L.errorEmitted||(N&&(N.errorEmitted=!0),L&&(L.errorEmitted=!0),k.emit("error",b))}function A(k,b,L){const N=k._readableState,K=k._writableState;if(K!=null&&K.destroyed||N!=null&&N.destroyed)return this;N!=null&&N.autoDestroy||K!=null&&K.autoDestroy?k.destroy(b):b&&(b.stack,K&&!K.errored&&(K.errored=b),N&&!N.errored&&(N.errored=b),L?r.nextTick(j,k,b):j(k,b))}function Q(k){let b=!1;function L(N){if(b)return void A(k,N??new a);b=!0;const K=k._readableState,se=k._writableState,q=se||K;K&&(K.constructed=!0),se&&(se.constructed=!0),q.destroyed?k.emit(v,N):N?A(k,N,!0):r.nextTick(S,k)}try{k._construct(N=>{r.nextTick(L,N)})}catch(N){r.nextTick(L,N)}}function S(k){k.emit(f)}function y(k){return(k==null?void 0:k.setHeader)&&typeof k.abort=="function"}function O(k){k.emit("close")}function T(k,b){k.emit("error",b),r.nextTick(O,k)}s.exports={construct:function(k,b){if(typeof k._construct!="function")return;const L=k._readableState,N=k._writableState;L&&(L.constructed=!1),N&&(N.constructed=!1),k.once(f,b),k.listenerCount(f)>1||r.nextTick(Q,k)},destroyer:function(k,b){k&&!o(k)&&(b||c(k)||(b=new l),p(k)?(k.socket=null,k.destroy(b)):y(k)?k.abort():y(k.req)?k.req.abort():typeof k.destroy=="function"?k.destroy(b):typeof k.close=="function"?k.close():b?r.nextTick(T,k,b):r.nextTick(O,k),k.destroyed||(k[i]=!0))},destroy:function(k,b){const L=this._readableState,N=this._writableState,K=N||L;return N!=null&&N.destroyed||L!=null&&L.destroyed?(typeof b=="function"&&b(),this):(h(k,N,L),N&&(N.destroyed=!0),L&&(L.destroyed=!0),K.constructed?w(this,k,b):this.once(v,function(se){w(this,n(se,k),b)}),this)},undestroy:function(){const k=this._readableState,b=this._writableState;k&&(k.constructed=!0,k.closed=!1,k.closeEmitted=!1,k.destroyed=!1,k.errored=null,k.errorEmitted=!1,k.reading=!1,k.ended=k.readable===!1,k.endEmitted=k.readable===!1),b&&(b.constructed=!0,b.destroyed=!1,b.closed=!1,b.closeEmitted=!1,b.errored=null,b.errorEmitted=!1,b.finalCalled=!1,b.prefinished=!1,b.ended=b.writable===!1,b.ending=b.writable===!1,b.finished=b.writable===!1)},errorOrDestroy:A}},3370:(s,e,t)=>{const{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:n,ObjectKeys:a,ObjectSetPrototypeOf:l}=t(4134);s.exports=o;const d=t(7576),i=t(8584);l(o.prototype,d.prototype),l(o,d);{const f=a(i.prototype);for(let h=0;h{const r=t(5606),n=t(8287),{isReadable:a,isWritable:l,isIterable:d,isNodeStream:i,isReadableNodeStream:o,isWritableNodeStream:c,isDuplexNodeStream:p,isReadableStream:v,isWritableStream:f}=t(6115),h=t(6238),{AbortError:w,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:x}}=t(6371),{destroyer:j}=t(5896),A=t(3370),Q=t(7576),S=t(8584),{createDeferredPromise:y}=t(7760),O=t(6532),T=globalThis.Blob||n.Blob,k=T!==void 0?function(se){return se instanceof T}:function(se){return!1},b=globalThis.AbortController||t(5568).AbortController,{FunctionPrototypeCall:L}=t(4134);class N extends A{constructor(q){super(q),(q==null?void 0:q.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(q==null?void 0:q.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}function K(se){const q=se.readable&&typeof se.readable.read!="function"?Q.wrap(se.readable):se.readable,C=se.writable;let X,I,B,U,P,J=!!a(q),D=!!l(C);function V(te){const le=U;U=null,le?le(te):te&&P.destroy(te)}return P=new N({readableObjectMode:!(q==null||!q.readableObjectMode),writableObjectMode:!(C==null||!C.writableObjectMode),readable:J,writable:D}),D&&(h(C,te=>{D=!1,te&&j(q,te),V(te)}),P._write=function(te,le,ee){C.write(te,le)?ee():X=ee},P._final=function(te){C.end(),I=te},C.on("drain",function(){if(X){const te=X;X=null,te()}}),C.on("finish",function(){if(I){const te=I;I=null,te()}})),J&&(h(q,te=>{J=!1,te&&j(q,te),V(te)}),q.on("readable",function(){if(B){const te=B;B=null,te()}}),q.on("end",function(){P.push(null)}),P._read=function(){for(;;){const te=q.read();if(te===null)return void(B=P._read);if(!P.push(te))return}}),P._destroy=function(te,le){te||U===null||(te=new w),B=null,X=null,I=null,U===null?le(te):(U=le,j(C,te),j(q,te))},P}s.exports=function se(q,C){if(p(q))return q;if(o(q))return K({readable:q});if(c(q))return K({writable:q});if(i(q))return K({writable:!1,readable:!1});if(v(q))return K({readable:Q.fromWeb(q)});if(f(q))return K({writable:S.fromWeb(q)});if(typeof q=="function"){const{value:I,write:B,final:U,destroy:P}=function(D){let{promise:V,resolve:te}=y();const le=new b,ee=le.signal;return{value:D(async function*(){for(;;){const M=V;V=null;const{chunk:E,done:W,cb:z}=await M;if(r.nextTick(z),W)return;if(ee.aborted)throw new w(void 0,{cause:ee.reason});({promise:V,resolve:te}=y()),yield E}}(),{signal:ee}),write(M,E,W){const z=te;te=null,z({chunk:M,done:!1,cb:W})},final(M){const E=te;te=null,E({done:!0,cb:M})},destroy(M,E){le.abort(),E(M)}}}(q);if(d(I))return O(N,I,{objectMode:!0,write:B,final:U,destroy:P});const J=I==null?void 0:I.then;if(typeof J=="function"){let D;const V=L(J,I,te=>{if(te!=null)throw new x("nully","body",te)},te=>{j(D,te)});return D=new N({objectMode:!0,readable:!1,write:B,final(te){U(async()=>{try{await V,r.nextTick(te,null)}catch(le){r.nextTick(te,le)}})},destroy:P})}throw new x("Iterable, AsyncIterable or AsyncFunction",C,I)}if(k(q))return se(q.arrayBuffer());if(d(q))return O(N,q,{objectMode:!0,writable:!1});if(v(q==null?void 0:q.readable)&&f(q==null?void 0:q.writable))return N.fromWeb(q);if(typeof(q==null?void 0:q.writable)=="object"||typeof(q==null?void 0:q.readable)=="object")return K({readable:q!=null&&q.readable?o(q==null?void 0:q.readable)?q==null?void 0:q.readable:se(q.readable):void 0,writable:q!=null&&q.writable?c(q==null?void 0:q.writable)?q==null?void 0:q.writable:se(q.writable):void 0});const X=q==null?void 0:q.then;if(typeof X=="function"){let I;return L(X,q,B=>{B!=null&&I.push(B),I.push(null)},B=>{j(I,B)}),I=new N({objectMode:!0,writable:!1,read(){}})}throw new g(C,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],q)}},6238:(s,e,t)=>{const r=t(5606),{AbortError:n,codes:a}=t(6371),{ERR_INVALID_ARG_TYPE:l,ERR_STREAM_PREMATURE_CLOSE:d}=a,{kEmptyObject:i,once:o}=t(7760),{validateAbortSignal:c,validateFunction:p,validateObject:v,validateBoolean:f}=t(277),{Promise:h,PromisePrototypeThen:w,SymbolDispose:g}=t(4134),{isClosed:x,isReadable:j,isReadableNodeStream:A,isReadableStream:Q,isReadableFinished:S,isReadableErrored:y,isWritable:O,isWritableNodeStream:T,isWritableStream:k,isWritableFinished:b,isWritableErrored:L,isNodeStream:N,willEmitClose:K,kIsClosedPromise:se}=t(6115);let q;const C=()=>{};function X(I,B,U){var P,J;if(arguments.length===2?(U=B,B=i):B==null?B=i:v(B,"options"),p(U,"callback"),c(B.signal,"options.signal"),U=o(U),Q(I)||k(I))return function(m,_,F){let G=!1,re=C;if(_.signal)if(re=()=>{G=!0,F.call(m,new n(void 0,{cause:_.signal.reason}))},_.signal.aborted)r.nextTick(re);else{q=q||t(7760).addAbortListener;const he=q(_.signal,re),pe=F;F=o((...me)=>{he[g](),pe.apply(m,me)})}const ce=(...he)=>{G||r.nextTick(()=>F.apply(m,he))};return w(m[se].promise,ce,ce),C}(I,B,U);if(!N(I))throw new l("stream",["ReadableStream","WritableStream","Stream"],I);const D=(P=B.readable)!==null&&P!==void 0?P:A(I),V=(J=B.writable)!==null&&J!==void 0?J:T(I),te=I._writableState,le=I._readableState,ee=()=>{I.writable||W()};let M=K(I)&&A(I)===D&&T(I)===V,E=b(I,!1);const W=()=>{E=!0,I.destroyed&&(M=!1),(!M||I.readable&&!D)&&(D&&!z||U.call(I))};let z=S(I,!1);const Z=()=>{z=!0,I.destroyed&&(M=!1),(!M||I.writable&&!V)&&(V&&!E||U.call(I))},R=m=>{U.call(I,m)};let ne=x(I);const Y=()=>{ne=!0;const m=L(I)||y(I);return m&&typeof m!="boolean"?U.call(I,m):D&&!z&&A(I,!0)&&!S(I,!1)?U.call(I,new d):!V||E||b(I,!1)?void U.call(I):U.call(I,new d)},ie=()=>{ne=!0;const m=L(I)||y(I);if(m&&typeof m!="boolean")return U.call(I,m);U.call(I)},oe=()=>{I.req.on("finish",W)};(function(m){return m.setHeader&&typeof m.abort=="function"})(I)?(I.on("complete",W),M||I.on("abort",Y),I.req?oe():I.on("request",oe)):V&&!te&&(I.on("end",ee),I.on("close",ee)),M||typeof I.aborted!="boolean"||I.on("aborted",Y),I.on("end",Z),I.on("finish",W),B.error!==!1&&I.on("error",R),I.on("close",Y),ne?r.nextTick(Y):te!=null&&te.errorEmitted||le!=null&&le.errorEmitted?M||r.nextTick(ie):(D||M&&!j(I)||!E&&O(I)!==!1)&&(V||M&&!O(I)||!z&&j(I)!==!1)?le&&I.req&&I.aborted&&r.nextTick(ie):r.nextTick(ie);const u=()=>{U=C,I.removeListener("aborted",Y),I.removeListener("complete",W),I.removeListener("abort",Y),I.removeListener("request",oe),I.req&&I.req.removeListener("finish",W),I.removeListener("end",ee),I.removeListener("close",ee),I.removeListener("finish",W),I.removeListener("end",Z),I.removeListener("error",R),I.removeListener("close",Y)};if(B.signal&&!ne){const m=()=>{const _=U;u(),_.call(I,new n(void 0,{cause:B.signal.reason}))};if(B.signal.aborted)r.nextTick(m);else{q=q||t(7760).addAbortListener;const _=q(B.signal,m),F=U;U=o((...G)=>{_[g](),F.apply(I,G)})}}return u}s.exports=X,s.exports.finished=function(I,B){var U;let P=!1;return B===null&&(B=i),(U=B)!==null&&U!==void 0&&U.cleanup&&(f(B.cleanup,"cleanup"),P=B.cleanup),new h((J,D)=>{const V=X(I,B,te=>{P&&V(),te?D(te):J()})})}},6532:(s,e,t)=>{const r=t(5606),{PromisePrototypeThen:n,SymbolAsyncIterator:a,SymbolIterator:l}=t(4134),{Buffer:d}=t(8287),{ERR_INVALID_ARG_TYPE:i,ERR_STREAM_NULL_VALUES:o}=t(6371).codes;s.exports=function(c,p,v){let f,h;if(typeof p=="string"||p instanceof d)return new c({objectMode:!0,...v,read(){this.push(p),this.push(null)}});if(p&&p[a])h=!0,f=p[a]();else{if(!p||!p[l])throw new i("iterable",["Iterable"],p);h=!1,f=p[l]()}const w=new c({objectMode:!0,highWaterMark:1,...v});let g=!1;return w._read=function(){g||(g=!0,async function(){for(;;){try{const{value:x,done:j}=h?await f.next():f.next();if(j)w.push(null);else{const A=x&&typeof x.then=="function"?await x:x;if(A===null)throw g=!1,new o;if(w.push(A))continue;g=!1}}catch(x){w.destroy(x)}break}}())},w._destroy=function(x,j){n(async function(A){const Q=A!=null,S=typeof f.throw=="function";if(Q&&S){const{value:y,done:O}=await f.throw(A);if(await y,O)return}if(typeof f.return=="function"){const{value:y}=await f.return();await y}}(x),()=>r.nextTick(j,x),A=>r.nextTick(j,A||x))},w}},4259:(s,e,t)=>{const{ArrayIsArray:r,ObjectSetPrototypeOf:n}=t(4134),{EventEmitter:a}=t(7007);function l(i){a.call(this,i)}function d(i,o,c){if(typeof i.prependListener=="function")return i.prependListener(o,c);i._events&&i._events[o]?r(i._events[o])?i._events[o].unshift(c):i._events[o]=[c,i._events[o]]:i.on(o,c)}n(l.prototype,a.prototype),n(l,a),l.prototype.pipe=function(i,o){const c=this;function p(j){i.writable&&i.write(j)===!1&&c.pause&&c.pause()}function v(){c.readable&&c.resume&&c.resume()}c.on("data",p),i.on("drain",v),i._isStdio||o&&o.end===!1||(c.on("end",h),c.on("close",w));let f=!1;function h(){f||(f=!0,i.end())}function w(){f||(f=!0,typeof i.destroy=="function"&&i.destroy())}function g(j){x(),a.listenerCount(this,"error")===0&&this.emit("error",j)}function x(){c.removeListener("data",p),i.removeListener("drain",v),c.removeListener("end",h),c.removeListener("close",w),c.removeListener("error",g),i.removeListener("error",g),c.removeListener("end",x),c.removeListener("close",x),i.removeListener("close",x)}return d(c,"error",g),d(i,"error",g),c.on("end",x),c.on("close",x),i.on("close",x),i.emit("pipe",c),i},s.exports={Stream:l,prependListener:d}},823:(s,e,t)=>{const r=globalThis.AbortController||t(5568).AbortController,{codes:{ERR_INVALID_ARG_VALUE:n,ERR_INVALID_ARG_TYPE:a,ERR_MISSING_ARGS:l,ERR_OUT_OF_RANGE:d},AbortError:i}=t(6371),{validateAbortSignal:o,validateInteger:c,validateObject:p}=t(277),v=t(4134).Symbol("kWeak"),f=t(4134).Symbol("kResistStopPropagation"),{finished:h}=t(6238),w=t(7830),{addAbortSignalNoValidate:g}=t(4147),{isWritable:x,isNodeStream:j}=t(6115),{deprecate:A}=t(7760),{ArrayPrototypePush:Q,Boolean:S,MathFloor:y,Number:O,NumberIsNaN:T,Promise:k,PromiseReject:b,PromiseResolve:L,PromisePrototypeThen:N,Symbol:K}=t(4134),se=K("kEmpty"),q=K("kEof");function C(P,J){if(typeof P!="function")throw new a("fn",["Function","AsyncFunction"],P);J!=null&&p(J,"options"),(J==null?void 0:J.signal)!=null&&o(J.signal,"options.signal");let D=1;(J==null?void 0:J.concurrency)!=null&&(D=y(J.concurrency));let V=D-1;return(J==null?void 0:J.highWaterMark)!=null&&(V=y(J.highWaterMark)),c(D,"options.concurrency",1),c(V,"options.highWaterMark",0),V+=D,(async function*(){const te=t(7760).AbortSignalAny([J==null?void 0:J.signal].filter(S)),le=this,ee=[],M={signal:te};let E,W,z=!1,Z=0;function R(){z=!0,ne()}function ne(){Z-=1,Y()}function Y(){W&&!z&&Z=V||Z>=D)&&await new k(oe=>{W=oe})}ee.push(q)}catch(ie){const oe=b(ie);N(oe,ne,R),ee.push(oe)}finally{z=!0,E&&(E(),E=null)}})();try{for(;;){for(;ee.length>0;){const ie=await ee[0];if(ie===q)return;if(te.aborted)throw new i;ie!==se&&(yield ie),ee.shift(),Y()}await new k(ie=>{E=ie})}}finally{z=!0,W&&(W(),W=null)}}).call(this)}async function X(P,J=void 0){for await(const D of I.call(this,P,J))return!0;return!1}function I(P,J){if(typeof P!="function")throw new a("fn",["Function","AsyncFunction"],P);return C.call(this,async function(D,V){return await P(D,V)?D:se},J)}class B extends l{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}function U(P){if(P=O(P),T(P))return 0;if(P<0)throw new d("number",">= 0",P);return P}s.exports.streamReturningOperators={asIndexedPairs:A(function(P=void 0){return P!=null&&p(P,"options"),(P==null?void 0:P.signal)!=null&&o(P.signal,"options.signal"),(async function*(){let J=0;for await(const V of this){var D;if(P!=null&&(D=P.signal)!==null&&D!==void 0&&D.aborted)throw new i({cause:P.signal.reason});yield[J++,V]}}).call(this)},"readable.asIndexedPairs will be removed in a future version."),drop:function(P,J=void 0){return J!=null&&p(J,"options"),(J==null?void 0:J.signal)!=null&&o(J.signal,"options.signal"),P=U(P),(async function*(){var D;if(J!=null&&(D=J.signal)!==null&&D!==void 0&&D.aborted)throw new i;for await(const te of this){var V;if(J!=null&&(V=J.signal)!==null&&V!==void 0&&V.aborted)throw new i;P--<=0&&(yield te)}}).call(this)},filter:I,flatMap:function(P,J){const D=C.call(this,P,J);return(async function*(){for await(const V of D)yield*V}).call(this)},map:C,take:function(P,J=void 0){return J!=null&&p(J,"options"),(J==null?void 0:J.signal)!=null&&o(J.signal,"options.signal"),P=U(P),(async function*(){var D;if(J!=null&&(D=J.signal)!==null&&D!==void 0&&D.aborted)throw new i;for await(const te of this){var V;if(J!=null&&(V=J.signal)!==null&&V!==void 0&&V.aborted)throw new i;if(P-- >0&&(yield te),P<=0)return}}).call(this)},compose:function(P,J){if(J!=null&&p(J,"options"),(J==null?void 0:J.signal)!=null&&o(J.signal,"options.signal"),j(P)&&!x(P))throw new n("stream",P,"must be writable");const D=w(this,P);return J!=null&&J.signal&&g(J.signal,D),D}},s.exports.promiseReturningOperators={every:async function(P,J=void 0){if(typeof P!="function")throw new a("fn",["Function","AsyncFunction"],P);return!await X.call(this,async(...D)=>!await P(...D),J)},forEach:async function(P,J){if(typeof P!="function")throw new a("fn",["Function","AsyncFunction"],P);for await(const D of C.call(this,async function(V,te){return await P(V,te),se},J));},reduce:async function(P,J,D){var V;if(typeof P!="function")throw new a("reducer",["Function","AsyncFunction"],P);D!=null&&p(D,"options"),(D==null?void 0:D.signal)!=null&&o(D.signal,"options.signal");let te=arguments.length>1;if(D!=null&&(V=D.signal)!==null&&V!==void 0&&V.aborted){const W=new i(void 0,{cause:D.signal.reason});throw this.once("error",()=>{}),await h(this.destroy(W)),W}const le=new r,ee=le.signal;if(D!=null&&D.signal){const W={once:!0,[v]:this,[f]:!0};D.signal.addEventListener("abort",()=>le.abort(),W)}let M=!1;try{for await(const W of this){var E;if(M=!0,D!=null&&(E=D.signal)!==null&&E!==void 0&&E.aborted)throw new i;te?J=await P(J,W,{signal:ee}):(J=W,te=!0)}if(!M&&!te)throw new B}finally{le.abort()}return J},toArray:async function(P){P!=null&&p(P,"options"),(P==null?void 0:P.signal)!=null&&o(P.signal,"options.signal");const J=[];for await(const V of this){var D;if(P!=null&&(D=P.signal)!==null&&D!==void 0&&D.aborted)throw new i(void 0,{cause:P.signal.reason});Q(J,V)}return J},some:X,find:async function(P,J){for await(const D of I.call(this,P,J))return D}}},6524:(s,e,t)=>{const{ObjectSetPrototypeOf:r}=t(4134);s.exports=a;const n=t(5001);function a(l){if(!(this instanceof a))return new a(l);n.call(this,l)}r(a.prototype,n.prototype),r(a,n),a.prototype._transform=function(l,d,i){i(null,l)}},7758:(s,e,t)=>{const r=t(5606),{ArrayIsArray:n,Promise:a,SymbolAsyncIterator:l,SymbolDispose:d}=t(4134),i=t(6238),{once:o}=t(7760),c=t(5896),p=t(3370),{aggregateTwoErrors:v,codes:{ERR_INVALID_ARG_TYPE:f,ERR_INVALID_RETURN_VALUE:h,ERR_MISSING_ARGS:w,ERR_STREAM_DESTROYED:g,ERR_STREAM_PREMATURE_CLOSE:x},AbortError:j}=t(6371),{validateFunction:A,validateAbortSignal:Q}=t(277),{isIterable:S,isReadable:y,isReadableNodeStream:O,isNodeStream:T,isTransformStream:k,isWebStream:b,isReadableStream:L,isReadableFinished:N}=t(6115),K=globalThis.AbortController||t(5568).AbortController;let se,q,C;function X(D,V,te){let le=!1;return D.on("close",()=>{le=!0}),{destroy:ee=>{le||(le=!0,c.destroyer(D,ee||new g("pipe")))},cleanup:i(D,{readable:V,writable:te},ee=>{le=!ee})}}function I(D){if(S(D))return D;if(O(D))return async function*(V){q||(q=t(7576)),yield*q.prototype[l].call(V)}(D);throw new f("val",["Readable","Iterable","AsyncIterable"],D)}async function B(D,V,te,{end:le}){let ee,M=null;const E=Z=>{if(Z&&(ee=Z),M){const R=M;M=null,R()}},W=()=>new a((Z,R)=>{ee?R(ee):M=()=>{ee?R(ee):Z()}});V.on("drain",E);const z=i(V,{readable:!1},E);try{V.writableNeedDrain&&await W();for await(const Z of D)V.write(Z)||await W();le&&(V.end(),await W()),te()}catch(Z){te(ee!==Z?v(ee,Z):Z)}finally{z(),V.off("drain",E)}}async function U(D,V,te,{end:le}){k(V)&&(V=V.writable);const ee=V.getWriter();try{for await(const M of D)await ee.ready,ee.write(M).catch(()=>{});await ee.ready,le&&await ee.close(),te()}catch(M){try{await ee.abort(M),te(M)}catch(E){te(E)}}}function P(D,V,te){if(D.length===1&&n(D[0])&&(D=D[0]),D.length<2)throw new w("streams");const le=new K,ee=le.signal,M=te==null?void 0:te.signal,E=[];function W(){u(new j)}let z,Z,R;Q(M,"options.signal"),C=C||t(7760).addAbortListener,M&&(z=C(M,W));const ne=[];let Y,ie=0;function oe(F){u(F,--ie==0)}function u(F,G){var re;if(!F||Z&&Z.code!=="ERR_STREAM_PREMATURE_CLOSE"||(Z=F),Z||G){for(;ne.length;)ne.shift()(Z);(re=z)===null||re===void 0||re[d](),le.abort(),G&&(Z||E.forEach(ce=>ce()),r.nextTick(V,Z,R))}}for(let F=0;F0,he=re||(te==null?void 0:te.end)!==!1,pe=F===D.length-1;if(T(G)){let me=function(ge){ge&&ge.name!=="AbortError"&&ge.code!=="ERR_STREAM_PREMATURE_CLOSE"&&oe(ge)};if(he){const{destroy:ge,cleanup:_e}=X(G,re,ce);ne.push(ge),y(G)&&pe&&E.push(_e)}G.on("error",me),y(G)&&pe&&E.push(()=>{G.removeListener("error",me)})}if(F===0)if(typeof G=="function"){if(Y=G({signal:ee}),!S(Y))throw new h("Iterable, AsyncIterable or Stream","source",Y)}else Y=S(G)||O(G)||k(G)?G:p.from(G);else if(typeof G=="function"){var m;if(Y=k(Y)?I((m=Y)===null||m===void 0?void 0:m.readable):I(Y),Y=G(Y,{signal:ee}),re){if(!S(Y,!0))throw new h("AsyncIterable",`transform[${F-1}]`,Y)}else{var _;se||(se=t(6524));const me=new se({objectMode:!0}),ge=(_=Y)===null||_===void 0?void 0:_.then;if(typeof ge=="function")ie++,ge.call(Y,Pe=>{R=Pe,Pe!=null&&me.write(Pe),he&&me.end(),r.nextTick(oe)},Pe=>{me.destroy(Pe),r.nextTick(oe,Pe)});else if(S(Y,!0))ie++,B(Y,me,oe,{end:he});else{if(!L(Y)&&!k(Y))throw new h("AsyncIterable or Promise","destination",Y);{const Pe=Y.readable||Y;ie++,B(Pe,me,oe,{end:he})}}Y=me;const{destroy:_e,cleanup:it}=X(Y,!1,!0);ne.push(_e),pe&&E.push(it)}}else if(T(G)){if(O(Y)){ie+=2;const me=J(Y,G,oe,{end:he});y(G)&&pe&&E.push(me)}else if(k(Y)||L(Y)){const me=Y.readable||Y;ie++,B(me,G,oe,{end:he})}else{if(!S(Y))throw new f("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Y);ie++,B(Y,G,oe,{end:he})}Y=G}else if(b(G)){if(O(Y))ie++,U(I(Y),G,oe,{end:he});else if(L(Y)||S(Y))ie++,U(Y,G,oe,{end:he});else{if(!k(Y))throw new f("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Y);ie++,U(Y.readable,G,oe,{end:he})}Y=G}else Y=p.from(G)}return(ee!=null&&ee.aborted||M!=null&&M.aborted)&&r.nextTick(W),Y}function J(D,V,te,{end:le}){let ee=!1;if(V.on("close",()=>{ee||te(new x)}),D.pipe(V,{end:!1}),le){let M=function(){ee=!0,V.end()};N(D)?r.nextTick(M):D.once("end",M)}else te();return i(D,{readable:!0,writable:!1},M=>{const E=D._readableState;M&&M.code==="ERR_STREAM_PREMATURE_CLOSE"&&E&&E.ended&&!E.errored&&!E.errorEmitted?D.once("end",te).once("error",te):te(M)}),i(V,{readable:!1,writable:!0},te)}s.exports={pipelineImpl:P,pipeline:function(...D){return P(D,o(function(V){return A(V[V.length-1],"streams[stream.length - 1]"),V.pop()}(D)))}}},7576:(s,e,t)=>{const r=t(5606),{ArrayPrototypeIndexOf:n,NumberIsInteger:a,NumberIsNaN:l,NumberParseInt:d,ObjectDefineProperties:i,ObjectKeys:o,ObjectSetPrototypeOf:c,Promise:p,SafeSet:v,SymbolAsyncDispose:f,SymbolAsyncIterator:h,Symbol:w}=t(4134);s.exports=R,R.ReadableState=Z;const{EventEmitter:g}=t(7007),{Stream:x,prependListener:j}=t(4259),{Buffer:A}=t(8287),{addAbortSignal:Q}=t(4147),S=t(6238);let y=t(7760).debuglog("stream",$=>{y=$});const O=t(345),T=t(5896),{getHighWaterMark:k,getDefaultHighWaterMark:b}=t(5291),{aggregateTwoErrors:L,codes:{ERR_INVALID_ARG_TYPE:N,ERR_METHOD_NOT_IMPLEMENTED:K,ERR_OUT_OF_RANGE:se,ERR_STREAM_PUSH_AFTER_EOF:q,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:C},AbortError:X}=t(6371),{validateObject:I}=t(277),B=w("kPaused"),{StringDecoder:U}=t(3141),P=t(6532);c(R.prototype,x.prototype),c(R,x);const J=()=>{},{errorOrDestroy:D}=T,V=1,te=16,le=32,ee=64,M=2048,E=4096,W=65536;function z($){return{enumerable:!1,get(){return!!(this.state&$)},set(H){H?this.state|=$:this.state&=~$}}}function Z($,H,de){typeof de!="boolean"&&(de=H instanceof t(3370)),this.state=M|E|te|le,$&&$.objectMode&&(this.state|=V),de&&$&&$.readableObjectMode&&(this.state|=V),this.highWaterMark=$?k(this,$,"readableHighWaterMark",de):b(!1),this.buffer=new O,this.length=0,this.pipes=[],this.flowing=null,this[B]=null,$&&$.emitClose===!1&&(this.state&=~M),$&&$.autoDestroy===!1&&(this.state&=~E),this.errored=null,this.defaultEncoding=$&&$.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,$&&$.encoding&&(this.decoder=new U($.encoding),this.encoding=$.encoding)}function R($){if(!(this instanceof R))return new R($);const H=this instanceof t(3370);this._readableState=new Z($,this,H),$&&(typeof $.read=="function"&&(this._read=$.read),typeof $.destroy=="function"&&(this._destroy=$.destroy),typeof $.construct=="function"&&(this._construct=$.construct),$.signal&&!H&&Q($.signal,this)),x.call(this,$),T.construct(this,()=>{this._readableState.needReadable&&m(this,this._readableState)})}function ne($,H,de,ue){y("readableAddChunk",H);const fe=$._readableState;let ve;if(fe.state&V||(typeof H=="string"?(de=de||fe.defaultEncoding,fe.encoding!==de&&(ue&&fe.encoding?H=A.from(H,de).toString(fe.encoding):(H=A.from(H,de),de=""))):H instanceof A?de="":x._isUint8Array(H)?(H=x._uint8ArrayToBuffer(H),de=""):H!=null&&(ve=new N("chunk",["string","Buffer","Uint8Array"],H))),ve)D($,ve);else if(H===null)fe.state&=-9,function(Ne,Ie){if(y("onEofChunk"),!Ie.ended){if(Ie.decoder){const ze=Ie.decoder.end();ze&&ze.length&&(Ie.buffer.push(ze),Ie.length+=Ie.objectMode?1:ze.length)}Ie.ended=!0,Ie.sync?oe(Ne):(Ie.needReadable=!1,Ie.emittedReadable=!0,u(Ne))}}($,fe);else if(fe.state&V||H&&H.length>0)if(ue)if(4&fe.state)D($,new C);else{if(fe.destroyed||fe.errored)return!1;Y($,fe,H,!0)}else if(fe.ended)D($,new q);else{if(fe.destroyed||fe.errored)return!1;fe.state&=-9,fe.decoder&&!de?(H=fe.decoder.write(H),fe.objectMode||H.length!==0?Y($,fe,H,!1):m($,fe)):Y($,fe,H,!1)}else ue||(fe.state&=-9,m($,fe));return!fe.ended&&(fe.length0?(H.state&W?H.awaitDrainWriters.clear():H.awaitDrainWriters=null,H.dataEmitted=!0,$.emit("data",de)):(H.length+=H.objectMode?1:de.length,ue?H.buffer.unshift(de):H.buffer.push(de),H.state&ee&&oe($)),m($,H)}function ie($,H){return $<=0||H.length===0&&H.ended?0:H.state&V?1:l($)?H.flowing&&H.length?H.buffer.first().length:H.length:$<=H.length?$:H.ended?H.length:0}function oe($){const H=$._readableState;y("emitReadable",H.needReadable,H.emittedReadable),H.needReadable=!1,H.emittedReadable||(y("emitReadable",H.flowing),H.emittedReadable=!0,r.nextTick(u,$))}function u($){const H=$._readableState;y("emitReadable_",H.destroyed,H.length,H.ended),H.destroyed||H.errored||!H.length&&!H.ended||($.emit("readable"),H.emittedReadable=!1),H.needReadable=!H.flowing&&!H.ended&&H.length<=H.highWaterMark,ce($)}function m($,H){!H.readingMore&&H.constructed&&(H.readingMore=!0,r.nextTick(_,$,H))}function _($,H){for(;!H.reading&&!H.ended&&(H.length0,H.resumeScheduled&&H[B]===!1?H.flowing=!0:$.listenerCount("data")>0?$.resume():H.readableListening||(H.flowing=null)}function G($){y("readable nexttick read 0"),$.read(0)}function re($,H){y("resume",H.reading),H.reading||$.read(0),H.resumeScheduled=!1,$.emit("resume"),ce($),H.flowing&&!H.reading&&$.read(0)}function ce($){const H=$._readableState;for(y("flow",H.flowing);H.flowing&&$.read()!==null;);}function he($,H){typeof $.read!="function"&&($=R.wrap($,{objectMode:!0}));const de=async function*(ue,fe){let ve,Ne=J;function Ie(Ce){this===ue?(Ne(),Ne=J):Ne=Ce}ue.on("readable",Ie);const ze=S(ue,{writable:!1},Ce=>{ve=Ce?L(ve,Ce):null,Ne(),Ne=J});try{for(;;){const Ce=ue.destroyed?null:ue.read();if(Ce!==null)yield Ce;else{if(ve)throw ve;if(ve===null)return;await new p(Ie)}}}catch(Ce){throw ve=L(ve,Ce),ve}finally{!ve&&(fe==null?void 0:fe.destroyOnReturn)===!1||ve!==void 0&&!ue._readableState.autoDestroy?(ue.off("readable",Ie),ze()):T.destroyer(ue,null)}}($,H);return de.stream=$,de}function pe($,H){if(H.length===0)return null;let de;return H.objectMode?de=H.buffer.shift():!$||$>=H.length?(de=H.decoder?H.buffer.join(""):H.buffer.length===1?H.buffer.first():H.buffer.concat(H.length),H.buffer.clear()):de=H.buffer.consume($,H.decoder),de}function me($){const H=$._readableState;y("endReadable",H.endEmitted),H.endEmitted||(H.ended=!0,r.nextTick(ge,H,$))}function ge($,H){if(y("endReadableNT",$.endEmitted,$.length),!$.errored&&!$.closeEmitted&&!$.endEmitted&&$.length===0){if($.endEmitted=!0,H.emit("end"),H.writable&&H.allowHalfOpen===!1)r.nextTick(_e,H);else if($.autoDestroy){const de=H._writableState;(!de||de.autoDestroy&&(de.finished||de.writable===!1))&&H.destroy()}}}function _e($){$.writable&&!$.writableEnded&&!$.destroyed&&$.end()}let it;function Pe(){return it===void 0&&(it={}),it}i(Z.prototype,{objectMode:z(V),ended:z(2),endEmitted:z(4),reading:z(8),constructed:z(te),sync:z(le),needReadable:z(ee),emittedReadable:z(128),readableListening:z(256),resumeScheduled:z(512),errorEmitted:z(1024),emitClose:z(M),autoDestroy:z(E),destroyed:z(8192),closed:z(16384),closeEmitted:z(32768),multiAwaitDrain:z(W),readingMore:z(1<<17),dataEmitted:z(1<<18)}),R.prototype.destroy=T.destroy,R.prototype._undestroy=T.undestroy,R.prototype._destroy=function($,H){H($)},R.prototype[g.captureRejectionSymbol]=function($){this.destroy($)},R.prototype[f]=function(){let $;return this.destroyed||($=this.readableEnded?null:new X,this.destroy($)),new p((H,de)=>S(this,ue=>ue&&ue!==$?de(ue):H(null)))},R.prototype.push=function($,H){return ne(this,$,H,!1)},R.prototype.unshift=function($,H){return ne(this,$,H,!0)},R.prototype.isPaused=function(){const $=this._readableState;return $[B]===!0||$.flowing===!1},R.prototype.setEncoding=function($){const H=new U($);this._readableState.decoder=H,this._readableState.encoding=this._readableState.decoder.encoding;const de=this._readableState.buffer;let ue="";for(const fe of de)ue+=H.write(fe);return de.clear(),ue!==""&&de.push(ue),this._readableState.length=ue.length,this},R.prototype.read=function($){y("read",$),$===void 0?$=NaN:a($)||($=d($,10));const H=this._readableState,de=$;if($>H.highWaterMark&&(H.highWaterMark=function(ve){if(ve>1073741824)throw new se("size","<= 1GiB",ve);return ve--,ve|=ve>>>1,ve|=ve>>>2,ve|=ve>>>4,ve|=ve>>>8,ve|=ve>>>16,++ve}($)),$!==0&&(H.state&=-129),$===0&&H.needReadable&&((H.highWaterMark!==0?H.length>=H.highWaterMark:H.length>0)||H.ended))return y("read: emitReadable",H.length,H.ended),H.length===0&&H.ended?me(this):oe(this),null;if(($=ie($,H))===0&&H.ended)return H.length===0&&me(this),null;let ue,fe=!!(H.state&ee);if(y("need readable",fe),(H.length===0||H.length-$0?pe($,H):null,ue===null?(H.needReadable=H.length<=H.highWaterMark,$=0):(H.length-=$,H.multiAwaitDrain?H.awaitDrainWriters.clear():H.awaitDrainWriters=null),H.length===0&&(H.ended||(H.needReadable=!0),de!==$&&H.ended&&me(this)),ue===null||H.errorEmitted||H.closeEmitted||(H.dataEmitted=!0,this.emit("data",ue)),ue},R.prototype._read=function($){throw new K("_read()")},R.prototype.pipe=function($,H){const de=this,ue=this._readableState;ue.pipes.length===1&&(ue.multiAwaitDrain||(ue.multiAwaitDrain=!0,ue.awaitDrainWriters=new v(ue.awaitDrainWriters?[ue.awaitDrainWriters]:[]))),ue.pipes.push($),y("pipe count=%d opts=%j",ue.pipes.length,H);const fe=H&&H.end===!1||$===r.stdout||$===r.stderr?st:ve;function ve(){y("onend"),$.end()}let Ne;ue.endEmitted?r.nextTick(fe):de.once("end",fe),$.on("unpipe",function $e(Ge,Be){y("onunpipe"),Ge===de&&Be&&Be.hasUnpiped===!1&&(Be.hasUnpiped=!0,y("cleanup"),$.removeListener("close",Lt),$.removeListener("finish",At),Ne&&$.removeListener("drain",Ne),$.removeListener("error",kt),$.removeListener("unpipe",$e),de.removeListener("end",ve),de.removeListener("end",st),de.removeListener("data",Ce),Ie=!0,Ne&&ue.awaitDrainWriters&&(!$._writableState||$._writableState.needDrain)&&Ne())});let Ie=!1;function ze(){Ie||(ue.pipes.length===1&&ue.pipes[0]===$?(y("false write response, pause",0),ue.awaitDrainWriters=$,ue.multiAwaitDrain=!1):ue.pipes.length>1&&ue.pipes.includes($)&&(y("false write response, pause",ue.awaitDrainWriters.size),ue.awaitDrainWriters.add($)),de.pause()),Ne||(Ne=function($e,Ge){return function(){const Be=$e._readableState;Be.awaitDrainWriters===Ge?(y("pipeOnDrain",1),Be.awaitDrainWriters=null):Be.multiAwaitDrain&&(y("pipeOnDrain",Be.awaitDrainWriters.size),Be.awaitDrainWriters.delete(Ge)),Be.awaitDrainWriters&&Be.awaitDrainWriters.size!==0||!$e.listenerCount("data")||$e.resume()}}(de,$),$.on("drain",Ne))}function Ce($e){y("ondata");const Ge=$.write($e);y("dest.write",Ge),Ge===!1&&ze()}function kt($e){if(y("onerror",$e),st(),$.removeListener("error",kt),$.listenerCount("error")===0){const Ge=$._writableState||$._readableState;Ge&&!Ge.errorEmitted?D($,$e):$.emit("error",$e)}}function Lt(){$.removeListener("finish",At),st()}function At(){y("onfinish"),$.removeListener("close",Lt),st()}function st(){y("unpipe"),de.unpipe($)}return de.on("data",Ce),j($,"error",kt),$.once("close",Lt),$.once("finish",At),$.emit("pipe",de),$.writableNeedDrain===!0?ze():ue.flowing||(y("pipe resume"),de.resume()),$},R.prototype.unpipe=function($){const H=this._readableState;if(H.pipes.length===0)return this;if(!$){const ue=H.pipes;H.pipes=[],this.pause();for(let fe=0;fe0,ue.flowing!==!1&&this.resume()):$==="readable"&&(ue.endEmitted||ue.readableListening||(ue.readableListening=ue.needReadable=!0,ue.flowing=!1,ue.emittedReadable=!1,y("on readable",ue.length,ue.reading),ue.length?oe(this):ue.reading||r.nextTick(G,this))),de},R.prototype.addListener=R.prototype.on,R.prototype.removeListener=function($,H){const de=x.prototype.removeListener.call(this,$,H);return $==="readable"&&r.nextTick(F,this),de},R.prototype.off=R.prototype.removeListener,R.prototype.removeAllListeners=function($){const H=x.prototype.removeAllListeners.apply(this,arguments);return $!=="readable"&&$!==void 0||r.nextTick(F,this),H},R.prototype.resume=function(){const $=this._readableState;return $.flowing||(y("resume"),$.flowing=!$.readableListening,function(H,de){de.resumeScheduled||(de.resumeScheduled=!0,r.nextTick(re,H,de))}(this,$)),$[B]=!1,this},R.prototype.pause=function(){return y("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(y("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[B]=!0,this},R.prototype.wrap=function($){let H=!1;$.on("data",ue=>{!this.push(ue)&&$.pause&&(H=!0,$.pause())}),$.on("end",()=>{this.push(null)}),$.on("error",ue=>{D(this,ue)}),$.on("close",()=>{this.destroy()}),$.on("destroy",()=>{this.destroy()}),this._read=()=>{H&&$.resume&&(H=!1,$.resume())};const de=o($);for(let ue=1;ue{const{MathFloor:r,NumberIsInteger:n}=t(4134),{validateInteger:a}=t(277),{ERR_INVALID_ARG_VALUE:l}=t(6371).codes;let d=16384,i=16;function o(c){return c?i:d}s.exports={getHighWaterMark:function(c,p,v,f){const h=function(w,g,x){return w.highWaterMark!=null?w.highWaterMark:g?w[x]:null}(p,f,v);if(h!=null){if(!n(h)||h<0)throw new l(f?`options.${v}`:"options.highWaterMark",h);return r(h)}return o(c.objectMode)},getDefaultHighWaterMark:o,setDefaultHighWaterMark:function(c,p){a(p,"value",0),c?i=p:d=p}}},5001:(s,e,t)=>{const{ObjectSetPrototypeOf:r,Symbol:n}=t(4134);s.exports=o;const{ERR_METHOD_NOT_IMPLEMENTED:a}=t(6371).codes,l=t(3370),{getHighWaterMark:d}=t(5291);r(o.prototype,l.prototype),r(o,l);const i=n("kCallback");function o(v){if(!(this instanceof o))return new o(v);const f=v?d(this,v,"readableHighWaterMark",!0):null;f===0&&(v={...v,highWaterMark:null,readableHighWaterMark:f,writableHighWaterMark:v.writableHighWaterMark||0}),l.call(this,v),this._readableState.sync=!1,this[i]=null,v&&(typeof v.transform=="function"&&(this._transform=v.transform),typeof v.flush=="function"&&(this._flush=v.flush)),this.on("prefinish",p)}function c(v){typeof this._flush!="function"||this.destroyed?(this.push(null),v&&v()):this._flush((f,h)=>{f?v?v(f):this.destroy(f):(h!=null&&this.push(h),this.push(null),v&&v())})}function p(){this._final!==c&&c.call(this)}o.prototype._final=c,o.prototype._transform=function(v,f,h){throw new a("_transform()")},o.prototype._write=function(v,f,h){const w=this._readableState,g=this._writableState,x=w.length;this._transform(v,f,(j,A)=>{j?h(j):(A!=null&&this.push(A),g.ended||x===w.length||w.length{const{SymbolAsyncIterator:r,SymbolIterator:n,SymbolFor:a}=t(4134),l=a("nodejs.stream.destroyed"),d=a("nodejs.stream.errored"),i=a("nodejs.stream.readable"),o=a("nodejs.stream.writable"),c=a("nodejs.stream.disturbed"),p=a("nodejs.webstream.isClosedPromise"),v=a("nodejs.webstream.controllerErrorFunction");function f(b,L=!1){var N;return!(!b||typeof b.pipe!="function"||typeof b.on!="function"||L&&(typeof b.pause!="function"||typeof b.resume!="function")||b._writableState&&((N=b._readableState)===null||N===void 0?void 0:N.readable)===!1||b._writableState&&!b._readableState)}function h(b){var L;return!(!b||typeof b.write!="function"||typeof b.on!="function"||b._readableState&&((L=b._writableState)===null||L===void 0?void 0:L.writable)===!1)}function w(b){return b&&(b._readableState||b._writableState||typeof b.write=="function"&&typeof b.on=="function"||typeof b.pipe=="function"&&typeof b.on=="function")}function g(b){return!(!b||w(b)||typeof b.pipeThrough!="function"||typeof b.getReader!="function"||typeof b.cancel!="function")}function x(b){return!(!b||w(b)||typeof b.getWriter!="function"||typeof b.abort!="function")}function j(b){return!(!b||w(b)||typeof b.readable!="object"||typeof b.writable!="object")}function A(b){if(!w(b))return null;const L=b._writableState,N=b._readableState,K=L||N;return!!(b.destroyed||b[l]||K!=null&&K.destroyed)}function Q(b){if(!h(b))return null;if(b.writableEnded===!0)return!0;const L=b._writableState;return(L==null||!L.errored)&&(typeof(L==null?void 0:L.ended)!="boolean"?null:L.ended)}function S(b,L){if(!f(b))return null;const N=b._readableState;return(N==null||!N.errored)&&(typeof(N==null?void 0:N.endEmitted)!="boolean"?null:!!(N.endEmitted||L===!1&&N.ended===!0&&N.length===0))}function y(b){return b&&b[i]!=null?b[i]:typeof(b==null?void 0:b.readable)!="boolean"?null:!A(b)&&f(b)&&b.readable&&!S(b)}function O(b){return b&&b[o]!=null?b[o]:typeof(b==null?void 0:b.writable)!="boolean"?null:!A(b)&&h(b)&&b.writable&&!Q(b)}function T(b){return typeof b._closed=="boolean"&&typeof b._defaultKeepAlive=="boolean"&&typeof b._removedConnection=="boolean"&&typeof b._removedContLen=="boolean"}function k(b){return typeof b._sent100=="boolean"&&T(b)}s.exports={isDestroyed:A,kIsDestroyed:l,isDisturbed:function(b){var L;return!(!b||!((L=b[c])!==null&&L!==void 0?L:b.readableDidRead||b.readableAborted))},kIsDisturbed:c,isErrored:function(b){var L,N,K,se,q,C,X,I,B,U;return!(!b||!((L=(N=(K=(se=(q=(C=b[d])!==null&&C!==void 0?C:b.readableErrored)!==null&&q!==void 0?q:b.writableErrored)!==null&&se!==void 0?se:(X=b._readableState)===null||X===void 0?void 0:X.errorEmitted)!==null&&K!==void 0?K:(I=b._writableState)===null||I===void 0?void 0:I.errorEmitted)!==null&&N!==void 0?N:(B=b._readableState)===null||B===void 0?void 0:B.errored)!==null&&L!==void 0?L:!((U=b._writableState)===null||U===void 0)&&U.errored))},kIsErrored:d,isReadable:y,kIsReadable:i,kIsClosedPromise:p,kControllerErrorFunction:v,kIsWritable:o,isClosed:function(b){if(!w(b))return null;if(typeof b.closed=="boolean")return b.closed;const L=b._writableState,N=b._readableState;return typeof(L==null?void 0:L.closed)=="boolean"||typeof(N==null?void 0:N.closed)=="boolean"?(L==null?void 0:L.closed)||(N==null?void 0:N.closed):typeof b._closed=="boolean"&&T(b)?b._closed:null},isDuplexNodeStream:function(b){return!(!b||typeof b.pipe!="function"||!b._readableState||typeof b.on!="function"||typeof b.write!="function")},isFinished:function(b,L){return w(b)?!(!A(b)&&((L==null?void 0:L.readable)!==!1&&y(b)||(L==null?void 0:L.writable)!==!1&&O(b))):null},isIterable:function(b,L){return b!=null&&(L===!0?typeof b[r]=="function":L===!1?typeof b[n]=="function":typeof b[r]=="function"||typeof b[n]=="function")},isReadableNodeStream:f,isReadableStream:g,isReadableEnded:function(b){if(!f(b))return null;if(b.readableEnded===!0)return!0;const L=b._readableState;return!(!L||L.errored)&&(typeof(L==null?void 0:L.ended)!="boolean"?null:L.ended)},isReadableFinished:S,isReadableErrored:function(b){var L,N;return w(b)?b.readableErrored?b.readableErrored:(L=(N=b._readableState)===null||N===void 0?void 0:N.errored)!==null&&L!==void 0?L:null:null},isNodeStream:w,isWebStream:function(b){return g(b)||x(b)||j(b)},isWritable:O,isWritableNodeStream:h,isWritableStream:x,isWritableEnded:Q,isWritableFinished:function(b,L){if(!h(b))return null;if(b.writableFinished===!0)return!0;const N=b._writableState;return(N==null||!N.errored)&&(typeof(N==null?void 0:N.finished)!="boolean"?null:!!(N.finished||L===!1&&N.ended===!0&&N.length===0))},isWritableErrored:function(b){var L,N;return w(b)?b.writableErrored?b.writableErrored:(L=(N=b._writableState)===null||N===void 0?void 0:N.errored)!==null&&L!==void 0?L:null:null},isServerRequest:function(b){var L;return typeof b._consuming=="boolean"&&typeof b._dumped=="boolean"&&((L=b.req)===null||L===void 0?void 0:L.upgradeOrConnect)===void 0},isServerResponse:k,willEmitClose:function(b){if(!w(b))return null;const L=b._writableState,N=b._readableState,K=L||N;return!K&&k(b)||!!(K&&K.autoDestroy&&K.emitClose&&K.closed===!1)},isTransformStream:j}},8584:(s,e,t)=>{const r=t(5606),{ArrayPrototypeSlice:n,Error:a,FunctionPrototypeSymbolHasInstance:l,ObjectDefineProperty:d,ObjectDefineProperties:i,ObjectSetPrototypeOf:o,StringPrototypeToLowerCase:c,Symbol:p,SymbolHasInstance:v}=t(4134);s.exports=I,I.WritableState=C;const{EventEmitter:f}=t(7007),h=t(4259).Stream,{Buffer:w}=t(8287),g=t(5896),{addAbortSignal:x}=t(4147),{getHighWaterMark:j,getDefaultHighWaterMark:A}=t(5291),{ERR_INVALID_ARG_TYPE:Q,ERR_METHOD_NOT_IMPLEMENTED:S,ERR_MULTIPLE_CALLBACK:y,ERR_STREAM_CANNOT_PIPE:O,ERR_STREAM_DESTROYED:T,ERR_STREAM_ALREADY_FINISHED:k,ERR_STREAM_NULL_VALUES:b,ERR_STREAM_WRITE_AFTER_END:L,ERR_UNKNOWN_ENCODING:N}=t(6371).codes,{errorOrDestroy:K}=g;function se(){}o(I.prototype,h.prototype),o(I,h);const q=p("kOnFinished");function C(R,ne,Y){typeof Y!="boolean"&&(Y=ne instanceof t(3370)),this.objectMode=!(!R||!R.objectMode),Y&&(this.objectMode=this.objectMode||!(!R||!R.writableObjectMode)),this.highWaterMark=R?j(this,R,"writableHighWaterMark",Y):A(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const ie=!(!R||R.decodeStrings!==!1);this.decodeStrings=!ie,this.defaultEncoding=R&&R.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=J.bind(void 0,ne),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,X(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!R||R.emitClose!==!1,this.autoDestroy=!R||R.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[q]=[]}function X(R){R.buffered=[],R.bufferedIndex=0,R.allBuffers=!0,R.allNoop=!0}function I(R){const ne=this instanceof t(3370);if(!ne&&!l(I,this))return new I(R);this._writableState=new C(R,this,ne),R&&(typeof R.write=="function"&&(this._write=R.write),typeof R.writev=="function"&&(this._writev=R.writev),typeof R.destroy=="function"&&(this._destroy=R.destroy),typeof R.final=="function"&&(this._final=R.final),typeof R.construct=="function"&&(this._construct=R.construct),R.signal&&x(R.signal,this)),h.call(this,R),g.construct(this,()=>{const Y=this._writableState;Y.writing||le(this,Y),M(this,Y)})}function B(R,ne,Y,ie){const oe=R._writableState;if(typeof Y=="function")ie=Y,Y=oe.defaultEncoding;else{if(Y){if(Y!=="buffer"&&!w.isEncoding(Y))throw new N(Y)}else Y=oe.defaultEncoding;typeof ie!="function"&&(ie=se)}if(ne===null)throw new b;if(!oe.objectMode)if(typeof ne=="string")oe.decodeStrings!==!1&&(ne=w.from(ne,Y),Y="buffer");else if(ne instanceof w)Y="buffer";else{if(!h._isUint8Array(ne))throw new Q("chunk",["string","Buffer","Uint8Array"],ne);ne=h._uint8ArrayToBuffer(ne),Y="buffer"}let u;return oe.ending?u=new L:oe.destroyed&&(u=new T("write")),u?(r.nextTick(ie,u),K(R,u,!0),u):(oe.pendingcb++,function(m,_,F,G,re){const ce=_.objectMode?1:F.length;_.length+=ce;const he=_.length<_.highWaterMark;return he||(_.needDrain=!0),_.writing||_.corked||_.errored||!_.constructed?(_.buffered.push({chunk:F,encoding:G,callback:re}),_.allBuffers&&G!=="buffer"&&(_.allBuffers=!1),_.allNoop&&re!==se&&(_.allNoop=!1)):(_.writelen=ce,_.writecb=re,_.writing=!0,_.sync=!0,m._write(F,G,_.onwrite),_.sync=!1),he&&!_.errored&&!_.destroyed}(R,oe,ne,Y,ie))}function U(R,ne,Y,ie,oe,u,m){ne.writelen=ie,ne.writecb=m,ne.writing=!0,ne.sync=!0,ne.destroyed?ne.onwrite(new T("write")):Y?R._writev(oe,ne.onwrite):R._write(oe,u,ne.onwrite),ne.sync=!1}function P(R,ne,Y,ie){--ne.pendingcb,ie(Y),te(ne),K(R,Y)}function J(R,ne){const Y=R._writableState,ie=Y.sync,oe=Y.writecb;typeof oe=="function"?(Y.writing=!1,Y.writecb=null,Y.length-=Y.writelen,Y.writelen=0,ne?(ne.stack,Y.errored||(Y.errored=ne),R._readableState&&!R._readableState.errored&&(R._readableState.errored=ne),ie?r.nextTick(P,R,Y,ne,oe):P(R,Y,ne,oe)):(Y.buffered.length>Y.bufferedIndex&&le(R,Y),ie?Y.afterWriteTickInfo!==null&&Y.afterWriteTickInfo.cb===oe?Y.afterWriteTickInfo.count++:(Y.afterWriteTickInfo={count:1,cb:oe,stream:R,state:Y},r.nextTick(D,Y.afterWriteTickInfo)):V(R,Y,1,oe))):K(R,new y)}function D({stream:R,state:ne,count:Y,cb:ie}){return ne.afterWriteTickInfo=null,V(R,ne,Y,ie)}function V(R,ne,Y,ie){for(!ne.ending&&!R.destroyed&&ne.length===0&&ne.needDrain&&(ne.needDrain=!1,R.emit("drain"));Y-- >0;)ne.pendingcb--,ie();ne.destroyed&&te(ne),M(R,ne)}function te(R){if(R.writing)return;for(let oe=R.bufferedIndex;oe1&&R._writev){ne.pendingcb-=u-1;const _=ne.allNoop?se:G=>{for(let re=m;re256?(Y.splice(0,m),ne.bufferedIndex=0):ne.bufferedIndex=m}ne.bufferProcessing=!1}function ee(R){return R.ending&&!R.destroyed&&R.constructed&&R.length===0&&!R.errored&&R.buffered.length===0&&!R.finished&&!R.writing&&!R.errorEmitted&&!R.closeEmitted}function M(R,ne,Y){ee(ne)&&(function(ie,oe){oe.prefinished||oe.finalCalled||(typeof ie._final!="function"||oe.destroyed?(oe.prefinished=!0,ie.emit("prefinish")):(oe.finalCalled=!0,function(u,m){let _=!1;function F(G){if(_)K(u,G??y());else if(_=!0,m.pendingcb--,G){const re=m[q].splice(0);for(let ce=0;ce{ee(oe)?E(ie,oe):oe.pendingcb--},R,ne)):ee(ne)&&(ne.pendingcb++,E(R,ne))))}function E(R,ne){ne.pendingcb--,ne.finished=!0;const Y=ne[q].splice(0);for(let ie=0;ie{const{ArrayIsArray:r,ArrayPrototypeIncludes:n,ArrayPrototypeJoin:a,ArrayPrototypeMap:l,NumberIsInteger:d,NumberIsNaN:i,NumberMAX_SAFE_INTEGER:o,NumberMIN_SAFE_INTEGER:c,NumberParseInt:p,ObjectPrototypeHasOwnProperty:v,RegExpPrototypeExec:f,String:h,StringPrototypeToUpperCase:w,StringPrototypeTrim:g}=t(4134),{hideStackFrames:x,codes:{ERR_SOCKET_BAD_PORT:j,ERR_INVALID_ARG_TYPE:A,ERR_INVALID_ARG_VALUE:Q,ERR_OUT_OF_RANGE:S,ERR_UNKNOWN_SIGNAL:y}}=t(6371),{normalizeEncoding:O}=t(7760),{isAsyncFunction:T,isArrayBufferView:k}=t(7760).types,b={},L=/^[0-7]+$/,N=x((E,W,z=c,Z=o)=>{if(typeof E!="number")throw new A(W,"number",E);if(!d(E))throw new S(W,"an integer",E);if(EZ)throw new S(W,`>= ${z} && <= ${Z}`,E)}),K=x((E,W,z=-2147483648,Z=2147483647)=>{if(typeof E!="number")throw new A(W,"number",E);if(!d(E))throw new S(W,"an integer",E);if(EZ)throw new S(W,`>= ${z} && <= ${Z}`,E)}),se=x((E,W,z=!1)=>{if(typeof E!="number")throw new A(W,"number",E);if(!d(E))throw new S(W,"an integer",E);const Z=z?1:0,R=4294967295;if(ER)throw new S(W,`>= ${Z} && <= ${R}`,E)});function q(E,W){if(typeof E!="string")throw new A(W,"string",E)}const C=x((E,W,z)=>{if(!n(z,E)){const Z=a(l(z,R=>typeof R=="string"?`'${R}'`:h(R)),", ");throw new Q(W,E,"must be one of: "+Z)}});function X(E,W){if(typeof E!="boolean")throw new A(W,"boolean",E)}function I(E,W,z){return E!=null&&v(E,W)?E[W]:z}const B=x((E,W,z=null)=>{const Z=I(z,"allowArray",!1),R=I(z,"allowFunction",!1);if(!I(z,"nullable",!1)&&E===null||!Z&&r(E)||typeof E!="object"&&(!R||typeof E!="function"))throw new A(W,"Object",E)}),U=x((E,W)=>{if(E!=null&&typeof E!="object"&&typeof E!="function")throw new A(W,"a dictionary",E)}),P=x((E,W,z=0)=>{if(!r(E))throw new A(W,"Array",E);if(E.length{if(!k(E))throw new A(W,["Buffer","TypedArray","DataView"],E)}),D=x((E,W)=>{if(E!==void 0&&(E===null||typeof E!="object"||!("aborted"in E)))throw new A(W,"AbortSignal",E)}),V=x((E,W)=>{if(typeof E!="function")throw new A(W,"Function",E)}),te=x((E,W)=>{if(typeof E!="function"||T(E))throw new A(W,"Function",E)}),le=x((E,W)=>{if(E!==void 0)throw new A(W,"undefined",E)}),ee=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function M(E,W){if(E===void 0||!f(ee,E))throw new Q(W,E,'must be an array or string of format "; rel=preload; as=style"')}s.exports={isInt32:function(E){return E===(0|E)},isUint32:function(E){return E===E>>>0},parseFileMode:function(E,W,z){if(E===void 0&&(E=z),typeof E=="string"){if(f(L,E)===null)throw new Q(W,E,"must be a 32-bit unsigned integer or an octal string");E=p(E,8)}return se(E,W),E},validateArray:P,validateStringArray:function(E,W){P(E,W);for(let z=0;zZ||(z!=null||Z!=null)&&i(E))throw new S(W,`${z!=null?`>= ${z}`:""}${z!=null&&Z!=null?" && ":""}${Z!=null?`<= ${Z}`:""}`,E)},validateObject:B,validateOneOf:C,validatePlainFunction:te,validatePort:function(E,W="Port",z=!0){if(typeof E!="number"&&typeof E!="string"||typeof E=="string"&&g(E).length===0||+E!=+E>>>0||E>65535||E===0&&!z)throw new j(W,E,z);return 0|E},validateSignalName:function(E,W="signal"){if(q(E,W),b[E]===void 0)throw b[w(E)]!==void 0?new y(E+" (signals must use all capital letters)"):new y(E)},validateString:q,validateUint32:se,validateUndefined:le,validateUnion:function(E,W,z){if(!n(z,E))throw new A(W,`('${a(z,"|")}')`,E)},validateAbortSignal:D,validateLinkHeaderValue:function(E){if(typeof E=="string")return M(E,"hints"),E;if(r(E)){const W=E.length;let z="";if(W===0)return z;for(let Z=0;Z; rel=preload; as=style"')}}},9198:(s,e,t)=>{const r=t(5506),n=t(3095),a=r.Readable.destroy;s.exports=r.Readable,s.exports._uint8ArrayToBuffer=r._uint8ArrayToBuffer,s.exports._isUint8Array=r._isUint8Array,s.exports.isDisturbed=r.isDisturbed,s.exports.isErrored=r.isErrored,s.exports.isReadable=r.isReadable,s.exports.Readable=r.Readable,s.exports.Writable=r.Writable,s.exports.Duplex=r.Duplex,s.exports.Transform=r.Transform,s.exports.PassThrough=r.PassThrough,s.exports.addAbortSignal=r.addAbortSignal,s.exports.finished=r.finished,s.exports.destroy=r.destroy,s.exports.destroy=a,s.exports.pipeline=r.pipeline,s.exports.compose=r.compose,Object.defineProperty(r,"promises",{configurable:!0,enumerable:!0,get:()=>n}),s.exports.Stream=r.Stream,s.exports.default=s.exports},6371:(s,e,t)=>{const{format:r,inspect:n,AggregateError:a}=t(7760),l=globalThis.AggregateError||a,d=Symbol("kIsNodeError"),i=["string","function","number","object","Function","Object","boolean","bigint","symbol"],o=/^([A-Z][a-z0-9]*)+$/,c={};function p(g,x){if(!g)throw new c.ERR_INTERNAL_ASSERTION(x)}function v(g){let x="",j=g.length;const A=g[0]==="-"?1:0;for(;j>=A+4;j-=3)x=`_${g.slice(j-3,j)}${x}`;return`${g.slice(0,j)}${x}`}function f(g,x,j){j||(j=Error);class A extends j{constructor(...S){super(function(y,O,T){if(typeof O=="function")return p(O.length<=T.length,`Code: ${y}; The provided arguments length (${T.length}) does not match the required ones (${O.length}).`),O(...T);const k=(O.match(/%[dfijoOs]/g)||[]).length;return p(k===T.length,`Code: ${y}; The provided arguments length (${T.length}) does not match the required ones (${k}).`),T.length===0?O:r(O,...T)}(g,x,S))}toString(){return`${this.name} [${g}]: ${this.message}`}}Object.defineProperties(A.prototype,{name:{value:j.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${g}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),A.prototype.code=g,A.prototype[d]=!0,c[g]=A}function h(g){const x="__node_internal_"+g.name;return Object.defineProperty(g,"name",{value:x}),g}class w extends Error{constructor(x="The operation was aborted",j=void 0){if(j!==void 0&&typeof j!="object")throw new c.ERR_INVALID_ARG_TYPE("options","Object",j);super(x,j),this.code="ABORT_ERR",this.name="AbortError"}}f("ERR_ASSERTION","%s",Error),f("ERR_INVALID_ARG_TYPE",(g,x,j)=>{p(typeof g=="string","'name' must be a string"),Array.isArray(x)||(x=[x]);let A="The ";g.endsWith(" argument")?A+=`${g} `:A+=`"${g}" ${g.includes(".")?"property":"argument"} `,A+="must be ";const Q=[],S=[],y=[];for(const T of x)p(typeof T=="string","All expected entries have to be of type string"),i.includes(T)?Q.push(T.toLowerCase()):o.test(T)?S.push(T):(p(T!=="object",'The value "object" should be written as "Object"'),y.push(T));if(S.length>0){const T=Q.indexOf("object");T!==-1&&(Q.splice(Q,T,1),S.push("Object"))}if(Q.length>0){switch(Q.length){case 1:A+=`of type ${Q[0]}`;break;case 2:A+=`one of type ${Q[0]} or ${Q[1]}`;break;default:{const T=Q.pop();A+=`one of type ${Q.join(", ")}, or ${T}`}}(S.length>0||y.length>0)&&(A+=" or ")}if(S.length>0){switch(S.length){case 1:A+=`an instance of ${S[0]}`;break;case 2:A+=`an instance of ${S[0]} or ${S[1]}`;break;default:{const T=S.pop();A+=`an instance of ${S.join(", ")}, or ${T}`}}y.length>0&&(A+=" or ")}switch(y.length){case 0:break;case 1:y[0].toLowerCase()!==y[0]&&(A+="an "),A+=`${y[0]}`;break;case 2:A+=`one of ${y[0]} or ${y[1]}`;break;default:{const T=y.pop();A+=`one of ${y.join(", ")}, or ${T}`}}if(j==null)A+=`. Received ${j}`;else if(typeof j=="function"&&j.name)A+=`. Received function ${j.name}`;else if(typeof j=="object"){var O;(O=j.constructor)!==null&&O!==void 0&&O.name?A+=`. Received an instance of ${j.constructor.name}`:A+=`. Received ${n(j,{depth:-1})}`}else{let T=n(j,{colors:!1});T.length>25&&(T=`${T.slice(0,25)}...`),A+=`. Received type ${typeof j} (${T})`}return A},TypeError),f("ERR_INVALID_ARG_VALUE",(g,x,j="is invalid")=>{let A=n(x);return A.length>128&&(A=A.slice(0,128)+"..."),`The ${g.includes(".")?"property":"argument"} '${g}' ${j}. Received ${A}`},TypeError),f("ERR_INVALID_RETURN_VALUE",(g,x,j)=>{var A;return`Expected ${g} to be returned from the "${x}" function but got ${j!=null&&(A=j.constructor)!==null&&A!==void 0&&A.name?`instance of ${j.constructor.name}`:"type "+typeof j}.`},TypeError),f("ERR_MISSING_ARGS",(...g)=>{let x;p(g.length>0,"At least one arg needs to be specified");const j=g.length;switch(g=(Array.isArray(g)?g:[g]).map(A=>`"${A}"`).join(" or "),j){case 1:x+=`The ${g[0]} argument`;break;case 2:x+=`The ${g[0]} and ${g[1]} arguments`;break;default:{const A=g.pop();x+=`The ${g.join(", ")}, and ${A} arguments`}}return`${x} must be specified`},TypeError),f("ERR_OUT_OF_RANGE",(g,x,j)=>{let A;return p(x,'Missing "range" argument'),Number.isInteger(j)&&Math.abs(j)>2**32?A=v(String(j)):typeof j=="bigint"?(A=String(j),(j>2n**32n||j<-(2n**32n))&&(A=v(A)),A+="n"):A=n(j),`The value of "${g}" is out of range. It must be ${x}. Received ${A}`},RangeError),f("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),f("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),f("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),f("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),f("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),f("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),f("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),f("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),f("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),f("ERR_STREAM_WRITE_AFTER_END","write after end",Error),f("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),s.exports={AbortError:w,aggregateTwoErrors:h(function(g,x){if(g&&x&&g!==x){if(Array.isArray(x.errors))return x.errors.push(g),x;const j=new l([x,g],x.message);return j.code=x.code,j}return g||x}),hideStackFrames:h,codes:c}},4134:s=>{s.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}},7760:(s,e,t)=>{const r=t(8287),{kResistStopPropagation:n,SymbolDispose:a}=t(4134),l=globalThis.AbortSignal||t(5568).AbortSignal,d=globalThis.AbortController||t(5568).AbortController,i=Object.getPrototypeOf(async function(){}).constructor,o=globalThis.Blob||r.Blob,c=o!==void 0?function(f){return f instanceof o}:function(f){return!1},p=(f,h)=>{if(f!==void 0&&(f===null||typeof f!="object"||!("aborted"in f)))throw new ERR_INVALID_ARG_TYPE(h,"AbortSignal",f)};class v extends Error{constructor(h){if(!Array.isArray(h))throw new TypeError("Expected input to be an Array, got "+typeof h);let w="";for(let g=0;g{f=w,h=g}),resolve:f,reject:h}},promisify:f=>new Promise((h,w)=>{f((g,...x)=>g?w(g):h(...x))}),debuglog:()=>function(){},format:(f,...h)=>f.replace(/%([sdifj])/g,function(...[w,g]){const x=h.shift();return g==="f"?x.toFixed(6):g==="j"?JSON.stringify(x):g==="s"&&typeof x=="object"?`${x.constructor!==Object?x.constructor.name:""} {}`.trim():x.toString()}),inspect(f){switch(typeof f){case"string":if(f.includes("'")){if(!f.includes('"'))return`"${f}"`;if(!f.includes("`")&&!f.includes("${"))return`\`${f}\``}return`'${f}'`;case"number":return isNaN(f)?"NaN":Object.is(f,-0)?String(f):f;case"bigint":return`${String(f)}n`;case"boolean":case"undefined":return String(f);case"object":return"{}"}},types:{isAsyncFunction:f=>f instanceof i,isArrayBufferView:f=>ArrayBuffer.isView(f)},isBlob:c,deprecate:(f,h)=>f,addAbortListener:t(7007).addAbortListener||function(f,h){if(f===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",f);let w;return p(f,"signal"),(g=>{if(typeof g!="function")throw new ERR_INVALID_ARG_TYPE("listener","Function",g)})(h),f.aborted?queueMicrotask(()=>h()):(f.addEventListener("abort",h,{__proto__:null,once:!0,[n]:!0}),w=()=>{f.removeEventListener("abort",h)}),{__proto__:null,[a](){var g;(g=w)===null||g===void 0||g()}}},AbortSignalAny:l.any||function(f){if(f.length===1)return f[0];const h=new d,w=()=>h.abort();return f.forEach(g=>{p(g,"signals"),g.addEventListener("abort",w,{once:!0})}),h.signal.addEventListener("abort",()=>{f.forEach(g=>g.removeEventListener("abort",w))},{once:!0}),h.signal}},s.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},5506:(s,e,t)=>{const{Buffer:r}=t(8287),{ObjectDefineProperty:n,ObjectKeys:a,ReflectApply:l}=t(4134),{promisify:{custom:d}}=t(7760),{streamReturningOperators:i,promiseReturningOperators:o}=t(823),{codes:{ERR_ILLEGAL_CONSTRUCTOR:c}}=t(6371),p=t(7830),{setDefaultHighWaterMark:v,getDefaultHighWaterMark:f}=t(5291),{pipeline:h}=t(7758),{destroyer:w}=t(5896),g=t(6238),x=t(3095),j=t(6115),A=s.exports=t(4259).Stream;A.isDestroyed=j.isDestroyed,A.isDisturbed=j.isDisturbed,A.isErrored=j.isErrored,A.isReadable=j.isReadable,A.isWritable=j.isWritable,A.Readable=t(7576);for(const S of a(i)){let O=function(...T){if(new.target)throw c();return A.Readable.from(l(y,this,T))};const y=i[S];n(O,"name",{__proto__:null,value:y.name}),n(O,"length",{__proto__:null,value:y.length}),n(A.Readable.prototype,S,{__proto__:null,value:O,enumerable:!1,configurable:!0,writable:!0})}for(const S of a(o)){let O=function(...T){if(new.target)throw c();return l(y,this,T)};const y=o[S];n(O,"name",{__proto__:null,value:y.name}),n(O,"length",{__proto__:null,value:y.length}),n(A.Readable.prototype,S,{__proto__:null,value:O,enumerable:!1,configurable:!0,writable:!0})}A.Writable=t(8584),A.Duplex=t(3370),A.Transform=t(5001),A.PassThrough=t(6524),A.pipeline=h;const{addAbortSignal:Q}=t(4147);A.addAbortSignal=Q,A.finished=g,A.destroy=w,A.compose=p,A.setDefaultHighWaterMark=v,A.getDefaultHighWaterMark=f,n(A,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>x}),n(h,d,{__proto__:null,enumerable:!0,get:()=>x.pipeline}),n(g,d,{__proto__:null,enumerable:!0,get:()=>x.finished}),A.Stream=A,A._isUint8Array=function(S){return S instanceof Uint8Array},A._uint8ArrayToBuffer=function(S){return r.from(S.buffer,S.byteOffset,S.byteLength)}},3095:(s,e,t)=>{const{ArrayPrototypePop:r,Promise:n}=t(4134),{isIterable:a,isNodeStream:l,isWebStream:d}=t(6115),{pipelineImpl:i}=t(7758),{finished:o}=t(6238);t(5506),s.exports={finished:o,pipeline:function(...c){return new n((p,v)=>{let f,h;const w=c[c.length-1];if(w&&typeof w=="object"&&!l(w)&&!a(w)&&!d(w)){const g=r(c);f=g.signal,h=g.end}i(c,(g,x)=>{g?v(g):p(x)},{signal:f,end:h})})}}},2791:function(s,e,t){(function(r){if(!r.setImmediate){var n,a,l,d,i,o=1,c={},p=!1,v=r.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(r);f=f&&f.setTimeout?f:r,{}.toString.call(r.process)==="[object process]"?n=function(g){fn.nextTick(function(){w(g)})}:function(){if(r.postMessage&&!r.importScripts){var g=!0,x=r.onmessage;return r.onmessage=function(){g=!1},r.postMessage("","*"),r.onmessage=x,g}}()?(d="setImmediate$"+Math.random()+"$",i=function(g){g.source===r&&typeof g.data=="string"&&g.data.indexOf(d)===0&&w(+g.data.slice(d.length))},r.addEventListener?r.addEventListener("message",i,!1):r.attachEvent("onmessage",i),n=function(g){r.postMessage(d+g,"*")}):r.MessageChannel?((l=new MessageChannel).port1.onmessage=function(g){w(g.data)},n=function(g){l.port2.postMessage(g)}):v&&"onreadystatechange"in v.createElement("script")?(a=v.documentElement,n=function(g){var x=v.createElement("script");x.onreadystatechange=function(){w(g),x.onreadystatechange=null,a.removeChild(x),x=null},a.appendChild(x)}):n=function(g){setTimeout(w,0,g)},f.setImmediate=function(g){typeof g!="function"&&(g=new Function(""+g));for(var x=new Array(arguments.length-1),j=0;j"u"?t.g===void 0?this:t.g:self)},3141:(s,e,t)=>{var r=t(5003).Buffer,n=r.isEncoding||function(h){switch((h=""+h)&&h.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(h){var w;switch(this.encoding=function(g){var x=function(j){if(!j)return"utf8";for(var A;;)switch(j){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 j;default:if(A)return;j=(""+j).toLowerCase(),A=!0}}(g);if(typeof x!="string"&&(r.isEncoding===n||!n(g)))throw new Error("Unknown encoding: "+g);return x||g}(h),this.encoding){case"utf16le":this.text=i,this.end=o,w=4;break;case"utf8":this.fillLast=d,w=4;break;case"base64":this.text=c,this.end=p,w=3;break;default:return this.write=v,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(w)}function l(h){return h<=127?0:h>>5==6?2:h>>4==14?3:h>>3==30?4:h>>6==2?-1:-2}function d(h){var w=this.lastTotal-this.lastNeed,g=function(x,j){if((192&j[0])!=128)return x.lastNeed=0,"�";if(x.lastNeed>1&&j.length>1){if((192&j[1])!=128)return x.lastNeed=1,"�";if(x.lastNeed>2&&j.length>2&&(192&j[2])!=128)return x.lastNeed=2,"�"}}(this,h);return g!==void 0?g:this.lastNeed<=h.length?(h.copy(this.lastChar,w,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(h.copy(this.lastChar,w,0,h.length),void(this.lastNeed-=h.length))}function i(h,w){if((h.length-w)%2==0){var g=h.toString("utf16le",w);if(g){var x=g.charCodeAt(g.length-1);if(x>=55296&&x<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=h[h.length-2],this.lastChar[1]=h[h.length-1],g.slice(0,-1)}return g}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=h[h.length-1],h.toString("utf16le",w,h.length-1)}function o(h){var w=h&&h.length?this.write(h):"";if(this.lastNeed){var g=this.lastTotal-this.lastNeed;return w+this.lastChar.toString("utf16le",0,g)}return w}function c(h,w){var g=(h.length-w)%3;return g===0?h.toString("base64",w):(this.lastNeed=3-g,this.lastTotal=3,g===1?this.lastChar[0]=h[h.length-1]:(this.lastChar[0]=h[h.length-2],this.lastChar[1]=h[h.length-1]),h.toString("base64",w,h.length-g))}function p(h){var w=h&&h.length?this.write(h):"";return this.lastNeed?w+this.lastChar.toString("base64",0,3-this.lastNeed):w}function v(h){return h.toString(this.encoding)}function f(h){return h&&h.length?this.write(h):""}e.StringDecoder=a,a.prototype.write=function(h){if(h.length===0)return"";var w,g;if(this.lastNeed){if((w=this.fillLast(h))===void 0)return"";g=this.lastNeed,this.lastNeed=0}else g=0;return g=0?(y>0&&(j.lastNeed=y-1),y):--S=0?(y>0&&(j.lastNeed=y-2),y):--S=0?(y>0&&(y===2?y=0:j.lastNeed=y-3),y):0}(this,h,w);if(!this.lastNeed)return h.toString("utf8",w);this.lastTotal=g;var x=h.length-(g-this.lastNeed);return h.copy(this.lastChar,0,x),h.toString("utf8",w,x)},a.prototype.fillLast=function(h){if(this.lastNeed<=h.length)return h.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);h.copy(this.lastChar,this.lastTotal-this.lastNeed,0,h.length),this.lastNeed-=h.length}},5003:(s,e,t)=>{var r=t(8287),n=r.Buffer;function a(d,i){for(var o in d)i[o]=d[o]}function l(d,i,o){return n(d,i,o)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?s.exports=r:(a(r,e),e.Buffer=l),l.prototype=Object.create(n.prototype),a(n,l),l.from=function(d,i,o){if(typeof d=="number")throw new TypeError("Argument must not be a number");return n(d,i,o)},l.alloc=function(d,i,o){if(typeof d!="number")throw new TypeError("Argument must be a number");var c=n(d);return i!==void 0?typeof o=="string"?c.fill(i,o):c.fill(i):c.fill(0),c},l.allocUnsafe=function(d){if(typeof d!="number")throw new TypeError("Argument must be a number");return n(d)},l.allocUnsafeSlow=function(d){if(typeof d!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(d)}},259:s=>{s.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}},8799:(s,e,t)=>{function r(i){var o=this;if(o instanceof r||(o=new r),o.tail=null,o.head=null,o.length=0,i&&typeof i.forEach=="function")i.forEach(function(v){o.push(v)});else if(arguments.length>0)for(var c=0,p=arguments.length;c1)c=o;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");p=this.head.next,c=this.head.value}for(var v=0;p!==null;v++)c=i(c,p.value,v),p=p.next;return c},r.prototype.reduceReverse=function(i,o){var c,p=this.tail;if(arguments.length>1)c=o;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");p=this.tail.prev,c=this.tail.value}for(var v=this.length-1;p!==null;v--)c=i(c,p.value,v),p=p.prev;return c},r.prototype.toArray=function(){for(var i=new Array(this.length),o=0,c=this.head;c!==null;o++)i[o]=c.value,c=c.next;return i},r.prototype.toArrayReverse=function(){for(var i=new Array(this.length),o=0,c=this.tail;c!==null;o++)i[o]=c.value,c=c.prev;return i},r.prototype.slice=function(i,o){(o=o||this.length)<0&&(o+=this.length),(i=i||0)<0&&(i+=this.length);var c=new r;if(othis.length&&(o=this.length);for(var p=0,v=this.head;v!==null&&pthis.length&&(o=this.length);for(var p=this.length,v=this.tail;v!==null&&p>o;p--)v=v.prev;for(;v!==null&&p>i;p--,v=v.prev)c.push(v.value);return c},r.prototype.splice=function(i,o,...c){i>this.length&&(i=this.length-1),i<0&&(i=this.length+i);for(var p=0,v=this.head;v!==null&&p{}},_r={};function je(s){var e=_r[s];if(e!==void 0)return e.exports;var t=_r[s]={exports:{}};return Tn[s].call(t.exports,t,t.exports,je),t.exports}je.n=s=>{var e=s&&s.__esModule?()=>s.default:()=>s;return je.d(e,{a:e}),e},je.d=(s,e)=>{for(var t in e)je.o(e,t)&&!je.o(s,t)&&Object.defineProperty(s,t,{enumerable:!0,get:e[t]})},je.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),je.o=(s,e)=>Object.prototype.hasOwnProperty.call(s,e),je.r=s=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})};var Rn={};je.d(Rn,{TS:()=>Kt,aH:()=>en,k_:()=>Vn,a6:()=>dn,nt:()=>Jr,Sx:()=>Qr,E7:()=>pt,F3:()=>Xr});var qt={};je.r(qt),je.d(qt,{anyAtomicType:()=>$i,anySimpleType:()=>Pi,anyURI:()=>ts,base64Binary:()=>es,boolean:()=>Fi,byte:()=>ds,date:()=>Wi,dateTime:()=>Vi,dateTimeStamp:()=>ws,dayTimeDuration:()=>vs,decimal:()=>qi,double:()=>Gi,duration:()=>Hi,float:()=>Ui,gDay:()=>Ki,gMonth:()=>Yi,gMonthDay:()=>Xi,gYear:()=>Qi,gYearMonth:()=>Ji,hexBinary:()=>Zi,int:()=>cs,integer:()=>ss,language:()=>is,long:()=>ls,negativeInteger:()=>os,nonNegativeInteger:()=>hs,nonPositiveInteger:()=>as,normalizedString:()=>rs,positiveInteger:()=>ys,short:()=>us,string:()=>Bi,time:()=>zi,token:()=>ns,unsignedByte:()=>ms,unsignedInt:()=>ps,unsignedLong:()=>fs,unsignedShort:()=>gs,yearMonthDuration:()=>bs});const at="http://www.w3.org/1999/02/22-rdf-syntax-ns#",ot="http://www.w3.org/2001/XMLSchema#",Dt="http://www.w3.org/2000/10/swap/",Re={xsd:{decimal:`${ot}decimal`,boolean:`${ot}boolean`,double:`${ot}double`,integer:`${ot}integer`,string:`${ot}string`},rdf:{type:`${at}type`,nil:`${at}nil`,first:`${at}first`,rest:`${at}rest`,langString:`${at}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${Dt}reify#forSome`,forAll:`${Dt}reify#forAll`},log:{implies:`${Dt}log#implies`}},{rdf:On,xsd:Qe}=Re;let ht,kn=0;const Ut={namedNode:function(s){return new rr(s)},blankNode:function(s){return new Ln(s||"n3-"+kn++)},variable:function(s){return new An(s)},literal:function(s,e){if(typeof e=="string")return new Ue(`"${s}"@${e.toLowerCase()}`);let t=e?e.value:"";return t===""&&(typeof s=="boolean"?t=Qe.boolean:typeof s=="number"&&(Number.isFinite(s)?t=Number.isInteger(s)?Qe.integer:Qe.double:(t=Qe.double,Number.isNaN(s)||(s=s>0?"INF":"-INF")))),t===""||t===Qe.string?new Ue(`"${s}"`):new Ue(`"${s}"^^${t}`)},defaultGraph:function(){return ht},quad:xr,triple:xr},we=Ut;class Ve{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof Ve?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 rr extends Ve{get termType(){return"NamedNode"}}class Ue extends Ve{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let t=e.lastIndexOf('"')+1;return t{d.value&&r.replaceWith(a[parseInt(d.value)])},r.appendChild(l)}else{const a=[];for(let i=0;i{d.value&&r.replaceWith(Qt(e.template.clone().merge(a[parseInt(d.value)]),void 0,!0))},r.appendChild(l)}return r}const Fn={[`${ye}name`]:(s,e)=>{const t=e;s.name&&t.language!==s.config.attributes.language||(s.name=t)},[`${ye}description`]:(s,e)=>{const t=e;s.description&&t.language!==s.config.attributes.language||(s.description=t)},[`${ye}path`]:(s,e)=>{s.path=e.value},[`${ye}node`]:(s,e)=>{s.node=e},[`${ye}datatype`]:(s,e)=>{s.datatype=e},[`${ye}nodeKind`]:(s,e)=>{s.nodeKind=e},[`${ye}minCount`]:(s,e)=>{s.minCount=parseInt(e.value)},[`${ye}maxCount`]:(s,e)=>{s.maxCount=parseInt(e.value)},[`${ye}minLength`]:(s,e)=>{s.minLength=parseInt(e.value)},[`${ye}maxLength`]:(s,e)=>{s.maxLength=parseInt(e.value)},[`${ye}minInclusive`]:(s,e)=>{s.minInclusive=parseInt(e.value)},[`${ye}maxInclusive`]:(s,e)=>{s.maxInclusive=parseInt(e.value)},[`${ye}minExclusive`]:(s,e)=>{s.minExclusive=parseInt(e.value)},[`${ye}maxExclusive`]:(s,e)=>{s.maxExclusive=parseInt(e.value)},[`${ye}pattern`]:(s,e)=>{s.pattern=e.value},[`${ye}order`]:(s,e)=>{s.order=parseInt(e.value)},"http://datashapes.org/dash#singleLine":(s,e)=>{s.singleLine=e.value==="true"},"http://www.w3.org/ns/oa#styleClass":(s,e)=>{s.cssClass=e.value},[`${ye}and`]:(s,e)=>{s.shaclAnd=e.value},[`${ye}in`]:(s,e)=>{s.shaclIn=e.value},[`${ye}languageIn`]:(s,e)=>{s.languageIn=s.config.lists[e.value],s.datatype=we.namedNode(nr+"langString")},[`${ye}defaultValue`]:(s,e)=>{s.defaultValue=e},[`${ye}hasValue`]:(s,e)=>{s.hasValue=e},[sr.value]:(s,e)=>{s.class=e;const t=s.config.shapesGraph.getSubjects(ar,e,Se);t.length>0&&(s.node=t[0])},[`${ye}or`]:(s,e)=>{const t=s.config.lists[e.value];t!=null&&t.length?s.shaclOr=t:console.error("list not found:",e.value,"existing lists:",s.config.lists)}};class Jr{constructor(e,t,r){this.label="",this.config=r,this.nodeId=t,this.merge(e)}merge(e){var t,r;for(const n of e)(t=Fn[n.predicate.id])===null||t===void 0||t.call(this,this,n.object);if(this.label=((r=this.name)===null||r===void 0?void 0:r.value)||pt(e,this.config.languages),this.label||this.shaclAnd||(this.label=this.path?Vt(this.path,this.config.prefixes):"unknown"),(this.node||this.shaclAnd)&&(this.extendedShapes=[],this.node&&this.extendedShapes.push(this.node),this.shaclAnd)){const n=this.config.lists[this.shaclAnd];if(n!=null&&n.length)for(const a of n)this.extendedShapes.push(a)}return this}clone(){const e=Object.assign({},this);return e.merge=this.merge.bind(e),e.clone=this.clone.bind(e),e}}class Qr{constructor(e){let t=`form { box-sizing: border-box; display:block; --label-width: 8em; --caret-size: 10px; } +form.mode-edit { padding-left: 1em; } +form *, form ::after, form ::before { box-sizing: inherit; } +shacl-node, .shacl-group { display: flex; flex-direction: column; width: 100%; position: relative; } +shacl-node .control-button { text-decoration: none; cursor: pointer; border: 1px solid transparent; border-radius: 4px; padding: 2px 4px; } +shacl-node .control-button:hover { border-color: inherit; } +shacl-node .remove-button { margin-left: 4px; } +shacl-node .add-button { font-size: 0.8rem; color: #555; margin: 4px 24px 0 0; } +shacl-node .add-button:before { content: '+'; margin-right: 0.2em; } +shacl-node .add-button:hover { color: inherit; } +shacl-node h1 { font-size: 1.1rem; border-bottom: 1px solid; margin-top: 4px; color: #555; } +shacl-property { display: flex; flex-direction: column; align-items: end; position: relative; } +shacl-property:not(.may-add) > .add-button { display: none; } +shacl-property:not(.may-remove) > .property-instance > .remove-button:not(.persistent) { visibility: hidden; } +shacl-property:not(.may-remove) > .shacl-or-constraint > .remove-button:not(.persistent) { visibility: hidden; } +.shacl-group { margin-bottom: 1em; padding-bottom: 1em; } +.mode-view .shacl-group:not(:has(shacl-property)) { display: none; } +.property-instance, .shacl-or-constraint { display: flex; align-items: flex-start; padding: 4px 0; width: 100%; position: relative; } +.shacl-or-constraint label { display: inline-block; word-break: break-word; width: var(--label-width); line-height: 1em; padding-top: 0.15em; padding-right: 1em; flex-shrink: 0; position: relative; } +.property-instance label[title] { cursor: help; text-decoration: underline dashed #AAA; } +.mode-edit .property-instance label.required::before { color: red; content: '\\2736'; font-size: 0.6rem; position: absolute; left: -1.4em; top: 0.15rem; } +.property-instance.valid::before { position: absolute; left: calc(var(--label-width) - 1em); top: 6px; color: green; content: '\\2713'; } +.editor:not([type='checkbox']), .shacl-or-constraint select { flex-grow: 1; } +.shacl-or-constraint select { border: 1px solid #DDD; padding: 2px 4px; } +select { overflow: hidden; text-overflow: ellipsis; } +textarea.editor { resize: vertical; } +.lang-chooser { position: absolute; top: 5px; right: 28px; border: 0; background-color: #e9e9ed; padding: 2px 4px; max-width: 40px; width: 40px; box-sizing: content-box; } +.lang-chooser+.editor { padding-right: 55px; } +.validation-error { position: absolute; left: calc(var(--label-width) - 1em); top: 6px; color: red; cursor: help; } +.validation-error::before { content: '\\26a0' } +.validation-error.node { left: -1em; } +.invalid > .editor { border-color: red !important; } +.ml-0 { margin-left: 0 !important; } +.pr-0 { padding-right: 0 !important; } +.mode-view .property-instance:not(:first-child) > label { visibility: hidden; } +.mode-view .property-instance label { width: var(--label-width); } + +.d-flex { display: flex; } +.lang { opacity: 0.65; font-size: 0.6em; } +a, a:visited { color: inherit; } + +.fadeIn, .fadeOut { animation: fadeIn 0.2s ease-out; } +.fadeOut { animation-direction: reverse; animation-timing-function: ease-out;} +@keyframes fadeIn { + 0% { opacity: 0; transform: scaleY(0.8); } + 100% { opacity: 1; transform: scaleY(1); } +} + +.collapsible > .activator { display: flex; justify-content: space-between; align-items: center; cursor: pointer; width: 100%; border: 0; padding: 8px 0; transition: 0.2s; } +.collapsible > .activator:hover, .collapsible.open > .activator { background-color: #F5F5F5; } +.collapsible > .activator::after { content:''; width: var(--caret-size); height: var(--caret-size); border-style: none solid solid none; border-width: calc(0.3 * var(--caret-size)); transform: rotate(45deg); transition: transform .15s ease-out; margin-right: calc(0.5 * var(--caret-size)); } +.collapsible.open > .activator::after { transform: rotate(225deg); } +.collapsible > *:not(.activator) { transition: all 0.2s ease-out; opacity: 1; } +.collapsible:not(.open) > *:not(.activator) { max-height: 0; padding: 0; opacity: 0; overflow: hidden; } +.collapsible > .property-instance > shacl-node > h1 { display: none; } +.collapsible.open > .property-instance:nth-child(odd) { background-color: #F5F5F5; } +.ref-link { cursor: pointer; } +.ref-link:hover { text-decoration: underline; } +.node-id-display { color: #999; font-size: 11px; }`;e&&(t+=` +`+e),this.stylesheet=new CSSStyleSheet,this.stylesheet.replaceSync(t)}apply(e){}createViewer(e,t,r){const n=document.createElement("div"),a=document.createElement("label");a.innerHTML=e+":",r.description&&a.setAttribute("title",r.description.value),n.appendChild(a);let l,d=t.value,i=null;if(t instanceof rr){const o=r.config.shapesGraph.getQuads(d,null,null,Se);if(o.length){const c=pt(o,r.config.languages);c&&(d=c)}}else t instanceof Ue&&(t.language?(i=document.createElement("span"),i.classList.add("lang"),i.innerText=`@${t.language}`):t.datatype.value===`${Xe}date`?d=new Date(Date.parse(t.value)).toDateString():t.datatype.value===`${Xe}dateTime`&&(d=new Date(Date.parse(t.value)).toLocaleString()));return Wt(t.value)?(l=document.createElement("a"),l.setAttribute("href",t.value)):l=document.createElement("div"),l.classList.add("d-flex"),l.innerText=d,i&&l.appendChild(i),n.appendChild(l),n}}function qn(s,e){var t,r,n;if(s.config.editMode){const a=s.minCount!==void 0&&s.minCount>0;if(s.class)return s.config.theme.createListEditor(s.label,e,a,zt(s.class,s.config),s);if(s.shaclIn){const l=s.config.lists[s.shaclIn];if(l!=null&&l.length){const d=Ht(l,s.config.shapesGraph,s.config.languages);return s.config.theme.createListEditor(s.label,e,a,d,s)}console.error("list not found:",s.shaclIn,"existing lists:",s.config.lists)}if(((t=s.datatype)===null||t===void 0?void 0:t.value)===`${nr}langString`||!((r=s.languageIn)===null||r===void 0)&&r.length)return s.config.theme.createLangStringEditor(s.label,e,a,s);switch((n=s.datatype)===null||n===void 0?void 0:n.value.replace(Xe,"")){case"integer":case"float":case"double":case"decimal":return s.config.theme.createNumberEditor(s.label,e,a,s);case"date":case"dateTime":return s.config.theme.createDateEditor(s.label,e,a,s);case"boolean":return s.config.theme.createBooleanEditor(s.label,e,a,s);case"base64Binary":return s.config.theme.createFileEditor(s.label,e,a,s)}return s.config.theme.createTextEditor(s.label,e,a,s)}{if(e)return s.config.theme.createViewer(s.label,e,s);const a=document.createElement("div");return a.innerHTML="No value",a}}function Jt(s){return!!s&&s.termType==="DefaultGraph"}const lt=we.defaultGraph(),{rdf:Un,xsd:Ye}=Re,Sr=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,jr=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,Gn={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class ct extends Ve{equals(e){return e===this}}class or{constructor(e,t){if(this._prefixRegex=/$0^/,e&&typeof e.write!="function"&&(t=e,e=null),t=t||{},this._lists=t.lists,e)this._outputStream=e,this._endStream=t.end===void 0||!!t.end;else{let r="";this._outputStream={write(n,a,l){r+=n,l&&l()},end:n=>{n&&n(null,r)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(t.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=lt,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes),t.baseIRI&&(this._baseMatcher=new RegExp(`^${Er(t.baseIRI)}${t.baseIRI.endsWith("/")?"":"[#?]"}`),this._baseLength=t.baseIRI.length))}get _inDefaultGraph(){return lt.equals(this._graph)}_write(e,t){this._outputStream.write(e,"utf8",t)}_writeQuad(e,t,r,n,a){try{n.equals(this._graph)||(this._write((this._subject===null?"":this._inDefaultGraph?`. +`:` +} +`)+(lt.equals(n)?"":`${this._encodeIriOrBlank(n)} { +`)),this._graph=n,this._subject=null),e.equals(this._subject)?t.equals(this._predicate)?this._write(`, ${this._encodeObject(r)}`,a):this._write(`; + ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(r)}`,a):this._write(`${(this._subject===null?"":`. +`)+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(r)}`,a)}catch(l){a&&a(l)}}_writeQuadLine(e,t,r,n,a){delete this._prefixMatch,this._write(this.quadToString(e,t,r,n),a)}quadToString(e,t,r,n){return`${this._encodeSubject(e)} ${this._encodeIriOrBlank(t)} ${this._encodeObject(r)}${n&&n.value?` ${this._encodeIriOrBlank(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 e.termType==="Quad"?this._encodeQuad(e):this._encodeIriOrBlank(e)}_encodeIriOrBlank(e){if(e.termType!=="NamedNode")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)),Sr.test(t)&&(t=t.replace(jr,Ir));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(Sr.test(t)&&(t=t.replace(jr,Ir)),e.language)return`"${t}"@${e.language}`;if(this._lineMode){if(e.datatype.value===Ye.string)return`"${t}"`}else switch(e.datatype.value){case Ye.string:return`"${t}"`;case Ye.boolean:if(t==="true"||t==="false")return t;break;case Ye.integer:if(/^[+-]?\d+$/.test(t))return t;break;case Ye.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case Ye.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t}return`"${t}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===Un.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)}${Jt(n)?"":` ${this._encodeIriOrBlank(n)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,t,r,n,a){r===void 0?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):typeof n=="function"?this._writeQuad(e,t,r,lt,n):this._writeQuad(e,t,r,n||lt,a)}addQuads(e){for(let t=0;t. +`)}if(r){let n="",a="";for(const l in this._prefixIRIs)n+=n?`|${l}`:l,a+=(a?"|":"")+this._prefixIRIs[l];n=Er(n),this._prefixRegex=new RegExp(`^(?:${a})[^/]*$|^(${n})([_a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(r?` +`:"",t)}blank(e,t){let r,n,a=e;switch(e===void 0?a=[]:e.termType?a=[{predicate:e,object:t}]:"length"in e||(a=[e]),n=a.length){case 0:return new ct("[]");case 1:if(r=a[0],!(r.object instanceof ct))return new ct(`[ ${this._encodePredicate(r.predicate)} ${this._encodeObject(r.object)} ]`);default:let l="[";for(let d=0;d{t=null,e(r,n)});if(this._endStream)try{return this._outputStream.end(t)}catch{}t&&t()}}function Ir(s){let e=Gn[s];return e===void 0&&(s.length===1?(e=s.charCodeAt(0).toString(16),e="\\u0000".substr(0,6-e.length)+e):(e=(1024*(s.charCodeAt(0)-55296)+s.charCodeAt(1)+9216).toString(16),e="\\U00000000".substr(0,10-e.length)+e)),e}function Er(s){return s.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}function Hn(s){let e=s.shaclDatatype,t=s.value;return t?s.dataset.class||s.dataset.nodeKind===ye+"IRI"?we.namedNode(t):(s.dataset.lang?e=s.dataset.lang:s.type==="number"?t=parseFloat(t):s.type==="file"&&s.binaryData?t=s.binaryData:s.type==="datetime-local"&&(t=new Date(t).toISOString().slice(0,19)),we.literal(t,e)):s.type!=="checkbox"&&s.getAttribute("type")!=="checkbox"||!(s.checked||parseInt(s.dataset.minCount||"0")>0)?void 0:we.literal(s.checked?"true":"false",e)}const dt={};function Xr(s){s.predicate===void 0&&s.datatype===void 0?console.warn('not registering plugin because it does neither define "predicate" nor "datatype"',s):dt[`${s.predicate}^${s.datatype}`]=s}class Vn{constructor(e,t){this.predicate=e.predicate,this.datatype=e.datatype,t&&(this.stylesheet=new CSSStyleSheet,this.stylesheet.replaceSync(t))}createViewer(e,t){return e.config.theme.createViewer(e.label,t,e)}}class lr extends HTMLElement{constructor(e,t,r,n){var a;if(super(),this.template=new Jr(t.shapesGraph.getQuads(e,null,null,Se),r,t),this.dataset.nodeId=this.template.nodeId.id,this.template.order!==void 0&&(this.style.order=`${this.template.order}`),this.template.cssClass&&this.classList.add(this.template.cssClass),t.editMode&&(this.addButton=document.createElement("a"),this.addButton.innerText=this.template.label,this.addButton.title="Add "+this.template.label,this.addButton.classList.add("control-button","add-button"),this.addButton.addEventListener("click",l=>{const d=this.addPropertyInstance();d.classList.add("fadeIn"),this.updateControls(),function(i){var o;(o=i.querySelector("input,select,textarea"))===null||o===void 0||o.focus()}(d),setTimeout(()=>{d.classList.remove("fadeIn")},200)}),this.appendChild(this.addButton)),this.template.path){const l=n?t.dataGraph.getQuads(n,this.template.path,null,null):[];let d=!1;for(const i of l)this.addPropertyInstance(i.object),this.template.hasValue&&i.object.equals(this.template.hasValue)&&(d=!0);t.editMode&&this.template.hasValue&&!d&&this.addPropertyInstance(this.template.hasValue)}if(t.editMode&&(this.addEventListener("change",()=>{this.updateControls()}),this.updateControls()),((a=this.template.extendedShapes)===null||a===void 0?void 0:a.length)&&this.template.config.attributes.collapse!==null&&(!this.template.maxCount||this.template.maxCount>1)&&(t.editMode||this.childElementCount>0)){const l=this;l.classList.add("collapsible"),this.template.config.attributes.collapse==="open"&&l.classList.add("open");const d=document.createElement("h1");d.classList.add("activator"),d.innerText=this.template.label,d.addEventListener("click",()=>{l.classList.toggle("open")}),this.prepend(d)}}addPropertyInstance(e){var t;let r;return!((t=this.template.shaclOr)===null||t===void 0)&&t.length?e?r=Qt(function(n,a){if(!n.shaclOr)return console.warn("can't resolve sh:or because template has no options",n),n;if(a instanceof Ue){const l=a.datatype;for(const d of n.shaclOr){const i=n.config.shapesGraph.getQuads(d,null,null,Se);for(const o of i)if(o.predicate.value===`${ye}datatype`&&o.object.equals(l))return n.clone().merge(i)}}else{let l=n.config.dataGraph.getObjects(a,Oe,null);l.push(...n.config.shapesGraph.getObjects(a,Oe,Se));for(const d of n.shaclOr){const i=n.config.shapesGraph.getQuads(d,null,null,Se);for(const o of i)if(l.length>0){if(o.predicate.value===`${ye}node`){for(const c of l)if(n.config.shapesGraph.has(new tt(o.object,ar,c,Se)))return n.clone().merge(i)}if(o.predicate.equals(sr)){for(const c of l)if(o.object.equals(c))return n.clone().merge(i)}}else if(o.predicate.equals(Bn)&&o.object.equals($n))return n.clone().merge(i)}}return console.error("couldn't resolve sh:or for value",a),n}(this.template,e),e,!0):(r=Wr(this.template.shaclOr,this,this.template.config),Kr(r,"")):r=Qt(this.template,e),this.template.config.editMode?this.insertBefore(r,this.addButton):this.appendChild(r),r}updateControls(){var e;let t,r=this.querySelectorAll(":scope > .property-instance, :scope > .shacl-or-constraint, :scope > shacl-node").length;r===0&&(!(!((e=this.template.extendedShapes)===null||e===void 0)&&e.length)||this.template.minCount!==void 0&&this.template.minCount>0)&&(this.addPropertyInstance(),r=this.querySelectorAll(":scope > .property-instance, :scope > .shacl-or-constraint, :scope > shacl-node").length),t=this.template.minCount!==void 0?r>this.template.minCount:this.template.extendedShapes&&this.template.extendedShapes.length>0||r>1;const n=this.template.maxCount===void 0||r .property-instance")){const n=we.namedNode(r.dataset.path);if(r.firstChild instanceof Je){e.size;const a=r.firstChild.toRDF(e);e.addQuad(t,n,a)}else{const a=Hn(r.querySelector(".editor"));a&&e.addQuad(t,n,a)}}}}function Qt(s,e,t=!1){var r,n;let a;if(!((r=s.extendedShapes)===null||r===void 0)&&r.length){a=document.createElement("div"),a.classList.add("property-instance");for(const l of s.extendedShapes)a.appendChild(new Je(l,s.config,e,s.nodeKind,s.label))}else{const l=function(d,i){let o=dt[`${d}^${i}`];return o||(o=dt[`${d}^undefined`],o||dt[`undefined^${i}`])}(s.path,(n=s.datatype)===null||n===void 0?void 0:n.value);a=l?s.config.editMode?l.createEditor(s,e):l.createViewer(s,e):qn(s,e||null),a.classList.add("property-instance")}return s.config.editMode&&Kr(a,s.label,t),a.dataset.path=s.path,a}function Kr(s,e,t=!1){const r=document.createElement("a");r.innerText="×",r.classList.add("control-button","btn","remove-button"),r.title="Remove "+e,r.addEventListener("click",n=>{s.classList.remove("fadeIn"),s.classList.add("fadeOut"),setTimeout(()=>{const a=s.parentElement;s.remove(),a==null||a.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},200)}),t&&r.classList.add("persistent"),s.appendChild(r)}function zn(s,e){const t=document.createElement("div");t.dataset.subject=s,t.classList.add("shacl-group");let r=s;const n=e.shapesGraph.getQuads(s,null,null,Se),a=Et(n,"label",ir,e.languages);a&&(r=a);const l=Et(n,"order");l&&(t.style.order=l);const d=document.createElement("h1");return d.innerText=r,t.appendChild(d),e.attributes.collapse!==null&&(t.classList.add("collapsible"),e.attributes.collapse==="open"&&t.classList.add("open"),d.classList.add("activator"),d.addEventListener("click",()=>{t.classList.toggle("open")})),t}window.customElements.define("shacl-property",lr);const Nr={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let vt;const Wn=new Uint8Array(16);function Jn(){if(!vt&&(vt=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!vt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return vt(Wn)}const Ee=[];for(let s=0;s<256;++s)Ee.push((s+256).toString(16).slice(1));const Tr=function(s,e,t){if(Nr.randomUUID&&!e&&!s)return Nr.randomUUID();const r=(s=s||{}).random||(s.rng||Jn)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){t=t||0;for(let n=0;n<16;++n)e[t+n]=r[n];return e}return function(n,a=0){return Ee[n[a+0]]+Ee[n[a+1]]+Ee[n[a+2]]+Ee[n[a+3]]+"-"+Ee[n[a+4]]+Ee[n[a+5]]+"-"+Ee[n[a+6]]+Ee[n[a+7]]+"-"+Ee[n[a+8]]+Ee[n[a+9]]+"-"+Ee[n[a+10]]+Ee[n[a+11]]+Ee[n[a+12]]+Ee[n[a+13]]+Ee[n[a+14]]+Ee[n[a+15]]}(r)};class Je extends HTMLElement{constructor(e,t,r,n,a){super(),this.config=t,this.shaclSubject=e;let l=r;if(!l){if(!n){const i=t.shapesGraph.getObjects(e,`${ye}nodeKind`,Se);i.length&&(n=i[0])}l=n===void 0&&t.attributes.valuesNamespace||(n==null?void 0:n.id)===`${ye}IRI`?we.namedNode(t.attributes.valuesNamespace+Tr()):we.blankNode(Tr())}this.nodeId=l;const d=JSON.stringify([e,r]);if(r&&t.renderedNodes.has(d)){if(a&&t.attributes.collapse===null){const o=document.createElement("label");o.innerText=a,this.appendChild(o)}const i=document.createElement("a");i.innerText=r.id,i.classList.add("ref-link"),i.onclick=()=>{var o;(o=this.config.form.querySelector(`shacl-node[data-node-id='${this.nodeId.id}']`))===null||o===void 0||o.scrollIntoView()},this.appendChild(i),this.style.flexDirection="row"}else{r&&t.renderedNodes.add(d),this.dataset.nodeId=this.nodeId.id;const i=t.shapesGraph.getQuads(e,null,null,Se);let o;if(this.config.attributes.showNodeIds!==null){const c=document.createElement("div");c.innerText=`id: ${this.nodeId.id}`,c.classList.add("node-id-display"),this.appendChild(c)}for(const c of i)switch(c.predicate.id){case`${ye}property`:let p=this;const v=t.shapesGraph.getQuads(c.object,`${ye}group`,null,Se);if(v.length>0){const h=v[0].object.value;if(t.groups.indexOf(h)>-1){let w=this.querySelector(`:scope > .shacl-group[data-subject='${h}']`);w||(w=zn(h,t),this.appendChild(w)),p=w}else console.warn("ignoring unknown group reference",v[0])}const f=new lr(c.object,t,this.nodeId,r);f.childElementCount>0&&p.appendChild(f);break;case`${ye}and`:if(o=t.lists[c.object.value],o==null?void 0:o.length)for(const h of o)this.prepend(new Je(h,t,r));else console.error("list not found:",c.object.value,"existing lists:",t.lists);break;case`${ye}node`:this.prepend(new Je(c.object,t,r));break;case`${ye}targetClass`:this.targetClass=c.object;break;case`${ye}or`:o=t.lists[c.object.value],o!=null&&o.length?this.appendChild(Wr(o,this,t)):console.error("list not found:",c.object.value,"existing lists:",t.lists)}if(a){const c=document.createElement("h1");c.innerText=a,this.prepend(c)}}}toRDF(e,t){t||(t=this.nodeId);for(const r of this.querySelectorAll(":scope > shacl-node, :scope > .shacl-group > shacl-node, :scope > shacl-property, :scope > .shacl-group > shacl-property"))r.toRDF(e,t);return this.targetClass&&e.addQuad(t,Oe,this.targetClass),this.config.attributes.generateNodeShapeReference&&!this.closest("shacl-node shacl-node")&&e.addQuad(t,we.namedNode(this.config.attributes.generateNodeShapeReference),this.shaclSubject),t}}window.customElements.define("shacl-node",Je);var Yr=je(9198);const Mt=Symbol("iter");function St(s,e,t=4){if(t===0)return Object.assign(s,e);for(const r in e)s[r]=St(s[r]||Object.create(null),e[r],t-1);return s}class Qn{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||we}_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 ut(e,this._factory)}_termToNumericId(e){if(e.termType==="Quad"){const t=this._termToNumericId(e.subject),r=this._termToNumericId(e.predicate),n=this._termToNumericId(e.object);let a;return t&&r&&n&&(Jt(e.graph)||(a=this._termToNumericId(e.graph)))&&this._ids[a?`.${t}.${r}.${n}.${a}`:`.${t}.${r}.${n}`]}return this._ids[et(e)]}_termToNewNumericId(e){const t=e&&e.termType==="Quad"?`.${this._termToNewNumericId(e.subject)}.${this._termToNewNumericId(e.predicate)}.${this._termToNewNumericId(e.object)}${Jt(e.graph)?"":`.${this._termToNewNumericId(e.graph)}`}`:et(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 ke{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||we,this._entityIndex=t.entityIndex||new Qn({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(e!==null)return e;e=0;const t=this._graphs;let r,n;for(const a in t)for(const l in r=t[a].subjects)for(const d in n=r[l])e+=Object.keys(n[d]).length;return this._size=e}_addToIndex(e,t,r,n){const a=e[t]||(e[t]={}),l=a[r]||(a[r]={}),d=n in l;return d||(l[n]=null),!d}_removeFromIndex(e,t,r,n){const a=e[t],l=a[r];delete l[n];for(const d in l)return;delete a[r];for(const d in a)return;delete e[t]}*_findInIndex(e,t,r,n,a,l,d,i){let o,c,p;const v=this._entities,f=this._termFromId(v[i]),h={subject:null,predicate:null,object:null};t&&((o=e,e={})[t]=o[t]);for(const w in e)if(c=e[w]){h[a]=this._termFromId(v[w]),r&&((o=c,c={})[r]=o[r]);for(const g in c)if(p=c[g]){h[l]=this._termFromId(v[g]);const x=n?n in p?[n]:[]:Object.keys(p);for(let j=0;j{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 a=this._graphs[n];return a||(a=this._graphs[n]={subjects:{},predicates:{},objects:{}},Object.freeze(a)),e=this._termToNewNumericId(e),t=this._termToNewNumericId(t),r=this._termToNewNumericId(r),!!this._addToIndex(a.subjects,e,t,r)&&(this._addToIndex(a.predicates,t,r,e),this._addToIndex(a.objects,r,e,t),this._size=null,!0)}addQuads(e){for(let t=0;t{this.addQuad(t)}),e}removeQuad(e,t,r,n){t||(n=e.graph,r=e.object,t=e.predicate,e=e.subject),n=n?this._termToNumericId(n):1;const a=this._graphs;let l,d,i;if(!((e=e&&this._termToNumericId(e))&&(t=t&&this._termToNumericId(t))&&(r=r&&this._termToNumericId(r))&&(l=a[n])&&(d=l.subjects[e])&&(i=d[t])&&r in i))return!1;for(e in this._removeFromIndex(l.subjects,e,t,r),this._removeFromIndex(l.predicates,t,r,e),this._removeFromIndex(l.objects,r,e,t),this._size!==null&&this._size--,l.subjects)return!0;return delete a[n],!0}removeQuads(e){for(let t=0;t{this.removeQuad(t)}),e}removeMatches(e,t,r,n){const a=new Yr.Readable({objectMode:!0}),l=this.readQuads(e,t,r,n);return a._read=d=>{for(;d-- >0;){const{done:i,value:o}=l.next();if(i)return void a.push(null);a.push(o)}},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 a=this._getGraphs(n);let l,d,i,o;if(!(e&&!(d=this._termToNumericId(e))||t&&!(i=this._termToNumericId(t))||r&&!(o=this._termToNumericId(r))))for(const c in a)(l=a[c])&&(d?o?yield*this._findInIndex(l.objects,o,d,i,"object","subject","predicate",c):yield*this._findInIndex(l.subjects,d,i,null,"subject","predicate","object",c):i?yield*this._findInIndex(l.predicates,i,o,null,"predicate","object","subject",c):o?yield*this._findInIndex(l.objects,o,null,null,"object","subject","predicate",c):yield*this._findInIndex(l.subjects,null,null,null,"subject","predicate","object",c))}match(e,t,r,n){return new cr(this,e,t,r,n,{entityIndex:this._entityIndex})}countQuads(e,t,r,n){const a=this._getGraphs(n);let l,d,i,o,c=0;if(e&&!(d=this._termToNumericId(e))||t&&!(i=this._termToNumericId(t))||r&&!(o=this._termToNumericId(r)))return 0;for(const p in a)(l=a[p])&&(c+=e?r?this._countInIndex(l.objects,o,d,i):this._countInIndex(l.subjects,d,i,o):t?this._countInIndex(l.predicates,i,o,d):this._countInIndex(l.objects,o,d,i));return c}forEach(e,t,r,n,a){this.some(l=>(e(l,this),!1),t,r,n,a)}every(e,t,r,n,a){return!this.some(l=>!e(l,this),t,r,n,a)}some(e,t,r,n,a){for(const l of this.readQuads(t,r,n,a))if(e(l))return!0;return!1}getSubjects(e,t,r){const n=[];return this.forSubjects(a=>{n.push(a)},e,t,r),n}forSubjects(e,t,r,n){const a=this._getGraphs(n);let l,d,i;if(e=this._uniqueEntities(e),!(t&&!(d=this._termToNumericId(t))||r&&!(i=this._termToNumericId(r))))for(n in a)(l=a[n])&&(d?i?this._loopBy2Keys(l.predicates,d,i,e):this._loopByKey1(l.subjects,d,e):i?this._loopByKey0(l.objects,i,e):this._loop(l.subjects,e))}getPredicates(e,t,r){const n=[];return this.forPredicates(a=>{n.push(a)},e,t,r),n}forPredicates(e,t,r,n){const a=this._getGraphs(n);let l,d,i;if(e=this._uniqueEntities(e),!(t&&!(d=this._termToNumericId(t))||r&&!(i=this._termToNumericId(r))))for(n in a)(l=a[n])&&(d?i?this._loopBy2Keys(l.objects,i,d,e):this._loopByKey0(l.subjects,d,e):i?this._loopByKey1(l.predicates,i,e):this._loop(l.predicates,e))}getObjects(e,t,r){const n=[];return this.forObjects(a=>{n.push(a)},e,t,r),n}forObjects(e,t,r,n){const a=this._getGraphs(n);let l,d,i;if(e=this._uniqueEntities(e),!(t&&!(d=this._termToNumericId(t))||r&&!(i=this._termToNumericId(r))))for(n in a)(l=a[n])&&(d?i?this._loopBy2Keys(l.subjects,d,i,e):this._loopByKey1(l.objects,d,e):i?this._loopByKey0(l.predicates,i,e):this._loop(l.objects,e))}getGraphs(e,t,r){const n=[];return this.forGraphs(a=>{n.push(a)},e,t,r),n}forGraphs(e,t,r,n){for(const a in this._graphs)this.some(l=>(e(l.graph),!0),t,r,n,this._termFromId(this._entities[a]))}createBlankNode(e){return this._entityIndex.createBlankNode(e)}extractLists({remove:e=!1,ignoreErrors:t=!1}={}){const r={},n=t?()=>!0:(d,i)=>{throw new Error(`${d.value} ${i}`)},a=this.getQuads(null,Re.rdf.rest,Re.rdf.nil,null),l=e?[...a]:[];return a.forEach(d=>{const i=[];let o,c,p=!1;const v=d.graph;let f=d.subject;for(;f&&!p;){const h=this.getQuads(null,null,f,null),w=this.getQuads(f,null,null,null);let g,x=null,j=null,A=null;for(let Q=0;Qthis.has(o));const t=this._graphs,r=e._graphs;let n,a,l,d,i;for(const o in r){if(!(n=t[o]))return!1;n=n.subjects;for(const c in a=r[o].subjects){if(!(l=n[c]))return!1;for(const p in d=a[c]){if(!(i=l[p]))return!1;for(const v in d[p])if(!(v in i))return!1}}}return!0}deleteMatches(e,t,r,n){for(const a of this.match(e,t,r,n))this.removeQuad(a);return this}difference(e){return e===this?new ke({entityIndex:this._entityIndex}):this.filter(t=>!e.has(t))}equals(e){return e===this||this.size===e.size&&this.contains(e)}filter(e){const t=new ke({entityIndex:this._entityIndex});for(const r of this)e(r,this)&&t.add(r);return t}intersection(e){if(e===this){const t=new ke({entityIndex:this._entityIndex});t._graphs=St(Object.create(null),this._graphs),t._size=this._size}return this.filter(t=>e.has(t))}map(e){const t=new ke({entityIndex:this._entityIndex});for(const r of this)t.add(e(r,this));return t}reduce(e,t){const r=this.readQuads();let n=t===void 0?r.next().value:t;for(const a of r)n=e(n,a,this);return n}toArray(){return this.getQuads()}toCanonical(){throw new Error("not implemented")}toStream(){return this.match()}toString(){return new or().quadsToString(this)}union(e){const t=new ke({entityIndex:this._entityIndex});return t._graphs=St(Object.create(null),this._graphs),t._size=this._size,t.addAll(e),t}*[Symbol.iterator](){yield*this.readQuads()}}class cr extends Yr.Readable{constructor(e,t,r,n,a,l){super({objectMode:!0}),Object.assign(this,{n3Store:e,subject:t,predicate:r,object:n,graph:a,options:l})}get filtered(){if(!this._filtered){const{n3Store:e,graph:t,object:r,predicate:n,subject:a}=this,l=this._filtered=new ke({factory:e._factory,entityIndex:this.options.entityIndex});for(const d of e.readQuads(a,n,r,t))l.addQuad(d)}return this._filtered}get size(){return this.filtered.size}_read(e){e>0&&!this[Mt]&&(this[Mt]=this[Symbol.iterator]());const t=this[Mt];for(;e-- >0;){const{done:r,value:n}=t.next();if(r)return void this.push(null);this.push(n)}}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,a){return this.filtered.every(e,t,r,n,a)}filter(e){return this.filtered.filter(e)}forEach(e,t,r,n,a){return this.filtered.forEach(e,t,r,n,a)}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,a){return this.filtered.some(e,t,r,n,a)}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 or().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 cr(this.filtered,e,t,r,n,this.options)}*[Symbol.iterator](){yield*this._filtered||this.n3Store.readQuads(this.subject,this.predicate,this.object,this.graph)}}var Xn=je(8287),Kn=je(9596),Yn=je.n(Kn);const{xsd:wt}=Re,Zn=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,Rr={"\\":"\\","'":"'",'"':'"',n:` +`,r:"\r",t:" ",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},ei=/[\x00-\x20<>\\"\{\}\|\^\`]/,ti={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},ri=/$0^/;class ni{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 t in this)!(t in ti)&&this[t]instanceof RegExp&&(this[t]=ri)}else this._n3Mode=e.n3!==!1;this._comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let r=this._input,n=r.length;for(;;){let d,i;for(;d=this._newline.exec(r);)this._comments&&(i=this._comment.exec(d[0]))&&a("comment",i[1],"",this._line,d[0].length),r=r.substr(d[0].length,r.length),n=r.length,this._line++;if(!d&&(d=this._whitespace.exec(r))&&(r=r.substr(d[0].length,r.length)),this._endOfFile.test(r))return t&&(this._comments&&(i=this._comment.exec(r))&&a("comment",i[1],"",this._line,r.length),r=null,a("eof","","",this._line,0)),this._input=r;const o=this._line,c=r[0];let p="",v="",f="",h=null,w=0,g=!1;switch(c){case"^":if(r.length<3)break;if(r[1]!=="^"){this._n3Mode&&(w=1,p="^");break}if(this._previousMarker="^^",r=r.substr(2),r[0]!=="<"){g=!0;break}case"<":if(h=this._unescapedIri.exec(r))p="IRI",v=h[1];else if(h=this._iri.exec(r)){if(v=this._unescape(h[1]),v===null||ei.test(v))return l(this);p="IRI"}else r.length>1&&r[1]==="<"?(p="<<",w=2):this._n3Mode&&r.length>1&&r[1]==="="&&(p="inverse",w=2,v=">");break;case">":r.length>1&&r[1]===">"&&(p=">>",w=2);break;case"_":((h=this._blank.exec(r))||t&&(h=this._blank.exec(`${r} `)))&&(p="blank",f="_",v=h[1]);break;case'"':if(h=this._simpleQuotedString.exec(r))v=h[1];else if({value:v,matchLength:w}=this._parseLiteral(r),v===null)return l(this);h===null&&w===0||(p="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(h=this._simpleApostropheString.exec(r))v=h[1];else if({value:v,matchLength:w}=this._parseLiteral(r),v===null)return l(this);h===null&&w===0||(p="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(h=this._variable.exec(r))&&(p="var",v=h[0]);break;case"@":this._previousMarker==="literal"&&(h=this._langcode.exec(r))?(p="langcode",v=h[1]):(h=this._keyword.exec(r))&&(p=h[0]);break;case".":if(r.length===1?t:r[1]<"0"||r[1]>"9"){p=".",w=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(h=this._number.exec(r)||t&&(h=this._number.exec(`${r} `)))&&(p="literal",v=h[0],f=typeof h[1]=="string"?wt.double:typeof h[2]=="string"?wt.decimal:wt.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(h=this._sparqlKeyword.exec(r))?p=h[0].toUpperCase():g=!0;break;case"f":case"t":(h=this._boolean.exec(r))?(p="literal",v=h[0],f=wt.boolean):g=!0;break;case"a":(h=this._shortPredicates.exec(r))?(p="abbreviation",v="a"):g=!0;break;case"=":this._n3Mode&&r.length>1&&(p="abbreviation",r[1]!==">"?(w=1,v="="):(w=2,v=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(w=1,p=c);break;case"{":!this._lineMode&&r.length>=2&&(r[1]==="|"?(p="{|",w=2):(p=c,w=1));break;case"|":r.length>=2&&r[1]==="}"&&(p="|}",w=2);break;default:g=!0}if(g&&(this._previousMarker!=="@prefix"&&this._previousMarker!=="PREFIX"||!(h=this._prefix.exec(r))?((h=this._prefixed.exec(r))||t&&(h=this._prefixed.exec(`${r} `)))&&(p="prefixed",f=h[1]||"",v=this._unescape(h[2])):(p="prefix",v=h[1]||"")),this._previousMarker==="^^")switch(p){case"prefixed":p="type";break;case"IRI":p="typeIRI";break;default:p=""}if(!p)return t||!/^'''|^"""/.test(r)&&/\n|\r/.test(r)?l(this):this._input=r;const x=w||h[0].length,j=a(p,v,f,o,x);this.previousToken=j,this._previousMarker=p,r=r.substr(x,r.length)}function a(d,i,o,c,p){const v=r?n-r.length:n,f={type:d,value:i,prefix:o,line:c,start:v,end:v+p};return e(null,f),f}function l(d){e(d._syntaxError(/^\S*/.exec(r)[0]))}}_unescape(e){let t=!1;const r=e.replace(Zn,(n,a,l,d)=>{if(typeof a=="string")return String.fromCharCode(Number.parseInt(a,16));if(typeof l=="string"){let i=Number.parseInt(l,16);return i<=65535?String.fromCharCode(Number.parseInt(l,16)):String.fromCharCode(55296+((i-=65536)>>10),56320+(1023&i))}return d in Rr?Rr[d]:(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 a=0;for(;e[n-a-1]==="\\";)a++;if(a%2==0){const l=e.substring(r,n),d=l.split(/\r\n|\r|\n/).length-1,i=n+r;if(r===1&&d!==0||r===3&&this._lineMode)break;return this._line+=d,{value:this._unescape(l),matchLength:i}}n++}this._literalClosingPos=e.length-r+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const t=new Error(`Unexpected "${e}" on line ${this._line}.`);return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}_readStartingBom(e){return e.startsWith("\uFEFF")?e.substr(1):e}tokenize(e,t){if(this._line=1,typeof e=="string"){if(this._input=this._readStartingBom(e),typeof t!="function"){const r=[];let n;if(this._tokenizeToEnd((a,l)=>a?n=a:r.push(l),!0),n)throw n;return r}Yn()(()=>this._tokenizeToEnd(t,!0))}else this._pendingBuffer=null,typeof e.setEncoding=="function"&&e.setEncoding("utf8"),e.on("data",r=>{this._input!==null&&r.length!==0&&(this._pendingBuffer&&(r=Xn.Buffer.concat([this._pendingBuffer,r]),this._pendingBuffer=null),128&r[r.length-1]?this._pendingBuffer=r:(this._input===void 0?this._input=this._readStartingBom(typeof r=="string"?r:r.toString()):this._input+=r,this._tokenizeToEnd(t,!1)))}),e.on("end",()=>{typeof this._input=="string"&&this._tokenizeToEnd(t,!0)}),e.on("error",t)}}let Or=0;class Xt{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&Zr(this,e.factory);const t=typeof e.format=="string"?e.format.match(/\w*$/)[0].toLowerCase():"",r=/turtle/.test(t),n=/trig/.test(t),a=/triple/.test(t),l=/quad/.test(t),d=this._n3Mode=/n3/.test(t),i=a||l;(this._supportsNamedGraphs=!(r||d))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(r||n||a||d),this._supportsRDFStar=t===""||/star|\*$/.test(t),i&&(this._resolveRelativeIRI=o=>null),this._blankNodePrefix=typeof e.blankNodePrefix!="string"?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new ni({lineMode:i,n3:d}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){Or=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,a){const l=this._n3Mode;this._contextStack.push({type:e,subject:r,predicate:n,object:a,graph:t,inverse:!!l&&this._inversePredicate,blankPrefix:l?this._prefixes._:"",quantified:l?this._quantified:null}),l&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,t){const r=this._contextStack.pop();if(!r||r.type!==e)return this._error(`Unexpected ${t.type}`,t);this._subject=r.subject,this._predicate=r.predicate,this._object=r.object,this._graph=r.graph,this._n3Mode&&(this._inversePredicate=r.inverse,this._prefixes._=r.blankPrefix,this._quantified=r.quantified)}_readInTopContext(e){switch(e.type){case"eof":return this._graph!==null?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,t){let r;switch(e.type){case"IRI":case"typeIRI":const n=this._resolveIRI(e.value);if(n===null)return this._error("Invalid IRI",e);r=this._namedNode(n);break;case"type":case"prefixed":const a=this._prefixes[e.prefix];if(a===void 0)return this._error(`Undefined prefix "${e.prefix}:"`,e);r=this._namedNode(a+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(e.prefix.length===0)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((this._subject=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){const t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return this._predicate===null?this._error(`Unexpected ${t}`,e):(this._subject=null,t==="]"?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return this._predicate!==null?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if((this._predicate=this._readEntity(e))===void 0)return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(e.prefix.length===0)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._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((this._object=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return e.type==="{"?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return e.type!=="{"?this._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return e.type==="]"?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}_readBlankNodeTail(e){if(e.type!=="]")return this._readBlankNodePunctuation(e);this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph);const t=this._predicate===null;return this._restoreContext("blank",e),this._object!==null?this._getContextEndReader():this._predicate!==null?this._readObject:t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let t=null,r=null,n=this._readListItem;const a=this._subject,l=this._contextStack,d=l[l.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),l.length!==0&&l[l.length-1].type==="list"&&this._emit(this._subject,this._predicate,this._object,this._graph),this._predicate===null){if(n=this._readPredicate,this._subject===this.RDF_NIL)return n}else if(n=this._getContextEndReader(),this._object===this.RDF_NIL)return n;r=this.RDF_NIL;break;case"literal":e.prefix.length===0?(this._literalValue=e.value,n=this._readListItemDataTypeOrLang):(t=this._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((t=this._readEntity(e))===void 0)return}if(r===null&&(this._subject=r=this._blankNode()),a===null?d.predicate===null?d.subject=r:d.object=r:this._emit(a,this.RDF_REST,r,this._graph),t!==null){if(this._n3Mode&&(e.type==="IRI"||e.type==="prefixed"))return this._saveContext("item",this._graph,r,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(r,this.RDF_FIRST,t,this._graph)}return n}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let t=this._literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const r=this._readEntity(e);if(r===void 0)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),r.token===null?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(r.token))}_readFormulaTail(e){return e.type!=="}"?this._readPunctuation(e):(this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),this._object===null?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let t,r=this._graph;const n=this._subject,a=this._inversePredicate;switch(e.type){case"}":if(this._graph===null)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,a&&(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 l=this._predicate,d=this._object;this._subject=this._quad(n,l,d,this.DEFAULTGRAPH),t=this._readPredicate;break;case"|}":if(this._subject.termType!=="Quad")return this._error("Unexpected asserted triple closing",e);this._subject=null,t=this._readPunctuation;break;default:if(this._supportsQuads&&this._graph===null&&(r=this._readEntity(e))!==void 0){t=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(n!==null){const l=this._predicate,d=this._object;a?this._emit(d,l,n,r):this._emit(n,l,d,r)}return t}_readBlankNodePunctuation(e){let t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}_readQuadPunctuation(e){return e.type!=="."?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return e.type!=="prefix"?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if(e.type!=="IRI")return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){const t=e.type==="IRI"&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return e.type!=="]"?this._error("Invalid graph label",e):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):e.type!=="."?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let t;switch(e.type){case"IRI":case"prefixed":if((t=this._readEntity(e,!0))!==void 0)break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(this._subject===null?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._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&&r.type==="item"){const n=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,n,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,r;const n=this._blankNode();if((r=this._readEntity(e))!==void 0)return this._predicate===null?(t=this._subject,this._subject=n):(t=this._object,this._object=n),this._emit(t,r,n,this._graph),this._readPath}_readBackwardPath(e){const t=this._blankNode();let r,n;if((r=this._readEntity(e))!==void 0)return this._predicate===null?(n=this._subject,this._subject=t):(n=this._object,this._object=t),this._emit(t,r,n,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return e.type!==">>"?this._supportsQuads&&this._graph===null&&(this._graph=this._readEntity(e))!==void 0?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(e.type!==">>")return this._error(`Expected >> but got ${e.type}`,e);const t=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),this._subject===null?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_getContextEndReader(){const e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,t,r,n){this._callback(null,this._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=Pt}_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,a=-1,l=0,d="/";for(;n=a&&(r=r.substr(0,l)),d!=="/")return`${r}/${e.substr(n+1)}`;l=n+1}}}d=e[++n]}return r+e.substring(l)}parse(e,t,r){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${Or++}_`,this._prefixCallback=r||Pt,this._inversePredicate=!1,this._quantified=Object.create(null),!t){const n=[];let a;if(this._callback=(l,d)=>{l?a=l:d&&n.push(d)},this._lexer.tokenize(e).every(l=>this._readCallback=this._readCallback(l)),a)throw a;return n}this._callback=t,this._lexer.tokenize(e,(n,a)=>{n!==null?(this._callback(n),this._callback=Pt):this._readCallback&&(this._readCallback=this._readCallback(a))})}}function Pt(){}function Zr(s,e){const t=e.namedNode;s._namedNode=t,s._blankNode=e.blankNode,s._literal=e.literal,s._variable=e.variable,s._quad=e.quad,s.DEFAULTGRAPH=e.defaultGraph(),s.RDF_FIRST=t(Re.rdf.first),s.RDF_REST=t(Re.rdf.rest),s.RDF_NIL=t(Re.rdf.nil),s.N3_FORALL=t(Re.r.forAll),s.N3_FORSOME=t(Re.r.forSome),s.ABBREVIATIONS={a:t(Re.rdf.type),"=":t(Re.owl.sameAs),">":t(Re.log.implies)},s.QUANTIFIERS_GRAPH=t("urn:n3:quantifiers")}Zr(Xt.prototype,we);var ii=je(4841),_t=function(s,e,t,r){return new(t||(t=Promise))(function(n,a){function l(o){try{i(r.next(o))}catch(c){a(c)}}function d(o){try{i(r.throw(o))}catch(c){a(c)}}function i(o){var c;o.done?n(o.value):(c=o.value,c instanceof t?c:new t(function(p){p(c)})).then(l,d)}i((r=r.apply(s,e||[])).next())})};const $t={},Bt={};class en{constructor(e){this.loadedExternalUrls=[],this.loadedClasses=[],this.config=e}loadGraphs(){return _t(this,void 0,void 0,function*(){this.loadedExternalUrls=[],this.loadedClasses=[];const e=new ke,t=new ke;if(this.config.prefixes={},yield Promise.all([this.importRDF(this.config.attributes.shapes?this.config.attributes.shapes:this.config.attributes.shapesUrl?this.fetchRDF(this.config.attributes.shapesUrl):"",e,Se),this.importRDF(this.config.attributes.values?this.config.attributes.values:this.config.attributes.valuesUrl?this.fetchRDF(this.config.attributes.valuesUrl):"",t,void 0,new Xt({blankNodePrefix:""}))]),e.size==0&&this.config.attributes.valuesSubject){const r=[...t.getObjects(this.config.attributes.valuesSubject,Oe,null),...t.getObjects(this.config.attributes.valuesSubject,Gt,null)],n=[];for(const a of r){const l=this.toURL(a.value);l&&this.loadedExternalUrls.indexOf(l)<0&&(this.loadedExternalUrls.push(l),n.push(this.importRDF(this.fetchRDF(l),e,Se)))}try{yield Promise.allSettled(n)}catch(a){console.warn(a)}}this.config.shapesGraph=e,this.config.dataGraph=t})}importRDF(e,t,r,n){return _t(this,void 0,void 0,function*(){const a=n||new Xt,l=d=>_t(this,void 0,void 0,function*(){const i=[];yield new Promise((o,c)=>{a.parse(d,(p,v,f)=>{if(p)return c(p);if(v){if(t.add(new tt(v.subject,v.predicate,v.object,r)),this.config.attributes.ignoreOwlImports===null&&Cn.equals(v.predicate)){const h=this.toURL(v.object.value);h&&this.loadedExternalUrls.indexOf(h)<0&&(this.loadedExternalUrls.push(h),i.push(this.importRDF(this.fetchRDF(h),t,r,n)))}if(this.config.classInstanceProvider&&sr.equals(v.predicate)){const h=v.object.value;if(this.loadedClasses.indexOf(h)<0){let w;h in Bt?w=Bt[h]:(w=this.config.classInstanceProvider(h),Bt[h]=w),this.loadedClasses.push(h),i.push(this.importRDF(w,t,r,n))}}}else f&&this.config.registerPrefixes(f),o(null)})});try{yield Promise.allSettled(i)}catch(o){console.warn(o)}});if(e instanceof Promise&&(e=yield e),e){try{e=yield(0,ii.toRDF)(JSON.parse(e),{format:"application/n-quads"})}catch{}yield l(e)}})}fetchRDF(e){return _t(this,void 0,void 0,function*(){if(e in $t)return $t[e];const t=fetch(e,{headers:{Accept:"text/turtle, application/trig, application/n-triples, application/n-quads, text/n3, application/ld+json"}}).then(r=>r.text());return $t[e]=t,t})}toURL(e){if(Wt(e))return e;if(this.config.prefixes){const t=e.split(":");if(t.length===2){const r=this.config.prefixes[t[0]];if(r&&Wt(e=e.replace(`${t[0]}:`,r)))return e}}return null}}class Ft{constructor(){this.shapes=null,this.shapesUrl=null,this.shapeSubject=null,this.values=null,this.valuesUrl=null,this.valueSubject=null,this.valuesSubject=null,this.valuesNamespace="",this.view=null,this.language=null,this.loading="Loading…",this.ignoreOwlImports=null,this.collapse=null,this.submitButton=null,this.generateNodeShapeReference=null,this.showNodeIds=null}}class Kt{constructor(e,t){this.attributes=new Ft,this.loader=new en(this),this.prefixes={},this.editMode=!0,this.dataGraph=new ke,this.lists={},this.groups=[],this.renderedNodes=new Set,this._shapesGraph=new ke,this.theme=e,this.form=t,this.languages=[...new Set(navigator.languages.flatMap(r=>r.length>2?[r,r.substring(0,2)]:r))]}updateAttributes(e){const t=new Ft;if(Object.keys(t).forEach(r=>{const n=e.dataset[r];n!==void 0&&(t[r]=n)}),this.editMode=t.view===null,this.attributes=t,this.attributes.valueSubject&&!this.attributes.valuesSubject&&(this.attributes.valuesSubject=this.attributes.valueSubject),t.language){const r=this.languages.indexOf(t.language);r>-1&&this.languages.splice(r,1),this.languages.unshift(t.language)}}static dataAttributes(){const e=new Ft;return Object.keys(e).map(t=>"data-"+t.replace(/[A-Z]/g,r=>"-"+r.toLowerCase()))}get shapesGraph(){return this._shapesGraph}set shapesGraph(e){this._shapesGraph=e,this.lists=e.extractLists(),this.groups=[],e.getQuads(null,Oe,`${ye}PropertyGroup`,Se).forEach(t=>{this.groups.push(t.subject.value)})}registerPrefixes(e){for(const t in e)t&&(this.prefixes[t]=e[t])}}const kr=function(s){return"<"+s.value+">"},si=/["\\\\\n\r]/,ai=/["\\\\\n\r]/g,oi={'"':'\\"',"\\":"\\\\","\n":"\\n","\r":"\\r"};function li(s){return oi[s]}const qe=function s(e){if(!e)return null;if(e.termType==="BlankNode")return"_:"+e.value;if(e.termType==="DefaultGraph")return"";if(e.termType==="Literal")return function(t){const r=(n=t.value,si.test(n)?n.replace(ai,li):n);var n;return t.datatype.value==="http://www.w3.org/2001/XMLSchema#string"?'"'+r+'"':t.datatype.value==="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"?'"'+r+'"@'+t.language:'"'+r+'"^^'+kr(t.datatype)}(e);if(e.termType==="NamedNode")return kr(e);if(e.termType==="Quad"||e.subject&&e.predicate&&e.object&&e.graph)return function(t,r){const n=r(t.subject),a=r(t.predicate),l=r(t.object),d=r(t.graph);return`${n} ${a} ${l} ${d?d+" ":""}.`}(e,s);if(e.termType==="Variable")return"?"+e.value;if(e[Symbol.iterator])return function(t,r){return[...t].map(n=>r(n)).join(` +`)+` +`}(e,s);throw new Error(`unknown termType ${e.termType}`)};class ci{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(qe(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(qe(e));return t&&t.value}has(e){return this.index.has(qe(e))}*keys(){for(const[,{term:e}]of this.index)yield e}set(e,t){const r=qe(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 nt=ci;function Lr(s){try{return qe(s)}catch{return null}}class ui{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=qe(e);return this.index.has(t)||this.index.set(t,e),this}clear(){this.index.clear()}delete(e){return!!e&&this.index.delete(Lr(e))}entries(){return this.values().entries()}forEach(e,t){return this.values().forEach(e,t)}has(e){return!!e&&this.index.has(Lr(e))}values(){return new Set(this.index.values())}keys(){return this.values()}[Symbol.iterator](){return this.index.values()}}const De=ui,Ar=class{constructor({dataset:s,end:e,quad:t,start:r}){this.dataset=s,this.end=e,this.quad=t,this.start=r}get term(){return this.quad[this.end]}get graph(){return this.quad.graph}get startTerm(){return this.quad[this.start]}};class tn{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}tn.prototype.termType="BlankNode";const di=tn;class Yt{equals(e){return!!e&&e.termType===this.termType}}Yt.prototype.termType="DefaultGraph",Yt.prototype.value="";const hi=Yt,Cr=function(s,e){if(!e)return null;if(e.termType==="BlankNode")return s.blankNode(e.value);if(e.termType==="DefaultGraph")return s.defaultGraph();if(e.termType==="Literal")return s.literal(e.value,e.language||s.namedNode(e.datatype.value));if(e.termType==="NamedNode")return s.namedNode(e.value);if(e.termType==="Quad"){const t=s.fromTerm(e.subject),r=s.fromTerm(e.predicate),n=s.fromTerm(e.object),a=s.fromTerm(e.graph);return s.quad(t,r,n,a)}if(e.termType==="Variable")return s.variable(e.value);throw new Error(`unknown termType ${e.termType}`)};class rn{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)}}rn.prototype.termType="Literal";const Dr=rn;class nn{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}nn.prototype.termType="NamedNode";const ur=nn;class Zt{constructor(e,t,r,n){this.subject=e,this.predicate=t,this.object=r,this.graph=n}equals(e){return!!e&&(e.termType==="Quad"||!e.termType)&&e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)}}Zt.prototype.termType="Quad",Zt.prototype.value="";const fi=Zt;class sn{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}sn.prototype.termType="Variable";const pi=sn,gi=new ur("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),mi=new ur("http://www.w3.org/2001/XMLSchema#string");class an{constructor(){this.init()}init(){this._data={blankNodeCounter:0,defaultGraph:new hi}}namedNode(e){return new ur(e)}blankNode(e){return e=e||"b"+ ++this._data.blankNodeCounter,new di(e)}literal(e,t){return typeof t=="string"?new Dr(e,t,gi):new Dr(e,"",t||mi)}variable(e){return new pi(e)}defaultGraph(){return this._data.defaultGraph}quad(e,t,r,n=this.defaultGraph()){return new fi(e,t,r,n)}fromTerm(e){return Cr(this,e)}fromQuad(e){return Cr(this,e)}}an.exports=["blankNode","defaultGraph","fromQuad","fromTerm","literal","namedNode","quad","variable"];const dr=new an,yi={apply:(s,e,t)=>s(t[0]),get:(s,e)=>s(e)},Me=function(s,{factory:e=dr}={}){const t=(r="")=>e.namedNode(`${s}${r.raw||r}`);return typeof Proxy>"u"?t:new Proxy(t,yi)},He=(Me("http://www.w3.org/2001/XMLSchema#"),Me("http://www.w3.org/1999/02/22-rdf-syntax-ns#"));Me("http://www.w3.org/2000/01/rdf-schema#");class Te{static add({ptr:e,start:t,end:r,subjects:n=[null],predicates:a=[null],objects:l=[null],graphs:d,callback:i}={}){if(!e.factory)throw new Error("add operation requires a factory");let o=()=>{};i&&(o=c=>{i(new Ar({dataset:e.dataset,start:t,end:r,quad:c}))});for(const c of n)for(const p of a)for(const v of l)for(const f of d){const h={subject:c,predicate:p,object:v,graph:f};h[t]=e.term;const w=e.factory.quad(h.subject,h.predicate,h.object,h.graph);e.dataset.add(w),o(w)}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 a of t)for(const l of n){const d=r.map(()=>e.factory.blankNode());e.dataset.add(e.factory.quad(e.term,a,d[0]||He.nil,l));for(let i=0;i!c.has(v.term))),e=o,p=[...p,...o],c=new De(p.map(v=>v.term))}while(o.length>0);return p}static traverseOne({ptr:e,start:t,end:r,subjects:n,predicates:a,objects:l,graphs:d,callback:i=(o,c)=>c.extend(o)}={}){const o=[];for(const c of n)for(const p of a)for(const v of l)for(const f of d){const h={subject:c,predicate:p,object:v,graph:f};h[t]=e.term;for(const w of e.dataset.match(h.subject,h.predicate,h.object,h.graph))o.push(i(new Ar({dataset:e.dataset,end:r,quad:w,start:t}),e))}return o}}const Le=Te;function Mr(s,e){return e?t=>e(s.extend(t)):()=>{}}const Pr=class{constructor({dataset:s,edges:e=[],factory:t,graph:r,term:n}){if(!s&&e.length===0)throw new Error("dataset or edges is required");if(e.length===0&&n===void 0)throw new Error("edges or term must be given");if(e.length>0&&n)throw new Error("edges or term must be given");this.dataset=s||e[e.length-1].dataset,this.edges=e,this.factory=t,this._graph=r,e.length===0&&(this._term=n)}get edge(){return this.edges[this.edges.length-1]}get graph(){return typeof this._graph=="object"?this._graph:this.edge&&this.edge.graph}get length(){return this._term!==void 0?1:this.edges.length+1}get startTerm(){return this._term||this.edges[0].startTerm}get term(){return this._term!==void 0?this._term:this.edge.term}get value(){const s=this.term;return s===null?void 0:s.value}addIn(s,e,t){return Le.add({ptr:this,start:"object",end:"subject",subjects:e,predicates:s,graphs:[this.graph||this.factory.defaultGraph()],callback:Mr(this,t)})}addList(s,e){return Le.addList({ptr:this,predicates:s,graphs:[this.graph||this.factory.defaultGraph()],items:e})}addOut(s,e,t){return Le.add({ptr:this,start:"subject",end:"object",predicates:s,objects:e,graphs:[this.graph||this.factory.defaultGraph()],callback:Mr(this,t)})}deleteIn(s,e){return Le.delete({ptr:this,start:"object",subjects:e,predicates:s})}deleteList(s){return Le.deleteList({ptr:this,predicates:s})}deleteOut(s,e){return Le.delete({ptr:this,start:"subject",predicates:s,objects:e})}execute({operation:s,quantifier:e,start:t,end:r,subjects:n,predicates:a,objects:l,graphs:d,items:i,callback:o}){return Le.execute({ptr:this,operation:s,quantifier:e,start:t,end:r,subjects:n,predicates:a,objects:l,graphs:d,items:i,callback:o})}extend(s){return new this.constructor({dataset:this.dataset,edges:[...this.edges,s],factory:this.factory,graph:this._graph})}hasIn(s,e){return Le.traverse({ptr:this,start:"object",end:"object",subjects:e,predicates:s,graphs:[this.graph]})}hasOut(s,e){return Le.traverse({ptr:this,start:"subject",end:"subject",predicates:s,objects:e,graphs:[this.graph]})}in(s,e){return Le.traverse({ptr:this,start:"object",end:"subject",subjects:e,predicates:s,graphs:[this.graph]})}isAny(){return!this.term}isList(){return Le.isList({ptr:this})}list(){return Le.list({ptr:this})}nodes(){const s=this,e=t=>this._term!==void 0?{dataset:this.dataset,term:this._term}:this.edges.length>t?{dataset:this.edges[t].dataset,term:this.edges[t].startTerm}:this.edges.length===t?{dataset:this.edges[t-1].dataset,term:this.edges[t-1].term}:void 0;return{*[Symbol.iterator](){for(let t=0;te(new s.constructor({factory:s.factory,ptrs:[t]})):()=>{}}class bi{constructor({dataset:e,factory:t,ptrs:r,terms:n,graphs:a}){if(this.factory=t,r)this.ptrs=[...r];else{this.ptrs=[];for(const l of n||[null])for(const d of a||[null])this.ptrs.push(new Pr({dataset:e,factory:t,graph:d,term:l}))}}get dataset(){const e=new Set(this.datasets);return e.size!==1?null:e[Symbol.iterator]().next().value}get datasets(){return this.ptrs.map(e=>e.dataset)}get term(){const e=new De(this.terms);if(e.size===1)return e[Symbol.iterator]().next().value}get terms(){return this.ptrs.map(e=>e.term)}get value(){const e=this.term;return e==null?void 0:e.value}get values(){return this.ptrs.map(e=>e.value)}addIn(e,t,r){const n=Br(this,r);for(const a of this.ptrs)a.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=Br(this,r);for(const a of this.ptrs)a.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((t,r)=>(t.some(n=>{return l=r,(a=n).dataset===l.dataset&&!!$r(a.graph,l.graph)&&!!$r(a.term,l.term);var a,l})||t.push(r.trim()),t),[]);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(t=>t.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 this.ptrs.length===1&&this.ptrs[0].isList()}list(){if(!this.isList())return;const e=this.ptrs[0].list()[Symbol.iterator](),t=()=>{const{done:r,value:n}=e.next();return r?{done:!0}:{done:!1,value:this.clone({ptrs:[n]})}};return{[Symbol.iterator]:()=>({next:t})}}map(e){return[...this].map(e)}node(e){const t=this.dataset,r=[...e].map(n=>new Pr({dataset:t,factory:this.factory,term:n}));return this.clone({ptrs:r})}out(e,t){return this.clone({ptrs:this.ptrs.flatMap(r=>r.out(e,t))})}quads(){const e=this;return{*[Symbol.iterator](){for(const t of e.ptrs)for(const r of t.edges)yield r.quad}}}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 Nt=bi;Me("http://www.w3.org/2002/07/owl#");const Ke=Me("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),vi=Me("http://www.w3.org/2000/01/rdf-schema#"),ae=Me("http://www.w3.org/ns/shacl#"),er=Me("https://schemas.link/shacl-next#"),hr=Me("http://www.w3.org/2001/XMLSchema#");var Fe=je(8059);const Fr=class{constructor({details:s,factory:e,options:t,results:r=[]}={}){this.details=s,this.factory=e,this.options=t,this.results=r,this._conforms=Fe(()=>!this.results.some(n=>n.severity.equals(ae.Info)||n.severity.equals(ae.Violation)||n.severity.equals(ae.Warning))),this._ptr=Fe(()=>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 s=new Nt({dataset:this.factory.dataset(),factory:this.factory,terms:[this.factory.blankNode()]});s.addOut([Ke.type],[ae.ValidationReport]).addOut([ae.conforms],[this.factory.literal(this.conforms.toString(),hr.boolean)]);for(const e of this.results)s.addOut([ae.result],[this.factory.blankNode()],t=>{e.build(t,this.options)});return s}coverage(){return this.results.flatMap(s=>s.coverage())}},wi=class{constructor({args:s={},constraintComponent:e,factory:t,focusNode:r,message:n=[],path:a,results:l=[],severity:d,shape:i,source:o=[],value:c,valuePaths:p=[]}={}){this.args=s,this.constraintComponent=e,this.factory=t,this.focusNode=r,this.path=a||i.path,this.results=l,this.severity=d,this.shape=i,this.source=o,this.value=c,this.valuePaths=p,this._message=Fe(()=>(this.shape.message.length>0&&(n=this.shape.message),n.length===0&&(n=this.shape.ptr.node([this.constraintComponent]).out([ae.message]).terms),n.map(v=>t.literal(function(f,h){return Object.entries(h).reduce((w,[g,x])=>(x&&x.termType&&(x=qe(x)),w.replace(`{$${g}}`,x).replace(`{?${g}}`,x)),f)}(v.value,s),v.language||null))))}get message(){return this._message()}build(s,{details:e}={}){s.addOut([Ke.type],[ae.ValidationResult]).addOut([ae.focusNode],this.focusNode.terms).addOut([ae.resultSeverity],[this.severity]).addOut([ae.sourceConstraint],this.source).addOut([ae.sourceConstraintComponent],[this.constraintComponent]).addOut([ae.sourceShape],this.shape.ptr.terms),this.message&&s.addOut([ae.resultMessage],this.message);const t=r=>r.quantifier==="one"?r.predicates.length>1?s.node([this.factory.blankNode()]).addList([ae.alternativePath],r.predicates):r.start==="object"?s.node([this.factory.blankNode()]).addOut([ae.inversePath],[r.predicates[0]]):s.node([r.predicates[0]]):r.quantifier==="oneOrMore"?s.node([this.factory.blankNode()]).addOut([ae.oneOrMorePath],[r.predicates[0]]):r.quantifier==="zeroOrMore"?s.node([this.factory.blankNode()]).addOut([ae.zeroOrMorePath],[r.predicates[0]]):r.quantifier==="zeroOrOne"?s.node([this.factory.blankNode()]).addOut([ae.zeroOrOnePath],[r.predicates[0]]):void 0;if(this.path&&(this.path.length===1?s.addOut([ae.resultPath],t(this.path[0]).terms):s.addList([ae.resultPath],this.path.map(r=>t(r).term))),this.value!==void 0&&s.addOut([ae.value],this.value.terms),e)for(const r of this.results)s.addOut([ae.detail],[this.factory.blankNode()],n=>{r.build(n,{details:e})})}coverage(){return[...this.valuePaths.flatMap(s=>[...s.quads()]),...this.results.flatMap(s=>s.coverage())]}};class fr{constructor({factory:e,focusNode:t,options:r={debug:!1,details:!1},processed:n=new Set,report:a=new Fr({factory:e,options:r}),results:l=new Map,shape:d,value:i,valueOrNode:o,valuePaths:c,values:p}={}){this.factory=e,this.focusNode=t,this.options=r,this.processed=n,this.report=a,this.results=l,this.shape=d,this.value=i,this.valuePaths=c,this.valueOrNode=o,this.values=p}create({child:e,focusNode:t=this.focusNode,shape:r=this.shape,value:n=this.value,valueOrNode:a=this.valueOrNode,valuePaths:l=this.valuePaths,values:d=this.values}={}){return new fr({factory:this.factory,focusNode:t,options:this.options,processed:this.processed,report:e?new Fr({factory:this.factory,options:this.options}):this.report,results:this.results,shape:r,value:n,valueOrNode:a,valuePaths:l,values:d})}id({shape:e=this.shape}={}){return`${qe(e.ptr.term)} - ${qe(this.focusNode.term)} - ${t=this.valuePaths,t?`{${t.map(r=>function(n){return n?`{${[...n.quads()].map(a=>qe(a)).join(" ")}}`:"{}"}(r)).join(" ")}}`:"{}"}`;var t}result(e){const t=new wi({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:er.Debug,constraintComponent:e,...t})}trace(e,t){this.options.trace&&this.result({severity:er.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||ae.Violation,...t})}}const _i=fr;function xi(){return{generic:s=>{s.trace(er.TraversalConstraintComponent,{args:{},message:[s.factory.literal("Traversal")],value:s.valueOrNode})}}}const Si=class{constructor(s){this.validations=new nt(s)}compile(s){const e=s.validator.options.coverage;if(s.deactivated)return[];let t=!1;const r=new Set;for(const n of s.ptr.execute({start:"subject",end:"predicate"})){const a=this.validations.get(n.term);a&&(r.add(a),n.term.equals(ae.property)&&(t=!0))}return e&&s.isPropertyShape&&!t&&r.add(xi),[...r].map(n=>n(s)).filter(Boolean)}};var ft=je(9349);function qr(s){if(s.term.termType!=="BlankNode")return{quantifier:"one",start:"subject",end:"object",predicates:[s.term]};const e=s.out([ae.alternativePath]);if(e.ptrs.length===1&&e.ptrs[0].isList())return{quantifier:"one",start:"subject",end:"object",predicates:[...e.list()].map(l=>l.term)};const t=s.out([ae.inversePath]);if(t.term)return{quantifier:"one",start:"object",end:"subject",predicates:[t.term]};const r=s.out([ae.oneOrMorePath]);if(r.term)return{quantifier:"oneOrMore",start:"subject",end:"object",predicates:[r.term]};const n=s.out([ae.zeroOrMorePath]);if(n.term)return{quantifier:"zeroOrMore",start:"subject",end:"object",predicates:[n.term]};const a=s.out([ae.zeroOrOnePath]);return a.term?{quantifier:"zeroOrOne",start:"subject",end:"object",predicates:[a.term]}:void 0}const ji=class{constructor(s){this.shape=s,this._compiled=Fe(()=>this.shape.validator.registry.compile(s))}get compiled(){return this._compiled()}async validate(s){return s.focusNode.dataset.size===0||(this.shape.isPropertyShape?await this.validateProperty(s):await this.validateNode(s)),s}async validateNode(s){const e=s.create({shape:this.shape,valueOrNode:s.value||s.focusNode});for(const t of this.compiled)t.node&&await t.node(e),t.generic&&await t.generic(e)}async validateProperty(s){let e;e=this.shape.isSparqlShape?s.focusNode:s.focusNode.executeAll(this.shape.path);const t=e.node(new De(e.terms)),r=[...e].reduce((a,l)=>{const d=l.term,i=e.node([d]);return a.has(d)||a.set(d,{value:i,valuePaths:[]}),a.get(d).valuePaths.push(l),a},new nt).values(),n=s.create({shape:this.shape,values:t});for(const a of this.compiled)a.property&&await a.property(n);for(const{value:a,valuePaths:l}of r){const d=s.create({shape:this.shape,value:a,valueOrNode:a,valuePaths:l});for(const i of this.compiled)i.generic&&await i.generic(d)}}},tr=function(s){const e=new De,t=new Nt({dataset:s.dataset,terms:s.terms}).execute({quantifier:"zeroOrMore",start:"object",end:"subject",predicates:[vi.subClassOf]});for(const r of t.ptrs)for(const{term:n}of r.nodes())e.add(n);return e},Ii=class{constructor(s){this.targetClass=new De([...tr(s.hasOut([Ke.type],[ae.NodeShape])),...tr(s.out([ae.targetClass]))]),this.targetNode=s.out([ae.targetNode]).terms,this.targetObjectsOf=s.out([ae.targetObjectsOf]).terms,this.targetSubjectsOf=s.out([ae.targetSubjectsOf]).terms}resolve(s){const e=s.focusNode.node([null]),t=[...s.focusNode.hasOut([Ke.type],this.targetClass).ptrs,...s.focusNode.node(this.targetNode).ptrs,...e.execute({start:"object",end:"object",predicates:this.targetObjectsOf}).ptrs,...e.execute({start:"subject",end:"subject",predicates:this.targetSubjectsOf}).ptrs],r=s.focusNode.clone({ptrs:t});return r.node([...new De(r.terms)])}},Ei=class{constructor(s,{validator:e}){this.ptr=s,this.validator=e,this._deactivated=Fe(()=>{const t=this.ptr.out([ae.deactivated]).term;return t&&(0,ft.fromRdf)(t)}),this._message=Fe(()=>this.ptr.out([ae.message]).terms),this._path=Fe(()=>function(t){return t.terms.length===0?null:t.ptrs[0].isList()?[...t.list()].map(r=>qr(r)):[qr(t)]}(this.ptr.out([ae.path]))),this._severity=Fe(()=>this.ptr.out([ae.severity]).term),this._shapeValidator=Fe(()=>new ji(this)),this._sparql=Fe(()=>this.ptr.out([ae.sparql])),this._targetResolver=Fe(()=>new Ii(this.ptr))}get deactivated(){return this._deactivated()}get isPropertyShape(){return!!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(s){return this.targetResolver.resolve(s)}async validate(s){const e=s.id({shape:this});if(s.processed.has(e)){if(s.results.has(e))for(const t of s.results.get(e))s.report.results.push(t);return s}return s.processed.add(e),this.shapeValidator.validate(s)}};async function jt(s,e){return Promise.all(s.map(e))}function Ni(s){return e=>{e.test(s.equals(e.valueOrNode.term),ae.HasValueConstraintComponent,{args:{hasValue:s},message:[e.factory.literal("Value must be {$hasValue}")]})}}function Ti(s){return e=>{const t=[...e.values].some(r=>s.equals(r.term));e.test(t,ae.HasValueConstraintComponent,{args:{hasValue:s},message:[e.factory.literal("Missing expected value {$hasValue}")]})}}function Ur(s){return hr.dateTime.equals(s.datatype)&&/^.*(((\+|-)\d{2}:\d{2})|Z)$/.test(s.value)}const Ze=function(s,e){if(!s||s.termType!=="Literal"||!e||e.termType!=="Literal"||Ur(s)!==Ur(e))return null;const t=(0,ft.fromRdf)(s),r=(0,ft.fromRdf)(e);return typeof t!=typeof r?null:typeof t=="string"?t.localeCompare(r):t-r};function Ri(s){return e=>{const t=e.focusNode.out([s]),r=t.filter(a=>!a.term.equals(e.focusNode.term)),n=t.terms.length!==0&&r.terms.length===0;e.test(n,ae.EqualsConstraintComponent,{args:{equals:s},message:[e.factory.literal("Must have same values as {$equals}")],value:r.terms[0]&&e.focusNode.node([r.terms[0]])||e.focusNode})}}function Oi(s){return e=>{const t=new De(e.focusNode.out([s]).terms),r=new De(e.values.terms),n=[...[...r].filter(a=>!t.has(a)),...[...t].filter(a=>!r.has(a))];for(const a of n)e.violation(ae.EqualsConstraintComponent,{args:{equals:s},message:[e.factory.literal("Must have same values as {$equals}")],value:e.focusNode.node([a])});n.length===0&&e.debug(ae.EqualsConstraintComponent,{args:{equals:s},message:[e.factory.literal("Must have same values as {$equals}")]})}}function ki(s,e,t,r){return async n=>{const a=[];let l=[];e&&(l=new Set(n.shape.ptr.in([ae.property]).out([ae.property]).out([ae.qualifiedValueShape]).filter(i=>!i.term.equals(s.ptr.term)).map(i=>n.shape.validator.shape(i))));const d=(await async function(i){return(await Promise.all(i.map(o=>(async c=>{const p=(await s.validate(n.create({child:!0,focusNode:c}))).report;if(a.push(p.results),!p.conforms)return!1;if(l.length===0)return!0;if(n.options.debug||n.options.details){const v=await jt([...l],async f=>(await f.validate(n.create({child:!0,focusNode:c}))).report);return a.push(v.flatMap(f=>f.results)),!v.every(f=>f.conforms)}return!await async function(v,f){for(const h of v)if(!await f(h))return!1;return!0}([...l],async v=>(await v.validate(n.create({child:!0,focusNode:c}))).report.conforms)})(o)))).filter(Boolean)}(n.values)).length;t!==null&&n.test(d<=t,ae.QualifiedMaxCountConstraintComponent,{args:{qualifiedMaxCount:t,qualifiedValueShape:s.ptr.term,qualifiedValueShapesDisjoint:e},message:[n.factory.literal("More than {$qualifiedMaxCount} values have shape {$qualifiedValueShape}")],results:a.flat()}),r!==null&&n.test(d>=r,ae.QualifiedMinCountConstraintComponent,{args:{qualifiedMinCount:r,qualifiedValueShape:s.ptr.term,qualifiedValueShapesDisjoint:e},message:[n.factory.literal("Less than {$qualifiedMinCount} values have shape {$qualifiedValueShape}")],results:a.flat()})}}function Li(s,e,t){return r=>{r.test(t.test(r.valueOrNode.term.value),ae.PatternConstraintComponent,{args:{flags:e,pattern:s},message:[r.factory.literal('Value does not match pattern "{$pattern}"')],value:r.valueOrNode})}}const It=Me("http://www.w3.org/ns/shacl#"),on=Me("https://schemas.link/shacl-next#"),rt=class{constructor({results:s=[]}={}){this.results=s}get conforms(){return!this.results.some(s=>s.severity.equals(It.Info)||s.severity.equals(It.Violation)||s.severity.equals(It.Warning))}},Tt=class{constructor({args:s={},factory:e,message:t=[],severity:r=It.Violation}={}){this.severity=r,this.message=t.map(n=>e.literal(function(a,l){return Object.entries(l).reduce((d,[i,o])=>(o&&o.termType&&(o=qe(o)),d.replace(`{$${i}}`,o).replace(`{?${i}}`,o)),a)}(n.value,s),n.language||null))}};class pr{constructor({factory:e=dr}={}){this.factory=e}clone({factory:e}={}){return new pr({factory:e||this.factory})}validate(){return new rt}validateSimple(){return!0}}const Ai=pr;class gr extends Ai{constructor({datatypes:e,factory:t}={}){super({factory:t}),this.datatypes=[];for(const r of Array.isArray(e)?e:[e])r&&this.datatypes.push(this.factory.fromTerm(r))}clone({factory:e}={}){return new gr({datatypes:this.datatypes,factory:e||this.factory})}}const Rt=gr,Ci=class{constructor({factory:s=dr,validations:e}={}){if(this.factory=s,this.validations=new nt,e)for(const t of Object.values(e)){const r=t.clone({factory:this.factory});for(const n of r.datatypes)this.validations.set(n,r)}}validate(s){const e=this.validations.get(s.datatype);return e?e.validate(s):new rt}validateSimple(s){const e=this.validations.get(s.datatype);return!e||e.validateSimple(s)}};class mr extends Rt{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 mr(this.patterns,this.datatypes,{factory:e||this.factory})}validate(e){const t=this.patterns.map(r=>{let n;r.test(e.value)&&(n=on.Debug);const a={pattern:this.factory.literal(r.toString()),this:e};return new Tt({args:a,factory:this.factory,message:this.message,severity:n})});return new rt({results:t})}validateSimple(e){return this.patterns.every(t=>t.test(e.value))}}const xe=mr,Di=/^([-+]?[0-9]+)$/;class yr extends xe{constructor(e=null,t=null,r,{factory:n}={}){super(Di,r,{factory:n}),this.maxInclusive=null,this.minInclusive=null,typeof t=="string"&&(this.maxInclusive=BigInt(t)),typeof e=="string"&&(this.minInclusive=BigInt(e))}clone({factory:e}={}){var t,r;return new yr((t=this.minInclusive)==null?void 0:t.toString(),(r=this.maxInclusive)==null?void 0:r.toString(),this.datatypes,{factory:e||this.factory})}validate(e){const t=super.validate(e).results;if(!on.Debug.equals(t[0].severity))return new rt({results:t});const r=BigInt(e.value);if(this.minInclusive!==null&&rthis.maxInclusive){const n=`term value "${e.value}" is greater than "${this.maxInclusive.toString()}"`,a=[this.factory.literal(n)];t.push(new Tt({factory:this.factory,message:a}))}return new rt({results:t})}validateSimple(e){if(!super.validateSimple(e))return!1;const t=BigInt(e.value);return!(this.minInclusive!==null&&tthis.maxInclusive)}}const Ae=yr;class br extends Rt{constructor(e,t,{factory:r}={}){super({datatypes:t,factory:r}),this.values=new Set(e)}clone({factory:e}={}){return new br(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 Tt({factory:this.factory,message:n}))}return new rt({results:t})}validateSimple(e){return this.values.has(e.value)}}const Mi=br,be={xsd:Me("http://www.w3.org/2001/XMLSchema#")},Pi=new Rt({datatypes:be.xsd.anySimpleType}),$i=new Rt({datatypes:be.xsd.anyAtomicType}),Ot=/^([^\ud8ff-\udfff\ufffe-\uffff]*)$/,ln=/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)([Ee](\+|-)?[0-9]+)?|(\+|-)?INF|NaN)$/,vr=/^(-?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)))))$/,cn=/^(-?([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))?)$/,Bi=new xe(Ot,be.xsd.string),Fi=new Mi(["1","true","0","false"],be.xsd.boolean),qi=new xe(/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+))$/,be.xsd.decimal),Ui=new xe(ln,be.xsd.float),Gi=new xe(ln,be.xsd.double),Hi=new xe(vr,be.xsd.duration),Vi=new xe(cn,be.xsd.dateTime),zi=new xe(/^((([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))?)$/,be.xsd.time),Wi=new xe(/^(-?([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))?)$/,be.xsd.date),Ji=new xe(/^(-?([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))?)$/,be.xsd.gYearMonth),Qi=new xe(/^(-?([1-9][0-9]{3,}|0[0-9]{3})(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,be.xsd.gYear),Xi=new xe(/^(--(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))?)$/,be.xsd.gMonthDay),Ki=new xe(/^(---(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,be.xsd.gDay),Yi=new xe(/^(--(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,be.xsd.gMonth),Zi=new xe(/^(([0-9a-fA-F]{2})*)$/,be.xsd.hexBinary),es=new xe(/^(((([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] ?= ?=))?)$/,be.xsd.base64Binary),ts=new xe(Ot,be.xsd.anyURI),un=/^([^\u000d\u000a\u0009]*)$/,rs=new xe([Ot,un],be.xsd.normalizedString),ns=new xe([Ot,un,/^([^ ]+( [^ ]+)*)*$/],be.xsd.token),is=new xe(/^([a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*)$/,be.xsd.language),ss=new Ae(null,null,be.xsd.integer),as=new Ae(null,"0",be.xsd.nonPositiveInteger),os=new Ae(null,"-1",be.xsd.negativeInteger),ls=new Ae("-9223372036854775808","9223372036854775807",be.xsd.long),cs=new Ae("-2147483648","2147483647",be.xsd.int),us=new Ae("-32768","32767",be.xsd.short),ds=new Ae("-128","127",be.xsd.byte),hs=new Ae("0",null,be.xsd.nonNegativeInteger),fs=new Ae("0","18446744073709551615",be.xsd.unsignedLong),ps=new Ae("0","4294967295",be.xsd.unsignedInt),gs=new Ae("0","65535",be.xsd.unsignedShort),ms=new Ae("0","255",be.xsd.unsignedByte),ys=new Ae("1",null,be.xsd.positiveInteger),bs=new xe([vr,/^([^DT]*)$/],be.xsd.yearMonthDuration),vs=new xe([vr,/^([^YM]*[DT].*)$/],be.xsd.dayTimeDuration),ws=new xe([cn,/^(.*(Z|(\+|-)[0-9][0-9]:[0-9][0-9]))$/],be.xsd.dateTimeStamp),_s=class extends Ci{constructor({factory:s}={}){super({factory:s,validations:{...qt}})}},xs=new nt([[ae.BlankNode,new Set(["BlankNode"])],[ae.BlankNodeOrIRI,new Set(["BlankNode","NamedNode"])],[ae.BlankNodeOrLiteral,new Set(["BlankNode","Literal"])],[ae.IRI,new Set(["NamedNode"])],[ae.IRIOrLiteral,new Set(["NamedNode","Literal"])],[ae.Literal,new Set(["Literal"])]]);function Ss(s,e){return t=>{t.test(e.has(t.valueOrNode.term.termType),ae.NodeKindConstraintComponent,{args:{nodeKind:s},message:[t.factory.literal("Value does not have node kind {$nodeKind}")],value:t.valueOrNode})}}const js=new nt([[ae.maxCount,function(s){return{property:(e=parseInt(s.ptr.out([ae.maxCount]).value),t=>{t.test(t.values.terms.length<=e,ae.MaxCountConstraintComponent,{args:{maxCount:e},message:[t.factory.literal("More than {$maxCount} values")]})})};var e}],[ae.minCount,function(s){return{property:(e=parseInt(s.ptr.out([ae.minCount]).value),t=>{t.test(t.values.terms.length>=e,ae.MinCountConstraintComponent,{args:{minCount:e},message:[t.factory.literal("Less than {$minCount} values")]})})};var e}],[ae.and,function(s){return{generic:(e=[...s.ptr.out([ae.and])].flatMap(t=>[...t.list()]).map(t=>s.validator.shape(t)),async t=>{const r=await jt(e,async a=>(await a.validate(t.create({child:!0,focusNode:t.valueOrNode}))).report),n=r.every(a=>a.conforms);t.test(n,ae.AndConstraintComponent,{results:r.flatMap(a=>a.results),value:t.valueOrNode})})};var e}],[ae.not,function(s){return{generic:(e=s.validator.shape(s.ptr.out([ae.not])),async t=>{const r=(await e.validate(t.create({child:!0,focusNode:t.valueOrNode}))).report,n=!r.conforms;t.test(n,ae.NotConstraintComponent,{args:{not:e.ptr.term},message:[t.factory.literal("Value does have shape {$not}")],results:r.results,value:t.valueOrNode})})};var e}],[ae.or,function(s){return{generic:(e=[...s.ptr.out([ae.or])].flatMap(t=>[...t.list()]).map(t=>s.validator.shape(t)),async t=>{let r,n=[];if(t.options.debug||t.options.details){const a=await jt(e,async l=>(await l.validate(t.create({child:!0,focusNode:t.valueOrNode}))).report);n=a.flatMap(l=>l.results),r=a.some(l=>l.conforms)}else r=await async function(a,l){for(const d of a)if(await l(d))return!0;return!1}(e,async a=>(await a.validate(t.create({child:!0,focusNode:t.valueOrNode}))).report.conforms);t.test(r,ae.OrConstraintComponent,{results:n,value:t.valueOrNode})})};var e}],[ae.xone,function(s){return{generic:(e=[...s.ptr.out([ae.xone])].flatMap(t=>[...t.list()]).map(t=>s.validator.shape(t)),async t=>{const r=await jt(e,async a=>(await a.validate(t.create({child:!0,focusNode:t.valueOrNode}))).report),n=r.filter(a=>a.conforms).length===1;t.test(n,ae.XoneConstraintComponent,{results:r.flatMap(a=>a.results),value:t.valueOrNode})})};var e}],[ae.closed,function(s){if(!(0,ft.fromRdf)(s.ptr.out([ae.closed]).term))return null;const e=s.ptr.out([ae.property]).map(n=>s.validator.shape(n));return{node:(t=new De(e.filter(n=>!n.deactivated).map(n=>n.path[0].predicates[0])),r=new De([...s.ptr.out([ae.ignoredProperties]).list()||[]].map(n=>n.term)),n=>{const a=n.focusNode.execute({start:"subject",end:"predicate"}).filter(l=>!r.has(l.term)&&!t.has(l.term));if(a.ptrs.length>0)for(const l of a)n.violation(ae.ClosedConstraintComponent,{message:[n.factory.literal("Predicate is not allowed (closed shape)")],path:[{quantifier:"one",start:"subject",end:"object",predicates:[l.term]}],value:n.focusNode.node([[...l.quads()][0].object])});else n.debug(ae.ClosedConstraintComponent)})};var t,r}],[ae.hasValue,function(s){const e=s.ptr.out([ae.hasValue]).term;return{node:Ni(e),property:Ti(e)}}],[ae.in,function(s){return{generic:(e=new De([...s.ptr.out([ae.in]).list()].map(t=>t.term)),t=>{t.test(e.has(t.valueOrNode.term),ae.InConstraintComponent,{args:{in:[...e].map(r=>r.value).join(", ")},message:[t.factory.literal("Value is not in {$in}")],value:t.valueOrNode})})};var e}],[ae.disjoint,function(s){return{generic:(e=s.ptr.out([ae.disjoint]).term,t=>{const r=t.focusNode.dataset.match(t.focusNode.term,e,t.valueOrNode.term);t.test(r.size===0,ae.DisjointConstraintComponent,{args:{disjoint:e},message:[t.factory.literal("Value node must not also be one of the values of {$disjoint}")],value:t.valueOrNode})})};var e}],[ae.equals,function(s){const e=s.ptr.out([ae.equals]).term;return{node:Ri(e),property:Oi(e)}}],[ae.lessThan,function(s){return{property:(e=s.ptr.out([ae.lessThan]).term,t=>{const r=t.focusNode.out([e]).terms;for(const n of t.values)for(const a of r){const l=Ze(n.term,a);l===null||l>=0?t.violation(ae.LessThanConstraintComponent,{args:{lessThan:e},message:[t.factory.literal("Value is not less than value of {$lessThan}")],value:n}):t.debug(ae.LessThanConstraintComponent,{args:{lessThan:e},message:[t.factory.literal("Value is not less than value of {$lessThan}")],value:n})}})};var e}],[ae.lessThanOrEquals,function(s){return{property:(e=s.ptr.out([ae.lessThanOrEquals]).term,t=>{const r=t.focusNode.out([e]).terms;for(const n of t.values)for(const a of r){const l=Ze(n.term,a);l===null||l>0?t.violation(ae.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:e},message:[t.factory.literal("Value is not less than or equal to value of {$lessThanOrEquals}")],value:n}):t.debug(ae.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:e},message:[t.factory.literal("Value is not less than or equal to value of {$lessThanOrEquals}")],value:n})}})};var e}],[ae.maxExclusive,function(s){return{generic:(e=s.ptr.out([ae.maxExclusive]).term,t=>{const r=Ze(t.valueOrNode.term,e);t.test(r!==null&&r<0,ae.MaxExclusiveConstraintComponent,{args:{maxExclusive:e},message:[t.factory.literal("Value is not less than {$maxExclusive}")],value:t.valueOrNode})})};var e}],[ae.maxInclusive,function(s){return{generic:(e=s.ptr.out([ae.maxInclusive]).term,t=>{const r=Ze(t.valueOrNode.term,e);t.test(r!==null&&r<=0,ae.MaxInclusiveConstraintComponent,{args:{maxInclusive:e},message:[t.factory.literal("Value is not less than or equal to {$maxInclusive}")],value:t.valueOrNode})})};var e}],[ae.minExclusive,function(s){return{generic:(e=s.ptr.out([ae.minExclusive]).term,t=>{const r=Ze(t.valueOrNode.term,e);t.test(r!==null&&r>0,ae.MinExclusiveConstraintComponent,{args:{minExclusive:e},message:[t.factory.literal("Value is not greater than {$minExclusive}")],value:t.valueOrNode})})};var e}],[ae.minInclusive,function(s){return{generic:(e=s.ptr.out([ae.minInclusive]).term,t=>{const r=Ze(t.valueOrNode.term,e);t.test(r!==null&&r>=0,ae.MinInclusiveConstraintComponent,{args:{minInclusive:e},message:[t.factory.literal("Value is not greater than or equal to {$minInclusive}")],value:t.valueOrNode})})};var e}],[ae.node,function(s){return{generic:(e=[...s.ptr.out([ae.node])].map(t=>s.validator.shape(t)),async t=>{for(const r of e){const n=await r.validate(t.create({child:!0,focusNode:t.valueOrNode}));t.test(n.report.conforms,ae.NodeConstraintComponent,{args:{node:r.ptr.term},message:[t.factory.literal("Value does not have shape {$node}")],results:n.report.results,value:t.valueOrNode})}})};var e}],[ae.property,function(s){return{generic:(e=[...s.ptr.out([ae.property])].map(t=>s.validator.shape(t)),async t=>{const r=t.create({focusNode:t.valueOrNode});for(const n of e)await n.validate(r)})};var e}],[ae.qualifiedValueShape,function(s){const e=s.validator.shape(s.ptr.out([ae.qualifiedValueShape])),t=s.ptr.out([ae.qualifiedValueShapesDisjoint]).term,r=!!t&&(0,ft.fromRdf)(t),n=s.ptr.out([ae.qualifiedMaxCount]).term,a=n?parseInt(n.value):null,l=s.ptr.out([ae.qualifiedMinCount]).term;return{property:ki(e,r,a,l?parseInt(l.value):null)}}],[ae.languageIn,function(s){return{generic:(e=[...new Set([...s.ptr.out([ae.languageIn]).list()].map(t=>t.value))],t=>{const r=e.some(n=>function(a,l){return!!l&&l.slice(0,a.length)===a}(n,t.valueOrNode.term.language));t.test(r,ae.LanguageInConstraintComponent,{args:{languageIn:e.join(", ")},message:[t.factory.literal("Language does not match any of {$languageIn}")],value:t.valueOrNode})})};var e}],[ae.maxLength,function(s){return{generic:(e=parseInt(s.ptr.out([ae.maxLength]).value),t=>{const r=t.valueOrNode.term.termType!=="BlankNode"&&t.valueOrNode.value.length<=e;t.test(r,ae.MaxLengthConstraintComponent,{args:{maxLength:e},message:[t.factory.literal("Value has more than {$maxLength} characters")],value:t.valueOrNode})})};var e}],[ae.minLength,function(s){return{generic:(e=parseInt(s.ptr.out([ae.minLength]).value),t=>{const r=t.valueOrNode.term.termType!=="BlankNode"&&t.valueOrNode.value.length>=e;t.test(r,ae.MinLengthConstraintComponent,{args:{minLength:e},message:[t.factory.literal("Value has less than {$minLength} characters")],value:t.valueOrNode})})};var e}],[ae.pattern,function(s){const e=s.ptr.out([ae.pattern]).value,t=s.ptr.out([ae.flags]).value;return{generic:Li(e,t,new RegExp(e,t))}}],[ae.uniqueLang,function(s){const e=s.ptr.out([ae.uniqueLang]).term;return e.value==="true"&&hr.boolean.equals(e.datatype)?{property:t=>{const r=Object.entries(t.values.terms.reduce((a,l)=>(l.language&&(a[l.language]=(a[l.language]||0)+1),a),{})),n=r.filter(([,a])=>a>1);for(const[a]of n)t.violation(ae.UniqueLangConstraintComponent,{args:{lang:a},message:[t.factory.literal('Language "{?lang}" used more than once')]});n.length===0&&t.debug(ae.UniqueLangConstraintComponent)}}:null}],[ae.class,function(s){return{generic:(e=s.ptr.out([ae.class]).map(t=>tr(t)),t=>{const r=new De(t.valueOrNode.out([Ke.type]).terms);for(const n of e){const a=[...r].some(l=>n.has(l));t.test(a,ae.ClassConstraintComponent,{value:t.valueOrNode})}})};var e}],[ae.datatype,function(s){return{generic:(e=s.ptr.out([ae.datatype]).term,t=new _s,r=>{const n=e.equals(r.valueOrNode.term.datatype)&&t.validateSimple(r.valueOrNode.term);r.test(n,ae.DatatypeConstraintComponent,{args:{datatype:e},message:[r.factory.literal("Value does not have datatype {$datatype}")],value:r.valueOrNode})})};var e,t}],[ae.nodeKind,function(s){const e=s.ptr.out([ae.nodeKind]).term;return{generic:Ss(e,xs.get(e))}}]]),Is=class{constructor(s,{factory:e,...t}){if(this.factory=e,this.options=t,this.registry=new Si(js),this.shapesPtr=new Nt({dataset:s,factory:e}),this.shapes=new nt,this.options.coverage&&(this.options.debug=!0,this.options.details=!0,this.options.trace=!0),this.options.validations)for(const[n,a]of this.options.validations)this.registry.validations.set(n,a);const r=[...this.shapesPtr.hasOut([ae.targetClass]),...this.shapesPtr.hasOut([ae.targetNode]),...this.shapesPtr.hasOut([ae.targetObjectsOf]),...this.shapesPtr.hasOut([ae.targetSubjectsOf]),...this.shapesPtr.hasOut([Ke.type],[ae.NodeShape]),...this.shapesPtr.hasOut([Ke.type],[ae.PropertyShape])];for(const n of r)this.shape(n)}shape(s){if(!s.term)return null;let e=this.shapes.get(s.term);return e||(e=new Ei(s,{validator:this}),this.shapes.set(s.term,e)),e}async validate(s,e){const t=new Nt({...s,factory:this.factory}),r=new _i({factory:this.factory,focusNode:t,options:this.options,validator:this});e=e?e.map(n=>this.shape(this.shapesPtr.node(n.terms))):this.shapes.values();for(const n of e){const a=r.create({shape:n});let l;l=t.isAny()?n.resolveTargets(a):t;for(const d of l)await n.validate(a.create({focusNode:d}))}return r.report}};var Gr=function(s,e,t,r){return new(t||(t=Promise))(function(n,a){function l(o){try{i(r.next(o))}catch(c){a(c)}}function d(o){try{i(r.throw(o))}catch(c){a(c)}}function i(o){var c;o.done?n(o.value):(c=o.value,c instanceof t?c:new t(function(p){p(c)})).then(l,d)}i((r=r.apply(s,e||[])).next())})};class Es extends HTMLElement{static get observedAttributes(){return Kt.dataAttributes()}constructor(e){super(),this.shape=null,this.attachShadow({mode:"open"}),this.form=document.createElement("form"),this.config=new Kt(e,this.form),this.form.addEventListener("change",t=>{t.stopPropagation(),this.config.editMode&&this.validate(!0).then(r=>{this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,composed:!0,detail:{valid:r}}))}).catch(r=>{console.warn(r)})})}connectedCallback(){this.shadowRoot.prepend(this.form)}attributeChangedCallback(){this.config.updateAttributes(this),this.initialize()}initialize(){clearTimeout(this.initDebounceTimeout),this.initDebounceTimeout=setTimeout(()=>Gr(this,void 0,void 0,function*(){this.form.replaceChildren(document.createTextNode(this.config.attributes.loading));try{yield this.config.loader.loadGraphs(),this.form.replaceChildren(),this.config.renderedNodes.clear();const e=this.findRootShaclShapeSubject();if(e){this.form.classList.forEach(r=>{this.form.classList.remove(r)}),this.form.classList.toggle("mode-edit",this.config.editMode),this.form.classList.toggle("mode-view",!this.config.editMode),this.config.theme.apply(this.form);const t=[this.config.theme.stylesheet];for(const r of Object.entries(dt).map(n=>n[1]))r.stylesheet&&t.push(r.stylesheet);if(this.shadowRoot.adoptedStyleSheets=t,this.shape=new Je(e,this.config,this.config.attributes.valuesSubject?we.namedNode(this.config.attributes.valuesSubject):void 0),this.form.appendChild(this.shape),this.config.editMode){if(this.config.attributes.submitButton!==null){const r=this.config.theme.createButton(this.config.attributes.submitButton||"Submit",!0);r.addEventListener("click",n=>{n.preventDefault(),this.form.reportValidity()&&this.validate().then(a=>{var l;a?this.dispatchEvent(new Event("submit",{bubbles:!0,cancelable:!0})):(l=this.form.querySelector(":scope .invalid > .editor"))===null||l===void 0||l.focus()})}),this.form.appendChild(r)}yield this.validate(!0)}}else if(this.config.shapesGraph.size>0)throw new Error("shacl root node shape not found")}catch(e){console.error(e);const t=document.createElement("div");t.innerText=String(e),this.form.replaceChildren(t)}}),200)}serialize(e="text/turtle",t=this.toRDF()){return function(r,n,a){if(n==="application/ld+json")return function(l){const d=[];for(const i of l){const o={"@id":i.subject.id};if(i.predicate===Oe)o["@type"]=i.object.id;else{let c=i.object.value;i.object instanceof Ue?i.object.language?c={"@language":i.object.language,"@value":i.object.value}:i.object.datatype&&i.object.datatype.value!==`${Xe}#string`&&(c={"@type":i.object.datatype.value,"@value":i.object.value}):c={"@id":i.object.id},o[i.predicate.value]=c}d.push(o)}return JSON.stringify(d)}(r);{const l=new or({format:n,prefixes:a});l.addQuads(r);let d="";return l.end((i,o)=>{i&&console.error(i),d=o}),d}}(t.getQuads(null,null,null,null),e,this.config.prefixes)}toRDF(e=new ke){var t;return(t=this.shape)===null||t===void 0||t.toRDF(e),e}registerPlugin(e){Xr(e),this.initialize()}setTheme(e){this.config.theme=e,this.initialize()}setClassInstanceProvider(e){this.config.classInstanceProvider=e,this.initialize()}validate(){return Gr(this,arguments,void 0,function*(e=!1){var t,r,n,a,l,d;for(const i of this.form.querySelectorAll(":scope .validation-error"))i.remove();for(const i of this.form.querySelectorAll(":scope .property-instance"))i.classList.remove("invalid"),!((t=i.querySelector(":scope > .editor"))===null||t===void 0)&&t.value?i.classList.add("valid"):i.classList.remove("valid");this.config.shapesGraph.deleteGraph(""),(r=this.shape)===null||r===void 0||r.toRDF(this.config.shapesGraph);try{const i=this.config.shapesGraph,o=yield new Is(i,{details:!0,factory:we}).validate({dataset:i});for(const c of o.results)if(!((a=(n=c.focusNode)===null||n===void 0?void 0:n.ptrs)===null||a===void 0)&&a.length)for(const p of c.focusNode.ptrs){const v=p._term;if(!((l=c.path)===null||l===void 0)&&l.length){const f=c.path[0].predicates[0];let h=this.form.querySelectorAll(`:scope [data-node-id='${v.id}'] [data-path='${f.id}'] > .editor`);h.length===0&&(h=this.form.querySelectorAll(`:scope [data-node-id='${v.id}'] [data-path='${f.id}']`));for(const w of h)if(w.classList.contains("editor")){if(!e||w.value){let g=w.parentElement;g.classList.add("invalid"),g.classList.remove("valid"),g.appendChild(this.createValidationErrorDisplay(c));do g.classList.contains("collapsible")&&g.classList.add("open"),g=g.parentElement;while(g)}}else e||(w.classList.add("invalid"),w.classList.remove("valid"),w.appendChild(this.createValidationErrorDisplay(c,"node")))}else e||(d=this.form.querySelector(`:scope [data-node-id='${v.id}']`))===null||d===void 0||d.prepend(this.createValidationErrorDisplay(c,"node"))}return o.conforms}catch(i){return console.error(i),!1}})}createValidationErrorDisplay(e,t){var r,n;const a=document.createElement("span");if(a.classList.add("validation-error"),t&&a.classList.add(t),e)if(((r=e.message)===null||r===void 0?void 0:r.length)>0)for(const l of e.message)a.title+=l.value+` +`;else a.title=(n=e.sourceConstraintComponent)===null||n===void 0?void 0:n.value;return a}findRootShaclShapeSubject(){let e=null;if(this.config.attributes.shapeSubject){if(e=we.namedNode(this.config.attributes.shapeSubject),!this.config.shapesGraph.has(new tt(e,Oe,bt,Se)))return void console.warn(`shapes graph does not contain requested root shape ${this.config.attributes.shapeSubject}`)}else if(this.config.attributes.valuesSubject&&this.config.dataGraph.size>0){const t=we.namedNode(this.config.attributes.valuesSubject),r=[...this.config.dataGraph.getQuads(t,Oe,null,null),...this.config.dataGraph.getQuads(t,Gt,null,null)];if(r.length===0)return void console.warn(`value subject '${this.config.attributes.valuesSubject}' has neither ${Oe.id} nor ${Gt.id} statement`);for(const n of r)if(this.config.shapesGraph.has(new tt(n.object,Oe,bt,Se))){e=n.object;break}if(!e){const n=this.config.shapesGraph.getQuads(null,ar,r[0].object,Se);if(n.length===0)return void console.error(`value subject '${this.config.attributes.valuesSubject}' has no shacl shape definition in the shapes graph`);if(n.length>1&&console.warn(`value subject '${this.config.attributes.valuesSubject}' has multiple shacl shape definitions in the shapes graph, choosing the first found (${n[0].subject})`),this.config.shapesGraph.getQuads(n[0].subject,Oe,bt,Se).length===0)return void console.error(`value subject '${this.config.attributes.valuesSubject}' references a shape which is not a NodeShape (${n[0].subject})`);e=n[0].subject}}else{const t=this.config.shapesGraph.getQuads(null,Oe,bt,Se);if(t.length==0)return void console.warn("shapes graph does not contain any root shapes");t.length>1&&(console.warn("shapes graph contains",t.length,"root shapes. choosing first found which is",t[0].subject.value),console.info('hint: set the shape to use with attribute "data-shape-subject"')),e=t[0].subject}return e}}class Ns extends Qr{constructor(e){super(e||`.editor:not([type='checkbox']) { border: 1px solid #DDD; padding: 2px 4px; } +.property-instance label { display: inline-block; word-break: break-word; line-height: 1em; padding-top: 0.15em; padding-right: 1em; flex-shrink: 0; position: relative; } +.property-instance:not(:first-child) > label { visibility: hidden; max-height: 0; } +.mode-edit .property-instance label { width: var(--label-width); } +`),this.idCtr=0}createDefaultTemplate(e,t,r,n,a){var l;n.id="e"+this.idCtr++,n.classList.add("editor"),a!=null&&a.datatype&&(n.shaclDatatype=a.datatype),(a==null?void 0:a.minCount)!==void 0&&(n.dataset.minCount=String(a.minCount)),a!=null&&a.class&&(n.dataset.class=a.class.value),a!=null&&a.nodeKind&&(n.dataset.nodeKind=a.nodeKind.value),a!=null&&a.hasValue&&(n.disabled=!0),n.value=(t==null?void 0:t.value)||((l=a==null?void 0:a.defaultValue)===null||l===void 0?void 0:l.value)||"";const d=document.createElement("label");d.htmlFor=n.id,d.innerText=e,a!=null&&a.description&&d.setAttribute("title",a.description.value);const i=a!=null&&a.description?a.description.value:a!=null&&a.pattern?a.pattern:null;i&&n.setAttribute("placeholder",i),r&&(n.setAttribute("required","true"),d.classList.add("required"));const o=document.createElement("div");return o.appendChild(d),o.appendChild(n),o}createDateEditor(e,t,r,n){var a,l;const d=document.createElement("input");((a=n.datatype)===null||a===void 0?void 0:a.value)===Xe+"dateTime"?(d.type="datetime-local",d.setAttribute("step","1")):d.type="date",d.classList.add("pr-0");const i=this.createDefaultTemplate(e,null,r,d,n);if(t)try{let o=new Date(t.value).toISOString();o=((l=n.datatype)===null||l===void 0?void 0:l.value)===Xe+"dateTime"?o.slice(0,19):o.slice(0,10),d.value=o}catch(o){console.error(o,t)}return i}createTextEditor(e,t,r,n){let a;return n.singleLine===!1?(a=document.createElement("textarea"),a.rows=5):(a=document.createElement("input"),a.type="text",n.pattern&&(a.pattern=n.pattern)),n.minLength&&(a.minLength=n.minLength),n.maxLength&&(a.maxLength=n.maxLength),this.createDefaultTemplate(e,t,r,a,n)}createLangStringEditor(e,t,r,n){var a;const l=this.createTextEditor(e,t,r,n),d=l.querySelector(":scope .editor");let i;if(!((a=n.languageIn)===null||a===void 0)&&a.length){i=document.createElement("select");for(const o of n.languageIn){const c=document.createElement("option");c.innerText=o.value,i.appendChild(c)}}else i=document.createElement("input"),i.maxLength=5,i.placeholder="lang?";return i.title="Language of the text",i.classList.add("lang-chooser"),i.addEventListener("change",o=>{o.stopPropagation(),d&&(d.dataset.lang=i.value,d.dispatchEvent(new Event("change",{bubbles:!0})))}),t instanceof Ue&&(i.value=t.language),d.dataset.lang=i.value,d.after(i),l}createBooleanEditor(e,t,r,n){var a;const l=document.createElement("input");l.type="checkbox",l.classList.add("ml-0");const d=this.createDefaultTemplate(e,null,r,l,n);return l.removeAttribute("required"),(a=d.querySelector(":scope label"))===null||a===void 0||a.classList.remove("required"),t instanceof Ue&&(l.checked=t.value==="true"),d}createFileEditor(e,t,r,n){const a=document.createElement("input");return a.type="file",a.addEventListener("change",l=>{var d;if(!((d=a.files)===null||d===void 0)&&d.length){l.stopPropagation();const i=new FileReader;i.readAsDataURL(a.files[0]),i.onload=()=>{var o;a.binaryData=btoa(i.result),(o=a.parentElement)===null||o===void 0||o.dispatchEvent(new Event("change",{bubbles:!0}))}}else a.binaryData=void 0}),this.createDefaultTemplate(e,t,r,a,n)}createNumberEditor(e,t,r,n){var a;const l=document.createElement("input");l.type="number",l.classList.add("pr-0");const d=n.minInclusive!==void 0?n.minInclusive:n.minExclusive!==void 0?n.minExclusive+1:void 0,i=n.maxInclusive!==void 0?n.maxInclusive:n.maxExclusive!==void 0?n.maxExclusive-1:void 0;return d!==void 0&&(l.min=String(d)),i!==void 0&&(l.max=String(i)),((a=n.datatype)===null||a===void 0?void 0:a.value)!==Xe+"integer"&&(l.step="0.1"),this.createDefaultTemplate(e,t,r,l,n)}createListEditor(e,t,r,n,a){const l=document.createElement("select"),d=this.createDefaultTemplate(e,null,r,l,a);let i=!0;for(const o of n){const c=document.createElement("option"),p=typeof o.value=="string"?o.value:o.value.value;c.innerHTML=o.label?o.label:p,c.value=p,t&&t.value===p&&(c.selected=!0),p===""&&(i=!1),l.appendChild(c)}if(i){const o=document.createElement("option");o.value="",t||(o.selected=!0),l.prepend(o)}return t&&(l.value=t.value),d}createButton(e,t){const r=document.createElement("button");return r.type="button",r.innerHTML=e,r}}class dn extends Es{constructor(){super(new Ns)}}window.customElements.define("shacl-form",dn);const Ts={name:"FormDemo",setup(){const s=gn(),e=wr();return{store:s,selection:e}},components:{Term:hn,InstanceList:Nn,Splitpanes:mn,Pane:yn},mounted(){this.getFormData()},watch:{resource_iri(s){this.getResource()},resource_iri(s){this.getFormData()}},data(){return{dataModel:{},dataTurtle:`@prefix rdf: . +@prefix rdfs: . + + rdf:type rdf:Class ; + 'Example resource'. `,shapeTurtle:`@prefix sh: . +@prefix rdf: . +@prefix rdfs: . +@prefix ex: . + +ex:DefaultShape + a sh:NodeShape, rdf:Class ; + sh:property [ + sh:name 'class' ; + sh:path rdf:type ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:name 'label' ; + sh:path rdfs:label ; + sh:maxCount 1 ; + ] .`,subject:gt.namedNode("")}},computed:{...bn(wr,["graph_iri","resource_iri","is_class"]),res_type(){if(this.dataModel.getQuads!==void 0){const s=this.dataModel.getQuads(gt.namedNode(this.resource_iri),gt.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),null)[0];if(s)return s.object}return""}},methods:{async getResource(){this.subject=gt.namedNode(this.resource_iri);const s=await this.store.getResource(this.resource_iri),e=(await vn(s)).store;return await wn(e.match(),{format:"application/n-triples",prefixes:this.prefixes_flat})},async getFormData(){console.log("Form: Get form data");let s=[],e="";this.is_class?e=await this.store.sendQuery({query:await _n(this.resource_iri)}):e=await this.store.sendQuery({query:await xn(this.resource_iri)}),e.resultType==="quads"&&(s=await(await e.execute()).toArray());let t="",r="";s.length<1?(console.log("Form: Use default shape"),t=`@prefix sh: . +@prefix rdf: . +@prefix rdfs: . +@prefix ex: . + +ex:DefaultShape + a sh:NodeShape, rdfs:Class ; + sh:property [ + sh:name 'class' ; + sh:path rdf:type ; + sh:minCount 1 ; + sh:maxCount 1 ; + ] ; + sh:property [ + sh:name 'label' ; + sh:path rdfs:label ; + sh:maxCount 1 ; + ] .`):(console.log("Form: Use found shape"),this.is_class==!1&&(r=(await this.getResource()).replaceAll('"',"'")),t=(await this.serialize(s,{format:"application/n-triples",prefixes:this.prefixes})).replaceAll('"',"'")),console.log("Form: Shape as turtle"),console.log(t),console.log("Form: Instance as n-triples"),console.log(r),this.shapeTurtle=t,this.dataTurtle=r},selectResource(s){this.selection.changeResourceIri(s)},serialize(s,e={}){return new Promise((t,r)=>{const n=new Sn(e);s.forEach(a=>{n.addQuad(a)}),n.end((a,l)=>{a!==null&&r(a),t(l)})})}}},Rs=We("dt",null,"IRI",-1),Os=We("dt",null,"Type",-1),ks=["data-shapes","data-values"];function Ls(s,e,t,r,n,a){const l=mt("Term"),d=mt("pane"),i=mt("InstanceList"),o=mt("splitpanes");return In(),jn(o,{class:"default-theme"},{default:Ct(()=>[yt(d,{size:"70"},{default:Ct(()=>[We("div",null,[We("dl",null,[Rs,We("dd",null,En(s.resource_iri),1),Os,We("dd",null,[yt(l,{term:a.res_type,"onUpdate:term":e[0]||(e[0]=c=>a.res_type=c),onClick:a.selectResource},null,8,["term","onClick"])])])]),We("div",null,[We("shacl-form",{"data-shapes":n.shapeTurtle,"data-values":n.dataTurtle},null,8,ks)])]),_:1}),yt(d,{size:"30"},{default:Ct(()=>[yt(i,{style:{height:"80vh","overflow-y":"scroll"}})]),_:1})]),_:1})}const Ms=pn(Ts,[["render",Ls]]);export{Ms as default}; diff --git a/pad/assets/FormDemo-DXTcTxJi.js b/pad/assets/FormDemo-DXTcTxJi.js deleted file mode 100644 index e87673b..0000000 --- a/pad/assets/FormDemo-DXTcTxJi.js +++ /dev/null @@ -1,125 +0,0 @@ -import{T as fn}from"./Term-CKdvsSUc.js";import{L as pn,_ as gn,u as mn,b as wr,M as yn,i as bn,f as gt,m as vn,q as wn,N as _r,O as _n,P as xn,r as mt,n as Sn,w as Ct,o as jn,d as yt,a as We,t as In}from"./index-CWflGvq2.js";import En from"./InstanceList-AVehQBSG.js";/*! For license information please see form-default.js.LICENSE.txt */var Nn={5568:s=>{const{AbortController:e,AbortSignal:t}=typeof self<"u"?self:typeof window<"u"?window:void 0;s.exports=e,s.exports.AbortSignal=t,s.exports.default=e},7526:(s,e)=>{e.byteLength=function(a){var c=d(a),p=c[0],v=c[1];return 3*(p+v)/4-v},e.toByteArray=function(a){var c,p,v=d(a),f=v[0],h=v[1],w=new n(function(j,A,Q){return 3*(A+Q)/4-Q}(0,f,h)),g=0,x=h>0?f-4:f;for(p=0;p>16&255,w[g++]=c>>8&255,w[g++]=255&c;return h===2&&(c=r[a.charCodeAt(p)]<<2|r[a.charCodeAt(p+1)]>>4,w[g++]=255&c),h===1&&(c=r[a.charCodeAt(p)]<<10|r[a.charCodeAt(p+1)]<<4|r[a.charCodeAt(p+2)]>>2,w[g++]=c>>8&255,w[g++]=255&c),w},e.fromByteArray=function(a){for(var c,p=a.length,v=p%3,f=[],h=16383,w=0,g=p-v;wg?g:w+h));return v===1?(c=a[p-1],f.push(t[c>>2]+t[c<<4&63]+"==")):v===2&&(c=(a[p-2]<<8)+a[p-1],f.push(t[c>>10]+t[c>>4&63]+t[c<<2&63]+"=")),f.join("")};for(var t=[],r=[],n=typeof Uint8Array<"u"?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0;l<64;++l)t[l]=o[l],r[o.charCodeAt(l)]=l;function d(a){var c=a.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var p=a.indexOf("=");return p===-1&&(p=c),[p,p===c?0:4-p%4]}function i(a,c,p){for(var v,f,h=[],w=c;w>18&63]+t[f>>12&63]+t[f>>6&63]+t[63&f]);return h.join("")}r[45]=62,r[95]=63},8287:(s,e,t)=>{const r=t(7526),n=t(251),o=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=i,e.SlowBuffer=function(u){return+u!=u&&(u=0),i.alloc(+u)},e.INSPECT_MAX_BYTES=50;const l=2147483647;function d(u){if(u>l)throw new RangeError('The value "'+u+'" is invalid for option "size"');const m=new Uint8Array(u);return Object.setPrototypeOf(m,i.prototype),m}function i(u,m,_){if(typeof u=="number"){if(typeof m=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return p(u)}return a(u,m,_)}function a(u,m,_){if(typeof u=="string")return function(re,ce){if(typeof ce=="string"&&ce!==""||(ce="utf8"),!i.isEncoding(ce))throw new TypeError("Unknown encoding: "+ce);const he=0|w(re,ce);let pe=d(he);const me=pe.write(re,ce);return me!==he&&(pe=pe.slice(0,me)),pe}(u,m);if(ArrayBuffer.isView(u))return function(re){if(R(re,Uint8Array)){const ce=new Uint8Array(re);return f(ce.buffer,ce.byteOffset,ce.byteLength)}return v(re)}(u);if(u==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof u);if(R(u,ArrayBuffer)||u&&R(u.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(R(u,SharedArrayBuffer)||u&&R(u.buffer,SharedArrayBuffer)))return f(u,m,_);if(typeof u=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const F=u.valueOf&&u.valueOf();if(F!=null&&F!==u)return i.from(F,m,_);const G=function(re){if(i.isBuffer(re)){const ce=0|h(re.length),he=d(ce);return he.length===0||re.copy(he,0,0,ce),he}return re.length!==void 0?typeof re.length!="number"||ne(re.length)?d(0):v(re):re.type==="Buffer"&&Array.isArray(re.data)?v(re.data):void 0}(u);if(G)return G;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof u[Symbol.toPrimitive]=="function")return i.from(u[Symbol.toPrimitive]("string"),m,_);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof u)}function c(u){if(typeof u!="number")throw new TypeError('"size" argument must be of type number');if(u<0)throw new RangeError('The value "'+u+'" is invalid for option "size"')}function p(u){return c(u),d(u<0?0:0|h(u))}function v(u){const m=u.length<0?0:0|h(u.length),_=d(m);for(let F=0;F=l)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+l.toString(16)+" bytes");return 0|u}function w(u,m){if(i.isBuffer(u))return u.length;if(ArrayBuffer.isView(u)||R(u,ArrayBuffer))return u.byteLength;if(typeof u!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof u);const _=u.length,F=arguments.length>2&&arguments[2]===!0;if(!F&&_===0)return 0;let G=!1;for(;;)switch(m){case"ascii":case"latin1":case"binary":return _;case"utf8":case"utf-8":return W(u).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*_;case"hex":return _>>>1;case"base64":return z(u).length;default:if(G)return F?-1:W(u).length;m=(""+m).toLowerCase(),G=!0}}function g(u,m,_){let F=!1;if((m===void 0||m<0)&&(m=0),m>this.length||((_===void 0||_>this.length)&&(_=this.length),_<=0)||(_>>>=0)<=(m>>>=0))return"";for(u||(u="utf8");;)switch(u){case"hex":return se(this,m,_);case"utf8":case"utf-8":return b(this,m,_);case"ascii":return N(this,m,_);case"latin1":case"binary":return K(this,m,_);case"base64":return k(this,m,_);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return q(this,m,_);default:if(F)throw new TypeError("Unknown encoding: "+u);u=(u+"").toLowerCase(),F=!0}}function x(u,m,_){const F=u[m];u[m]=u[_],u[_]=F}function j(u,m,_,F,G){if(u.length===0)return-1;if(typeof _=="string"?(F=_,_=0):_>2147483647?_=2147483647:_<-2147483648&&(_=-2147483648),ne(_=+_)&&(_=G?0:u.length-1),_<0&&(_=u.length+_),_>=u.length){if(G)return-1;_=u.length-1}else if(_<0){if(!G)return-1;_=0}if(typeof m=="string"&&(m=i.from(m,F)),i.isBuffer(m))return m.length===0?-1:A(u,m,_,F,G);if(typeof m=="number")return m&=255,typeof Uint8Array.prototype.indexOf=="function"?G?Uint8Array.prototype.indexOf.call(u,m,_):Uint8Array.prototype.lastIndexOf.call(u,m,_):A(u,[m],_,F,G);throw new TypeError("val must be string, number or Buffer")}function A(u,m,_,F,G){let re,ce=1,he=u.length,pe=m.length;if(F!==void 0&&((F=String(F).toLowerCase())==="ucs2"||F==="ucs-2"||F==="utf16le"||F==="utf-16le")){if(u.length<2||m.length<2)return-1;ce=2,he/=2,pe/=2,_/=2}function me(ge,_e){return ce===1?ge[_e]:ge.readUInt16BE(_e*ce)}if(G){let ge=-1;for(re=_;rehe&&(_=he-pe),re=_;re>=0;re--){let ge=!0;for(let _e=0;_eG&&(F=G):F=G;const re=m.length;let ce;for(F>re/2&&(F=re/2),ce=0;ce>8,pe=ce%256,me.push(pe),me.push(he);return me}(m,u.length-_),u,_,F)}function k(u,m,_){return m===0&&_===u.length?r.fromByteArray(u):r.fromByteArray(u.slice(m,_))}function b(u,m,_){_=Math.min(u.length,_);const F=[];let G=m;for(;G<_;){const re=u[G];let ce=null,he=re>239?4:re>223?3:re>191?2:1;if(G+he<=_){let pe,me,ge,_e;switch(he){case 1:re<128&&(ce=re);break;case 2:pe=u[G+1],(192&pe)==128&&(_e=(31&re)<<6|63&pe,_e>127&&(ce=_e));break;case 3:pe=u[G+1],me=u[G+2],(192&pe)==128&&(192&me)==128&&(_e=(15&re)<<12|(63&pe)<<6|63&me,_e>2047&&(_e<55296||_e>57343)&&(ce=_e));break;case 4:pe=u[G+1],me=u[G+2],ge=u[G+3],(192&pe)==128&&(192&me)==128&&(192&ge)==128&&(_e=(15&re)<<18|(63&pe)<<12|(63&me)<<6|63&ge,_e>65535&&_e<1114112&&(ce=_e))}}ce===null?(ce=65533,he=1):ce>65535&&(ce-=65536,F.push(ce>>>10&1023|55296),ce=56320|1023&ce),F.push(ce),G+=he}return function(re){const ce=re.length;if(ce<=L)return String.fromCharCode.apply(String,re);let he="",pe=0;for(;pe"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}}),i.poolSize=8192,i.from=function(u,m,_){return a(u,m,_)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array),i.alloc=function(u,m,_){return function(F,G,re){return c(F),F<=0?d(F):G!==void 0?typeof re=="string"?d(F).fill(G,re):d(F).fill(G):d(F)}(u,m,_)},i.allocUnsafe=function(u){return p(u)},i.allocUnsafeSlow=function(u){return p(u)},i.isBuffer=function(u){return u!=null&&u._isBuffer===!0&&u!==i.prototype},i.compare=function(u,m){if(R(u,Uint8Array)&&(u=i.from(u,u.offset,u.byteLength)),R(m,Uint8Array)&&(m=i.from(m,m.offset,m.byteLength)),!i.isBuffer(u)||!i.isBuffer(m))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(u===m)return 0;let _=u.length,F=m.length;for(let G=0,re=Math.min(_,F);GF.length?(i.isBuffer(re)||(re=i.from(re)),re.copy(F,G)):Uint8Array.prototype.set.call(F,re,G);else{if(!i.isBuffer(re))throw new TypeError('"list" argument must be an Array of Buffers');re.copy(F,G)}G+=re.length}return F},i.byteLength=w,i.prototype._isBuffer=!0,i.prototype.swap16=function(){const u=this.length;if(u%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let m=0;mm&&(u+=" ... "),""},o&&(i.prototype[o]=i.prototype.inspect),i.prototype.compare=function(u,m,_,F,G){if(R(u,Uint8Array)&&(u=i.from(u,u.offset,u.byteLength)),!i.isBuffer(u))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof u);if(m===void 0&&(m=0),_===void 0&&(_=u?u.length:0),F===void 0&&(F=0),G===void 0&&(G=this.length),m<0||_>u.length||F<0||G>this.length)throw new RangeError("out of range index");if(F>=G&&m>=_)return 0;if(F>=G)return-1;if(m>=_)return 1;if(this===u)return 0;let re=(G>>>=0)-(F>>>=0),ce=(_>>>=0)-(m>>>=0);const he=Math.min(re,ce),pe=this.slice(F,G),me=u.slice(m,_);for(let ge=0;ge>>=0,isFinite(_)?(_>>>=0,F===void 0&&(F="utf8")):(F=_,_=void 0)}const G=this.length-m;if((_===void 0||_>G)&&(_=G),u.length>0&&(_<0||m<0)||m>this.length)throw new RangeError("Attempt to write outside buffer bounds");F||(F="utf8");let re=!1;for(;;)switch(F){case"hex":return Q(this,u,m,_);case"utf8":case"utf-8":return S(this,u,m,_);case"ascii":case"latin1":case"binary":return y(this,u,m,_);case"base64":return O(this,u,m,_);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,u,m,_);default:if(re)throw new TypeError("Unknown encoding: "+F);F=(""+F).toLowerCase(),re=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const L=4096;function N(u,m,_){let F="";_=Math.min(u.length,_);for(let G=m;G<_;++G)F+=String.fromCharCode(127&u[G]);return F}function K(u,m,_){let F="";_=Math.min(u.length,_);for(let G=m;G<_;++G)F+=String.fromCharCode(u[G]);return F}function se(u,m,_){const F=u.length;(!m||m<0)&&(m=0),(!_||_<0||_>F)&&(_=F);let G="";for(let re=m;re<_;++re)G+=Y[u[re]];return G}function q(u,m,_){const F=u.slice(m,_);let G="";for(let re=0;re_)throw new RangeError("Trying to access beyond buffer length")}function X(u,m,_,F,G,re){if(!i.isBuffer(u))throw new TypeError('"buffer" argument must be a Buffer instance');if(m>G||mu.length)throw new RangeError("Index out of range")}function I(u,m,_,F,G){le(m,F,G,u,_,7);let re=Number(m&BigInt(4294967295));u[_++]=re,re>>=8,u[_++]=re,re>>=8,u[_++]=re,re>>=8,u[_++]=re;let ce=Number(m>>BigInt(32)&BigInt(4294967295));return u[_++]=ce,ce>>=8,u[_++]=ce,ce>>=8,u[_++]=ce,ce>>=8,u[_++]=ce,_}function B(u,m,_,F,G){le(m,F,G,u,_,7);let re=Number(m&BigInt(4294967295));u[_+7]=re,re>>=8,u[_+6]=re,re>>=8,u[_+5]=re,re>>=8,u[_+4]=re;let ce=Number(m>>BigInt(32)&BigInt(4294967295));return u[_+3]=ce,ce>>=8,u[_+2]=ce,ce>>=8,u[_+1]=ce,ce>>=8,u[_]=ce,_+8}function U(u,m,_,F,G,re){if(_+F>u.length)throw new RangeError("Index out of range");if(_<0)throw new RangeError("Index out of range")}function P(u,m,_,F,G){return m=+m,_>>>=0,G||U(u,0,_,4),n.write(u,m,_,F,23,4),_+4}function J(u,m,_,F,G){return m=+m,_>>>=0,G||U(u,0,_,8),n.write(u,m,_,F,52,8),_+8}i.prototype.slice=function(u,m){const _=this.length;(u=~~u)<0?(u+=_)<0&&(u=0):u>_&&(u=_),(m=m===void 0?_:~~m)<0?(m+=_)<0&&(m=0):m>_&&(m=_),m>>=0,m>>>=0,_||C(u,m,this.length);let F=this[u],G=1,re=0;for(;++re>>=0,m>>>=0,_||C(u,m,this.length);let F=this[u+--m],G=1;for(;m>0&&(G*=256);)F+=this[u+--m]*G;return F},i.prototype.readUint8=i.prototype.readUInt8=function(u,m){return u>>>=0,m||C(u,1,this.length),this[u]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(u,m){return u>>>=0,m||C(u,2,this.length),this[u]|this[u+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(u,m){return u>>>=0,m||C(u,2,this.length),this[u]<<8|this[u+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(u,m){return u>>>=0,m||C(u,4,this.length),(this[u]|this[u+1]<<8|this[u+2]<<16)+16777216*this[u+3]},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(u,m){return u>>>=0,m||C(u,4,this.length),16777216*this[u]+(this[u+1]<<16|this[u+2]<<8|this[u+3])},i.prototype.readBigUInt64LE=ie(function(u){ee(u>>>=0,"offset");const m=this[u],_=this[u+7];m!==void 0&&_!==void 0||M(u,this.length-8);const F=m+256*this[++u]+65536*this[++u]+this[++u]*2**24,G=this[++u]+256*this[++u]+65536*this[++u]+_*2**24;return BigInt(F)+(BigInt(G)<>>=0,"offset");const m=this[u],_=this[u+7];m!==void 0&&_!==void 0||M(u,this.length-8);const F=m*2**24+65536*this[++u]+256*this[++u]+this[++u],G=this[++u]*2**24+65536*this[++u]+256*this[++u]+_;return(BigInt(F)<>>=0,m>>>=0,_||C(u,m,this.length);let F=this[u],G=1,re=0;for(;++re=G&&(F-=Math.pow(2,8*m)),F},i.prototype.readIntBE=function(u,m,_){u>>>=0,m>>>=0,_||C(u,m,this.length);let F=m,G=1,re=this[u+--F];for(;F>0&&(G*=256);)re+=this[u+--F]*G;return G*=128,re>=G&&(re-=Math.pow(2,8*m)),re},i.prototype.readInt8=function(u,m){return u>>>=0,m||C(u,1,this.length),128&this[u]?-1*(255-this[u]+1):this[u]},i.prototype.readInt16LE=function(u,m){u>>>=0,m||C(u,2,this.length);const _=this[u]|this[u+1]<<8;return 32768&_?4294901760|_:_},i.prototype.readInt16BE=function(u,m){u>>>=0,m||C(u,2,this.length);const _=this[u+1]|this[u]<<8;return 32768&_?4294901760|_:_},i.prototype.readInt32LE=function(u,m){return u>>>=0,m||C(u,4,this.length),this[u]|this[u+1]<<8|this[u+2]<<16|this[u+3]<<24},i.prototype.readInt32BE=function(u,m){return u>>>=0,m||C(u,4,this.length),this[u]<<24|this[u+1]<<16|this[u+2]<<8|this[u+3]},i.prototype.readBigInt64LE=ie(function(u){ee(u>>>=0,"offset");const m=this[u],_=this[u+7];m!==void 0&&_!==void 0||M(u,this.length-8);const F=this[u+4]+256*this[u+5]+65536*this[u+6]+(_<<24);return(BigInt(F)<>>=0,"offset");const m=this[u],_=this[u+7];m!==void 0&&_!==void 0||M(u,this.length-8);const F=(m<<24)+65536*this[++u]+256*this[++u]+this[++u];return(BigInt(F)<>>=0,m||C(u,4,this.length),n.read(this,u,!0,23,4)},i.prototype.readFloatBE=function(u,m){return u>>>=0,m||C(u,4,this.length),n.read(this,u,!1,23,4)},i.prototype.readDoubleLE=function(u,m){return u>>>=0,m||C(u,8,this.length),n.read(this,u,!0,52,8)},i.prototype.readDoubleBE=function(u,m){return u>>>=0,m||C(u,8,this.length),n.read(this,u,!1,52,8)},i.prototype.writeUintLE=i.prototype.writeUIntLE=function(u,m,_,F){u=+u,m>>>=0,_>>>=0,F||X(this,u,m,_,Math.pow(2,8*_)-1,0);let G=1,re=0;for(this[m]=255&u;++re<_&&(G*=256);)this[m+re]=u/G&255;return m+_},i.prototype.writeUintBE=i.prototype.writeUIntBE=function(u,m,_,F){u=+u,m>>>=0,_>>>=0,F||X(this,u,m,_,Math.pow(2,8*_)-1,0);let G=_-1,re=1;for(this[m+G]=255&u;--G>=0&&(re*=256);)this[m+G]=u/re&255;return m+_},i.prototype.writeUint8=i.prototype.writeUInt8=function(u,m,_){return u=+u,m>>>=0,_||X(this,u,m,1,255,0),this[m]=255&u,m+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(u,m,_){return u=+u,m>>>=0,_||X(this,u,m,2,65535,0),this[m]=255&u,this[m+1]=u>>>8,m+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(u,m,_){return u=+u,m>>>=0,_||X(this,u,m,2,65535,0),this[m]=u>>>8,this[m+1]=255&u,m+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(u,m,_){return u=+u,m>>>=0,_||X(this,u,m,4,4294967295,0),this[m+3]=u>>>24,this[m+2]=u>>>16,this[m+1]=u>>>8,this[m]=255&u,m+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(u,m,_){return u=+u,m>>>=0,_||X(this,u,m,4,4294967295,0),this[m]=u>>>24,this[m+1]=u>>>16,this[m+2]=u>>>8,this[m+3]=255&u,m+4},i.prototype.writeBigUInt64LE=ie(function(u,m=0){return I(this,u,m,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeBigUInt64BE=ie(function(u,m=0){return B(this,u,m,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeIntLE=function(u,m,_,F){if(u=+u,m>>>=0,!F){const he=Math.pow(2,8*_-1);X(this,u,m,_,he-1,-he)}let G=0,re=1,ce=0;for(this[m]=255&u;++G<_&&(re*=256);)u<0&&ce===0&&this[m+G-1]!==0&&(ce=1),this[m+G]=(u/re|0)-ce&255;return m+_},i.prototype.writeIntBE=function(u,m,_,F){if(u=+u,m>>>=0,!F){const he=Math.pow(2,8*_-1);X(this,u,m,_,he-1,-he)}let G=_-1,re=1,ce=0;for(this[m+G]=255&u;--G>=0&&(re*=256);)u<0&&ce===0&&this[m+G+1]!==0&&(ce=1),this[m+G]=(u/re|0)-ce&255;return m+_},i.prototype.writeInt8=function(u,m,_){return u=+u,m>>>=0,_||X(this,u,m,1,127,-128),u<0&&(u=255+u+1),this[m]=255&u,m+1},i.prototype.writeInt16LE=function(u,m,_){return u=+u,m>>>=0,_||X(this,u,m,2,32767,-32768),this[m]=255&u,this[m+1]=u>>>8,m+2},i.prototype.writeInt16BE=function(u,m,_){return u=+u,m>>>=0,_||X(this,u,m,2,32767,-32768),this[m]=u>>>8,this[m+1]=255&u,m+2},i.prototype.writeInt32LE=function(u,m,_){return u=+u,m>>>=0,_||X(this,u,m,4,2147483647,-2147483648),this[m]=255&u,this[m+1]=u>>>8,this[m+2]=u>>>16,this[m+3]=u>>>24,m+4},i.prototype.writeInt32BE=function(u,m,_){return u=+u,m>>>=0,_||X(this,u,m,4,2147483647,-2147483648),u<0&&(u=4294967295+u+1),this[m]=u>>>24,this[m+1]=u>>>16,this[m+2]=u>>>8,this[m+3]=255&u,m+4},i.prototype.writeBigInt64LE=ie(function(u,m=0){return I(this,u,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeBigInt64BE=ie(function(u,m=0){return B(this,u,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeFloatLE=function(u,m,_){return P(this,u,m,!0,_)},i.prototype.writeFloatBE=function(u,m,_){return P(this,u,m,!1,_)},i.prototype.writeDoubleLE=function(u,m,_){return J(this,u,m,!0,_)},i.prototype.writeDoubleBE=function(u,m,_){return J(this,u,m,!1,_)},i.prototype.copy=function(u,m,_,F){if(!i.isBuffer(u))throw new TypeError("argument should be a Buffer");if(_||(_=0),F||F===0||(F=this.length),m>=u.length&&(m=u.length),m||(m=0),F>0&&F<_&&(F=_),F===_||u.length===0||this.length===0)return 0;if(m<0)throw new RangeError("targetStart out of bounds");if(_<0||_>=this.length)throw new RangeError("Index out of range");if(F<0)throw new RangeError("sourceEnd out of bounds");F>this.length&&(F=this.length),u.length-m>>=0,_=_===void 0?this.length:_>>>0,u||(u=0),typeof u=="number")for(G=m;G<_;++G)this[G]=u;else{const re=i.isBuffer(u)?u:i.from(u,F),ce=re.length;if(ce===0)throw new TypeError('The value "'+u+'" is invalid for argument "value"');for(G=0;G<_-m;++G)this[G+m]=re[G%ce]}return this};const D={};function V(u,m,_){D[u]=class extends _{constructor(){super(),Object.defineProperty(this,"message",{value:m.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${u}]`,this.stack,delete this.name}get code(){return u}set code(F){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:F,writable:!0})}toString(){return`${this.name} [${u}]: ${this.message}`}}}function te(u){let m="",_=u.length;const F=u[0]==="-"?1:0;for(;_>=F+4;_-=3)m=`_${u.slice(_-3,_)}${m}`;return`${u.slice(0,_)}${m}`}function le(u,m,_,F,G,re){if(u>_||u3?m===0||m===BigInt(0)?`>= 0${ce} and < 2${ce} ** ${8*(re+1)}${ce}`:`>= -(2${ce} ** ${8*(re+1)-1}${ce}) and < 2 ** ${8*(re+1)-1}${ce}`:`>= ${m}${ce} and <= ${_}${ce}`,new D.ERR_OUT_OF_RANGE("value",he,u)}(function(ce,he,pe){ee(he,"offset"),ce[he]!==void 0&&ce[he+pe]!==void 0||M(he,ce.length-(pe+1))})(F,G,re)}function ee(u,m){if(typeof u!="number")throw new D.ERR_INVALID_ARG_TYPE(m,"number",u)}function M(u,m,_){throw Math.floor(u)!==u?(ee(u,_),new D.ERR_OUT_OF_RANGE(_||"offset","an integer",u)):m<0?new D.ERR_BUFFER_OUT_OF_BOUNDS:new D.ERR_OUT_OF_RANGE(_||"offset",`>= ${_?1:0} and <= ${m}`,u)}V("ERR_BUFFER_OUT_OF_BOUNDS",function(u){return u?`${u} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),V("ERR_INVALID_ARG_TYPE",function(u,m){return`The "${u}" argument must be of type number. Received type ${typeof m}`},TypeError),V("ERR_OUT_OF_RANGE",function(u,m,_){let F=`The value of "${u}" is out of range.`,G=_;return Number.isInteger(_)&&Math.abs(_)>2**32?G=te(String(_)):typeof _=="bigint"&&(G=String(_),(_>BigInt(2)**BigInt(32)||_<-(BigInt(2)**BigInt(32)))&&(G=te(G)),G+="n"),F+=` It must be ${m}. Received ${G}`,F},RangeError);const E=/[^+/0-9A-Za-z-_]/g;function W(u,m){let _;m=m||1/0;const F=u.length;let G=null;const re=[];for(let ce=0;ce55295&&_<57344){if(!G){if(_>56319){(m-=3)>-1&&re.push(239,191,189);continue}if(ce+1===F){(m-=3)>-1&&re.push(239,191,189);continue}G=_;continue}if(_<56320){(m-=3)>-1&&re.push(239,191,189),G=_;continue}_=65536+(G-55296<<10|_-56320)}else G&&(m-=3)>-1&&re.push(239,191,189);if(G=null,_<128){if((m-=1)<0)break;re.push(_)}else if(_<2048){if((m-=2)<0)break;re.push(_>>6|192,63&_|128)}else if(_<65536){if((m-=3)<0)break;re.push(_>>12|224,_>>6&63|128,63&_|128)}else{if(!(_<1114112))throw new Error("Invalid code point");if((m-=4)<0)break;re.push(_>>18|240,_>>12&63|128,_>>6&63|128,63&_|128)}}return re}function z(u){return r.toByteArray(function(m){if((m=(m=m.split("=")[0]).trim().replace(E,"")).length<2)return"";for(;m.length%4!=0;)m+="=";return m}(u))}function Z(u,m,_,F){let G;for(G=0;G=m.length||G>=u.length);++G)m[G+_]=u[G];return G}function R(u,m){return u instanceof m||u!=null&&u.constructor!=null&&u.constructor.name!=null&&u.constructor.name===m.name}function ne(u){return u!=u}const Y=function(){const u="0123456789abcdef",m=new Array(256);for(let _=0;_<16;++_){const F=16*_;for(let G=0;G<16;++G)m[F+G]=u[_]+u[G]}return m}();function ie(u){return typeof BigInt>"u"?ae:u}function ae(){throw new Error("BigInt not supported")}},2341:s=>{s.exports=function e(t){return t===null||typeof t!="object"||t.toJSON!=null?JSON.stringify(t):Array.isArray(t)?"["+t.reduce((r,n,o)=>r+(o===0?"":",")+e(n===void 0||typeof n=="symbol"?null:n),"")+"]":"{"+Object.keys(t).sort().reduce((r,n,o)=>t[n]===void 0||typeof t[n]=="symbol"?r:r+(r.length===0?"":",")+e(n)+":"+e(t[n]),"")+"}"}},7007:s=>{var e,t=typeof Reflect=="object"?Reflect:null,r=t&&typeof t.apply=="function"?t.apply:function(g,x,j){return Function.prototype.apply.call(g,x,j)};e=t&&typeof t.ownKeys=="function"?t.ownKeys:Object.getOwnPropertySymbols?function(g){return Object.getOwnPropertyNames(g).concat(Object.getOwnPropertySymbols(g))}:function(g){return Object.getOwnPropertyNames(g)};var n=Number.isNaN||function(g){return g!=g};function o(){o.init.call(this)}s.exports=o,s.exports.once=function(g,x){return new Promise(function(j,A){function Q(y){g.removeListener(x,S),A(y)}function S(){typeof g.removeListener=="function"&&g.removeListener("error",Q),j([].slice.call(arguments))}w(g,x,S,{once:!0}),x!=="error"&&function(y,O){typeof y.on=="function"&&w(y,"error",O,{once:!0})}(g,Q)})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var l=10;function d(g){if(typeof g!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof g)}function i(g){return g._maxListeners===void 0?o.defaultMaxListeners:g._maxListeners}function a(g,x,j,A){var Q,S,y,O;if(d(j),(S=g._events)===void 0?(S=g._events=Object.create(null),g._eventsCount=0):(S.newListener!==void 0&&(g.emit("newListener",x,j.listener?j.listener:j),S=g._events),y=S[x]),y===void 0)y=S[x]=j,++g._eventsCount;else if(typeof y=="function"?y=S[x]=A?[j,y]:[y,j]:A?y.unshift(j):y.push(j),(Q=i(g))>0&&y.length>Q&&!y.warned){y.warned=!0;var T=new Error("Possible EventEmitter memory leak detected. "+y.length+" "+String(x)+" listeners added. Use emitter.setMaxListeners() to increase limit");T.name="MaxListenersExceededWarning",T.emitter=g,T.type=x,T.count=y.length,O=T,console&&console.warn&&console.warn(O)}return g}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(g,x,j){var A={fired:!1,wrapFn:void 0,target:g,type:x,listener:j},Q=c.bind(A);return Q.listener=j,A.wrapFn=Q,Q}function v(g,x,j){var A=g._events;if(A===void 0)return[];var Q=A[x];return Q===void 0?[]:typeof Q=="function"?j?[Q.listener||Q]:[Q]:j?function(S){for(var y=new Array(S.length),O=0;O0&&(S=x[0]),S instanceof Error)throw S;var y=new Error("Unhandled error."+(S?" ("+S.message+")":""));throw y.context=S,y}var O=Q[g];if(O===void 0)return!1;if(typeof O=="function")r(O,this,x);else{var T=O.length,k=h(O,T);for(j=0;j=0;S--)if(j[S]===x||j[S].listener===x){y=j[S].listener,Q=S;break}if(Q<0)return this;Q===0?j.shift():function(O,T){for(;T+1=0;A--)this.removeListener(g,x[A]);return this},o.prototype.listeners=function(g){return v(this,g,!0)},o.prototype.rawListeners=function(g){return v(this,g,!1)},o.listenerCount=function(g,x){return typeof g.listenerCount=="function"?g.listenerCount(x):f.call(g,x)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},251:(s,e)=>{e.read=function(t,r,n,o,l){var d,i,a=8*l-o-1,c=(1<>1,v=-7,f=n?l-1:0,h=n?-1:1,w=t[r+f];for(f+=h,d=w&(1<<-v)-1,w>>=-v,v+=a;v>0;d=256*d+t[r+f],f+=h,v-=8);for(i=d&(1<<-v)-1,d>>=-v,v+=o;v>0;i=256*i+t[r+f],f+=h,v-=8);if(d===0)d=1-p;else{if(d===c)return i?NaN:1/0*(w?-1:1);i+=Math.pow(2,o),d-=p}return(w?-1:1)*i*Math.pow(2,d-o)},e.write=function(t,r,n,o,l,d){var i,a,c,p=8*d-l-1,v=(1<>1,h=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=o?0:d-1,g=o?1:-1,x=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,i=v):(i=Math.floor(Math.log(r)/Math.LN2),r*(c=Math.pow(2,-i))<1&&(i--,c*=2),(r+=i+f>=1?h/c:h*Math.pow(2,1-f))*c>=2&&(i++,c/=2),i+f>=v?(a=0,i=v):i+f>=1?(a=(r*c-1)*Math.pow(2,l),i+=f):(a=r*Math.pow(2,f-1)*Math.pow(2,l),i=0));l>=8;t[n+w]=255&a,w+=g,a/=256,l-=8);for(i=i<0;t[n+w]=255&i,w+=g,i/=256,p-=8);t[n+w-g]|=128*x}},7034:(s,e,t)=>{const{isArray:r,isObject:n,isString:o}=t(7382),{asArray:l}=t(9263),{prependBase:d}=t(470),i=t(2207),a=t(7532);function c(v){throw new i("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:v})}function p({context:v,base:f}){if(!v)return;const h=v["@context"];if(o(h))v["@context"]=d(f,h);else if(r(h))for(let w=0;w10)throw new i("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:v.processingMode==="json-ld-1.0"?"loading remote context failed":"context overflow",max:10});if(w.has(f))throw new i("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:v.processingMode==="json-ld-1.0"?"recursive context inclusion":"context overflow",url:f});let g,x;w.add(f);try{x=await h(f),g=x.document||null,o(g)&&(g=JSON.parse(g))}catch(j){throw new i("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:f,cause:j})}if(!n(g))throw new i("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:f});return g="@context"in g?{"@context":g["@context"]}:{"@context":{}},x.contextUrl&&(r(g["@context"])||(g["@context"]=[g["@context"]]),g["@context"].push(x.contextUrl)),{context:g,remoteDoc:x}}}},2207:s=>{s.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}}},5445:s=>{s.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(r,n){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(r,n)},t.expand=function(r){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(r)},t.flatten=function(r){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(r)},t}},8229:(s,e,t)=>{s.exports=t(989).NQuads},3743:s=>{s.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]}}}},7532:(s,e,t)=>{const r=t(9749);s.exports=class{constructor({document:n}){this.document=n,this.cache=new r({max:10})}getProcessed(n){return this.cache.get(n)}setProcessed(n,o){this.cache.set(n,o)}}},1058:(s,e,t)=>{const r=t(2207),{isArray:n,isObject:o,isString:l,isUndefined:d}=t(7382),{isList:i,isValue:a,isGraph:c,isSimpleGraph:p,isSubjectReference:v}=t(3978),{expandIri:f,getContextValue:h,isKeyword:w,process:g,processingMode:x}=t(1972),{removeBase:j,prependBase:A}=t(470),{REGEX_KEYWORD:Q,addValue:S,asArray:y,compareShortestLeast:O}=t(9263),T={};function k(b,L,N){if(f(b,L,{vocab:!0},N)!=="@nest")throw new r("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}s.exports=T,T.compact=async({activeCtx:b,activeProperty:L=null,element:N,options:K={}})=>{if(n(N)){let q=[];for(let C=0;C1&&(B=Array.from(B).sort());const U=b;for(const J of B){const D=T.compactIri({activeCtx:U,iri:J,relativeTo:{vocab:!0}}),V=h(X,D,"@context");d(V)||(b=await g({activeCtx:b,localCtx:V,options:K,propagate:!1}))}const P=Object.keys(N).sort();for(const J of P){const D=N[J];if(J!=="@id")if(J!=="@type")if(J!=="@reverse")if(J!=="@preserve")if(J!=="@index")if(J!=="@graph"&&J!=="@list"&&J!=="@included"&&w(J)){const V=T.compactIri({activeCtx:b,iri:J,relativeTo:{vocab:!0}});S(C,V,D)}else{if(!n(D))throw new r("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(D.length===0){const V=T.compactIri({activeCtx:b,iri:J,value:D,relativeTo:{vocab:!0},reverse:q}),te=b.mappings.has(V)?b.mappings.get(V)["@nest"]:null;let le=C;te&&(k(b,te,K),o(C[te])||(C[te]={}),le=C[te]),S(le,V,D,{propertyIsArray:!0})}for(const V of D){const te=T.compactIri({activeCtx:b,iri:J,value:V,relativeTo:{vocab:!0},reverse:q}),le=b.mappings.has(te)?b.mappings.get(te)["@nest"]:null;let ee=C;le&&(k(b,le,K),o(C[le])||(C[le]={}),ee=C[le]);const M=h(b,te,"@container")||[],E=c(V),W=i(V);let z;W?z=V["@list"]:E&&(z=V["@graph"]);let Z=await T.compact({activeCtx:b,activeProperty:te,element:W||E?z:V,options:K});if(W){if(n(Z)||(Z=[Z]),M.includes("@list")){S(ee,te,Z,{valueIsArray:!0,allowDuplicate:!0});continue}Z={[T.compactIri({activeCtx:b,iri:"@list",relativeTo:{vocab:!0}})]:Z},"@index"in V&&(Z[T.compactIri({activeCtx:b,iri:"@index",relativeTo:{vocab:!0}})]=V["@index"])}if(E)if(M.includes("@graph")&&(M.includes("@id")||M.includes("@index")&&p(V))){let R;ee.hasOwnProperty(te)?R=ee[te]:ee[te]=R={};const ne=(M.includes("@id")?V["@id"]:V["@index"])||T.compactIri({activeCtx:b,iri:"@none",relativeTo:{vocab:!0}});S(R,ne,Z,{propertyIsArray:!K.compactArrays||M.includes("@set")})}else M.includes("@graph")&&p(V)?(n(Z)&&Z.length>1&&(Z={"@included":Z}),S(ee,te,Z,{propertyIsArray:!K.compactArrays||M.includes("@set")})):(n(Z)&&Z.length===1&&K.compactArrays&&(Z=Z[0]),Z={[T.compactIri({activeCtx:b,iri:"@graph",relativeTo:{vocab:!0}})]:Z},"@id"in V&&(Z[T.compactIri({activeCtx:b,iri:"@id",relativeTo:{vocab:!0}})]=V["@id"]),"@index"in V&&(Z[T.compactIri({activeCtx:b,iri:"@index",relativeTo:{vocab:!0}})]=V["@index"]),S(ee,te,Z,{propertyIsArray:!K.compactArrays||M.includes("@set")}));else if(M.includes("@language")||M.includes("@index")||M.includes("@id")||M.includes("@type")){let R,ne;if(ee.hasOwnProperty(te)?R=ee[te]:ee[te]=R={},M.includes("@language"))a(Z)&&(Z=Z["@value"]),ne=V["@language"];else if(M.includes("@index")){const Y=h(b,te,"@index")||"@index",ie=T.compactIri({activeCtx:b,iri:Y,relativeTo:{vocab:!0}});if(Y==="@index")ne=V["@index"],delete Z[ie];else{let ae;if([ne,...ae]=y(Z[Y]||[]),l(ne))switch(ae.length){case 0:delete Z[Y];break;case 1:Z[Y]=ae[0];break;default:Z[Y]=ae}else ne=null}}else if(M.includes("@id")){const Y=T.compactIri({activeCtx:b,iri:"@id",relativeTo:{vocab:!0}});ne=Z[Y],delete Z[Y]}else if(M.includes("@type")){const Y=T.compactIri({activeCtx:b,iri:"@type",relativeTo:{vocab:!0}});let ie;switch([ne,...ie]=y(Z[Y]||[]),ie.length){case 0:delete Z[Y];break;case 1:Z[Y]=ie[0];break;default:Z[Y]=ie}Object.keys(Z).length===1&&"@id"in V&&(Z=await T.compact({activeCtx:b,activeProperty:te,element:{"@id":V["@id"]},options:K}))}ne||(ne=T.compactIri({activeCtx:b,iri:"@none",relativeTo:{vocab:!0}})),S(R,ne,Z,{propertyIsArray:M.includes("@set")})}else{const R=!K.compactArrays||M.includes("@set")||M.includes("@list")||n(Z)&&Z.length===0||J==="@list"||J==="@graph";S(ee,te,Z,{propertyIsArray:R})}}}else{if((h(b,L,"@container")||[]).includes("@index"))continue;const V=T.compactIri({activeCtx:b,iri:J,relativeTo:{vocab:!0}});S(C,V,D)}else{const V=await T.compact({activeCtx:b,activeProperty:L,element:D,options:K});n(V)&&V.length===0||S(C,J,V)}else{const V=await T.compact({activeCtx:b,activeProperty:"@reverse",element:D,options:K});for(const te in V)if(b.mappings.has(te)&&b.mappings.get(te).reverse){const le=V[te],ee=(h(b,te,"@container")||[]).includes("@set")||!K.compactArrays;S(C,te,le,{propertyIsArray:ee}),delete V[te]}if(Object.keys(V).length>0){const te=T.compactIri({activeCtx:b,iri:J,relativeTo:{vocab:!0}});S(C,te,V)}}else{let V=y(D).map(ee=>T.compactIri({activeCtx:X,iri:ee,relativeTo:{vocab:!0}}));V.length===1&&(V=V[0]);const te=T.compactIri({activeCtx:b,iri:"@type",relativeTo:{vocab:!0}}),le=(h(b,te,"@container")||[]).includes("@set")&&x(b,1.1)||n(V)&&D.length===0;S(C,te,V,{propertyIsArray:le})}else{let V=y(D).map(te=>T.compactIri({activeCtx:b,iri:te,relativeTo:{vocab:!1},base:K.base}));V.length===1&&(V=V[0]),C[T.compactIri({activeCtx:b,iri:"@id",relativeTo:{vocab:!0}})]=V}}return C}return N},T.compactIri=({activeCtx:b,iri:L,value:N=null,relativeTo:K={vocab:!1},reverse:se=!1,base:q=null})=>{if(L===null)return L;b.isPropertyTermScoped&&b.previousContext&&(b=b.previousContext);const C=b.getInverse();if(w(L)&&L in C&&"@none"in C[L]&&"@type"in C[L]["@none"]&&"@none"in C[L]["@none"]["@type"])return C[L]["@none"]["@type"]["@none"];if(K.vocab&&L in C){const P=b["@language"]||"@none",J=[];o(N)&&"@index"in N&&!("@graph"in N)&&J.push("@index","@index@set"),o(N)&&"@preserve"in N&&(N=N["@preserve"][0]),c(N)?("@index"in N&&J.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in N&&J.push("@graph@id","@graph@id@set"),J.push("@graph","@graph@set","@set"),"@index"in N||J.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in N||J.push("@graph@id","@graph@id@set")):o(N)&&!a(N)&&J.push("@id","@id@set","@type","@set@type");let D="@language",V="@null";if(se)D="@type",V="@reverse",J.push("@set");else if(i(N)){"@index"in N||J.push("@list");const le=N["@list"];if(le.length===0)D="@any",V="@none";else{let ee=le.length===0?P:null,M=null;for(let E=0;EY.includes("_"));ne&&Z.push(ne.replace(/^[^_]+_/,"_"))}Z.push("@none");const R=le.inverse[ee];for(const ne of E){if(!(ne in R))continue;const Y=R[ne][W];for(const ie of Z)if(ie in Y)return Y[ie]}return null}(b,L,N,J,D,V);if(te!==null)return te}if(K.vocab&&"@vocab"in b){const P=b["@vocab"];if(L.indexOf(P)===0&&L!==P){const J=L.substr(P.length);if(!b.mappings.has(J))return J}}let X=null;const I=[];let B=b.fastCurieMap;const U=L.length-1;for(let P=0;P=0;--P){const J=I[P],D=J.terms;for(const V of D){const te=V+":"+L.substr(J.iri.length);b.mappings.get(V)._prefix&&(!b.mappings.has(te)||N===null&&b.mappings.get(te)["@id"]===L)&&(X===null||O(te,X)<0)&&(X=te)}}if(X!==null)return X;for(const[P,J]of b.mappings)if(J&&J._prefix&&L.startsWith(P+":"))throw new r(`Absolute IRI "${L}" confused with prefix "${P}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:b});if(!K.vocab){if("@base"in b){if(b["@base"]){const P=j(A(q,b["@base"]),L);return Q.test(P)?`./${P}`:P}return L}return j(q,L)}return L},T.compactValue=({activeCtx:b,activeProperty:L,value:N,options:K})=>{if(a(N)){const X=h(b,L,"@type"),I=h(b,L,"@language"),B=h(b,L,"@direction"),U=h(b,L,"@container")||[],P="@index"in N&&!U.includes("@index");if(!P&&X!=="@none"&&(N["@type"]===X||"@language"in N&&N["@language"]===I&&"@direction"in N&&N["@direction"]===B||"@language"in N&&N["@language"]===I||"@direction"in N&&N["@direction"]===B))return N["@value"];const J=Object.keys(N).length,D=J===1||J===2&&"@index"in N&&!P,V="@language"in b,te=l(N["@value"]),le=b.mappings.has(L)&&b.mappings.get(L)["@language"]===null;if(D&&X!=="@none"&&(!V||!te||le))return N["@value"];const ee={};return P&&(ee[T.compactIri({activeCtx:b,iri:"@index",relativeTo:{vocab:!0}})]=N["@index"]),"@type"in N?ee[T.compactIri({activeCtx:b,iri:"@type",relativeTo:{vocab:!0}})]=T.compactIri({activeCtx:b,iri:N["@type"],relativeTo:{vocab:!0}}):"@language"in N&&(ee[T.compactIri({activeCtx:b,iri:"@language",relativeTo:{vocab:!0}})]=N["@language"]),"@direction"in N&&(ee[T.compactIri({activeCtx:b,iri:"@direction",relativeTo:{vocab:!0}})]=N["@direction"]),ee[T.compactIri({activeCtx:b,iri:"@value",relativeTo:{vocab:!0}})]=N["@value"],ee}const se=f(b,L,{vocab:!0},K),q=h(b,L,"@type"),C=T.compactIri({activeCtx:b,iri:N["@id"],relativeTo:{vocab:q==="@vocab"},base:K.base});return q==="@id"||q==="@vocab"||se==="@graph"?C:{[T.compactIri({activeCtx:b,iri:"@id",relativeTo:{vocab:!0}})]:C}}},9378:s=>{const e="http://www.w3.org/1999/02/22-rdf-syntax-ns#",t="http://www.w3.org/2001/XMLSchema#";s.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:e,RDF_LIST:e+"List",RDF_FIRST:e+"first",RDF_REST:e+"rest",RDF_NIL:e+"nil",RDF_TYPE:e+"type",RDF_PLAIN_LITERAL:e+"PlainLiteral",RDF_XML_LITERAL:e+"XMLLiteral",RDF_JSON_LITERAL:e+"JSON",RDF_OBJECT:e+"object",RDF_LANGSTRING:e+"langString",XSD:t,XSD_BOOLEAN:t+"boolean",XSD_DOUBLE:t+"double",XSD_INTEGER:t+"integer",XSD_STRING:t+"string"}},1972:(s,e,t)=>{const r=t(9263),n=t(2207),{isArray:o,isObject:l,isString:d,isUndefined:i}=t(7382),{isAbsolute:a,isRelative:c,prependBase:p}=t(470),{handleEvent:v}=t(2246),{REGEX_BCP47:f,REGEX_KEYWORD:h,asArray:w,compareShortestLeast:g}=t(9263),x=new Map,j={};function A(S,y,O,T,k,b){if(y===null||!d(y)||j.isKeyword(y))return y;if(y.match(h))return null;if(T&&T.hasOwnProperty(y)&&k.get(y)!==!0&&j.createTermDefinition({activeCtx:S,localCtx:T,term:y,defined:k,options:b}),(O=O||{}).vocab){const N=S.mappings.get(y);if(N===null)return null;if(l(N)&&"@id"in N)return N["@id"]}const L=y.indexOf(":");if(L>0){const N=y.substr(0,L),K=y.substr(L+1);if(N==="_"||K.indexOf("//")===0)return y;T&&T.hasOwnProperty(N)&&j.createTermDefinition({activeCtx:S,localCtx:T,term:N,defined:k,options:b});const se=S.mappings.get(N);if(se&&se._prefix)return se["@id"]+K;if(a(y))return y}if(O.vocab&&"@vocab"in S)y=S["@vocab"]+y;else if(O.base){let N,K;"@base"in S?S["@base"]?(K=p(b.base,S["@base"]),N=p(K,y)):(K=S["@base"],N=y):(K=b.base,N=p(b.base,y)),y=N}return y}function Q(S,y){if(!S||typeof S!="object"||!y||typeof y!="object")return S===y;const O=Array.isArray(S);if(O!==Array.isArray(y))return!1;if(O){if(S.length!==y.length)return!1;for(let b=0;b{if(l(y)&&"@context"in y&&o(y["@context"])&&(y=y["@context"]),w(y).length===0)return S;const L=[],N=[({event:C,next:X})=>{L.push(C),X()}];O.eventHandler&&N.push(O.eventHandler);const K=O;O={...O,eventHandler:N};const se=await O.contextResolver.resolve({activeCtx:S,context:y,documentLoader:O.documentLoader,base:O.base});l(se[0].document)&&typeof se[0].document["@propagate"]=="boolean"&&(T=se[0].document["@propagate"]);let q=S;T||q.previousContext||(q=q.clone(),q.previousContext=S);for(const C of se){let{document:X}=C;if(S=q,X===null){if(!k&&Object.keys(S.protected).length!==0)throw new n("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});q=S=j.getInitialContext(O).clone();continue}const I=C.getProcessed(S);if(I){if(K.eventHandler)for(const U of I.events)v({event:U,options:K});q=S=I.context;continue}if(l(X)&&"@context"in X&&(X=X["@context"]),!l(X))throw new n("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:X});q=q.clone();const B=new Map;if("@version"in X){if(X["@version"]!==1.1)throw new n("Unsupported JSON-LD version: "+X["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:X});if(S.processingMode&&S.processingMode==="json-ld-1.0")throw new n("@version: "+X["@version"]+" not compatible with "+S.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:X});q.processingMode="json-ld-1.1",q["@version"]=X["@version"],B.set("@version",!0)}if(q.processingMode=q.processingMode||S.processingMode,"@base"in X){let U=X["@base"];if(!(U===null||a(U))){if(!c(U))throw new n('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:X});U=p(q["@base"],U)}q["@base"]=U,B.set("@base",!0)}if("@vocab"in X){const U=X["@vocab"];if(U===null)delete q["@vocab"];else{if(!d(U))throw new n('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:X});if(!a(U)&&j.processingMode(q,1))throw new n('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:X});{const P=A(q,U,{vocab:!0,base:!0},void 0,void 0,O);a(P)||O.eventHandler&&v({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:P}},options:O}),q["@vocab"]=P}}B.set("@vocab",!0)}if("@language"in X){const U=X["@language"];if(U===null)delete q["@language"];else{if(!d(U))throw new n('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:X});U.match(f)||O.eventHandler&&v({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:U}},options:O}),q["@language"]=U.toLowerCase()}B.set("@language",!0)}if("@direction"in X){const U=X["@direction"];if(S.processingMode==="json-ld-1.0")throw new n("Invalid JSON-LD syntax; @direction not compatible with "+S.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:X});if(U===null)delete q["@direction"];else{if(U!=="ltr"&&U!=="rtl")throw new n('Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:X});q["@direction"]=U}B.set("@direction",!0)}if("@propagate"in X){const U=X["@propagate"];if(S.processingMode==="json-ld-1.0")throw new n("Invalid JSON-LD syntax; @propagate not compatible with "+S.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:X});if(typeof U!="boolean")throw new n("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:y});B.set("@propagate",!0)}if("@import"in X){const U=X["@import"];if(S.processingMode==="json-ld-1.0")throw new n("Invalid JSON-LD syntax; @import not compatible with "+S.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:X});if(!d(U))throw new n("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:y});const P=await O.contextResolver.resolve({activeCtx:S,context:U,documentLoader:O.documentLoader,base:O.base});if(P.length!==1)throw new n("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:y});const J=P[0].getProcessed(S);if(J)X=J;else{const D=P[0].document;if("@import"in D)throw new n("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:y});for(const V in D)X.hasOwnProperty(V)||(X[V]=D[V]);P[0].setProcessed(S,X)}B.set("@import",!0)}B.set("@protected",X["@protected"]||!1);for(const U in X)if(j.createTermDefinition({activeCtx:q,localCtx:X,term:U,defined:B,options:O,overrideProtected:k}),l(X[U])&&"@context"in X[U]){const P=X[U]["@context"];let J=!0;if(d(P)){const D=p(O.base,P);b.has(D)?J=!1:b.add(D)}if(J)try{await j.process({activeCtx:q.clone(),localCtx:X[U]["@context"],overrideProtected:!0,options:O,cycles:b})}catch{throw new n("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:X[U]["@context"],term:U})}}C.setProcessed(S,{context:q,events:L})}return q},j.createTermDefinition=({activeCtx:S,localCtx:y,term:O,defined:T,options:k,overrideProtected:b=!1})=>{if(T.has(O)){if(T.get(O))return;throw new n("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:y,term:O})}let L;if(T.set(O,!1),y.hasOwnProperty(O)&&(L=y[O]),O==="@type"&&l(L)&&(L["@container"]||"@set")==="@set"&&j.processingMode(S,1.1)){const I=["@container","@id","@protected"],B=Object.keys(L);if(B.length===0||B.some(U=>!I.includes(U)))throw new n("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:y,term:O})}else{if(j.isKeyword(O))throw new n("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:y,term:O});if(O.match(h))return void(k.eventHandler&&v({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:O}},options:k}));if(O==="")throw new n("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:y})}const N=S.mappings.get(O);S.mappings.has(O)&&S.mappings.delete(O);let K=!1;if((d(L)||L===null)&&(K=!0,L={"@id":L}),!l(L))throw new n("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:y});const se={};S.mappings.set(O,se),se.reverse=!1;const q=["@container","@id","@language","@reverse","@type"];j.processingMode(S,1.1)&&q.push("@context","@direction","@index","@nest","@prefix","@protected");for(const I in L)if(!q.includes(I))throw new n("Invalid JSON-LD syntax; a term definition must not contain "+I,"jsonld.SyntaxError",{code:"invalid term definition",context:y});const C=O.indexOf(":");if(se._termHasColon=C>0,"@reverse"in L){if("@id"in L)throw new n("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:y});if("@nest"in L)throw new n("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:y});const I=L["@reverse"];if(!d(I))throw new n("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y});if(I.match(h))return k.eventHandler&&v({event:{type:["JsonLdEvent"],code:"reserved @reverse value",level:"warning",message:'@reverse values beginning with "@" are reserved for future use and dropped.',details:{reverse:I}},options:k}),void(N?S.mappings.set(O,N):S.mappings.delete(O));const B=A(S,I,{vocab:!0,base:!1},y,T,k);if(!a(B))throw new n("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:y});se["@id"]=B,se.reverse=!0}else if("@id"in L){let I=L["@id"];if(I&&!d(I))throw new n("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y});if(I===null)se["@id"]=null;else{if(!j.isKeyword(I)&&I.match(h))return k.eventHandler&&v({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:'@id values beginning with "@" are reserved for future use and dropped.',details:{id:I}},options:k}),void(N?S.mappings.set(O,N):S.mappings.delete(O));if(I!==O){if(I=A(S,I,{vocab:!0,base:!1},y,T,k),!a(I)&&!j.isKeyword(I))throw new n("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:y});if(O.match(/(?::[^:])|\//)&&A(S,O,{vocab:!0,base:!1},y,new Map(T).set(O,!0),k)!==I)throw new n("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y});se["@id"]=I,se._prefix=K&&!se._termHasColon&&I.match(/[:\/\?#\[\]@]$/)!==null}}}if(!("@id"in se))if(se._termHasColon){const I=O.substr(0,C);if(y.hasOwnProperty(I)&&j.createTermDefinition({activeCtx:S,localCtx:y,term:I,defined:T,options:k}),S.mappings.has(I)){const B=O.substr(C+1);se["@id"]=S.mappings.get(I)["@id"]+B}else se["@id"]=O}else if(O==="@type")se["@id"]=O;else{if(!("@vocab"in S))throw new n("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y,term:O});se["@id"]=S["@vocab"]+O}if((L["@protected"]===!0||T.get("@protected")===!0&&L["@protected"]!==!1)&&(S.protected[O]=!0,se.protected=!0),T.set(O,!0),"@type"in L){let I=L["@type"];if(!d(I))throw new n("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:y});if(I==="@json"||I==="@none"){if(j.processingMode(S,1))throw new n(`Invalid JSON-LD syntax; an @context @type value must not be "${I}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:y})}else if(I!=="@id"&&I!=="@vocab"){if(I=A(S,I,{vocab:!0,base:!1},y,T,k),!a(I))throw new n("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:y});if(I.indexOf("_:")===0)throw new n("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:y})}se["@type"]=I}if("@container"in L){const I=d(L["@container"])?[L["@container"]]:L["@container"]||[],B=["@list","@set","@index","@language"];let U=!0;const P=I.includes("@set");if(j.processingMode(S,1.1)){if(B.push("@graph","@id","@type"),I.includes("@list")){if(I.length!==1)throw new n("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:y})}else if(I.includes("@graph")){if(I.some(J=>J!=="@graph"&&J!=="@id"&&J!=="@index"&&J!=="@set"))throw new n("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:y})}else U&=I.length<=(P?2:1);if(I.includes("@type")&&(se["@type"]=se["@type"]||"@id",!["@id","@vocab"].includes(se["@type"])))throw new n("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:y})}else U&=!o(L["@container"]),U&=I.length<=1;if(U&=I.every(J=>B.includes(J)),U&=!(P&&I.includes("@list")),!U)throw new n("Invalid JSON-LD syntax; @context @container value must be one of the following: "+B.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:y});if(se.reverse&&!I.every(J=>["@index","@set"].includes(J)))throw new n("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:y});se["@container"]=I}if("@index"in L){if(!("@container"in L)||!se["@container"].includes("@index"))throw new n(`Invalid JSON-LD syntax; @index without @index in @container: "${L["@index"]}" on term "${O}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:y});if(!d(L["@index"])||L["@index"].indexOf("@")===0)throw new n(`Invalid JSON-LD syntax; @index must expand to an IRI: "${L["@index"]}" on term "${O}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:y});se["@index"]=L["@index"]}if("@context"in L&&(se["@context"]=L["@context"]),"@language"in L&&!("@type"in L)){let I=L["@language"];if(I!==null&&!d(I))throw new n("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:y});I!==null&&(I=I.toLowerCase()),se["@language"]=I}if("@prefix"in L){if(O.match(/:|\//))throw new n("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:y});if(j.isKeyword(se["@id"]))throw new n("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:y});if(typeof L["@prefix"]!="boolean")throw new n("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:y});se._prefix=L["@prefix"]===!0}if("@direction"in L){const I=L["@direction"];if(I!==null&&I!=="ltr"&&I!=="rtl")throw new n('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:y});se["@direction"]=I}if("@nest"in L){const I=L["@nest"];if(!d(I)||I!=="@nest"&&I.indexOf("@")===0)throw new n("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:y});se["@nest"]=I}const X=se["@id"];if(X==="@context"||X==="@preserve")throw new n("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:y});if(N&&N.protected&&!b&&(S.protected[O]=!0,se.protected=!0,!Q(N,se)))throw new n("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:y,term:O})},j.expandIri=(S,y,O,T)=>A(S,y,O,void 0,void 0,T),j.getInitialContext=S=>{const y=JSON.stringify({processingMode:S.processingMode}),O=x.get(y);if(O)return O;const T={processingMode:S.processingMode,mappings:new Map,inverse:null,getInverse:function(){const L=this;if(L.inverse)return L.inverse;const N=L.inverse={},K=L.fastCurieMap={},se={},q=(L["@language"]||"@none").toLowerCase(),C=L["@direction"],X=L.mappings,I=[...X.keys()].sort(g);for(const B of I){const U=X.get(B);if(U===null)continue;let P=U["@container"]||"@none";if(P=[].concat(P).sort().join(""),U["@id"]===null)continue;const J=w(U["@id"]);for(const D of J){let V=N[D];const te=j.isKeyword(D);if(V)te||U._termHasColon||se[D].push(B);else if(N[D]=V={},!te&&!U._termHasColon){se[D]=[B];const le={iri:D,terms:se[D]};D[0]in K?K[D[0]].push(le):K[D[0]]=[le]}if(V[P]||(V[P]={"@language":{},"@type":{},"@any":{}}),V=V[P],b(B,V["@any"],"@none"),U.reverse)b(B,V["@type"],"@reverse");else if(U["@type"]==="@none")b(B,V["@any"],"@none"),b(B,V["@language"],"@none"),b(B,V["@type"],"@none");else if("@type"in U)b(B,V["@type"],U["@type"]);else if("@language"in U&&"@direction"in U){const le=U["@language"],ee=U["@direction"];b(B,V["@language"],le&&ee?`${le}_${ee}`.toLowerCase():le?le.toLowerCase():ee?`_${ee}`:"@null")}else"@language"in U?b(B,V["@language"],(U["@language"]||"@null").toLowerCase()):"@direction"in U?U["@direction"]?b(B,V["@language"],`_${U["@direction"]}`):b(B,V["@language"],"@none"):C?(b(B,V["@language"],`_${C}`),b(B,V["@language"],"@none"),b(B,V["@type"],"@none")):(b(B,V["@language"],q),b(B,V["@language"],"@none"),b(B,V["@type"],"@none"))}}for(const B in K)k(K,B,1);return N},clone:function(){const L={};return L.mappings=r.clone(this.mappings),L.clone=this.clone,L.inverse=null,L.getInverse=this.getInverse,L.protected=r.clone(this.protected),this.previousContext&&(L.previousContext=this.previousContext.clone()),L.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(L["@base"]=this["@base"]),"@language"in this&&(L["@language"]=this["@language"]),"@vocab"in this&&(L["@vocab"]=this["@vocab"]),L},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return x.size===1e4&&x.clear(),x.set(y,T),T;function k(L,N,K){const se=L[N],q=L[N]={};let C,X;for(const I of se)C=I.iri,X=K>=C.length?"":C[K],X in q?q[X].push(I):q[X]=[I];for(const I in q)I!==""&&k(q,I,K+1)}function b(L,N,K){N.hasOwnProperty(K)||(N[K]=L)}},j.getContextValue=(S,y,O)=>{if(y===null)return O==="@context"?void 0:null;if(S.mappings.has(y)){const T=S.mappings.get(y);if(i(O))return T;if(T.hasOwnProperty(O))return T[O]}return O==="@language"&&O in S||O==="@direction"&&O in S?S[O]:O!=="@context"?null:void 0},j.processingMode=(S,y)=>y.toString()>="1.1"?!S.processingMode||S.processingMode>="json-ld-"+y.toString():S.processingMode==="json-ld-1.0",j.isKeyword=S=>{if(!d(S)||S[0]!=="@")return!1;switch(S){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}},6957:(s,e,t)=>{const{parseLinkHeader:r,buildHeaders:n}=t(9263),{LINK_HEADER_CONTEXT:o}=t(9378),l=t(2207),d=t(3743),{prependBase:i}=t(470),a=/(^|(\r\n))link:/i;s.exports=({secure:c,headers:p={},xhr:v}={headers:{}})=>(p=n(p),new d().wrapLoader(async function f(h){if(h.indexOf("http:")!==0&&h.indexOf("https:")!==0)throw new l('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:h});if(c&&h.indexOf("https")!==0)throw new l(`URL could not be dereferenced; secure mode is enabled and the URL's scheme is not "https".`,"jsonld.InvalidUrl",{code:"loading document failed",url:h});let w;try{w=await function(Q,S,y){const O=new(Q=Q||XMLHttpRequest);return new Promise((T,k)=>{O.onload=()=>T(O),O.onerror=b=>k(b),O.open("GET",S,!0);for(const b in y)O.setRequestHeader(b,y[b]);O.send()})}(v,h,p)}catch(Q){throw new l("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:h,cause:Q})}if(w.status>=400)throw new l("URL could not be dereferenced: "+w.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:h,httpStatusCode:w.status});let g={contextUrl:null,documentUrl:h,document:w.response},x=null;const j=w.getResponseHeader("Content-Type");let A;if(a.test(w.getAllResponseHeaders())&&(A=w.getResponseHeader("Link")),A&&j!=="application/ld+json"){const Q=r(A),S=Q[o];if(Array.isArray(S))throw new l("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:h});S&&(g.contextUrl=S.target),x=Q.alternate,x&&x.type=="application/ld+json"&&!(j||"").match(/^application\/(\w*\+)?json$/)&&(g=await f(i(h,x.target)))}return g}))},2246:(s,e,t)=>{const r=t(2207),{isArray:n}=t(7382),{asArray:o}=t(9263),l={};function d({event:a,handlers:c}){let p=!0;for(let v=0;p&&v{p=!0}});else{if(typeof f!="object")throw new r("Invalid event handler.","jsonld.InvalidEventHandler",{event:a});a.code in f?f[a.code]({event:a,next:()=>{p=!0}}):p=!0}}return p}s.exports=l,l.defaultEventHandler=null,l.setupEventHandler=({options:a={}})=>{const c=[].concat(a.safe?l.safeEventHandler:[],a.eventHandler?o(a.eventHandler):[],l.defaultEventHandler?l.defaultEventHandler:[]);return c.length===0?null:c},l.handleEvent=({event:a,options:c})=>{d({event:a,handlers:c.eventHandler})};const i=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"]);l.safeEventHandler=function({event:a,next:c}){if(a.level==="warning"&&i.has(a.code))throw new r("Safe mode validation error.","jsonld.ValidationError",{event:a});c()},l.logEventHandler=function({event:a,next:c}){console.log(`EVENT: ${a.message}`,{event:a}),c()},l.logWarningEventHandler=function({event:a,next:c}){a.level==="warning"&&console.warn(`WARNING: ${a.message}`,{event:a}),c()},l.unhandledEventHandler=function({event:a}){throw new r("No handler for event.","jsonld.UnhandledEvent",{event:a})},l.setDefaultEventHandler=function({eventHandler:a}={}){l.defaultEventHandler=a?o(a):null}},4019:(s,e,t)=>{const r=t(2207),{isArray:n,isObject:o,isEmptyObject:l,isString:d,isUndefined:i}=t(7382),{isList:a,isValue:c,isGraph:p,isSubject:v}=t(3978),{expandIri:f,getContextValue:h,isKeyword:w,process:g,processingMode:x}=t(1972),{isAbsolute:j}=t(470),{REGEX_BCP47:A,REGEX_KEYWORD:Q,addValue:S,asArray:y,getValues:O,validateTypeValue:T}=t(9263),{handleEvent:k}=t(2246),b={};function L({value:C,count:X,options:I}){if(X===0||"@value"in C||"@list"in C||X===1&&"@id"in C){if(I.eventHandler){let B,U;X===0?(B="empty object",U="Dropping empty object."):"@value"in C?(B="object with only @value",U="Dropping object with only @value."):"@list"in C?(B="object with only @list",U="Dropping object with only @list."):X===1&&"@id"in C&&(B="object with only @id",U="Dropping object with only @id."),k({event:{type:["JsonLdEvent"],code:B,level:"warning",message:U,details:{value:C}},options:I})}return null}return C}async function N({activeCtx:C,activeProperty:X,expandedActiveProperty:I,element:B,expandedParent:U,options:P={},insideList:J,typeKey:D,typeScopedContext:V}){const te=Object.keys(B).sort(),le=[];let ee;const M=B[D]&&f(C,n(B[D])?B[D][0]:B[D],{vocab:!0},{...P,typeExpansion:!0})==="@json";for(const E of te){let W,z=B[E];if(E==="@context")continue;const Z=f(C,E,{vocab:!0},P);if(Z===null||!j(Z)&&!w(Z)){P.eventHandler&&k({event:{type:["JsonLdEvent"],code:"invalid property",level:"warning",message:"Dropping property that did not expand into an absolute IRI or keyword.",details:{property:E,expandedProperty:Z}},options:P});continue}if(w(Z)){if(I==="@reverse")throw new r("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:z});if(Z in U&&Z!=="@included"&&Z!=="@type")throw new r("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:Z})}if(Z==="@id"){if(!d(z)){if(!P.isFrame)throw new r('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:z});if(o(z)){if(!l(z))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z})}else{if(!n(z))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z});if(!z.every(ie=>d(ie)))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z})}}S(U,"@id",y(z).map(ie=>{if(d(ie)){const ae=f(C,ie,{base:!0},P);return P.eventHandler&&(ae===null?k(ie===null?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:ie}},options:P}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:ie}},options:P}):j(ae)||k({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:ie,expandedId:ae}},options:P})),ae}return ie}),{propertyIsArray:P.isFrame});continue}if(Z==="@type"){o(z)&&(z=Object.fromEntries(Object.entries(z).map(([ie,ae])=>[f(V,ie,{vocab:!0}),y(ae).map(u=>f(V,u,{base:!0,vocab:!0},{...P,typeExpansion:!0}))]))),T(z,P.isFrame),S(U,"@type",y(z).map(ie=>{if(d(ie)){const ae=f(V,ie,{base:!0,vocab:!0},{...P,typeExpansion:!0});return ae==="@json"||j(ae)||P.eventHandler&&k({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:ie}},options:P}),ae}return ie}),{propertyIsArray:!!P.isFrame});continue}if(Z==="@included"&&x(C,1.1)){const ie=y(await b.expand({activeCtx:C,activeProperty:X,element:z,options:P}));if(!ie.every(ae=>v(ae)))throw new r("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:z});S(U,"@included",ie,{propertyIsArray:!0});continue}if(Z==="@graph"&&!o(z)&&!n(z))throw new r('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:z});if(Z==="@value"){ee=z,M&&x(C,1.1)?U["@value"]=z:S(U,"@value",z,{propertyIsArray:P.isFrame});continue}if(Z==="@language"){if(z===null)continue;if(!d(z)&&!P.isFrame)throw new r('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:z});z=y(z).map(ie=>d(ie)?ie.toLowerCase():ie);for(const ie of z)d(ie)&&!ie.match(A)&&P.eventHandler&&k({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:ie}},options:P});S(U,"@language",z,{propertyIsArray:P.isFrame});continue}if(Z==="@direction"){if(!d(z)&&!P.isFrame)throw new r('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:z});z=y(z);for(const ie of z)if(d(ie)&&ie!=="ltr"&&ie!=="rtl")throw new r('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:z});S(U,"@direction",z,{propertyIsArray:P.isFrame});continue}if(Z==="@index"){if(!d(z))throw new r('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:z});S(U,"@index",z);continue}if(Z==="@reverse"){if(!o(z))throw new r('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:z});if(W=await b.expand({activeCtx:C,activeProperty:"@reverse",element:z,options:P}),"@reverse"in W)for(const ae in W["@reverse"])S(U,ae,W["@reverse"][ae],{propertyIsArray:!0});let ie=U["@reverse"]||null;for(const ae in W){if(ae==="@reverse")continue;ie===null&&(ie=U["@reverse"]={}),S(ie,ae,[],{propertyIsArray:!0});const u=W[ae];for(let m=0;mie==="@id"||ie==="@index")){if(W=y(W),P.isFrame||(W=W.filter(ie=>L({value:ie,count:Object.keys(ie).length,options:P})!==null)),W.length===0)continue;W=W.map(ie=>({"@graph":y(ie)}))}if(R.mappings.has(E)&&R.mappings.get(E).reverse){const ie=U["@reverse"]=U["@reverse"]||{};W=y(W);for(let ae=0;aef(C,Z,{vocab:!0},P)==="@value"))throw new r("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:z});await N({activeCtx:C,activeProperty:X,expandedActiveProperty:I,element:z,expandedParent:U,options:P,insideList:J,typeScopedContext:V,typeKey:D})}}}function K({activeCtx:C,activeProperty:X,value:I,options:B}){if(I==null)return null;const U=f(C,X,{vocab:!0},B);if(U==="@id")return f(C,I,{base:!0},B);if(U==="@type")return f(C,I,{vocab:!0,base:!0},{...B,typeExpansion:!0});const P=h(C,X,"@type");if((P==="@id"||U==="@graph")&&d(I)){const D=f(C,I,{base:!0},B);return D===null&&I.match(Q)&&B.eventHandler&&k({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:X}},options:B}),{"@id":D}}if(P==="@vocab"&&d(I))return{"@id":f(C,I,{vocab:!0,base:!0},B)};if(w(U))return I;const J={};if(P&&!["@id","@vocab","@none"].includes(P))J["@type"]=P;else if(d(I)){const D=h(C,X,"@language");D!==null&&(J["@language"]=D);const V=h(C,X,"@direction");V!==null&&(J["@direction"]=V)}return["boolean","number","string"].includes(typeof I)||(I=I.toString()),J["@value"]=I,J}function se(C,X,I,B){const U=[],P=Object.keys(X).sort();for(const J of P){const D=f(C,J,{vocab:!0},B);let V=X[J];n(V)||(V=[V]);for(const te of V){if(te===null)continue;if(!d(te))throw new r("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:X});const le={"@value":te};D!=="@none"&&(J.match(A)||B.eventHandler&&k({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:J}},options:B}),le["@language"]=J.toLowerCase()),I&&(le["@direction"]=I),U.push(le)}}return U}async function q({activeCtx:C,options:X,activeProperty:I,value:B,asGraph:U,indexKey:P,propertyIndex:J}){const D=[],V=Object.keys(B).sort(),te=P==="@type";for(let le of V){if(te){const E=h(C,le,"@context");i(E)||(C=await g({activeCtx:C,localCtx:E,propagate:!1,options:X}))}let ee,M=B[le];n(M)||(M=[M]),M=await b.expand({activeCtx:C,activeProperty:I,element:M,options:X,insideList:!1,insideIndex:!0}),ee=J?le==="@none"?"@none":K({activeCtx:C,activeProperty:P,value:le,options:X}):f(C,le,{vocab:!0},X),P==="@id"?le=f(C,le,{base:!0},X):te&&(le=ee);for(let E of M){if(U&&!p(E)&&(E={"@graph":[E]}),P==="@type")ee==="@none"||(E["@type"]?E["@type"]=[le].concat(E["@type"]):E["@type"]=[le]);else{if(c(E)&&!["@language","@type","@index"].includes(P))throw new r(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${P}".`,"jsonld.SyntaxError",{code:"invalid value object",value:E});J?ee!=="@none"&&S(E,J,ee,{propertyIsArray:!0,prependValue:!0}):ee==="@none"||P in E||(E[P]=le)}D.push(E)}}return D}s.exports=b,b.expand=async({activeCtx:C,activeProperty:X=null,element:I,options:B={},insideList:U=!1,insideIndex:P=!1,typeScopedContext:J=null})=>{if(I==null)return null;if(X==="@default"&&(B=Object.assign({},B,{isFrame:!1})),!n(I)&&!o(I))return U||X!==null&&f(C,X,{vocab:!0},B)!=="@graph"?K({activeCtx:C,activeProperty:X,value:I,options:B}):(B.eventHandler&&k({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:I}},options:B}),null);if(n(I)){let W=[];const z=h(C,X,"@container")||[];U=U||z.includes("@list");for(let Z=0;Z1?z.slice().sort():z:[z];for(const R of Z){const ne=h(J,R,"@context");i(ne)||(C=await g({activeCtx:C,localCtx:ne,options:B,propagate:!1}))}}let M={};await N({activeCtx:C,activeProperty:X,expandedActiveProperty:D,element:I,expandedParent:M,options:B,insideList:U,typeKey:ee,typeScopedContext:J}),te=Object.keys(M);let E=te.length;if("@value"in M){if("@type"in M&&("@language"in M||"@direction"in M))throw new r('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:M});let W=E-1;if("@type"in M&&(W-=1),"@index"in M&&(W-=1),"@language"in M&&(W-=1),"@direction"in M&&(W-=1),W!==0)throw new r('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:M});const z=M["@value"]===null?[]:y(M["@value"]),Z=O(M,"@type");if(!(x(C,1.1)&&Z.includes("@json")&&Z.length===1))if(z.length===0)B.eventHandler&&k({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:M}},options:B}),M=null;else{if(!z.every(R=>d(R)||l(R))&&"@language"in M)throw new r("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:M});if(!Z.every(R=>j(R)&&!(d(R)&&R.indexOf("_:")===0)||l(R)))throw new r('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:M})}}else if("@type"in M&&!n(M["@type"]))M["@type"]=[M["@type"]];else if("@set"in M||"@list"in M){if(E>1&&(E!==2||!("@index"in M)))throw new r('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:M});"@set"in M&&(M=M["@set"],te=Object.keys(M),E=te.length)}else E===1&&"@language"in M&&(B.eventHandler&&k({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:M}},options:B}),M=null);return!o(M)||B.keepFreeFloatingNodes||U||X!==null&&D!=="@graph"&&!(h(C,X,"@container")||[]).includes("@graph")||(M=L({value:M,count:E,options:B})),M}},5229:(s,e,t)=>{const{isSubjectReference:r}=t(3978),{createMergedNodeMap:n}=t(9233),o={};s.exports=o,o.flatten=l=>{const d=n(l),i=[],a=Object.keys(d).sort();for(let c=0;c{const{isKeyword:r}=t(1972),n=t(3978),o=t(7382),l=t(9263),d=t(470),i=t(2207),{createNodeMap:a,mergeNodeMapGraphs:c}=t(9233),p={};function v(y){const O={};for(const T in y)y[T]!==void 0&&(O["@"+T]=[y[T]]);return[O]}function f(y,O,T){for(let k=T.length-1;k>=0;--k){const b=T[k];if(b.graph===O&&b.subject["@id"]===y["@id"])return!0}return!1}function h(y,O,T){const k="@"+T;let b=k in y?y[k][0]:O[T];if(T==="embed"){if(b===!0)b="@once";else if(b===!1)b="@never";else if(b!=="@always"&&b!=="@never"&&b!=="@link"&&b!=="@first"&&b!=="@last"&&b!=="@once")throw new i("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:y})}return b}function w(y){if(!o.isArray(y)||y.length!==1||!o.isObject(y[0]))throw new i("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:y});if("@id"in y[0]){for(const O of l.asArray(y[0]["@id"]))if(!o.isObject(O)&&!d.isAbsolute(O)||o.isString(O)&&O.indexOf("_:")===0)throw new i("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:y})}if("@type"in y[0]){for(const O of l.asArray(y[0]["@type"]))if(!o.isObject(O)&&!d.isAbsolute(O)&&O!=="@json"||o.isString(O)&&O.indexOf("_:")===0)throw new i("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:y})}}function g(y,O,T,k){let b=!0,L=!1;for(const N in T){let K=!1;const se=l.getValues(O,N),q=l.getValues(T,N).length===0;if(N==="@id"){if(o.isEmptyObject(T["@id"][0]||{})?K=!0:T["@id"].length>=0&&(K=T["@id"].includes(se[0])),!k.requireAll)return K}else if(N==="@type"){if(b=!1,q){if(se.length>0)return!1;K=!0}else if(T["@type"].length===1&&o.isEmptyObject(T["@type"][0]))K=se.length>0;else for(const C of T["@type"])K=!(!o.isObject(C)||!("@default"in C))||K||se.some(X=>X===C);if(!k.requireAll)return K}else{if(r(N))continue;{const C=l.getValues(T,N)[0];let X=!1;if(C&&(w([C]),X="@default"in C),b=!1,se.length===0&&X)continue;if(se.length>0&&q)return!1;if(C===void 0){if(se.length>0)return!1;K=!0}else if(n.isList(C)){const I=C["@list"][0];if(n.isList(se[0])){const B=se[0]["@list"];n.isValue(I)?K=B.some(U=>S(I,U)):(n.isSubject(I)||n.isSubjectReference(I))&&(K=B.some(U=>Q(y,I,U,k)))}}else K=n.isValue(C)?se.some(I=>S(C,I)):n.isSubjectReference(C)?se.some(I=>Q(y,C,I,k)):!!o.isObject(C)&&se.length>0}}if(!K&&k.requireAll)return!1;L=L||K}return b||L}function x(y,O){const T=y.uniqueEmbeds[y.graph],k=T[O],b=k.parent,L=k.property,N={"@id":O};if(o.isArray(b)){for(let se=0;se{const q=Object.keys(T);for(const C of q)C in T&&o.isObject(T[C].parent)&&T[C].parent["@id"]===se&&(delete T[C],K(C))};K(O)}function j(y,O){if(o.isArray(y))return y.map(T=>j(T,O));if(o.isObject(y)){if("@preserve"in y)return y["@preserve"][0];if(n.isValue(y))return y;if(n.isList(y))return y["@list"]=j(y["@list"],O),y;if("@id"in y){const T=y["@id"];if(O.link.hasOwnProperty(T)){const k=O.link[T].indexOf(y);if(k!==-1)return O.link[T][k];O.link[T].push(y)}else O.link[T]=[y]}for(const T in y)T==="@id"&&O.bnodesToClear.includes(y[T])?delete y["@id"]:y[T]=j(y[T],O)}return y}function A(y,O,T){o.isObject(y)?l.addValue(y,O,T,{propertyIsArray:!0}):y.push(T)}function Q(y,O,T,k){if(!("@id"in T))return!1;const b=y.subjects[T["@id"]];return b&&g(y,b,O,k)}function S(y,O){const T=O["@value"],k=O["@type"],b=O["@language"],L=y["@value"]?o.isArray(y["@value"])?y["@value"]:[y["@value"]]:[],N=y["@type"]?o.isArray(y["@type"])?y["@type"]:[y["@type"]]:[],K=y["@language"]?o.isArray(y["@language"])?y["@language"]:[y["@language"]]:[];return L.length===0&&N.length===0&&K.length===0||!(!L.includes(T)&&!o.isEmptyObject(L[0]))&&!!(!k&&N.length===0||N.includes(k)||k&&o.isEmptyObject(N[0]))&&!!(!b&&K.length===0||K.includes(b)||b&&o.isEmptyObject(K[0]))}s.exports=p,p.frameMergedOrDefault=(y,O,T)=>{const k={options:T,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},b=new l.IdentifierIssuer("_:b");a(y,k.graphMap,"@default",b),T.merged&&(k.graphMap["@merged"]=c(k.graphMap),k.graph="@merged"),k.subjects=k.graphMap[k.graph];const L=[];return p.frame(k,Object.keys(k.subjects).sort(),O,L),T.pruneBlankNodeIdentifiers&&(T.bnodesToClear=Object.keys(k.bnodeMap).filter(N=>k.bnodeMap[N].length===1)),T.link={},j(L,T)},p.frame=(y,O,T,k,b=null)=>{w(T),T=T[0];const L=y.options,N={embed:h(T,L,"embed"),explicit:h(T,L,"explicit"),requireAll:h(T,L,"requireAll")};y.link.hasOwnProperty(y.graph)||(y.link[y.graph]={});const K=y.link[y.graph],se=function(C,X,I,B){const U={};for(const P of X){const J=C.graphMap[C.graph][P];g(C,J,I,B)&&(U[P]=J)}return U}(y,O,T,N),q=Object.keys(se).sort();for(const C of q){const X=se[C];if(b===null?y.uniqueEmbeds={[y.graph]:{}}:y.uniqueEmbeds[y.graph]=y.uniqueEmbeds[y.graph]||{},N.embed==="@link"&&C in K){A(k,b,K[C]);continue}const I={"@id":C};if(C.indexOf("_:")===0&&l.addValue(y.bnodeMap,C,I,{propertyIsArray:!0}),K[C]=I,(N.embed==="@first"||N.embed==="@last")&&y.is11)throw new i("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:T});if(y.embedded||!y.uniqueEmbeds[y.graph].hasOwnProperty(C))if(!y.embedded||N.embed!=="@never"&&!f(X,y.graph,y.subjectStack))if(!y.embedded||N.embed!="@first"&&N.embed!="@once"||!y.uniqueEmbeds[y.graph].hasOwnProperty(C)){if(N.embed==="@last"&&C in y.uniqueEmbeds[y.graph]&&x(y,C),y.uniqueEmbeds[y.graph][C]={parent:k,property:b},y.subjectStack.push({subject:X,graph:y.graph}),C in y.graphMap){let B=!1,U=null;"@graph"in T?(U=T["@graph"][0],B=!(C==="@merged"||C==="@default"),o.isObject(U)||(U={})):(B=y.graph!=="@merged",U={}),B&&p.frame({...y,graph:C,embedded:!1},Object.keys(y.graphMap[C]).sort(),[U],I,"@graph")}"@included"in T&&p.frame({...y,embedded:!1},O,T["@included"],I,"@included");for(const B of Object.keys(X).sort())if(r(B)){if(I[B]=l.clone(X[B]),B==="@type")for(const U of X["@type"])U.indexOf("_:")===0&&l.addValue(y.bnodeMap,U,I,{propertyIsArray:!0})}else if(!N.explicit||B in T)for(const U of X[B]){const P=B in T?T[B]:v(N);if(n.isList(U)){const J=T[B]&&T[B][0]&&T[B][0]["@list"]?T[B][0]["@list"]:v(N),D={"@list":[]};A(I,B,D);const V=U["@list"];for(const te of V)n.isSubjectReference(te)?p.frame({...y,embedded:!0},[te["@id"]],J,D,"@list"):A(D,"@list",l.clone(te))}else n.isSubjectReference(U)?p.frame({...y,embedded:!0},[U["@id"]],P,I,B):S(P[0],U)&&A(I,B,l.clone(U))}for(const B of Object.keys(T).sort()){if(B==="@type"){if(!o.isObject(T[B][0])||!("@default"in T[B][0]))continue}else if(r(B))continue;const U=T[B][0]||{};if(!h(U,L,"omitDefault")&&!(B in I)){let P="@null";"@default"in U&&(P=l.clone(U["@default"])),o.isArray(P)||(P=[P]),I[B]=[{"@preserve":P}]}}for(const B of Object.keys(T["@reverse"]||{}).sort()){const U=T["@reverse"][B];for(const P of Object.keys(y.subjects))l.getValues(y.subjects[P],B).some(J=>J["@id"]===C)&&(I["@reverse"]=I["@reverse"]||{},l.addValue(I["@reverse"],B,[],{propertyIsArray:!0}),p.frame({...y,embedded:!0},[P],U,I["@reverse"][B],b))}A(k,b,I),y.subjectStack.pop()}else A(k,b,I);else A(k,b,I)}},p.cleanupNull=(y,O)=>{if(o.isArray(y))return y.map(T=>p.cleanupNull(T,O)).filter(T=>T);if(y==="@null")return null;if(o.isObject(y)){if("@id"in y){const T=y["@id"];if(O.link.hasOwnProperty(T)){const k=O.link[T].indexOf(y);if(k!==-1)return O.link[T][k];O.link[T].push(y)}else O.link[T]=[y]}for(const T in y)y[T]=p.cleanupNull(y[T],O)}return y}},3947:(s,e,t)=>{const r=t(2207),n=t(3978),o=t(7382),{REGEX_BCP47:l,addValue:d}=t(9263),{handleEvent:i}=t(2246),{RDF_LIST:a,RDF_FIRST:c,RDF_REST:p,RDF_NIL:v,RDF_TYPE:f,RDF_JSON_LITERAL:h,XSD_BOOLEAN:w,XSD_DOUBLE:g,XSD_INTEGER:x,XSD_STRING:j}=t(9378),A={};function Q(S,y,O,T){if(S.termType.endsWith("Node"))return{"@id":S.value};const k={"@value":S.value};if(S.language)S.language.match(l)||T.eventHandler&&i({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:S.language}},options:T}),k["@language"]=S.language;else{let b=S.datatype.value;if(b||(b=j),b===h){b="@json";try{k["@value"]=JSON.parse(k["@value"])}catch(L){throw new r("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:k["@value"],cause:L})}}if(y){if(b===w)k["@value"]==="true"?k["@value"]=!0:k["@value"]==="false"&&(k["@value"]=!1);else if(o.isNumeric(k["@value"]))if(b===x){const L=parseInt(k["@value"],10);L.toFixed(0)===k["@value"]&&(k["@value"]=L)}else b===g&&(k["@value"]=parseFloat(k["@value"]));[w,x,g,j].includes(b)||(k["@type"]=b)}else if(O==="i18n-datatype"&&b.startsWith("https://www.w3.org/ns/i18n#")){const[,L,N]=b.split(/[#_]/);L.length>0&&(k["@language"]=L,L.match(l)||T.eventHandler&&i({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:L}},options:T})),k["@direction"]=N}else b!==j&&(k["@type"]=b)}return k}s.exports=A,A.fromRDF=async(S,y)=>{const{useRdfType:O=!1,useNativeTypes:T=!1,rdfDirection:k=null}=y,b={},L={"@default":b},N={};if(k){if(k==="compound-literal")throw new r("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:k});if(k!=="i18n-datatype")throw new r("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:k})}for(const q of S){const C=q.graph.termType==="DefaultGraph"?"@default":q.graph.value;C in L||(L[C]={}),C==="@default"||C in b||(b[C]={"@id":C});const X=L[C],I=q.subject.value,B=q.predicate.value,U=q.object;I in X||(X[I]={"@id":I});const P=X[I],J=U.termType.endsWith("Node");if(J&&!(U.value in X)&&(X[U.value]={"@id":U.value}),B===f&&!O&&J){d(P,"@type",U.value,{propertyIsArray:!0});continue}const D=Q(U,T,k,y);if(d(P,B,D,{propertyIsArray:!0}),J)if(U.value===v){const V=X[U.value];"usages"in V||(V.usages=[]),V.usages.push({node:P,property:B,value:D})}else U.value in N?N[U.value]=!1:N[U.value]={node:P,property:B,value:D}}for(const q in L){const C=L[q];if(!(v in C))continue;const X=C[v];if(X.usages){for(let I of X.usages){let B=I.node,U=I.property,P=I.value;const J=[],D=[];let V=Object.keys(B).length;for(;U===p&&o.isObject(N[B["@id"]])&&o.isArray(B[c])&&B[c].length===1&&o.isArray(B[p])&&B[p].length===1&&(V===3||V===4&&o.isArray(B["@type"])&&B["@type"].length===1&&B["@type"][0]===a)&&(J.push(B[c][0]),D.push(B["@id"]),I=N[B["@id"]],B=I.node,U=I.property,P=I.value,V=Object.keys(B).length,n.isBlankNode(B)););delete P["@id"],P["@list"]=J.reverse();for(const te of D)delete C[te]}delete X.usages}}const K=[],se=Object.keys(b).sort();for(const q of se){const C=b[q];if(q in L){const X=C["@graph"]=[],I=L[q],B=Object.keys(I).sort();for(const U of B){const P=I[U];n.isSubjectReference(P)||X.push(P)}}n.isSubjectReference(C)||K.push(C)}return K}},3978:(s,e,t)=>{const r=t(7382),n={};s.exports=n,n.isSubject=o=>!(!r.isObject(o)||"@value"in o||"@set"in o||"@list"in o)&&(Object.keys(o).length>1||!("@id"in o)),n.isSubjectReference=o=>r.isObject(o)&&Object.keys(o).length===1&&"@id"in o,n.isValue=o=>r.isObject(o)&&"@value"in o,n.isList=o=>r.isObject(o)&&"@list"in o,n.isGraph=o=>r.isObject(o)&&"@graph"in o&&Object.keys(o).filter(l=>l!=="@id"&&l!=="@index").length===1,n.isSimpleGraph=o=>n.isGraph(o)&&!("@id"in o),n.isBlankNode=o=>{if(r.isObject(o)){if("@id"in o){const l=o["@id"];return!r.isString(l)||l.indexOf("_:")===0}return Object.keys(o).length===0||!("@value"in o||"@set"in o||"@list"in o)}return!1}},4841:(s,e,t)=>{const r=t(989),n=t(701),o=t(9263),l=t(7034),d=o.IdentifierIssuer,i=t(2207),a=t(9749),c=t(8229),{expand:p}=t(4019),{flatten:v}=t(5229),{fromRDF:f}=t(3947),{toRDF:h}=t(9180),{frameMergedOrDefault:w,cleanupNull:g}=t(7946),{isArray:x,isObject:j,isString:A}=t(7382),{isSubjectReference:Q}=t(3978),{expandIri:S,getInitialContext:y,process:O,processingMode:T}=t(1972),{compact:k,compactIri:b}=t(1058),{createNodeMap:L,createMergedNodeMap:N,mergeNodeMaps:K}=t(9233),{logEventHandler:se,logWarningEventHandler:q,safeEventHandler:C,setDefaultEventHandler:X,setupEventHandler:I,strictEventHandler:B,unhandledEventHandler:U}=t(2246),P=function(D){const V={},te=new a({max:100});function le(ee,{documentLoader:M=D.documentLoader,...E}){if(ee&&"compactionMap"in ee)throw new i('"compactionMap" not supported.',"jsonld.OptionsError");if(ee&&"expansionMap"in ee)throw new i('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:M},E,ee,{eventHandler:I({options:ee})})}return D.compact=async function(ee,M,E){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(M===null)throw new i("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(ee===null)return null;let W;(E=le(E,{base:A(ee)?ee:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new d("_:b"),contextResolver:new l({sharedCache:te})})).link&&(E.skipExpansion=!0),E.compactToRelative||delete E.base,W=E.skipExpansion?ee:await D.expand(ee,E);const z=await D.processContext(y(E),M,E);let Z=await k({activeCtx:z,element:W,options:E});E.compactArrays&&!E.graph&&x(Z)?Z.length===1?Z=Z[0]:Z.length===0&&(Z={}):E.graph&&j(Z)&&(Z=[Z]),j(M)&&"@context"in M&&(M=M["@context"]),M=o.clone(M),x(M)||(M=[M]);const R=M;M=[];for(let Y=0;Y0)&&M.push(R[Y]);const ne=M.length>0;if(M.length===1&&(M=M[0]),x(Z)){const Y=b({activeCtx:z,iri:"@graph",relativeTo:{vocab:!0}}),ie=Z;Z={},ne&&(Z["@context"]=M),Z[Y]=ie}else if(j(Z)&&ne){const Y=Z;Z={"@context":M};for(const ie in Y)Z[ie]=Y[ie]}return Z},D.expand=async function(ee,M){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");const E={},W=[];if("expandContext"in(M=le(M,{keepFreeFloatingNodes:!1,contextResolver:new l({sharedCache:te})}))){const ne=o.clone(M.expandContext);j(ne)&&"@context"in ne?E.expandContext=ne:E.expandContext={"@context":ne},W.push(E.expandContext)}let z;if(A(ee)){const ne=await D.get(ee,M);z=ne.documentUrl,E.input=ne.document,ne.contextUrl&&(E.remoteContext={"@context":ne.contextUrl},W.push(E.remoteContext))}else E.input=o.clone(ee);"base"in M||(M.base=z||"");let Z=y(M);for(const ne of W)Z=await O({activeCtx:Z,localCtx:ne,options:M});let R=await p({activeCtx:Z,element:E.input,options:M});return j(R)&&"@graph"in R&&Object.keys(R).length===1?R=R["@graph"]:R===null&&(R=[]),x(R)||(R=[R]),R},D.flatten=async function(ee,M,E){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");M=typeof M=="function"?null:M||null,E=le(E,{base:A(ee)?ee:"",contextResolver:new l({sharedCache:te})});const W=await D.expand(ee,E),z=v(W);return M===null?z:(E.graph=!0,E.skipExpansion=!0,await D.compact(z,M,E))},D.frame=async function(ee,M,E){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(E=le(E,{base:A(ee)?ee:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new l({sharedCache:te})}),A(M)){const u=await D.get(M,E);if(M=u.document,u.contextUrl){let m=M["@context"];m?x(m)?m.push(u.contextUrl):m=[m,u.contextUrl]:m=u.contextUrl,M["@context"]=m}}const W=M&&M["@context"]||{},z=await D.processContext(y(E),W,E);E.hasOwnProperty("omitGraph")||(E.omitGraph=T(z,1.1)),E.hasOwnProperty("pruneBlankNodeIdentifiers")||(E.pruneBlankNodeIdentifiers=T(z,1.1));const Z=await D.expand(ee,E),R={...E};R.isFrame=!0,R.keepFreeFloatingNodes=!0;const ne=await D.expand(M,R),Y=Object.keys(M).map(u=>S(z,u,{vocab:!0}));R.merged=!Y.includes("@graph"),R.is11=T(z,1.1);const ie=w(Z,ne,R);R.graph=!E.omitGraph,R.skipExpansion=!0,R.link={},R.framing=!0;let ae=await D.compact(ie,W,R);return R.link={},ae=g(ae,R),ae},D.link=async function(ee,M,E){const W={};return M&&(W["@context"]=M),W["@embed"]="@link",D.frame(ee,W,E)},D.normalize=D.canonize=async function(ee,M){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(M=le(M,{base:A(ee)?ee:null,algorithm:"URDNA2015",skipExpansion:!1,safe:!0,contextResolver:new l({sharedCache:te})}))){if(M.inputFormat!=="application/n-quads"&&M.inputFormat!=="application/nquads")throw new i("Unknown canonicalization input format.","jsonld.CanonizeError");const z=c.parse(ee);return r.canonize(z,M)}const E={...M};delete E.format,E.produceGeneralizedRdf=!1;const W=await D.toRDF(ee,E);return r.canonize(W,M)},D.fromRDF=async function(ee,M){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");M=le(M,{format:A(ee)?"application/n-quads":void 0});const{format:E}=M;let{rdfParser:W}=M;if(E){if(W=W||V[E],!W)throw new i("Unknown input format.","jsonld.UnknownFormat",{format:E})}else W=()=>ee;const z=await W(ee);return f(z,M)},D.toRDF=async function(ee,M){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let E;E=(M=le(M,{base:A(ee)?ee:"",skipExpansion:!1,contextResolver:new l({sharedCache:te})})).skipExpansion?ee:await D.expand(ee,M);const W=h(E,M);if(M.format){if(M.format==="application/n-quads"||M.format==="application/nquads")return c.serialize(W);throw new i("Unknown output format.","jsonld.UnknownFormat",{format:M.format})}return W},D.createNodeMap=async function(ee,M){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");M=le(M,{base:A(ee)?ee:"",contextResolver:new l({sharedCache:te})});const E=await D.expand(ee,M);return N(E,M)},D.merge=async function(ee,M,E){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!x(ee))throw new TypeError('Could not merge, "docs" must be an array.');M=typeof M=="function"?null:M||null,E=le(E,{contextResolver:new l({sharedCache:te})});const W=await Promise.all(ee.map(ae=>{const u={...E};return D.expand(ae,u)}));let z=!0;"mergeNodes"in E&&(z=E.mergeNodes);const Z=E.issuer||new d("_:b"),R={"@default":{}};for(let ae=0;aeD._documentLoader,set:ee=>D._documentLoader=ee}),D.documentLoader=async ee=>{throw new i("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:ee})},D.get=async function(ee,M){let E;E=typeof M.documentLoader=="function"?M.documentLoader:D.documentLoader;const W=await E(ee);try{if(!W.document)throw new i("No remote document found at the given URL.","jsonld.NullRemoteDocument");A(W.document)&&(W.document=JSON.parse(W.document))}catch(z){throw new i("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:z,remoteDoc:W})}return W},D.processContext=async function(ee,M,E){return E=le(E,{base:"",contextResolver:new l({sharedCache:te})}),M===null?y(E):(M=o.clone(M),j(M)&&"@context"in M||(M={"@context":M}),O({activeCtx:ee,localCtx:M,options:E}))},D.getContextValue=t(1972).getContextValue,D.documentLoaders={},D.useDocumentLoader=function(ee){if(!(ee in D.documentLoaders))throw new i('Unknown document loader type: "'+ee+'"',"jsonld.UnknownDocumentLoader",{type:ee});D.documentLoader=D.documentLoaders[ee].apply(D,Array.prototype.slice.call(arguments,1))},D.registerRDFParser=function(ee,M){V[ee]=M},D.unregisterRDFParser=function(ee){delete V[ee]},D.registerRDFParser("application/n-quads",c.parse),D.registerRDFParser("application/nquads",c.parse),D.url=t(470),D.logEventHandler=se,D.logWarningEventHandler=q,D.safeEventHandler=C,D.setDefaultEventHandler=X,D.strictEventHandler=B,D.unhandledEventHandler=U,D.util=o,Object.assign(D,o),D.promises=D,D.RequestQueue=t(3743),D.JsonLdProcessor=t(5445)(D),n.setupGlobals(D),n.setupDocumentLoaders(D),D},J=function(){return P(function(){return J()})};P(J),s.exports=J},9233:(s,e,t)=>{const{isKeyword:r}=t(1972),n=t(3978),o=t(7382),l=t(9263),d=t(2207),i={};s.exports=i,i.createMergedNodeMap=(a,c)=>{const p=(c=c||{}).issuer||new l.IdentifierIssuer("_:b"),v={"@default":{}};return i.createNodeMap(a,v,"@default",p),i.mergeNodeMaps(v)},i.createNodeMap=(a,c,p,v,f,h)=>{if(o.isArray(a)){for(const j of a)i.createNodeMap(j,c,p,v,void 0,h);return}if(!o.isObject(a))return void(h&&h.push(a));if(n.isValue(a)){if("@type"in a){let j=a["@type"];j.indexOf("_:")===0&&(a["@type"]=j=v.getId(j))}return void(h&&h.push(a))}if(h&&n.isList(a)){const j=[];return i.createNodeMap(a["@list"],c,p,v,f,j),void h.push({"@list":j})}if("@type"in a){const j=a["@type"];for(const A of j)A.indexOf("_:")===0&&v.getId(A)}o.isUndefined(f)&&(f=n.isBlankNode(a)?v.getId(a["@id"]):a["@id"]),h&&h.push({"@id":f});const w=c[p],g=w[f]=w[f]||{};g["@id"]=f;const x=Object.keys(a).sort();for(let j of x){if(j==="@id")continue;if(j==="@reverse"){const Q={"@id":f},S=a["@reverse"];for(const y in S){const O=S[y];for(const T of O){let k=T["@id"];n.isBlankNode(T)&&(k=v.getId(k)),i.createNodeMap(T,c,p,v,k),l.addValue(w[k],y,Q,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if(j==="@graph"){f in c||(c[f]={}),i.createNodeMap(a[j],c,f,v);continue}if(j==="@included"){i.createNodeMap(a[j],c,p,v);continue}if(j!=="@type"&&r(j)){if(j==="@index"&&j in g&&(a[j]!==g[j]||a[j]["@id"]!==g[j]["@id"]))throw new d("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:g});g[j]=a[j];continue}const A=a[j];if(j.indexOf("_:")===0&&(j=v.getId(j)),A.length!==0)for(let Q of A)if(j==="@type"&&(Q=Q.indexOf("_:")===0?v.getId(Q):Q),n.isSubject(Q)||n.isSubjectReference(Q)){if("@id"in Q&&!Q["@id"])continue;const S=n.isBlankNode(Q)?v.getId(Q["@id"]):Q["@id"];l.addValue(g,j,{"@id":S},{propertyIsArray:!0,allowDuplicate:!1}),i.createNodeMap(Q,c,p,v,S)}else if(n.isValue(Q))l.addValue(g,j,Q,{propertyIsArray:!0,allowDuplicate:!1});else if(n.isList(Q)){const S=[];i.createNodeMap(Q["@list"],c,p,v,f,S),Q={"@list":S},l.addValue(g,j,Q,{propertyIsArray:!0,allowDuplicate:!1})}else i.createNodeMap(Q,c,p,v,f),l.addValue(g,j,Q,{propertyIsArray:!0,allowDuplicate:!1});else l.addValue(g,j,[],{propertyIsArray:!0})}},i.mergeNodeMapGraphs=a=>{const c={};for(const p of Object.keys(a).sort())for(const v of Object.keys(a[p]).sort()){const f=a[p][v];v in c||(c[v]={"@id":v});const h=c[v];for(const w of Object.keys(f).sort())if(r(w)&&w!=="@type")h[w]=l.clone(f[w]);else for(const g of f[w])l.addValue(h,w,l.clone(g),{propertyIsArray:!0,allowDuplicate:!1})}return c},i.mergeNodeMaps=a=>{const c=a["@default"],p=Object.keys(a).sort();for(const v of p){if(v==="@default")continue;const f=a[v];let h=c[v];h?"@graph"in h||(h["@graph"]=[]):c[v]=h={"@id":v,"@graph":[]};const w=h["@graph"];for(const g of Object.keys(f).sort()){const x=f[g];n.isSubjectReference(x)||w.push(x)}}return c}},701:(s,e,t)=>{const r=t(6957),n={};s.exports=n,n.setupDocumentLoaders=function(o){typeof XMLHttpRequest<"u"&&(o.documentLoaders.xhr=r,o.useDocumentLoader("xhr"))},n.setupGlobals=function(o){globalThis.JsonLdProcessor===void 0&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:o.JsonLdProcessor})}},9180:(s,e,t)=>{const{createNodeMap:r}=t(9233),{isKeyword:n}=t(1972),o=t(3978),l=t(2341),d=t(2207),i=t(7382),a=t(9263),{handleEvent:c}=t(2246),{RDF_FIRST:p,RDF_REST:v,RDF_NIL:f,RDF_TYPE:h,RDF_JSON_LITERAL:w,RDF_LANGSTRING:g,XSD_BOOLEAN:x,XSD_DOUBLE:j,XSD_INTEGER:A,XSD_STRING:Q}=t(9378),{isAbsolute:S}=t(470),y={};function O(k,b,L,N,K){const se=Object.keys(b).sort();for(const q of se){const C=b[q],X=Object.keys(C).sort();for(let I of X){const B=C[I];if(I==="@type")I=h;else if(n(I))continue;for(const U of B){const P={termType:q.startsWith("_:")?"BlankNode":"NamedNode",value:q};if(!S(q)){K.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:q}},options:K});continue}const J={termType:I.startsWith("_:")?"BlankNode":"NamedNode",value:I};if(!S(I)){K.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:I}},options:K});continue}if(J.termType==="BlankNode"&&!K.produceGeneralizedRdf){K.eventHandler&&c({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:N.getOldIds().find(V=>N.getId(V)===I)}},options:K});continue}const D=T(U,N,k,L,K.rdfDirection,K);D&&k.push({subject:P,predicate:J,object:D,graph:L})}}}}function T(k,b,L,N,K,se){const q={};if(o.isValue(k)){q.termType="Literal",q.value=void 0,q.datatype={termType:"NamedNode"};let C=k["@value"];const X=k["@type"]||null;if(X==="@json")q.value=l(C),q.datatype.value=w;else if(i.isBoolean(C))q.value=C.toString(),q.datatype.value=X||x;else if(i.isDouble(C)||X===j)i.isDouble(C)||(C=parseFloat(C)),q.value=C.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),q.datatype.value=X||j;else if(i.isNumber(C))q.value=C.toFixed(0),q.datatype.value=X||A;else if("@direction"in k&&K==="i18n-datatype"){const I=`https://www.w3.org/ns/i18n#${(k["@language"]||"").toLowerCase()}_${k["@direction"]}`;q.datatype.value=I,q.value=C}else{if("@direction"in k&&K==="compound-literal")throw new d("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:K});if("@direction"in k&&K)throw new d("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:K});"@language"in k?("@direction"in k&&!K&&se.eventHandler&&c({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:q.value}},options:se}),q.value=C,q.datatype.value=X||g,q.language=k["@language"]):("@direction"in k&&!K&&se.eventHandler&&c({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:q.value}},options:se}),q.value=C,q.datatype.value=X||Q)}}else if(o.isList(k)){const C=function(X,I,B,U,P,J){const D={termType:"NamedNode",value:p},V={termType:"NamedNode",value:v},te={termType:"NamedNode",value:f},le=X.pop(),ee=le?{termType:"BlankNode",value:I.getId()}:te;let M=ee;for(const E of X){const W=T(E,I,B,U,P,J),z={termType:"BlankNode",value:I.getId()};B.push({subject:M,predicate:D,object:W,graph:U}),B.push({subject:M,predicate:V,object:z,graph:U}),M=z}if(le){const E=T(le,I,B,U,P,J);B.push({subject:M,predicate:D,object:E,graph:U}),B.push({subject:M,predicate:V,object:te,graph:U})}return ee}(k["@list"],b,L,N,K,se);q.termType=C.termType,q.value=C.value}else{const C=i.isObject(k)?k["@id"]:k;q.termType=C.startsWith("_:")?"BlankNode":"NamedNode",q.value=C}return q.termType!=="NamedNode"||S(q.value)?q:(se.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:q.value}},options:se}),null)}s.exports=y,y.toRDF=(k,b)=>{const L=new a.IdentifierIssuer("_:b"),N={"@default":{}};r(k,N,"@default",L);const K=[],se=Object.keys(N).sort();for(const q of se){let C;if(q==="@default")C={termType:"DefaultGraph",value:""};else{if(!S(q)){b.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:q}},options:b});continue}C=q.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},C.value=q}O(K,N[q],C,L,b)}return K}},7382:s=>{const e={};s.exports=e,e.isArray=Array.isArray,e.isBoolean=t=>typeof t=="boolean"||Object.prototype.toString.call(t)==="[object Boolean]",e.isDouble=t=>e.isNumber(t)&&(String(t).indexOf(".")!==-1||Math.abs(t)>=1e21),e.isEmptyObject=t=>e.isObject(t)&&Object.keys(t).length===0,e.isNumber=t=>typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]",e.isNumeric=t=>!isNaN(parseFloat(t))&&isFinite(t),e.isObject=t=>Object.prototype.toString.call(t)==="[object Object]",e.isString=t=>typeof t=="string"||Object.prototype.toString.call(t)==="[object String]",e.isUndefined=t=>t===void 0},470:(s,e,t)=>{const r=t(7382),n={};s.exports=n,n.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*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},n.parse=(l,d)=>{const i={},a=n.parsers[d||"full"],c=a.regex.exec(l);let p=a.keys.length;for(;p--;)i[a.keys[p]]=c[p]===void 0?null:c[p];return(i.scheme==="https"&&i.port==="443"||i.scheme==="http"&&i.port==="80")&&(i.href=i.href.replace(":"+i.port,""),i.authority=i.authority.replace(":"+i.port,""),i.port=null),i.normalizedPath=n.removeDotSegments(i.path),i},n.prependBase=(l,d)=>{if(l===null||n.isAbsolute(d))return d;l&&!r.isString(l)||(l=n.parse(l||""));const i=n.parse(d),a={protocol:l.protocol||""};if(i.authority!==null)a.authority=i.authority,a.path=i.path,a.query=i.query;else if(a.authority=l.authority,i.path==="")a.path=l.path,i.query!==null?a.query=i.query:a.query=l.query;else{if(i.path.indexOf("/")===0)a.path=i.path;else{let p=l.path;p=p.substr(0,p.lastIndexOf("/")+1),(p.length>0||l.authority)&&p.substr(-1)!=="/"&&(p+="/"),p+=i.path,a.path=p}a.query=i.query}i.path!==""&&(a.path=n.removeDotSegments(a.path));let c=a.protocol;return a.authority!==null&&(c+="//"+a.authority),c+=a.path,a.query!==null&&(c+="?"+a.query),i.fragment!==null&&(c+="#"+i.fragment),c===""&&(c="./"),c},n.removeBase=(l,d)=>{if(l===null)return d;l&&!r.isString(l)||(l=n.parse(l||""));let i="";if(l.href!==""?i+=(l.protocol||"")+"//"+(l.authority||""):d.indexOf("//")&&(i+="//"),d.indexOf(i)!==0)return d;const a=n.parse(d.substr(i.length)),c=l.normalizedPath.split("/"),p=a.normalizedPath.split("/"),v=a.fragment||a.query?0:1;for(;c.length>0&&p.length>v&&c[0]===p[0];)c.shift(),p.shift();let f="";if(c.length>0){c.pop();for(let h=0;h{if(l.length===0)return"";const d=l.split("/"),i=[];for(;d.length>0;){const a=d.shift(),c=d.length===0;a!=="."?a!==".."?i.push(a):(i.pop(),c&&i.push("")):c&&i.push("")}return l[0]==="/"&&i.length>0&&i[0]!==""&&i.unshift(""),i.length===1&&i[0]===""?"/":i.join("/")};const o=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;n.isAbsolute=l=>r.isString(l)&&o.test(l),n.isRelative=l=>r.isString(l)},9263:(s,e,t)=>{const r=t(3978),n=t(7382),o=t(989).IdentifierIssuer,l=t(2207),d=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,i=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,a=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,c="application/ld+json, application/json",p={};function v(f,h){if(n.isArray(h))for(let w=0;w{if(Object.keys(f).some(h=>h.toLowerCase()==="accept"))throw new RangeError('Accept header may not be specified; only "'+c+'" is supported.');return Object.assign({Accept:c},f)},p.parseLinkHeader=f=>{const h={},w=f.match(d);for(let g=0;g{if(!(n.isString(f)||n.isArray(f)&&f.every(w=>n.isString(w)))){if(h&&n.isObject(f))switch(Object.keys(f).length){case 0:return;case 1:if("@default"in f&&p.asArray(f["@default"]).every(w=>n.isString(w)))return}throw new l('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:f})}},p.hasProperty=(f,h)=>{if(f.hasOwnProperty(h)){const w=f[h];return!n.isArray(w)||w.length>0}return!1},p.hasValue=(f,h,w)=>{if(p.hasProperty(f,h)){let g=f[h];const x=r.isList(g);if(n.isArray(g)||x){x&&(g=g["@list"]);for(let j=0;j{if("propertyIsArray"in(g=g||{})||(g.propertyIsArray=!1),"valueIsArray"in g||(g.valueIsArray=!1),"allowDuplicate"in g||(g.allowDuplicate=!0),"prependValue"in g||(g.prependValue=!1),g.valueIsArray)f[h]=w;else if(n.isArray(w)){w.length===0&&g.propertyIsArray&&!f.hasOwnProperty(h)&&(f[h]=[]),g.prependValue&&(w=w.concat(f[h]),f[h]=[]);for(let x=0;x[].concat(f[h]||[]),p.removeProperty=(f,h)=>{delete f[h]},p.removeValue=(f,h,w,g)=>{"propertyIsArray"in(g=g||{})||(g.propertyIsArray=!1);const x=p.getValues(f,h).filter(j=>!p.compareValues(j,w));x.length===0?p.removeProperty(f,h):x.length!==1||g.propertyIsArray?f[h]=x:f[h]=x[0]},p.relabelBlankNodes=(f,h)=>v((h=h||{}).issuer||new o("_:b"),f),p.compareValues=(f,h)=>f===h||!(!r.isValue(f)||!r.isValue(h)||f["@value"]!==h["@value"]||f["@type"]!==h["@type"]||f["@language"]!==h["@language"]||f["@index"]!==h["@index"])||!!(n.isObject(f)&&"@id"in f&&n.isObject(h)&&"@id"in h)&&f["@id"]===h["@id"],p.compareShortestLeast=(f,h)=>f.length{var r=t(9325).Symbol;s.exports=r},2552:(s,e,t)=>{var r=t(1873),n=t(659),o=t(9350),l=r?r.toStringTag:void 0;s.exports=function(d){return d==null?d===void 0?"[object Undefined]":"[object Null]":l&&l in Object(d)?n(d):o(d)}},4128:(s,e,t)=>{var r=t(1800),n=/^\s+/;s.exports=function(o){return o&&o.slice(0,r(o)+1).replace(n,"")}},4840:(s,e,t)=>{var r=typeof t.g=="object"&&t.g&&t.g.Object===Object&&t.g;s.exports=r},659:(s,e,t)=>{var r=t(1873),n=Object.prototype,o=n.hasOwnProperty,l=n.toString,d=r?r.toStringTag:void 0;s.exports=function(i){var a=o.call(i,d),c=i[d];try{i[d]=void 0;var p=!0}catch{}var v=l.call(i);return p&&(a?i[d]=c:delete i[d]),v}},9350:s=>{var e=Object.prototype.toString;s.exports=function(t){return e.call(t)}},9325:(s,e,t)=>{var r=t(4840),n=typeof self=="object"&&self&&self.Object===Object&&self,o=r||n||Function("return this")();s.exports=o},1800:s=>{var e=/\s/;s.exports=function(t){for(var r=t.length;r--&&e.test(t.charAt(r)););return r}},2177:(s,e,t)=>{var r=t(1489);s.exports=function(n,o){var l;if(typeof o!="function")throw new TypeError("Expected a function");return n=r(n),function(){return--n>0&&(l=o.apply(this,arguments)),n<=1&&(o=void 0),l}}},3805:s=>{s.exports=function(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}},346:s=>{s.exports=function(e){return e!=null&&typeof e=="object"}},4394:(s,e,t)=>{var r=t(2552),n=t(346);s.exports=function(o){return typeof o=="symbol"||n(o)&&r(o)=="[object Symbol]"}},8059:(s,e,t)=>{var r=t(2177);s.exports=function(n){return r(2,n)}},7400:(s,e,t)=>{var r=t(9374),n=1/0;s.exports=function(o){return o?(o=r(o))===n||o===-1/0?17976931348623157e292*(o<0?-1:1):o==o?o:0:o===0?o:0}},1489:(s,e,t)=>{var r=t(7400);s.exports=function(n){var o=r(n),l=o%1;return o==o?l?o-l:o:0}},9374:(s,e,t)=>{var r=t(4128),n=t(3805),o=t(4394),l=/^[-+]0x[0-9a-f]+$/i,d=/^0b[01]+$/i,i=/^0o[0-7]+$/i,a=parseInt;s.exports=function(c){if(typeof c=="number")return c;if(o(c))return NaN;if(n(c)){var p=typeof c.valueOf=="function"?c.valueOf():c;c=n(p)?p+"":p}if(typeof c!="string")return c===0?c:+c;c=r(c);var v=d.test(c);return v||i.test(c)?a(c.slice(2),v?2:8):l.test(c)?NaN:+c}},9749:(s,e,t)=>{const r=t(8799),n=Symbol("max"),o=Symbol("length"),l=Symbol("lengthCalculator"),d=Symbol("allowStale"),i=Symbol("maxAge"),a=Symbol("dispose"),c=Symbol("noDisposeOnSet"),p=Symbol("lruList"),v=Symbol("cache"),f=Symbol("updateAgeOnGet"),h=()=>1,w=(S,y,O)=>{const T=S[v].get(y);if(T){const k=T.value;if(g(S,k)){if(j(S,T),!S[d])return}else O&&(S[f]&&(T.value.now=Date.now()),S[p].unshiftNode(T));return k.value}},g=(S,y)=>{if(!y||!y.maxAge&&!S[i])return!1;const O=Date.now()-y.now;return y.maxAge?O>y.maxAge:S[i]&&O>S[i]},x=S=>{if(S[o]>S[n])for(let y=S[p].tail;S[o]>S[n]&&y!==null;){const O=y.prev;j(S,y),y=O}},j=(S,y)=>{if(y){const O=y.value;S[a]&&S[a](O.key,O.value),S[o]-=O.length,S[v].delete(O.key),S[p].removeNode(y)}};class A{constructor(y,O,T,k,b){this.key=y,this.value=O,this.length=T,this.now=k,this.maxAge=b||0}}const Q=(S,y,O,T)=>{let k=O.value;g(S,k)&&(j(S,O),S[d]||(k=void 0)),k&&y.call(T,k.value,k.key,S)};s.exports=class{constructor(S){if(typeof S=="number"&&(S={max:S}),S||(S={}),S.max&&(typeof S.max!="number"||S.max<0))throw new TypeError("max must be a non-negative number");this[n]=S.max||1/0;const y=S.length||h;if(this[l]=typeof y!="function"?h:y,this[d]=S.stale||!1,S.maxAge&&typeof S.maxAge!="number")throw new TypeError("maxAge must be a number");this[i]=S.maxAge||0,this[a]=S.dispose,this[c]=S.noDisposeOnSet||!1,this[f]=S.updateAgeOnGet||!1,this.reset()}set max(S){if(typeof S!="number"||S<0)throw new TypeError("max must be a non-negative number");this[n]=S||1/0,x(this)}get max(){return this[n]}set allowStale(S){this[d]=!!S}get allowStale(){return this[d]}set maxAge(S){if(typeof S!="number")throw new TypeError("maxAge must be a non-negative number");this[i]=S,x(this)}get maxAge(){return this[i]}set lengthCalculator(S){typeof S!="function"&&(S=h),S!==this[l]&&(this[l]=S,this[o]=0,this[p].forEach(y=>{y.length=this[l](y.value,y.key),this[o]+=y.length})),x(this)}get lengthCalculator(){return this[l]}get length(){return this[o]}get itemCount(){return this[p].length}rforEach(S,y){y=y||this;for(let O=this[p].tail;O!==null;){const T=O.prev;Q(this,S,O,y),O=T}}forEach(S,y){y=y||this;for(let O=this[p].head;O!==null;){const T=O.next;Q(this,S,O,y),O=T}}keys(){return this[p].toArray().map(S=>S.key)}values(){return this[p].toArray().map(S=>S.value)}reset(){this[a]&&this[p]&&this[p].length&&this[p].forEach(S=>this[a](S.key,S.value)),this[v]=new Map,this[p]=new r,this[o]=0}dump(){return this[p].map(S=>!g(this,S)&&{k:S.key,v:S.value,e:S.now+(S.maxAge||0)}).toArray().filter(S=>S)}dumpLru(){return this[p]}set(S,y,O){if((O=O||this[i])&&typeof O!="number")throw new TypeError("maxAge must be a number");const T=O?Date.now():0,k=this[l](y,S);if(this[v].has(S)){if(k>this[n])return j(this,this[v].get(S)),!1;const L=this[v].get(S).value;return this[a]&&(this[c]||this[a](S,L.value)),L.now=T,L.maxAge=O,L.value=y,this[o]+=k-L.length,L.length=k,this.get(S),x(this),!0}const b=new A(S,y,k,T,O);return b.length>this[n]?(this[a]&&this[a](S,y),!1):(this[o]+=b.length,this[p].unshift(b),this[v].set(S,this[p].head),x(this),!0)}has(S){if(!this[v].has(S))return!1;const y=this[v].get(S).value;return!g(this,y)}get(S){return w(this,S,!0)}peek(S){return w(this,S,!1)}pop(){const S=this[p].tail;return S?(j(this,S),S.value):null}del(S){j(this,this[v].get(S))}load(S){this.reset();const y=Date.now();for(let O=S.length-1;O>=0;O--){const T=S[O],k=T.e||0;if(k===0)this.set(T.k,T.v);else{const b=k-y;b>0&&this.set(T.k,T.v,b)}}}prune(){this[v].forEach((S,y)=>w(this,y,!1))}}},5606:s=>{var e,t,r=s.exports={};function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function l(w){if(e===setTimeout)return setTimeout(w,0);if((e===n||!e)&&setTimeout)return e=setTimeout,setTimeout(w,0);try{return e(w,0)}catch{try{return e.call(null,w,0)}catch{return e.call(this,w,0)}}}(function(){try{e=typeof setTimeout=="function"?setTimeout:n}catch{e=n}try{t=typeof clearTimeout=="function"?clearTimeout:o}catch{t=o}})();var d,i=[],a=!1,c=-1;function p(){a&&d&&(a=!1,d.length?i=d.concat(i):c=-1,i.length&&v())}function v(){if(!a){var w=l(p);a=!0;for(var g=i.length;g;){for(d=i,i=[];++c1)for(var x=1;x{let r;s.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:t.g):n=>(r||(r=Promise.resolve())).then(n).catch(o=>setTimeout(()=>{throw o},0))},989:(s,e,t)=>{s.exports=t(4005)},2985:s=>{s.exports=class Vr{constructor(t,r=new Map,n=0){this.prefix=t,this._existing=r,this.counter=n}clone(){const{prefix:t,_existing:r,counter:n}=this;return new Vr(t,new Map(r),n)}getId(t){const r=t&&this._existing.get(t);if(r)return r;const n=this.prefix+this.counter;return this.counter++,t&&this._existing.set(t,n),n}hasId(t){return this._existing.has(t)}getOldIds(){return[...this._existing.keys()]}}},3751:(s,e,t)=>{t(2791);const r=self.crypto||self.msCrypto;s.exports=class{constructor(n){if(!r||!r.subtle)throw new Error("crypto.subtle not found.");if(n==="sha256")this.algorithm={name:"SHA-256"};else{if(n!=="sha1")throw new Error(`Unsupported algorithm "${n}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(n){this._content+=n}async digest(){const n=new TextEncoder().encode(this._content),o=new Uint8Array(await r.subtle.digest(this.algorithm,n));let l="";for(let d=0;d{const e="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",t="http://www.w3.org/2001/XMLSchema#string",r="NamedNode",n="BlankNode",o="Literal",l="DefaultGraph",d={};(()=>{const c="(?:<([^:]+:[^>]*)>)",p="A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_",v=p+"0-9-·̀-ͯ‿-⁀",f="(_:(?:["+p+"0-9])(?:(?:["+v+".])*(?:["+v+"]))?)",h="[ \\t]+",w="[ \\t]*",g="(?:"+c+"|"+f+")"+h,x=c+h,j="(?:"+c+"|"+f+'|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^'+c+")|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))"+w,A="(?:\\.|(?:(?:"+c+"|"+f+")"+w+"\\.))";d.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,d.empty=new RegExp("^"+w+"$"),d.quad=new RegExp("^"+w+g+x+j+A+w+"$")})(),s.exports=class xt{static parse(p){const v=[],f={},h=p.split(d.eoln);let w=0;for(const j of h){if(w++,d.empty.test(j))continue;const A=j.match(d.quad);if(A===null)throw new Error("N-Quads parse error on line "+w+".");const Q={subject:null,predicate:null,object:null,graph:null};if(A[1]!==void 0?Q.subject={termType:r,value:A[1]}:Q.subject={termType:n,value:A[2]},Q.predicate={termType:r,value:A[3]},A[4]!==void 0?Q.object={termType:r,value:A[4]}:A[5]!==void 0?Q.object={termType:n,value:A[5]}:(Q.object={termType:o,value:void 0,datatype:{termType:r}},A[7]!==void 0?Q.object.datatype.value=A[7]:A[8]!==void 0?(Q.object.datatype.value=e,Q.object.language=A[8]):Q.object.datatype.value=t,Q.object.value=A[6].replace(a,function(S,y,O,T){if(y)switch(y){case"t":return" ";case"b":return"\b";case"n":return` -`;case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(O)return String.fromCharCode(parseInt(O,16));if(T)throw new Error("Unsupported U escape")})),A[9]!==void 0?Q.graph={termType:r,value:A[9]}:A[10]!==void 0?Q.graph={termType:n,value:A[10]}:Q.graph={termType:l,value:""},Q.graph.value in f){let S=!0;const y=f[Q.graph.value];for(const O of y)if(x=Q,(g=O).subject.termType===x.subject.termType&&g.object.termType===x.object.termType&&g.subject.value===x.subject.value&&g.predicate.value===x.predicate.value&&g.object.value===x.object.value&&(g.object.termType!==o||g.object.datatype.termType===x.object.datatype.termType&&g.object.language===x.object.language&&g.object.datatype.value===x.object.datatype.value)){S=!1;break}S&&(y.push(Q),v.push(Q))}else f[Q.graph.value]=[Q],v.push(Q)}var g,x;return v}static serialize(p){Array.isArray(p)||(p=xt.legacyDatasetToQuads(p));const v=[];for(const f of p)v.push(xt.serializeQuad(f));return v.sort().join("")}static serializeQuadComponents(p,v,f,h){let w="";return p.termType===r?w+=`<${p.value}>`:w+=`${p.value}`,w+=` <${v.value}> `,f.termType===r?w+=`<${f.value}>`:f.termType===n?w+=f.value:(w+=`"${function(g){return g.replace(i,function(x){switch(x){case'"':return'\\"';case"\\":return"\\\\";case` -`:return"\\n";case"\r":return"\\r"}})}(f.value)}"`,f.datatype.value===e?f.language&&(w+=`@${f.language}`):f.datatype.value!==t&&(w+=`^^<${f.datatype.value}>`)),h.termType===r?w+=` <${h.value}>`:h.termType===n&&(w+=` ${h.value}`),w+=` . -`,w}static serializeQuad(p){return xt.serializeQuadComponents(p.subject,p.predicate,p.object,p.graph)}static legacyDatasetToQuads(p){const v=[],f={"blank node":n,IRI:r,literal:o};for(const h in p)p[h].forEach(w=>{const g={};for(const x in w){const j=w[x],A={termType:f[j.type],value:j.value};A.termType===o&&(A.datatype={termType:r},"datatype"in j&&(A.datatype.value=j.datatype),"language"in j?("datatype"in j||(A.datatype.value=e),A.language=j.language):"datatype"in j||(A.datatype.value=t)),g[x]=A}g.graph=h==="@default"?{termType:l,value:""}:{termType:h.startsWith("_:")?n:r,value:h},v.push(g)});return v}};const i=/["\\\n\r]/g,a=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},9925:s=>{s.exports=class{constructor(e){this.current=e.sort(),this.done=!1,this.dir=new Map;for(let t=0;tn)&&(a&&d>0&&i>e[d-1]||!a&&de[d+1])&&(n=i,o=d)}if(n===null)this.done=!0;else{const d=t.get(n)?o-1:o+1;e[o]=e[d],e[d]=n;for(const i of e)i>n&&t.set(i,!t.get(i))}return r}}},3513:(s,e,t)=>{const r=t(2985),n=t(3751),o=t(9925),l=t(1227);function d(i,a){return i.hasha.hash?1:0}s.exports=class{constructor({createMessageDigest:i=()=>new n("sha256"),canonicalIdMap:a=new Map,maxDeepIterations:c=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new r("_:c14n",a),this.createMessageDigest=i,this.maxDeepIterations=c,this.quads=null,this.deepIterations=null}async main(i){this.deepIterations=new Map,this.quads=i;for(const w of i)this._addBlankNodeQuadInfo({quad:w,component:w.subject}),this._addBlankNodeQuadInfo({quad:w,component:w.object}),this._addBlankNodeQuadInfo({quad:w,component:w.graph});const a=new Map,c=[...this.blankNodeInfo.keys()];let p=0;for(const w of c)++p%100==0&&await this._yield(),await this._hashAndTrackBlankNode({id:w,hashToBlankNodes:a});const v=[...a.keys()].sort(),f=[];for(const w of v){const g=a.get(w);if(g.length>1){f.push(g);continue}const x=g[0];this.canonicalIssuer.getId(x)}for(const w of f){const g=[];for(const x of w){if(this.canonicalIssuer.hasId(x))continue;const j=new r("_:b");j.getId(x);const A=await this.hashNDegreeQuads(x,j);g.push(A)}g.sort(d);for(const x of g){const j=x.issuer.getOldIds();for(const A of j)this.canonicalIssuer.getId(A)}}const h=[];for(const w of this.quads){const g=l.serializeQuadComponents(this._componentWithCanonicalId(w.subject),w.predicate,this._componentWithCanonicalId(w.object),this._componentWithCanonicalId(w.graph));h.push(g)}return h.sort(),h.join("")}async hashFirstDegreeQuads(i){const a=[],c=this.blankNodeInfo.get(i),p=c.quads;for(const f of p){const h={subject:null,predicate:f.predicate,object:null,graph:null};h.subject=this.modifyFirstDegreeComponent(i,f.subject,"subject"),h.object=this.modifyFirstDegreeComponent(i,f.object,"object"),h.graph=this.modifyFirstDegreeComponent(i,f.graph,"graph"),a.push(l.serializeQuad(h))}a.sort();const v=this.createMessageDigest();for(const f of a)v.update(f);return c.hash=await v.digest(),c.hash}async hashRelatedBlankNode(i,a,c,p){let v;v=this.canonicalIssuer.hasId(i)?this.canonicalIssuer.getId(i):c.hasId(i)?c.getId(i):this.blankNodeInfo.get(i).hash;const f=this.createMessageDigest();return f.update(p),p!=="g"&&f.update(this.getRelatedPredicate(a)),f.update(v),f.digest()}async hashNDegreeQuads(i,a){const c=this.deepIterations.get(i)||0;if(c>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(i,c+1);const p=this.createMessageDigest(),v=await this.createHashToRelated(i,a),f=[...v.keys()].sort();for(const h of f){p.update(h);let w,g="";const x=new o(v.get(h));let j=0;for(;x.hasNext();){const A=x.next();++j%3==0&&await this._yield();let Q=a.clone(),S="";const y=[];let O=!1;for(const T of A)if(this.canonicalIssuer.hasId(T)?S+=this.canonicalIssuer.getId(T):(Q.hasId(T)||y.push(T),S+=Q.getId(T)),g.length!==0&&S>g){O=!0;break}if(!O){for(const T of y){const k=await this.hashNDegreeQuads(T,Q);if(S+=Q.getId(T),S+=`<${k.hash}>`,Q=k.issuer,g.length!==0&&S>g){O=!0;break}}O||(g.length===0||S`}async createHashToRelated(i,a){const c=new Map,p=this.blankNodeInfo.get(i).quads;let v=0;for(const f of p)++v%100==0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:f,component:f.subject,position:"s",id:i,issuer:a,hashToRelated:c}),this._addRelatedBlankNodeHash({quad:f,component:f.object,position:"o",id:i,issuer:a,hashToRelated:c}),this._addRelatedBlankNodeHash({quad:f,component:f.graph,position:"g",id:i,issuer:a,hashToRelated:c})]);return c}async _hashAndTrackBlankNode({id:i,hashToBlankNodes:a}){const c=await this.hashFirstDegreeQuads(i),p=a.get(c);p?p.push(i):a.set(c,[i])}_addBlankNodeQuadInfo({quad:i,component:a}){if(a.termType!=="BlankNode")return;const c=a.value,p=this.blankNodeInfo.get(c);p?p.quads.add(i):this.blankNodeInfo.set(c,{quads:new Set([i]),hash:null})}async _addRelatedBlankNodeHash({quad:i,component:a,position:c,id:p,issuer:v,hashToRelated:f}){if(a.termType!=="BlankNode"||a.value===p)return;const h=a.value,w=await this.hashRelatedBlankNode(h,i,v,c),g=f.get(w);g?g.push(h):f.set(w,[h])}_componentWithCanonicalId(i){return i.termType!=="BlankNode"||i.value.startsWith(this.canonicalIssuer.prefix)?i:{termType:"BlankNode",value:this.canonicalIssuer.getId(i.value)}}async _yield(){return new Promise(i=>setImmediate(i))}}},2438:(s,e,t)=>{const r=t(2985),n=t(3751),o=t(9925),l=t(1227);function d(i,a){return i.hasha.hash?1:0}s.exports=class{constructor({createMessageDigest:i=()=>new n("sha256"),canonicalIdMap:a=new Map,maxDeepIterations:c=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new r("_:c14n",a),this.createMessageDigest=i,this.maxDeepIterations=c,this.quads=null,this.deepIterations=null}main(i){this.deepIterations=new Map,this.quads=i;for(const h of i)this._addBlankNodeQuadInfo({quad:h,component:h.subject}),this._addBlankNodeQuadInfo({quad:h,component:h.object}),this._addBlankNodeQuadInfo({quad:h,component:h.graph});const a=new Map,c=[...this.blankNodeInfo.keys()];for(const h of c)this._hashAndTrackBlankNode({id:h,hashToBlankNodes:a});const p=[...a.keys()].sort(),v=[];for(const h of p){const w=a.get(h);if(w.length>1){v.push(w);continue}const g=w[0];this.canonicalIssuer.getId(g)}for(const h of v){const w=[];for(const g of h){if(this.canonicalIssuer.hasId(g))continue;const x=new r("_:b");x.getId(g);const j=this.hashNDegreeQuads(g,x);w.push(j)}w.sort(d);for(const g of w){const x=g.issuer.getOldIds();for(const j of x)this.canonicalIssuer.getId(j)}}const f=[];for(const h of this.quads){const w=l.serializeQuadComponents(this._componentWithCanonicalId({component:h.subject}),h.predicate,this._componentWithCanonicalId({component:h.object}),this._componentWithCanonicalId({component:h.graph}));f.push(w)}return f.sort(),f.join("")}hashFirstDegreeQuads(i){const a=[],c=this.blankNodeInfo.get(i),p=c.quads;for(const f of p){const h={subject:null,predicate:f.predicate,object:null,graph:null};h.subject=this.modifyFirstDegreeComponent(i,f.subject,"subject"),h.object=this.modifyFirstDegreeComponent(i,f.object,"object"),h.graph=this.modifyFirstDegreeComponent(i,f.graph,"graph"),a.push(l.serializeQuad(h))}a.sort();const v=this.createMessageDigest();for(const f of a)v.update(f);return c.hash=v.digest(),c.hash}hashRelatedBlankNode(i,a,c,p){let v;v=this.canonicalIssuer.hasId(i)?this.canonicalIssuer.getId(i):c.hasId(i)?c.getId(i):this.blankNodeInfo.get(i).hash;const f=this.createMessageDigest();return f.update(p),p!=="g"&&f.update(this.getRelatedPredicate(a)),f.update(v),f.digest()}hashNDegreeQuads(i,a){const c=this.deepIterations.get(i)||0;if(c>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(i,c+1);const p=this.createMessageDigest(),v=this.createHashToRelated(i,a),f=[...v.keys()].sort();for(const h of f){p.update(h);let w,g="";const x=new o(v.get(h));for(;x.hasNext();){const j=x.next();let A=a.clone(),Q="";const S=[];let y=!1;for(const O of j)if(this.canonicalIssuer.hasId(O)?Q+=this.canonicalIssuer.getId(O):(A.hasId(O)||S.push(O),Q+=A.getId(O)),g.length!==0&&Q>g){y=!0;break}if(!y){for(const O of S){const T=this.hashNDegreeQuads(O,A);if(Q+=A.getId(O),Q+=`<${T.hash}>`,A=T.issuer,g.length!==0&&Q>g){y=!0;break}}y||(g.length===0||Q`}createHashToRelated(i,a){const c=new Map,p=this.blankNodeInfo.get(i).quads;for(const v of p)this._addRelatedBlankNodeHash({quad:v,component:v.subject,position:"s",id:i,issuer:a,hashToRelated:c}),this._addRelatedBlankNodeHash({quad:v,component:v.object,position:"o",id:i,issuer:a,hashToRelated:c}),this._addRelatedBlankNodeHash({quad:v,component:v.graph,position:"g",id:i,issuer:a,hashToRelated:c});return c}_hashAndTrackBlankNode({id:i,hashToBlankNodes:a}){const c=this.hashFirstDegreeQuads(i),p=a.get(c);p?p.push(i):a.set(c,[i])}_addBlankNodeQuadInfo({quad:i,component:a}){if(a.termType!=="BlankNode")return;const c=a.value,p=this.blankNodeInfo.get(c);p?p.quads.add(i):this.blankNodeInfo.set(c,{quads:new Set([i]),hash:null})}_addRelatedBlankNodeHash({quad:i,component:a,position:c,id:p,issuer:v,hashToRelated:f}){if(a.termType!=="BlankNode"||a.value===p)return;const h=a.value,w=this.hashRelatedBlankNode(h,i,v,c),g=f.get(w);g?g.push(h):f.set(w,[h])}_componentWithCanonicalId({component:i}){return i.termType!=="BlankNode"||i.value.startsWith(this.canonicalIssuer.prefix)?i:{termType:"BlankNode",value:this.canonicalIssuer.getId(i.value)}}}},3845:(s,e,t)=>{const r=t(3751),n=t(3513);s.exports=class extends n{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new r("sha1")}modifyFirstDegreeComponent(o,l,d){return l.termType!=="BlankNode"?l:d==="graph"?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:l.value===o?"_:a":"_:z"}}getRelatedPredicate(o){return o.predicate.value}async createHashToRelated(o,l){const d=new Map,i=this.blankNodeInfo.get(o).quads;let a=0;for(const c of i){let p,v;if(c.subject.termType==="BlankNode"&&c.subject.value!==o)v=c.subject.value,p="p";else{if(c.object.termType!=="BlankNode"||c.object.value===o)continue;v=c.object.value,p="r"}++a%100==0&&await this._yield();const f=await this.hashRelatedBlankNode(v,c,l,p),h=d.get(f);h?h.push(v):d.set(f,[v])}return d}}},378:(s,e,t)=>{const r=t(3751),n=t(2438);s.exports=class extends n{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new r("sha1")}modifyFirstDegreeComponent(o,l,d){return l.termType!=="BlankNode"?l:d==="graph"?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:l.value===o?"_:a":"_:z"}}getRelatedPredicate(o){return o.predicate.value}createHashToRelated(o,l){const d=new Map,i=this.blankNodeInfo.get(o).quads;for(const a of i){let c,p;if(a.subject.termType==="BlankNode"&&a.subject.value!==o)p=a.subject.value,c="p";else{if(a.object.termType!=="BlankNode"||a.object.value===o)continue;p=a.object.value,c="r"}const v=this.hashRelatedBlankNode(p,a,l,c),f=d.get(v);f?f.push(p):d.set(v,[p])}return d}}},4005:(s,e,t)=>{const r=t(3513),n=t(3845),o=t(2438),l=t(378);let d;try{d=t(7789)}catch{}function i(a){return Array.isArray(a)?a:e.NQuads.legacyDatasetToQuads(a)}e.NQuads=t(1227),e.IdentifierIssuer=t(2985),e._rdfCanonizeNative=function(a){return a&&(d=a),d},e.canonize=async function(a,c){const p=i(a);if(c.useNative){if(!d)throw new Error("rdf-canonize-native not available");if(c.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise((v,f)=>d.canonize(p,c,(h,w)=>h?f(h):v(w)))}if(c.algorithm==="URDNA2015")return new r(c).main(p);if(c.algorithm==="URGNA2012"){if(c.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new n(c).main(p)}throw"algorithm"in c?new Error("Invalid RDF Dataset Canonicalization algorithm: "+c.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")},e._canonizeSync=function(a,c){const p=i(a);if(c.useNative){if(!d)throw new Error("rdf-canonize-native not available");if(c.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return d.canonizeSync(p,c)}if(c.algorithm==="URDNA2015")return new o(c).main(p);if(c.algorithm==="URGNA2012"){if(c.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new l(c).main(p)}throw"algorithm"in c?new Error("Invalid RDF Dataset Canonicalization algorithm: "+c.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}},7793:function(s,e,t){var r=this&&this.__createBinding||(Object.create?function(o,l,d,i){i===void 0&&(i=d),Object.defineProperty(o,i,{enumerable:!0,get:function(){return l[d]}})}:function(o,l,d,i){i===void 0&&(i=d),o[i]=l[d]}),n=this&&this.__exportStar||function(o,l){for(var d in o)d==="default"||Object.prototype.hasOwnProperty.call(l,d)||r(l,o,d)};Object.defineProperty(e,"__esModule",{value:!0}),n(t(9931),e),n(t(8483),e),n(t(2142),e),n(t(2426),e),n(t(3988),e),n(t(6754),e),n(t(8401),e)},9931:(s,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BlankNode=void 0,e.BlankNode=class{constructor(t){this.termType="BlankNode",this.value=t}equals(t){return!!t&&t.termType==="BlankNode"&&t.value===this.value}}},8483:(s,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DataFactory=void 0;const r=t(9931),n=t(2142),o=t(2426),l=t(3988),d=t(6754),i=t(8401);let a=0;e.DataFactory=class{constructor(c){this.blankNodeCounter=0,c=c||{},this.blankNodePrefix=c.blankNodePrefix||`df_${a++}_`}namedNode(c){return new l.NamedNode(c)}blankNode(c){return new r.BlankNode(c||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(c,p){return new o.Literal(c,p)}variable(c){return new i.Variable(c)}defaultGraph(){return n.DefaultGraph.INSTANCE}quad(c,p,v,f){return new d.Quad(c,p,v,f||this.defaultGraph())}fromTerm(c){switch(c.termType){case"NamedNode":return this.namedNode(c.value);case"BlankNode":return this.blankNode(c.value);case"Literal":return c.language?this.literal(c.value,c.language):c.datatype.equals(o.Literal.XSD_STRING)?this.literal(c.value):this.literal(c.value,this.fromTerm(c.datatype));case"Variable":return this.variable(c.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(c.subject),this.fromTerm(c.predicate),this.fromTerm(c.object),this.fromTerm(c.graph))}}fromQuad(c){return this.fromTerm(c)}resetBlankNodeCounter(){this.blankNodeCounter=0}}},2142:(s,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DefaultGraph=void 0;class t{constructor(){this.termType="DefaultGraph",this.value=""}equals(n){return!!n&&n.termType==="DefaultGraph"}}e.DefaultGraph=t,t.INSTANCE=new t},2426:(s,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Literal=void 0;const r=t(3988);class n{constructor(l,d){this.termType="Literal",this.value=l,typeof d=="string"?(this.language=d,this.datatype=n.RDF_LANGUAGE_STRING):d?(this.language="",this.datatype=d):(this.language="",this.datatype=n.XSD_STRING)}equals(l){return!!l&&l.termType==="Literal"&&l.value===this.value&&l.language===this.language&&this.datatype.equals(l.datatype)}}e.Literal=n,n.RDF_LANGUAGE_STRING=new r.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),n.XSD_STRING=new r.NamedNode("http://www.w3.org/2001/XMLSchema#string")},3988:(s,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NamedNode=void 0,e.NamedNode=class{constructor(t){this.termType="NamedNode",this.value=t}equals(t){return!!t&&t.termType==="NamedNode"&&t.value===this.value}}},6754:(s,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Quad=void 0,e.Quad=class{constructor(t,r,n,o){this.termType="Quad",this.value="",this.subject=t,this.predicate=r,this.object=n,this.graph=o}equals(t){return!!t&&(t.termType==="Quad"||!t.termType)&&this.subject.equals(t.subject)&&this.predicate.equals(t.predicate)&&this.object.equals(t.object)&&this.graph.equals(t.graph)}}},8401:(s,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Variable=void 0,e.Variable=class{constructor(t){this.termType="Variable",this.value=t}equals(t){return!!t&&t.termType==="Variable"&&t.value===this.value}}},9349:function(s,e,t){var r=this&&this.__createBinding||(Object.create?function(p,v,f,h){h===void 0&&(h=f);var w=Object.getOwnPropertyDescriptor(v,f);w&&!("get"in w?!v.__esModule:w.writable||w.configurable)||(w={enumerable:!0,get:function(){return v[f]}}),Object.defineProperty(p,h,w)}:function(p,v,f,h){h===void 0&&(h=f),p[h]=v[f]}),n=this&&this.__exportStar||function(p,v){for(var f in p)f==="default"||Object.prototype.hasOwnProperty.call(v,f)||r(v,p,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.getSupportedJavaScriptPrimitives=e.getSupportedRdfDatatypes=e.getTermRaw=e.toRdf=e.fromRdf=void 0;const o=t(7793),l=t(4802),d=t(103);n(t(4802),e),n(t(5448),e),n(t(103),e);const i=new o.DataFactory,a=new d.Translator;function c(p,v){return a.fromRdf(p,v)}a.registerHandler(new l.TypeHandlerString,l.TypeHandlerString.TYPES.map(p=>i.namedNode(p)),["string"]),a.registerHandler(new l.TypeHandlerBoolean,[l.TypeHandlerBoolean.TYPE].map(p=>i.namedNode(p)),["boolean"]),a.registerHandler(new l.TypeHandlerNumberDouble,l.TypeHandlerNumberDouble.TYPES.map(p=>i.namedNode(p)),["number"]),a.registerHandler(new l.TypeHandlerNumberInteger,l.TypeHandlerNumberInteger.TYPES.map(p=>i.namedNode(p)),["number"]),a.registerHandler(new l.TypeHandlerDate,l.TypeHandlerDate.TYPES.map(p=>i.namedNode(p)),["object"]),e.fromRdf=c,e.toRdf=function(p,v){return v&&"namedNode"in v&&(v={dataFactory:v}),(v=v||{})&&!v.dataFactory&&(v.dataFactory=i),a.toRdf(p,v)},e.getTermRaw=function(p,v){return p.termType==="Literal"?c(p,v):p.value},e.getSupportedRdfDatatypes=function(){return a.getSupportedRdfDatatypes()},e.getSupportedJavaScriptPrimitives=function(){return a.getSupportedJavaScriptPrimitives()}},5448:(s,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},103:(s,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Translator=void 0,e.Translator=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(t){throw new Error(`Invalid RDF ${t.datatype.value} value: '${t.value}'`)}registerHandler(t,r,n){for(const o of r)this.supportedRdfDatatypes.push(o),this.fromRdfHandlers[o.value]=t;for(const o of n){let l=this.toRdfHandlers[o];l||(this.toRdfHandlers[o]=l=[]),l.push(t)}}fromRdf(t,r){const n=this.fromRdfHandlers[t.datatype.value];return n?n.fromRdf(t,r):t.value}toRdf(t,r){const n=this.toRdfHandlers[typeof t];if(n)for(const o of n){const l=o.toRdf(t,r);if(l)return l}throw new Error(`Invalid JavaScript value: '${t}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},92:(s,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerBoolean=void 0;const r=t(103);class n{fromRdf(l,d){switch(l.value){case"true":case"1":return!0;case"false":case"0":return!1}return d&&r.Translator.incorrectRdfDataType(l),!1}toRdf(l,{datatype:d,dataFactory:i}){return i.literal(l?"true":"false",d||i.namedNode(n.TYPE))}}n.TYPE="http://www.w3.org/2001/XMLSchema#boolean",e.TypeHandlerBoolean=n},7258:(s,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerDate=void 0;const r=t(103);class n{fromRdf(l,d){switch(d&&!l.value.match(n.VALIDATORS[l.datatype.value.substr(33,l.datatype.value.length)])&&r.Translator.incorrectRdfDataType(l),l.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(l.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":const i=l.value.split("-");return new Date(0,parseInt(i[0],10)-1,parseInt(i[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(l.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(l.value+"-01");default:return new Date(l.value)}}toRdf(l,{datatype:d,dataFactory:i}){if(d=d||i.namedNode(n.TYPES[0]),!(l instanceof Date))return null;const a=l;let c;switch(d.value){case"http://www.w3.org/2001/XMLSchema#gDay":c=String(a.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":c=a.getUTCMonth()+1+"-"+a.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":c=String(a.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":c=a.getUTCFullYear()+"-"+(a.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":c=a.toISOString().replace(/T.*$/,"");break;default:c=a.toISOString()}return i.literal(c,d)}}n.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"],n.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]$/},e.TypeHandlerDate=n},2406:(s,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerNumberDouble=void 0;const r=t(103);class n{fromRdf(l,d){const i=parseFloat(l.value);return d&&isNaN(i)&&r.Translator.incorrectRdfDataType(l),i}toRdf(l,{datatype:d,dataFactory:i}){return d=d||i.namedNode(n.TYPES[0]),isNaN(l)?i.literal("NaN",d):isFinite(l)?l%1==0?null:i.literal(l.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),d):i.literal(l>0?"INF":"-INF",d)}}n.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"],e.TypeHandlerNumberDouble=n},6925:(s,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerNumberInteger=void 0;const r=t(103);class n{fromRdf(l,d){const i=parseInt(l.value,10);return d&&(isNaN(i)||l.value.indexOf(".")>=0)&&r.Translator.incorrectRdfDataType(l),i}toRdf(l,{datatype:d,dataFactory:i}){return i.literal(String(l),d||(l<=n.MAX_INT&&l>=n.MIN_INT?i.namedNode(n.TYPES[0]):i.namedNode(n.TYPES[1])))}}n.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"],n.MAX_INT=2147483647,n.MIN_INT=-2147483648,e.TypeHandlerNumberInteger=n},4191:(s,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHandlerString=void 0;class t{fromRdf(n){return n.value}toRdf(n,{datatype:o,dataFactory:l}){return l.literal(n,o)}}t.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"],e.TypeHandlerString=t},4802:function(s,e,t){var r=this&&this.__createBinding||(Object.create?function(o,l,d,i){i===void 0&&(i=d);var a=Object.getOwnPropertyDescriptor(l,d);a&&!("get"in a?!l.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(o,i,a)}:function(o,l,d,i){i===void 0&&(i=d),o[i]=l[d]}),n=this&&this.__exportStar||function(o,l){for(var d in o)d==="default"||Object.prototype.hasOwnProperty.call(l,d)||r(l,o,d)};Object.defineProperty(e,"__esModule",{value:!0}),n(t(92),e),n(t(7258),e),n(t(2406),e),n(t(6925),e),n(t(4191),e)},4147:(s,e,t)=>{const{SymbolDispose:r}=t(4134),{AbortError:n,codes:o}=t(6371),{isNodeStream:l,isWebStream:d,kControllerErrorFunction:i}=t(6115),a=t(6238),{ERR_INVALID_ARG_TYPE:c}=o;let p;s.exports.addAbortSignal=function(v,f){if((h=>{if(typeof h!="object"||!("aborted"in h))throw new c("signal","AbortSignal",h)})(v),!l(f)&&!d(f))throw new c("stream",["ReadableStream","WritableStream","Stream"],f);return s.exports.addAbortSignalNoValidate(v,f)},s.exports.addAbortSignalNoValidate=function(v,f){if(typeof v!="object"||!("aborted"in v))return f;const h=l(f)?()=>{f.destroy(new n(void 0,{cause:v.reason}))}:()=>{f[i](new n(void 0,{cause:v.reason}))};if(v.aborted)h();else{p=p||t(7760).addAbortListener;const w=p(v,h);a(f,w[r])}return f}},345:(s,e,t)=>{const{StringPrototypeSlice:r,SymbolIterator:n,TypedArrayPrototypeSet:o,Uint8Array:l}=t(4134),{Buffer:d}=t(8287),{inspect:i}=t(7760);s.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(a){const c={data:a,next:null};this.length>0?this.tail.next=c:this.head=c,this.tail=c,++this.length}unshift(a){const c={data:a,next:this.head};this.length===0&&(this.tail=c),this.head=c,++this.length}shift(){if(this.length===0)return;const a=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,a}clear(){this.head=this.tail=null,this.length=0}join(a){if(this.length===0)return"";let c=this.head,p=""+c.data;for(;(c=c.next)!==null;)p+=a+c.data;return p}concat(a){if(this.length===0)return d.alloc(0);const c=d.allocUnsafe(a>>>0);let p=this.head,v=0;for(;p;)o(c,p.data,v),v+=p.data.length,p=p.next;return c}consume(a,c){const p=this.head.data;if(af.length)){a===f.length?(c+=f,++v,p.next?this.head=p.next:this.head=this.tail=null):(c+=r(f,0,a),this.head=p,p.data=r(f,a));break}c+=f,a-=f.length,++v}while((p=p.next)!==null);return this.length-=v,c}_getBuffer(a){const c=d.allocUnsafe(a),p=a;let v=this.head,f=0;do{const h=v.data;if(!(a>h.length)){a===h.length?(o(c,h,p-a),++f,v.next?this.head=v.next:this.head=this.tail=null):(o(c,new l(h.buffer,h.byteOffset,a),p-a),this.head=v,v.data=h.slice(a));break}o(c,h,p-a),a-=h.length,++f}while((v=v.next)!==null);return this.length-=f,c}[Symbol.for("nodejs.util.inspect.custom")](a,c){return i(this,{...c,depth:0,customInspect:!1})}}},7830:(s,e,t)=>{const{pipeline:r}=t(7758),n=t(3370),{destroyer:o}=t(5896),{isNodeStream:l,isReadable:d,isWritable:i,isWebStream:a,isTransformStream:c,isWritableStream:p,isReadableStream:v}=t(6115),{AbortError:f,codes:{ERR_INVALID_ARG_VALUE:h,ERR_MISSING_ARGS:w}}=t(6371),g=t(6238);s.exports=function(...x){if(x.length===0)throw new w("streams");if(x.length===1)return n.from(x[0]);const j=[...x];if(typeof x[0]=="function"&&(x[0]=n.from(x[0])),typeof x[x.length-1]=="function"){const N=x.length-1;x[N]=n.from(x[N])}for(let N=0;N0&&!(i(x[N])||p(x[N])||c(x[N])))throw new h(`streams[${N}]`,j[N],"must be writable")}let A,Q,S,y,O;const T=x[0],k=r(x,function(N){const K=y;y=null,K?K(N):N?O.destroy(N):L||b||O.destroy()}),b=!!(i(T)||p(T)||c(T)),L=!!(d(k)||v(k)||c(k));if(O=new n({writableObjectMode:!(T==null||!T.writableObjectMode),readableObjectMode:!(k==null||!k.readableObjectMode),writable:b,readable:L}),b){if(l(T))O._write=function(K,se,q){T.write(K,se)?q():A=q},O._final=function(K){T.end(),Q=K},T.on("drain",function(){if(A){const K=A;A=null,K()}});else if(a(T)){const K=(c(T)?T.writable:T).getWriter();O._write=async function(se,q,C){try{await K.ready,K.write(se).catch(()=>{}),C()}catch(X){C(X)}},O._final=async function(se){try{await K.ready,K.close().catch(()=>{}),Q=se}catch(q){se(q)}}}const N=c(k)?k.readable:k;g(N,()=>{if(Q){const K=Q;Q=null,K()}})}if(L){if(l(k))k.on("readable",function(){if(S){const N=S;S=null,N()}}),k.on("end",function(){O.push(null)}),O._read=function(){for(;;){const N=k.read();if(N===null)return void(S=O._read);if(!O.push(N))return}};else if(a(k)){const N=(c(k)?k.readable:k).getReader();O._read=async function(){for(;;)try{const{value:K,done:se}=await N.read();if(!O.push(K))return;if(se)return void O.push(null)}catch{return}}}}return O._destroy=function(N,K){N||y===null||(N=new f),S=null,A=null,Q=null,y===null?K(N):(y=K,l(k)&&o(k,N))},O}},5896:(s,e,t)=>{const r=t(5606),{aggregateTwoErrors:n,codes:{ERR_MULTIPLE_CALLBACK:o},AbortError:l}=t(6371),{Symbol:d}=t(4134),{kIsDestroyed:i,isDestroyed:a,isFinished:c,isServerRequest:p}=t(6115),v=d("kDestroy"),f=d("kConstruct");function h(k,b,L){k&&(k.stack,b&&!b.errored&&(b.errored=k),L&&!L.errored&&(L.errored=k))}function w(k,b,L){let N=!1;function K(se){if(N)return;N=!0;const q=k._readableState,C=k._writableState;h(se,C,q),C&&(C.closed=!0),q&&(q.closed=!0),typeof L=="function"&&L(se),se?r.nextTick(g,k,se):r.nextTick(x,k)}try{k._destroy(b||null,K)}catch(se){K(se)}}function g(k,b){j(k,b),x(k)}function x(k){const b=k._readableState,L=k._writableState;L&&(L.closeEmitted=!0),b&&(b.closeEmitted=!0),(L!=null&&L.emitClose||b!=null&&b.emitClose)&&k.emit("close")}function j(k,b){const L=k._readableState,N=k._writableState;N!=null&&N.errorEmitted||L!=null&&L.errorEmitted||(N&&(N.errorEmitted=!0),L&&(L.errorEmitted=!0),k.emit("error",b))}function A(k,b,L){const N=k._readableState,K=k._writableState;if(K!=null&&K.destroyed||N!=null&&N.destroyed)return this;N!=null&&N.autoDestroy||K!=null&&K.autoDestroy?k.destroy(b):b&&(b.stack,K&&!K.errored&&(K.errored=b),N&&!N.errored&&(N.errored=b),L?r.nextTick(j,k,b):j(k,b))}function Q(k){let b=!1;function L(N){if(b)return void A(k,N??new o);b=!0;const K=k._readableState,se=k._writableState,q=se||K;K&&(K.constructed=!0),se&&(se.constructed=!0),q.destroyed?k.emit(v,N):N?A(k,N,!0):r.nextTick(S,k)}try{k._construct(N=>{r.nextTick(L,N)})}catch(N){r.nextTick(L,N)}}function S(k){k.emit(f)}function y(k){return(k==null?void 0:k.setHeader)&&typeof k.abort=="function"}function O(k){k.emit("close")}function T(k,b){k.emit("error",b),r.nextTick(O,k)}s.exports={construct:function(k,b){if(typeof k._construct!="function")return;const L=k._readableState,N=k._writableState;L&&(L.constructed=!1),N&&(N.constructed=!1),k.once(f,b),k.listenerCount(f)>1||r.nextTick(Q,k)},destroyer:function(k,b){k&&!a(k)&&(b||c(k)||(b=new l),p(k)?(k.socket=null,k.destroy(b)):y(k)?k.abort():y(k.req)?k.req.abort():typeof k.destroy=="function"?k.destroy(b):typeof k.close=="function"?k.close():b?r.nextTick(T,k,b):r.nextTick(O,k),k.destroyed||(k[i]=!0))},destroy:function(k,b){const L=this._readableState,N=this._writableState,K=N||L;return N!=null&&N.destroyed||L!=null&&L.destroyed?(typeof b=="function"&&b(),this):(h(k,N,L),N&&(N.destroyed=!0),L&&(L.destroyed=!0),K.constructed?w(this,k,b):this.once(v,function(se){w(this,n(se,k),b)}),this)},undestroy:function(){const k=this._readableState,b=this._writableState;k&&(k.constructed=!0,k.closed=!1,k.closeEmitted=!1,k.destroyed=!1,k.errored=null,k.errorEmitted=!1,k.reading=!1,k.ended=k.readable===!1,k.endEmitted=k.readable===!1),b&&(b.constructed=!0,b.destroyed=!1,b.closed=!1,b.closeEmitted=!1,b.errored=null,b.errorEmitted=!1,b.finalCalled=!1,b.prefinished=!1,b.ended=b.writable===!1,b.ending=b.writable===!1,b.finished=b.writable===!1)},errorOrDestroy:A}},3370:(s,e,t)=>{const{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:n,ObjectKeys:o,ObjectSetPrototypeOf:l}=t(4134);s.exports=a;const d=t(7576),i=t(8584);l(a.prototype,d.prototype),l(a,d);{const f=o(i.prototype);for(let h=0;h{const r=t(5606),n=t(8287),{isReadable:o,isWritable:l,isIterable:d,isNodeStream:i,isReadableNodeStream:a,isWritableNodeStream:c,isDuplexNodeStream:p,isReadableStream:v,isWritableStream:f}=t(6115),h=t(6238),{AbortError:w,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:x}}=t(6371),{destroyer:j}=t(5896),A=t(3370),Q=t(7576),S=t(8584),{createDeferredPromise:y}=t(7760),O=t(6532),T=globalThis.Blob||n.Blob,k=T!==void 0?function(se){return se instanceof T}:function(se){return!1},b=globalThis.AbortController||t(5568).AbortController,{FunctionPrototypeCall:L}=t(4134);class N extends A{constructor(q){super(q),(q==null?void 0:q.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(q==null?void 0:q.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}function K(se){const q=se.readable&&typeof se.readable.read!="function"?Q.wrap(se.readable):se.readable,C=se.writable;let X,I,B,U,P,J=!!o(q),D=!!l(C);function V(te){const le=U;U=null,le?le(te):te&&P.destroy(te)}return P=new N({readableObjectMode:!(q==null||!q.readableObjectMode),writableObjectMode:!(C==null||!C.writableObjectMode),readable:J,writable:D}),D&&(h(C,te=>{D=!1,te&&j(q,te),V(te)}),P._write=function(te,le,ee){C.write(te,le)?ee():X=ee},P._final=function(te){C.end(),I=te},C.on("drain",function(){if(X){const te=X;X=null,te()}}),C.on("finish",function(){if(I){const te=I;I=null,te()}})),J&&(h(q,te=>{J=!1,te&&j(q,te),V(te)}),q.on("readable",function(){if(B){const te=B;B=null,te()}}),q.on("end",function(){P.push(null)}),P._read=function(){for(;;){const te=q.read();if(te===null)return void(B=P._read);if(!P.push(te))return}}),P._destroy=function(te,le){te||U===null||(te=new w),B=null,X=null,I=null,U===null?le(te):(U=le,j(C,te),j(q,te))},P}s.exports=function se(q,C){if(p(q))return q;if(a(q))return K({readable:q});if(c(q))return K({writable:q});if(i(q))return K({writable:!1,readable:!1});if(v(q))return K({readable:Q.fromWeb(q)});if(f(q))return K({writable:S.fromWeb(q)});if(typeof q=="function"){const{value:I,write:B,final:U,destroy:P}=function(D){let{promise:V,resolve:te}=y();const le=new b,ee=le.signal;return{value:D(async function*(){for(;;){const M=V;V=null;const{chunk:E,done:W,cb:z}=await M;if(r.nextTick(z),W)return;if(ee.aborted)throw new w(void 0,{cause:ee.reason});({promise:V,resolve:te}=y()),yield E}}(),{signal:ee}),write(M,E,W){const z=te;te=null,z({chunk:M,done:!1,cb:W})},final(M){const E=te;te=null,E({done:!0,cb:M})},destroy(M,E){le.abort(),E(M)}}}(q);if(d(I))return O(N,I,{objectMode:!0,write:B,final:U,destroy:P});const J=I==null?void 0:I.then;if(typeof J=="function"){let D;const V=L(J,I,te=>{if(te!=null)throw new x("nully","body",te)},te=>{j(D,te)});return D=new N({objectMode:!0,readable:!1,write:B,final(te){U(async()=>{try{await V,r.nextTick(te,null)}catch(le){r.nextTick(te,le)}})},destroy:P})}throw new x("Iterable, AsyncIterable or AsyncFunction",C,I)}if(k(q))return se(q.arrayBuffer());if(d(q))return O(N,q,{objectMode:!0,writable:!1});if(v(q==null?void 0:q.readable)&&f(q==null?void 0:q.writable))return N.fromWeb(q);if(typeof(q==null?void 0:q.writable)=="object"||typeof(q==null?void 0:q.readable)=="object")return K({readable:q!=null&&q.readable?a(q==null?void 0:q.readable)?q==null?void 0:q.readable:se(q.readable):void 0,writable:q!=null&&q.writable?c(q==null?void 0:q.writable)?q==null?void 0:q.writable:se(q.writable):void 0});const X=q==null?void 0:q.then;if(typeof X=="function"){let I;return L(X,q,B=>{B!=null&&I.push(B),I.push(null)},B=>{j(I,B)}),I=new N({objectMode:!0,writable:!1,read(){}})}throw new g(C,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],q)}},6238:(s,e,t)=>{const r=t(5606),{AbortError:n,codes:o}=t(6371),{ERR_INVALID_ARG_TYPE:l,ERR_STREAM_PREMATURE_CLOSE:d}=o,{kEmptyObject:i,once:a}=t(7760),{validateAbortSignal:c,validateFunction:p,validateObject:v,validateBoolean:f}=t(277),{Promise:h,PromisePrototypeThen:w,SymbolDispose:g}=t(4134),{isClosed:x,isReadable:j,isReadableNodeStream:A,isReadableStream:Q,isReadableFinished:S,isReadableErrored:y,isWritable:O,isWritableNodeStream:T,isWritableStream:k,isWritableFinished:b,isWritableErrored:L,isNodeStream:N,willEmitClose:K,kIsClosedPromise:se}=t(6115);let q;const C=()=>{};function X(I,B,U){var P,J;if(arguments.length===2?(U=B,B=i):B==null?B=i:v(B,"options"),p(U,"callback"),c(B.signal,"options.signal"),U=a(U),Q(I)||k(I))return function(m,_,F){let G=!1,re=C;if(_.signal)if(re=()=>{G=!0,F.call(m,new n(void 0,{cause:_.signal.reason}))},_.signal.aborted)r.nextTick(re);else{q=q||t(7760).addAbortListener;const he=q(_.signal,re),pe=F;F=a((...me)=>{he[g](),pe.apply(m,me)})}const ce=(...he)=>{G||r.nextTick(()=>F.apply(m,he))};return w(m[se].promise,ce,ce),C}(I,B,U);if(!N(I))throw new l("stream",["ReadableStream","WritableStream","Stream"],I);const D=(P=B.readable)!==null&&P!==void 0?P:A(I),V=(J=B.writable)!==null&&J!==void 0?J:T(I),te=I._writableState,le=I._readableState,ee=()=>{I.writable||W()};let M=K(I)&&A(I)===D&&T(I)===V,E=b(I,!1);const W=()=>{E=!0,I.destroyed&&(M=!1),(!M||I.readable&&!D)&&(D&&!z||U.call(I))};let z=S(I,!1);const Z=()=>{z=!0,I.destroyed&&(M=!1),(!M||I.writable&&!V)&&(V&&!E||U.call(I))},R=m=>{U.call(I,m)};let ne=x(I);const Y=()=>{ne=!0;const m=L(I)||y(I);return m&&typeof m!="boolean"?U.call(I,m):D&&!z&&A(I,!0)&&!S(I,!1)?U.call(I,new d):!V||E||b(I,!1)?void U.call(I):U.call(I,new d)},ie=()=>{ne=!0;const m=L(I)||y(I);if(m&&typeof m!="boolean")return U.call(I,m);U.call(I)},ae=()=>{I.req.on("finish",W)};(function(m){return m.setHeader&&typeof m.abort=="function"})(I)?(I.on("complete",W),M||I.on("abort",Y),I.req?ae():I.on("request",ae)):V&&!te&&(I.on("end",ee),I.on("close",ee)),M||typeof I.aborted!="boolean"||I.on("aborted",Y),I.on("end",Z),I.on("finish",W),B.error!==!1&&I.on("error",R),I.on("close",Y),ne?r.nextTick(Y):te!=null&&te.errorEmitted||le!=null&&le.errorEmitted?M||r.nextTick(ie):(D||M&&!j(I)||!E&&O(I)!==!1)&&(V||M&&!O(I)||!z&&j(I)!==!1)?le&&I.req&&I.aborted&&r.nextTick(ie):r.nextTick(ie);const u=()=>{U=C,I.removeListener("aborted",Y),I.removeListener("complete",W),I.removeListener("abort",Y),I.removeListener("request",ae),I.req&&I.req.removeListener("finish",W),I.removeListener("end",ee),I.removeListener("close",ee),I.removeListener("finish",W),I.removeListener("end",Z),I.removeListener("error",R),I.removeListener("close",Y)};if(B.signal&&!ne){const m=()=>{const _=U;u(),_.call(I,new n(void 0,{cause:B.signal.reason}))};if(B.signal.aborted)r.nextTick(m);else{q=q||t(7760).addAbortListener;const _=q(B.signal,m),F=U;U=a((...G)=>{_[g](),F.apply(I,G)})}}return u}s.exports=X,s.exports.finished=function(I,B){var U;let P=!1;return B===null&&(B=i),(U=B)!==null&&U!==void 0&&U.cleanup&&(f(B.cleanup,"cleanup"),P=B.cleanup),new h((J,D)=>{const V=X(I,B,te=>{P&&V(),te?D(te):J()})})}},6532:(s,e,t)=>{const r=t(5606),{PromisePrototypeThen:n,SymbolAsyncIterator:o,SymbolIterator:l}=t(4134),{Buffer:d}=t(8287),{ERR_INVALID_ARG_TYPE:i,ERR_STREAM_NULL_VALUES:a}=t(6371).codes;s.exports=function(c,p,v){let f,h;if(typeof p=="string"||p instanceof d)return new c({objectMode:!0,...v,read(){this.push(p),this.push(null)}});if(p&&p[o])h=!0,f=p[o]();else{if(!p||!p[l])throw new i("iterable",["Iterable"],p);h=!1,f=p[l]()}const w=new c({objectMode:!0,highWaterMark:1,...v});let g=!1;return w._read=function(){g||(g=!0,async function(){for(;;){try{const{value:x,done:j}=h?await f.next():f.next();if(j)w.push(null);else{const A=x&&typeof x.then=="function"?await x:x;if(A===null)throw g=!1,new a;if(w.push(A))continue;g=!1}}catch(x){w.destroy(x)}break}}())},w._destroy=function(x,j){n(async function(A){const Q=A!=null,S=typeof f.throw=="function";if(Q&&S){const{value:y,done:O}=await f.throw(A);if(await y,O)return}if(typeof f.return=="function"){const{value:y}=await f.return();await y}}(x),()=>r.nextTick(j,x),A=>r.nextTick(j,A||x))},w}},4259:(s,e,t)=>{const{ArrayIsArray:r,ObjectSetPrototypeOf:n}=t(4134),{EventEmitter:o}=t(7007);function l(i){o.call(this,i)}function d(i,a,c){if(typeof i.prependListener=="function")return i.prependListener(a,c);i._events&&i._events[a]?r(i._events[a])?i._events[a].unshift(c):i._events[a]=[c,i._events[a]]:i.on(a,c)}n(l.prototype,o.prototype),n(l,o),l.prototype.pipe=function(i,a){const c=this;function p(j){i.writable&&i.write(j)===!1&&c.pause&&c.pause()}function v(){c.readable&&c.resume&&c.resume()}c.on("data",p),i.on("drain",v),i._isStdio||a&&a.end===!1||(c.on("end",h),c.on("close",w));let f=!1;function h(){f||(f=!0,i.end())}function w(){f||(f=!0,typeof i.destroy=="function"&&i.destroy())}function g(j){x(),o.listenerCount(this,"error")===0&&this.emit("error",j)}function x(){c.removeListener("data",p),i.removeListener("drain",v),c.removeListener("end",h),c.removeListener("close",w),c.removeListener("error",g),i.removeListener("error",g),c.removeListener("end",x),c.removeListener("close",x),i.removeListener("close",x)}return d(c,"error",g),d(i,"error",g),c.on("end",x),c.on("close",x),i.on("close",x),i.emit("pipe",c),i},s.exports={Stream:l,prependListener:d}},823:(s,e,t)=>{const r=globalThis.AbortController||t(5568).AbortController,{codes:{ERR_INVALID_ARG_VALUE:n,ERR_INVALID_ARG_TYPE:o,ERR_MISSING_ARGS:l,ERR_OUT_OF_RANGE:d},AbortError:i}=t(6371),{validateAbortSignal:a,validateInteger:c,validateObject:p}=t(277),v=t(4134).Symbol("kWeak"),f=t(4134).Symbol("kResistStopPropagation"),{finished:h}=t(6238),w=t(7830),{addAbortSignalNoValidate:g}=t(4147),{isWritable:x,isNodeStream:j}=t(6115),{deprecate:A}=t(7760),{ArrayPrototypePush:Q,Boolean:S,MathFloor:y,Number:O,NumberIsNaN:T,Promise:k,PromiseReject:b,PromiseResolve:L,PromisePrototypeThen:N,Symbol:K}=t(4134),se=K("kEmpty"),q=K("kEof");function C(P,J){if(typeof P!="function")throw new o("fn",["Function","AsyncFunction"],P);J!=null&&p(J,"options"),(J==null?void 0:J.signal)!=null&&a(J.signal,"options.signal");let D=1;(J==null?void 0:J.concurrency)!=null&&(D=y(J.concurrency));let V=D-1;return(J==null?void 0:J.highWaterMark)!=null&&(V=y(J.highWaterMark)),c(D,"options.concurrency",1),c(V,"options.highWaterMark",0),V+=D,(async function*(){const te=t(7760).AbortSignalAny([J==null?void 0:J.signal].filter(S)),le=this,ee=[],M={signal:te};let E,W,z=!1,Z=0;function R(){z=!0,ne()}function ne(){Z-=1,Y()}function Y(){W&&!z&&Z=V||Z>=D)&&await new k(ae=>{W=ae})}ee.push(q)}catch(ie){const ae=b(ie);N(ae,ne,R),ee.push(ae)}finally{z=!0,E&&(E(),E=null)}})();try{for(;;){for(;ee.length>0;){const ie=await ee[0];if(ie===q)return;if(te.aborted)throw new i;ie!==se&&(yield ie),ee.shift(),Y()}await new k(ie=>{E=ie})}}finally{z=!0,W&&(W(),W=null)}}).call(this)}async function X(P,J=void 0){for await(const D of I.call(this,P,J))return!0;return!1}function I(P,J){if(typeof P!="function")throw new o("fn",["Function","AsyncFunction"],P);return C.call(this,async function(D,V){return await P(D,V)?D:se},J)}class B extends l{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}function U(P){if(P=O(P),T(P))return 0;if(P<0)throw new d("number",">= 0",P);return P}s.exports.streamReturningOperators={asIndexedPairs:A(function(P=void 0){return P!=null&&p(P,"options"),(P==null?void 0:P.signal)!=null&&a(P.signal,"options.signal"),(async function*(){let J=0;for await(const V of this){var D;if(P!=null&&(D=P.signal)!==null&&D!==void 0&&D.aborted)throw new i({cause:P.signal.reason});yield[J++,V]}}).call(this)},"readable.asIndexedPairs will be removed in a future version."),drop:function(P,J=void 0){return J!=null&&p(J,"options"),(J==null?void 0:J.signal)!=null&&a(J.signal,"options.signal"),P=U(P),(async function*(){var D;if(J!=null&&(D=J.signal)!==null&&D!==void 0&&D.aborted)throw new i;for await(const te of this){var V;if(J!=null&&(V=J.signal)!==null&&V!==void 0&&V.aborted)throw new i;P--<=0&&(yield te)}}).call(this)},filter:I,flatMap:function(P,J){const D=C.call(this,P,J);return(async function*(){for await(const V of D)yield*V}).call(this)},map:C,take:function(P,J=void 0){return J!=null&&p(J,"options"),(J==null?void 0:J.signal)!=null&&a(J.signal,"options.signal"),P=U(P),(async function*(){var D;if(J!=null&&(D=J.signal)!==null&&D!==void 0&&D.aborted)throw new i;for await(const te of this){var V;if(J!=null&&(V=J.signal)!==null&&V!==void 0&&V.aborted)throw new i;if(P-- >0&&(yield te),P<=0)return}}).call(this)},compose:function(P,J){if(J!=null&&p(J,"options"),(J==null?void 0:J.signal)!=null&&a(J.signal,"options.signal"),j(P)&&!x(P))throw new n("stream",P,"must be writable");const D=w(this,P);return J!=null&&J.signal&&g(J.signal,D),D}},s.exports.promiseReturningOperators={every:async function(P,J=void 0){if(typeof P!="function")throw new o("fn",["Function","AsyncFunction"],P);return!await X.call(this,async(...D)=>!await P(...D),J)},forEach:async function(P,J){if(typeof P!="function")throw new o("fn",["Function","AsyncFunction"],P);for await(const D of C.call(this,async function(V,te){return await P(V,te),se},J));},reduce:async function(P,J,D){var V;if(typeof P!="function")throw new o("reducer",["Function","AsyncFunction"],P);D!=null&&p(D,"options"),(D==null?void 0:D.signal)!=null&&a(D.signal,"options.signal");let te=arguments.length>1;if(D!=null&&(V=D.signal)!==null&&V!==void 0&&V.aborted){const W=new i(void 0,{cause:D.signal.reason});throw this.once("error",()=>{}),await h(this.destroy(W)),W}const le=new r,ee=le.signal;if(D!=null&&D.signal){const W={once:!0,[v]:this,[f]:!0};D.signal.addEventListener("abort",()=>le.abort(),W)}let M=!1;try{for await(const W of this){var E;if(M=!0,D!=null&&(E=D.signal)!==null&&E!==void 0&&E.aborted)throw new i;te?J=await P(J,W,{signal:ee}):(J=W,te=!0)}if(!M&&!te)throw new B}finally{le.abort()}return J},toArray:async function(P){P!=null&&p(P,"options"),(P==null?void 0:P.signal)!=null&&a(P.signal,"options.signal");const J=[];for await(const V of this){var D;if(P!=null&&(D=P.signal)!==null&&D!==void 0&&D.aborted)throw new i(void 0,{cause:P.signal.reason});Q(J,V)}return J},some:X,find:async function(P,J){for await(const D of I.call(this,P,J))return D}}},6524:(s,e,t)=>{const{ObjectSetPrototypeOf:r}=t(4134);s.exports=o;const n=t(5001);function o(l){if(!(this instanceof o))return new o(l);n.call(this,l)}r(o.prototype,n.prototype),r(o,n),o.prototype._transform=function(l,d,i){i(null,l)}},7758:(s,e,t)=>{const r=t(5606),{ArrayIsArray:n,Promise:o,SymbolAsyncIterator:l,SymbolDispose:d}=t(4134),i=t(6238),{once:a}=t(7760),c=t(5896),p=t(3370),{aggregateTwoErrors:v,codes:{ERR_INVALID_ARG_TYPE:f,ERR_INVALID_RETURN_VALUE:h,ERR_MISSING_ARGS:w,ERR_STREAM_DESTROYED:g,ERR_STREAM_PREMATURE_CLOSE:x},AbortError:j}=t(6371),{validateFunction:A,validateAbortSignal:Q}=t(277),{isIterable:S,isReadable:y,isReadableNodeStream:O,isNodeStream:T,isTransformStream:k,isWebStream:b,isReadableStream:L,isReadableFinished:N}=t(6115),K=globalThis.AbortController||t(5568).AbortController;let se,q,C;function X(D,V,te){let le=!1;return D.on("close",()=>{le=!0}),{destroy:ee=>{le||(le=!0,c.destroyer(D,ee||new g("pipe")))},cleanup:i(D,{readable:V,writable:te},ee=>{le=!ee})}}function I(D){if(S(D))return D;if(O(D))return async function*(V){q||(q=t(7576)),yield*q.prototype[l].call(V)}(D);throw new f("val",["Readable","Iterable","AsyncIterable"],D)}async function B(D,V,te,{end:le}){let ee,M=null;const E=Z=>{if(Z&&(ee=Z),M){const R=M;M=null,R()}},W=()=>new o((Z,R)=>{ee?R(ee):M=()=>{ee?R(ee):Z()}});V.on("drain",E);const z=i(V,{readable:!1},E);try{V.writableNeedDrain&&await W();for await(const Z of D)V.write(Z)||await W();le&&(V.end(),await W()),te()}catch(Z){te(ee!==Z?v(ee,Z):Z)}finally{z(),V.off("drain",E)}}async function U(D,V,te,{end:le}){k(V)&&(V=V.writable);const ee=V.getWriter();try{for await(const M of D)await ee.ready,ee.write(M).catch(()=>{});await ee.ready,le&&await ee.close(),te()}catch(M){try{await ee.abort(M),te(M)}catch(E){te(E)}}}function P(D,V,te){if(D.length===1&&n(D[0])&&(D=D[0]),D.length<2)throw new w("streams");const le=new K,ee=le.signal,M=te==null?void 0:te.signal,E=[];function W(){u(new j)}let z,Z,R;Q(M,"options.signal"),C=C||t(7760).addAbortListener,M&&(z=C(M,W));const ne=[];let Y,ie=0;function ae(F){u(F,--ie==0)}function u(F,G){var re;if(!F||Z&&Z.code!=="ERR_STREAM_PREMATURE_CLOSE"||(Z=F),Z||G){for(;ne.length;)ne.shift()(Z);(re=z)===null||re===void 0||re[d](),le.abort(),G&&(Z||E.forEach(ce=>ce()),r.nextTick(V,Z,R))}}for(let F=0;F0,he=re||(te==null?void 0:te.end)!==!1,pe=F===D.length-1;if(T(G)){let me=function(ge){ge&&ge.name!=="AbortError"&&ge.code!=="ERR_STREAM_PREMATURE_CLOSE"&&ae(ge)};if(he){const{destroy:ge,cleanup:_e}=X(G,re,ce);ne.push(ge),y(G)&&pe&&E.push(_e)}G.on("error",me),y(G)&&pe&&E.push(()=>{G.removeListener("error",me)})}if(F===0)if(typeof G=="function"){if(Y=G({signal:ee}),!S(Y))throw new h("Iterable, AsyncIterable or Stream","source",Y)}else Y=S(G)||O(G)||k(G)?G:p.from(G);else if(typeof G=="function"){var m;if(Y=k(Y)?I((m=Y)===null||m===void 0?void 0:m.readable):I(Y),Y=G(Y,{signal:ee}),re){if(!S(Y,!0))throw new h("AsyncIterable",`transform[${F-1}]`,Y)}else{var _;se||(se=t(6524));const me=new se({objectMode:!0}),ge=(_=Y)===null||_===void 0?void 0:_.then;if(typeof ge=="function")ie++,ge.call(Y,Pe=>{R=Pe,Pe!=null&&me.write(Pe),he&&me.end(),r.nextTick(ae)},Pe=>{me.destroy(Pe),r.nextTick(ae,Pe)});else if(S(Y,!0))ie++,B(Y,me,ae,{end:he});else{if(!L(Y)&&!k(Y))throw new h("AsyncIterable or Promise","destination",Y);{const Pe=Y.readable||Y;ie++,B(Pe,me,ae,{end:he})}}Y=me;const{destroy:_e,cleanup:it}=X(Y,!1,!0);ne.push(_e),pe&&E.push(it)}}else if(T(G)){if(O(Y)){ie+=2;const me=J(Y,G,ae,{end:he});y(G)&&pe&&E.push(me)}else if(k(Y)||L(Y)){const me=Y.readable||Y;ie++,B(me,G,ae,{end:he})}else{if(!S(Y))throw new f("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Y);ie++,B(Y,G,ae,{end:he})}Y=G}else if(b(G)){if(O(Y))ie++,U(I(Y),G,ae,{end:he});else if(L(Y)||S(Y))ie++,U(Y,G,ae,{end:he});else{if(!k(Y))throw new f("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Y);ie++,U(Y.readable,G,ae,{end:he})}Y=G}else Y=p.from(G)}return(ee!=null&&ee.aborted||M!=null&&M.aborted)&&r.nextTick(W),Y}function J(D,V,te,{end:le}){let ee=!1;if(V.on("close",()=>{ee||te(new x)}),D.pipe(V,{end:!1}),le){let M=function(){ee=!0,V.end()};N(D)?r.nextTick(M):D.once("end",M)}else te();return i(D,{readable:!0,writable:!1},M=>{const E=D._readableState;M&&M.code==="ERR_STREAM_PREMATURE_CLOSE"&&E&&E.ended&&!E.errored&&!E.errorEmitted?D.once("end",te).once("error",te):te(M)}),i(V,{readable:!1,writable:!0},te)}s.exports={pipelineImpl:P,pipeline:function(...D){return P(D,a(function(V){return A(V[V.length-1],"streams[stream.length - 1]"),V.pop()}(D)))}}},7576:(s,e,t)=>{const r=t(5606),{ArrayPrototypeIndexOf:n,NumberIsInteger:o,NumberIsNaN:l,NumberParseInt:d,ObjectDefineProperties:i,ObjectKeys:a,ObjectSetPrototypeOf:c,Promise:p,SafeSet:v,SymbolAsyncDispose:f,SymbolAsyncIterator:h,Symbol:w}=t(4134);s.exports=R,R.ReadableState=Z;const{EventEmitter:g}=t(7007),{Stream:x,prependListener:j}=t(4259),{Buffer:A}=t(8287),{addAbortSignal:Q}=t(4147),S=t(6238);let y=t(7760).debuglog("stream",$=>{y=$});const O=t(345),T=t(5896),{getHighWaterMark:k,getDefaultHighWaterMark:b}=t(5291),{aggregateTwoErrors:L,codes:{ERR_INVALID_ARG_TYPE:N,ERR_METHOD_NOT_IMPLEMENTED:K,ERR_OUT_OF_RANGE:se,ERR_STREAM_PUSH_AFTER_EOF:q,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:C},AbortError:X}=t(6371),{validateObject:I}=t(277),B=w("kPaused"),{StringDecoder:U}=t(3141),P=t(6532);c(R.prototype,x.prototype),c(R,x);const J=()=>{},{errorOrDestroy:D}=T,V=1,te=16,le=32,ee=64,M=2048,E=4096,W=65536;function z($){return{enumerable:!1,get(){return!!(this.state&$)},set(H){H?this.state|=$:this.state&=~$}}}function Z($,H,de){typeof de!="boolean"&&(de=H instanceof t(3370)),this.state=M|E|te|le,$&&$.objectMode&&(this.state|=V),de&&$&&$.readableObjectMode&&(this.state|=V),this.highWaterMark=$?k(this,$,"readableHighWaterMark",de):b(!1),this.buffer=new O,this.length=0,this.pipes=[],this.flowing=null,this[B]=null,$&&$.emitClose===!1&&(this.state&=~M),$&&$.autoDestroy===!1&&(this.state&=~E),this.errored=null,this.defaultEncoding=$&&$.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,$&&$.encoding&&(this.decoder=new U($.encoding),this.encoding=$.encoding)}function R($){if(!(this instanceof R))return new R($);const H=this instanceof t(3370);this._readableState=new Z($,this,H),$&&(typeof $.read=="function"&&(this._read=$.read),typeof $.destroy=="function"&&(this._destroy=$.destroy),typeof $.construct=="function"&&(this._construct=$.construct),$.signal&&!H&&Q($.signal,this)),x.call(this,$),T.construct(this,()=>{this._readableState.needReadable&&m(this,this._readableState)})}function ne($,H,de,ue){y("readableAddChunk",H);const fe=$._readableState;let ve;if(fe.state&V||(typeof H=="string"?(de=de||fe.defaultEncoding,fe.encoding!==de&&(ue&&fe.encoding?H=A.from(H,de).toString(fe.encoding):(H=A.from(H,de),de=""))):H instanceof A?de="":x._isUint8Array(H)?(H=x._uint8ArrayToBuffer(H),de=""):H!=null&&(ve=new N("chunk",["string","Buffer","Uint8Array"],H))),ve)D($,ve);else if(H===null)fe.state&=-9,function(Ne,Ie){if(y("onEofChunk"),!Ie.ended){if(Ie.decoder){const ze=Ie.decoder.end();ze&&ze.length&&(Ie.buffer.push(ze),Ie.length+=Ie.objectMode?1:ze.length)}Ie.ended=!0,Ie.sync?ae(Ne):(Ie.needReadable=!1,Ie.emittedReadable=!0,u(Ne))}}($,fe);else if(fe.state&V||H&&H.length>0)if(ue)if(4&fe.state)D($,new C);else{if(fe.destroyed||fe.errored)return!1;Y($,fe,H,!0)}else if(fe.ended)D($,new q);else{if(fe.destroyed||fe.errored)return!1;fe.state&=-9,fe.decoder&&!de?(H=fe.decoder.write(H),fe.objectMode||H.length!==0?Y($,fe,H,!1):m($,fe)):Y($,fe,H,!1)}else ue||(fe.state&=-9,m($,fe));return!fe.ended&&(fe.length0?(H.state&W?H.awaitDrainWriters.clear():H.awaitDrainWriters=null,H.dataEmitted=!0,$.emit("data",de)):(H.length+=H.objectMode?1:de.length,ue?H.buffer.unshift(de):H.buffer.push(de),H.state&ee&&ae($)),m($,H)}function ie($,H){return $<=0||H.length===0&&H.ended?0:H.state&V?1:l($)?H.flowing&&H.length?H.buffer.first().length:H.length:$<=H.length?$:H.ended?H.length:0}function ae($){const H=$._readableState;y("emitReadable",H.needReadable,H.emittedReadable),H.needReadable=!1,H.emittedReadable||(y("emitReadable",H.flowing),H.emittedReadable=!0,r.nextTick(u,$))}function u($){const H=$._readableState;y("emitReadable_",H.destroyed,H.length,H.ended),H.destroyed||H.errored||!H.length&&!H.ended||($.emit("readable"),H.emittedReadable=!1),H.needReadable=!H.flowing&&!H.ended&&H.length<=H.highWaterMark,ce($)}function m($,H){!H.readingMore&&H.constructed&&(H.readingMore=!0,r.nextTick(_,$,H))}function _($,H){for(;!H.reading&&!H.ended&&(H.length0,H.resumeScheduled&&H[B]===!1?H.flowing=!0:$.listenerCount("data")>0?$.resume():H.readableListening||(H.flowing=null)}function G($){y("readable nexttick read 0"),$.read(0)}function re($,H){y("resume",H.reading),H.reading||$.read(0),H.resumeScheduled=!1,$.emit("resume"),ce($),H.flowing&&!H.reading&&$.read(0)}function ce($){const H=$._readableState;for(y("flow",H.flowing);H.flowing&&$.read()!==null;);}function he($,H){typeof $.read!="function"&&($=R.wrap($,{objectMode:!0}));const de=async function*(ue,fe){let ve,Ne=J;function Ie(Ce){this===ue?(Ne(),Ne=J):Ne=Ce}ue.on("readable",Ie);const ze=S(ue,{writable:!1},Ce=>{ve=Ce?L(ve,Ce):null,Ne(),Ne=J});try{for(;;){const Ce=ue.destroyed?null:ue.read();if(Ce!==null)yield Ce;else{if(ve)throw ve;if(ve===null)return;await new p(Ie)}}}catch(Ce){throw ve=L(ve,Ce),ve}finally{!ve&&(fe==null?void 0:fe.destroyOnReturn)===!1||ve!==void 0&&!ue._readableState.autoDestroy?(ue.off("readable",Ie),ze()):T.destroyer(ue,null)}}($,H);return de.stream=$,de}function pe($,H){if(H.length===0)return null;let de;return H.objectMode?de=H.buffer.shift():!$||$>=H.length?(de=H.decoder?H.buffer.join(""):H.buffer.length===1?H.buffer.first():H.buffer.concat(H.length),H.buffer.clear()):de=H.buffer.consume($,H.decoder),de}function me($){const H=$._readableState;y("endReadable",H.endEmitted),H.endEmitted||(H.ended=!0,r.nextTick(ge,H,$))}function ge($,H){if(y("endReadableNT",$.endEmitted,$.length),!$.errored&&!$.closeEmitted&&!$.endEmitted&&$.length===0){if($.endEmitted=!0,H.emit("end"),H.writable&&H.allowHalfOpen===!1)r.nextTick(_e,H);else if($.autoDestroy){const de=H._writableState;(!de||de.autoDestroy&&(de.finished||de.writable===!1))&&H.destroy()}}}function _e($){$.writable&&!$.writableEnded&&!$.destroyed&&$.end()}let it;function Pe(){return it===void 0&&(it={}),it}i(Z.prototype,{objectMode:z(V),ended:z(2),endEmitted:z(4),reading:z(8),constructed:z(te),sync:z(le),needReadable:z(ee),emittedReadable:z(128),readableListening:z(256),resumeScheduled:z(512),errorEmitted:z(1024),emitClose:z(M),autoDestroy:z(E),destroyed:z(8192),closed:z(16384),closeEmitted:z(32768),multiAwaitDrain:z(W),readingMore:z(1<<17),dataEmitted:z(1<<18)}),R.prototype.destroy=T.destroy,R.prototype._undestroy=T.undestroy,R.prototype._destroy=function($,H){H($)},R.prototype[g.captureRejectionSymbol]=function($){this.destroy($)},R.prototype[f]=function(){let $;return this.destroyed||($=this.readableEnded?null:new X,this.destroy($)),new p((H,de)=>S(this,ue=>ue&&ue!==$?de(ue):H(null)))},R.prototype.push=function($,H){return ne(this,$,H,!1)},R.prototype.unshift=function($,H){return ne(this,$,H,!0)},R.prototype.isPaused=function(){const $=this._readableState;return $[B]===!0||$.flowing===!1},R.prototype.setEncoding=function($){const H=new U($);this._readableState.decoder=H,this._readableState.encoding=this._readableState.decoder.encoding;const de=this._readableState.buffer;let ue="";for(const fe of de)ue+=H.write(fe);return de.clear(),ue!==""&&de.push(ue),this._readableState.length=ue.length,this},R.prototype.read=function($){y("read",$),$===void 0?$=NaN:o($)||($=d($,10));const H=this._readableState,de=$;if($>H.highWaterMark&&(H.highWaterMark=function(ve){if(ve>1073741824)throw new se("size","<= 1GiB",ve);return ve--,ve|=ve>>>1,ve|=ve>>>2,ve|=ve>>>4,ve|=ve>>>8,ve|=ve>>>16,++ve}($)),$!==0&&(H.state&=-129),$===0&&H.needReadable&&((H.highWaterMark!==0?H.length>=H.highWaterMark:H.length>0)||H.ended))return y("read: emitReadable",H.length,H.ended),H.length===0&&H.ended?me(this):ae(this),null;if(($=ie($,H))===0&&H.ended)return H.length===0&&me(this),null;let ue,fe=!!(H.state&ee);if(y("need readable",fe),(H.length===0||H.length-$0?pe($,H):null,ue===null?(H.needReadable=H.length<=H.highWaterMark,$=0):(H.length-=$,H.multiAwaitDrain?H.awaitDrainWriters.clear():H.awaitDrainWriters=null),H.length===0&&(H.ended||(H.needReadable=!0),de!==$&&H.ended&&me(this)),ue===null||H.errorEmitted||H.closeEmitted||(H.dataEmitted=!0,this.emit("data",ue)),ue},R.prototype._read=function($){throw new K("_read()")},R.prototype.pipe=function($,H){const de=this,ue=this._readableState;ue.pipes.length===1&&(ue.multiAwaitDrain||(ue.multiAwaitDrain=!0,ue.awaitDrainWriters=new v(ue.awaitDrainWriters?[ue.awaitDrainWriters]:[]))),ue.pipes.push($),y("pipe count=%d opts=%j",ue.pipes.length,H);const fe=H&&H.end===!1||$===r.stdout||$===r.stderr?st:ve;function ve(){y("onend"),$.end()}let Ne;ue.endEmitted?r.nextTick(fe):de.once("end",fe),$.on("unpipe",function $e(Ge,Be){y("onunpipe"),Ge===de&&Be&&Be.hasUnpiped===!1&&(Be.hasUnpiped=!0,y("cleanup"),$.removeListener("close",Lt),$.removeListener("finish",At),Ne&&$.removeListener("drain",Ne),$.removeListener("error",kt),$.removeListener("unpipe",$e),de.removeListener("end",ve),de.removeListener("end",st),de.removeListener("data",Ce),Ie=!0,Ne&&ue.awaitDrainWriters&&(!$._writableState||$._writableState.needDrain)&&Ne())});let Ie=!1;function ze(){Ie||(ue.pipes.length===1&&ue.pipes[0]===$?(y("false write response, pause",0),ue.awaitDrainWriters=$,ue.multiAwaitDrain=!1):ue.pipes.length>1&&ue.pipes.includes($)&&(y("false write response, pause",ue.awaitDrainWriters.size),ue.awaitDrainWriters.add($)),de.pause()),Ne||(Ne=function($e,Ge){return function(){const Be=$e._readableState;Be.awaitDrainWriters===Ge?(y("pipeOnDrain",1),Be.awaitDrainWriters=null):Be.multiAwaitDrain&&(y("pipeOnDrain",Be.awaitDrainWriters.size),Be.awaitDrainWriters.delete(Ge)),Be.awaitDrainWriters&&Be.awaitDrainWriters.size!==0||!$e.listenerCount("data")||$e.resume()}}(de,$),$.on("drain",Ne))}function Ce($e){y("ondata");const Ge=$.write($e);y("dest.write",Ge),Ge===!1&&ze()}function kt($e){if(y("onerror",$e),st(),$.removeListener("error",kt),$.listenerCount("error")===0){const Ge=$._writableState||$._readableState;Ge&&!Ge.errorEmitted?D($,$e):$.emit("error",$e)}}function Lt(){$.removeListener("finish",At),st()}function At(){y("onfinish"),$.removeListener("close",Lt),st()}function st(){y("unpipe"),de.unpipe($)}return de.on("data",Ce),j($,"error",kt),$.once("close",Lt),$.once("finish",At),$.emit("pipe",de),$.writableNeedDrain===!0?ze():ue.flowing||(y("pipe resume"),de.resume()),$},R.prototype.unpipe=function($){const H=this._readableState;if(H.pipes.length===0)return this;if(!$){const ue=H.pipes;H.pipes=[],this.pause();for(let fe=0;fe0,ue.flowing!==!1&&this.resume()):$==="readable"&&(ue.endEmitted||ue.readableListening||(ue.readableListening=ue.needReadable=!0,ue.flowing=!1,ue.emittedReadable=!1,y("on readable",ue.length,ue.reading),ue.length?ae(this):ue.reading||r.nextTick(G,this))),de},R.prototype.addListener=R.prototype.on,R.prototype.removeListener=function($,H){const de=x.prototype.removeListener.call(this,$,H);return $==="readable"&&r.nextTick(F,this),de},R.prototype.off=R.prototype.removeListener,R.prototype.removeAllListeners=function($){const H=x.prototype.removeAllListeners.apply(this,arguments);return $!=="readable"&&$!==void 0||r.nextTick(F,this),H},R.prototype.resume=function(){const $=this._readableState;return $.flowing||(y("resume"),$.flowing=!$.readableListening,function(H,de){de.resumeScheduled||(de.resumeScheduled=!0,r.nextTick(re,H,de))}(this,$)),$[B]=!1,this},R.prototype.pause=function(){return y("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(y("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[B]=!0,this},R.prototype.wrap=function($){let H=!1;$.on("data",ue=>{!this.push(ue)&&$.pause&&(H=!0,$.pause())}),$.on("end",()=>{this.push(null)}),$.on("error",ue=>{D(this,ue)}),$.on("close",()=>{this.destroy()}),$.on("destroy",()=>{this.destroy()}),this._read=()=>{H&&$.resume&&(H=!1,$.resume())};const de=a($);for(let ue=1;ue{const{MathFloor:r,NumberIsInteger:n}=t(4134),{validateInteger:o}=t(277),{ERR_INVALID_ARG_VALUE:l}=t(6371).codes;let d=16384,i=16;function a(c){return c?i:d}s.exports={getHighWaterMark:function(c,p,v,f){const h=function(w,g,x){return w.highWaterMark!=null?w.highWaterMark:g?w[x]:null}(p,f,v);if(h!=null){if(!n(h)||h<0)throw new l(f?`options.${v}`:"options.highWaterMark",h);return r(h)}return a(c.objectMode)},getDefaultHighWaterMark:a,setDefaultHighWaterMark:function(c,p){o(p,"value",0),c?i=p:d=p}}},5001:(s,e,t)=>{const{ObjectSetPrototypeOf:r,Symbol:n}=t(4134);s.exports=a;const{ERR_METHOD_NOT_IMPLEMENTED:o}=t(6371).codes,l=t(3370),{getHighWaterMark:d}=t(5291);r(a.prototype,l.prototype),r(a,l);const i=n("kCallback");function a(v){if(!(this instanceof a))return new a(v);const f=v?d(this,v,"readableHighWaterMark",!0):null;f===0&&(v={...v,highWaterMark:null,readableHighWaterMark:f,writableHighWaterMark:v.writableHighWaterMark||0}),l.call(this,v),this._readableState.sync=!1,this[i]=null,v&&(typeof v.transform=="function"&&(this._transform=v.transform),typeof v.flush=="function"&&(this._flush=v.flush)),this.on("prefinish",p)}function c(v){typeof this._flush!="function"||this.destroyed?(this.push(null),v&&v()):this._flush((f,h)=>{f?v?v(f):this.destroy(f):(h!=null&&this.push(h),this.push(null),v&&v())})}function p(){this._final!==c&&c.call(this)}a.prototype._final=c,a.prototype._transform=function(v,f,h){throw new o("_transform()")},a.prototype._write=function(v,f,h){const w=this._readableState,g=this._writableState,x=w.length;this._transform(v,f,(j,A)=>{j?h(j):(A!=null&&this.push(A),g.ended||x===w.length||w.length{const{SymbolAsyncIterator:r,SymbolIterator:n,SymbolFor:o}=t(4134),l=o("nodejs.stream.destroyed"),d=o("nodejs.stream.errored"),i=o("nodejs.stream.readable"),a=o("nodejs.stream.writable"),c=o("nodejs.stream.disturbed"),p=o("nodejs.webstream.isClosedPromise"),v=o("nodejs.webstream.controllerErrorFunction");function f(b,L=!1){var N;return!(!b||typeof b.pipe!="function"||typeof b.on!="function"||L&&(typeof b.pause!="function"||typeof b.resume!="function")||b._writableState&&((N=b._readableState)===null||N===void 0?void 0:N.readable)===!1||b._writableState&&!b._readableState)}function h(b){var L;return!(!b||typeof b.write!="function"||typeof b.on!="function"||b._readableState&&((L=b._writableState)===null||L===void 0?void 0:L.writable)===!1)}function w(b){return b&&(b._readableState||b._writableState||typeof b.write=="function"&&typeof b.on=="function"||typeof b.pipe=="function"&&typeof b.on=="function")}function g(b){return!(!b||w(b)||typeof b.pipeThrough!="function"||typeof b.getReader!="function"||typeof b.cancel!="function")}function x(b){return!(!b||w(b)||typeof b.getWriter!="function"||typeof b.abort!="function")}function j(b){return!(!b||w(b)||typeof b.readable!="object"||typeof b.writable!="object")}function A(b){if(!w(b))return null;const L=b._writableState,N=b._readableState,K=L||N;return!!(b.destroyed||b[l]||K!=null&&K.destroyed)}function Q(b){if(!h(b))return null;if(b.writableEnded===!0)return!0;const L=b._writableState;return(L==null||!L.errored)&&(typeof(L==null?void 0:L.ended)!="boolean"?null:L.ended)}function S(b,L){if(!f(b))return null;const N=b._readableState;return(N==null||!N.errored)&&(typeof(N==null?void 0:N.endEmitted)!="boolean"?null:!!(N.endEmitted||L===!1&&N.ended===!0&&N.length===0))}function y(b){return b&&b[i]!=null?b[i]:typeof(b==null?void 0:b.readable)!="boolean"?null:!A(b)&&f(b)&&b.readable&&!S(b)}function O(b){return b&&b[a]!=null?b[a]:typeof(b==null?void 0:b.writable)!="boolean"?null:!A(b)&&h(b)&&b.writable&&!Q(b)}function T(b){return typeof b._closed=="boolean"&&typeof b._defaultKeepAlive=="boolean"&&typeof b._removedConnection=="boolean"&&typeof b._removedContLen=="boolean"}function k(b){return typeof b._sent100=="boolean"&&T(b)}s.exports={isDestroyed:A,kIsDestroyed:l,isDisturbed:function(b){var L;return!(!b||!((L=b[c])!==null&&L!==void 0?L:b.readableDidRead||b.readableAborted))},kIsDisturbed:c,isErrored:function(b){var L,N,K,se,q,C,X,I,B,U;return!(!b||!((L=(N=(K=(se=(q=(C=b[d])!==null&&C!==void 0?C:b.readableErrored)!==null&&q!==void 0?q:b.writableErrored)!==null&&se!==void 0?se:(X=b._readableState)===null||X===void 0?void 0:X.errorEmitted)!==null&&K!==void 0?K:(I=b._writableState)===null||I===void 0?void 0:I.errorEmitted)!==null&&N!==void 0?N:(B=b._readableState)===null||B===void 0?void 0:B.errored)!==null&&L!==void 0?L:!((U=b._writableState)===null||U===void 0)&&U.errored))},kIsErrored:d,isReadable:y,kIsReadable:i,kIsClosedPromise:p,kControllerErrorFunction:v,kIsWritable:a,isClosed:function(b){if(!w(b))return null;if(typeof b.closed=="boolean")return b.closed;const L=b._writableState,N=b._readableState;return typeof(L==null?void 0:L.closed)=="boolean"||typeof(N==null?void 0:N.closed)=="boolean"?(L==null?void 0:L.closed)||(N==null?void 0:N.closed):typeof b._closed=="boolean"&&T(b)?b._closed:null},isDuplexNodeStream:function(b){return!(!b||typeof b.pipe!="function"||!b._readableState||typeof b.on!="function"||typeof b.write!="function")},isFinished:function(b,L){return w(b)?!(!A(b)&&((L==null?void 0:L.readable)!==!1&&y(b)||(L==null?void 0:L.writable)!==!1&&O(b))):null},isIterable:function(b,L){return b!=null&&(L===!0?typeof b[r]=="function":L===!1?typeof b[n]=="function":typeof b[r]=="function"||typeof b[n]=="function")},isReadableNodeStream:f,isReadableStream:g,isReadableEnded:function(b){if(!f(b))return null;if(b.readableEnded===!0)return!0;const L=b._readableState;return!(!L||L.errored)&&(typeof(L==null?void 0:L.ended)!="boolean"?null:L.ended)},isReadableFinished:S,isReadableErrored:function(b){var L,N;return w(b)?b.readableErrored?b.readableErrored:(L=(N=b._readableState)===null||N===void 0?void 0:N.errored)!==null&&L!==void 0?L:null:null},isNodeStream:w,isWebStream:function(b){return g(b)||x(b)||j(b)},isWritable:O,isWritableNodeStream:h,isWritableStream:x,isWritableEnded:Q,isWritableFinished:function(b,L){if(!h(b))return null;if(b.writableFinished===!0)return!0;const N=b._writableState;return(N==null||!N.errored)&&(typeof(N==null?void 0:N.finished)!="boolean"?null:!!(N.finished||L===!1&&N.ended===!0&&N.length===0))},isWritableErrored:function(b){var L,N;return w(b)?b.writableErrored?b.writableErrored:(L=(N=b._writableState)===null||N===void 0?void 0:N.errored)!==null&&L!==void 0?L:null:null},isServerRequest:function(b){var L;return typeof b._consuming=="boolean"&&typeof b._dumped=="boolean"&&((L=b.req)===null||L===void 0?void 0:L.upgradeOrConnect)===void 0},isServerResponse:k,willEmitClose:function(b){if(!w(b))return null;const L=b._writableState,N=b._readableState,K=L||N;return!K&&k(b)||!!(K&&K.autoDestroy&&K.emitClose&&K.closed===!1)},isTransformStream:j}},8584:(s,e,t)=>{const r=t(5606),{ArrayPrototypeSlice:n,Error:o,FunctionPrototypeSymbolHasInstance:l,ObjectDefineProperty:d,ObjectDefineProperties:i,ObjectSetPrototypeOf:a,StringPrototypeToLowerCase:c,Symbol:p,SymbolHasInstance:v}=t(4134);s.exports=I,I.WritableState=C;const{EventEmitter:f}=t(7007),h=t(4259).Stream,{Buffer:w}=t(8287),g=t(5896),{addAbortSignal:x}=t(4147),{getHighWaterMark:j,getDefaultHighWaterMark:A}=t(5291),{ERR_INVALID_ARG_TYPE:Q,ERR_METHOD_NOT_IMPLEMENTED:S,ERR_MULTIPLE_CALLBACK:y,ERR_STREAM_CANNOT_PIPE:O,ERR_STREAM_DESTROYED:T,ERR_STREAM_ALREADY_FINISHED:k,ERR_STREAM_NULL_VALUES:b,ERR_STREAM_WRITE_AFTER_END:L,ERR_UNKNOWN_ENCODING:N}=t(6371).codes,{errorOrDestroy:K}=g;function se(){}a(I.prototype,h.prototype),a(I,h);const q=p("kOnFinished");function C(R,ne,Y){typeof Y!="boolean"&&(Y=ne instanceof t(3370)),this.objectMode=!(!R||!R.objectMode),Y&&(this.objectMode=this.objectMode||!(!R||!R.writableObjectMode)),this.highWaterMark=R?j(this,R,"writableHighWaterMark",Y):A(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const ie=!(!R||R.decodeStrings!==!1);this.decodeStrings=!ie,this.defaultEncoding=R&&R.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=J.bind(void 0,ne),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,X(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!R||R.emitClose!==!1,this.autoDestroy=!R||R.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[q]=[]}function X(R){R.buffered=[],R.bufferedIndex=0,R.allBuffers=!0,R.allNoop=!0}function I(R){const ne=this instanceof t(3370);if(!ne&&!l(I,this))return new I(R);this._writableState=new C(R,this,ne),R&&(typeof R.write=="function"&&(this._write=R.write),typeof R.writev=="function"&&(this._writev=R.writev),typeof R.destroy=="function"&&(this._destroy=R.destroy),typeof R.final=="function"&&(this._final=R.final),typeof R.construct=="function"&&(this._construct=R.construct),R.signal&&x(R.signal,this)),h.call(this,R),g.construct(this,()=>{const Y=this._writableState;Y.writing||le(this,Y),M(this,Y)})}function B(R,ne,Y,ie){const ae=R._writableState;if(typeof Y=="function")ie=Y,Y=ae.defaultEncoding;else{if(Y){if(Y!=="buffer"&&!w.isEncoding(Y))throw new N(Y)}else Y=ae.defaultEncoding;typeof ie!="function"&&(ie=se)}if(ne===null)throw new b;if(!ae.objectMode)if(typeof ne=="string")ae.decodeStrings!==!1&&(ne=w.from(ne,Y),Y="buffer");else if(ne instanceof w)Y="buffer";else{if(!h._isUint8Array(ne))throw new Q("chunk",["string","Buffer","Uint8Array"],ne);ne=h._uint8ArrayToBuffer(ne),Y="buffer"}let u;return ae.ending?u=new L:ae.destroyed&&(u=new T("write")),u?(r.nextTick(ie,u),K(R,u,!0),u):(ae.pendingcb++,function(m,_,F,G,re){const ce=_.objectMode?1:F.length;_.length+=ce;const he=_.length<_.highWaterMark;return he||(_.needDrain=!0),_.writing||_.corked||_.errored||!_.constructed?(_.buffered.push({chunk:F,encoding:G,callback:re}),_.allBuffers&&G!=="buffer"&&(_.allBuffers=!1),_.allNoop&&re!==se&&(_.allNoop=!1)):(_.writelen=ce,_.writecb=re,_.writing=!0,_.sync=!0,m._write(F,G,_.onwrite),_.sync=!1),he&&!_.errored&&!_.destroyed}(R,ae,ne,Y,ie))}function U(R,ne,Y,ie,ae,u,m){ne.writelen=ie,ne.writecb=m,ne.writing=!0,ne.sync=!0,ne.destroyed?ne.onwrite(new T("write")):Y?R._writev(ae,ne.onwrite):R._write(ae,u,ne.onwrite),ne.sync=!1}function P(R,ne,Y,ie){--ne.pendingcb,ie(Y),te(ne),K(R,Y)}function J(R,ne){const Y=R._writableState,ie=Y.sync,ae=Y.writecb;typeof ae=="function"?(Y.writing=!1,Y.writecb=null,Y.length-=Y.writelen,Y.writelen=0,ne?(ne.stack,Y.errored||(Y.errored=ne),R._readableState&&!R._readableState.errored&&(R._readableState.errored=ne),ie?r.nextTick(P,R,Y,ne,ae):P(R,Y,ne,ae)):(Y.buffered.length>Y.bufferedIndex&&le(R,Y),ie?Y.afterWriteTickInfo!==null&&Y.afterWriteTickInfo.cb===ae?Y.afterWriteTickInfo.count++:(Y.afterWriteTickInfo={count:1,cb:ae,stream:R,state:Y},r.nextTick(D,Y.afterWriteTickInfo)):V(R,Y,1,ae))):K(R,new y)}function D({stream:R,state:ne,count:Y,cb:ie}){return ne.afterWriteTickInfo=null,V(R,ne,Y,ie)}function V(R,ne,Y,ie){for(!ne.ending&&!R.destroyed&&ne.length===0&&ne.needDrain&&(ne.needDrain=!1,R.emit("drain"));Y-- >0;)ne.pendingcb--,ie();ne.destroyed&&te(ne),M(R,ne)}function te(R){if(R.writing)return;for(let ae=R.bufferedIndex;ae1&&R._writev){ne.pendingcb-=u-1;const _=ne.allNoop?se:G=>{for(let re=m;re256?(Y.splice(0,m),ne.bufferedIndex=0):ne.bufferedIndex=m}ne.bufferProcessing=!1}function ee(R){return R.ending&&!R.destroyed&&R.constructed&&R.length===0&&!R.errored&&R.buffered.length===0&&!R.finished&&!R.writing&&!R.errorEmitted&&!R.closeEmitted}function M(R,ne,Y){ee(ne)&&(function(ie,ae){ae.prefinished||ae.finalCalled||(typeof ie._final!="function"||ae.destroyed?(ae.prefinished=!0,ie.emit("prefinish")):(ae.finalCalled=!0,function(u,m){let _=!1;function F(G){if(_)K(u,G??y());else if(_=!0,m.pendingcb--,G){const re=m[q].splice(0);for(let ce=0;ce{ee(ae)?E(ie,ae):ae.pendingcb--},R,ne)):ee(ne)&&(ne.pendingcb++,E(R,ne))))}function E(R,ne){ne.pendingcb--,ne.finished=!0;const Y=ne[q].splice(0);for(let ie=0;ie{const{ArrayIsArray:r,ArrayPrototypeIncludes:n,ArrayPrototypeJoin:o,ArrayPrototypeMap:l,NumberIsInteger:d,NumberIsNaN:i,NumberMAX_SAFE_INTEGER:a,NumberMIN_SAFE_INTEGER:c,NumberParseInt:p,ObjectPrototypeHasOwnProperty:v,RegExpPrototypeExec:f,String:h,StringPrototypeToUpperCase:w,StringPrototypeTrim:g}=t(4134),{hideStackFrames:x,codes:{ERR_SOCKET_BAD_PORT:j,ERR_INVALID_ARG_TYPE:A,ERR_INVALID_ARG_VALUE:Q,ERR_OUT_OF_RANGE:S,ERR_UNKNOWN_SIGNAL:y}}=t(6371),{normalizeEncoding:O}=t(7760),{isAsyncFunction:T,isArrayBufferView:k}=t(7760).types,b={},L=/^[0-7]+$/,N=x((E,W,z=c,Z=a)=>{if(typeof E!="number")throw new A(W,"number",E);if(!d(E))throw new S(W,"an integer",E);if(EZ)throw new S(W,`>= ${z} && <= ${Z}`,E)}),K=x((E,W,z=-2147483648,Z=2147483647)=>{if(typeof E!="number")throw new A(W,"number",E);if(!d(E))throw new S(W,"an integer",E);if(EZ)throw new S(W,`>= ${z} && <= ${Z}`,E)}),se=x((E,W,z=!1)=>{if(typeof E!="number")throw new A(W,"number",E);if(!d(E))throw new S(W,"an integer",E);const Z=z?1:0,R=4294967295;if(ER)throw new S(W,`>= ${Z} && <= ${R}`,E)});function q(E,W){if(typeof E!="string")throw new A(W,"string",E)}const C=x((E,W,z)=>{if(!n(z,E)){const Z=o(l(z,R=>typeof R=="string"?`'${R}'`:h(R)),", ");throw new Q(W,E,"must be one of: "+Z)}});function X(E,W){if(typeof E!="boolean")throw new A(W,"boolean",E)}function I(E,W,z){return E!=null&&v(E,W)?E[W]:z}const B=x((E,W,z=null)=>{const Z=I(z,"allowArray",!1),R=I(z,"allowFunction",!1);if(!I(z,"nullable",!1)&&E===null||!Z&&r(E)||typeof E!="object"&&(!R||typeof E!="function"))throw new A(W,"Object",E)}),U=x((E,W)=>{if(E!=null&&typeof E!="object"&&typeof E!="function")throw new A(W,"a dictionary",E)}),P=x((E,W,z=0)=>{if(!r(E))throw new A(W,"Array",E);if(E.length{if(!k(E))throw new A(W,["Buffer","TypedArray","DataView"],E)}),D=x((E,W)=>{if(E!==void 0&&(E===null||typeof E!="object"||!("aborted"in E)))throw new A(W,"AbortSignal",E)}),V=x((E,W)=>{if(typeof E!="function")throw new A(W,"Function",E)}),te=x((E,W)=>{if(typeof E!="function"||T(E))throw new A(W,"Function",E)}),le=x((E,W)=>{if(E!==void 0)throw new A(W,"undefined",E)}),ee=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function M(E,W){if(E===void 0||!f(ee,E))throw new Q(W,E,'must be an array or string of format "; rel=preload; as=style"')}s.exports={isInt32:function(E){return E===(0|E)},isUint32:function(E){return E===E>>>0},parseFileMode:function(E,W,z){if(E===void 0&&(E=z),typeof E=="string"){if(f(L,E)===null)throw new Q(W,E,"must be a 32-bit unsigned integer or an octal string");E=p(E,8)}return se(E,W),E},validateArray:P,validateStringArray:function(E,W){P(E,W);for(let z=0;zZ||(z!=null||Z!=null)&&i(E))throw new S(W,`${z!=null?`>= ${z}`:""}${z!=null&&Z!=null?" && ":""}${Z!=null?`<= ${Z}`:""}`,E)},validateObject:B,validateOneOf:C,validatePlainFunction:te,validatePort:function(E,W="Port",z=!0){if(typeof E!="number"&&typeof E!="string"||typeof E=="string"&&g(E).length===0||+E!=+E>>>0||E>65535||E===0&&!z)throw new j(W,E,z);return 0|E},validateSignalName:function(E,W="signal"){if(q(E,W),b[E]===void 0)throw b[w(E)]!==void 0?new y(E+" (signals must use all capital letters)"):new y(E)},validateString:q,validateUint32:se,validateUndefined:le,validateUnion:function(E,W,z){if(!n(z,E))throw new A(W,`('${o(z,"|")}')`,E)},validateAbortSignal:D,validateLinkHeaderValue:function(E){if(typeof E=="string")return M(E,"hints"),E;if(r(E)){const W=E.length;let z="";if(W===0)return z;for(let Z=0;Z; rel=preload; as=style"')}}},9198:(s,e,t)=>{const r=t(5506),n=t(3095),o=r.Readable.destroy;s.exports=r.Readable,s.exports._uint8ArrayToBuffer=r._uint8ArrayToBuffer,s.exports._isUint8Array=r._isUint8Array,s.exports.isDisturbed=r.isDisturbed,s.exports.isErrored=r.isErrored,s.exports.isReadable=r.isReadable,s.exports.Readable=r.Readable,s.exports.Writable=r.Writable,s.exports.Duplex=r.Duplex,s.exports.Transform=r.Transform,s.exports.PassThrough=r.PassThrough,s.exports.addAbortSignal=r.addAbortSignal,s.exports.finished=r.finished,s.exports.destroy=r.destroy,s.exports.destroy=o,s.exports.pipeline=r.pipeline,s.exports.compose=r.compose,Object.defineProperty(r,"promises",{configurable:!0,enumerable:!0,get:()=>n}),s.exports.Stream=r.Stream,s.exports.default=s.exports},6371:(s,e,t)=>{const{format:r,inspect:n,AggregateError:o}=t(7760),l=globalThis.AggregateError||o,d=Symbol("kIsNodeError"),i=["string","function","number","object","Function","Object","boolean","bigint","symbol"],a=/^([A-Z][a-z0-9]*)+$/,c={};function p(g,x){if(!g)throw new c.ERR_INTERNAL_ASSERTION(x)}function v(g){let x="",j=g.length;const A=g[0]==="-"?1:0;for(;j>=A+4;j-=3)x=`_${g.slice(j-3,j)}${x}`;return`${g.slice(0,j)}${x}`}function f(g,x,j){j||(j=Error);class A extends j{constructor(...S){super(function(y,O,T){if(typeof O=="function")return p(O.length<=T.length,`Code: ${y}; The provided arguments length (${T.length}) does not match the required ones (${O.length}).`),O(...T);const k=(O.match(/%[dfijoOs]/g)||[]).length;return p(k===T.length,`Code: ${y}; The provided arguments length (${T.length}) does not match the required ones (${k}).`),T.length===0?O:r(O,...T)}(g,x,S))}toString(){return`${this.name} [${g}]: ${this.message}`}}Object.defineProperties(A.prototype,{name:{value:j.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${g}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),A.prototype.code=g,A.prototype[d]=!0,c[g]=A}function h(g){const x="__node_internal_"+g.name;return Object.defineProperty(g,"name",{value:x}),g}class w extends Error{constructor(x="The operation was aborted",j=void 0){if(j!==void 0&&typeof j!="object")throw new c.ERR_INVALID_ARG_TYPE("options","Object",j);super(x,j),this.code="ABORT_ERR",this.name="AbortError"}}f("ERR_ASSERTION","%s",Error),f("ERR_INVALID_ARG_TYPE",(g,x,j)=>{p(typeof g=="string","'name' must be a string"),Array.isArray(x)||(x=[x]);let A="The ";g.endsWith(" argument")?A+=`${g} `:A+=`"${g}" ${g.includes(".")?"property":"argument"} `,A+="must be ";const Q=[],S=[],y=[];for(const T of x)p(typeof T=="string","All expected entries have to be of type string"),i.includes(T)?Q.push(T.toLowerCase()):a.test(T)?S.push(T):(p(T!=="object",'The value "object" should be written as "Object"'),y.push(T));if(S.length>0){const T=Q.indexOf("object");T!==-1&&(Q.splice(Q,T,1),S.push("Object"))}if(Q.length>0){switch(Q.length){case 1:A+=`of type ${Q[0]}`;break;case 2:A+=`one of type ${Q[0]} or ${Q[1]}`;break;default:{const T=Q.pop();A+=`one of type ${Q.join(", ")}, or ${T}`}}(S.length>0||y.length>0)&&(A+=" or ")}if(S.length>0){switch(S.length){case 1:A+=`an instance of ${S[0]}`;break;case 2:A+=`an instance of ${S[0]} or ${S[1]}`;break;default:{const T=S.pop();A+=`an instance of ${S.join(", ")}, or ${T}`}}y.length>0&&(A+=" or ")}switch(y.length){case 0:break;case 1:y[0].toLowerCase()!==y[0]&&(A+="an "),A+=`${y[0]}`;break;case 2:A+=`one of ${y[0]} or ${y[1]}`;break;default:{const T=y.pop();A+=`one of ${y.join(", ")}, or ${T}`}}if(j==null)A+=`. Received ${j}`;else if(typeof j=="function"&&j.name)A+=`. Received function ${j.name}`;else if(typeof j=="object"){var O;(O=j.constructor)!==null&&O!==void 0&&O.name?A+=`. Received an instance of ${j.constructor.name}`:A+=`. Received ${n(j,{depth:-1})}`}else{let T=n(j,{colors:!1});T.length>25&&(T=`${T.slice(0,25)}...`),A+=`. Received type ${typeof j} (${T})`}return A},TypeError),f("ERR_INVALID_ARG_VALUE",(g,x,j="is invalid")=>{let A=n(x);return A.length>128&&(A=A.slice(0,128)+"..."),`The ${g.includes(".")?"property":"argument"} '${g}' ${j}. Received ${A}`},TypeError),f("ERR_INVALID_RETURN_VALUE",(g,x,j)=>{var A;return`Expected ${g} to be returned from the "${x}" function but got ${j!=null&&(A=j.constructor)!==null&&A!==void 0&&A.name?`instance of ${j.constructor.name}`:"type "+typeof j}.`},TypeError),f("ERR_MISSING_ARGS",(...g)=>{let x;p(g.length>0,"At least one arg needs to be specified");const j=g.length;switch(g=(Array.isArray(g)?g:[g]).map(A=>`"${A}"`).join(" or "),j){case 1:x+=`The ${g[0]} argument`;break;case 2:x+=`The ${g[0]} and ${g[1]} arguments`;break;default:{const A=g.pop();x+=`The ${g.join(", ")}, and ${A} arguments`}}return`${x} must be specified`},TypeError),f("ERR_OUT_OF_RANGE",(g,x,j)=>{let A;return p(x,'Missing "range" argument'),Number.isInteger(j)&&Math.abs(j)>2**32?A=v(String(j)):typeof j=="bigint"?(A=String(j),(j>2n**32n||j<-(2n**32n))&&(A=v(A)),A+="n"):A=n(j),`The value of "${g}" is out of range. It must be ${x}. Received ${A}`},RangeError),f("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),f("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),f("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),f("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),f("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),f("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),f("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),f("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),f("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),f("ERR_STREAM_WRITE_AFTER_END","write after end",Error),f("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),s.exports={AbortError:w,aggregateTwoErrors:h(function(g,x){if(g&&x&&g!==x){if(Array.isArray(x.errors))return x.errors.push(g),x;const j=new l([x,g],x.message);return j.code=x.code,j}return g||x}),hideStackFrames:h,codes:c}},4134:s=>{s.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}},7760:(s,e,t)=>{const r=t(8287),{kResistStopPropagation:n,SymbolDispose:o}=t(4134),l=globalThis.AbortSignal||t(5568).AbortSignal,d=globalThis.AbortController||t(5568).AbortController,i=Object.getPrototypeOf(async function(){}).constructor,a=globalThis.Blob||r.Blob,c=a!==void 0?function(f){return f instanceof a}:function(f){return!1},p=(f,h)=>{if(f!==void 0&&(f===null||typeof f!="object"||!("aborted"in f)))throw new ERR_INVALID_ARG_TYPE(h,"AbortSignal",f)};class v extends Error{constructor(h){if(!Array.isArray(h))throw new TypeError("Expected input to be an Array, got "+typeof h);let w="";for(let g=0;g{f=w,h=g}),resolve:f,reject:h}},promisify:f=>new Promise((h,w)=>{f((g,...x)=>g?w(g):h(...x))}),debuglog:()=>function(){},format:(f,...h)=>f.replace(/%([sdifj])/g,function(...[w,g]){const x=h.shift();return g==="f"?x.toFixed(6):g==="j"?JSON.stringify(x):g==="s"&&typeof x=="object"?`${x.constructor!==Object?x.constructor.name:""} {}`.trim():x.toString()}),inspect(f){switch(typeof f){case"string":if(f.includes("'")){if(!f.includes('"'))return`"${f}"`;if(!f.includes("`")&&!f.includes("${"))return`\`${f}\``}return`'${f}'`;case"number":return isNaN(f)?"NaN":Object.is(f,-0)?String(f):f;case"bigint":return`${String(f)}n`;case"boolean":case"undefined":return String(f);case"object":return"{}"}},types:{isAsyncFunction:f=>f instanceof i,isArrayBufferView:f=>ArrayBuffer.isView(f)},isBlob:c,deprecate:(f,h)=>f,addAbortListener:t(7007).addAbortListener||function(f,h){if(f===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",f);let w;return p(f,"signal"),(g=>{if(typeof g!="function")throw new ERR_INVALID_ARG_TYPE("listener","Function",g)})(h),f.aborted?queueMicrotask(()=>h()):(f.addEventListener("abort",h,{__proto__:null,once:!0,[n]:!0}),w=()=>{f.removeEventListener("abort",h)}),{__proto__:null,[o](){var g;(g=w)===null||g===void 0||g()}}},AbortSignalAny:l.any||function(f){if(f.length===1)return f[0];const h=new d,w=()=>h.abort();return f.forEach(g=>{p(g,"signals"),g.addEventListener("abort",w,{once:!0})}),h.signal.addEventListener("abort",()=>{f.forEach(g=>g.removeEventListener("abort",w))},{once:!0}),h.signal}},s.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},5506:(s,e,t)=>{const{Buffer:r}=t(8287),{ObjectDefineProperty:n,ObjectKeys:o,ReflectApply:l}=t(4134),{promisify:{custom:d}}=t(7760),{streamReturningOperators:i,promiseReturningOperators:a}=t(823),{codes:{ERR_ILLEGAL_CONSTRUCTOR:c}}=t(6371),p=t(7830),{setDefaultHighWaterMark:v,getDefaultHighWaterMark:f}=t(5291),{pipeline:h}=t(7758),{destroyer:w}=t(5896),g=t(6238),x=t(3095),j=t(6115),A=s.exports=t(4259).Stream;A.isDestroyed=j.isDestroyed,A.isDisturbed=j.isDisturbed,A.isErrored=j.isErrored,A.isReadable=j.isReadable,A.isWritable=j.isWritable,A.Readable=t(7576);for(const S of o(i)){let O=function(...T){if(new.target)throw c();return A.Readable.from(l(y,this,T))};const y=i[S];n(O,"name",{__proto__:null,value:y.name}),n(O,"length",{__proto__:null,value:y.length}),n(A.Readable.prototype,S,{__proto__:null,value:O,enumerable:!1,configurable:!0,writable:!0})}for(const S of o(a)){let O=function(...T){if(new.target)throw c();return l(y,this,T)};const y=a[S];n(O,"name",{__proto__:null,value:y.name}),n(O,"length",{__proto__:null,value:y.length}),n(A.Readable.prototype,S,{__proto__:null,value:O,enumerable:!1,configurable:!0,writable:!0})}A.Writable=t(8584),A.Duplex=t(3370),A.Transform=t(5001),A.PassThrough=t(6524),A.pipeline=h;const{addAbortSignal:Q}=t(4147);A.addAbortSignal=Q,A.finished=g,A.destroy=w,A.compose=p,A.setDefaultHighWaterMark=v,A.getDefaultHighWaterMark=f,n(A,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>x}),n(h,d,{__proto__:null,enumerable:!0,get:()=>x.pipeline}),n(g,d,{__proto__:null,enumerable:!0,get:()=>x.finished}),A.Stream=A,A._isUint8Array=function(S){return S instanceof Uint8Array},A._uint8ArrayToBuffer=function(S){return r.from(S.buffer,S.byteOffset,S.byteLength)}},3095:(s,e,t)=>{const{ArrayPrototypePop:r,Promise:n}=t(4134),{isIterable:o,isNodeStream:l,isWebStream:d}=t(6115),{pipelineImpl:i}=t(7758),{finished:a}=t(6238);t(5506),s.exports={finished:a,pipeline:function(...c){return new n((p,v)=>{let f,h;const w=c[c.length-1];if(w&&typeof w=="object"&&!l(w)&&!o(w)&&!d(w)){const g=r(c);f=g.signal,h=g.end}i(c,(g,x)=>{g?v(g):p(x)},{signal:f,end:h})})}}},2791:function(s,e,t){(function(r){if(!r.setImmediate){var n,o,l,d,i,a=1,c={},p=!1,v=r.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(r);f=f&&f.setTimeout?f:r,{}.toString.call(r.process)==="[object process]"?n=function(g){pn.nextTick(function(){w(g)})}:function(){if(r.postMessage&&!r.importScripts){var g=!0,x=r.onmessage;return r.onmessage=function(){g=!1},r.postMessage("","*"),r.onmessage=x,g}}()?(d="setImmediate$"+Math.random()+"$",i=function(g){g.source===r&&typeof g.data=="string"&&g.data.indexOf(d)===0&&w(+g.data.slice(d.length))},r.addEventListener?r.addEventListener("message",i,!1):r.attachEvent("onmessage",i),n=function(g){r.postMessage(d+g,"*")}):r.MessageChannel?((l=new MessageChannel).port1.onmessage=function(g){w(g.data)},n=function(g){l.port2.postMessage(g)}):v&&"onreadystatechange"in v.createElement("script")?(o=v.documentElement,n=function(g){var x=v.createElement("script");x.onreadystatechange=function(){w(g),x.onreadystatechange=null,o.removeChild(x),x=null},o.appendChild(x)}):n=function(g){setTimeout(w,0,g)},f.setImmediate=function(g){typeof g!="function"&&(g=new Function(""+g));for(var x=new Array(arguments.length-1),j=0;j"u"?t.g===void 0?this:t.g:self)},3141:(s,e,t)=>{var r=t(5003).Buffer,n=r.isEncoding||function(h){switch((h=""+h)&&h.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 o(h){var w;switch(this.encoding=function(g){var x=function(j){if(!j)return"utf8";for(var A;;)switch(j){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 j;default:if(A)return;j=(""+j).toLowerCase(),A=!0}}(g);if(typeof x!="string"&&(r.isEncoding===n||!n(g)))throw new Error("Unknown encoding: "+g);return x||g}(h),this.encoding){case"utf16le":this.text=i,this.end=a,w=4;break;case"utf8":this.fillLast=d,w=4;break;case"base64":this.text=c,this.end=p,w=3;break;default:return this.write=v,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(w)}function l(h){return h<=127?0:h>>5==6?2:h>>4==14?3:h>>3==30?4:h>>6==2?-1:-2}function d(h){var w=this.lastTotal-this.lastNeed,g=function(x,j){if((192&j[0])!=128)return x.lastNeed=0,"�";if(x.lastNeed>1&&j.length>1){if((192&j[1])!=128)return x.lastNeed=1,"�";if(x.lastNeed>2&&j.length>2&&(192&j[2])!=128)return x.lastNeed=2,"�"}}(this,h);return g!==void 0?g:this.lastNeed<=h.length?(h.copy(this.lastChar,w,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(h.copy(this.lastChar,w,0,h.length),void(this.lastNeed-=h.length))}function i(h,w){if((h.length-w)%2==0){var g=h.toString("utf16le",w);if(g){var x=g.charCodeAt(g.length-1);if(x>=55296&&x<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=h[h.length-2],this.lastChar[1]=h[h.length-1],g.slice(0,-1)}return g}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=h[h.length-1],h.toString("utf16le",w,h.length-1)}function a(h){var w=h&&h.length?this.write(h):"";if(this.lastNeed){var g=this.lastTotal-this.lastNeed;return w+this.lastChar.toString("utf16le",0,g)}return w}function c(h,w){var g=(h.length-w)%3;return g===0?h.toString("base64",w):(this.lastNeed=3-g,this.lastTotal=3,g===1?this.lastChar[0]=h[h.length-1]:(this.lastChar[0]=h[h.length-2],this.lastChar[1]=h[h.length-1]),h.toString("base64",w,h.length-g))}function p(h){var w=h&&h.length?this.write(h):"";return this.lastNeed?w+this.lastChar.toString("base64",0,3-this.lastNeed):w}function v(h){return h.toString(this.encoding)}function f(h){return h&&h.length?this.write(h):""}e.StringDecoder=o,o.prototype.write=function(h){if(h.length===0)return"";var w,g;if(this.lastNeed){if((w=this.fillLast(h))===void 0)return"";g=this.lastNeed,this.lastNeed=0}else g=0;return g=0?(y>0&&(j.lastNeed=y-1),y):--S=0?(y>0&&(j.lastNeed=y-2),y):--S=0?(y>0&&(y===2?y=0:j.lastNeed=y-3),y):0}(this,h,w);if(!this.lastNeed)return h.toString("utf8",w);this.lastTotal=g;var x=h.length-(g-this.lastNeed);return h.copy(this.lastChar,0,x),h.toString("utf8",w,x)},o.prototype.fillLast=function(h){if(this.lastNeed<=h.length)return h.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);h.copy(this.lastChar,this.lastTotal-this.lastNeed,0,h.length),this.lastNeed-=h.length}},5003:(s,e,t)=>{var r=t(8287),n=r.Buffer;function o(d,i){for(var a in d)i[a]=d[a]}function l(d,i,a){return n(d,i,a)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?s.exports=r:(o(r,e),e.Buffer=l),l.prototype=Object.create(n.prototype),o(n,l),l.from=function(d,i,a){if(typeof d=="number")throw new TypeError("Argument must not be a number");return n(d,i,a)},l.alloc=function(d,i,a){if(typeof d!="number")throw new TypeError("Argument must be a number");var c=n(d);return i!==void 0?typeof a=="string"?c.fill(i,a):c.fill(i):c.fill(0),c},l.allocUnsafe=function(d){if(typeof d!="number")throw new TypeError("Argument must be a number");return n(d)},l.allocUnsafeSlow=function(d){if(typeof d!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(d)}},259:s=>{s.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}},8799:(s,e,t)=>{function r(i){var a=this;if(a instanceof r||(a=new r),a.tail=null,a.head=null,a.length=0,i&&typeof i.forEach=="function")i.forEach(function(v){a.push(v)});else if(arguments.length>0)for(var c=0,p=arguments.length;c1)c=a;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");p=this.head.next,c=this.head.value}for(var v=0;p!==null;v++)c=i(c,p.value,v),p=p.next;return c},r.prototype.reduceReverse=function(i,a){var c,p=this.tail;if(arguments.length>1)c=a;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");p=this.tail.prev,c=this.tail.value}for(var v=this.length-1;p!==null;v--)c=i(c,p.value,v),p=p.prev;return c},r.prototype.toArray=function(){for(var i=new Array(this.length),a=0,c=this.head;c!==null;a++)i[a]=c.value,c=c.next;return i},r.prototype.toArrayReverse=function(){for(var i=new Array(this.length),a=0,c=this.tail;c!==null;a++)i[a]=c.value,c=c.prev;return i},r.prototype.slice=function(i,a){(a=a||this.length)<0&&(a+=this.length),(i=i||0)<0&&(i+=this.length);var c=new r;if(athis.length&&(a=this.length);for(var p=0,v=this.head;v!==null&&pthis.length&&(a=this.length);for(var p=this.length,v=this.tail;v!==null&&p>a;p--)v=v.prev;for(;v!==null&&p>i;p--,v=v.prev)c.push(v.value);return c},r.prototype.splice=function(i,a,...c){i>this.length&&(i=this.length-1),i<0&&(i=this.length+i);for(var p=0,v=this.head;v!==null&&p{}},xr={};function je(s){var e=xr[s];if(e!==void 0)return e.exports;var t=xr[s]={exports:{}};return Nn[s].call(t.exports,t,t.exports,je),t.exports}je.n=s=>{var e=s&&s.__esModule?()=>s.default:()=>s;return je.d(e,{a:e}),e},je.d=(s,e)=>{for(var t in e)je.o(e,t)&&!je.o(s,t)&&Object.defineProperty(s,t,{enumerable:!0,get:e[t]})},je.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),je.o=(s,e)=>Object.prototype.hasOwnProperty.call(s,e),je.r=s=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})};var Tn={};je.d(Tn,{TS:()=>Kt,aH:()=>tn,k_:()=>Hn,a6:()=>hn,nt:()=>Qr,Sx:()=>Xr,E7:()=>pt,F3:()=>Kr});var qt={};je.r(qt),je.d(qt,{anyAtomicType:()=>Pi,anySimpleType:()=>Mi,anyURI:()=>es,base64Binary:()=>Zi,boolean:()=>Bi,byte:()=>us,date:()=>zi,dateTime:()=>Hi,dateTimeStamp:()=>vs,dayTimeDuration:()=>bs,decimal:()=>Fi,double:()=>Ui,duration:()=>Gi,float:()=>qi,gDay:()=>Xi,gMonth:()=>Ki,gMonthDay:()=>Qi,gYear:()=>Ji,gYearMonth:()=>Wi,hexBinary:()=>Yi,int:()=>ls,integer:()=>is,language:()=>ns,long:()=>as,negativeInteger:()=>os,nonNegativeInteger:()=>ds,nonPositiveInteger:()=>ss,normalizedString:()=>ts,positiveInteger:()=>ms,short:()=>cs,string:()=>$i,time:()=>Vi,token:()=>rs,unsignedByte:()=>gs,unsignedInt:()=>fs,unsignedLong:()=>hs,unsignedShort:()=>ps,yearMonthDuration:()=>ys});const ot="http://www.w3.org/1999/02/22-rdf-syntax-ns#",at="http://www.w3.org/2001/XMLSchema#",Dt="http://www.w3.org/2000/10/swap/",Re={xsd:{decimal:`${at}decimal`,boolean:`${at}boolean`,double:`${at}double`,integer:`${at}integer`,string:`${at}string`},rdf:{type:`${ot}type`,nil:`${ot}nil`,first:`${ot}first`,rest:`${ot}rest`,langString:`${ot}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${Dt}reify#forSome`,forAll:`${Dt}reify#forAll`},log:{implies:`${Dt}log#implies`}},{rdf:Rn,xsd:Qe}=Re;let ht,On=0;const Ut={namedNode:function(s){return new rr(s)},blankNode:function(s){return new kn(s||"n3-"+On++)},variable:function(s){return new Ln(s)},literal:function(s,e){if(typeof e=="string")return new Ue(`"${s}"@${e.toLowerCase()}`);let t=e?e.value:"";return t===""&&(typeof s=="boolean"?t=Qe.boolean:typeof s=="number"&&(Number.isFinite(s)?t=Number.isInteger(s)?Qe.integer:Qe.double:(t=Qe.double,Number.isNaN(s)||(s=s>0?"INF":"-INF")))),t===""||t===Qe.string?new Ue(`"${s}"`):new Ue(`"${s}"^^${t}`)},defaultGraph:function(){return ht},quad:Sr,triple:Sr},we=Ut;class Ve{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof Ve?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 rr extends Ve{get termType(){return"NamedNode"}}class Ue extends Ve{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let t=e.lastIndexOf('"')+1;return t{d.value&&r.replaceWith(o[parseInt(d.value)])},r.appendChild(l)}else{const o=[];for(let i=0;i{d.value&&r.replaceWith(Qt(e.template.clone().merge(o[parseInt(d.value)]),void 0,!0))},r.appendChild(l)}return r}const Bn={[`${ye}name`]:(s,e)=>{const t=e;s.name&&t.language!==s.config.attributes.language||(s.name=t)},[`${ye}description`]:(s,e)=>{const t=e;s.description&&t.language!==s.config.attributes.language||(s.description=t)},[`${ye}path`]:(s,e)=>{s.path=e.value},[`${ye}node`]:(s,e)=>{s.node=e},[`${ye}datatype`]:(s,e)=>{s.datatype=e},[`${ye}nodeKind`]:(s,e)=>{s.nodeKind=e},[`${ye}minCount`]:(s,e)=>{s.minCount=parseInt(e.value)},[`${ye}maxCount`]:(s,e)=>{s.maxCount=parseInt(e.value)},[`${ye}minLength`]:(s,e)=>{s.minLength=parseInt(e.value)},[`${ye}maxLength`]:(s,e)=>{s.maxLength=parseInt(e.value)},[`${ye}minInclusive`]:(s,e)=>{s.minInclusive=parseInt(e.value)},[`${ye}maxInclusive`]:(s,e)=>{s.maxInclusive=parseInt(e.value)},[`${ye}minExclusive`]:(s,e)=>{s.minExclusive=parseInt(e.value)},[`${ye}maxExclusive`]:(s,e)=>{s.maxExclusive=parseInt(e.value)},[`${ye}pattern`]:(s,e)=>{s.pattern=e.value},[`${ye}order`]:(s,e)=>{s.order=parseInt(e.value)},"http://datashapes.org/dash#singleLine":(s,e)=>{s.singleLine=e.value==="true"},"http://www.w3.org/ns/oa#styleClass":(s,e)=>{s.cssClass=e.value},[`${ye}and`]:(s,e)=>{s.shaclAnd=e.value},[`${ye}in`]:(s,e)=>{s.shaclIn=e.value},[`${ye}languageIn`]:(s,e)=>{s.languageIn=s.config.lists[e.value],s.datatype=we.namedNode(nr+"langString")},[`${ye}defaultValue`]:(s,e)=>{s.defaultValue=e},[`${ye}hasValue`]:(s,e)=>{s.hasValue=e},[sr.value]:(s,e)=>{s.class=e;const t=s.config.shapesGraph.getSubjects(or,e,Se);t.length>0&&(s.node=t[0])},[`${ye}or`]:(s,e)=>{const t=s.config.lists[e.value];t!=null&&t.length?s.shaclOr=t:console.error("list not found:",e.value,"existing lists:",s.config.lists)}};class Qr{constructor(e,t,r){this.label="",this.config=r,this.nodeId=t,this.merge(e)}merge(e){var t,r;for(const n of e)(t=Bn[n.predicate.id])===null||t===void 0||t.call(this,this,n.object);if(this.label=((r=this.name)===null||r===void 0?void 0:r.value)||pt(e,this.config.languages),this.label||this.shaclAnd||(this.label=this.path?Vt(this.path,this.config.prefixes):"unknown"),(this.node||this.shaclAnd)&&(this.extendedShapes=[],this.node&&this.extendedShapes.push(this.node),this.shaclAnd)){const n=this.config.lists[this.shaclAnd];if(n!=null&&n.length)for(const o of n)this.extendedShapes.push(o)}return this}clone(){const e=Object.assign({},this);return e.merge=this.merge.bind(e),e.clone=this.clone.bind(e),e}}class Xr{constructor(e){let t=`form { box-sizing: border-box; display:block; --label-width: 8em; --caret-size: 10px; } -form.mode-edit { padding-left: 1em; } -form *, form ::after, form ::before { box-sizing: inherit; } -shacl-node, .shacl-group { display: flex; flex-direction: column; width: 100%; position: relative; } -shacl-node .control-button { text-decoration: none; cursor: pointer; border: 1px solid transparent; border-radius: 4px; padding: 2px 4px; } -shacl-node .control-button:hover { border-color: inherit; } -shacl-node .remove-button { margin-left: 4px; } -shacl-node .add-button { font-size: 0.8rem; color: #555; margin: 4px 24px 0 0; } -shacl-node .add-button:before { content: '+'; margin-right: 0.2em; } -shacl-node .add-button:hover { color: inherit; } -shacl-node h1 { font-size: 1.1rem; border-bottom: 1px solid; margin-top: 4px; color: #555; } -shacl-property { display: flex; flex-direction: column; align-items: end; position: relative; } -shacl-property:not(.may-add) > .add-button { display: none; } -shacl-property:not(.may-remove) > .property-instance > .remove-button:not(.persistent) { visibility: hidden; } -shacl-property:not(.may-remove) > .shacl-or-constraint > .remove-button:not(.persistent) { visibility: hidden; } -.shacl-group { margin-bottom: 1em; padding-bottom: 1em; } -.mode-view .shacl-group:not(:has(shacl-property)) { display: none; } -.property-instance, .shacl-or-constraint { display: flex; align-items: flex-start; padding: 4px 0; width: 100%; position: relative; } -.shacl-or-constraint label { display: inline-block; word-break: break-word; width: var(--label-width); line-height: 1em; padding-top: 0.15em; padding-right: 1em; flex-shrink: 0; position: relative; } -.property-instance label[title] { cursor: help; text-decoration: underline dashed #AAA; } -.mode-edit .property-instance label.required::before { color: red; content: '\\2736'; font-size: 0.6rem; position: absolute; left: -1.4em; top: 0.15rem; } -.property-instance.valid::before { position: absolute; left: calc(var(--label-width) - 1em); top: 6px; color: green; content: '\\2713'; } -.editor:not([type='checkbox']), .shacl-or-constraint select { flex-grow: 1; } -.shacl-or-constraint select { border: 1px solid #DDD; padding: 2px 4px; } -select { overflow: hidden; text-overflow: ellipsis; } -textarea.editor { resize: vertical; } -.lang-chooser { position: absolute; top: 5px; right: 28px; border: 0; background-color: #e9e9ed; padding: 2px 4px; max-width: 40px; width: 40px; box-sizing: content-box; } -.lang-chooser+.editor { padding-right: 55px; } -.validation-error { position: absolute; left: calc(var(--label-width) - 1em); top: 6px; color: red; cursor: help; } -.validation-error::before { content: '\\26a0' } -.validation-error.node { left: -1em; } -.invalid > .editor { border-color: red !important; } -.ml-0 { margin-left: 0 !important; } -.pr-0 { padding-right: 0 !important; } -.mode-view .property-instance:not(:first-child) > label { visibility: hidden; } -.mode-view .property-instance label { width: var(--label-width); } - -.d-flex { display: flex; } -.lang { opacity: 0.65; font-size: 0.6em; } -a, a:visited { color: inherit; } - -.fadeIn, .fadeOut { animation: fadeIn 0.2s ease-out; } -.fadeOut { animation-direction: reverse; animation-timing-function: ease-out;} -@keyframes fadeIn { - 0% { opacity: 0; transform: scaleY(0.8); } - 100% { opacity: 1; transform: scaleY(1); } -} - -.collapsible > .activator { display: flex; justify-content: space-between; align-items: center; cursor: pointer; width: 100%; border: 0; padding: 8px 0; transition: 0.2s; } -.collapsible > .activator:hover, .collapsible.open > .activator { background-color: #F5F5F5; } -.collapsible > .activator::after { content:''; width: var(--caret-size); height: var(--caret-size); border-style: none solid solid none; border-width: calc(0.3 * var(--caret-size)); transform: rotate(45deg); transition: transform .15s ease-out; margin-right: calc(0.5 * var(--caret-size)); } -.collapsible.open > .activator::after { transform: rotate(225deg); } -.collapsible > *:not(.activator) { transition: all 0.2s ease-out; opacity: 1; } -.collapsible:not(.open) > *:not(.activator) { max-height: 0; padding: 0; opacity: 0; overflow: hidden; } -.collapsible > .property-instance > shacl-node > h1 { display: none; } -.collapsible.open > .property-instance:nth-child(odd) { background-color: #F5F5F5; } -.ref-link { cursor: pointer; } -.ref-link:hover { text-decoration: underline; } -.node-id-display { color: #999; font-size: 11px; }`;e&&(t+=` -`+e),this.stylesheet=new CSSStyleSheet,this.stylesheet.replaceSync(t)}apply(e){}createViewer(e,t,r){const n=document.createElement("div"),o=document.createElement("label");o.innerHTML=e+":",r.description&&o.setAttribute("title",r.description.value),n.appendChild(o);let l,d=t.value,i=null;if(t instanceof rr){const a=r.config.shapesGraph.getQuads(d,null,null,Se);if(a.length){const c=pt(a,r.config.languages);c&&(d=c)}}else t instanceof Ue&&(t.language?(i=document.createElement("span"),i.classList.add("lang"),i.innerText=`@${t.language}`):t.datatype.value===`${Xe}date`?d=new Date(Date.parse(t.value)).toDateString():t.datatype.value===`${Xe}dateTime`&&(d=new Date(Date.parse(t.value)).toLocaleString()));return Wt(t.value)?(l=document.createElement("a"),l.setAttribute("href",t.value)):l=document.createElement("div"),l.classList.add("d-flex"),l.innerText=d,i&&l.appendChild(i),n.appendChild(l),n}}function Fn(s,e){var t,r,n;if(s.config.editMode){const o=s.minCount!==void 0&&s.minCount>0;if(s.class)return s.config.theme.createListEditor(s.label,e,o,zt(s.class,s.config),s);if(s.shaclIn){const l=s.config.lists[s.shaclIn];if(l!=null&&l.length){const d=Ht(l,s.config.shapesGraph,s.config.languages);return s.config.theme.createListEditor(s.label,e,o,d,s)}console.error("list not found:",s.shaclIn,"existing lists:",s.config.lists)}if(((t=s.datatype)===null||t===void 0?void 0:t.value)===`${nr}langString`||!((r=s.languageIn)===null||r===void 0)&&r.length)return s.config.theme.createLangStringEditor(s.label,e,o,s);switch((n=s.datatype)===null||n===void 0?void 0:n.value.replace(Xe,"")){case"integer":case"float":case"double":case"decimal":return s.config.theme.createNumberEditor(s.label,e,o,s);case"date":case"dateTime":return s.config.theme.createDateEditor(s.label,e,o,s);case"boolean":return s.config.theme.createBooleanEditor(s.label,e,o,s);case"base64Binary":return s.config.theme.createFileEditor(s.label,e,o,s)}return s.config.theme.createTextEditor(s.label,e,o,s)}{if(e)return s.config.theme.createViewer(s.label,e,s);const o=document.createElement("div");return o.innerHTML="No value",o}}function Jt(s){return!!s&&s.termType==="DefaultGraph"}const lt=we.defaultGraph(),{rdf:qn,xsd:Ye}=Re,jr=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,Ir=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,Un={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class ct extends Ve{equals(e){return e===this}}class ar{constructor(e,t){if(this._prefixRegex=/$0^/,e&&typeof e.write!="function"&&(t=e,e=null),t=t||{},this._lists=t.lists,e)this._outputStream=e,this._endStream=t.end===void 0||!!t.end;else{let r="";this._outputStream={write(n,o,l){r+=n,l&&l()},end:n=>{n&&n(null,r)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(t.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=lt,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes),t.baseIRI&&(this._baseMatcher=new RegExp(`^${Nr(t.baseIRI)}${t.baseIRI.endsWith("/")?"":"[#?]"}`),this._baseLength=t.baseIRI.length))}get _inDefaultGraph(){return lt.equals(this._graph)}_write(e,t){this._outputStream.write(e,"utf8",t)}_writeQuad(e,t,r,n,o){try{n.equals(this._graph)||(this._write((this._subject===null?"":this._inDefaultGraph?`. -`:` -} -`)+(lt.equals(n)?"":`${this._encodeIriOrBlank(n)} { -`)),this._graph=n,this._subject=null),e.equals(this._subject)?t.equals(this._predicate)?this._write(`, ${this._encodeObject(r)}`,o):this._write(`; - ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(r)}`,o):this._write(`${(this._subject===null?"":`. -`)+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(r)}`,o)}catch(l){o&&o(l)}}_writeQuadLine(e,t,r,n,o){delete this._prefixMatch,this._write(this.quadToString(e,t,r,n),o)}quadToString(e,t,r,n){return`${this._encodeSubject(e)} ${this._encodeIriOrBlank(t)} ${this._encodeObject(r)}${n&&n.value?` ${this._encodeIriOrBlank(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 e.termType==="Quad"?this._encodeQuad(e):this._encodeIriOrBlank(e)}_encodeIriOrBlank(e){if(e.termType!=="NamedNode")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)),jr.test(t)&&(t=t.replace(Ir,Er));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(jr.test(t)&&(t=t.replace(Ir,Er)),e.language)return`"${t}"@${e.language}`;if(this._lineMode){if(e.datatype.value===Ye.string)return`"${t}"`}else switch(e.datatype.value){case Ye.string:return`"${t}"`;case Ye.boolean:if(t==="true"||t==="false")return t;break;case Ye.integer:if(/^[+-]?\d+$/.test(t))return t;break;case Ye.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case Ye.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t}return`"${t}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===qn.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)}${Jt(n)?"":` ${this._encodeIriOrBlank(n)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,t,r,n,o){r===void 0?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):typeof n=="function"?this._writeQuad(e,t,r,lt,n):this._writeQuad(e,t,r,n||lt,o)}addQuads(e){for(let t=0;t. -`)}if(r){let n="",o="";for(const l in this._prefixIRIs)n+=n?`|${l}`:l,o+=(o?"|":"")+this._prefixIRIs[l];n=Nr(n),this._prefixRegex=new RegExp(`^(?:${o})[^/]*$|^(${n})([_a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(r?` -`:"",t)}blank(e,t){let r,n,o=e;switch(e===void 0?o=[]:e.termType?o=[{predicate:e,object:t}]:"length"in e||(o=[e]),n=o.length){case 0:return new ct("[]");case 1:if(r=o[0],!(r.object instanceof ct))return new ct(`[ ${this._encodePredicate(r.predicate)} ${this._encodeObject(r.object)} ]`);default:let l="[";for(let d=0;d{t=null,e(r,n)});if(this._endStream)try{return this._outputStream.end(t)}catch{}t&&t()}}function Er(s){let e=Un[s];return e===void 0&&(s.length===1?(e=s.charCodeAt(0).toString(16),e="\\u0000".substr(0,6-e.length)+e):(e=(1024*(s.charCodeAt(0)-55296)+s.charCodeAt(1)+9216).toString(16),e="\\U00000000".substr(0,10-e.length)+e)),e}function Nr(s){return s.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}function Gn(s){let e=s.shaclDatatype,t=s.value;return t?s.dataset.class||s.dataset.nodeKind===ye+"IRI"?we.namedNode(t):(s.dataset.lang?e=s.dataset.lang:s.type==="number"?t=parseFloat(t):s.type==="file"&&s.binaryData?t=s.binaryData:s.type==="datetime-local"&&(t=new Date(t).toISOString().slice(0,19)),we.literal(t,e)):s.type!=="checkbox"&&s.getAttribute("type")!=="checkbox"||!(s.checked||parseInt(s.dataset.minCount||"0")>0)?void 0:we.literal(s.checked?"true":"false",e)}const dt={};function Kr(s){s.predicate===void 0&&s.datatype===void 0?console.warn('not registering plugin because it does neither define "predicate" nor "datatype"',s):dt[`${s.predicate}^${s.datatype}`]=s}class Hn{constructor(e,t){this.predicate=e.predicate,this.datatype=e.datatype,t&&(this.stylesheet=new CSSStyleSheet,this.stylesheet.replaceSync(t))}createViewer(e,t){return e.config.theme.createViewer(e.label,t,e)}}class lr extends HTMLElement{constructor(e,t,r,n){var o;if(super(),this.template=new Qr(t.shapesGraph.getQuads(e,null,null,Se),r,t),this.dataset.nodeId=this.template.nodeId.id,this.template.order!==void 0&&(this.style.order=`${this.template.order}`),this.template.cssClass&&this.classList.add(this.template.cssClass),t.editMode&&(this.addButton=document.createElement("a"),this.addButton.innerText=this.template.label,this.addButton.title="Add "+this.template.label,this.addButton.classList.add("control-button","add-button"),this.addButton.addEventListener("click",l=>{const d=this.addPropertyInstance();d.classList.add("fadeIn"),this.updateControls(),function(i){var a;(a=i.querySelector("input,select,textarea"))===null||a===void 0||a.focus()}(d),setTimeout(()=>{d.classList.remove("fadeIn")},200)}),this.appendChild(this.addButton)),this.template.path){const l=n?t.dataGraph.getQuads(n,this.template.path,null,null):[];let d=!1;for(const i of l)this.addPropertyInstance(i.object),this.template.hasValue&&i.object.equals(this.template.hasValue)&&(d=!0);t.editMode&&this.template.hasValue&&!d&&this.addPropertyInstance(this.template.hasValue)}if(t.editMode&&(this.addEventListener("change",()=>{this.updateControls()}),this.updateControls()),((o=this.template.extendedShapes)===null||o===void 0?void 0:o.length)&&this.template.config.attributes.collapse!==null&&(!this.template.maxCount||this.template.maxCount>1)&&(t.editMode||this.childElementCount>0)){const l=this;l.classList.add("collapsible"),this.template.config.attributes.collapse==="open"&&l.classList.add("open");const d=document.createElement("h1");d.classList.add("activator"),d.innerText=this.template.label,d.addEventListener("click",()=>{l.classList.toggle("open")}),this.prepend(d)}}addPropertyInstance(e){var t;let r;return!((t=this.template.shaclOr)===null||t===void 0)&&t.length?e?r=Qt(function(n,o){if(!n.shaclOr)return console.warn("can't resolve sh:or because template has no options",n),n;if(o instanceof Ue){const l=o.datatype;for(const d of n.shaclOr){const i=n.config.shapesGraph.getQuads(d,null,null,Se);for(const a of i)if(a.predicate.value===`${ye}datatype`&&a.object.equals(l))return n.clone().merge(i)}}else{let l=n.config.dataGraph.getObjects(o,Oe,null);l.push(...n.config.shapesGraph.getObjects(o,Oe,Se));for(const d of n.shaclOr){const i=n.config.shapesGraph.getQuads(d,null,null,Se);for(const a of i)if(l.length>0){if(a.predicate.value===`${ye}node`){for(const c of l)if(n.config.shapesGraph.has(new tt(a.object,or,c,Se)))return n.clone().merge(i)}if(a.predicate.equals(sr)){for(const c of l)if(a.object.equals(c))return n.clone().merge(i)}}else if(a.predicate.equals($n)&&a.object.equals(Pn))return n.clone().merge(i)}}return console.error("couldn't resolve sh:or for value",o),n}(this.template,e),e,!0):(r=Jr(this.template.shaclOr,this,this.template.config),Yr(r,"")):r=Qt(this.template,e),this.template.config.editMode?this.insertBefore(r,this.addButton):this.appendChild(r),r}updateControls(){var e;let t,r=this.querySelectorAll(":scope > .property-instance, :scope > .shacl-or-constraint, :scope > shacl-node").length;r===0&&(!(!((e=this.template.extendedShapes)===null||e===void 0)&&e.length)||this.template.minCount!==void 0&&this.template.minCount>0)&&(this.addPropertyInstance(),r=this.querySelectorAll(":scope > .property-instance, :scope > .shacl-or-constraint, :scope > shacl-node").length),t=this.template.minCount!==void 0?r>this.template.minCount:this.template.extendedShapes&&this.template.extendedShapes.length>0||r>1;const n=this.template.maxCount===void 0||r .property-instance")){const n=we.namedNode(r.dataset.path);if(r.firstChild instanceof Je){e.size;const o=r.firstChild.toRDF(e);e.addQuad(t,n,o)}else{const o=Gn(r.querySelector(".editor"));o&&e.addQuad(t,n,o)}}}}function Qt(s,e,t=!1){var r,n;let o;if(!((r=s.extendedShapes)===null||r===void 0)&&r.length){o=document.createElement("div"),o.classList.add("property-instance");for(const l of s.extendedShapes)o.appendChild(new Je(l,s.config,e,s.nodeKind,s.label))}else{const l=function(d,i){let a=dt[`${d}^${i}`];return a||(a=dt[`${d}^undefined`],a||dt[`undefined^${i}`])}(s.path,(n=s.datatype)===null||n===void 0?void 0:n.value);o=l?s.config.editMode?l.createEditor(s,e):l.createViewer(s,e):Fn(s,e||null),o.classList.add("property-instance")}return s.config.editMode&&Yr(o,s.label,t),o.dataset.path=s.path,o}function Yr(s,e,t=!1){const r=document.createElement("a");r.innerText="×",r.classList.add("control-button","btn","remove-button"),r.title="Remove "+e,r.addEventListener("click",n=>{s.classList.remove("fadeIn"),s.classList.add("fadeOut"),setTimeout(()=>{const o=s.parentElement;s.remove(),o==null||o.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},200)}),t&&r.classList.add("persistent"),s.appendChild(r)}function Vn(s,e){const t=document.createElement("div");t.dataset.subject=s,t.classList.add("shacl-group");let r=s;const n=e.shapesGraph.getQuads(s,null,null,Se),o=Et(n,"label",ir,e.languages);o&&(r=o);const l=Et(n,"order");l&&(t.style.order=l);const d=document.createElement("h1");return d.innerText=r,t.appendChild(d),e.attributes.collapse!==null&&(t.classList.add("collapsible"),e.attributes.collapse==="open"&&t.classList.add("open"),d.classList.add("activator"),d.addEventListener("click",()=>{t.classList.toggle("open")})),t}window.customElements.define("shacl-property",lr);const Tr={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let vt;const zn=new Uint8Array(16);function Wn(){if(!vt&&(vt=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!vt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return vt(zn)}const Ee=[];for(let s=0;s<256;++s)Ee.push((s+256).toString(16).slice(1));const Rr=function(s,e,t){if(Tr.randomUUID&&!e&&!s)return Tr.randomUUID();const r=(s=s||{}).random||(s.rng||Wn)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){t=t||0;for(let n=0;n<16;++n)e[t+n]=r[n];return e}return function(n,o=0){return Ee[n[o+0]]+Ee[n[o+1]]+Ee[n[o+2]]+Ee[n[o+3]]+"-"+Ee[n[o+4]]+Ee[n[o+5]]+"-"+Ee[n[o+6]]+Ee[n[o+7]]+"-"+Ee[n[o+8]]+Ee[n[o+9]]+"-"+Ee[n[o+10]]+Ee[n[o+11]]+Ee[n[o+12]]+Ee[n[o+13]]+Ee[n[o+14]]+Ee[n[o+15]]}(r)};class Je extends HTMLElement{constructor(e,t,r,n,o){super(),this.config=t,this.shaclSubject=e;let l=r;if(!l){if(!n){const i=t.shapesGraph.getObjects(e,`${ye}nodeKind`,Se);i.length&&(n=i[0])}l=n===void 0&&t.attributes.valuesNamespace||(n==null?void 0:n.id)===`${ye}IRI`?we.namedNode(t.attributes.valuesNamespace+Rr()):we.blankNode(Rr())}this.nodeId=l;const d=JSON.stringify([e,r]);if(r&&t.renderedNodes.has(d)){if(o&&t.attributes.collapse===null){const a=document.createElement("label");a.innerText=o,this.appendChild(a)}const i=document.createElement("a");i.innerText=r.id,i.classList.add("ref-link"),i.onclick=()=>{var a;(a=this.config.form.querySelector(`shacl-node[data-node-id='${this.nodeId.id}']`))===null||a===void 0||a.scrollIntoView()},this.appendChild(i),this.style.flexDirection="row"}else{r&&t.renderedNodes.add(d),this.dataset.nodeId=this.nodeId.id;const i=t.shapesGraph.getQuads(e,null,null,Se);let a;if(this.config.attributes.showNodeIds!==null){const c=document.createElement("div");c.innerText=`id: ${this.nodeId.id}`,c.classList.add("node-id-display"),this.appendChild(c)}for(const c of i)switch(c.predicate.id){case`${ye}property`:let p=this;const v=t.shapesGraph.getQuads(c.object,`${ye}group`,null,Se);if(v.length>0){const h=v[0].object.value;if(t.groups.indexOf(h)>-1){let w=this.querySelector(`:scope > .shacl-group[data-subject='${h}']`);w||(w=Vn(h,t),this.appendChild(w)),p=w}else console.warn("ignoring unknown group reference",v[0])}const f=new lr(c.object,t,this.nodeId,r);f.childElementCount>0&&p.appendChild(f);break;case`${ye}and`:if(a=t.lists[c.object.value],a==null?void 0:a.length)for(const h of a)this.prepend(new Je(h,t,r));else console.error("list not found:",c.object.value,"existing lists:",t.lists);break;case`${ye}node`:this.prepend(new Je(c.object,t,r));break;case`${ye}targetClass`:this.targetClass=c.object;break;case`${ye}or`:a=t.lists[c.object.value],a!=null&&a.length?this.appendChild(Jr(a,this,t)):console.error("list not found:",c.object.value,"existing lists:",t.lists)}if(o){const c=document.createElement("h1");c.innerText=o,this.prepend(c)}}}toRDF(e,t){t||(t=this.nodeId);for(const r of this.querySelectorAll(":scope > shacl-node, :scope > .shacl-group > shacl-node, :scope > shacl-property, :scope > .shacl-group > shacl-property"))r.toRDF(e,t);return this.targetClass&&e.addQuad(t,Oe,this.targetClass),this.config.attributes.generateNodeShapeReference&&!this.closest("shacl-node shacl-node")&&e.addQuad(t,we.namedNode(this.config.attributes.generateNodeShapeReference),this.shaclSubject),t}}window.customElements.define("shacl-node",Je);var Zr=je(9198);const Mt=Symbol("iter");function St(s,e,t=4){if(t===0)return Object.assign(s,e);for(const r in e)s[r]=St(s[r]||Object.create(null),e[r],t-1);return s}class Jn{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||we}_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 ut(e,this._factory)}_termToNumericId(e){if(e.termType==="Quad"){const t=this._termToNumericId(e.subject),r=this._termToNumericId(e.predicate),n=this._termToNumericId(e.object);let o;return t&&r&&n&&(Jt(e.graph)||(o=this._termToNumericId(e.graph)))&&this._ids[o?`.${t}.${r}.${n}.${o}`:`.${t}.${r}.${n}`]}return this._ids[et(e)]}_termToNewNumericId(e){const t=e&&e.termType==="Quad"?`.${this._termToNewNumericId(e.subject)}.${this._termToNewNumericId(e.predicate)}.${this._termToNewNumericId(e.object)}${Jt(e.graph)?"":`.${this._termToNewNumericId(e.graph)}`}`:et(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 ke{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||we,this._entityIndex=t.entityIndex||new Jn({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(e!==null)return e;e=0;const t=this._graphs;let r,n;for(const o in t)for(const l in r=t[o].subjects)for(const d in n=r[l])e+=Object.keys(n[d]).length;return this._size=e}_addToIndex(e,t,r,n){const o=e[t]||(e[t]={}),l=o[r]||(o[r]={}),d=n in l;return d||(l[n]=null),!d}_removeFromIndex(e,t,r,n){const o=e[t],l=o[r];delete l[n];for(const d in l)return;delete o[r];for(const d in o)return;delete e[t]}*_findInIndex(e,t,r,n,o,l,d,i){let a,c,p;const v=this._entities,f=this._termFromId(v[i]),h={subject:null,predicate:null,object:null};t&&((a=e,e={})[t]=a[t]);for(const w in e)if(c=e[w]){h[o]=this._termFromId(v[w]),r&&((a=c,c={})[r]=a[r]);for(const g in c)if(p=c[g]){h[l]=this._termFromId(v[g]);const x=n?n in p?[n]:[]:Object.keys(p);for(let j=0;j{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 o=this._graphs[n];return o||(o=this._graphs[n]={subjects:{},predicates:{},objects:{}},Object.freeze(o)),e=this._termToNewNumericId(e),t=this._termToNewNumericId(t),r=this._termToNewNumericId(r),!!this._addToIndex(o.subjects,e,t,r)&&(this._addToIndex(o.predicates,t,r,e),this._addToIndex(o.objects,r,e,t),this._size=null,!0)}addQuads(e){for(let t=0;t{this.addQuad(t)}),e}removeQuad(e,t,r,n){t||(n=e.graph,r=e.object,t=e.predicate,e=e.subject),n=n?this._termToNumericId(n):1;const o=this._graphs;let l,d,i;if(!((e=e&&this._termToNumericId(e))&&(t=t&&this._termToNumericId(t))&&(r=r&&this._termToNumericId(r))&&(l=o[n])&&(d=l.subjects[e])&&(i=d[t])&&r in i))return!1;for(e in this._removeFromIndex(l.subjects,e,t,r),this._removeFromIndex(l.predicates,t,r,e),this._removeFromIndex(l.objects,r,e,t),this._size!==null&&this._size--,l.subjects)return!0;return delete o[n],!0}removeQuads(e){for(let t=0;t{this.removeQuad(t)}),e}removeMatches(e,t,r,n){const o=new Zr.Readable({objectMode:!0}),l=this.readQuads(e,t,r,n);return o._read=d=>{for(;d-- >0;){const{done:i,value:a}=l.next();if(i)return void o.push(null);o.push(a)}},this.remove(o)}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 o=this._getGraphs(n);let l,d,i,a;if(!(e&&!(d=this._termToNumericId(e))||t&&!(i=this._termToNumericId(t))||r&&!(a=this._termToNumericId(r))))for(const c in o)(l=o[c])&&(d?a?yield*this._findInIndex(l.objects,a,d,i,"object","subject","predicate",c):yield*this._findInIndex(l.subjects,d,i,null,"subject","predicate","object",c):i?yield*this._findInIndex(l.predicates,i,a,null,"predicate","object","subject",c):a?yield*this._findInIndex(l.objects,a,null,null,"object","subject","predicate",c):yield*this._findInIndex(l.subjects,null,null,null,"subject","predicate","object",c))}match(e,t,r,n){return new cr(this,e,t,r,n,{entityIndex:this._entityIndex})}countQuads(e,t,r,n){const o=this._getGraphs(n);let l,d,i,a,c=0;if(e&&!(d=this._termToNumericId(e))||t&&!(i=this._termToNumericId(t))||r&&!(a=this._termToNumericId(r)))return 0;for(const p in o)(l=o[p])&&(c+=e?r?this._countInIndex(l.objects,a,d,i):this._countInIndex(l.subjects,d,i,a):t?this._countInIndex(l.predicates,i,a,d):this._countInIndex(l.objects,a,d,i));return c}forEach(e,t,r,n,o){this.some(l=>(e(l,this),!1),t,r,n,o)}every(e,t,r,n,o){return!this.some(l=>!e(l,this),t,r,n,o)}some(e,t,r,n,o){for(const l of this.readQuads(t,r,n,o))if(e(l))return!0;return!1}getSubjects(e,t,r){const n=[];return this.forSubjects(o=>{n.push(o)},e,t,r),n}forSubjects(e,t,r,n){const o=this._getGraphs(n);let l,d,i;if(e=this._uniqueEntities(e),!(t&&!(d=this._termToNumericId(t))||r&&!(i=this._termToNumericId(r))))for(n in o)(l=o[n])&&(d?i?this._loopBy2Keys(l.predicates,d,i,e):this._loopByKey1(l.subjects,d,e):i?this._loopByKey0(l.objects,i,e):this._loop(l.subjects,e))}getPredicates(e,t,r){const n=[];return this.forPredicates(o=>{n.push(o)},e,t,r),n}forPredicates(e,t,r,n){const o=this._getGraphs(n);let l,d,i;if(e=this._uniqueEntities(e),!(t&&!(d=this._termToNumericId(t))||r&&!(i=this._termToNumericId(r))))for(n in o)(l=o[n])&&(d?i?this._loopBy2Keys(l.objects,i,d,e):this._loopByKey0(l.subjects,d,e):i?this._loopByKey1(l.predicates,i,e):this._loop(l.predicates,e))}getObjects(e,t,r){const n=[];return this.forObjects(o=>{n.push(o)},e,t,r),n}forObjects(e,t,r,n){const o=this._getGraphs(n);let l,d,i;if(e=this._uniqueEntities(e),!(t&&!(d=this._termToNumericId(t))||r&&!(i=this._termToNumericId(r))))for(n in o)(l=o[n])&&(d?i?this._loopBy2Keys(l.subjects,d,i,e):this._loopByKey1(l.objects,d,e):i?this._loopByKey0(l.predicates,i,e):this._loop(l.objects,e))}getGraphs(e,t,r){const n=[];return this.forGraphs(o=>{n.push(o)},e,t,r),n}forGraphs(e,t,r,n){for(const o in this._graphs)this.some(l=>(e(l.graph),!0),t,r,n,this._termFromId(this._entities[o]))}createBlankNode(e){return this._entityIndex.createBlankNode(e)}extractLists({remove:e=!1,ignoreErrors:t=!1}={}){const r={},n=t?()=>!0:(d,i)=>{throw new Error(`${d.value} ${i}`)},o=this.getQuads(null,Re.rdf.rest,Re.rdf.nil,null),l=e?[...o]:[];return o.forEach(d=>{const i=[];let a,c,p=!1;const v=d.graph;let f=d.subject;for(;f&&!p;){const h=this.getQuads(null,null,f,null),w=this.getQuads(f,null,null,null);let g,x=null,j=null,A=null;for(let Q=0;Qthis.has(a));const t=this._graphs,r=e._graphs;let n,o,l,d,i;for(const a in r){if(!(n=t[a]))return!1;n=n.subjects;for(const c in o=r[a].subjects){if(!(l=n[c]))return!1;for(const p in d=o[c]){if(!(i=l[p]))return!1;for(const v in d[p])if(!(v in i))return!1}}}return!0}deleteMatches(e,t,r,n){for(const o of this.match(e,t,r,n))this.removeQuad(o);return this}difference(e){return e===this?new ke({entityIndex:this._entityIndex}):this.filter(t=>!e.has(t))}equals(e){return e===this||this.size===e.size&&this.contains(e)}filter(e){const t=new ke({entityIndex:this._entityIndex});for(const r of this)e(r,this)&&t.add(r);return t}intersection(e){if(e===this){const t=new ke({entityIndex:this._entityIndex});t._graphs=St(Object.create(null),this._graphs),t._size=this._size}return this.filter(t=>e.has(t))}map(e){const t=new ke({entityIndex:this._entityIndex});for(const r of this)t.add(e(r,this));return t}reduce(e,t){const r=this.readQuads();let n=t===void 0?r.next().value:t;for(const o of r)n=e(n,o,this);return n}toArray(){return this.getQuads()}toCanonical(){throw new Error("not implemented")}toStream(){return this.match()}toString(){return new ar().quadsToString(this)}union(e){const t=new ke({entityIndex:this._entityIndex});return t._graphs=St(Object.create(null),this._graphs),t._size=this._size,t.addAll(e),t}*[Symbol.iterator](){yield*this.readQuads()}}class cr extends Zr.Readable{constructor(e,t,r,n,o,l){super({objectMode:!0}),Object.assign(this,{n3Store:e,subject:t,predicate:r,object:n,graph:o,options:l})}get filtered(){if(!this._filtered){const{n3Store:e,graph:t,object:r,predicate:n,subject:o}=this,l=this._filtered=new ke({factory:e._factory,entityIndex:this.options.entityIndex});for(const d of e.readQuads(o,n,r,t))l.addQuad(d)}return this._filtered}get size(){return this.filtered.size}_read(e){e>0&&!this[Mt]&&(this[Mt]=this[Symbol.iterator]());const t=this[Mt];for(;e-- >0;){const{done:r,value:n}=t.next();if(r)return void this.push(null);this.push(n)}}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,o){return this.filtered.every(e,t,r,n,o)}filter(e){return this.filtered.filter(e)}forEach(e,t,r,n,o){return this.filtered.forEach(e,t,r,n,o)}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,o){return this.filtered.some(e,t,r,n,o)}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 ar().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 cr(this.filtered,e,t,r,n,this.options)}*[Symbol.iterator](){yield*this._filtered||this.n3Store.readQuads(this.subject,this.predicate,this.object,this.graph)}}var Qn=je(8287),Xn=je(9596),Kn=je.n(Xn);const{xsd:wt}=Re,Yn=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,Or={"\\":"\\","'":"'",'"':'"',n:` -`,r:"\r",t:" ",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},Zn=/[\x00-\x20<>\\"\{\}\|\^\`]/,ei={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},ti=/$0^/;class ri{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 t in this)!(t in ei)&&this[t]instanceof RegExp&&(this[t]=ti)}else this._n3Mode=e.n3!==!1;this._comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let r=this._input,n=r.length;for(;;){let d,i;for(;d=this._newline.exec(r);)this._comments&&(i=this._comment.exec(d[0]))&&o("comment",i[1],"",this._line,d[0].length),r=r.substr(d[0].length,r.length),n=r.length,this._line++;if(!d&&(d=this._whitespace.exec(r))&&(r=r.substr(d[0].length,r.length)),this._endOfFile.test(r))return t&&(this._comments&&(i=this._comment.exec(r))&&o("comment",i[1],"",this._line,r.length),r=null,o("eof","","",this._line,0)),this._input=r;const a=this._line,c=r[0];let p="",v="",f="",h=null,w=0,g=!1;switch(c){case"^":if(r.length<3)break;if(r[1]!=="^"){this._n3Mode&&(w=1,p="^");break}if(this._previousMarker="^^",r=r.substr(2),r[0]!=="<"){g=!0;break}case"<":if(h=this._unescapedIri.exec(r))p="IRI",v=h[1];else if(h=this._iri.exec(r)){if(v=this._unescape(h[1]),v===null||Zn.test(v))return l(this);p="IRI"}else r.length>1&&r[1]==="<"?(p="<<",w=2):this._n3Mode&&r.length>1&&r[1]==="="&&(p="inverse",w=2,v=">");break;case">":r.length>1&&r[1]===">"&&(p=">>",w=2);break;case"_":((h=this._blank.exec(r))||t&&(h=this._blank.exec(`${r} `)))&&(p="blank",f="_",v=h[1]);break;case'"':if(h=this._simpleQuotedString.exec(r))v=h[1];else if({value:v,matchLength:w}=this._parseLiteral(r),v===null)return l(this);h===null&&w===0||(p="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(h=this._simpleApostropheString.exec(r))v=h[1];else if({value:v,matchLength:w}=this._parseLiteral(r),v===null)return l(this);h===null&&w===0||(p="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(h=this._variable.exec(r))&&(p="var",v=h[0]);break;case"@":this._previousMarker==="literal"&&(h=this._langcode.exec(r))?(p="langcode",v=h[1]):(h=this._keyword.exec(r))&&(p=h[0]);break;case".":if(r.length===1?t:r[1]<"0"||r[1]>"9"){p=".",w=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(h=this._number.exec(r)||t&&(h=this._number.exec(`${r} `)))&&(p="literal",v=h[0],f=typeof h[1]=="string"?wt.double:typeof h[2]=="string"?wt.decimal:wt.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(h=this._sparqlKeyword.exec(r))?p=h[0].toUpperCase():g=!0;break;case"f":case"t":(h=this._boolean.exec(r))?(p="literal",v=h[0],f=wt.boolean):g=!0;break;case"a":(h=this._shortPredicates.exec(r))?(p="abbreviation",v="a"):g=!0;break;case"=":this._n3Mode&&r.length>1&&(p="abbreviation",r[1]!==">"?(w=1,v="="):(w=2,v=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(w=1,p=c);break;case"{":!this._lineMode&&r.length>=2&&(r[1]==="|"?(p="{|",w=2):(p=c,w=1));break;case"|":r.length>=2&&r[1]==="}"&&(p="|}",w=2);break;default:g=!0}if(g&&(this._previousMarker!=="@prefix"&&this._previousMarker!=="PREFIX"||!(h=this._prefix.exec(r))?((h=this._prefixed.exec(r))||t&&(h=this._prefixed.exec(`${r} `)))&&(p="prefixed",f=h[1]||"",v=this._unescape(h[2])):(p="prefix",v=h[1]||"")),this._previousMarker==="^^")switch(p){case"prefixed":p="type";break;case"IRI":p="typeIRI";break;default:p=""}if(!p)return t||!/^'''|^"""/.test(r)&&/\n|\r/.test(r)?l(this):this._input=r;const x=w||h[0].length,j=o(p,v,f,a,x);this.previousToken=j,this._previousMarker=p,r=r.substr(x,r.length)}function o(d,i,a,c,p){const v=r?n-r.length:n,f={type:d,value:i,prefix:a,line:c,start:v,end:v+p};return e(null,f),f}function l(d){e(d._syntaxError(/^\S*/.exec(r)[0]))}}_unescape(e){let t=!1;const r=e.replace(Yn,(n,o,l,d)=>{if(typeof o=="string")return String.fromCharCode(Number.parseInt(o,16));if(typeof l=="string"){let i=Number.parseInt(l,16);return i<=65535?String.fromCharCode(Number.parseInt(l,16)):String.fromCharCode(55296+((i-=65536)>>10),56320+(1023&i))}return d in Or?Or[d]:(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 o=0;for(;e[n-o-1]==="\\";)o++;if(o%2==0){const l=e.substring(r,n),d=l.split(/\r\n|\r|\n/).length-1,i=n+r;if(r===1&&d!==0||r===3&&this._lineMode)break;return this._line+=d,{value:this._unescape(l),matchLength:i}}n++}this._literalClosingPos=e.length-r+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const t=new Error(`Unexpected "${e}" on line ${this._line}.`);return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}_readStartingBom(e){return e.startsWith("\uFEFF")?e.substr(1):e}tokenize(e,t){if(this._line=1,typeof e=="string"){if(this._input=this._readStartingBom(e),typeof t!="function"){const r=[];let n;if(this._tokenizeToEnd((o,l)=>o?n=o:r.push(l),!0),n)throw n;return r}Kn()(()=>this._tokenizeToEnd(t,!0))}else this._pendingBuffer=null,typeof e.setEncoding=="function"&&e.setEncoding("utf8"),e.on("data",r=>{this._input!==null&&r.length!==0&&(this._pendingBuffer&&(r=Qn.Buffer.concat([this._pendingBuffer,r]),this._pendingBuffer=null),128&r[r.length-1]?this._pendingBuffer=r:(this._input===void 0?this._input=this._readStartingBom(typeof r=="string"?r:r.toString()):this._input+=r,this._tokenizeToEnd(t,!1)))}),e.on("end",()=>{typeof this._input=="string"&&this._tokenizeToEnd(t,!0)}),e.on("error",t)}}let kr=0;class Xt{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&en(this,e.factory);const t=typeof e.format=="string"?e.format.match(/\w*$/)[0].toLowerCase():"",r=/turtle/.test(t),n=/trig/.test(t),o=/triple/.test(t),l=/quad/.test(t),d=this._n3Mode=/n3/.test(t),i=o||l;(this._supportsNamedGraphs=!(r||d))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(r||n||o||d),this._supportsRDFStar=t===""||/star|\*$/.test(t),i&&(this._resolveRelativeIRI=a=>null),this._blankNodePrefix=typeof e.blankNodePrefix!="string"?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new ri({lineMode:i,n3:d}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){kr=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,o){const l=this._n3Mode;this._contextStack.push({type:e,subject:r,predicate:n,object:o,graph:t,inverse:!!l&&this._inversePredicate,blankPrefix:l?this._prefixes._:"",quantified:l?this._quantified:null}),l&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,t){const r=this._contextStack.pop();if(!r||r.type!==e)return this._error(`Unexpected ${t.type}`,t);this._subject=r.subject,this._predicate=r.predicate,this._object=r.object,this._graph=r.graph,this._n3Mode&&(this._inversePredicate=r.inverse,this._prefixes._=r.blankPrefix,this._quantified=r.quantified)}_readInTopContext(e){switch(e.type){case"eof":return this._graph!==null?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,t){let r;switch(e.type){case"IRI":case"typeIRI":const n=this._resolveIRI(e.value);if(n===null)return this._error("Invalid IRI",e);r=this._namedNode(n);break;case"type":case"prefixed":const o=this._prefixes[e.prefix];if(o===void 0)return this._error(`Undefined prefix "${e.prefix}:"`,e);r=this._namedNode(o+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(e.prefix.length===0)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((this._subject=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){const t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return this._predicate===null?this._error(`Unexpected ${t}`,e):(this._subject=null,t==="]"?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return this._predicate!==null?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if((this._predicate=this._readEntity(e))===void 0)return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(e.prefix.length===0)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._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((this._object=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return e.type==="{"?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return e.type!=="{"?this._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return e.type==="]"?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}_readBlankNodeTail(e){if(e.type!=="]")return this._readBlankNodePunctuation(e);this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph);const t=this._predicate===null;return this._restoreContext("blank",e),this._object!==null?this._getContextEndReader():this._predicate!==null?this._readObject:t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let t=null,r=null,n=this._readListItem;const o=this._subject,l=this._contextStack,d=l[l.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),l.length!==0&&l[l.length-1].type==="list"&&this._emit(this._subject,this._predicate,this._object,this._graph),this._predicate===null){if(n=this._readPredicate,this._subject===this.RDF_NIL)return n}else if(n=this._getContextEndReader(),this._object===this.RDF_NIL)return n;r=this.RDF_NIL;break;case"literal":e.prefix.length===0?(this._literalValue=e.value,n=this._readListItemDataTypeOrLang):(t=this._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((t=this._readEntity(e))===void 0)return}if(r===null&&(this._subject=r=this._blankNode()),o===null?d.predicate===null?d.subject=r:d.object=r:this._emit(o,this.RDF_REST,r,this._graph),t!==null){if(this._n3Mode&&(e.type==="IRI"||e.type==="prefixed"))return this._saveContext("item",this._graph,r,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(r,this.RDF_FIRST,t,this._graph)}return n}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let t=this._literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const r=this._readEntity(e);if(r===void 0)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),r.token===null?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(r.token))}_readFormulaTail(e){return e.type!=="}"?this._readPunctuation(e):(this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),this._object===null?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let t,r=this._graph;const n=this._subject,o=this._inversePredicate;switch(e.type){case"}":if(this._graph===null)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,o&&(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 l=this._predicate,d=this._object;this._subject=this._quad(n,l,d,this.DEFAULTGRAPH),t=this._readPredicate;break;case"|}":if(this._subject.termType!=="Quad")return this._error("Unexpected asserted triple closing",e);this._subject=null,t=this._readPunctuation;break;default:if(this._supportsQuads&&this._graph===null&&(r=this._readEntity(e))!==void 0){t=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(n!==null){const l=this._predicate,d=this._object;o?this._emit(d,l,n,r):this._emit(n,l,d,r)}return t}_readBlankNodePunctuation(e){let t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}_readQuadPunctuation(e){return e.type!=="."?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return e.type!=="prefix"?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if(e.type!=="IRI")return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){const t=e.type==="IRI"&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return e.type!=="]"?this._error("Invalid graph label",e):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):e.type!=="."?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let t;switch(e.type){case"IRI":case"prefixed":if((t=this._readEntity(e,!0))!==void 0)break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(this._subject===null?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._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&&r.type==="item"){const n=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,n,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,r;const n=this._blankNode();if((r=this._readEntity(e))!==void 0)return this._predicate===null?(t=this._subject,this._subject=n):(t=this._object,this._object=n),this._emit(t,r,n,this._graph),this._readPath}_readBackwardPath(e){const t=this._blankNode();let r,n;if((r=this._readEntity(e))!==void 0)return this._predicate===null?(n=this._subject,this._subject=t):(n=this._object,this._object=t),this._emit(t,r,n,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return e.type!==">>"?this._supportsQuads&&this._graph===null&&(this._graph=this._readEntity(e))!==void 0?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(e.type!==">>")return this._error(`Expected >> but got ${e.type}`,e);const t=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),this._subject===null?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_getContextEndReader(){const e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,t,r,n){this._callback(null,this._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=Pt}_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,o=-1,l=0,d="/";for(;n=o&&(r=r.substr(0,l)),d!=="/")return`${r}/${e.substr(n+1)}`;l=n+1}}}d=e[++n]}return r+e.substring(l)}parse(e,t,r){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${kr++}_`,this._prefixCallback=r||Pt,this._inversePredicate=!1,this._quantified=Object.create(null),!t){const n=[];let o;if(this._callback=(l,d)=>{l?o=l:d&&n.push(d)},this._lexer.tokenize(e).every(l=>this._readCallback=this._readCallback(l)),o)throw o;return n}this._callback=t,this._lexer.tokenize(e,(n,o)=>{n!==null?(this._callback(n),this._callback=Pt):this._readCallback&&(this._readCallback=this._readCallback(o))})}}function Pt(){}function en(s,e){const t=e.namedNode;s._namedNode=t,s._blankNode=e.blankNode,s._literal=e.literal,s._variable=e.variable,s._quad=e.quad,s.DEFAULTGRAPH=e.defaultGraph(),s.RDF_FIRST=t(Re.rdf.first),s.RDF_REST=t(Re.rdf.rest),s.RDF_NIL=t(Re.rdf.nil),s.N3_FORALL=t(Re.r.forAll),s.N3_FORSOME=t(Re.r.forSome),s.ABBREVIATIONS={a:t(Re.rdf.type),"=":t(Re.owl.sameAs),">":t(Re.log.implies)},s.QUANTIFIERS_GRAPH=t("urn:n3:quantifiers")}en(Xt.prototype,we);var ni=je(4841),_t=function(s,e,t,r){return new(t||(t=Promise))(function(n,o){function l(a){try{i(r.next(a))}catch(c){o(c)}}function d(a){try{i(r.throw(a))}catch(c){o(c)}}function i(a){var c;a.done?n(a.value):(c=a.value,c instanceof t?c:new t(function(p){p(c)})).then(l,d)}i((r=r.apply(s,e||[])).next())})};const $t={},Bt={};class tn{constructor(e){this.loadedExternalUrls=[],this.loadedClasses=[],this.config=e}loadGraphs(){return _t(this,void 0,void 0,function*(){this.loadedExternalUrls=[],this.loadedClasses=[];const e=new ke,t=new ke;if(this.config.prefixes={},yield Promise.all([this.importRDF(this.config.attributes.shapes?this.config.attributes.shapes:this.config.attributes.shapesUrl?this.fetchRDF(this.config.attributes.shapesUrl):"",e,Se),this.importRDF(this.config.attributes.values?this.config.attributes.values:this.config.attributes.valuesUrl?this.fetchRDF(this.config.attributes.valuesUrl):"",t,void 0,new Xt({blankNodePrefix:""}))]),e.size==0&&this.config.attributes.valuesSubject){const r=[...t.getObjects(this.config.attributes.valuesSubject,Oe,null),...t.getObjects(this.config.attributes.valuesSubject,Gt,null)],n=[];for(const o of r){const l=this.toURL(o.value);l&&this.loadedExternalUrls.indexOf(l)<0&&(this.loadedExternalUrls.push(l),n.push(this.importRDF(this.fetchRDF(l),e,Se)))}try{yield Promise.allSettled(n)}catch(o){console.warn(o)}}this.config.shapesGraph=e,this.config.dataGraph=t})}importRDF(e,t,r,n){return _t(this,void 0,void 0,function*(){const o=n||new Xt,l=d=>_t(this,void 0,void 0,function*(){const i=[];yield new Promise((a,c)=>{o.parse(d,(p,v,f)=>{if(p)return c(p);if(v){if(t.add(new tt(v.subject,v.predicate,v.object,r)),this.config.attributes.ignoreOwlImports===null&&An.equals(v.predicate)){const h=this.toURL(v.object.value);h&&this.loadedExternalUrls.indexOf(h)<0&&(this.loadedExternalUrls.push(h),i.push(this.importRDF(this.fetchRDF(h),t,r,n)))}if(this.config.classInstanceProvider&&sr.equals(v.predicate)){const h=v.object.value;if(this.loadedClasses.indexOf(h)<0){let w;h in Bt?w=Bt[h]:(w=this.config.classInstanceProvider(h),Bt[h]=w),this.loadedClasses.push(h),i.push(this.importRDF(w,t,r,n))}}}else f&&this.config.registerPrefixes(f),a(null)})});try{yield Promise.allSettled(i)}catch(a){console.warn(a)}});if(e instanceof Promise&&(e=yield e),e){try{e=yield(0,ni.toRDF)(JSON.parse(e),{format:"application/n-quads"})}catch{}yield l(e)}})}fetchRDF(e){return _t(this,void 0,void 0,function*(){if(e in $t)return $t[e];const t=fetch(e,{headers:{Accept:"text/turtle, application/trig, application/n-triples, application/n-quads, text/n3, application/ld+json"}}).then(r=>r.text());return $t[e]=t,t})}toURL(e){if(Wt(e))return e;if(this.config.prefixes){const t=e.split(":");if(t.length===2){const r=this.config.prefixes[t[0]];if(r&&Wt(e=e.replace(`${t[0]}:`,r)))return e}}return null}}class Ft{constructor(){this.shapes=null,this.shapesUrl=null,this.shapeSubject=null,this.values=null,this.valuesUrl=null,this.valueSubject=null,this.valuesSubject=null,this.valuesNamespace="",this.view=null,this.language=null,this.loading="Loading…",this.ignoreOwlImports=null,this.collapse=null,this.submitButton=null,this.generateNodeShapeReference=null,this.showNodeIds=null}}class Kt{constructor(e,t){this.attributes=new Ft,this.loader=new tn(this),this.prefixes={},this.editMode=!0,this.dataGraph=new ke,this.lists={},this.groups=[],this.renderedNodes=new Set,this._shapesGraph=new ke,this.theme=e,this.form=t,this.languages=[...new Set(navigator.languages.flatMap(r=>r.length>2?[r,r.substring(0,2)]:r))]}updateAttributes(e){const t=new Ft;if(Object.keys(t).forEach(r=>{const n=e.dataset[r];n!==void 0&&(t[r]=n)}),this.editMode=t.view===null,this.attributes=t,this.attributes.valueSubject&&!this.attributes.valuesSubject&&(this.attributes.valuesSubject=this.attributes.valueSubject),t.language){const r=this.languages.indexOf(t.language);r>-1&&this.languages.splice(r,1),this.languages.unshift(t.language)}}static dataAttributes(){const e=new Ft;return Object.keys(e).map(t=>"data-"+t.replace(/[A-Z]/g,r=>"-"+r.toLowerCase()))}get shapesGraph(){return this._shapesGraph}set shapesGraph(e){this._shapesGraph=e,this.lists=e.extractLists(),this.groups=[],e.getQuads(null,Oe,`${ye}PropertyGroup`,Se).forEach(t=>{this.groups.push(t.subject.value)})}registerPrefixes(e){for(const t in e)t&&(this.prefixes[t]=e[t])}}const Lr=function(s){return"<"+s.value+">"},ii=/["\\\\\n\r]/,si=/["\\\\\n\r]/g,oi={'"':'\\"',"\\":"\\\\","\n":"\\n","\r":"\\r"};function ai(s){return oi[s]}const qe=function s(e){if(!e)return null;if(e.termType==="BlankNode")return"_:"+e.value;if(e.termType==="DefaultGraph")return"";if(e.termType==="Literal")return function(t){const r=(n=t.value,ii.test(n)?n.replace(si,ai):n);var n;return t.datatype.value==="http://www.w3.org/2001/XMLSchema#string"?'"'+r+'"':t.datatype.value==="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"?'"'+r+'"@'+t.language:'"'+r+'"^^'+Lr(t.datatype)}(e);if(e.termType==="NamedNode")return Lr(e);if(e.termType==="Quad"||e.subject&&e.predicate&&e.object&&e.graph)return function(t,r){const n=r(t.subject),o=r(t.predicate),l=r(t.object),d=r(t.graph);return`${n} ${o} ${l} ${d?d+" ":""}.`}(e,s);if(e.termType==="Variable")return"?"+e.value;if(e[Symbol.iterator])return function(t,r){return[...t].map(n=>r(n)).join(` -`)+` -`}(e,s);throw new Error(`unknown termType ${e.termType}`)};class li{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(qe(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(qe(e));return t&&t.value}has(e){return this.index.has(qe(e))}*keys(){for(const[,{term:e}]of this.index)yield e}set(e,t){const r=qe(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 nt=li;function Ar(s){try{return qe(s)}catch{return null}}class ci{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=qe(e);return this.index.has(t)||this.index.set(t,e),this}clear(){this.index.clear()}delete(e){return!!e&&this.index.delete(Ar(e))}entries(){return this.values().entries()}forEach(e,t){return this.values().forEach(e,t)}has(e){return!!e&&this.index.has(Ar(e))}values(){return new Set(this.index.values())}keys(){return this.values()}[Symbol.iterator](){return this.index.values()}}const De=ci,Cr=class{constructor({dataset:s,end:e,quad:t,start:r}){this.dataset=s,this.end=e,this.quad=t,this.start=r}get term(){return this.quad[this.end]}get graph(){return this.quad.graph}get startTerm(){return this.quad[this.start]}};class rn{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}rn.prototype.termType="BlankNode";const ui=rn;class Yt{equals(e){return!!e&&e.termType===this.termType}}Yt.prototype.termType="DefaultGraph",Yt.prototype.value="";const di=Yt,Dr=function(s,e){if(!e)return null;if(e.termType==="BlankNode")return s.blankNode(e.value);if(e.termType==="DefaultGraph")return s.defaultGraph();if(e.termType==="Literal")return s.literal(e.value,e.language||s.namedNode(e.datatype.value));if(e.termType==="NamedNode")return s.namedNode(e.value);if(e.termType==="Quad"){const t=s.fromTerm(e.subject),r=s.fromTerm(e.predicate),n=s.fromTerm(e.object),o=s.fromTerm(e.graph);return s.quad(t,r,n,o)}if(e.termType==="Variable")return s.variable(e.value);throw new Error(`unknown termType ${e.termType}`)};class nn{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)}}nn.prototype.termType="Literal";const Mr=nn;class sn{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}sn.prototype.termType="NamedNode";const ur=sn;class Zt{constructor(e,t,r,n){this.subject=e,this.predicate=t,this.object=r,this.graph=n}equals(e){return!!e&&(e.termType==="Quad"||!e.termType)&&e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)}}Zt.prototype.termType="Quad",Zt.prototype.value="";const hi=Zt;class on{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}on.prototype.termType="Variable";const fi=on,pi=new ur("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),gi=new ur("http://www.w3.org/2001/XMLSchema#string");class an{constructor(){this.init()}init(){this._data={blankNodeCounter:0,defaultGraph:new di}}namedNode(e){return new ur(e)}blankNode(e){return e=e||"b"+ ++this._data.blankNodeCounter,new ui(e)}literal(e,t){return typeof t=="string"?new Mr(e,t,pi):new Mr(e,"",t||gi)}variable(e){return new fi(e)}defaultGraph(){return this._data.defaultGraph}quad(e,t,r,n=this.defaultGraph()){return new hi(e,t,r,n)}fromTerm(e){return Dr(this,e)}fromQuad(e){return Dr(this,e)}}an.exports=["blankNode","defaultGraph","fromQuad","fromTerm","literal","namedNode","quad","variable"];const dr=new an,mi={apply:(s,e,t)=>s(t[0]),get:(s,e)=>s(e)},Me=function(s,{factory:e=dr}={}){const t=(r="")=>e.namedNode(`${s}${r.raw||r}`);return typeof Proxy>"u"?t:new Proxy(t,mi)},He=(Me("http://www.w3.org/2001/XMLSchema#"),Me("http://www.w3.org/1999/02/22-rdf-syntax-ns#"));Me("http://www.w3.org/2000/01/rdf-schema#");class Te{static add({ptr:e,start:t,end:r,subjects:n=[null],predicates:o=[null],objects:l=[null],graphs:d,callback:i}={}){if(!e.factory)throw new Error("add operation requires a factory");let a=()=>{};i&&(a=c=>{i(new Cr({dataset:e.dataset,start:t,end:r,quad:c}))});for(const c of n)for(const p of o)for(const v of l)for(const f of d){const h={subject:c,predicate:p,object:v,graph:f};h[t]=e.term;const w=e.factory.quad(h.subject,h.predicate,h.object,h.graph);e.dataset.add(w),a(w)}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 o of t)for(const l of n){const d=r.map(()=>e.factory.blankNode());e.dataset.add(e.factory.quad(e.term,o,d[0]||He.nil,l));for(let i=0;i!c.has(v.term))),e=a,p=[...p,...a],c=new De(p.map(v=>v.term))}while(a.length>0);return p}static traverseOne({ptr:e,start:t,end:r,subjects:n,predicates:o,objects:l,graphs:d,callback:i=(a,c)=>c.extend(a)}={}){const a=[];for(const c of n)for(const p of o)for(const v of l)for(const f of d){const h={subject:c,predicate:p,object:v,graph:f};h[t]=e.term;for(const w of e.dataset.match(h.subject,h.predicate,h.object,h.graph))a.push(i(new Cr({dataset:e.dataset,end:r,quad:w,start:t}),e))}return a}}const Le=Te;function Pr(s,e){return e?t=>e(s.extend(t)):()=>{}}const $r=class{constructor({dataset:s,edges:e=[],factory:t,graph:r,term:n}){if(!s&&e.length===0)throw new Error("dataset or edges is required");if(e.length===0&&n===void 0)throw new Error("edges or term must be given");if(e.length>0&&n)throw new Error("edges or term must be given");this.dataset=s||e[e.length-1].dataset,this.edges=e,this.factory=t,this._graph=r,e.length===0&&(this._term=n)}get edge(){return this.edges[this.edges.length-1]}get graph(){return typeof this._graph=="object"?this._graph:this.edge&&this.edge.graph}get length(){return this._term!==void 0?1:this.edges.length+1}get startTerm(){return this._term||this.edges[0].startTerm}get term(){return this._term!==void 0?this._term:this.edge.term}get value(){const s=this.term;return s===null?void 0:s.value}addIn(s,e,t){return Le.add({ptr:this,start:"object",end:"subject",subjects:e,predicates:s,graphs:[this.graph||this.factory.defaultGraph()],callback:Pr(this,t)})}addList(s,e){return Le.addList({ptr:this,predicates:s,graphs:[this.graph||this.factory.defaultGraph()],items:e})}addOut(s,e,t){return Le.add({ptr:this,start:"subject",end:"object",predicates:s,objects:e,graphs:[this.graph||this.factory.defaultGraph()],callback:Pr(this,t)})}deleteIn(s,e){return Le.delete({ptr:this,start:"object",subjects:e,predicates:s})}deleteList(s){return Le.deleteList({ptr:this,predicates:s})}deleteOut(s,e){return Le.delete({ptr:this,start:"subject",predicates:s,objects:e})}execute({operation:s,quantifier:e,start:t,end:r,subjects:n,predicates:o,objects:l,graphs:d,items:i,callback:a}){return Le.execute({ptr:this,operation:s,quantifier:e,start:t,end:r,subjects:n,predicates:o,objects:l,graphs:d,items:i,callback:a})}extend(s){return new this.constructor({dataset:this.dataset,edges:[...this.edges,s],factory:this.factory,graph:this._graph})}hasIn(s,e){return Le.traverse({ptr:this,start:"object",end:"object",subjects:e,predicates:s,graphs:[this.graph]})}hasOut(s,e){return Le.traverse({ptr:this,start:"subject",end:"subject",predicates:s,objects:e,graphs:[this.graph]})}in(s,e){return Le.traverse({ptr:this,start:"object",end:"subject",subjects:e,predicates:s,graphs:[this.graph]})}isAny(){return!this.term}isList(){return Le.isList({ptr:this})}list(){return Le.list({ptr:this})}nodes(){const s=this,e=t=>this._term!==void 0?{dataset:this.dataset,term:this._term}:this.edges.length>t?{dataset:this.edges[t].dataset,term:this.edges[t].startTerm}:this.edges.length===t?{dataset:this.edges[t-1].dataset,term:this.edges[t-1].term}:void 0;return{*[Symbol.iterator](){for(let t=0;te(new s.constructor({factory:s.factory,ptrs:[t]})):()=>{}}class yi{constructor({dataset:e,factory:t,ptrs:r,terms:n,graphs:o}){if(this.factory=t,r)this.ptrs=[...r];else{this.ptrs=[];for(const l of n||[null])for(const d of o||[null])this.ptrs.push(new $r({dataset:e,factory:t,graph:d,term:l}))}}get dataset(){const e=new Set(this.datasets);return e.size!==1?null:e[Symbol.iterator]().next().value}get datasets(){return this.ptrs.map(e=>e.dataset)}get term(){const e=new De(this.terms);if(e.size===1)return e[Symbol.iterator]().next().value}get terms(){return this.ptrs.map(e=>e.term)}get value(){const e=this.term;return e==null?void 0:e.value}get values(){return this.ptrs.map(e=>e.value)}addIn(e,t,r){const n=Fr(this,r);for(const o of this.ptrs)o.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=Fr(this,r);for(const o of this.ptrs)o.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((t,r)=>(t.some(n=>{return l=r,(o=n).dataset===l.dataset&&!!Br(o.graph,l.graph)&&!!Br(o.term,l.term);var o,l})||t.push(r.trim()),t),[]);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(t=>t.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 this.ptrs.length===1&&this.ptrs[0].isList()}list(){if(!this.isList())return;const e=this.ptrs[0].list()[Symbol.iterator](),t=()=>{const{done:r,value:n}=e.next();return r?{done:!0}:{done:!1,value:this.clone({ptrs:[n]})}};return{[Symbol.iterator]:()=>({next:t})}}map(e){return[...this].map(e)}node(e){const t=this.dataset,r=[...e].map(n=>new $r({dataset:t,factory:this.factory,term:n}));return this.clone({ptrs:r})}out(e,t){return this.clone({ptrs:this.ptrs.flatMap(r=>r.out(e,t))})}quads(){const e=this;return{*[Symbol.iterator](){for(const t of e.ptrs)for(const r of t.edges)yield r.quad}}}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 Nt=yi;Me("http://www.w3.org/2002/07/owl#");const Ke=Me("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),bi=Me("http://www.w3.org/2000/01/rdf-schema#"),oe=Me("http://www.w3.org/ns/shacl#"),er=Me("https://schemas.link/shacl-next#"),hr=Me("http://www.w3.org/2001/XMLSchema#");var Fe=je(8059);const qr=class{constructor({details:s,factory:e,options:t,results:r=[]}={}){this.details=s,this.factory=e,this.options=t,this.results=r,this._conforms=Fe(()=>!this.results.some(n=>n.severity.equals(oe.Info)||n.severity.equals(oe.Violation)||n.severity.equals(oe.Warning))),this._ptr=Fe(()=>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 s=new Nt({dataset:this.factory.dataset(),factory:this.factory,terms:[this.factory.blankNode()]});s.addOut([Ke.type],[oe.ValidationReport]).addOut([oe.conforms],[this.factory.literal(this.conforms.toString(),hr.boolean)]);for(const e of this.results)s.addOut([oe.result],[this.factory.blankNode()],t=>{e.build(t,this.options)});return s}coverage(){return this.results.flatMap(s=>s.coverage())}},vi=class{constructor({args:s={},constraintComponent:e,factory:t,focusNode:r,message:n=[],path:o,results:l=[],severity:d,shape:i,source:a=[],value:c,valuePaths:p=[]}={}){this.args=s,this.constraintComponent=e,this.factory=t,this.focusNode=r,this.path=o||i.path,this.results=l,this.severity=d,this.shape=i,this.source=a,this.value=c,this.valuePaths=p,this._message=Fe(()=>(this.shape.message.length>0&&(n=this.shape.message),n.length===0&&(n=this.shape.ptr.node([this.constraintComponent]).out([oe.message]).terms),n.map(v=>t.literal(function(f,h){return Object.entries(h).reduce((w,[g,x])=>(x&&x.termType&&(x=qe(x)),w.replace(`{$${g}}`,x).replace(`{?${g}}`,x)),f)}(v.value,s),v.language||null))))}get message(){return this._message()}build(s,{details:e}={}){s.addOut([Ke.type],[oe.ValidationResult]).addOut([oe.focusNode],this.focusNode.terms).addOut([oe.resultSeverity],[this.severity]).addOut([oe.sourceConstraint],this.source).addOut([oe.sourceConstraintComponent],[this.constraintComponent]).addOut([oe.sourceShape],this.shape.ptr.terms),this.message&&s.addOut([oe.resultMessage],this.message);const t=r=>r.quantifier==="one"?r.predicates.length>1?s.node([this.factory.blankNode()]).addList([oe.alternativePath],r.predicates):r.start==="object"?s.node([this.factory.blankNode()]).addOut([oe.inversePath],[r.predicates[0]]):s.node([r.predicates[0]]):r.quantifier==="oneOrMore"?s.node([this.factory.blankNode()]).addOut([oe.oneOrMorePath],[r.predicates[0]]):r.quantifier==="zeroOrMore"?s.node([this.factory.blankNode()]).addOut([oe.zeroOrMorePath],[r.predicates[0]]):r.quantifier==="zeroOrOne"?s.node([this.factory.blankNode()]).addOut([oe.zeroOrOnePath],[r.predicates[0]]):void 0;if(this.path&&(this.path.length===1?s.addOut([oe.resultPath],t(this.path[0]).terms):s.addList([oe.resultPath],this.path.map(r=>t(r).term))),this.value!==void 0&&s.addOut([oe.value],this.value.terms),e)for(const r of this.results)s.addOut([oe.detail],[this.factory.blankNode()],n=>{r.build(n,{details:e})})}coverage(){return[...this.valuePaths.flatMap(s=>[...s.quads()]),...this.results.flatMap(s=>s.coverage())]}};class fr{constructor({factory:e,focusNode:t,options:r={debug:!1,details:!1},processed:n=new Set,report:o=new qr({factory:e,options:r}),results:l=new Map,shape:d,value:i,valueOrNode:a,valuePaths:c,values:p}={}){this.factory=e,this.focusNode=t,this.options=r,this.processed=n,this.report=o,this.results=l,this.shape=d,this.value=i,this.valuePaths=c,this.valueOrNode=a,this.values=p}create({child:e,focusNode:t=this.focusNode,shape:r=this.shape,value:n=this.value,valueOrNode:o=this.valueOrNode,valuePaths:l=this.valuePaths,values:d=this.values}={}){return new fr({factory:this.factory,focusNode:t,options:this.options,processed:this.processed,report:e?new qr({factory:this.factory,options:this.options}):this.report,results:this.results,shape:r,value:n,valueOrNode:o,valuePaths:l,values:d})}id({shape:e=this.shape}={}){return`${qe(e.ptr.term)} - ${qe(this.focusNode.term)} - ${t=this.valuePaths,t?`{${t.map(r=>function(n){return n?`{${[...n.quads()].map(o=>qe(o)).join(" ")}}`:"{}"}(r)).join(" ")}}`:"{}"}`;var t}result(e){const t=new vi({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:er.Debug,constraintComponent:e,...t})}trace(e,t){this.options.trace&&this.result({severity:er.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||oe.Violation,...t})}}const wi=fr;function _i(){return{generic:s=>{s.trace(er.TraversalConstraintComponent,{args:{},message:[s.factory.literal("Traversal")],value:s.valueOrNode})}}}const xi=class{constructor(s){this.validations=new nt(s)}compile(s){const e=s.validator.options.coverage;if(s.deactivated)return[];let t=!1;const r=new Set;for(const n of s.ptr.execute({start:"subject",end:"predicate"})){const o=this.validations.get(n.term);o&&(r.add(o),n.term.equals(oe.property)&&(t=!0))}return e&&s.isPropertyShape&&!t&&r.add(_i),[...r].map(n=>n(s)).filter(Boolean)}};var ft=je(9349);function Ur(s){if(s.term.termType!=="BlankNode")return{quantifier:"one",start:"subject",end:"object",predicates:[s.term]};const e=s.out([oe.alternativePath]);if(e.ptrs.length===1&&e.ptrs[0].isList())return{quantifier:"one",start:"subject",end:"object",predicates:[...e.list()].map(l=>l.term)};const t=s.out([oe.inversePath]);if(t.term)return{quantifier:"one",start:"object",end:"subject",predicates:[t.term]};const r=s.out([oe.oneOrMorePath]);if(r.term)return{quantifier:"oneOrMore",start:"subject",end:"object",predicates:[r.term]};const n=s.out([oe.zeroOrMorePath]);if(n.term)return{quantifier:"zeroOrMore",start:"subject",end:"object",predicates:[n.term]};const o=s.out([oe.zeroOrOnePath]);return o.term?{quantifier:"zeroOrOne",start:"subject",end:"object",predicates:[o.term]}:void 0}const Si=class{constructor(s){this.shape=s,this._compiled=Fe(()=>this.shape.validator.registry.compile(s))}get compiled(){return this._compiled()}async validate(s){return s.focusNode.dataset.size===0||(this.shape.isPropertyShape?await this.validateProperty(s):await this.validateNode(s)),s}async validateNode(s){const e=s.create({shape:this.shape,valueOrNode:s.value||s.focusNode});for(const t of this.compiled)t.node&&await t.node(e),t.generic&&await t.generic(e)}async validateProperty(s){let e;e=this.shape.isSparqlShape?s.focusNode:s.focusNode.executeAll(this.shape.path);const t=e.node(new De(e.terms)),r=[...e].reduce((o,l)=>{const d=l.term,i=e.node([d]);return o.has(d)||o.set(d,{value:i,valuePaths:[]}),o.get(d).valuePaths.push(l),o},new nt).values(),n=s.create({shape:this.shape,values:t});for(const o of this.compiled)o.property&&await o.property(n);for(const{value:o,valuePaths:l}of r){const d=s.create({shape:this.shape,value:o,valueOrNode:o,valuePaths:l});for(const i of this.compiled)i.generic&&await i.generic(d)}}},tr=function(s){const e=new De,t=new Nt({dataset:s.dataset,terms:s.terms}).execute({quantifier:"zeroOrMore",start:"object",end:"subject",predicates:[bi.subClassOf]});for(const r of t.ptrs)for(const{term:n}of r.nodes())e.add(n);return e},ji=class{constructor(s){this.targetClass=new De([...tr(s.hasOut([Ke.type],[oe.NodeShape])),...tr(s.out([oe.targetClass]))]),this.targetNode=s.out([oe.targetNode]).terms,this.targetObjectsOf=s.out([oe.targetObjectsOf]).terms,this.targetSubjectsOf=s.out([oe.targetSubjectsOf]).terms}resolve(s){const e=s.focusNode.node([null]),t=[...s.focusNode.hasOut([Ke.type],this.targetClass).ptrs,...s.focusNode.node(this.targetNode).ptrs,...e.execute({start:"object",end:"object",predicates:this.targetObjectsOf}).ptrs,...e.execute({start:"subject",end:"subject",predicates:this.targetSubjectsOf}).ptrs],r=s.focusNode.clone({ptrs:t});return r.node([...new De(r.terms)])}},Ii=class{constructor(s,{validator:e}){this.ptr=s,this.validator=e,this._deactivated=Fe(()=>{const t=this.ptr.out([oe.deactivated]).term;return t&&(0,ft.fromRdf)(t)}),this._message=Fe(()=>this.ptr.out([oe.message]).terms),this._path=Fe(()=>function(t){return t.terms.length===0?null:t.ptrs[0].isList()?[...t.list()].map(r=>Ur(r)):[Ur(t)]}(this.ptr.out([oe.path]))),this._severity=Fe(()=>this.ptr.out([oe.severity]).term),this._shapeValidator=Fe(()=>new Si(this)),this._sparql=Fe(()=>this.ptr.out([oe.sparql])),this._targetResolver=Fe(()=>new ji(this.ptr))}get deactivated(){return this._deactivated()}get isPropertyShape(){return!!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(s){return this.targetResolver.resolve(s)}async validate(s){const e=s.id({shape:this});if(s.processed.has(e)){if(s.results.has(e))for(const t of s.results.get(e))s.report.results.push(t);return s}return s.processed.add(e),this.shapeValidator.validate(s)}};async function jt(s,e){return Promise.all(s.map(e))}function Ei(s){return e=>{e.test(s.equals(e.valueOrNode.term),oe.HasValueConstraintComponent,{args:{hasValue:s},message:[e.factory.literal("Value must be {$hasValue}")]})}}function Ni(s){return e=>{const t=[...e.values].some(r=>s.equals(r.term));e.test(t,oe.HasValueConstraintComponent,{args:{hasValue:s},message:[e.factory.literal("Missing expected value {$hasValue}")]})}}function Gr(s){return hr.dateTime.equals(s.datatype)&&/^.*(((\+|-)\d{2}:\d{2})|Z)$/.test(s.value)}const Ze=function(s,e){if(!s||s.termType!=="Literal"||!e||e.termType!=="Literal"||Gr(s)!==Gr(e))return null;const t=(0,ft.fromRdf)(s),r=(0,ft.fromRdf)(e);return typeof t!=typeof r?null:typeof t=="string"?t.localeCompare(r):t-r};function Ti(s){return e=>{const t=e.focusNode.out([s]),r=t.filter(o=>!o.term.equals(e.focusNode.term)),n=t.terms.length!==0&&r.terms.length===0;e.test(n,oe.EqualsConstraintComponent,{args:{equals:s},message:[e.factory.literal("Must have same values as {$equals}")],value:r.terms[0]&&e.focusNode.node([r.terms[0]])||e.focusNode})}}function Ri(s){return e=>{const t=new De(e.focusNode.out([s]).terms),r=new De(e.values.terms),n=[...[...r].filter(o=>!t.has(o)),...[...t].filter(o=>!r.has(o))];for(const o of n)e.violation(oe.EqualsConstraintComponent,{args:{equals:s},message:[e.factory.literal("Must have same values as {$equals}")],value:e.focusNode.node([o])});n.length===0&&e.debug(oe.EqualsConstraintComponent,{args:{equals:s},message:[e.factory.literal("Must have same values as {$equals}")]})}}function Oi(s,e,t,r){return async n=>{const o=[];let l=[];e&&(l=new Set(n.shape.ptr.in([oe.property]).out([oe.property]).out([oe.qualifiedValueShape]).filter(i=>!i.term.equals(s.ptr.term)).map(i=>n.shape.validator.shape(i))));const d=(await async function(i){return(await Promise.all(i.map(a=>(async c=>{const p=(await s.validate(n.create({child:!0,focusNode:c}))).report;if(o.push(p.results),!p.conforms)return!1;if(l.length===0)return!0;if(n.options.debug||n.options.details){const v=await jt([...l],async f=>(await f.validate(n.create({child:!0,focusNode:c}))).report);return o.push(v.flatMap(f=>f.results)),!v.every(f=>f.conforms)}return!await async function(v,f){for(const h of v)if(!await f(h))return!1;return!0}([...l],async v=>(await v.validate(n.create({child:!0,focusNode:c}))).report.conforms)})(a)))).filter(Boolean)}(n.values)).length;t!==null&&n.test(d<=t,oe.QualifiedMaxCountConstraintComponent,{args:{qualifiedMaxCount:t,qualifiedValueShape:s.ptr.term,qualifiedValueShapesDisjoint:e},message:[n.factory.literal("More than {$qualifiedMaxCount} values have shape {$qualifiedValueShape}")],results:o.flat()}),r!==null&&n.test(d>=r,oe.QualifiedMinCountConstraintComponent,{args:{qualifiedMinCount:r,qualifiedValueShape:s.ptr.term,qualifiedValueShapesDisjoint:e},message:[n.factory.literal("Less than {$qualifiedMinCount} values have shape {$qualifiedValueShape}")],results:o.flat()})}}function ki(s,e,t){return r=>{r.test(t.test(r.valueOrNode.term.value),oe.PatternConstraintComponent,{args:{flags:e,pattern:s},message:[r.factory.literal('Value does not match pattern "{$pattern}"')],value:r.valueOrNode})}}const It=Me("http://www.w3.org/ns/shacl#"),ln=Me("https://schemas.link/shacl-next#"),rt=class{constructor({results:s=[]}={}){this.results=s}get conforms(){return!this.results.some(s=>s.severity.equals(It.Info)||s.severity.equals(It.Violation)||s.severity.equals(It.Warning))}},Tt=class{constructor({args:s={},factory:e,message:t=[],severity:r=It.Violation}={}){this.severity=r,this.message=t.map(n=>e.literal(function(o,l){return Object.entries(l).reduce((d,[i,a])=>(a&&a.termType&&(a=qe(a)),d.replace(`{$${i}}`,a).replace(`{?${i}}`,a)),o)}(n.value,s),n.language||null))}};class pr{constructor({factory:e=dr}={}){this.factory=e}clone({factory:e}={}){return new pr({factory:e||this.factory})}validate(){return new rt}validateSimple(){return!0}}const Li=pr;class gr extends Li{constructor({datatypes:e,factory:t}={}){super({factory:t}),this.datatypes=[];for(const r of Array.isArray(e)?e:[e])r&&this.datatypes.push(this.factory.fromTerm(r))}clone({factory:e}={}){return new gr({datatypes:this.datatypes,factory:e||this.factory})}}const Rt=gr,Ai=class{constructor({factory:s=dr,validations:e}={}){if(this.factory=s,this.validations=new nt,e)for(const t of Object.values(e)){const r=t.clone({factory:this.factory});for(const n of r.datatypes)this.validations.set(n,r)}}validate(s){const e=this.validations.get(s.datatype);return e?e.validate(s):new rt}validateSimple(s){const e=this.validations.get(s.datatype);return!e||e.validateSimple(s)}};class mr extends Rt{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 mr(this.patterns,this.datatypes,{factory:e||this.factory})}validate(e){const t=this.patterns.map(r=>{let n;r.test(e.value)&&(n=ln.Debug);const o={pattern:this.factory.literal(r.toString()),this:e};return new Tt({args:o,factory:this.factory,message:this.message,severity:n})});return new rt({results:t})}validateSimple(e){return this.patterns.every(t=>t.test(e.value))}}const xe=mr,Ci=/^([-+]?[0-9]+)$/;class yr extends xe{constructor(e=null,t=null,r,{factory:n}={}){super(Ci,r,{factory:n}),this.maxInclusive=null,this.minInclusive=null,typeof t=="string"&&(this.maxInclusive=BigInt(t)),typeof e=="string"&&(this.minInclusive=BigInt(e))}clone({factory:e}={}){var t,r;return new yr((t=this.minInclusive)==null?void 0:t.toString(),(r=this.maxInclusive)==null?void 0:r.toString(),this.datatypes,{factory:e||this.factory})}validate(e){const t=super.validate(e).results;if(!ln.Debug.equals(t[0].severity))return new rt({results:t});const r=BigInt(e.value);if(this.minInclusive!==null&&rthis.maxInclusive){const n=`term value "${e.value}" is greater than "${this.maxInclusive.toString()}"`,o=[this.factory.literal(n)];t.push(new Tt({factory:this.factory,message:o}))}return new rt({results:t})}validateSimple(e){if(!super.validateSimple(e))return!1;const t=BigInt(e.value);return!(this.minInclusive!==null&&tthis.maxInclusive)}}const Ae=yr;class br extends Rt{constructor(e,t,{factory:r}={}){super({datatypes:t,factory:r}),this.values=new Set(e)}clone({factory:e}={}){return new br(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 Tt({factory:this.factory,message:n}))}return new rt({results:t})}validateSimple(e){return this.values.has(e.value)}}const Di=br,be={xsd:Me("http://www.w3.org/2001/XMLSchema#")},Mi=new Rt({datatypes:be.xsd.anySimpleType}),Pi=new Rt({datatypes:be.xsd.anyAtomicType}),Ot=/^([^\ud8ff-\udfff\ufffe-\uffff]*)$/,cn=/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)([Ee](\+|-)?[0-9]+)?|(\+|-)?INF|NaN)$/,vr=/^(-?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)))))$/,un=/^(-?([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))?)$/,$i=new xe(Ot,be.xsd.string),Bi=new Di(["1","true","0","false"],be.xsd.boolean),Fi=new xe(/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+))$/,be.xsd.decimal),qi=new xe(cn,be.xsd.float),Ui=new xe(cn,be.xsd.double),Gi=new xe(vr,be.xsd.duration),Hi=new xe(un,be.xsd.dateTime),Vi=new xe(/^((([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))?)$/,be.xsd.time),zi=new xe(/^(-?([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))?)$/,be.xsd.date),Wi=new xe(/^(-?([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))?)$/,be.xsd.gYearMonth),Ji=new xe(/^(-?([1-9][0-9]{3,}|0[0-9]{3})(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,be.xsd.gYear),Qi=new xe(/^(--(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))?)$/,be.xsd.gMonthDay),Xi=new xe(/^(---(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,be.xsd.gDay),Ki=new xe(/^(--(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,be.xsd.gMonth),Yi=new xe(/^(([0-9a-fA-F]{2})*)$/,be.xsd.hexBinary),Zi=new xe(/^(((([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] ?= ?=))?)$/,be.xsd.base64Binary),es=new xe(Ot,be.xsd.anyURI),dn=/^([^\u000d\u000a\u0009]*)$/,ts=new xe([Ot,dn],be.xsd.normalizedString),rs=new xe([Ot,dn,/^([^ ]+( [^ ]+)*)*$/],be.xsd.token),ns=new xe(/^([a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*)$/,be.xsd.language),is=new Ae(null,null,be.xsd.integer),ss=new Ae(null,"0",be.xsd.nonPositiveInteger),os=new Ae(null,"-1",be.xsd.negativeInteger),as=new Ae("-9223372036854775808","9223372036854775807",be.xsd.long),ls=new Ae("-2147483648","2147483647",be.xsd.int),cs=new Ae("-32768","32767",be.xsd.short),us=new Ae("-128","127",be.xsd.byte),ds=new Ae("0",null,be.xsd.nonNegativeInteger),hs=new Ae("0","18446744073709551615",be.xsd.unsignedLong),fs=new Ae("0","4294967295",be.xsd.unsignedInt),ps=new Ae("0","65535",be.xsd.unsignedShort),gs=new Ae("0","255",be.xsd.unsignedByte),ms=new Ae("1",null,be.xsd.positiveInteger),ys=new xe([vr,/^([^DT]*)$/],be.xsd.yearMonthDuration),bs=new xe([vr,/^([^YM]*[DT].*)$/],be.xsd.dayTimeDuration),vs=new xe([un,/^(.*(Z|(\+|-)[0-9][0-9]:[0-9][0-9]))$/],be.xsd.dateTimeStamp),ws=class extends Ai{constructor({factory:s}={}){super({factory:s,validations:{...qt}})}},_s=new nt([[oe.BlankNode,new Set(["BlankNode"])],[oe.BlankNodeOrIRI,new Set(["BlankNode","NamedNode"])],[oe.BlankNodeOrLiteral,new Set(["BlankNode","Literal"])],[oe.IRI,new Set(["NamedNode"])],[oe.IRIOrLiteral,new Set(["NamedNode","Literal"])],[oe.Literal,new Set(["Literal"])]]);function xs(s,e){return t=>{t.test(e.has(t.valueOrNode.term.termType),oe.NodeKindConstraintComponent,{args:{nodeKind:s},message:[t.factory.literal("Value does not have node kind {$nodeKind}")],value:t.valueOrNode})}}const Ss=new nt([[oe.maxCount,function(s){return{property:(e=parseInt(s.ptr.out([oe.maxCount]).value),t=>{t.test(t.values.terms.length<=e,oe.MaxCountConstraintComponent,{args:{maxCount:e},message:[t.factory.literal("More than {$maxCount} values")]})})};var e}],[oe.minCount,function(s){return{property:(e=parseInt(s.ptr.out([oe.minCount]).value),t=>{t.test(t.values.terms.length>=e,oe.MinCountConstraintComponent,{args:{minCount:e},message:[t.factory.literal("Less than {$minCount} values")]})})};var e}],[oe.and,function(s){return{generic:(e=[...s.ptr.out([oe.and])].flatMap(t=>[...t.list()]).map(t=>s.validator.shape(t)),async t=>{const r=await jt(e,async o=>(await o.validate(t.create({child:!0,focusNode:t.valueOrNode}))).report),n=r.every(o=>o.conforms);t.test(n,oe.AndConstraintComponent,{results:r.flatMap(o=>o.results),value:t.valueOrNode})})};var e}],[oe.not,function(s){return{generic:(e=s.validator.shape(s.ptr.out([oe.not])),async t=>{const r=(await e.validate(t.create({child:!0,focusNode:t.valueOrNode}))).report,n=!r.conforms;t.test(n,oe.NotConstraintComponent,{args:{not:e.ptr.term},message:[t.factory.literal("Value does have shape {$not}")],results:r.results,value:t.valueOrNode})})};var e}],[oe.or,function(s){return{generic:(e=[...s.ptr.out([oe.or])].flatMap(t=>[...t.list()]).map(t=>s.validator.shape(t)),async t=>{let r,n=[];if(t.options.debug||t.options.details){const o=await jt(e,async l=>(await l.validate(t.create({child:!0,focusNode:t.valueOrNode}))).report);n=o.flatMap(l=>l.results),r=o.some(l=>l.conforms)}else r=await async function(o,l){for(const d of o)if(await l(d))return!0;return!1}(e,async o=>(await o.validate(t.create({child:!0,focusNode:t.valueOrNode}))).report.conforms);t.test(r,oe.OrConstraintComponent,{results:n,value:t.valueOrNode})})};var e}],[oe.xone,function(s){return{generic:(e=[...s.ptr.out([oe.xone])].flatMap(t=>[...t.list()]).map(t=>s.validator.shape(t)),async t=>{const r=await jt(e,async o=>(await o.validate(t.create({child:!0,focusNode:t.valueOrNode}))).report),n=r.filter(o=>o.conforms).length===1;t.test(n,oe.XoneConstraintComponent,{results:r.flatMap(o=>o.results),value:t.valueOrNode})})};var e}],[oe.closed,function(s){if(!(0,ft.fromRdf)(s.ptr.out([oe.closed]).term))return null;const e=s.ptr.out([oe.property]).map(n=>s.validator.shape(n));return{node:(t=new De(e.filter(n=>!n.deactivated).map(n=>n.path[0].predicates[0])),r=new De([...s.ptr.out([oe.ignoredProperties]).list()||[]].map(n=>n.term)),n=>{const o=n.focusNode.execute({start:"subject",end:"predicate"}).filter(l=>!r.has(l.term)&&!t.has(l.term));if(o.ptrs.length>0)for(const l of o)n.violation(oe.ClosedConstraintComponent,{message:[n.factory.literal("Predicate is not allowed (closed shape)")],path:[{quantifier:"one",start:"subject",end:"object",predicates:[l.term]}],value:n.focusNode.node([[...l.quads()][0].object])});else n.debug(oe.ClosedConstraintComponent)})};var t,r}],[oe.hasValue,function(s){const e=s.ptr.out([oe.hasValue]).term;return{node:Ei(e),property:Ni(e)}}],[oe.in,function(s){return{generic:(e=new De([...s.ptr.out([oe.in]).list()].map(t=>t.term)),t=>{t.test(e.has(t.valueOrNode.term),oe.InConstraintComponent,{args:{in:[...e].map(r=>r.value).join(", ")},message:[t.factory.literal("Value is not in {$in}")],value:t.valueOrNode})})};var e}],[oe.disjoint,function(s){return{generic:(e=s.ptr.out([oe.disjoint]).term,t=>{const r=t.focusNode.dataset.match(t.focusNode.term,e,t.valueOrNode.term);t.test(r.size===0,oe.DisjointConstraintComponent,{args:{disjoint:e},message:[t.factory.literal("Value node must not also be one of the values of {$disjoint}")],value:t.valueOrNode})})};var e}],[oe.equals,function(s){const e=s.ptr.out([oe.equals]).term;return{node:Ti(e),property:Ri(e)}}],[oe.lessThan,function(s){return{property:(e=s.ptr.out([oe.lessThan]).term,t=>{const r=t.focusNode.out([e]).terms;for(const n of t.values)for(const o of r){const l=Ze(n.term,o);l===null||l>=0?t.violation(oe.LessThanConstraintComponent,{args:{lessThan:e},message:[t.factory.literal("Value is not less than value of {$lessThan}")],value:n}):t.debug(oe.LessThanConstraintComponent,{args:{lessThan:e},message:[t.factory.literal("Value is not less than value of {$lessThan}")],value:n})}})};var e}],[oe.lessThanOrEquals,function(s){return{property:(e=s.ptr.out([oe.lessThanOrEquals]).term,t=>{const r=t.focusNode.out([e]).terms;for(const n of t.values)for(const o of r){const l=Ze(n.term,o);l===null||l>0?t.violation(oe.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:e},message:[t.factory.literal("Value is not less than or equal to value of {$lessThanOrEquals}")],value:n}):t.debug(oe.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:e},message:[t.factory.literal("Value is not less than or equal to value of {$lessThanOrEquals}")],value:n})}})};var e}],[oe.maxExclusive,function(s){return{generic:(e=s.ptr.out([oe.maxExclusive]).term,t=>{const r=Ze(t.valueOrNode.term,e);t.test(r!==null&&r<0,oe.MaxExclusiveConstraintComponent,{args:{maxExclusive:e},message:[t.factory.literal("Value is not less than {$maxExclusive}")],value:t.valueOrNode})})};var e}],[oe.maxInclusive,function(s){return{generic:(e=s.ptr.out([oe.maxInclusive]).term,t=>{const r=Ze(t.valueOrNode.term,e);t.test(r!==null&&r<=0,oe.MaxInclusiveConstraintComponent,{args:{maxInclusive:e},message:[t.factory.literal("Value is not less than or equal to {$maxInclusive}")],value:t.valueOrNode})})};var e}],[oe.minExclusive,function(s){return{generic:(e=s.ptr.out([oe.minExclusive]).term,t=>{const r=Ze(t.valueOrNode.term,e);t.test(r!==null&&r>0,oe.MinExclusiveConstraintComponent,{args:{minExclusive:e},message:[t.factory.literal("Value is not greater than {$minExclusive}")],value:t.valueOrNode})})};var e}],[oe.minInclusive,function(s){return{generic:(e=s.ptr.out([oe.minInclusive]).term,t=>{const r=Ze(t.valueOrNode.term,e);t.test(r!==null&&r>=0,oe.MinInclusiveConstraintComponent,{args:{minInclusive:e},message:[t.factory.literal("Value is not greater than or equal to {$minInclusive}")],value:t.valueOrNode})})};var e}],[oe.node,function(s){return{generic:(e=[...s.ptr.out([oe.node])].map(t=>s.validator.shape(t)),async t=>{for(const r of e){const n=await r.validate(t.create({child:!0,focusNode:t.valueOrNode}));t.test(n.report.conforms,oe.NodeConstraintComponent,{args:{node:r.ptr.term},message:[t.factory.literal("Value does not have shape {$node}")],results:n.report.results,value:t.valueOrNode})}})};var e}],[oe.property,function(s){return{generic:(e=[...s.ptr.out([oe.property])].map(t=>s.validator.shape(t)),async t=>{const r=t.create({focusNode:t.valueOrNode});for(const n of e)await n.validate(r)})};var e}],[oe.qualifiedValueShape,function(s){const e=s.validator.shape(s.ptr.out([oe.qualifiedValueShape])),t=s.ptr.out([oe.qualifiedValueShapesDisjoint]).term,r=!!t&&(0,ft.fromRdf)(t),n=s.ptr.out([oe.qualifiedMaxCount]).term,o=n?parseInt(n.value):null,l=s.ptr.out([oe.qualifiedMinCount]).term;return{property:Oi(e,r,o,l?parseInt(l.value):null)}}],[oe.languageIn,function(s){return{generic:(e=[...new Set([...s.ptr.out([oe.languageIn]).list()].map(t=>t.value))],t=>{const r=e.some(n=>function(o,l){return!!l&&l.slice(0,o.length)===o}(n,t.valueOrNode.term.language));t.test(r,oe.LanguageInConstraintComponent,{args:{languageIn:e.join(", ")},message:[t.factory.literal("Language does not match any of {$languageIn}")],value:t.valueOrNode})})};var e}],[oe.maxLength,function(s){return{generic:(e=parseInt(s.ptr.out([oe.maxLength]).value),t=>{const r=t.valueOrNode.term.termType!=="BlankNode"&&t.valueOrNode.value.length<=e;t.test(r,oe.MaxLengthConstraintComponent,{args:{maxLength:e},message:[t.factory.literal("Value has more than {$maxLength} characters")],value:t.valueOrNode})})};var e}],[oe.minLength,function(s){return{generic:(e=parseInt(s.ptr.out([oe.minLength]).value),t=>{const r=t.valueOrNode.term.termType!=="BlankNode"&&t.valueOrNode.value.length>=e;t.test(r,oe.MinLengthConstraintComponent,{args:{minLength:e},message:[t.factory.literal("Value has less than {$minLength} characters")],value:t.valueOrNode})})};var e}],[oe.pattern,function(s){const e=s.ptr.out([oe.pattern]).value,t=s.ptr.out([oe.flags]).value;return{generic:ki(e,t,new RegExp(e,t))}}],[oe.uniqueLang,function(s){const e=s.ptr.out([oe.uniqueLang]).term;return e.value==="true"&&hr.boolean.equals(e.datatype)?{property:t=>{const r=Object.entries(t.values.terms.reduce((o,l)=>(l.language&&(o[l.language]=(o[l.language]||0)+1),o),{})),n=r.filter(([,o])=>o>1);for(const[o]of n)t.violation(oe.UniqueLangConstraintComponent,{args:{lang:o},message:[t.factory.literal('Language "{?lang}" used more than once')]});n.length===0&&t.debug(oe.UniqueLangConstraintComponent)}}:null}],[oe.class,function(s){return{generic:(e=s.ptr.out([oe.class]).map(t=>tr(t)),t=>{const r=new De(t.valueOrNode.out([Ke.type]).terms);for(const n of e){const o=[...r].some(l=>n.has(l));t.test(o,oe.ClassConstraintComponent,{value:t.valueOrNode})}})};var e}],[oe.datatype,function(s){return{generic:(e=s.ptr.out([oe.datatype]).term,t=new ws,r=>{const n=e.equals(r.valueOrNode.term.datatype)&&t.validateSimple(r.valueOrNode.term);r.test(n,oe.DatatypeConstraintComponent,{args:{datatype:e},message:[r.factory.literal("Value does not have datatype {$datatype}")],value:r.valueOrNode})})};var e,t}],[oe.nodeKind,function(s){const e=s.ptr.out([oe.nodeKind]).term;return{generic:xs(e,_s.get(e))}}]]),js=class{constructor(s,{factory:e,...t}){if(this.factory=e,this.options=t,this.registry=new xi(Ss),this.shapesPtr=new Nt({dataset:s,factory:e}),this.shapes=new nt,this.options.coverage&&(this.options.debug=!0,this.options.details=!0,this.options.trace=!0),this.options.validations)for(const[n,o]of this.options.validations)this.registry.validations.set(n,o);const r=[...this.shapesPtr.hasOut([oe.targetClass]),...this.shapesPtr.hasOut([oe.targetNode]),...this.shapesPtr.hasOut([oe.targetObjectsOf]),...this.shapesPtr.hasOut([oe.targetSubjectsOf]),...this.shapesPtr.hasOut([Ke.type],[oe.NodeShape]),...this.shapesPtr.hasOut([Ke.type],[oe.PropertyShape])];for(const n of r)this.shape(n)}shape(s){if(!s.term)return null;let e=this.shapes.get(s.term);return e||(e=new Ii(s,{validator:this}),this.shapes.set(s.term,e)),e}async validate(s,e){const t=new Nt({...s,factory:this.factory}),r=new wi({factory:this.factory,focusNode:t,options:this.options,validator:this});e=e?e.map(n=>this.shape(this.shapesPtr.node(n.terms))):this.shapes.values();for(const n of e){const o=r.create({shape:n});let l;l=t.isAny()?n.resolveTargets(o):t;for(const d of l)await n.validate(o.create({focusNode:d}))}return r.report}};var Hr=function(s,e,t,r){return new(t||(t=Promise))(function(n,o){function l(a){try{i(r.next(a))}catch(c){o(c)}}function d(a){try{i(r.throw(a))}catch(c){o(c)}}function i(a){var c;a.done?n(a.value):(c=a.value,c instanceof t?c:new t(function(p){p(c)})).then(l,d)}i((r=r.apply(s,e||[])).next())})};class Is extends HTMLElement{static get observedAttributes(){return Kt.dataAttributes()}constructor(e){super(),this.shape=null,this.attachShadow({mode:"open"}),this.form=document.createElement("form"),this.config=new Kt(e,this.form),this.form.addEventListener("change",t=>{t.stopPropagation(),this.config.editMode&&this.validate(!0).then(r=>{this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,composed:!0,detail:{valid:r}}))}).catch(r=>{console.warn(r)})})}connectedCallback(){this.shadowRoot.prepend(this.form)}attributeChangedCallback(){this.config.updateAttributes(this),this.initialize()}initialize(){clearTimeout(this.initDebounceTimeout),this.initDebounceTimeout=setTimeout(()=>Hr(this,void 0,void 0,function*(){this.form.replaceChildren(document.createTextNode(this.config.attributes.loading));try{yield this.config.loader.loadGraphs(),this.form.replaceChildren(),this.config.renderedNodes.clear();const e=this.findRootShaclShapeSubject();if(e){this.form.classList.forEach(r=>{this.form.classList.remove(r)}),this.form.classList.toggle("mode-edit",this.config.editMode),this.form.classList.toggle("mode-view",!this.config.editMode),this.config.theme.apply(this.form);const t=[this.config.theme.stylesheet];for(const r of Object.entries(dt).map(n=>n[1]))r.stylesheet&&t.push(r.stylesheet);if(this.shadowRoot.adoptedStyleSheets=t,this.shape=new Je(e,this.config,this.config.attributes.valuesSubject?we.namedNode(this.config.attributes.valuesSubject):void 0),this.form.appendChild(this.shape),this.config.editMode){if(this.config.attributes.submitButton!==null){const r=this.config.theme.createButton(this.config.attributes.submitButton||"Submit",!0);r.addEventListener("click",n=>{n.preventDefault(),this.form.reportValidity()&&this.validate().then(o=>{var l;o?this.dispatchEvent(new Event("submit",{bubbles:!0,cancelable:!0})):(l=this.form.querySelector(":scope .invalid > .editor"))===null||l===void 0||l.focus()})}),this.form.appendChild(r)}yield this.validate(!0)}}else if(this.config.shapesGraph.size>0)throw new Error("shacl root node shape not found")}catch(e){console.error(e);const t=document.createElement("div");t.innerText=String(e),this.form.replaceChildren(t)}}),200)}serialize(e="text/turtle",t=this.toRDF()){return function(r,n,o){if(n==="application/ld+json")return function(l){const d=[];for(const i of l){const a={"@id":i.subject.id};if(i.predicate===Oe)a["@type"]=i.object.id;else{let c=i.object.value;i.object instanceof Ue?i.object.language?c={"@language":i.object.language,"@value":i.object.value}:i.object.datatype&&i.object.datatype.value!==`${Xe}#string`&&(c={"@type":i.object.datatype.value,"@value":i.object.value}):c={"@id":i.object.id},a[i.predicate.value]=c}d.push(a)}return JSON.stringify(d)}(r);{const l=new ar({format:n,prefixes:o});l.addQuads(r);let d="";return l.end((i,a)=>{i&&console.error(i),d=a}),d}}(t.getQuads(null,null,null,null),e,this.config.prefixes)}toRDF(e=new ke){var t;return(t=this.shape)===null||t===void 0||t.toRDF(e),e}registerPlugin(e){Kr(e),this.initialize()}setTheme(e){this.config.theme=e,this.initialize()}setClassInstanceProvider(e){this.config.classInstanceProvider=e,this.initialize()}validate(){return Hr(this,arguments,void 0,function*(e=!1){var t,r,n,o,l,d;for(const i of this.form.querySelectorAll(":scope .validation-error"))i.remove();for(const i of this.form.querySelectorAll(":scope .property-instance"))i.classList.remove("invalid"),!((t=i.querySelector(":scope > .editor"))===null||t===void 0)&&t.value?i.classList.add("valid"):i.classList.remove("valid");this.config.shapesGraph.deleteGraph(""),(r=this.shape)===null||r===void 0||r.toRDF(this.config.shapesGraph);try{const i=this.config.shapesGraph,a=yield new js(i,{details:!0,factory:we}).validate({dataset:i});for(const c of a.results)if(!((o=(n=c.focusNode)===null||n===void 0?void 0:n.ptrs)===null||o===void 0)&&o.length)for(const p of c.focusNode.ptrs){const v=p._term;if(!((l=c.path)===null||l===void 0)&&l.length){const f=c.path[0].predicates[0];let h=this.form.querySelectorAll(`:scope [data-node-id='${v.id}'] [data-path='${f.id}'] > .editor`);h.length===0&&(h=this.form.querySelectorAll(`:scope [data-node-id='${v.id}'] [data-path='${f.id}']`));for(const w of h)if(w.classList.contains("editor")){if(!e||w.value){let g=w.parentElement;g.classList.add("invalid"),g.classList.remove("valid"),g.appendChild(this.createValidationErrorDisplay(c));do g.classList.contains("collapsible")&&g.classList.add("open"),g=g.parentElement;while(g)}}else e||(w.classList.add("invalid"),w.classList.remove("valid"),w.appendChild(this.createValidationErrorDisplay(c,"node")))}else e||(d=this.form.querySelector(`:scope [data-node-id='${v.id}']`))===null||d===void 0||d.prepend(this.createValidationErrorDisplay(c,"node"))}return a.conforms}catch(i){return console.error(i),!1}})}createValidationErrorDisplay(e,t){var r,n;const o=document.createElement("span");if(o.classList.add("validation-error"),t&&o.classList.add(t),e)if(((r=e.message)===null||r===void 0?void 0:r.length)>0)for(const l of e.message)o.title+=l.value+` -`;else o.title=(n=e.sourceConstraintComponent)===null||n===void 0?void 0:n.value;return o}findRootShaclShapeSubject(){let e=null;if(this.config.attributes.shapeSubject){if(e=we.namedNode(this.config.attributes.shapeSubject),!this.config.shapesGraph.has(new tt(e,Oe,bt,Se)))return void console.warn(`shapes graph does not contain requested root shape ${this.config.attributes.shapeSubject}`)}else if(this.config.attributes.valuesSubject&&this.config.dataGraph.size>0){const t=we.namedNode(this.config.attributes.valuesSubject),r=[...this.config.dataGraph.getQuads(t,Oe,null,null),...this.config.dataGraph.getQuads(t,Gt,null,null)];if(r.length===0)return void console.warn(`value subject '${this.config.attributes.valuesSubject}' has neither ${Oe.id} nor ${Gt.id} statement`);for(const n of r)if(this.config.shapesGraph.has(new tt(n.object,Oe,bt,Se))){e=n.object;break}if(!e){const n=this.config.shapesGraph.getQuads(null,or,r[0].object,Se);if(n.length===0)return void console.error(`value subject '${this.config.attributes.valuesSubject}' has no shacl shape definition in the shapes graph`);if(n.length>1&&console.warn(`value subject '${this.config.attributes.valuesSubject}' has multiple shacl shape definitions in the shapes graph, choosing the first found (${n[0].subject})`),this.config.shapesGraph.getQuads(n[0].subject,Oe,bt,Se).length===0)return void console.error(`value subject '${this.config.attributes.valuesSubject}' references a shape which is not a NodeShape (${n[0].subject})`);e=n[0].subject}}else{const t=this.config.shapesGraph.getQuads(null,Oe,bt,Se);if(t.length==0)return void console.warn("shapes graph does not contain any root shapes");t.length>1&&(console.warn("shapes graph contains",t.length,"root shapes. choosing first found which is",t[0].subject.value),console.info('hint: set the shape to use with attribute "data-shape-subject"')),e=t[0].subject}return e}}class Es extends Xr{constructor(e){super(e||`.editor:not([type='checkbox']) { border: 1px solid #DDD; padding: 2px 4px; } -.property-instance label { display: inline-block; word-break: break-word; line-height: 1em; padding-top: 0.15em; padding-right: 1em; flex-shrink: 0; position: relative; } -.property-instance:not(:first-child) > label { visibility: hidden; max-height: 0; } -.mode-edit .property-instance label { width: var(--label-width); } -`),this.idCtr=0}createDefaultTemplate(e,t,r,n,o){var l;n.id="e"+this.idCtr++,n.classList.add("editor"),o!=null&&o.datatype&&(n.shaclDatatype=o.datatype),(o==null?void 0:o.minCount)!==void 0&&(n.dataset.minCount=String(o.minCount)),o!=null&&o.class&&(n.dataset.class=o.class.value),o!=null&&o.nodeKind&&(n.dataset.nodeKind=o.nodeKind.value),o!=null&&o.hasValue&&(n.disabled=!0),n.value=(t==null?void 0:t.value)||((l=o==null?void 0:o.defaultValue)===null||l===void 0?void 0:l.value)||"";const d=document.createElement("label");d.htmlFor=n.id,d.innerText=e,o!=null&&o.description&&d.setAttribute("title",o.description.value);const i=o!=null&&o.description?o.description.value:o!=null&&o.pattern?o.pattern:null;i&&n.setAttribute("placeholder",i),r&&(n.setAttribute("required","true"),d.classList.add("required"));const a=document.createElement("div");return a.appendChild(d),a.appendChild(n),a}createDateEditor(e,t,r,n){var o,l;const d=document.createElement("input");((o=n.datatype)===null||o===void 0?void 0:o.value)===Xe+"dateTime"?(d.type="datetime-local",d.setAttribute("step","1")):d.type="date",d.classList.add("pr-0");const i=this.createDefaultTemplate(e,null,r,d,n);if(t)try{let a=new Date(t.value).toISOString();a=((l=n.datatype)===null||l===void 0?void 0:l.value)===Xe+"dateTime"?a.slice(0,19):a.slice(0,10),d.value=a}catch(a){console.error(a,t)}return i}createTextEditor(e,t,r,n){let o;return n.singleLine===!1?(o=document.createElement("textarea"),o.rows=5):(o=document.createElement("input"),o.type="text",n.pattern&&(o.pattern=n.pattern)),n.minLength&&(o.minLength=n.minLength),n.maxLength&&(o.maxLength=n.maxLength),this.createDefaultTemplate(e,t,r,o,n)}createLangStringEditor(e,t,r,n){var o;const l=this.createTextEditor(e,t,r,n),d=l.querySelector(":scope .editor");let i;if(!((o=n.languageIn)===null||o===void 0)&&o.length){i=document.createElement("select");for(const a of n.languageIn){const c=document.createElement("option");c.innerText=a.value,i.appendChild(c)}}else i=document.createElement("input"),i.maxLength=5,i.placeholder="lang?";return i.title="Language of the text",i.classList.add("lang-chooser"),i.addEventListener("change",a=>{a.stopPropagation(),d&&(d.dataset.lang=i.value,d.dispatchEvent(new Event("change",{bubbles:!0})))}),t instanceof Ue&&(i.value=t.language),d.dataset.lang=i.value,d.after(i),l}createBooleanEditor(e,t,r,n){var o;const l=document.createElement("input");l.type="checkbox",l.classList.add("ml-0");const d=this.createDefaultTemplate(e,null,r,l,n);return l.removeAttribute("required"),(o=d.querySelector(":scope label"))===null||o===void 0||o.classList.remove("required"),t instanceof Ue&&(l.checked=t.value==="true"),d}createFileEditor(e,t,r,n){const o=document.createElement("input");return o.type="file",o.addEventListener("change",l=>{var d;if(!((d=o.files)===null||d===void 0)&&d.length){l.stopPropagation();const i=new FileReader;i.readAsDataURL(o.files[0]),i.onload=()=>{var a;o.binaryData=btoa(i.result),(a=o.parentElement)===null||a===void 0||a.dispatchEvent(new Event("change",{bubbles:!0}))}}else o.binaryData=void 0}),this.createDefaultTemplate(e,t,r,o,n)}createNumberEditor(e,t,r,n){var o;const l=document.createElement("input");l.type="number",l.classList.add("pr-0");const d=n.minInclusive!==void 0?n.minInclusive:n.minExclusive!==void 0?n.minExclusive+1:void 0,i=n.maxInclusive!==void 0?n.maxInclusive:n.maxExclusive!==void 0?n.maxExclusive-1:void 0;return d!==void 0&&(l.min=String(d)),i!==void 0&&(l.max=String(i)),((o=n.datatype)===null||o===void 0?void 0:o.value)!==Xe+"integer"&&(l.step="0.1"),this.createDefaultTemplate(e,t,r,l,n)}createListEditor(e,t,r,n,o){const l=document.createElement("select"),d=this.createDefaultTemplate(e,null,r,l,o);let i=!0;for(const a of n){const c=document.createElement("option"),p=typeof a.value=="string"?a.value:a.value.value;c.innerHTML=a.label?a.label:p,c.value=p,t&&t.value===p&&(c.selected=!0),p===""&&(i=!1),l.appendChild(c)}if(i){const a=document.createElement("option");a.value="",t||(a.selected=!0),l.prepend(a)}return t&&(l.value=t.value),d}createButton(e,t){const r=document.createElement("button");return r.type="button",r.innerHTML=e,r}}class hn extends Is{constructor(){super(new Es)}}window.customElements.define("shacl-form",hn);const Ns={name:"FormDemo",setup(){const s=mn(),e=wr();return{store:s,selection:e}},components:{Term:fn,InstanceList:En,Splitpanes:yn,Pane:bn},mounted(){this.getResource()},watch:{resource_iri(s){this.getResource()},resource_iri(s){this.getShape()}},data(){return{dataModel:{},shapeTurtle:`@prefix sh: . -@prefix rdf: . -@prefix rdfs: . -@prefix ex: . - -ex:DefaultShape - a sh:NodeShape, rdfs:Class ; - sh:property [ - sh:name 'class' ; - sh:path rdf:type ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] ; - sh:property [ - sh:name 'label' ; - sh:path rdfs:label ; - sh:maxCount 1 ; - ] .`,subject:gt.namedNode("")}},computed:{...vn(wr,["graph_iri","resource_iri"]),res_type(){if(this.dataModel.getQuads!==void 0){const s=this.dataModel.getQuads(gt.namedNode(this.resource_iri),gt.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),null)[0];if(s)return s.object}return""}},methods:{async getResource(){this.subject=gt.namedNode(this.resource_iri),console.log("Form: get resource: "+this.resource_iri);const s=await this.store.getResource(this.resource_iri);this.dataModel=(await wn(s)).store},async getShape(){console.log("Form: Get shape for target class");let s=[];console.log(_r(this.resource_iri));const e=await this.store.sendQuery({query:_r(this.resource_iri)});if(console.log("Form: result:"+e),e.resultType==="quads"&&(s=await(await e.execute()).toArray()),s.length<1){console.log("Form: Get shape for class of current resource");const r=await this.store.sendQuery({query:_n(this.resource_iri)});if(r.resultType==="quads"){const n=await r.execute();console.log("Form: QuadStream"),console.log(n),s=await n.toArray()}}if(s.length<1)console.log("Form: Use default shape"),this.shapeTurtle=`@prefix sh: . -@prefix rdf: . -@prefix rdfs: . -@prefix ex: . - -ex:DefaultShape - a sh:NodeShape, rdfs:Class ; - sh:property [ - sh:name 'class' ; - sh:path rdf:type ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] ; - sh:property [ - sh:name 'label' ; - sh:path rdfs:label ; - sh:maxCount 1 ; - ] .`;else{console.log("Form: Use found shape");var t=await this.serialize(s,{format:"text/turtle",prefixes:this.prefixes});this.shapeTurtle=t.replaceAll('"',"'")}},selectResource(s){this.selection.changeResourceIri(s)},serialize(s,e={}){return new Promise((t,r)=>{const n=new xn(e);s.forEach(o=>{console.log(o),n.addQuad(o)}),n.end((o,l)=>{o!==null&&r(o),t(l)})})}}},Ts=We("dt",null,"IRI",-1),Rs=We("dt",null,"Type",-1),Os=["data-shapes"];function ks(s,e,t,r,n,o){const l=mt("Term"),d=mt("pane"),i=mt("InstanceList"),a=mt("splitpanes");return jn(),Sn(a,{class:"default-theme"},{default:Ct(()=>[yt(d,{size:"70"},{default:Ct(()=>[We("div",null,[We("dl",null,[Ts,We("dd",null,In(s.resource_iri),1),Rs,We("dd",null,[yt(l,{term:o.res_type,"onUpdate:term":e[0]||(e[0]=c=>o.res_type=c),onClick:o.selectResource},null,8,["term","onClick"])])])]),We("div",null,[We("shacl-form",{"data-shapes":n.shapeTurtle},null,8,Os)])]),_:1}),yt(d,{size:"30"},{default:Ct(()=>[yt(i,{style:{height:"80vh","overflow-y":"scroll"}})]),_:1})]),_:1})}const Ds=gn(Ns,[["render",ks]]);export{Ds as default}; diff --git a/pad/assets/InputForm-Du3E-_8t.js b/pad/assets/InputForm-BkXAP2gv.js similarity index 94% rename from pad/assets/InputForm-Du3E-_8t.js rename to pad/assets/InputForm-BkXAP2gv.js index a8896a0..a84e93b 100644 --- a/pad/assets/InputForm-Du3E-_8t.js +++ b/pad/assets/InputForm-BkXAP2gv.js @@ -1,3 +1,3 @@ -import{_ as h,u as k,T as f,f as s,m as _,r as g,c as d,a as e,d as m,F as y,e as j,g as b,t as p,b as I,o as l}from"./index-CWflGvq2.js";const C={name:"InputForm",setup(){return{store:k()}},components:{TermInput:f},data(){return{debug:!1,subject:s.namedNode(""),dataModel:[s.quad(s.blankNode(""),s.namedNode(""),s.namedNode(""))]}},computed:{..._(I,["graph_iri"])},methods:{newTriple(r){r||(r=0),this.dataModel.splice(r+1,0,s.quad(s.blankNode(""),s.namedNode(""),s.namedNode("")))},delTriple(r){this.dataModel.splice(r,1)},submit(){for(const r in this.dataModel){const t=this.dataModel[r];t.subject=this.subject}this.store.deleteInsertData({insertArray:this.dataModel,graphIri:this.graph_iri})}}},N={class:"Form"},M=e("label",{for:"resourceUriInput"},"Resource IRI (Subject)",-1),T={width:"100%"},v=e("tr",null,[e("th",{scope:"col",width:"45%"},"Predicate"),e("th",{scope:"col",width:"auto"},"Object"),e("th",{scope:"col",width:"90px"})],-1),w=["onClick"],S=["onClick"],U={key:1};function F(r,t,B,R,n,u){const c=g("TermInput");return l(),d("div",N,[e("form",null,[M,m(c,{term:n.subject,"onUpdate:term":t[0]||(t[0]=o=>n.subject=o),type:"iri",id:"resourceUriInput"},null,8,["term"]),e("table",T,[v,(l(!0),d(y,null,j(n.dataModel,(o,a)=>(l(),d("tr",{key:a},[e("td",null,[m(c,{id:"form-pred-"+a,term:o.predicate,"onUpdate:term":i=>o.predicate=i,type:"iri"},null,8,["id","term","onUpdate:term"])]),e("td",null,[m(c,{id:"form-obj-"+a,term:o.object,"onUpdate:term":i=>o.object=i},null,8,["id","term","onUpdate:term"])]),e("td",null,[e("button",{type:"button",class:"btn btn-outline-dark",onClick:i=>u.newTriple(a)},"+",8,w),e("button",{type:"button",class:"btn btn-outline-dark",onClick:i=>u.delTriple(a)},"-",8,S)])]))),128))]),n.dataModel.length<1?(l(),d("button",{key:0,type:"button",class:"btn btn-outline-dark mb-0",onClick:t[1]||(t[1]=o=>u.newTriple())},"+")):b("",!0),e("button",{type:"button",class:"btn btn-outline-primary mb-0",onClick:t[2]||(t[2]=(...o)=>u.submit&&u.submit(...o))},"Submit")]),n.debug==!1?(l(),d("a",{key:0,onClick:t[3]||(t[3]=o=>n.debug=!0)},"(show debug)")):b("",!0),n.debug?(l(),d("div",U,[e("a",{onClick:t[4]||(t[4]=o=>n.debug=!1)},"(hide debug)"),e("pre",null,"subject: "+p(n.subject)+` +import{_ as h,u as k,T as f,f as s,m as _,r as g,c as d,a as e,d as m,F as y,e as j,g as b,t as p,b as I,o as l}from"./index-DjCaYEkD.js";const C={name:"InputForm",setup(){return{store:k()}},components:{TermInput:f},data(){return{debug:!1,subject:s.namedNode(""),dataModel:[s.quad(s.blankNode(""),s.namedNode(""),s.namedNode(""))]}},computed:{..._(I,["graph_iri"])},methods:{newTriple(r){r||(r=0),this.dataModel.splice(r+1,0,s.quad(s.blankNode(""),s.namedNode(""),s.namedNode("")))},delTriple(r){this.dataModel.splice(r,1)},submit(){for(const r in this.dataModel){const t=this.dataModel[r];t.subject=this.subject}this.store.deleteInsertData({insertArray:this.dataModel,graphIri:this.graph_iri})}}},N={class:"Form"},M=e("label",{for:"resourceUriInput"},"Resource IRI (Subject)",-1),T={width:"100%"},v=e("tr",null,[e("th",{scope:"col",width:"45%"},"Predicate"),e("th",{scope:"col",width:"auto"},"Object"),e("th",{scope:"col",width:"90px"})],-1),w=["onClick"],S=["onClick"],U={key:1};function F(r,t,B,R,n,u){const c=g("TermInput");return l(),d("div",N,[e("form",null,[M,m(c,{term:n.subject,"onUpdate:term":t[0]||(t[0]=o=>n.subject=o),type:"iri",id:"resourceUriInput"},null,8,["term"]),e("table",T,[v,(l(!0),d(y,null,j(n.dataModel,(o,a)=>(l(),d("tr",{key:a},[e("td",null,[m(c,{id:"form-pred-"+a,term:o.predicate,"onUpdate:term":i=>o.predicate=i,type:"iri"},null,8,["id","term","onUpdate:term"])]),e("td",null,[m(c,{id:"form-obj-"+a,term:o.object,"onUpdate:term":i=>o.object=i},null,8,["id","term","onUpdate:term"])]),e("td",null,[e("button",{type:"button",class:"btn btn-outline-dark",onClick:i=>u.newTriple(a)},"+",8,w),e("button",{type:"button",class:"btn btn-outline-dark",onClick:i=>u.delTriple(a)},"-",8,S)])]))),128))]),n.dataModel.length<1?(l(),d("button",{key:0,type:"button",class:"btn btn-outline-dark mb-0",onClick:t[1]||(t[1]=o=>u.newTriple())},"+")):b("",!0),e("button",{type:"button",class:"btn btn-outline-primary mb-0",onClick:t[2]||(t[2]=(...o)=>u.submit&&u.submit(...o))},"Submit")]),n.debug==!1?(l(),d("a",{key:0,onClick:t[3]||(t[3]=o=>n.debug=!0)},"(show debug)")):b("",!0),n.debug?(l(),d("div",U,[e("a",{onClick:t[4]||(t[4]=o=>n.debug=!1)},"(hide debug)"),e("pre",null,"subject: "+p(n.subject)+` `+p(n.dataModel)+` `,1)])):b("",!0)])}const q=h(C,[["render",F]]);export{q as default}; diff --git a/pad/assets/InstanceList-AVehQBSG.js b/pad/assets/InstanceList-DoIEMcR8.js similarity index 76% rename from pad/assets/InstanceList-AVehQBSG.js rename to pad/assets/InstanceList-DoIEMcR8.js index d3e6e24..d5e472a 100644 --- a/pad/assets/InstanceList-AVehQBSG.js +++ b/pad/assets/InstanceList-DoIEMcR8.js @@ -1 +1 @@ -import{m as c,n as r,h as a,Q as n,b as s,o as i}from"./index-CWflGvq2.js";const o={name:"InstanceList",computed:{...c(s,["resource_iri"])}},p=Object.assign(o,{setup(u){return(e,l)=>(i(),r(n,{title:"Instance List",search:"",query:"select distinct ?instance { ?instance a <"+e.resource_iri+"> } order by ?instance","select-variable":"instance",itemClass:"py-2",ref:"instanceList",activeResource:e.resource_iri,selectResource:t=>{a(s)().changeResourceIri(t,!1)}},null,8,["query","activeResource","selectResource"]))}});export{p as default}; +import{m as c,n as r,h as a,R as n,b as s,o as i}from"./index-DjCaYEkD.js";const o={name:"InstanceList",computed:{...c(s,["resource_iri"])}},p=Object.assign(o,{setup(u){return(e,l)=>(i(),r(n,{title:"Instance List",search:"",query:"select distinct ?instance { ?instance a <"+e.resource_iri+"> } order by ?instance","select-variable":"instance",itemClass:"py-2",ref:"instanceList",activeResource:e.resource_iri,selectResource:t=>{a(s)().changeResourceIri(t,!1)}},null,8,["query","activeResource","selectResource"]))}});export{p as default}; diff --git a/pad/assets/Source-DLJIiKEC.js b/pad/assets/Source-DTEjL7Kq.js similarity index 65% rename from pad/assets/Source-DLJIiKEC.js rename to pad/assets/Source-DTEjL7Kq.js index 1275224..f5000fe 100644 --- a/pad/assets/Source-DLJIiKEC.js +++ b/pad/assets/Source-DTEjL7Kq.js @@ -1 +1 @@ -import{_ as g,u as f,m as n,q as m,R as p,S,c as u,a as r,t as l,C as c,D as h,E as b,g as d,b as _,I as D,o as i}from"./index-CWflGvq2.js";import{a as R}from"./n3-compare-B4Bu77vD.js";const v={name:"Source",setup(){return{store:f()}},mounted(){this.getResource()},watch:{resource_iri(t){this.getResource()}},computed:{...n(_,["graph_iri","resource_iri"]),...n(D,["prefixes_flat"])},data(){return{debug:!1,originalData:{},resourceSource:""}},methods:{async getResource(){console.log("get resource");const t=await this.store.getResource(this.resource_iri);this.originalData=(await m(t)).store,this.resourceSource=await p(this.originalData.match(),{format:"text/turtle",prefixes:this.prefixes_flat})},async updateResource(){const t=await S(this.resourceSource),e=R(this.originalData,t);this.store.deleteInsertData({insertArray:e.add,deleteArray:e.del,graphIri:this.graph_iri})}}},w={class:"form-group"},x=r("label",{for:"sourceInput",class:""},"Turtle",-1),y={key:1};function k(t,e,C,T,s,a){return i(),u("div",null,[r("strong",null,"Sources of "+l(t.resource_iri),1),c(" ("),r("a",{onClick:e[0]||(e[0]=(...o)=>a.getResource&&a.getResource(...o))},"refresh"),c(") "),r("form",null,[r("div",w,[x,h(r("textarea",{id:"sourceInput",class:"form-control","onUpdate:modelValue":e[1]||(e[1]=o=>s.resourceSource=o),rows:"15"},null,512),[[b,s.resourceSource]])]),r("button",{type:"button",class:"btn btn-outline-primary mb-0",onClick:e[2]||(e[2]=o=>a.updateResource())},"Submit")]),s.debug==!1?(i(),u("a",{key:0,onClick:e[3]||(e[3]=o=>s.debug=!0)},"(show debug)")):d("",!0),s.debug?(i(),u("div",y,[r("a",{onClick:e[4]||(e[4]=o=>s.debug=!1)},"(hide debug)"),r("pre",null,l(t.originalSource)+" ",1)])):d("",!0)])}const q=g(v,[["render",k]]);export{q as default}; +import{_ as g,u as f,m as n,q as m,N as p,S,c as u,a as r,t as l,C as c,D as h,E as b,g as d,b as _,I as D,o as i}from"./index-DjCaYEkD.js";import{a as v}from"./n3-compare-Q4z2T_H1.js";const w={name:"Source",setup(){return{store:f()}},mounted(){this.getResource()},watch:{resource_iri(t){this.getResource()}},computed:{...n(_,["graph_iri","resource_iri"]),...n(D,["prefixes_flat"])},data(){return{debug:!1,originalData:{},resourceSource:""}},methods:{async getResource(){console.log("get resource");const t=await this.store.getResource(this.resource_iri);this.originalData=(await m(t)).store,this.resourceSource=await p(this.originalData.match(),{format:"text/turtle",prefixes:this.prefixes_flat})},async updateResource(){const t=await S(this.resourceSource),e=v(this.originalData,t);this.store.deleteInsertData({insertArray:e.add,deleteArray:e.del,graphIri:this.graph_iri})}}},x={class:"form-group"},y=r("label",{for:"sourceInput",class:""},"Turtle",-1),R={key:1};function k(t,e,C,T,s,a){return i(),u("div",null,[r("strong",null,"Sources of "+l(t.resource_iri),1),c(" ("),r("a",{onClick:e[0]||(e[0]=(...o)=>a.getResource&&a.getResource(...o))},"refresh"),c(") "),r("form",null,[r("div",x,[y,h(r("textarea",{id:"sourceInput",class:"form-control","onUpdate:modelValue":e[1]||(e[1]=o=>s.resourceSource=o),rows:"15"},null,512),[[b,s.resourceSource]])]),r("button",{type:"button",class:"btn btn-outline-primary mb-0",onClick:e[2]||(e[2]=o=>a.updateResource())},"Submit")]),s.debug==!1?(i(),u("a",{key:0,onClick:e[3]||(e[3]=o=>s.debug=!0)},"(show debug)")):d("",!0),s.debug?(i(),u("div",R,[r("a",{onClick:e[4]||(e[4]=o=>s.debug=!1)},"(hide debug)"),r("pre",null,l(t.originalSource)+" ",1)])):d("",!0)])}const V=g(w,[["render",k]]);export{V as default}; diff --git a/pad/assets/Term-CKdvsSUc.js b/pad/assets/Term-Blmh2NdX.js similarity index 92% rename from pad/assets/Term-CKdvsSUc.js rename to pad/assets/Term-Blmh2NdX.js index b189f97..761ae98 100644 --- a/pad/assets/Term-CKdvsSUc.js +++ b/pad/assets/Term-Blmh2NdX.js @@ -1 +1 @@ -import{_ as u,o as r,c as m,C as n,a as l,t,J as i,g as d}from"./index-CWflGvq2.js";const v={name:"Term",props:["term"],emits:["click"],methods:{selectResource:function(s){this.$emit("click",s)}}},_={key:0},y={key:1},f={key:2};function k(s,a,e,T,g,c){return r(),m("div",null,[e.term.termType==="NamedNode"?(r(),m("span",_,[n(" <"),l("a",{href:"#",onClick:a[0]||(a[0]=i(o=>c.selectResource(e.term.value),["prevent"]))},t(e.term.value),1),n("> ")])):e.term.termType==="Literal"&&e.term.language?(r(),m("span",y,'"'+t(e.term.value)+'"@'+t(e.term.language),1)):e.term.termType==="Literal"&&e.term.datatype.value?(r(),m("span",f,[n('"'+t(e.term.value)+'"^^<',1),l("a",{href:"#",onClick:a[1]||(a[1]=i(o=>c.selectResource(e.term.datatype.value),["prevent"]))},t(e.term.datatype.value),1),n(">")])):d("",!0)])}const N=u(v,[["render",k]]);export{N as T}; +import{_ as u,o as r,c as m,C as n,a as l,t,J as i,g as d}from"./index-DjCaYEkD.js";const v={name:"Term",props:["term"],emits:["click"],methods:{selectResource:function(s){this.$emit("click",s)}}},_={key:0},y={key:1},f={key:2};function k(s,a,e,T,g,c){return r(),m("div",null,[e.term.termType==="NamedNode"?(r(),m("span",_,[n(" <"),l("a",{href:"#",onClick:a[0]||(a[0]=i(o=>c.selectResource(e.term.value),["prevent"]))},t(e.term.value),1),n("> ")])):e.term.termType==="Literal"&&e.term.language?(r(),m("span",y,'"'+t(e.term.value)+'"@'+t(e.term.language),1)):e.term.termType==="Literal"&&e.term.datatype.value?(r(),m("span",f,[n('"'+t(e.term.value)+'"^^<',1),l("a",{href:"#",onClick:a[1]||(a[1]=i(o=>c.selectResource(e.term.datatype.value),["prevent"]))},t(e.term.datatype.value),1),n(">")])):d("",!0)])}const N=u(v,[["render",k]]);export{N as T}; diff --git a/pad/assets/VocPad-D_dUwJLt.js b/pad/assets/VocPad-Ccm15vTJ.js similarity index 99% rename from pad/assets/VocPad-D_dUwJLt.js rename to pad/assets/VocPad-Ccm15vTJ.js index fb1ea52..1d72c3b 100644 --- a/pad/assets/VocPad-D_dUwJLt.js +++ b/pad/assets/VocPad-Ccm15vTJ.js @@ -1,4 +1,4 @@ -import{k as nt,l as C,r as A,o as p,c,n as O,g as R,d as P,s as Pt,w as j,F as z,e as E,a as r,v as N,x as $,y as kt,z as wt,A as H,p as Ct,j as Dt,B as U,C as It,t as B,D as zt,E as Et,G as Tt,_ as Zt,u as Nt,b as it,T as Lt,m as Bt,H as st,I as At,J as Ot,K as $t}from"./index-CWflGvq2.js";import{d as Rt}from"./n3-compare-B4Bu77vD.js";var Vt=Object.defineProperty,Ut=(t,e,o)=>e in t?Vt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,I=(t,e,o)=>(Ut(t,typeof e!="symbol"?e+"":e,o),o),qt=Object.defineProperty,Ht=Object.defineProperties,jt=Object.getOwnPropertyDescriptors,rt=Object.getOwnPropertySymbols,Xt=Object.prototype.hasOwnProperty,Yt=Object.prototype.propertyIsEnumerable,lt=(t,e,o)=>e in t?qt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,Ft=(t,e)=>{for(var o in e||(e={}))Xt.call(e,o)&<(t,o,e[o]);if(rt)for(var o of rt(e))Yt.call(e,o)&<(t,o,e[o]);return t},Wt=(t,e)=>Ht(t,jt(e)),at=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof nt<"u"?nt:typeof self<"u"?self:{},Gt=function(){var t="",e,o,n,i=[],s={passive:!0};window.addEventListener?(e="addEventListener",o="removeEventListener"):(e="attachEvent",o="detachEvent",t="on"),n="onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll";function l(v,u){var y=function(g){!g&&(g=window.event);var S={originalEvent:g,target:g.target||g.srcElement,type:"wheel",deltaMode:g.type=="MozMousePixelScroll"?0:1,deltaX:0,delatZ:0,preventDefault:function(){g.preventDefault?g.preventDefault():g.returnValue=!1}};return n=="mousewheel"?(S.deltaY=-.025*g.wheelDelta,g.wheelDeltaX&&(S.deltaX=-.025*g.wheelDeltaX)):S.deltaY=g.detail,u(S)};return i.push({element:v,fn:y}),y}function d(v){for(var u=0;ue?(clearTimeout(d),d=null,a=m,l=t.apply(i,s),d||(i=s=null)):!d&&o.trailing!==!1&&(d=setTimeout(h,b)),l}},createRequestAnimationFrame:function(t){var e=null;return t!=="auto"&&t<60&&t>1&&(e=Math.floor(1e3/t)),e===null?window.requestAnimationFrame||dt(33):dt(e)}};function dt(t){return function(e){window.setTimeout(e,t)}}var K=tt,bt="unknown";document.documentMode&&(bt="ie");var et={svgNS:"http://www.w3.org/2000/svg",xmlNS:"http://www.w3.org/XML/1998/namespace",xmlnsNS:"http://www.w3.org/2000/xmlns/",xlinkNS:"http://www.w3.org/1999/xlink",evNS:"http://www.w3.org/2001/xml-events",getBoundingClientRectNormalized:function(t){if(t.clientWidth&&t.clientHeight)return{width:t.clientWidth,height:t.clientHeight};if(t.getBoundingClientRect())return t.getBoundingClientRect();throw new Error("Cannot get BoundingClientRect for SVG.")},getOrCreateViewport:function(t,e){var o=null;if(K.isElement(e)?o=e:o=t.querySelector(e),!o){var n=Array.prototype.slice.call(t.childNodes||t.children).filter(function(a){return a.nodeName!=="defs"&&a.nodeName!=="#text"});n.length===1&&n[0].nodeName==="g"&&n[0].getAttribute("transform")===null&&(o=n[0])}if(!o){var i="viewport-"+new Date().toISOString().replace(/\D/g,"");o=document.createElementNS(this.svgNS,"g"),o.setAttribute("id",i);var s=t.childNodes||t.children;if(s&&s.length>0)for(var l=s.length;l>0;l--)s[s.length-l].nodeName!=="defs"&&o.appendChild(s[s.length-l]);t.appendChild(o)}var d=[];return o.getAttribute("class")&&(d=o.getAttribute("class").split(" ")),~d.indexOf("svg-pan-zoom_viewport")||(d.push("svg-pan-zoom_viewport"),o.setAttribute("class",d.join(" "))),o},setupSvgAttributes:function(t){if(t.setAttribute("xmlns",this.svgNS),t.setAttributeNS(this.xmlnsNS,"xmlns:xlink",this.xlinkNS),t.setAttributeNS(this.xmlnsNS,"xmlns:ev",this.evNS),t.parentNode!==null){var e=t.getAttribute("style")||"";e.toLowerCase().indexOf("overflow")===-1&&t.setAttribute("style","overflow: hidden; "+e)}},internetExplorerRedisplayInterval:300,refreshDefsGlobal:K.throttle(function(){for(var t=document.querySelectorAll("defs"),e=t.length,o=0;o=0;n--)this.eventListeners.hasOwnProperty(o[n])&&delete this.eventListeners[o[n]]}for(var i in this.eventListeners)(this.options.eventsListenerElement||this.svg).addEventListener(i,this.eventListeners[i],this.options.preventMouseEventsDefault?!1:St);this.options.mouseWheelZoomEnabled&&(this.options.mouseWheelZoomEnabled=!1,this.enableMouseWheelZoom())};f.prototype.enableMouseWheelZoom=function(){if(!this.options.mouseWheelZoomEnabled){var t=this;this.wheelListener=function(o){return t.handleMouseWheel(o)};var e=!this.options.preventMouseEventsDefault;xt.on(this.options.eventsListenerElement||this.svg,this.wheelListener,e),this.options.mouseWheelZoomEnabled=!0}};f.prototype.disableMouseWheelZoom=function(){if(this.options.mouseWheelZoomEnabled){var t=!this.options.preventMouseEventsDefault;xt.off(this.options.eventsListenerElement||this.svg,this.wheelListener,t),this.options.mouseWheelZoomEnabled=!1}};f.prototype.handleMouseWheel=function(t){if(!(!this.options.zoomEnabled||this.state!=="none")){this.options.preventMouseEventsDefault&&(t.preventDefault?t.preventDefault():t.returnValue=!1);var e=t.deltaY||1,o=Date.now()-this.lastMouseWheelEventTime,n=3+Math.max(0,30-o);this.lastMouseWheelEventTime=Date.now(),"deltaMode"in t&&t.deltaMode===0&&t.wheelDelta&&(e=t.deltaY===0?0:Math.abs(t.wheelDelta)/t.deltaY),e=-.30?1:-1)*Math.log(Math.abs(e)+10)/n;var i=this.svg.getScreenCTM().inverse(),s=L.getEventPoint(t,this.svg).matrixTransform(i),l=Math.pow(1+this.options.zoomScaleSensitivity,-1*e);this.zoomAtPoint(l,s)}};f.prototype.zoomAtPoint=function(t,e,o){var n=this.viewport.getOriginalState();o?(t=Math.max(this.options.minZoom*n.zoom,Math.min(this.options.maxZoom*n.zoom,t)),t=t/this.getZoom()):this.getZoom()*tthis.options.maxZoom*n.zoom&&(t=this.options.maxZoom*n.zoom/this.getZoom());var i=this.viewport.getCTM(),s=e.matrixTransform(i.inverse()),l=this.svg.createSVGMatrix().translate(s.x,s.y).scale(t).translate(-s.x,-s.y),d=i.multiply(l);d.a!==i.a&&this.viewport.setCTM(d)};f.prototype.zoom=function(t,e){this.zoomAtPoint(t,L.getSvgCenterPoint(this.svg,this.width,this.height),e)};f.prototype.publicZoom=function(t,e){e&&(t=this.computeFromRelativeZoom(t)),this.zoom(t,e)};f.prototype.publicZoomAtPoint=function(t,e,o){if(o&&(t=this.computeFromRelativeZoom(t)),T.getType(e)!=="SVGPoint")if("x"in e&&"y"in e)e=L.createSVGPoint(this.svg,e.x,e.y);else throw new Error("Given point is invalid");this.zoomAtPoint(t,e,o)};f.prototype.getZoom=function(){return this.viewport.getZoom()};f.prototype.getRelativeZoom=function(){return this.viewport.getRelativeZoom()};f.prototype.computeFromRelativeZoom=function(t){return t*this.viewport.getOriginalState().zoom};f.prototype.resetZoom=function(){var t=this.viewport.getOriginalState();this.zoom(t.zoom,!0)};f.prototype.resetPan=function(){this.pan(this.viewport.getOriginalState())};f.prototype.reset=function(){this.resetZoom(),this.resetPan()};f.prototype.handleDblClick=function(t){if(this.options.preventMouseEventsDefault&&(t.preventDefault?t.preventDefault():t.returnValue=!1),this.options.controlIconsEnabled){var e=t.target.getAttribute("class")||"";if(e.indexOf("svg-pan-zoom-control")>-1)return!1}var o;t.shiftKey?o=1/((1+this.options.zoomScaleSensitivity)*2):o=(1+this.options.zoomScaleSensitivity)*2;var n=L.getEventPoint(t,this.svg).matrixTransform(this.svg.getScreenCTM().inverse());this.zoomAtPoint(o,n)};f.prototype.handleMouseDown=function(t,e){this.options.preventMouseEventsDefault&&(t.preventDefault?t.preventDefault():t.returnValue=!1),T.mouseAndTouchNormalize(t,this.svg),this.options.dblClickZoomEnabled&&T.isDblClick(t,e)?this.handleDblClick(t):(this.state="pan",this.firstEventCTM=this.viewport.getCTM(),this.stateOrigin=L.getEventPoint(t,this.svg).matrixTransform(this.firstEventCTM.inverse()))};f.prototype.handleMouseMove=function(t){if(this.options.preventMouseEventsDefault&&(t.preventDefault?t.preventDefault():t.returnValue=!1),this.state==="pan"&&this.options.panEnabled){var e=L.getEventPoint(t,this.svg).matrixTransform(this.firstEventCTM.inverse()),o=this.firstEventCTM.translate(e.x-this.stateOrigin.x,e.y-this.stateOrigin.y);this.viewport.setCTM(o)}};f.prototype.handleMouseUp=function(t){this.options.preventMouseEventsDefault&&(t.preventDefault?t.preventDefault():t.returnValue=!1),this.state==="pan"&&(this.state="none")};f.prototype.fit=function(){var t=this.viewport.getViewBox(),e=Math.min(this.width/t.width,this.height/t.height);this.zoom(e,!0)};f.prototype.contain=function(){var t=this.viewport.getViewBox(),e=Math.max(this.width/t.width,this.height/t.height);this.zoom(e,!0)};f.prototype.center=function(){var t=this.viewport.getViewBox(),e=(this.width-(t.width+t.x*2)*this.getZoom())*.5,o=(this.height-(t.height+t.y*2)*this.getZoom())*.5;this.getPublicInstance().pan({x:e,y:o})};f.prototype.updateBBox=function(){this.viewport.simpleViewBoxCache()};f.prototype.pan=function(t){var e=this.viewport.getCTM();e.e=t.x,e.f=t.y,this.viewport.setCTM(e)};f.prototype.panBy=function(t){var e=this.viewport.getCTM();e.e+=t.x,e.f+=t.y,this.viewport.setCTM(e)};f.prototype.getPan=function(){var t=this.viewport.getState();return{x:t.x,y:t.y}};f.prototype.resize=function(){var t=L.getBoundingClientRectNormalized(this.svg);this.width=t.width,this.height=t.height;var e=this.viewport;e.options.width=this.width,e.options.height=this.height,e.processCTM(),this.options.controlIconsEnabled&&(this.getPublicInstance().disableControlIcons(),this.getPublicInstance().enableControlIcons())};f.prototype.destroy=function(){var t=this;this.beforeZoom=null,this.onZoom=null,this.beforePan=null,this.onPan=null,this.onUpdatedCTM=null,this.options.customEventsHandler!=null&&this.options.customEventsHandler.destroy({svgElement:this.svg,eventsListenerElement:this.options.eventsListenerElement,instance:this.getPublicInstance()});for(var e in this.eventListeners)(this.options.eventsListenerElement||this.svg).removeEventListener(e,this.eventListeners[e],this.options.preventMouseEventsDefault?!1:St);this.disableMouseWheelZoom(),this.getPublicInstance().disableControlIcons(),this.reset(),V=V.filter(function(o){return o.svg!==t.svg}),delete this.options,delete this.viewport,delete this.publicInstance,delete this.pi,this.getPublicInstance=function(){return null}};f.prototype.getPublicInstance=function(){var t=this;return this.publicInstance||(this.publicInstance=this.pi={enablePan:function(){return t.options.panEnabled=!0,t.pi},disablePan:function(){return t.options.panEnabled=!1,t.pi},isPanEnabled:function(){return!!t.options.panEnabled},pan:function(e){return t.pan(e),t.pi},panBy:function(e){return t.panBy(e),t.pi},getPan:function(){return t.getPan()},setBeforePan:function(e){return t.options.beforePan=e===null?null:T.proxy(e,t.publicInstance),t.pi},setOnPan:function(e){return t.options.onPan=e===null?null:T.proxy(e,t.publicInstance),t.pi},enableZoom:function(){return t.options.zoomEnabled=!0,t.pi},disableZoom:function(){return t.options.zoomEnabled=!1,t.pi},isZoomEnabled:function(){return!!t.options.zoomEnabled},enableControlIcons:function(){return t.options.controlIconsEnabled||(t.options.controlIconsEnabled=!0,J.enable(t)),t.pi},disableControlIcons:function(){return t.options.controlIconsEnabled&&(t.options.controlIconsEnabled=!1,J.disable(t)),t.pi},isControlIconsEnabled:function(){return!!t.options.controlIconsEnabled},enableDblClickZoom:function(){return t.options.dblClickZoomEnabled=!0,t.pi},disableDblClickZoom:function(){return t.options.dblClickZoomEnabled=!1,t.pi},isDblClickZoomEnabled:function(){return!!t.options.dblClickZoomEnabled},enableMouseWheelZoom:function(){return t.enableMouseWheelZoom(),t.pi},disableMouseWheelZoom:function(){return t.disableMouseWheelZoom(),t.pi},isMouseWheelZoomEnabled:function(){return!!t.options.mouseWheelZoomEnabled},setZoomScaleSensitivity:function(e){return t.options.zoomScaleSensitivity=e,t.pi},setMinZoom:function(e){return t.options.minZoom=e,t.pi},setMaxZoom:function(e){return t.options.maxZoom=e,t.pi},setBeforeZoom:function(e){return t.options.beforeZoom=e===null?null:T.proxy(e,t.publicInstance),t.pi},setOnZoom:function(e){return t.options.onZoom=e===null?null:T.proxy(e,t.publicInstance),t.pi},zoom:function(e){return t.publicZoom(e,!0),t.pi},zoomBy:function(e){return t.publicZoom(e,!1),t.pi},zoomAtPoint:function(e,o){return t.publicZoomAtPoint(e,o,!0),t.pi},zoomAtPointBy:function(e,o){return t.publicZoomAtPoint(e,o,!1),t.pi},zoomIn:function(){return this.zoomBy(1+t.options.zoomScaleSensitivity),t.pi},zoomOut:function(){return this.zoomBy(1/(1+t.options.zoomScaleSensitivity)),t.pi},getZoom:function(){return t.getRelativeZoom()},setOnUpdatedCTM:function(e){return t.options.onUpdatedCTM=e===null?null:T.proxy(e,t.publicInstance),t.pi},resetZoom:function(){return t.resetZoom(),t.pi},resetPan:function(){return t.resetPan(),t.pi},reset:function(){return t.reset(),t.pi},fit:function(){return t.fit(),t.pi},contain:function(){return t.contain(),t.pi},center:function(){return t.center(),t.pi},updateBBox:function(){return t.updateBBox(),t.pi},resize:function(){return t.resize(),t.pi},getSizes:function(){return{width:t.width,height:t.height,realZoom:t.getZoom(),viewBox:t.viewport.getViewBox()}},destroy:function(){return t.destroy(),t.pi}}),this.publicInstance};var V=[],oe=function(t,e){var o=T.getSvg(t);if(o===null)return null;for(var n=V.length-1;n>=0;n--)if(V[n].svg===o)return V[n].instance.getPublicInstance();return V.push({svg:o,instance:new f(o,e)}),V[V.length-1].instance.getPublicInstance()},ne=oe,Mt=(t,e)=>{const o=t.__vccOpts||t;for(const[n,i]of e)o[n]=i;return o};const ie=["x","y","width","height"],se=C({__name:"Scope",props:{mainSPZ:null,thumbnailSPZ:null},setup(t){const e=t,o=$(0),n=$(0),i=$(0),s=$(0),l=$(null),d=()=>{if(!e.mainSPZ||!e.thumbnailSPZ)return;const h=e.mainSPZ.getPan().x,m=e.mainSPZ.getPan().y,b=e.mainSPZ.getSizes().width,w=e.mainSPZ.getSizes().height,v=e.mainSPZ.getSizes().realZoom,u=e.thumbnailSPZ.getPan().x,y=e.thumbnailSPZ.getPan().y,g=e.thumbnailSPZ.getSizes().realZoom/v,S=u-h*g,X=y-m*g,W=b*g,G=w*g;o.value=S+1,n.value=X+1,i.value=W-2,s.value=G-2},a=h=>{if(h.which==0&&h.button==0||!l.value)return;let m=e.mainSPZ,b=e.thumbnailSPZ,w=l.value.getBoundingClientRect();m.getSizes().width,m.getSizes().height;let v=m.getSizes().realZoom,u=b.getSizes().width,y=b.getSizes().height,g=b.getSizes().realZoom;var S=h.clientX-w.left-u/2,X=h.clientY-w.top-y/2,W=-S*v/g,G=-X*v/g;m.pan({x:W,y:G})};return wt(()=>{d(),e.mainSPZ.setOnPan(()=>d()),e.mainSPZ.setOnZoom(()=>d())}),(h,m)=>(p(),c("svg",{class:"svg-pan-zoom__scope",onClick:a,onMousemove:a,ref_key:"scopeSVG",ref:l},[r("rect",{class:"scope",x:o.value,y:n.value,width:i.value,height:s.value},null,8,ie)],544))}});var re=Mt(se,[["__scopeId","data-v-169415fd"]]);const le=C({__name:"SvgPanZoomThumbnail",props:{mainSPZ:null},emits:["thumbnailCreated"],setup(t,{emit:e}){const o=t,n=$(null),i=l=>{o.mainSPZ[l.deltaY<0?"zoomIn":"zoomOut"]()},s=l=>{n.value=l,e("thumbnailCreated",l)};return(l,d)=>(p(),c("div",{class:"svg-pan-zoom__thumbnail",onWheel:i},[P(_t,{class:"thumbnail",zoomEnabled:!1,panEnabled:!1,controlIconsEnabled:!1,dblClickZoomEnabled:!1,preventMouseEventsDefault:!0,onCreated:s},{default:j(()=>[H(l.$slots,"default",{},void 0,!0)]),_:3}),n.value?(p(),O(re,{key:0,mainSPZ:t.mainSPZ,thumbnailSPZ:n.value},null,8,["mainSPZ","thumbnailSPZ"])):R("",!0)],32))}});var ae=Mt(le,[["__scopeId","data-v-093287c4"]]);const de={class:"svg-pan-zoom"},_t=C({__name:"SvgPanZoom",props:{viewportSelector:{type:[String,Object],default:".svg-pan-zoom"},panEnabled:{type:Boolean,default:!0},controlIconsEnabled:{type:Boolean,default:!1},zoomEnabled:{type:Boolean,default:!0},dblClickZoomEnabled:{type:Boolean,default:!0},mouseWheelZoomEnabled:{type:Boolean,default:!0},preventMouseEventsDefault:{type:Boolean,default:!0},zoomScaleSensitivity:{type:Number,default:.2},minZoom:{type:Number,default:.5},maxZoom:{type:Number,default:10},fit:{type:Boolean,default:!0},contain:{type:Boolean,default:!0},center:{type:Boolean,default:!0},refreshRate:{type:[Number,String],default:"auto"}},emits:["beforeZoom","onZoom","beforePan","onPan","onUpdatedCTM","created","thumbnailCreated"],setup(t,{emit:e}){const o=t,n=$(null),i=kt(),s=$({});Object.keys(o).filter(a=>o[a]!==void 0).forEach(a=>{s.value=Wt(Ft({},s.value),{[a]:o[a]})});const l=$(null),d=a=>{if(a&&a.tagName==="svg")return a;const h=Array.from(a.children);if(!h)return!1;for(const m of h){const b=d(m);if(b)return b}return!1};return wt(()=>{if(s.value.onZoom=h=>e("onZoom",h),s.value.onPan=h=>e("onPan",h),!(i.default&&n.value))return;const a=d(n.value);a&&(l.value=ne(a,s.value),e("created",l.value))}),(a,h)=>(p(),c("div",de,[r("div",{class:"svg-pan-zoom__default",ref_key:"defaultSlot",ref:n},[H(a.$slots,"default")],512),a.$slots.thumbnail&&l.value?(p(),O(ae,{key:0,onThumbnailCreated:h[0]||(h[0]=m=>a.$emit("thumbnailCreated",m)),mainSPZ:l.value},{default:j(()=>[H(a.$slots,"thumbnail")]),_:3},8,["mainSPZ"])):R("",!0)]))}}),he=C({data(){return{onContextMenu:t=>{t.preventDefault()},onMouseDown:t=>{const e=this,o=t==null?void 0:t.target.closest(".diagram-context-menu"),n=t==null?void 0:t.target.closest(".has-menu");this.menuX=t.pageX,this.menuY=t.pageY,o?(t.stopPropagation(),this.menuItemClick(t,this.showMenuComponent),e.showMenuComponent=void 0):n&&t.button===2?(this.showMenuComponent=n.vueComponent,t.stopPropagation()):e.showMenuComponent=void 0},menuX:0,menuY:0,showMenuComponent:void 0}},mounted(){this.$parent.$el.addEventListener("mousedown",this.onMouseDown,{capture:!0}),this.$parent.$el.addEventListener("contextmenu",this.onContextMenu)},beforeUnmount(){this.$parent.$el.removeEventListener("mousedown",this.onMouseDown),this.$parent.$el.addEventListener("contextmenu",this.onContextMenu)},methods:{menuItemClick(t,e){var o;const n=(o=t==null?void 0:t.target)==null?void 0:o.dataset;n!=null&&n.childItemKey?e.menu[n.menuItemKey].children[n.childItemKey].handler.call(e):e.menu[n.menuItemKey].handler.call(e)}}}),Z=(t,e)=>{const o=t.__vccOpts||t;for(const[n,i]of e)o[n]=i;return o},ue=["data-menu-item-key"],pe={key:0,style:{float:"right"}},ce={key:1,class:"menu-item-children-container"},me=["data-menu-item-key","data-child-item-key"];function ge(t,e,o,n,i,s){return p(),c("div",null,[t.showMenuComponent?(p(),c("div",{key:0,class:U("menu diagram-context-menu"),style:N(`left: ${t.menuX}px; top: ${t.menuY}px`)},[(p(!0),c(z,null,E(t.showMenuComponent.menu,(l,d)=>(p(),c("div",{key:d,class:U(`menu-item ${l.classes?l.classes.join(" "):""}`),"data-menu-item-key":d},[It(B(l.label)+" ",1),l.children?(p(),c("span",pe," > ")):R("",!0),l.children?(p(),c("div",ce,[(p(!0),c(z,null,E(l.children,(a,h)=>(p(),c("div",{key:h,class:U(`menu-item child-menu-item ${a.classes?a.classes.join(" "):""}`),"data-menu-item-key":d,"data-child-item-key":h},B(a.label),11,me))),128))])):R("",!0)],10,ue))),128))],4)):R("",!0)])}const ve=Z(he,[["render",ge],["__scopeId","data-v-f5726dff"]]),fe=C({data(){return{style:"display: none;",object:void 0,property:"",element:void 0}},computed:{value:{get(){if(this.object)return this.object[this.property]},set(t){this.object&&(this.object[this.property]=t,this.computeStyle())}}},watch:{element(t,e){e&&e.classList.remove("opacity-0"),t&&t.classList.add("opacity-0")}},methods:{computeStyle(){this.element?this.style=` +import{k as nt,l as C,r as A,o as p,c,n as O,g as R,d as P,s as Pt,w as j,F as z,e as E,a as r,v as N,x as $,y as kt,z as wt,A as H,p as Ct,j as Dt,B as U,C as It,t as B,D as zt,E as Et,G as Tt,_ as Zt,u as Nt,b as it,T as Lt,m as Bt,H as st,I as At,J as Ot,K as $t}from"./index-DjCaYEkD.js";import{d as Rt}from"./n3-compare-Q4z2T_H1.js";var Vt=Object.defineProperty,Ut=(t,e,o)=>e in t?Vt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,I=(t,e,o)=>(Ut(t,typeof e!="symbol"?e+"":e,o),o),qt=Object.defineProperty,Ht=Object.defineProperties,jt=Object.getOwnPropertyDescriptors,rt=Object.getOwnPropertySymbols,Xt=Object.prototype.hasOwnProperty,Yt=Object.prototype.propertyIsEnumerable,lt=(t,e,o)=>e in t?qt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,Ft=(t,e)=>{for(var o in e||(e={}))Xt.call(e,o)&<(t,o,e[o]);if(rt)for(var o of rt(e))Yt.call(e,o)&<(t,o,e[o]);return t},Wt=(t,e)=>Ht(t,jt(e)),at=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof nt<"u"?nt:typeof self<"u"?self:{},Gt=function(){var t="",e,o,n,i=[],s={passive:!0};window.addEventListener?(e="addEventListener",o="removeEventListener"):(e="attachEvent",o="detachEvent",t="on"),n="onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll";function l(v,u){var y=function(g){!g&&(g=window.event);var S={originalEvent:g,target:g.target||g.srcElement,type:"wheel",deltaMode:g.type=="MozMousePixelScroll"?0:1,deltaX:0,delatZ:0,preventDefault:function(){g.preventDefault?g.preventDefault():g.returnValue=!1}};return n=="mousewheel"?(S.deltaY=-.025*g.wheelDelta,g.wheelDeltaX&&(S.deltaX=-.025*g.wheelDeltaX)):S.deltaY=g.detail,u(S)};return i.push({element:v,fn:y}),y}function d(v){for(var u=0;ue?(clearTimeout(d),d=null,a=m,l=t.apply(i,s),d||(i=s=null)):!d&&o.trailing!==!1&&(d=setTimeout(h,b)),l}},createRequestAnimationFrame:function(t){var e=null;return t!=="auto"&&t<60&&t>1&&(e=Math.floor(1e3/t)),e===null?window.requestAnimationFrame||dt(33):dt(e)}};function dt(t){return function(e){window.setTimeout(e,t)}}var K=tt,bt="unknown";document.documentMode&&(bt="ie");var et={svgNS:"http://www.w3.org/2000/svg",xmlNS:"http://www.w3.org/XML/1998/namespace",xmlnsNS:"http://www.w3.org/2000/xmlns/",xlinkNS:"http://www.w3.org/1999/xlink",evNS:"http://www.w3.org/2001/xml-events",getBoundingClientRectNormalized:function(t){if(t.clientWidth&&t.clientHeight)return{width:t.clientWidth,height:t.clientHeight};if(t.getBoundingClientRect())return t.getBoundingClientRect();throw new Error("Cannot get BoundingClientRect for SVG.")},getOrCreateViewport:function(t,e){var o=null;if(K.isElement(e)?o=e:o=t.querySelector(e),!o){var n=Array.prototype.slice.call(t.childNodes||t.children).filter(function(a){return a.nodeName!=="defs"&&a.nodeName!=="#text"});n.length===1&&n[0].nodeName==="g"&&n[0].getAttribute("transform")===null&&(o=n[0])}if(!o){var i="viewport-"+new Date().toISOString().replace(/\D/g,"");o=document.createElementNS(this.svgNS,"g"),o.setAttribute("id",i);var s=t.childNodes||t.children;if(s&&s.length>0)for(var l=s.length;l>0;l--)s[s.length-l].nodeName!=="defs"&&o.appendChild(s[s.length-l]);t.appendChild(o)}var d=[];return o.getAttribute("class")&&(d=o.getAttribute("class").split(" ")),~d.indexOf("svg-pan-zoom_viewport")||(d.push("svg-pan-zoom_viewport"),o.setAttribute("class",d.join(" "))),o},setupSvgAttributes:function(t){if(t.setAttribute("xmlns",this.svgNS),t.setAttributeNS(this.xmlnsNS,"xmlns:xlink",this.xlinkNS),t.setAttributeNS(this.xmlnsNS,"xmlns:ev",this.evNS),t.parentNode!==null){var e=t.getAttribute("style")||"";e.toLowerCase().indexOf("overflow")===-1&&t.setAttribute("style","overflow: hidden; "+e)}},internetExplorerRedisplayInterval:300,refreshDefsGlobal:K.throttle(function(){for(var t=document.querySelectorAll("defs"),e=t.length,o=0;o=0;n--)this.eventListeners.hasOwnProperty(o[n])&&delete this.eventListeners[o[n]]}for(var i in this.eventListeners)(this.options.eventsListenerElement||this.svg).addEventListener(i,this.eventListeners[i],this.options.preventMouseEventsDefault?!1:St);this.options.mouseWheelZoomEnabled&&(this.options.mouseWheelZoomEnabled=!1,this.enableMouseWheelZoom())};f.prototype.enableMouseWheelZoom=function(){if(!this.options.mouseWheelZoomEnabled){var t=this;this.wheelListener=function(o){return t.handleMouseWheel(o)};var e=!this.options.preventMouseEventsDefault;xt.on(this.options.eventsListenerElement||this.svg,this.wheelListener,e),this.options.mouseWheelZoomEnabled=!0}};f.prototype.disableMouseWheelZoom=function(){if(this.options.mouseWheelZoomEnabled){var t=!this.options.preventMouseEventsDefault;xt.off(this.options.eventsListenerElement||this.svg,this.wheelListener,t),this.options.mouseWheelZoomEnabled=!1}};f.prototype.handleMouseWheel=function(t){if(!(!this.options.zoomEnabled||this.state!=="none")){this.options.preventMouseEventsDefault&&(t.preventDefault?t.preventDefault():t.returnValue=!1);var e=t.deltaY||1,o=Date.now()-this.lastMouseWheelEventTime,n=3+Math.max(0,30-o);this.lastMouseWheelEventTime=Date.now(),"deltaMode"in t&&t.deltaMode===0&&t.wheelDelta&&(e=t.deltaY===0?0:Math.abs(t.wheelDelta)/t.deltaY),e=-.30?1:-1)*Math.log(Math.abs(e)+10)/n;var i=this.svg.getScreenCTM().inverse(),s=L.getEventPoint(t,this.svg).matrixTransform(i),l=Math.pow(1+this.options.zoomScaleSensitivity,-1*e);this.zoomAtPoint(l,s)}};f.prototype.zoomAtPoint=function(t,e,o){var n=this.viewport.getOriginalState();o?(t=Math.max(this.options.minZoom*n.zoom,Math.min(this.options.maxZoom*n.zoom,t)),t=t/this.getZoom()):this.getZoom()*tthis.options.maxZoom*n.zoom&&(t=this.options.maxZoom*n.zoom/this.getZoom());var i=this.viewport.getCTM(),s=e.matrixTransform(i.inverse()),l=this.svg.createSVGMatrix().translate(s.x,s.y).scale(t).translate(-s.x,-s.y),d=i.multiply(l);d.a!==i.a&&this.viewport.setCTM(d)};f.prototype.zoom=function(t,e){this.zoomAtPoint(t,L.getSvgCenterPoint(this.svg,this.width,this.height),e)};f.prototype.publicZoom=function(t,e){e&&(t=this.computeFromRelativeZoom(t)),this.zoom(t,e)};f.prototype.publicZoomAtPoint=function(t,e,o){if(o&&(t=this.computeFromRelativeZoom(t)),T.getType(e)!=="SVGPoint")if("x"in e&&"y"in e)e=L.createSVGPoint(this.svg,e.x,e.y);else throw new Error("Given point is invalid");this.zoomAtPoint(t,e,o)};f.prototype.getZoom=function(){return this.viewport.getZoom()};f.prototype.getRelativeZoom=function(){return this.viewport.getRelativeZoom()};f.prototype.computeFromRelativeZoom=function(t){return t*this.viewport.getOriginalState().zoom};f.prototype.resetZoom=function(){var t=this.viewport.getOriginalState();this.zoom(t.zoom,!0)};f.prototype.resetPan=function(){this.pan(this.viewport.getOriginalState())};f.prototype.reset=function(){this.resetZoom(),this.resetPan()};f.prototype.handleDblClick=function(t){if(this.options.preventMouseEventsDefault&&(t.preventDefault?t.preventDefault():t.returnValue=!1),this.options.controlIconsEnabled){var e=t.target.getAttribute("class")||"";if(e.indexOf("svg-pan-zoom-control")>-1)return!1}var o;t.shiftKey?o=1/((1+this.options.zoomScaleSensitivity)*2):o=(1+this.options.zoomScaleSensitivity)*2;var n=L.getEventPoint(t,this.svg).matrixTransform(this.svg.getScreenCTM().inverse());this.zoomAtPoint(o,n)};f.prototype.handleMouseDown=function(t,e){this.options.preventMouseEventsDefault&&(t.preventDefault?t.preventDefault():t.returnValue=!1),T.mouseAndTouchNormalize(t,this.svg),this.options.dblClickZoomEnabled&&T.isDblClick(t,e)?this.handleDblClick(t):(this.state="pan",this.firstEventCTM=this.viewport.getCTM(),this.stateOrigin=L.getEventPoint(t,this.svg).matrixTransform(this.firstEventCTM.inverse()))};f.prototype.handleMouseMove=function(t){if(this.options.preventMouseEventsDefault&&(t.preventDefault?t.preventDefault():t.returnValue=!1),this.state==="pan"&&this.options.panEnabled){var e=L.getEventPoint(t,this.svg).matrixTransform(this.firstEventCTM.inverse()),o=this.firstEventCTM.translate(e.x-this.stateOrigin.x,e.y-this.stateOrigin.y);this.viewport.setCTM(o)}};f.prototype.handleMouseUp=function(t){this.options.preventMouseEventsDefault&&(t.preventDefault?t.preventDefault():t.returnValue=!1),this.state==="pan"&&(this.state="none")};f.prototype.fit=function(){var t=this.viewport.getViewBox(),e=Math.min(this.width/t.width,this.height/t.height);this.zoom(e,!0)};f.prototype.contain=function(){var t=this.viewport.getViewBox(),e=Math.max(this.width/t.width,this.height/t.height);this.zoom(e,!0)};f.prototype.center=function(){var t=this.viewport.getViewBox(),e=(this.width-(t.width+t.x*2)*this.getZoom())*.5,o=(this.height-(t.height+t.y*2)*this.getZoom())*.5;this.getPublicInstance().pan({x:e,y:o})};f.prototype.updateBBox=function(){this.viewport.simpleViewBoxCache()};f.prototype.pan=function(t){var e=this.viewport.getCTM();e.e=t.x,e.f=t.y,this.viewport.setCTM(e)};f.prototype.panBy=function(t){var e=this.viewport.getCTM();e.e+=t.x,e.f+=t.y,this.viewport.setCTM(e)};f.prototype.getPan=function(){var t=this.viewport.getState();return{x:t.x,y:t.y}};f.prototype.resize=function(){var t=L.getBoundingClientRectNormalized(this.svg);this.width=t.width,this.height=t.height;var e=this.viewport;e.options.width=this.width,e.options.height=this.height,e.processCTM(),this.options.controlIconsEnabled&&(this.getPublicInstance().disableControlIcons(),this.getPublicInstance().enableControlIcons())};f.prototype.destroy=function(){var t=this;this.beforeZoom=null,this.onZoom=null,this.beforePan=null,this.onPan=null,this.onUpdatedCTM=null,this.options.customEventsHandler!=null&&this.options.customEventsHandler.destroy({svgElement:this.svg,eventsListenerElement:this.options.eventsListenerElement,instance:this.getPublicInstance()});for(var e in this.eventListeners)(this.options.eventsListenerElement||this.svg).removeEventListener(e,this.eventListeners[e],this.options.preventMouseEventsDefault?!1:St);this.disableMouseWheelZoom(),this.getPublicInstance().disableControlIcons(),this.reset(),V=V.filter(function(o){return o.svg!==t.svg}),delete this.options,delete this.viewport,delete this.publicInstance,delete this.pi,this.getPublicInstance=function(){return null}};f.prototype.getPublicInstance=function(){var t=this;return this.publicInstance||(this.publicInstance=this.pi={enablePan:function(){return t.options.panEnabled=!0,t.pi},disablePan:function(){return t.options.panEnabled=!1,t.pi},isPanEnabled:function(){return!!t.options.panEnabled},pan:function(e){return t.pan(e),t.pi},panBy:function(e){return t.panBy(e),t.pi},getPan:function(){return t.getPan()},setBeforePan:function(e){return t.options.beforePan=e===null?null:T.proxy(e,t.publicInstance),t.pi},setOnPan:function(e){return t.options.onPan=e===null?null:T.proxy(e,t.publicInstance),t.pi},enableZoom:function(){return t.options.zoomEnabled=!0,t.pi},disableZoom:function(){return t.options.zoomEnabled=!1,t.pi},isZoomEnabled:function(){return!!t.options.zoomEnabled},enableControlIcons:function(){return t.options.controlIconsEnabled||(t.options.controlIconsEnabled=!0,J.enable(t)),t.pi},disableControlIcons:function(){return t.options.controlIconsEnabled&&(t.options.controlIconsEnabled=!1,J.disable(t)),t.pi},isControlIconsEnabled:function(){return!!t.options.controlIconsEnabled},enableDblClickZoom:function(){return t.options.dblClickZoomEnabled=!0,t.pi},disableDblClickZoom:function(){return t.options.dblClickZoomEnabled=!1,t.pi},isDblClickZoomEnabled:function(){return!!t.options.dblClickZoomEnabled},enableMouseWheelZoom:function(){return t.enableMouseWheelZoom(),t.pi},disableMouseWheelZoom:function(){return t.disableMouseWheelZoom(),t.pi},isMouseWheelZoomEnabled:function(){return!!t.options.mouseWheelZoomEnabled},setZoomScaleSensitivity:function(e){return t.options.zoomScaleSensitivity=e,t.pi},setMinZoom:function(e){return t.options.minZoom=e,t.pi},setMaxZoom:function(e){return t.options.maxZoom=e,t.pi},setBeforeZoom:function(e){return t.options.beforeZoom=e===null?null:T.proxy(e,t.publicInstance),t.pi},setOnZoom:function(e){return t.options.onZoom=e===null?null:T.proxy(e,t.publicInstance),t.pi},zoom:function(e){return t.publicZoom(e,!0),t.pi},zoomBy:function(e){return t.publicZoom(e,!1),t.pi},zoomAtPoint:function(e,o){return t.publicZoomAtPoint(e,o,!0),t.pi},zoomAtPointBy:function(e,o){return t.publicZoomAtPoint(e,o,!1),t.pi},zoomIn:function(){return this.zoomBy(1+t.options.zoomScaleSensitivity),t.pi},zoomOut:function(){return this.zoomBy(1/(1+t.options.zoomScaleSensitivity)),t.pi},getZoom:function(){return t.getRelativeZoom()},setOnUpdatedCTM:function(e){return t.options.onUpdatedCTM=e===null?null:T.proxy(e,t.publicInstance),t.pi},resetZoom:function(){return t.resetZoom(),t.pi},resetPan:function(){return t.resetPan(),t.pi},reset:function(){return t.reset(),t.pi},fit:function(){return t.fit(),t.pi},contain:function(){return t.contain(),t.pi},center:function(){return t.center(),t.pi},updateBBox:function(){return t.updateBBox(),t.pi},resize:function(){return t.resize(),t.pi},getSizes:function(){return{width:t.width,height:t.height,realZoom:t.getZoom(),viewBox:t.viewport.getViewBox()}},destroy:function(){return t.destroy(),t.pi}}),this.publicInstance};var V=[],oe=function(t,e){var o=T.getSvg(t);if(o===null)return null;for(var n=V.length-1;n>=0;n--)if(V[n].svg===o)return V[n].instance.getPublicInstance();return V.push({svg:o,instance:new f(o,e)}),V[V.length-1].instance.getPublicInstance()},ne=oe,Mt=(t,e)=>{const o=t.__vccOpts||t;for(const[n,i]of e)o[n]=i;return o};const ie=["x","y","width","height"],se=C({__name:"Scope",props:{mainSPZ:null,thumbnailSPZ:null},setup(t){const e=t,o=$(0),n=$(0),i=$(0),s=$(0),l=$(null),d=()=>{if(!e.mainSPZ||!e.thumbnailSPZ)return;const h=e.mainSPZ.getPan().x,m=e.mainSPZ.getPan().y,b=e.mainSPZ.getSizes().width,w=e.mainSPZ.getSizes().height,v=e.mainSPZ.getSizes().realZoom,u=e.thumbnailSPZ.getPan().x,y=e.thumbnailSPZ.getPan().y,g=e.thumbnailSPZ.getSizes().realZoom/v,S=u-h*g,X=y-m*g,W=b*g,G=w*g;o.value=S+1,n.value=X+1,i.value=W-2,s.value=G-2},a=h=>{if(h.which==0&&h.button==0||!l.value)return;let m=e.mainSPZ,b=e.thumbnailSPZ,w=l.value.getBoundingClientRect();m.getSizes().width,m.getSizes().height;let v=m.getSizes().realZoom,u=b.getSizes().width,y=b.getSizes().height,g=b.getSizes().realZoom;var S=h.clientX-w.left-u/2,X=h.clientY-w.top-y/2,W=-S*v/g,G=-X*v/g;m.pan({x:W,y:G})};return wt(()=>{d(),e.mainSPZ.setOnPan(()=>d()),e.mainSPZ.setOnZoom(()=>d())}),(h,m)=>(p(),c("svg",{class:"svg-pan-zoom__scope",onClick:a,onMousemove:a,ref_key:"scopeSVG",ref:l},[r("rect",{class:"scope",x:o.value,y:n.value,width:i.value,height:s.value},null,8,ie)],544))}});var re=Mt(se,[["__scopeId","data-v-169415fd"]]);const le=C({__name:"SvgPanZoomThumbnail",props:{mainSPZ:null},emits:["thumbnailCreated"],setup(t,{emit:e}){const o=t,n=$(null),i=l=>{o.mainSPZ[l.deltaY<0?"zoomIn":"zoomOut"]()},s=l=>{n.value=l,e("thumbnailCreated",l)};return(l,d)=>(p(),c("div",{class:"svg-pan-zoom__thumbnail",onWheel:i},[P(_t,{class:"thumbnail",zoomEnabled:!1,panEnabled:!1,controlIconsEnabled:!1,dblClickZoomEnabled:!1,preventMouseEventsDefault:!0,onCreated:s},{default:j(()=>[H(l.$slots,"default",{},void 0,!0)]),_:3}),n.value?(p(),O(re,{key:0,mainSPZ:t.mainSPZ,thumbnailSPZ:n.value},null,8,["mainSPZ","thumbnailSPZ"])):R("",!0)],32))}});var ae=Mt(le,[["__scopeId","data-v-093287c4"]]);const de={class:"svg-pan-zoom"},_t=C({__name:"SvgPanZoom",props:{viewportSelector:{type:[String,Object],default:".svg-pan-zoom"},panEnabled:{type:Boolean,default:!0},controlIconsEnabled:{type:Boolean,default:!1},zoomEnabled:{type:Boolean,default:!0},dblClickZoomEnabled:{type:Boolean,default:!0},mouseWheelZoomEnabled:{type:Boolean,default:!0},preventMouseEventsDefault:{type:Boolean,default:!0},zoomScaleSensitivity:{type:Number,default:.2},minZoom:{type:Number,default:.5},maxZoom:{type:Number,default:10},fit:{type:Boolean,default:!0},contain:{type:Boolean,default:!0},center:{type:Boolean,default:!0},refreshRate:{type:[Number,String],default:"auto"}},emits:["beforeZoom","onZoom","beforePan","onPan","onUpdatedCTM","created","thumbnailCreated"],setup(t,{emit:e}){const o=t,n=$(null),i=kt(),s=$({});Object.keys(o).filter(a=>o[a]!==void 0).forEach(a=>{s.value=Wt(Ft({},s.value),{[a]:o[a]})});const l=$(null),d=a=>{if(a&&a.tagName==="svg")return a;const h=Array.from(a.children);if(!h)return!1;for(const m of h){const b=d(m);if(b)return b}return!1};return wt(()=>{if(s.value.onZoom=h=>e("onZoom",h),s.value.onPan=h=>e("onPan",h),!(i.default&&n.value))return;const a=d(n.value);a&&(l.value=ne(a,s.value),e("created",l.value))}),(a,h)=>(p(),c("div",de,[r("div",{class:"svg-pan-zoom__default",ref_key:"defaultSlot",ref:n},[H(a.$slots,"default")],512),a.$slots.thumbnail&&l.value?(p(),O(ae,{key:0,onThumbnailCreated:h[0]||(h[0]=m=>a.$emit("thumbnailCreated",m)),mainSPZ:l.value},{default:j(()=>[H(a.$slots,"thumbnail")]),_:3},8,["mainSPZ"])):R("",!0)]))}}),he=C({data(){return{onContextMenu:t=>{t.preventDefault()},onMouseDown:t=>{const e=this,o=t==null?void 0:t.target.closest(".diagram-context-menu"),n=t==null?void 0:t.target.closest(".has-menu");this.menuX=t.pageX,this.menuY=t.pageY,o?(t.stopPropagation(),this.menuItemClick(t,this.showMenuComponent),e.showMenuComponent=void 0):n&&t.button===2?(this.showMenuComponent=n.vueComponent,t.stopPropagation()):e.showMenuComponent=void 0},menuX:0,menuY:0,showMenuComponent:void 0}},mounted(){this.$parent.$el.addEventListener("mousedown",this.onMouseDown,{capture:!0}),this.$parent.$el.addEventListener("contextmenu",this.onContextMenu)},beforeUnmount(){this.$parent.$el.removeEventListener("mousedown",this.onMouseDown),this.$parent.$el.addEventListener("contextmenu",this.onContextMenu)},methods:{menuItemClick(t,e){var o;const n=(o=t==null?void 0:t.target)==null?void 0:o.dataset;n!=null&&n.childItemKey?e.menu[n.menuItemKey].children[n.childItemKey].handler.call(e):e.menu[n.menuItemKey].handler.call(e)}}}),Z=(t,e)=>{const o=t.__vccOpts||t;for(const[n,i]of e)o[n]=i;return o},ue=["data-menu-item-key"],pe={key:0,style:{float:"right"}},ce={key:1,class:"menu-item-children-container"},me=["data-menu-item-key","data-child-item-key"];function ge(t,e,o,n,i,s){return p(),c("div",null,[t.showMenuComponent?(p(),c("div",{key:0,class:U("menu diagram-context-menu"),style:N(`left: ${t.menuX}px; top: ${t.menuY}px`)},[(p(!0),c(z,null,E(t.showMenuComponent.menu,(l,d)=>(p(),c("div",{key:d,class:U(`menu-item ${l.classes?l.classes.join(" "):""}`),"data-menu-item-key":d},[It(B(l.label)+" ",1),l.children?(p(),c("span",pe," > ")):R("",!0),l.children?(p(),c("div",ce,[(p(!0),c(z,null,E(l.children,(a,h)=>(p(),c("div",{key:h,class:U(`menu-item child-menu-item ${a.classes?a.classes.join(" "):""}`),"data-menu-item-key":d,"data-child-item-key":h},B(a.label),11,me))),128))])):R("",!0)],10,ue))),128))],4)):R("",!0)])}const ve=Z(he,[["render",ge],["__scopeId","data-v-f5726dff"]]),fe=C({data(){return{style:"display: none;",object:void 0,property:"",element:void 0}},computed:{value:{get(){if(this.object)return this.object[this.property]},set(t){this.object&&(this.object[this.property]=t,this.computeStyle())}}},watch:{element(t,e){e&&e.classList.remove("opacity-0"),t&&t.classList.add("opacity-0")}},methods:{computeStyle(){this.element?this.style=` top: ${this.element.getBoundingClientRect().top}px; left: ${this.element.getBoundingClientRect().left}px; width: ${this.element.getBoundingClientRect().width}px; diff --git a/pad/assets/index-CWflGvq2.js b/pad/assets/index-DjCaYEkD.js similarity index 99% rename from pad/assets/index-CWflGvq2.js rename to pad/assets/index-DjCaYEkD.js index a045820..b35fb97 100644 --- a/pad/assets/index-CWflGvq2.js +++ b/pad/assets/index-DjCaYEkD.js @@ -1,4 +1,4 @@ -const __vite__fileDeps=["./DashboardView-oP_o-Ja_.js","./Term-CKdvsSUc.js","./InstanceList-AVehQBSG.js","./DashboardView-D39OJwqc.css","./VocPad-D_dUwJLt.js","./n3-compare-B4Bu77vD.js","./EditForm-uEtOdnsK.js","./FormDemo-DXTcTxJi.js","./Source-DLJIiKEC.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); +const __vite__fileDeps=["./DashboardView-DcVz4jBx.js","./Term-Blmh2NdX.js","./InstanceList-DoIEMcR8.js","./DashboardView-D39OJwqc.css","./VocPad-Ccm15vTJ.js","./n3-compare-Q4z2T_H1.js","./EditForm-Blgk6tMk.js","./FormDemo-B-6k6oiB.js","./Source-DTEjL7Kq.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]); var sZ=Object.defineProperty;var oZ=(t,e,n)=>e in t?sZ(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Ir=(t,e,n)=>(oZ(t,typeof e!="symbol"?e+"":e,n),n),DS=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)};var be=(t,e,n)=>(DS(t,e,"read from private field"),n?n.call(t):e.get(t)),Mt=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Tt=(t,e,n,r)=>(DS(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);var Ob=(t,e,n,r)=>({set _(a){Tt(t,e,a,n)},get _(){return be(t,e,r)}}),gt=(t,e,n)=>(DS(t,e,"access private method"),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const s of a)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(a){const s={};return a.integrity&&(s.integrity=a.integrity),a.referrerPolicy&&(s.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?s.credentials="include":a.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(a){if(a.ep)return;a.ep=!0;const s=n(a);fetch(a.href,s)}})();var Kn="top",Si="bottom",Ti="right",Jn="left",Nv="auto",Ol=[Kn,Si,Ti,Jn],Bu="start",rl="end",tH="clippingParents",Qx="viewport",Ic="popper",rH="reference",fR=Ol.reduce(function(t,e){return t.concat([e+"-"+Bu,e+"-"+rl])},[]),zx=[].concat(Ol,[Nv]).reduce(function(t,e){return t.concat([e,e+"-"+Bu,e+"-"+rl])},[]),nH="beforeRead",iH="read",aH="afterRead",sH="beforeMain",oH="main",uH="afterMain",cH="beforeWrite",lH="write",dH="afterWrite",fH=[nH,iH,aH,sH,oH,uH,cH,lH,dH];function Ca(t){return t?(t.nodeName||"").toLowerCase():null}function Ei(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function $u(t){var e=Ei(t).Element;return t instanceof e||t instanceof Element}function Fi(t){var e=Ei(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Gx(t){if(typeof ShadowRoot>"u")return!1;var e=Ei(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function uZ(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},a=e.attributes[n]||{},s=e.elements[n];!Fi(s)||!Ca(s)||(Object.assign(s.style,r),Object.keys(a).forEach(function(o){var u=a[o];u===!1?s.removeAttribute(o):s.setAttribute(o,u===!0?"":u)}))})}function cZ(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var a=e.elements[r],s=e.attributes[r]||{},o=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),u=o.reduce(function(l,c){return l[c]="",l},{});!Fi(a)||!Ca(a)||(Object.assign(a.style,u),Object.keys(s).forEach(function(l){a.removeAttribute(l)}))})}}const Wx={name:"applyStyles",enabled:!0,phase:"write",fn:uZ,effect:cZ,requires:["computeStyles"]};function xa(t){return t.split("-")[0]}var Lu=Math.max,tv=Math.min,nl=Math.round;function hR(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function hH(){return!/^((?!chrome|android).)*safari/i.test(hR())}function il(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),a=1,s=1;e&&Fi(t)&&(a=t.offsetWidth>0&&nl(r.width)/t.offsetWidth||1,s=t.offsetHeight>0&&nl(r.height)/t.offsetHeight||1);var o=$u(t)?Ei(t):window,u=o.visualViewport,l=!hH()&&n,c=(r.left+(l&&u?u.offsetLeft:0))/a,d=(r.top+(l&&u?u.offsetTop:0))/s,f=r.width/a,h=r.height/s;return{width:f,height:h,top:d,right:c+f,bottom:d+h,left:c,x:c,y:d}}function Kx(t){var e=il(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function pH(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Gx(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Os(t){return Ei(t).getComputedStyle(t)}function lZ(t){return["table","td","th"].indexOf(Ca(t))>=0}function wo(t){return(($u(t)?t.ownerDocument:t.document)||window.document).documentElement}function Dv(t){return Ca(t)==="html"?t:t.assignedSlot||t.parentNode||(Gx(t)?t.host:null)||wo(t)}function pD(t){return!Fi(t)||Os(t).position==="fixed"?null:t.offsetParent}function dZ(t){var e=/firefox/i.test(hR()),n=/Trident/i.test(hR());if(n&&Fi(t)){var r=Os(t);if(r.position==="fixed")return null}var a=Dv(t);for(Gx(a)&&(a=a.host);Fi(a)&&["html","body"].indexOf(Ca(a))<0;){var s=Os(a);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return a;a=a.parentNode}return null}function p_(t){for(var e=Ei(t),n=pD(t);n&&lZ(n)&&Os(n).position==="static";)n=pD(n);return n&&(Ca(n)==="html"||Ca(n)==="body"&&Os(n).position==="static")?e:n||dZ(t)||e}function Jx(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Ig(t,e,n){return Lu(t,tv(e,n))}function fZ(t,e,n){var r=Ig(t,e,n);return r>n?n:r}function yH(){return{top:0,right:0,bottom:0,left:0}}function mH(t){return Object.assign({},yH(),t)}function gH(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var hZ=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,mH(typeof e!="number"?e:gH(e,Ol))};function pZ(t){var e,n=t.state,r=t.name,a=t.options,s=n.elements.arrow,o=n.modifiersData.popperOffsets,u=xa(n.placement),l=Jx(u),c=[Jn,Ti].indexOf(u)>=0,d=c?"height":"width";if(!(!s||!o)){var f=hZ(a.padding,n),h=Kx(s),p=l==="y"?Kn:Jn,m=l==="y"?Si:Ti,y=n.rects.reference[d]+n.rects.reference[l]-o[l]-n.rects.popper[d],g=o[l]-n.rects.reference[l],_=p_(s),v=_?l==="y"?_.clientHeight||0:_.clientWidth||0:0,b=y/2-g/2,w=f[p],S=v-h[d]-f[m],A=v/2-h[d]/2+b,x=Ig(w,A,S),M=l;n.modifiersData[r]=(e={},e[M]=x,e.centerOffset=x-A,e)}}function yZ(t){var e=t.state,n=t.options,r=n.element,a=r===void 0?"[data-popper-arrow]":r;a!=null&&(typeof a=="string"&&(a=e.elements.popper.querySelector(a),!a)||pH(e.elements.popper,a)&&(e.elements.arrow=a))}const _H={name:"arrow",enabled:!0,phase:"main",fn:pZ,effect:yZ,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function al(t){return t.split("-")[1]}var mZ={top:"auto",right:"auto",bottom:"auto",left:"auto"};function gZ(t,e){var n=t.x,r=t.y,a=e.devicePixelRatio||1;return{x:nl(n*a)/a||0,y:nl(r*a)/a||0}}function yD(t){var e,n=t.popper,r=t.popperRect,a=t.placement,s=t.variation,o=t.offsets,u=t.position,l=t.gpuAcceleration,c=t.adaptive,d=t.roundOffsets,f=t.isFixed,h=o.x,p=h===void 0?0:h,m=o.y,y=m===void 0?0:m,g=typeof d=="function"?d({x:p,y}):{x:p,y};p=g.x,y=g.y;var _=o.hasOwnProperty("x"),v=o.hasOwnProperty("y"),b=Jn,w=Kn,S=window;if(c){var A=p_(n),x="clientHeight",M="clientWidth";if(A===Ei(n)&&(A=wo(n),Os(A).position!=="static"&&u==="absolute"&&(x="scrollHeight",M="scrollWidth")),A=A,a===Kn||(a===Jn||a===Ti)&&s===rl){w=Si;var I=f&&A===S&&S.visualViewport?S.visualViewport.height:A[x];y-=I-r.height,y*=l?1:-1}if(a===Jn||(a===Kn||a===Si)&&s===rl){b=Ti;var N=f&&A===S&&S.visualViewport?S.visualViewport.width:A[M];p-=N-r.width,p*=l?1:-1}}var F=Object.assign({position:u},c&&mZ),D=d===!0?gZ({x:p,y},Ei(n)):{x:p,y};if(p=D.x,y=D.y,l){var V;return Object.assign({},F,(V={},V[w]=v?"0":"",V[b]=_?"0":"",V.transform=(S.devicePixelRatio||1)<=1?"translate("+p+"px, "+y+"px)":"translate3d("+p+"px, "+y+"px, 0)",V))}return Object.assign({},F,(e={},e[w]=v?y+"px":"",e[b]=_?p+"px":"",e.transform="",e))}function _Z(t){var e=t.state,n=t.options,r=n.gpuAcceleration,a=r===void 0?!0:r,s=n.adaptive,o=s===void 0?!0:s,u=n.roundOffsets,l=u===void 0?!0:u,c={placement:xa(e.placement),variation:al(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:a,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,yD(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,yD(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Xx={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:_Z,data:{}};var Rb={passive:!0};function bZ(t){var e=t.state,n=t.instance,r=t.options,a=r.scroll,s=a===void 0?!0:a,o=r.resize,u=o===void 0?!0:o,l=Ei(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(d){d.addEventListener("scroll",n.update,Rb)}),u&&l.addEventListener("resize",n.update,Rb),function(){s&&c.forEach(function(d){d.removeEventListener("scroll",n.update,Rb)}),u&&l.removeEventListener("resize",n.update,Rb)}}const Yx={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:bZ,data:{}};var vZ={left:"right",right:"left",bottom:"top",top:"bottom"};function E1(t){return t.replace(/left|right|bottom|top/g,function(e){return vZ[e]})}var wZ={start:"end",end:"start"};function mD(t){return t.replace(/start|end/g,function(e){return wZ[e]})}function Zx(t){var e=Ei(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function eI(t){return il(wo(t)).left+Zx(t).scrollLeft}function SZ(t,e){var n=Ei(t),r=wo(t),a=n.visualViewport,s=r.clientWidth,o=r.clientHeight,u=0,l=0;if(a){s=a.width,o=a.height;var c=hH();(c||!c&&e==="fixed")&&(u=a.offsetLeft,l=a.offsetTop)}return{width:s,height:o,x:u+eI(t),y:l}}function TZ(t){var e,n=wo(t),r=Zx(t),a=(e=t.ownerDocument)==null?void 0:e.body,s=Lu(n.scrollWidth,n.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),o=Lu(n.scrollHeight,n.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),u=-r.scrollLeft+eI(t),l=-r.scrollTop;return Os(a||n).direction==="rtl"&&(u+=Lu(n.clientWidth,a?a.clientWidth:0)-s),{width:s,height:o,x:u,y:l}}function tI(t){var e=Os(t),n=e.overflow,r=e.overflowX,a=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+a+r)}function bH(t){return["html","body","#document"].indexOf(Ca(t))>=0?t.ownerDocument.body:Fi(t)&&tI(t)?t:bH(Dv(t))}function Pg(t,e){var n;e===void 0&&(e=[]);var r=bH(t),a=r===((n=t.ownerDocument)==null?void 0:n.body),s=Ei(r),o=a?[s].concat(s.visualViewport||[],tI(r)?r:[]):r,u=e.concat(o);return a?u:u.concat(Pg(Dv(o)))}function pR(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function EZ(t,e){var n=il(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function gD(t,e,n){return e===Qx?pR(SZ(t,n)):$u(e)?EZ(e,n):pR(TZ(wo(t)))}function AZ(t){var e=Pg(Dv(t)),n=["absolute","fixed"].indexOf(Os(t).position)>=0,r=n&&Fi(t)?p_(t):t;return $u(r)?e.filter(function(a){return $u(a)&&pH(a,r)&&Ca(a)!=="body"}):[]}function OZ(t,e,n,r){var a=e==="clippingParents"?AZ(t):[].concat(e),s=[].concat(a,[n]),o=s[0],u=s.reduce(function(l,c){var d=gD(t,c,r);return l.top=Lu(d.top,l.top),l.right=tv(d.right,l.right),l.bottom=tv(d.bottom,l.bottom),l.left=Lu(d.left,l.left),l},gD(t,o,r));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function vH(t){var e=t.reference,n=t.element,r=t.placement,a=r?xa(r):null,s=r?al(r):null,o=e.x+e.width/2-n.width/2,u=e.y+e.height/2-n.height/2,l;switch(a){case Kn:l={x:o,y:e.y-n.height};break;case Si:l={x:o,y:e.y+e.height};break;case Ti:l={x:e.x+e.width,y:u};break;case Jn:l={x:e.x-n.width,y:u};break;default:l={x:e.x,y:e.y}}var c=a?Jx(a):null;if(c!=null){var d=c==="y"?"height":"width";switch(s){case Bu:l[c]=l[c]-(e[d]/2-n[d]/2);break;case rl:l[c]=l[c]+(e[d]/2-n[d]/2);break}}return l}function sl(t,e){e===void 0&&(e={});var n=e,r=n.placement,a=r===void 0?t.placement:r,s=n.strategy,o=s===void 0?t.strategy:s,u=n.boundary,l=u===void 0?tH:u,c=n.rootBoundary,d=c===void 0?Qx:c,f=n.elementContext,h=f===void 0?Ic:f,p=n.altBoundary,m=p===void 0?!1:p,y=n.padding,g=y===void 0?0:y,_=mH(typeof g!="number"?g:gH(g,Ol)),v=h===Ic?rH:Ic,b=t.rects.popper,w=t.elements[m?v:h],S=OZ($u(w)?w:w.contextElement||wo(t.elements.popper),l,d,o),A=il(t.elements.reference),x=vH({reference:A,element:b,strategy:"absolute",placement:a}),M=pR(Object.assign({},b,x)),I=h===Ic?M:A,N={top:S.top-I.top+_.top,bottom:I.bottom-S.bottom+_.bottom,left:S.left-I.left+_.left,right:I.right-S.right+_.right},F=t.modifiersData.offset;if(h===Ic&&F){var D=F[a];Object.keys(N).forEach(function(V){var k=[Ti,Si].indexOf(V)>=0?1:-1,U=[Kn,Si].indexOf(V)>=0?"y":"x";N[V]+=D[U]*k})}return N}function RZ(t,e){e===void 0&&(e={});var n=e,r=n.placement,a=n.boundary,s=n.rootBoundary,o=n.padding,u=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?zx:l,d=al(r),f=d?u?fR:fR.filter(function(m){return al(m)===d}):Ol,h=f.filter(function(m){return c.indexOf(m)>=0});h.length===0&&(h=f);var p=h.reduce(function(m,y){return m[y]=sl(t,{placement:y,boundary:a,rootBoundary:s,padding:o})[xa(y)],m},{});return Object.keys(p).sort(function(m,y){return p[m]-p[y]})}function xZ(t){if(xa(t)===Nv)return[];var e=E1(t);return[mD(t),e,mD(e)]}function IZ(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var a=n.mainAxis,s=a===void 0?!0:a,o=n.altAxis,u=o===void 0?!0:o,l=n.fallbackPlacements,c=n.padding,d=n.boundary,f=n.rootBoundary,h=n.altBoundary,p=n.flipVariations,m=p===void 0?!0:p,y=n.allowedAutoPlacements,g=e.options.placement,_=xa(g),v=_===g,b=l||(v||!m?[E1(g)]:xZ(g)),w=[g].concat(b).reduce(function(ue,Ie){return ue.concat(xa(Ie)===Nv?RZ(e,{placement:Ie,boundary:d,rootBoundary:f,padding:c,flipVariations:m,allowedAutoPlacements:y}):Ie)},[]),S=e.rects.reference,A=e.rects.popper,x=new Map,M=!0,I=w[0],N=0;N=0,U=k?"width":"height",H=sl(e,{placement:F,boundary:d,rootBoundary:f,altBoundary:h,padding:c}),X=k?V?Ti:Jn:V?Si:Kn;S[U]>A[U]&&(X=E1(X));var ee=E1(X),fe=[];if(s&&fe.push(H[D]<=0),u&&fe.push(H[X]<=0,H[ee]<=0),fe.every(function(ue){return ue})){I=F,M=!1;break}x.set(F,fe)}if(M)for(var Te=m?3:1,De=function(Ie){var Ne=w.find(function(we){var Ae=x.get(we);if(Ae)return Ae.slice(0,Ie).every(function(Se){return Se})});if(Ne)return I=Ne,"break"},Ve=Te;Ve>0;Ve--){var le=De(Ve);if(le==="break")break}e.placement!==I&&(e.modifiersData[r]._skip=!0,e.placement=I,e.reset=!0)}}const wH={name:"flip",enabled:!0,phase:"main",fn:IZ,requiresIfExists:["offset"],data:{_skip:!1}};function _D(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function bD(t){return[Kn,Ti,Si,Jn].some(function(e){return t[e]>=0})}function PZ(t){var e=t.state,n=t.name,r=e.rects.reference,a=e.rects.popper,s=e.modifiersData.preventOverflow,o=sl(e,{elementContext:"reference"}),u=sl(e,{altBoundary:!0}),l=_D(o,r),c=_D(u,a,s),d=bD(l),f=bD(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}const SH={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:PZ};function NZ(t,e,n){var r=xa(t),a=[Jn,Kn].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,o=s[0],u=s[1];return o=o||0,u=(u||0)*a,[Jn,Ti].indexOf(r)>=0?{x:u,y:o}:{x:o,y:u}}function DZ(t){var e=t.state,n=t.options,r=t.name,a=n.offset,s=a===void 0?[0,0]:a,o=zx.reduce(function(d,f){return d[f]=NZ(f,e.rects,s),d},{}),u=o[e.placement],l=u.x,c=u.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=o}const TH={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:DZ};function CZ(t){var e=t.state,n=t.name;e.modifiersData[n]=vH({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const rI={name:"popperOffsets",enabled:!0,phase:"read",fn:CZ,data:{}};function LZ(t){return t==="x"?"y":"x"}function jZ(t){var e=t.state,n=t.options,r=t.name,a=n.mainAxis,s=a===void 0?!0:a,o=n.altAxis,u=o===void 0?!1:o,l=n.boundary,c=n.rootBoundary,d=n.altBoundary,f=n.padding,h=n.tether,p=h===void 0?!0:h,m=n.tetherOffset,y=m===void 0?0:m,g=sl(e,{boundary:l,rootBoundary:c,padding:f,altBoundary:d}),_=xa(e.placement),v=al(e.placement),b=!v,w=Jx(_),S=LZ(w),A=e.modifiersData.popperOffsets,x=e.rects.reference,M=e.rects.popper,I=typeof y=="function"?y(Object.assign({},e.rects,{placement:e.placement})):y,N=typeof I=="number"?{mainAxis:I,altAxis:I}:Object.assign({mainAxis:0,altAxis:0},I),F=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,D={x:0,y:0};if(A){if(s){var V,k=w==="y"?Kn:Jn,U=w==="y"?Si:Ti,H=w==="y"?"height":"width",X=A[w],ee=X+g[k],fe=X-g[U],Te=p?-M[H]/2:0,De=v===Bu?x[H]:M[H],Ve=v===Bu?-M[H]:-x[H],le=e.elements.arrow,ue=p&&le?Kx(le):{width:0,height:0},Ie=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:yH(),Ne=Ie[k],we=Ie[U],Ae=Ig(0,x[H],ue[H]),Se=b?x[H]/2-Te-Ae-Ne-N.mainAxis:De-Ae-Ne-N.mainAxis,z=b?-x[H]/2+Te+Ae+we+N.mainAxis:Ve+Ae+we+N.mainAxis,L=e.elements.arrow&&p_(e.elements.arrow),B=L?w==="y"?L.clientTop||0:L.clientLeft||0:0,T=(V=F==null?void 0:F[w])!=null?V:0,O=X+Se-T-B,$=X+z-T,G=Ig(p?tv(ee,O):ee,X,p?Lu(fe,$):fe);A[w]=G,D[w]=G-X}if(u){var Q,Y=w==="x"?Kn:Jn,ie=w==="x"?Si:Ti,te=A[S],he=S==="y"?"height":"width",ce=te+g[Y],ve=te-g[ie],Ce=[Kn,Jn].indexOf(_)!==-1,Ee=(Q=F==null?void 0:F[S])!=null?Q:0,Ue=Ce?ce:te-x[he]-M[he]-Ee+N.altAxis,Fe=Ce?te+x[he]+M[he]-Ee-N.altAxis:ve,Qe=p&&Ce?fZ(Ue,te,Fe):Ig(p?Ue:ce,te,p?Fe:ve);A[S]=Qe,D[S]=Qe-te}e.modifiersData[r]=D}}const EH={name:"preventOverflow",enabled:!0,phase:"main",fn:jZ,requiresIfExists:["offset"]};function MZ(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function FZ(t){return t===Ei(t)||!Fi(t)?Zx(t):MZ(t)}function qZ(t){var e=t.getBoundingClientRect(),n=nl(e.width)/t.offsetWidth||1,r=nl(e.height)/t.offsetHeight||1;return n!==1||r!==1}function BZ(t,e,n){n===void 0&&(n=!1);var r=Fi(e),a=Fi(e)&&qZ(e),s=wo(e),o=il(t,a,n),u={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Ca(e)!=="body"||tI(s))&&(u=FZ(e)),Fi(e)?(l=il(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=eI(s))),{x:o.left+u.scrollLeft-l.x,y:o.top+u.scrollTop-l.y,width:o.width,height:o.height}}function $Z(t){var e=new Map,n=new Set,r=[];t.forEach(function(s){e.set(s.name,s)});function a(s){n.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(u){if(!n.has(u)){var l=e.get(u);l&&a(l)}}),r.push(s)}return t.forEach(function(s){n.has(s.name)||a(s)}),r}function UZ(t){var e=$Z(t);return fH.reduce(function(n,r){return n.concat(e.filter(function(a){return a.phase===r}))},[])}function kZ(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function VZ(t){var e=t.reduce(function(n,r){var a=n[r.name];return n[r.name]=a?Object.assign({},a,r,{options:Object.assign({},a.options,r.options),data:Object.assign({},a.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var vD={placement:"bottom",modifiers:[],strategy:"absolute"};function wD(){for(var t=arguments.length,e=new Array(t),n=0;n{const t=Wg(!1),e=Wg(null);async function n(l){let c,d="";console.log(`send query: ${l}`),typeof l=="string"?(d=l,c=[Da().graph_iri]):typeof l=="object"?(d=l.query,l.defaultGraph==="quads"?c=void 0:l.defaultGraph!==void 0?c=l.defaultGraph:c=[Da().graph_iri]):(console.error("can't process query"),console.error(l)),c!==void 0&&(console.log(`inject graph: ${c}`),d=TDe(d,c));const f=new Xu.Generator;let h;return typeof d!="string"?h=f.stringify(d):h=d,e.value.query(h)}async function r(l,c){c===void 0&&(c=[Da().graph_iri]);let d="";for(const m of c)d+=`from <${m}>`;const f=`construct {<${l}> ?p ?o} ${d} where {<${l}> ?p ?o}`,h=await e.value.query_quads(f),p=Lr.namedNode(c[0]);return Dt.Readable.from(h).pipe(new A2(p))}function a(){e.value.push!==void 0&&e.value.push().then(function(l){console.log(l)})}function s(){e.value.pull!==void 0&&e.value.pull().then(function(l){console.log(l)})}async function o(l){let c=l.deleteArray,d=l.insertArray;const f=[];if(l.graphIri!==void 0){const p=Lr.namedNode(l.graphIri);c&&c.length>0&&(c=await Dt.Readable.from(c).pipe(new A2(p)).toArray()),d&&d.length>0&&(d=await Dt.Readable.from(d).pipe(new A2(p)).toArray())}c&&c.length>0&&f.push(jbe(c).toString()),d&&d.length>0&&f.push(Mbe(d).toString());const h=f.join(";");return e.value.update(h)}async function u(l){console.log("Loading …"),console.log("Change SPARQL Endpoint configuration."),console.log(l);const c=await dNe.create(l);e.value=c[0],t.value=!0}return console.log("configuration is"),console.log(Pv),u(Pv),{ready:t,sparqlEndpoint:e,sendQuery:n,getResource:r,push:a,pull:s,deleteInsertData:o,updateEndpointConfiguration:u}}),fb=(t,e)=>{const n=t.__vccOpts||t;for(const[r,a]of e)n[r]=a;return n},EDe={name:"SparqlConnection",setup(){const t=Wu(),e=Da();return{store:t,selection:e}},data(){return{configure_endpoint_modal:null,endpoint_type:"quit",query_url:"",update_url:"",quit_url:""}},mounted(){this.configure_endpoint_modal=new po(this.$refs.configure_endpoint),this.$refs.configure_endpoint.addEventListener("show.bs.modal",t=>{this.get_endpoint_configuration()})},computed:{...hv(Wu,{store_ready:t=>t.ready}),store_capability:{get(){return this.store.sparqlEndpoint.capability}},graph_iri:{get(){return this.selection.graph_iri},set(t){this.store.changeGraphIri(t)}},resource_iri:{get(){return this.selection.resource_iri},set(t){this.selection.changeResourceIri(t)}}},methods:{push(){this.store.push()},pull(){this.store.pull()},get_endpoint_configuration(){const t=this.store.sparqlEndpoint;this.quit_url="",this.query_url="",this.update_url="",this.endpoint_type=t.type,t.type==="quit"?this.quit_url=t.quitUrl:t.type==="query_only"?this.query_url=t.queryUrl:t.type==="query_update"&&(this.query_url=t.queryUrl,this.update_url=t.updateUrl)},configure_endpoint(){const t={};if(this.endpoint_type==="quit"&&this.quit_url)t.quit_url=this.quit_url;else{if(!this.query_url){console.error("Not even a query_url is given. Not chaning the endpoint configuration.");return}t.query_url=this.query_url,this.update_url&&(t.update_url=this.update_url)}this.store.updateEndpointConfiguration(t)}}},ADe={key:0,inline:"",class:"col-12"},ODe={class:"btn-group col-1 mb-2 mr-sm-2 mb-sm-0",role:"group"},RDe=ot("i",{class:"bi bi-gear"},null,-1),xDe=[RDe],IDe=ot("i",{class:"bi bi-cloud-upload"},null,-1),PDe=[IDe],NDe=ot("i",{class:"bi bi-cloud-download"},null,-1),DDe=[NDe],CDe=ot("label",{for:"select_url",class:"col-1 mr-sm-2"},"Graph IRI",-1),LDe=ot("label",{for:"select_url",class:"col-1 mr-sm-2"},"Resource IRI",-1),jDe={class:"modal fade",ref:"configure_endpoint",tabindex:"-1","aria-hidden":"true","data-bs-backdrop":"static",size:"lg"},MDe={class:"modal-dialog modal-lg"},FDe={class:"modal-content"},qDe={class:"modal-header"},BDe=ot("h5",{class:"modal-title"},"Configure Endpoint",-1),$De={class:"modal-body"},UDe={class:"form-group",label:"Endpoint Type"},kDe=ot("label",{class:"form-check-label",for:"query_only"},"Query only",-1),VDe=ot("label",{class:"form-check-label",for:"query_update"},"Query & Update",-1),HDe=ot("label",{class:"form-check-label",for:"quit"},"Quit Store",-1),QDe={key:0,class:"form-group"},zDe=ot("label",{for:"quit_url"},"Quit URL",-1),GDe={key:1,class:"form-group"},WDe=ot("label",{for:"query_url"},"Query URL",-1),KDe={key:2,class:"form-group"},JDe=ot("label",{for:"update_url"},"Update URL",-1),XDe={class:"modal-footer"};function YDe(t,e,n,r,a,s){return ar(),hr(Rn,null,[t.store_ready?(ar(),hr("form",ADe,[ot("div",ODe,[ot("button",{type:"button",class:"btn btn-outline-secondary mb-0",onClick:e[0]||(e[0]=o=>a.configure_endpoint_modal.show()),title:"Configure Endpoint","aria-label":"Configure Endpoint"},xDe),s.store_capability.quit?(ar(),hr("button",{key:0,type:"button",class:"btn btn-outline-secondary mb-0",onClick:e[1]||(e[1]=o=>s.push()),title:"Push To Remote Repository","aria-label":"Push To Remote Repository"},PDe)):ta("",!0),s.store_capability.quit?(ar(),hr("button",{key:1,type:"button",class:"btn btn-outline-secondary mb-0",onClick:e[2]||(e[2]=o=>s.pull()),title:"Pull From Remote Repository","aria-label":"Pull From Remote Repository"},DDe)):ta("",!0)]),CDe,Pi(ot("input",{type:"text",class:"form-control col-2",id:"graph_iri","onUpdate:modelValue":e[3]||(e[3]=o=>s.graph_iri=o)},null,512),[[ys,s.graph_iri]]),LDe,Pi(ot("input",{type:"text",class:"form-control col-6",id:"resource_iri","onUpdate:modelValue":e[4]||(e[4]=o=>s.resource_iri=o)},null,512),[[ys,s.resource_iri]])])):ta("",!0),ot("div",jDe,[ot("div",MDe,[ot("div",FDe,[ot("div",qDe,[BDe,ot("button",{type:"button",class:"btn-close",onClick:e[5]||(e[5]=o=>a.configure_endpoint_modal.hide()),"aria-label":"Close"})]),ot("div",$De,[ot("form",null,[ot("div",UDe,[Pi(ot("input",{class:"form-check-input",type:"radio",name:"endpoint_type","onUpdate:modelValue":e[6]||(e[6]=o=>a.endpoint_type=o),id:"query_only",value:"query_only"},null,512),[[r2,a.endpoint_type]]),kDe,Pi(ot("input",{class:"form-check-input",type:"radio",name:"endpoint_type","onUpdate:modelValue":e[7]||(e[7]=o=>a.endpoint_type=o),id:"query_update",value:"query_update"},null,512),[[r2,a.endpoint_type]]),VDe,Pi(ot("input",{class:"form-check-input",type:"radio",name:"endpoint_type","onUpdate:modelValue":e[8]||(e[8]=o=>a.endpoint_type=o),id:"quit",value:"quit"},null,512),[[r2,a.endpoint_type]]),HDe]),a.endpoint_type=="quit"?(ar(),hr("div",QDe,[zDe,ot("div",null,[Pi(ot("input",{type:"text",class:"form-control",id:"quit_url","onUpdate:modelValue":e[9]||(e[9]=o=>a.quit_url=o),placeholder:"http://your.quit.store.org/"},null,512),[[ys,a.quit_url]])])])):ta("",!0),a.endpoint_type=="query_only"||a.endpoint_type=="query_update"?(ar(),hr("div",GDe,[WDe,ot("div",null,[Pi(ot("input",{type:"text",class:"form-control",id:"query_url","onUpdate:modelValue":e[10]||(e[10]=o=>a.query_url=o),placeholder:"http://your.sparql.store.org/query"},null,512),[[ys,a.query_url]])])])):ta("",!0),a.endpoint_type=="query_update"?(ar(),hr("div",KDe,[JDe,ot("div",null,[Pi(ot("input",{type:"text",class:"form-control",id:"update_url","onUpdate:modelValue":e[11]||(e[11]=o=>a.update_url=o),placeholder:"http://your.sparql.store.org/update"},null,512),[[ys,a.update_url]])])])):ta("",!0)])]),ot("div",XDe,[ot("button",{type:"button",class:"btn btn-secondary",onClick:e[12]||(e[12]=o=>a.configure_endpoint_modal.hide())},"Close"),ot("button",{type:"button",class:"btn btn-primary",onClick:e[13]||(e[13]=o=>{s.configure_endpoint(),a.configure_endpoint_modal.hide()})},"Save changes")])])])],512)],64)}const ZDe=fb(EDe,[["render",YDe]]),eCe=PI("prefixes",{state:()=>({prefixes:{ex:Lr.namedNode("http://example.org/"),exc:Lr.namedNode("http://example.org/classes#"),exp:Lr.namedNode("http://example.org/properties#"),rdf:Lr.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),rdfs:Lr.namedNode("http://www.w3.org/2000/01/rdf-schema#"),xsd:Lr.namedNode("http://www.w3.org/2001/XMLSchema#"),foaf:Lr.namedNode("http://xmlns.com/foaf/0.1/"),sh:Lr.namedNode("http://www.w3.org/ns/shacl#")}}),getters:{namespace_prefix_map:t=>{const e={};return Object.keys(t.prefixes).forEach(n=>{e[t.prefixes[n].value]=n}),e},prefixes_flat:t=>{const e={};return Object.keys(t.prefixes).forEach(n=>{e[n]=t.prefixes[n].value}),e}},actions:{setPrefix(t,e){this.prefixes[t]=Lr.namedNode(e)},resolvePrefix(t){return this.prefixes[t]},getPrefix(t){return this.namespace_prefix_map[t]},shortenIri(t){const e=new URL(t);let n=e.toString(),r="";if(e.hash){const a=n.lastIndexOf("#");r=n.substr(0,a+1),n=e.hash.substr(1)}else if(e.pathname){const a=n.lastIndexOf("/");r=n.substr(0,a+1),n=n.substr(a+1)}return this.namespace_prefix_map[r]&&n.indexOf("#")<0&&n.indexOf(":")<0&&n.indexOf("/")<0?`${this.namespace_prefix_map[r]}:${n}`:e.toString()}}}),tCe={name:"QueryResultList",setup(){const t=Wu(),e=Da();return{store:t,selection:e}},mounted(){this.updateList()},props:{title:String,query:String,queryQuads:{type:Boolean,default:!1},search:{type:Boolean,default:!1},selectVariable:{type:String,default:"resourceIri"},itemClass:String,add:Function,selectResource:Function,addTitle:String,activeResource:String},watch:{query(t){this.updateList()}},data(){return{resources:[],filter:""}},computed:{resourcesFiltered(){return this.filter?this.resources.filter(t=>t.toLowerCase().includes(this.filter.toLowerCase())):this.resources}},methods:{select(t){this.selectResource&&this.selectResource(t)},async updateList(){let t;this.queryQuads&&(t="quads");const e=await this.store.sendQuery({query:this.query,defaultGraph:t});if(e.resultType==="bindings"){const n=await e.execute();this.resources=await Array.fromAsync(n,(r,a)=>r.get(this.selectVariable).value)}},shortenIri(t){return eCe().shortenIri(t)}}},HY=t=>(tae("data-v-211acf3b"),t=t(),rae(),t),rCe={class:"card"},nCe={class:"card-header d-flex justify-content-between align-items-center"},iCe={class:"row row-cols-lg-auto g-3 align-items-center"},aCe={class:"col-12"},sCe={class:"mb-0"},oCe={class:"col-12"},uCe={class:"input-group mb-3"},cCe=HY(()=>ot("i",{class:"bi bi-arrow-repeat"},null,-1)),lCe=[cCe],dCe=["title","aria-label"],fCe=HY(()=>ot("i",{class:"bi bi-plus-square"},null,-1)),hCe=[fCe],pCe={class:"list-group list-group-flush"},yCe=["for","title","onClick"];function mCe(t,e,n,r,a,s){return ar(),hr("div",rCe,[ot("div",nCe,[ot("div",iCe,[ot("div",aCe,[ot("h6",sCe,YD(n.title),1)]),ot("div",oCe,[ot("div",uCe,[n.search?Pi((ar(),hr("input",{key:0,type:"text",class:"form-control","onUpdate:modelValue":e[0]||(e[0]=o=>a.filter=o),placeholder:"Search …"},null,512)),[[ys,a.filter]]):ta("",!0),ot("button",{type:"button",class:"btn btn-secondary",onClick:e[1]||(e[1]=(...o)=>s.updateList&&s.updateList(...o)),title:"Reload","aria-label":"Reload"},lCe),n.add?(ar(),hr("button",{key:1,type:"button",class:"btn btn-secondary",onClick:e[2]||(e[2]=(...o)=>n.add&&n.add(...o)),title:n.addTitle,"aria-label":n.addTitle},hCe,8,dCe)):ta("",!0)])])])]),ot("ul",pCe,[(ar(!0),hr(Rn,null,Eae(s.resourcesFiltered,(o,u)=>(ar(),hr("li",{class:ul(["list-group-item",[{active:o==n.activeResource},n.itemClass]]),key:u,href:"#",for:"form-control"+u,title:o,onClick:l=>s.select(o)},YD(s.shortenIri(o)),11,yCe))),128))])])}const QY=fb(tCe,[["render",mCe],["__scopeId","data-v-211acf3b"]]),gCe={name:"TermInput",mounted(){this.updateNode()},watch:{term(t){this.updateNode()}},data(){return{dynamicNodetype:"iri",literalType:"language",idValue:"",language:"de",datatype:"http://www.w3.org/2001/XMLSchema#string",node:{}}},props:{type:String,id:String,term:Object},computed:{nodeType:{get:function(){return this.type?this.type:this.dynamicNodetype},set:function(t){this.dynamicNodetype=t}}},methods:{setType(t){this.nodeType=t,this.notify()},setLiteralType(t){this.literalType=t,this.notify()},notify(){this.updateTerm()},updateTerm(){this.dynamicNodetype==="iri"?this.node=Lr.namedNode(this.idValue):this.literalType==="language"?this.node=Lr.literal(this.idValue,this.language):this.node=Lr.literal(this.idValue,Lr.namedNode(this.datatype)),this.$emit("update:term",this.node)},updateNode(){this.term!=null&&(this.node=this.term,this.term.termType==="NamedNode"?this.dynamicNodetype="iri":this.term.termType==="Literal"&&(this.dynamicNodetype="literal",this.term.language?(this.language=this.term.language,this.literalType="language"):(this.datatype=this.term.datatype.value,this.literalType="datatype")),this.idValue=this.term.value)}}},_Ce={class:"input-group"},bCe={key:1,class:"input-group-text"},vCe={key:2,class:"input-group-text"},wCe=["id"],SCe={key:3,class:"input-group-text"},TCe=["id"],ECe=["id"],ACe=ot("span",{class:"input-group-text"},">",-1);function OCe(t,e,n,r,a,s){return ar(),hr("div",_Ce,[n.type===void 0?(ar(),hr(Rn,{key:0},[ot("button",{onClick:e[0]||(e[0]=o=>s.setType("iri")),class:ul(["btn btn-outline-secondary",{active:s.nodeType=="iri"}]),type:"button"},"IRI",2),ot("button",{onClick:e[1]||(e[1]=o=>s.setType("literal")),class:ul(["btn btn-outline-secondary",{active:s.nodeType=="literal"}]),type:"button"},"Lit",2)],64)):ta("",!0),s.nodeType==="iri"?(ar(),hr("span",bCe,"<")):s.nodeType==="literal"?(ar(),hr("span",vCe,'"')):ta("",!0),Pi(ot("input",{id:"value-"+this.id,"onUpdate:modelValue":e[2]||(e[2]=o=>a.idValue=o),onInput:e[3]||(e[3]=(...o)=>s.notify&&s.notify(...o)),type:"text",class:"form-control"},null,40,wCe),[[ys,a.idValue]]),s.nodeType==="iri"?(ar(),hr("span",SCe,">")):s.nodeType==="literal"&&a.literalType==="language"?(ar(),hr(Rn,{key:4},[ot("span",{onClick:e[4]||(e[4]=o=>s.setLiteralType("datatype")),class:"input-group-text btn btn-outline-secondary"},'"@'),Pi(ot("input",{id:"language-"+this.id,"onUpdate:modelValue":e[5]||(e[5]=o=>a.language=o),onInput:e[6]||(e[6]=(...o)=>s.notify&&s.notify(...o)),type:"text",class:"form-control"},null,40,TCe),[[ys,a.language]])],64)):s.nodeType==="literal"&&a.literalType==="datatype"?(ar(),hr(Rn,{key:5},[ot("span",{onClick:e[7]||(e[7]=o=>s.setLiteralType("language")),class:"input-group-text btn btn-outline-secondary"},'"^^<'),Pi(ot("input",{id:"datatype-"+this.id,"onUpdate:modelValue":e[8]||(e[8]=o=>a.datatype=o),onInput:e[9]||(e[9]=(...o)=>s.notify&&s.notify(...o)),type:"text",class:"form-control"},null,40,ECe),[[ys,a.datatype]]),ACe],64)):ta("",!0)])}const RCe=fb(gCe,[["render",OCe]]),xCe={name:"GraphList",setup(){return{store:Wu()}},components:{TermInput:RCe,QueryResultList:QY},props:{graph_iri:String,selectGraph:Function},data(){return{graphs:[],new_graph_iri:Lr.namedNode(""),add_graph_modal:null}},mounted(){this.add_graph_modal=new po(this.$refs.add_graph)},methods:{async add_graph(){const t=[Lr.quad(this.new_graph_iri,Lr.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),Lr.namedNode("http://www.w3.org/2000/01/rdf-schema#Graph"))];console.log(this.new_graph_iri);try{await this.store.deleteInsertData({insertArray:t,graphIri:this.new_graph_iri.value}),this.add_graph_modal.hide()}catch(e){console.error(e)}}}},ICe={class:"modal fade",ref:"add_graph",tabindex:"-1","aria-hidden":"true","data-bs-backdrop":"static",size:"lg"},PCe={class:"modal-dialog modal-lg"},NCe={class:"modal-content"},DCe={class:"modal-header"},CCe=ot("h5",{class:"modal-title"},"Create New Graph",-1),LCe={class:"modal-body"},jCe={class:"form-group"},MCe=ot("label",{for:"new_graph_iri"},"IRI",-1),FCe={class:"modal-footer"};function qCe(t,e,n,r,a,s){const o=uC("QueryResultList"),u=uC("TermInput");return ar(),hr("div",null,[Wt(o,{title:"Graph List",search:"",query:"select distinct ?graph { graph ?graph {?s ?p ?o}} order by ?graph","query-quads":"","select-variable":"graph",ref:"classList",add:()=>{a.add_graph_modal.show()},selectResource:n.selectGraph,activeResource:n.graph_iri},null,8,["add","selectResource","activeResource"]),ot("div",ICe,[ot("div",PCe,[ot("div",NCe,[ot("div",DCe,[CCe,ot("button",{type:"button",class:"btn-close",onClick:e[0]||(e[0]=l=>a.add_graph_modal.hide()),"aria-label":"Close"})]),ot("div",LCe,[ot("form",null,[ot("div",jCe,[MCe,ot("div",null,[Wt(u,{type:"iri",id:"new_graph_iri",term:a.new_graph_iri,"onUpdate:term":e[1]||(e[1]=l=>a.new_graph_iri=l)},null,8,["term"])])])])]),ot("div",FCe,[ot("button",{type:"button",class:"btn btn-secondary",onClick:e[2]||(e[2]=l=>a.add_graph_modal.hide())},"Close"),ot("button",{type:"button",class:"btn btn-primary",onClick:e[3]||(e[3]=l=>s.add_graph())},"Save changes")])])])],512)])}const BCe=fb(xCe,[["render",qCe]]),$Ce={name:"ClassList",props:{class_iri:String,selectClass:Function},watch:{graph_iri(t){console.log("graph_iri changed"+t),this.$refs.classList.updateList()}},computed:{...hv(Da,["graph_iri"])}},UCe=Object.assign($Ce,{setup(t){return(e,n)=>(ar(),RI(QY,{title:"Class List",search:"",query:"select distinct ?class { {?s a ?class} union {?class a } union {?class a } } order by ?class","select-variable":"class",ref:"classList",activeResource:t.class_iri,selectResource:t.selectClass},null,8,["activeResource","selectResource"]))}}),ZV={name:"splitpanes",emits:["ready","resize","resized","pane-click","pane-maximize","pane-add","pane-remove","splitter-click"],props:{horizontal:{type:Boolean},pushOtherPanes:{type:Boolean,default:!0},dblClickSplitter:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean}},provide(){return{requestUpdate:this.requestUpdate,onPaneAdd:this.onPaneAdd,onPaneRemove:this.onPaneRemove,onPaneClick:this.onPaneClick}},data:()=>({container:null,ready:!1,panes:[],touch:{mouseDown:!1,dragging:!1,activeSplitter:null},splitterTaps:{splitter:null,timeoutId:null}}),computed:{panesCount(){return this.panes.length},indexedPanes(){return this.panes.reduce((t,e)=>(t[e.id]=e)&&t,{})}},methods:{updatePaneComponents(){this.panes.forEach(t=>{t.update&&t.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[t.id].size}%`})})},bindEvents(){document.addEventListener("mousemove",this.onMouseMove,{passive:!1}),document.addEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.addEventListener("touchmove",this.onMouseMove,{passive:!1}),document.addEventListener("touchend",this.onMouseUp))},unbindEvents(){document.removeEventListener("mousemove",this.onMouseMove,{passive:!1}),document.removeEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.removeEventListener("touchmove",this.onMouseMove,{passive:!1}),document.removeEventListener("touchend",this.onMouseUp))},onMouseDown(t,e){this.bindEvents(),this.touch.mouseDown=!0,this.touch.activeSplitter=e},onMouseMove(t){this.touch.mouseDown&&(t.preventDefault(),this.touch.dragging=!0,this.calculatePanesSize(this.getCurrentMouseDrag(t)),this.$emit("resize",this.panes.map(e=>({min:e.min,max:e.max,size:e.size}))))},onMouseUp(){this.touch.dragging&&this.$emit("resized",this.panes.map(t=>({min:t.min,max:t.max,size:t.size}))),this.touch.mouseDown=!1,setTimeout(()=>{this.touch.dragging=!1,this.unbindEvents()},100)},onSplitterClick(t,e){"ontouchstart"in window&&(t.preventDefault(),this.dblClickSplitter&&(this.splitterTaps.splitter===e?(clearTimeout(this.splitterTaps.timeoutId),this.splitterTaps.timeoutId=null,this.onSplitterDblClick(t,e),this.splitterTaps.splitter=null):(this.splitterTaps.splitter=e,this.splitterTaps.timeoutId=setTimeout(()=>{this.splitterTaps.splitter=null},500)))),this.touch.dragging||this.$emit("splitter-click",this.panes[e])},onSplitterDblClick(t,e){let n=0;this.panes=this.panes.map((r,a)=>(r.size=a===e?r.max:r.min,a!==e&&(n+=r.min),r)),this.panes[e].size-=n,this.$emit("pane-maximize",this.panes[e]),this.$emit("resized",this.panes.map(r=>({min:r.min,max:r.max,size:r.size})))},onPaneClick(t,e){this.$emit("pane-click",this.indexedPanes[e])},getCurrentMouseDrag(t){const e=this.container.getBoundingClientRect(),{clientX:n,clientY:r}="ontouchstart"in window&&t.touches?t.touches[0]:t;return{x:n-e.left,y:r-e.top}},getCurrentDragPercentage(t){t=t[this.horizontal?"y":"x"];const e=this.container[this.horizontal?"clientHeight":"clientWidth"];return this.rtl&&!this.horizontal&&(t=e-t),t*100/e},calculatePanesSize(t){const e=this.touch.activeSplitter;let n={prevPanesSize:this.sumPrevPanesSize(e),nextPanesSize:this.sumNextPanesSize(e),prevReachedMinPanes:0,nextReachedMinPanes:0};const r=0+(this.pushOtherPanes?0:n.prevPanesSize),a=100-(this.pushOtherPanes?0:n.nextPanesSize),s=Math.max(Math.min(this.getCurrentDragPercentage(t),a),r);let o=[e,e+1],u=this.panes[o[0]]||null,l=this.panes[o[1]]||null;const c=u.max<100&&s>=u.max+n.prevPanesSize,d=l.max<100&&s<=100-(l.max+this.sumNextPanesSize(e+1));if(c||d){c?(u.size=u.max,l.size=Math.max(100-u.max-n.prevPanesSize-n.nextPanesSize,0)):(u.size=Math.max(100-l.max-n.prevPanesSize-this.sumNextPanesSize(e+1),0),l.size=l.max);return}if(this.pushOtherPanes){const f=this.doPushOtherPanes(n,s);if(!f)return;({sums:n,panesToResize:o}=f),u=this.panes[o[0]]||null,l=this.panes[o[1]]||null}u!==null&&(u.size=Math.min(Math.max(s-n.prevPanesSize-n.prevReachedMinPanes,u.min),u.max)),l!==null&&(l.size=Math.min(Math.max(100-s-n.nextPanesSize-n.nextReachedMinPanes,l.min),l.max))},doPushOtherPanes(t,e){const n=this.touch.activeSplitter,r=[n,n+1];return e{s>r[0]&&s<=n&&(a.size=a.min,t.prevReachedMinPanes+=a.min)}),t.prevPanesSize=this.sumPrevPanesSize(r[0]),r[0]===void 0)?(t.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((a,s)=>{s>0&&s<=n&&(a.size=a.min,t.prevReachedMinPanes+=a.min)}),this.panes[r[1]].size=100-t.prevReachedMinPanes-this.panes[0].min-t.prevPanesSize-t.nextPanesSize,null):e>100-t.nextPanesSize-this.panes[r[1]].min&&(r[1]=this.findNextExpandedPane(n).index,t.nextReachedMinPanes=0,r[1]>n+1&&this.panes.forEach((a,s)=>{s>n&&s{s=n+1&&(a.size=a.min,t.nextReachedMinPanes+=a.min)}),this.panes[r[0]].size=100-t.prevPanesSize-t.nextReachedMinPanes-this.panes[this.panesCount-1].min-t.nextPanesSize,null):{sums:t,panesToResize:r}},sumPrevPanesSize(t){return this.panes.reduce((e,n,r)=>e+(re+(r>t+1?n.size:0),0)},findPrevExpandedPane(t){return[...this.panes].reverse().find(e=>e.indexe.min)||{}},findNextExpandedPane(t){return this.panes.find(e=>e.index>t+1&&e.size>e.min)||{}},checkSplitpanesNodes(){Array.from(this.container.children).forEach(t=>{const e=t.classList.contains("splitpanes__pane"),n=t.classList.contains("splitpanes__splitter");!e&&!n&&(t.parentNode.removeChild(t),console.warn("Splitpanes: Only elements are allowed at the root of . One of your DOM nodes was removed."))})},addSplitter(t,e,n=!1){const r=t-1,a=document.createElement("div");a.classList.add("splitpanes__splitter"),n||(a.onmousedown=s=>this.onMouseDown(s,r),typeof window<"u"&&"ontouchstart"in window&&(a.ontouchstart=s=>this.onMouseDown(s,r)),a.onclick=s=>this.onSplitterClick(s,r+1)),this.dblClickSplitter&&(a.ondblclick=s=>this.onSplitterDblClick(s,r+1)),e.parentNode.insertBefore(a,e)},removeSplitter(t){t.onmousedown=void 0,t.onclick=void 0,t.ondblclick=void 0,t.parentNode.removeChild(t)},redoSplitters(){const t=Array.from(this.container.children);t.forEach(n=>{n.className.includes("splitpanes__splitter")&&this.removeSplitter(n)});let e=0;t.forEach(n=>{n.className.includes("splitpanes__pane")&&(!e&&this.firstSplitter?this.addSplitter(e,n,!0):e&&this.addSplitter(e,n),e++)})},requestUpdate({target:t,...e}){const n=this.indexedPanes[t._.uid];Object.entries(e).forEach(([r,a])=>n[r]=a)},onPaneAdd(t){let e=-1;Array.from(t.$el.parentNode.children).some(a=>(a.className.includes("splitpanes__pane")&&e++,a===t.$el));const n=parseFloat(t.minSize),r=parseFloat(t.maxSize);this.panes.splice(e,0,{id:t._.uid,index:e,min:isNaN(n)?0:n,max:isNaN(r)?100:r,size:t.size===null?null:parseFloat(t.size),givenSize:t.size,update:t.update}),this.panes.forEach((a,s)=>a.index=s),this.ready&&this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({addedPane:this.panes[e]}),this.$emit("pane-add",{index:e,panes:this.panes.map(a=>({min:a.min,max:a.max,size:a.size}))})})},onPaneRemove(t){const e=this.panes.findIndex(r=>r.id===t._.uid),n=this.panes.splice(e,1)[0];this.panes.forEach((r,a)=>r.index=a),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...n,index:e}}),this.$emit("pane-remove",{removed:n,panes:this.panes.map(r=>({min:r.min,max:r.max,size:r.size}))})})},resetPaneSizes(t={}){!t.addedPane&&!t.removedPane?this.initialPanesSizing():this.panes.some(e=>e.givenSize!==null||e.min||e.max<100)?this.equalizeAfterAddOrRemove(t):this.equalize(),this.ready&&this.$emit("resized",this.panes.map(e=>({min:e.min,max:e.max,size:e.size})))},equalize(){const t=100/this.panesCount;let e=0;const n=[],r=[];this.panes.forEach(a=>{a.size=Math.max(Math.min(t,a.max),a.min),e-=a.size,a.size>=a.max&&n.push(a.id),a.size<=a.min&&r.push(a.id)}),e>.1&&this.readjustSizes(e,n,r)},initialPanesSizing(){let t=100;const e=[],n=[];let r=0;this.panes.forEach(s=>{t-=s.size,s.size!==null&&r++,s.size>=s.max&&e.push(s.id),s.size<=s.min&&n.push(s.id)});let a=100;t>.1&&(this.panes.forEach(s=>{s.size===null&&(s.size=Math.max(Math.min(t/(this.panesCount-r),s.max),s.min)),a-=s.size}),a>.1&&this.readjustSizes(t,e,n))},equalizeAfterAddOrRemove({addedPane:t,removedPane:e}={}){let n=100/this.panesCount,r=0;const a=[],s=[];t&&t.givenSize!==null&&(n=(100-t.givenSize)/(this.panesCount-1)),this.panes.forEach(o=>{r-=o.size,o.size>=o.max&&a.push(o.id),o.size<=o.min&&s.push(o.id)}),!(Math.abs(r)<.1)&&(this.panes.forEach(o=>{t&&t.givenSize!==null&&t.id===o.id||(o.size=Math.max(Math.min(n,o.max),o.min)),r-=o.size,o.size>=o.max&&a.push(o.id),o.size<=o.min&&s.push(o.id)}),r>.1&&this.readjustSizes(r,a,s))},readjustSizes(t,e,n){let r;t>0?r=t/(this.panesCount-e.length):r=t/(this.panesCount-n.length),this.panes.forEach((a,s)=>{if(t>0&&!e.includes(a.id)){const o=Math.max(Math.min(a.size+r,a.max),a.min),u=o-a.size;t-=u,a.size=o}else if(!n.includes(a.id)){const o=Math.max(Math.min(a.size+r,a.max),a.min),u=o-a.size;t-=u,a.size=o}a.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[a.id].size}%`})}),Math.abs(t)>.1&&this.$nextTick(()=>{this.ready&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints.")})}},watch:{panes:{deep:!0,immediate:!1,handler(){this.updatePaneComponents()}},horizontal(){this.updatePaneComponents()},firstSplitter(){this.redoSplitters()},dblClickSplitter(t){[...this.container.querySelectorAll(".splitpanes__splitter")].forEach((e,n)=>{e.ondblclick=t?r=>this.onSplitterDblClick(r,n):void 0})}},beforeUnmount(){this.ready=!1},mounted(){this.container=this.$refs.container,this.checkSplitpanesNodes(),this.redoSplitters(),this.resetPaneSizes(),this.$emit("ready"),this.ready=!0},render(){return II("div",{ref:"container",class:["splitpanes",`splitpanes--${this.horizontal?"horizontal":"vertical"}`,{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())}},kCe=(t,e)=>{const n=t.__vccOpts||t;for(const[r,a]of e)n[r]=a;return n},VCe={name:"pane",inject:["requestUpdate","onPaneAdd","onPaneRemove","onPaneClick"],props:{size:{type:[Number,String],default:null},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},data:()=>({style:{}}),mounted(){this.onPaneAdd(this)},beforeUnmount(){this.onPaneRemove(this)},methods:{update(t){this.style=t}},computed:{sizeNumber(){return this.size||this.size===0?parseFloat(this.size):null},minSizeNumber(){return parseFloat(this.minSize)},maxSizeNumber(){return parseFloat(this.maxSize)}},watch:{sizeNumber(t){this.requestUpdate({target:this,size:t})},minSizeNumber(t){this.requestUpdate({target:this,min:t})},maxSizeNumber(t){this.requestUpdate({target:this,max:t})}}};function HCe(t,e,n,r,a,s){return ar(),hr("div",{class:"splitpanes__pane",onClick:e[0]||(e[0]=o=>s.onPaneClick(o,t._.uid)),style:kv(t.style)},[Aae(t.$slots,"default")],4)}const T1=kCe(VCe,[["render",HCe]]),QCe={id:"app",class:"container-fluid"},zCe={class:"row connection"},GCe={key:0},WCe={key:1},KCe={key:0,class:"row"},JCe={class:"nav nav-tabs"},XCe={class:"nav-item"},YCe={class:"nav-item"},ZCe={class:"nav-item"},e4e={class:"nav-item"},t4e={class:"nav-item"},r4e={class:"nav-item"},n4e={class:"nav-item"},i4e={key:1},a4e={name:"App",setup(){return{store:Wu()}},computed:{...hv(Wu,{store_ready:t=>t.ready}),...hv(Da,["graph_iri","resource_iri"])}},s4e=Object.assign(a4e,{setup(t){return(e,n)=>(ar(),hr("div",QCe,[ot("div",zCe,[e.store_ready?(ar(),hr("div",GCe,"🟢 Store is ready")):(ar(),hr("div",WCe,"🔄 Loading")),Wt(ZDe)]),e.store_ready?(ar(),hr("div",KCe,[Wt(Dr(ZV),{class:"default-theme"},{default:ai(()=>[Wt(Dr(T1),{size:"30"},{default:ai(()=>[Wt(Dr(ZV),{horizontal:"",style:{height:"80vh"}},{default:ai(()=>[Wt(Dr(T1),{size:"30"},{default:ai(()=>[Wt(BCe,{graph_iri:e.graph_iri,selectGraph:r=>{Dr(Da)().changeGraphIri(r),Dr(Da)().changeResourceIri(r)}},null,8,["graph_iri","selectGraph"])]),_:1}),Wt(Dr(T1),{size:"70"},{default:ai(()=>[Wt(UCe,{class_iri:e.resource_iri,selectClass:r=>{Dr(Da)().changeResourceIri(r)}},null,8,["class_iri","selectClass"])]),_:1})]),_:1})]),_:1}),Wt(Dr(T1),{size:"90"},{default:ai(()=>[ot("ul",JCe,[ot("li",XCe,[Wt(Dr(Ks),{class:"nav-link","active-class":"active",to:"/dashboard"},{default:ai(()=>[Gs("Home")]),_:1})]),ot("li",YCe,[Wt(Dr(Ks),{class:"nav-link","active-class":"active",to:"/instances"},{default:ai(()=>[Gs("Instances")]),_:1})]),ot("li",ZCe,[Wt(Dr(Ks),{class:"nav-link","active-class":"active",to:"/voc"},{default:ai(()=>[Gs("Vocabulary")]),_:1})]),ot("li",e4e,[Wt(Dr(Ks),{class:"nav-link","active-class":"active",to:"/edit"},{default:ai(()=>[Gs("Edit")]),_:1})]),ot("li",t4e,[Wt(Dr(Ks),{class:"nav-link","active-class":"active",to:"/form"},{default:ai(()=>[Gs("Form")]),_:1})]),ot("li",r4e,[Wt(Dr(Ks),{class:"nav-link","active-class":"active",to:"/add"},{default:ai(()=>[Gs("Add")]),_:1})]),ot("li",n4e,[Wt(Dr(Ks),{class:"nav-link","active-class":"active",to:"/source"},{default:ai(()=>[Gs("Source")]),_:1})])]),Wt(Dr(wz))]),_:1})]),_:1})])):(ar(),hr("div",i4e," Waiting for Store to be configured … "))]))}}),o4e=fb(s4e,[["__scopeId","data-v-ef9edd2d"]]),u4e="modulepreload",c4e=function(t,e){return new URL(t,e).href},eH={},zs=function(e,n,r){let a=Promise.resolve();if(n&&n.length>0){const s=document.getElementsByTagName("link"),o=document.querySelector("meta[property=csp-nonce]"),u=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));a=Promise.all(n.map(l=>{if(l=c4e(l,r),l in eH)return;eH[l]=!0;const c=l.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(!!r)for(let p=s.length-1;p>=0;p--){const m=s[p];if(m.href===l&&(!c||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${d}`))return;const h=document.createElement("link");if(h.rel=c?"stylesheet":u4e,c||(h.as="script",h.crossOrigin=""),h.href=l,u&&h.setAttribute("nonce",u),document.head.appendChild(h),c)return new Promise((p,m)=>{h.addEventListener("load",p),h.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${l}`)))})}))}return a.then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})},zY=Voe({history:voe("./"),routes:[{path:"/",redirect:{path:"/dashboard"}},{path:"/about",name:"about",component:()=>zs(()=>import("./AboutView-8D4yJgwJ.js"),[],import.meta.url)},{path:"/dashboard",name:"DashboardView",component:()=>zs(()=>import("./DashboardView-oP_o-Ja_.js"),__vite__mapDeps([0,1,2,3]),import.meta.url)},{path:"/instances",name:"InstanceList",component:()=>zs(()=>import("./InstanceList-AVehQBSG.js"),[],import.meta.url)},{path:"/voc",name:"VocPad",component:()=>zs(()=>import("./VocPad-D_dUwJLt.js"),__vite__mapDeps([4,5]),import.meta.url)},{path:"/edit",name:"EditForm",component:()=>zs(()=>import("./EditForm-uEtOdnsK.js"),__vite__mapDeps([6,5]),import.meta.url)},{path:"/form",name:"FormDemo",component:()=>zs(()=>import("./FormDemo-DXTcTxJi.js"),__vite__mapDeps([7,1,2]),import.meta.url)},{path:"/add",name:"InputForm",component:()=>zs(()=>import("./InputForm-Du3E-_8t.js"),[],import.meta.url)},{path:"/source",name:"Source",component:()=>zs(()=>import("./Source-DLJIiKEC.js"),__vite__mapDeps([8,5]),import.meta.url)}]});zY.beforeEach(t=>{Wu()});const GN=Cse(o4e);GN.use(Fse());GN.use(zY);GN.mount("#app");export{Aae as A,ul as B,Gs as C,Pi as D,ys as E,Rn as F,d4e as G,po as H,eCe as I,p4e as J,d_ as K,As as L,ZV as M,D8e as N,C8e as O,iNe as P,QY as Q,P8e as R,uNe as S,RCe as T,P as U,tr as V,fb as _,ot as a,Da as b,hr as c,Wt as d,Eae as e,Lr as f,ta as g,Dr as h,T1 as i,rae as j,bR as k,BQ as l,hv as m,RI as n,ar as o,tae as p,N8e as q,uC as r,f4e as s,YD as t,Wu as u,kv as v,ai as w,Wg as x,h4e as y,mae as z}; + }`}function TDe(t,e){console.log(t);let n="select distinct ?instance from { ?instance a } order by ?instance";if(typeof t=="string"){const r=new Xu.Parser;t=r.parse(t);const a=r.parse(n);console.log(a)}return console.log(t),t.type==="query"?t.from={default:[Lr.namedNode(e)],named:[]}:t.type==="update"&&(t.with=Lr.namedNode(e)),t}const Wu=PI("rdf",()=>{const t=Wg(!1),e=Wg(null);async function n(l){let c,d="";console.log(`send query: ${l}`),typeof l=="string"?(d=l,c=[Da().graph_iri]):typeof l=="object"?(d=l.query,l.defaultGraph==="quads"?c=void 0:l.defaultGraph!==void 0?c=l.defaultGraph:c=[Da().graph_iri]):(console.error("can't process query"),console.error(l)),c!==void 0&&(console.log(`inject graph: ${c}`),d=TDe(d,c));const f=new Xu.Generator;let h;return typeof d!="string"?h=f.stringify(d):h=d,e.value.query(h)}async function r(l,c){c===void 0&&(c=[Da().graph_iri]);let d="";for(const m of c)d+=`from <${m}>`;const f=`construct {<${l}> ?p ?o} ${d} where {<${l}> ?p ?o}`,h=await e.value.query_quads(f),p=Lr.namedNode(c[0]);return Dt.Readable.from(h).pipe(new A2(p))}function a(){e.value.push!==void 0&&e.value.push().then(function(l){console.log(l)})}function s(){e.value.pull!==void 0&&e.value.pull().then(function(l){console.log(l)})}async function o(l){let c=l.deleteArray,d=l.insertArray;const f=[];if(l.graphIri!==void 0){const p=Lr.namedNode(l.graphIri);c&&c.length>0&&(c=await Dt.Readable.from(c).pipe(new A2(p)).toArray()),d&&d.length>0&&(d=await Dt.Readable.from(d).pipe(new A2(p)).toArray())}c&&c.length>0&&f.push(jbe(c).toString()),d&&d.length>0&&f.push(Mbe(d).toString());const h=f.join(";");return e.value.update(h)}async function u(l){console.log("Loading …"),console.log("Change SPARQL Endpoint configuration."),console.log(l);const c=await dNe.create(l);e.value=c[0],t.value=!0}return console.log("configuration is"),console.log(Pv),u(Pv),{ready:t,sparqlEndpoint:e,sendQuery:n,getResource:r,push:a,pull:s,deleteInsertData:o,updateEndpointConfiguration:u}}),fb=(t,e)=>{const n=t.__vccOpts||t;for(const[r,a]of e)n[r]=a;return n},EDe={name:"SparqlConnection",setup(){const t=Wu(),e=Da();return{store:t,selection:e}},data(){return{configure_endpoint_modal:null,endpoint_type:"quit",query_url:"",update_url:"",quit_url:""}},mounted(){this.configure_endpoint_modal=new po(this.$refs.configure_endpoint),this.$refs.configure_endpoint.addEventListener("show.bs.modal",t=>{this.get_endpoint_configuration()})},computed:{...hv(Wu,{store_ready:t=>t.ready}),store_capability:{get(){return this.store.sparqlEndpoint.capability}},graph_iri:{get(){return this.selection.graph_iri},set(t){this.store.changeGraphIri(t)}},resource_iri:{get(){return this.selection.resource_iri},set(t){this.selection.changeResourceIri(t)}}},methods:{push(){this.store.push()},pull(){this.store.pull()},get_endpoint_configuration(){const t=this.store.sparqlEndpoint;this.quit_url="",this.query_url="",this.update_url="",this.endpoint_type=t.type,t.type==="quit"?this.quit_url=t.quitUrl:t.type==="query_only"?this.query_url=t.queryUrl:t.type==="query_update"&&(this.query_url=t.queryUrl,this.update_url=t.updateUrl)},configure_endpoint(){const t={};if(this.endpoint_type==="quit"&&this.quit_url)t.quit_url=this.quit_url;else{if(!this.query_url){console.error("Not even a query_url is given. Not chaning the endpoint configuration.");return}t.query_url=this.query_url,this.update_url&&(t.update_url=this.update_url)}this.store.updateEndpointConfiguration(t)}}},ADe={key:0,inline:"",class:"col-12"},ODe={class:"btn-group col-1 mb-2 mr-sm-2 mb-sm-0",role:"group"},RDe=ot("i",{class:"bi bi-gear"},null,-1),xDe=[RDe],IDe=ot("i",{class:"bi bi-cloud-upload"},null,-1),PDe=[IDe],NDe=ot("i",{class:"bi bi-cloud-download"},null,-1),DDe=[NDe],CDe=ot("label",{for:"select_url",class:"col-1 mr-sm-2"},"Graph IRI",-1),LDe=ot("label",{for:"select_url",class:"col-1 mr-sm-2"},"Resource IRI",-1),jDe={class:"modal fade",ref:"configure_endpoint",tabindex:"-1","aria-hidden":"true","data-bs-backdrop":"static",size:"lg"},MDe={class:"modal-dialog modal-lg"},FDe={class:"modal-content"},qDe={class:"modal-header"},BDe=ot("h5",{class:"modal-title"},"Configure Endpoint",-1),$De={class:"modal-body"},UDe={class:"form-group",label:"Endpoint Type"},kDe=ot("label",{class:"form-check-label",for:"query_only"},"Query only",-1),VDe=ot("label",{class:"form-check-label",for:"query_update"},"Query & Update",-1),HDe=ot("label",{class:"form-check-label",for:"quit"},"Quit Store",-1),QDe={key:0,class:"form-group"},zDe=ot("label",{for:"quit_url"},"Quit URL",-1),GDe={key:1,class:"form-group"},WDe=ot("label",{for:"query_url"},"Query URL",-1),KDe={key:2,class:"form-group"},JDe=ot("label",{for:"update_url"},"Update URL",-1),XDe={class:"modal-footer"};function YDe(t,e,n,r,a,s){return ar(),hr(Rn,null,[t.store_ready?(ar(),hr("form",ADe,[ot("div",ODe,[ot("button",{type:"button",class:"btn btn-outline-secondary mb-0",onClick:e[0]||(e[0]=o=>a.configure_endpoint_modal.show()),title:"Configure Endpoint","aria-label":"Configure Endpoint"},xDe),s.store_capability.quit?(ar(),hr("button",{key:0,type:"button",class:"btn btn-outline-secondary mb-0",onClick:e[1]||(e[1]=o=>s.push()),title:"Push To Remote Repository","aria-label":"Push To Remote Repository"},PDe)):ta("",!0),s.store_capability.quit?(ar(),hr("button",{key:1,type:"button",class:"btn btn-outline-secondary mb-0",onClick:e[2]||(e[2]=o=>s.pull()),title:"Pull From Remote Repository","aria-label":"Pull From Remote Repository"},DDe)):ta("",!0)]),CDe,Pi(ot("input",{type:"text",class:"form-control col-2",id:"graph_iri","onUpdate:modelValue":e[3]||(e[3]=o=>s.graph_iri=o)},null,512),[[ys,s.graph_iri]]),LDe,Pi(ot("input",{type:"text",class:"form-control col-6",id:"resource_iri","onUpdate:modelValue":e[4]||(e[4]=o=>s.resource_iri=o)},null,512),[[ys,s.resource_iri]])])):ta("",!0),ot("div",jDe,[ot("div",MDe,[ot("div",FDe,[ot("div",qDe,[BDe,ot("button",{type:"button",class:"btn-close",onClick:e[5]||(e[5]=o=>a.configure_endpoint_modal.hide()),"aria-label":"Close"})]),ot("div",$De,[ot("form",null,[ot("div",UDe,[Pi(ot("input",{class:"form-check-input",type:"radio",name:"endpoint_type","onUpdate:modelValue":e[6]||(e[6]=o=>a.endpoint_type=o),id:"query_only",value:"query_only"},null,512),[[r2,a.endpoint_type]]),kDe,Pi(ot("input",{class:"form-check-input",type:"radio",name:"endpoint_type","onUpdate:modelValue":e[7]||(e[7]=o=>a.endpoint_type=o),id:"query_update",value:"query_update"},null,512),[[r2,a.endpoint_type]]),VDe,Pi(ot("input",{class:"form-check-input",type:"radio",name:"endpoint_type","onUpdate:modelValue":e[8]||(e[8]=o=>a.endpoint_type=o),id:"quit",value:"quit"},null,512),[[r2,a.endpoint_type]]),HDe]),a.endpoint_type=="quit"?(ar(),hr("div",QDe,[zDe,ot("div",null,[Pi(ot("input",{type:"text",class:"form-control",id:"quit_url","onUpdate:modelValue":e[9]||(e[9]=o=>a.quit_url=o),placeholder:"http://your.quit.store.org/"},null,512),[[ys,a.quit_url]])])])):ta("",!0),a.endpoint_type=="query_only"||a.endpoint_type=="query_update"?(ar(),hr("div",GDe,[WDe,ot("div",null,[Pi(ot("input",{type:"text",class:"form-control",id:"query_url","onUpdate:modelValue":e[10]||(e[10]=o=>a.query_url=o),placeholder:"http://your.sparql.store.org/query"},null,512),[[ys,a.query_url]])])])):ta("",!0),a.endpoint_type=="query_update"?(ar(),hr("div",KDe,[JDe,ot("div",null,[Pi(ot("input",{type:"text",class:"form-control",id:"update_url","onUpdate:modelValue":e[11]||(e[11]=o=>a.update_url=o),placeholder:"http://your.sparql.store.org/update"},null,512),[[ys,a.update_url]])])])):ta("",!0)])]),ot("div",XDe,[ot("button",{type:"button",class:"btn btn-secondary",onClick:e[12]||(e[12]=o=>a.configure_endpoint_modal.hide())},"Close"),ot("button",{type:"button",class:"btn btn-primary",onClick:e[13]||(e[13]=o=>{s.configure_endpoint(),a.configure_endpoint_modal.hide()})},"Save changes")])])])],512)],64)}const ZDe=fb(EDe,[["render",YDe]]),eCe=PI("prefixes",{state:()=>({prefixes:{ex:Lr.namedNode("http://example.org/"),exc:Lr.namedNode("http://example.org/classes#"),exp:Lr.namedNode("http://example.org/properties#"),rdf:Lr.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),rdfs:Lr.namedNode("http://www.w3.org/2000/01/rdf-schema#"),xsd:Lr.namedNode("http://www.w3.org/2001/XMLSchema#"),foaf:Lr.namedNode("http://xmlns.com/foaf/0.1/"),sh:Lr.namedNode("http://www.w3.org/ns/shacl#")}}),getters:{namespace_prefix_map:t=>{const e={};return Object.keys(t.prefixes).forEach(n=>{e[t.prefixes[n].value]=n}),e},prefixes_flat:t=>{const e={};return Object.keys(t.prefixes).forEach(n=>{e[n]=t.prefixes[n].value}),e}},actions:{setPrefix(t,e){this.prefixes[t]=Lr.namedNode(e)},resolvePrefix(t){return this.prefixes[t]},getPrefix(t){return this.namespace_prefix_map[t]},shortenIri(t){const e=new URL(t);let n=e.toString(),r="";if(e.hash){const a=n.lastIndexOf("#");r=n.substr(0,a+1),n=e.hash.substr(1)}else if(e.pathname){const a=n.lastIndexOf("/");r=n.substr(0,a+1),n=n.substr(a+1)}return this.namespace_prefix_map[r]&&n.indexOf("#")<0&&n.indexOf(":")<0&&n.indexOf("/")<0?`${this.namespace_prefix_map[r]}:${n}`:e.toString()}}}),tCe={name:"QueryResultList",setup(){const t=Wu(),e=Da();return{store:t,selection:e}},mounted(){this.updateList()},props:{title:String,query:String,queryQuads:{type:Boolean,default:!1},search:{type:Boolean,default:!1},selectVariable:{type:String,default:"resourceIri"},itemClass:String,add:Function,selectResource:Function,addTitle:String,activeResource:String},watch:{query(t){this.updateList()}},data(){return{resources:[],filter:""}},computed:{resourcesFiltered(){return this.filter?this.resources.filter(t=>t.toLowerCase().includes(this.filter.toLowerCase())):this.resources}},methods:{select(t){this.selectResource&&this.selectResource(t)},async updateList(){let t;this.queryQuads&&(t="quads");const e=await this.store.sendQuery({query:this.query,defaultGraph:t});if(e.resultType==="bindings"){const n=await e.execute();this.resources=await Array.fromAsync(n,(r,a)=>r.get(this.selectVariable).value)}},shortenIri(t){return eCe().shortenIri(t)}}},HY=t=>(tae("data-v-211acf3b"),t=t(),rae(),t),rCe={class:"card"},nCe={class:"card-header d-flex justify-content-between align-items-center"},iCe={class:"row row-cols-lg-auto g-3 align-items-center"},aCe={class:"col-12"},sCe={class:"mb-0"},oCe={class:"col-12"},uCe={class:"input-group mb-3"},cCe=HY(()=>ot("i",{class:"bi bi-arrow-repeat"},null,-1)),lCe=[cCe],dCe=["title","aria-label"],fCe=HY(()=>ot("i",{class:"bi bi-plus-square"},null,-1)),hCe=[fCe],pCe={class:"list-group list-group-flush"},yCe=["for","title","onClick"];function mCe(t,e,n,r,a,s){return ar(),hr("div",rCe,[ot("div",nCe,[ot("div",iCe,[ot("div",aCe,[ot("h6",sCe,YD(n.title),1)]),ot("div",oCe,[ot("div",uCe,[n.search?Pi((ar(),hr("input",{key:0,type:"text",class:"form-control","onUpdate:modelValue":e[0]||(e[0]=o=>a.filter=o),placeholder:"Search …"},null,512)),[[ys,a.filter]]):ta("",!0),ot("button",{type:"button",class:"btn btn-secondary",onClick:e[1]||(e[1]=(...o)=>s.updateList&&s.updateList(...o)),title:"Reload","aria-label":"Reload"},lCe),n.add?(ar(),hr("button",{key:1,type:"button",class:"btn btn-secondary",onClick:e[2]||(e[2]=(...o)=>n.add&&n.add(...o)),title:n.addTitle,"aria-label":n.addTitle},hCe,8,dCe)):ta("",!0)])])])]),ot("ul",pCe,[(ar(!0),hr(Rn,null,Eae(s.resourcesFiltered,(o,u)=>(ar(),hr("li",{class:ul(["list-group-item",[{active:o==n.activeResource},n.itemClass]]),key:u,href:"#",for:"form-control"+u,title:o,onClick:l=>s.select(o)},YD(s.shortenIri(o)),11,yCe))),128))])])}const QY=fb(tCe,[["render",mCe],["__scopeId","data-v-211acf3b"]]),gCe={name:"TermInput",mounted(){this.updateNode()},watch:{term(t){this.updateNode()}},data(){return{dynamicNodetype:"iri",literalType:"language",idValue:"",language:"de",datatype:"http://www.w3.org/2001/XMLSchema#string",node:{}}},props:{type:String,id:String,term:Object},computed:{nodeType:{get:function(){return this.type?this.type:this.dynamicNodetype},set:function(t){this.dynamicNodetype=t}}},methods:{setType(t){this.nodeType=t,this.notify()},setLiteralType(t){this.literalType=t,this.notify()},notify(){this.updateTerm()},updateTerm(){this.dynamicNodetype==="iri"?this.node=Lr.namedNode(this.idValue):this.literalType==="language"?this.node=Lr.literal(this.idValue,this.language):this.node=Lr.literal(this.idValue,Lr.namedNode(this.datatype)),this.$emit("update:term",this.node)},updateNode(){this.term!=null&&(this.node=this.term,this.term.termType==="NamedNode"?this.dynamicNodetype="iri":this.term.termType==="Literal"&&(this.dynamicNodetype="literal",this.term.language?(this.language=this.term.language,this.literalType="language"):(this.datatype=this.term.datatype.value,this.literalType="datatype")),this.idValue=this.term.value)}}},_Ce={class:"input-group"},bCe={key:1,class:"input-group-text"},vCe={key:2,class:"input-group-text"},wCe=["id"],SCe={key:3,class:"input-group-text"},TCe=["id"],ECe=["id"],ACe=ot("span",{class:"input-group-text"},">",-1);function OCe(t,e,n,r,a,s){return ar(),hr("div",_Ce,[n.type===void 0?(ar(),hr(Rn,{key:0},[ot("button",{onClick:e[0]||(e[0]=o=>s.setType("iri")),class:ul(["btn btn-outline-secondary",{active:s.nodeType=="iri"}]),type:"button"},"IRI",2),ot("button",{onClick:e[1]||(e[1]=o=>s.setType("literal")),class:ul(["btn btn-outline-secondary",{active:s.nodeType=="literal"}]),type:"button"},"Lit",2)],64)):ta("",!0),s.nodeType==="iri"?(ar(),hr("span",bCe,"<")):s.nodeType==="literal"?(ar(),hr("span",vCe,'"')):ta("",!0),Pi(ot("input",{id:"value-"+this.id,"onUpdate:modelValue":e[2]||(e[2]=o=>a.idValue=o),onInput:e[3]||(e[3]=(...o)=>s.notify&&s.notify(...o)),type:"text",class:"form-control"},null,40,wCe),[[ys,a.idValue]]),s.nodeType==="iri"?(ar(),hr("span",SCe,">")):s.nodeType==="literal"&&a.literalType==="language"?(ar(),hr(Rn,{key:4},[ot("span",{onClick:e[4]||(e[4]=o=>s.setLiteralType("datatype")),class:"input-group-text btn btn-outline-secondary"},'"@'),Pi(ot("input",{id:"language-"+this.id,"onUpdate:modelValue":e[5]||(e[5]=o=>a.language=o),onInput:e[6]||(e[6]=(...o)=>s.notify&&s.notify(...o)),type:"text",class:"form-control"},null,40,TCe),[[ys,a.language]])],64)):s.nodeType==="literal"&&a.literalType==="datatype"?(ar(),hr(Rn,{key:5},[ot("span",{onClick:e[7]||(e[7]=o=>s.setLiteralType("language")),class:"input-group-text btn btn-outline-secondary"},'"^^<'),Pi(ot("input",{id:"datatype-"+this.id,"onUpdate:modelValue":e[8]||(e[8]=o=>a.datatype=o),onInput:e[9]||(e[9]=(...o)=>s.notify&&s.notify(...o)),type:"text",class:"form-control"},null,40,ECe),[[ys,a.datatype]]),ACe],64)):ta("",!0)])}const RCe=fb(gCe,[["render",OCe]]),xCe={name:"GraphList",setup(){return{store:Wu()}},components:{TermInput:RCe,QueryResultList:QY},props:{graph_iri:String,selectGraph:Function},data(){return{graphs:[],new_graph_iri:Lr.namedNode(""),add_graph_modal:null}},mounted(){this.add_graph_modal=new po(this.$refs.add_graph)},methods:{async add_graph(){const t=[Lr.quad(this.new_graph_iri,Lr.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),Lr.namedNode("http://www.w3.org/2000/01/rdf-schema#Graph"))];console.log(this.new_graph_iri);try{await this.store.deleteInsertData({insertArray:t,graphIri:this.new_graph_iri.value}),this.add_graph_modal.hide()}catch(e){console.error(e)}}}},ICe={class:"modal fade",ref:"add_graph",tabindex:"-1","aria-hidden":"true","data-bs-backdrop":"static",size:"lg"},PCe={class:"modal-dialog modal-lg"},NCe={class:"modal-content"},DCe={class:"modal-header"},CCe=ot("h5",{class:"modal-title"},"Create New Graph",-1),LCe={class:"modal-body"},jCe={class:"form-group"},MCe=ot("label",{for:"new_graph_iri"},"IRI",-1),FCe={class:"modal-footer"};function qCe(t,e,n,r,a,s){const o=uC("QueryResultList"),u=uC("TermInput");return ar(),hr("div",null,[Wt(o,{title:"Graph List",search:"",query:"select distinct ?graph { graph ?graph {?s ?p ?o}} order by ?graph","query-quads":"","select-variable":"graph",ref:"classList",add:()=>{a.add_graph_modal.show()},selectResource:n.selectGraph,activeResource:n.graph_iri},null,8,["add","selectResource","activeResource"]),ot("div",ICe,[ot("div",PCe,[ot("div",NCe,[ot("div",DCe,[CCe,ot("button",{type:"button",class:"btn-close",onClick:e[0]||(e[0]=l=>a.add_graph_modal.hide()),"aria-label":"Close"})]),ot("div",LCe,[ot("form",null,[ot("div",jCe,[MCe,ot("div",null,[Wt(u,{type:"iri",id:"new_graph_iri",term:a.new_graph_iri,"onUpdate:term":e[1]||(e[1]=l=>a.new_graph_iri=l)},null,8,["term"])])])])]),ot("div",FCe,[ot("button",{type:"button",class:"btn btn-secondary",onClick:e[2]||(e[2]=l=>a.add_graph_modal.hide())},"Close"),ot("button",{type:"button",class:"btn btn-primary",onClick:e[3]||(e[3]=l=>s.add_graph())},"Save changes")])])])],512)])}const BCe=fb(xCe,[["render",qCe]]),$Ce={name:"ClassList",props:{class_iri:String,selectClass:Function},watch:{graph_iri(t){console.log("graph_iri changed"+t),this.$refs.classList.updateList()}},computed:{...hv(Da,["graph_iri"])}},UCe=Object.assign($Ce,{setup(t){return(e,n)=>(ar(),RI(QY,{title:"Class List",search:"",query:"select distinct ?class { {?s a ?class} union {?class a } union {?class a } } order by ?class","select-variable":"class",ref:"classList",activeResource:t.class_iri,selectResource:t.selectClass},null,8,["activeResource","selectResource"]))}}),ZV={name:"splitpanes",emits:["ready","resize","resized","pane-click","pane-maximize","pane-add","pane-remove","splitter-click"],props:{horizontal:{type:Boolean},pushOtherPanes:{type:Boolean,default:!0},dblClickSplitter:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean}},provide(){return{requestUpdate:this.requestUpdate,onPaneAdd:this.onPaneAdd,onPaneRemove:this.onPaneRemove,onPaneClick:this.onPaneClick}},data:()=>({container:null,ready:!1,panes:[],touch:{mouseDown:!1,dragging:!1,activeSplitter:null},splitterTaps:{splitter:null,timeoutId:null}}),computed:{panesCount(){return this.panes.length},indexedPanes(){return this.panes.reduce((t,e)=>(t[e.id]=e)&&t,{})}},methods:{updatePaneComponents(){this.panes.forEach(t=>{t.update&&t.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[t.id].size}%`})})},bindEvents(){document.addEventListener("mousemove",this.onMouseMove,{passive:!1}),document.addEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.addEventListener("touchmove",this.onMouseMove,{passive:!1}),document.addEventListener("touchend",this.onMouseUp))},unbindEvents(){document.removeEventListener("mousemove",this.onMouseMove,{passive:!1}),document.removeEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.removeEventListener("touchmove",this.onMouseMove,{passive:!1}),document.removeEventListener("touchend",this.onMouseUp))},onMouseDown(t,e){this.bindEvents(),this.touch.mouseDown=!0,this.touch.activeSplitter=e},onMouseMove(t){this.touch.mouseDown&&(t.preventDefault(),this.touch.dragging=!0,this.calculatePanesSize(this.getCurrentMouseDrag(t)),this.$emit("resize",this.panes.map(e=>({min:e.min,max:e.max,size:e.size}))))},onMouseUp(){this.touch.dragging&&this.$emit("resized",this.panes.map(t=>({min:t.min,max:t.max,size:t.size}))),this.touch.mouseDown=!1,setTimeout(()=>{this.touch.dragging=!1,this.unbindEvents()},100)},onSplitterClick(t,e){"ontouchstart"in window&&(t.preventDefault(),this.dblClickSplitter&&(this.splitterTaps.splitter===e?(clearTimeout(this.splitterTaps.timeoutId),this.splitterTaps.timeoutId=null,this.onSplitterDblClick(t,e),this.splitterTaps.splitter=null):(this.splitterTaps.splitter=e,this.splitterTaps.timeoutId=setTimeout(()=>{this.splitterTaps.splitter=null},500)))),this.touch.dragging||this.$emit("splitter-click",this.panes[e])},onSplitterDblClick(t,e){let n=0;this.panes=this.panes.map((r,a)=>(r.size=a===e?r.max:r.min,a!==e&&(n+=r.min),r)),this.panes[e].size-=n,this.$emit("pane-maximize",this.panes[e]),this.$emit("resized",this.panes.map(r=>({min:r.min,max:r.max,size:r.size})))},onPaneClick(t,e){this.$emit("pane-click",this.indexedPanes[e])},getCurrentMouseDrag(t){const e=this.container.getBoundingClientRect(),{clientX:n,clientY:r}="ontouchstart"in window&&t.touches?t.touches[0]:t;return{x:n-e.left,y:r-e.top}},getCurrentDragPercentage(t){t=t[this.horizontal?"y":"x"];const e=this.container[this.horizontal?"clientHeight":"clientWidth"];return this.rtl&&!this.horizontal&&(t=e-t),t*100/e},calculatePanesSize(t){const e=this.touch.activeSplitter;let n={prevPanesSize:this.sumPrevPanesSize(e),nextPanesSize:this.sumNextPanesSize(e),prevReachedMinPanes:0,nextReachedMinPanes:0};const r=0+(this.pushOtherPanes?0:n.prevPanesSize),a=100-(this.pushOtherPanes?0:n.nextPanesSize),s=Math.max(Math.min(this.getCurrentDragPercentage(t),a),r);let o=[e,e+1],u=this.panes[o[0]]||null,l=this.panes[o[1]]||null;const c=u.max<100&&s>=u.max+n.prevPanesSize,d=l.max<100&&s<=100-(l.max+this.sumNextPanesSize(e+1));if(c||d){c?(u.size=u.max,l.size=Math.max(100-u.max-n.prevPanesSize-n.nextPanesSize,0)):(u.size=Math.max(100-l.max-n.prevPanesSize-this.sumNextPanesSize(e+1),0),l.size=l.max);return}if(this.pushOtherPanes){const f=this.doPushOtherPanes(n,s);if(!f)return;({sums:n,panesToResize:o}=f),u=this.panes[o[0]]||null,l=this.panes[o[1]]||null}u!==null&&(u.size=Math.min(Math.max(s-n.prevPanesSize-n.prevReachedMinPanes,u.min),u.max)),l!==null&&(l.size=Math.min(Math.max(100-s-n.nextPanesSize-n.nextReachedMinPanes,l.min),l.max))},doPushOtherPanes(t,e){const n=this.touch.activeSplitter,r=[n,n+1];return e{s>r[0]&&s<=n&&(a.size=a.min,t.prevReachedMinPanes+=a.min)}),t.prevPanesSize=this.sumPrevPanesSize(r[0]),r[0]===void 0)?(t.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((a,s)=>{s>0&&s<=n&&(a.size=a.min,t.prevReachedMinPanes+=a.min)}),this.panes[r[1]].size=100-t.prevReachedMinPanes-this.panes[0].min-t.prevPanesSize-t.nextPanesSize,null):e>100-t.nextPanesSize-this.panes[r[1]].min&&(r[1]=this.findNextExpandedPane(n).index,t.nextReachedMinPanes=0,r[1]>n+1&&this.panes.forEach((a,s)=>{s>n&&s{s=n+1&&(a.size=a.min,t.nextReachedMinPanes+=a.min)}),this.panes[r[0]].size=100-t.prevPanesSize-t.nextReachedMinPanes-this.panes[this.panesCount-1].min-t.nextPanesSize,null):{sums:t,panesToResize:r}},sumPrevPanesSize(t){return this.panes.reduce((e,n,r)=>e+(re+(r>t+1?n.size:0),0)},findPrevExpandedPane(t){return[...this.panes].reverse().find(e=>e.indexe.min)||{}},findNextExpandedPane(t){return this.panes.find(e=>e.index>t+1&&e.size>e.min)||{}},checkSplitpanesNodes(){Array.from(this.container.children).forEach(t=>{const e=t.classList.contains("splitpanes__pane"),n=t.classList.contains("splitpanes__splitter");!e&&!n&&(t.parentNode.removeChild(t),console.warn("Splitpanes: Only elements are allowed at the root of . One of your DOM nodes was removed."))})},addSplitter(t,e,n=!1){const r=t-1,a=document.createElement("div");a.classList.add("splitpanes__splitter"),n||(a.onmousedown=s=>this.onMouseDown(s,r),typeof window<"u"&&"ontouchstart"in window&&(a.ontouchstart=s=>this.onMouseDown(s,r)),a.onclick=s=>this.onSplitterClick(s,r+1)),this.dblClickSplitter&&(a.ondblclick=s=>this.onSplitterDblClick(s,r+1)),e.parentNode.insertBefore(a,e)},removeSplitter(t){t.onmousedown=void 0,t.onclick=void 0,t.ondblclick=void 0,t.parentNode.removeChild(t)},redoSplitters(){const t=Array.from(this.container.children);t.forEach(n=>{n.className.includes("splitpanes__splitter")&&this.removeSplitter(n)});let e=0;t.forEach(n=>{n.className.includes("splitpanes__pane")&&(!e&&this.firstSplitter?this.addSplitter(e,n,!0):e&&this.addSplitter(e,n),e++)})},requestUpdate({target:t,...e}){const n=this.indexedPanes[t._.uid];Object.entries(e).forEach(([r,a])=>n[r]=a)},onPaneAdd(t){let e=-1;Array.from(t.$el.parentNode.children).some(a=>(a.className.includes("splitpanes__pane")&&e++,a===t.$el));const n=parseFloat(t.minSize),r=parseFloat(t.maxSize);this.panes.splice(e,0,{id:t._.uid,index:e,min:isNaN(n)?0:n,max:isNaN(r)?100:r,size:t.size===null?null:parseFloat(t.size),givenSize:t.size,update:t.update}),this.panes.forEach((a,s)=>a.index=s),this.ready&&this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({addedPane:this.panes[e]}),this.$emit("pane-add",{index:e,panes:this.panes.map(a=>({min:a.min,max:a.max,size:a.size}))})})},onPaneRemove(t){const e=this.panes.findIndex(r=>r.id===t._.uid),n=this.panes.splice(e,1)[0];this.panes.forEach((r,a)=>r.index=a),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...n,index:e}}),this.$emit("pane-remove",{removed:n,panes:this.panes.map(r=>({min:r.min,max:r.max,size:r.size}))})})},resetPaneSizes(t={}){!t.addedPane&&!t.removedPane?this.initialPanesSizing():this.panes.some(e=>e.givenSize!==null||e.min||e.max<100)?this.equalizeAfterAddOrRemove(t):this.equalize(),this.ready&&this.$emit("resized",this.panes.map(e=>({min:e.min,max:e.max,size:e.size})))},equalize(){const t=100/this.panesCount;let e=0;const n=[],r=[];this.panes.forEach(a=>{a.size=Math.max(Math.min(t,a.max),a.min),e-=a.size,a.size>=a.max&&n.push(a.id),a.size<=a.min&&r.push(a.id)}),e>.1&&this.readjustSizes(e,n,r)},initialPanesSizing(){let t=100;const e=[],n=[];let r=0;this.panes.forEach(s=>{t-=s.size,s.size!==null&&r++,s.size>=s.max&&e.push(s.id),s.size<=s.min&&n.push(s.id)});let a=100;t>.1&&(this.panes.forEach(s=>{s.size===null&&(s.size=Math.max(Math.min(t/(this.panesCount-r),s.max),s.min)),a-=s.size}),a>.1&&this.readjustSizes(t,e,n))},equalizeAfterAddOrRemove({addedPane:t,removedPane:e}={}){let n=100/this.panesCount,r=0;const a=[],s=[];t&&t.givenSize!==null&&(n=(100-t.givenSize)/(this.panesCount-1)),this.panes.forEach(o=>{r-=o.size,o.size>=o.max&&a.push(o.id),o.size<=o.min&&s.push(o.id)}),!(Math.abs(r)<.1)&&(this.panes.forEach(o=>{t&&t.givenSize!==null&&t.id===o.id||(o.size=Math.max(Math.min(n,o.max),o.min)),r-=o.size,o.size>=o.max&&a.push(o.id),o.size<=o.min&&s.push(o.id)}),r>.1&&this.readjustSizes(r,a,s))},readjustSizes(t,e,n){let r;t>0?r=t/(this.panesCount-e.length):r=t/(this.panesCount-n.length),this.panes.forEach((a,s)=>{if(t>0&&!e.includes(a.id)){const o=Math.max(Math.min(a.size+r,a.max),a.min),u=o-a.size;t-=u,a.size=o}else if(!n.includes(a.id)){const o=Math.max(Math.min(a.size+r,a.max),a.min),u=o-a.size;t-=u,a.size=o}a.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[a.id].size}%`})}),Math.abs(t)>.1&&this.$nextTick(()=>{this.ready&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints.")})}},watch:{panes:{deep:!0,immediate:!1,handler(){this.updatePaneComponents()}},horizontal(){this.updatePaneComponents()},firstSplitter(){this.redoSplitters()},dblClickSplitter(t){[...this.container.querySelectorAll(".splitpanes__splitter")].forEach((e,n)=>{e.ondblclick=t?r=>this.onSplitterDblClick(r,n):void 0})}},beforeUnmount(){this.ready=!1},mounted(){this.container=this.$refs.container,this.checkSplitpanesNodes(),this.redoSplitters(),this.resetPaneSizes(),this.$emit("ready"),this.ready=!0},render(){return II("div",{ref:"container",class:["splitpanes",`splitpanes--${this.horizontal?"horizontal":"vertical"}`,{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())}},kCe=(t,e)=>{const n=t.__vccOpts||t;for(const[r,a]of e)n[r]=a;return n},VCe={name:"pane",inject:["requestUpdate","onPaneAdd","onPaneRemove","onPaneClick"],props:{size:{type:[Number,String],default:null},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},data:()=>({style:{}}),mounted(){this.onPaneAdd(this)},beforeUnmount(){this.onPaneRemove(this)},methods:{update(t){this.style=t}},computed:{sizeNumber(){return this.size||this.size===0?parseFloat(this.size):null},minSizeNumber(){return parseFloat(this.minSize)},maxSizeNumber(){return parseFloat(this.maxSize)}},watch:{sizeNumber(t){this.requestUpdate({target:this,size:t})},minSizeNumber(t){this.requestUpdate({target:this,min:t})},maxSizeNumber(t){this.requestUpdate({target:this,max:t})}}};function HCe(t,e,n,r,a,s){return ar(),hr("div",{class:"splitpanes__pane",onClick:e[0]||(e[0]=o=>s.onPaneClick(o,t._.uid)),style:kv(t.style)},[Aae(t.$slots,"default")],4)}const T1=kCe(VCe,[["render",HCe]]),QCe={id:"app",class:"container-fluid"},zCe={class:"row connection"},GCe={key:0},WCe={key:1},KCe={key:0,class:"row"},JCe={class:"nav nav-tabs"},XCe={class:"nav-item"},YCe={class:"nav-item"},ZCe={class:"nav-item"},e4e={class:"nav-item"},t4e={class:"nav-item"},r4e={class:"nav-item"},n4e={class:"nav-item"},i4e={key:1},a4e={name:"App",setup(){return{store:Wu()}},computed:{...hv(Wu,{store_ready:t=>t.ready}),...hv(Da,["graph_iri","resource_iri"])}},s4e=Object.assign(a4e,{setup(t){return(e,n)=>(ar(),hr("div",QCe,[ot("div",zCe,[e.store_ready?(ar(),hr("div",GCe,"🟢 Store is ready")):(ar(),hr("div",WCe,"🔄 Loading")),Wt(ZDe)]),e.store_ready?(ar(),hr("div",KCe,[Wt(Dr(ZV),{class:"default-theme"},{default:ai(()=>[Wt(Dr(T1),{size:"30"},{default:ai(()=>[Wt(Dr(ZV),{horizontal:"",style:{height:"80vh"}},{default:ai(()=>[Wt(Dr(T1),{size:"30"},{default:ai(()=>[Wt(BCe,{graph_iri:e.graph_iri,selectGraph:r=>{Dr(Da)().changeGraphIri(r),Dr(Da)().changeResourceIri(r)}},null,8,["graph_iri","selectGraph"])]),_:1}),Wt(Dr(T1),{size:"70"},{default:ai(()=>[Wt(UCe,{class_iri:e.resource_iri,selectClass:r=>{Dr(Da)().changeResourceIri(r)}},null,8,["class_iri","selectClass"])]),_:1})]),_:1})]),_:1}),Wt(Dr(T1),{size:"90"},{default:ai(()=>[ot("ul",JCe,[ot("li",XCe,[Wt(Dr(Ks),{class:"nav-link","active-class":"active",to:"/dashboard"},{default:ai(()=>[Gs("Home")]),_:1})]),ot("li",YCe,[Wt(Dr(Ks),{class:"nav-link","active-class":"active",to:"/instances"},{default:ai(()=>[Gs("Instances")]),_:1})]),ot("li",ZCe,[Wt(Dr(Ks),{class:"nav-link","active-class":"active",to:"/voc"},{default:ai(()=>[Gs("Vocabulary")]),_:1})]),ot("li",e4e,[Wt(Dr(Ks),{class:"nav-link","active-class":"active",to:"/edit"},{default:ai(()=>[Gs("Edit")]),_:1})]),ot("li",t4e,[Wt(Dr(Ks),{class:"nav-link","active-class":"active",to:"/form"},{default:ai(()=>[Gs("Form")]),_:1})]),ot("li",r4e,[Wt(Dr(Ks),{class:"nav-link","active-class":"active",to:"/add"},{default:ai(()=>[Gs("Add")]),_:1})]),ot("li",n4e,[Wt(Dr(Ks),{class:"nav-link","active-class":"active",to:"/source"},{default:ai(()=>[Gs("Source")]),_:1})])]),Wt(Dr(wz))]),_:1})]),_:1})])):(ar(),hr("div",i4e," Waiting for Store to be configured … "))]))}}),o4e=fb(s4e,[["__scopeId","data-v-ef9edd2d"]]),u4e="modulepreload",c4e=function(t,e){return new URL(t,e).href},eH={},zs=function(e,n,r){let a=Promise.resolve();if(n&&n.length>0){const s=document.getElementsByTagName("link"),o=document.querySelector("meta[property=csp-nonce]"),u=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));a=Promise.all(n.map(l=>{if(l=c4e(l,r),l in eH)return;eH[l]=!0;const c=l.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(!!r)for(let p=s.length-1;p>=0;p--){const m=s[p];if(m.href===l&&(!c||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${d}`))return;const h=document.createElement("link");if(h.rel=c?"stylesheet":u4e,c||(h.as="script",h.crossOrigin=""),h.href=l,u&&h.setAttribute("nonce",u),document.head.appendChild(h),c)return new Promise((p,m)=>{h.addEventListener("load",p),h.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${l}`)))})}))}return a.then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})},zY=Voe({history:voe("./"),routes:[{path:"/",redirect:{path:"/dashboard"}},{path:"/about",name:"about",component:()=>zs(()=>import("./AboutView-qWIyL1Yy.js"),[],import.meta.url)},{path:"/dashboard",name:"DashboardView",component:()=>zs(()=>import("./DashboardView-DcVz4jBx.js"),__vite__mapDeps([0,1,2,3]),import.meta.url)},{path:"/instances",name:"InstanceList",component:()=>zs(()=>import("./InstanceList-DoIEMcR8.js"),[],import.meta.url)},{path:"/voc",name:"VocPad",component:()=>zs(()=>import("./VocPad-Ccm15vTJ.js"),__vite__mapDeps([4,5]),import.meta.url)},{path:"/edit",name:"EditForm",component:()=>zs(()=>import("./EditForm-Blgk6tMk.js"),__vite__mapDeps([6,5]),import.meta.url)},{path:"/form",name:"FormDemo",component:()=>zs(()=>import("./FormDemo-B-6k6oiB.js"),__vite__mapDeps([7,1,2]),import.meta.url)},{path:"/add",name:"InputForm",component:()=>zs(()=>import("./InputForm-BkXAP2gv.js"),[],import.meta.url)},{path:"/source",name:"Source",component:()=>zs(()=>import("./Source-DTEjL7Kq.js"),__vite__mapDeps([8,5]),import.meta.url)}]});zY.beforeEach(t=>{Wu()});const GN=Cse(o4e);GN.use(Fse());GN.use(zY);GN.mount("#app");export{Aae as A,ul as B,Gs as C,Pi as D,ys as E,Rn as F,d4e as G,po as H,eCe as I,p4e as J,d_ as K,As as L,ZV as M,P8e as N,D8e as O,C8e as P,iNe as Q,QY as R,uNe as S,RCe as T,P as U,tr as V,fb as _,ot as a,Da as b,hr as c,Wt as d,Eae as e,Lr as f,ta as g,Dr as h,T1 as i,rae as j,bR as k,BQ as l,hv as m,RI as n,ar as o,tae as p,N8e as q,uC as r,f4e as s,YD as t,Wu as u,kv as v,ai as w,Wg as x,h4e as y,mae as z}; diff --git a/pad/assets/n3-compare-B4Bu77vD.js b/pad/assets/n3-compare-Q4z2T_H1.js similarity index 99% rename from pad/assets/n3-compare-B4Bu77vD.js rename to pad/assets/n3-compare-Q4z2T_H1.js index 8aee589..8978918 100644 --- a/pad/assets/n3-compare-B4Bu77vD.js +++ b/pad/assets/n3-compare-Q4z2T_H1.js @@ -1,4 +1,4 @@ -import{U as fe,V as ll}from"./index-CWflGvq2.js";var er={exports:{}};/** +import{U as fe,V as ll}from"./index-DjCaYEkD.js";var er={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors diff --git a/pad/index.html b/pad/index.html index 134e225..e83ab40 100644 --- a/pad/index.html +++ b/pad/index.html @@ -70,7 +70,7 @@ Vite App - +