rdflib 2.2.27 → 2.2.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see rdflib.min.js.LICENSE.txt */
2
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("window")):"function"==typeof define&&define.amd?define(["window"],e):"object"==typeof exports?exports.$rdf=e(require("window")):t.$rdf=e(t.window)}(self,(t=>(()=>{var e,r,n,i,o={8333:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n={Literal:1,Collection:3,Graph:4,NamedNode:5,BlankNode:6,Variable:7}},7308:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n={debug:function(t){},warn:function(t){},info:function(t){},error:function(t){},success:function(t){},msg:function(t){}}},6545:(t,e,r)=>{"use strict";r.d(e,{Z:()=>y});var n=r(7061),i=r(9900),o=r(4771),a=r(4768),s=r(4593),u=r(886),c=r(240),l=r(8333),h=r(4806),f=r(9247),p=r(2598),d=r(5904);var y=function(t){(0,a.Z)(y,t);var e,r,h=(e=y,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,n=(0,u.Z)(e);if(r){var i=(0,u.Z)(this).constructor;t=Reflect.construct(n,arguments,i)}else t=n.apply(this,arguments);return(0,s.Z)(this,t)});function y(t){var e;if((0,n.Z)(this,y),e=h.call(this,(0,p._)(t)),(0,c.Z)((0,o.Z)(e),"termType",f.XM),(0,c.Z)((0,o.Z)(e),"classOrder",l.Z.NamedNode),!e.value)throw new Error("Missing IRI for NamedNode");if(!e.value.includes(":"))throw new Error('NamedNode IRI "'+t+'" must be absolute.');if(e.value.includes(" "))throw new Error('Error: NamedNode IRI "'+t+'" must not contain unencoded spaces.');return e}return(0,i.Z)(y,[{key:"dir",value:function(){var t=this.value.split("#")[0],e=t.slice(0,-1).lastIndexOf("/"),r=t.indexOf("//");return r>=0&&e<r+2||e<0?null:new y(t.slice(0,e+1))}},{key:"site",value:function(){var t=this.value.split("#")[0],e=t.indexOf("//");if(e<0)throw new Error("This URI does not have a web site part (origin)");var r=t.indexOf("/",e+2);return new y(r<0?t.slice(0)+"/":t.slice(0,r+1))}},{key:"doc",value:function(){return this.value.indexOf("#")<0?this:new y(this.value.split("#")[0])}},{key:"toString",value:function(){return"<"+this.value+">"}},{key:"id",value:function(){return this.value.split("#")[1]}},{key:"uri",get:function(){return this.value},set:function(t){this.value=t}}],[{key:"fromValue",value:function(t){return null==t||(0,d.jt)(t)?t:new y(t)}}]),y}(h.Z)},4806:(t,e,r)=>{"use strict";r.d(e,{Z:()=>s});var n=r(7061),i=r(9900),o=r(240),a=r(292),s=function(){function t(e){(0,n.Z)(this,t),(0,o.Z)(this,"termType",void 0),(0,o.Z)(this,"classOrder",void 0),(0,o.Z)(this,"value",void 0),this.value=e}return(0,i.Z)(t,[{key:"substitute",value:function(t){return a.log("@@@ node substitute"+this),this}},{key:"compareTerm",value:function(t){return this.classOrder<t.classOrder?-1:this.classOrder>t.classOrder?1:this.value<t.value?-1:this.value>t.value?1:0}},{key:"equals",value:function(t){return!!t&&this.termType===t.termType&&this.value===t.value}},{key:"hashString",value:function(){return this.toCanonical()}},{key:"sameTerm",value:function(t){return this.equals(t)}},{key:"toCanonical",value:function(){return this.toNT()}},{key:"toNT",value:function(){return this.toString()}},{key:"toNQ",value:function(){return this.toNT()}},{key:"toString",value:function(){throw new Error("Node.toString() is abstract - see the subclasses instead")}}]),t}();(0,o.Z)(s,"fromValue",void 0),(0,o.Z)(s,"toJS",void 0)},9247:(t,e,r)=>{"use strict";r.d(e,{D7:()=>T,Eo:()=>_,Is:()=>m,NK:()=>s,UH:()=>a,V1:()=>i,XM:()=>n,_A:()=>l,aV:()=>g,b4:()=>v,fb:()=>u,lL:()=>y,ls:()=>c,oW:()=>b,qS:()=>p,sZ:()=>d,ui:()=>f,us:()=>h,xH:()=>o,xm:()=>w,z8:()=>x});var n="NamedNode",i="BlankNode",o="Literal",a="Variable",s="DefaultGraph",u="Collection",c="Empty",l="Graph",h="text/html",f="application/ld+json",p="text/n3",d="application/n3",y="application/nquads",v="application/n-quads",g="application/n-triples",m="application/rdf+xml",b="application/sparql-update",w="application/sparql-update-single-match",x="text/turtle",_="application/x-turtle",T="application/xhtml+xml"},3357:(t,e,r)=>{"use strict";r.r(e),r.d(e,{docpart:()=>a,document:()=>s,hostpart:()=>u,join:()=>c,protocol:()=>l,refTo:()=>h});var n=r(6545),i=r(292),o=o||i.log;function a(t){var e;return(e=t.indexOf("#"))<0?t:t.slice(0,e)}function s(t){return new n.Z(a(t))}function u(t){var e=/[^\/]*\/\/([^\/]*)\//.exec(t);return e?e[1]:""}function c(t,e){var r,n,i,a,s,u=e.indexOf("#");if(u>0&&(e=e.slice(0,u)),0===t.length)return e;if(0===t.indexOf("#"))return e+t;if(t.indexOf(":")>=0)return t;if(r=e.indexOf(":"),0===e.length)return t;if(r<0)return o("Invalid base: "+e+" in join with given: "+t),t;if(n=e.slice(0,+r+1||9e9),0===t.indexOf("//"))return n+t;if(e.indexOf("//",r)===r+1){if((i=e.indexOf("/",r+3))<0)return e.length-r-3>0?e+"/"+t:n+t}else if((i=e.indexOf("/",r+1))<0)return e.length-r-1>0?e+"/"+t:n+t;if(0===t.indexOf("/"))return e.slice(0,i)+t;if((a=(s=e.slice(i)).lastIndexOf("/"))<0)return n+t;for(a>=0&&a<s.length-1&&(s=s.slice(0,+a+1||9e9)),s+=t;s.match(/[^\/]*\/\.\.\//);)s=s.replace(/[^\/]*\/\.\.\//,"");return s=(s=s.replace(/\.\//g,"")).replace(/\/\.$/,"/"),e.slice(0,i)+s}function l(t){var e=t.indexOf(":");return e<0?null:t.slice(0,e)}function h(t,e){var r,n,i,o,a,s,u,c,l,h,f,p,d=new RegExp("^[-_a-zA-Z0-9.]+:(//[^/]*)?/[^/]*$");if(!t)return e;if(t===e)return"";for(r=u=0,o=e.length;u<o&&e[r]===t[r];r=++u);if(t.slice(0,r).match(d)&&((n=e.indexOf("//"))<0&&(n=-2),i=e.indexOf("/",n+2),"/"!==e[i+1]&&"/"!==t[i+1]&&e.slice(0,i)===t.slice(0,i)))return e.slice(i);if("#"===e[r]&&t.length===r)return e.slice(r);for(;r>0&&"/"!==e[r-1];)r--;if(r<3)return e;if(t.indexOf("//",r-2)>0||e.indexOf("//",r-2)>0)return e;if(t.indexOf(":",r)>0)return e;for(s=0,c=0,a=(h=t.slice(r)).length;c<a;c++)"/"===h[c]&&s++;if(0===s&&r<e.length&&"#"===e[r])return"./"+e.slice(r);if(0===s&&r===e.length)return"./";if(p="",s>0)for(l=1,f=s;f>=1?l<=f:l>=f;f>=1?++l:--l)p+="../";return p+e.slice(r)}},5115:(t,e,r)=>{"use strict";r.r(e),r.d(e,{DOMParserFactory:()=>f,RDFArrayRemove:()=>w,callbackify:()=>h,domToString:()=>p,dtstamp:()=>y,dumpNode:()=>d,heavyCompare:()=>v,heavyCompareSPO:()=>g,linkRelationProperty:()=>l,log:()=>n.Z,mediaTypeClass:()=>c,output:()=>m,parseXML:()=>b,stackString:()=>_,string:()=>u,string_startswith:()=>x,uri:()=>i});var n=r(7308),i=r(3357),o=r(6545),a=r(870);t=r.hmd(t);var s=r(292),u={template:function(t,e){for(var r=t.split("%s"),n="",i=0;i<e.length;i++)e[i]+="",n+=r[i]+e[i];return n+r.slice(e.length).join()}};function c(t){return t=t.split(";")[0].trim(),new o.Z("http://www.w3.org/ns/iana/media-types/"+t+"#Resource")}function l(t){return new o.Z("http://www.w3.org/ns/iana/link-relations/relation#"+t.trim())}function h(t,e){t.callbacks={};for(var r=e.length-1;r>=0;r--)t.callbacks[e[r]]=[];t.addHook=function(e){t.callbacks[e]||(t.callbacks[e]=[])},t.addCallback=function(e,r){t.callbacks[e].push(r)},t.removeCallback=function(e,r){for(var n=0;n<t.callbacks[e].length;n++)if(t.callbacks[e][n].name===r)return t.callbacks[e].splice(n,1),!0;return!1},t.insertCallback=function(e,r){t.callbacks[e].unshift(r)},t.fireCallbacks=function(e,r){var n,i,o=[],a=[],s=t.callbacks[e].length;for(n=s-1;n>=0;n--)(i=t.callbacks[e][n])&&i.apply(t,r)&&o.push(i);for(n=o.length-1;n>=0;n--)a.push(o[n]);for(n=s;n<t.callbacks[e].length;n++)a.push(t.callbacks[e][n]);t.callbacks[e]=a}}function f(){return window.DOMParser?new a.DOMParser:!!window.ActiveXObject&&new ActiveXObject("Microsoft.XMLDOM")}function p(t,e){var r=[];(e=e||{})&&e.selfClosing&&e.selfClosing.split(" ").forEach((function(t){r[t]=!0}));var n=[];return e&&e.skipAttributes&&e.skipAttributes.split(" ").forEach((function(t){n[t]=!0})),d(t,e,r,n)}function d(t,e,r,n){var i,o="",a=[!1];if(void 0===t.nodeType)return o;if(1===t.nodeType){if(t.hasAttribute("class")&&e&&e.classWithChildText&&t.matches(e.classWithChildText.class))o+=t.querySelector(e.classWithChildText.element).textContent;else if(!(e&&e.skipNodeWithClass&&t.matches("."+e.skipNodeWithClass))){var u=t.nodeName.toLowerCase();o+="<"+u;var c=[];for(i=t.attributes.length-1;i>=0;i--){var l=t.attributes[i];if(!(n&&n.length>0&&n[l.name]||/^\d+$/.test(l.name))){if("class"===l.name&&e&&e.replaceClassItemWith&&l.value.split(" ").indexOf(e.replaceClassItemWith.source)>-1){var h=new RegExp(e.replaceClassItemWith.source,"g");l.value=l.value.replace(h,e.replaceClassItemWith.target).trim()}"class"===l.name&&e&&e.skipClassWithValue&&e.skipClassWithValue===l.value||c.push(l.name+"='"+l.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&quot;")+"'")}}if(c.length>0&&(e&&e.sortAttributes&&c.sort((function(t,e){return t.toLowerCase().localeCompare(e.toLowerCase())})),o+=" "+c.join(" ")),r&&r.ename)o+=" />";else{for(o+=">",o+="html"===u?"\n ":"",a.push("style"===u||"script"===u),i=0;i<t.childNodes.length;i++)o+=d(t.childNodes[i]);a.pop(),o+="body"===u?"</"+u+">\n":"</"+u+">"}}}else if(8===t.nodeType)o+="\x3c!--"+t.nodeValue+"--\x3e";else if(3===t.nodeType||4===t.nodeType){var f=t.nodeValue.replace(/\n+$/,"");o+=a[a.length-1]?f:f.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}else s.log("Warning; Cannot handle serialising nodes of type: "+t.nodeType),s.log(t);return o}function y(){var t=new Date,e=t.getYear()+1900,r=t.getMonth()+1,n=t.getDate(),i=t.getUTCHours(),o=t.getUTCMinutes(),a=t.getSeconds();return r<10&&(r="0"+r),n<10&&(n="0"+n),i<10&&(i="0"+i),o<10&&(o="0"+o),a<10&&(a="0"+a),e+"-"+r+"-"+n+"T"+i+":"+o+":"+a+"Z"}function v(t,e,r,n){var i=function(t){return"BlankNode"===t.termType?null:t},o=function(t){var e=r.statementsMatching(t).map((function(t){return i(t.subject)+" "+i(t.predicate)+" "+i(t.object)})).concat(r.statementsMatching(void 0,void 0,t).map((function(t){return i(t.subject)+" "+i(t.predicate)+" "+i(t.object)})));return e.sort(),e.join("\n")},a=Object.prototype.hasOwnProperty.call(r,"compareTerms")?r.compareTerms(t,e):t.compareTerm(e);return"BlankNode"===t.termType&&"BlankNode"===e.termType?0===a?0:o(t)>o(e)?1:o(t)<o(e)?-1:a:n&&t.uri&&e.uri?(n[t.uri]||t.uri).localeCompare(n[e.uri]||e.uri):a}function g(t,e,r,n){return v(t.subject,e.subject,r,n)||v(t.predicate,e.predicate,r,n)||v(t.object,e.object,r,n)}function m(t){var e=document.createElement("div");e.textContent=t,document.body.appendChild(e)}function b(e,r){return r=r||{},t&&t.exports?(new a.DOMParser).parseFromString(e,r.contentType||"application/xhtml+xml"):("undefined"!=typeof window&&window.DOMParser?new window.DOMParser:new a.DOMParser).parseFromString(e,"application/xml")}function w(t,e){for(var r=0;r<t.length;r++)if(t[r].subject.equals(e.subject)&&t[r].predicate.equals(e.predicate)&&t[r].object.equals(e.object)&&t[r].why.equals(e.why))return void t.splice(r,1);throw new Error("RDFArrayRemove: Array did not contain "+e+" "+e.why)}function x(t,e){return t.slice(0,e.length)===e}function _(t){var e=t+"\n";if(!t.stack)return e+"No stack available.\n";for(var r=t.stack.toString().split("\n"),n=[],i=0;i<r.length;i++){var o=r[i];if(o.indexOf("ecmaunit.js")>-1)break;"("==o.charAt(0)&&(o="function"+o);var a=o.split("@");n.push(a)}for(i=0;i<n.length;i++)e+=" "+n[i][1]+"\n "+n[i][0];return e}},2598:(t,e,r)=>{"use strict";function n(t){return"string"==typeof t?t:t.value}r.d(e,{_:()=>n})},5904:(t,e,r)=>{"use strict";r.d(e,{B2:()=>v,NA:()=>w,NX:()=>y,PY:()=>d,Pv:()=>a,Uc:()=>u,Yi:()=>o,cG:()=>h,f:()=>c,jt:()=>f,lt:()=>b,lx:()=>m,n_:()=>p,nq:()=>l,uZ:()=>s,zz:()=>g});var n=r(7209),i=r(9247);function o(t){return"object"===(0,n.Z)(t)&&null!==t&&"subject"in t}function a(t){return"object"===(0,n.Z)(t)&&null!==t&&"statements"in t}function s(t){return f(t)&&t.termType===i.fb}function u(t){return t&&Object.prototype.hasOwnProperty.call(t,"termType")&&(t.termType===i.XM||t.termType===i.UH||t.termType===i.V1||t.termType===i.fb||t.termType===i.xH||t.termType===i._A)}function c(t){return t&&Object.prototype.hasOwnProperty.call(t,"termType")&&(t.termType===i.XM||t.termType===i.UH||t.termType===i.V1||t.termType===i.fb||t.termType===i.xH||t.termType===i._A)}function l(t){return f(t)&&(t.termType===i.XM||t.termType===i.V1||t.termType===i.UH)}function h(t){return f(t)&&t.termType===i.UH}function f(t){return"object"===(0,n.Z)(t)&&null!==t&&"termType"in t}function p(t){return t.termType===i.xH}function d(t){return"object"===(0,n.Z)(t)&&null!==t&&"subject"in t&&"predicate"in t&&"object"in t}function y(t){return f(t)&&"NamedNode"===t.termType}function v(t){return f(t)&&"termType"in t&&"BlankNode"===t.termType}function g(t){return f(t)&&(t.termType===i.XM||t.termType===i.UH||t.termType===i.V1)}function m(t){return f(t)&&(t.termType===i.XM||t.termType===i.UH)}function b(t){return f(t)&&(t.termType===i.XM||t.termType===i.UH||t.termType===i.V1||t.termType===i.xH)}function w(t){return f(t)&&(t.termType===i.XM||t.termType===i.UH||t.termType===i.V1||t.termType===i.NK)}},5619:function(t,e,r){var n,i;void 0===(i="function"==typeof(n=function(){"use strict";function t(e,r,n,i){this.message=e,this.expected=r,this.found=n,this.location=i,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,t)}return function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(t,Error),t.buildMessage=function(t,e){var r={literal:function(t){return'"'+i(t.text)+'"'},class:function(t){var e,r="";for(e=0;e<t.parts.length;e++)r+=t.parts[e]instanceof Array?o(t.parts[e][0])+"-"+o(t.parts[e][1]):o(t.parts[e]);return"["+(t.inverted?"^":"")+r+"]"},any:function(t){return"any character"},end:function(t){return"end of input"},other:function(t){return t.description}};function n(t){return t.charCodeAt(0).toString(16).toUpperCase()}function i(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}function o(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}return"Expected "+function(t){var e,n,i,o=new Array(t.length);for(e=0;e<t.length;e++)o[e]=(i=t[e],r[i.type](i));if(o.sort(),o.length>0){for(e=1,n=1;e<o.length;e++)o[e-1]!==o[e]&&(o[n]=o[e],n++);o.length=n}switch(o.length){case 1:return o[0];case 2:return o[0]+" or "+o[1];default:return o.slice(0,-1).join(", ")+", or "+o[o.length-1]}}(t)+" but "+function(t){return t?'"'+i(t)+'"':"end of input"}(e)+" found."},{SyntaxError:t,parse:function(e,n){n=void 0!==n?n:{};var i,o={},a={turtleDoc:Ue},s=Ue,u=".",c=Re(".",!1),l=Re("#",!1),h=/^[^\n]/,f=Ie(["\n"],!0,!1),p=Re("\n",!1),d=function(t){return t.join("")},y="@prefix",v=Re("@prefix",!1),g=function(t,e){return hr.addPrefix(""===t?"0":t,e),{}},m="@base",b=Re("@base",!1),w=function(t){return hr.addBase(t),{}},x=/^[Bb]/,_=Ie(["B","b"],!1,!1),T=/^[Aa]/,k=Ie(["A","a"],!1,!1),A=/^[Ss]/,E=Ie(["S","s"],!1,!1),O=/^[Ee]/,j=Ie(["E","e"],!1,!1),N=/^[Pp]/,S=Ie(["P","p"],!1,!1),R=/^[Rr]/,I=Ie(["R","r"],!1,!1),C=/^[Ff]/,P=Ie(["F","f"],!1,!1),F=/^[Ii]/,U=Ie(["I","i"],!1,!1),L=/^[Xx]/,D=Ie(["X","x"],!1,!1),M=Re(";",!1),Z=function(t,e,r,n){var i={};return i[r]=n,i},B=function(t,e,r){return r},q=Re(",",!1),H=function(t,e){return e},$=Re("a",!1),z=Re("[",!1),X=Re("]",!1),V=Re("(",!1),G=Re(")",!1),W="^^",Q=Re("^^",!1),Y="true",J=Re("true",!1),K="false",tt=Re("false",!1),et=Re("<",!1),rt=/^[^\0- <>"{}|\^`\\]/,nt=Ie([["\0"," "],"<",">",'"',"{","}","|","^","`","\\"],!0,!1),it=Re(">",!1),ot=":",at=Re(":",!1),st="_:",ut=Re("_:",!1),ct=/^[0-9]/,lt=Ie([["0","9"]],!1,!1),ht=Re("@",!1),ft=/^[a-zA-Z]/,pt=Ie([["a","z"],["A","Z"]],!1,!1),dt="-",yt=Re("-",!1),vt=/^[a-zA-Z0-9]/,gt=Ie([["a","z"],["A","Z"],["0","9"]],!1,!1),mt=function(t,e){return"-"+e.join("")},bt=/^[+\-]/,wt=Ie(["+","-"],!1,!1),xt=/^[eE]/,_t=Ie(["e","E"],!1,!1),Tt='"',kt=Re('"',!1),At=/^[^"\\\n\r]/,Et=Ie(['"',"\\","\n","\r"],!0,!1),Ot="'",jt=Re("'",!1),Nt=/^[^'\\\n\r]/,St=Ie(["'","\\","\n","\r"],!0,!1),Rt="'''",It=Re("'''",!1),Ct=/^[^'\\]/,Pt=Ie(["'","\\"],!0,!1),Ft="''",Ut=Re("''",!1),Lt=function(t,e){return"''"+e.join("")},Dt=function(t,e){return"'"+e.join("")},Mt=function(t,e){return t.join("")+e.join("")},Zt='"""',Bt=Re('"""',!1),qt=/^[^"\\]/,Ht=Ie(['"',"\\"],!0,!1),$t='""',zt=Re('""',!1),Xt=function(t,e){return'""'+e.join("")},Vt=function(t,e){return'"'+e.join("")},Gt=Re("\\U",!1),Wt=Re("\\u",!1),Qt=Re("\\t",!1),Yt=Re("\\b",!1),Jt=Re("\\n",!1),Kt=Re("\\r",!1),te=Re("\\f",!1),ee=Re('\\"',!1),re=Re("\\'",!1),ne=Re("\\\\",!1),ie=/^[ \t\r\n]/,oe=Ie([" ","\t","\r","\n"],!1,!1),ae=/^[\uD800-\uDBFF]/,se=Ie([["\ud800","\udbff"]],!1,!1),ue=/^[\uDC00-\uDFFF]/,ce=Ie([["\udc00","\udfff"]],!1,!1),le=/^[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]/,he=Ie([["A","Z"],["a","z"],["À","Ö"],["Ø","ö"],["ø","˿"],["Ͱ","ͽ"],["Ϳ","῿"],["‌","‍"],["⁰","↏"],["Ⰰ","⿯"],["、","퟿"],["豈","﷏"],["ﷰ","�"]],!1,!1),fe=Re("_",!1),pe=Re("·",!1),de=/^[\u0300-\u036F]/,ye=Ie([["̀","ͯ"]],!1,!1),ve=/^[\u203F-\u2040]/,ge=Ie([["‿","⁀"]],!1,!1),me=function(t,e,r,n){return r.join("")+n.join("")},be=Re("%",!1),we=/^[0-9A-Fa-f]/,xe=Ie([["0","9"],["A","F"],["a","f"]],!1,!1),_e=Re("\\",!1),Te=/^[_~.!$&'()*+,;=\/?#@%\-]/,ke=Ie(["_","~",".","!","$","&","'","(",")","*","+",",",";","=","/","?","#","@","%","-"],!1,!1),Ae=0,Ee=0,Oe=[{line:1,column:1}],je=0,Ne=[];if("startRule"in n){if(!(n.startRule in a))throw new Error("Can't start parsing from rule \""+n.startRule+'".');s=a[n.startRule]}function Se(e,r){throw function(e,r){return new t(e,null,null,r)}(e,r=void 0!==r?r:Pe(Ee,Ae))}function Re(t,e){return{type:"literal",text:t,ignoreCase:e}}function Ie(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function Ce(t){var r,n=Oe[t];if(n)return n;for(r=t-1;!Oe[r];)r--;for(n={line:(n=Oe[r]).line,column:n.column};r<t;)10===e.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return Oe[t]=n,n}function Pe(t,e){var r=Ce(t),n=Ce(e);return{start:{offset:t,line:r.line,column:r.column},end:{offset:e,line:n.line,column:n.column}}}function Fe(t){Ae<je||(Ae>je&&(je=Ae,Ne=[]),Ne.push(t))}function Ue(){var t,e,r,n,i,a;for(t=Ae,e=[],r=Le();r!==o;)e.push(r),r=Le();if(e!==o){for(r=[],n=De();n!==o;)r.push(n),n=De();r!==o?(Ee=t,i=e,(a=hr.toJSON())["@graph"]=[],i.filter((t=>Array.isArray(t))).forEach((t=>{t.forEach((t=>{a["@graph"].push(t)}))})),1===a["@graph"].length&&(Object.assign(a,a["@graph"][0]),delete a["@graph"]),t=e=a):(Ae=t,t=o)}else Ae=t,t=o;return t}function Le(){var t,r,n,i;if((t=function(){var t;return(t=function(){var t,r,n,i,a,s,l,h,f;for(t=Ae,r=[],n=De();n!==o;)r.push(n),n=De();if(r!==o)if(e.substr(Ae,7)===y?(n=y,Ae+=7):(n=o,Fe(v)),n!==o){for(i=[],a=De();a!==o;)i.push(a),a=De();if(i!==o)if((a=Qe())!==o){for(s=[],l=De();l!==o;)s.push(l),l=De();if(s!==o)if((l=Ge())!==o){for(h=[],f=De();f!==o;)h.push(f),f=De();h!==o?(46===e.charCodeAt(Ae)?(f=u,Ae++):(f=o,Fe(c)),f!==o?(Ee=t,t=r=g(a,l)):(Ae=t,t=o)):(Ae=t,t=o)}else Ae=t,t=o;else Ae=t,t=o}else Ae=t,t=o;else Ae=t,t=o}else Ae=t,t=o;else Ae=t,t=o;return t}())===o&&(t=function(){var t,r,n,i,a,s,l;for(t=Ae,r=[],n=De();n!==o;)r.push(n),n=De();if(r!==o)if(e.substr(Ae,5)===m?(n=m,Ae+=5):(n=o,Fe(b)),n!==o){for(i=[],a=De();a!==o;)i.push(a),a=De();if(i!==o)if((a=Ge())!==o){for(s=[],l=De();l!==o;)s.push(l),l=De();s!==o?(46===e.charCodeAt(Ae)?(l=u,Ae++):(l=o,Fe(c)),l!==o?(Ee=t,t=r=w(a)):(Ae=t,t=o)):(Ae=t,t=o)}else Ae=t,t=o;else Ae=t,t=o}else Ae=t,t=o;else Ae=t,t=o;return t}())===o&&(t=function(){var t,r,n,i,a,s,u,c,l,h,f,p;for(t=Ae,r=[],n=De();n!==o;)r.push(n),n=De();if(r!==o)if(N.test(e.charAt(Ae))?(n=e.charAt(Ae),Ae++):(n=o,Fe(S)),n!==o)if(R.test(e.charAt(Ae))?(i=e.charAt(Ae),Ae++):(i=o,Fe(I)),i!==o)if(O.test(e.charAt(Ae))?(a=e.charAt(Ae),Ae++):(a=o,Fe(j)),a!==o)if(C.test(e.charAt(Ae))?(s=e.charAt(Ae),Ae++):(s=o,Fe(P)),s!==o)if(F.test(e.charAt(Ae))?(u=e.charAt(Ae),Ae++):(u=o,Fe(U)),u!==o)if(L.test(e.charAt(Ae))?(c=e.charAt(Ae),Ae++):(c=o,Fe(D)),c!==o){for(l=[],h=De();h!==o;)l.push(h),h=De();if(l!==o)if((h=Qe())!==o){for(f=[],p=De();p!==o;)f.push(p),p=De();f!==o&&(p=Ge())!==o?(Ee=t,t=r=g(h,p)):(Ae=t,t=o)}else Ae=t,t=o;else Ae=t,t=o}else Ae=t,t=o;else Ae=t,t=o;else Ae=t,t=o;else Ae=t,t=o;else Ae=t,t=o;else Ae=t,t=o;else Ae=t,t=o;return t}())===o&&(t=function(){var t,r,n,i,a,s,u,c;for(t=Ae,r=[],n=De();n!==o;)r.push(n),n=De();if(r!==o)if(x.test(e.charAt(Ae))?(n=e.charAt(Ae),Ae++):(n=o,Fe(_)),n!==o)if(T.test(e.charAt(Ae))?(i=e.charAt(Ae),Ae++):(i=o,Fe(k)),i!==o)if(A.test(e.charAt(Ae))?(a=e.charAt(Ae),Ae++):(a=o,Fe(E)),a!==o)if(O.test(e.charAt(Ae))?(s=e.charAt(Ae),Ae++):(s=o,Fe(j)),s!==o){for(u=[],c=De();c!==o;)u.push(c),c=De();u!==o&&(c=Ge())!==o?(Ee=t,t=r=w(c)):(Ae=t,t=o)}else Ae=t,t=o;else Ae=t,t=o;else Ae=t,t=o;else Ae=t,t=o;else Ae=t,t=o;return t}()),t}())===o)if(t=Ae,(r=function(){var t,e,r;return t=Ae,(e=function(){var t,e;return t=Ae,(e=$e())!==o&&(Ee=t,r=e,e=fr(r,!0)),(t=e)===o&&(t=Ve())===o&&(t=Xe()),t;var r}())!==o&&(r=Me())!==o?(Ee=t,n=e,i=r,a={},"string"==typeof n&&"[]"!==n?a["@id"]=n:"object"==typeof n&&Object.assign(a,n),i&&Object.assign(a,i),t=e=[a]):(Ae=t,t=o),t===o&&(t=Ae,(e=He())!==o?((r=Me())===o&&(r=null),r!==o?(Ee=t,t=e=function(t,e){var r={};return t&&Object.assign(r,t),e&&Object.assign(r,e),[r]}(e,r)):(Ae=t,t=o)):(Ae=t,t=o)),t;var n,i,a}())!==o){for(n=[],i=De();i!==o;)n.push(i),i=De();n!==o?(46===e.charCodeAt(Ae)?(i=u,Ae++):(i=o,Fe(c)),i!==o?(Ee=t,t=r):(Ae=t,t=o)):(Ae=t,t=o)}else Ae=t,t=o;return t}function De(){var t;return(t=function(){var t;return ie.test(e.charAt(Ae))?(t=e.charAt(Ae),Ae++):(t=o,Fe(oe)),t}())===o&&(t=function(){var t,r,n,i;if(t=Ae,35===e.charCodeAt(Ae)?(r="#",Ae++):(r=o,Fe(l)),r!==o){for(n=[],h.test(e.charAt(Ae))?(i=e.charAt(Ae),Ae++):(i=o,Fe(f));i!==o;)n.push(i),h.test(e.charAt(Ae))?(i=e.charAt(Ae),Ae++):(i=o,Fe(f));n!==o?(10===e.charCodeAt(Ae)?(i="\n",Ae++):(i=o,Fe(p)),i!==o?(Ee=t,t=r=d(n)):(Ae=t,t=o)):(Ae=t,t=o)}else Ae=t,t=o;return t}()),t}function Me(){var t,r,n,i,a,s,u,c,l,h,f,p,d,y;if(t=Ae,(r=Be())!==o)if((n=Ze())!==o){for(i=[],a=Ae,s=[],u=De();u!==o;)s.push(u),u=De();for(s!==o?(59===e.charCodeAt(Ae)?(u=";",Ae++):(u=o,Fe(M)),u!==o?(c=Ae,(l=Be())!==o&&(h=Ze())!==o?(Ee=c,c=l=Z(0,0,l,h)):(Ae=c,c=o),c===o&&(c=null),c!==o?(Ee=a,a=s=B(0,0,c)):(Ae=a,a=o)):(Ae=a,a=o)):(Ae=a,a=o);a!==o;){for(i.push(a),a=Ae,s=[],u=De();u!==o;)s.push(u),u=De();s!==o?(59===e.charCodeAt(Ae)?(u=";",Ae++):(u=o,Fe(M)),u!==o?(c=Ae,(l=Be())!==o&&(h=Ze())!==o?(Ee=c,c=l=Z(0,0,l,h)):(Ae=c,c=o),c===o&&(c=null),c!==o?(Ee=a,a=s=B(0,0,c)):(Ae=a,a=o)):(Ae=a,a=o)):(Ae=a,a=o)}i!==o?(Ee=t,f=r,p=n,y={},(d=i).unshift(function(t,e){var r={};return r[t]=e,r}(f,p)),d.forEach((t=>{t&&Object.keys(t).forEach((e=>{t[e].forEach((t=>{"@type"===e&&void 0!==t["@id"]&&(t=t["@id"]),void 0===y[e]?y[e]=t:Array.isArray(y[e])?y[e].push(t):y[e]=[y[e],t]}))}))})),t=r=y):(Ae=t,t=o)}else Ae=t,t=o;else Ae=t,t=o;return t}function Ze(){var t,r,n,i,a,s,u,c,l;if(t=Ae,(r=qe())!==o){for(n=[],i=Ae,a=[],s=De();s!==o;)a.push(s),s=De();for(a!==o?(44===e.charCodeAt(Ae)?(s=",",Ae++):(s=o,Fe(q)),s!==o&&(u=qe())!==o?(Ee=i,i=a=H(0,u)):(Ae=i,i=o)):(Ae=i,i=o);i!==o;){for(n.push(i),i=Ae,a=[],s=De();s!==o;)a.push(s),s=De();a!==o?(44===e.charCodeAt(Ae)?(s=",",Ae++):(s=o,Fe(q)),s!==o&&(u=qe())!==o?(Ee=i,i=a=H(0,u)):(Ae=i,i=o)):(Ae=i,i=o)}n!==o?(Ee=t,c=r,(l=n).unshift(c),t=r=l):(Ae=t,t=o)}else Ae=t,t=o;return t}function Be(){var t,r,n;if(t=Ae,(r=function(){var t,e,r;for(t=Ae,e=[],r=De();r!==o;)e.push(r),r=De();return e!==o&&(r=Xe())!==o?(Ee=t,t=e=r):(Ae=t,t=o),t}())!==o&&(Ee=t),(t=r)===o){for(t=Ae,r=[],n=De();n!==o;)r.push(n),n=De();r!==o?(97===e.charCodeAt(Ae)?(n="a",Ae++):(n=o,Fe($)),n!==o?(Ee=t,t=r="@type"):(Ae=t,t=o)):(Ae=t,t=o)}return t}function qe(){var t,r;return(t=function(){var t;return(t=function(){var t,r,n,i,a,s,u;for(t=Ae,r=[],n=De();n!==o;)r.push(n),n=De();if(r!==o)if((n=ze())!==o){for(i=[],a=De();a!==o;)i.push(a),a=De();i!==o&&(a=function(){var t,r,n,i,a,s,u,c;if(t=Ae,64===e.charCodeAt(Ae)?(r="@",Ae++):(r=o,Fe(ht)),r!==o){if(n=[],ft.test(e.charAt(Ae))?(i=e.charAt(Ae),Ae++):(i=o,Fe(pt)),i!==o)for(;i!==o;)n.push(i),ft.test(e.charAt(Ae))?(i=e.charAt(Ae),Ae++):(i=o,Fe(pt));else n=o;if(n!==o){if(i=[],a=Ae,45===e.charCodeAt(Ae)?(s=dt,Ae++):(s=o,Fe(yt)),s!==o){if(u=[],vt.test(e.charAt(Ae))?(c=e.charAt(Ae),Ae++):(c=o,Fe(gt)),c!==o)for(;c!==o;)u.push(c),vt.test(e.charAt(Ae))?(c=e.charAt(Ae),Ae++):(c=o,Fe(gt));else u=o;u!==o?(Ee=a,a=s=mt(0,u)):(Ae=a,a=o)}else Ae=a,a=o;for(;a!==o;)if(i.push(a),a=Ae,45===e.charCodeAt(Ae)?(s=dt,Ae++):(s=o,Fe(yt)),s!==o){if(u=[],vt.test(e.charAt(Ae))?(c=e.charAt(Ae),Ae++):(c=o,Fe(gt)),c!==o)for(;c!==o;)u.push(c),vt.test(e.charAt(Ae))?(c=e.charAt(Ae),Ae++):(c=o,Fe(gt));else u=o;u!==o?(Ee=a,a=s=mt(0,u)):(Ae=a,a=o)}else Ae=a,a=o;i!==o?(Ee=t,l=i,t=r=n.join("")+l.join("")):(Ae=t,t=o)}else Ae=t,t=o}else Ae=t,t=o;var l;return t}())!==o?(Ee=t,t=r={"@value":n,"@language":a}):(Ae=t,t=o)}else Ae=t,t=o;else Ae=t,t=o;if(t===o){for(t=Ae,r=[],n=De();n!==o;)r.push(n),n=De();if(r!==o)if((n=ze())!==o){for(i=[],a=De();a!==o;)i.push(a),a=De();if(i!==o)if(e.substr(Ae,2)===W?(a=W,Ae+=2):(a=o,Fe(Q)),a!==o){for(s=[],u=De();u!==o;)s.push(u),u=De();s!==o&&(u=Xe())!==o?(Ee=t,t=r=function(t,e){if("http://www.w3.org/2001/XMLSchema#boolean"===e&&"true"===t)return!0;if("http://www.w3.org/2001/XMLSchema#boolean"===e&&"false"===t)return!1;if("http://www.w3.org/2001/XMLSchema#integer"===e)return parseInt(t);if("http://www.w3.org/2001/XMLSchema#double"===e)return parseFloat(t);const r=hr.resolve(e,!0);if(r){const n=e.split(":")[0];if("http://www.w3.org/2001/XMLSchema#boolean"===r&&"true"===t)return hr.decrement(n),!0;if("http://www.w3.org/2001/XMLSchema#boolean"===r&&"false"===t)return hr.decrement(n),!1;if("http://www.w3.org/2001/XMLSchema#integer"===r)return hr.decrement(n),parseInt(t);if("http://www.w3.org/2001/XMLSchema#double"===r)return hr.decrement(n),parseFloat(t)}return{"@value":t,"@type":e}}(n,u)):(Ae=t,t=o)}else Ae=t,t=o;else Ae=t,t=o}else Ae=t,t=o;else Ae=t,t=o;if(t===o){for(t=Ae,r=[],n=De();n!==o;)r.push(n),n=De();r!==o&&(n=ze())!==o?(Ee=t,t=r=n):(Ae=t,t=o)}}return t}())===o&&(t=function(){var t,r,n;for(t=Ae,r=[],n=De();n!==o;)r.push(n),n=De();return r!==o?((n=function(){var t,r,n,i,a,s,l,h,f;if(t=Ae,r=Ae,n=Ae,bt.test(e.charAt(Ae))?(i=e.charAt(Ae),Ae++):(i=o,Fe(wt)),i===o&&(i=null),i!==o){if(a=Ae,s=[],ct.test(e.charAt(Ae))?(l=e.charAt(Ae),Ae++):(l=o,Fe(lt)),l!==o)for(;l!==o;)s.push(l),ct.test(e.charAt(Ae))?(l=e.charAt(Ae),Ae++):(l=o,Fe(lt));else s=o;if(s!==o)if(46===e.charCodeAt(Ae)?(l=u,Ae++):(l=o,Fe(c)),l!==o){for(h=[],ct.test(e.charAt(Ae))?(f=e.charAt(Ae),Ae++):(f=o,Fe(lt));f!==o;)h.push(f),ct.test(e.charAt(Ae))?(f=e.charAt(Ae),Ae++):(f=o,Fe(lt));h!==o&&(f=Ye())!==o?a=s=[s,l,h,f]:(Ae=a,a=o)}else Ae=a,a=o;else Ae=a,a=o;if(a===o){if(a=Ae,46===e.charCodeAt(Ae)?(s=u,Ae++):(s=o,Fe(c)),s!==o){if(l=[],ct.test(e.charAt(Ae))?(h=e.charAt(Ae),Ae++):(h=o,Fe(lt)),h!==o)for(;h!==o;)l.push(h),ct.test(e.charAt(Ae))?(h=e.charAt(Ae),Ae++):(h=o,Fe(lt));else l=o;l!==o&&(h=Ye())!==o?a=s=[s,l,h]:(Ae=a,a=o)}else Ae=a,a=o;if(a===o){if(a=Ae,s=[],ct.test(e.charAt(Ae))?(l=e.charAt(Ae),Ae++):(l=o,Fe(lt)),l!==o)for(;l!==o;)s.push(l),ct.test(e.charAt(Ae))?(l=e.charAt(Ae),Ae++):(l=o,Fe(lt));else s=o;s!==o&&(l=Ye())!==o?a=s=[s,l]:(Ae=a,a=o)}}a!==o?n=i=[i,a]:(Ae=n,n=o)}else Ae=n,n=o;return(r=n!==o?e.substring(r,Ae):n)!==o&&(Ee=t,p=r,r={"@value":p,"@type":"http://www.w3.org/2001/XMLSchema#double"}),r;var p}())===o&&(n=function(){var t,r,n,i,a,s,l,h;if(t=Ae,r=Ae,n=Ae,bt.test(e.charAt(Ae))?(i=e.charAt(Ae),Ae++):(i=o,Fe(wt)),i===o&&(i=null),i!==o){for(a=[],ct.test(e.charAt(Ae))?(s=e.charAt(Ae),Ae++):(s=o,Fe(lt));s!==o;)a.push(s),ct.test(e.charAt(Ae))?(s=e.charAt(Ae),Ae++):(s=o,Fe(lt));if(a!==o)if(46===e.charCodeAt(Ae)?(s=u,Ae++):(s=o,Fe(c)),s!==o){if(l=[],ct.test(e.charAt(Ae))?(h=e.charAt(Ae),Ae++):(h=o,Fe(lt)),h!==o)for(;h!==o;)l.push(h),ct.test(e.charAt(Ae))?(h=e.charAt(Ae),Ae++):(h=o,Fe(lt));else l=o;l!==o?n=i=[i,a,s,l]:(Ae=n,n=o)}else Ae=n,n=o;else Ae=n,n=o}else Ae=n,n=o;return(r=n!==o?e.substring(r,Ae):n)!==o&&(Ee=t,f=r,r={"@value":f,"@type":"http://www.w3.org/2001/XMLSchema#decimal"}),r;var f}())===o&&(n=function(){var t,r,n,i,a,s;if(t=Ae,r=Ae,n=Ae,bt.test(e.charAt(Ae))?(i=e.charAt(Ae),Ae++):(i=o,Fe(wt)),i===o&&(i=null),i!==o){if(a=[],ct.test(e.charAt(Ae))?(s=e.charAt(Ae),Ae++):(s=o,Fe(lt)),s!==o)for(;s!==o;)a.push(s),ct.test(e.charAt(Ae))?(s=e.charAt(Ae),Ae++):(s=o,Fe(lt));else a=o;a!==o?n=i=[i,a]:(Ae=n,n=o)}else Ae=n,n=o;return(r=n!==o?e.substring(r,Ae):n)!==o&&(Ee=t,u=r,r=u.match(/^[0+][0-9]+$/)?{"@value":u,"@type":"http://www.w3.org/2001/XMLSchema#integer"}:parseInt(u)),r;var u}()),n!==o?(Ee=t,t=r=n):(Ae=t,t=o)):(Ae=t,t=o),t}())===o&&(t=function(){var t,r,n;for(t=Ae,r=[],n=De();n!==o;)r.push(n),n=De();if(r!==o?(e.substr(Ae,4)===Y?(n=Y,Ae+=4):(n=o,Fe(J)),n!==o?(Ee=t,t=r=!0):(Ae=t,t=o)):(Ae=t,t=o),t===o){for(t=Ae,r=[],n=De();n!==o;)r.push(n),n=De();r!==o?(e.substr(Ae,5)===K?(n=K,Ae+=5):(n=o,Fe(tt)),n!==o?(Ee=t,t=r=!1):(Ae=t,t=o)):(Ae=t,t=o)}return t}()),t}())===o&&(t=Ae,(r=$e())!==o&&(Ee=t,r=fr(r,!1)),(t=r)===o&&(t=Ae,(r=Ve())!==o&&(Ee=t,r=function(t){return"[]"===t?{}:{"@id":t}}(r)),(t=r)===o&&(t=Ae,(r=He())!==o&&(Ee=t),(t=r)===o&&(t=Ae,(r=Xe())!==o&&(Ee=t,r=function(t){return{"@id":t}}(r)),t=r)))),t}function He(){var t,r,n,i,a,s;for(t=Ae,r=[],n=De();n!==o;)r.push(n),n=De();if(r!==o)if(91===e.charCodeAt(Ae)?(n="[",Ae++):(n=o,Fe(z)),n!==o)if((i=Me())!==o){for(a=[],s=De();s!==o;)a.push(s),s=De();a!==o?(93===e.charCodeAt(Ae)?(s="]",Ae++):(s=o,Fe(X)),s!==o?(Ee=t,t=r=i):(Ae=t,t=o)):(Ae=t,t=o)}else Ae=t,t=o;else Ae=t,t=o;else Ae=t,t=o;return t}function $e(){var t,r,n,i,a,s;for(t=Ae,r=[],n=De();n!==o;)r.push(n),n=De();if(r!==o)if(40===e.charCodeAt(Ae)?(n="(",Ae++):(n=o,Fe(V)),n!==o){for(i=[],a=qe();a!==o;)i.push(a),a=qe();if(i!==o){for(a=[],s=De();s!==o;)a.push(s),s=De();a!==o?(41===e.charCodeAt(Ae)?(s=")",Ae++):(s=o,Fe(G)),s!==o?(Ee=t,t=r={"@list":i}):(Ae=t,t=o)):(Ae=t,t=o)}else Ae=t,t=o}else Ae=t,t=o;else Ae=t,t=o;return t}function ze(){var t,r,n;for(t=Ae,r=[],n=De();n!==o;)r.push(n),n=De();return r!==o?((n=function(){var t,r,n,i,a,s,u,c;if(t=Ae,e.substr(Ae,3)===Rt?(r=Rt,Ae+=3):(r=o,Fe(It)),r!==o){for(n=[],Ct.test(e.charAt(Ae))?(i=e.charAt(Ae),Ae++):(i=o,Fe(Pt)),i===o&&(i=Ke())===o&&(i=Je());i!==o;)n.push(i),Ct.test(e.charAt(Ae))?(i=e.charAt(Ae),Ae++):(i=o,Fe(Pt)),i===o&&(i=Ke())===o&&(i=Je());if(n!==o){if(i=[],a=Ae,e.substr(Ae,2)===Ft?(s=Ft,Ae+=2):(s=o,Fe(Ut)),s!==o){if(u=[],Ct.test(e.charAt(Ae))?(c=e.charAt(Ae),Ae++):(c=o,Fe(Pt)),c===o&&(c=Ke())===o&&(c=Je()),c!==o)for(;c!==o;)u.push(c),Ct.test(e.charAt(Ae))?(c=e.charAt(Ae),Ae++):(c=o,Fe(Pt)),c===o&&(c=Ke())===o&&(c=Je());else u=o;u!==o?(Ee=a,a=s=Lt(0,u)):(Ae=a,a=o)}else Ae=a,a=o;if(a===o)if(a=Ae,39===e.charCodeAt(Ae)?(s=Ot,Ae++):(s=o,Fe(jt)),s!==o){if(u=[],Ct.test(e.charAt(Ae))?(c=e.charAt(Ae),Ae++):(c=o,Fe(Pt)),c===o&&(c=Ke())===o&&(c=Je()),c!==o)for(;c!==o;)u.push(c),Ct.test(e.charAt(Ae))?(c=e.charAt(Ae),Ae++):(c=o,Fe(Pt)),c===o&&(c=Ke())===o&&(c=Je());else u=o;u!==o?(Ee=a,a=s=Dt(0,u)):(Ae=a,a=o)}else Ae=a,a=o;for(;a!==o;){if(i.push(a),a=Ae,e.substr(Ae,2)===Ft?(s=Ft,Ae+=2):(s=o,Fe(Ut)),s!==o){if(u=[],Ct.test(e.charAt(Ae))?(c=e.charAt(Ae),Ae++):(c=o,Fe(Pt)),c===o&&(c=Ke())===o&&(c=Je()),c!==o)for(;c!==o;)u.push(c),Ct.test(e.charAt(Ae))?(c=e.charAt(Ae),Ae++):(c=o,Fe(Pt)),c===o&&(c=Ke())===o&&(c=Je());else u=o;u!==o?(Ee=a,a=s=Lt(0,u)):(Ae=a,a=o)}else Ae=a,a=o;if(a===o)if(a=Ae,39===e.charCodeAt(Ae)?(s=Ot,Ae++):(s=o,Fe(jt)),s!==o){if(u=[],Ct.test(e.charAt(Ae))?(c=e.charAt(Ae),Ae++):(c=o,Fe(Pt)),c===o&&(c=Ke())===o&&(c=Je()),c!==o)for(;c!==o;)u.push(c),Ct.test(e.charAt(Ae))?(c=e.charAt(Ae),Ae++):(c=o,Fe(Pt)),c===o&&(c=Ke())===o&&(c=Je());else u=o;u!==o?(Ee=a,a=s=Dt(0,u)):(Ae=a,a=o)}else Ae=a,a=o}i!==o?(e.substr(Ae,3)===Rt?(a=Rt,Ae+=3):(a=o,Fe(It)),a!==o?(Ee=t,t=r=Mt(n,i)):(Ae=t,t=o)):(Ae=t,t=o)}else Ae=t,t=o}else Ae=t,t=o;return t}())===o&&(n=function(){var t,r,n,i,a,s,u,c;if(t=Ae,e.substr(Ae,3)===Zt?(r=Zt,Ae+=3):(r=o,Fe(Bt)),r!==o){for(n=[],qt.test(e.charAt(Ae))?(i=e.charAt(Ae),Ae++):(i=o,Fe(Ht)),i===o&&(i=Ke())===o&&(i=Je());i!==o;)n.push(i),qt.test(e.charAt(Ae))?(i=e.charAt(Ae),Ae++):(i=o,Fe(Ht)),i===o&&(i=Ke())===o&&(i=Je());if(n!==o){if(i=[],a=Ae,e.substr(Ae,2)===$t?(s=$t,Ae+=2):(s=o,Fe(zt)),s!==o){if(u=[],qt.test(e.charAt(Ae))?(c=e.charAt(Ae),Ae++):(c=o,Fe(Ht)),c===o&&(c=Ke())===o&&(c=Je()),c!==o)for(;c!==o;)u.push(c),qt.test(e.charAt(Ae))?(c=e.charAt(Ae),Ae++):(c=o,Fe(Ht)),c===o&&(c=Ke())===o&&(c=Je());else u=o;u!==o?(Ee=a,a=s=Xt(0,u)):(Ae=a,a=o)}else Ae=a,a=o;if(a===o)if(a=Ae,34===e.charCodeAt(Ae)?(s=Tt,Ae++):(s=o,Fe(kt)),s!==o){if(u=[],qt.test(e.charAt(Ae))?(c=e.charAt(Ae),Ae++):(c=o,Fe(Ht)),c===o&&(c=Ke())===o&&(c=Je()),c!==o)for(;c!==o;)u.push(c),qt.test(e.charAt(Ae))?(c=e.charAt(Ae),Ae++):(c=o,Fe(Ht)),c===o&&(c=Ke())===o&&(c=Je());else u=o;u!==o?(Ee=a,a=s=Vt(0,u)):(Ae=a,a=o)}else Ae=a,a=o;for(;a!==o;){if(i.push(a),a=Ae,e.substr(Ae,2)===$t?(s=$t,Ae+=2):(s=o,Fe(zt)),s!==o){if(u=[],qt.test(e.charAt(Ae))?(c=e.charAt(Ae),Ae++):(c=o,Fe(Ht)),c===o&&(c=Ke())===o&&(c=Je()),c!==o)for(;c!==o;)u.push(c),qt.test(e.charAt(Ae))?(c=e.charAt(Ae),Ae++):(c=o,Fe(Ht)),c===o&&(c=Ke())===o&&(c=Je());else u=o;u!==o?(Ee=a,a=s=Xt(0,u)):(Ae=a,a=o)}else Ae=a,a=o;if(a===o)if(a=Ae,34===e.charCodeAt(Ae)?(s=Tt,Ae++):(s=o,Fe(kt)),s!==o){if(u=[],qt.test(e.charAt(Ae))?(c=e.charAt(Ae),Ae++):(c=o,Fe(Ht)),c===o&&(c=Ke())===o&&(c=Je()),c!==o)for(;c!==o;)u.push(c),qt.test(e.charAt(Ae))?(c=e.charAt(Ae),Ae++):(c=o,Fe(Ht)),c===o&&(c=Ke())===o&&(c=Je());else u=o;u!==o?(Ee=a,a=s=Vt(0,u)):(Ae=a,a=o)}else Ae=a,a=o}i!==o?(e.substr(Ae,3)===Zt?(a=Zt,Ae+=3):(a=o,Fe(Bt)),a!==o?(Ee=t,t=r=Mt(n,i)):(Ae=t,t=o)):(Ae=t,t=o)}else Ae=t,t=o}else Ae=t,t=o;return t}())===o&&(n=function(){var t,r,n,i;if(t=Ae,39===e.charCodeAt(Ae)?(r=Ot,Ae++):(r=o,Fe(jt)),r!==o){for(n=[],Nt.test(e.charAt(Ae))?(i=e.charAt(Ae),Ae++):(i=o,Fe(St)),i===o&&(i=Ke())===o&&(i=Je());i!==o;)n.push(i),Nt.test(e.charAt(Ae))?(i=e.charAt(Ae),Ae++):(i=o,Fe(St)),i===o&&(i=Ke())===o&&(i=Je());n!==o?(39===e.charCodeAt(Ae)?(i=Ot,Ae++):(i=o,Fe(jt)),i!==o?(Ee=t,t=r=d(n)):(Ae=t,t=o)):(Ae=t,t=o)}else Ae=t,t=o;return t}())===o&&(n=function(){var t,r,n,i;if(t=Ae,34===e.charCodeAt(Ae)?(r=Tt,Ae++):(r=o,Fe(kt)),r!==o){for(n=[],At.test(e.charAt(Ae))?(i=e.charAt(Ae),Ae++):(i=o,Fe(Et)),i===o&&(i=Ke())===o&&(i=Je());i!==o;)n.push(i),At.test(e.charAt(Ae))?(i=e.charAt(Ae),Ae++):(i=o,Fe(Et)),i===o&&(i=Ke())===o&&(i=Je());n!==o?(34===e.charCodeAt(Ae)?(i=Tt,Ae++):(i=o,Fe(kt)),i!==o?(Ee=t,t=r=d(n)):(Ae=t,t=o)):(Ae=t,t=o)}else Ae=t,t=o;return t}()),n!==o?(Ee=t,t=r=n):(Ae=t,t=o)):(Ae=t,t=o),t}function Xe(){var t,r,n;for(t=Ae,r=[],n=De();n!==o;)r.push(n),n=De();if(r!==o&&(n=Ge())!==o?(Ee=t,t=r=n):(Ae=t,t=o),t===o){for(t=Ae,r=[],n=De();n!==o;)r.push(n),n=De();r!==o&&(n=function(){var t,r;return(t=function(){var t,r,n;return t=Ae,(r=We())!==o&&(n=function(){var t,r,n,i,a,s,l,h;if(t=Ae,(r=er())===o&&(58===e.charCodeAt(Ae)?(r=ot,Ae++):(r=o,Fe(at)),r===o&&(ct.test(e.charAt(Ae))?(r=e.charAt(Ae),Ae++):(r=o,Fe(lt)),r===o&&(r=ir()))),r!==o){for(n=[],(i=rr())===o&&(58===e.charCodeAt(Ae)?(i=ot,Ae++):(i=o,Fe(at)),i===o&&(i=ir()));i!==o;)n.push(i),(i=rr())===o&&(58===e.charCodeAt(Ae)?(i=ot,Ae++):(i=o,Fe(at)),i===o&&(i=ir()));if(n!==o){if(i=[],a=Ae,s=[],46===e.charCodeAt(Ae)?(l=u,Ae++):(l=o,Fe(c)),l!==o)for(;l!==o;)s.push(l),46===e.charCodeAt(Ae)?(l=u,Ae++):(l=o,Fe(c));else s=o;if(s!==o){if(l=[],(h=rr())===o&&(58===e.charCodeAt(Ae)?(h=ot,Ae++):(h=o,Fe(at)),h===o&&(h=ir())),h!==o)for(;h!==o;)l.push(h),(h=rr())===o&&(58===e.charCodeAt(Ae)?(h=ot,Ae++):(h=o,Fe(at)),h===o&&(h=ir()));else l=o;l!==o?(Ee=a,a=s=me(0,0,s,l)):(Ae=a,a=o)}else Ae=a,a=o;for(;a!==o;){if(i.push(a),a=Ae,s=[],46===e.charCodeAt(Ae)?(l=u,Ae++):(l=o,Fe(c)),l!==o)for(;l!==o;)s.push(l),46===e.charCodeAt(Ae)?(l=u,Ae++):(l=o,Fe(c));else s=o;if(s!==o){if(l=[],(h=rr())===o&&(58===e.charCodeAt(Ae)?(h=ot,Ae++):(h=o,Fe(at)),h===o&&(h=ir())),h!==o)for(;h!==o;)l.push(h),(h=rr())===o&&(58===e.charCodeAt(Ae)?(h=ot,Ae++):(h=o,Fe(at)),h===o&&(h=ir()));else l=o;l!==o?(Ee=a,a=s=me(0,0,s,l)):(Ae=a,a=o)}else Ae=a,a=o}i!==o?(Ee=t,f=i,t=r=r+n.join("")+f.join("")):(Ae=t,t=o)}else Ae=t,t=o}else Ae=t,t=o;var f;return t}())!==o?(Ee=t,i=r,a=n,hr.increment(i),t=r=hr.resolve(i+":"+a)):(Ae=t,t=o),t;var i,a}())===o&&(t=Ae,(r=We())!==o&&(Ee=t,n=r,r=n+":"),t=r),t;var n}())!==o?(Ee=t,t=r=n):(Ae=t,t=o)}return t}function Ve(){var t,r,n;for(t=Ae,r=[],n=De();n!==o;)r.push(n),n=De();if(r!==o&&(n=function(){var t,r,n,i,a,s,l,h,f,p;if(t=Ae,r=Ae,e.substr(Ae,2)===st?(n=st,Ae+=2):(n=o,Fe(ut)),n!==o)if((i=er())===o&&(ct.test(e.charAt(Ae))?(i=e.charAt(Ae),Ae++):(i=o,Fe(lt))),i!==o){for(a=[],s=rr();s!==o;)a.push(s),s=rr();if(a!==o){if(s=[],l=Ae,h=[],46===e.charCodeAt(Ae)?(f=u,Ae++):(f=o,Fe(c)),f!==o)for(;f!==o;)h.push(f),46===e.charCodeAt(Ae)?(f=u,Ae++):(f=o,Fe(c));else h=o;if(h!==o){if(f=[],(p=rr())!==o)for(;p!==o;)f.push(p),p=rr();else f=o;f!==o?l=h=[h,f]:(Ae=l,l=o)}else Ae=l,l=o;for(;l!==o;){if(s.push(l),l=Ae,h=[],46===e.charCodeAt(Ae)?(f=u,Ae++):(f=o,Fe(c)),f!==o)for(;f!==o;)h.push(f),46===e.charCodeAt(Ae)?(f=u,Ae++):(f=o,Fe(c));else h=o;if(h!==o){if(f=[],(p=rr())!==o)for(;p!==o;)f.push(p),p=rr();else f=o;f!==o?l=h=[h,f]:(Ae=l,l=o)}else Ae=l,l=o}s!==o?r=n=[n,i,a,s]:(Ae=r,r=o)}else Ae=r,r=o}else Ae=r,r=o;else Ae=r,r=o;return r!==o?e.substring(t,Ae):r}())!==o?(Ee=t,t=r=n):(Ae=t,t=o),t===o){for(t=Ae,r=[],n=De();n!==o;)r.push(n),n=De();r!==o&&(n=function(){var t,r,n,i;if(t=Ae,91===e.charCodeAt(Ae)?(r="[",Ae++):(r=o,Fe(z)),r!==o){for(n=[],i=De();i!==o;)n.push(i),i=De();n!==o?(93===e.charCodeAt(Ae)?(i="]",Ae++):(i=o,Fe(X)),i!==o?(Ee=t,t=r="[]"):(Ae=t,t=o)):(Ae=t,t=o)}else Ae=t,t=o;return t}())!==o?(Ee=t,t=r=n):(Ae=t,t=o)}return t}function Ge(){var t,r,n,i;if(t=Ae,60===e.charCodeAt(Ae)?(r="<",Ae++):(r=o,Fe(et)),r!==o){for(n=[],rt.test(e.charAt(Ae))?(i=e.charAt(Ae),Ae++):(i=o,Fe(nt)),i===o&&(i=Je());i!==o;)n.push(i),rt.test(e.charAt(Ae))?(i=e.charAt(Ae),Ae++):(i=o,Fe(nt)),i===o&&(i=Je());n!==o?(62===e.charCodeAt(Ae)?(i=">",Ae++):(i=o,Fe(it)),i!==o?(Ee=t,t=r=function(t){const e=t.map((t=>65536<=t.codePointAt(0)&&t.codePointAt(0)<=983039?"a":1===t.length?t:6===t.length?String.fromCharCode("0x"+t.substring(2)):10===t.length?String.fromCodePoint("0x"+t.substring(2)):t)).join("");if(e.match(/^[^\u0000-\u0020<>"{}|^`\\]*$/)){var r=t.join("");try{return hr.resolve(r)}catch(t){Se("Invalid IRIREF "+r)}}else Se("Invalid IRIREF "+t.join("")+" / "+e)}(n)):(Ae=t,t=o)):(Ae=t,t=o)}else Ae=t,t=o;return t}function We(){var t,r,n,i;return t=Ae,(r=nr())===o&&(r=null),r!==o?(58===e.charCodeAt(Ae)?(n=ot,Ae++):(n=o,Fe(at)),n!==o?(Ee=t,i=(i=r)||"0",!1===hr.hasPrefix(i)&&Se("undefined prefix "+i),t=r=i):(Ae=t,t=o)):(Ae=t,t=o),t}function Qe(){var t,r,n;return t=Ae,(r=nr())===o&&(r=null),r!==o?(58===e.charCodeAt(Ae)?(n=ot,Ae++):(n=o,Fe(at)),n!==o?(Ee=t,t=r=r||""):(Ae=t,t=o)):(Ae=t,t=o),t}function Ye(){var t,r,n,i,a,s;if(t=Ae,r=Ae,xt.test(e.charAt(Ae))?(n=e.charAt(Ae),Ae++):(n=o,Fe(_t)),n!==o)if(bt.test(e.charAt(Ae))?(i=e.charAt(Ae),Ae++):(i=o,Fe(wt)),i===o&&(i=null),i!==o){if(a=[],ct.test(e.charAt(Ae))?(s=e.charAt(Ae),Ae++):(s=o,Fe(lt)),s!==o)for(;s!==o;)a.push(s),ct.test(e.charAt(Ae))?(s=e.charAt(Ae),Ae++):(s=o,Fe(lt));else a=o;a!==o?r=n=[n,i,a]:(Ae=r,r=o)}else Ae=r,r=o;else Ae=r,r=o;return r!==o?e.substring(t,Ae):r}function Je(){var t,r,n,i,a,s,u,c,l,h,f,p;return t=Ae,"\\U"===e.substr(Ae,2)?(r="\\U",Ae+=2):(r=o,Fe(Gt)),r!==o?(n=Ae,(i=or())!==o&&(a=or())!==o&&(s=or())!==o&&(u=or())!==o&&(c=or())!==o&&(l=or())!==o&&(h=or())!==o&&(f=or())!==o?n=i=[i,a,s,u,c,l,h,f]:(Ae=n,n=o),n!==o?(Ee=t,p=n,t=r=String.fromCodePoint(parseInt(p.join(""),16))):(Ae=t,t=o)):(Ae=t,t=o),t===o&&(t=Ae,"\\u"===e.substr(Ae,2)?(r="\\u",Ae+=2):(r=o,Fe(Wt)),r!==o?(n=Ae,(i=or())!==o&&(a=or())!==o&&(s=or())!==o&&(u=or())!==o?n=i=[i,a,s,u]:(Ae=n,n=o),n!==o?(Ee=t,t=r=function(t){return String.fromCharCode(parseInt(t.join(""),16))}(n)):(Ae=t,t=o)):(Ae=t,t=o)),t}function Ke(){var t,r;return t=Ae,"\\t"===e.substr(Ae,2)?(r="\\t",Ae+=2):(r=o,Fe(Qt)),r!==o&&(Ee=t,r="\t"),(t=r)===o&&(t=Ae,"\\b"===e.substr(Ae,2)?(r="\\b",Ae+=2):(r=o,Fe(Yt)),r!==o&&(Ee=t,r="\b"),(t=r)===o&&(t=Ae,"\\n"===e.substr(Ae,2)?(r="\\n",Ae+=2):(r=o,Fe(Jt)),r!==o&&(Ee=t,r="\n"),(t=r)===o&&(t=Ae,"\\r"===e.substr(Ae,2)?(r="\\r",Ae+=2):(r=o,Fe(Kt)),r!==o&&(Ee=t,r="\r"),(t=r)===o&&(t=Ae,"\\f"===e.substr(Ae,2)?(r="\\f",Ae+=2):(r=o,Fe(te)),r!==o&&(Ee=t,r="\f"),(t=r)===o&&(t=Ae,'\\"'===e.substr(Ae,2)?(r='\\"',Ae+=2):(r=o,Fe(ee)),r!==o&&(Ee=t,r='"'),(t=r)===o&&(t=Ae,"\\'"===e.substr(Ae,2)?(r="\\'",Ae+=2):(r=o,Fe(re)),r!==o&&(Ee=t,r="'"),(t=r)===o&&(t=Ae,"\\\\"===e.substr(Ae,2)?(r="\\\\",Ae+=2):(r=o,Fe(ne)),r!==o&&(Ee=t,r="\\"),t=r))))))),t}function tr(){var t,r,n;return t=Ae,ae.test(e.charAt(Ae))?(r=e.charAt(Ae),Ae++):(r=o,Fe(se)),r!==o?(ue.test(e.charAt(Ae))?(n=e.charAt(Ae),Ae++):(n=o,Fe(ce)),n!==o?(Ee=t,t=r=r+n):(Ae=t,t=o)):(Ae=t,t=o),t===o&&(le.test(e.charAt(Ae))?(t=e.charAt(Ae),Ae++):(t=o,Fe(he))),t}function er(){var t;return(t=tr())===o&&(95===e.charCodeAt(Ae)?(t="_",Ae++):(t=o,Fe(fe))),t}function rr(){var t;return(t=er())===o&&(45===e.charCodeAt(Ae)?(t=dt,Ae++):(t=o,Fe(yt)),t===o&&(ct.test(e.charAt(Ae))?(t=e.charAt(Ae),Ae++):(t=o,Fe(lt)),t===o&&(183===e.charCodeAt(Ae)?(t="·",Ae++):(t=o,Fe(pe)),t===o&&(de.test(e.charAt(Ae))?(t=e.charAt(Ae),Ae++):(t=o,Fe(ye)),t===o&&(ve.test(e.charAt(Ae))?(t=e.charAt(Ae),Ae++):(t=o,Fe(ge))))))),t}function nr(){var t,r,n,i,a,s,l,h,f;if(t=Ae,r=Ae,(n=tr())!==o){for(i=[],a=rr();a!==o;)i.push(a),a=rr();if(i!==o){if(a=[],s=Ae,l=[],46===e.charCodeAt(Ae)?(h=u,Ae++):(h=o,Fe(c)),h!==o)for(;h!==o;)l.push(h),46===e.charCodeAt(Ae)?(h=u,Ae++):(h=o,Fe(c));else l=o;if(l!==o){if(h=[],(f=rr())!==o)for(;f!==o;)h.push(f),f=rr();else h=o;h!==o?s=l=[l,h]:(Ae=s,s=o)}else Ae=s,s=o;for(;s!==o;){if(a.push(s),s=Ae,l=[],46===e.charCodeAt(Ae)?(h=u,Ae++):(h=o,Fe(c)),h!==o)for(;h!==o;)l.push(h),46===e.charCodeAt(Ae)?(h=u,Ae++):(h=o,Fe(c));else l=o;if(l!==o){if(h=[],(f=rr())!==o)for(;f!==o;)h.push(f),f=rr();else h=o;h!==o?s=l=[l,h]:(Ae=s,s=o)}else Ae=s,s=o}a!==o?r=n=[n,i,a]:(Ae=r,r=o)}else Ae=r,r=o}else Ae=r,r=o;return r!==o?e.substring(t,Ae):r}function ir(){var t;return(t=function(){var t,r,n,i,a;return t=Ae,r=Ae,37===e.charCodeAt(Ae)?(n="%",Ae++):(n=o,Fe(be)),n!==o&&(i=or())!==o&&(a=or())!==o?r=n=[n,i,a]:(Ae=r,r=o),r!==o?e.substring(t,Ae):r}())===o&&(t=function(){var t,r,n;return t=Ae,92===e.charCodeAt(Ae)?(r="\\",Ae++):(r=o,Fe(_e)),r!==o?(Te.test(e.charAt(Ae))?(n=e.charAt(Ae),Ae++):(n=o,Fe(ke)),n!==o?(Ee=t,t=r=n):(Ae=t,t=o)):(Ae=t,t=o),t}()),t}function or(){var t;return we.test(e.charAt(Ae))?(t=e.charAt(Ae),Ae++):(t=o,Fe(xe)),t}var ar,sr,ur,cr=new Function("try {return this===window;}catch(e){ return false;}")()?window.URL:r(4044).URL,lr=function(t){return t.match(/^[a-z](.*?):(.+?)/g)},hr={base:[],data:{},addBase:function(t){if(0===hr.base.length)return void hr.base.push(t);const e=hr.base[hr.base.length-1];e!==t&&hr.base.push(new cr(t,e).toString())},addPrefix:function(t,e){const r=hr.data[t];void 0===r?hr.data[t]=[{uri:e,count:0}]:r[r.length-1].uri!==e&&r.push({uri:e,count:0})},hasPrefix:function(t){return void 0!==this.data[t]},resolve:function(t,e){const r=Object.keys(hr.data).find((e=>0===t.indexOf(e+":")));if(void 0!==r){const n=hr.data[r];if(1===n.length&&!0!==e&&lr(n[0].uri))return t;const i=n[n.length-1].uri;return t.replace(r+":",i)}var i=0===hr.base.length?n.baseIRI:hr.base[hr.base.length-1];return!i||t.match(/^(http:|https:|urn:|file:)/)?t:0===t.indexOf("//")&&i?i.split("//")[0]+t:new cr(t,i).toString()},increment:function(t){const e=hr.data[t];void 0!==e&&e[e.length-1].count++},decrement:function(t){const e=hr.data[t];void 0!==e&&e[e.length-1].count--},toJSON:function(){const t={};return hr.base.length>0&&(void 0===t["@context"]&&(t["@context"]={}),t["@context"]["@base"]=hr.base[0]),Object.keys(hr.data).forEach((e=>{const r=hr.data[e][0];"http://www.w3.org/2001/XMLSchema#"===r.uri&&r.count<1||lr(r.uri)&&(void 0===t["@context"]&&(t["@context"]={}),t["@context"][e]=r.uri)})),t}};function fr(t,e){if(void 0===t["@list"])return t;if(!e&&!t["@list"].find((t=>void 0!==t["@list"])))return t;if(0===t["@list"].length)return{"@id":"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"};var r={},n=null;return t["@list"].forEach((t=>{null===n?n=r:(n["http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"]={},n=n["http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"]),n["http://www.w3.org/1999/02/22-rdf-syntax-ns#first"]=fr(t,!0),n["http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"]={"@id":"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"}})),r}if((i=s())!==o&&Ae===e.length)return i;throw i!==o&&Ae<e.length&&Fe({type:"end"}),ar=Ne,sr=je<e.length?e.charAt(je):null,ur=je<e.length?Pe(je,je+1):Pe(je,je),new t(t.buildMessage(ar,sr),ar,sr,ur)}}})?n.apply(e,[]):n)||(t.exports=i)},6118:(t,e,r)=>{"use strict";var n=r(2530),i=r(292);function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}var a,s,u=r(8619).codes,c=u.ERR_AMBIGUOUS_ARGUMENT,l=u.ERR_INVALID_ARG_TYPE,h=u.ERR_INVALID_ARG_VALUE,f=u.ERR_INVALID_RETURN_VALUE,p=u.ERR_MISSING_ARGS,d=r(6979),y=r(5663).inspect,v=r(5663).types,g=v.isPromise,m=v.isRegExp,b=Object.assign?Object.assign:r(1662).assign,w=Object.is?Object.is:r(7402);function x(){var t=r(1667);a=t.isDeepEqual,s=t.isDeepStrictEqual}new Map;var _=!1,T=t.exports=O,k={};function A(t){if(t.message instanceof Error)throw t.message;throw new d(t)}function E(t,e,r,n){if(!r){var i=!1;if(0===e)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var o=new d({actual:r,expected:!0,message:n,operator:"==",stackStartFn:t});throw o.generatedMessage=i,o}}function O(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];E.apply(void 0,[O,e.length].concat(e))}T.fail=function t(e,r,o,a,s){var u,c=arguments.length;if(0===c)u="Failed";else if(1===c)o=e,e=void 0;else{if(!1===_){_=!0;var l=n.emitWarning?n.emitWarning:i.warn.bind(i);l("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}2===c&&(a="!=")}if(o instanceof Error)throw o;var h={actual:e,expected:r,operator:void 0===a?"fail":a,stackStartFn:s||t};void 0!==o&&(h.message=o);var f=new d(h);throw u&&(f.message=u,f.generatedMessage=!0),f},T.AssertionError=d,T.ok=O,T.equal=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");e!=r&&A({actual:e,expected:r,message:n,operator:"==",stackStartFn:t})},T.notEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");e==r&&A({actual:e,expected:r,message:n,operator:"!=",stackStartFn:t})},T.deepEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===a&&x(),a(e,r)||A({actual:e,expected:r,message:n,operator:"deepEqual",stackStartFn:t})},T.notDeepEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===a&&x(),a(e,r)&&A({actual:e,expected:r,message:n,operator:"notDeepEqual",stackStartFn:t})},T.deepStrictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===a&&x(),s(e,r)||A({actual:e,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:t})},T.notDeepStrictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===a&&x(),s(e,r)&&A({actual:e,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:t})},T.strictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");w(e,r)||A({actual:e,expected:r,message:n,operator:"strictEqual",stackStartFn:t})},T.notStrictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");w(e,r)&&A({actual:e,expected:r,message:n,operator:"notStrictEqual",stackStartFn:t})};var j=function t(e,r,n){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r.forEach((function(t){t in e&&(void 0!==n&&"string"==typeof n[t]&&m(e[t])&&e[t].test(n[t])?i[t]=n[t]:i[t]=e[t])}))};function N(t,e,r,n,i,o){if(!(r in t)||!s(t[r],e[r])){if(!n){var a=new j(t,i),u=new j(e,i,t),c=new d({actual:a,expected:u,operator:"deepStrictEqual",stackStartFn:o});throw c.actual=t,c.expected=e,c.operator=o.name,c}A({actual:t,expected:e,message:n,operator:o.name,stackStartFn:o})}}function S(t,e,r,n){if("function"!=typeof e){if(m(e))return e.test(t);if(2===arguments.length)throw new l("expected",["Function","RegExp"],e);if("object"!==o(t)||null===t){var i=new d({actual:t,expected:e,message:r,operator:"deepStrictEqual",stackStartFn:n});throw i.operator=n.name,i}var s=Object.keys(e);if(e instanceof Error)s.push("name","message");else if(0===s.length)throw new h("error",e,"may not be an empty object");return void 0===a&&x(),s.forEach((function(i){"string"==typeof t[i]&&m(e[i])&&e[i].test(t[i])||N(t,e,i,r,s,n)})),!0}return void 0!==e.prototype&&t instanceof e||!Error.isPrototypeOf(e)&&!0===e.call({},t)}function R(t){if("function"!=typeof t)throw new l("fn","Function",t);try{t()}catch(t){return t}return k}function I(t){return g(t)||null!==t&&"object"===o(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function C(t){return Promise.resolve().then((function(){var e;if("function"==typeof t){if(!I(e=t()))throw new f("instance of Promise","promiseFn",e)}else{if(!I(t))throw new l("promiseFn",["Function","Promise"],t);e=t}return Promise.resolve().then((function(){return e})).then((function(){return k})).catch((function(t){return t}))}))}function P(t,e,r,n){if("string"==typeof r){if(4===arguments.length)throw new l("error",["Object","Error","Function","RegExp"],r);if("object"===o(e)&&null!==e){if(e.message===r)throw new c("error/message",'The error message "'.concat(e.message,'" is identical to the message.'))}else if(e===r)throw new c("error/message",'The error "'.concat(e,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==o(r)&&"function"!=typeof r)throw new l("error",["Object","Error","Function","RegExp"],r);if(e===k){var i="";r&&r.name&&(i+=" (".concat(r.name,")")),i+=n?": ".concat(n):".";var a="rejects"===t.name?"rejection":"exception";A({actual:void 0,expected:r,operator:t.name,message:"Missing expected ".concat(a).concat(i),stackStartFn:t})}if(r&&!S(e,r,n,t))throw e}function F(t,e,r,n){if(e!==k){if("string"==typeof r&&(n=r,r=void 0),!r||S(e,r)){var i=n?": ".concat(n):".",o="doesNotReject"===t.name?"rejection":"exception";A({actual:e,expected:r,operator:t.name,message:"Got unwanted ".concat(o).concat(i,"\n")+'Actual message: "'.concat(e&&e.message,'"'),stackStartFn:t})}throw e}}function U(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];E.apply(void 0,[U,e.length].concat(e))}T.throws=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];P.apply(void 0,[t,R(e)].concat(n))},T.rejects=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return C(e).then((function(e){return P.apply(void 0,[t,e].concat(n))}))},T.doesNotThrow=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];F.apply(void 0,[t,R(e)].concat(n))},T.doesNotReject=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return C(e).then((function(e){return F.apply(void 0,[t,e].concat(n))}))},T.ifError=function t(e){if(null!=e){var r="ifError got unwanted exception: ";"object"===o(e)&&"string"==typeof e.message?0===e.message.length&&e.constructor?r+=e.constructor.name:r+=e.message:r+=y(e);var n=new d({actual:e,expected:null,operator:"ifError",message:r,stackStartFn:t}),i=e.stack;if("string"==typeof i){var a=i.split("\n");a.shift();for(var s=n.stack.split("\n"),u=0;u<a.length;u++){var c=s.indexOf(a[u]);if(-1!==c){s=s.slice(0,c);break}}n.stack="".concat(s.join("\n"),"\n").concat(a.join("\n"))}throw n}},T.strict=b(U,T,{equal:T.strictEqual,deepEqual:T.deepStrictEqual,notEqual:T.notStrictEqual,notDeepEqual:T.notDeepStrictEqual}),T.strict.strict=T.strict},6979:(t,e,r)=>{"use strict";var n=r(2530);function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function a(t,e){return!e||"object"!==p(e)&&"function"!=typeof e?s(t):e}function s(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(t){var e="function"==typeof Map?new Map:void 0;return u=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return l(t,arguments,f(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),h(n,t)},u(t)}function c(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function l(t,e,r){return l=c()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&h(i,r.prototype),i},l.apply(null,arguments)}function h(t,e){return h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},h(t,e)}function f(t){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},f(t)}function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}var d=r(5663).inspect,y=r(8619).codes.ERR_INVALID_ARG_TYPE;function v(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}var g="",m="",b="",w="",x={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function _(t){var e=Object.keys(t),r=Object.create(Object.getPrototypeOf(t));return e.forEach((function(e){r[e]=t[e]})),Object.defineProperty(r,"message",{value:t.message}),r}function T(t){return d(t,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var k=function(t){function e(t){var r;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),"object"!==p(t)||null===t)throw new y("options","Object",t);var i=t.message,o=t.operator,u=t.stackStartFn,c=t.actual,l=t.expected,h=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=i)r=a(this,f(e).call(this,String(i)));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(g="",m="",w="",b=""):(g="",m="",w="",b="")),"object"===p(c)&&null!==c&&"object"===p(l)&&null!==l&&"stack"in c&&c instanceof Error&&"stack"in l&&l instanceof Error&&(c=_(c),l=_(l)),"deepStrictEqual"===o||"strictEqual"===o)r=a(this,f(e).call(this,function(t,e,r){var i="",o="",a=0,s="",u=!1,c=T(t),l=c.split("\n"),h=T(e).split("\n"),f=0,d="";if("strictEqual"===r&&"object"===p(t)&&"object"===p(e)&&null!==t&&null!==e&&(r="strictEqualObject"),1===l.length&&1===h.length&&l[0]!==h[0]){var y=l[0].length+h[0].length;if(y<=10){if(!("object"===p(t)&&null!==t||"object"===p(e)&&null!==e||0===t&&0===e))return"".concat(x[r],"\n\n")+"".concat(l[0]," !== ").concat(h[0],"\n")}else if("strictEqualObject"!==r&&y<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;l[0][f]===h[0][f];)f++;f>2&&(d="\n ".concat(function(t,e){if(e=Math.floor(e),0==t.length||0==e)return"";var r=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+t.substring(0,r-t.length)}(" ",f),"^"),f=0)}}for(var _=l[l.length-1],k=h[h.length-1];_===k&&(f++<2?s="\n ".concat(_).concat(s):i=_,l.pop(),h.pop(),0!==l.length&&0!==h.length);)_=l[l.length-1],k=h[h.length-1];var A=Math.max(l.length,h.length);if(0===A){var E=c.split("\n");if(E.length>30)for(E[26]="".concat(g,"...").concat(w);E.length>27;)E.pop();return"".concat(x.notIdentical,"\n\n").concat(E.join("\n"),"\n")}f>3&&(s="\n".concat(g,"...").concat(w).concat(s),u=!0),""!==i&&(s="\n ".concat(i).concat(s),i="");var O=0,j=x[r]+"\n".concat(m,"+ actual").concat(w," ").concat(b,"- expected").concat(w),N=" ".concat(g,"...").concat(w," Lines skipped");for(f=0;f<A;f++){var S=f-a;if(l.length<f+1)S>1&&f>2&&(S>4?(o+="\n".concat(g,"...").concat(w),u=!0):S>3&&(o+="\n ".concat(h[f-2]),O++),o+="\n ".concat(h[f-1]),O++),a=f,i+="\n".concat(b,"-").concat(w," ").concat(h[f]),O++;else if(h.length<f+1)S>1&&f>2&&(S>4?(o+="\n".concat(g,"...").concat(w),u=!0):S>3&&(o+="\n ".concat(l[f-2]),O++),o+="\n ".concat(l[f-1]),O++),a=f,o+="\n".concat(m,"+").concat(w," ").concat(l[f]),O++;else{var R=h[f],I=l[f],C=I!==R&&(!v(I,",")||I.slice(0,-1)!==R);C&&v(R,",")&&R.slice(0,-1)===I&&(C=!1,I+=","),C?(S>1&&f>2&&(S>4?(o+="\n".concat(g,"...").concat(w),u=!0):S>3&&(o+="\n ".concat(l[f-2]),O++),o+="\n ".concat(l[f-1]),O++),a=f,o+="\n".concat(m,"+").concat(w," ").concat(I),i+="\n".concat(b,"-").concat(w," ").concat(R),O+=2):(o+=i,i="",1!==S&&0!==f||(o+="\n ".concat(I),O++))}if(O>20&&f<A-2)return"".concat(j).concat(N,"\n").concat(o,"\n").concat(g,"...").concat(w).concat(i,"\n")+"".concat(g,"...").concat(w)}return"".concat(j).concat(u?N:"","\n").concat(o).concat(i).concat(s).concat(d)}(c,l,o)));else if("notDeepStrictEqual"===o||"notStrictEqual"===o){var d=x[o],k=T(c).split("\n");if("notStrictEqual"===o&&"object"===p(c)&&null!==c&&(d=x.notStrictEqualObject),k.length>30)for(k[26]="".concat(g,"...").concat(w);k.length>27;)k.pop();r=1===k.length?a(this,f(e).call(this,"".concat(d," ").concat(k[0]))):a(this,f(e).call(this,"".concat(d,"\n\n").concat(k.join("\n"),"\n")))}else{var A=T(c),E="",O=x[o];"notDeepEqual"===o||"notEqual"===o?(A="".concat(x[o],"\n\n").concat(A)).length>1024&&(A="".concat(A.slice(0,1021),"...")):(E="".concat(T(l)),A.length>512&&(A="".concat(A.slice(0,509),"...")),E.length>512&&(E="".concat(E.slice(0,509),"...")),"deepEqual"===o||"equal"===o?A="".concat(O,"\n\n").concat(A,"\n\nshould equal\n\n"):E=" ".concat(o," ").concat(E)),r=a(this,f(e).call(this,"".concat(A).concat(E)))}return Error.stackTraceLimit=h,r.generatedMessage=!i,Object.defineProperty(s(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=c,r.expected=l,r.operator=o,Error.captureStackTrace&&Error.captureStackTrace(s(r),u),r.stack,r.name="AssertionError",a(r)}var r,u;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}(e,t),r=e,u=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:d.custom,value:function(t,e){return d(this,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){i(t,e,r[e])}))}return t}({},e,{customInspect:!1,depth:0}))}}],u&&o(r.prototype,u),e}(u(Error));t.exports=k},8619:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function o(t,e){return o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},o(t,e)}var a,s,u={};function c(t,e,r){r||(r=Error);var a=function(r){function a(r,o,s){var u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),u=function(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}(this,i(a).call(this,function(t,r,n){return"string"==typeof e?e:e(t,r,n)}(r,o,s))),u.code=t,u}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&o(t,e)}(a,r),a}(r);u[t]=a}function l(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}c("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),c("ERR_INVALID_ARG_TYPE",(function(t,e,i){var o,s,u,c,h;if(void 0===a&&(a=r(6118)),a("string"==typeof t,"'name' must be a string"),"string"==typeof e&&(s="not ",e.substr(0,s.length)===s)?(o="must not be",e=e.replace(/^not /,"")):o="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))u="The ".concat(t," ").concat(o," ").concat(l(e,"type"));else{var f=("number"!=typeof h&&(h=0),h+".".length>(c=t).length||-1===c.indexOf(".",h)?"argument":"property");u='The "'.concat(t,'" ').concat(f," ").concat(o," ").concat(l(e,"type"))}return u+". Received type ".concat(n(i))}),TypeError),c("ERR_INVALID_ARG_VALUE",(function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===s&&(s=r(5663));var i=s.inspect(e);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(t,"' ").concat(n,". Received ").concat(i)}),TypeError,RangeError),c("ERR_INVALID_RETURN_VALUE",(function(t,e,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(t,' to be returned from the "').concat(e,'"')+" function but got ".concat(i,".")}),TypeError),c("ERR_MISSING_ARGS",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];void 0===a&&(a=r(6118)),a(e.length>0,"At least one arg needs to be specified");var i="The ",o=e.length;switch(e=e.map((function(t){return'"'.concat(t,'"')})),o){case 1:i+="".concat(e[0]," argument");break;case 2:i+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:i+=e.slice(0,o-1).join(", "),i+=", and ".concat(e[o-1]," arguments")}return"".concat(i," must be specified")}),TypeError),t.exports.codes=u},1667:(t,e,r)=>{"use strict";function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}var o=void 0!==/a/g.flags,a=function(t){var e=[];return t.forEach((function(t){return e.push(t)})),e},s=function(t){var e=[];return t.forEach((function(t,r){return e.push([r,t])})),e},u=Object.is?Object.is:r(7402),c=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},l=Number.isNaN?Number.isNaN:r(8622);function h(t){return t.call.bind(t)}var f=h(Object.prototype.hasOwnProperty),p=h(Object.prototype.propertyIsEnumerable),d=h(Object.prototype.toString),y=r(5663).types,v=y.isAnyArrayBuffer,g=y.isArrayBufferView,m=y.isDate,b=y.isMap,w=y.isRegExp,x=y.isSet,_=y.isNativeError,T=y.isBoxedPrimitive,k=y.isNumberObject,A=y.isStringObject,E=y.isBooleanObject,O=y.isBigIntObject,j=y.isSymbolObject,N=y.isFloat32Array,S=y.isFloat64Array;function R(t){if(0===t.length||t.length>10)return!0;for(var e=0;e<t.length;e++){var r=t.charCodeAt(e);if(r<48||r>57)return!0}return 10===t.length&&t>=Math.pow(2,32)}function I(t){return Object.keys(t).filter(R).concat(c(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}function C(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0}function P(t,e,r,n){if(t===e)return 0!==t||!r||u(t,e);if(r){if("object"!==i(t))return"number"==typeof t&&l(t)&&l(e);if("object"!==i(e)||null===t||null===e)return!1;if(Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1}else{if(null===t||"object"!==i(t))return(null===e||"object"!==i(e))&&t==e;if(null===e||"object"!==i(e))return!1}var a,s,c,h,f=d(t);if(f!==d(e))return!1;if(Array.isArray(t)){if(t.length!==e.length)return!1;var p=I(t),y=I(e);return p.length===y.length&&U(t,e,r,n,1,p)}if("[object Object]"===f&&(!b(t)&&b(e)||!x(t)&&x(e)))return!1;if(m(t)){if(!m(e)||Date.prototype.getTime.call(t)!==Date.prototype.getTime.call(e))return!1}else if(w(t)){if(!w(e)||(c=t,h=e,!(o?c.source===h.source&&c.flags===h.flags:RegExp.prototype.toString.call(c)===RegExp.prototype.toString.call(h))))return!1}else if(_(t)||t instanceof Error){if(t.message!==e.message||t.name!==e.name)return!1}else{if(g(t)){if(r||!N(t)&&!S(t)){if(!function(t,e){return t.byteLength===e.byteLength&&0===C(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}(t,e))return!1}else if(!function(t,e){if(t.byteLength!==e.byteLength)return!1;for(var r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}(t,e))return!1;var R=I(t),P=I(e);return R.length===P.length&&U(t,e,r,n,0,R)}if(x(t))return!(!x(e)||t.size!==e.size)&&U(t,e,r,n,2);if(b(t))return!(!b(e)||t.size!==e.size)&&U(t,e,r,n,3);if(v(t)){if(s=e,(a=t).byteLength!==s.byteLength||0!==C(new Uint8Array(a),new Uint8Array(s)))return!1}else if(T(t)&&!function(t,e){return k(t)?k(e)&&u(Number.prototype.valueOf.call(t),Number.prototype.valueOf.call(e)):A(t)?A(e)&&String.prototype.valueOf.call(t)===String.prototype.valueOf.call(e):E(t)?E(e)&&Boolean.prototype.valueOf.call(t)===Boolean.prototype.valueOf.call(e):O(t)?O(e)&&BigInt.prototype.valueOf.call(t)===BigInt.prototype.valueOf.call(e):j(e)&&Symbol.prototype.valueOf.call(t)===Symbol.prototype.valueOf.call(e)}(t,e))return!1}return U(t,e,r,n,0)}function F(t,e){return e.filter((function(e){return p(t,e)}))}function U(t,e,r,n,i,o){if(5===arguments.length){o=Object.keys(t);var a=Object.keys(e);if(o.length!==a.length)return!1}for(var s=0;s<o.length;s++)if(!f(e,o[s]))return!1;if(r&&5===arguments.length){var u=c(t);if(0!==u.length){var l=0;for(s=0;s<u.length;s++){var h=u[s];if(p(t,h)){if(!p(e,h))return!1;o.push(h),l++}else if(p(e,h))return!1}var d=c(e);if(u.length!==d.length&&F(e,d).length!==l)return!1}else{var y=c(e);if(0!==y.length&&0!==F(e,y).length)return!1}}if(0===o.length&&(0===i||1===i&&0===t.length||0===t.size))return!0;if(void 0===n)n={val1:new Map,val2:new Map,position:0};else{var v=n.val1.get(t);if(void 0!==v){var g=n.val2.get(e);if(void 0!==g)return v===g}n.position++}n.val1.set(t,n.position),n.val2.set(e,n.position);var m=q(t,e,r,o,n,i);return n.val1.delete(t),n.val2.delete(e),m}function L(t,e,r,n){for(var i=a(t),o=0;o<i.length;o++){var s=i[o];if(P(e,s,r,n))return t.delete(s),!0}return!1}function D(t){switch(i(t)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":t=+t;case"number":if(l(t))return!1}return!0}function M(t,e,r){var n=D(r);return null!=n?n:e.has(n)&&!t.has(n)}function Z(t,e,r,n,i){var o=D(r);if(null!=o)return o;var a=e.get(o);return!(void 0===a&&!e.has(o)||!P(n,a,!1,i))&&!t.has(o)&&P(n,a,!1,i)}function B(t,e,r,n,i,o){for(var s=a(t),u=0;u<s.length;u++){var c=s[u];if(P(r,c,i,o)&&P(n,e.get(c),i,o))return t.delete(c),!0}return!1}function q(t,e,r,o,u,c){var l=0;if(2===c){if(!function(t,e,r,n){for(var o=null,s=a(t),u=0;u<s.length;u++){var c=s[u];if("object"===i(c)&&null!==c)null===o&&(o=new Set),o.add(c);else if(!e.has(c)){if(r)return!1;if(!M(t,e,c))return!1;null===o&&(o=new Set),o.add(c)}}if(null!==o){for(var l=a(e),h=0;h<l.length;h++){var f=l[h];if("object"===i(f)&&null!==f){if(!L(o,f,r,n))return!1}else if(!r&&!t.has(f)&&!L(o,f,r,n))return!1}return 0===o.size}return!0}(t,e,r,u))return!1}else if(3===c){if(!function(t,e,r,o){for(var a=null,u=s(t),c=0;c<u.length;c++){var l=n(u[c],2),h=l[0],f=l[1];if("object"===i(h)&&null!==h)null===a&&(a=new Set),a.add(h);else{var p=e.get(h);if(void 0===p&&!e.has(h)||!P(f,p,r,o)){if(r)return!1;if(!Z(t,e,h,f,o))return!1;null===a&&(a=new Set),a.add(h)}}}if(null!==a){for(var d=s(e),y=0;y<d.length;y++){var v=n(d[y],2),g=(h=v[0],v[1]);if("object"===i(h)&&null!==h){if(!B(a,t,h,g,r,o))return!1}else if(!(r||t.has(h)&&P(t.get(h),g,!1,o)||B(a,t,h,g,!1,o)))return!1}return 0===a.size}return!0}(t,e,r,u))return!1}else if(1===c)for(;l<t.length;l++){if(!f(t,l)){if(f(e,l))return!1;for(var h=Object.keys(t);l<h.length;l++){var p=h[l];if(!f(e,p)||!P(t[p],e[p],r,u))return!1}return h.length===Object.keys(e).length}if(!f(e,l)||!P(t[l],e[l],r,u))return!1}for(l=0;l<o.length;l++){var d=o[l];if(!P(t[d],e[d],r,u))return!1}return!0}t.exports={isDeepEqual:function(t,e){return P(t,e,!1)},isDeepStrictEqual:function(t,e){return P(t,e,!0)}}},5155:(t,e)=>{"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=u(t),a=o[0],s=o[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,a,s)),l=0,h=s>0?a-4:a;for(r=0;r<h;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],c[l++]=e>>16&255,c[l++]=e>>8&255,c[l++]=255&e;return 2===s&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[l++]=255&e),1===s&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[l++]=e>>8&255,c[l++]=255&e),c},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],a=16383,s=0,u=n-i;s<u;s+=a)o.push(c(t,s,s+a>u?u:s+a));return 1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a<s;++a)r[a]=o[a],n[o.charCodeAt(a)]=a;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,n){for(var i,o,a=[],s=e;s<n;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),a.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},2486:(t,e,r)=>{"use strict";var n=r(292);const i=r(5155),o=r(4525),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.lW=c,e.h2=50;const s=2147483647;function u(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,c.prototype),e}function c(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return f(t)}return l(t,e,r)}function l(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!c.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|v(t,e);let n=u(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(Q(t,Uint8Array)){const e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return p(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Q(t,ArrayBuffer)||t&&Q(t.buffer,ArrayBuffer))return d(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(Q(t,SharedArrayBuffer)||t&&Q(t.buffer,SharedArrayBuffer)))return d(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return c.from(n,e,r);const i=function(t){if(c.isBuffer(t)){const e=0|y(t.length),r=u(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||Y(t.length)?u(0):p(t):"Buffer"===t.type&&Array.isArray(t.data)?p(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return c.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function f(t){return h(t),u(t<0?0:0|y(t))}function p(t){const e=t.length<0?0:0|y(t.length),r=u(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function d(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,c.prototype),n}function y(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function v(t,e){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Q(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return V(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(t).length;default:if(i)return n?-1:V(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return O(this,e,r);case"ascii":return N(this,e,r);case"latin1":case"binary":return S(this,e,r);case"base64":return E(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:w(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):w(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(t,e,r,n,i){let o,a=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){let n=-1;for(o=r;o<s;o++)if(c(t,o)===c(e,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*a}else-1!==n&&(o-=o-n),n=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(c(t,o+n)!==c(e,n)){r=!1;break}if(r)return o}return-1}function x(t,e,r,n){r=Number(r)||0;const i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=e.length;let a;for(n>o/2&&(n=o/2),a=0;a<n;++a){const n=parseInt(e.substr(2*a,2),16);if(Y(n))return a;t[r+a]=n}return a}function _(t,e,r,n){return W(V(e,t.length-r),t,r,n)}function T(t,e,r,n){return W(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function k(t,e,r,n){return W(G(e),t,r,n)}function A(t,e,r,n){return W(function(t,e){let r,n,i;const o=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function E(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function O(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i<r;){const e=t[i];let o=null,a=e>239?4:e>223?3:e>191?2:1;if(i+a<=r){let r,n,s,u;switch(a){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(o=u));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=t[i+1],n=t[i+2],s=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=a}return function(t){const e=t.length;if(e<=j)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=j));return r}(n)}c.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),c.TYPED_ARRAY_SUPPORT||void 0===n||"function"!=typeof n.error||n.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(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(t,e,r){return l(t,e,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(t,e,r){return function(t,e,r){return h(t),t<=0?u(t):void 0!==e?"string"==typeof r?u(t).fill(e,r):u(t).fill(e):u(t)}(t,e,r)},c.allocUnsafe=function(t){return f(t)},c.allocUnsafeSlow=function(t){return f(t)},c.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==c.prototype},c.compare=function(t,e){if(Q(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),Q(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=c.allocUnsafe(e);let i=0;for(r=0;r<t.length;++r){let e=t[r];if(Q(e,Uint8Array))i+e.length>n.length?(c.isBuffer(e)||(e=c.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!c.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},c.byteLength=v,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)m(this,e,e+1);return this},c.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},c.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},c.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?O(this,0,t):g.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){let t="";const r=e.h2;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},a&&(c.prototype[a]=c.prototype.inspect),c.prototype.compare=function(t,e,r,n,i){if(Q(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0);const s=Math.min(o,a),u=this.slice(n,i),l=t.slice(e,r);for(let t=0;t<s;++t)if(u[t]!==l[t]){o=u[t],a=l[t];break}return o<a?-1:a<o?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},c.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return x(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":case"latin1":case"binary":return T(this,t,e,r);case"base64":return k(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const j=4096;function N(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function S(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function R(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=e;n<r;++n)i+=J[t[n]];return i}function I(t,e,r){const n=t.slice(e,r);let i="";for(let t=0;t<n.length-1;t+=2)i+=String.fromCharCode(n[t]+256*n[t+1]);return i}function C(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,r,n,i,o){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function F(t,e,r,n,i){H(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,r}function U(t,e,r,n,i){H(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=a,a>>=8,t[r+2]=a,a>>=8,t[r+1]=a,a>>=8,t[r]=a,r+8}function L(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,n,i){return e=+e,r>>>=0,i||L(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function M(t,e,r,n,i){return e=+e,r>>>=0,i||L(t,0,r,8),o.write(t,e,r,n,52,8),r+8}c.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readBigUInt64LE=K((function(t){$(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),c.prototype.readBigUInt64BE=K((function(t){$(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),c.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},c.prototype.readInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readBigInt64LE=K((function(t){$(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),c.prototype.readBigInt64BE=K((function(t){$(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)})),c.prototype.readFloatLE=function(t,e){return t>>>=0,e||C(t,4,this.length),o.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return t>>>=0,e||C(t,4,this.length),o.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return t>>>=0,e||C(t,8,this.length),o.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return t>>>=0,e||C(t,8,this.length),o.read(this,t,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||P(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||P(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,255,0),this[e]=255&t,e+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigUInt64LE=K((function(t,e=0){return F(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=K((function(t,e=0){return U(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}let i=0,o=1,a=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/o>>0)-a&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}let i=r-1,o=1,a=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/o>>0)-a&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigInt64LE=K((function(t,e=0){return F(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=K((function(t,e=0){return U(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return M(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return M(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);const i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},c.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{const o=c.isBuffer(t)?t:c.from(t,n),a=o.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=o[i%a]}return this};const Z={};function B(t,e,r){Z[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function q(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function H(t,e,r,n,i,o){if(t>r||t<e){const n="bigint"==typeof e?"n":"";let i;throw i=o>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new Z.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){$(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||z(e,t.length-(r+1))}(n,i,o)}function $(t,e){if("number"!=typeof t)throw new Z.ERR_INVALID_ARG_TYPE(e,"number",t)}function z(t,e,r){if(Math.floor(t)!==t)throw $(t,r),new Z.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new Z.ERR_BUFFER_OUT_OF_BOUNDS;throw new Z.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}B("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),B("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),B("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=q(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=q(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const X=/[^+/0-9A-Za-z-_]/g;function V(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let a=0;a<n;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(X,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function W(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Q(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!=t}const J=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function K(t){return"undefined"==typeof BigInt?tt:t}function tt(){throw new Error("BigInt not supported")}},7615:(t,e,r)=>{"use strict";var n=r(1801),i=r(2550),o=i(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&o(t,".prototype.")>-1?i(r):r}},2550:(t,e,r)=>{"use strict";var n=r(1930),i=r(1801),o=i("%Function.prototype.apply%"),a=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||n.call(a,o),u=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),l=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(t){c=null}t.exports=function(t){var e=s(n,a,arguments);if(u&&c){var r=u(e,"length");r.configurable&&c(e,"length",{value:1+l(0,t.length-(arguments.length-1))})}return e};var h=function(){return s(n,o,arguments)};c?c(t.exports,"apply",{value:h}):t.exports.apply=h},292:(t,e,r)=>{var n=r(5663),i=r(6118);function o(){return(new Date).getTime()}var a,s=Array.prototype.slice,u={};a=void 0!==r.g&&r.g.console?r.g.console:"undefined"!=typeof window&&window.console?window.console:{};for(var c=[[function(){},"log"],[function(){a.log.apply(a,arguments)},"info"],[function(){a.log.apply(a,arguments)},"warn"],[function(){a.warn.apply(a,arguments)},"error"],[function(t){u[t]=o()},"time"],[function(t){var e=u[t];if(!e)throw new Error("No such label: "+t);delete u[t];var r=o()-e;a.log(t+": "+r+"ms")},"timeEnd"],[function(){var t=new Error;t.name="Trace",t.message=n.format.apply(null,arguments),a.error(t.stack)},"trace"],[function(t){a.log(n.inspect(t)+"\n")},"dir"],[function(t){if(!t){var e=s.call(arguments,1);i.ok(!1,n.format.apply(null,e))}},"assert"]],l=0;l<c.length;l++){var h=c[l],f=h[0],p=h[1];a[p]||(a[p]=f)}t.exports=a},7297:function(t,e){var r="undefined"!=typeof self?self:this,n=function(){function t(){this.fetch=!1,this.DOMException=r.DOMException}return t.prototype=r,new t}();!function(t){!function(e){var r="URLSearchParams"in t,n="Symbol"in t&&"iterator"in Symbol,i="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),o="FormData"in t,a="ArrayBuffer"in t;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(t){return t&&s.indexOf(Object.prototype.toString.call(t))>-1};function c(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function l(t){return"string"!=typeof t&&(t=String(t)),t}function h(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n&&(e[Symbol.iterator]=function(){return e}),e}function f(t){this.map={},t instanceof f?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function p(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function d(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function y(t){var e=new FileReader,r=d(e);return e.readAsArrayBuffer(t),r}function v(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:i&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():a&&i&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=v(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(t)||u(t))?this._bodyArrayBuffer=v(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var t=p(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(y)}),this.text=function(){var t,e,r,n=p(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,r=d(e=new FileReader),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}f.prototype.append=function(t,e){t=c(t),e=l(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},f.prototype.delete=function(t){delete this.map[c(t)]},f.prototype.get=function(t){return t=c(t),this.has(t)?this.map[t]:null},f.prototype.has=function(t){return this.map.hasOwnProperty(c(t))},f.prototype.set=function(t,e){this.map[c(t)]=l(e)},f.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},f.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),h(t)},f.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),h(t)},f.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),h(t)},n&&(f.prototype[Symbol.iterator]=f.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(t,e){var r,n,i=(e=e||{}).body;if(t instanceof b){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new f(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,i||null==t._bodyInit||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new f(e.headers)),this.method=(n=(r=e.method||this.method||"GET").toUpperCase(),m.indexOf(n)>-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function w(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}})),e}function x(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new f(e.headers),this.url=e.url||"",this._initBody(t)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},g.call(b.prototype),g.call(x.prototype),x.prototype.clone=function(){return new x(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},x.error=function(){var t=new x(null,{status:0,statusText:""});return t.type="error",t};var _=[301,302,303,307,308];x.redirect=function(t,e){if(-1===_.indexOf(e))throw new RangeError("Invalid status code");return new x(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function T(t,r){return new Promise((function(n,o){var a=new b(t,r);if(a.signal&&a.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function u(){s.abort()}s.onload=function(){var t,e,r={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new f,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();e.append(n,i)}})),e)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;n(new x(i,r))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),a.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",u),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",u)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}T.polyfill=!0,t.fetch||(t.fetch=T,t.Headers=f,t.Request=b,t.Response=x),e.Headers=f,e.Request=b,e.Response=x,e.fetch=T,Object.defineProperty(e,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(e=i.fetch).default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e},9170:(t,e,r)=>{"use strict";var n=r(806),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,a=Array.prototype.concat,s=Object.defineProperty,u=r(8198)(),c=s&&u,l=function(t,e,r,n){var i;(!(e in t)||"function"==typeof(i=n)&&"[object Function]"===o.call(i)&&n())&&(c?s(t,e,{configurable:!0,enumerable:!1,value:r,writable:!0}):t[e]=r)},h=function(t,e){var r=arguments.length>2?arguments[2]:{},o=n(e);i&&(o=a.call(o,Object.getOwnPropertySymbols(e)));for(var s=0;s<o.length;s+=1)l(t,o[s],e[o[s]],r[o[s]])};h.supportsDescriptors=!!c,t.exports=h},1662:t=>{"use strict";function e(t,e){if(null==t)throw new TypeError("Cannot convert first argument to object");for(var r=Object(t),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var o=Object.keys(Object(i)),a=0,s=o.length;a<s;a++){var u=o[a],c=Object.getOwnPropertyDescriptor(i,u);void 0!==c&&c.enumerable&&(r[u]=i[u])}}return r}t.exports={assign:e,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:e})}}},4843:(t,e,r)=>{"use strict";var n=r(5443),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty,a=function(t,e,r){for(var n=0,i=t.length;n<i;n++)o.call(t,n)&&(null==r?e(t[n],n,t):e.call(r,t[n],n,t))},s=function(t,e,r){for(var n=0,i=t.length;n<i;n++)null==r?e(t.charAt(n),n,t):e.call(r,t.charAt(n),n,t)},u=function(t,e,r){for(var n in t)o.call(t,n)&&(null==r?e(t[n],n,t):e.call(r,t[n],n,t))};t.exports=function(t,e,r){if(!n(e))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=r),"[object Array]"===i.call(t)?a(t,e,o):"string"==typeof t?s(t,e,o):u(t,e,o)}},9930:t=>{"use strict";var e="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";t.exports=function(t){var o=this;if("function"!=typeof o||n.call(o)!==i)throw new TypeError(e+o);for(var a,s=r.call(arguments,1),u=function(){if(this instanceof a){var e=o.apply(this,s.concat(r.call(arguments)));return Object(e)===e?e:this}return o.apply(t,s.concat(r.call(arguments)))},c=Math.max(0,o.length-s.length),l=[],h=0;h<c;h++)l.push("$"+h);if(a=Function("binder","return function ("+l.join(",")+"){ return binder.apply(this,arguments); }")(u),o.prototype){var f=function(){};f.prototype=o.prototype,a.prototype=new f,f.prototype=null}return a}},1930:(t,e,r)=>{"use strict";var n=r(9930);t.exports=Function.prototype.bind||n},1801:(t,e,r)=>{"use strict";var n,i=SyntaxError,o=Function,a=TypeError,s=function(t){try{return o('"use strict"; return ('+t+").constructor;")()}catch(t){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(t){u=null}var c=function(){throw new a},l=u?function(){try{return c}catch(t){try{return u(arguments,"callee").get}catch(t){return c}}}():c,h=r(9905)(),f=Object.getPrototypeOf||function(t){return t.__proto__},p={},d="undefined"==typeof Uint8Array?n:f(Uint8Array),y={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":h?f([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h?f(f([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&h?f((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&h?f((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h?f(""[Symbol.iterator]()):n,"%Symbol%":h?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":l,"%TypedArray%":d,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};try{null.error}catch(t){var v=f(f(t));y["%Error.prototype%"]=v}var g=function t(e){var r;if("%AsyncFunction%"===e)r=s("async function () {}");else if("%GeneratorFunction%"===e)r=s("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=s("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(r=f(i.prototype))}return y[e]=r,r},m={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},b=r(1930),w=r(9284),x=b.call(Function.call,Array.prototype.concat),_=b.call(Function.apply,Array.prototype.splice),T=b.call(Function.call,String.prototype.replace),k=b.call(Function.call,String.prototype.slice),A=b.call(Function.call,RegExp.prototype.exec),E=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,O=/\\(\\)?/g,j=function(t){var e=k(t,0,1),r=k(t,-1);if("%"===e&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return T(t,E,(function(t,e,r,i){n[n.length]=r?T(i,O,"$1"):e||t})),n},N=function(t,e){var r,n=t;if(w(m,n)&&(n="%"+(r=m[n])[0]+"%"),w(y,n)){var o=y[n];if(o===p&&(o=g(n)),void 0===o&&!e)throw new a("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new a('"allowMissing" argument must be a boolean');if(null===A(/^%?[^%]*%?$/,t))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=j(t),n=r.length>0?r[0]:"",o=N("%"+n+"%",e),s=o.name,c=o.value,l=!1,h=o.alias;h&&(n=h[0],_(r,x([0,1],h)));for(var f=1,p=!0;f<r.length;f+=1){var d=r[f],v=k(d,0,1),g=k(d,-1);if(('"'===v||"'"===v||"`"===v||'"'===g||"'"===g||"`"===g)&&v!==g)throw new i("property names with quotes must have matching quotes");if("constructor"!==d&&p||(l=!0),w(y,s="%"+(n+="."+d)+"%"))c=y[s];else if(null!=c){if(!(d in c)){if(!e)throw new a("base intrinsic for "+t+" exists, but the property is not available.");return}if(u&&f+1>=r.length){var m=u(c,d);c=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:c[d]}else p=w(c,d),c=c[d];p&&!l&&(y[s]=c)}}return c}},3828:(t,e,r)=>{"use strict";var n=r(1801)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},8198:(t,e,r)=>{"use strict";var n=r(1801)("%Object.defineProperty%",!0),i=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};i.hasArrayLengthDefineBug=function(){if(!i())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=i},9905:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(5682);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},5682:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},4111:(t,e,r)=>{"use strict";var n=r(5682);t.exports=function(){return n()&&!!Symbol.toStringTag}},9284:(t,e,r)=>{"use strict";var n=r(1930);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},4525:(t,e)=>{e.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,c=u>>1,l=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+t[e+h],h+=f,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+t[e+h],h+=f,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=c}return(p?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,s,u,c=8*o-i-1,l=(1<<c)-1,h=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;t[r+p]=255&a,p+=d,a/=256,c-=8);t[r+p-d]|=128*y}},8575:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},7092:(t,e,r)=>{"use strict";var n=r(4111)(),i=r(7615)("Object.prototype.toString"),o=function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===i(t)},a=function(t){return!!o(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==i(t)&&"[object Function]"===i(t.callee)},s=function(){return o(arguments)}();o.isLegacyArguments=a,t.exports=s?o:a},5443:t=>{"use strict";var e,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,e)}catch(t){t!==r&&(i=null)}else i=null;var o=/^\s*class\b/,a=function(t){try{var e=n.call(t);return o.test(e)}catch(t){return!1}},s=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},u=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),h=function(){return!1};if("object"==typeof document){var f=document.all;u.call(f)===u.call(document.all)&&(h=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=u.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=i?function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{i(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&s(t)}:function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(c)return s(t);if(a(t))return!1;var e=u.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&s(t)}},7427:(t,e,r)=>{"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,a=/^\s*(?:function)?\*/,s=r(4111)(),u=Object.getPrototypeOf;t.exports=function(t){if("function"!=typeof t)return!1;if(a.test(o.call(t)))return!0;if(!s)return"[object GeneratorFunction]"===i.call(t);if(!u)return!1;if(void 0===n){var e=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&u(e)}return u(t)===n}},2100:t=>{"use strict";t.exports=function(t){return t!=t}},8622:(t,e,r)=>{"use strict";var n=r(2550),i=r(9170),o=r(2100),a=r(4358),s=r(6232),u=n(a(),Number);i(u,{getPolyfill:a,implementation:o,shim:s}),t.exports=u},4358:(t,e,r)=>{"use strict";var n=r(2100);t.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},6232:(t,e,r)=>{"use strict";var n=r(9170),i=r(4358);t.exports=function(){var t=i();return n(Number,{isNaN:t},{isNaN:function(){return Number.isNaN!==t}}),t}},2527:(t,e,r)=>{"use strict";var n=r(4843),i=r(4343),o=r(7615),a=o("Object.prototype.toString"),s=r(4111)(),u=r(3828),c="undefined"==typeof globalThis?r.g:globalThis,l=i(),h=o("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r<t.length;r+=1)if(t[r]===e)return r;return-1},f=o("String.prototype.slice"),p={},d=Object.getPrototypeOf;s&&u&&d&&n(l,(function(t){var e=new c[t];if(Symbol.toStringTag in e){var r=d(e),n=u(r,Symbol.toStringTag);if(!n){var i=d(r);n=u(i,Symbol.toStringTag)}p[t]=n.get}})),t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!s||!(Symbol.toStringTag in t)){var e=f(a(t),8,-1);return h(l,e)>-1}return!!u&&function(t){var e=!1;return n(p,(function(r,n){if(!e)try{e=r.call(t)===n}catch(t){}})),e}(t)}},8720:t=>{"use strict";var e=function(t){return t!=t};t.exports=function(t,r){return 0===t&&0===r?1/t==1/r:t===r||!(!e(t)||!e(r))}},7402:(t,e,r)=>{"use strict";var n=r(9170),i=r(2550),o=r(8720),a=r(5280),s=r(9129),u=i(a(),Object);n(u,{getPolyfill:a,implementation:o,shim:s}),t.exports=u},5280:(t,e,r)=>{"use strict";var n=r(8720);t.exports=function(){return"function"==typeof Object.is?Object.is:n}},9129:(t,e,r)=>{"use strict";var n=r(5280),i=r(9170);t.exports=function(){var t=n();return i(Object,{is:t},{is:function(){return Object.is!==t}}),t}},8383:(t,e,r)=>{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,a=r(4418),s=Object.prototype.propertyIsEnumerable,u=!s.call({toString:null},"toString"),c=s.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(t){var e=t.constructor;return e&&e.prototype===t},f={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!f["$"+t]&&i.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{h(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===o.call(t),n=a(t),s=e&&"[object String]"===o.call(t),f=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=c&&r;if(s&&t.length>0&&!i.call(t,0))for(var y=0;y<t.length;++y)f.push(String(y));if(n&&t.length>0)for(var v=0;v<t.length;++v)f.push(String(v));else for(var g in t)d&&"prototype"===g||!i.call(t,g)||f.push(String(g));if(u)for(var m=function(t){if("undefined"==typeof window||!p)return h(t);try{return h(t)}catch(t){return!1}}(t),b=0;b<l.length;++b)m&&"constructor"===l[b]||!i.call(t,l[b])||f.push(l[b]);return f}}t.exports=n},806:(t,e,r)=>{"use strict";var n=Array.prototype.slice,i=r(4418),o=Object.keys,a=o?function(t){return o(t)}:r(8383),s=Object.keys;a.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return i(t)?s(n.call(t)):s(t)})}else Object.keys=a;return Object.keys||a},t.exports=a},4418:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},2530:t=>{var e,r,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var s,u=[],c=!1,l=-1;function h(){c&&s&&(c=!1,s.length?u=s.concat(u):l=-1,u.length&&f())}function f(){if(!c){var t=a(h);c=!0;for(var e=u.length;e;){for(s=u,u=[];++l<e;)s&&s[l].run();l=-1,e=u.length}s=null,c=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function d(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new p(t,e)),1!==u.length||c||a(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=d,n.addListener=d,n.once=d,n.off=d,n.removeListener=d,n.removeAllListeners=d,n.emit=d,n.prependListener=d,n.prependOnceListener=d,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},6063:t=>{"use strict";function e(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,r,n,i){r=r||"&",n=n||"=";var o={};if("string"!=typeof t||0===t.length)return o;var a=/\+/g;t=t.split(r);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var u=t.length;s>0&&u>s&&(u=s);for(var c=0;c<u;++c){var l,h,f,p,d=t[c].replace(a,"%20"),y=d.indexOf(n);y>=0?(l=d.substr(0,y),h=d.substr(y+1)):(l=d,h=""),f=decodeURIComponent(l),p=decodeURIComponent(h),e(o,f)?Array.isArray(o[f])?o[f].push(p):o[f]=[o[f],p]:o[f]=p}return o}},1957:t=>{"use strict";var e=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,r,n,i){return r=r||"&",n=n||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(i){var o=encodeURIComponent(e(i))+n;return Array.isArray(t[i])?t[i].map((function(t){return o+encodeURIComponent(e(t))})).join(r):o+encodeURIComponent(e(t[i]))})).join(r):i?encodeURIComponent(e(i))+n+encodeURIComponent(e(t)):""}},5582:(t,e,r)=>{"use strict";e.decode=e.parse=r(6063),e.encode=e.stringify=r(1957)},5929:(t,e,r)=>{let n;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):t=>(n||(n=Promise.resolve())).then(t).catch((t=>setTimeout((()=>{throw t}),0)))},9523:t=>{const e={acl:"http://www.w3.org/ns/auth/acl#",arg:"http://www.w3.org/ns/pim/arg#",as:"https://www.w3.org/ns/activitystreams#",cal:"http://www.w3.org/2002/12/cal/ical#",cert:"http://www.w3.org/ns/auth/cert#",contact:"http://www.w3.org/2000/10/swap/pim/contact#",dc:"http://purl.org/dc/elements/1.1/",dct:"http://purl.org/dc/terms/",doap:"http://usefulinc.com/ns/doap#",foaf:"http://xmlns.com/foaf/0.1/",geo:"http://www.w3.org/2003/01/geo/wgs84_pos#",gpx:"http://www.w3.org/ns/pim/gpx#",http:"http://www.w3.org/2007/ont/http#",httph:"http://www.w3.org/2007/ont/httph#",icalTZ:"http://www.w3.org/2002/12/cal/icaltzd#",ldp:"http://www.w3.org/ns/ldp#",link:"http://www.w3.org/2007/ont/link#",log:"http://www.w3.org/2000/10/swap/log#",meeting:"http://www.w3.org/ns/pim/meeting#",mo:"http://purl.org/ontology/mo/",org:"http://www.w3.org/ns/org#",owl:"http://www.w3.org/2002/07/owl#",pad:"http://www.w3.org/ns/pim/pad#",patch:"http://www.w3.org/ns/pim/patch#",prov:"http://www.w3.org/ns/prov#",qu:"http://www.w3.org/2000/10/swap/pim/qif#",trip:"http://www.w3.org/ns/pim/trip#",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",rss:"http://purl.org/rss/1.0/",sched:"http://www.w3.org/ns/pim/schedule#",schema:"http://schema.org/",sioc:"http://rdfs.org/sioc/ns#",solid:"http://www.w3.org/ns/solid/terms#",space:"http://www.w3.org/ns/pim/space#",stat:"http://www.w3.org/ns/posix/stat#",tab:"http://www.w3.org/2007/ont/link#",tabont:"http://www.w3.org/2007/ont/link#",ui:"http://www.w3.org/ns/ui#",vcard:"http://www.w3.org/2006/vcard/ns#",wf:"http://www.w3.org/2005/01/wf/flow#",xsd:"http://www.w3.org/2001/XMLSchema#",cco:"http://www.ontologyrepository.com/CommonCoreOntologies/"};t.exports=function(t={namedNode:t=>t}){const r={};for(const n in e){const i=e[n];r[n]=function(e=""){return t.namedNode(i+e)}}return r}},8928:function(t,e,r){var n;t=r.nmd(t),function(i){e&&e.nodeType,t&&t.nodeType;var o="object"==typeof r.g&&r.g;o.global!==o&&o.window!==o&&o.self;var a,s=2147483647,u=36,c=/^xn--/,l=/[^\x20-\x7E]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,d=String.fromCharCode;function y(t){throw RangeError(f[t])}function v(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function g(t,e){var r=t.split("@"),n="";return r.length>1&&(n=r[0]+"@",t=r[1]),n+v((t=t.replace(h,".")).split("."),e).join(".")}function m(t){for(var e,r,n=[],i=0,o=t.length;i<o;)(e=t.charCodeAt(i++))>=55296&&e<=56319&&i<o?56320==(64512&(r=t.charCodeAt(i++)))?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),i--):n.push(e);return n}function b(t){return v(t,(function(t){var e="";return t>65535&&(e+=d((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+d(t)})).join("")}function w(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function x(t,e,r){var n=0;for(t=r?p(t/700):t>>1,t+=p(t/e);t>455;n+=u)t=p(t/35);return p(n+36*t/(t+38))}function _(t){var e,r,n,i,o,a,c,l,h,f,d,v=[],g=t.length,m=0,w=128,_=72;for((r=t.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)t.charCodeAt(n)>=128&&y("not-basic"),v.push(t.charCodeAt(n));for(i=r>0?r+1:0;i<g;){for(o=m,a=1,c=u;i>=g&&y("invalid-input"),((l=(d=t.charCodeAt(i++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:u)>=u||l>p((s-m)/a))&&y("overflow"),m+=l*a,!(l<(h=c<=_?1:c>=_+26?26:c-_));c+=u)a>p(s/(f=u-h))&&y("overflow"),a*=f;_=x(m-o,e=v.length+1,0==o),p(m/e)>s-w&&y("overflow"),w+=p(m/e),m%=e,v.splice(m++,0,w)}return b(v)}function T(t){var e,r,n,i,o,a,c,l,h,f,v,g,b,_,T,k=[];for(g=(t=m(t)).length,e=128,r=0,o=72,a=0;a<g;++a)(v=t[a])<128&&k.push(d(v));for(n=i=k.length,i&&k.push("-");n<g;){for(c=s,a=0;a<g;++a)(v=t[a])>=e&&v<c&&(c=v);for(c-e>p((s-r)/(b=n+1))&&y("overflow"),r+=(c-e)*b,e=c,a=0;a<g;++a)if((v=t[a])<e&&++r>s&&y("overflow"),v==e){for(l=r,h=u;!(l<(f=h<=o?1:h>=o+26?26:h-o));h+=u)T=l-f,_=u-f,k.push(d(w(f+T%_,0))),l=p(T/_);k.push(d(w(l,0))),o=x(r,b,n==i),r=0,++n}++r,++e}return k.join("")}a={version:"1.3.2",ucs2:{decode:m,encode:b},decode:_,encode:T,toASCII:function(t){return g(t,(function(t){return l.test(t)?"xn--"+T(t):t}))},toUnicode:function(t){return g(t,(function(t){return c.test(t)?_(t.slice(4).toLowerCase()):t}))}},void 0===(n=function(){return a}.call(e,r,e,t))||(t.exports=n)}()},4044:(t,e,r)=>{"use strict";var n=r(8928),i=r(944);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),h=["%","/","?",";","#"].concat(l),f=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,y={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=r(5582);o.prototype.parse=function(t,e,r){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),s=-1!==o&&o<t.indexOf("#")?"?":"#",c=t.split(s);c[0]=c[0].replace(/\\/g,"/");var b=t=c.join(s);if(b=b.trim(),!r&&1===t.split("#").length){var w=u.exec(b);if(w)return this.path=b,this.href=b,this.pathname=w[1],w[2]?(this.search=w[2],this.query=e?m.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var x=a.exec(b);if(x){var _=(x=x[0]).toLowerCase();this.protocol=_,b=b.substr(x.length)}if(r||x||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var T="//"===b.substr(0,2);!T||x&&v[x]||(b=b.substr(2),this.slashes=!0)}if(!v[x]&&(T||x&&!g[x])){for(var k,A,E=-1,O=0;O<f.length;O++)-1!==(j=b.indexOf(f[O]))&&(-1===E||j<E)&&(E=j);for(-1!==(A=-1===E?b.lastIndexOf("@"):b.lastIndexOf("@",E))&&(k=b.slice(0,A),b=b.slice(A+1),this.auth=decodeURIComponent(k)),E=-1,O=0;O<h.length;O++){var j;-1!==(j=b.indexOf(h[O]))&&(-1===E||j<E)&&(E=j)}-1===E&&(E=b.length),this.host=b.slice(0,E),b=b.slice(E),this.parseHost(),this.hostname=this.hostname||"";var N="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!N)for(var S=this.hostname.split(/\./),R=(O=0,S.length);O<R;O++){var I=S[O];if(I&&!I.match(p)){for(var C="",P=0,F=I.length;P<F;P++)I.charCodeAt(P)>127?C+="x":C+=I[P];if(!C.match(p)){var U=S.slice(0,O),L=S.slice(O+1),D=I.match(d);D&&(U.push(D[1]),L.unshift(D[2])),L.length&&(b="/"+L.join(".")+b),this.hostname=U.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),N||(this.hostname=n.toASCII(this.hostname));var M=this.port?":"+this.port:"",Z=this.hostname||"";this.host=Z+M,this.href+=this.host,N&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!y[_])for(O=0,R=l.length;O<R;O++){var B=l[O];if(-1!==b.indexOf(B)){var q=encodeURIComponent(B);q===B&&(q=escape(B)),b=b.split(B).join(q)}}var H=b.indexOf("#");-1!==H&&(this.hash=b.substr(H),b=b.slice(0,H));var $=b.indexOf("?");if(-1!==$?(this.search=b.substr($),this.query=b.substr($+1),e&&(this.query=m.parse(this.query)),b=b.slice(0,$)):e&&(this.search="",this.query={}),b&&(this.pathname=b),g[_]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){M=this.pathname||"";var z=this.search||"";this.path=M+z}return this.href=this.format(),this},o.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,a="";this.host?o=t+this.host:this.hostname&&(o=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(a=m.stringify(this.query));var s=this.search||a&&"?"+a||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||g[e])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),e+o+(r=r.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(s=s.replace("#","%23"))+n},o.prototype.resolve=function(t){return this.resolveObject(function(t,e,r){if(t&&i.isObject(t)&&t instanceof o)return t;var n=new o;return n.parse(t,e,r),n}(t,!1,!0)).format()},o.prototype.resolveObject=function(t){if(i.isString(t)){var e=new o;e.parse(t,!1,!0),t=e}for(var r=new o,n=Object.keys(this),a=0;a<n.length;a++){var s=n[a];r[s]=this[s]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var u=Object.keys(t),c=0;c<u.length;c++){var l=u[c];"protocol"!==l&&(r[l]=t[l])}return g[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!g[t.protocol]){for(var h=Object.keys(t),f=0;f<h.length;f++){var p=h[f];r[p]=t[p]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||v[t.protocol])r.pathname=t.pathname;else{for(var d=(t.pathname||"").split("/");d.length&&!(t.host=d.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),r.pathname=d.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var y=r.pathname||"",m=r.search||"";r.path=y+m}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var b=r.pathname&&"/"===r.pathname.charAt(0),w=t.host||t.pathname&&"/"===t.pathname.charAt(0),x=w||b||r.host&&t.pathname,_=x,T=r.pathname&&r.pathname.split("/")||[],k=(d=t.pathname&&t.pathname.split("/")||[],r.protocol&&!g[r.protocol]);if(k&&(r.hostname="",r.port=null,r.host&&(""===T[0]?T[0]=r.host:T.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===d[0]?d[0]=t.host:d.unshift(t.host)),t.host=null),x=x&&(""===d[0]||""===T[0])),w)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,T=d;else if(d.length)T||(T=[]),T.pop(),T=T.concat(d),r.search=t.search,r.query=t.query;else if(!i.isNullOrUndefined(t.search))return k&&(r.hostname=r.host=T.shift(),(N=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=N.shift(),r.host=r.hostname=N.shift())),r.search=t.search,r.query=t.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!T.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var A=T.slice(-1)[0],E=(r.host||t.host||T.length>1)&&("."===A||".."===A)||""===A,O=0,j=T.length;j>=0;j--)"."===(A=T[j])?T.splice(j,1):".."===A?(T.splice(j,1),O++):O&&(T.splice(j,1),O--);if(!x&&!_)for(;O--;O)T.unshift("..");!x||""===T[0]||T[0]&&"/"===T[0].charAt(0)||T.unshift(""),E&&"/"!==T.join("/").substr(-1)&&T.push("");var N,S=""===T[0]||T[0]&&"/"===T[0].charAt(0);return k&&(r.hostname=r.host=S?"":T.length?T.shift():"",(N=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=N.shift(),r.host=r.hostname=N.shift())),(x=x||r.host&&T.length)&&!S&&T.unshift(""),T.length?r.pathname=T.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var t=this.host,e=s.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},944:t=>{"use strict";t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},9397:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},4489:(t,e,r)=>{"use strict";var n=r(7092),i=r(7427),o=r(4010),a=r(2527);function s(t){return t.call.bind(t)}var u="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,l=s(Object.prototype.toString),h=s(Number.prototype.valueOf),f=s(String.prototype.valueOf),p=s(Boolean.prototype.valueOf);if(u)var d=s(BigInt.prototype.valueOf);if(c)var y=s(Symbol.prototype.valueOf);function v(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function g(t){return"[object Map]"===l(t)}function m(t){return"[object Set]"===l(t)}function b(t){return"[object WeakMap]"===l(t)}function w(t){return"[object WeakSet]"===l(t)}function x(t){return"[object ArrayBuffer]"===l(t)}function _(t){return"undefined"!=typeof ArrayBuffer&&(x.working?x(t):t instanceof ArrayBuffer)}function T(t){return"[object DataView]"===l(t)}function k(t){return"undefined"!=typeof DataView&&(T.working?T(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=i,e.isTypedArray=a,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):a(t)||k(t)},e.isUint8Array=function(t){return"Uint8Array"===o(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===o(t)},e.isUint16Array=function(t){return"Uint16Array"===o(t)},e.isUint32Array=function(t){return"Uint32Array"===o(t)},e.isInt8Array=function(t){return"Int8Array"===o(t)},e.isInt16Array=function(t){return"Int16Array"===o(t)},e.isInt32Array=function(t){return"Int32Array"===o(t)},e.isFloat32Array=function(t){return"Float32Array"===o(t)},e.isFloat64Array=function(t){return"Float64Array"===o(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===o(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===o(t)},g.working="undefined"!=typeof Map&&g(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(g.working?g(t):t instanceof Map)},m.working="undefined"!=typeof Set&&m(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(m.working?m(t):t instanceof Set)},b.working="undefined"!=typeof WeakMap&&b(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(b.working?b(t):t instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),e.isWeakSet=function(t){return w(t)},x.working="undefined"!=typeof ArrayBuffer&&x(new ArrayBuffer),e.isArrayBuffer=_,T.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&T(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=k;var A="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function E(t){return"[object SharedArrayBuffer]"===l(t)}function O(t){return void 0!==A&&(void 0===E.working&&(E.working=E(new A)),E.working?E(t):t instanceof A)}function j(t){return v(t,h)}function N(t){return v(t,f)}function S(t){return v(t,p)}function R(t){return u&&v(t,d)}function I(t){return c&&v(t,y)}e.isSharedArrayBuffer=O,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===l(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===l(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===l(t)},e.isGeneratorObject=function(t){return"[object Generator]"===l(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===l(t)},e.isNumberObject=j,e.isStringObject=N,e.isBooleanObject=S,e.isBigIntObject=R,e.isSymbolObject=I,e.isBoxedPrimitive=function(t){return j(t)||N(t)||S(t)||R(t)||I(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(_(t)||O(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},5663:(t,e,r)=>{var n=r(2530),i=r(292),o=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},a=/%[sdj%]/g;e.format=function(t){if(!w(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(l(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,i=n.length,o=String(t).replace(a,(function(t){if("%%"===t)return"%";if(r>=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),s=n[r];r<i;s=n[++r])m(s)||!T(s)?o+=" "+s:o+=" "+l(s);return o},e.deprecate=function(t,r){if(void 0!==n&&!0===n.noDeprecation)return t;if(void 0===n)return function(){return e.deprecate(t,r).apply(this,arguments)};var o=!1;return function(){if(!o){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?i.trace(r):i.error(r),o=!0}return t.apply(this,arguments)}};var s={},u=/^$/;if(n.env.NODE_DEBUG){var c=n.env.NODE_DEBUG;c=c.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),u=new RegExp("^"+c+"$","i")}function l(t,r){var n={seen:[],stylize:f};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&e._extend(n,r),x(n.showHidden)&&(n.showHidden=!1),x(n.depth)&&(n.depth=2),x(n.colors)&&(n.colors=!1),x(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=h),p(n,t,n.depth)}function h(t,e){var r=l.styles[e];return r?"["+l.colors[r][0]+"m"+t+"["+l.colors[r][1]+"m":t}function f(t,e){return t}function p(t,r,n){if(t.customInspect&&r&&E(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return w(i)||(i=p(t,i,n)),i}var o=function(t,e){if(x(e))return t.stylize("undefined","undefined");if(w(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return b(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):m(e)?t.stylize("null","null"):void 0}(t,r);if(o)return o;var a=Object.keys(r),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(r)),A(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return d(r);if(0===a.length){if(E(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(_(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(k(r))return t.stylize(Date.prototype.toString.call(r),"date");if(A(r))return d(r)}var c,l="",h=!1,f=["{","}"];return v(r)&&(h=!0,f=["[","]"]),E(r)&&(l=" [Function"+(r.name?": "+r.name:"")+"]"),_(r)&&(l=" "+RegExp.prototype.toString.call(r)),k(r)&&(l=" "+Date.prototype.toUTCString.call(r)),A(r)&&(l=" "+d(r)),0!==a.length||h&&0!=r.length?n<0?_(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=h?function(t,e,r,n,i){for(var o=[],a=0,s=e.length;a<s;++a)R(e,String(a))?o.push(y(t,e,r,n,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(y(t,e,r,n,i,!0))})),o}(t,r,n,s,a):a.map((function(e){return y(t,r,n,s,e,h)})),t.seen.pop(),function(t,e,r){return t.reduce((function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(c,l,f)):f[0]+l+f[1]}function d(t){return"["+Error.prototype.toString.call(t)+"]"}function y(t,e,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),R(n,i)||(a="["+i+"]"),s||(t.seen.indexOf(u.value)<0?(s=m(r)?p(t,u.value,null):p(t,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(t){return" "+t})).join("\n").slice(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),x(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function v(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function m(t){return null===t}function b(t){return"number"==typeof t}function w(t){return"string"==typeof t}function x(t){return void 0===t}function _(t){return T(t)&&"[object RegExp]"===O(t)}function T(t){return"object"==typeof t&&null!==t}function k(t){return T(t)&&"[object Date]"===O(t)}function A(t){return T(t)&&("[object Error]"===O(t)||t instanceof Error)}function E(t){return"function"==typeof t}function O(t){return Object.prototype.toString.call(t)}function j(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!s[t])if(u.test(t)){var r=n.pid;s[t]=function(){var n=e.format.apply(e,arguments);i.error("%s %d: %s",t,r,n)}}else s[t]=function(){};return s[t]},e.inspect=l,l.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(4489),e.isArray=v,e.isBoolean=g,e.isNull=m,e.isNullOrUndefined=function(t){return null==t},e.isNumber=b,e.isString=w,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=x,e.isRegExp=_,e.types.isRegExp=_,e.isObject=T,e.isDate=k,e.types.isDate=k,e.isError=A,e.types.isNativeError=A,e.isFunction=E,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(9397);var N=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function S(){var t=new Date,e=[j(t.getHours()),j(t.getMinutes()),j(t.getSeconds())].join(":");return[t.getDate(),N[t.getMonth()],e].join(" ")}function R(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){i.log("%s - %s",S(),e.format.apply(e,arguments))},e.inherits=r(8575),e._extend=function(t,e){if(!e||!T(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var I="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function C(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(I&&t[I]){var e;if("function"!=typeof(e=t[I]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,I,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(t,n){t?r(t):e(n)}));try{t.apply(this,i)}catch(t){r(t)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),I&&Object.defineProperty(e,I,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,o(t))},e.promisify.custom=I,e.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function e(){for(var e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);var i=e.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,a=function(){return i.apply(o,arguments)};t.apply(this,e).then((function(t){n.nextTick(a.bind(null,null,t))}),(function(t){n.nextTick(C.bind(null,t,a))}))}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,o(t)),e}},4010:(t,e,r)=>{"use strict";var n=r(4843),i=r(4343),o=r(7615),a=r(3828),s=o("Object.prototype.toString"),u=r(4111)(),c="undefined"==typeof globalThis?r.g:globalThis,l=i(),h=o("String.prototype.slice"),f={},p=Object.getPrototypeOf;u&&a&&p&&n(l,(function(t){if("function"==typeof c[t]){var e=new c[t];if(Symbol.toStringTag in e){var r=p(e),n=a(r,Symbol.toStringTag);if(!n){var i=p(r);n=a(i,Symbol.toStringTag)}f[t]=n.get}}}));var d=r(2527);t.exports=function(t){return!!d(t)&&(u&&Symbol.toStringTag in t?function(t){var e=!1;return n(f,(function(r,n){if(!e)try{var i=r.call(t);i===n&&(e=i)}catch(t){}})),e}(t):h(s(t),8,-1))}},870:e=>{"use strict";e.exports=t},3333:(t,e,r)=>{var n=r(2125).default;function i(){"use strict";t.exports=i=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var e={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof y?e:y,o=Object.create(i.prototype),s=new j(n||[]);return a(o,"_invoke",{value:k(t,r,s)}),o}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var d={};function y(){}function v(){}function g(){}var m={};h(m,u,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(N([])));w&&w!==r&&o.call(w,u)&&(m=w);var x=g.prototype=y.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){function r(i,a,s,u){var c=p(t[i],t,a);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==n(h)&&o.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,s,u)}),(function(t){r("throw",t,s,u)})):e.resolve(h).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,u)}))}u(c.arg)}var i;a(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}})}function k(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return{value:void 0,done:!0}}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=A(a,r);if(s){if(s===d)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=p(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===d)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function A(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,A(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var i=p(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,d;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function N(t){if(t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(o.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:S}}function S(){return{value:void 0,done:!0}}return v.prototype=g,a(x,"constructor",{value:g,configurable:!0}),a(g,"constructor",{value:v,configurable:!0}),v.displayName=h(g,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,h(t,l,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},_(T.prototype),h(T.prototype,c,(function(){return this})),e.AsyncIterator=T,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new T(f(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(x),h(x,l,"Generator"),h(x,u,(function(){return this})),h(x,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=N,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;O(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:N(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},2125:t=>{function e(r){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},8047:(t,e,r)=>{var n=r(3333)();t.exports=n;try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},4343:(t,e,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e<n.length;e++)"function"==typeof i[n[e]]&&(t[t.length]=n[e]);return t}},4771:(t,e,r)=>{"use strict";function n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}r.d(e,{Z:()=>n})},7061:(t,e,r)=>{"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.d(e,{Z:()=>n})},9900:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(8965);function i(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(0,n.Z)(i.key),i)}}function o(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}},240:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(8965);function i(t,e,r){return(e=(0,n.Z)(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}},886:(t,e,r)=>{"use strict";function n(t){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},n(t)}r.d(e,{Z:()=>n})},4768:(t,e,r)=>{"use strict";function n(t,e){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},n(t,e)}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&n(t,e)}r.d(e,{Z:()=>i})},4593:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(7209),i=r(4771);function o(t,e){if(e&&("object"===(0,n.Z)(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return(0,i.Z)(t)}},8965:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(7209);function i(t){var e=function(t,e){if("object"!==(0,n.Z)(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!==(0,n.Z)(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===(0,n.Z)(e)?e:String(e)}},7209:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}r.d(e,{Z:()=>n})}},a={};function s(t){var e=a[t];if(void 0!==e)return e.exports;var r=a[t]={id:t,loaded:!1,exports:{}};return o[t].call(r.exports,r,r.exports,s),r.loaded=!0,r.exports}s.m=o,s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},r=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,s.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if("object"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&"function"==typeof t.then)return t}var i=Object.create(null);s.r(i);var o={};e=e||[null,r({}),r([]),r(r)];for(var a=2&n&&t;"object"==typeof a&&!~e.indexOf(a);a=r(a))Object.getOwnPropertyNames(a).forEach((e=>o[e]=()=>t[e]));return o.default=()=>t,s.d(i,o),i},s.d=(t,e)=>{for(var r in e)s.o(e,r)&&!s.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},s.f={},s.e=t=>Promise.all(Object.keys(s.f).reduce(((e,r)=>(s.f[r](t,e),e)),[])),s.u=t=>t+".rdflib.min.js",s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),s.hmd=t=>((t=Object.create(t)).children||(t.children=[]),Object.defineProperty(t,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+t.id)}}),t),s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n={},i="$rdf:",s.l=(t,e,r,o)=>{if(n[t])n[t].push(e);else{var a,u;if(void 0!==r)for(var c=document.getElementsByTagName("script"),l=0;l<c.length;l++){var h=c[l];if(h.getAttribute("src")==t||h.getAttribute("data-webpack")==i+r){a=h;break}}a||(u=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,s.nc&&a.setAttribute("nonce",s.nc),a.setAttribute("data-webpack",i+r),a.src=t),n[t]=[e];var f=(e,r)=>{a.onerror=a.onload=null,clearTimeout(p);var i=n[t];if(delete n[t],a.parentNode&&a.parentNode.removeChild(a),i&&i.forEach((t=>t(r))),e)return e(r)},p=setTimeout(f.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=f.bind(null,a.onerror),a.onload=f.bind(null,a.onload),u&&document.head.appendChild(a)}},s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{var t;s.g.importScripts&&(t=s.g.location+"");var e=s.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");r.length&&(t=r[r.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=t})(),(()=>{var t={179:0};s.f.j=(e,r)=>{var n=s.o(t,e)?t[e]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise(((r,i)=>n=t[e]=[r,i]));r.push(n[2]=i);var o=s.p+s.u(e),a=new Error;s.l(o,(r=>{if(s.o(t,e)&&(0!==(n=t[e])&&(t[e]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src;a.message="Loading chunk "+e+" failed.\n("+i+": "+o+")",a.name="ChunkLoadError",a.type=i,a.request=o,n[1](a)}}),"chunk-"+e,e)}};var e=(e,r)=>{var n,i,[o,a,u]=r,c=0;if(o.some((e=>0!==t[e]))){for(n in a)s.o(a,n)&&(s.m[n]=a[n]);u&&u(s)}for(e&&e(r);c<o.length;c++)i=o[c],s.o(t,i)&&t[i]&&t[i][0](),t[i]=0},r=self.webpackChunk$rdf=self.webpackChunk$rdf||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))})();var u={};return(()=>{"use strict";s.r(u),s.d(u,{BlankNode:()=>p,Collection:()=>w,ConnectedStore:()=>Cr,DataFactory:()=>fr,Empty:()=>x,Fetcher:()=>rr,Formula:()=>nt,IndexedFormula:()=>gt,Literal:()=>m,LiveStore:()=>Pr,N3Parser:()=>Bt,NamedNode:()=>y.Z,Namespace:()=>Z,NextId:()=>Ir,Node:()=>it,Query:()=>st,RDFParser:()=>Pe,RDFaProcessor:()=>Ie,SPARQLToQuery:()=>or,Serializer:()=>V,Statement:()=>R,Store:()=>gt,UpdateManager:()=>ur,UpdatesSocket:()=>pr,UpdatesVia:()=>dr,Util:()=>B,Variable:()=>F,blankNode:()=>kr,defaultGraph:()=>Ar,fetcher:()=>mr,fromNT:()=>Sr,graph:()=>br,isBlankNode:()=>v.B2,isCollection:()=>v.uZ,isGraph:()=>v.NA,isLiteral:()=>v.n_,isNamedNode:()=>v.NX,isPredicate:()=>v.lx,isQuad:()=>v.PY,isRDFObject:()=>v.lt,isRDFlibObject:()=>v.Uc,isRDFlibPredicate:()=>v.nq,isRDFlibSubject:()=>v.f,isStatement:()=>v.Yi,isStore:()=>v.Pv,isSubject:()=>v.zz,isTerm:()=>v.jt,isVariable:()=>v.cG,jsonParser:()=>nr,lit:()=>wr,literal:()=>Er,log:()=>M.Z,namedNode:()=>_r,parse:()=>Ue,quad:()=>Or,queryToSPARQL:()=>ir,serialize:()=>W,sparqlUpdateParser:()=>Fe,st:()=>xr,sym:()=>_r,term:()=>Rr,termValue:()=>Me._,triple:()=>jr,uri:()=>I,variable:()=>Tr});var t=s(9900),e=s(7061),r=s(4771),n=s(4768),i=s(4593),o=s(886),a=s(240),c=s(8333),l=s(4806),h=s(9247),f=s(292);var p=function(s){(0,n.Z)(d,s);var u,l,p=(u=d,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,o.Z)(u);if(l){var r=(0,o.Z)(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return(0,i.Z)(this,t)});function d(t){var n;return(0,e.Z)(this,d),n=p.call(this,d.getId(t)),(0,a.Z)((0,r.Z)(n),"termType",h.V1),(0,a.Z)((0,r.Z)(n),"classOrder",c.Z.BlankNode),(0,a.Z)((0,r.Z)(n),"isBlank",1),(0,a.Z)((0,r.Z)(n),"isVar",1),n}return(0,t.Z)(d,[{key:"id",get:function(){return this.value},set:function(t){this.value=t}},{key:"compareTerm",value:function(t){return this.classOrder<t.classOrder?-1:this.classOrder>t.classOrder?1:this.id<t.id?-1:this.id>t.id?1:0}},{key:"copy",value:function(t){var e=new d;return t.copyTo(this,e),e}},{key:"toCanonical",value:function(){return d.NTAnonymousNodePrefix+this.value}},{key:"toString",value:function(){return d.NTAnonymousNodePrefix+this.id}}],[{key:"getId",value:function(t){if(t){if("string"!=typeof t)throw f.log("Bad blank id:",t),new Error("Bad id argument to new blank node: "+t);if(t.includes("#")){var e=t.split("#");return e[e.length-1]}return t}return"n"+d.nextId++}}]),d}(l.Z);(0,a.Z)(p,"nextId",0),(0,a.Z)(p,"NTAnonymousNodePrefix","_:");var d=s(7209),y=s(6545),v=s(5904);const g={boolean:new y.Z("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:new y.Z("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:new y.Z("http://www.w3.org/2001/XMLSchema#decimal"),double:new y.Z("http://www.w3.org/2001/XMLSchema#double"),integer:new y.Z("http://www.w3.org/2001/XMLSchema#integer"),langString:new y.Z("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:new y.Z("http://www.w3.org/2001/XMLSchema#string")};var m=function(s){(0,n.Z)(p,s);var u,l,f=(u=p,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,o.Z)(u);if(l){var r=(0,o.Z)(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return(0,i.Z)(this,t)});function p(t,n,i){var o;return(0,e.Z)(this,p),o=f.call(this,t),(0,a.Z)((0,r.Z)(o),"termType",h.xH),(0,a.Z)((0,r.Z)(o),"classOrder",c.Z.Literal),(0,a.Z)((0,r.Z)(o),"datatype",g.string),(0,a.Z)((0,r.Z)(o),"isVar",0),(0,a.Z)((0,r.Z)(o),"language",""),n?(o.language=n,o.datatype=g.langString):o.datatype=i?y.Z.fromValue(i):g.string,o}return(0,t.Z)(p,[{key:"copy",value:function(){return new p(this.value,this.lang,this.datatype)}},{key:"equals",value:function(t){return!!t&&this.termType===t.termType&&this.value===t.value&&this.language===t.language&&(!this.datatype&&!t.datatype||this.datatype&&this.datatype.equals(t.datatype))}},{key:"lang",get:function(){return this.language},set:function(t){this.language=t||""}},{key:"toNT",value:function(){return p.toNT(this)}},{key:"toString",value:function(){return""+this.value}}],[{key:"toNT",value:function(t){if("number"==typeof t.value)return""+t.value;if("string"!=typeof t.value)throw new Error("Value of RDF literal is not string or number: "+t.value);var e=t.value;return e='"'+(e=(e=(e=(e=e.replace(/\\/g,"\\\\")).replace(/\"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r"))+'"',t.language?e+="@"+t.language:t.datatype.equals(g.string)||(e+="^^"+t.datatype.toCanonical()),e}},{key:"fromBoolean",value:function(t){return new p(t?"1":"0",null,g.boolean)}},{key:"fromDate",value:function(t){if(!(t instanceof Date))throw new TypeError("Invalid argument to Literal.fromDate()");var e=function(t){return(""+(100+t)).slice(1,3)};return new p(t.getUTCFullYear()+"-"+e(t.getUTCMonth()+1)+"-"+e(t.getUTCDate())+"T"+e(t.getUTCHours())+":"+e(t.getUTCMinutes())+":"+e(t.getUTCSeconds())+"Z",null,g.dateTime)}},{key:"fromNumber",value:function(t){if("number"!=typeof t)throw new TypeError("Invalid argument to Literal.fromNumber()");var e,r=t.toString();return e=r.indexOf("e")<0&&Math.abs(t)<=Number.MAX_SAFE_INTEGER?Number.isInteger(t)?g.integer:g.decimal:g.double,new p(r,null,e)}},{key:"fromValue",value:function(t){if((0,v.n_)(t))return t;switch((0,d.Z)(t)){case"object":if(t instanceof Date)return p.fromDate(t);case"boolean":return p.fromBoolean(t);case"number":return p.fromNumber(t);case"string":return new p(t)}throw new Error("Can't make literal from "+t+" of type "+(0,d.Z)(t))}}]),p}(l.Z);function b(t){return null==t||(0,v.jt)(t)?t:Array.isArray(t)?new w(t):m.fromValue(t)}var w=function(s){(0,n.Z)(d,s);var u,l,f=(u=d,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,o.Z)(u);if(l){var r=(0,o.Z)(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return(0,i.Z)(this,t)});function d(t){var n;return(0,e.Z)(this,d),n=f.call(this,(p.nextId++).toString()),(0,a.Z)((0,r.Z)(n),"termType",h.fb),(0,a.Z)((0,r.Z)(n),"classOrder",c.Z.Collection),(0,a.Z)((0,r.Z)(n),"closed",!1),(0,a.Z)((0,r.Z)(n),"compareTerm",p.prototype.compareTerm),(0,a.Z)((0,r.Z)(n),"elements",[]),(0,a.Z)((0,r.Z)(n),"isVar",0),t&&t.length>0&&t.forEach((function(t){n.elements.push(b(t))})),n}return(0,t.Z)(d,[{key:"id",get:function(){return this.value},set:function(t){this.value=t}},{key:"append",value:function(t){return this.elements.push(t)}},{key:"close",value:function(){return this.closed=!0,this.closed}},{key:"shift",value:function(){return this.elements.shift()}},{key:"substitute",value:function(t){return new d(this.elements.map((function(e){return e.substitute(t)})))}},{key:"toNT",value:function(){return d.toNT(this)}},{key:"toString",value:function(){return"("+this.elements.join(" ")+")"}},{key:"unshift",value:function(t){return this.elements.unshift(t)}}],[{key:"toNT",value:function(t){return p.NTAnonymousNodePrefix+t.id}}]),d}(l.Z);(0,a.Z)(w,"termType",h.fb);var x=function(s){(0,n.Z)(f,s);var u,c,l=(u=f,c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,o.Z)(u);if(c){var r=(0,o.Z)(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return(0,i.Z)(this,t)});function f(){var t;return(0,e.Z)(this,f),t=l.call(this,""),(0,a.Z)((0,r.Z)(t),"termType",h.ls),t}return(0,t.Z)(f,[{key:"toString",value:function(){return"()"}}]),f}(l.Z);function _(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function T(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){_(o,n,i,a,s,"next",t)}function s(t){_(o,n,i,a,s,"throw",t)}a(void 0)}))}}var k=s(8047),A=s.n(k),E="chrome:theSession";new y.Z(E);var O=function(s){(0,n.Z)(f,s);var u,c,l=(u=f,c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,o.Z)(u);if(c){var r=(0,o.Z)(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return(0,i.Z)(this,t)});function f(){var t;return(0,e.Z)(this,f),t=l.call(this,""),(0,a.Z)((0,r.Z)(t),"value",""),(0,a.Z)((0,r.Z)(t),"termType",h.NK),(0,a.Z)((0,r.Z)(t),"uri",E),t}return(0,t.Z)(f,[{key:"toCanonical",value:function(){return this.value}},{key:"toString",value:function(){return"DefaultGraph"}}]),f}(l.Z);function j(t){return!!t&&t.termType===h.NK}var N=s(292),S=new O,R=function(){function r(t,n,i,o){(0,e.Z)(this,r),(0,a.Z)(this,"subject",void 0),(0,a.Z)(this,"predicate",void 0),(0,a.Z)(this,"object",void 0),(0,a.Z)(this,"graph",void 0),this.subject=l.Z.fromValue(t),this.predicate=l.Z.fromValue(n),this.object=l.Z.fromValue(i),this.graph=null==o?S:l.Z.fromValue(o)}return(0,t.Z)(r,[{key:"why",get:function(){return this.graph},set:function(t){this.graph=t}},{key:"equals",value:function(t){return t.subject.equals(this.subject)&&t.predicate.equals(this.predicate)&&t.object.equals(this.object)&&t.graph.equals(this.graph)}},{key:"substitute",value:function(t){var e=new r(this.subject.substitute(t),this.predicate.substitute(t),this.object.substitute(t),j(this.graph)?this.graph:this.graph.substitute(t));return N.log("@@@ statement substitute:"+e),e}},{key:"toCanonical",value:function(){var t=[this.subject.toCanonical(),this.predicate.toCanonical(),this.object.toCanonical()];return this.graph&&this.graph.termType!==h.NK&&t.push(this.graph.toCanonical()),t.join(" ")+" ."}},{key:"toNT",value:function(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT()].join(" ")+" ."}},{key:"toNQ",value:function(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT(),j(this.graph)?"":this.graph.toNT()].join(" ")+" ."}},{key:"toString",value:function(){return this.toNT()}}]),r}(),I=s(3357);var C,P,F=function(s){(0,n.Z)(p,s);var u,l,f=(u=p,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,o.Z)(u);if(l){var r=(0,o.Z)(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return(0,i.Z)(this,t)});function p(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,e.Z)(this,p),t=f.call(this,n),(0,a.Z)((0,r.Z)(t),"termType",h.UH),(0,a.Z)((0,r.Z)(t),"base","varid:"),(0,a.Z)((0,r.Z)(t),"classOrder",c.Z.Variable),(0,a.Z)((0,r.Z)(t),"isVar",1),(0,a.Z)((0,r.Z)(t),"uri",void 0),t.base="varid:",t.uri=I.join(n,t.base),t}return(0,t.Z)(p,[{key:"equals",value:function(t){return!!t&&this.termType===t.termType&&this.value===t.value}},{key:"hashString",value:function(){return this.toString()}},{key:"substitute",value:function(t){var e;return null!=(e=t[this.toNT()])?e:this}},{key:"toString",value:function(){return p.toString(this)}}],[{key:"toString",value:function(t){return t.uri.slice(0,t.base.length)===t.base?"?".concat(t.uri.slice(t.base.length)):"?".concat(t.uri)}}]),p}(l.Z);!function(t){t.collections="COLLECTIONS",t.defaultGraphType="DEFAULT_GRAPH_TYPE",t.equalsMethod="EQUALS_METHOD",t.id="ID",t.identity="IDENTITY",t.reversibleId="REVERSIBLE_ID",t.variableType="VARIABLE_TYPE"}(C||(C={}));var U=new O,L={supports:(P={},(0,a.Z)(P,C.collections,!1),(0,a.Z)(P,C.defaultGraphType,!1),(0,a.Z)(P,C.equalsMethod,!0),(0,a.Z)(P,C.identity,!1),(0,a.Z)(P,C.id,!0),(0,a.Z)(P,C.reversibleId,!1),(0,a.Z)(P,C.variableType,!0),P),blankNode:function(t){return new p(t)},defaultGraph:function(){return U},equals:function(t,e){return t===e||!t||!e||((0,v.PY)(t)||(0,v.PY)(e)?!(!(0,v.PY)(t)||!(0,v.PY)(e))&&this.equals(t.subject,e.subject)&&this.equals(t.predicate,e.predicate)&&this.equals(t.object,e.object)&&this.equals(t.graph,e.graph):!(!(0,v.jt)(t)||!(0,v.jt)(e))&&this.id(t)===this.id(e))},id:function(t){if(!t)return"undefined";if((0,v.PY)(t))return this.quadToNQ(t);switch(t.termType){case h.NK:return"defaultGraph";case h.UH:return F.toString(t);default:var e=this.termToNQ(t);if(e)return e;throw new Error("Can't id term with type '".concat(t.termType,"'"))}},isQuad:function(t){return t instanceof R},literal:function(t,e){if("string"!=typeof t&&!e)return m.fromValue(t);var r="string"==typeof t?t:""+t;return"string"==typeof e?-1===e.indexOf(":")?new m(r,e):new m(r,null,this.namedNode(e)):new m(r,null,e)},namedNode:function(t){return new y.Z(t)},quad:function(t,e,r,n){return new R(t,e,r,n||U)},triple:function(t,e,r,n){return this.quad(t,e,r,n)},quadToNQ:function(t){return"".concat(this.termToNQ(t.subject)," ").concat(this.termToNQ(t.predicate)," ").concat(this.termToNQ(t.object)," ").concat(this.termToNQ(t.graph)," .")},termToNQ:function(t){var e=this;switch(t.termType){case h.V1:return"_:"+t.value;case h.NK:return"";case h.ls:return"<http://www.w3.org/1999/02/22-rdf-syntax-ns#nil>";case h.xH:return m.toNT(t);case h._A:case h.XM:return"<"+t.value+">";case h.fb:return"("+t.elements.map((function(t){return e.termToNQ(t)})).join(" ")+")";default:throw new Error("Can't serialize nonstandard term type (was '".concat(t.termType,"')"))}},toNQ:function(t){return this.isQuad(t)?this.quadToNQ(t):this.termToNQ(t)},variable:function(t){return new F(t)}};const D=L;var M=s(7308);function Z(t,e){var r=e||{namedNode:function(t){return new y.Z(t)}};return function(e){return r.namedNode(t+(e||""))}}var B=s(5115);function q(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D;return{boolean:t.namedNode("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:t.namedNode("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:t.namedNode("http://www.w3.org/2001/XMLSchema#decimal"),double:t.namedNode("http://www.w3.org/2001/XMLSchema#double"),integer:t.namedNode("http://www.w3.org/2001/XMLSchema#integer"),langString:t.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:t.namedNode("http://www.w3.org/2001/XMLSchema#string")}}q(D);var H=s(9523),$=s.n(H),z=s(5619),X=s(292);function V(t){return new G(t)}var G=function(){function r(t){(0,e.Z)(this,r),(0,a.Z)(this,"_notQNameChars","\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~"),(0,a.Z)(this,"_notNameChars",this._notQNameChars+":"),(0,a.Z)(this,"validPrefix",new RegExp(/^[a-zA-Z][a-zA-Z0-9]*$/)),(0,a.Z)(this,"forbidden1",new RegExp(/[\\"\b\f\r\v\t\n\u0080-\uffff]/gm)),(0,a.Z)(this,"forbidden3",new RegExp(/[\\"\b\f\r\v\u0080-\uffff]/gm)),this.flags="",this.base=null,this.prefixes=[],this.namespaces=[];var n=Object.keys($()());for(var i in n){var o=$()()[n[i]](""),s=n[i];this.prefixes[o]=s,this.namespaces[s]=o}this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.suggestPrefix("xml","reserved:reservedForFutureUse"),this.namespacesUsed=[],this.keywords=["a"],this.prefixchars="abcdefghijklmnopqustuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",this.incoming=null,this.formulas=[],this.store=t,this.rdfFactory=t.rdfFactory||D,this.xsd=q(this.rdfFactory)}return(0,t.Z)(r,[{key:"setBase",value:function(t){return this.base=t,this}},{key:"setFlags",value:function(t){return this.flags=t||"",this}},{key:"toStr",value:function(t){var e=t.toNT();return"Graph"===t.termType&&(this.formulas[e]=t),e}},{key:"fromStr",value:function(t){if("{"===t[0]){var e=this.formulas[t];return e||X.log("No formula object for "+t),e}return this.store.fromNT(t)}},{key:"setNamespaces",value:function(t){for(var e in t)this.setPrefix(e,t[e]);return this}},{key:"setPrefix",value:function(t,e){if("default"!==t.slice(0,7)&&"ns"!==t.slice(0,2)&&t&&e){for(var r in this.prefixes)this.prefixes[r]==t&&delete this.prefixes[r];this.prefixes[e]=t,this.namespaces[t]=e}}},{key:"suggestPrefix",value:function(t,e){"default"!==t.slice(0,7)&&"ns"!==t.slice(0,2)&&t&&e&&(t in this.namespaces||e in this.prefixes||(this.prefixes[e]=t,this.namespaces[t]=e))}},{key:"suggestNamespaces",value:function(t){for(var e in t)this.suggestPrefix(e,t[e]);return this}},{key:"checkIntegrity",value:function(){var t,e;for(t in this.namespaces)if(this.prefixes[this.namespaces[t]]!==t)throw new Error("Serializer integity error 1: "+t+", "+this.namespaces[t]+", "+this.prefixes[this.namespaces[t]]+"!");for(e in this.prefixes)if(this.namespaces[this.prefixes[e]]!==e)throw new Error("Serializer integity error 2: "+e+", "+this.prefixs[e]+", "+this.namespaces[this.prefixes[e]]+"!")}},{key:"makeUpPrefix",value:function(t){var e=t,r=function(e){return!!this.validPrefix.test(e)&&"ns"!==e&&!(e in this.namespaces)&&(this.prefixes[t]=e,this.namespaces[e]=t,e)}.bind(this);"#/".indexOf(e[e.length-1])>=0&&(e=e.slice(0,-1));var n=e.lastIndexOf("/");n>=0&&(e=e.slice(n+1));for(var i=0;i<e.length&&this.prefixchars.indexOf(e[i]);)i++;if((e=e.slice(0,i)).length<6&&r(e))return e;if(r(e.slice(0,3)))return e.slice(0,3);if(r(e.slice(0,2)))return e.slice(0,2);if(r(e.slice(0,4)))return e.slice(0,4);if(r(e.slice(0,1)))return e.slice(0,1);if(r(e.slice(0,5)))return e.slice(0,5);this.validPrefix.test(e)||(e="n");for(var o=0;;o++)if(r(e.slice(0,3)+o))return e.slice(0,3)+o}},{key:"rootSubjects",value:function(t){for(var e={},r={},n={},i=0;i<t.length;i++){var o=t[i],a=function(t){e.hasOwnProperty(t)||(e[t]=[]),e[t].push(o.subject)};[o.subject,o.predicate,o.object].map((function(t){"BlankNode"===t.termType?n[t.toNT()]=!0:"Collection"===t.termType&&t.elements.forEach((function(t){a(t)}))})),a(t[i].object);var s=r[this.toStr(o.subject)];s||(s=[]),s.push(o),r[this.toStr(o.subject)]=s}var u=[];for(var c in r)if(r.hasOwnProperty(c)){var l=this.fromStr(c);"BlankNode"===l.termType&&e[l]&&1===e[l].length||u.push(l)}this.incoming=e;for(var h={},f=0;f<u.length;f++)h[u[f].toNT()]=!0;return{roots:u,subjects:r,rootsHash:h,incoming:e}}},{key:"toN3",value:function(t){return this.statementsToN3(t.statements)}},{key:"explicitURI",value:function(t){return"<"+(t=this.flags.indexOf("r")<0&&this.base?I.refTo(this.base,t):this.flags.indexOf("u")>=0?function(t){for(var e,r="",n=0;n<t.length;n++)r+=(e=t.charCodeAt(n))>65535?"\\U"+("00000000"+e.toString(16)).slice(-8):e>126?"\\u"+("0000"+e.toString(16)).slice(-4):t[n];return r}(t):encodeURI(t))+">"}},{key:"statementsToNTriples",value:function(t){var e=t.slice();e.sort();for(var r="",n="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i=this,o=this.store,a=this.rdfFactory,s=function t(e){if("Collection"!==e.termType)return i.atomicTermToN3(e);for(var s=e.elements,u=o.sym(n+"nill"),c=s.length-1;c>=0;c--){var l=a.blankNode();r+=t(l)+" "+t(o.sym(n+"first"))+" "+t(s[c])+".\n",r+=t(l)+" "+t(o.sym(n+"rest"))+" "+t(u)+".\n",u=l}return i.atomicTermToN3(u)},u=0;u<e.length;u++){var c=e[u],l="";l+=s(c.subject)+" ",l+=s(c.predicate)+" ",l+=s(c.object)+" ",this.flags.indexOf("q")>=0&&(l+=s(c.why)+" "),r+=l+=".\n"}return r}},{key:"statementsToN3",value:function(t){var e=this.store,n={"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":"aaa:00"};t.sort((function(t,r){return B.heavyCompareSPO(t,r,e,n)})),this.base&&!this.defaultNamespace&&(this.defaultNamespace=this.base+"#");var i={};this.flags.indexOf("s")<0&&(i["http://www.w3.org/2002/07/owl#sameAs"]="="),this.flags.indexOf("t")<0&&(i["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"]="a"),this.flags.indexOf("i")<0&&(i["http://www.w3.org/2000/10/swap/log#implies"]="=>");var o=function(t){for(var e="",r=0;r<t;r++)e+=" ";return e},a=function t(e){for(var r="",n=0;n<e.length;n++){var i=e[n],o="string"==typeof i?i:t(i);if(0!==n){var a=r.slice(-1)||" ";","===o||";"===o||("."!==o||"0123456789.:".includes(a))&&(r+=" ")}r+=o}return r},s=function(t){for(var e=this.rootSubjects(t),r=e.roots,n=[],i=0;i<r.length;i++){var o=r[i];n.push(u(o,e))}return n}.bind(this);function u(t,e){return"BlankNode"!==t.termType||e.incoming[t]?[h(t,e)].concat([c(t,e)]).concat(["."]):l(t,e,!0).concat(["."])}var c=function(t,e){var r=[],n=null,o=e.subjects[this.toStr(t)]||[];if(void 0===o)throw new Error("Cant find statements for "+t);for(var a=[],s=0;s<o.length;s++){var u=o[s];u.predicate.uri===n?a.push(","):(n&&(r=r.concat([a]).concat([";"]),a=[]),r.push(i[u.predicate.uri]?i[u.predicate.uri]:h(u.predicate,e))),n=u.predicate.uri,a.push(l(u.object,e))}return r.concat([a])}.bind(this),l=function(t,e,r){return"BlankNode"!==t.termType||!r&&void 0!==e.rootsHash[t.toNT()]?h(t,e):e.subjects[this.toStr(t)]?["[",c(t,e),"]"]:"[]"}.bind(this);r.prototype.termToN3=h;var h=function(t,e){var r,n;switch(t.termType){case"Graph":return(n=(n=["{"]).concat(s(t.statements))).concat(["}"]);case"Collection":for(n=["("],r=0;r<t.elements.length;r++)n.push([l(t.elements[r],e)]);return n.push(")"),n;default:return this.atomicTermToN3(t)}}.bind(this),f=function(){var t="";for(var e in this.flags.indexOf("d")<0&&this.defaultNamespace&&(t+="@prefix : "+this.explicitURI(this.defaultNamespace)+".\n"),this.prefixes)this.prefixes.hasOwnProperty(e)&&this.namespacesUsed[e]&&(t+="@prefix "+this.prefixes[e]+": "+this.explicitURI(e)+".\n");return t+"\n"}.bind(this),p=s(t);return f()+function t(e,r){var n="",i=1e5;void 0===r&&(r=-1);for(var s=0;s<e.length;s++){var u=e[s];if("string"!=typeof u){var c=t(u,r+1);if(c.length<10*(80-4*r)&&c.indexOf('"""')<0){var l=a(u);l.length<80-4*r&&(u=l,c="")}c&&(i=1e4),n+=c}if("string"==typeof u){if(1===u.length&&"\n"===n.slice(-1)&&",.;".indexOf(u)>=0){n=n.slice(0,-1),"."==u&&"0123456789.:".includes(n.charAt(n.length-1))&&(n+=" ",i+=1),n+=u+"\n",i+=1;continue}if(i<4*r+4||i+u.length+1<80&&";.".indexOf(n[n.length-2])<0)n=n.slice(0,-1)+" "+u+"\n",i+=u.length+1;else{var h=o(4*r)+u;n+=h+"\n",i=h.length,r<0&&(n+="\n",i=1e5)}}}return n}(p)}},{key:"atomicTermToN3",value:function(t,e){switch(t.termType){case"BlankNode":case"Variable":return t.toNT();case"Literal":var r=t.value;if("string"!=typeof r)throw new TypeError("Value of RDF literal node must be a string");if(t.datatype&&this.flags.indexOf("x")<0)switch(t.datatype.uri){case"http://www.w3.org/2001/XMLSchema#integer":return r;case"http://www.w3.org/2001/XMLSchema#decimal":return r.indexOf(".")<0&&(r+=".0"),r;case"http://www.w3.org/2001/XMLSchema#double":var n=r.toLowerCase().indexOf("e")>0;return r.indexOf(".")<0&&!n&&(r+=".0"),n||(r+="e0"),r;case"http://www.w3.org/2001/XMLSchema#boolean":return"1"===t.value?"true":"false"}var i=this.stringToN3(t.value);return t.language?i+="@"+t.language:t.datatype.equals(this.xsd.string)||(i+="^^"+this.atomicTermToN3(t.datatype,e)),i;case"NamedNode":return this.symbolToN3(t);case"DefaultGraph":return"";default:throw new Error("Internal: atomicTermToN3 cannot handle "+t+" of termType: "+t.termType)}}},{key:"stringToN3",value:function(t,e){e||(e="e");var r,n,i,o,a,s="";for(t.length>20&&'"'!==t.slice(-1)&&e.indexOf("n")<0&&(t.indexOf("\n")>0||t.indexOf('"')>0)?(o='"""',a=this.forbidden3):(o='"',a=this.forbidden1),r=0;r<t.length&&(a.lastIndex=0,null!=a.exec(t.slice(r)));){n=r+a.lastIndex-1,s+=t.slice(r,n);var u=t[n];'"'===u&&'"""'===o&&'"""'!==t.slice(n,n+3)?s+=u:(i='\b\f\r\t\v\n\\"'.indexOf(u))>=0?s+="\\"+'bfrtvn\\"'[i]:e.indexOf("e")>=0?s+="\\u"+("000"+u.charCodeAt(0).toString(16).toLowerCase()).slice(-4):s+=u,r=n+1}return o+s+t.slice(r)+o}},{key:"symbolToN3",value:function(t){var e=t.uri,r=e.indexOf("#");if(r<0&&this.flags.indexOf("/")<0&&(r=e.lastIndexOf("/")),r>=0&&this.flags.indexOf("p")<0&&(0===e.indexOf("http")||0===e.indexOf("ws")||0===e.indexOf("file"))){for(var n=!0,i=r+1;i<e.length;i++)if(this._notNameChars.indexOf(e[i])>=0){n=!1;break}if(n){var o=e.slice(r+1),a=e.slice(0,r+1);if(this.defaultNamespace&&this.defaultNamespace===a&&this.flags.indexOf("d")<0)return this.flags.indexOf("k")>=0&&this.keyords.indexOf(o)<0?o:":"+o;var s=this.prefixes[a];if(s||(s=this.makeUpPrefix(a)),s)return this.namespacesUsed[a]=!0,s+":"+o}}return this.explicitURI(e)}},{key:"writeStore",value:function(t){var e=this.store,r=e.fetcher,n=r&&r.appNode,i=this.store.index[3];for(var o in i){var a=e.fromNT(o);n&&a.equals(n)||t("\n"+this.atomicTermToN3(a)+" "+this.atomicTermToN3(e.sym("http://www.w3.org/2000/10/swap/log#semantics"))+" { "+this.statementsToN3(e.statementsMatching(void 0,void 0,void 0,a))+" }.\n")}e.statementsMatching(void 0,e.sym("http://www.w3.org/2007/ont/link#requestedURI")).map((function(r){t("\n<"+r.object.value+"> log:metadata {\n");var n=e.statementsMatching(void 0,void 0,void 0,r.subject);t(this.statementsToN3(this.statementsToN3(n))),t("}.\n")}));var s=[];n&&s.push(n);var u=[];s.map((function(t){u=u.concat(e.statementsMatching(void 0,void 0,void 0,t))})),t(this.statementsToN3(u))}},{key:"statementsToXML",value:function(t){var e=[];e["http://www.w3.org/1999/02/22-rdf-syntax-ns#"]=!0;var r="http://www.w3.org/1999/02/22-rdf-syntax-ns#_",n=function(t){for(var e="",r=0;r<t;r++)e+=" ";return e},i=function t(e){for(var r="",n=0;n<e.length;n++){var i=e[n];r+="string"==typeof i?i:t(i)}return r},o=function(t){this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#");for(var e=this.rootSubjects(t),r=e.roots,n=[],i=0;i<r.length;i++){var o=r[i];n.push(u(o,e))}return n}.bind(this);function a(t){return void 0===t?"@@@undefined@@@@":t.replace(/[&<"]/g,(function(t){switch(t[0]){case"&":return"&amp;";case"<":return"&lt;";case'"':return"&quot;"}}))}var s=function(t){return a(this.base?I.refTo(this.base,t.uri):t.uri)}.bind(this),u=function(t,e){var n,i,o,f,p=[],d=e.subjects[this.toStr(t)];if(void 0===d)return l(t,e);d.sort((function(t,e){var n=t.predicate.uri,i=e.predicate.uri;if(n.substring(0,r.length)===r||i.substring(0,r.length)===r)return n.localeCompare(i);var o=n.substring(r.length),a=i.substring(r.length),s=parseInt(o,10),u=parseInt(a,10);return isNaN(s)||isNaN(u)||s!==o||u!==a?n.localeCompare(i):s-u}));for(var y=0;y<d.length;y++)if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"!==(o=d[y]).predicate.uri||n||"NamedNode"!==o.object.termType){if((f=o.predicate).uri.substr(0,r.length)===r){var v=f.uri.substr(r.length);v===parseInt(v,10).toString()&&(f=this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#li"))}switch(i=h(f),o.object.termType){case"BlankNode":p=1===e.incoming[o.object].length?p.concat(["<"+i+' rdf:parseType="Resource">',u(o.object,e),"</"+i+">"]):p.concat(["<"+i+' rdf:nodeID="'+o.object.toNT().slice(2)+'"/>']);break;case"NamedNode":p=p.concat(["<"+i+' rdf:resource="'+s(o.object)+'"/>']);break;case"Literal":p=p.concat(["<"+i+(o.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+a(o.object.datatype.uri)+'"')+(o.object.language?' xml:lang="'+o.object.language+'"':"")+">"+a(o.object.value)+"</"+i+">"]);break;case"Collection":p=p.concat(["<"+i+' rdf:parseType="Collection">',c(o.object,e),"</"+i+">"]);break;default:throw new Error("Can't serialize object of type "+o.object.termType+" into XML")}}else n=o.object;var g=n?h(n):"rdf:Description",m="";return"BlankNode"===t.termType?e.incoming[t]&&1===e.incoming[t].length||(m=' rdf:nodeID="'+t.toNT().slice(2)+'"'):m=' rdf:about="'+s(t)+'"',["<"+g+m+">"].concat([p]).concat(["</"+g+">"])}.bind(this);function c(t,e){for(var r=[],n=0;n<t.elements.length;n++)r.push(u(t.elements[n],e));return r}var l=function(t,e){var r=[],n=e.subjects[this.toStr(t)];if(!n)return r;n.sort();for(var i=0;i<n.length;i++){var o=n[i];switch(o.object.termType){case"BlankNode":r=e.rootsHash[o.object.toNT()]?r.concat(["<"+h(o.predicate)+' rdf:nodeID="'+o.object.toNT().slice(2)+'">',"</"+h(o.predicate)+">"]):r.concat(["<"+h(o.predicate)+' rdf:parseType="Resource">',l(o.object,e),"</"+h(o.predicate)+">"]);break;case"NamedNode":r=r.concat(["<"+h(o.predicate)+' rdf:resource="'+s(o.object)+'"/>']);break;case"Literal":r=r.concat(["<"+h(o.predicate)+(o.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+a(o.object.datatype.value)+'"')+(o.object.language?' xml:lang="'+o.object.language+'"':"")+">"+a(o.object.value)+"</"+h(o.predicate)+">"]);break;case"Collection":r=r.concat(["<"+h(o.predicate)+' rdf:parseType="Collection">',c(o.object,e),"</"+h(o.predicate)+">"]);break;default:throw new Error("Can't serialize object of type "+o.object.termType+" into XML")}}return r}.bind(this),h=function(t){var r=t.uri,n=r.indexOf("#");if(n<0&&this.flags.indexOf("/")<0&&(n=r.lastIndexOf("/")),n<0)throw new Error("Cannot make qname out of <"+r+">");for(var i=n+1;i<r.length;i++)if(this._notNameChars.indexOf(r[i])>=0)throw new Error('Invalid character "'+r[i]+'" cannot be in XML qname for URI: '+r);var o=r.slice(n+1),a=r.slice(0,n+1);if(this.defaultNamespace&&this.defaultNamespace===a&&this.flags.indexOf("d")<0)return o;var s=this.prefixes[a];return s||(s=this.makeUpPrefix(a)),e[a]=!0,s+":"+o}.bind(this),f=o(t),p="<rdf:RDF";for(var d in this.defaultNamespace&&(p+=' xmlns="'+a(this.defaultNamespace)+'"'),e)if(e.hasOwnProperty(d)){var y=this.base&&this.flags.includes("z")?I.refTo(this.base,d):d;p+="\n xmlns:"+this.prefixes[d]+'="'+a(y)+'"'}return function t(e,r){var o,a="",s=1e5;r||(r=0);for(var u=0;u<e.length;u++){var c=e[u];if("string"!=typeof c){var l=t(c,r+1);l.length<10*(80-4*r)&&l.indexOf('"""')<0&&(o=i(c)).length<80-4*r&&(c=" "+o,l=""),l&&(s=1e4),a+=l}"string"==typeof c&&(s<4*r+4?(a=a.slice(0,-1)+" "+c+"\n",s+=c.length+1):(a+=(o=n(4*r)+c)+"\n",s=o.length))}return a}([p+=">",f,"</rdf:RDF>"],-1)}},{key:"statementsToJsonld",value:function(t){var e=this.statementsToN3(t),r=z.parse(e);return JSON.stringify(r,null,2)}}]),r}();function W(t,e,r,n,i,o){r=r||(null==t?void 0:t.value);var a=o||{};n=n||h.z8;try{var s=V(e);a.flags&&s.setFlags(a.flags);var u=e.statementsMatching(void 0,void 0,void 0,t);switch("namespaces"in e&&s.suggestNamespaces(e.namespaces),a.namespaces&&s.setNamespaces(a.namespaces),s.setBase(r),n){case h.Is:return c(null,s.statementsToXML(u));case h.qS:case h.sZ:return c(null,s.statementsToN3(u));case h.z8:case h.Eo:return s.setFlags("si"),c(null,s.statementsToN3(u));case h.aV:return s.setFlags("deinprstux"),c(null,s.statementsToNTriples(u));case h.ui:return s.setFlags("si dr"),c(null,s.statementsToJsonld(u));case h.b4:case h.lL:return s.setFlags("deinprstux q"),c(null,s.statementsToNTriples(u));default:throw new Error("Serialize: Content-type "+n+" not supported for data write.")}}catch(t){if(i)return i(t,void 0);throw t}function c(t,e){return i?void i(t,e):e}}var Q=["blankNode","defaultGraph","literal","namedNode","quad","variable","supports"],Y="http://www.w3.org/1999/02/22-rdf-syntax-ns#rest";function J(t,e,r){var n=[];return r.reduce((function(e,r,i,o){var a;return n.push(t.quad(e,t.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#first"),o[i])),i<o.length-1?(a=t.blankNode(),n.push(t.quad(e,t.namedNode(Y),a))):n.push(t.quad(e,t.namedNode(Y),t.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"))),a}),e),n}function K(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=t.length;for(r<0&&(r=n+r);r<n;r++)if(t[r]===e)return r;return-1}var tt=s(292);function et(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return rt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?rt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function rt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var nt=function(s){(0,n.Z)(d,s);var u,f,p=(u=d,f=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,o.Z)(u);if(f){var r=(0,o.Z)(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return(0,i.Z)(this,t)});function d(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};(0,e.Z)(this,d),(t=p.call(this,"")).statements=n,t.constraints=i,t.initBindings=o,t.optional=s,(0,a.Z)((0,r.Z)(t),"termType",h._A),(0,a.Z)((0,r.Z)(t),"classOrder",c.Z.Graph),(0,a.Z)((0,r.Z)(t),"fetcher",void 0),(0,a.Z)((0,r.Z)(t),"isVar",0),(0,a.Z)((0,r.Z)(t),"ns",Z),(0,a.Z)((0,r.Z)(t),"rdfFactory",void 0),t.rdfFactory=u&&u.rdfFactory||D;var l,f=et(Q);try{var y=function(){var e=l.value;t[e]=function(){var r;return(r=t.rdfFactory)[e].apply(r,arguments)}};for(f.s();!(l=f.n()).done;)y()}catch(t){f.e(t)}finally{f.f()}return t}return(0,t.Z)(d,[{key:"add",value:function(t,e,r,n){var i=this;return 1===arguments.length&&t.forEach((function(t){return i.add(t.subject,t.predicate,t.object,t.graph)})),this.statements.push(this.rdfFactory.quad(t,e,r,n))}},{key:"addStatement",value:function(t){return this.add(t)}},{key:"bnode",value:function(t){return this.rdfFactory.blankNode(t)}},{key:"addAll",value:function(t){var e=this;t.forEach((function(t){e.add(t.subject,t.predicate,t.object,t.graph)}))}},{key:"any",value:function(t,e,r,n){var i=this.anyStatementMatching(t,e,r,n);return null==i?null:null==t?i.subject:null==e?i.predicate:null==r?i.object:null}},{key:"anyValue",value:function(t,e,r,n){var i=this.any(t,e,r,n);return i?i.value:void 0}},{key:"anyJS",value:function(t,e,r,n){var i=this.any(t,e,r,n);return i?l.Z.toJS(i):void 0}},{key:"anyStatementMatching",value:function(t,e,r,n){var i=this.statementsMatching(t,e,r,n,!0);if(i&&0!==i.length)return i[0]}},{key:"id",value:function(t){return this.rdfFactory.id(t)}},{key:"statementsMatching",value:function(t,e,r,n,i){var o=this.statements.filter((function(i){return(!t||t.equals(i.subject))&&(!e||e.equals(i.predicate))&&(!r||r.equals(i.object))&&(!n||n.equals(i.graph))}));return i?0===o.length?[]:[o[0]]:o}},{key:"bottomTypeURIs",value:function(t){var e,r,n,i,o,a;for(var s in e=[],t)if(t.hasOwnProperty(s)){for(a=t[s],r=!0,n=0,i=(o=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),this.rdfFactory.namedNode(s))).length;n<i;n++)if(o[n].uri in t){r=!1;break}r&&(e[s]=a)}return e}},{key:"collection",value:function(){return new w}},{key:"each",value:function(t,e,r,n){var i=[],o=this.statementsMatching(t,e,r,n,!1);if(null==t)for(var a=0,s=o.length;a<s;a++)i.push(o[a].subject);else if(null==e)for(var u=0,c=o.length;u<c;u++)i.push(o[u].predicate);else if(null==r)for(var l=0,h=o.length;l<h;l++)i.push(o[l].object);else if(null==n)for(var f=0,p=o.length;f<p;f++)i.push(new y.Z(o[f].graph.value));return i}},{key:"equals",value:function(t){return!!t&&this.hashString()===t.hashString()}},{key:"findMembersNT",value:function(t){var e,r,n,i,o,a,s,u,c,l,h,f,p,d;for(var y in(f={})[t.toNT()]=!0,i={},a=this.transitiveClosure(f,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0))if(a.hasOwnProperty(y)){for(var v=0,g=(s=this.statementsMatching(void 0,this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.fromNT(y))).length;v<g;v++)i[(p=s[v]).subject.toNT()]=p;for(var m=0,b=(u=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"),this.fromNT(y))).length;m<b;m++)for(o=u[m],n=0,e=(c=this.statementsMatching(void 0,o)).length;n<e;n++)i[(p=c[n]).subject.toNT()]=p;for(var w=0,x=(l=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"),this.fromNT(y))).length;w<x;w++)for(o=l[w],d=0,r=(h=this.statementsMatching(void 0,o)).length;d<r;d++)i[(p=h[d]).object.toNT()]=p}return i}},{key:"findMemberURIs",value:function(t){return this.NTtoURI(this.findMembersNT(t))}},{key:"findSubClassesNT",value:function(t){var e={};return e[t.toNT()]=!0,this.transitiveClosure(e,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0)}},{key:"findSuperClassesNT",value:function(t){var e={};return e[t.toNT()]=!0,this.transitiveClosure(e,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}},{key:"findTypesNT",value:function(t){var e,r,n,i,o,a;a=[];for(var s=0,u=(e=this.statementsMatching(t,void 0,void 0)).length;s<u;s++)if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===(o=e[s]).predicate.uri)a[o.object.toNT()]=o;else for(var c=0,l=(r=this.each(o.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"))).length;c<l;c++)a[r[c].toNT()]=o;for(var h=0,f=(n=this.statementsMatching(void 0,void 0,t)).length;h<f;h++){o=n[h];for(var p=0,d=(i=this.each(o.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"))).length;p<d;p++)a[i[p].toNT()]=o}return this.transitiveClosure(a,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}},{key:"findTypeURIs",value:function(t){return this.NTtoURI(this.findTypesNT(t))}},{key:"connectedStatements",value:function(t,e,r){r=r||[];for(var n=[t],i={},o={},a=[],s=this,u=function(t){var u=function(t){"BlankNode"!==t.termType||i[t.value]||(i[t.value]=!0,n.push(t))},c=s.statementsMatching(null,null,t,e).concat(s.statementsMatching(t,null,null,e));c=c.filter((function(t){if(r[t.predicate.value])return!1;var e=t.toNT();return!o[e]&&(o[e]=!0,!0)})),c.forEach((function(t){u(t.subject),u(t.object)})),a=a.concat(c)};n.length;)u(n.shift());return a}},{key:"formula",value:function(t){return new d}},{key:"fromNT",value:function(t){var e,r,n;switch(t[0]){case"<":return this.sym(t.slice(1,-1));case'"':if(n=void 0,e=void 0,(r=t.lastIndexOf('"'))<t.length-1)if("@"===t[r+1])n=t.slice(r+2);else{if("^^"!==t.slice(r+1,r+3))throw new Error("Can't convert string from NT: "+t);e=this.fromNT(t.slice(r+3))}return t=(t=(t=(t=t.slice(1,r)).replace(/\\"/g,'"')).replace(/\\n/g,"\n")).replace(/\\\\/g,"\\"),this.rdfFactory.literal(t,n||e);case"_":return this.rdfFactory.blankNode(t.slice(2));case"?":return new F(t.slice(1))}throw new Error("Can't convert from NT: "+t)}},{key:"holds",value:function(t,e,r,n){var i;if(1===arguments.length){if(!t)return!0;if(t instanceof Array){for(i=0;i<t.length;i++)if(!this.holds(t[i]))return!1;return!0}if((0,v.Yi)(t))return this.holds(t.subject,t.predicate,t.object,t.graph);if(t.statements)return this.holds(t.statements)}var o=this.anyStatementMatching(t,e,r,n);return null!=o}},{key:"holdsStatement",value:function(t){return this.holds(t.subject,t.predicate,t.object,t.graph)}},{key:"list",value:function(t,e){if(e.rdfFactory.supports.COLLECTIONS){var r=e.rdfFactory.collection();return t.forEach((function(t){r.append(t)})),r}var n=e.rdfFactory.blankNode(),i=J(e.rdfFactory,n,t);return e.addAll(i),n}},{key:"NTtoURI",value:function(t){var e,r,n={};for(e in t)t.hasOwnProperty(e)&&(r=t[e],"<"===e[0]&&(n[e.slice(1,-1)]=r));return n}},{key:"serialize",value:function(t,e,r,n){return W(r,this,t,e,void 0,n)}},{key:"substitute",value:function(t){var e=this.statements.map((function(e){return e.substitute(t)}));tt.log("Formula subs statmnts:"+e);var r=new d;return r.addAll(e),tt.log("indexed-form subs formula:"+r),r}},{key:"sym",value:function(t,e){if(e)throw new Error("This feature (kb.sym with 2 args) is removed. Do not assume prefix mappings.");return this.rdfFactory.namedNode(t)}},{key:"the",value:function(t,e,r,n){var i=this.any(t,e,r,n);return null==i&&M.Z.error("No value found for the() {"+t+" "+e+" "+r+"}."),i}},{key:"transitiveClosure",value:function(t,e,r){var n,i,o,a,s,u={};Object.assign(u,t);for(var c={};;){if(null==(s=function(){for(var t in u)if(u.hasOwnProperty(t))return t}()))return c;for(n=0,i=(a=r?this.each(void 0,e,this.fromNT(s)):this.each(this.fromNT(s),e)).length;n<i;n++)(o=a[n].toNT())in c||o in u||(u[o]=u[s]);c[s]=u[s],delete u[s]}}},{key:"topTypeURIs",value:function(t){var e,r,n,i,o,a,s;for(r in a=[],t)if(t.hasOwnProperty(r)){for(s=t[r],i=0,e=0,n=(o=this.each(this.rdfFactory.namedNode(r),this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"))).length;e<n;e++)if("http://www.w3.org/2000/01/rdf-schema#Resource"!==o[e].uri){i++;break}i||(a[r]=s)}return a["http://www.w3.org/2000/01/rdf-schema#Resource"]&&delete a["http://www.w3.org/2000/01/rdf-schema#Resource"],a["http://www.w3.org/2002/07/owl#Thing"]&&delete a["http://www.w3.org/2002/07/owl#Thing"],a}},{key:"toString",value:function(){return"{"+this.statements.join("\n")+"}"}},{key:"variable",value:function(t){return new F(t)}},{key:"whether",value:function(t,e,r,n){return this.statementsMatching(t,e,r,n,!1).length}}]),d}(l.Z);l.Z.fromValue=b;const it=l.Z;var ot={xsd:Z("http://www.w3.org/2001/XMLSchema#")};l.Z.toJS=function(t){return(0,v.uZ)(t)?t.elements.map(l.Z.toJS):(0,v.n_)(t)?t.datatype.equals(ot.xsd("boolean"))?"1"===t.value||"true"===t.value:t.datatype.equals(ot.xsd("dateTime"))||t.datatype.equals(ot.xsd("date"))?new Date(t.value):t.datatype.equals(ot.xsd("integer"))||t.datatype.equals(ot.xsd("float"))||t.datatype.equals(ot.xsd("decimal"))?Number(t.value):t.value:t};var at=s(292),st=(0,t.Z)((function t(r,n){(0,e.Z)(this,t),this.pat=new gt,this.vars=[],this.name=r,this.id=n}));function ut(t,e,r,n){function i(t){var e,r="";for(e in t)t.hasOwnProperty(e)&&(r+=" "+e+" -> "+t[e]);return r}function o(t){var e,r="Bindings: ",n=t.length;for(e=0;e<n;e++)r+=i(t[e][0])+";\n\t";return r}function a(t,e,r,n){var i;if(t.length!==e.length)return[];if(!t.length)return[[[],null]];var o=function(t,e,r,n){var i=r[t];if(void 0===i){if(t.isVar){var o=[];return o[t]=e,[[o,null]]}i=t}if(!i.complexType)return n.redirections[i]&&(i=n.redirections[i]),n.redirections[e]&&(e=n.redirections[e]),i.equals(e)||i.uri&&i.uri===E?[[[],null]]:[];if(t instanceof Array)return e instanceof Array?a(t,e,r):[];throw new Error("query.js: oops - code not written yet")}(t[0],e[0],r,n);if(0===o.length)return o;var s,u,c,l,h,f,p,d=[],y=o.length;for(s=0;s<y;s++){for(h in p=[],u=o[s][0])u.hasOwnProperty(h)&&(p[h]=u[h]);for(h in r)r.hasOwnProperty(h)&&(p[h]=r[h]);for(l=(i=a(t.slice(1),e.slice(1),p,n)).length,c=0;c<l;c++){for(h in f=i[c][0],u)u.hasOwnProperty(h)&&(f[h]=u[h]);d.push([f,null])}}return d}function s(t,e){var r,n={};for(r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);for(r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);return n}function u(t,e){return this.trunkBindings=e,this.originalCallback=t,this.branches=[],this}function c(t,e){return this.count=0,this.success=!1,this.done=!1,this.callback=t,this.onDone=e,this}u.prototype.checkAllDone=function(){var t;for(t=0;t<this.branches.length;t++)if(!this.branches[t].done)return;M.Z.debug("OPTIONAL BIDNINGS ALL DONE:"),this.doCallBacks(this.branches.length-1,this.trunkBindings)},u.prototype.doCallBacks=function(t,e){var r;if(t<0)return this.originalCallback(e);for(r=0;r<this.branches[t].results.length;r++)this.doCallBacks(t-1,s(e,this.branches[t].results[r]))},c.prototype.reportMatch=function(t){this.callback(t),this.success=!0},c.prototype.reportDone=function(){this.done=!0,M.Z.info("Mandatory query branch finished.***"),void 0!==this.onDone&&this.onDone()};var l=function(t){return this.count=0,this.done=!1,this.results=[],this.junction=t,t.branches.push(this),this};function h(t,e,r){var n,i,o,a,s,u;for(e.nvars=0,e.index=null,n=[e.subject,e.predicate,e.object,e.why],a=[t.subjectIndex,t.predicateIndex,t.objectIndex,t.whyIndex],o=0;o<4;o++){var c=n[o];if(c.uri&&c.uri===E);else if(c.isVar&&void 0===r[c])e.nvars++;else{if(void 0,c=void 0===(u=r[s=n[o]])?s:u,t.redirections[t.id(c)]&&(c=t.redirections[t.id(c)]),!(i=a[o][t.id(c)]))return e.index=[],!1;(null===e.index||e.index.length>i.length)&&(e.index=i)}}return null===e.index&&(e.index=t.statements),!0}function f(t,e){return t.nvars!==e.nvars?t.nvars-e.nvars:t.index.length-e.index.length}l.prototype.reportMatch=function(t){this.results.push(t)},l.prototype.reportDone=function(){M.Z.debug("Optional branch finished - results.length = "+this.results.length),0===this.results.length&&(this.results.push({}),M.Z.debug("Optional branch FAILED - that's OK.")),this.done=!0,this.junction.checkAllDone()};var p=function t(r,n,o,a,s,c,h){M.Z.debug("Match begins, Branch count now: "+h.count+" for "+h.pattern_debug);var f,p,d=n.statements;if(0===d.length){if(M.Z.debug("FOUND MATCH WITH BINDINGS:"+i(o)),0===n.optional.length)h.reportMatch(o);else{M.Z.debug("OPTIONAL: "+n.optional);var v,g=new u(e,o),m=[];for(v=0;v<n.optional.length;v++)m[v]=new l(g),m[v].pattern_debug=n.optional[v];for(v=0;v<n.optional.length;v++)m[v].count=m[v].count+1,t(r,n.optional[v],o,"",s,e,m[v])}return h.count--,void M.Z.debug("Match ends -- success , Branch count now: "+h.count+" for "+h.pattern_debug)}var b=d.length;if(s){var w=function(e,i){var u=e.uri.split("#")[0];s.nowOrWhenFetched(u,void 0,(function(i,u,l){i||at.log("Error following link to <"+e.uri+"> in query: "+u),t(r,n,o,a,s,c,h)}))};for(p=0;p<b;p++){if(f=d[p],void 0!==o[f.subject]&&o[f.subject].uri&&s&&"unrequested"===s.getState((0,I.docpart)(o[f.subject].uri)))return void w(o[f.subject]);if(void 0!==o[f.object]&&o[f.object].uri&&s&&"unrequested"===s.getState((0,I.docpart)(o[f.object].uri)))return void w(o[f.object])}}y(r,n,o,a,s,c,h)},d=function(t,e){var r,n,i=!0;for(r in t)t.hasOwnProperty(r)&&e[r]&&(n=e[r].test)&&!n(t[r])&&(i=!1);return i},y=function(t,e,r,n,s,u,c){var l,y,v,g,m,b,w,x=e.statements,_=x.length;for(l=0;l<_;l++)h(t,w=x[l],r);x.sort(f),w=x[0];var T,k=t.formula();k.optional=e.optional,k.constraints=e.constraints,k.statements=x.slice(1),M.Z.debug(n+"match2 searching "+w.index.length+" for "+w+"; bindings so far="+i(r));var A,E,O=w.index.length,j=0;for(T=0;T<O;T++)for(E=w.index[T],A=a([w.subject,w.predicate,w.object,w.why],[E.subject,E.predicate,E.object,E.why],r,t),M.Z.info(n+" From first: "+A.length+": "+o(A)),v=A.length,y=0;y<v;y++)if(m=[],b=A[y][0],d(b,e.constraints)){for(g in b)b.hasOwnProperty(g)&&(m[g]=b[g]);for(g in r)r.hasOwnProperty(g)&&(m[g]=r[g]);c.count++,j++,p(t,k,m,n+" ",s,u,c)}else M.Z.debug("Branch count CS: "+c.count);c.count--,0===j&&M.Z.debug("Match2 fails completely on "+w),M.Z.debug("Match2 ends, Branch count: "+c.count+" for "+c.pattern_debug),0===c.count&&(M.Z.debug("Branch finished."),c.reportDone())},v=this;M.Z.debug("Query on "+this.statements.length);var g=new c(e,n);g.count++,t.sync?p(v,t.pat,t.pat.initBindings,"",r,e,g):setTimeout((function(){p(v,t.pat,t.pat.initBindings,"",r,e,g)}),0)}function ct(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function lt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ct(Object(r),!0).forEach((function(e){(0,a.Z)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ct(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ht(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return ft(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ft(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function ft(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var pt="http://www.w3.org/2002/07/owl#";function dt(t,e,r,n){var i=t.any(e,r,void 0);return!!i&&(t.equate(i,n),!0)}function yt(t,e,r,n){var i=t.any(void 0,r,n);return!!i&&(t.equate(i,e),!0)}function vt(t,e,r,n,i){t.typeCallback&&t.typeCallback(t,n,i);var o=t.classActions[t.id(n)],a=!1;if(o)for(var s=0;s<o.length;s++)a=a||o[s](t,e,r,n,i);return a}var gt=function(s){(0,n.Z)(d,s);var u,l,f=(u=d,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,o.Z)(u);if(l){var r=(0,o.Z)(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return(0,i.Z)(this,t)});function d(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,e.Z)(this,d),n=f.call(this,void 0,void 0,void 0,void 0,i),(0,a.Z)((0,r.Z)(n),"updater",void 0),(0,a.Z)((0,r.Z)(n),"namespaces",void 0),(0,a.Z)((0,r.Z)(n),"classActions",void 0),(0,a.Z)((0,r.Z)(n),"propertyActions",void 0),(0,a.Z)((0,r.Z)(n),"redirections",void 0),(0,a.Z)((0,r.Z)(n),"aliases",void 0),(0,a.Z)((0,r.Z)(n),"HTTPRedirects",void 0),(0,a.Z)((0,r.Z)(n),"subjectIndex",void 0),(0,a.Z)((0,r.Z)(n),"predicateIndex",void 0),(0,a.Z)((0,r.Z)(n),"objectIndex",void 0),(0,a.Z)((0,r.Z)(n),"whyIndex",void 0),(0,a.Z)((0,r.Z)(n),"index",void 0),(0,a.Z)((0,r.Z)(n),"features",void 0),(0,a.Z)((0,r.Z)(n),"_universalVariables",void 0),(0,a.Z)((0,r.Z)(n),"_existentialVariables",void 0),(0,a.Z)((0,r.Z)(n),"rdfArrayRemove",void 0),(0,a.Z)((0,r.Z)(n),"dataCallbacks",void 0),n.propertyActions={},n.classActions={},n.redirections=[],n.aliases=[],n.HTTPRedirects=[],n.subjectIndex=[],n.predicateIndex=[],n.objectIndex=[],n.whyIndex=[],n.index=[n.subjectIndex,n.predicateIndex,n.objectIndex,n.whyIndex],n.namespaces={},n.features=t||[],n.rdfArrayRemove=i.rdfArrayRemove||B.RDFArrayRemove,i.dataCallback&&(n.dataCallbacks=[i.dataCallback]),n.initPropertyActions(n.features),n}return(0,t.Z)(d,[{key:"substitute",value:function(t){var e=this.statements.map((function(e){return e.substitute(t)})),r=new d;return r.add(e),r}},{key:"addDataCallback",value:function(t){this.dataCallbacks||(this.dataCallbacks=[]),this.dataCallbacks.push(t)}},{key:"applyPatch",value:function(t,e,r){var n,i=this,o=null;function a(a){if(t.delete){n=t.delete,o&&(n=n.substitute(o)),n=n.statements;var s=[],u=n.map((function(t){var r=i.statementsMatching(t.subject,t.predicate,t.object,e);return 0===r.length?(s.push(t),null):r[0]}));if(s.length)return r("Could not find to delete: "+s.join("\n or "));u.map((function(t){i.remove(t)}))}t.insert&&(n=t.insert,o&&(n=n.substitute(o)),(n=n.statements).map((function(t){t.graph=e,i.add(t.subject,t.predicate,t.object,t.graph)}))),a()}if(t.where){var s=new st("patch");s.pat=t.where,s.pat.statements.map((function(t){t.graph=_r(e.value)})),s.sync=!0;var u=[];i.query(s,(function(t){u.push(t)}),i.fetcher,(function(){return 0===u.length?r("No match found to be patched:"+t.where):u.length>1?r("Patch ambiguous. No patch done."):(o=u[0],void a(r))}))}else a(r)}},{key:"declareExistential",value:function(t){return this._existentialVariables||(this._existentialVariables=[]),this._existentialVariables.push(t),t}},{key:"initPropertyActions",value:function(t){this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"))]=[vt],K(t,"sameAs")>=0&&(this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(pt,"sameAs")))]=[function(t,e,r,n,i){return t.equate(e,n),!0}]),K(t,"InverseFunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(pt,"InverseFunctionalProperty")))]=[function(t,e,r,n,i){return t.newPropertyAction(e,yt)}]),K(t,"FunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(pt,"FunctionalProperty")))]=[function(t,e,r,n,i){return t.newPropertyAction(e,dt)}])}},{key:"addStatement",value:function(t){return this.add(t.subject,t.predicate,t.object,t.graph),this.statements.length}},{key:"add",value:function(t,e,r,n){var i,o,a;if(1===arguments.length){if(t instanceof Array)for(i=0;i<t.length;i++)this.add(t[i]);else(0,v.PY)(t)?this.add(t.subject,t.predicate,t.object,t.graph):(0,v.Pv)(t)&&this.add(t.statements);return this}n||(n=this.fetcher?this.fetcher.appNode:this.rdfFactory.defaultGraph()),"string"==typeof t&&(t=this.rdfFactory.namedNode(t)),e=it.fromValue(e);var s=it.fromValue(r);if(n=it.fromValue(n),!(0,v.f)(t))throw new Error("Subject is not a subject type");if(!(0,v.nq)(e))throw new Error("Predicate ".concat(e," is not a predicate type"));if(!(0,v.Uc)(s))throw new Error("Object ".concat(s," is not an object type"));if(!(0,v.NA)(n))throw new Error("Why is not a graph type");this.predicateCallback&&this.predicateCallback(this,e,n);var u=this.id(this.canon(e)),c=!1;if(o=this.propertyActions[u])for(i=0;i<o.length;i++)c=c||o[i](this,t,e,s,n);if(this.holds(t,e,s,n))return null;var l=[this.id(this.canon(t)),u,this.id(this.canon(s)),this.id(this.canon(n))];for(a=this.rdfFactory.quad(t,e,s,n),i=0;i<4;i++){var h=this.index[i],f=l[i];h[f]||(h[f]=[]),h[f].push(a)}if(this.statements.push(a),this.dataCallbacks){var p,d=ht(this.dataCallbacks);try{for(d.s();!(p=d.n()).done;){var y=p.value;y(a)}}catch(t){d.e(t)}finally{d.f()}}return a}},{key:"canon",value:function(t){if(!t)return t;var e=this.redirections[this.id(t)];if(e)return e;switch(t.termType){case h.V1:return new p(t.value);case h.fb:return t;case h.NK:return new O;case h.ls:case h._A:return t;case h.xH:return new m(t.value,t.language,t.datatype);case h.XM:return new y.Z(t.value);case h.UH:return new F(t.value);default:throw new Error("Term Type not recognized for canonization: ".concat(t.termType))}}},{key:"check",value:function(){this.checkStatementList(this.statements);for(var t=0;t<4;t++){var e=this.index[t];for(var r in e)e.hasOwnProperty(r)&&this.checkStatementList(e[r],t)}}},{key:"checkStatementList",value:function(t,e){void 0===e&&(e=0);for(var r,n=" found in "+["subject","predicate","object","why"][e]+" index.",i=0;i<t.length;i++){for(var o=[(r=t[i]).subject,r.predicate,r.object,r.graph],a=function(t,e){for(var r=0;r<t.length;r++)if(t[r].subject.equals(e.subject)&&t[r].predicate.equals(e.predicate)&&t[r].object.equals(e.object)&&t[r].why.equals(e.graph))return!0},s=0;s<4;s++){var u=this.canon(o[s]),c=this.id(u);this.index[s][c]&&a(this.index[s][c],r)}if(!a(this.statements,r))throw new Error("Statement list does not statement "+r+"@"+r.graph+n)}}},{key:"close",value:function(){return this}},{key:"compareTerms",value:function(t,e){return Object.prototype.hasOwnProperty.call(t,"compareTerm")?t.compareTerm(e):c.Z[t.termType]<c.Z[e.termType]?-1:c.Z[t.termType]>c.Z[e.termType]?1:t.value<e.value?-1:t.value>e.value?1:0}},{key:"copyTo",value:function(t,e,r){r||(r=[]);var n=this.statementsMatching(t);-1!==K(r,"two-direction")&&n.concat(this.statementsMatching(void 0,void 0,t));for(var i=0;i<n.length;i++){var o=n[i];switch(o.object.termType){case"NamedNode":this.add(e,o.predicate,o.object);break;case"Literal":case"BlankNode":case"Collection":this.add(e,o.predicate,o.object.copy(this))}-1!==K(r,"delete")&&this.remove(o)}}},{key:"equate",value:function(t,e){var r=this.canon(t),n=this.canon(e),i=this.compareTerms(r,n);return!i||(i<0?this.replaceWith(n,r):this.replaceWith(r,n))}},{key:"formula",value:function(t){return new d(t)}},{key:"length",get:function(){return this.statements.length}},{key:"match",value:function(t,e,r,n){return this.statementsMatching(it.fromValue(t),it.fromValue(e),it.fromValue(r),it.fromValue(n))}},{key:"mentionsURI",value:function(t){var e="<"+t+">";return!!this.subjectIndex[e]||!!this.objectIndex[e]||!!this.predicateIndex[e]}},{key:"newExistential",value:function(t){if(!t)return this.bnode();var e=this.sym(t);return this.declareExistential(e)}},{key:"newPropertyAction",value:function(t,e){var r=this.id(t);this.propertyActions[r]||(this.propertyActions[r]=[]),this.propertyActions[r].push(e);for(var n=this.statementsMatching(void 0,t,void 0),i=!1,o=0;o<n.length;o++)i=i||e(this,n[o].subject,t,n[o].object);return i}},{key:"newUniversal",value:function(t){var e=this.sym(t);return this._universalVariables||(this._universalVariables=[]),this._universalVariables.push(e),e}},{key:"variable",value:function(t){return new F(t)}},{key:"nextSymbol",value:function(t){for(var e=0;;e++){var r=t.value+"#n"+e;if(!this.mentionsURI(r))return this.sym(r)}}},{key:"query",value:function(t,e,r,n){return ut.call(this,t,e,r,n)}},{key:"querySync",value:function(t){var e=[],r=!1;if(t.sync=!0,ut.call(this,t,(function(t){e.push(t)}),null,(function(){r=!0})),!r)throw new Error("Sync query should have called done function");return e}},{key:"remove",value:function(t){if(t instanceof Array){for(var e=0;e<t.length;e++)this.remove(t[e]);return this}if((0,v.Pv)(t))return this.remove(t.statements);var r=this.statementsMatching(t.subject,t.predicate,t.object,t.graph);if(!r.length)throw new Error("Statement to be removed is not on store: "+t);return this.removeStatement(r[0]),this}},{key:"removeDocument",value:function(t){for(var e=this.statementsMatching(void 0,void 0,void 0,t).slice(),r=0;r<e.length;r++)this.removeStatement(e[r]);return this}},{key:"removeMany",value:function(t,e,r,n,i){for(var o=this.statementsMatching(t,e,r,n,!1),a=[],s=0;s<o.length;s++)a.push(o[s]);for(i&&(a=a.slice(0,i)),s=0;s<a.length;s++)this.remove(a[s])}},{key:"removeMatches",value:function(t,e,r,n){return this.removeMany(t,e,r,n),this}},{key:"removeStatement",value:function(t){for(var e=[t.subject,t.predicate,t.object,t.graph],r=0;r<4;r++){var n=this.canon(e[r]),i=this.id(n);this.index[r][i]&&this.rdfArrayRemove(this.index[r][i],t)}return this.rdfArrayRemove(this.statements,t),this}},{key:"removeStatements",value:function(t){for(var e=0;e<t.length;e++)this.remove(t[e]);return this}},{key:"replaceWith",value:function(t,e){for(var r=this.id(t),n=this.id(e),i=function(t){var e=t[r];if(e){var i=t[n];t[n]=i?e.concat(i):e,delete t[r]}},o=0;o<4;o++)i(this.index[o]);if(this.redirections[r]=e,t.value){if(this.aliases[n]||(this.aliases[n]=[]),this.aliases[n].push(t),this.aliases[r])for(o=0;o<this.aliases[r].length;o++)this.redirections[this.id(this.aliases[r][o])]=e,this.aliases[n].push(this.aliases[r][o]);this.add(e,this.sym("http://www.w3.org/2007/ont/link#uri"),t),this.fetcher&&this.fetcher.nowKnownAs(t,e)}return i(this.classActions),i(this.propertyActions),!0}},{key:"allAliases",value:function(t){var e=this.aliases[this.id(this.canon(t))]||[];return e.push(this.canon(t)),e}},{key:"sameThings",value:function(t,e){if(t.equals(e))return!0;var r=this.canon(t);if(!r)return!1;var n=this.canon(e);return!!n&&r.value===n.value}},{key:"setPrefixForURI",value:function(t,e){if(("tab"!==t||!this.namespaces.tab)&&"ns"!==t.slice(0,2)&&"default"!==t.slice(0,7)){for(var r in this.namespaces)this.namespaces[r]==e&&delete this.namespaces[r];this.namespaces[t]=e}}},{key:"statementsMatching",value:function(t,e,r,n,i){var o,a,s=[t,e,r,n],u=[],c=[],l=[],h=[];for(o=0;o<4;o++)u[o]=this.canon(it.fromValue(s[o])),u[o]?(h.push(o),c[o]=this.id(u[o])):l.push(o);if(0===h.length)return this.statements;if(1===h.length)return o=h[0],(a=this.index[o][c[o]])&&i&&a.length>1&&(a=a.slice(0,1)),a||[];var f,p,d=1e10;for(p=0;p<h.length;p++){if(o=h[p],!(a=this.index[o][c[o]]))return[];a.length<d&&(d=a.length,f=p)}for(var y=h[f],v=this.index[y][c[y]],g=h.slice(0,f).concat(h.slice(f+1)),m=[],b=["subject","predicate","object","why"],w=0;w<v.length;w++){var x=v[w];for(p=0;p<g.length;p++)if(o=g[p],!this.canon(x[b[o]]).equals(u[o])){x=null;break}if(null!=x&&(m.push(x),i))break}return m}},{key:"uris",value:function(t){var e=this.canon(t),r=this.aliases[this.id(e)];if(!e.value)return[];var n=[e.value];if(r)for(var i=0;i<r.length;i++)n.push(r[i].uri);return n}},{key:"serialize",value:function(t,e,r,n){var i,o=null!==(i=n)&&void 0!==i&&i.namespaces?lt(lt({},this.namespaces),n.namespaces):lt({},this.namespaces);return W(r,this,t,e,void 0,n=lt(lt({},n||{}),{},{namespaces:o}))}}],[{key:"defaultGraphURI",get:function(){return E}}]),d}(nt);function mt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return bt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?bt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function bt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}(0,a.Z)(gt,"handleRDFType",void 0),gt.handleRDFType=vt;var wt=Z("http://www.w3.org/1999/02/22-rdf-syntax-ns#");function xt(t,e){function r(n,i,o){var a=t.statementsMatching(n,wt("rest"),null,e);if(1!==a.length)throw new Error("Bad list structure: no rest at ".concat(n));var s=t.statementsMatching(n,wt("first"),null,e);if(1!==s.length)throw new Error("Bad list structure: rest but ".concat(s.length," firsts at ").concat(n));var u=[s[0].object].concat(i),c=o.concat(a).concat(s),l=t.statementsMatching(null,wt("rest"),n,e);if(0===l.length){var h=new w(u);return t.remove(c),void function(t,e,r,n){var i,o=mt(t.statementsMatching(r,null,null,n));try{for(o.s();!(i=o.n()).done;){var a=i.value,s=new R(e,a.predicate,a.object,n);t.remove(a),t.add(s)}}catch(t){o.e(t)}finally{o.f()}var u,c=mt(t.statementsMatching(null,r,null,n));try{for(c.s();!(u=c.n()).done;){var l=u.value;t.remove(l),t.add(new R(l.subject,e,l.object,n))}}catch(t){c.e(t)}finally{c.f()}var h,f=mt(t.statementsMatching(null,null,r,n));try{for(f.s();!(h=f.n()).done;){var p=h.value;t.remove(p),t.add(new R(p.subject,p.predicate,e,n))}}catch(t){f.e(t)}finally{f.f()}}(t,h,n,e)}if(1!==l.length)throw new Error("Bad list structure: ".concat(l.length," pres at ").concat(n));var f=l[0].subject;if("BlankNode"!==f.termType)throw new Error("Bad list element node ".concat(f," type: ").concat(f.termType," "));r(f,u,c)}!function(t,e){var r,n=wt("nil"),i=mt(t.statementsMatching(n,null,null,e));try{for(i.s();!(r=i.n()).done;){var o=r.value;t.remove(o);var a=new w;t.add(new R(a,o.predicate,o.object,e))}}catch(t){i.e(t)}finally{i.f()}var s,u=mt(t.statementsMatching(null,null,n,e));try{for(u.s();!(s=u.n()).done;){var c=s.value;if(!c.predicate.sameTerm(wt("rest"))){t.remove(c);var l=new w;t.add(new R(c.subject,c.predicate,l,e))}}}catch(t){u.e(t)}finally{u.f()}}(t,e),t.statementsMatching(null,wt("rest"),wt("nil"),e).forEach((function(t){if("BlankNode"!==t.subject.termType)throw new Error("Bad list element node ".concat(t.subject," type: ").concat(t.subject.termType," "));r(t.subject,[],[])}))}var _t="http://www.w3.org/2000/10/swap/log#",Tt=function(t){return t},kt=function(t){return t},At=function(t){if(t.length>0)throw"missing.js: oops nnonempty dict not imp";return[]},Et=function(t){return t.length},Ot=function(t,e,r){if(void 0===t.slice)throw"@@ mising.js: No .slice function for "+t+" of type "+(0,d.Z)(t);return void 0===r||null==r?t.slice(e):t.slice(e,r)},jt=Error("dummy error stop iteration"),Nt=function(t){return this.last=0,this.li=t,this.next=function(){if(this.last==this.li.length)throw jt;return this.li[this.last++]},this},St=function(t,e){return t.indexOf(e)},Rt=function(t,e){if(!t){if(e)throw"python Assertion failed: "+e;throw"(python) Assertion failed."}};String.prototype.encode=function(t){if("utf-8"!=t)throw"UTF8_converter: can only do utf-8";return function(t){t=t.replace(/\r\n/g,"\n");for(var e="",r=0;r<t.length;r++){var n=t.charCodeAt(r);n<128?e+=String.fromCharCode(n):n>127&&n<2048?(e+=String.fromCharCode(n>>6|192),e+=String.fromCharCode(63&n|128)):(e+=String.fromCharCode(n>>12|224),e+=String.fromCharCode(n>>6&63|128),e+=String.fromCharCode(63&n|128))}return e}(this)},String.prototype.decode=function(t){if("utf-8"!=t)throw"UTF8_converter: can only do utf-8";return this};var It=function(t,e){return I.join(e,t)},Ct="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil",Pt="http://www.w3.org/2002/07/owl#sameAs",Ft="\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~",Ut=Ft+":",Lt=new RegExp("^([-+]?[0-9]+)(\\.[0-9]+)?(e[-+]?[0-9]+)?","g"),Dt=new RegExp("^[0-9][0-9][0-9][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]*)?)?)?Z?"),Mt=new RegExp('[\\\\\\r\\n\\"]',"g"),Zt=new RegExp("^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*","g");const Bt=function(t,e,r,n,i,o,a,s){return new Ht(t,e,r,n,i,o,a,s)};var qt,Ht=function(){function r(t,n,i,o,a,s,u,c){(0,e.Z)(this,r),void 0===n&&(n=null),void 0===i&&(i=""),void 0===o&&(o=null),void 0===a&&(a=""),void 0===s&&(s=null),void 0===u&&(u=""),void 0===c&&(c=null),this._bindings=new At([]),this._flags=u,""!=i&&(Rt(i.indexOf(":")>=0,"Document URI not absolute: "+i),this._bindings[""]=i+"#"),this._store=t,a&&t.setGenPrefix(a),this._thisDoc=i,this.source=t.sym(i),this.lines=0,this.statementCount=0,this.hasNil=!1,this.startOfLine=0,this.previousLine=0,this._genPrefix=a,this.keywords=new kt(["a","this","bind","has","is","of","true","false"]),this.keywordsSet=0,this._anonymousNodes=new At([]),this._variables=new At([]),this._parentVariables=new At([]),this._reason=c,this._reason2=null,this._baseURI=o||i||null,Rt(!this._baseURI||this._baseURI.indexOf(":")>=0),this._genPrefix||(this._thisDoc?this._genPrefix=this._thisDoc+"#_g":this._genPrefix=RDFSink_uniqueURI()),null==n?this._thisDoc?this._formula=t.formula(i+"#_formula"):this._formula=t.formula():this._formula=n,this._context=this._formula,this._parentContext=null}return(0,t.Z)(r,[{key:"here",value:function(t){return this._genPrefix+"_L"+this.lines+"C"+(t-this.startOfLine+1)}},{key:"formula",value:function(){return this._formula}},{key:"loadStream",value:function(t){return this.loadBuf(t.read())}},{key:"loadBuf",value:function(t){return this.startDoc(),this.feed(t),this.endDoc()}},{key:"feed",value:function(t){for(var e=t.decode("utf-8"),r=0;r>=0;){var n=this.skipSpace(e,r);if(n<0)return;if((r=this.directiveOrStatement(e,n))<0)throw $t(this._thisDoc,this.lines,e,n,"expected directive or statement")}}},{key:"directiveOrStatement",value:function(t,e){var r,n=this.skipSpace(t,e);return n<0?n:(r=this.directive(t,n))>=0||(r=this.statement(t,n))>=0?this.checkDot(t,r):r}},{key:"tok",value:function(t,e,r){if("@"==e.slice(r,r+1))r+=1;else if(K(this.keywords,t)<0)return-1;var n=r+Et(t);return e.slice(r,n)==t&&Ft.indexOf(e.charAt(n))>=0?n:-1}},{key:"directive",value:function(t,e){if((o=this.skipSpace(t,e))<0)return o;var r=new kt([]);if((o=this.tok("bind",t,e))>0)throw $t(this._thisDoc,this.lines,t,e,"keyword bind is obsolete: use @prefix");if((o=this.tok("keywords",t,e))>0){if((e=this.commaSeparatedList(t,o,r,!1))<0)throw $t(this._thisDoc,this.lines,t,e,"'@keywords' needs comma separated list of words");return this.setKeywords(Ot(r,null,null)),e}if((o=this.tok("forAll",t,e))>0){if((e=this.commaSeparatedList(t,o,r,!0))<0)throw $t(this._thisDoc,this.lines,t,e,"Bad variable list after @forAll");var n=new Nt(r);try{for(;;){var i=n.next();(K(this._variables,i)<0||K(this._parentVariables,i)>=0)&&(this._variables[i]=this._context.newUniversal(i))}}catch(t){if(t!=jt)throw t}return e}if((o=this.tok("forSome",t,e))>0){if((e=this.commaSeparatedList(t,o,r,this.uri_ref2))<0)throw $t(this._thisDoc,this.lines,t,e,"Bad variable list after @forSome");n=new Nt(r);try{for(;;)i=n.next(),this._context.declareExistential(i)}catch(t){if(t!=jt)throw t}return e}if((o=this.tok("prefix",t,e))>=0){var o,a=new kt([]);if((e=this.qname(t,o,a))<0)throw $t(this._thisDoc,this.lines,t,o,"expected qname after @prefix");if((o=this.uri_ref2(t,e,a))<0)throw $t(this._thisDoc,this.lines,t,e,"expected <uriref> after @prefix _qname_");var s=a[1].uri;return this._baseURI?s=It(this._baseURI,s):Rt(s.indexOf(":")>=0,"With no base URI, cannot handle relative URI for NS"),Rt(s.indexOf(":")>=0),this._bindings[a[0][0]]=s,this.bind(a[0][0],function(t){return encodeURI(t)}(s)),o}if((o=this.tok("base",t,e))>=0){if(a=new kt([]),(e=this.uri_ref2(t,o,a))<0)throw $t(this._thisDoc,this.lines,t,o,"expected <uri> after @base ");if(s=a[0].uri,!this._baseURI)throw $t(this._thisDoc,this.lines,t,o,"With no previous base URI, cannot use relative URI in @base <"+s+">");return s=It(this._baseURI,s),Rt(s.indexOf(":")>=0),this._baseURI=s,e}return-1}},{key:"bind",value:function(t,e){""==t||this._store.setPrefixForURI(t,e)}},{key:"setKeywords",value:function(t){null==t?this.keywordsSet=0:(this.keywords=t,this.keywordsSet=1)}},{key:"startDoc",value:function(){}},{key:"endDoc",value:function(){return this.hasNil&&this._store.rdfFactory.supports.COLLECTIONS&&xt(this._store,this.source),this._formula}},{key:"makeStatement",value:function(t){t[0].add(t[2],t[1],t[3],this.source),(t[2].uri&&t[2].uri===Ct||t[3].uri&&t[3].uri===Ct)&&(this.hasNil=!0),this.statementCount+=1}},{key:"statement",value:function(t,e){var r=new kt([]);if((e=this.object(t,e,r))<0)return e;var n=this.property_list(t,e,r[0]);if(n<0)throw $t(this._thisDoc,this.lines,t,e,"expected propertylist");return n}},{key:"subject",value:function(t,e,r){return this.item(t,e,r)}},{key:"verb",value:function(t,e,r){if((i=this.skipSpace(t,e))<0)return i;var n=new kt([]);if((i=this.tok("has",t,e))>=0){if((e=this.prop(t,i,n))<0)throw $t(this._thisDoc,this.lines,t,i,"expected property after 'has'");return r.push(new Tt(["->",n[0]])),e}if((i=this.tok("is",t,e))>=0){if((e=this.prop(t,i,n))<0)throw $t(this._thisDoc,this.lines,t,i,"expected <property> after 'is'");if((i=this.skipSpace(t,e))<0)throw $t(this._thisDoc,this.lines,t,e,"End of file found, expected property after 'is'");var i;if(e=i,(i=this.tok("of",t,e))<0)throw $t(this._thisDoc,this.lines,t,e,"expected 'of' after 'is' <prop>");return r.push(new Tt(["<-",n[0]])),i}if((i=this.tok("a",t,e))>=0)return r.push(new Tt(["->",this._store.sym("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")])),i;if("<="==t.slice(e,e+2))return r.push(new Tt(["<-",this._store.sym(_t+"implies")])),e+2;if("="==t.slice(e,e+1))return">"==t.slice(e+1,e+2)?(r.push(new Tt(["->",this._store.sym(_t+"implies")])),e+2):(r.push(new Tt(["->",this._store.sym(Pt)])),e+1);if(":="==t.slice(e,e+2))return r.push(new Tt(["->",_t+"becomes"])),e+2;if((i=this.prop(t,e,n))>=0)return r.push(new Tt(["->",n[0]])),i;if(">-"==t.slice(e,e+2)||"<-"==t.slice(e,e+2))throw $t(this._thisDoc,this.lines,t,i,">- ... -> syntax is obsolete.");return-1}},{key:"prop",value:function(t,e,r){return this.item(t,e,r)}},{key:"item",value:function(t,e,r){return this.path(t,e,r)}},{key:"blankNode",value:function(t){return this._context.bnode(t,this._reason2)}},{key:"path",value:function(t,e,r){if((o=this.nodeOrLiteral(t,e,r))<0)return o;for(;"!^.".indexOf(t.slice(o,o+1))>=0;){var n=t.slice(o,o+1);if("."==n){var i=t.slice(o+1,o+2);if(!i||Ut.indexOf(i)>=0&&":?<[{(".indexOf(i)<0)break}var o,a=r.pop(),s=this.blankNode(this.here(o));if((o=this.node(t,o+1,r))<0)throw $t(this._thisDoc,this.lines,t,o,"EOF found in middle of path syntax");var u=r.pop();"^"==n?this.makeStatement(new Tt([this._context,u,s,a])):this.makeStatement(new Tt([this._context,u,a,s])),r.push(s)}return o}},{key:"anonymousNode",value:function(t){if(e=this._anonymousNodes[t])return e;var e=this._store.bnode(t);return this._anonymousNodes[t]=e,e}},{key:"node",value:function(t,e,r,n){void 0===n&&(n=null);var i=n;if((l=this.skipSpace(t,e))<0)return l;e=l;var o=t.slice(e,e+1);if("["==o){var a=this.here(e);if((l=this.skipSpace(t,e+1))<0)throw $t(this._thisDoc,this.lines,t,e,"EOF after '['");if("="==t.slice(l,l+1)){e=l+1;var s=new kt([]);if(!((l=this.objectList(t,e,s))>=0))throw $t(this._thisDoc,this.lines,t,e,"objectList expected after [= ");if(i=s[0],Et(s)>1){var u=new Nt(s);try{for(;;){var c=u.next();this.makeStatement(new Tt([this._context,this._store.sym(Pt),i,c]))}}catch(t){if(t!=jt)throw t}}if((l=this.skipSpace(t,l))<0)throw $t(this._thisDoc,this.lines,t,e,"EOF when objectList expected after [ = ");if(";"==t.slice(l,l+1))var l=l+1}if(null==i&&(i=this.blankNode(a)),(e=this.property_list(t,l,i))<0)throw $t(this._thisDoc,this.lines,t,l,"property_list expected");if((l=this.skipSpace(t,e))<0)throw $t(this._thisDoc,this.lines,t,e,"EOF when ']' expected after [ <propertyList>");if("]"!=t.slice(l,l+1))throw $t(this._thisDoc,this.lines,t,l,"']' expected");return r.push(i),l+1}if("{"==o){if("$"==t.slice(e+1,e+2)){l=(e+=1)+1;for(var h=new kt([]),f=!0;;){if((e=this.skipSpace(t,l))<0)throw $t(this._thisDoc,this.lines,t,e,"needed '$}', found end.");if("$}"==t.slice(e,e+2)){l=e+2;break}if(f)f=!1;else{if(","!=t.slice(e,e+1))throw $t(this._thisDoc,this.lines,t,e,"expected: ','");e+=1}var p=new kt([]);if((l=this.item(t,e,p))<0)throw $t(this._thisDoc,this.lines,t,e,"expected item in set or '$}'");h.push(p[0])}return r.push(this._store.newSet(h,this._context)),l}l=e+1;var d=this._parentContext;this._parentContext=this._context;var y=this._anonymousNodes,v=this._parentVariables;this._parentVariables=this._variables,this._anonymousNodes=new At([]),this._variables=this._variables.slice();var g=this._reason2;for(this._reason2=null,null==i&&(i=this._store.formula()),this._context=i;;){if((e=this.skipSpace(t,l))<0)throw $t(this._thisDoc,this.lines,t,e,"needed '}', found end.");if("}"==t.slice(e,e+1)){l=e+1;break}if((l=this.directiveOrStatement(t,e))<0)throw $t(this._thisDoc,this.lines,t,e,"expected statement or '}'")}return this._anonymousNodes=y,this._variables=this._parentVariables,this._parentVariables=v,this._context=this._parentContext,this._reason2=g,this._parentContext=d,r.push(i.close()),l}if("("==o){var m=this._store.list;for("$"==t.slice(e+1,e+2)&&(m=this._store.newSet,e+=1),l=e+1,h=new kt([]);;){if((e=this.skipSpace(t,l))<0)throw $t(this._thisDoc,this.lines,t,e,"needed ')', found end.");if(")"==t.slice(e,e+1)){l=e+1;break}if(p=new kt([]),(l=this.item(t,e,p))<0)throw $t(this._thisDoc,this.lines,t,e,"expected item in list or ')'");h.push(p[0])}return r.push(m(h,this._context)),l}if((l=this.tok("this",t,e))>=0)throw $t(this._thisDoc,this.lines,t,e,"Keyword 'this' was ancient N3. Now use @forSome and @forAll keywords.");return(l=this.tok("true",t,e))>=0?(r.push(!0),l):(l=this.tok("false",t,e))>=0?(r.push(!1),l):null==i&&(l=this.uri_ref2(t,e,r))>=0?l:-1}},{key:"property_list",value:function(t,e,r){for(;;){if((l=this.skipSpace(t,e))<0)throw $t(this._thisDoc,this.lines,t,e,"EOF found when expected verb in property list");if(":-"!=t.slice(l,l+2)){e=l;var n=new kt([]);if((l=this.verb(t,e,n))<=0)return e;var i=new kt([]);if((e=this.objectList(t,l,i))<0)throw $t(this._thisDoc,this.lines,t,l,"objectList expected");var o=new Nt(i);try{for(;;){var a=o.next(),s=n[0],u=s[0],c=s[1];"->"==u?this.makeStatement(new Tt([this._context,c,r,a])):this.makeStatement(new Tt([this._context,c,a,r]))}}catch(t){if(t!=jt)throw t}if((l=this.skipSpace(t,e))<0)throw $t(this._thisDoc,this.lines,t,l,"EOF found in list of objects");if(";"!=t.slice(e,e+1))return e;e+=1}else{e=l+2;var l,h=new kt([]);if((l=this.node(t,e,h,r))<0)throw $t(this._thisDoc,this.lines,t,e,"bad {} or () or [] node after :- ");e=l}}}},{key:"commaSeparatedList",value:function(t,e,r,n){if((i=this.skipSpace(t,e))<0)throw $t(this._thisDoc,this.lines,t,i,"EOF found expecting comma sep list");if("."==t.charAt(i))return e;if(n)var i=this.uri_ref2(t,i,r);else i=this.bareWord(t,i,r);if(i<0)return-1;for(;;){if((e=this.skipSpace(t,i))<0)return e;var o=t.slice(e,e+1);if(","!=o)return"."!=o?-1:e;if((i=n?this.uri_ref2(t,e+1,r):this.bareWord(t,e+1,r))<0)throw $t(this._thisDoc,this.lines,t,i,"bad list content")}}},{key:"objectList",value:function(t,e,r){if((e=this.object(t,e,r))<0)return-1;for(;;){var n=this.skipSpace(t,e);if(n<0)throw $t(this._thisDoc,this.lines,t,n,"EOF found after object");if(","!=t.slice(n,n+1))return n;if((e=this.object(t,n+1,r))<0)return e}}},{key:"checkDot",value:function(t,e){var r=this.skipSpace(t,e);if(r<0)return r;if("."==t.slice(r,r+1))return r+1;if("}"==t.slice(r,r+1))return r;if("]"==t.slice(r,r+1))return r;throw $t(this._thisDoc,this.lines,t,r,"expected '.' or '}' or ']' at end of statement")}},{key:"uri_ref2",value:function(t,e,r){var n=new kt([]);if((f=this.qname(t,e,n))>=0){var i=n[0],o=i[0],a=i[1];if(null==o){Rt(0,"not used?");var s=this._baseURI+"#"}else if(!(s=this._bindings[o])){if("_"==o)return r.push(this.anonymousNode(a)),f;throw $t(this._thisDoc,this.lines,t,e,"Prefix "+o+" not bound.")}var u=this._store.sym(s+a);return K(this._variables,u)>=0?r.push(this._variables[u]):r.push(u),f}if((e=this.skipSpace(t,e))<0)return-1;if("?"==t.charAt(e)){var c=new kt([]);return(f=this.variable(t,e,c))>0?(r.push(c[0]),f):-1}if("<"==t.charAt(e)){for(var l=e+=1;e<Et(t);){if(">"==t.charAt(e)){var h=t.slice(l,e);return this._baseURI?h=It(this._baseURI,h):Rt(h.indexOf(":")>=0,"With no base URI, cannot deal with relative URIs"),"#"==t.slice(e-1,e)&&"#"!=Ot(h,-1,null)&&(h+="#"),u=this._store.sym(h),K(this._variables,u)>=0?r.push(this._variables[u]):r.push(u),e+1}e+=1}throw $t(this._thisDoc,this.lines,t,f,"unterminated URI reference")}if(this.keywordsSet){var f;if(c=new kt([]),(f=this.bareWord(t,e,c))<0)return-1;if(K(this.keywords,c[0])>=0)throw $t(this._thisDoc,this.lines,t,e,'Keyword "'+c[0]+'" not allowed here.');return r.push(this._store.sym(this._bindings[""]+c[0])),f}return-1}},{key:"skipSpace",value:function(t,e){for(var r=e||0;r<t.length;r++){var n=t.charAt(r);if(" \n\r\t\f\v            ​\u2028\u2029 ".indexOf(n)<0){if("#"!==t.charAt(r))return r;for(;;r++){if(r===t.length)return-1;if("\n"===t.charAt(r)){this.lines=this.lines+1;break}}}else"\n"===t.charAt(r)&&(this.lines=this.lines+1)}return-1}},{key:"variable",value:function(t,e,r){if((n=this.skipSpace(t,e))<0)return-1;if("?"!=t.slice(n,n+1))return-1;var n;if(e=n+=1,"0123456789-".indexOf(t.charAt(n))>=0)throw $t(this._thisDoc,this.lines,t,n,"Varible name can't start with '"+t.charAt(n)+"s'");for(;e<Et(t)&&Ut.indexOf(t.charAt(e))<0;)e+=1;if(null==this._parentContext)throw $t(this._thisDoc,this.lines,t,n,"Can't use ?xxx syntax for variable in outermost level: "+t.slice(n-1,e));return r.push(this._store.variable(t.slice(n,e))),e}},{key:"bareWord",value:function(t,e,r){var n=this.skipSpace(t,e);if(n<0)return-1;var i=t.charAt(n);if("0123456789-".indexOf(i)>=0)return-1;if(Ut.indexOf(i)>=0)return-1;for(e=n;e<Et(t)&&Ut.indexOf(t.charAt(e))<0;)e+=1;return r.push(t.slice(n,e)),e}},{key:"qname",value:function(t,e,r){if((e=this.skipSpace(t,e))<0)return-1;var n=t.charAt(e);if("0123456789-+".indexOf(n)>=0)return-1;if(Ut.indexOf(n)<0){var i=n;for(e+=1;e<Et(t)&&(n=t.charAt(e),Ut.indexOf(n)<0);)i+=n,e+=1}else i="";if(e<Et(t)&&":"==t.charAt(e)){var o=i;for(e+=1,i="";e<Et(t)&&(n=t.charAt(e),Ut.indexOf(n)<0);)i+=n,e+=1;return r.push(new Tt([o,i])),e}return i&&this.keywordsSet&&K(this.keywords,i)<0?(r.push(new Tt(["",i])),e):-1}},{key:"object",value:function(t,e,r){if((a=this.subject(t,e,r))>=0)return a;if((a=this.skipSpace(t,e))<0)return-1;e=a;var n=null,i=t.charAt(e);if('"'==i||"'"==i){n=t.slice(e,e+3==i+i)?i+i+i:i,e+=Et(n);var o=this.strconst(t,e,n),a=o[0],s=o[1];return r.push(this._store.literal(s)),a}return-1}},{key:"nodeOrLiteral",value:function(t,e,r){if((u=this.node(t,e,r))>=0)return u;if((u=this.skipSpace(t,e))<0)return-1;e=u;var n=t.charAt(e);if("-+0987654321".indexOf(n)>=0){if(Dt.lastIndex=0,null!=(h=Dt.exec(t.slice(e))))u=e+(i=h[0]).length,i.indexOf("T")>=0?r.push(this._store.literal(i,this._store.sym("http://www.w3.org/2001/XMLSchema#dateTime"))):r.push(this._store.literal(i,this._store.sym("http://www.w3.org/2001/XMLSchema#date")));else{var i;if(Lt.lastIndex=0,null==(h=Lt.exec(t.slice(e))))throw $t(this._thisDoc,this.lines,t,e,"Bad number or date syntax");u=e+Lt.lastIndex,(i=t.slice(e,u)).indexOf("e")>=0?r.push(this._store.literal(parseFloat(i),this._store.sym("http://www.w3.org/2001/XMLSchema#double"))):t.slice(e,u).indexOf(".")>=0?r.push(this._store.literal(parseFloat(i),this._store.sym("http://www.w3.org/2001/XMLSchema#decimal"))):r.push(this._store.literal(parseInt(i),this._store.sym("http://www.w3.org/2001/XMLSchema#integer")))}return u}if('"'==t.charAt(e)){if('"""'==t.slice(e,e+3))var o='"""';else o='"';e+=Et(o);var a=null,s=this.strconst(t,e,o),u=s[0],c=s[1],l=null;if("@"==t.slice(u,u+1)){var h;if(Zt.lastIndex=0,null==(h=Zt.exec(t.slice(u+1))))throw $t(this._thisDoc,startline,t,e,"Bad language code syntax on string literal, after @");e=Zt.lastIndex+u+1,l=t.slice(u+1,e),u=e}if("^^"==t.slice(u,u+2)){var f=new kt([]);u=this.uri_ref2(t,u+2,f),a=f[0]}return r.push(this._store.literal(c,l||a)),u}return-1}},{key:"strconst",value:function(t,e,r){for(var n=e,i="",o=this.lines;n<Et(t);){if(e=n+Et(r),t.slice(n,e)==r)return new Tt([e,i]);if('"'!=t.charAt(n)){if(Mt.lastIndex=0,!Mt.exec(t.slice(n)))throw $t(this._thisDoc,o,t,n,"Closing quote missing in string at ^ in "+t.slice(n-20,n)+"^"+t.slice(n,n+20));if(e=n+Mt.lastIndex-1,i+=t.slice(n,e),'"'!=(u=t.charAt(e)))if("\r"!=u){if("\n"==u){if('"'==r)throw $t(this._thisDoc,o,t,e,"newline found in string literal");this.lines=this.lines+1,i+=u,n=e+1,this.previousLine=this.startOfLine,this.startOfLine=n}else if("\\"==u){if(n=e+1,!(u=t.slice(n,n+1)))throw $t(this._thisDoc,o,t,e,"unterminated string literal (2)");var a=St('abfrtvn\\"',u);if(a>=0)i+='a\b\f\r\t\v\n\\"'.charAt(a),n+=1;else if("u"==u)n=(s=this.uEscape(t,n+1,o))[0],i+=u=s[1];else{if("U"!=u)throw $t(this._thisDoc,this.lines,t,e,"bad escape");var s,u;n=(s=this.UEscape(t,n+1,o))[0],i+=u=s[1]}}}else n=e+1;else n=e}else i=i+'"',n=n+1}throw $t(this._thisDoc,this.lines,t,e,"unterminated string literal")}},{key:"uEscape",value:function(t,e,r){for(var n=e,i=0,o=0;i<4;){var a=t.slice(n,n+1).toLowerCase();if(n+=1,""==a)throw $t(this._thisDoc,r,t,e,"unterminated string literal(3)");var s=St("0123456789abcdef",a);if(s<0)throw $t(this._thisDoc,r,t,e,"bad string literal hex escape");o=16*o+s,i+=1}var u=String.fromCharCode(o);return new Tt([n,u])}},{key:"UEscape",value:function(t,e,r){for(var n=e,i=0,o="\\U";i<8;){var a=t.slice(n,n+1).toLowerCase();if(n+=1,""==a)throw $t(this._thisDoc,r,t,e,"unterminated string literal(3)");if(St("0123456789abcdef",a)<0)throw $t(this._thisDoc,r,t,e,"bad string literal hex escape");o+=a,i+=1}var s,u=(s="0x"+Ot(o,2,10)-0,String.fromCharCode(s));return new Tt([n,u])}}]),r}();function $t(t,e,r,n,i){var o=e+1,a="Line "+o+" of <"+t+">: Bad syntax: "+i+'\nat: "'+r.slice(n,n+30)+'"',s=new SyntaxError(a,t,o);return s.lineNo=o,s.characterInFile=n,s.syntaxProblem=i,s}function zt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Xt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?zt(Object(r),!0).forEach((function(e){(0,a.Z)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):zt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Vt=Xt(Xt({},D),{},{supports:(qt={},(0,a.Z)(qt,C.collections,!0),(0,a.Z)(qt,C.defaultGraphType,!1),(0,a.Z)(qt,C.equalsMethod,!0),(0,a.Z)(qt,C.identity,!1),(0,a.Z)(qt,C.id,!0),(0,a.Z)(qt,C.reversibleId,!1),(0,a.Z)(qt,C.variableType,!0),qt),collection:function(t){return new w(t)},id:function(t){var e=this;return(0,v.uZ)(t)?"( ".concat(t.elements.map((function(t){return e.id(t)})).join(", ")," )"):(0,v.cG)(t)?F.toString(t):D.id(t)},termToNQ:function(t){return t.termType===h.fb?w.toNT(t):D.termToNQ(t)}});const Gt=Vt;function Wt(t,e){return"string"==typeof e?t.rdfFactory.literal(e):Object.prototype.hasOwnProperty.call(e,"@list")?!0===t.rdfFactory.supports.COLLECTIONS?function(t,e){if(!Array.isArray(e))throw new TypeError("Object must be an array");return t.rdfFactory.collection(e.map((function(e){return Wt(t,e)})))}(t,e["@list"]):function(t,e){var r=e["@id"]?Yt(t,e):t.rdfFactory.blankNode(),n=e["@list"].map((function(e){return Wt(t,e)})),i=J(t.rdfFactory,r,n);return t.addAll(i),r}(t,e):Object.prototype.hasOwnProperty.call(e,"@id")?Yt(t,e):Object.prototype.hasOwnProperty.call(e,"@language")?t.rdfFactory.literal(e["@value"],e["@language"]):Object.prototype.hasOwnProperty.call(e,"@type")?t.rdfFactory.literal(e["@value"],t.rdfFactory.namedNode(e["@type"])):Object.prototype.hasOwnProperty.call(e,"@value")?t.rdfFactory.literal(e["@value"]):t.rdfFactory.literal(e)}function Qt(t,e,r,n){var i=r&&Object.prototype.hasOwnProperty.call(r,"termType")?r.value:r;return Promise.all([s.e(730),s.e(670)]).then(s.t.bind(s,730,23)).then((function(e){return e.flatten(JSON.parse(t),null,{base:i})})).then((function(t){return t.reduce((function(t,n){return e=Jt(e,r,n)}),e)})).then(n).catch(n)}function Yt(t,e){return e["@id"].startsWith("_:")?t.rdfFactory.blankNode(e["@id"].substring(2)):t.rdfFactory.namedNode(e["@id"])}function Jt(t,e,r){for(var n=r["@id"]?Yt(t,r):t.rdfFactory.blankNode(),i=0,o=Object.keys(r);i<o.length;i++){var a=o[i];if("@id"!==a){if("@graph"==a)for(var s=n,u=r[a],c=0;c<u.length;c++)t=Jt(t,s,u[c]);var l=r[a];if(Array.isArray(l))for(var h=0;h<l.length;h++)t.addStatement(Kt(t,n,a,l[h],e));else t.addStatement(Kt(t,n,a,l,e))}}return t}function Kt(t,e,r,n,i){var o,a;return"@type"===r?(o=t.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),a=t.rdfFactory.namedNode(n)):(o=t.rdfFactory.namedNode(r),a=Wt(t,n)),t.rdfFactory.quad(e,o,a,t.rdfFactory.namedNode(i))}const te="http://www.w3.org/1999/02/22-rdf-syntax-ns#",ee="http://www.w3.org/2001/XMLSchema#",re="http://www.w3.org/2000/10/swap/",ne={xsd:{decimal:`${ee}decimal`,boolean:`${ee}boolean`,double:`${ee}double`,integer:`${ee}integer`,string:`${ee}string`},rdf:{type:`${te}type`,nil:`${te}nil`,first:`${te}first`,rest:`${te}rest`,langString:`${te}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${re}reify#forSome`,forAll:`${re}reify#forAll`},log:{implies:`${re}log#implies`}};var ie=s(5929),oe=s.n(ie),ae=s(2486).lW;const{xsd:se}=ne,ue=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,ce={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},le=/[\x00-\x20<>\\"\{\}\|\^\`]/,he={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},fe=/$0^/;class pe{constructor(t){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]*)?$/,t=t||{},this._lineMode=!!t.lineMode){this._n3Mode=!1;for(const t in this)!(t in he)&&this[t]instanceof RegExp&&(this[t]=fe)}else this._n3Mode=!1!==t.n3;this._comments=!!t.comments,this._literalClosingPos=0}_tokenizeToEnd(t,e){let r=this._input,n=r.length;for(;;){let t,a;for(;t=this._newline.exec(r);)this._comments&&(a=this._comment.exec(t[0]))&&i("comment",a[1],"",this._line,t[0].length),r=r.substr(t[0].length,r.length),n=r.length,this._line++;if(!t&&(t=this._whitespace.exec(r))&&(r=r.substr(t[0].length,r.length)),this._endOfFile.test(r))return e&&(this._comments&&(a=this._comment.exec(r))&&i("comment",a[1],"",this._line,r.length),r=null,i("eof","","",this._line,0)),this._input=r;const s=this._line,u=r[0];let c="",l="",h="",f=null,p=0,d=!1;switch(u){case"^":if(r.length<3)break;if("^"!==r[1]){this._n3Mode&&(p=1,c="^");break}if(this._previousMarker="^^",r=r.substr(2),"<"!==r[0]){d=!0;break}case"<":if(f=this._unescapedIri.exec(r))c="IRI",l=f[1];else if(f=this._iri.exec(r)){if(l=this._unescape(f[1]),null===l||le.test(l))return o(this);c="IRI"}else r.length>1&&"<"===r[1]?(c="<<",p=2):this._n3Mode&&r.length>1&&"="===r[1]&&(c="inverse",p=2,l=">");break;case">":r.length>1&&">"===r[1]&&(c=">>",p=2);break;case"_":((f=this._blank.exec(r))||e&&(f=this._blank.exec(`${r} `)))&&(c="blank",h="_",l=f[1]);break;case'"':if(f=this._simpleQuotedString.exec(r))l=f[1];else if(({value:l,matchLength:p}=this._parseLiteral(r)),null===l)return o(this);null===f&&0===p||(c="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(f=this._simpleApostropheString.exec(r))l=f[1];else if(({value:l,matchLength:p}=this._parseLiteral(r)),null===l)return o(this);null===f&&0===p||(c="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(f=this._variable.exec(r))&&(c="var",l=f[0]);break;case"@":"literal"===this._previousMarker&&(f=this._langcode.exec(r))?(c="langcode",l=f[1]):(f=this._keyword.exec(r))&&(c=f[0]);break;case".":if(1===r.length?e:r[1]<"0"||r[1]>"9"){c=".",p=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(f=this._number.exec(r)||e&&(f=this._number.exec(`${r} `)))&&(c="literal",l=f[0],h="string"==typeof f[1]?se.double:"string"==typeof f[2]?se.decimal:se.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(f=this._sparqlKeyword.exec(r))?c=f[0].toUpperCase():d=!0;break;case"f":case"t":(f=this._boolean.exec(r))?(c="literal",l=f[0],h=se.boolean):d=!0;break;case"a":(f=this._shortPredicates.exec(r))?(c="abbreviation",l="a"):d=!0;break;case"=":this._n3Mode&&r.length>1&&(c="abbreviation",">"!==r[1]?(p=1,l="="):(p=2,l=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(p=1,c=u);break;default:d=!0}if(d&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(f=this._prefix.exec(r))?((f=this._prefixed.exec(r))||e&&(f=this._prefixed.exec(`${r} `)))&&(c="prefixed",h=f[1]||"",l=this._unescape(f[2])):(c="prefix",l=f[1]||"")),"^^"===this._previousMarker)switch(c){case"prefixed":c="type";break;case"IRI":c="typeIRI";break;default:c=""}if(!c)return e||!/^'''|^"""/.test(r)&&/\n|\r/.test(r)?o(this):this._input=r;const y=p||f[0].length,v=i(c,l,h,s,y);this.previousToken=v,this._previousMarker=c,r=r.substr(y,r.length)}function i(e,i,o,a,s){const u=r?n-r.length:n,c={type:e,value:i,prefix:o,line:a,start:u,end:u+s};return t(null,c),c}function o(e){t(e._syntaxError(/^\S*/.exec(r)[0]))}}_unescape(t){let e=!1;const r=t.replace(ue,((t,r,n,i)=>{if("string"==typeof r)return String.fromCharCode(Number.parseInt(r,16));if("string"==typeof n){let t=Number.parseInt(n,16);return t<=65535?String.fromCharCode(Number.parseInt(n,16)):String.fromCharCode(55296+((t-=65536)>>10),56320+(1023&t))}return i in ce?ce[i]:(e=!0,"")}));return e?null:r}_parseLiteral(t){if(t.length>=3){const e=t.match(/^(?:"""|"|'''|'|)/)[0],r=e.length;let n=Math.max(this._literalClosingPos,r);for(;(n=t.indexOf(e,n))>0;){let e=0;for(;"\\"===t[n-e-1];)e++;if(e%2==0){const e=t.substring(r,n),i=e.split(/\r\n|\r|\n/).length-1,o=n+r;if(1===r&&0!==i||3===r&&this._lineMode)break;return this._line+=i,{value:this._unescape(e),matchLength:o}}n++}this._literalClosingPos=t.length-r+1}return{value:"",matchLength:0}}_syntaxError(t){this._input=null;const e=new Error(`Unexpected "${t}" on line ${this._line}.`);return e.context={token:void 0,line:this._line,previousToken:this.previousToken},e}_readStartingBom(t){return t.startsWith("\ufeff")?t.substr(1):t}tokenize(t,e){if(this._line=1,"string"==typeof t){if(this._input=this._readStartingBom(t),"function"!=typeof e){const t=[];let e;if(this._tokenizeToEnd(((r,n)=>r?e=r:t.push(n)),!0),e)throw e;return t}oe()((()=>this._tokenizeToEnd(e,!0)))}else this._pendingBuffer=null,"function"==typeof t.setEncoding&&t.setEncoding("utf8"),t.on("data",(t=>{null!==this._input&&0!==t.length&&(this._pendingBuffer&&(t=ae.concat([this._pendingBuffer,t]),this._pendingBuffer=null),128&t[t.length-1]?this._pendingBuffer=t:(void 0===this._input?this._input=this._readStartingBom("string"==typeof t?t:t.toString()):this._input+=t,this._tokenizeToEnd(e,!1)))})),t.on("end",(()=>{"string"==typeof this._input&&this._tokenizeToEnd(e,!0)})),t.on("error",e)}}const{rdf:de,xsd:ye}=ne;let ve,ge=0;const me={namedNode:function(t){return new we(t)},blankNode:function(t){return new _e(t||"n3-"+ge++)},variable:function(t){return new Te(t)},literal:function(t,e){if("string"==typeof e)return new xe(`"${t}"@${e.toLowerCase()}`);let r=e?e.value:"";return""===r&&("boolean"==typeof t?r=ye.boolean:"number"==typeof t&&(Number.isFinite(t)?r=Number.isInteger(t)?ye.integer:ye.double:(r=ye.double,Number.isNaN(t)||(t=t>0?"INF":"-INF")))),""===r||r===ye.string?new xe(`"${t}"`):new xe(`"${t}"^^${r}`)},defaultGraph:function(){return ve},quad:Ae,triple:Ae};class be{constructor(t){this.id=t}get value(){return this.id}equals(t){return t instanceof be?this.id===t.id:!!t&&this.termType===t.termType&&this.value===t.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}class we extends be{get termType(){return"NamedNode"}}class xe extends be{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const t=this.id;let e=t.lastIndexOf('"')+1;return e<t.length&&"@"===t[e++]?t.substr(e).toLowerCase():""}get datatype(){return new we(this.datatypeString)}get datatypeString(){const t=this.id,e=t.lastIndexOf('"')+1,r=e<t.length?t[e]:"";return"^"===r?t.substr(e+2):"@"!==r?ye.string:de.langString}equals(t){return t instanceof xe?this.id===t.id:!!t&&!!t.datatype&&this.termType===t.termType&&this.value===t.value&&this.language===t.language&&this.datatype.value===t.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}}class _e extends be{constructor(t){super(`_:${t}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}class Te extends be{constructor(t){super(`?${t}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}ve=new class extends be{constructor(){return super(""),ve||this}get termType(){return"DefaultGraph"}equals(t){return this===t||!!t&&this.termType===t.termType}};class ke extends be{constructor(t,e,r,n){super(""),this._subject=t,this._predicate=e,this._object=r,this._graph=n||ve}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(t){return!!t&&this._subject.equals(t.subject)&&this._predicate.equals(t.predicate)&&this._object.equals(t.object)&&this._graph.equals(t.graph)}}function Ae(t,e,r,n){return new ke(t,e,r,n)}let Ee=0;class Oe{constructor(t){this._contextStack=[],this._graph=null,t=t||{},this._setBase(t.baseIRI),t.factory&&Ne(this,t.factory);const e="string"==typeof t.format?t.format.match(/\w*$/)[0].toLowerCase():"",r=/turtle/.test(e),n=/trig/.test(e),i=/triple/.test(e),o=/quad/.test(e),a=this._n3Mode=/n3/.test(e),s=i||o;(this._supportsNamedGraphs=!(r||a))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(r||n||i||a),this._supportsRDFStar=""===e||/star|\*$/.test(e),s&&(this._resolveRelativeIRI=t=>null),this._blankNodePrefix="string"!=typeof t.blankNodePrefix?"":t.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=t.lexer||new pe({lineMode:s,n3:a}),this._explicitQuantifiers=!!t.explicitQuantifiers}static _resetBlankNodePrefix(){Ee=0}_setBase(t){if(t){const e=t.indexOf("#");e>=0&&(t=t.substr(0,e)),this._base=t,this._basePath=t.indexOf("/")<0?t:t.replace(/[^\/?]*(?:\?.*)?$/,""),t=t.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=t[0],this._baseScheme=t[1]}else this._base="",this._basePath=""}_saveContext(t,e,r,n,i){const o=this._n3Mode;this._contextStack.push({type:t,subject:r,predicate:n,object:i,graph:e,inverse:!!o&&this._inversePredicate,blankPrefix:o?this._prefixes._:"",quantified:o?this._quantified:null}),o&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(t,e){const r=this._contextStack.pop();if(!r||r.type!==t)return this._error(`Unexpected ${e.type}`,e);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(t){switch(t.type){case"eof":return null!==this._graph?this._error("Unclosed graph",t):(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(t)}}_readEntity(t,e){let r;switch(t.type){case"IRI":case"typeIRI":const e=this._resolveIRI(t.value);if(null===e)return this._error("Invalid IRI",t);r=this._namedNode(e);break;case"type":case"prefixed":const n=this._prefixes[t.prefix];if(void 0===n)return this._error(`Undefined prefix "${t.prefix}:"`,t);r=this._namedNode(n+t.value);break;case"blank":r=this._blankNode(this._prefixes[t.prefix]+t.value);break;case"var":r=this._variable(t.value.substr(1));break;default:return this._error(`Expected entity but got ${t.type}`,t)}return!e&&this._n3Mode&&r.id in this._quantified&&(r=this._quantified[r.id]),r}_readSubject(t){switch(this._predicate=null,t.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",t);case"}":return this._readPunctuation(t);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',t);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',t);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",t);if(0===t.prefix.length)return this._literalValue=t.value,this._completeSubjectLiteral;this._subject=this._literal(t.value,this._namedNode(t.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",t);default:if(void 0===(this._subject=this._readEntity(t)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(t){const e=t.type;switch(e){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[t.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${e}`,t):(this._subject=null,"]"===e?this._readBlankNodeTail(t):this._readPunctuation(t));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",t);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",t);default:if(void 0===(this._predicate=this._readEntity(t)))return}return this._readObject}_readObject(t){switch(t.type){case"literal":if(0===t.prefix.length)return this._literalValue=t.value,this._readDataTypeOrLang;this._object=this._literal(t.value,this._namedNode(t.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",t);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",t);default:if(void 0===(this._object=this._readEntity(t)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(t){return"{"===t.type?this._readGraph(t):this._readPredicate(t)}_readGraph(t){return"{"!==t.type?this._error(`Expected graph but got ${t.type}`,t):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(t){return"]"===t.type?(this._subject=null,this._readBlankNodeTail(t)):(this._predicate=null,this._readPredicate(t))}_readBlankNodeTail(t){if("]"!==t.type)return this._readBlankNodePunctuation(t);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const e=null===this._predicate;return this._restoreContext("blank",t),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:e?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(t){switch(t.type){case".":case"}":return this._subject=null,this._readPunctuation(t);default:return this._readPredicate(t)}}_readListItem(t){let e=null,r=null,n=this._readListItem;const i=this._subject,o=this._contextStack,a=o[o.length-1];switch(t.type){case"[":this._saveContext("blank",this._graph,r=this._blankNode(),this.RDF_FIRST,this._subject=e=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",t),0!==o.length&&"list"===o[o.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(n=this._readPredicate,this._subject===this.RDF_NIL)return n}else if(n=this._getContextEndReader(),this._object===this.RDF_NIL)return n;r=this.RDF_NIL;break;case"literal":0===t.prefix.length?(this._literalValue=t.value,n=this._readListItemDataTypeOrLang):(e=this._literal(t.value,this._namedNode(t.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",t);default:if(void 0===(e=this._readEntity(t)))return}if(null===r&&(this._subject=r=this._blankNode()),null===i?null===a.predicate?a.subject=r:a.object=r:this._emit(i,this.RDF_REST,r,this._graph),null!==e){if(this._n3Mode&&("IRI"===t.type||"prefixed"===t.type))return this._saveContext("item",this._graph,r,this.RDF_FIRST,e),this._subject=e,this._predicate=null,this._getPathReader(this._readListItem);this._emit(r,this.RDF_FIRST,e,this._graph)}return n}_readDataTypeOrLang(t){return this._completeObjectLiteral(t,!1)}_readListItemDataTypeOrLang(t){return this._completeObjectLiteral(t,!0)}_completeLiteral(t){let e=this._literal(this._literalValue);switch(t.type){case"type":case"typeIRI":const r=this._readEntity(t);if(void 0===r)return;e=this._literal(this._literalValue,r),t=null;break;case"langcode":e=this._literal(this._literalValue,t.value),t=null}return{token:t,literal:e}}_completeSubjectLiteral(t){return this._subject=this._completeLiteral(t).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(t,e){const r=this._completeLiteral(t);if(r)return this._object=r.literal,e&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===r.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(r.token))}_readFormulaTail(t){return"}"!==t.type?this._readPunctuation(t):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",t),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(t){let e,r=this._graph;const n=this._subject,i=this._inversePredicate;switch(t.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",t);if(this._n3Mode)return this._readFormulaTail(t);this._graph=null;case".":this._subject=null,e=this._contextStack.length?this._readSubject:this._readInTopContext,i&&(this._inversePredicate=!1);break;case";":e=this._readPredicate;break;case",":e=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(r=this._readEntity(t))){e=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,t)}if(null!==n){const t=this._predicate,e=this._object;i?this._emit(e,t,n,r):this._emit(n,t,e,r)}return e}_readBlankNodePunctuation(t){let e;switch(t.type){case";":e=this._readPredicate;break;case",":e=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,t)}return this._emit(this._subject,this._predicate,this._object,this._graph),e}_readQuadPunctuation(t){return"."!==t.type?this._error("Expected dot to follow quad",t):this._readInTopContext}_readPrefix(t){return"prefix"!==t.type?this._error("Expected prefix to follow @prefix",t):(this._prefix=t.value,this._readPrefixIRI)}_readPrefixIRI(t){if("IRI"!==t.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,t);const e=this._readEntity(t);return this._prefixes[this._prefix]=e.value,this._prefixCallback(this._prefix,e),this._readDeclarationPunctuation}_readBaseIRI(t){const e="IRI"===t.type&&this._resolveIRI(t.value);return e?(this._setBase(e),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",t)}_readNamedGraphLabel(t){switch(t.type){case"IRI":case"blank":case"prefixed":return this._readSubject(t),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",t)}}_readNamedGraphBlankLabel(t){return"]"!==t.type?this._error("Invalid graph label",t):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(t){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(t)):"."!==t.type?this._error("Expected declaration to end with a dot",t):this._readInTopContext}_readQuantifierList(t){let e;switch(t.type){case"IRI":case"prefixed":if(void 0!==(e=this._readEntity(t,!0)))break;default:return this._error(`Unexpected ${t.type}`,t)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,e,this.QUANTIFIERS_GRAPH)):this._quantified[e.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(t){return","===t.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(t))}_getPathReader(t){return this._afterPath=t,this._readPath}_readPath(t){switch(t.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const e=this._contextStack,r=e.length&&e[e.length-1];if(r&&"item"===r.type){const e=this._subject;this._restoreContext("item",t),this._emit(this._subject,this.RDF_FIRST,e,this._graph)}return this._afterPath(t)}}_readForwardPath(t){let e,r;const n=this._blankNode();if(void 0!==(r=this._readEntity(t)))return null===this._predicate?(e=this._subject,this._subject=n):(e=this._object,this._object=n),this._emit(e,r,n,this._graph),this._readPath}_readBackwardPath(t){const e=this._blankNode();let r,n;if(void 0!==(r=this._readEntity(t)))return null===this._predicate?(n=this._subject,this._subject=e):(n=this._object,this._object=e),this._emit(e,r,n,this._graph),this._readPath}_readRDFStarTailOrGraph(t){return">>"!==t.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(t))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,t):this._readRDFStarTail(t)}_readRDFStarTail(t){if(">>"!==t.type)return this._error(`Expected >> but got ${t.type}`,t);const e=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",t),null===this._subject?(this._subject=e,this._readPredicate):(this._object=e,this._getContextEndReader())}_getContextEndReader(){const t=this._contextStack;if(!t.length)return this._readPunctuation;switch(t[t.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(t,e,r,n){this._callback(null,this._quad(t,e,r,n||this.DEFAULTGRAPH))}_error(t,e){const r=new Error(`${t} on line ${e.line}.`);r.context={token:e,line:e.line,previousToken:this._lexer.previousToken},this._callback(r),this._callback=je}_resolveIRI(t){return/^[a-z][a-z0-9+.-]*:/i.test(t)?t:this._resolveRelativeIRI(t)}_resolveRelativeIRI(t){if(!t.length)return this._base;switch(t[0]){case"#":return this._base+t;case"?":return this._base.replace(/(?:\?.*)?$/,t);case"/":return("/"===t[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(t);default:return/^[^/:]*:/.test(t)?null:this._removeDotSegments(this._basePath+t)}}_removeDotSegments(t){if(!/(^|\/)\.\.?($|[/#?])/.test(t))return t;const e=t.length;let r="",n=-1,i=-1,o=0,a="/";for(;n<e;){switch(a){case":":if(i<0&&"/"===t[++n]&&"/"===t[++n])for(;(i=n+1)<e&&"/"!==t[i];)n=i;break;case"?":case"#":n=e;break;case"/":if("."===t[n+1])switch(a=t[1+ ++n],a){case"/":r+=t.substring(o,n-1),o=n+1;break;case void 0:case"?":case"#":return r+t.substring(o,n)+t.substr(n+1);case".":if(a=t[1+ ++n],void 0===a||"/"===a||"?"===a||"#"===a){if(r+=t.substring(o,n-2),(o=r.lastIndexOf("/"))>=i&&(r=r.substr(0,o)),"/"!==a)return`${r}/${t.substr(n+1)}`;o=n+1}}}a=t[++n]}return r+t.substring(o)}parse(t,e,r){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${Ee++}_`,this._prefixCallback=r||je,this._inversePredicate=!1,this._quantified=Object.create(null),!e){const e=[];let r;if(this._callback=(t,n)=>{t?r=t:n&&e.push(n)},this._lexer.tokenize(t).every((t=>this._readCallback=this._readCallback(t))),r)throw r;return e}this._callback=e,this._lexer.tokenize(t,((t,e)=>{null!==t?(this._callback(t),this._callback=je):this._readCallback&&(this._readCallback=this._readCallback(e))}))}}function je(){}function Ne(t,e){const r=e.namedNode;t._namedNode=r,t._blankNode=e.blankNode,t._literal=e.literal,t._variable=e.variable,t._quad=e.quad,t.DEFAULTGRAPH=e.defaultGraph(),t.RDF_FIRST=r(ne.rdf.first),t.RDF_REST=r(ne.rdf.rest),t.RDF_NIL=r(ne.rdf.nil),t.N3_FORALL=r(ne.r.forAll),t.N3_FORSOME=r(ne.r.forSome),t.ABBREVIATIONS={a:r(ne.rdf.type),"=":r(ne.owl.sameAs),">":r(ne.log.implies)},t.QUANTIFIERS_GRAPH=r("urn:n3:quantifiers")}Ne(Oe.prototype,me);var Se=s(292);if(void 0===Re)var Re={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12};var Ie=function(){function r(t,n){(0,e.Z)(this,r),this.options=n||{},this.kb=t,this.target=n.target||{graph:{subjects:{},prefixes:{},terms:{}}},this.blankNodes=[],this.htmlOptions={selfClosing:"br img input area base basefont col colgroup source wbr isindex link meta param hr"},this.theOne="_:"+(new Date).getTime(),this.language=null,this.vocabulary=null,this.blankCounter=0,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"}],this.inXHTMLMode=!1,this.absURIRE=/[\w\_\-]+:\S+/,this.finishedHandlers=[],this.init()}return(0,t.Z)(r,[{key:"addTriple",value:function(t,e,r,n){var i,o,a,s;i=void 0===e?D.namedNode(this.options.base):this.toRDFNodeObject(e),a=this.toRDFNodeObject(r),o=this.toRDFNodeObject(n),s=D.namedNode(this.options.base),this.kb.add(i,a,o,s)}},{key:"ancestorPath",value:function(t){for(var e="";t&&t.nodeType!==Re.DOCUMENT_NODE;)e="/"+t.localName+e,t=t.parentNode;return e}},{key:"copyMappings",value:function(t){var e={};for(var r in t)e[r]=t[r];return e}},{key:"copyProperties",value:function(){}},{key:"deriveDateTimeType",value:function(t){for(var e=0;e<r.dateTimeTypes.length;e++){var n=r.dateTimeTypes[e].pattern.exec(t);if(n&&n[0].length===t.length)return r.dateTimeTypes[e].type}return null}},{key:"init",value:function(){}},{key:"newBlankNode",value:function(){return this.blankCounter++,"_:"+this.blankCounter}},{key:"newSubjectOrigin",value:function(t,e){}},{key:"parseCURIE",value:function(t,e,n){var i,o=t.indexOf(":");if(o>=0){var a=t.substring(0,o);if(""===a)return(i=e[""])?i+t.substring(o+1):null;if("_"===a)return"_:"+t.substring(o+1);if(r.NCNAME.test(a)&&(i=e[a]))return i+t.substring(o+1)}return null}},{key:"parseCURIEOrURI",value:function(t,e,r){return this.parseCURIE(t,e,r)||this.resolveAndNormalize(r,t)}},{key:"parsePredicate",value:function(t,e,r,n,i,o){if(""===t)return null;var a=this.parseTermOrCURIEOrAbsURI(t,e,o?null:r,n,i);return a&&0===a.indexOf("_:")?null:a}},{key:"parsePrefixMappings",value:function(t,e){for(var r=this.tokenize(t),n=null,i=0;i<r.length;i++)":"===r[i][r[i].length-1]?n=r[i].substring(0,r[i].length-1):n&&(e[n]=this.options.base?I.join(r[i],this.options.base):r[i],n=null)}},{key:"parseSafeCURIEOrCURIEOrURI",value:function(t,e,r){return"["===(t=this.trim(t)).charAt(0)&&"]"===t.charAt(t.length-1)?0===(t=(t=t.substring(1,t.length-1)).trim(t)).length?null:"_:"===t?this.theOne:this.parseCURIE(t,e,r):this.parseCURIEOrURI(t,e,r)}},{key:"parseTermOrCURIEOrAbsURI",value:function(t,e,r,n,i){t=this.trim(t);var o=this.parseCURIE(t,n,i);if(o)return o;if(r){if(e&&!this.absURIRE.exec(t))return e+t;var a=r[t];if(a)return a;if(a=r[t.toLowerCase()])return a}return this.absURIRE.exec(t)?this.resolveAndNormalize(i,t):null}},{key:"parseTermOrCURIEOrURI",value:function(t,e,r,n,i){t=this.trim(t);var o=this.parseCURIE(t,n,i);if(o)return o;var a=r[t];return a||((a=r[t.toLowerCase()])?a:e&&!this.absURIRE.exec(t)?e+t:this.resolveAndNormalize(i,t))}},{key:"parseURI",value:function(t){return t}},{key:"process",value:function(t,e){var n;e=e||{},t.nodeType===Re.DOCUMENT_NODE?(t.baseURI&&!e.baseURI&&(e.baseURI=t.baseURI),n=t.baseURI,(t=t.documentElement).baseURI||(t.baseURI=n),this.setContext(t)):t.parentNode.nodeType===Re.DOCUMENT_NODE&&this.setContext(t);var i=[],o=function(t){if(!t&&e&&e.baseURI)return e.baseURI;var r=t.indexOf("#");return r>=0&&(t=t.substring(0,r)),e&&e.baseURIMap&&(t=e.baseURIMap(t)),t};for(i.push({current:t,context:this.push(null,o(t.baseURI))});i.length>0;){var a=i.shift();if(a.parent){if(a.context.parent&&a.context.parent.listMapping===a.listMapping)continue;for(var s in a.listMapping){var u=a.listMapping[s];if(0!==u.length){for(var c=[],l=0;l<u.length;l++)c.push(this.newBlankNode());for(var h=0;h<c.length;h++)this.addTriple(a.parent,c[h],"http://www.w3.org/1999/02/22-rdf-syntax-ns#first",u[h]),this.addTriple(a.parent,c[h],"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",{type:r.objectURI,value:h+1<c.length?c[h+1]:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"});this.addTriple(a.parent,a.subject,s,{type:r.objectURI,value:c[0]})}else this.addTriple(a.parent,a.subject,s,{type:r.objectURI,value:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"})}}else{var f=a.current,p=a.context,d=!1,y=null,v=null,g=null,m=p.prefixes,b=!1,w=[],x=p.listMapping,_=!p.parent,T=p.language,k=p.vocabulary;n=this.parseURI(o(f.baseURI)),f.item=null;var A=f.getAttributeNode("vocab");if(A){var E=this.trim(A.value);if(E.length>0){k=E;var O=n.spec;this.addTriple(f,O,"http://www.w3.org/ns/rdfa#usesVocabulary",{type:r.objectURI,value:k})}else k=this.vocabulary}for(var j=0;j<f.attributes.length;j++){var N=f.attributes[j];if("x"===N.nodeName.charAt(0)&&0===N.nodeName.indexOf("xmlns:")){b||(m=this.copyMappings(m),b=!0);var S=N.nodeName.substring(6),R=r.trim(N.value);m[S]=this.options.base?I.join(R,this.options.base):R}}var C=f.getAttributeNode("prefix");C&&(b||(m=this.copyMappings(m),b=!0),this.parsePrefixMappings(C.value,m));for(var P=null,F=0;!P&&F<this.langAttributes.length;F++)P=f.getAttributeNodeNS(this.langAttributes[F].namespaceURI,this.langAttributes[F].localName);if(P){var U=r.trim(P.value);T=U.length>0?U:null}var L,D,M=f.getAttributeNode("rel"),Z=f.getAttributeNode("rev"),B=f.getAttributeNode("typeof"),q=f.getAttributeNode("property"),H=f.getAttributeNode("datatype"),$=this.inHTMLMode?f.getAttributeNode("datetime"):null,z=f.getAttributeNode("content"),X=f.getAttributeNode("about"),V=f.getAttributeNode("src"),G=f.getAttributeNode("resource"),W=f.getAttributeNode("href"),Q=f.getAttributeNode("inlist"),Y=[];if(M){D=this.tokenize(M.value);for(var J=0;J<D.length;J++)(L=this.parsePredicate(D[J],k,p.terms,m,n,this.inHTMLMode&&null!==q))&&Y.push(L)}var K=[];if(Z){D=this.tokenize(Z.value);for(var tt=0;tt<D.length;tt++)(L=this.parsePredicate(D[tt],k,p.terms,m,n,this.inHTMLMode&&q))&&K.push(L)}if(this.inHTMLMode&&(M||Z)&&q&&(0===Y.length&&(M=null),0===K.length&&(Z=null)),M||Z?(X&&(y=this.parseSafeCURIEOrCURIEOrURI(X.value,m,n)),B&&(g=y),y||(f.parentNode.nodeType===Re.DOCUMENT_NODE?y=o(f.baseURI):p.parentObject&&(y=o(f.parentNode.baseURI)===p.parentObject?o(f.baseURI):p.parentObject)),G&&(v=this.parseSafeCURIEOrCURIEOrURI(G.value,m,n)),v||(W?v=this.resolveAndNormalize(n,encodeURI(W.value)):V?v=this.resolveAndNormalize(n,encodeURI(V.value)):!B||X||this.inXHTMLMode&&("head"===f.localName||"body"===f.localName)||(v=this.newBlankNode())),!B||X||!this.inXHTMLMode||"head"!==f.localName&&"body"!==f.localName?B&&!X&&(g=v):g=y):!q||z||H?(X&&(y=this.parseSafeCURIEOrCURIEOrURI(X.value,m,n)),!y&&G&&(y=this.parseSafeCURIEOrCURIEOrURI(G.value,m,n)),!y&&W&&(y=this.resolveAndNormalize(n,encodeURI(W.value))),!y&&V&&(y=this.resolveAndNormalize(n,encodeURI(V.value))),y||(f.parentNode.nodeType===Re.DOCUMENT_NODE?y=o(f.baseURI):!this.inXHTMLMode&&!this.inHTMLMode||"head"!==f.localName&&"body"!==f.localName?B?y=this.newBlankNode():p.parentObject&&(y=o(f.parentNode.baseURI)===p.parentObject?o(f.baseURI):p.parentObject,q||(d=!0)):y=o(f.parentNode.baseURI)===p.parentObject?o(f.baseURI):p.parentObject),B&&(g=y)):(X&&(y=this.parseSafeCURIEOrCURIEOrURI(X.value,m,n),B&&(g=y)),y||f.parentNode.nodeType!==Re.DOCUMENT_NODE?!y&&p.parentObject&&(y=o(f.parentNode.baseURI)===p.parentObject?o(f.baseURI):p.parentObject):(y=o(f.baseURI),B&&(g=y)),B&&!g&&(G&&(g=this.parseSafeCURIEOrCURIEOrURI(G.value,m,n)),!g&&W&&(g=this.resolveAndNormalize(n,encodeURI(W.value))),!g&&V&&(g=this.resolveAndNormalize(n,encodeURI(V.value))),g||!this.inXHTMLMode&&!this.inHTMLMode||"head"!==f.localName&&"body"!==f.localName||(g=y),g||(g=this.newBlankNode()),v=g)),y&&(X||G||g)){var et=y;B&&!X&&!G&&v&&(et=v),this.newSubjectOrigin(f,et)}if(g){D=this.tokenize(B.value);for(var rt=0;rt<D.length;rt++){var nt=this.parseTermOrCURIEOrAbsURI(D[rt],k,p.terms,m,n);nt&&this.addTriple(f,g,r.typeURI,{type:r.objectURI,value:nt})}}if(y&&y!==p.parentObject&&(x={},_=!0),v){if(M&&Q)for(var it=0;it<Y.length;it++){var ot=x[Y[it]];ot||(ot=[],x[Y[it]]=ot),ot.push({type:r.objectURI,value:v})}else if(M)for(var at=0;at<Y.length;at++)this.addTriple(f,y,Y[at],{type:r.objectURI,value:v});if(Z)for(var st=0;st<K.length;st++)this.addTriple(f,v,K[st],{type:r.objectURI,value:y})}else{if(y&&!v&&(M||Z)&&(v=this.newBlankNode()),M&&Q)for(var ut=0;ut<Y.length;ut++){var ct=x[Y[ut]];ct||(ct=[],x[L]=ct),w.push({predicate:Y[ut],list:ct})}else if(M)for(var lt=0;lt<Y.length;lt++)w.push({predicate:Y[lt],forward:!0});if(Z)for(var ht=0;ht<K.length;ht++)w.push({predicate:K[ht],forward:!1})}if(q){var ft=null,pt=null;H?(ft=""===H.value?r.PlainLiteralURI:this.parseTermOrCURIEOrAbsURI(H.value,k,p.terms,m,n),pt=$&&!z?$.value:ft===r.XMLLiteralURI||ft===r.HTMLLiteralURI?null:z?z.value:f.textContent):z?(ft=r.PlainLiteralURI,pt=z.value):$?(pt=$.value,(ft=r.deriveDateTimeType(pt))||(ft=r.PlainLiteralURI)):M||Z||(G&&(pt=this.parseSafeCURIEOrCURIEOrURI(G.value,m,n)),!pt&&W?pt=this.resolveAndNormalize(n,encodeURI(W.value)):!pt&&V&&(pt=this.resolveAndNormalize(n,encodeURI(V.value))),pt&&(ft=r.objectURI)),ft||(B&&!X?(ft=r.objectURI,pt=g):(pt=f.textContent,this.inHTMLMode&&"time"===f.localName&&(ft=r.deriveDateTimeType(pt)),ft||(ft=r.PlainLiteralURI))),D=this.tokenize(q.value);for(var dt=0;dt<D.length;dt++){var yt=this.parsePredicate(D[dt],k,p.terms,m,n);if(yt)if(Q){var vt=x[yt];vt||(vt=[],x[yt]=vt),vt.push(ft===r.XMLLiteralURI||ft===r.HTMLLiteralURI?{type:ft,value:f.childNodes}:{type:ft||r.PlainLiteralURI,value:pt,language:T})}else ft===r.XMLLiteralURI||ft===r.HTMLLiteralURI?this.addTriple(f,y,yt,{type:ft,value:f.childNodes}):this.addTriple(f,y,yt,{type:ft||r.PlainLiteralURI,value:pt,language:T})}}if(y&&!d)for(var gt=0;gt<p.incomplete.length;gt++)p.incomplete[gt].list?p.incomplete[gt].list.push({type:r.objectURI,value:y}):p.incomplete[gt].forward?this.addTriple(f,p.subject,p.incomplete[gt].predicate,{type:r.objectURI,value:y}):this.addTriple(f,y,p.incomplete[gt].predicate,{type:r.objectURI,value:p.subject});var mt=null,bt=y;d?((mt=this.push(p,p.subject)).parentObject=o(f.parentNode.baseURI)===p.parentObject?o(f.baseURI):p.parentObject,mt.incomplete=p.incomplete,mt.language=T,mt.prefixes=m,mt.vocabulary=k):((mt=this.push(p,y)).parentObject=v||y||p.subject,mt.prefixes=m,mt.incomplete=w,v&&(bt=v,x={},_=!0),mt.listMapping=x,mt.language=T,mt.vocabulary=k),_&&i.unshift({parent:f,context:p,subject:bt,listMapping:x});for(var wt=f.lastChild;wt;wt=wt.previousSibling)wt.nodeType===Re.ELEMENT_NODE&&i.unshift({current:wt,context:mt})}}this.inHTMLMode&&this.copyProperties();for(var xt=0;xt<this.finishedHandlers.length;xt++)this.finishedHandlers[xt](t)}},{key:"push",value:function(t,e){return{parent:t,subject:e||(t?t.subject:null),parentObject:null,incomplete:[],listMapping:t?t.listMapping:{},language:t?t.language:this.language,prefixes:t?t.prefixes:this.target.graph.prefixes,terms:t?t.terms:this.target.graph.terms,vocabulary:t?t.vocabulary:this.vocabulary}}},{key:"resolveAndNormalize",value:function(t,e){return I.join(e,t)}},{key:"setContext",value:function(t){"html"===t.localName&&"XHTML+RDFa 1.1"===t.getAttribute("version")?this.setXHTMLContext():"html"===t.localName||"http://www.w3.org/1999/xhtml"===t.namespaceURI?"undefined"!=typeof document&&document.doctype?"-//W3C//DTD XHTML+RDFa 1.0//EN"===document.doctype.publicId&&"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"===document.doctype.systemId?(Se.log("WARNING: RDF 1.0 is not supported. Defaulting to HTML5 mode."),this.setHTMLContext()):"-//W3C//DTD XHTML+RDFa 1.1//EN"===document.doctype.publicId&&"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd"===document.doctype.systemId?this.setXHTMLContext():this.setHTMLContext():this.setHTMLContext():this.setXMLContext()}},{key:"setHTMLContext",value:function(){this.setInitialContext(),this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"},{namespaceURI:null,localName:"lang"}],this.inXHTMLMode=!1,this.inHTMLMode=!0}},{key:"setInitialContext",value:function(){this.vocabulary=null,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"}]}},{key:"setXHTMLContext",value:function(){this.setInitialContext(),this.inXHTMLMode=!0,this.inHTMLMode=!1,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"},{namespaceURI:null,localName:"lang"}],this.target.graph.terms.alternate="http://www.w3.org/1999/xhtml/vocab#alternate",this.target.graph.terms.appendix="http://www.w3.org/1999/xhtml/vocab#appendix",this.target.graph.terms.bookmark="http://www.w3.org/1999/xhtml/vocab#bookmark",this.target.graph.terms.cite="http://www.w3.org/1999/xhtml/vocab#cite",this.target.graph.terms.chapter="http://www.w3.org/1999/xhtml/vocab#chapter",this.target.graph.terms.contents="http://www.w3.org/1999/xhtml/vocab#contents",this.target.graph.terms.copyright="http://www.w3.org/1999/xhtml/vocab#copyright",this.target.graph.terms.first="http://www.w3.org/1999/xhtml/vocab#first",this.target.graph.terms.glossary="http://www.w3.org/1999/xhtml/vocab#glossary",this.target.graph.terms.help="http://www.w3.org/1999/xhtml/vocab#help",this.target.graph.terms.icon="http://www.w3.org/1999/xhtml/vocab#icon",this.target.graph.terms.index="http://www.w3.org/1999/xhtml/vocab#index",this.target.graph.terms.last="http://www.w3.org/1999/xhtml/vocab#last",this.target.graph.terms.license="http://www.w3.org/1999/xhtml/vocab#license",this.target.graph.terms.meta="http://www.w3.org/1999/xhtml/vocab#meta",this.target.graph.terms.next="http://www.w3.org/1999/xhtml/vocab#next",this.target.graph.terms.prev="http://www.w3.org/1999/xhtml/vocab#prev",this.target.graph.terms.previous="http://www.w3.org/1999/xhtml/vocab#previous",this.target.graph.terms.section="http://www.w3.org/1999/xhtml/vocab#section",this.target.graph.terms.stylesheet="http://www.w3.org/1999/xhtml/vocab#stylesheet",this.target.graph.terms.subsection="http://www.w3.org/1999/xhtml/vocab#subsection",this.target.graph.terms.start="http://www.w3.org/1999/xhtml/vocab#start",this.target.graph.terms.top="http://www.w3.org/1999/xhtml/vocab#top",this.target.graph.terms.up="http://www.w3.org/1999/xhtml/vocab#up",this.target.graph.terms.p3pv1="http://www.w3.org/1999/xhtml/vocab#p3pv1",this.target.graph.terms.related="http://www.w3.org/1999/xhtml/vocab#related",this.target.graph.terms.role="http://www.w3.org/1999/xhtml/vocab#role",this.target.graph.terms.transformation="http://www.w3.org/1999/xhtml/vocab#transformation"}},{key:"setXMLContext",value:function(){this.setInitialContext(),this.inXHTMLMode=!1,this.inHTMLMode=!1}},{key:"tokenize",value:function(t){return this.trim(t).split(/\s+/)}},{key:"toRDFNodeObject",value:function(t){var e=this;if(void 0!==t){if("string"==typeof t)return"_:"===t.substring(0,2)?(void 0===this.blankNodes[t.substring(2)]&&(this.blankNodes[t.substring(2)]=new p(t.substring(2))),this.blankNodes[t.substring(2)]):D.namedNode(t);switch(t.type){case r.objectURI:return"_:"===t.value.substring(0,2)?(void 0===this.blankNodes[t.value.substring(2)]&&(this.blankNodes[t.value.substring(2)]=new p(t.value.substring(2))),this.blankNodes[t.value.substring(2)]):D.namedNode(t.value);case r.PlainLiteralURI:return new m(t.value,t.language||"");case r.XMLLiteralURI:case r.HTMLLiteralURI:var n="";return Object.keys(t.value).forEach((function(r){n+=B.domToString(t.value[r],e.htmlOptions)})),new m(n,"",new y.Z(t.type));default:return new m(t.value,"",new y.Z(t.type))}}}},{key:"trim",value:function(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}],[{key:"parseRDFaDOM",value:function(t,e,n){var i=new r(e,{base:n});t.baseURI||(t.baseURI=n),i.process(t,{baseURI:n})}},{key:"tokenize",value:function(t){return this.trim(t).split(/\s+/)}},{key:"trim",value:function(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}]),r}();Ie.XMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral",Ie.HTMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML",Ie.PlainLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral",Ie.objectURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#object",Ie.typeURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",Ie.nameChar="[-A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�က0-F.0-9·̀-ͯ‿-⁀]",Ie.nameStartChar="[A-Za-zÀ-ÖØ-öø-ÿĀ-ıĴ-ľŁ-ňŊ-žƀ-ǃǍ-ǰǴ-ǵǺ-ȗɐ-ʨʻ-ˁΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϖϚϜϞϠϢ-ϳЁ-ЌЎ-яё-ќў-ҁҐ-ӄӇ-ӈӋ-ӌӐ-ӫӮ-ӵӸ-ӹԱ-Ֆՙա-ֆא-תװ-ײء-غف-يٱ-ڷں-ھۀ-ێې-ۓەۥ-ۦअ-हऽक़-ॡঅ-ঌএ-ঐও-নপ-রলশ-হড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઋઍએ-ઑઓ-નપ-રલ-ળવ-હઽૠଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଶ-ହଽଡ଼-ଢ଼ୟ-ୡஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-வஷ-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡก-ฮะา-ำเ-ๅກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ຮະາ-ຳຽເ-ໄཀ-ཇཉ-ཀྵႠ-Ⴥა-ჶᄀᄂ-ᄃᄅ-ᄇᄉᄋ-ᄌᄎ-ᄒᄼᄾᅀᅌᅎᅐᅔ-ᅕᅙᅟ-ᅡᅣᅥᅧᅩᅭ-ᅮᅲ-ᅳᅵᆞᆨᆫᆮ-ᆯᆷ-ᆸᆺᆼ-ᇂᇫᇰᇹḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼΩK-Å℮ↀ-ↂぁ-ゔァ-ヺㄅ-ㄬ가-힣一-龥〇〡-〩_]",Ie.NCNAME=new RegExp("^"+Ie.nameStartChar+Ie.nameChar+"*$"),Ie.dateTimeTypes=[{pattern:/-?P(?:[0-9]+Y)?(?:[0-9]+M)?(?:[0-9]+D)?(?:T(?:[0-9]+H)?(?:[0-9]+M)?(?:[0-9]+(?:\.[0-9]+)?S)?)?/,type:"http://www.w3.org/2001/XMLSchema#duration"},{pattern:/-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]-[0-9][0-9]T(?:[0-1][0-9]|2[0-4]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]+)?(?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,type:"http://www.w3.org/2001/XMLSchema#dateTime"},{pattern:/-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]-[0-9][0-9](?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,type:"http://www.w3.org/2001/XMLSchema#date"},{pattern:/(?:[0-1][0-9]|2[0-4]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]+)?(?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,type:"http://www.w3.org/2001/XMLSchema#time"},{pattern:/-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]/,type:"http://www.w3.org/2001/XMLSchema#gYearMonth"},{pattern:/-?[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9]/,type:"http://www.w3.org/2001/XMLSchema#gYear"}];var Ce=Ie.parseRDFaDOM,Pe=function(){function r(t){(0,e.Z)(this,r),this.store=t,this.bnodes={},this.why=null,this.reify=!1}return(0,t.Z)(r,[{key:"frameFactory",value:function(t,e,n){return{NODE:1,ARC:2,parent:e,parser:t,store:t.store,element:n,lastChild:0,base:null,lang:null,node:null,nodeType:null,listIndex:1,rdfid:null,datatype:null,collection:!1,terminateFrame:function(){this.collection&&this.node.close()},addSymbol:function(t,e){e=I.join(e,this.base),this.node=this.store.sym(e),this.nodeType=t},loadTriple:function(){if(this.parent.parent.collection?this.parent.parent.node.append(this.node):this.store.add(this.parent.parent.node,this.parent.node,this.node,this.parser.why),null!=this.parent.rdfid){var t=this.store.sym(I.join("#"+this.parent.rdfid,this.base));this.store.add(t,this.store.sym(r.ns.RDF+"type"),this.store.sym(r.ns.RDF+"Statement"),this.parser.why),this.store.add(t,this.store.sym(r.ns.RDF+"subject"),this.parent.parent.node,this.parser.why),this.store.add(t,this.store.sym(r.ns.RDF+"predicate"),this.parent.node,this.parser.why),this.store.add(t,this.store.sym(r.ns.RDF+"object"),this.node,this.parser.why)}},isTripleToLoad:function(){return null!=this.parent&&null!=this.parent.parent&&this.nodeType===this.NODE&&this.parent.nodeType===this.ARC&&this.parent.parent.nodeType===this.NODE},addNode:function(t){this.addSymbol(this.NODE,t),this.isTripleToLoad()&&this.loadTriple()},addCollection:function(){this.nodeType=this.NODE,this.node=this.store.collection(),this.collection=!0,this.isTripleToLoad()&&this.loadTriple()},addCollectionArc:function(){this.nodeType=this.ARC},addBNode:function(t){null!=t?null!=this.parser.bnodes[t]?this.node=this.parser.bnodes[t]:this.node=this.parser.bnodes[t]=this.store.bnode():this.node=this.store.bnode(),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()},addArc:function(t){t===r.ns.RDF+"li"&&(t=r.ns.RDF+"_"+this.parent.listIndex,this.parent.listIndex++),this.addSymbol(this.ARC,t)},addLiteral:function(t){this.parent.datatype&&this.parent.datatype!==r.ns.RDF+"langString"?this.node=this.store.literal(t,this.store.sym(this.parent.datatype)):this.node=this.store.literal(t,this.lang),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()}}}},{key:"getAttributeNodeNS",value:function(t,e,r){var n=null;if(t.getAttributeNodeNS)n=t.getAttributeNodeNS(e,r);else for(var i,o=t.attributes,a=0;a<o.length;++a)if((i=o[a]).namespaceURI===e&&(i.prefix?i.prefix+":"+r:r)===i.nodeName){n=i;break}return n}},{key:"parse",value:function(t,e,n){var i,o=t.childNodes;if(this.cleanParser(),t.nodeType===r.nodeType.DOCUMENT){for(var a=0;a<o.length;a++)if(o[a].nodeType===r.nodeType.ELEMENT){i=o[a];break}}else{if(t.nodeType!==r.nodeType.ELEMENT)throw new Error("RDFParser: can't find root in "+e+". Halting. ");i=t}this.why=n;var s=this.frameFactory(this);return this.base=e,s.base=e,s.lang=null,this.parseDOM(this.buildFrame(s,i)),!0}},{key:"parseDOM",value:function(t){for(var e,n=function(t){var e="";if(null==t.namespaceURI)throw new Error("RDF/XML syntax error: No namespace for "+t.localName+" in "+this.base);return t.namespaceURI&&(e+=t.namespaceURI),t.localName?e+=t.localName:t.nodeName&&(t.nodeName.indexOf(":")>=0?e+=t.nodeName.split(":")[1]:e+=t.nodeName),e}.bind(this),i=!0;t.parent;){var o=t.element,a=o.attributes;if(o.nodeType===r.nodeType.TEXT||o.nodeType===r.nodeType.CDATA_SECTION)t.parent.nodeType===t.NODE&&(t.addArc(r.ns.RDF+"value"),t=this.buildFrame(t)),t.addLiteral(o.nodeValue);else if(n(o)!==r.ns.RDF+"RDF")if(t.parent&&t.parent.collection&&(t.addCollectionArc(),(t=this.buildFrame(t,t.element)).parent.element=null),t.parent&&t.parent.nodeType&&t.parent.nodeType!==t.ARC){t.addArc(n(o)),this.reify&&(e=this.getAttributeNodeNS(o,r.ns.RDF,"ID"))&&(t.rdfid=e.nodeValue,o.removeAttributeNode(e));var s=this.getAttributeNodeNS(o,r.ns.RDF,"parseType"),u=this.getAttributeNodeNS(o,r.ns.RDF,"datatype");if(u&&(t.datatype=u.nodeValue,o.removeAttributeNode(u)),s){var c=s.nodeValue;"Literal"===c?(t.datatype=r.ns.RDF+"XMLLiteral",(t=this.buildFrame(t)).addLiteral(o.childNodes),i=!1):"Resource"===c?((t=this.buildFrame(t,t.element)).parent.element=null,t.addBNode()):"Collection"===c&&((t=this.buildFrame(t,t.element)).parent.element=null,t.addCollection()),o.removeAttributeNode(s)}if(0!==a.length){var l=this.getAttributeNodeNS(o,r.ns.RDF,"resource"),h=this.getAttributeNodeNS(o,r.ns.RDF,"nodeID");t=this.buildFrame(t),l?(t.addNode(l.nodeValue),o.removeAttributeNode(l)):h?(t.addBNode(h.nodeValue),o.removeAttributeNode(h)):t.addBNode();for(var f=a.length-1;f>=0;f--){var p=this.buildFrame(t);p.addArc(n(a[f])),n(a[f])===r.ns.RDF+"type"?this.buildFrame(p).addNode(a[f].nodeValue):this.buildFrame(p).addLiteral(a[f].nodeValue)}}else 0===o.childNodes.length&&this.buildFrame(t).addLiteral("")}else{var d=this.getAttributeNodeNS(o,r.ns.RDF,"about");if(e=this.getAttributeNodeNS(o,r.ns.RDF,"ID"),d&&e)throw new Error("RDFParser: "+o.nodeName+" has both rdf:id and rdf:about. Halting. Only one of these properties may be specified on a node.");if(!d&&e)t.addNode("#"+e.nodeValue),o.removeAttributeNode(e);else if(null==d&&null==e){var y=this.getAttributeNodeNS(o,r.ns.RDF,"nodeID");y?(t.addBNode(y.nodeValue),o.removeAttributeNode(y)):t.addBNode()}else t.addNode(d.nodeValue),o.removeAttributeNode(d);var v=this.getAttributeNodeNS(o,r.ns.RDF,"type");r.ns.RDF+"Description"!==n(o)&&(v={nodeValue:n(o)}),null!=v&&(this.store.add(t.node,this.store.sym(r.ns.RDF+"type"),this.store.sym(I.join(v.nodeValue,t.base)),this.why),v.nodeName&&o.removeAttributeNode(v));for(var g=a.length-1;g>=0;g--)this.store.add(t.node,this.store.sym(n(a[g])),this.store.literal(a[g].nodeValue,t.lang),this.why)}for(o=t.element;t.parent;){for(var m=t;null==o;)o=(t=t.parent).element;var b=o.childNodes&&o.childNodes[t.lastChild];if(b&&i){if((b.nodeType===r.nodeType.ELEMENT||b.nodeType===r.nodeType.TEXT||b.nodeType===r.nodeType.CDATA_SECTION)&&(b.nodeType!==r.nodeType.TEXT&&b.nodeType!==r.nodeType.CDATA_SECTION||1===o.childNodes.length)){t.lastChild++,t=this.buildFrame(m,o.childNodes[t.lastChild-1]);break}t.lastChild++}else{if(t.terminateFrame(),!(t=t.parent))break;o=t.element,i=!0}}}}},{key:"cleanParser",value:function(){this.bnodes={},this.why=null}},{key:"buildFrame",value:function(t,e){var n=this.frameFactory(this,t,e);if(t&&(n.base=t.base,n.lang=t.lang),!e||e.nodeType===r.nodeType.TEXT||e.nodeType===r.nodeType.CDATA_SECTION)return n;var i=e.attributes,o=e.getAttributeNode("xml:base");null!=o&&(n.base=o.nodeValue,e.removeAttribute("xml:base"));var a=e.getAttributeNode("xml:lang");null!=a&&(n.lang=a.nodeValue,e.removeAttribute("xml:lang"));for(var s=i.length-1;s>=0;s--)if("xml"===i[s].nodeName.substr(0,3)){if("xmlns:"===i[s].name.slice(0,6)){var u=i[s].nodeValue;this.base&&(u=I.join(u,this.base)),this.store.setPrefixForURI(i[s].name.slice(6),u)}e.removeAttributeNode(i[s])}return n}}]),r}();function Fe(t,e,r){var n,i,o,a=["INSERT","DELETE","WHERE"],s=Z("http://www.w3.org/ns/pim/patch#"),u=Bt(e,e,r,r,null,null,"",null),c={},l=function(t,e,r,n,i){return"Line "+(e+1)+" of <"+t+">: Bad syntax:\n "+i+'\n at: "'+r.slice(n,n+30)+'"'};n=0;var h=e.sym(r+"#query");for(c.query=h;;){if((i=u.skipSpace(t,n))<0)return c;if(";"===t[i]){if((n=u.skipSpace(t,i+1))<0)return c;i=n}var f=!1;for(o=0;o<a.length;o++){var p=a[o];if(t.slice(i,i+p.length)===p){if((n=u.skipSpace(t,i+p.length))<0)throw l(u._thisDoc,u.lines,t,i+p.length,"found EOF, needed {...} after "+p);if(("INSERT"===p||"DELETE"===p)&&"DATA"===t.slice(n,n+4)){if((i=u.skipSpace(t,n+4))<0)throw l(u._thisDoc,u.lines,t,n+4,"needed {...} after INSERT DATA "+p);n=i}var d=[];if((i=u.node(t,n,d))<0)throw l(u._thisDoc,u.lines,t,n,"bad syntax or EOF in {...} after "+p);c[p.toLowerCase()]=d[0],e.add(h,s(p.toLowerCase()),d[0]),f=!0,n=i}}if(!f&&"@prefix"===t.slice(i,i+7)){if((n=u.directive(t,i))<0)throw l(u._thisDoc,u.lines,t,n,"bad syntax or EOF after @prefix ");n=u.checkDot(t,n),f=!0}if(!f)throw l(u._thisDoc,u.lines,t,i,"Unknown syntax at start of statememt: '"+t.slice(i).slice(0,20)+"'")}}function Ue(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"text/turtle",i=arguments.length>4?arguments[4]:void 0;n=(n=n||h.z8).split(";")[0];try{if(n===h.qS||n===h.z8){var o=Bt(e,e,r,r,null,null,"",null);o.loadBuf(t),u()}else if(n===h.Is){var a=new Pe(e);a.parse(B.parseXML(t),r,e.sym(r)),u()}else if(n===h.D7)Ce(B.parseXML(t,{contentType:h.D7}),e,r),u();else if(n===h.us)Ce(B.parseXML(t,{contentType:h.us}),e,r),u();else if(n===h.oW||n===h.xm)Fe(t,e,r),u();else if(n===h.ui)Qt(t,e,r,u);else{if(n!==h.b4&&n!==h.lL)throw void 0===n?new Error("contentType is undefined"):new Error("Don't know how to parse "+n+" yet");var s=new Oe({factory:Gt});l(null,t)}}catch(t){c(t)}function u(){i&&i(null,e)}function c(t){if(n!==h.ui||n!==h.b4||n!==h.lL){if(!i){var o=new Error(t+" while trying to parse <"+r+"> as "+n);throw o.cause=t,o}i(t,e)}}function l(t,r){t&&i(t,e);try{s.parse(r,f)}catch(t){i(t,e)}}function f(t,r){r?e.add(r.subject,r.predicate,r.object,r.graph):i(t,e)}Ue.handled={"text/n3":!0,"text/turtle":!0,"application/rdf+xml":!0,"application/xhtml+xml":!0,"text/html":!0,"application/sparql-update":!0,"application/sparql-update-single-match":!0,"application/ld+json":!0,"application/nquads":!0,"application/n-quads":!0}}(0,a.Z)(Pe,"ns",{RDF:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",RDFS:"http://www.w3.org/2000/01/rdf-schema#"}),(0,a.Z)(Pe,"nodeType",{ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12});var Le=s(7297),De=s.n(Le),Me=s(2598),Ze=s(292);function Be(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,o.Z)(t);if(e){var a=(0,o.Z)(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return(0,i.Z)(this,r)}}var qe={"text/n3":!0,"text/turtle":!0,"application/rdf+xml":!0,"application/xhtml+xml":!0,"text/html":!0,"application/ld+json":!0},He={rdf:h.Is,owl:h.Is,n3:"text/n3",ttl:"text/turtle",nt:"text/n3",acl:"text/n3",html:"text/html",xml:"text/xml"},$e=function(t){return{link:Z("http://www.w3.org/2007/ont/link#",t),http:Z("http://www.w3.org/2007/ont/http#",t),httph:Z("http://www.w3.org/2007/ont/httph#",t),rdf:Z("http://www.w3.org/1999/02/22-rdf-syntax-ns#",t),rdfs:Z("http://www.w3.org/2000/01/rdf-schema#",t),dc:Z("http://purl.org/dc/elements/1.1/",t),ldp:Z("http://www.w3.org/ns/ldp#",t)}},ze=$e(),Xe=(0,t.Z)((function t(r,n){(0,e.Z)(this,t),(0,a.Z)(this,"response",void 0),(0,a.Z)(this,"dom",void 0),this.response=r,this.dom=n}));(0,a.Z)(Xe,"pattern",void 0);var Ve=function(r){(0,n.Z)(o,r);var i=Be(o);function o(){return(0,e.Z)(this,o),i.apply(this,arguments)}return(0,t.Z)(o,[{key:"parse",value:function(t,e,r){var n=t.store;if(this.dom||(this.dom=B.parseXML(e)),"parsererror"===this.dom.documentElement.nodeName)return t.failFetch(r,"Badly formed XML in "+r.resource.value,"parse_error");var i=new Pe(n);try{i.parse(this.dom,r.original.value,r.original)}catch(e){return t.failFetch(r,"Syntax error parsing RDF/XML! "+e,"parse_error")}return r.noMeta||n.add(r.original,ze.rdf("type"),ze.link("RDFDocument"),t.appNode),t.doneFetch(r,this.response)}}],[{key:"toString",value:function(){return"RDFXMLHandler"}},{key:"register",value:function(t){t.mediatypes[h.Is]={q:.9}}}]),o}(Xe);Ve.pattern=new RegExp("application/rdf\\+xml");var Ge=function(r){(0,n.Z)(o,r);var i=Be(o);function o(){return(0,e.Z)(this,o),i.apply(this,arguments)}return(0,t.Z)(o,[{key:"parse",value:function(t,e,r){var n,i;this.dom||(this.dom=B.parseXML(e));var o=t.store,a=this.dom.getElementsByTagName("title");a.length>0&&o.add(r.resource,ze.dc("title"),o.rdfFactory.literal(a[0].textContent),r.resource);for(var s=this.dom.getElementsByTagName("link"),u=s.length-1;u>=0;u--)i=!1,(n=s[u].getAttribute("rel"))||(n=s[u].getAttribute("rev"),i=!0),n&&t.linkData(r.original,n,s[u].getAttribute("href"),r.resource,i);for(var c=this.dom.getElementsByTagName("script"),l=0;l<c.length;l++){var h=c[l].getAttribute("type");qe[h]&&(Ue(c[l].textContent,o,r.original.value,h),Ue(c[l].textContent,o,r.original.value,h))}if(r.noMeta||o.add(r.resource,ze.rdf("type"),ze.link("WebPage"),t.appNode),!r.noRDFa&&Ce)try{Ce(this.dom,o,r.original.value)}catch(e){var f="Error trying to parse "+r.resource+" as RDFa:\n"+e+":\n"+e.stack;return t.failFetch(r,f,"parse_error")}return t.doneFetch(r,this.response)}}],[{key:"toString",value:function(){return"XHTMLHandler"}},{key:"register",value:function(t){t.mediatypes[h.D7]={}}}]),o}(Xe);Ge.pattern=new RegExp("application/xhtml");var We=function(r){(0,n.Z)(o,r);var i=Be(o);function o(){return(0,e.Z)(this,o),i.apply(this,arguments)}return(0,t.Z)(o,[{key:"parse",value:function(t,e,r){for(var n=B.parseXML(e),i=0;i<n.childNodes.length;i++){var a=n.childNodes[i];if(o.isElement(a)){var s=a.namespaceURI;if(s&&s===s.rdf)return t.addStatus(r.req,"Has XML root element in the RDF namespace, so assume RDF/XML."),new Ve(this.response,n).parse(t,e,r);break}}if(n.doctype&&"html"===n.doctype.name&&n.doctype.publicId.match(/^-\/\/W3C\/\/DTD XHTML/)&&n.doctype.systemId.match(/http:\/\/www.w3.org\/TR\/xhtml/))return t.addStatus(r.req,"Has XHTML DOCTYPE. Switching to XHTML Handler.\n"),new Ge(this.response,n).parse(t,e,r);var u=n.getElementsByTagName("html")[0];if(u){var c=u.getAttribute("xmlns");if(c&&c.match(/^http:\/\/www.w3.org\/1999\/xhtml/))return t.addStatus(r.req,"Has a default namespace for XHTML. Switching to XHTMLHandler.\n"),new Ge(this.response,n).parse(t,e,r)}return t.failFetch(r,"Unsupported dialect of XML: not RDF or XHTML namespace, etc.\n"+e.slice(0,80),901)}}],[{key:"toString",value:function(){return"XMLHandler"}},{key:"register",value:function(t){t.mediatypes["text/xml"]={q:.5},t.mediatypes["application/xml"]={q:.5}}},{key:"isElement",value:function(t){return t.nodeType===Node.ELEMENT_NODE}}]),o}(Xe);We.pattern=new RegExp("(text|application)/(.*)xml");var Qe=function(r){(0,n.Z)(o,r);var i=Be(o);function o(){return(0,e.Z)(this,o),i.apply(this,arguments)}return(0,t.Z)(o,[{key:"parse",value:function(t,e,r){var n=t.store;if(er(e))return t.addStatus(r.req,"Has an XML declaration. We'll assume it's XHTML as the content-type was text/html.\n"),new Ge(this.response).parse(t,e,r);if(function(t){var e=t.indexOf("<!DOCTYPE html"),r=t.indexOf(">");return!(-1===e||-1===r||e>r)&&-1!==t.substr(e,r-e).indexOf("XHTML")}(e))return t.addStatus(r.req,"Has XHTML DOCTYPE. Switching to XHTMLHandler.\n"),new Ge(this.response).parse(t,e,r);if(function(t){return!!t.match(/[^(<html)]*<html\s+[^<]*xmlns=['"]http:\/\/www.w3.org\/1999\/xhtml["'][^<]*>/)}(e))return t.addStatus(r.req,"Has default namespace for XHTML, so switching to XHTMLHandler.\n"),new Ge(this.response).parse(t,e,r);var i=new RegExp("<title>([\\s\\S]+?)</title>","im").exec(e);return i&&n.add(r.resource,ze.dc("title"),n.rdfFactory.literal(i[1]),r.resource),n.add(r.resource,ze.rdf("type"),ze.link("WebPage"),t.appNode),t.addStatus(r.req,"non-XML HTML document, not parsed for data."),t.doneFetch(r,this.response)}}],[{key:"toString",value:function(){return"HTMLHandler"}},{key:"register",value:function(t){t.mediatypes["text/html"]={q:.9}}}]),o}(Xe);Qe.pattern=new RegExp("text/html");var Ye=function(r){(0,n.Z)(o,r);var i=Be(o);function o(){return(0,e.Z)(this,o),i.apply(this,arguments)}return(0,t.Z)(o,[{key:"parse",value:function(t,e,r,n){var i=t.store;return new Promise((function(o,a){try{Qt(e,i,r.original.value,(function(){o(t.doneFetch(r,n))}))}catch(e){var s="Error trying to parse "+r.resource+" as JSON-LD:\n"+e;o(t.failFetch(r,s,"parse_error",n))}}))}}],[{key:"toString",value:function(){return"JsonLdHandler"}},{key:"register",value:function(t){t.mediatypes["application/ld+json"]={q:.9}}}]),o}(Xe);Ye.pattern=/application\/ld\+json/;var Je=function(r){(0,n.Z)(o,r);var i=Be(o);function o(){return(0,e.Z)(this,o),i.apply(this,arguments)}return(0,t.Z)(o,[{key:"parse",value:function(t,e,r){return er(e)?(t.addStatus(r.req,"Warning: "+r.resource+" has an XML declaration. We'll assume it's XML but its content-type wasn't XML.\n"),new We(this.response).parse(t,e,r)):e.slice(0,500).match(/xmlns:/)?(t.addStatus(r.req,"May have an XML namespace. We'll assume it's XML but its content-type wasn't XML.\n"),new We(this.response).parse(t,e,r)):(t.addStatus(r.req,"Plain text document, no known RDF semantics."),t.doneFetch(r,this.response))}}],[{key:"toString",value:function(){return"TextHandler"}},{key:"register",value:function(t){t.mediatypes["text/plain"]={q:.5}}}]),o}(Xe);Je.pattern=new RegExp("text/plain");var Ke=function(r){(0,n.Z)(o,r);var i=Be(o);function o(){return(0,e.Z)(this,o),i.apply(this,arguments)}return(0,t.Z)(o,[{key:"parse",value:function(t,e,r,n){var i=t.store,o=Bt(i,i,r.original.value,r.original.value,null,null,"",null);try{o.loadBuf(e)}catch(e){var a="Error trying to parse "+r.resource+" as Notation3:\n"+e;return t.failFetch(r,a,"parse_error",n)}return t.addStatus(r.req,"N3 parsed: "+o.statementCount+" triples in "+o.lines+" lines."),t.store.add(r.original,ze.rdf("type"),ze.link("RDFDocument"),t.appNode),t.doneFetch(r,this.response)}}],[{key:"toString",value:function(){return"N3Handler"}},{key:"register",value:function(t){t.mediatypes["text/n3"]={q:"1.0"},t.mediatypes["text/turtle"]={q:1}}}]),o}(Xe);Ke.pattern=new RegExp("(application|text)/(x-)?(rdf\\+)?(n3|turtle)");var tr={RDFXMLHandler:Ve,XHTMLHandler:Ge,XMLHandler:We,HTMLHandler:Qe,TextHandler:Je,N3Handler:Ke,JsonLdHandler:Ye};function er(t){return!!t.match(/\s*<\?xml\s+version\s*=[^<>]+\?>/)}var rr=function(){function r(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((0,e.Z)(this,r),(0,a.Z)(this,"store",void 0),(0,a.Z)(this,"timeout",void 0),(0,a.Z)(this,"_fetch",void 0),(0,a.Z)(this,"mediatypes",void 0),(0,a.Z)(this,"appNode",void 0),(0,a.Z)(this,"requested",void 0),(0,a.Z)(this,"timeouts",void 0),(0,a.Z)(this,"redirectedTo",void 0),(0,a.Z)(this,"fetchQueue",void 0),(0,a.Z)(this,"fetchCallbacks",void 0),(0,a.Z)(this,"nonexistent",void 0),(0,a.Z)(this,"lookedUp",void 0),(0,a.Z)(this,"handlers",void 0),(0,a.Z)(this,"ns",void 0),(0,a.Z)(this,"fireCallbacks",void 0),this.store=t||new gt,this.ns=$e(this.store.rdfFactory),this.timeout=i.timeout||3e4,this._fetch=i.fetch||void 0!==s.g&&(s.g.solidFetcher||s.g.solidFetch)||"undefined"!=typeof window&&(window.solidFetcher||window.solidFetch)||De(),!this._fetch)throw new Error("No _fetch function available for Fetcher");this.appNode=this.store.rdfFactory.blankNode(),this.store.fetcher=this,this.requested={},this.timeouts={},this.redirectedTo={},this.fetchQueue={},this.fetchCallbacks={},this.nonexistent={},this.lookedUp={},this.handlers=[],this.mediatypes={"image/*":{q:.9},"*/*":{q:.1}},B.callbackify(this,["request","fail","refresh","retract","done"]),Object.keys(i.handlers||tr).map((function(t){return n.addHandler(tr[t])}))}var n,i;return(0,t.Z)(r,[{key:"load",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r=Object.assign({},r),t instanceof Array)return Promise.all(t.map((function(t){return e.load(t,Object.assign({},r))})));var n=t,i=(0,Me._)(n);i=i.split("#")[0],r=this.initFetchOptions(i,r);var o=this.initFetchOptions(i,r);return this.pendingFetchPromise(i,o.baseURI,o)}},{key:"pendingFetchPromise",value:(i=T(A().mark((function t(e,r,n){var i,o=this;return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=!n.force,!t.t0){t.next=5;break}return t.next=4,this.fetchQueue[r];case 4:t.t0=t.sent;case 5:if(!t.t0){t.next=9;break}i=this.fetchQueue[r],t.next=12;break;case 9:i=Promise.race([this.setRequestTimeout(e,n),this.fetchUri(e,n)]),this.fetchQueue[r]=i,this.cleanupFetchRequest(r,void 0,this.timeout);case 12:return t.abrupt("return",i.then((function(t){return e in o.timeouts&&(o.timeouts[e].forEach(clearTimeout),delete o.timeouts[e]),t})));case 13:case"end":return t.stop()}}),t,this)}))),function(t,e,r){return i.apply(this,arguments)})},{key:"cleanupFetchRequest",value:function(t,e,r){var n=this;void 0!==e&&Ze.warn("_options is deprecated"),this.timeouts[t]=(this.timeouts[t]||[]).concat(setTimeout((function(){n.isPending(t)||delete n.fetchQueue[t]}),r))}},{key:"initFetchOptions",value:function(t,e){var n=this.store;!e.method||"GET"===e.method.toUpperCase()||(e.force=!0),e.resource=n.rdfFactory.namedNode(t),e.baseURI=e.baseURI||t,e.original=n.rdfFactory.namedNode(e.baseURI),e.req=n.bnode(),e.headers=e.headers||new Le.Headers,e.contentType&&(e.headers["content-type"]=e.contentType),e.force&&(e.cache="no-cache");var i=this.acceptString();e.headers.accept=i;var o=r.offlineOverride(t);e.requestedURI=o,r.setCredentials(o,e);var a=r.proxyIfNecessary(o);return o!==a&&(e.proxyUsed=!0),e.actualProxyURI=a,e}},{key:"fetchUri",value:function(t,e){var n=this;if(!t)return Promise.reject(new Error("Cannot fetch an empty uri"));if(r.unsupportedProtocol(t))return this.failFetch(e,"fetcher: Unsupported protocol","unsupported_protocol");var i=this.getState(t);if(e.force)delete this.nonexistent[t];else{if("fetched"===i)return Promise.resolve(this.doneFetch(e,{status:200,ok:!0,statusText:"Already loaded into quadstore."}));if("failed"===i&&404===this.requested[t]){var o="Previously failed: "+this.requested[t],a={url:t,status:this.requested[t],statusText:o,responseText:o,headers:new Le.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return this.failFetch(e,o,this.requested[t],a)}}this.fireCallbacks("request",[t]),this.requested[t]=!0,e.noMeta||this.saveRequestMetadata(t,e);var s=e.actualProxyURI;return this._fetch(s,e).then((function(r){return n.handleResponse(r,t,e)}),(function(r){var i={url:s,status:999,statusText:(r.name||"network failure")+": "+(r.errno||r.code||r.type),responseText:r.message,headers:new Le.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return Ze.log("Fetcher: <"+s+"> Non-HTTP fetch exception: "+r),n.handleError(i,t,e)}))}},{key:"nowOrWhenFetched",value:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=(0,Me._)(t);"function"==typeof e?r=e:void 0===e||((0,v.NX)(e)?n.referringTerm=e:n=e),this.load(i,n).then((function(t){if(r)if(t)if(t.ok)r(!0,"OK",t);else{var e="HTTP error: Status "+t.status+" ("+t.statusText+")";t.responseText&&(e+=" "+t.responseText),Ze.log(e+" fetching "+i),r(!1,e,t)}else{var n="@@ nowOrWhenFetched: no response object!";Ze.log(n),r(!1,n)}}),(function(t){var e=t.message||t.statusText;e="Failed to load <"+i+"> "+e,Ze.log(e),t.response&&t.response.status&&(e+=" status: "+t.response.status),r(!1,e,t.response)}))}},{key:"addStatus",value:function(t,e){var r=new Date;e="["+r.getHours()+":"+r.getMinutes()+":"+r.getSeconds()+"."+r.getMilliseconds()+"] "+e;var n=this.store,i=n.the(t,this.ns.link("status"));(0,v.uZ)(i)?i.append(n.rdfFactory.literal(e)):M.Z.warn("web.js: No list to add to: "+i+","+e)}},{key:"failFetch",value:function(t,e,r,n){this.addStatus(t.req,e),t.noMeta||this.store.add(t.original,this.ns.link("error"),this.store.rdfFactory.literal(e));var i=(t.method||"GET").toUpperCase();("GET"===i||"HEAD"===i)&&(t.resource.equals(t.original),this.requested[I.docpart(t.original.value)]=r,this.fireCallbacks("fail",[t.original.value,e]));var o=new Error("Fetcher: "+e);return o.status=r,o.statusText=e,o.response=n,Promise.reject(o)}},{key:"linkData",value:function(t,e,r,n,i){if(r){var o,a=this.store,s=a.rdfFactory.namedNode(I.join(r,t.value));if("alternate"===e||"seeAlso"===e||"meta"===e||"describedby"===e){if(s.value===t.value)return;o=this.ns.rdfs("seeAlso")}else o="type"===e?a.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"):a.rdfFactory.namedNode(I.join(encodeURIComponent(e),"http://www.iana.org/assignments/link-relations/"));i?a.add(s,o,t,n):a.add(t,o,s,n)}}},{key:"parseLinkHeader",value:function(t,e,r){if(t){var n=/[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*"))/g,i=t.match(/<[^>]*>\s*(\s*;\s*[^()<>@,;:"/[\]?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*")))*(,|$)/g);if(null!=i)for(var o=0;o<i.length;o++){var a=i[o].split(">"),s=a[0].substring(1),u=a[1].match(n);if(null==u)return;for(var c=0;c<u.length;c++){var l=u[c].split("=")[1].replace(/["']/g,"");this.linkData(e,l,s,r)}}}}},{key:"doneFetch",value:function(t,e){return this.addStatus(t.req,"Done."),this.requested[t.original.value]="done",this.fireCallbacks("done",[t.original.value]),e.req=t.req,e}},{key:"nowKnownAs",value:function(t,e){this.lookedUp[t.value]?this.lookedUp[e.value]||this.lookUpThing(e,t):this.lookedUp[e.value]&&(this.lookedUp[t.value]||this.lookUpThing(t,e))}},{key:"putBack",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,Me._)(t),i=new y.Z(n).doc();return r.contentType=r["content-type"]||r["Content-Type"]||r.contentType||h.z8,"application/ld+json"===r.contentType?new Promise((function(n,o){W(i,e.store,i.uri,r.contentType,(function(i,a){i?o(i):(r.data=a,e.webOperation("PUT",t,r).then((function(t){return n(t)})).catch((function(t){return o(t)})))}))})):(r.data=W(i,this.store,i.value,r.contentType),this.webOperation("PUT",n,r))}},{key:"webCopy",value:function(t,e,r){var n=this;return this.webOperation("GET",t).then((function(t){return n.webOperation("PUT",e,{data:t.responseText,contentType:r})}))}},{key:"delete",value:function(t,e){var r=this;return this.webOperation("DELETE",t,e).then((function(e){return r.requested[t]=404,r.nonexistent[t]=!0,r.unload(r.store.rdfFactory.namedNode(t)),e}))}},{key:"createIfNotExists",value:(n=T(A().mark((function t(e){var r,n,i,o,a=arguments;return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:h.z8,n=a.length>2&&void 0!==a[2]?a[2]:"",i=this,t.prev=3,t.next=6,i.load(e);case 6:o=t.sent,t.next=29;break;case 9:if(t.prev=9,t.t0=t.catch(3),404!==t.t0.response.status){t.next=27;break}return Ze.log("createIfNotExists: doc does NOT exist, will create... "+e),t.prev=13,t.next=16,i.webOperation("PUT",e.value,{data:n,contentType:r});case 16:o=t.sent,t.next=23;break;case 19:throw t.prev=19,t.t1=t.catch(13),Ze.log("createIfNotExists doc FAILED: "+e+": "+t.t1),t.t1;case 23:return delete i.requested[e.value],t.abrupt("return",o);case 27:throw Ze.log("createIfNotExists doc load error NOT 404: "+e+": "+t.t0),t.t0;case 29:return t.abrupt("return",o);case 30:case"end":return t.stop()}}),t,this,[[3,9],[13,19]])}))),function(t){return n.apply(this,arguments)})},{key:"createContainer",value:function(t,e,r){var n={"content-type":h.z8,link:this.ns.ldp("BasicContainer")+'; rel="type"'};e&&(n.slug=e);var i={headers:n};return r&&(i.body=r),this.webOperation("POST",t,i)}},{key:"invalidateCache",value:function(t){var e=(0,Me._)(t),r=this;if(r.fetchQueue&&r.fetchQueue[e]&&(r.fetchQueue[e].PromiseStatus,delete r.fetchQueue[e]),r.requested[e]&&"done"!==r.requested[e]&&"failed"!==r.requested[e]&&404!==r.requested[e]){var n="Rdflib: fetcher: Destructive operation on <".concat(r.requested[e],"> file being fetched! ")+e;Ze.error(n)}else delete r.requested[e],delete r.nonexistent[e]}},{key:"webOperation",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=(0,Me._)(e);n.method=t,n.body=n.data||n.body,n.force=!0;var o=this;if(n.body&&!n.contentType)throw new Error("Web operation sending data must have a defined contentType.");return n.contentType&&(n.headers=n.headers||{},n.headers["content-type"]=n.contentType),r.setCredentials(i,n),new Promise((function(e,r){o._fetch(i,n).then((function(n){if(n.ok)"PUT"!==t&&"PATCH"!==t&&"POST"!==t&&"DELETE"!==t||o.invalidateCache(i),n.text?n.text().then((function(t){n.responseText=t,e(n)})):e(n);else{var a="Web error: "+n.status;n.statusText&&(a+=" ("+n.statusText+")"),a+=" on "+t+" of <"+i+">",n.responseText&&(a+=": "+n.responseText);var s=new Error(a);s.response=n,r(s)}}),(function(e){r(new Error("Fetch error for "+t+" of <"+i+">:"+e))}))}))}},{key:"lookUpThing",value:function(t,e){var r=this,n=this.store.uris(t);return(n=n.map((function(t){return I.docpart(t)}))).forEach((function(t){r.lookedUp[t]=!0})),this.load(n,{referringTerm:e})}},{key:"getHeader",value:function(t,e){for(var r=this.store,n=t.value,i=r.each(void 0,this.ns.link("requestedURI"),r.rdfFactory.literal(n)),o=0;o<i.length;o++){var a=i[o];if(void 0!==a){var s=r.any(a,this.ns.link("response"));if(void 0!==s&&r.anyValue(s,this.ns.http("status"))&&r.anyValue(s,this.ns.http("status")).startsWith("2")){var u=r.each(s,this.ns.httph(e.toLowerCase()));return u.length?u.map((function(t){return t.value})):[]}}}}},{key:"saveRequestMetadata",value:function(t,e){var r=e.req,n=this.store,i=e.referringTerm;this.addStatus(e.req,"Accept: "+e.headers.accept),(0,v.NX)(i)&&n.add(n.rdfFactory.namedNode(t),this.ns.link("requestedBy"),i,this.appNode),e.original&&e.original.value!==t&&n.add(r,this.ns.link("orginalURI"),n.rdfFactory.literal(e.original.value),this.appNode);var o=new Date,a="["+o.getHours()+":"+o.getMinutes()+":"+o.getSeconds()+"] ";n.add(r,this.ns.rdfs("label"),n.rdfFactory.literal(a+" Request for "+t),this.appNode),n.add(r,this.ns.link("requestedURI"),n.rdfFactory.literal(t),this.appNode),n.add(r,this.ns.link("status"),n.collection(),this.appNode)}},{key:"saveResponseMetadata",value:function(t,e){var r=this,n=this.store,i=n.bnode();return n.add(e.req,this.ns.link("response"),i,i),n.add(i,this.ns.http("status"),n.rdfFactory.literal(t.status),i),n.add(i,this.ns.http("statusText"),n.rdfFactory.literal(t.statusText),i),t.headers.forEach((function(t,o){n.add(i,r.ns.httph(o),r.store.rdfFactory.literal(t),i),"content-type"===o&&n.add(e.resource,r.ns.rdf("type"),n.rdfFactory.namedNode(B.mediaTypeClass(t).value),i)})),i}},{key:"objectRefresh",value:function(t){var e=this.store.uris(t);if(void 0!==e)for(var r=0;r<e.length;r++)this.refresh(this.store.rdfFactory.namedNode(I.docpart(e[r])))}},{key:"refresh",value:function(t,e){this.fireCallbacks("refresh",arguments),this.nowOrWhenFetched(t,{force:!0,clearPreviousData:!0},e)}},{key:"refreshIfExpired",value:function(t,e){var r=this.getHeader(t,"Expires");!r||new Date(r[0]).getTime()<=(new Date).getTime()?this.refresh(t,e):e(!0,"Not expired",{})}},{key:"retract",value:function(t){this.store.removeMany(void 0,void 0,void 0,t),t.value&&delete this.requested[I.docpart(t.value)],this.fireCallbacks("retract",arguments)}},{key:"getState",value:function(t){return void 0===this.requested[t]?"unrequested":!0===this.requested[t]?"requested":"done"===this.requested[t]?"fetched":"redirected"===this.requested[t]?this.getState(this.redirectedTo[t]):"failed"}},{key:"isPending",value:function(t){return!0===this.requested[t]}},{key:"unload",value:function(t){this.store.removeDocument(t),delete this.requested[t.value]}},{key:"addHandler",value:function(t){this.handlers.push(t),t.register(this)}},{key:"retryNoCredentials",value:function(t,e){Ze.log("Fetcher: CORS: RETRYING with NO CREDENTIALS for "+e.resource),e.retriedWithNoCredentials=!0,delete this.requested[t],delete this.fetchQueue[t];var r=Object.assign({},e,{credentials:"omit"});return this.addStatus(e.req,"Abort: Will retry with credentials SUPPRESSED to see if that helps"),this.load(t,r)}},{key:"isCrossSite",value:function(t){if("undefined"==typeof document||!document.location)return!1;var e=I.hostpart,r=""+document.location;return(e(r)&&e(t)&&e(r))!==e(t)}},{key:"handleError",value:function(t,e,n){if(this.isCrossSite(e)){if(n.credentials&&"include"===n.credentials&&!n.retriedWithNoCredentials)return this.retryNoCredentials(e,n);var i=r.crossSiteProxy(e);if(i&&!n.proxyUsed)return Ze.log("web: Direct failed so trying proxy "+i),this.redirectToProxy(i,n)}var o;return t instanceof Error?o="Fetch error: "+t.message:(o=t.statusText,t.responseText&&(o+=" ".concat(t.responseText))),this.failFetch(n,o,t.status||998,t)}},{key:"addType",value:function(t,e,r,n){var i=e;if(n){var o=r.any(i,this.ns.link("requestedURI"));o&&o.value!==n&&r.add(r.rdfFactory.namedNode(n),this.ns.rdf("type"),t,this.appNode)}for(;;){var a=r.any(i,this.ns.link("requestedURI"));if(a&&a.value&&r.add(r.rdfFactory.namedNode(a.value),this.ns.rdf("type"),t,this.appNode),!(i=r.any(void 0,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#redirectedRequest"),i)))break;var s=r.any(i,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#response"));if(!s)break;var u=r.any(s,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/http#status"));if(!u)break;if("301"!==u&&"302"!==u)break}}},{key:"handleResponse",value:function(t,e,r){var n=this,i=this.store,o=t.headers,a=r.req,s=this.saveResponseMetadata(t,r),u=this.normalizedContentType(r,o)||"",c=o.get("content-location");if(0===t.status)return Ze.log("Masked error - status 0 for "+e),this.handleError(t,e,r);if(t.status>=400)return 404===t.status&&(this.nonexistent[r.original.value]=!0,this.nonexistent[e]=!0),this.saveErrorResponse(t,s).then((function(){var e=r.resource+" "+t.statusText;return n.failFetch(r,e,t.status,t)}));var l=null,h=null;if(c&&(h=I.join(c,e))!==e&&(l=h),200===t.status){this.addType(this.ns.link("Document"),a,i,e),l&&this.addType(this.ns.link("Document"),a,i,l),r.clearPreviousData&&i.removeDocument(r.resource);var f=u.includes("image/")||u.includes("application/pdf");u&&f&&(this.addType(i.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),a,i,e),l&&this.addType(i.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),a,i,l))}if(c){if(!r.force&&l&&"done"===this.requested[h])return this.doneFetch(r,t);this.requested[h]=!0}this.parseLinkHeader(o.get("link"),r.original,a);var p=this.handlerForContentType(u,t);return p?t.text().then((function(e){return t.responseText=e,p.parse(n,e,r,t)})):(this.addStatus(a,"Fetch over. No data handled."),this.doneFetch(r,t))}},{key:"saveErrorResponse",value:function(t,e){var r=this,n=this.store;return t.text().then((function(t){t.length>10&&n.add(e,r.ns.http("content"),n.rdfFactory.literal(t),e)}))}},{key:"handlerForContentType",value:function(t,e){if(!t)return null;var r=this.handlers.find((function(e){return t.match(e.pattern)}));return r?new r(e):null}},{key:"guessContentType",value:function(t){return He[t.split(".").pop()]}},{key:"normalizedContentType",value:function(t,e){if(t.forceContentType)return t.forceContentType;var r=e.get("content-type");if(!r||r.includes("application/octet-stream")){var n=this.guessContentType(t.resource.value);if(n)return n}var i=I.protocol(t.resource.value);return!r&&["file","chrome"].includes(i)?"text/xml":r}},{key:"redirectToProxy",value:function(t,e){var r=this;this.addStatus(e.req,"BLOCKED -> Cross-site Proxy to <"+t+">"),e.proxyUsed=!0;var n=this.store,i=e.req;e.noMeta||(n.add(i,this.ns.link("redirectedTo"),n.rdfFactory.namedNode(t),i),this.addStatus(i,"redirected to new request")),this.requested[e.resource.value]="redirected",this.redirectedTo[e.resource.value]=t;var o=Object.assign({},e);return o.baseURI=e.resource.value,this.fetchUri(t,o).then((function(t){return o.noMeta||n.add(i,r.ns.link("redirectedRequest"),o.req,r.appNode),t}))}},{key:"setRequestTimeout",value:function(t,e){var r=this;return new Promise((function(n){r.timeouts[t]=(r.timeouts[t]||[]).concat(setTimeout((function(){!r.isPending(t)||e.retriedWithNoCredentials||e.proxyUsed||n(r.failFetch(e,"Request to ".concat(t," timed out"),"timeout"))}),r.timeout))}))}},{key:"addFetchCallback",value:function(t,e){this.fetchCallbacks[t]?this.fetchCallbacks[t].push(e):this.fetchCallbacks[t]=[e]}},{key:"acceptString",value:function(){var t="";for(var e in this.mediatypes)for(var r in""!==t&&(t+=", "),t+=e,this.mediatypes[e])t+=";"+r+"="+this.mediatypes[e][r];return t}}],[{key:"crossSiteProxy",value:function(t){return r.crossSiteProxyTemplate?r.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(t)):void 0}},{key:"offlineOverride",value:function(t){var e,r=t;return"undefined"!=typeof window&&window.panes&&(e=window.panes.UI)&&e.preferences&&e.preferences.get("offlineModeUsingLocalhost")&&"http://"===r.slice(0,7)&&"localhost/"!==r.slice(7,17)&&(r="http://localhost/"+r.slice(7),M.Z.warn("Localhost kludge for offline use: actually getting <"+r+">")),r}},{key:"proxyIfNecessary",value:function(t){var e;if("undefined"!=typeof window&&window.panes&&(e=window.panes.UI)&&e.isExtension)return t;if("undefined"!=typeof $SolidTestEnvironment&&$SolidTestEnvironment.localSiteMap){var n=function t(e,r){var n=r[e.shift()];return n?"string"==typeof n?n+e.join("/"):e?t(e,n):null:null}(t.split("/").slice(2),$SolidTestEnvironment.localSiteMap);if(n)return n}return r.crossSiteProxyTemplate&&"undefined"!=typeof document&&document.location&&"https:"===(""+document.location).slice(0,6)&&"http:"===t.slice(0,5)?r.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(t)):t}},{key:"unsupportedProtocol",value:function(t){var e=I.protocol(t);return"tel"===e||"mailto"===e||"urn"===e}},{key:"setCredentials",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};void 0===e.credentials&&(void 0!==e.withCredentials?e.credentials=e.withCredentials?"include":"omit":e.credentials="include")}}]),r}();(0,a.Z)(rr,"HANDLERS",void 0),(0,a.Z)(rr,"CONTENT_TYPE_BY_EXT",void 0),(0,a.Z)(rr,"crossSiteProxyTemplate",void 0),rr.HANDLERS=tr,rr.CONTENT_TYPE_BY_EXT=He;const nr={parseJSON:function(t,e,r){var n,i,o,a={},s=r.sym(e);for(var u in t){0===u.indexOf("_:")?a[u]?n=a[u]:(n=r.bnode(u),a[u]=n):n=r.sym(u);var c=t[u];for(var l in c){var h=c[l];for(var f in i=r.sym(l),h){var p=h[f];if("uri"===p.type)o=r.sym(p.value),r.add(n,i,o,s);else if("BlankNode"===p.type)a[p.value]?o=a[p.value]:(o=r.bnode(p.value),a[p.value]=o),r.add(n,i,o,s);else{if("Literal"!==p.type)throw new Error("error: unexpected termtype: "+f.type);o=p.datatype?r.literal(p.value,void 0,r.sym(p.datatype)):p.lang?r.literal(p.value,p.lang):r.literal(p.value),r.add(n,i,o,s)}}}}}};function ir(t){var e=0;function r(t){var e="",r=t.statements;for(var n in r)M.Z.debug("Found statement: "+r),e+=a()+r[n]+"\n";return e}function n(t){var e="";for(var r in t.constraints){var n=t.constraints[r];e+=a()+"FILTER ( "+n.describe(r)+" ) \n"}return e}function i(t){for(var o="",s=0;s<t.optional.length;s++)M.Z.debug("Found optional query"),o+=a()+"OPTIONAL { \n",e++,o+=r(t.optional[s]),o+=n(t.optional[s]),o+=i(t.optional[s]),e--,o+=a()+"}\n";return o}function o(t){var o=a()+"WHERE \n{ \n";return e++,o+=r(t),o+=n(t),o+=i(t),e--,o+"}"}function a(){for(var t="",r=0;r<e;r++)t+=" ";return t}return function(t){return function(t){for(var e=a()+"SELECT ",r=0;r<t.vars.length;r++)e+=t.vars[r]+" ";return e+"\n"}(t)+o(t.pat)}(t)}function or(t,e,r){var n=[];function i(t){if(n[t])return n[t];var e=r.variable(t);return n[t]=e,e}function o(t){return"string"==typeof t&&t.match(/[^ \n\t]/)}function a(t){return"string"==typeof t&&t.match(/^[\?\$]/)}function s(t){return"string"==typeof t?t.replace(/^&lt;/,"<").replace(/&gt;$/,">"):t}function u(t){return"string"==typeof t&&t.match(/^<[^>]*>$/)}function c(t){return"string"==typeof t&&(t.match(/^_:/)||t.match(/^$/))}function l(t){return"string"==typeof t&&t.match(/:$/)}function h(t){return"string"==typeof t&&t.match(/^:|^[^_][^:]*:/)}function f(t){return t.split(":")[0]}function p(t){return t.split(":")[1]}function d(t){return u(t)?t.slice(1,t.length-1):t}function y(t){var e=-1===t.indexOf("'")?null:t.indexOf("'"),n=-1===t.indexOf('"')?null:t.indexOf('"');if(!e&&!n){var i=new Array(1);return i[0]=t,i}var o,a,s=new Array(2);if(!e||n&&n<e)o='"',a=n;else{if(n&&!(e&&e<n))return M.Z.error("SQARQL QUERY OOPS!"),s;o="'",a=e}s[0]=t.slice(0,a);var u,c=t.slice(a+1).indexOf(o);return-1===c?(M.Z.error("SPARQL parsing error: no matching parentheses in literal "+t),t):(t.slice(c+a+2).match(/^\^\^/)?(u=t.slice(c+a+2).indexOf(" "),s[1]=r.literal(t.slice(a+1,a+1+c),r.sym(d(t.slice(a+4+c,a+2+c+u)))),s=s.concat(y(t.slice(c+a+3+u)))):t.slice(c+a+2).match(/^@/)?(u=t.slice(c+a+2).indexOf(" "),s[1]=r.literal(t.slice(a+1,a+1+c),t.slice(a+3+c,a+2+c+u),null),s=s.concat(y(t.slice(c+a+2+u)))):(s[1]=r.literal(t.slice(a+1,a+1+c)),M.Z.info("Literal found: "+s[1]),s=s.concat(y(t.slice(c+a+2)))),s)}function v(t){t=t.replace(/\(/g," ( ").replace(/\)/g," ) ").replace(/</g," <").replace(/>/g,"> ").replace(/{/g," { ").replace(/}/g," } ").replace(/[\t\n\r]/g," ").replace(/; /g," ; ").replace(/\. /g," . ").replace(/, /g," , "),M.Z.info("New str into spaceDelimit: \n"+t);var e=[],r=t.split(" ");for(var n in r)o(r[n])&&(e=e.concat(r[n]));return e}function g(t,e){for(var r=0;r<e.length;r++)if("string"==typeof e[r]&&e[r].toLowerCase()===t.toLowerCase())return r;return null}function m(t,e){for(var r=[],n=0;n<e.length;n++)"string"==typeof e[n]&&e[n].toLowerCase()===t.toLowerCase()&&r.push(n);return r}function b(t,e,r){M.Z.info("Looking for a close bracket of type "+r+" in "+t);for(var n=0,i=0;i<t.length;i++)if(t[i]===e&&n++,t[i]===r&&n--,n<0)return i;return M.Z.error("Statement had no close parenthesis in SPARQL query"),0}function w(t){return this.describe=function(e){return e+" = "+t.toNT()},this.test=function(e){return t.equals(e)},this}function x(t){this.describe=function(e){return"REGEXP( '"+t+"' , "+e+" )"},this.test=function(e){var r=new RegExp(t);return!!e.value&&r.test(e.value)}}function _(t,e){3!==t.length||"Variable"!==t[0].termType||"NamedNode"!==t[2].termType&&"Literal"!==t[2].termType?6===t.length&&"string"==typeof t[0]&&"regexp"===t[0].toLowerCase()&&"("===t[1]&&")"===t[5]&&","===t[3]&&"Variable"===t[4].termType&&"Literal"===t[2].termType&&(M.Z.debug("Constraint added: "+t),e.constraints[t[4]]=new x(t[2].value)):"="===t[1]||">"===t[1]||"<"===t[1]?(M.Z.debug("Constraint added: "+t),e.constraints[t[0]]=new w(t[2])):M.Z.warn("I don't know how to handle the constraint: "+t)}function T(t,e){M.Z.debug("Optional query: "+t+" not yet implemented.");var n=r.formula();k(t,n),e.optional.push(n)}function k(t,e){var n,o,l=function(t){for(var e=[],n=0;n<t.length;n++)"string"==typeof t[n]?(t[n]=s(t[n]),a(t[n])?e[n]=i(t[n].slice(1)):c(t[n])?(M.Z.info(t[n]+" was identified as a bnode."),e[n]=r.bnode()):u(t[n])?(M.Z.info(t[n]+" was identified as a symbol."),e[n]=r.sym(d(t[n]))):h(t[n])?(M.Z.info(t[n]+" was identified as a prefixed symbol"),O[f(t[n])]?e[n]=r.sym(t[n]=O[f(t[n])]+p(t[n])):(M.Z.error("SPARQL error: "+t[n]+" with prefix "+f(t[n])+" does not have a correct prefix entry."),e[n]=t[n])):e[n]=t[n]):e[n]=t[n];return e}(t);for(M.Z.debug("WHERE: "+l);g("OPTIONAL",l);)o=g("OPTIONAL",l),M.Z.debug("OPT: "+o+" "+l[o]+" in "+l),"{"!==l[o+1]&&M.Z.warn("Bad optional opening bracket in word "+o),-1===(n=b(l.slice(o+2),"{","}"))?M.Z.error("No matching bracket in word "+o):(T(l.slice(o+2,o+2+n),e),o=g("OPTIONAL",l),n=b(l.slice(o+2),"{","}"),l.splice(o,n+3));for(M.Z.debug("WHERE after optionals: "+l);g("FILTER",l);){var y=g("FILTER",l);"("!==l[y+1]&&M.Z.warn("Bad filter opening bracket in word "+y),-1===(n=b(l.slice(y+2),"(",")"))?M.Z.error("No matching bracket in word "+y):(_(l.slice(y+2,y+2+n),e),y=g("FILTER",l),n=b(l.slice(y+2),"(",")"),l.splice(y,n+3))}M.Z.debug("WHERE after filters and optionals: "+l),function(t,e){var r=new Array(1);r[0]=-1;for(var n=r.concat(m(".",t)),i=[],o=0;o<n.length-1;o++)i[o]=t.slice(n[o]+1,n[o+1]);for(o in i){M.Z.info("s+p+o "+o+" = "+i[o]);var a=i[o][0];i[o].splice(0,1);var s=r.concat(m(";",i[o]));s.push(i[o].length);for(var u=[],c=0;c<s.length-1;c++)u[c]=i[o].slice(s[c]+1,s[c+1]);for(o in u){M.Z.info("p+o "+o+" = "+i[o]);var l=u[o][0];u[o].splice(0,1);var h=r.concat(m(",",u[o]));h.push(u[o].length);var f=[];for(c=0;c<h.length-1;c++)f[c]=u[o].slice(h[c]+1,h[c+1]);for(o in f){var p=f[o][0];M.Z.info("Subj="+a+" Pred="+l+" Obj="+p),e.add(a,l,p)}}}}(l,e)}M.Z.info("SPARQL input: \n"+t);var A=new st,E=function(t){var e=y(t),r=[];for(var n in e)r="string"==typeof e[n]?r.concat(v(e[n])):r.concat(e[n]);return r=function(t){for(var e=t,r=0;r<e.length;r++)if("a"===e[r]&&(e[r]="<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>"),"is"===e[r]&&"of"===e[r+2]){e.splice(r,1),e.splice(r+1,1);var n=e[r-1];e[r-1]=e[r+1],e[r+1]=n}return e}(r),M.Z.info("SPARQL Tokens: "+r),r}(t),O=function(t){var e=m("PREFIX",t),r=[];for(var n in e){var i=t[e[n]+1],o=t[e[n]+2];if(l(i))if(u(o)){M.Z.info("Prefix found: "+i+" -> "+o);var a=f(i),s=d(o);r[a]=s}else M.Z.error("Invalid SPARQL symbol: "+o);else M.Z.error("Invalid SPARQL prefix: "+i)}return r}(E);O.rdf||(O.rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"),O.rdfs||(O.rdfs="http://www.w3.org/2000/01/rdf-schema#");var j=g("SELECT",E),N=g("WHERE",E);if(j<0||N<0||j>N)return M.Z.error("Invalid or nonexistent SELECT and WHERE tags in SPARQL query"),!1;if(function(t,e){for(var r in M.Z.info("SPARQL vars: "+t),t)if(a(t[r])){M.Z.info("Added "+t[r]+" to query variables from SPARQL");var n=i(t[r].slice(1));e.vars.push(n),n.label=t[r].slice(1)}else M.Z.warn("Incorrect SPARQL variable in SELECT: "+t[r])}(E.slice(j+1,N),A),k(E.slice(N+2,E.length-1),A.pat),e)return A;for(var S in A.pat.statements){var R=A.pat.statements[S];"NamedNode"===R.subject.termType&&r.fetcher&&r.fetcher.lookUpThing(R.subject,"sparql:"+R.subject),"NamedNode"===R.object.termType&&r.fetcher&&r.fetcher.lookUpThing(R.object,"sparql:"+R.object)}return A}function ar(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return sr(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?sr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function sr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var ur=function(){function r(t){if((0,e.Z)(this,r),(0,a.Z)(this,"store",void 0),(0,a.Z)(this,"ifps",void 0),(0,a.Z)(this,"fps",void 0),(0,a.Z)(this,"patchControl",void 0),(0,a.Z)(this,"ns",void 0),(t=t||new gt).updater)throw new Error("You can't have two UpdateManagers for the same store");t.fetcher||(t.fetcher=new rr(t)),this.store=t,t.updater=this,this.ifps={},this.fps={},this.ns={},this.ns.link=Z("http://www.w3.org/2007/ont/link#"),this.ns.http=Z("http://www.w3.org/2007/ont/http#"),this.ns.httph=Z("http://www.w3.org/2007/ont/httph#"),this.ns.ldp=Z("http://www.w3.org/ns/ldp#"),this.ns.rdf=Z("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.rdfs=Z("http://www.w3.org/2000/01/rdf-schema#"),this.ns.rdf=Z("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.owl=Z("http://www.w3.org/2002/07/owl#"),this.patchControl=[]}return(0,t.Z)(r,[{key:"patchControlFor",value:function(t){return this.patchControl[t.value]||(this.patchControl[t.value]=[]),this.patchControl[t.value]}},{key:"isHttpUri",value:function(t){return"http"===t.slice(0,4)}},{key:"editable",value:function(t,e){if(!t)return!1;if(e||(e=this.store),t=(0,Me._)(t),!this.isHttpUri(t)&&e.holds(this.store.rdfFactory.namedNode(t),this.store.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.store.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#MachineEditableDocument")))return"LOCALFILE";for(var r,n,i=!1,o=e.each(void 0,this.ns.link("requestedURI"),(0,I.docpart)(t)),a=0;a<o.length;a++)if(void 0!==(r=o[a])){var s=e.any(r,this.ns.link("response"));if(void 0!==r){var u=e.anyValue(s,this.ns.httph("wac-allow"));if(u){var c,l=ar(u.split(","));try{for(l.s();!(c=l.n()).done;){var h=c.value.split("=");if(h[0].includes("user")&&!h[1].includes("write")&&!h[1].includes("append"))return!1}}catch(t){l.e(t)}finally{l.f()}}var f=e.each(s,this.ns.httph("accept-patch"));if(f.length)for(var p=0;p<f.length;p++){if((n=f[p].value.trim()).indexOf("application/sparql-update")>=0)return"SPARQL";if(n.indexOf("application/sparql-update-single-match")>=0)return"SPARQL"}var d=e.each(s,this.ns.httph("ms-author-via"));if(d.length)for(var y=0;y<d.length;y++){if((n=d[y].value.trim()).indexOf("SPARQL")>=0)return"SPARQL";if(n.indexOf("DAV")>=0)return"DAV"}if(!this.isHttpUri(t))return!!u&&"LOCALFILE";var v=e.each(s,this.ns.http("status"));if(v.length)for(var g=0;g<v.length;g++)200!==v[g]&&404!==v[g]||(i=!0)}}if(0===o.length);else if(i)return!1}},{key:"anonymize",value:function(t){return"_:"===t.toNT().substr(0,2)&&this.mentioned(t)?"?"+t.toNT().substr(2):t.toNT()}},{key:"anonymizeNT",value:function(t){return this.anonymize(t.subject)+" "+this.anonymize(t.predicate)+" "+this.anonymize(t.object)+" ."}},{key:"nTriples",value:function(t){return"".concat(t.subject.toNT()," ").concat(t.predicate.toNT()," ").concat(t.object.toNT()," .")}},{key:"statementBnodes",value:function(t){return[t.subject,t.predicate,t.object].filter((function(t){return(0,v.B2)(t)}))}},{key:"statementArrayBnodes",value:function(t){for(var e=[],r=0;r<t.length;r++)e=e.concat(this.statementBnodes(t[r]));e.sort();for(var n=[],i=0;i<e.length;i++)0!==i&&e[i].equals(e[i-1])||n.push(e[i]);return n}},{key:"cacheIfps",value:function(){this.ifps={};for(var t=this.store.each(void 0,this.ns.rdf("type"),this.ns.owl("InverseFunctionalProperty")),e=0;e<t.length;e++)this.ifps[t[e].value]=!0;this.fps={},t=this.store.each(void 0,this.ns.rdf("type"),this.ns.owl("FunctionalProperty"));for(var r=0;r<t.length;r++)this.fps[t[r].value]=!0}},{key:"bnodeContext2",value:function(t,e,r){for(var n,i,o=this.store.statementsMatching(void 0,void 0,t,e),a=0;a<o.length;a++)if(this.fps[o[a].predicate.value]){if(!(n=o[a].subject).isBlank)return[o[a]];if(r&&(i=this.bnodeContext2(n,e,r-1)))return i.concat([o[a]])}o=this.store.statementsMatching(t,void 0,void 0,e);for(var s=0;s<o.length;s++)if(this.ifps[o[s].predicate.value]){if(!(n=o[s].object).isBlank)return[o[s]];if(r&&(i=this.bnodeContext2(n,e,r-1)))return i.concat([o[s]])}return null}},{key:"bnodeContext1",value:function(t,e){for(var r=0;r<3;r++){var n=this.bnodeContext2(t,e,r);if(null!==n)return n}return this.store.connectedStatements(t,e)}},{key:"mentioned",value:function(t){return 0!==this.store.statementsMatching(t,null,null,null).length||0!==this.store.statementsMatching(null,t).length||0!==this.store.statementsMatching(null,null,t).length}},{key:"bnodeContext",value:function(t,e){var r=[];if(t.length){this.cacheIfps();for(var n=0;n<t.length;n++){var i=t[n];this.mentioned(i)&&(r=r.concat(this.bnodeContext1(i,e)))}}return r}},{key:"statementContext",value:function(t){var e=this.statementBnodes(t);return this.bnodeContext(e,t.graph)}},{key:"contextWhere",value:function(t){var e=this;return t&&0!==t.length?"WHERE { "+t.map((function(t){return e.anonymizeNT(t)})).join("\n")+" }\n":""}},{key:"fire",value:function(t,e,r){var n=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Promise.resolve().then((function(){if(!t)throw new Error("No URI given for remote editing operation: "+e);return i.noMeta=!0,i.contentType="application/sparql-update",i.body=e,n.store.fetcher.webOperation("PATCH",t,i)})).then((function(n){if(!n.ok){var i="UpdateManager: update failed for <"+t+"> status="+n.status+", "+n.statusText+"\n for query: "+e;throw new Error(i)}r(t,n.ok,n.responseText,n)})).catch((function(e){r(t,!1,e.message,e)}))}},{key:"update_statement",value:function(t){if(!t||t.graph){var e=this,r=this.statementContext(t);return{statement:t?[t.subject,t.predicate,t.object,t.graph]:void 0,statementNT:t?this.anonymizeNT(t):void 0,where:e.contextWhere(r),set_object:function(t,r){var n=this.where;n+="DELETE DATA { "+this.statementNT+" } ;\n",n+="INSERT DATA { "+this.anonymize(this.statement[0])+" "+this.anonymize(this.statement[1])+" "+this.anonymize(t)+" . }\n",e.fire(this.statement[3].value,n,r)}}}}},{key:"insert_statement",value:function(t,e){var r=t instanceof Array?t[0]:t,n=this.contextWhere(this.statementContext(r));if(t instanceof Array){for(var i="",o=0;o<t.length;o++)i+=t[o]+"\n";n+="INSERT DATA { "+i+" }\n"}else n+="INSERT DATA { "+this.anonymize(t.subject)+" "+this.anonymize(t.predicate)+" "+this.anonymize(t.object)+" . }\n";this.fire(r.graph.value,n,e)}},{key:"delete_statement",value:function(t,e){var r=t instanceof Array?t[0]:t,n=this.contextWhere(this.statementContext(r));if(t instanceof Array){for(var i="",o=0;o<t.length;o++)i+=t[o]+"\n";n+="DELETE DATA { "+i+" }\n"}else n+="DELETE DATA { "+this.anonymize(t.subject)+" "+this.anonymize(t.predicate)+" "+this.anonymize(t.object)+" . }\n";this.fire(r.graph.value,n,e)}},{key:"requestDownstreamAction",value:function(t,e){var r=this.patchControlFor(t);if(r.pendingUpstream)if(r.downstreamAction){if(""+r.downstreamAction!=""+e)throw new Error("Can't wait for > 1 different downstream actions")}else r.downstreamAction=e;else e(t)}},{key:"clearUpstreamCount",value:function(t){this.patchControlFor(t).upstreamCount=0}},{key:"getUpdatesVia",value:function(t){var e=this.store.fetcher.getHeader(t,"updates-via");return e&&e.length?e[0].trim():null}},{key:"addDownstreamChangeListener",value:function(t,e){var r=this,n=this.patchControlFor(t);n.downstreamChangeListeners||(n.downstreamChangeListeners=[]),n.downstreamChangeListeners.push(e),this.setRefreshHandler(t,(function(t){r.reloadAndSync(t)}))}},{key:"reloadAndSync",value:function(t){var e=this.patchControlFor(t),r=this;if(e.reloading)e.outOfDate=!0;else{e.reloading=!0;var n=1e3;!function i(){r.reload(r.store,t,(function(t,r,o){if(t){if(e.downstreamChangeListeners)for(var a=0;a<e.downstreamChangeListeners.length;a++)e.downstreamChangeListeners[a]();e.reloading=!1,e.outOfDate&&(e.outOfDate=!1,i())}else e.reloading=!1,0===o.status&&(e.reloading=!0,setTimeout(i,n*=2))}))}()}}},{key:"setRefreshHandler",value:function(t,e){var r=this.getUpdatesVia(t),n=e,i=this,o=this,a=1500,s=0;if(!r)return!1;var u=(r=(0,I.join)(r,t.value)).replace(/^http:/,"ws:").replace(/^https:/,"wss:");return function e(){var r;if("undefined"!=typeof WebSocket)r=new WebSocket(u);else{if("undefined"==typeof window||!window.WebSocket)return;r=window.WebSocket(u)}r.onopen=function(){a=1500,this.send("sub "+t.value),s&&o.requestDownstreamAction(t,n)};var c=i.patchControlFor(t);c.upstreamCount=0,r.onerror=function(t){},r.onclose=function(t){a*=2,s+=1,setTimeout((function(){e()}),a)},r.onmessage=function(e){if(e.data&&"pub"===e.data.slice(0,3)){if("upstreamCount"in c&&(c.upstreamCount-=1,c.upstreamCount>=0))return;c.upstreamCount=0,i.requestDownstreamAction(t,n)}}}(),!0}},{key:"updateMany",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=t.concat(e).map((function(t){return t.why})),n=this,i=[];r.forEach((function(t){i.find((function(e){return e.equals(t)}))||i.push(t)}));var o=i.map((function(r){return n.update(t.filter((function(t){return t.why.equals(r)})),e.filter((function(t){return t.why.equals(r)})))}));return o.length,Promise.all(o)}},{key:"update",value:function(t,e,r,n){var i=this,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(!r){var a=this;return new Promise((function(r,i){a.update(t,e,(function(t,e,n){e?r():i(new Error(n))}),n,o)}))}try{var s=this.store,u=t?(0,v.Pv)(t)?t.statements:t instanceof Array?t:[t]:[],c=e?(0,v.Pv)(e)?e.statements:e instanceof Array?e:[e]:[];if(!(u instanceof Array))throw new Error("Type Error "+(0,d.Z)(u)+": "+u);if(!(c instanceof Array))throw new Error("Type Error "+(0,d.Z)(c)+": "+c);if(0===u.length&&0===c.length)return r(null,!0);var l=u.length?u[0].graph:c[0].graph;if(!l){var h="Error patching: statement does not specify which document to patch:"+u[0]+", "+c[0];throw new Error(h)}if("NamedNode"!==l.termType){var f="Error patching: document not a NamedNode:"+u[0]+", "+c[0];throw new Error(f)}var p=this.patchControlFor(l),y=Date.now(),g=["subject","predicate","object","why"],m=["insert","delete"],b={delete:u,insert:c};m.map((function(t){b[t].map((function(t){if(!l.equals(t.graph))throw new Error("update: destination "+l+" inconsistent with delete quad "+t.graph);g.map((function(e){if(void 0===t[e])throw new Error("update: undefined "+e+" of statement.")}))}))}));var w=this.editable(l.value,s);if(!1===w)throw new Error("Update: Can't make changes in uneditable "+l);if(void 0===w){if(n)throw new Error("Update: Loaded "+l+"but stil can't figure out what editing protcol it supports.");return void this.store.fetcher.load(l).then((function(n){i.update(t,e,r,!0,o)}),(function(n){if(404!==n.response.status)throw new Error("Update: Can't get updatability status ".concat(l," before patching: ").concat(n));i.update(t,e,r,!0,o)}))}if(w.indexOf("SPARQL")>=0){var x=[];u.length&&(x=this.statementArrayBnodes(u)),c.length&&(x=x.concat(this.statementArrayBnodes(c)));var _=this.bnodeContext(x,l),T=this.contextWhere(_),k="";if(T.length){if(u.length){k+="DELETE { ";for(var A=0;A<u.length;A++)k+=this.anonymizeNT(u[A])+"\n";k+=" }\n"}if(c.length){k+="INSERT { ";for(var E=0;E<c.length;E++)k+=this.anonymizeNT(c[E])+"\n";k+=" }\n"}k+=T}else{if(u.length){k+="DELETE DATA { ";for(var O=0;O<u.length;O++)k+=this.anonymizeNT(u[O])+"\n";k+=" } \n"}if(c.length){u.length&&(k+=" ; "),k+="INSERT DATA { ";for(var j=0;j<c.length;j++)k+=this.nTriples(c[j])+"\n";k+=" }\n"}}p.pendingUpstream=p.pendingUpstream?p.pendingUpstream+1:1,"upstreamCount"in p&&(p.upstreamCount+=1),this.fire(l.value,k,(function(t,e,n,i){if(i.elapsedTimeMs=Date.now()-y,e){try{s.remove(u)}catch(t){e=!1,n="Remote Ok BUT error deleting "+u.length+" from store!!! "+t}for(var o=0;o<c.length;o++)s.add(c[o].subject,c[o].predicate,c[o].object,l)}if(r(t,e,n,i),p.pendingUpstream-=1,0===p.pendingUpstream&&p.downstreamAction){var a=p.downstreamAction;delete p.downstreamAction,a(l)}}),o)}else if(w.indexOf("DAV")>=0)this.updateDav(l,u,c,r,o);else{if(!(w.indexOf("LOCALFILE")>=0))throw new Error("Unhandled edit method: '"+w+"' for "+l);try{this.updateLocalFile(l,u,c,r,o)}catch(t){r(l.value,!1,"Exception trying to write back file <"+l.value+">\n")}}}catch(t){r(void 0,!1,"Exception in update: "+t+"\n"+B.stackString(t))}}},{key:"updateDav",value:function(t,e,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=this.store,a=o.any(t,this.ns.link("request"));if(!a)throw new Error("No record of our HTTP GET request for document: "+t);var s=o.any(a,this.ns.link("response"));if(!s)return null;for(var u=o.the(s,this.ns.httph("content-type")).value,c=o.statementsMatching(void 0,void 0,void 0,t).slice(),l=0;l<e.length;l++)B.RDFArrayRemove(c,e[l]);for(var h=0;h<r.length;h++)c.push(r[h]);var f,p=this.serialize(t.value,c,u),d=o.the(s,this.ns.httph("content-location"));return d&&(f=(0,I.join)(d.value,f)),i.contentType=u,i.noMeta=!0,i.body=p,o.fetcher.webOperation("PUT",f,i).then((function(i){if(!i.ok)throw new Error(i.error);for(var a=0;a<e.length;a++)o.remove(e[a]);for(var s=0;s<r.length;s++)o.add(r[s].subject,r[s].predicate,r[s].object,t);n(t.value,i.ok,i.responseText,i)})).catch((function(e){n(t.value,!1,e.message,e)}))}},{key:"updateLocalFile",value:function(t,e,r,n){for(var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=this.store,a=o.statementsMatching(void 0,void 0,void 0,t).slice(),s=0;s<e.length;s++)B.RDFArrayRemove(a,e[s]);for(var u=0;u<r.length;u++)a.push(r[u]);var c=t.value.lastIndexOf(".");if(c<1)throw new Error("Rewriting file: No filename extension: "+t.value);var l=t.value.slice(c+1),h=rr.CONTENT_TYPE_BY_EXT[l];if(!h)throw new Error("File extension ."+l+" not supported for data write");i.body=this.serialize(t.value,a,h),i.contentType=h,o.fetcher.webOperation("PUT",t.value,i).then((function(i){if(!i.ok)return n(t.value,!1,i.error);for(var a=0;a<e.length;a++)o.remove(e[a]);for(var s=0;s<r.length;s++)o.add(r[s].subject,r[s].predicate,r[s].object,t);n(t.value,!0,"")}))}},{key:"serialize",value:function(t,e,r){var n,i=this.store;if("string"==typeof e)return e;var o=V(i);switch(o.suggestNamespaces(i.namespaces),o.setBase(t),r){case"text/xml":case"application/rdf+xml":n=o.statementsToXML(e);break;case"text/n3":case"text/turtle":case"application/x-turtle":case"application/n3":n=o.statementsToN3(e);break;default:throw new Error("Content-type "+r+" not supported for data serialization")}return n}},{key:"put",value:function(t,e,r,n){var i,o=this,a=this.store;return Promise.resolve().then((function(){return i=o.serialize(t.value,e,r),a.fetcher.webOperation("PUT",t.value,{contentType:r,body:i})})).then((function(r){if(!r.ok)return n(t.value,r.ok,r.error,r);delete a.fetcher.nonexistent[t.value],delete a.fetcher.requested[t.value],"string"!=typeof e&&e.map((function(t){a.addStatement(t)})),n(t.value,r.ok,"",r)})).catch((function(e){n(t.value,!1,e.message)}))}},{key:"reload",value:function(t,e,r){var n=Date.now();t.fetcher.nowOrWhenFetched(e.value,{force:!0,noMeta:!0,clearPreviousData:!0},(function(t,i,o){if(t)if(o.onErrorWasCalled||200!==o.status)r(!1,"Non-HTTP error reloading data: "+i,o);else{var a=Date.now()-n;e.reloadTimeTotal||(e.reloadTimeTotal=0),e.reloadTimeCount||(e.reloadTimeCount=0),e.reloadTimeTotal+=a,e.reloadTimeCount+=1,r(!0)}else r(!1,"Error reloading data: "+i,o)}))}}]),r}();function cr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function lr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?cr(Object(r),!0).forEach((function(e){(0,a.Z)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):cr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var hr=lr(lr({},Gt),{},{fetcher:function(t,e){return new rr(t,e)},graph:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return new gt(t,e||{rdfFactory:Gt})},lit:function(t,e,r){return this.literal(""+t,e||r)},st:function(t,e,r,n){return this.quad(t,e,r,n)}});const fr=hr;var pr=function(){function r(t,n){(0,e.Z)(this,r),this.parent=t,this.via=n,this.connected=!1,this.pending={},this.subscribed={},this.socket={};try{this.socket=new WebSocket(n),this.socket.onopen=this.onOpen,this.socket.onclose=this.onClose,this.socket.onmessage=this.onMessage,this.socket.onerror=this.onError}catch(t){this.onError(t)}}return(0,t.Z)(r,[{key:"_decode",value:function(t){var e,r,n,i,o,a,s;for(r in i={},o=function(){var r,n,i,o;for(o=[],r=0,n=(i=t.split("&")).length;r<n;r++)e=i[r],o.push(e.split("="));return o}())e=o[r],s=(a=[decodeURIComponent(e[0]),decodeURIComponent(e[1])])[1],null==i[n=a[0]]&&(i[n]=[]),i[n].push(s);return i}},{key:"_send",value:function(t,e,r){var n,i;return i=[t,e,r].join(" "),"function"==typeof(n=this.socket).send?n.send(i):void 0}},{key:"_subscribe",value:function(t){return this._send("sub",t,""),this.subscribed[t]=!0,this.subscribed[t]}},{key:"onClose",value:function(t){var e;for(e in this.connected=!1,this.subscribed)this.pending[e]=!0;return this.subscribed={},this.subscribed}},{key:"onError",value:function(t){throw new Error("onError"+t)}},{key:"onMessage",value:function(t){var e,r;return"ping"===(r=t.data.split(" "))[0]?"function"==typeof(e=this.socket).send?e.send("pong "+r.slice(1).join(" ")):void 0:"pub"===r[0]?this.parent.onUpdate(r[1],this._decode(r[2])):void 0}},{key:"onOpen",value:function(t){var e,r;for(r in this.connected=!0,e=[],this.pending)delete this.pending[r],e.push(this._subscribe(r));return e}},{key:"subscribe",value:function(t){return this.connected?this._subscribe(t):(this.pending[t]=!0,this.pending[t])}}]),r}(),dr=function(){function r(t){(0,e.Z)(this,r),this.fetcher=t,this.graph={},this.via={},this.fetcher.addCallback("headers",this.onHeaders)}return(0,t.Z)(r,[{key:"onHeaders",value:function(t){var e,r,n;return null==t.headers||"undefined"==typeof WebSocket||null===WebSocket||(e=t.headers.etag,n=t.headers["updates-via"],r=t.uri,e&&n&&(this.graph[r]={etag:e,via:n},this.register(n,r))),!0}},{key:"onUpdate",value:function(t,e){return this.fetcher.refresh(fr.namedNode(t))}},{key:"register",value:function(t,e){return null==this.via[t]&&(this.via[t]=new pr(this,t)),this.via[t].subscribe(e)}}]),r}();function yr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,o.Z)(t);if(e){var a=(0,o.Z)(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return(0,i.Z)(this,r)}}var vr={};for(var gr in fr)"function"==typeof fr[gr]&&(vr[gr]=fr[gr].bind(fr));var mr=vr.fetcher,br=vr.graph,wr=vr.lit,xr=vr.st,_r=vr.namedNode,Tr=vr.variable,kr=vr.blankNode,Ar=vr.defaultGraph,Er=vr.literal,Or=vr.quad,jr=vr.triple,Nr=new nt,Sr=function(t){return Nr.fromNT(t)},Rr=it.fromValue,Ir=p.nextId,Cr=function(i){(0,n.Z)(s,i);var o=yr(s);function s(t){var n;return(0,e.Z)(this,s),n=o.call(this,t),(0,a.Z)((0,r.Z)(n),"fetcher",void 0),n.fetcher=new rr((0,r.Z)(n),{}),n}return(0,t.Z)(s)}(gt),Pr=function(i){(0,n.Z)(s,i);var o=yr(s);function s(t){var n;return(0,e.Z)(this,s),n=o.call(this,t),(0,a.Z)((0,r.Z)(n),"updater",void 0),n.updater=new ur((0,r.Z)(n)),n}return(0,t.Z)(s)}(Cr)})(),u})()));
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("window")):"function"==typeof define&&define.amd?define(["window"],t):"object"==typeof exports?exports.$rdf=t(require("window")):e.$rdf=t(e.window)}(self,(e=>(()=>{var t={8333:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n={Literal:1,Collection:3,Graph:4,NamedNode:5,BlankNode:6,Variable:7}},7308:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n={debug:function(e){},warn:function(e){},info:function(e){},error:function(e){},success:function(e){},msg:function(e){}}},6545:(e,t,r)=>{"use strict";r.d(t,{Z:()=>y});var n=r(7061),i=r(9900),o=r(4771),a=r(4768),s=r(4593),c=r(886),u=r(240),l=r(8333),h=r(4806),f=r(9247),p=r(2598),d=r(5904);var y=function(e){(0,a.Z)(y,e);var t,r,h=(t=y,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=(0,c.Z)(t);if(r){var i=(0,c.Z)(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return(0,s.Z)(this,e)});function y(e){var t;if((0,n.Z)(this,y),t=h.call(this,(0,p._)(e)),(0,u.Z)((0,o.Z)(t),"termType",f.XM),(0,u.Z)((0,o.Z)(t),"classOrder",l.Z.NamedNode),!t.value)throw new Error("Missing IRI for NamedNode");if(!t.value.includes(":"))throw new Error('NamedNode IRI "'+e+'" must be absolute.');if(t.value.includes(" "))throw new Error('Error: NamedNode IRI "'+e+'" must not contain unencoded spaces.');return t}return(0,i.Z)(y,[{key:"dir",value:function(){var e=this.value.split("#")[0],t=e.slice(0,-1).lastIndexOf("/"),r=e.indexOf("//");return r>=0&&t<r+2||t<0?null:new y(e.slice(0,t+1))}},{key:"site",value:function(){var e=this.value.split("#")[0],t=e.indexOf("//");if(t<0)throw new Error("This URI does not have a web site part (origin)");var r=e.indexOf("/",t+2);return new y(r<0?e.slice(0)+"/":e.slice(0,r+1))}},{key:"doc",value:function(){return this.value.indexOf("#")<0?this:new y(this.value.split("#")[0])}},{key:"toString",value:function(){return"<"+this.value+">"}},{key:"id",value:function(){return this.value.split("#")[1]}},{key:"uri",get:function(){return this.value},set:function(e){this.value=e}}],[{key:"fromValue",value:function(e){return null==e||(0,d.jt)(e)?e:new y(e)}}]),y}(h.Z)},4806:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});var n=r(7061),i=r(9900),o=r(240),a=r(292),s=function(){function e(t){(0,n.Z)(this,e),(0,o.Z)(this,"termType",void 0),(0,o.Z)(this,"classOrder",void 0),(0,o.Z)(this,"value",void 0),this.value=t}return(0,i.Z)(e,[{key:"substitute",value:function(e){return a.log("@@@ node substitute"+this),this}},{key:"compareTerm",value:function(e){return this.classOrder<e.classOrder?-1:this.classOrder>e.classOrder?1:this.value<e.value?-1:this.value>e.value?1:0}},{key:"equals",value:function(e){return!!e&&this.termType===e.termType&&this.value===e.value}},{key:"hashString",value:function(){return this.toCanonical()}},{key:"sameTerm",value:function(e){return this.equals(e)}},{key:"toCanonical",value:function(){return this.toNT()}},{key:"toNT",value:function(){return this.toString()}},{key:"toNQ",value:function(){return this.toNT()}},{key:"toString",value:function(){throw new Error("Node.toString() is abstract - see the subclasses instead")}}]),e}();(0,o.Z)(s,"fromValue",void 0),(0,o.Z)(s,"toJS",void 0)},9247:(e,t,r)=>{"use strict";r.d(t,{D7:()=>j,Eo:()=>_,Is:()=>m,NK:()=>s,UH:()=>a,V1:()=>i,XM:()=>n,_A:()=>l,aV:()=>g,b4:()=>v,fb:()=>c,lL:()=>y,ls:()=>u,oW:()=>b,qS:()=>p,sZ:()=>d,ui:()=>f,us:()=>h,xH:()=>o,xm:()=>w,z8:()=>x});var n="NamedNode",i="BlankNode",o="Literal",a="Variable",s="DefaultGraph",c="Collection",u="Empty",l="Graph",h="text/html",f="application/ld+json",p="text/n3",d="application/n3",y="application/nquads",v="application/n-quads",g="application/n-triples",m="application/rdf+xml",b="application/sparql-update",w="application/sparql-update-single-match",x="text/turtle",_="application/x-turtle",j="application/xhtml+xml"},3357:(e,t,r)=>{"use strict";r.r(t),r.d(t,{docpart:()=>a,document:()=>s,hostpart:()=>c,join:()=>u,protocol:()=>l,refTo:()=>h});var n=r(6545),i=r(292),o=o||i.log;function a(e){var t;return(t=e.indexOf("#"))<0?e:e.slice(0,t)}function s(e){return new n.Z(a(e))}function c(e){var t=/[^\/]*\/\/([^\/]*)\//.exec(e);return t?t[1]:""}function u(e,t){var r,n,i,a,s,c=t.indexOf("#");if(c>0&&(t=t.slice(0,c)),0===e.length)return t;if(0===e.indexOf("#"))return t+e;if(e.indexOf(":")>=0)return e;if(r=t.indexOf(":"),0===t.length)return e;if(r<0)return o("Invalid base: "+t+" in join with given: "+e),e;if(n=t.slice(0,+r+1||9e9),0===e.indexOf("//"))return n+e;if(t.indexOf("//",r)===r+1){if((i=t.indexOf("/",r+3))<0)return t.length-r-3>0?t+"/"+e:n+e}else if((i=t.indexOf("/",r+1))<0)return t.length-r-1>0?t+"/"+e:n+e;if(0===e.indexOf("/"))return t.slice(0,i)+e;if((a=(s=t.slice(i)).lastIndexOf("/"))<0)return n+e;for(a>=0&&a<s.length-1&&(s=s.slice(0,+a+1||9e9)),s+=e;s.match(/[^\/]*\/\.\.\//);)s=s.replace(/[^\/]*\/\.\.\//,"");return s=(s=s.replace(/\.\//g,"")).replace(/\/\.$/,"/"),t.slice(0,i)+s}function l(e){var t=e.indexOf(":");return t<0?null:e.slice(0,t)}function h(e,t){var r,n,i,o,a,s,c,u,l,h,f,p,d=new RegExp("^[-_a-zA-Z0-9.]+:(//[^/]*)?/[^/]*$");if(!e)return t;if(e===t)return"";for(r=c=0,o=t.length;c<o&&t[r]===e[r];r=++c);if(e.slice(0,r).match(d)&&((n=t.indexOf("//"))<0&&(n=-2),i=t.indexOf("/",n+2),"/"!==t[i+1]&&"/"!==e[i+1]&&t.slice(0,i)===e.slice(0,i)))return t.slice(i);if("#"===t[r]&&e.length===r)return t.slice(r);for(;r>0&&"/"!==t[r-1];)r--;if(r<3)return t;if(e.indexOf("//",r-2)>0||t.indexOf("//",r-2)>0)return t;if(e.indexOf(":",r)>0)return t;for(s=0,u=0,a=(h=e.slice(r)).length;u<a;u++)"/"===h[u]&&s++;if(0===s&&r<t.length&&"#"===t[r])return"./"+t.slice(r);if(0===s&&r===t.length)return"./";if(p="",s>0)for(l=1,f=s;f>=1?l<=f:l>=f;f>=1?++l:--l)p+="../";return p+t.slice(r)}},5115:(e,t,r)=>{"use strict";r.r(t),r.d(t,{DOMParserFactory:()=>f,RDFArrayRemove:()=>w,callbackify:()=>h,domToString:()=>p,dtstamp:()=>y,dumpNode:()=>d,heavyCompare:()=>v,heavyCompareSPO:()=>g,linkRelationProperty:()=>l,log:()=>n.Z,mediaTypeClass:()=>u,output:()=>m,parseXML:()=>b,stackString:()=>_,string:()=>c,string_startswith:()=>x,uri:()=>i});var n=r(7308),i=r(3357),o=r(6545),a=r(870);e=r.hmd(e);var s=r(292),c={template:function(e,t){for(var r=e.split("%s"),n="",i=0;i<t.length;i++)t[i]+="",n+=r[i]+t[i];return n+r.slice(t.length).join()}};function u(e){return e=e.split(";")[0].trim(),new o.Z("http://www.w3.org/ns/iana/media-types/"+e+"#Resource")}function l(e){return new o.Z("http://www.w3.org/ns/iana/link-relations/relation#"+e.trim())}function h(e,t){e.callbacks={};for(var r=t.length-1;r>=0;r--)e.callbacks[t[r]]=[];e.addHook=function(t){e.callbacks[t]||(e.callbacks[t]=[])},e.addCallback=function(t,r){e.callbacks[t].push(r)},e.removeCallback=function(t,r){for(var n=0;n<e.callbacks[t].length;n++)if(e.callbacks[t][n].name===r)return e.callbacks[t].splice(n,1),!0;return!1},e.insertCallback=function(t,r){e.callbacks[t].unshift(r)},e.fireCallbacks=function(t,r){var n,i,o=[],a=[],s=e.callbacks[t].length;for(n=s-1;n>=0;n--)(i=e.callbacks[t][n])&&i.apply(e,r)&&o.push(i);for(n=o.length-1;n>=0;n--)a.push(o[n]);for(n=s;n<e.callbacks[t].length;n++)a.push(e.callbacks[t][n]);e.callbacks[t]=a}}function f(){return window.DOMParser?new a.DOMParser:!!window.ActiveXObject&&new ActiveXObject("Microsoft.XMLDOM")}function p(e,t){var r=[];(t=t||{})&&t.selfClosing&&t.selfClosing.split(" ").forEach((function(e){r[e]=!0}));var n=[];return t&&t.skipAttributes&&t.skipAttributes.split(" ").forEach((function(e){n[e]=!0})),d(e,t,r,n)}function d(e,t,r,n){var i,o="",a=[!1];if(void 0===e.nodeType)return o;if(1===e.nodeType){if(e.hasAttribute("class")&&t&&t.classWithChildText&&e.matches(t.classWithChildText.class))o+=e.querySelector(t.classWithChildText.element).textContent;else if(!(t&&t.skipNodeWithClass&&e.matches("."+t.skipNodeWithClass))){var c=e.nodeName.toLowerCase();o+="<"+c;var u=[];for(i=e.attributes.length-1;i>=0;i--){var l=e.attributes[i];if(!(n&&n.length>0&&n[l.name]||/^\d+$/.test(l.name))){if("class"===l.name&&t&&t.replaceClassItemWith&&l.value.split(" ").indexOf(t.replaceClassItemWith.source)>-1){var h=new RegExp(t.replaceClassItemWith.source,"g");l.value=l.value.replace(h,t.replaceClassItemWith.target).trim()}"class"===l.name&&t&&t.skipClassWithValue&&t.skipClassWithValue===l.value||u.push(l.name+"='"+l.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&quot;")+"'")}}if(u.length>0&&(t&&t.sortAttributes&&u.sort((function(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())})),o+=" "+u.join(" ")),r&&r.ename)o+=" />";else{for(o+=">",o+="html"===c?"\n ":"",a.push("style"===c||"script"===c),i=0;i<e.childNodes.length;i++)o+=d(e.childNodes[i]);a.pop(),o+="body"===c?"</"+c+">\n":"</"+c+">"}}}else if(8===e.nodeType)o+="\x3c!--"+e.nodeValue+"--\x3e";else if(3===e.nodeType||4===e.nodeType){var f=e.nodeValue.replace(/\n+$/,"");o+=a[a.length-1]?f:f.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}else s.log("Warning; Cannot handle serialising nodes of type: "+e.nodeType),s.log(e);return o}function y(){var e=new Date,t=e.getYear()+1900,r=e.getMonth()+1,n=e.getDate(),i=e.getUTCHours(),o=e.getUTCMinutes(),a=e.getSeconds();return r<10&&(r="0"+r),n<10&&(n="0"+n),i<10&&(i="0"+i),o<10&&(o="0"+o),a<10&&(a="0"+a),t+"-"+r+"-"+n+"T"+i+":"+o+":"+a+"Z"}function v(e,t,r,n){var i=function(e){return"BlankNode"===e.termType?null:e},o=function(e){var t=r.statementsMatching(e).map((function(e){return i(e.subject)+" "+i(e.predicate)+" "+i(e.object)})).concat(r.statementsMatching(void 0,void 0,e).map((function(e){return i(e.subject)+" "+i(e.predicate)+" "+i(e.object)})));return t.sort(),t.join("\n")},a=Object.prototype.hasOwnProperty.call(r,"compareTerms")?r.compareTerms(e,t):e.compareTerm(t);return"BlankNode"===e.termType&&"BlankNode"===t.termType?0===a?0:o(e)>o(t)?1:o(e)<o(t)?-1:a:n&&e.uri&&t.uri?(n[e.uri]||e.uri).localeCompare(n[t.uri]||t.uri):a}function g(e,t,r,n){return v(e.subject,t.subject,r,n)||v(e.predicate,t.predicate,r,n)||v(e.object,t.object,r,n)}function m(e){var t=document.createElement("div");t.textContent=e,document.body.appendChild(t)}function b(t,r){return r=r||{},e&&e.exports?(new a.DOMParser).parseFromString(t,r.contentType||"application/xhtml+xml"):("undefined"!=typeof window&&window.DOMParser?new window.DOMParser:new a.DOMParser).parseFromString(t,"application/xml")}function w(e,t){for(var r=0;r<e.length;r++)if(e[r].subject.equals(t.subject)&&e[r].predicate.equals(t.predicate)&&e[r].object.equals(t.object)&&e[r].why.equals(t.why))return void e.splice(r,1);throw new Error("RDFArrayRemove: Array did not contain "+t+" "+t.why)}function x(e,t){return e.slice(0,t.length)===t}function _(e){var t=e+"\n";if(!e.stack)return t+"No stack available.\n";for(var r=e.stack.toString().split("\n"),n=[],i=0;i<r.length;i++){var o=r[i];if(o.indexOf("ecmaunit.js")>-1)break;"("==o.charAt(0)&&(o="function"+o);var a=o.split("@");n.push(a)}for(i=0;i<n.length;i++)t+=" "+n[i][1]+"\n "+n[i][0];return t}},2598:(e,t,r)=>{"use strict";function n(e){return"string"==typeof e?e:e.value}r.d(t,{_:()=>n})},5904:(e,t,r)=>{"use strict";r.d(t,{B2:()=>v,NA:()=>w,NX:()=>y,PY:()=>d,Pv:()=>a,Uc:()=>c,Yi:()=>o,cG:()=>h,f:()=>u,jt:()=>f,lt:()=>b,lx:()=>m,n_:()=>p,nq:()=>l,uZ:()=>s,zz:()=>g});var n=r(7209),i=r(9247);function o(e){return"object"===(0,n.Z)(e)&&null!==e&&"subject"in e}function a(e){return"object"===(0,n.Z)(e)&&null!==e&&"statements"in e}function s(e){return f(e)&&e.termType===i.fb}function c(e){return e&&Object.prototype.hasOwnProperty.call(e,"termType")&&(e.termType===i.XM||e.termType===i.UH||e.termType===i.V1||e.termType===i.fb||e.termType===i.xH||e.termType===i._A)}function u(e){return e&&Object.prototype.hasOwnProperty.call(e,"termType")&&(e.termType===i.XM||e.termType===i.UH||e.termType===i.V1||e.termType===i.fb||e.termType===i.xH||e.termType===i._A)}function l(e){return f(e)&&(e.termType===i.XM||e.termType===i.V1||e.termType===i.UH)}function h(e){return f(e)&&e.termType===i.UH}function f(e){return"object"===(0,n.Z)(e)&&null!==e&&"termType"in e}function p(e){return e.termType===i.xH}function d(e){return"object"===(0,n.Z)(e)&&null!==e&&"subject"in e&&"predicate"in e&&"object"in e}function y(e){return f(e)&&"NamedNode"===e.termType}function v(e){return f(e)&&"termType"in e&&"BlankNode"===e.termType}function g(e){return f(e)&&(e.termType===i.XM||e.termType===i.UH||e.termType===i.V1)}function m(e){return f(e)&&(e.termType===i.XM||e.termType===i.UH)}function b(e){return f(e)&&(e.termType===i.XM||e.termType===i.UH||e.termType===i.V1||e.termType===i.xH)}function w(e){return f(e)&&(e.termType===i.XM||e.termType===i.UH||e.termType===i.V1||e.termType===i.NK)}},5619:function(e,t,r){var n,i;void 0===(i="function"==typeof(n=function(){"use strict";function e(t,r,n,i){this.message=t,this.expected=r,this.found=n,this.location=i,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}return function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(e,Error),e.buildMessage=function(e,t){var r={literal:function(e){return'"'+i(e.text)+'"'},class:function(e){var t,r="";for(t=0;t<e.parts.length;t++)r+=e.parts[t]instanceof Array?o(e.parts[t][0])+"-"+o(e.parts[t][1]):o(e.parts[t]);return"["+(e.inverted?"^":"")+r+"]"},any:function(e){return"any character"},end:function(e){return"end of input"},other:function(e){return e.description}};function n(e){return e.charCodeAt(0).toString(16).toUpperCase()}function i(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}function o(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}return"Expected "+function(e){var t,n,i,o=new Array(e.length);for(t=0;t<e.length;t++)o[t]=(i=e[t],r[i.type](i));if(o.sort(),o.length>0){for(t=1,n=1;t<o.length;t++)o[t-1]!==o[t]&&(o[n]=o[t],n++);o.length=n}switch(o.length){case 1:return o[0];case 2:return o[0]+" or "+o[1];default:return o.slice(0,-1).join(", ")+", or "+o[o.length-1]}}(e)+" but "+function(e){return e?'"'+i(e)+'"':"end of input"}(t)+" found."},{SyntaxError:e,parse:function(t,n){n=void 0!==n?n:{};var i,o={},a={turtleDoc:Pt},s=Pt,c=".",u=It(".",!1),l=It("#",!1),h=/^[^\n]/,f=Rt(["\n"],!0,!1),p=It("\n",!1),d=function(e){return e.join("")},y="@prefix",v=It("@prefix",!1),g=function(e,t){return hr.addPrefix(""===e?"0":e,t),{}},m="@base",b=It("@base",!1),w=function(e){return hr.addBase(e),{}},x=/^[Bb]/,_=Rt(["B","b"],!1,!1),j=/^[Aa]/,k=Rt(["A","a"],!1,!1),T=/^[Ss]/,O=Rt(["S","s"],!1,!1),A=/^[Ee]/,N=Rt(["E","e"],!1,!1),S=/^[Pp]/,E=Rt(["P","p"],!1,!1),I=/^[Rr]/,R=Rt(["R","r"],!1,!1),C=/^[Ff]/,D=Rt(["F","f"],!1,!1),L=/^[Ii]/,P=Rt(["I","i"],!1,!1),M=/^[Xx]/,F=Rt(["X","x"],!1,!1),U=It(";",!1),B=function(e,t,r,n){var i={};return i[r]=n,i},Z=function(e,t,r){return r},q=It(",",!1),H=function(e,t){return t},V=It("a",!1),z=It("[",!1),$=It("]",!1),G=It("(",!1),X=It(")",!1),J="^^",W=It("^^",!1),Q="true",Y=It("true",!1),K="false",ee=It("false",!1),te=It("<",!1),re=/^[^\0- <>"{}|\^`\\]/,ne=Rt([["\0"," "],"<",">",'"',"{","}","|","^","`","\\"],!0,!1),ie=It(">",!1),oe=":",ae=It(":",!1),se="_:",ce=It("_:",!1),ue=/^[0-9]/,le=Rt([["0","9"]],!1,!1),he=It("@",!1),fe=/^[a-zA-Z]/,pe=Rt([["a","z"],["A","Z"]],!1,!1),de="-",ye=It("-",!1),ve=/^[a-zA-Z0-9]/,ge=Rt([["a","z"],["A","Z"],["0","9"]],!1,!1),me=function(e,t){return"-"+t.join("")},be=/^[+\-]/,we=Rt(["+","-"],!1,!1),xe=/^[eE]/,_e=Rt(["e","E"],!1,!1),je='"',ke=It('"',!1),Te=/^[^"\\\n\r]/,Oe=Rt(['"',"\\","\n","\r"],!0,!1),Ae="'",Ne=It("'",!1),Se=/^[^'\\\n\r]/,Ee=Rt(["'","\\","\n","\r"],!0,!1),Ie="'''",Re=It("'''",!1),Ce=/^[^'\\]/,De=Rt(["'","\\"],!0,!1),Le="''",Pe=It("''",!1),Me=function(e,t){return"''"+t.join("")},Fe=function(e,t){return"'"+t.join("")},Ue=function(e,t){return e.join("")+t.join("")},Be='"""',Ze=It('"""',!1),qe=/^[^"\\]/,He=Rt(['"',"\\"],!0,!1),Ve='""',ze=It('""',!1),$e=function(e,t){return'""'+t.join("")},Ge=function(e,t){return'"'+t.join("")},Xe=It("\\U",!1),Je=It("\\u",!1),We=It("\\t",!1),Qe=It("\\b",!1),Ye=It("\\n",!1),Ke=It("\\r",!1),et=It("\\f",!1),tt=It('\\"',!1),rt=It("\\'",!1),nt=It("\\\\",!1),it=/^[ \t\r\n]/,ot=Rt([" ","\t","\r","\n"],!1,!1),at=/^[\uD800-\uDBFF]/,st=Rt([["\ud800","\udbff"]],!1,!1),ct=/^[\uDC00-\uDFFF]/,ut=Rt([["\udc00","\udfff"]],!1,!1),lt=/^[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]/,ht=Rt([["A","Z"],["a","z"],["À","Ö"],["Ø","ö"],["ø","˿"],["Ͱ","ͽ"],["Ϳ","῿"],["‌","‍"],["⁰","↏"],["Ⰰ","⿯"],["、","퟿"],["豈","﷏"],["ﷰ","�"]],!1,!1),ft=It("_",!1),pt=It("·",!1),dt=/^[\u0300-\u036F]/,yt=Rt([["̀","ͯ"]],!1,!1),vt=/^[\u203F-\u2040]/,gt=Rt([["‿","⁀"]],!1,!1),mt=function(e,t,r,n){return r.join("")+n.join("")},bt=It("%",!1),wt=/^[0-9A-Fa-f]/,xt=Rt([["0","9"],["A","F"],["a","f"]],!1,!1),_t=It("\\",!1),jt=/^[_~.!$&'()*+,;=\/?#@%\-]/,kt=Rt(["_","~",".","!","$","&","'","(",")","*","+",",",";","=","/","?","#","@","%","-"],!1,!1),Tt=0,Ot=0,At=[{line:1,column:1}],Nt=0,St=[];if("startRule"in n){if(!(n.startRule in a))throw new Error("Can't start parsing from rule \""+n.startRule+'".');s=a[n.startRule]}function Et(t,r){throw function(t,r){return new e(t,null,null,r)}(t,r=void 0!==r?r:Dt(Ot,Tt))}function It(e,t){return{type:"literal",text:e,ignoreCase:t}}function Rt(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function Ct(e){var r,n=At[e];if(n)return n;for(r=e-1;!At[r];)r--;for(n={line:(n=At[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return At[e]=n,n}function Dt(e,t){var r=Ct(e),n=Ct(t);return{start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:n.line,column:n.column}}}function Lt(e){Tt<Nt||(Tt>Nt&&(Nt=Tt,St=[]),St.push(e))}function Pt(){var e,t,r,n,i,a;for(e=Tt,t=[],r=Mt();r!==o;)t.push(r),r=Mt();if(t!==o){for(r=[],n=Ft();n!==o;)r.push(n),n=Ft();r!==o?(Ot=e,i=t,(a=hr.toJSON())["@graph"]=[],i.filter((e=>Array.isArray(e))).forEach((e=>{e.forEach((e=>{a["@graph"].push(e)}))})),1===a["@graph"].length&&(Object.assign(a,a["@graph"][0]),delete a["@graph"]),e=t=a):(Tt=e,e=o)}else Tt=e,e=o;return e}function Mt(){var e,r,n,i;if((e=function(){var e;return(e=function(){var e,r,n,i,a,s,l,h,f;for(e=Tt,r=[],n=Ft();n!==o;)r.push(n),n=Ft();if(r!==o)if(t.substr(Tt,7)===y?(n=y,Tt+=7):(n=o,Lt(v)),n!==o){for(i=[],a=Ft();a!==o;)i.push(a),a=Ft();if(i!==o)if((a=Wt())!==o){for(s=[],l=Ft();l!==o;)s.push(l),l=Ft();if(s!==o)if((l=Xt())!==o){for(h=[],f=Ft();f!==o;)h.push(f),f=Ft();h!==o?(46===t.charCodeAt(Tt)?(f=c,Tt++):(f=o,Lt(u)),f!==o?(Ot=e,e=r=g(a,l)):(Tt=e,e=o)):(Tt=e,e=o)}else Tt=e,e=o;else Tt=e,e=o}else Tt=e,e=o;else Tt=e,e=o}else Tt=e,e=o;else Tt=e,e=o;return e}())===o&&(e=function(){var e,r,n,i,a,s,l;for(e=Tt,r=[],n=Ft();n!==o;)r.push(n),n=Ft();if(r!==o)if(t.substr(Tt,5)===m?(n=m,Tt+=5):(n=o,Lt(b)),n!==o){for(i=[],a=Ft();a!==o;)i.push(a),a=Ft();if(i!==o)if((a=Xt())!==o){for(s=[],l=Ft();l!==o;)s.push(l),l=Ft();s!==o?(46===t.charCodeAt(Tt)?(l=c,Tt++):(l=o,Lt(u)),l!==o?(Ot=e,e=r=w(a)):(Tt=e,e=o)):(Tt=e,e=o)}else Tt=e,e=o;else Tt=e,e=o}else Tt=e,e=o;else Tt=e,e=o;return e}())===o&&(e=function(){var e,r,n,i,a,s,c,u,l,h,f,p;for(e=Tt,r=[],n=Ft();n!==o;)r.push(n),n=Ft();if(r!==o)if(S.test(t.charAt(Tt))?(n=t.charAt(Tt),Tt++):(n=o,Lt(E)),n!==o)if(I.test(t.charAt(Tt))?(i=t.charAt(Tt),Tt++):(i=o,Lt(R)),i!==o)if(A.test(t.charAt(Tt))?(a=t.charAt(Tt),Tt++):(a=o,Lt(N)),a!==o)if(C.test(t.charAt(Tt))?(s=t.charAt(Tt),Tt++):(s=o,Lt(D)),s!==o)if(L.test(t.charAt(Tt))?(c=t.charAt(Tt),Tt++):(c=o,Lt(P)),c!==o)if(M.test(t.charAt(Tt))?(u=t.charAt(Tt),Tt++):(u=o,Lt(F)),u!==o){for(l=[],h=Ft();h!==o;)l.push(h),h=Ft();if(l!==o)if((h=Wt())!==o){for(f=[],p=Ft();p!==o;)f.push(p),p=Ft();f!==o&&(p=Xt())!==o?(Ot=e,e=r=g(h,p)):(Tt=e,e=o)}else Tt=e,e=o;else Tt=e,e=o}else Tt=e,e=o;else Tt=e,e=o;else Tt=e,e=o;else Tt=e,e=o;else Tt=e,e=o;else Tt=e,e=o;else Tt=e,e=o;return e}())===o&&(e=function(){var e,r,n,i,a,s,c,u;for(e=Tt,r=[],n=Ft();n!==o;)r.push(n),n=Ft();if(r!==o)if(x.test(t.charAt(Tt))?(n=t.charAt(Tt),Tt++):(n=o,Lt(_)),n!==o)if(j.test(t.charAt(Tt))?(i=t.charAt(Tt),Tt++):(i=o,Lt(k)),i!==o)if(T.test(t.charAt(Tt))?(a=t.charAt(Tt),Tt++):(a=o,Lt(O)),a!==o)if(A.test(t.charAt(Tt))?(s=t.charAt(Tt),Tt++):(s=o,Lt(N)),s!==o){for(c=[],u=Ft();u!==o;)c.push(u),u=Ft();c!==o&&(u=Xt())!==o?(Ot=e,e=r=w(u)):(Tt=e,e=o)}else Tt=e,e=o;else Tt=e,e=o;else Tt=e,e=o;else Tt=e,e=o;else Tt=e,e=o;return e}()),e}())===o)if(e=Tt,(r=function(){var e,t,r;return e=Tt,(t=function(){var e,t;return e=Tt,(t=Vt())!==o&&(Ot=e,r=t,t=fr(r,!0)),(e=t)===o&&(e=Gt())===o&&(e=$t()),e;var r}())!==o&&(r=Ut())!==o?(Ot=e,n=t,i=r,a={},"string"==typeof n&&"[]"!==n?a["@id"]=n:"object"==typeof n&&Object.assign(a,n),i&&Object.assign(a,i),e=t=[a]):(Tt=e,e=o),e===o&&(e=Tt,(t=Ht())!==o?((r=Ut())===o&&(r=null),r!==o?(Ot=e,e=t=function(e,t){var r={};return e&&Object.assign(r,e),t&&Object.assign(r,t),[r]}(t,r)):(Tt=e,e=o)):(Tt=e,e=o)),e;var n,i,a}())!==o){for(n=[],i=Ft();i!==o;)n.push(i),i=Ft();n!==o?(46===t.charCodeAt(Tt)?(i=c,Tt++):(i=o,Lt(u)),i!==o?(Ot=e,e=r):(Tt=e,e=o)):(Tt=e,e=o)}else Tt=e,e=o;return e}function Ft(){var e;return(e=function(){var e;return it.test(t.charAt(Tt))?(e=t.charAt(Tt),Tt++):(e=o,Lt(ot)),e}())===o&&(e=function(){var e,r,n,i;if(e=Tt,35===t.charCodeAt(Tt)?(r="#",Tt++):(r=o,Lt(l)),r!==o){for(n=[],h.test(t.charAt(Tt))?(i=t.charAt(Tt),Tt++):(i=o,Lt(f));i!==o;)n.push(i),h.test(t.charAt(Tt))?(i=t.charAt(Tt),Tt++):(i=o,Lt(f));n!==o?(10===t.charCodeAt(Tt)?(i="\n",Tt++):(i=o,Lt(p)),i!==o?(Ot=e,e=r=d(n)):(Tt=e,e=o)):(Tt=e,e=o)}else Tt=e,e=o;return e}()),e}function Ut(){var e,r,n,i,a,s,c,u,l,h,f,p,d,y;if(e=Tt,(r=Zt())!==o)if((n=Bt())!==o){for(i=[],a=Tt,s=[],c=Ft();c!==o;)s.push(c),c=Ft();for(s!==o?(59===t.charCodeAt(Tt)?(c=";",Tt++):(c=o,Lt(U)),c!==o?(u=Tt,(l=Zt())!==o&&(h=Bt())!==o?(Ot=u,u=l=B(0,0,l,h)):(Tt=u,u=o),u===o&&(u=null),u!==o?(Ot=a,a=s=Z(0,0,u)):(Tt=a,a=o)):(Tt=a,a=o)):(Tt=a,a=o);a!==o;){for(i.push(a),a=Tt,s=[],c=Ft();c!==o;)s.push(c),c=Ft();s!==o?(59===t.charCodeAt(Tt)?(c=";",Tt++):(c=o,Lt(U)),c!==o?(u=Tt,(l=Zt())!==o&&(h=Bt())!==o?(Ot=u,u=l=B(0,0,l,h)):(Tt=u,u=o),u===o&&(u=null),u!==o?(Ot=a,a=s=Z(0,0,u)):(Tt=a,a=o)):(Tt=a,a=o)):(Tt=a,a=o)}i!==o?(Ot=e,f=r,p=n,y={},(d=i).unshift(function(e,t){var r={};return r[e]=t,r}(f,p)),d.forEach((e=>{e&&Object.keys(e).forEach((t=>{e[t].forEach((e=>{"@type"===t&&void 0!==e["@id"]&&(e=e["@id"]),void 0===y[t]?y[t]=e:Array.isArray(y[t])?y[t].push(e):y[t]=[y[t],e]}))}))})),e=r=y):(Tt=e,e=o)}else Tt=e,e=o;else Tt=e,e=o;return e}function Bt(){var e,r,n,i,a,s,c,u,l;if(e=Tt,(r=qt())!==o){for(n=[],i=Tt,a=[],s=Ft();s!==o;)a.push(s),s=Ft();for(a!==o?(44===t.charCodeAt(Tt)?(s=",",Tt++):(s=o,Lt(q)),s!==o&&(c=qt())!==o?(Ot=i,i=a=H(0,c)):(Tt=i,i=o)):(Tt=i,i=o);i!==o;){for(n.push(i),i=Tt,a=[],s=Ft();s!==o;)a.push(s),s=Ft();a!==o?(44===t.charCodeAt(Tt)?(s=",",Tt++):(s=o,Lt(q)),s!==o&&(c=qt())!==o?(Ot=i,i=a=H(0,c)):(Tt=i,i=o)):(Tt=i,i=o)}n!==o?(Ot=e,u=r,(l=n).unshift(u),e=r=l):(Tt=e,e=o)}else Tt=e,e=o;return e}function Zt(){var e,r,n;if(e=Tt,(r=function(){var e,t,r;for(e=Tt,t=[],r=Ft();r!==o;)t.push(r),r=Ft();return t!==o&&(r=$t())!==o?(Ot=e,e=t=r):(Tt=e,e=o),e}())!==o&&(Ot=e),(e=r)===o){for(e=Tt,r=[],n=Ft();n!==o;)r.push(n),n=Ft();r!==o?(97===t.charCodeAt(Tt)?(n="a",Tt++):(n=o,Lt(V)),n!==o?(Ot=e,e=r="@type"):(Tt=e,e=o)):(Tt=e,e=o)}return e}function qt(){var e,r;return(e=function(){var e;return(e=function(){var e,r,n,i,a,s,c;for(e=Tt,r=[],n=Ft();n!==o;)r.push(n),n=Ft();if(r!==o)if((n=zt())!==o){for(i=[],a=Ft();a!==o;)i.push(a),a=Ft();i!==o&&(a=function(){var e,r,n,i,a,s,c,u;if(e=Tt,64===t.charCodeAt(Tt)?(r="@",Tt++):(r=o,Lt(he)),r!==o){if(n=[],fe.test(t.charAt(Tt))?(i=t.charAt(Tt),Tt++):(i=o,Lt(pe)),i!==o)for(;i!==o;)n.push(i),fe.test(t.charAt(Tt))?(i=t.charAt(Tt),Tt++):(i=o,Lt(pe));else n=o;if(n!==o){if(i=[],a=Tt,45===t.charCodeAt(Tt)?(s=de,Tt++):(s=o,Lt(ye)),s!==o){if(c=[],ve.test(t.charAt(Tt))?(u=t.charAt(Tt),Tt++):(u=o,Lt(ge)),u!==o)for(;u!==o;)c.push(u),ve.test(t.charAt(Tt))?(u=t.charAt(Tt),Tt++):(u=o,Lt(ge));else c=o;c!==o?(Ot=a,a=s=me(0,c)):(Tt=a,a=o)}else Tt=a,a=o;for(;a!==o;)if(i.push(a),a=Tt,45===t.charCodeAt(Tt)?(s=de,Tt++):(s=o,Lt(ye)),s!==o){if(c=[],ve.test(t.charAt(Tt))?(u=t.charAt(Tt),Tt++):(u=o,Lt(ge)),u!==o)for(;u!==o;)c.push(u),ve.test(t.charAt(Tt))?(u=t.charAt(Tt),Tt++):(u=o,Lt(ge));else c=o;c!==o?(Ot=a,a=s=me(0,c)):(Tt=a,a=o)}else Tt=a,a=o;i!==o?(Ot=e,l=i,e=r=n.join("")+l.join("")):(Tt=e,e=o)}else Tt=e,e=o}else Tt=e,e=o;var l;return e}())!==o?(Ot=e,e=r={"@value":n,"@language":a}):(Tt=e,e=o)}else Tt=e,e=o;else Tt=e,e=o;if(e===o){for(e=Tt,r=[],n=Ft();n!==o;)r.push(n),n=Ft();if(r!==o)if((n=zt())!==o){for(i=[],a=Ft();a!==o;)i.push(a),a=Ft();if(i!==o)if(t.substr(Tt,2)===J?(a=J,Tt+=2):(a=o,Lt(W)),a!==o){for(s=[],c=Ft();c!==o;)s.push(c),c=Ft();s!==o&&(c=$t())!==o?(Ot=e,e=r=function(e,t){if("http://www.w3.org/2001/XMLSchema#boolean"===t&&"true"===e)return!0;if("http://www.w3.org/2001/XMLSchema#boolean"===t&&"false"===e)return!1;if("http://www.w3.org/2001/XMLSchema#integer"===t)return parseInt(e);if("http://www.w3.org/2001/XMLSchema#double"===t)return parseFloat(e);const r=hr.resolve(t,!0);if(r){const n=t.split(":")[0];if("http://www.w3.org/2001/XMLSchema#boolean"===r&&"true"===e)return hr.decrement(n),!0;if("http://www.w3.org/2001/XMLSchema#boolean"===r&&"false"===e)return hr.decrement(n),!1;if("http://www.w3.org/2001/XMLSchema#integer"===r)return hr.decrement(n),parseInt(e);if("http://www.w3.org/2001/XMLSchema#double"===r)return hr.decrement(n),parseFloat(e)}return{"@value":e,"@type":t}}(n,c)):(Tt=e,e=o)}else Tt=e,e=o;else Tt=e,e=o}else Tt=e,e=o;else Tt=e,e=o;if(e===o){for(e=Tt,r=[],n=Ft();n!==o;)r.push(n),n=Ft();r!==o&&(n=zt())!==o?(Ot=e,e=r=n):(Tt=e,e=o)}}return e}())===o&&(e=function(){var e,r,n;for(e=Tt,r=[],n=Ft();n!==o;)r.push(n),n=Ft();return r!==o?((n=function(){var e,r,n,i,a,s,l,h,f;if(e=Tt,r=Tt,n=Tt,be.test(t.charAt(Tt))?(i=t.charAt(Tt),Tt++):(i=o,Lt(we)),i===o&&(i=null),i!==o){if(a=Tt,s=[],ue.test(t.charAt(Tt))?(l=t.charAt(Tt),Tt++):(l=o,Lt(le)),l!==o)for(;l!==o;)s.push(l),ue.test(t.charAt(Tt))?(l=t.charAt(Tt),Tt++):(l=o,Lt(le));else s=o;if(s!==o)if(46===t.charCodeAt(Tt)?(l=c,Tt++):(l=o,Lt(u)),l!==o){for(h=[],ue.test(t.charAt(Tt))?(f=t.charAt(Tt),Tt++):(f=o,Lt(le));f!==o;)h.push(f),ue.test(t.charAt(Tt))?(f=t.charAt(Tt),Tt++):(f=o,Lt(le));h!==o&&(f=Qt())!==o?a=s=[s,l,h,f]:(Tt=a,a=o)}else Tt=a,a=o;else Tt=a,a=o;if(a===o){if(a=Tt,46===t.charCodeAt(Tt)?(s=c,Tt++):(s=o,Lt(u)),s!==o){if(l=[],ue.test(t.charAt(Tt))?(h=t.charAt(Tt),Tt++):(h=o,Lt(le)),h!==o)for(;h!==o;)l.push(h),ue.test(t.charAt(Tt))?(h=t.charAt(Tt),Tt++):(h=o,Lt(le));else l=o;l!==o&&(h=Qt())!==o?a=s=[s,l,h]:(Tt=a,a=o)}else Tt=a,a=o;if(a===o){if(a=Tt,s=[],ue.test(t.charAt(Tt))?(l=t.charAt(Tt),Tt++):(l=o,Lt(le)),l!==o)for(;l!==o;)s.push(l),ue.test(t.charAt(Tt))?(l=t.charAt(Tt),Tt++):(l=o,Lt(le));else s=o;s!==o&&(l=Qt())!==o?a=s=[s,l]:(Tt=a,a=o)}}a!==o?n=i=[i,a]:(Tt=n,n=o)}else Tt=n,n=o;return(r=n!==o?t.substring(r,Tt):n)!==o&&(Ot=e,p=r,r={"@value":p,"@type":"http://www.w3.org/2001/XMLSchema#double"}),r;var p}())===o&&(n=function(){var e,r,n,i,a,s,l,h;if(e=Tt,r=Tt,n=Tt,be.test(t.charAt(Tt))?(i=t.charAt(Tt),Tt++):(i=o,Lt(we)),i===o&&(i=null),i!==o){for(a=[],ue.test(t.charAt(Tt))?(s=t.charAt(Tt),Tt++):(s=o,Lt(le));s!==o;)a.push(s),ue.test(t.charAt(Tt))?(s=t.charAt(Tt),Tt++):(s=o,Lt(le));if(a!==o)if(46===t.charCodeAt(Tt)?(s=c,Tt++):(s=o,Lt(u)),s!==o){if(l=[],ue.test(t.charAt(Tt))?(h=t.charAt(Tt),Tt++):(h=o,Lt(le)),h!==o)for(;h!==o;)l.push(h),ue.test(t.charAt(Tt))?(h=t.charAt(Tt),Tt++):(h=o,Lt(le));else l=o;l!==o?n=i=[i,a,s,l]:(Tt=n,n=o)}else Tt=n,n=o;else Tt=n,n=o}else Tt=n,n=o;return(r=n!==o?t.substring(r,Tt):n)!==o&&(Ot=e,f=r,r={"@value":f,"@type":"http://www.w3.org/2001/XMLSchema#decimal"}),r;var f}())===o&&(n=function(){var e,r,n,i,a,s;if(e=Tt,r=Tt,n=Tt,be.test(t.charAt(Tt))?(i=t.charAt(Tt),Tt++):(i=o,Lt(we)),i===o&&(i=null),i!==o){if(a=[],ue.test(t.charAt(Tt))?(s=t.charAt(Tt),Tt++):(s=o,Lt(le)),s!==o)for(;s!==o;)a.push(s),ue.test(t.charAt(Tt))?(s=t.charAt(Tt),Tt++):(s=o,Lt(le));else a=o;a!==o?n=i=[i,a]:(Tt=n,n=o)}else Tt=n,n=o;return(r=n!==o?t.substring(r,Tt):n)!==o&&(Ot=e,c=r,r=c.match(/^[0+][0-9]+$/)?{"@value":c,"@type":"http://www.w3.org/2001/XMLSchema#integer"}:parseInt(c)),r;var c}()),n!==o?(Ot=e,e=r=n):(Tt=e,e=o)):(Tt=e,e=o),e}())===o&&(e=function(){var e,r,n;for(e=Tt,r=[],n=Ft();n!==o;)r.push(n),n=Ft();if(r!==o?(t.substr(Tt,4)===Q?(n=Q,Tt+=4):(n=o,Lt(Y)),n!==o?(Ot=e,e=r=!0):(Tt=e,e=o)):(Tt=e,e=o),e===o){for(e=Tt,r=[],n=Ft();n!==o;)r.push(n),n=Ft();r!==o?(t.substr(Tt,5)===K?(n=K,Tt+=5):(n=o,Lt(ee)),n!==o?(Ot=e,e=r=!1):(Tt=e,e=o)):(Tt=e,e=o)}return e}()),e}())===o&&(e=Tt,(r=Vt())!==o&&(Ot=e,r=fr(r,!1)),(e=r)===o&&(e=Tt,(r=Gt())!==o&&(Ot=e,r=function(e){return"[]"===e?{}:{"@id":e}}(r)),(e=r)===o&&(e=Tt,(r=Ht())!==o&&(Ot=e),(e=r)===o&&(e=Tt,(r=$t())!==o&&(Ot=e,r=function(e){return{"@id":e}}(r)),e=r)))),e}function Ht(){var e,r,n,i,a,s;for(e=Tt,r=[],n=Ft();n!==o;)r.push(n),n=Ft();if(r!==o)if(91===t.charCodeAt(Tt)?(n="[",Tt++):(n=o,Lt(z)),n!==o)if((i=Ut())!==o){for(a=[],s=Ft();s!==o;)a.push(s),s=Ft();a!==o?(93===t.charCodeAt(Tt)?(s="]",Tt++):(s=o,Lt($)),s!==o?(Ot=e,e=r=i):(Tt=e,e=o)):(Tt=e,e=o)}else Tt=e,e=o;else Tt=e,e=o;else Tt=e,e=o;return e}function Vt(){var e,r,n,i,a,s;for(e=Tt,r=[],n=Ft();n!==o;)r.push(n),n=Ft();if(r!==o)if(40===t.charCodeAt(Tt)?(n="(",Tt++):(n=o,Lt(G)),n!==o){for(i=[],a=qt();a!==o;)i.push(a),a=qt();if(i!==o){for(a=[],s=Ft();s!==o;)a.push(s),s=Ft();a!==o?(41===t.charCodeAt(Tt)?(s=")",Tt++):(s=o,Lt(X)),s!==o?(Ot=e,e=r={"@list":i}):(Tt=e,e=o)):(Tt=e,e=o)}else Tt=e,e=o}else Tt=e,e=o;else Tt=e,e=o;return e}function zt(){var e,r,n;for(e=Tt,r=[],n=Ft();n!==o;)r.push(n),n=Ft();return r!==o?((n=function(){var e,r,n,i,a,s,c,u;if(e=Tt,t.substr(Tt,3)===Ie?(r=Ie,Tt+=3):(r=o,Lt(Re)),r!==o){for(n=[],Ce.test(t.charAt(Tt))?(i=t.charAt(Tt),Tt++):(i=o,Lt(De)),i===o&&(i=Kt())===o&&(i=Yt());i!==o;)n.push(i),Ce.test(t.charAt(Tt))?(i=t.charAt(Tt),Tt++):(i=o,Lt(De)),i===o&&(i=Kt())===o&&(i=Yt());if(n!==o){if(i=[],a=Tt,t.substr(Tt,2)===Le?(s=Le,Tt+=2):(s=o,Lt(Pe)),s!==o){if(c=[],Ce.test(t.charAt(Tt))?(u=t.charAt(Tt),Tt++):(u=o,Lt(De)),u===o&&(u=Kt())===o&&(u=Yt()),u!==o)for(;u!==o;)c.push(u),Ce.test(t.charAt(Tt))?(u=t.charAt(Tt),Tt++):(u=o,Lt(De)),u===o&&(u=Kt())===o&&(u=Yt());else c=o;c!==o?(Ot=a,a=s=Me(0,c)):(Tt=a,a=o)}else Tt=a,a=o;if(a===o)if(a=Tt,39===t.charCodeAt(Tt)?(s=Ae,Tt++):(s=o,Lt(Ne)),s!==o){if(c=[],Ce.test(t.charAt(Tt))?(u=t.charAt(Tt),Tt++):(u=o,Lt(De)),u===o&&(u=Kt())===o&&(u=Yt()),u!==o)for(;u!==o;)c.push(u),Ce.test(t.charAt(Tt))?(u=t.charAt(Tt),Tt++):(u=o,Lt(De)),u===o&&(u=Kt())===o&&(u=Yt());else c=o;c!==o?(Ot=a,a=s=Fe(0,c)):(Tt=a,a=o)}else Tt=a,a=o;for(;a!==o;){if(i.push(a),a=Tt,t.substr(Tt,2)===Le?(s=Le,Tt+=2):(s=o,Lt(Pe)),s!==o){if(c=[],Ce.test(t.charAt(Tt))?(u=t.charAt(Tt),Tt++):(u=o,Lt(De)),u===o&&(u=Kt())===o&&(u=Yt()),u!==o)for(;u!==o;)c.push(u),Ce.test(t.charAt(Tt))?(u=t.charAt(Tt),Tt++):(u=o,Lt(De)),u===o&&(u=Kt())===o&&(u=Yt());else c=o;c!==o?(Ot=a,a=s=Me(0,c)):(Tt=a,a=o)}else Tt=a,a=o;if(a===o)if(a=Tt,39===t.charCodeAt(Tt)?(s=Ae,Tt++):(s=o,Lt(Ne)),s!==o){if(c=[],Ce.test(t.charAt(Tt))?(u=t.charAt(Tt),Tt++):(u=o,Lt(De)),u===o&&(u=Kt())===o&&(u=Yt()),u!==o)for(;u!==o;)c.push(u),Ce.test(t.charAt(Tt))?(u=t.charAt(Tt),Tt++):(u=o,Lt(De)),u===o&&(u=Kt())===o&&(u=Yt());else c=o;c!==o?(Ot=a,a=s=Fe(0,c)):(Tt=a,a=o)}else Tt=a,a=o}i!==o?(t.substr(Tt,3)===Ie?(a=Ie,Tt+=3):(a=o,Lt(Re)),a!==o?(Ot=e,e=r=Ue(n,i)):(Tt=e,e=o)):(Tt=e,e=o)}else Tt=e,e=o}else Tt=e,e=o;return e}())===o&&(n=function(){var e,r,n,i,a,s,c,u;if(e=Tt,t.substr(Tt,3)===Be?(r=Be,Tt+=3):(r=o,Lt(Ze)),r!==o){for(n=[],qe.test(t.charAt(Tt))?(i=t.charAt(Tt),Tt++):(i=o,Lt(He)),i===o&&(i=Kt())===o&&(i=Yt());i!==o;)n.push(i),qe.test(t.charAt(Tt))?(i=t.charAt(Tt),Tt++):(i=o,Lt(He)),i===o&&(i=Kt())===o&&(i=Yt());if(n!==o){if(i=[],a=Tt,t.substr(Tt,2)===Ve?(s=Ve,Tt+=2):(s=o,Lt(ze)),s!==o){if(c=[],qe.test(t.charAt(Tt))?(u=t.charAt(Tt),Tt++):(u=o,Lt(He)),u===o&&(u=Kt())===o&&(u=Yt()),u!==o)for(;u!==o;)c.push(u),qe.test(t.charAt(Tt))?(u=t.charAt(Tt),Tt++):(u=o,Lt(He)),u===o&&(u=Kt())===o&&(u=Yt());else c=o;c!==o?(Ot=a,a=s=$e(0,c)):(Tt=a,a=o)}else Tt=a,a=o;if(a===o)if(a=Tt,34===t.charCodeAt(Tt)?(s=je,Tt++):(s=o,Lt(ke)),s!==o){if(c=[],qe.test(t.charAt(Tt))?(u=t.charAt(Tt),Tt++):(u=o,Lt(He)),u===o&&(u=Kt())===o&&(u=Yt()),u!==o)for(;u!==o;)c.push(u),qe.test(t.charAt(Tt))?(u=t.charAt(Tt),Tt++):(u=o,Lt(He)),u===o&&(u=Kt())===o&&(u=Yt());else c=o;c!==o?(Ot=a,a=s=Ge(0,c)):(Tt=a,a=o)}else Tt=a,a=o;for(;a!==o;){if(i.push(a),a=Tt,t.substr(Tt,2)===Ve?(s=Ve,Tt+=2):(s=o,Lt(ze)),s!==o){if(c=[],qe.test(t.charAt(Tt))?(u=t.charAt(Tt),Tt++):(u=o,Lt(He)),u===o&&(u=Kt())===o&&(u=Yt()),u!==o)for(;u!==o;)c.push(u),qe.test(t.charAt(Tt))?(u=t.charAt(Tt),Tt++):(u=o,Lt(He)),u===o&&(u=Kt())===o&&(u=Yt());else c=o;c!==o?(Ot=a,a=s=$e(0,c)):(Tt=a,a=o)}else Tt=a,a=o;if(a===o)if(a=Tt,34===t.charCodeAt(Tt)?(s=je,Tt++):(s=o,Lt(ke)),s!==o){if(c=[],qe.test(t.charAt(Tt))?(u=t.charAt(Tt),Tt++):(u=o,Lt(He)),u===o&&(u=Kt())===o&&(u=Yt()),u!==o)for(;u!==o;)c.push(u),qe.test(t.charAt(Tt))?(u=t.charAt(Tt),Tt++):(u=o,Lt(He)),u===o&&(u=Kt())===o&&(u=Yt());else c=o;c!==o?(Ot=a,a=s=Ge(0,c)):(Tt=a,a=o)}else Tt=a,a=o}i!==o?(t.substr(Tt,3)===Be?(a=Be,Tt+=3):(a=o,Lt(Ze)),a!==o?(Ot=e,e=r=Ue(n,i)):(Tt=e,e=o)):(Tt=e,e=o)}else Tt=e,e=o}else Tt=e,e=o;return e}())===o&&(n=function(){var e,r,n,i;if(e=Tt,39===t.charCodeAt(Tt)?(r=Ae,Tt++):(r=o,Lt(Ne)),r!==o){for(n=[],Se.test(t.charAt(Tt))?(i=t.charAt(Tt),Tt++):(i=o,Lt(Ee)),i===o&&(i=Kt())===o&&(i=Yt());i!==o;)n.push(i),Se.test(t.charAt(Tt))?(i=t.charAt(Tt),Tt++):(i=o,Lt(Ee)),i===o&&(i=Kt())===o&&(i=Yt());n!==o?(39===t.charCodeAt(Tt)?(i=Ae,Tt++):(i=o,Lt(Ne)),i!==o?(Ot=e,e=r=d(n)):(Tt=e,e=o)):(Tt=e,e=o)}else Tt=e,e=o;return e}())===o&&(n=function(){var e,r,n,i;if(e=Tt,34===t.charCodeAt(Tt)?(r=je,Tt++):(r=o,Lt(ke)),r!==o){for(n=[],Te.test(t.charAt(Tt))?(i=t.charAt(Tt),Tt++):(i=o,Lt(Oe)),i===o&&(i=Kt())===o&&(i=Yt());i!==o;)n.push(i),Te.test(t.charAt(Tt))?(i=t.charAt(Tt),Tt++):(i=o,Lt(Oe)),i===o&&(i=Kt())===o&&(i=Yt());n!==o?(34===t.charCodeAt(Tt)?(i=je,Tt++):(i=o,Lt(ke)),i!==o?(Ot=e,e=r=d(n)):(Tt=e,e=o)):(Tt=e,e=o)}else Tt=e,e=o;return e}()),n!==o?(Ot=e,e=r=n):(Tt=e,e=o)):(Tt=e,e=o),e}function $t(){var e,r,n;for(e=Tt,r=[],n=Ft();n!==o;)r.push(n),n=Ft();if(r!==o&&(n=Xt())!==o?(Ot=e,e=r=n):(Tt=e,e=o),e===o){for(e=Tt,r=[],n=Ft();n!==o;)r.push(n),n=Ft();r!==o&&(n=function(){var e,r;return(e=function(){var e,r,n;return e=Tt,(r=Jt())!==o&&(n=function(){var e,r,n,i,a,s,l,h;if(e=Tt,(r=tr())===o&&(58===t.charCodeAt(Tt)?(r=oe,Tt++):(r=o,Lt(ae)),r===o&&(ue.test(t.charAt(Tt))?(r=t.charAt(Tt),Tt++):(r=o,Lt(le)),r===o&&(r=ir()))),r!==o){for(n=[],(i=rr())===o&&(58===t.charCodeAt(Tt)?(i=oe,Tt++):(i=o,Lt(ae)),i===o&&(i=ir()));i!==o;)n.push(i),(i=rr())===o&&(58===t.charCodeAt(Tt)?(i=oe,Tt++):(i=o,Lt(ae)),i===o&&(i=ir()));if(n!==o){if(i=[],a=Tt,s=[],46===t.charCodeAt(Tt)?(l=c,Tt++):(l=o,Lt(u)),l!==o)for(;l!==o;)s.push(l),46===t.charCodeAt(Tt)?(l=c,Tt++):(l=o,Lt(u));else s=o;if(s!==o){if(l=[],(h=rr())===o&&(58===t.charCodeAt(Tt)?(h=oe,Tt++):(h=o,Lt(ae)),h===o&&(h=ir())),h!==o)for(;h!==o;)l.push(h),(h=rr())===o&&(58===t.charCodeAt(Tt)?(h=oe,Tt++):(h=o,Lt(ae)),h===o&&(h=ir()));else l=o;l!==o?(Ot=a,a=s=mt(0,0,s,l)):(Tt=a,a=o)}else Tt=a,a=o;for(;a!==o;){if(i.push(a),a=Tt,s=[],46===t.charCodeAt(Tt)?(l=c,Tt++):(l=o,Lt(u)),l!==o)for(;l!==o;)s.push(l),46===t.charCodeAt(Tt)?(l=c,Tt++):(l=o,Lt(u));else s=o;if(s!==o){if(l=[],(h=rr())===o&&(58===t.charCodeAt(Tt)?(h=oe,Tt++):(h=o,Lt(ae)),h===o&&(h=ir())),h!==o)for(;h!==o;)l.push(h),(h=rr())===o&&(58===t.charCodeAt(Tt)?(h=oe,Tt++):(h=o,Lt(ae)),h===o&&(h=ir()));else l=o;l!==o?(Ot=a,a=s=mt(0,0,s,l)):(Tt=a,a=o)}else Tt=a,a=o}i!==o?(Ot=e,f=i,e=r=r+n.join("")+f.join("")):(Tt=e,e=o)}else Tt=e,e=o}else Tt=e,e=o;var f;return e}())!==o?(Ot=e,i=r,a=n,hr.increment(i),e=r=hr.resolve(i+":"+a)):(Tt=e,e=o),e;var i,a}())===o&&(e=Tt,(r=Jt())!==o&&(Ot=e,n=r,r=n+":"),e=r),e;var n}())!==o?(Ot=e,e=r=n):(Tt=e,e=o)}return e}function Gt(){var e,r,n;for(e=Tt,r=[],n=Ft();n!==o;)r.push(n),n=Ft();if(r!==o&&(n=function(){var e,r,n,i,a,s,l,h,f,p;if(e=Tt,r=Tt,t.substr(Tt,2)===se?(n=se,Tt+=2):(n=o,Lt(ce)),n!==o)if((i=tr())===o&&(ue.test(t.charAt(Tt))?(i=t.charAt(Tt),Tt++):(i=o,Lt(le))),i!==o){for(a=[],s=rr();s!==o;)a.push(s),s=rr();if(a!==o){if(s=[],l=Tt,h=[],46===t.charCodeAt(Tt)?(f=c,Tt++):(f=o,Lt(u)),f!==o)for(;f!==o;)h.push(f),46===t.charCodeAt(Tt)?(f=c,Tt++):(f=o,Lt(u));else h=o;if(h!==o){if(f=[],(p=rr())!==o)for(;p!==o;)f.push(p),p=rr();else f=o;f!==o?l=h=[h,f]:(Tt=l,l=o)}else Tt=l,l=o;for(;l!==o;){if(s.push(l),l=Tt,h=[],46===t.charCodeAt(Tt)?(f=c,Tt++):(f=o,Lt(u)),f!==o)for(;f!==o;)h.push(f),46===t.charCodeAt(Tt)?(f=c,Tt++):(f=o,Lt(u));else h=o;if(h!==o){if(f=[],(p=rr())!==o)for(;p!==o;)f.push(p),p=rr();else f=o;f!==o?l=h=[h,f]:(Tt=l,l=o)}else Tt=l,l=o}s!==o?r=n=[n,i,a,s]:(Tt=r,r=o)}else Tt=r,r=o}else Tt=r,r=o;else Tt=r,r=o;return r!==o?t.substring(e,Tt):r}())!==o?(Ot=e,e=r=n):(Tt=e,e=o),e===o){for(e=Tt,r=[],n=Ft();n!==o;)r.push(n),n=Ft();r!==o&&(n=function(){var e,r,n,i;if(e=Tt,91===t.charCodeAt(Tt)?(r="[",Tt++):(r=o,Lt(z)),r!==o){for(n=[],i=Ft();i!==o;)n.push(i),i=Ft();n!==o?(93===t.charCodeAt(Tt)?(i="]",Tt++):(i=o,Lt($)),i!==o?(Ot=e,e=r="[]"):(Tt=e,e=o)):(Tt=e,e=o)}else Tt=e,e=o;return e}())!==o?(Ot=e,e=r=n):(Tt=e,e=o)}return e}function Xt(){var e,r,n,i;if(e=Tt,60===t.charCodeAt(Tt)?(r="<",Tt++):(r=o,Lt(te)),r!==o){for(n=[],re.test(t.charAt(Tt))?(i=t.charAt(Tt),Tt++):(i=o,Lt(ne)),i===o&&(i=Yt());i!==o;)n.push(i),re.test(t.charAt(Tt))?(i=t.charAt(Tt),Tt++):(i=o,Lt(ne)),i===o&&(i=Yt());n!==o?(62===t.charCodeAt(Tt)?(i=">",Tt++):(i=o,Lt(ie)),i!==o?(Ot=e,e=r=function(e){const t=e.map((e=>65536<=e.codePointAt(0)&&e.codePointAt(0)<=983039?"a":1===e.length?e:6===e.length?String.fromCharCode("0x"+e.substring(2)):10===e.length?String.fromCodePoint("0x"+e.substring(2)):e)).join("");if(t.match(/^[^\u0000-\u0020<>"{}|^`\\]*$/)){var r=e.join("");try{return hr.resolve(r)}catch(e){Et("Invalid IRIREF "+r)}}else Et("Invalid IRIREF "+e.join("")+" / "+t)}(n)):(Tt=e,e=o)):(Tt=e,e=o)}else Tt=e,e=o;return e}function Jt(){var e,r,n,i;return e=Tt,(r=nr())===o&&(r=null),r!==o?(58===t.charCodeAt(Tt)?(n=oe,Tt++):(n=o,Lt(ae)),n!==o?(Ot=e,i=(i=r)||"0",!1===hr.hasPrefix(i)&&Et("undefined prefix "+i),e=r=i):(Tt=e,e=o)):(Tt=e,e=o),e}function Wt(){var e,r,n;return e=Tt,(r=nr())===o&&(r=null),r!==o?(58===t.charCodeAt(Tt)?(n=oe,Tt++):(n=o,Lt(ae)),n!==o?(Ot=e,e=r=r||""):(Tt=e,e=o)):(Tt=e,e=o),e}function Qt(){var e,r,n,i,a,s;if(e=Tt,r=Tt,xe.test(t.charAt(Tt))?(n=t.charAt(Tt),Tt++):(n=o,Lt(_e)),n!==o)if(be.test(t.charAt(Tt))?(i=t.charAt(Tt),Tt++):(i=o,Lt(we)),i===o&&(i=null),i!==o){if(a=[],ue.test(t.charAt(Tt))?(s=t.charAt(Tt),Tt++):(s=o,Lt(le)),s!==o)for(;s!==o;)a.push(s),ue.test(t.charAt(Tt))?(s=t.charAt(Tt),Tt++):(s=o,Lt(le));else a=o;a!==o?r=n=[n,i,a]:(Tt=r,r=o)}else Tt=r,r=o;else Tt=r,r=o;return r!==o?t.substring(e,Tt):r}function Yt(){var e,r,n,i,a,s,c,u,l,h,f,p;return e=Tt,"\\U"===t.substr(Tt,2)?(r="\\U",Tt+=2):(r=o,Lt(Xe)),r!==o?(n=Tt,(i=or())!==o&&(a=or())!==o&&(s=or())!==o&&(c=or())!==o&&(u=or())!==o&&(l=or())!==o&&(h=or())!==o&&(f=or())!==o?n=i=[i,a,s,c,u,l,h,f]:(Tt=n,n=o),n!==o?(Ot=e,p=n,e=r=String.fromCodePoint(parseInt(p.join(""),16))):(Tt=e,e=o)):(Tt=e,e=o),e===o&&(e=Tt,"\\u"===t.substr(Tt,2)?(r="\\u",Tt+=2):(r=o,Lt(Je)),r!==o?(n=Tt,(i=or())!==o&&(a=or())!==o&&(s=or())!==o&&(c=or())!==o?n=i=[i,a,s,c]:(Tt=n,n=o),n!==o?(Ot=e,e=r=function(e){return String.fromCharCode(parseInt(e.join(""),16))}(n)):(Tt=e,e=o)):(Tt=e,e=o)),e}function Kt(){var e,r;return e=Tt,"\\t"===t.substr(Tt,2)?(r="\\t",Tt+=2):(r=o,Lt(We)),r!==o&&(Ot=e,r="\t"),(e=r)===o&&(e=Tt,"\\b"===t.substr(Tt,2)?(r="\\b",Tt+=2):(r=o,Lt(Qe)),r!==o&&(Ot=e,r="\b"),(e=r)===o&&(e=Tt,"\\n"===t.substr(Tt,2)?(r="\\n",Tt+=2):(r=o,Lt(Ye)),r!==o&&(Ot=e,r="\n"),(e=r)===o&&(e=Tt,"\\r"===t.substr(Tt,2)?(r="\\r",Tt+=2):(r=o,Lt(Ke)),r!==o&&(Ot=e,r="\r"),(e=r)===o&&(e=Tt,"\\f"===t.substr(Tt,2)?(r="\\f",Tt+=2):(r=o,Lt(et)),r!==o&&(Ot=e,r="\f"),(e=r)===o&&(e=Tt,'\\"'===t.substr(Tt,2)?(r='\\"',Tt+=2):(r=o,Lt(tt)),r!==o&&(Ot=e,r='"'),(e=r)===o&&(e=Tt,"\\'"===t.substr(Tt,2)?(r="\\'",Tt+=2):(r=o,Lt(rt)),r!==o&&(Ot=e,r="'"),(e=r)===o&&(e=Tt,"\\\\"===t.substr(Tt,2)?(r="\\\\",Tt+=2):(r=o,Lt(nt)),r!==o&&(Ot=e,r="\\"),e=r))))))),e}function er(){var e,r,n;return e=Tt,at.test(t.charAt(Tt))?(r=t.charAt(Tt),Tt++):(r=o,Lt(st)),r!==o?(ct.test(t.charAt(Tt))?(n=t.charAt(Tt),Tt++):(n=o,Lt(ut)),n!==o?(Ot=e,e=r=r+n):(Tt=e,e=o)):(Tt=e,e=o),e===o&&(lt.test(t.charAt(Tt))?(e=t.charAt(Tt),Tt++):(e=o,Lt(ht))),e}function tr(){var e;return(e=er())===o&&(95===t.charCodeAt(Tt)?(e="_",Tt++):(e=o,Lt(ft))),e}function rr(){var e;return(e=tr())===o&&(45===t.charCodeAt(Tt)?(e=de,Tt++):(e=o,Lt(ye)),e===o&&(ue.test(t.charAt(Tt))?(e=t.charAt(Tt),Tt++):(e=o,Lt(le)),e===o&&(183===t.charCodeAt(Tt)?(e="·",Tt++):(e=o,Lt(pt)),e===o&&(dt.test(t.charAt(Tt))?(e=t.charAt(Tt),Tt++):(e=o,Lt(yt)),e===o&&(vt.test(t.charAt(Tt))?(e=t.charAt(Tt),Tt++):(e=o,Lt(gt))))))),e}function nr(){var e,r,n,i,a,s,l,h,f;if(e=Tt,r=Tt,(n=er())!==o){for(i=[],a=rr();a!==o;)i.push(a),a=rr();if(i!==o){if(a=[],s=Tt,l=[],46===t.charCodeAt(Tt)?(h=c,Tt++):(h=o,Lt(u)),h!==o)for(;h!==o;)l.push(h),46===t.charCodeAt(Tt)?(h=c,Tt++):(h=o,Lt(u));else l=o;if(l!==o){if(h=[],(f=rr())!==o)for(;f!==o;)h.push(f),f=rr();else h=o;h!==o?s=l=[l,h]:(Tt=s,s=o)}else Tt=s,s=o;for(;s!==o;){if(a.push(s),s=Tt,l=[],46===t.charCodeAt(Tt)?(h=c,Tt++):(h=o,Lt(u)),h!==o)for(;h!==o;)l.push(h),46===t.charCodeAt(Tt)?(h=c,Tt++):(h=o,Lt(u));else l=o;if(l!==o){if(h=[],(f=rr())!==o)for(;f!==o;)h.push(f),f=rr();else h=o;h!==o?s=l=[l,h]:(Tt=s,s=o)}else Tt=s,s=o}a!==o?r=n=[n,i,a]:(Tt=r,r=o)}else Tt=r,r=o}else Tt=r,r=o;return r!==o?t.substring(e,Tt):r}function ir(){var e;return(e=function(){var e,r,n,i,a;return e=Tt,r=Tt,37===t.charCodeAt(Tt)?(n="%",Tt++):(n=o,Lt(bt)),n!==o&&(i=or())!==o&&(a=or())!==o?r=n=[n,i,a]:(Tt=r,r=o),r!==o?t.substring(e,Tt):r}())===o&&(e=function(){var e,r,n;return e=Tt,92===t.charCodeAt(Tt)?(r="\\",Tt++):(r=o,Lt(_t)),r!==o?(jt.test(t.charAt(Tt))?(n=t.charAt(Tt),Tt++):(n=o,Lt(kt)),n!==o?(Ot=e,e=r=n):(Tt=e,e=o)):(Tt=e,e=o),e}()),e}function or(){var e;return wt.test(t.charAt(Tt))?(e=t.charAt(Tt),Tt++):(e=o,Lt(xt)),e}var ar,sr,cr,ur=new Function("try {return this===window;}catch(e){ return false;}")()?window.URL:r(4044).URL,lr=function(e){return e.match(/^[a-z](.*?):(.+?)/g)},hr={base:[],data:{},addBase:function(e){if(0===hr.base.length)return void hr.base.push(e);const t=hr.base[hr.base.length-1];t!==e&&hr.base.push(new ur(e,t).toString())},addPrefix:function(e,t){const r=hr.data[e];void 0===r?hr.data[e]=[{uri:t,count:0}]:r[r.length-1].uri!==t&&r.push({uri:t,count:0})},hasPrefix:function(e){return void 0!==this.data[e]},resolve:function(e,t){const r=Object.keys(hr.data).find((t=>0===e.indexOf(t+":")));if(void 0!==r){const n=hr.data[r];if(1===n.length&&!0!==t&&lr(n[0].uri))return e;const i=n[n.length-1].uri;return e.replace(r+":",i)}var i=0===hr.base.length?n.baseIRI:hr.base[hr.base.length-1];return!i||e.match(/^(http:|https:|urn:|file:)/)?e:0===e.indexOf("//")&&i?i.split("//")[0]+e:new ur(e,i).toString()},increment:function(e){const t=hr.data[e];void 0!==t&&t[t.length-1].count++},decrement:function(e){const t=hr.data[e];void 0!==t&&t[t.length-1].count--},toJSON:function(){const e={};return hr.base.length>0&&(void 0===e["@context"]&&(e["@context"]={}),e["@context"]["@base"]=hr.base[0]),Object.keys(hr.data).forEach((t=>{const r=hr.data[t][0];"http://www.w3.org/2001/XMLSchema#"===r.uri&&r.count<1||lr(r.uri)&&(void 0===e["@context"]&&(e["@context"]={}),e["@context"][t]=r.uri)})),e}};function fr(e,t){if(void 0===e["@list"])return e;if(!t&&!e["@list"].find((e=>void 0!==e["@list"])))return e;if(0===e["@list"].length)return{"@id":"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"};var r={},n=null;return e["@list"].forEach((e=>{null===n?n=r:(n["http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"]={},n=n["http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"]),n["http://www.w3.org/1999/02/22-rdf-syntax-ns#first"]=fr(e,!0),n["http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"]={"@id":"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"}})),r}if((i=s())!==o&&Tt===t.length)return i;throw i!==o&&Tt<t.length&&Lt({type:"end"}),ar=St,sr=Nt<t.length?t.charAt(Nt):null,cr=Nt<t.length?Dt(Nt,Nt+1):Dt(Nt,Nt),new e(e.buildMessage(ar,sr),ar,sr,cr)}}})?n.apply(t,[]):n)||(e.exports=i)},6118:(e,t,r)=>{"use strict";var n=r(2530),i=r(292);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var a,s,c=r(8619).codes,u=c.ERR_AMBIGUOUS_ARGUMENT,l=c.ERR_INVALID_ARG_TYPE,h=c.ERR_INVALID_ARG_VALUE,f=c.ERR_INVALID_RETURN_VALUE,p=c.ERR_MISSING_ARGS,d=r(6979),y=r(5663).inspect,v=r(5663).types,g=v.isPromise,m=v.isRegExp,b=Object.assign?Object.assign:r(1662).assign,w=Object.is?Object.is:r(7402);function x(){var e=r(1667);a=e.isDeepEqual,s=e.isDeepStrictEqual}new Map;var _=!1,j=e.exports=A,k={};function T(e){if(e.message instanceof Error)throw e.message;throw new d(e)}function O(e,t,r,n){if(!r){var i=!1;if(0===t)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var o=new d({actual:r,expected:!0,message:n,operator:"==",stackStartFn:e});throw o.generatedMessage=i,o}}function A(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];O.apply(void 0,[A,t.length].concat(t))}j.fail=function e(t,r,o,a,s){var c,u=arguments.length;if(0===u)c="Failed";else if(1===u)o=t,t=void 0;else{if(!1===_){_=!0;var l=n.emitWarning?n.emitWarning:i.warn.bind(i);l("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}2===u&&(a="!=")}if(o instanceof Error)throw o;var h={actual:t,expected:r,operator:void 0===a?"fail":a,stackStartFn:s||e};void 0!==o&&(h.message=o);var f=new d(h);throw c&&(f.message=c,f.generatedMessage=!0),f},j.AssertionError=d,j.ok=A,j.equal=function e(t,r,n){if(arguments.length<2)throw new p("actual","expected");t!=r&&T({actual:t,expected:r,message:n,operator:"==",stackStartFn:e})},j.notEqual=function e(t,r,n){if(arguments.length<2)throw new p("actual","expected");t==r&&T({actual:t,expected:r,message:n,operator:"!=",stackStartFn:e})},j.deepEqual=function e(t,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===a&&x(),a(t,r)||T({actual:t,expected:r,message:n,operator:"deepEqual",stackStartFn:e})},j.notDeepEqual=function e(t,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===a&&x(),a(t,r)&&T({actual:t,expected:r,message:n,operator:"notDeepEqual",stackStartFn:e})},j.deepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===a&&x(),s(t,r)||T({actual:t,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:e})},j.notDeepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===a&&x(),s(t,r)&&T({actual:t,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:e})},j.strictEqual=function e(t,r,n){if(arguments.length<2)throw new p("actual","expected");w(t,r)||T({actual:t,expected:r,message:n,operator:"strictEqual",stackStartFn:e})},j.notStrictEqual=function e(t,r,n){if(arguments.length<2)throw new p("actual","expected");w(t,r)&&T({actual:t,expected:r,message:n,operator:"notStrictEqual",stackStartFn:e})};var N=function e(t,r,n){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r.forEach((function(e){e in t&&(void 0!==n&&"string"==typeof n[e]&&m(t[e])&&t[e].test(n[e])?i[e]=n[e]:i[e]=t[e])}))};function S(e,t,r,n,i,o){if(!(r in e)||!s(e[r],t[r])){if(!n){var a=new N(e,i),c=new N(t,i,e),u=new d({actual:a,expected:c,operator:"deepStrictEqual",stackStartFn:o});throw u.actual=e,u.expected=t,u.operator=o.name,u}T({actual:e,expected:t,message:n,operator:o.name,stackStartFn:o})}}function E(e,t,r,n){if("function"!=typeof t){if(m(t))return t.test(e);if(2===arguments.length)throw new l("expected",["Function","RegExp"],t);if("object"!==o(e)||null===e){var i=new d({actual:e,expected:t,message:r,operator:"deepStrictEqual",stackStartFn:n});throw i.operator=n.name,i}var s=Object.keys(t);if(t instanceof Error)s.push("name","message");else if(0===s.length)throw new h("error",t,"may not be an empty object");return void 0===a&&x(),s.forEach((function(i){"string"==typeof e[i]&&m(t[i])&&t[i].test(e[i])||S(e,t,i,r,s,n)})),!0}return void 0!==t.prototype&&e instanceof t||!Error.isPrototypeOf(t)&&!0===t.call({},e)}function I(e){if("function"!=typeof e)throw new l("fn","Function",e);try{e()}catch(e){return e}return k}function R(e){return g(e)||null!==e&&"object"===o(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function C(e){return Promise.resolve().then((function(){var t;if("function"==typeof e){if(!R(t=e()))throw new f("instance of Promise","promiseFn",t)}else{if(!R(e))throw new l("promiseFn",["Function","Promise"],e);t=e}return Promise.resolve().then((function(){return t})).then((function(){return k})).catch((function(e){return e}))}))}function D(e,t,r,n){if("string"==typeof r){if(4===arguments.length)throw new l("error",["Object","Error","Function","RegExp"],r);if("object"===o(t)&&null!==t){if(t.message===r)throw new u("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===r)throw new u("error/message",'The error "'.concat(t,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==o(r)&&"function"!=typeof r)throw new l("error",["Object","Error","Function","RegExp"],r);if(t===k){var i="";r&&r.name&&(i+=" (".concat(r.name,")")),i+=n?": ".concat(n):".";var a="rejects"===e.name?"rejection":"exception";T({actual:void 0,expected:r,operator:e.name,message:"Missing expected ".concat(a).concat(i),stackStartFn:e})}if(r&&!E(t,r,n,e))throw t}function L(e,t,r,n){if(t!==k){if("string"==typeof r&&(n=r,r=void 0),!r||E(t,r)){var i=n?": ".concat(n):".",o="doesNotReject"===e.name?"rejection":"exception";T({actual:t,expected:r,operator:e.name,message:"Got unwanted ".concat(o).concat(i,"\n")+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:e})}throw t}}function P(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];O.apply(void 0,[P,t.length].concat(t))}j.throws=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];D.apply(void 0,[e,I(t)].concat(n))},j.rejects=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return C(t).then((function(t){return D.apply(void 0,[e,t].concat(n))}))},j.doesNotThrow=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];L.apply(void 0,[e,I(t)].concat(n))},j.doesNotReject=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return C(t).then((function(t){return L.apply(void 0,[e,t].concat(n))}))},j.ifError=function e(t){if(null!=t){var r="ifError got unwanted exception: ";"object"===o(t)&&"string"==typeof t.message?0===t.message.length&&t.constructor?r+=t.constructor.name:r+=t.message:r+=y(t);var n=new d({actual:t,expected:null,operator:"ifError",message:r,stackStartFn:e}),i=t.stack;if("string"==typeof i){var a=i.split("\n");a.shift();for(var s=n.stack.split("\n"),c=0;c<a.length;c++){var u=s.indexOf(a[c]);if(-1!==u){s=s.slice(0,u);break}}n.stack="".concat(s.join("\n"),"\n").concat(a.join("\n"))}throw n}},j.strict=b(P,j,{equal:j.strictEqual,deepEqual:j.deepStrictEqual,notEqual:j.notStrictEqual,notDeepEqual:j.notDeepStrictEqual}),j.strict.strict=j.strict},6979:(e,t,r)=>{"use strict";var n=r(2530);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function a(e,t){return!t||"object"!==p(t)&&"function"!=typeof t?s(e):t}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e){var t="function"==typeof Map?new Map:void 0;return c=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return l(e,arguments,f(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),h(n,e)},c(e)}function u(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function l(e,t,r){return l=u()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&h(i,r.prototype),i},l.apply(null,arguments)}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}var d=r(5663).inspect,y=r(8619).codes.ERR_INVALID_ARG_TYPE;function v(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}var g="",m="",b="",w="",x={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function _(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach((function(t){r[t]=e[t]})),Object.defineProperty(r,"message",{value:e.message}),r}function j(e){return d(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var k=function(e){function t(e){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),"object"!==p(e)||null===e)throw new y("options","Object",e);var i=e.message,o=e.operator,c=e.stackStartFn,u=e.actual,l=e.expected,h=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=i)r=a(this,f(t).call(this,String(i)));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(g="",m="",w="",b=""):(g="",m="",w="",b="")),"object"===p(u)&&null!==u&&"object"===p(l)&&null!==l&&"stack"in u&&u instanceof Error&&"stack"in l&&l instanceof Error&&(u=_(u),l=_(l)),"deepStrictEqual"===o||"strictEqual"===o)r=a(this,f(t).call(this,function(e,t,r){var i="",o="",a=0,s="",c=!1,u=j(e),l=u.split("\n"),h=j(t).split("\n"),f=0,d="";if("strictEqual"===r&&"object"===p(e)&&"object"===p(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===l.length&&1===h.length&&l[0]!==h[0]){var y=l[0].length+h[0].length;if(y<=10){if(!("object"===p(e)&&null!==e||"object"===p(t)&&null!==t||0===e&&0===t))return"".concat(x[r],"\n\n")+"".concat(l[0]," !== ").concat(h[0],"\n")}else if("strictEqualObject"!==r&&y<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;l[0][f]===h[0][f];)f++;f>2&&(d="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",f),"^"),f=0)}}for(var _=l[l.length-1],k=h[h.length-1];_===k&&(f++<2?s="\n ".concat(_).concat(s):i=_,l.pop(),h.pop(),0!==l.length&&0!==h.length);)_=l[l.length-1],k=h[h.length-1];var T=Math.max(l.length,h.length);if(0===T){var O=u.split("\n");if(O.length>30)for(O[26]="".concat(g,"...").concat(w);O.length>27;)O.pop();return"".concat(x.notIdentical,"\n\n").concat(O.join("\n"),"\n")}f>3&&(s="\n".concat(g,"...").concat(w).concat(s),c=!0),""!==i&&(s="\n ".concat(i).concat(s),i="");var A=0,N=x[r]+"\n".concat(m,"+ actual").concat(w," ").concat(b,"- expected").concat(w),S=" ".concat(g,"...").concat(w," Lines skipped");for(f=0;f<T;f++){var E=f-a;if(l.length<f+1)E>1&&f>2&&(E>4?(o+="\n".concat(g,"...").concat(w),c=!0):E>3&&(o+="\n ".concat(h[f-2]),A++),o+="\n ".concat(h[f-1]),A++),a=f,i+="\n".concat(b,"-").concat(w," ").concat(h[f]),A++;else if(h.length<f+1)E>1&&f>2&&(E>4?(o+="\n".concat(g,"...").concat(w),c=!0):E>3&&(o+="\n ".concat(l[f-2]),A++),o+="\n ".concat(l[f-1]),A++),a=f,o+="\n".concat(m,"+").concat(w," ").concat(l[f]),A++;else{var I=h[f],R=l[f],C=R!==I&&(!v(R,",")||R.slice(0,-1)!==I);C&&v(I,",")&&I.slice(0,-1)===R&&(C=!1,R+=","),C?(E>1&&f>2&&(E>4?(o+="\n".concat(g,"...").concat(w),c=!0):E>3&&(o+="\n ".concat(l[f-2]),A++),o+="\n ".concat(l[f-1]),A++),a=f,o+="\n".concat(m,"+").concat(w," ").concat(R),i+="\n".concat(b,"-").concat(w," ").concat(I),A+=2):(o+=i,i="",1!==E&&0!==f||(o+="\n ".concat(R),A++))}if(A>20&&f<T-2)return"".concat(N).concat(S,"\n").concat(o,"\n").concat(g,"...").concat(w).concat(i,"\n")+"".concat(g,"...").concat(w)}return"".concat(N).concat(c?S:"","\n").concat(o).concat(i).concat(s).concat(d)}(u,l,o)));else if("notDeepStrictEqual"===o||"notStrictEqual"===o){var d=x[o],k=j(u).split("\n");if("notStrictEqual"===o&&"object"===p(u)&&null!==u&&(d=x.notStrictEqualObject),k.length>30)for(k[26]="".concat(g,"...").concat(w);k.length>27;)k.pop();r=1===k.length?a(this,f(t).call(this,"".concat(d," ").concat(k[0]))):a(this,f(t).call(this,"".concat(d,"\n\n").concat(k.join("\n"),"\n")))}else{var T=j(u),O="",A=x[o];"notDeepEqual"===o||"notEqual"===o?(T="".concat(x[o],"\n\n").concat(T)).length>1024&&(T="".concat(T.slice(0,1021),"...")):(O="".concat(j(l)),T.length>512&&(T="".concat(T.slice(0,509),"...")),O.length>512&&(O="".concat(O.slice(0,509),"...")),"deepEqual"===o||"equal"===o?T="".concat(A,"\n\n").concat(T,"\n\nshould equal\n\n"):O=" ".concat(o," ").concat(O)),r=a(this,f(t).call(this,"".concat(T).concat(O)))}return Error.stackTraceLimit=h,r.generatedMessage=!i,Object.defineProperty(s(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=u,r.expected=l,r.operator=o,Error.captureStackTrace&&Error.captureStackTrace(s(r),c),r.stack,r.name="AssertionError",a(r)}var r,c;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(t,e),r=t,c=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:d.custom,value:function(e,t){return d(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){i(e,t,r[t])}))}return e}({},t,{customInspect:!1,depth:0}))}}],c&&o(r.prototype,c),t}(c(Error));e.exports=k},8619:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}var a,s,c={};function u(e,t,r){r||(r=Error);var a=function(r){function a(r,o,s){var c;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),c=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,i(a).call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,o,s))),c.code=e,c}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(a,r),a}(r);c[e]=a}function l(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}u("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),u("ERR_INVALID_ARG_TYPE",(function(e,t,i){var o,s,c,u,h;if(void 0===a&&(a=r(6118)),a("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(s="not ",t.substr(0,s.length)===s)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))c="The ".concat(e," ").concat(o," ").concat(l(t,"type"));else{var f=("number"!=typeof h&&(h=0),h+".".length>(u=e).length||-1===u.indexOf(".",h)?"argument":"property");c='The "'.concat(e,'" ').concat(f," ").concat(o," ").concat(l(t,"type"))}return c+". Received type ".concat(n(i))}),TypeError),u("ERR_INVALID_ARG_VALUE",(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===s&&(s=r(5663));var i=s.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(i)}),TypeError,RangeError),u("ERR_INVALID_RETURN_VALUE",(function(e,t,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")}),TypeError),u("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];void 0===a&&(a=r(6118)),a(t.length>0,"At least one arg needs to be specified");var i="The ",o=t.length;switch(t=t.map((function(e){return'"'.concat(e,'"')})),o){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,o-1).join(", "),i+=", and ".concat(t[o-1]," arguments")}return"".concat(i," must be specified")}),TypeError),e.exports.codes=c},1667:(e,t,r)=>{"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var o=void 0!==/a/g.flags,a=function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t},s=function(e){var t=[];return e.forEach((function(e,r){return t.push([r,e])})),t},c=Object.is?Object.is:r(7402),u=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},l=Number.isNaN?Number.isNaN:r(8622);function h(e){return e.call.bind(e)}var f=h(Object.prototype.hasOwnProperty),p=h(Object.prototype.propertyIsEnumerable),d=h(Object.prototype.toString),y=r(5663).types,v=y.isAnyArrayBuffer,g=y.isArrayBufferView,m=y.isDate,b=y.isMap,w=y.isRegExp,x=y.isSet,_=y.isNativeError,j=y.isBoxedPrimitive,k=y.isNumberObject,T=y.isStringObject,O=y.isBooleanObject,A=y.isBigIntObject,N=y.isSymbolObject,S=y.isFloat32Array,E=y.isFloat64Array;function I(e){if(0===e.length||e.length>10)return!0;for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(r<48||r>57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function R(e){return Object.keys(e).filter(I).concat(u(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function C(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function D(e,t,r,n){if(e===t)return 0!==e||!r||c(e,t);if(r){if("object"!==i(e))return"number"==typeof e&&l(e)&&l(t);if("object"!==i(t)||null===e||null===t)return!1;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||"object"!==i(e))return(null===t||"object"!==i(t))&&e==t;if(null===t||"object"!==i(t))return!1}var a,s,u,h,f=d(e);if(f!==d(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var p=R(e),y=R(t);return p.length===y.length&&P(e,t,r,n,1,p)}if("[object Object]"===f&&(!b(e)&&b(t)||!x(e)&&x(t)))return!1;if(m(e)){if(!m(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(w(e)){if(!w(t)||(u=e,h=t,!(o?u.source===h.source&&u.flags===h.flags:RegExp.prototype.toString.call(u)===RegExp.prototype.toString.call(h))))return!1}else if(_(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(g(e)){if(r||!S(e)&&!E(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===C(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}(e,t))return!1}else if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(e,t))return!1;var I=R(e),D=R(t);return I.length===D.length&&P(e,t,r,n,0,I)}if(x(e))return!(!x(t)||e.size!==t.size)&&P(e,t,r,n,2);if(b(e))return!(!b(t)||e.size!==t.size)&&P(e,t,r,n,3);if(v(e)){if(s=t,(a=e).byteLength!==s.byteLength||0!==C(new Uint8Array(a),new Uint8Array(s)))return!1}else if(j(e)&&!function(e,t){return k(e)?k(t)&&c(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):T(e)?T(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):O(e)?O(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):A(e)?A(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):N(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}(e,t))return!1}return P(e,t,r,n,0)}function L(e,t){return t.filter((function(t){return p(e,t)}))}function P(e,t,r,n,i,o){if(5===arguments.length){o=Object.keys(e);var a=Object.keys(t);if(o.length!==a.length)return!1}for(var s=0;s<o.length;s++)if(!f(t,o[s]))return!1;if(r&&5===arguments.length){var c=u(e);if(0!==c.length){var l=0;for(s=0;s<c.length;s++){var h=c[s];if(p(e,h)){if(!p(t,h))return!1;o.push(h),l++}else if(p(t,h))return!1}var d=u(t);if(c.length!==d.length&&L(t,d).length!==l)return!1}else{var y=u(t);if(0!==y.length&&0!==L(t,y).length)return!1}}if(0===o.length&&(0===i||1===i&&0===e.length||0===e.size))return!0;if(void 0===n)n={val1:new Map,val2:new Map,position:0};else{var v=n.val1.get(e);if(void 0!==v){var g=n.val2.get(t);if(void 0!==g)return v===g}n.position++}n.val1.set(e,n.position),n.val2.set(t,n.position);var m=q(e,t,r,o,n,i);return n.val1.delete(e),n.val2.delete(t),m}function M(e,t,r,n){for(var i=a(e),o=0;o<i.length;o++){var s=i[o];if(D(t,s,r,n))return e.delete(s),!0}return!1}function F(e){switch(i(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e=+e;case"number":if(l(e))return!1}return!0}function U(e,t,r){var n=F(r);return null!=n?n:t.has(n)&&!e.has(n)}function B(e,t,r,n,i){var o=F(r);if(null!=o)return o;var a=t.get(o);return!(void 0===a&&!t.has(o)||!D(n,a,!1,i))&&!e.has(o)&&D(n,a,!1,i)}function Z(e,t,r,n,i,o){for(var s=a(e),c=0;c<s.length;c++){var u=s[c];if(D(r,u,i,o)&&D(n,t.get(u),i,o))return e.delete(u),!0}return!1}function q(e,t,r,o,c,u){var l=0;if(2===u){if(!function(e,t,r,n){for(var o=null,s=a(e),c=0;c<s.length;c++){var u=s[c];if("object"===i(u)&&null!==u)null===o&&(o=new Set),o.add(u);else if(!t.has(u)){if(r)return!1;if(!U(e,t,u))return!1;null===o&&(o=new Set),o.add(u)}}if(null!==o){for(var l=a(t),h=0;h<l.length;h++){var f=l[h];if("object"===i(f)&&null!==f){if(!M(o,f,r,n))return!1}else if(!r&&!e.has(f)&&!M(o,f,r,n))return!1}return 0===o.size}return!0}(e,t,r,c))return!1}else if(3===u){if(!function(e,t,r,o){for(var a=null,c=s(e),u=0;u<c.length;u++){var l=n(c[u],2),h=l[0],f=l[1];if("object"===i(h)&&null!==h)null===a&&(a=new Set),a.add(h);else{var p=t.get(h);if(void 0===p&&!t.has(h)||!D(f,p,r,o)){if(r)return!1;if(!B(e,t,h,f,o))return!1;null===a&&(a=new Set),a.add(h)}}}if(null!==a){for(var d=s(t),y=0;y<d.length;y++){var v=n(d[y],2),g=(h=v[0],v[1]);if("object"===i(h)&&null!==h){if(!Z(a,e,h,g,r,o))return!1}else if(!(r||e.has(h)&&D(e.get(h),g,!1,o)||Z(a,e,h,g,!1,o)))return!1}return 0===a.size}return!0}(e,t,r,c))return!1}else if(1===u)for(;l<e.length;l++){if(!f(e,l)){if(f(t,l))return!1;for(var h=Object.keys(e);l<h.length;l++){var p=h[l];if(!f(t,p)||!D(e[p],t[p],r,c))return!1}return h.length===Object.keys(t).length}if(!f(t,l)||!D(e[l],t[l],r,c))return!1}for(l=0;l<o.length;l++){var d=o[l];if(!D(e[d],t[d],r,c))return!1}return!0}e.exports={isDeepEqual:function(e,t){return D(e,t,!1)},isDeepStrictEqual:function(e,t){return D(e,t,!0)}}},5155:(e,t)=>{"use strict";t.byteLength=function(e){var t=c(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=c(e),a=o[0],s=o[1],u=new i(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),l=0,h=s>0?a-4:a;for(r=0;r<h;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;return 2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[l++]=255&t),1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=16383,s=0,c=n-i;s<c;s+=a)o.push(u(e,s,s+a>c?c:s+a));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a<s;++a)r[a]=o[a],n[o.charCodeAt(a)]=a;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var i,o,a=[],s=t;s<n;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},2486:(e,t,r)=>{"use strict";var n=r(292);const i=r(5155),o=r(4525),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.lW=u,t.h2=50;const s=2147483647;function c(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|v(e,t);let n=c(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(W(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return p(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(W(e,ArrayBuffer)||e&&W(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(W(e,SharedArrayBuffer)||e&&W(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|y(e.length),r=c(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Q(e.length)?c(0):p(e):"Buffer"===e.type&&Array.isArray(e.data)?p(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return h(e),c(e<0?0:0|y(e))}function p(e){const t=e.length<0?0:0|y(e.length),r=c(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function y(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function v(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||W(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return X(e).length;default:if(i)return n?-1:G(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,r);case"utf8":case"utf-8":return A(this,t,r);case"ascii":return S(this,t,r);case"latin1":case"binary":return E(this,t,r);case"base64":return O(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Q(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,i){let o,a=1,s=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let n=-1;for(o=r;o<s;o++)if(u(e,o)===u(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===c)return n*a}else-1!==n&&(o-=o-n),n=-1}else for(r+c>s&&(r=s-c),o=r;o>=0;o--){let r=!0;for(let n=0;n<c;n++)if(u(e,o+n)!==u(t,n)){r=!1;break}if(r)return o}return-1}function x(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let a;for(n>o/2&&(n=o/2),a=0;a<n;++a){const n=parseInt(t.substr(2*a,2),16);if(Q(n))return a;e[r+a]=n}return a}function _(e,t,r,n){return J(G(t,e.length-r),e,r,n)}function j(e,t,r,n){return J(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function k(e,t,r,n){return J(X(t),e,r,n)}function T(e,t,r,n){return J(function(e,t){let r,n,i;const o=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function O(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function A(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,a=t>239?4:t>223?3:t>191?2:1;if(i+a<=r){let r,n,s,c;switch(a){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(o=c));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(c=(15&t)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:r=e[i+1],n=e[i+2],s=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=a}return function(e){const t=e.length;if(t<=N)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=N));return r}(n)}u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||void 0===n||"function"!=typeof n.error||n.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(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return h(e),e<=0?c(e):void 0!==t?"string"==typeof r?c(e).fill(t,r):c(e).fill(t):c(e)}(e,t,r)},u.allocUnsafe=function(e){return f(e)},u.allocUnsafeSlow=function(e){return f(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(W(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),W(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(W(t,Uint8Array))i+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},u.byteLength=v,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)m(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?A(this,0,e):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.h2;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},a&&(u.prototype[a]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(W(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(o,a),c=this.slice(n,i),l=e.slice(t,r);for(let e=0;e<s;++e)if(c[e]!==l[e]){o=c[e],a=l[e];break}return o<a?-1:a<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return x(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return j(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const N=4096;function S(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function E(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function I(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=Y[e[n]];return i}function R(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function C(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function L(e,t,r,n,i){H(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function P(e,t,r,n,i){H(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function M(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(e,t,r,n,i){return t=+t,r>>>=0,i||M(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,i){return t=+t,r>>>=0,i||M(e,0,r,8),o.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=K((function(e){V(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=K((function(e){V(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=K((function(e){V(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=K((function(e){V(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||C(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||D(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||D(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=K((function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=K((function(e,t=0){return P(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);D(this,e,t,r,n-1,-n)}let i=0,o=1,a=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/o>>0)-a&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);D(this,e,t,r,n-1,-n)}let i=r-1,o=1,a=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/o>>0)-a&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=K((function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=K((function(e,t=0){return P(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return F(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return F(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=u.isBuffer(e)?e:u.from(e,n),a=o.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%a]}return this};const B={};function Z(e,t,r){B[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function q(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function H(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new B.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){V(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||z(t,e.length-(r+1))}(n,i,o)}function V(e,t){if("number"!=typeof e)throw new B.ERR_INVALID_ARG_TYPE(t,"number",e)}function z(e,t,r){if(Math.floor(e)!==e)throw V(e,r),new B.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}Z("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),Z("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),Z("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=q(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=q(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const $=/[^+/0-9A-Za-z-_]/g;function G(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function X(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace($,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function J(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function W(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Q(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function K(e){return"undefined"==typeof BigInt?ee:e}function ee(){throw new Error("BigInt not supported")}},7615:(e,t,r)=>{"use strict";var n=r(1801),i=r(2550),o=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i(r):r}},2550:(e,t,r)=>{"use strict";var n=r(1930),i=r(1801),o=i("%Function.prototype.apply%"),a=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||n.call(a,o),c=i("%Object.getOwnPropertyDescriptor%",!0),u=i("%Object.defineProperty%",!0),l=i("%Math.max%");if(u)try{u({},"a",{value:1})}catch(e){u=null}e.exports=function(e){var t=s(n,a,arguments);if(c&&u){var r=c(t,"length");r.configurable&&u(t,"length",{value:1+l(0,e.length-(arguments.length-1))})}return t};var h=function(){return s(n,o,arguments)};u?u(e.exports,"apply",{value:h}):e.exports.apply=h},8981:e=>{"use strict";e.exports=function e(t){return null===t||"object"!=typeof t||null!=t.toJSON?JSON.stringify(t):Array.isArray(t)?"["+t.reduce(((t,r,n)=>t+(0===n?"":",")+e(void 0===r||"symbol"==typeof r?null:r)),"")+"]":"{"+Object.keys(t).sort().reduce(((r,n,i)=>void 0===t[n]||"symbol"==typeof t[n]?r:r+(0===r.length?"":",")+e(n)+":"+e(t[n])),"")+"}"}},292:(e,t,r)=>{var n=r(5663),i=r(6118);function o(){return(new Date).getTime()}var a,s=Array.prototype.slice,c={};a=void 0!==r.g&&r.g.console?r.g.console:"undefined"!=typeof window&&window.console?window.console:{};for(var u=[[function(){},"log"],[function(){a.log.apply(a,arguments)},"info"],[function(){a.log.apply(a,arguments)},"warn"],[function(){a.warn.apply(a,arguments)},"error"],[function(e){c[e]=o()},"time"],[function(e){var t=c[e];if(!t)throw new Error("No such label: "+e);delete c[e];var r=o()-t;a.log(e+": "+r+"ms")},"timeEnd"],[function(){var e=new Error;e.name="Trace",e.message=n.format.apply(null,arguments),a.error(e.stack)},"trace"],[function(e){a.log(n.inspect(e)+"\n")},"dir"],[function(e){if(!e){var t=s.call(arguments,1);i.ok(!1,n.format.apply(null,t))}},"assert"]],l=0;l<u.length;l++){var h=u[l],f=h[0],p=h[1];a[p]||(a[p]=f)}e.exports=a},7297:function(e,t){var r="undefined"!=typeof self?self:this,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,a="ArrayBuffer"in e;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function u(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function h(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function p(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function d(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function y(e){var t=new FileReader,r=d(t);return t.readAsArrayBuffer(e),r}function v(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=v(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||c(e))?this._bodyArrayBuffer=v(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(y)}),this.text=function(){var e,t,r,n=p(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=d(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}f.prototype.append=function(e,t){e=u(e),t=l(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},f.prototype.delete=function(e){delete this.map[u(e)]},f.prototype.get=function(e){return e=u(e),this.has(e)?this.map[e]:null},f.prototype.has=function(e){return this.map.hasOwnProperty(u(e))},f.prototype.set=function(e,t){this.map[u(e)]=l(t)},f.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},f.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),h(e)},f.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),h(e)},f.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),h(e)},n&&(f.prototype[Symbol.iterator]=f.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(e,t){var r,n,i=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new f(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new f(t.headers)),this.method=(n=(r=t.method||this.method||"GET").toUpperCase(),m.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function x(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},g.call(b.prototype),g.call(x.prototype),x.prototype.clone=function(){return new x(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},x.error=function(){var e=new x(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];x.redirect=function(e,t){if(-1===_.indexOf(t))throw new RangeError("Invalid status code");return new x(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function j(e,r){return new Promise((function(n,o){var a=new b(e,r);if(a.signal&&a.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function c(){s.abort()}s.onload=function(){var e,t,r={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new f,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;n(new x(i,r))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.onabort=function(){o(new t.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),a.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),a.signal&&(a.signal.addEventListener("abort",c),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",c)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}j.polyfill=!0,e.fetch||(e.fetch=j,e.Headers=f,e.Request=b,e.Response=x),t.Headers=f,t.Request=b,t.Response=x,t.fetch=j,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},9170:(e,t,r)=>{"use strict";var n=r(806),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,a=Array.prototype.concat,s=Object.defineProperty,c=r(8198)(),u=s&&c,l=function(e,t,r,n){var i;(!(t in e)||"function"==typeof(i=n)&&"[object Function]"===o.call(i)&&n())&&(u?s(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r)},h=function(e,t){var r=arguments.length>2?arguments[2]:{},o=n(t);i&&(o=a.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s<o.length;s+=1)l(e,o[s],t[o[s]],r[o[s]])};h.supportsDescriptors=!!u,e.exports=h},1662:e=>{"use strict";function t(e,t){if(null==e)throw new TypeError("Cannot convert first argument to object");for(var r=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var o=Object.keys(Object(i)),a=0,s=o.length;a<s;a++){var c=o[a],u=Object.getOwnPropertyDescriptor(i,c);void 0!==u&&u.enumerable&&(r[c]=i[c])}}return r}e.exports={assign:t,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:t})}}},4843:(e,t,r)=>{"use strict";var n=r(5443),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty,a=function(e,t,r){for(var n=0,i=e.length;n<i;n++)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))},s=function(e,t,r){for(var n=0,i=e.length;n<i;n++)null==r?t(e.charAt(n),n,e):t.call(r,e.charAt(n),n,e)},c=function(e,t,r){for(var n in e)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))};e.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=r),"[object Array]"===i.call(e)?a(e,t,o):"string"==typeof e?s(e,t,o):c(e,t,o)}},9930:e=>{"use strict";var t="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";e.exports=function(e){var o=this;if("function"!=typeof o||n.call(o)!==i)throw new TypeError(t+o);for(var a,s=r.call(arguments,1),c=function(){if(this instanceof a){var t=o.apply(this,s.concat(r.call(arguments)));return Object(t)===t?t:this}return o.apply(e,s.concat(r.call(arguments)))},u=Math.max(0,o.length-s.length),l=[],h=0;h<u;h++)l.push("$"+h);if(a=Function("binder","return function ("+l.join(",")+"){ return binder.apply(this,arguments); }")(c),o.prototype){var f=function(){};f.prototype=o.prototype,a.prototype=new f,f.prototype=null}return a}},1930:(e,t,r)=>{"use strict";var n=r(9930);e.exports=Function.prototype.bind||n},1801:(e,t,r)=>{"use strict";var n,i=SyntaxError,o=Function,a=TypeError,s=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(e){}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch(e){c=null}var u=function(){throw new a},l=c?function(){try{return u}catch(e){try{return c(arguments,"callee").get}catch(e){return u}}}():u,h=r(9905)(),f=Object.getPrototypeOf||function(e){return e.__proto__},p={},d="undefined"==typeof Uint8Array?n:f(Uint8Array),y={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":h?f([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h?f(f([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&h?f((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&h?f((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h?f(""[Symbol.iterator]()):n,"%Symbol%":h?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":l,"%TypedArray%":d,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};try{null.error}catch(e){var v=f(f(e));y["%Error.prototype%"]=v}var g=function e(t){var r;if("%AsyncFunction%"===t)r=s("async function () {}");else if("%GeneratorFunction%"===t)r=s("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=s("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&(r=f(i.prototype))}return y[t]=r,r},m={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},b=r(1930),w=r(9284),x=b.call(Function.call,Array.prototype.concat),_=b.call(Function.apply,Array.prototype.splice),j=b.call(Function.call,String.prototype.replace),k=b.call(Function.call,String.prototype.slice),T=b.call(Function.call,RegExp.prototype.exec),O=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,A=/\\(\\)?/g,N=function(e){var t=k(e,0,1),r=k(e,-1);if("%"===t&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return j(e,O,(function(e,t,r,i){n[n.length]=r?j(i,A,"$1"):t||e})),n},S=function(e,t){var r,n=e;if(w(m,n)&&(n="%"+(r=m[n])[0]+"%"),w(y,n)){var o=y[n];if(o===p&&(o=g(n)),void 0===o&&!t)throw new a("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new a('"allowMissing" argument must be a boolean');if(null===T(/^%?[^%]*%?$/,e))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=N(e),n=r.length>0?r[0]:"",o=S("%"+n+"%",t),s=o.name,u=o.value,l=!1,h=o.alias;h&&(n=h[0],_(r,x([0,1],h)));for(var f=1,p=!0;f<r.length;f+=1){var d=r[f],v=k(d,0,1),g=k(d,-1);if(('"'===v||"'"===v||"`"===v||'"'===g||"'"===g||"`"===g)&&v!==g)throw new i("property names with quotes must have matching quotes");if("constructor"!==d&&p||(l=!0),w(y,s="%"+(n+="."+d)+"%"))u=y[s];else if(null!=u){if(!(d in u)){if(!t)throw new a("base intrinsic for "+e+" exists, but the property is not available.");return}if(c&&f+1>=r.length){var m=c(u,d);u=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:u[d]}else p=w(u,d),u=u[d];p&&!l&&(y[s]=u)}}return u}},3828:(e,t,r)=>{"use strict";var n=r(1801)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},8198:(e,t,r)=>{"use strict";var n=r(1801)("%Object.defineProperty%",!0),i=function(){if(n)try{return n({},"a",{value:1}),!0}catch(e){return!1}return!1};i.hasArrayLengthDefineBug=function(){if(!i())return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},9905:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(5682);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},5682:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},4111:(e,t,r)=>{"use strict";var n=r(5682);e.exports=function(){return n()&&!!Symbol.toStringTag}},9284:(e,t,r)=>{"use strict";var n=r(1930);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},4525:(e,t)=>{t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,c=(1<<s)-1,u=c>>1,l=-7,h=r?i-1:0,f=r?-1:1,p=e[t+h];for(h+=f,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+e[t+h],h+=f,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+e[t+h],h+=f,l-=8);if(0===o)o=1-u;else{if(o===c)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=u}return(p?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,c,u=8*o-i-1,l=(1<<u)-1,h=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+h>=1?f/c:f*Math.pow(2,1-h))*c>=2&&(a++,c/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(t*c-1)*Math.pow(2,i),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;e[r+p]=255&s,p+=d,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;e[r+p]=255&a,p+=d,a/=256,u-=8);e[r+p-d]|=128*y}},8575:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},7092:(e,t,r)=>{"use strict";var n=r(4111)(),i=r(7615)("Object.prototype.toString"),o=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},a=function(e){return!!o(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},s=function(){return o(arguments)}();o.isLegacyArguments=a,e.exports=s?o:a},5443:e=>{"use strict";var t,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,t)}catch(e){e!==r&&(i=null)}else i=null;var o=/^\s*class\b/,a=function(e){try{var t=n.call(e);return o.test(t)}catch(e){return!1}},s=function(e){try{return!a(e)&&(n.call(e),!0)}catch(e){return!1}},c=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),h=function(){return!1};if("object"==typeof document){var f=document.all;c.call(f)===c.call(document.all)&&(h=function(e){if((l||!e)&&(void 0===e||"object"==typeof e))try{var t=c.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=i?function(e){if(h(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{i(e,null,t)}catch(e){if(e!==r)return!1}return!a(e)&&s(e)}:function(e){if(h(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(u)return s(e);if(a(e))return!1;var t=c.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&s(e)}},7427:(e,t,r)=>{"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,a=/^\s*(?:function)?\*/,s=r(4111)(),c=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(a.test(o.call(e)))return!0;if(!s)return"[object GeneratorFunction]"===i.call(e);if(!c)return!1;if(void 0===n){var t=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&c(t)}return c(e)===n}},2100:e=>{"use strict";e.exports=function(e){return e!=e}},8622:(e,t,r)=>{"use strict";var n=r(2550),i=r(9170),o=r(2100),a=r(4358),s=r(6232),c=n(a(),Number);i(c,{getPolyfill:a,implementation:o,shim:s}),e.exports=c},4358:(e,t,r)=>{"use strict";var n=r(2100);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},6232:(e,t,r)=>{"use strict";var n=r(9170),i=r(4358);e.exports=function(){var e=i();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},2527:(e,t,r)=>{"use strict";var n=r(4843),i=r(4343),o=r(7615),a=o("Object.prototype.toString"),s=r(4111)(),c=r(3828),u="undefined"==typeof globalThis?r.g:globalThis,l=i(),h=o("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},f=o("String.prototype.slice"),p={},d=Object.getPrototypeOf;s&&c&&d&&n(l,(function(e){var t=new u[e];if(Symbol.toStringTag in t){var r=d(t),n=c(r,Symbol.toStringTag);if(!n){var i=d(r);n=c(i,Symbol.toStringTag)}p[e]=n.get}})),e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!s||!(Symbol.toStringTag in e)){var t=f(a(e),8,-1);return h(l,t)>-1}return!!c&&function(e){var t=!1;return n(p,(function(r,n){if(!t)try{t=r.call(e)===n}catch(e){}})),t}(e)}},5777:(e,t,r)=>{"use strict";const{isArray:n,isObject:i,isString:o}=r(8285),{asArray:a}=r(2621),{prependBase:s}=r(3866),c=r(9699),u=r(1898);function l(e){throw new c("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:e})}function h({context:e,base:t}){if(!e)return;const r=e["@context"];if(o(r))e["@context"]=s(t,r);else if(n(r))for(let e=0;e<r.length;++e){const n=r[e];o(n)?r[e]=s(t,n):i(n)&&h({context:{"@context":n},base:t})}else if(i(r))for(const e in r)h({context:r[e],base:t})}e.exports=class{constructor({sharedCache:e}){this.perOpCache=new Map,this.sharedCache=e}async resolve({activeCtx:e,context:t,documentLoader:r,base:s,cycles:c=new Set}){t&&i(t)&&t["@context"]&&(t=t["@context"]),t=a(t);const h=[];for(const a of t){if(o(a)){let t=this._get(a);t||(t=await this._resolveRemoteContext({activeCtx:e,url:a,documentLoader:r,base:s,cycles:c})),n(t)?h.push(...t):h.push(t);continue}if(null===a){h.push(new u({document:null}));continue}i(a)||l(t);const f=JSON.stringify(a);let p=this._get(f);p||(p=new u({document:a}),this._cacheResolvedContext({key:f,resolved:p,tag:"static"})),h.push(p)}return h}_get(e){let t=this.perOpCache.get(e);if(!t){const r=this.sharedCache.get(e);r&&(t=r.get("static"),t&&this.perOpCache.set(e,t))}return t}_cacheResolvedContext({key:e,resolved:t,tag:r}){if(this.perOpCache.set(e,t),void 0!==r){let n=this.sharedCache.get(e);n||(n=new Map,this.sharedCache.set(e,n)),n.set(r,t)}return t}async _resolveRemoteContext({activeCtx:e,url:t,documentLoader:r,base:n,cycles:i}){t=s(n,t);const{context:o,remoteDoc:a}=await this._fetchContext({activeCtx:e,url:t,documentLoader:r,cycles:i});h({context:o,base:n=a.documentUrl||t});const c=await this.resolve({activeCtx:e,context:o,documentLoader:r,base:n,cycles:i});return this._cacheResolvedContext({key:t,resolved:c,tag:a.tag}),c}async _fetchContext({activeCtx:e,url:t,documentLoader:r,cycles:a}){if(a.size>10)throw new c("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"loading remote context failed":"context overflow",max:10});if(a.has(t))throw new c("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"recursive context inclusion":"context overflow",url:t});let s,u;a.add(t);try{u=await r(t),s=u.document||null,o(s)&&(s=JSON.parse(s))}catch(e){throw new c("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:t,cause:e})}if(!i(s))throw new c("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:t});return s="@context"in s?{"@context":s["@context"]}:{"@context":{}},u.contextUrl&&(n(s["@context"])||(s["@context"]=[s["@context"]]),s["@context"].push(u.contextUrl)),{context:s,remoteDoc:u}}}},9699:e=>{"use strict";e.exports=class extends Error{constructor(e="An unspecified JSON-LD error occurred.",t="jsonld.Error",r={}){super(e),this.name=t,this.message=e,this.details=r}}},7298:e=>{"use strict";e.exports=e=>{class t{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t}),t.compact=function(t,r){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(t,r)},t.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(t)},t.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(t)},t}},7990:(e,t,r)=>{"use strict";e.exports=r(2948).NQuads},3114:e=>{"use strict";e.exports=class{constructor(){this._requests={}}wrapLoader(e){const t=this;return t._loader=e,function(){return t.add.apply(t,arguments)}}async add(e){let t=this._requests[e];if(t)return Promise.resolve(t);t=this._requests[e]=this._loader(e);try{return await t}finally{delete this._requests[e]}}}},1898:(e,t,r)=>{"use strict";const n=r(3811);e.exports=class{constructor({document:e}){this.document=e,this.cache=new n({max:10})}getProcessed(e){return this.cache.get(e)}setProcessed(e,t){this.cache.set(e,t)}}},120:(e,t,r)=>{"use strict";const n=r(9699),{isArray:i,isObject:o,isString:a,isUndefined:s}=r(8285),{isList:c,isValue:u,isGraph:l,isSimpleGraph:h,isSubjectReference:f}=r(478),{expandIri:p,getContextValue:d,isKeyword:y,process:v,processingMode:g}=r(2182),{removeBase:m,prependBase:b}=r(3866),{addValue:w,asArray:x,compareShortestLeast:_}=r(2621),j={};function k(e,t,r){if("@nest"!==p(e,t,{vocab:!0},r))throw new n("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}e.exports=j,j.compact=async({activeCtx:e,activeProperty:t=null,element:r,options:p={},compactionMap:m=(()=>{})})=>{if(i(r)){let n=[];for(let i=0;i<r.length;++i){let o=await j.compact({activeCtx:e,activeProperty:t,element:r[i],options:p,compactionMap:m});null===o&&(o=await m({unmappedValue:r[i],activeCtx:e,activeProperty:t,parent:r,index:i,options:p}),void 0===o)||n.push(o)}return p.compactArrays&&1===n.length&&0===(d(e,t,"@container")||[]).length&&(n=n[0]),n}const b=d(e,t,"@context");if(s(b)||(e=await v({activeCtx:e,localCtx:b,propagate:!0,overrideProtected:!0,options:p})),o(r)){if(p.link&&"@id"in r&&p.link.hasOwnProperty(r["@id"])){const e=p.link[r["@id"]];for(let t=0;t<e.length;++t)if(e[t].expanded===r)return e[t].compacted}if(u(r)||f(r)){const n=j.compactValue({activeCtx:e,activeProperty:t,value:r,options:p});return p.link&&f(r)&&(p.link.hasOwnProperty(r["@id"])||(p.link[r["@id"]]=[]),p.link[r["@id"]].push({expanded:r,compacted:n})),n}if(c(r)&&(d(e,t,"@container")||[]).includes("@list"))return j.compact({activeCtx:e,activeProperty:t,element:r["@list"],options:p,compactionMap:m});const b="@reverse"===t,_={},T=e;u(r)||f(r)||(e=e.revertToPreviousContext());const O=d(T,t,"@context");s(O)||(e=await v({activeCtx:e,localCtx:O,propagate:!0,overrideProtected:!0,options:p})),p.link&&"@id"in r&&(p.link.hasOwnProperty(r["@id"])||(p.link[r["@id"]]=[]),p.link[r["@id"]].push({expanded:r,compacted:_}));let A=r["@type"]||[];A.length>1&&(A=Array.from(A).sort());const N=e;for(const t of A){const r=j.compactIri({activeCtx:N,iri:t,relativeTo:{vocab:!0}}),n=d(T,r,"@context");s(n)||(e=await v({activeCtx:e,localCtx:n,options:p,propagate:!1}))}const S=Object.keys(r).sort();for(const s of S){const f=r[s];if("@id"!==s)if("@type"!==s)if("@reverse"!==s)if("@preserve"!==s)if("@index"!==s)if("@graph"!==s&&"@list"!==s&&"@included"!==s&&y(s)){const t=j.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});w(_,t,f)}else{if(!i(f))throw new n("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===f.length){const t=j.compactIri({activeCtx:e,iri:s,value:f,relativeTo:{vocab:!0},reverse:b}),r=e.mappings.has(t)?e.mappings.get(t)["@nest"]:null;let n=_;r&&(k(e,r,p),o(_[r])||(_[r]={}),n=_[r]),w(n,t,f,{propertyIsArray:!0})}for(const t of f){const r=j.compactIri({activeCtx:e,iri:s,value:t,relativeTo:{vocab:!0},reverse:b}),n=e.mappings.has(r)?e.mappings.get(r)["@nest"]:null;let f=_;n&&(k(e,n,p),o(_[n])||(_[n]={}),f=_[n]);const y=d(e,r,"@container")||[],v=l(t),g=c(t);let T;g?T=t["@list"]:v&&(T=t["@graph"]);let O=await j.compact({activeCtx:e,activeProperty:r,element:g||v?T:t,options:p,compactionMap:m});if(g){if(i(O)||(O=[O]),y.includes("@list")){w(f,r,O,{valueIsArray:!0,allowDuplicate:!0});continue}O={[j.compactIri({activeCtx:e,iri:"@list",relativeTo:{vocab:!0}})]:O},"@index"in t&&(O[j.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"])}if(v)if(y.includes("@graph")&&(y.includes("@id")||y.includes("@index")&&h(t))){let n;f.hasOwnProperty(r)?n=f[r]:f[r]=n={};const i=(y.includes("@id")?t["@id"]:t["@index"])||j.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}});w(n,i,O,{propertyIsArray:!p.compactArrays||y.includes("@set")})}else y.includes("@graph")&&h(t)?(i(O)&&O.length>1&&(O={"@included":O}),w(f,r,O,{propertyIsArray:!p.compactArrays||y.includes("@set")})):(i(O)&&1===O.length&&p.compactArrays&&(O=O[0]),O={[j.compactIri({activeCtx:e,iri:"@graph",relativeTo:{vocab:!0}})]:O},"@id"in t&&(O[j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t["@id"]),"@index"in t&&(O[j.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"]),w(f,r,O,{propertyIsArray:!p.compactArrays||y.includes("@set")}));else if(y.includes("@language")||y.includes("@index")||y.includes("@id")||y.includes("@type")){let n,i;if(f.hasOwnProperty(r)?n=f[r]:f[r]=n={},y.includes("@language"))u(O)&&(O=O["@value"]),i=t["@language"];else if(y.includes("@index")){const n=d(e,r,"@index")||"@index",o=j.compactIri({activeCtx:e,iri:n,relativeTo:{vocab:!0}});if("@index"===n)i=t["@index"],delete O[o];else{let e;if([i,...e]=x(O[n]||[]),a(i))switch(e.length){case 0:delete O[n];break;case 1:O[n]=e[0];break;default:O[n]=e}else i=null}}else if(y.includes("@id")){const t=j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}});i=O[t],delete O[t]}else if(y.includes("@type")){const n=j.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}});let o;switch([i,...o]=x(O[n]||[]),o.length){case 0:delete O[n];break;case 1:O[n]=o[0];break;default:O[n]=o}1===Object.keys(O).length&&"@id"in t&&(O=await j.compact({activeCtx:e,activeProperty:r,element:{"@id":t["@id"]},options:p,compactionMap:m}))}i||(i=j.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}})),w(n,i,O,{propertyIsArray:y.includes("@set")})}else{const e=!p.compactArrays||y.includes("@set")||y.includes("@list")||i(O)&&0===O.length||"@list"===s||"@graph"===s;w(f,r,O,{propertyIsArray:e})}}}else{if((d(e,t,"@container")||[]).includes("@index"))continue;const r=j.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});w(_,r,f)}else{const r=await j.compact({activeCtx:e,activeProperty:t,element:f,options:p,compactionMap:m});i(r)&&0===r.length||w(_,s,r)}else{const t=await j.compact({activeCtx:e,activeProperty:"@reverse",element:f,options:p,compactionMap:m});for(const r in t)if(e.mappings.has(r)&&e.mappings.get(r).reverse){const n=t[r],i=(d(e,r,"@container")||[]).includes("@set")||!p.compactArrays;w(_,r,n,{propertyIsArray:i}),delete t[r]}if(Object.keys(t).length>0){const r=j.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});w(_,r,t)}}else{let t=x(f).map((e=>j.compactIri({activeCtx:T,iri:e,relativeTo:{vocab:!0}})));1===t.length&&(t=t[0]);const r=j.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}}),n=(d(e,r,"@container")||[]).includes("@set")&&g(e,1.1)||i(t)&&0===f.length;w(_,r,t,{propertyIsArray:n})}else{let t=x(f).map((t=>j.compactIri({activeCtx:e,iri:t,relativeTo:{vocab:!1},base:p.base})));1===t.length&&(t=t[0]),_[j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t}}return _}return r},j.compactIri=({activeCtx:e,iri:t,value:r=null,relativeTo:i={vocab:!1},reverse:a=!1,base:s=null})=>{if(null===t)return t;e.isPropertyTermScoped&&e.previousContext&&(e=e.previousContext);const h=e.getInverse();if(y(t)&&t in h&&"@none"in h[t]&&"@type"in h[t]["@none"]&&"@none"in h[t]["@none"]["@type"])return h[t]["@none"]["@type"]["@none"];if(i.vocab&&t in h){const n=e["@language"]||"@none",i=[];o(r)&&"@index"in r&&!("@graph"in r)&&i.push("@index","@index@set"),o(r)&&"@preserve"in r&&(r=r["@preserve"][0]),l(r)?("@index"in r&&i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in r&&i.push("@graph@id","@graph@id@set"),i.push("@graph","@graph@set","@set"),"@index"in r||i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in r||i.push("@graph@id","@graph@id@set")):o(r)&&!u(r)&&i.push("@id","@id@set","@type","@set@type");let s="@language",h="@null";if(a)s="@type",h="@reverse",i.push("@set");else if(c(r)){"@index"in r||i.push("@list");const e=r["@list"];if(0===e.length)s="@any",h="@none";else{let t=0===e.length?n:null,r=null;for(let n=0;n<e.length;++n){const i=e[n];let o="@none",a="@none";if(u(i)?"@direction"in i?o=`${(i["@language"]||"").toLowerCase()}_${i["@direction"]}`:"@language"in i?o=i["@language"].toLowerCase():"@type"in i?a=i["@type"]:o="@null":a="@id",null===t?t=o:o!==t&&u(i)&&(t="@none"),null===r?r=a:a!==r&&(r="@none"),"@none"===t&&"@none"===r)break}t=t||"@none",r=r||"@none","@none"!==r?(s="@type",h=r):h=t}}else{if(u(r))if("@language"in r&&!("@index"in r)){i.push("@language","@language@set"),h=r["@language"];const e=r["@direction"];e&&(h=`${h}_${e}`)}else"@direction"in r&&!("@index"in r)?h=`_${r["@direction"]}`:"@type"in r&&(s="@type",h=r["@type"]);else s="@type",h="@id";i.push("@set")}i.push("@none"),o(r)&&!("@index"in r)&&i.push("@index","@index@set"),u(r)&&1===Object.keys(r).length&&i.push("@language","@language@set");const f=function(e,t,r,n,i,a){null===a&&(a="@null");const s=[];if(("@id"===a||"@reverse"===a)&&o(r)&&"@id"in r){"@reverse"===a&&s.push("@reverse");const t=j.compactIri({activeCtx:e,iri:r["@id"],relativeTo:{vocab:!0}});e.mappings.has(t)&&e.mappings.get(t)&&e.mappings.get(t)["@id"]===r["@id"]?s.push.apply(s,["@vocab","@id"]):s.push.apply(s,["@id","@vocab"])}else{s.push(a);const e=s.find((e=>e.includes("_")));e&&s.push(e.replace(/^[^_]+_/,"_"))}s.push("@none");const c=e.inverse[t];for(const e of n){if(!(e in c))continue;const t=c[e][i];for(const e of s)if(e in t)return t[e]}return null}(e,t,r,i,s,h);if(null!==f)return f}if(i.vocab&&"@vocab"in e){const r=e["@vocab"];if(0===t.indexOf(r)&&t!==r){const n=t.substr(r.length);if(!e.mappings.has(n))return n}}let f=null;const p=[];let d=e.fastCurieMap;const v=t.length-1;for(let e=0;e<v&&t[e]in d;++e)d=d[t[e]],""in d&&p.push(d[""][0]);for(let n=p.length-1;n>=0;--n){const i=p[n],o=i.terms;for(const n of o){const o=n+":"+t.substr(i.iri.length);e.mappings.get(n)._prefix&&(!e.mappings.has(o)||null===r&&e.mappings.get(o)["@id"]===t)&&(null===f||_(o,f)<0)&&(f=o)}}if(null!==f)return f;for(const[r,i]of e.mappings)if(i&&i._prefix&&t.startsWith(r+":"))throw new n(`Absolute IRI "${t}" confused with prefix "${r}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:e});return i.vocab?t:"@base"in e?e["@base"]?m(b(s,e["@base"]),t):t:m(s,t)},j.compactValue=({activeCtx:e,activeProperty:t,value:r,options:n})=>{if(u(r)){const n=d(e,t,"@type"),i=d(e,t,"@language"),o=d(e,t,"@direction"),s=d(e,t,"@container")||[],c="@index"in r&&!s.includes("@index");if(!c&&"@none"!==n){if(r["@type"]===n)return r["@value"];if("@language"in r&&r["@language"]===i&&"@direction"in r&&r["@direction"]===o)return r["@value"];if("@language"in r&&r["@language"]===i)return r["@value"];if("@direction"in r&&r["@direction"]===o)return r["@value"]}const u=Object.keys(r).length,l=1===u||2===u&&"@index"in r&&!c,h="@language"in e,f=a(r["@value"]),p=e.mappings.has(t)&&null===e.mappings.get(t)["@language"];if(l&&"@none"!==n&&(!h||!f||p))return r["@value"];const y={};return c&&(y[j.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=r["@index"]),"@type"in r?y[j.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}})]=j.compactIri({activeCtx:e,iri:r["@type"],relativeTo:{vocab:!0}}):"@language"in r&&(y[j.compactIri({activeCtx:e,iri:"@language",relativeTo:{vocab:!0}})]=r["@language"]),"@direction"in r&&(y[j.compactIri({activeCtx:e,iri:"@direction",relativeTo:{vocab:!0}})]=r["@direction"]),y[j.compactIri({activeCtx:e,iri:"@value",relativeTo:{vocab:!0}})]=r["@value"],y}const i=p(e,t,{vocab:!0},n),o=d(e,t,"@type"),s=j.compactIri({activeCtx:e,iri:r["@id"],relativeTo:{vocab:"@vocab"===o},base:n.base});return"@id"===o||"@vocab"===o||"@graph"===i?s:{[j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]:s}}},2445:e=>{"use strict";const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#",r="http://www.w3.org/2001/XMLSchema#";e.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:t,RDF_LIST:t+"List",RDF_FIRST:t+"first",RDF_REST:t+"rest",RDF_NIL:t+"nil",RDF_TYPE:t+"type",RDF_PLAIN_LITERAL:t+"PlainLiteral",RDF_XML_LITERAL:t+"XMLLiteral",RDF_JSON_LITERAL:t+"JSON",RDF_OBJECT:t+"object",RDF_LANGSTRING:t+"langString",XSD:r,XSD_BOOLEAN:r+"boolean",XSD_DOUBLE:r+"double",XSD_INTEGER:r+"integer",XSD_STRING:r+"string"}},2182:(e,t,r)=>{"use strict";var n=r(292);const i=r(2621),o=r(9699),{isArray:a,isObject:s,isString:c,isUndefined:u}=r(8285),{isAbsolute:l,isRelative:h,prependBase:f}=r(3866),{asArray:p,compareShortestLeast:d}=r(2621),y=new Map,v=/^@[a-zA-Z]+$/,g={};function m(e,t,r,n,i,o){if(null===t||!c(t)||g.isKeyword(t))return t;if(t.match(v))return null;if(n&&n.hasOwnProperty(t)&&!0!==i.get(t)&&g.createTermDefinition({activeCtx:e,localCtx:n,term:t,defined:i,options:o}),(r=r||{}).vocab){const r=e.mappings.get(t);if(null===r)return null;if(s(r)&&"@id"in r)return r["@id"]}const a=t.indexOf(":");if(a>0){const r=t.substr(0,a),s=t.substr(a+1);if("_"===r||0===s.indexOf("//"))return t;n&&n.hasOwnProperty(r)&&g.createTermDefinition({activeCtx:e,localCtx:n,term:r,defined:i,options:o});const c=e.mappings.get(r);if(c&&c._prefix)return c["@id"]+s;if(l(t))return t}if(r.vocab&&"@vocab"in e)return e["@vocab"]+t;if(r.base&&"@base"in e){if(e["@base"])return f(f(o.base,e["@base"]),t)}else if(r.base)return f(o.base,t);return t}function b(e,t){if(!e||"object"!=typeof e||!t||"object"!=typeof t)return e===t;const r=Array.isArray(e);if(r!==Array.isArray(t))return!1;if(r){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!b(e[r],t[r]))return!1;return!0}const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const r in e){let n=e[r],i=t[r];if("@container"===r&&Array.isArray(n)&&Array.isArray(i)&&(n=n.slice().sort(),i=i.slice().sort()),!b(n,i))return!1}return!0}e.exports=g,g.process=async({activeCtx:e,localCtx:t,options:r,propagate:u=!0,overrideProtected:d=!1,cycles:y=new Set})=>{if(s(t)&&"@context"in t&&a(t["@context"])&&(t=t["@context"]),0===p(t).length)return e;const v=await r.contextResolver.resolve({activeCtx:e,context:t,documentLoader:r.documentLoader,base:r.base});s(v[0].document)&&"boolean"==typeof v[0].document["@propagate"]&&(u=v[0].document["@propagate"]);let b=e;u||b.previousContext||(b=b.clone(),b.previousContext=e);for(const a of v){let{document:u}=a;if(e=b,null===u){if(!d&&0!==Object.keys(e.protected).length){const s=r&&r.protectedMode||"error";if("error"===s)throw new o("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});if("warn"===s){n.warn("WARNING: invalid context nullification");const t=a.getProcessed(e);if(t){b=e=t;continue}const o=e;b=e=g.getInitialContext(r).clone();for(const[t,r]of Object.entries(o.protected))r&&(e.mappings[t]=i.clone(o.mappings[t]));e.protected=i.clone(o.protected),a.setProcessed(o,b);continue}throw new o("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:t,protectedMode:s})}b=e=g.getInitialContext(r).clone();continue}const p=a.getProcessed(e);if(p){b=e=p;continue}if(s(u)&&"@context"in u&&(u=u["@context"]),!s(u))throw new o("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:u});b=b.clone();const v=new Map;if("@version"in u){if(1.1!==u["@version"])throw new o("Unsupported JSON-LD version: "+u["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:u});if(e.processingMode&&"json-ld-1.0"===e.processingMode)throw new o("@version: "+u["@version"]+" not compatible with "+e.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:u});b.processingMode="json-ld-1.1",b["@version"]=u["@version"],v.set("@version",!0)}if(b.processingMode=b.processingMode||e.processingMode,"@base"in u){let e=u["@base"];if(null===e||l(e));else{if(!h(e))throw new o('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:u});e=f(b["@base"],e)}b["@base"]=e,v.set("@base",!0)}if("@vocab"in u){const e=u["@vocab"];if(null===e)delete b["@vocab"];else{if(!c(e))throw new o('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:u});if(!l(e)&&g.processingMode(b,1))throw new o('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:u});b["@vocab"]=m(b,e,{vocab:!0,base:!0},void 0,void 0,r)}v.set("@vocab",!0)}if("@language"in u){const e=u["@language"];if(null===e)delete b["@language"];else{if(!c(e))throw new o('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:u});b["@language"]=e.toLowerCase()}v.set("@language",!0)}if("@direction"in u){const t=u["@direction"];if("json-ld-1.0"===e.processingMode)throw new o("Invalid JSON-LD syntax; @direction not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:u});if(null===t)delete b["@direction"];else{if("ltr"!==t&&"rtl"!==t)throw new o('Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:u});b["@direction"]=t}v.set("@direction",!0)}if("@propagate"in u){const r=u["@propagate"];if("json-ld-1.0"===e.processingMode)throw new o("Invalid JSON-LD syntax; @propagate not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:u});if("boolean"!=typeof r)throw new o("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:t});v.set("@propagate",!0)}if("@import"in u){const n=u["@import"];if("json-ld-1.0"===e.processingMode)throw new o("Invalid JSON-LD syntax; @import not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:u});if(!c(n))throw new o("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:t});const i=await r.contextResolver.resolve({activeCtx:e,context:n,documentLoader:r.documentLoader,base:r.base});if(1!==i.length)throw new o("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:t});const a=i[0].getProcessed(e);if(a)u=a;else{const r=i[0].document;if("@import"in r)throw new o("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:t});for(const e in r)u.hasOwnProperty(e)||(u[e]=r[e]);i[0].setProcessed(e,u)}v.set("@import",!0)}v.set("@protected",u["@protected"]||!1);for(const e in u)if(g.createTermDefinition({activeCtx:b,localCtx:u,term:e,defined:v,options:r,overrideProtected:d}),s(u[e])&&"@context"in u[e]){const t=u[e]["@context"];let n=!0;if(c(t)){const e=f(r.base,t);y.has(e)?n=!1:y.add(e)}if(n)try{await g.process({activeCtx:b.clone(),localCtx:u[e]["@context"],overrideProtected:!0,options:r,cycles:y})}catch(t){throw new o("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:u[e]["@context"],term:e})}}a.setProcessed(e,b)}return b},g.createTermDefinition=({activeCtx:e,localCtx:t,term:r,defined:i,options:u,overrideProtected:h=!1})=>{if(i.has(r)){if(i.get(r))return;throw new o("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:t,term:r})}let f;if(i.set(r,!1),t.hasOwnProperty(r)&&(f=t[r]),"@type"===r&&s(f)&&"@set"===(f["@container"]||"@set")&&g.processingMode(e,1.1)){const e=["@container","@id","@protected"],n=Object.keys(f);if(0===n.length||n.some((t=>!e.includes(t))))throw new o("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:r})}else{if(g.isKeyword(r))throw new o("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:r});if(r.match(v))return void n.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:r});if(""===r)throw new o("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:t})}const p=e.mappings.get(r);e.mappings.has(r)&&e.mappings.delete(r);let d=!1;if((c(f)||null===f)&&(d=!0,f={"@id":f}),!s(f))throw new o("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:t});const y={};e.mappings.set(r,y),y.reverse=!1;const w=["@container","@id","@language","@reverse","@type"];g.processingMode(e,1.1)&&w.push("@context","@direction","@index","@nest","@prefix","@protected");for(const e in f)if(!w.includes(e))throw new o("Invalid JSON-LD syntax; a term definition must not contain "+e,"jsonld.SyntaxError",{code:"invalid term definition",context:t});const x=r.indexOf(":");if(y._termHasColon=x>0,"@reverse"in f){if("@id"in f)throw new o("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});if("@nest"in f)throw new o("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});const a=f["@reverse"];if(!c(a))throw new o("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(!g.isKeyword(a)&&a.match(v))return n.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:a}),void(p?e.mappings.set(r,p):e.mappings.delete(r));const s=m(e,a,{vocab:!0,base:!1},t,i,u);if(!l(s))throw new o("Invalid JSON-LD syntax; a @context @reverse value must be an absolute IRI or a blank node identifier.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});y["@id"]=s,y.reverse=!0}else if("@id"in f){let a=f["@id"];if(a&&!c(a))throw new o("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(null===a)y["@id"]=null;else{if(!g.isKeyword(a)&&a.match(v))return n.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:a}),void(p?e.mappings.set(r,p):e.mappings.delete(r));if(a!==r){if(a=m(e,a,{vocab:!0,base:!1},t,i,u),!l(a)&&!g.isKeyword(a))throw new o("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(r.match(/(?::[^:])|\//)&&m(e,r,{vocab:!0,base:!1},t,new Map(i).set(r,!0),u)!==a)throw new o("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});y["@id"]=a,y._prefix=d&&!y._termHasColon&&a.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in y))if(y._termHasColon){const n=r.substr(0,x);if(t.hasOwnProperty(n)&&g.createTermDefinition({activeCtx:e,localCtx:t,term:n,defined:i,options:u}),e.mappings.has(n)){const t=r.substr(x+1);y["@id"]=e.mappings.get(n)["@id"]+t}else y["@id"]=r}else if("@type"===r)y["@id"]=r;else{if(!("@vocab"in e))throw new o("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t,term:r});y["@id"]=e["@vocab"]+r}if((!0===f["@protected"]||!0===i.get("@protected")&&!1!==f["@protected"])&&(e.protected[r]=!0,y.protected=!0),i.set(r,!0),"@type"in f){let r=f["@type"];if(!c(r))throw new o("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if("@json"===r||"@none"===r){if(g.processingMode(e,1))throw new o(`Invalid JSON-LD syntax; an @context @type value must not be "${r}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else if("@id"!==r&&"@vocab"!==r){if(r=m(e,r,{vocab:!0,base:!1},t,i,u),!l(r))throw new o("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if(0===r.indexOf("_:"))throw new o("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}y["@type"]=r}if("@container"in f){const r=c(f["@container"])?[f["@container"]]:f["@container"]||[],n=["@list","@set","@index","@language"];let i=!0;const s=r.includes("@set");if(g.processingMode(e,1.1)){if(n.push("@graph","@id","@type"),r.includes("@list")){if(1!==r.length)throw new o("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else if(r.includes("@graph")){if(r.some((e=>"@graph"!==e&&"@id"!==e&&"@index"!==e&&"@set"!==e)))throw new o("Invalid JSON-LD syntax; @context @container with @graph must have no other values other than @id, @index, and @set","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else i&=r.length<=(s?2:1);if(r.includes("@type")&&(y["@type"]=y["@type"]||"@id",!["@id","@vocab"].includes(y["@type"])))throw new o("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else i&=!a(f["@container"]),i&=r.length<=1;if(i&=r.every((e=>n.includes(e))),i&=!(s&&r.includes("@list")),!i)throw new o("Invalid JSON-LD syntax; @context @container value must be one of the following: "+n.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:t});if(y.reverse&&!r.every((e=>["@index","@set"].includes(e))))throw new o("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});y["@container"]=r}if("@index"in f){if(!("@container"in f)||!y["@container"].includes("@index"))throw new o(`Invalid JSON-LD syntax; @index without @index in @container: "${f["@index"]}" on term "${r}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});if(!c(f["@index"])||0===f["@index"].indexOf("@"))throw new o(`Invalid JSON-LD syntax; @index must expand to an IRI: "${f["@index"]}" on term "${r}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});y["@index"]=f["@index"]}if("@context"in f&&(y["@context"]=f["@context"]),"@language"in f&&!("@type"in f)){let e=f["@language"];if(null!==e&&!c(e))throw new o("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:t});null!==e&&(e=e.toLowerCase()),y["@language"]=e}if("@prefix"in f){if(r.match(/:|\//))throw new o("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:t});if(g.isKeyword(y["@id"]))throw new o("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:t});if("boolean"!=typeof f["@prefix"])throw new o("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:t});y._prefix=!0===f["@prefix"]}if("@direction"in f){const e=f["@direction"];if(null!==e&&"ltr"!==e&&"rtl"!==e)throw new o('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:t});y["@direction"]=e}if("@nest"in f){const e=f["@nest"];if(!c(e)||"@nest"!==e&&0===e.indexOf("@"))throw new o("Invalid JSON-LD syntax; @context @nest value must be a string which is not a keyword other than @nest.","jsonld.SyntaxError",{code:"invalid @nest value",context:t});y["@nest"]=e}const _=y["@id"];if("@context"===_||"@preserve"===_)throw new o("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:t});if(p&&p.protected&&!h&&(e.protected[r]=!0,y.protected=!0,!b(p,y))){const e=u&&u.protectedMode||"error";if("error"===e)throw new o(`Invalid JSON-LD syntax; tried to redefine "${r}" which is a protected term.`,"jsonld.SyntaxError",{code:"protected term redefinition",context:t,term:r});if("warn"===e)return void n.warn("WARNING: protected term redefinition",{term:r});throw new o("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:t,term:r,protectedMode:e})}},g.expandIri=(e,t,r,n)=>m(e,t,r,void 0,void 0,n),g.getInitialContext=e=>{const t=JSON.stringify({processingMode:e.processingMode}),r=y.get(t);if(r)return r;const n={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){const e=this;if(e.inverse)return e.inverse;const t=e.inverse={},r=e.fastCurieMap={},n={},i=(e["@language"]||"@none").toLowerCase(),s=e["@direction"],c=e.mappings,u=[...c.keys()].sort(d);for(const e of u){const o=c.get(e);if(null===o)continue;let u=o["@container"]||"@none";if(u=[].concat(u).sort().join(""),null===o["@id"])continue;const l=p(o["@id"]);for(const c of l){let l=t[c];const h=g.isKeyword(c);if(l)h||o._termHasColon||n[c].push(e);else if(t[c]=l={},!h&&!o._termHasColon){n[c]=[e];const t={iri:c,terms:n[c]};c[0]in r?r[c[0]].push(t):r[c[0]]=[t]}if(l[u]||(l[u]={"@language":{},"@type":{},"@any":{}}),l=l[u],a(e,l["@any"],"@none"),o.reverse)a(e,l["@type"],"@reverse");else if("@none"===o["@type"])a(e,l["@any"],"@none"),a(e,l["@language"],"@none"),a(e,l["@type"],"@none");else if("@type"in o)a(e,l["@type"],o["@type"]);else if("@language"in o&&"@direction"in o){const t=o["@language"],r=o["@direction"];a(e,l["@language"],t&&r?`${t}_${r}`.toLowerCase():t?t.toLowerCase():r?`_${r}`:"@null")}else"@language"in o?a(e,l["@language"],(o["@language"]||"@null").toLowerCase()):"@direction"in o?o["@direction"]?a(e,l["@language"],`_${o["@direction"]}`):a(e,l["@language"],"@none"):s?(a(e,l["@language"],`_${s}`),a(e,l["@language"],"@none"),a(e,l["@type"],"@none")):(a(e,l["@language"],i),a(e,l["@language"],"@none"),a(e,l["@type"],"@none"))}}for(const e in r)o(r,e,1);return t},clone:function(){const e={};return e.mappings=i.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=i.clone(this.protected),this.previousContext&&(e.previousContext=this.previousContext.clone()),e.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(e["@base"]=this["@base"]),"@language"in this&&(e["@language"]=this["@language"]),"@vocab"in this&&(e["@vocab"]=this["@vocab"]),e},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===y.size&&y.clear(),y.set(t,n),n;function o(e,t,r){const n=e[t],i=e[t]={};let a,s;for(const e of n)a=e.iri,s=r>=a.length?"":a[r],s in i?i[s].push(e):i[s]=[e];for(const e in i)""!==e&&o(i,e,r+1)}function a(e,t,r){t.hasOwnProperty(r)||(t[r]=e)}},g.getContextValue=(e,t,r)=>{if(null===t){if("@context"===r)return;return null}if(e.mappings.has(t)){const n=e.mappings.get(t);if(u(r))return n;if(n.hasOwnProperty(r))return n[r]}return"@language"===r&&r in e||"@direction"===r&&r in e?e[r]:"@context"!==r?null:void 0},g.processingMode=(e,t)=>t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():"json-ld-1.0"===e.processingMode,g.isKeyword=e=>{if(!c(e)||"@"!==e[0])return!1;switch(e){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1}},2872:(e,t,r)=>{"use strict";const{parseLinkHeader:n,buildHeaders:i}=r(2621),{LINK_HEADER_CONTEXT:o}=r(2445),a=r(9699),s=r(3114),{prependBase:c}=r(3866),u=/(^|(\r\n))link:/i;e.exports=({secure:e,headers:t={},xhr:r}={headers:{}})=>(t=i(t),(new s).wrapLoader((async function i(s){if(0!==s.indexOf("http:")&&0!==s.indexOf("https:"))throw new a('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:s});if(e&&0!==s.indexOf("https"))throw new a('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:s});let l;try{l=await function(e,t,r){const n=new(e=e||XMLHttpRequest);return new Promise(((e,i)=>{n.onload=()=>e(n),n.onerror=e=>i(e),n.open("GET",t,!0);for(const e in r)n.setRequestHeader(e,r[e]);n.send()}))}(r,s,t)}catch(e){throw new a("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:s,cause:e})}if(l.status>=400)throw new a("URL could not be dereferenced: "+l.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:s,httpStatusCode:l.status});let h={contextUrl:null,documentUrl:s,document:l.response},f=null;const p=l.getResponseHeader("Content-Type");let d;if(u.test(l.getAllResponseHeaders())&&(d=l.getResponseHeader("Link")),d&&"application/ld+json"!==p){const e=n(d),t=e[o];if(Array.isArray(t))throw new a("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:s});t&&(h.contextUrl=t.target),f=e.alternate,f&&"application/ld+json"==f.type&&!(p||"").match(/^application\/(\w*\+)?json$/)&&(h=await i(c(s,f.target)))}return h})))},570:(e,t,r)=>{"use strict";var n=r(292);const i=r(9699),{isArray:o,isObject:a,isEmptyObject:s,isString:c,isUndefined:u}=r(8285),{isList:l,isValue:h,isGraph:f,isSubject:p}=r(478),{expandIri:d,getContextValue:y,isKeyword:v,process:g,processingMode:m}=r(2182),{isAbsolute:b}=r(3866),{addValue:w,asArray:x,getValues:_,validateTypeValue:j}=r(2621),k={};e.exports=k;const T=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;async function O({activeCtx:e,activeProperty:t,expandedActiveProperty:r,element:f,expandedParent:_,options:A={},insideList:E,typeKey:I,typeScopedContext:R,expansionMap:C}){const D=Object.keys(f).sort(),L=[];let P;const M=f[I]&&"@json"===d(e,o(f[I])?f[I][0]:f[I],{vocab:!0},A);for(const O of D){let I,D=f[O];if("@context"===O)continue;let F=d(e,O,{vocab:!0},A);if((null===F||!b(F)&&!v(F))&&(F=C({unmappedProperty:O,activeCtx:e,activeProperty:t,parent:f,options:A,insideList:E,value:D,expandedParent:_}),void 0===F))continue;if(v(F)){if("@reverse"===r)throw new i("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:D});if(F in _&&"@included"!==F&&"@type"!==F)throw new i("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:F})}if("@id"===F){if(!c(D)){if(!A.isFrame)throw new i('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:D});if(a(D)){if(!s(D))throw new i('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:D})}else{if(!o(D))throw new i('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:D});if(!D.every((e=>c(e))))throw new i('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:D})}}w(_,"@id",x(D).map((t=>c(t)?d(e,t,{base:!0},A):t)),{propertyIsArray:A.isFrame});continue}if("@type"===F){a(D)&&(D=Object.fromEntries(Object.entries(D).map((([e,t])=>[d(R,e,{vocab:!0}),x(t).map((e=>d(R,e,{base:!0,vocab:!0})))])))),j(D,A.isFrame),w(_,"@type",x(D).map((e=>c(e)?d(R,e,{base:!0,vocab:!0},A):e)),{propertyIsArray:A.isFrame});continue}if("@included"===F&&m(e,1.1)){const r=x(await k.expand({activeCtx:e,activeProperty:t,element:D,options:A,expansionMap:C}));if(!r.every((e=>p(e))))throw new i("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:D});w(_,"@included",r,{propertyIsArray:!0});continue}if("@graph"===F&&!a(D)&&!o(D))throw new i('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:D});if("@value"===F){P=D,M&&m(e,1.1)?_["@value"]=D:w(_,"@value",D,{propertyIsArray:A.isFrame});continue}if("@language"===F){if(null===D)continue;if(!c(D)&&!A.isFrame)throw new i('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:D});D=x(D).map((e=>c(e)?e.toLowerCase():e));for(const e of D)c(e)&&!e.match(T)&&n.warn(`@language must be valid BCP47: ${e}`);w(_,"@language",D,{propertyIsArray:A.isFrame});continue}if("@direction"===F){if(!c(D)&&!A.isFrame)throw new i('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:D});D=x(D);for(const e of D)if(c(e)&&"ltr"!==e&&"rtl"!==e)throw new i('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:D});w(_,"@direction",D,{propertyIsArray:A.isFrame});continue}if("@index"===F){if(!c(D))throw new i('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:D});w(_,"@index",D);continue}if("@reverse"===F){if(!a(D))throw new i('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:D});if(I=await k.expand({activeCtx:e,activeProperty:"@reverse",element:D,options:A,expansionMap:C}),"@reverse"in I)for(const e in I["@reverse"])w(_,e,I["@reverse"][e],{propertyIsArray:!0});let t=_["@reverse"]||null;for(const e in I){if("@reverse"===e)continue;null===t&&(t=_["@reverse"]={}),w(t,e,[],{propertyIsArray:!0});const r=I[e];for(let n=0;n<r.length;++n){const o=r[n];if(h(o)||l(o))throw new i('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:I});w(t,e,o,{propertyIsArray:!0})}}continue}if("@nest"===F){L.push(O);continue}let U=e;const B=y(e,O,"@context");u(B)||(U=await g({activeCtx:e,localCtx:B,propagate:!0,overrideProtected:!0,options:A}));const Z=y(U,O,"@container")||[];if(Z.includes("@language")&&a(D))I=N(U,D,y(U,O,"@direction"),A);else if(Z.includes("@index")&&a(D)){const t=Z.includes("@graph"),r=y(U,O,"@index")||"@index",n="@index"!==r&&d(e,r,{vocab:!0},A);I=await S({activeCtx:U,options:A,activeProperty:O,value:D,expansionMap:C,asGraph:t,indexKey:r,propertyIndex:n})}else if(Z.includes("@id")&&a(D)){const e=Z.includes("@graph");I=await S({activeCtx:U,options:A,activeProperty:O,value:D,expansionMap:C,asGraph:e,indexKey:"@id"})}else if(Z.includes("@type")&&a(D))I=await S({activeCtx:U.revertToPreviousContext(),options:A,activeProperty:O,value:D,expansionMap:C,asGraph:!1,indexKey:"@type"});else{const n="@list"===F;if(n||"@set"===F){let e=t;n&&"@graph"===r&&(e=null),I=await k.expand({activeCtx:U,activeProperty:e,element:D,options:A,insideList:n,expansionMap:C})}else I="@json"===y(e,O,"@type")?{"@type":"@json","@value":D}:await k.expand({activeCtx:U,activeProperty:O,element:D,options:A,insideList:!1,expansionMap:C})}if(null!==I||"@value"===F||(I=C({unmappedValue:D,expandedProperty:F,activeCtx:U,activeProperty:t,parent:f,options:A,insideList:E,key:O,expandedParent:_}),void 0!==I))if("@list"!==F&&!l(I)&&Z.includes("@list")&&(I={"@list":x(I)}),Z.includes("@graph")&&!Z.some((e=>"@id"===e||"@index"===e))&&(I=x(I).map((e=>({"@graph":x(e)})))),U.mappings.has(O)&&U.mappings.get(O).reverse){const e=_["@reverse"]=_["@reverse"]||{};I=x(I);for(let t=0;t<I.length;++t){const r=I[t];if(h(r)||l(r))throw new i('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:I});w(e,F,r,{propertyIsArray:!0})}}else w(_,F,I,{propertyIsArray:!0})}if("@value"in _)if("@json"===_["@type"]&&m(e,1.1));else if((a(P)||o(P))&&!A.isFrame)throw new i('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:P});for(const n of L){const s=o(f[n])?f[n]:[f[n]];for(const n of s){if(!a(n)||Object.keys(n).some((t=>"@value"===d(e,t,{vocab:!0},A))))throw new i("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:n});await O({activeCtx:e,activeProperty:t,expandedActiveProperty:r,element:n,expandedParent:_,options:A,insideList:E,typeScopedContext:R,typeKey:I,expansionMap:C})}}}function A({activeCtx:e,activeProperty:t,value:r,options:n}){if(null==r)return null;const i=d(e,t,{vocab:!0},n);if("@id"===i)return d(e,r,{base:!0},n);if("@type"===i)return d(e,r,{vocab:!0,base:!0},n);const o=y(e,t,"@type");if(("@id"===o||"@graph"===i)&&c(r))return{"@id":d(e,r,{base:!0},n)};if("@vocab"===o&&c(r))return{"@id":d(e,r,{vocab:!0,base:!0},n)};if(v(i))return r;const a={};if(o&&!["@id","@vocab","@none"].includes(o))a["@type"]=o;else if(c(r)){const r=y(e,t,"@language");null!==r&&(a["@language"]=r);const n=y(e,t,"@direction");null!==n&&(a["@direction"]=n)}return["boolean","number","string"].includes(typeof r)||(r=r.toString()),a["@value"]=r,a}function N(e,t,r,n){const a=[],s=Object.keys(t).sort();for(const u of s){const s=d(e,u,{vocab:!0},n);let l=t[u];o(l)||(l=[l]);for(const e of l){if(null===e)continue;if(!c(e))throw new i("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:t});const n={"@value":e};"@none"!==s&&(n["@language"]=u.toLowerCase()),r&&(n["@direction"]=r),a.push(n)}}return a}async function S({activeCtx:e,options:t,activeProperty:r,value:n,expansionMap:a,asGraph:s,indexKey:c,propertyIndex:l}){const p=[],v=Object.keys(n).sort(),m="@type"===c;for(let b of v){if(m){const r=y(e,b,"@context");u(r)||(e=await g({activeCtx:e,localCtx:r,propagate:!1,options:t}))}let v,x=n[b];o(x)||(x=[x]),x=await k.expand({activeCtx:e,activeProperty:r,element:x,options:t,insideList:!1,insideIndex:!0,expansionMap:a}),v=l?"@none"===b?"@none":A({activeCtx:e,activeProperty:c,value:b,options:t}):d(e,b,{vocab:!0},t),"@id"===c?b=d(e,b,{base:!0},t):m&&(b=v);for(let e of x){if(s&&!f(e)&&(e={"@graph":[e]}),"@type"===c)"@none"===v||(e["@type"]?e["@type"]=[b].concat(e["@type"]):e["@type"]=[b]);else{if(h(e)&&!["@language","@type","@index"].includes(c))throw new i(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${c}".`,"jsonld.SyntaxError",{code:"invalid value object",value:e});l?"@none"!==v&&w(e,l,v,{propertyIsArray:!0,prependValue:!0}):"@none"===v||c in e||(e[c]=b)}p.push(e)}}return p}k.expand=async({activeCtx:e,activeProperty:t=null,element:r,options:n={},insideList:l=!1,insideIndex:h=!1,typeScopedContext:f=null,expansionMap:p=(()=>{})})=>{if(null==r)return null;if("@default"===t&&(n=Object.assign({},n,{isFrame:!1})),!o(r)&&!a(r)){if(!l&&(null===t||"@graph"===d(e,t,{vocab:!0},n))){const i=await p({unmappedValue:r,activeCtx:e,activeProperty:t,options:n,insideList:l});return void 0===i?null:i}return A({activeCtx:e,activeProperty:t,value:r,options:n})}if(o(r)){let i=[];const a=y(e,t,"@container")||[];l=l||a.includes("@list");for(let a=0;a<r.length;++a){let s=await k.expand({activeCtx:e,activeProperty:t,element:r[a],options:n,expansionMap:p,insideIndex:h,typeScopedContext:f});l&&o(s)&&(s={"@list":s}),null===s&&(s=await p({unmappedValue:r[a],activeCtx:e,activeProperty:t,parent:r,index:a,options:n,expandedParent:i,insideList:l}),void 0===s)||(o(s)?i=i.concat(s):i.push(s))}return i}const v=d(e,t,{vocab:!0},n),w=y(e,t,"@context");f=f||(e.previousContext?e:null);let j=Object.keys(r).sort(),T=!h;if(T&&f&&j.length<=2&&!j.includes("@context"))for(const t of j){const r=d(f,t,{vocab:!0},n);if("@value"===r){T=!1,e=f;break}if("@id"===r&&1===j.length){T=!1;break}}T&&(e=e.revertToPreviousContext()),u(w)||(e=await g({activeCtx:e,localCtx:w,propagate:!0,overrideProtected:!0,options:n})),"@context"in r&&(e=await g({activeCtx:e,localCtx:r["@context"],options:n})),f=e;let N=null;for(const t of j)if("@type"===d(e,t,{vocab:!0},n)){N=N||t;const i=r[t],o=Array.isArray(i)?i.length>1?i.slice().sort():i:[i];for(const t of o){const r=y(f,t,"@context");u(r)||(e=await g({activeCtx:e,localCtx:r,options:n,propagate:!1}))}}let S={};await O({activeCtx:e,activeProperty:t,expandedActiveProperty:v,element:r,expandedParent:S,options:n,insideList:l,typeKey:N,typeScopedContext:f,expansionMap:p}),j=Object.keys(S);let E=j.length;if("@value"in S){if("@type"in S&&("@language"in S||"@direction"in S))throw new i('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:S});let o=E-1;if("@type"in S&&(o-=1),"@index"in S&&(o-=1),"@language"in S&&(o-=1),"@direction"in S&&(o-=1),0!==o)throw new i('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:S});const a=null===S["@value"]?[]:x(S["@value"]),u=_(S,"@type");if(m(e,1.1)&&u.includes("@json")&&1===u.length);else if(0===a.length){const i=await p({unmappedValue:S,activeCtx:e,activeProperty:t,element:r,options:n,insideList:l});S=void 0!==i?i:null}else{if(!a.every((e=>c(e)||s(e)))&&"@language"in S)throw new i("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:S});if(!u.every((e=>b(e)&&!(c(e)&&0===e.indexOf("_:"))||s(e))))throw new i('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:S})}}else if("@type"in S&&!o(S["@type"]))S["@type"]=[S["@type"]];else if("@set"in S||"@list"in S){if(E>1&&(2!==E||!("@index"in S)))throw new i('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:S});"@set"in S&&(S=S["@set"],j=Object.keys(S),E=j.length)}else if(1===E&&"@language"in S){const i=await p(S,{unmappedValue:S,activeCtx:e,activeProperty:t,element:r,options:n,insideList:l});S=void 0!==i?i:null}if(a(S)&&!n.keepFreeFloatingNodes&&!l&&(null===t||"@graph"===v)&&(0===E||"@value"in S||"@list"in S||1===E&&"@id"in S)){const i=await p({unmappedValue:S,activeCtx:e,activeProperty:t,element:r,options:n,insideList:l});S=void 0!==i?i:null}return S}},1409:(e,t,r)=>{"use strict";const{isSubjectReference:n}=r(478),{createMergedNodeMap:i}=r(9646),o={};e.exports=o,o.flatten=e=>{const t=i(e),r=[],o=Object.keys(t).sort();for(let e=0;e<o.length;++e){const i=t[o[e]];n(i)||r.push(i)}return r}},1849:(e,t,r)=>{"use strict";const{isKeyword:n}=r(2182),i=r(478),o=r(8285),a=r(2621),s=r(3866),c=r(9699),{createNodeMap:u,mergeNodeMapGraphs:l}=r(9646),h={};function f(e){const t={};for(const r in e)void 0!==e[r]&&(t["@"+r]=[e[r]]);return[t]}function p(e,t,r){for(let n=r.length-1;n>=0;--n){const i=r[n];if(i.graph===t&&i.subject["@id"]===e["@id"])return!0}return!1}function d(e,t,r){const n="@"+r;let i=n in e?e[n][0]:t[r];if("embed"===r)if(!0===i)i="@once";else if(!1===i)i="@never";else if("@always"!==i&&"@never"!==i&&"@link"!==i&&"@first"!==i&&"@last"!==i&&"@once"!==i)throw new c("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:e});return i}function y(e){if(!o.isArray(e)||1!==e.length||!o.isObject(e[0]))throw new c("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:e});if("@id"in e[0])for(const t of a.asArray(e[0]["@id"]))if(!o.isObject(t)&&!s.isAbsolute(t)||o.isString(t)&&0===t.indexOf("_:"))throw new c("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e});if("@type"in e[0])for(const t of a.asArray(e[0]["@type"]))if(!o.isObject(t)&&!s.isAbsolute(t)||o.isString(t)&&0===t.indexOf("_:"))throw new c("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}function v(e,t,r,s){let c=!0,u=!1;for(const l in r){let h=!1;const f=a.getValues(t,l),p=0===a.getValues(r,l).length;if("@id"===l){if(o.isEmptyObject(r["@id"][0]||{})?h=!0:r["@id"].length>=0&&(h=r["@id"].includes(f[0])),!s.requireAll)return h}else if("@type"===l){if(c=!1,p){if(f.length>0)return!1;h=!0}else if(1===r["@type"].length&&o.isEmptyObject(r["@type"][0]))h=f.length>0;else for(const e of r["@type"])h=!(!o.isObject(e)||!("@default"in e))||h||f.some((t=>t===e));if(!s.requireAll)return h}else{if(n(l))continue;{const t=a.getValues(r,l)[0];let n=!1;if(t&&(y([t]),n="@default"in t),c=!1,0===f.length&&n)continue;if(f.length>0&&p)return!1;if(void 0===t){if(f.length>0)return!1;h=!0}else if(i.isList(t)){const r=t["@list"][0];if(i.isList(f[0])){const t=f[0]["@list"];i.isValue(r)?h=t.some((e=>x(r,e))):(i.isSubject(r)||i.isSubjectReference(r))&&(h=t.some((t=>w(e,r,t,s))))}}else h=i.isValue(t)?f.some((e=>x(t,e))):i.isSubjectReference(t)?f.some((r=>w(e,t,r,s))):!!o.isObject(t)&&f.length>0}}if(!h&&s.requireAll)return!1;u=u||h}return c||u}function g(e,t){const r=e.uniqueEmbeds[e.graph],n=r[t],i=n.parent,s=n.property,c={"@id":t};if(o.isArray(i)){for(let e=0;e<i.length;++e)if(a.compareValues(i[e],c)){i[e]=c;break}}else{const e=o.isArray(i[s]);a.removeValue(i,s,c,{propertyIsArray:e}),a.addValue(i,s,c,{propertyIsArray:e})}const u=e=>{const t=Object.keys(r);for(const n of t)n in r&&o.isObject(r[n].parent)&&r[n].parent["@id"]===e&&(delete r[n],u(n))};u(t)}function m(e,t){if(o.isArray(e))return e.map((e=>m(e,t)));if(o.isObject(e)){if("@preserve"in e)return e["@preserve"][0];if(i.isValue(e))return e;if(i.isList(e))return e["@list"]=m(e["@list"],t),e;if("@id"in e){const r=e["@id"];if(t.link.hasOwnProperty(r)){const n=t.link[r].indexOf(e);if(-1!==n)return t.link[r][n];t.link[r].push(e)}else t.link[r]=[e]}for(const r in e)"@id"===r&&t.bnodesToClear.includes(e[r])?delete e["@id"]:e[r]=m(e[r],t)}return e}function b(e,t,r){o.isObject(e)?a.addValue(e,t,r,{propertyIsArray:!0}):e.push(r)}function w(e,t,r,n){if(!("@id"in r))return!1;const i=e.subjects[r["@id"]];return i&&v(e,i,t,n)}function x(e,t){const r=t["@value"],n=t["@type"],i=t["@language"],a=e["@value"]?o.isArray(e["@value"])?e["@value"]:[e["@value"]]:[],s=e["@type"]?o.isArray(e["@type"])?e["@type"]:[e["@type"]]:[],c=e["@language"]?o.isArray(e["@language"])?e["@language"]:[e["@language"]]:[];return 0===a.length&&0===s.length&&0===c.length||!(!a.includes(r)&&!o.isEmptyObject(a[0]))&&!!(!n&&0===s.length||s.includes(n)||n&&o.isEmptyObject(s[0]))&&!!(!i&&0===c.length||c.includes(i)||i&&o.isEmptyObject(c[0]))}e.exports=h,h.frameMergedOrDefault=(e,t,r)=>{const n={options:r,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},i=new a.IdentifierIssuer("_:b");u(e,n.graphMap,"@default",i),r.merged&&(n.graphMap["@merged"]=l(n.graphMap),n.graph="@merged"),n.subjects=n.graphMap[n.graph];const o=[];return h.frame(n,Object.keys(n.subjects).sort(),t,o),r.pruneBlankNodeIdentifiers&&(r.bnodesToClear=Object.keys(n.bnodeMap).filter((e=>1===n.bnodeMap[e].length))),r.link={},m(o,r)},h.frame=(e,t,r,s,u=null)=>{y(r),r=r[0];const l=e.options,m={embed:d(r,l,"embed"),explicit:d(r,l,"explicit"),requireAll:d(r,l,"requireAll")};e.link.hasOwnProperty(e.graph)||(e.link[e.graph]={});const w=e.link[e.graph],_=function(e,t,r,n){const i={};for(const o of t){const t=e.graphMap[e.graph][o];v(e,t,r,n)&&(i[o]=t)}return i}(e,t,r,m),j=Object.keys(_).sort();for(const y of j){const v=_[y];if(null===u?e.uniqueEmbeds={[e.graph]:{}}:e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},"@link"===m.embed&&y in w){b(s,u,w[y]);continue}const j={"@id":y};if(0===y.indexOf("_:")&&a.addValue(e.bnodeMap,y,j,{propertyIsArray:!0}),w[y]=j,("@first"===m.embed||"@last"===m.embed)&&e.is11)throw new c("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:r});if(e.embedded||!e.uniqueEmbeds[e.graph].hasOwnProperty(y))if(!e.embedded||"@never"!==m.embed&&!p(v,e.graph,e.subjectStack))if(!e.embedded||"@first"!=m.embed&&"@once"!=m.embed||!e.uniqueEmbeds[e.graph].hasOwnProperty(y)){if("@last"===m.embed&&y in e.uniqueEmbeds[e.graph]&&g(e,y),e.uniqueEmbeds[e.graph][y]={parent:s,property:u},e.subjectStack.push({subject:v,graph:e.graph}),y in e.graphMap){let t=!1,n=null;"@graph"in r?(n=r["@graph"][0],t=!("@merged"===y||"@default"===y),o.isObject(n)||(n={})):(t="@merged"!==e.graph,n={}),t&&h.frame({...e,graph:y,embedded:!1},Object.keys(e.graphMap[y]).sort(),[n],j,"@graph")}"@included"in r&&h.frame({...e,embedded:!1},t,r["@included"],j,"@included");for(const t of Object.keys(v).sort())if(n(t)){if(j[t]=a.clone(v[t]),"@type"===t)for(const t of v["@type"])0===t.indexOf("_:")&&a.addValue(e.bnodeMap,t,j,{propertyIsArray:!0})}else if(!m.explicit||t in r)for(const n of v[t]){const o=t in r?r[t]:f(m);if(i.isList(n)){const o=r[t]&&r[t][0]&&r[t][0]["@list"]?r[t][0]["@list"]:f(m),s={"@list":[]};b(j,t,s);const c=n["@list"];for(const t of c)i.isSubjectReference(t)?h.frame({...e,embedded:!0},[t["@id"]],o,s,"@list"):b(s,"@list",a.clone(t))}else i.isSubjectReference(n)?h.frame({...e,embedded:!0},[n["@id"]],o,j,t):x(o[0],n)&&b(j,t,a.clone(n))}for(const e of Object.keys(r).sort()){if("@type"===e){if(!o.isObject(r[e][0])||!("@default"in r[e][0]))continue}else if(n(e))continue;const t=r[e][0]||{};if(!d(t,l,"omitDefault")&&!(e in j)){let r="@null";"@default"in t&&(r=a.clone(t["@default"])),o.isArray(r)||(r=[r]),j[e]=[{"@preserve":r}]}}for(const t of Object.keys(r["@reverse"]||{}).sort()){const n=r["@reverse"][t];for(const r of Object.keys(e.subjects))a.getValues(e.subjects[r],t).some((e=>e["@id"]===y))&&(j["@reverse"]=j["@reverse"]||{},a.addValue(j["@reverse"],t,[],{propertyIsArray:!0}),h.frame({...e,embedded:!0},[r],n,j["@reverse"][t],u))}b(s,u,j),e.subjectStack.pop()}else b(s,u,j);else b(s,u,j)}},h.cleanupNull=(e,t)=>{if(o.isArray(e))return e.map((e=>h.cleanupNull(e,t))).filter((e=>e));if("@null"===e)return null;if(o.isObject(e)){if("@id"in e){const r=e["@id"];if(t.link.hasOwnProperty(r)){const n=t.link[r].indexOf(e);if(-1!==n)return t.link[r][n];t.link[r].push(e)}else t.link[r]=[e]}for(const r in e)e[r]=h.cleanupNull(e[r],t)}return e}},1176:(e,t,r)=>{"use strict";var n=r(292);const i=r(9699),o=r(478),a=r(8285),s=r(2621),{RDF_LIST:c,RDF_FIRST:u,RDF_REST:l,RDF_NIL:h,RDF_TYPE:f,RDF_JSON_LITERAL:p,XSD_BOOLEAN:d,XSD_DOUBLE:y,XSD_INTEGER:v,XSD_STRING:g}=r(2445),m=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,b={};function w(e,t,r){if(e.termType.endsWith("Node"))return{"@id":e.value};const o={"@value":e.value};if(e.language)o["@language"]=e.language;else{let s=e.datatype.value;if(s||(s=g),s===p){s="@json";try{o["@value"]=JSON.parse(o["@value"])}catch(e){throw new i("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:o["@value"],cause:e})}}if(t){if(s===d)"true"===o["@value"]?o["@value"]=!0:"false"===o["@value"]&&(o["@value"]=!1);else if(a.isNumeric(o["@value"]))if(s===v){const e=parseInt(o["@value"],10);e.toFixed(0)===o["@value"]&&(o["@value"]=e)}else s===y&&(o["@value"]=parseFloat(o["@value"]));[d,v,y,g].includes(s)||(o["@type"]=s)}else if("i18n-datatype"===r&&s.startsWith("https://www.w3.org/ns/i18n#")){const[,e,t]=s.split(/[#_]/);e.length>0&&(o["@language"]=e,e.match(m)||n.warn(`@language must be valid BCP47: ${e}`)),o["@direction"]=t}else s!==g&&(o["@type"]=s)}return o}e.exports=b,b.fromRDF=async(e,{useRdfType:t=!1,useNativeTypes:r=!1,rdfDirection:n=null})=>{const i={},p={"@default":i},d={};for(const o of e){const e="DefaultGraph"===o.graph.termType?"@default":o.graph.value;e in p||(p[e]={}),"@default"===e||e in i||(i[e]={"@id":e});const a=p[e],c=o.subject.value,u=o.predicate.value,l=o.object;c in a||(a[c]={"@id":c});const y=a[c],v=l.termType.endsWith("Node");if(v&&!(l.value in a)&&(a[l.value]={"@id":l.value}),u===f&&!t&&v){s.addValue(y,"@type",l.value,{propertyIsArray:!0});continue}const g=w(l,r,n);if(s.addValue(y,u,g,{propertyIsArray:!0}),v)if(l.value===h){const e=a[l.value];"usages"in e||(e.usages=[]),e.usages.push({node:y,property:u,value:g})}else l.value in d?d[l.value]=!1:d[l.value]={node:y,property:u,value:g}}for(const e in p){const t=p[e];if(!(h in t))continue;const r=t[h];if(r.usages){for(let e of r.usages){let r=e.node,n=e.property,i=e.value;const s=[],h=[];let f=Object.keys(r).length;for(;n===l&&a.isObject(d[r["@id"]])&&a.isArray(r[u])&&1===r[u].length&&a.isArray(r[l])&&1===r[l].length&&(3===f||4===f&&a.isArray(r["@type"])&&1===r["@type"].length&&r["@type"][0]===c)&&(s.push(r[u][0]),h.push(r["@id"]),e=d[r["@id"]],r=e.node,n=e.property,i=e.value,f=Object.keys(r).length,o.isBlankNode(r)););delete i["@id"],i["@list"]=s.reverse();for(const e of h)delete t[e]}delete r.usages}}const y=[],v=Object.keys(i).sort();for(const e of v){const t=i[e];if(e in p){const r=t["@graph"]=[],n=p[e],i=Object.keys(n).sort();for(const e of i){const t=n[e];o.isSubjectReference(t)||r.push(t)}}o.isSubjectReference(t)||y.push(t)}return y}},478:(e,t,r)=>{"use strict";const n=r(8285),i={};e.exports=i,i.isSubject=e=>!(!n.isObject(e)||"@value"in e||"@set"in e||"@list"in e)&&(Object.keys(e).length>1||!("@id"in e)),i.isSubjectReference=e=>n.isObject(e)&&1===Object.keys(e).length&&"@id"in e,i.isValue=e=>n.isObject(e)&&"@value"in e,i.isList=e=>n.isObject(e)&&"@list"in e,i.isGraph=e=>n.isObject(e)&&"@graph"in e&&1===Object.keys(e).filter((e=>"@id"!==e&&"@index"!==e)).length,i.isSimpleGraph=e=>i.isGraph(e)&&!("@id"in e),i.isBlankNode=e=>!!n.isObject(e)&&("@id"in e?0===e["@id"].indexOf("_:"):0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e))},730:(e,t,r)=>{const n=r(2948),i=r(1402),o=r(2621),a=r(5777),s=o.IdentifierIssuer,c=r(9699),u=r(3811),l=r(7990),{expand:h}=r(570),{flatten:f}=r(1409),{fromRDF:p}=r(1176),{toRDF:d}=r(2189),{frameMergedOrDefault:y,cleanupNull:v}=r(1849),{isArray:g,isObject:m,isString:b}=r(8285),{isSubjectReference:w}=r(478),{expandIri:x,getInitialContext:_,process:j,processingMode:k}=r(2182),{compact:T,compactIri:O}=r(120),{createNodeMap:A,createMergedNodeMap:N,mergeNodeMaps:S}=r(9646),E=function(e){const t={},E=new u({max:100});function I(t,{documentLoader:r=e.documentLoader,...n}){return Object.assign({},{documentLoader:r},n,t)}return e.compact=async function(t,r,n){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===r)throw new c("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===t)return null;let i;(n=I(n,{base:b(t)?t:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new s("_:b"),contextResolver:new a({sharedCache:E})})).link&&(n.skipExpansion=!0),n.compactToRelative||delete n.base,i=n.skipExpansion?t:await e.expand(t,n);const u=await e.processContext(_(n),r,n);let l=await T({activeCtx:u,element:i,options:n,compactionMap:n.compactionMap});n.compactArrays&&!n.graph&&g(l)?1===l.length?l=l[0]:0===l.length&&(l={}):n.graph&&m(l)&&(l=[l]),m(r)&&"@context"in r&&(r=r["@context"]),r=o.clone(r),g(r)||(r=[r]);const h=r;r=[];for(let e=0;e<h.length;++e)(!m(h[e])||Object.keys(h[e]).length>0)&&r.push(h[e]);const f=r.length>0;if(1===r.length&&(r=r[0]),g(l)){const e=O({activeCtx:u,iri:"@graph",relativeTo:{vocab:!0}}),t=l;l={},f&&(l["@context"]=r),l[e]=t}else if(m(l)&&f){const e=l;l={"@context":r};for(const t in e)l[t]=e[t]}return l},e.expand=async function(t,r){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(r=I(r,{keepFreeFloatingNodes:!1,contextResolver:new a({sharedCache:E})})).expansionMap&&(r.expansionMap=void 0);const n={},i=[];if("expandContext"in r){const e=o.clone(r.expandContext);m(e)&&"@context"in e?n.expandContext=e:n.expandContext={"@context":e},i.push(n.expandContext)}let s;if(b(t)){const o=await e.get(t,r);s=o.documentUrl,n.input=o.document,o.contextUrl&&(n.remoteContext={"@context":o.contextUrl},i.push(n.remoteContext))}else n.input=o.clone(t);"base"in r||(r.base=s||"");let c=_(r);for(const e of i)c=await j({activeCtx:c,localCtx:e,options:r});let u=await h({activeCtx:c,element:n.input,options:r,expansionMap:r.expansionMap});return m(u)&&"@graph"in u&&1===Object.keys(u).length?u=u["@graph"]:null===u&&(u=[]),g(u)||(u=[u]),u},e.flatten=async function(t,r,n){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");r="function"==typeof r?null:r||null,n=I(n,{base:b(t)?t:"",contextResolver:new a({sharedCache:E})});const i=await e.expand(t,n),o=f(i);if(null===r)return o;n.graph=!0,n.skipExpansion=!0;const s=await e.compact(o,r,n);return s},e.frame=async function(t,r,n){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(n=I(n,{base:b(t)?t:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new a({sharedCache:E})}),b(r)){const t=await e.get(r,n);if(r=t.document,t.contextUrl){let e=r["@context"];e?g(e)?e.push(t.contextUrl):e=[e,t.contextUrl]:e=t.contextUrl,r["@context"]=e}}const i=r&&r["@context"]||{},o=await e.processContext(_(n),i,n);n.hasOwnProperty("omitGraph")||(n.omitGraph=k(o,1.1)),n.hasOwnProperty("pruneBlankNodeIdentifiers")||(n.pruneBlankNodeIdentifiers=k(o,1.1));const s=await e.expand(t,n),c={...n};c.isFrame=!0,c.keepFreeFloatingNodes=!0;const u=await e.expand(r,c),l=Object.keys(r).map((e=>x(o,e,{vocab:!0})));c.merged=!l.includes("@graph"),c.is11=k(o,1.1);const h=y(s,u,c);c.graph=!n.omitGraph,c.skipExpansion=!0,c.link={},c.framing=!0;let f=await e.compact(h,i,c);return c.link={},f=v(f,c),f},e.link=async function(t,r,n){const i={};return r&&(i["@context"]=r),i["@embed"]="@link",e.frame(t,i,n)},e.normalize=e.canonize=async function(t,r){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(r=I(r,{base:b(t)?t:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new a({sharedCache:E})}))){if("application/n-quads"!==r.inputFormat&&"application/nquads"!==r.inputFormat)throw new c("Unknown canonicalization input format.","jsonld.CanonizeError");const e=l.parse(t);return n.canonize(e,r)}const i={...r};delete i.format,i.produceGeneralizedRdf=!1;const o=await e.toRDF(t,i);return n.canonize(o,r)},e.fromRDF=async function(e,r){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");r=I(r,{format:b(e)?"application/n-quads":void 0});const{format:n}=r;let{rdfParser:i}=r;if(n){if(i=i||t[n],!i)throw new c("Unknown input format.","jsonld.UnknownFormat",{format:n})}else i=()=>e;const o=await i(e);return p(o,r)},e.toRDF=async function(t,r){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let n;n=(r=I(r,{base:b(t)?t:"",skipExpansion:!1,contextResolver:new a({sharedCache:E})})).skipExpansion?t:await e.expand(t,r);const i=d(n,r);if(r.format){if("application/n-quads"===r.format||"application/nquads"===r.format)return l.serialize(i);throw new c("Unknown output format.","jsonld.UnknownFormat",{format:r.format})}return i},e.createNodeMap=async function(t,r){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");r=I(r,{base:b(t)?t:"",contextResolver:new a({sharedCache:E})});const n=await e.expand(t,r);return N(n,r)},e.merge=async function(t,r,n){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!g(t))throw new TypeError('Could not merge, "docs" must be an array.');r="function"==typeof r?null:r||null,n=I(n,{contextResolver:new a({sharedCache:E})});const i=await Promise.all(t.map((t=>{const r={...n};return e.expand(t,r)})));let c=!0;"mergeNodes"in n&&(c=n.mergeNodes);const u=n.issuer||new s("_:b"),l={"@default":{}};for(let e=0;e<i.length;++e){const t=o.relabelBlankNodes(i[e],{issuer:new s("_:b"+e+"-")}),r=c||0===e?l:{"@default":{}};if(A(t,r,"@default",u),r!==l)for(const e in r){const t=r[e];if(!(e in l)){l[e]=t;continue}const n=l[e];for(const e in t)e in n||(n[e]=t[e])}}const h=S(l),f=[],p=Object.keys(h).sort();for(let e=0;e<p.length;++e){const t=h[p[e]];w(t)||f.push(t)}if(null===r)return f;n.graph=!0,n.skipExpansion=!0;const d=await e.compact(f,r,n);return d},Object.defineProperty(e,"documentLoader",{get:()=>e._documentLoader,set:t=>e._documentLoader=t}),e.documentLoader=async e=>{throw new c("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:e})},e.get=async function(t,r){let n;n="function"==typeof r.documentLoader?r.documentLoader:e.documentLoader;const i=await n(t);try{if(!i.document)throw new c("No remote document found at the given URL.","jsonld.NullRemoteDocument");b(i.document)&&(i.document=JSON.parse(i.document))}catch(e){throw new c("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:e,remoteDoc:i})}return i},e.processContext=async function(e,t,r){return r=I(r,{base:"",contextResolver:new a({sharedCache:E})}),null===t?_(r):(t=o.clone(t),m(t)&&"@context"in t||(t={"@context":t}),j({activeCtx:e,localCtx:t,options:r}))},e.getContextValue=r(2182).getContextValue,e.documentLoaders={},e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new c('Unknown document loader type: "'+t+'"',"jsonld.UnknownDocumentLoader",{type:t});e.documentLoader=e.documentLoaders[t].apply(e,Array.prototype.slice.call(arguments,1))},e.registerRDFParser=function(e,r){t[e]=r},e.unregisterRDFParser=function(e){delete t[e]},e.registerRDFParser("application/n-quads",l.parse),e.registerRDFParser("application/nquads",l.parse),e.url=r(3866),e.util=o,Object.assign(e,o),e.promises=e,e.RequestQueue=r(3114),e.JsonLdProcessor=r(7298)(e),i.setupGlobals(e),i.setupDocumentLoaders(e),e},I=function(){return E((function(){return I()}))};E(I),e.exports=I},9646:(e,t,r)=>{"use strict";const{isKeyword:n}=r(2182),i=r(478),o=r(8285),a=r(2621),s=r(9699),c={};e.exports=c,c.createMergedNodeMap=(e,t)=>{const r=(t=t||{}).issuer||new a.IdentifierIssuer("_:b"),n={"@default":{}};return c.createNodeMap(e,n,"@default",r),c.mergeNodeMaps(n)},c.createNodeMap=(e,t,r,u,l,h)=>{if(o.isArray(e)){for(const n of e)c.createNodeMap(n,t,r,u,void 0,h);return}if(!o.isObject(e))return void(h&&h.push(e));if(i.isValue(e)){if("@type"in e){let t=e["@type"];0===t.indexOf("_:")&&(e["@type"]=t=u.getId(t))}return void(h&&h.push(e))}if(h&&i.isList(e)){const n=[];return c.createNodeMap(e["@list"],t,r,u,l,n),void h.push({"@list":n})}if("@type"in e){const t=e["@type"];for(const e of t)0===e.indexOf("_:")&&u.getId(e)}o.isUndefined(l)&&(l=i.isBlankNode(e)?u.getId(e["@id"]):e["@id"]),h&&h.push({"@id":l});const f=t[r],p=f[l]=f[l]||{};p["@id"]=l;const d=Object.keys(e).sort();for(let o of d){if("@id"===o)continue;if("@reverse"===o){const n={"@id":l},o=e["@reverse"];for(const e in o){const s=o[e];for(const o of s){let s=o["@id"];i.isBlankNode(o)&&(s=u.getId(s)),c.createNodeMap(o,t,r,u,s),a.addValue(f[s],e,n,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===o){l in t||(t[l]={}),c.createNodeMap(e[o],t,l,u);continue}if("@included"===o){c.createNodeMap(e[o],t,r,u);continue}if("@type"!==o&&n(o)){if("@index"===o&&o in p&&(e[o]!==p[o]||e[o]["@id"]!==p[o]["@id"]))throw new s("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:p});p[o]=e[o];continue}const h=e[o];if(0===o.indexOf("_:")&&(o=u.getId(o)),0!==h.length)for(let e of h)if("@type"===o&&(e=0===e.indexOf("_:")?u.getId(e):e),i.isSubject(e)||i.isSubjectReference(e)){if("@id"in e&&!e["@id"])continue;const n=i.isBlankNode(e)?u.getId(e["@id"]):e["@id"];a.addValue(p,o,{"@id":n},{propertyIsArray:!0,allowDuplicate:!1}),c.createNodeMap(e,t,r,u,n)}else if(i.isValue(e))a.addValue(p,o,e,{propertyIsArray:!0,allowDuplicate:!1});else if(i.isList(e)){const n=[];c.createNodeMap(e["@list"],t,r,u,l,n),e={"@list":n},a.addValue(p,o,e,{propertyIsArray:!0,allowDuplicate:!1})}else c.createNodeMap(e,t,r,u,l),a.addValue(p,o,e,{propertyIsArray:!0,allowDuplicate:!1});else a.addValue(p,o,[],{propertyIsArray:!0})}},c.mergeNodeMapGraphs=e=>{const t={};for(const r of Object.keys(e).sort())for(const i of Object.keys(e[r]).sort()){const o=e[r][i];i in t||(t[i]={"@id":i});const s=t[i];for(const e of Object.keys(o).sort())if(n(e)&&"@type"!==e)s[e]=a.clone(o[e]);else for(const t of o[e])a.addValue(s,e,a.clone(t),{propertyIsArray:!0,allowDuplicate:!1})}return t},c.mergeNodeMaps=e=>{const t=e["@default"],r=Object.keys(e).sort();for(const n of r){if("@default"===n)continue;const r=e[n];let o=t[n];o?"@graph"in o||(o["@graph"]=[]):t[n]=o={"@id":n,"@graph":[]};const a=o["@graph"];for(const e of Object.keys(r).sort()){const t=r[e];i.isSubjectReference(t)||a.push(t)}}return t}},1402:(e,t,r)=>{"use strict";const n=r(2872),i={};e.exports=i,i.setupDocumentLoaders=function(e){"undefined"!=typeof XMLHttpRequest&&(e.documentLoaders.xhr=n,e.useDocumentLoader("xhr"))},i.setupGlobals=function(e){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:e.JsonLdProcessor})}},2189:(e,t,r)=>{"use strict";const{createNodeMap:n}=r(9646),{isKeyword:i}=r(2182),o=r(478),a=r(8981),s=r(8285),c=r(2621),{RDF_FIRST:u,RDF_REST:l,RDF_NIL:h,RDF_TYPE:f,RDF_JSON_LITERAL:p,RDF_LANGSTRING:d,XSD_BOOLEAN:y,XSD_DOUBLE:v,XSD_INTEGER:g,XSD_STRING:m}=r(2445),{isAbsolute:b}=r(3866),w={};function x(e,t,r,n,o){const a=Object.keys(t).sort();for(const s of a){const a=t[s],c=Object.keys(a).sort();for(let t of c){const c=a[t];if("@type"===t)t=f;else if(i(t))continue;for(const i of c){const a={termType:s.startsWith("_:")?"BlankNode":"NamedNode",value:s};if(!b(s))continue;const c={termType:t.startsWith("_:")?"BlankNode":"NamedNode",value:t};if(!b(t))continue;if("BlankNode"===c.termType&&!o.produceGeneralizedRdf)continue;const u=_(i,n,e,r,o.rdfDirection);u&&e.push({subject:a,predicate:c,object:u,graph:r})}}}}function _(e,t,r,n,i){const c={};if(o.isValue(e)){c.termType="Literal",c.value=void 0,c.datatype={termType:"NamedNode"};let t=e["@value"];const r=e["@type"]||null;if("@json"===r)c.value=a(t),c.datatype.value=p;else if(s.isBoolean(t))c.value=t.toString(),c.datatype.value=r||y;else if(s.isDouble(t)||r===v)s.isDouble(t)||(t=parseFloat(t)),c.value=t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),c.datatype.value=r||v;else if(s.isNumber(t))c.value=t.toFixed(0),c.datatype.value=r||g;else if("i18n-datatype"===i&&"@direction"in e){const r="https://www.w3.org/ns/i18n#"+(e["@language"]||"")+`_${e["@direction"]}`;c.datatype.value=r,c.value=t}else"@language"in e?(c.value=t,c.datatype.value=r||d,c.language=e["@language"]):(c.value=t,c.datatype.value=r||m)}else if(o.isList(e)){const o=function(e,t,r,n,i){const o={termType:"NamedNode",value:u},a={termType:"NamedNode",value:l},s={termType:"NamedNode",value:h},c=e.pop(),f=c?{termType:"BlankNode",value:t.getId()}:s;let p=f;for(const s of e){const e=_(s,t,r,n,i),c={termType:"BlankNode",value:t.getId()};r.push({subject:p,predicate:o,object:e,graph:n}),r.push({subject:p,predicate:a,object:c,graph:n}),p=c}if(c){const e=_(c,t,r,n,i);r.push({subject:p,predicate:o,object:e,graph:n}),r.push({subject:p,predicate:a,object:s,graph:n})}return f}(e["@list"],t,r,n,i);c.termType=o.termType,c.value=o.value}else{const t=s.isObject(e)?e["@id"]:e;c.termType=t.startsWith("_:")?"BlankNode":"NamedNode",c.value=t}return"NamedNode"!==c.termType||b(c.value)?c:null}e.exports=w,w.toRDF=(e,t)=>{const r=new c.IdentifierIssuer("_:b"),i={"@default":{}};n(e,i,"@default",r);const o=[],a=Object.keys(i).sort();for(const e of a){let n;if("@default"===e)n={termType:"DefaultGraph",value:""};else{if(!b(e))continue;n=e.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},n.value=e}x(o,i[e],n,r,t)}return o}},8285:e=>{"use strict";const t={};e.exports=t,t.isArray=Array.isArray,t.isBoolean=e=>"boolean"==typeof e||"[object Boolean]"===Object.prototype.toString.call(e),t.isDouble=e=>t.isNumber(e)&&(-1!==String(e).indexOf(".")||Math.abs(e)>=1e21),t.isEmptyObject=e=>t.isObject(e)&&0===Object.keys(e).length,t.isNumber=e=>"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e),t.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),t.isObject=e=>"[object Object]"===Object.prototype.toString.call(e),t.isString=e=>"string"==typeof e||"[object String]"===Object.prototype.toString.call(e),t.isUndefined=e=>void 0===e},3866:(e,t,r)=>{"use strict";const n=r(8285),i={};e.exports=i,i.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},i.parse=(e,t)=>{const r={},n=i.parsers[t||"full"],o=n.regex.exec(e);let a=n.keys.length;for(;a--;)r[n.keys[a]]=void 0===o[a]?null:o[a];return("https"===r.scheme&&"443"===r.port||"http"===r.scheme&&"80"===r.port)&&(r.href=r.href.replace(":"+r.port,""),r.authority=r.authority.replace(":"+r.port,""),r.port=null),r.normalizedPath=i.removeDotSegments(r.path),r},i.prependBase=(e,t)=>{if(null===e)return t;if(i.isAbsolute(t))return t;e&&!n.isString(e)||(e=i.parse(e||""));const r=i.parse(t),o={protocol:e.protocol||""};if(null!==r.authority)o.authority=r.authority,o.path=r.path,o.query=r.query;else if(o.authority=e.authority,""===r.path)o.path=e.path,null!==r.query?o.query=r.query:o.query=e.query;else{if(0===r.path.indexOf("/"))o.path=r.path;else{let t=e.path;t=t.substr(0,t.lastIndexOf("/")+1),(t.length>0||e.authority)&&"/"!==t.substr(-1)&&(t+="/"),t+=r.path,o.path=t}o.query=r.query}""!==r.path&&(o.path=i.removeDotSegments(o.path));let a=o.protocol;return null!==o.authority&&(a+="//"+o.authority),a+=o.path,null!==o.query&&(a+="?"+o.query),null!==r.fragment&&(a+="#"+r.fragment),""===a&&(a="./"),a},i.removeBase=(e,t)=>{if(null===e)return t;e&&!n.isString(e)||(e=i.parse(e||""));let r="";if(""!==e.href?r+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(r+="//"),0!==t.indexOf(r))return t;const o=i.parse(t.substr(r.length)),a=e.normalizedPath.split("/"),s=o.normalizedPath.split("/"),c=o.fragment||o.query?0:1;for(;a.length>0&&s.length>c&&a[0]===s[0];)a.shift(),s.shift();let u="";if(a.length>0){a.pop();for(let e=0;e<a.length;++e)u+="../"}return u+=s.join("/"),null!==o.query&&(u+="?"+o.query),null!==o.fragment&&(u+="#"+o.fragment),""===u&&(u="./"),u},i.removeDotSegments=e=>{if(0===e.length)return"";const t=e.split("/"),r=[];for(;t.length>0;){const e=t.shift(),n=0===t.length;"."!==e?".."!==e?r.push(e):(r.pop(),n&&r.push("")):n&&r.push("")}return"/"===e[0]&&r.length>0&&""!==r[0]&&r.unshift(""),1===r.length&&""===r[0]?"/":r.join("/")};const o=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;i.isAbsolute=e=>n.isString(e)&&o.test(e),i.isRelative=e=>n.isString(e)},2621:(e,t,r)=>{"use strict";const n=r(478),i=r(8285),o=r(2948).IdentifierIssuer,a=r(9699),s=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,c=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,u=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,l="application/ld+json, application/json",h={};function f(e,t){if(i.isArray(t))for(let r=0;r<t.length;++r)t[r]=f(e,t[r]);else if(n.isList(t))t["@list"]=f(e,t["@list"]);else if(i.isObject(t)){n.isBlankNode(t)&&(t["@id"]=e.getId(t["@id"]));const r=Object.keys(t).sort();for(let n=0;n<r.length;++n){const i=r[n];"@id"!==i&&(t[i]=f(e,t[i]))}}return t}e.exports=h,h.IdentifierIssuer=o,h.clone=function(e){if(e&&"object"==typeof e){let t;if(i.isArray(e)){t=[];for(let r=0;r<e.length;++r)t[r]=h.clone(e[r])}else if(e instanceof Map){t=new Map;for(const[r,n]of e)t.set(r,h.clone(n))}else if(e instanceof Set){t=new Set;for(const r of e)t.add(h.clone(r))}else if(i.isObject(e)){t={};for(const r in e)t[r]=h.clone(e[r])}else t=e.toString();return t}return e},h.asArray=function(e){return Array.isArray(e)?e:[e]},h.buildHeaders=(e={})=>{if(Object.keys(e).some((e=>"accept"===e.toLowerCase())))throw new RangeError('Accept header may not be specified; only "'+l+'" is supported.');return Object.assign({Accept:l},e)},h.parseLinkHeader=e=>{const t={},r=e.match(s);for(let e=0;e<r.length;++e){let n=r[e].match(c);if(!n)continue;const i={target:n[1]},o=n[2];for(;n=u.exec(o);)i[n[1]]=void 0===n[2]?n[3]:n[2];const a=i.rel||"";Array.isArray(t[a])?t[a].push(i):t.hasOwnProperty(a)?t[a]=[t[a],i]:t[a]=i}return t},h.validateTypeValue=(e,t)=>{if(!(i.isString(e)||i.isArray(e)&&e.every((e=>i.isString(e))))){if(t&&i.isObject(e))switch(Object.keys(e).length){case 0:return;case 1:if("@default"in e&&h.asArray(e["@default"]).every((e=>i.isString(e))))return}throw new a('Invalid JSON-LD syntax; "@type" value must a string, an array of strings, an empty object, or a default object.',"jsonld.SyntaxError",{code:"invalid type value",value:e})}},h.hasProperty=(e,t)=>{if(e.hasOwnProperty(t)){const r=e[t];return!i.isArray(r)||r.length>0}return!1},h.hasValue=(e,t,r)=>{if(h.hasProperty(e,t)){let o=e[t];const a=n.isList(o);if(i.isArray(o)||a){a&&(o=o["@list"]);for(let e=0;e<o.length;++e)if(h.compareValues(r,o[e]))return!0}else if(!i.isArray(r))return h.compareValues(r,o)}return!1},h.addValue=(e,t,r,n)=>{if("propertyIsArray"in(n=n||{})||(n.propertyIsArray=!1),"valueIsArray"in n||(n.valueIsArray=!1),"allowDuplicate"in n||(n.allowDuplicate=!0),"prependValue"in n||(n.prependValue=!1),n.valueIsArray)e[t]=r;else if(i.isArray(r)){0===r.length&&n.propertyIsArray&&!e.hasOwnProperty(t)&&(e[t]=[]),n.prependValue&&(r=r.concat(e[t]),e[t]=[]);for(let i=0;i<r.length;++i)h.addValue(e,t,r[i],n)}else if(e.hasOwnProperty(t)){const o=!n.allowDuplicate&&h.hasValue(e,t,r);i.isArray(e[t])||o&&!n.propertyIsArray||(e[t]=[e[t]]),o||(n.prependValue?e[t].unshift(r):e[t].push(r))}else e[t]=n.propertyIsArray?[r]:r},h.getValues=(e,t)=>[].concat(e[t]||[]),h.removeProperty=(e,t)=>{delete e[t]},h.removeValue=(e,t,r,n)=>{"propertyIsArray"in(n=n||{})||(n.propertyIsArray=!1);const i=h.getValues(e,t).filter((e=>!h.compareValues(e,r)));0===i.length?h.removeProperty(e,t):1!==i.length||n.propertyIsArray?e[t]=i:e[t]=i[0]},h.relabelBlankNodes=(e,t)=>f((t=t||{}).issuer||new o("_:b"),e),h.compareValues=(e,t)=>e===t||!(!n.isValue(e)||!n.isValue(t)||e["@value"]!==t["@value"]||e["@type"]!==t["@type"]||e["@language"]!==t["@language"]||e["@index"]!==t["@index"])||!!(i.isObject(e)&&"@id"in e&&i.isObject(t)&&"@id"in t)&&e["@id"]===t["@id"],h.compareShortestLeast=(e,t)=>e.length<t.length?-1:t.length<e.length?1:e===t?0:e<t?-1:1},3811:(e,t,r)=>{"use strict";const n=r(3854),i=Symbol("max"),o=Symbol("length"),a=Symbol("lengthCalculator"),s=Symbol("allowStale"),c=Symbol("maxAge"),u=Symbol("dispose"),l=Symbol("noDisposeOnSet"),h=Symbol("lruList"),f=Symbol("cache"),p=Symbol("updateAgeOnGet"),d=()=>1,y=(e,t,r)=>{const n=e[f].get(t);if(n){const t=n.value;if(v(e,t)){if(m(e,n),!e[s])return}else r&&(e[p]&&(n.value.now=Date.now()),e[h].unshiftNode(n));return t.value}},v=(e,t)=>{if(!t||!t.maxAge&&!e[c])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[c]&&r>e[c]},g=e=>{if(e[o]>e[i])for(let t=e[h].tail;e[o]>e[i]&&null!==t;){const r=t.prev;m(e,t),t=r}},m=(e,t)=>{if(t){const r=t.value;e[u]&&e[u](r.key,r.value),e[o]-=r.length,e[f].delete(r.key),e[h].removeNode(t)}};class b{constructor(e,t,r,n,i){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=i||0}}const w=(e,t,r,n)=>{let i=r.value;v(e,i)&&(m(e,r),e[s]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[i]=e.max||1/0;const t=e.length||d;if(this[a]="function"!=typeof t?d:t,this[s]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[c]=e.maxAge||0,this[u]=e.dispose,this[l]=e.noDisposeOnSet||!1,this[p]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[i]=e||1/0,g(this)}get max(){return this[i]}set allowStale(e){this[s]=!!e}get allowStale(){return this[s]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[c]=e,g(this)}get maxAge(){return this[c]}set lengthCalculator(e){"function"!=typeof e&&(e=d),e!==this[a]&&(this[a]=e,this[o]=0,this[h].forEach((e=>{e.length=this[a](e.value,e.key),this[o]+=e.length}))),g(this)}get lengthCalculator(){return this[a]}get length(){return this[o]}get itemCount(){return this[h].length}rforEach(e,t){t=t||this;for(let r=this[h].tail;null!==r;){const n=r.prev;w(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[h].head;null!==r;){const n=r.next;w(this,e,r,t),r=n}}keys(){return this[h].toArray().map((e=>e.key))}values(){return this[h].toArray().map((e=>e.value))}reset(){this[u]&&this[h]&&this[h].length&&this[h].forEach((e=>this[u](e.key,e.value))),this[f]=new Map,this[h]=new n,this[o]=0}dump(){return this[h].map((e=>!v(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[h]}set(e,t,r){if((r=r||this[c])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,s=this[a](t,e);if(this[f].has(e)){if(s>this[i])return m(this,this[f].get(e)),!1;const a=this[f].get(e).value;return this[u]&&(this[l]||this[u](e,a.value)),a.now=n,a.maxAge=r,a.value=t,this[o]+=s-a.length,a.length=s,this.get(e),g(this),!0}const p=new b(e,t,s,n,r);return p.length>this[i]?(this[u]&&this[u](e,t),!1):(this[o]+=p.length,this[h].unshift(p),this[f].set(e,this[h].head),g(this),!0)}has(e){if(!this[f].has(e))return!1;const t=this[f].get(e).value;return!v(this,t)}get(e){return y(this,e,!0)}peek(e){return y(this,e,!1)}pop(){const e=this[h].tail;return e?(m(this,e),e.value):null}del(e){m(this,this[f].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{const e=i-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[f].forEach(((e,t)=>y(this,t,!1)))}}},265:e=>{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},3854:(e,t,r)=>{"use strict";function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var r=0,i=arguments.length;r<i;r++)t.push(arguments[r]);return t}function i(e,t,r){var n=t===e.head?new s(r,null,t,e):new s(r,t,t.next,e);return null===n.next&&(e.tail=n),null===n.prev&&(e.head=n),e.length++,n}function o(e,t){e.tail=new s(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function a(e,t){e.head=new s(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function s(e,t,r,n){if(!(this instanceof s))return new s(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}e.exports=n,n.Node=s,n.create=n,n.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},n.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},n.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},n.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)o(this,arguments[e]);return this.length},n.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)a(this,arguments[e]);return this.length},n.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},n.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},n.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;null!==r;n++)e.call(t,r.value,n,this),r=r.next},n.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;null!==r;n--)e.call(t,r.value,n,this),r=r.prev},n.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},n.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},n.prototype.map=function(e,t){t=t||this;for(var r=new n,i=this.head;null!==i;)r.push(e.call(t,i.value,this)),i=i.next;return r},n.prototype.mapReverse=function(e,t){t=t||this;for(var r=new n,i=this.tail;null!==i;)r.push(e.call(t,i.value,this)),i=i.prev;return r},n.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=e(r,n.value,i),n=n.next;return r},n.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=e(r,n.value,i),n=n.prev;return r},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&i<e;i++)o=o.next;for(;null!==o&&i<t;i++,o=o.next)r.push(o.value);return r},n.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)r.push(o.value);return r},n.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,o=this.head;null!==o&&n<e;n++)o=o.next;var a=[];for(n=0;o&&n<t;n++)a.push(o.value),o=this.removeNode(o);for(null===o&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev),n=0;n<r.length;n++)o=i(this,o,r[n]);return a},n.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};try{r(265)(n)}catch(e){}},8720:e=>{"use strict";var t=function(e){return e!=e};e.exports=function(e,r){return 0===e&&0===r?1/e==1/r:e===r||!(!t(e)||!t(r))}},7402:(e,t,r)=>{"use strict";var n=r(9170),i=r(2550),o=r(8720),a=r(5280),s=r(9129),c=i(a(),Object);n(c,{getPolyfill:a,implementation:o,shim:s}),e.exports=c},5280:(e,t,r)=>{"use strict";var n=r(8720);e.exports=function(){return"function"==typeof Object.is?Object.is:n}},9129:(e,t,r)=>{"use strict";var n=r(5280),i=r(9170);e.exports=function(){var e=n();return i(Object,{is:e},{is:function(){return Object.is!==e}}),e}},8383:(e,t,r)=>{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,a=r(4418),s=Object.prototype.propertyIsEnumerable,c=!s.call({toString:null},"toString"),u=s.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(e){var t=e.constructor;return t&&t.prototype===e},f={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!f["$"+e]&&i.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{h(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===o.call(e),n=a(e),s=t&&"[object String]"===o.call(e),f=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=u&&r;if(s&&e.length>0&&!i.call(e,0))for(var y=0;y<e.length;++y)f.push(String(y));if(n&&e.length>0)for(var v=0;v<e.length;++v)f.push(String(v));else for(var g in e)d&&"prototype"===g||!i.call(e,g)||f.push(String(g));if(c)for(var m=function(e){if("undefined"==typeof window||!p)return h(e);try{return h(e)}catch(e){return!1}}(e),b=0;b<l.length;++b)m&&"constructor"===l[b]||!i.call(e,l[b])||f.push(l[b]);return f}}e.exports=n},806:(e,t,r)=>{"use strict";var n=Array.prototype.slice,i=r(4418),o=Object.keys,a=o?function(e){return o(e)}:r(8383),s=Object.keys;a.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return i(e)?s(n.call(e)):s(e)})}else Object.keys=a;return Object.keys||a},e.exports=a},4418:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},2530:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var s,c=[],u=!1,l=-1;function h(){u&&s&&(u=!1,s.length?c=s.concat(c):l=-1,c.length&&f())}function f(){if(!u){var e=a(h);u=!0;for(var t=c.length;t;){for(s=c,c=[];++l<t;)s&&s[l].run();l=-1,t=c.length}s=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function d(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new p(e,t)),1!==c.length||u||a(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=d,n.addListener=d,n.once=d,n.off=d,n.removeListener=d,n.removeAllListeners=d,n.emit=d,n.prependListener=d,n.prependOnceListener=d,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},6063:e=>{"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,r,n,i){r=r||"&",n=n||"=";var o={};if("string"!=typeof e||0===e.length)return o;var a=/\+/g;e=e.split(r);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var c=e.length;s>0&&c>s&&(c=s);for(var u=0;u<c;++u){var l,h,f,p,d=e[u].replace(a,"%20"),y=d.indexOf(n);y>=0?(l=d.substr(0,y),h=d.substr(y+1)):(l=d,h=""),f=decodeURIComponent(l),p=decodeURIComponent(h),t(o,f)?Array.isArray(o[f])?o[f].push(p):o[f]=[o[f],p]:o[f]=p}return o}},1957:e=>{"use strict";var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,r,n,i){return r=r||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(i){var o=encodeURIComponent(t(i))+n;return Array.isArray(e[i])?e[i].map((function(e){return o+encodeURIComponent(t(e))})).join(r):o+encodeURIComponent(t(e[i]))})).join(r):i?encodeURIComponent(t(i))+n+encodeURIComponent(t(e)):""}},5582:(e,t,r)=>{"use strict";t.decode=t.parse=r(6063),t.encode=t.stringify=r(1957)},5929:(e,t,r)=>{let n;e.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):e=>(n||(n=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)))},2948:(e,t,r)=>{e.exports=r(2874)},577:e=>{"use strict";e.exports=class e{constructor(e,t=new Map,r=0){this.prefix=e,this._existing=t,this.counter=r}clone(){const{prefix:t,_existing:r,counter:n}=this;return new e(t,new Map(r),n)}getId(e){const t=e&&this._existing.get(e);if(t)return t;const r=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,r),r}hasId(e){return this._existing.has(e)}getOldIds(){return[...this._existing.keys()]}}},4071:(e,t,r)=>{"use strict";r(4828);const n=self.crypto||self.msCrypto;e.exports=class{constructor(e){if(!n||!n.subtle)throw new Error("crypto.subtle not found.");if("sha256"===e)this.algorithm={name:"SHA-256"};else{if("sha1"!==e)throw new Error(`Unsupported algorithm "${e}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(e){this._content+=e}async digest(){const e=(new TextEncoder).encode(this._content),t=new Uint8Array(await n.subtle.digest(this.algorithm,e));let r="";for(let e=0;e<t.length;++e)r+=t[e].toString(16).padStart(2,"0");return r}}},6327:e=>{"use strict";const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",r="http://www.w3.org/2001/XMLSchema#string",n="NamedNode",i="BlankNode",o="Literal",a="DefaultGraph",s={};(()=>{const e="(?:<([^:]+:[^>]*)>)",t="A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_",r=t+"0-9-·̀-ͯ‿-⁀",n="(_:(?:["+t+"0-9])(?:(?:["+r+".])*(?:["+r+"]))?)",i="[ \\t]+",o="[ \\t]*",a="(?:"+e+"|"+n+")"+i,c=e+i,u="(?:"+e+"|"+n+'|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^'+e+")|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))"+o,l="(?:\\.|(?:(?:"+e+"|"+n+")"+o+"\\.))";s.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,s.empty=new RegExp("^"+o+"$"),s.quad=new RegExp("^"+o+a+c+u+l+o+"$")})(),e.exports=class e{static parse(e){const c=[],l={},h=e.split(s.eoln);let f=0;for(const e of h){if(f++,s.empty.test(e))continue;const h=e.match(s.quad);if(null===h)throw new Error("N-Quads parse error on line "+f+".");const y={subject:null,predicate:null,object:null,graph:null};if(void 0!==h[1]?y.subject={termType:n,value:h[1]}:y.subject={termType:i,value:h[2]},y.predicate={termType:n,value:h[3]},void 0!==h[4]?y.object={termType:n,value:h[4]}:void 0!==h[5]?y.object={termType:i,value:h[5]}:(y.object={termType:o,value:void 0,datatype:{termType:n}},void 0!==h[7]?y.object.datatype.value=h[7]:void 0!==h[8]?(y.object.datatype.value=t,y.object.language=h[8]):y.object.datatype.value=r,y.object.value=h[6].replace(u,(function(e,t,r,n){if(t)switch(t){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(r)return String.fromCharCode(parseInt(r,16));if(n)throw new Error("Unsupported U escape")}))),void 0!==h[9]?y.graph={termType:n,value:h[9]}:void 0!==h[10]?y.graph={termType:i,value:h[10]}:y.graph={termType:a,value:""},y.graph.value in l){let e=!0;const t=l[y.graph.value];for(const r of t)if(d=y,(p=r).subject.termType===d.subject.termType&&p.object.termType===d.object.termType&&p.subject.value===d.subject.value&&p.predicate.value===d.predicate.value&&p.object.value===d.object.value&&(p.object.termType!==o||p.object.datatype.termType===d.object.datatype.termType&&p.object.language===d.object.language&&p.object.datatype.value===d.object.datatype.value)){e=!1;break}e&&(t.push(y),c.push(y))}else l[y.graph.value]=[y],c.push(y)}var p,d;return c}static serialize(t){Array.isArray(t)||(t=e.legacyDatasetToQuads(t));const r=[];for(const n of t)r.push(e.serializeQuad(n));return r.sort().join("")}static serializeQuadComponents(e,o,a,s){let u="";return e.termType===n?u+=`<${e.value}>`:u+=`${e.value}`,u+=` <${o.value}> `,a.termType===n?u+=`<${a.value}>`:a.termType===i?u+=a.value:(u+=`"${function(e){return e.replace(c,(function(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}}))}(a.value)}"`,a.datatype.value===t?a.language&&(u+=`@${a.language}`):a.datatype.value!==r&&(u+=`^^<${a.datatype.value}>`)),s.termType===n?u+=` <${s.value}>`:s.termType===i&&(u+=` ${s.value}`),u+=" .\n",u}static serializeQuad(t){return e.serializeQuadComponents(t.subject,t.predicate,t.object,t.graph)}static legacyDatasetToQuads(e){const s=[],c={"blank node":i,IRI:n,literal:o};for(const u in e)e[u].forEach((e=>{const l={};for(const i in e){const a=e[i],s={termType:c[a.type],value:a.value};s.termType===o&&(s.datatype={termType:n},"datatype"in a&&(s.datatype.value=a.datatype),"language"in a?("datatype"in a||(s.datatype.value=t),s.language=a.language):"datatype"in a||(s.datatype.value=r)),l[i]=s}l.graph="@default"===u?{termType:a,value:""}:{termType:u.startsWith("_:")?i:n,value:u},s.push(l)}));return s}};const c=/["\\\n\r]/g,u=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},83:e=>{"use strict";e.exports=class{constructor(e){this.current=e.sort(),this.done=!1,this.dir=new Map;for(let t=0;t<e.length;++t)this.dir.set(e[t],!0)}hasNext(){return!this.done}next(){const{current:e,dir:t}=this,r=e.slice();let n=null,i=0;const o=e.length;for(let r=0;r<o;++r){const a=e[r],s=t.get(a);(null===n||a>n)&&(s&&r>0&&a>e[r-1]||!s&&r<o-1&&a>e[r+1])&&(n=a,i=r)}if(null===n)this.done=!0;else{const r=t.get(n)?i-1:i+1;e[i]=e[r],e[r]=n;for(const r of e)r>n&&t.set(r,!t.get(r))}return r}}},4515:(e,t,r)=>{"use strict";const n=r(577),i=r(4071),o=r(83),a=r(6327);function s(e,t){return e.hash<t.hash?-1:e.hash>t.hash?1:0}e.exports=class{constructor({createMessageDigest:e=(()=>new i("sha256")),maxDeepIterations:t=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new n("_:c14n"),this.createMessageDigest=e,this.maxDeepIterations=t,this.quads=null,this.deepIterations=null}async main(e){this.deepIterations=new Map,this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,r=[...this.blankNodeInfo.keys()];let i=0;for(const e of r)++i%100==0&&await this._yield(),await this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const o=[...t.keys()].sort(),c=[];for(const e of o){const r=t.get(e);if(r.length>1){c.push(r);continue}const n=r[0];this.canonicalIssuer.getId(n)}for(const e of c){const t=[];for(const r of e){if(this.canonicalIssuer.hasId(r))continue;const e=new n("_:b");e.getId(r);const i=await this.hashNDegreeQuads(r,e);t.push(i)}t.sort(s);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const u=[];for(const e of this.quads){const t=a.serializeQuadComponents(this._componentWithCanonicalId(e.subject),e.predicate,this._componentWithCanonicalId(e.object),this._componentWithCanonicalId(e.graph));u.push(t)}return u.sort(),u.join("")}async hashFirstDegreeQuads(e){const t=[],r=this.blankNodeInfo.get(e),n=r.quads;for(const r of n){const n={subject:null,predicate:r.predicate,object:null,graph:null};n.subject=this.modifyFirstDegreeComponent(e,r.subject,"subject"),n.object=this.modifyFirstDegreeComponent(e,r.object,"object"),n.graph=this.modifyFirstDegreeComponent(e,r.graph,"graph"),t.push(a.serializeQuad(n))}t.sort();const i=this.createMessageDigest();for(const e of t)i.update(e);return r.hash=await i.digest(),r.hash}async hashRelatedBlankNode(e,t,r,n){let i;i=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):r.hasId(e)?r.getId(e):this.blankNodeInfo.get(e).hash;const o=this.createMessageDigest();return o.update(n),"g"!==n&&o.update(this.getRelatedPredicate(t)),o.update(i),o.digest()}async hashNDegreeQuads(e,t){const r=this.deepIterations.get(e)||0;if(r>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,r+1);const n=this.createMessageDigest(),i=await this.createHashToRelated(e,t),a=[...i.keys()].sort();for(const e of a){n.update(e);let r,a="";const s=new o(i.get(e));let c=0;for(;s.hasNext();){const e=s.next();++c%3==0&&await this._yield();let n=t.clone(),i="";const o=[];let u=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?i+=this.canonicalIssuer.getId(t):(n.hasId(t)||o.push(t),i+=n.getId(t)),0!==a.length&&i>a){u=!0;break}if(!u){for(const e of o){const t=await this.hashNDegreeQuads(e,n);if(i+=n.getId(e),i+=`<${t.hash}>`,n=t.issuer,0!==a.length&&i>a){u=!0;break}}u||(0===a.length||i<a)&&(a=i,r=n)}}n.update(a),t=r}return{hash:await n.digest(),issuer:t}}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType?t:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return`<${e.predicate.value}>`}async createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;let i=0;for(const o of n)++i%100==0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:o,component:o.subject,position:"s",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:o,component:o.object,position:"o",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:o,component:o.graph,position:"g",id:e,issuer:t,hashToRelated:r})]);return r}async _hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const r=await this.hashFirstDegreeQuads(e),n=t.get(r);n?n.push(e):t.set(r,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const r=t.value,n=this.blankNodeInfo.get(r);n?n.quads.add(e):this.blankNodeInfo.set(r,{quads:new Set([e]),hash:null})}async _addRelatedBlankNodeHash({quad:e,component:t,position:r,id:n,issuer:i,hashToRelated:o}){if("BlankNode"!==t.termType||t.value===n)return;const a=t.value,s=await this.hashRelatedBlankNode(a,e,i,r),c=o.get(s);c?c.push(a):o.set(s,[a])}_componentWithCanonicalId(e){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}async _yield(){return new Promise((e=>setImmediate(e)))}}},2160:(e,t,r)=>{"use strict";const n=r(577),i=r(4071),o=r(83),a=r(6327);function s(e,t){return e.hash<t.hash?-1:e.hash>t.hash?1:0}e.exports=class{constructor({createMessageDigest:e=(()=>new i("sha256")),maxDeepIterations:t=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new n("_:c14n"),this.createMessageDigest=e,this.maxDeepIterations=t,this.quads=null,this.deepIterations=null}main(e){this.deepIterations=new Map,this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,r=[...this.blankNodeInfo.keys()];for(const e of r)this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const i=[...t.keys()].sort(),o=[];for(const e of i){const r=t.get(e);if(r.length>1){o.push(r);continue}const n=r[0];this.canonicalIssuer.getId(n)}for(const e of o){const t=[];for(const r of e){if(this.canonicalIssuer.hasId(r))continue;const e=new n("_:b");e.getId(r);const i=this.hashNDegreeQuads(r,e);t.push(i)}t.sort(s);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const c=[];for(const e of this.quads){const t=a.serializeQuadComponents(this._componentWithCanonicalId({component:e.subject}),e.predicate,this._componentWithCanonicalId({component:e.object}),this._componentWithCanonicalId({component:e.graph}));c.push(t)}return c.sort(),c.join("")}hashFirstDegreeQuads(e){const t=[],r=this.blankNodeInfo.get(e),n=r.quads;for(const r of n){const n={subject:null,predicate:r.predicate,object:null,graph:null};n.subject=this.modifyFirstDegreeComponent(e,r.subject,"subject"),n.object=this.modifyFirstDegreeComponent(e,r.object,"object"),n.graph=this.modifyFirstDegreeComponent(e,r.graph,"graph"),t.push(a.serializeQuad(n))}t.sort();const i=this.createMessageDigest();for(const e of t)i.update(e);return r.hash=i.digest(),r.hash}hashRelatedBlankNode(e,t,r,n){let i;i=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):r.hasId(e)?r.getId(e):this.blankNodeInfo.get(e).hash;const o=this.createMessageDigest();return o.update(n),"g"!==n&&o.update(this.getRelatedPredicate(t)),o.update(i),o.digest()}hashNDegreeQuads(e,t){const r=this.deepIterations.get(e)||0;if(r>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,r+1);const n=this.createMessageDigest(),i=this.createHashToRelated(e,t),a=[...i.keys()].sort();for(const e of a){n.update(e);let r,a="";const s=new o(i.get(e));for(;s.hasNext();){const e=s.next();let n=t.clone(),i="";const o=[];let c=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?i+=this.canonicalIssuer.getId(t):(n.hasId(t)||o.push(t),i+=n.getId(t)),0!==a.length&&i>a){c=!0;break}if(!c){for(const e of o){const t=this.hashNDegreeQuads(e,n);if(i+=n.getId(e),i+=`<${t.hash}>`,n=t.issuer,0!==a.length&&i>a){c=!0;break}}c||(0===a.length||i<a)&&(a=i,r=n)}}n.update(a),t=r}return{hash:n.digest(),issuer:t}}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType?t:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return`<${e.predicate.value}>`}createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;for(const i of n)this._addRelatedBlankNodeHash({quad:i,component:i.subject,position:"s",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:i,component:i.object,position:"o",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:i,component:i.graph,position:"g",id:e,issuer:t,hashToRelated:r});return r}_hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const r=this.hashFirstDegreeQuads(e),n=t.get(r);n?n.push(e):t.set(r,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const r=t.value,n=this.blankNodeInfo.get(r);n?n.quads.add(e):this.blankNodeInfo.set(r,{quads:new Set([e]),hash:null})}_addRelatedBlankNodeHash({quad:e,component:t,position:r,id:n,issuer:i,hashToRelated:o}){if("BlankNode"!==t.termType||t.value===n)return;const a=t.value,s=this.hashRelatedBlankNode(a,e,i,r),c=o.get(s);c?c.push(a):o.set(s,[a])}_componentWithCanonicalId({component:e}){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}}},3663:(e,t,r)=>{"use strict";const n=r(4071),i=r(4515);e.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new n("sha1")}modifyFirstDegreeComponent(e,t,r){return"BlankNode"!==t.termType?t:"graph"===r?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}async createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;let i=0;for(const o of n){let n,a;if("BlankNode"===o.subject.termType&&o.subject.value!==e)a=o.subject.value,n="p";else{if("BlankNode"!==o.object.termType||o.object.value===e)continue;a=o.object.value,n="r"}++i%100==0&&await this._yield();const s=await this.hashRelatedBlankNode(a,o,t,n),c=r.get(s);c?c.push(a):r.set(s,[a])}return r}}},5393:(e,t,r)=>{"use strict";const n=r(4071),i=r(2160);e.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new n("sha1")}modifyFirstDegreeComponent(e,t,r){return"BlankNode"!==t.termType?t:"graph"===r?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;for(const i of n){let n,o;if("BlankNode"===i.subject.termType&&i.subject.value!==e)o=i.subject.value,n="p";else{if("BlankNode"!==i.object.termType||i.object.value===e)continue;o=i.object.value,n="r"}const a=this.hashRelatedBlankNode(o,i,t,n),s=r.get(a);s?s.push(o):r.set(a,[o])}return r}}},2874:(e,t,r)=>{"use strict";const n=r(4515),i=r(3663),o=r(2160),a=r(5393);let s;try{s=r(7670)}catch(e){}t.NQuads=r(6327),t.IdentifierIssuer=r(577),t._rdfCanonizeNative=function(e){return e&&(s=e),s},t.canonize=async function(e,r){if(Array.isArray(e)||(e=t.NQuads.legacyDatasetToQuads(e)),r.useNative){if(!s)throw new Error("rdf-canonize-native not available");if(r.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise(((t,n)=>s.canonize(e,r,((e,r)=>e?n(e):t(r)))))}if("URDNA2015"===r.algorithm)return new n(r).main(e);if("URGNA2012"===r.algorithm){if(r.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new i(r).main(e)}if(!("algorithm"in r))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+r.algorithm)},t._canonizeSync=function(e,r){if(Array.isArray(e)||(e=t.NQuads.legacyDatasetToQuads(e)),r.useNative){if(!s)throw new Error("rdf-canonize-native not available");if(r.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return s.canonizeSync(e,r)}if("URDNA2015"===r.algorithm)return new o(r).main(e);if("URGNA2012"===r.algorithm){if(r.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new a(r).main(e)}if(!("algorithm"in r))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+r.algorithm)}},4828:function(e,t,r){var n=r(2530);!function(e,t){"use strict";if(!e.setImmediate){var r,i,o,a,s,c=1,u={},l=!1,h=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?r=function(e){n.nextTick((function(){d(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&d(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){d(e.data)},r=function(e){o.port2.postMessage(e)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,r=function(e){var t=h.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(d,0,e)},f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return u[c]=i,r(c),c++},f.clearImmediate=p}function p(e){delete u[e]}function d(e){if(l)setTimeout(d,0,e);else{var t=u[e];if(t){l=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(void 0,r)}}(t)}finally{p(e),l=!1}}}}}("undefined"==typeof self?void 0===r.g?this:r.g:self)},9523:e=>{const t={acl:"http://www.w3.org/ns/auth/acl#",arg:"http://www.w3.org/ns/pim/arg#",as:"https://www.w3.org/ns/activitystreams#",cal:"http://www.w3.org/2002/12/cal/ical#",cert:"http://www.w3.org/ns/auth/cert#",contact:"http://www.w3.org/2000/10/swap/pim/contact#",dc:"http://purl.org/dc/elements/1.1/",dct:"http://purl.org/dc/terms/",doap:"http://usefulinc.com/ns/doap#",foaf:"http://xmlns.com/foaf/0.1/",geo:"http://www.w3.org/2003/01/geo/wgs84_pos#",gpx:"http://www.w3.org/ns/pim/gpx#",http:"http://www.w3.org/2007/ont/http#",httph:"http://www.w3.org/2007/ont/httph#",icalTZ:"http://www.w3.org/2002/12/cal/icaltzd#",ldp:"http://www.w3.org/ns/ldp#",link:"http://www.w3.org/2007/ont/link#",log:"http://www.w3.org/2000/10/swap/log#",meeting:"http://www.w3.org/ns/pim/meeting#",mo:"http://purl.org/ontology/mo/",org:"http://www.w3.org/ns/org#",owl:"http://www.w3.org/2002/07/owl#",pad:"http://www.w3.org/ns/pim/pad#",patch:"http://www.w3.org/ns/pim/patch#",prov:"http://www.w3.org/ns/prov#",qu:"http://www.w3.org/2000/10/swap/pim/qif#",trip:"http://www.w3.org/ns/pim/trip#",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",rss:"http://purl.org/rss/1.0/",sched:"http://www.w3.org/ns/pim/schedule#",schema:"http://schema.org/",sioc:"http://rdfs.org/sioc/ns#",solid:"http://www.w3.org/ns/solid/terms#",space:"http://www.w3.org/ns/pim/space#",stat:"http://www.w3.org/ns/posix/stat#",tab:"http://www.w3.org/2007/ont/link#",tabont:"http://www.w3.org/2007/ont/link#",ui:"http://www.w3.org/ns/ui#",vcard:"http://www.w3.org/2006/vcard/ns#",wf:"http://www.w3.org/2005/01/wf/flow#",xsd:"http://www.w3.org/2001/XMLSchema#",cco:"http://www.ontologyrepository.com/CommonCoreOntologies/"};e.exports=function(e={namedNode:e=>e}){const r={};for(const n in t){const i=t[n];r[n]=function(t=""){return e.namedNode(i+t)}}return r}},8928:function(e,t,r){var n;e=r.nmd(e),function(i){t&&t.nodeType,e&&e.nodeType;var o="object"==typeof r.g&&r.g;o.global!==o&&o.window!==o&&o.self;var a,s=2147483647,c=36,u=/^xn--/,l=/[^\x20-\x7E]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,d=String.fromCharCode;function y(e){throw RangeError(f[e])}function v(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function g(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+v((e=e.replace(h,".")).split("."),t).join(".")}function m(e){for(var t,r,n=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function b(e){return v(e,(function(e){var t="";return e>65535&&(t+=d((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+d(e)})).join("")}function w(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function x(e,t,r){var n=0;for(e=r?p(e/700):e>>1,e+=p(e/t);e>455;n+=c)e=p(e/35);return p(n+36*e/(e+38))}function _(e){var t,r,n,i,o,a,u,l,h,f,d,v=[],g=e.length,m=0,w=128,_=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&y("not-basic"),v.push(e.charCodeAt(n));for(i=r>0?r+1:0;i<g;){for(o=m,a=1,u=c;i>=g&&y("invalid-input"),((l=(d=e.charCodeAt(i++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:c)>=c||l>p((s-m)/a))&&y("overflow"),m+=l*a,!(l<(h=u<=_?1:u>=_+26?26:u-_));u+=c)a>p(s/(f=c-h))&&y("overflow"),a*=f;_=x(m-o,t=v.length+1,0==o),p(m/t)>s-w&&y("overflow"),w+=p(m/t),m%=t,v.splice(m++,0,w)}return b(v)}function j(e){var t,r,n,i,o,a,u,l,h,f,v,g,b,_,j,k=[];for(g=(e=m(e)).length,t=128,r=0,o=72,a=0;a<g;++a)(v=e[a])<128&&k.push(d(v));for(n=i=k.length,i&&k.push("-");n<g;){for(u=s,a=0;a<g;++a)(v=e[a])>=t&&v<u&&(u=v);for(u-t>p((s-r)/(b=n+1))&&y("overflow"),r+=(u-t)*b,t=u,a=0;a<g;++a)if((v=e[a])<t&&++r>s&&y("overflow"),v==t){for(l=r,h=c;!(l<(f=h<=o?1:h>=o+26?26:h-o));h+=c)j=l-f,_=c-f,k.push(d(w(f+j%_,0))),l=p(j/_);k.push(d(w(l,0))),o=x(r,b,n==i),r=0,++n}++r,++t}return k.join("")}a={version:"1.3.2",ucs2:{decode:m,encode:b},decode:_,encode:j,toASCII:function(e){return g(e,(function(e){return l.test(e)?"xn--"+j(e):e}))},toUnicode:function(e){return g(e,(function(e){return u.test(e)?_(e.slice(4).toLowerCase()):e}))}},void 0===(n=function(){return a}.call(t,r,t,e))||(e.exports=n)}()},4044:(e,t,r)=>{"use strict";var n=r(8928),i=r(944);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(u),h=["%","/","?",";","#"].concat(l),f=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,y={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=r(5582);o.prototype.parse=function(e,t,r){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),s=-1!==o&&o<e.indexOf("#")?"?":"#",u=e.split(s);u[0]=u[0].replace(/\\/g,"/");var b=e=u.join(s);if(b=b.trim(),!r&&1===e.split("#").length){var w=c.exec(b);if(w)return this.path=b,this.href=b,this.pathname=w[1],w[2]?(this.search=w[2],this.query=t?m.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var x=a.exec(b);if(x){var _=(x=x[0]).toLowerCase();this.protocol=_,b=b.substr(x.length)}if(r||x||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var j="//"===b.substr(0,2);!j||x&&v[x]||(b=b.substr(2),this.slashes=!0)}if(!v[x]&&(j||x&&!g[x])){for(var k,T,O=-1,A=0;A<f.length;A++)-1!==(N=b.indexOf(f[A]))&&(-1===O||N<O)&&(O=N);for(-1!==(T=-1===O?b.lastIndexOf("@"):b.lastIndexOf("@",O))&&(k=b.slice(0,T),b=b.slice(T+1),this.auth=decodeURIComponent(k)),O=-1,A=0;A<h.length;A++){var N;-1!==(N=b.indexOf(h[A]))&&(-1===O||N<O)&&(O=N)}-1===O&&(O=b.length),this.host=b.slice(0,O),b=b.slice(O),this.parseHost(),this.hostname=this.hostname||"";var S="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!S)for(var E=this.hostname.split(/\./),I=(A=0,E.length);A<I;A++){var R=E[A];if(R&&!R.match(p)){for(var C="",D=0,L=R.length;D<L;D++)R.charCodeAt(D)>127?C+="x":C+=R[D];if(!C.match(p)){var P=E.slice(0,A),M=E.slice(A+1),F=R.match(d);F&&(P.push(F[1]),M.unshift(F[2])),M.length&&(b="/"+M.join(".")+b),this.hostname=P.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),S||(this.hostname=n.toASCII(this.hostname));var U=this.port?":"+this.port:"",B=this.hostname||"";this.host=B+U,this.href+=this.host,S&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!y[_])for(A=0,I=l.length;A<I;A++){var Z=l[A];if(-1!==b.indexOf(Z)){var q=encodeURIComponent(Z);q===Z&&(q=escape(Z)),b=b.split(Z).join(q)}}var H=b.indexOf("#");-1!==H&&(this.hash=b.substr(H),b=b.slice(0,H));var V=b.indexOf("?");if(-1!==V?(this.search=b.substr(V),this.query=b.substr(V+1),t&&(this.query=m.parse(this.query)),b=b.slice(0,V)):t&&(this.search="",this.query={}),b&&(this.pathname=b),g[_]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){U=this.pathname||"";var z=this.search||"";this.path=U+z}return this.href=this.format(),this},o.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,a="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(a=m.stringify(this.query));var s=this.search||a&&"?"+a||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||g[t])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),t+o+(r=r.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(s=s.replace("#","%23"))+n},o.prototype.resolve=function(e){return this.resolveObject(function(e,t,r){if(e&&i.isObject(e)&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}(e,!1,!0)).format()},o.prototype.resolveObject=function(e){if(i.isString(e)){var t=new o;t.parse(e,!1,!0),e=t}for(var r=new o,n=Object.keys(this),a=0;a<n.length;a++){var s=n[a];r[s]=this[s]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var c=Object.keys(e),u=0;u<c.length;u++){var l=c[u];"protocol"!==l&&(r[l]=e[l])}return g[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!g[e.protocol]){for(var h=Object.keys(e),f=0;f<h.length;f++){var p=h[f];r[p]=e[p]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||v[e.protocol])r.pathname=e.pathname;else{for(var d=(e.pathname||"").split("/");d.length&&!(e.host=d.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),r.pathname=d.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var y=r.pathname||"",m=r.search||"";r.path=y+m}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var b=r.pathname&&"/"===r.pathname.charAt(0),w=e.host||e.pathname&&"/"===e.pathname.charAt(0),x=w||b||r.host&&e.pathname,_=x,j=r.pathname&&r.pathname.split("/")||[],k=(d=e.pathname&&e.pathname.split("/")||[],r.protocol&&!g[r.protocol]);if(k&&(r.hostname="",r.port=null,r.host&&(""===j[0]?j[0]=r.host:j.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===d[0]?d[0]=e.host:d.unshift(e.host)),e.host=null),x=x&&(""===d[0]||""===j[0])),w)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,j=d;else if(d.length)j||(j=[]),j.pop(),j=j.concat(d),r.search=e.search,r.query=e.query;else if(!i.isNullOrUndefined(e.search))return k&&(r.hostname=r.host=j.shift(),(S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift())),r.search=e.search,r.query=e.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!j.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var T=j.slice(-1)[0],O=(r.host||e.host||j.length>1)&&("."===T||".."===T)||""===T,A=0,N=j.length;N>=0;N--)"."===(T=j[N])?j.splice(N,1):".."===T?(j.splice(N,1),A++):A&&(j.splice(N,1),A--);if(!x&&!_)for(;A--;A)j.unshift("..");!x||""===j[0]||j[0]&&"/"===j[0].charAt(0)||j.unshift(""),O&&"/"!==j.join("/").substr(-1)&&j.push("");var S,E=""===j[0]||j[0]&&"/"===j[0].charAt(0);return k&&(r.hostname=r.host=E?"":j.length?j.shift():"",(S=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=S.shift(),r.host=r.hostname=S.shift())),(x=x||r.host&&j.length)&&!E&&j.unshift(""),j.length?r.pathname=j.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},944:e=>{"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},9397:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},4489:(e,t,r)=>{"use strict";var n=r(7092),i=r(7427),o=r(4010),a=r(2527);function s(e){return e.call.bind(e)}var c="undefined"!=typeof BigInt,u="undefined"!=typeof Symbol,l=s(Object.prototype.toString),h=s(Number.prototype.valueOf),f=s(String.prototype.valueOf),p=s(Boolean.prototype.valueOf);if(c)var d=s(BigInt.prototype.valueOf);if(u)var y=s(Symbol.prototype.valueOf);function v(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function g(e){return"[object Map]"===l(e)}function m(e){return"[object Set]"===l(e)}function b(e){return"[object WeakMap]"===l(e)}function w(e){return"[object WeakSet]"===l(e)}function x(e){return"[object ArrayBuffer]"===l(e)}function _(e){return"undefined"!=typeof ArrayBuffer&&(x.working?x(e):e instanceof ArrayBuffer)}function j(e){return"[object DataView]"===l(e)}function k(e){return"undefined"!=typeof DataView&&(j.working?j(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=i,t.isTypedArray=a,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):a(e)||k(e)},t.isUint8Array=function(e){return"Uint8Array"===o(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===o(e)},t.isUint16Array=function(e){return"Uint16Array"===o(e)},t.isUint32Array=function(e){return"Uint32Array"===o(e)},t.isInt8Array=function(e){return"Int8Array"===o(e)},t.isInt16Array=function(e){return"Int16Array"===o(e)},t.isInt32Array=function(e){return"Int32Array"===o(e)},t.isFloat32Array=function(e){return"Float32Array"===o(e)},t.isFloat64Array=function(e){return"Float64Array"===o(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===o(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===o(e)},g.working="undefined"!=typeof Map&&g(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(g.working?g(e):e instanceof Map)},m.working="undefined"!=typeof Set&&m(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(m.working?m(e):e instanceof Set)},b.working="undefined"!=typeof WeakMap&&b(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(b.working?b(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},x.working="undefined"!=typeof ArrayBuffer&&x(new ArrayBuffer),t.isArrayBuffer=_,j.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&j(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=k;var T="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function O(e){return"[object SharedArrayBuffer]"===l(e)}function A(e){return void 0!==T&&(void 0===O.working&&(O.working=O(new T)),O.working?O(e):e instanceof T)}function N(e){return v(e,h)}function S(e){return v(e,f)}function E(e){return v(e,p)}function I(e){return c&&v(e,d)}function R(e){return u&&v(e,y)}t.isSharedArrayBuffer=A,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===l(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===l(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===l(e)},t.isGeneratorObject=function(e){return"[object Generator]"===l(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===l(e)},t.isNumberObject=N,t.isStringObject=S,t.isBooleanObject=E,t.isBigIntObject=I,t.isSymbolObject=R,t.isBoxedPrimitive=function(e){return N(e)||S(e)||E(e)||I(e)||R(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(_(e)||A(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},5663:(e,t,r)=>{var n=r(2530),i=r(292),o=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},a=/%[sdj%]/g;t.format=function(e){if(!w(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(l(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,i=n.length,o=String(e).replace(a,(function(e){if("%%"===e)return"%";if(r>=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),s=n[r];r<i;s=n[++r])m(s)||!j(s)?o+=" "+s:o+=" "+l(s);return o},t.deprecate=function(e,r){if(void 0!==n&&!0===n.noDeprecation)return e;if(void 0===n)return function(){return t.deprecate(e,r).apply(this,arguments)};var o=!1;return function(){if(!o){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?i.trace(r):i.error(r),o=!0}return e.apply(this,arguments)}};var s={},c=/^$/;if(n.env.NODE_DEBUG){var u=n.env.NODE_DEBUG;u=u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),c=new RegExp("^"+u+"$","i")}function l(e,r){var n={seen:[],stylize:f};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&t._extend(n,r),x(n.showHidden)&&(n.showHidden=!1),x(n.depth)&&(n.depth=2),x(n.colors)&&(n.colors=!1),x(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=h),p(n,e,n.depth)}function h(e,t){var r=l.styles[t];return r?"["+l.colors[r][0]+"m"+e+"["+l.colors[r][1]+"m":e}function f(e,t){return e}function p(e,r,n){if(e.customInspect&&r&&O(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return w(i)||(i=p(e,i,n)),i}var o=function(e,t){if(x(t))return e.stylize("undefined","undefined");if(w(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return b(t)?e.stylize(""+t,"number"):g(t)?e.stylize(""+t,"boolean"):m(t)?e.stylize("null","null"):void 0}(e,r);if(o)return o;var a=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),T(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return d(r);if(0===a.length){if(O(r)){var c=r.name?": "+r.name:"";return e.stylize("[Function"+c+"]","special")}if(_(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(k(r))return e.stylize(Date.prototype.toString.call(r),"date");if(T(r))return d(r)}var u,l="",h=!1,f=["{","}"];return v(r)&&(h=!0,f=["[","]"]),O(r)&&(l=" [Function"+(r.name?": "+r.name:"")+"]"),_(r)&&(l=" "+RegExp.prototype.toString.call(r)),k(r)&&(l=" "+Date.prototype.toUTCString.call(r)),T(r)&&(l=" "+d(r)),0!==a.length||h&&0!=r.length?n<0?_(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),u=h?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a<s;++a)I(t,String(a))?o.push(y(e,t,r,n,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(y(e,t,r,n,i,!0))})),o}(e,r,n,s,a):a.map((function(t){return y(e,r,n,s,t,h)})),e.seen.pop(),function(e,t,r){return e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(u,l,f)):f[0]+l+f[1]}function d(e){return"["+Error.prototype.toString.call(e)+"]"}function y(e,t,r,n,i,o){var a,s,c;if((c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(s=e.stylize("[Setter]","special")),I(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(c.value)<0?(s=m(r)?p(e,c.value,null):p(e,c.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),x(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function v(e){return Array.isArray(e)}function g(e){return"boolean"==typeof e}function m(e){return null===e}function b(e){return"number"==typeof e}function w(e){return"string"==typeof e}function x(e){return void 0===e}function _(e){return j(e)&&"[object RegExp]"===A(e)}function j(e){return"object"==typeof e&&null!==e}function k(e){return j(e)&&"[object Date]"===A(e)}function T(e){return j(e)&&("[object Error]"===A(e)||e instanceof Error)}function O(e){return"function"==typeof e}function A(e){return Object.prototype.toString.call(e)}function N(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!s[e])if(c.test(e)){var r=n.pid;s[e]=function(){var n=t.format.apply(t,arguments);i.error("%s %d: %s",e,r,n)}}else s[e]=function(){};return s[e]},t.inspect=l,l.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(4489),t.isArray=v,t.isBoolean=g,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=b,t.isString=w,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=x,t.isRegExp=_,t.types.isRegExp=_,t.isObject=j,t.isDate=k,t.types.isDate=k,t.isError=T,t.types.isNativeError=T,t.isFunction=O,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(9397);var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function E(){var e=new Date,t=[N(e.getHours()),N(e.getMinutes()),N(e.getSeconds())].join(":");return[e.getDate(),S[e.getMonth()],t].join(" ")}function I(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){i.log("%s - %s",E(),t.format.apply(t,arguments))},t.inherits=r(8575),t._extend=function(e,t){if(!t||!j(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var R="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function C(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(R&&e[R]){var t;if("function"!=typeof(t=e[R]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,R,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(e,n){e?r(e):t(n)}));try{e.apply(this,i)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),R&&Object.defineProperty(t,R,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,o(e))},t.promisify.custom=R,t.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var i=t.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,a=function(){return i.apply(o,arguments)};e.apply(this,t).then((function(e){n.nextTick(a.bind(null,null,e))}),(function(e){n.nextTick(C.bind(null,e,a))}))}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,o(e)),t}},4010:(e,t,r)=>{"use strict";var n=r(4843),i=r(4343),o=r(7615),a=r(3828),s=o("Object.prototype.toString"),c=r(4111)(),u="undefined"==typeof globalThis?r.g:globalThis,l=i(),h=o("String.prototype.slice"),f={},p=Object.getPrototypeOf;c&&a&&p&&n(l,(function(e){if("function"==typeof u[e]){var t=new u[e];if(Symbol.toStringTag in t){var r=p(t),n=a(r,Symbol.toStringTag);if(!n){var i=p(r);n=a(i,Symbol.toStringTag)}f[e]=n.get}}}));var d=r(2527);e.exports=function(e){return!!d(e)&&(c&&Symbol.toStringTag in e?function(e){var t=!1;return n(f,(function(r,n){if(!t)try{var i=r.call(e);i===n&&(t=i)}catch(e){}})),t}(e):h(s(e),8,-1))}},870:t=>{"use strict";t.exports=e},7670:()=>{},3333:(e,t,r)=>{var n=r(2125).default;function i(){"use strict";e.exports=i=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},s="function"==typeof Symbol?Symbol:{},c=s.iterator||"@@iterator",u=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function h(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{h({},"")}catch(e){h=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var i=t&&t.prototype instanceof y?t:y,o=Object.create(i.prototype),s=new N(n||[]);return a(o,"_invoke",{value:k(e,r,s)}),o}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=f;var d={};function y(){}function v(){}function g(){}var m={};h(m,c,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(S([])));w&&w!==r&&o.call(w,c)&&(m=w);var x=g.prototype=y.prototype=Object.create(m);function _(e){["next","throw","return"].forEach((function(t){h(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function r(i,a,s,c){var u=p(e[i],e,a);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==n(h)&&o.call(h,"__await")?t.resolve(h.__await).then((function(e){r("next",e,s,c)}),(function(e){r("throw",e,s,c)})):t.resolve(h).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,c)}))}c(u.arg)}var i;a(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}})}function k(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return{value:void 0,done:!0}}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=T(a,r);if(s){if(s===d)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=p(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===d)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function T(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,T(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var i=p(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,d;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function S(e){if(e){var t=e[c];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;)if(o.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:E}}function E(){return{value:void 0,done:!0}}return v.prototype=g,a(x,"constructor",{value:g,configurable:!0}),a(g,"constructor",{value:v,configurable:!0}),v.displayName=h(g,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,h(e,l,"GeneratorFunction")),e.prototype=Object.create(x),e},t.awrap=function(e){return{__await:e}},_(j.prototype),h(j.prototype,u,(function(){return this})),t.AsyncIterator=j,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new j(f(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},_(x),h(x,l,"Generator"),h(x,c,(function(){return this})),h(x,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=S,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(A),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},t}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},2125:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},8047:(e,t,r)=>{var n=r(3333)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},4343:(e,t,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t<n.length;t++)"function"==typeof i[n[t]]&&(e[e.length]=n[t]);return e}},4771:(e,t,r)=>{"use strict";function n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}r.d(t,{Z:()=>n})},7061:(e,t,r)=>{"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}r.d(t,{Z:()=>n})},9900:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(8965);function i(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(0,n.Z)(i.key),i)}}function o(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}},240:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(8965);function i(e,t,r){return(t=(0,n.Z)(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},886:(e,t,r)=>{"use strict";function n(e){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},n(e)}r.d(t,{Z:()=>n})},4768:(e,t,r)=>{"use strict";function n(e,t){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},n(e,t)}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&n(e,t)}r.d(t,{Z:()=>i})},4593:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(7209),i=r(4771);function o(e,t){if(t&&("object"===(0,n.Z)(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return(0,i.Z)(e)}},8965:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(7209);function i(e){var t=function(e,t){if("object"!==(0,n.Z)(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,"string");if("object"!==(0,n.Z)(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===(0,n.Z)(t)?t:String(t)}},7209:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}r.d(t,{Z:()=>n})}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var o=r[e]={id:e,loaded:!1,exports:{}};return t[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var i={};return(()=>{"use strict";n.r(i),n.d(i,{BlankNode:()=>p,Collection:()=>w,ConnectedStore:()=>Lr,DataFactory:()=>dr,Empty:()=>x,Fetcher:()=>ir,Formula:()=>ne,IndexedFormula:()=>ge,Literal:()=>m,LiveStore:()=>Pr,N3Parser:()=>Ze,NamedNode:()=>y.Z,Namespace:()=>B,NextId:()=>Dr,Node:()=>ie,Query:()=>se,RDFParser:()=>Pt,RDFaProcessor:()=>Dt,SPARQLToQuery:()=>sr,Serializer:()=>G,Statement:()=>I,Store:()=>ge,UpdateManager:()=>lr,UpdatesSocket:()=>yr,UpdatesVia:()=>vr,Util:()=>Z,Variable:()=>L,blankNode:()=>Or,defaultGraph:()=>Ar,fetcher:()=>wr,fromNT:()=>Rr,graph:()=>xr,isBlankNode:()=>v.B2,isCollection:()=>v.uZ,isGraph:()=>v.NA,isLiteral:()=>v.n_,isNamedNode:()=>v.NX,isPredicate:()=>v.lx,isQuad:()=>v.PY,isRDFObject:()=>v.lt,isRDFlibObject:()=>v.Uc,isRDFlibPredicate:()=>v.nq,isRDFlibSubject:()=>v.f,isStatement:()=>v.Yi,isStore:()=>v.Pv,isSubject:()=>v.zz,isTerm:()=>v.jt,isVariable:()=>v.cG,jsonParser:()=>or,lit:()=>_r,literal:()=>Nr,log:()=>U.Z,namedNode:()=>kr,parse:()=>Ft,quad:()=>Sr,queryToSPARQL:()=>ar,serialize:()=>J,sparqlUpdateParser:()=>Mt,st:()=>jr,sym:()=>kr,term:()=>Cr,termValue:()=>Zt._,triple:()=>Er,uri:()=>R,variable:()=>Tr});var e=n(9900),t=n(7061),r=n(4771),o=n(4768),a=n(4593),s=n(886),c=n(240),u=n(8333),l=n(4806),h=n(9247),f=n(292);var p=function(n){(0,o.Z)(d,n);var i,l,p=(i=d,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=(0,s.Z)(i);if(l){var r=(0,s.Z)(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return(0,a.Z)(this,e)});function d(e){var n;return(0,t.Z)(this,d),n=p.call(this,d.getId(e)),(0,c.Z)((0,r.Z)(n),"termType",h.V1),(0,c.Z)((0,r.Z)(n),"classOrder",u.Z.BlankNode),(0,c.Z)((0,r.Z)(n),"isBlank",1),(0,c.Z)((0,r.Z)(n),"isVar",1),n}return(0,e.Z)(d,[{key:"id",get:function(){return this.value},set:function(e){this.value=e}},{key:"compareTerm",value:function(e){return this.classOrder<e.classOrder?-1:this.classOrder>e.classOrder?1:this.id<e.id?-1:this.id>e.id?1:0}},{key:"copy",value:function(e){var t=new d;return e.copyTo(this,t),t}},{key:"toCanonical",value:function(){return d.NTAnonymousNodePrefix+this.value}},{key:"toString",value:function(){return d.NTAnonymousNodePrefix+this.id}}],[{key:"getId",value:function(e){if(e){if("string"!=typeof e)throw f.log("Bad blank id:",e),new Error("Bad id argument to new blank node: "+e);if(e.includes("#")){var t=e.split("#");return t[t.length-1]}return e}return"n"+d.nextId++}}]),d}(l.Z);(0,c.Z)(p,"nextId",0),(0,c.Z)(p,"NTAnonymousNodePrefix","_:");var d=n(7209),y=n(6545),v=n(5904);const g={boolean:new y.Z("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:new y.Z("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:new y.Z("http://www.w3.org/2001/XMLSchema#decimal"),double:new y.Z("http://www.w3.org/2001/XMLSchema#double"),integer:new y.Z("http://www.w3.org/2001/XMLSchema#integer"),langString:new y.Z("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:new y.Z("http://www.w3.org/2001/XMLSchema#string")};var m=function(n){(0,o.Z)(p,n);var i,l,f=(i=p,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=(0,s.Z)(i);if(l){var r=(0,s.Z)(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return(0,a.Z)(this,e)});function p(e,n,i){var o;return(0,t.Z)(this,p),o=f.call(this,e),(0,c.Z)((0,r.Z)(o),"termType",h.xH),(0,c.Z)((0,r.Z)(o),"classOrder",u.Z.Literal),(0,c.Z)((0,r.Z)(o),"datatype",g.string),(0,c.Z)((0,r.Z)(o),"isVar",0),(0,c.Z)((0,r.Z)(o),"language",""),n?(o.language=n,o.datatype=g.langString):o.datatype=i?y.Z.fromValue(i):g.string,o}return(0,e.Z)(p,[{key:"copy",value:function(){return new p(this.value,this.lang,this.datatype)}},{key:"equals",value:function(e){return!!e&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&(!this.datatype&&!e.datatype||this.datatype&&this.datatype.equals(e.datatype))}},{key:"lang",get:function(){return this.language},set:function(e){this.language=e||""}},{key:"toNT",value:function(){return p.toNT(this)}},{key:"toString",value:function(){return""+this.value}}],[{key:"toNT",value:function(e){if("number"==typeof e.value)return""+e.value;if("string"!=typeof e.value)throw new Error("Value of RDF literal is not string or number: "+e.value);var t=e.value;return t='"'+(t=(t=(t=(t=t.replace(/\\/g,"\\\\")).replace(/\"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r"))+'"',e.language?t+="@"+e.language:e.datatype.equals(g.string)||(t+="^^"+e.datatype.toCanonical()),t}},{key:"fromBoolean",value:function(e){return new p(e?"1":"0",null,g.boolean)}},{key:"fromDate",value:function(e){if(!(e instanceof Date))throw new TypeError("Invalid argument to Literal.fromDate()");var t=function(e){return(""+(100+e)).slice(1,3)};return new p(e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"Z",null,g.dateTime)}},{key:"fromNumber",value:function(e){if("number"!=typeof e)throw new TypeError("Invalid argument to Literal.fromNumber()");var t,r=e.toString();return t=r.indexOf("e")<0&&Math.abs(e)<=Number.MAX_SAFE_INTEGER?Number.isInteger(e)?g.integer:g.decimal:g.double,new p(r,null,t)}},{key:"fromValue",value:function(e){if((0,v.n_)(e))return e;switch((0,d.Z)(e)){case"object":if(e instanceof Date)return p.fromDate(e);case"boolean":return p.fromBoolean(e);case"number":return p.fromNumber(e);case"string":return new p(e)}throw new Error("Can't make literal from "+e+" of type "+(0,d.Z)(e))}}]),p}(l.Z);function b(e){return null==e||(0,v.jt)(e)?e:Array.isArray(e)?new w(e):m.fromValue(e)}var w=function(n){(0,o.Z)(d,n);var i,l,f=(i=d,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=(0,s.Z)(i);if(l){var r=(0,s.Z)(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return(0,a.Z)(this,e)});function d(e){var n;return(0,t.Z)(this,d),n=f.call(this,(p.nextId++).toString()),(0,c.Z)((0,r.Z)(n),"termType",h.fb),(0,c.Z)((0,r.Z)(n),"classOrder",u.Z.Collection),(0,c.Z)((0,r.Z)(n),"closed",!1),(0,c.Z)((0,r.Z)(n),"compareTerm",p.prototype.compareTerm),(0,c.Z)((0,r.Z)(n),"elements",[]),(0,c.Z)((0,r.Z)(n),"isVar",0),e&&e.length>0&&e.forEach((function(e){n.elements.push(b(e))})),n}return(0,e.Z)(d,[{key:"id",get:function(){return this.value},set:function(e){this.value=e}},{key:"append",value:function(e){return this.elements.push(e)}},{key:"close",value:function(){return this.closed=!0,this.closed}},{key:"shift",value:function(){return this.elements.shift()}},{key:"substitute",value:function(e){return new d(this.elements.map((function(t){return t.substitute(e)})))}},{key:"toNT",value:function(){return d.toNT(this)}},{key:"toString",value:function(){return"("+this.elements.join(" ")+")"}},{key:"unshift",value:function(e){return this.elements.unshift(e)}}],[{key:"toNT",value:function(e){return p.NTAnonymousNodePrefix+e.id}}]),d}(l.Z);(0,c.Z)(w,"termType",h.fb);var x=function(n){(0,o.Z)(f,n);var i,u,l=(i=f,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=(0,s.Z)(i);if(u){var r=(0,s.Z)(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return(0,a.Z)(this,e)});function f(){var e;return(0,t.Z)(this,f),e=l.call(this,""),(0,c.Z)((0,r.Z)(e),"termType",h.ls),e}return(0,e.Z)(f,[{key:"toString",value:function(){return"()"}}]),f}(l.Z);function _(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}function j(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){_(o,n,i,a,s,"next",e)}function s(e){_(o,n,i,a,s,"throw",e)}a(void 0)}))}}var k=n(8047),T=n.n(k),O="chrome:theSession";new y.Z(O);var A=function(n){(0,o.Z)(f,n);var i,u,l=(i=f,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=(0,s.Z)(i);if(u){var r=(0,s.Z)(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return(0,a.Z)(this,e)});function f(){var e;return(0,t.Z)(this,f),e=l.call(this,""),(0,c.Z)((0,r.Z)(e),"value",""),(0,c.Z)((0,r.Z)(e),"termType",h.NK),(0,c.Z)((0,r.Z)(e),"uri",O),e}return(0,e.Z)(f,[{key:"toCanonical",value:function(){return this.value}},{key:"toString",value:function(){return"DefaultGraph"}}]),f}(l.Z);function N(e){return!!e&&e.termType===h.NK}var S=n(292),E=new A,I=function(){function r(e,n,i,o){(0,t.Z)(this,r),(0,c.Z)(this,"subject",void 0),(0,c.Z)(this,"predicate",void 0),(0,c.Z)(this,"object",void 0),(0,c.Z)(this,"graph",void 0),this.subject=l.Z.fromValue(e),this.predicate=l.Z.fromValue(n),this.object=l.Z.fromValue(i),this.graph=null==o?E:l.Z.fromValue(o)}return(0,e.Z)(r,[{key:"why",get:function(){return this.graph},set:function(e){this.graph=e}},{key:"equals",value:function(e){return e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)}},{key:"substitute",value:function(e){var t=new r(this.subject.substitute(e),this.predicate.substitute(e),this.object.substitute(e),N(this.graph)?this.graph:this.graph.substitute(e));return S.log("@@@ statement substitute:"+t),t}},{key:"toCanonical",value:function(){var e=[this.subject.toCanonical(),this.predicate.toCanonical(),this.object.toCanonical()];return this.graph&&this.graph.termType!==h.NK&&e.push(this.graph.toCanonical()),e.join(" ")+" ."}},{key:"toNT",value:function(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT()].join(" ")+" ."}},{key:"toNQ",value:function(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT(),N(this.graph)?"":this.graph.toNT()].join(" ")+" ."}},{key:"toString",value:function(){return this.toNT()}}]),r}(),R=n(3357);var C,D,L=function(n){(0,o.Z)(p,n);var i,l,f=(i=p,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=(0,s.Z)(i);if(l){var r=(0,s.Z)(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return(0,a.Z)(this,e)});function p(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,t.Z)(this,p),e=f.call(this,n),(0,c.Z)((0,r.Z)(e),"termType",h.UH),(0,c.Z)((0,r.Z)(e),"base","varid:"),(0,c.Z)((0,r.Z)(e),"classOrder",u.Z.Variable),(0,c.Z)((0,r.Z)(e),"isVar",1),(0,c.Z)((0,r.Z)(e),"uri",void 0),e.base="varid:",e.uri=R.join(n,e.base),e}return(0,e.Z)(p,[{key:"equals",value:function(e){return!!e&&this.termType===e.termType&&this.value===e.value}},{key:"hashString",value:function(){return this.toString()}},{key:"substitute",value:function(e){var t;return null!=(t=e[this.toNT()])?t:this}},{key:"toString",value:function(){return p.toString(this)}}],[{key:"toString",value:function(e){return e.uri.slice(0,e.base.length)===e.base?"?".concat(e.uri.slice(e.base.length)):"?".concat(e.uri)}}]),p}(l.Z);!function(e){e.collections="COLLECTIONS",e.defaultGraphType="DEFAULT_GRAPH_TYPE",e.equalsMethod="EQUALS_METHOD",e.id="ID",e.identity="IDENTITY",e.reversibleId="REVERSIBLE_ID",e.variableType="VARIABLE_TYPE"}(C||(C={}));var P=new A,M={supports:(D={},(0,c.Z)(D,C.collections,!1),(0,c.Z)(D,C.defaultGraphType,!1),(0,c.Z)(D,C.equalsMethod,!0),(0,c.Z)(D,C.identity,!1),(0,c.Z)(D,C.id,!0),(0,c.Z)(D,C.reversibleId,!1),(0,c.Z)(D,C.variableType,!0),D),blankNode:function(e){return new p(e)},defaultGraph:function(){return P},equals:function(e,t){return e===t||!e||!t||((0,v.PY)(e)||(0,v.PY)(t)?!(!(0,v.PY)(e)||!(0,v.PY)(t))&&this.equals(e.subject,t.subject)&&this.equals(e.predicate,t.predicate)&&this.equals(e.object,t.object)&&this.equals(e.graph,t.graph):!(!(0,v.jt)(e)||!(0,v.jt)(t))&&this.id(e)===this.id(t))},id:function(e){if(!e)return"undefined";if((0,v.PY)(e))return this.quadToNQ(e);switch(e.termType){case h.NK:return"defaultGraph";case h.UH:return L.toString(e);default:var t=this.termToNQ(e);if(t)return t;throw new Error("Can't id term with type '".concat(e.termType,"'"))}},isQuad:function(e){return e instanceof I},literal:function(e,t){if("string"!=typeof e&&!t)return m.fromValue(e);var r="string"==typeof e?e:""+e;return"string"==typeof t?-1===t.indexOf(":")?new m(r,t):new m(r,null,this.namedNode(t)):new m(r,null,t)},namedNode:function(e){return new y.Z(e)},quad:function(e,t,r,n){return new I(e,t,r,n||P)},triple:function(e,t,r,n){return this.quad(e,t,r,n)},quadToNQ:function(e){return"".concat(this.termToNQ(e.subject)," ").concat(this.termToNQ(e.predicate)," ").concat(this.termToNQ(e.object)," ").concat(this.termToNQ(e.graph)," .")},termToNQ:function(e){var t=this;switch(e.termType){case h.V1:return"_:"+e.value;case h.NK:return"";case h.ls:return"<http://www.w3.org/1999/02/22-rdf-syntax-ns#nil>";case h.xH:return m.toNT(e);case h._A:case h.XM:return"<"+e.value+">";case h.fb:return"("+e.elements.map((function(e){return t.termToNQ(e)})).join(" ")+")";default:throw new Error("Can't serialize nonstandard term type (was '".concat(e.termType,"')"))}},toNQ:function(e){return this.isQuad(e)?this.quadToNQ(e):this.termToNQ(e)},variable:function(e){return new L(e)}};const F=M;var U=n(7308);function B(e,t){var r=t||{namedNode:function(e){return new y.Z(e)}};return function(t){return r.namedNode(e+(t||""))}}var Z=n(5115);function q(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:F;return{boolean:e.namedNode("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:e.namedNode("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:e.namedNode("http://www.w3.org/2001/XMLSchema#decimal"),double:e.namedNode("http://www.w3.org/2001/XMLSchema#double"),integer:e.namedNode("http://www.w3.org/2001/XMLSchema#integer"),langString:e.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:e.namedNode("http://www.w3.org/2001/XMLSchema#string")}}q(F);var H=n(9523),V=n.n(H),z=n(5619),$=n(292);function G(e){return new X(e)}var X=function(){function r(e){(0,t.Z)(this,r),(0,c.Z)(this,"_notQNameChars","\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~"),(0,c.Z)(this,"_notNameChars",this._notQNameChars+":"),(0,c.Z)(this,"validPrefix",new RegExp(/^[a-zA-Z][a-zA-Z0-9]*$/)),(0,c.Z)(this,"forbidden1",new RegExp(/[\\"\b\f\r\v\t\n\u0080-\uffff]/gm)),(0,c.Z)(this,"forbidden3",new RegExp(/[\\"\b\f\r\v\u0080-\uffff]/gm)),this.flags="",this.base=null,this.prefixes=[],this.namespaces=[];var n=Object.keys(V()());for(var i in n){var o=V()()[n[i]](""),a=n[i];this.prefixes[o]=a,this.namespaces[a]=o}this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.suggestPrefix("xml","reserved:reservedForFutureUse"),this.namespacesUsed=[],this.keywords=["a"],this.prefixchars="abcdefghijklmnopqustuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",this.incoming=null,this.formulas=[],this.store=e,this.rdfFactory=e.rdfFactory||F,this.xsd=q(this.rdfFactory)}return(0,e.Z)(r,[{key:"setBase",value:function(e){return this.base=e,this}},{key:"setFlags",value:function(e){return this.flags=e||"",this}},{key:"toStr",value:function(e){var t=e.toNT();return"Graph"===e.termType&&(this.formulas[t]=e),t}},{key:"fromStr",value:function(e){if("{"===e[0]){var t=this.formulas[e];return t||$.log("No formula object for "+e),t}return this.store.fromNT(e)}},{key:"setNamespaces",value:function(e){for(var t in e)this.setPrefix(t,e[t]);return this}},{key:"setPrefix",value:function(e,t){if("default"!==e.slice(0,7)&&"ns"!==e.slice(0,2)&&e&&t){for(var r in this.prefixes)this.prefixes[r]==e&&delete this.prefixes[r];this.prefixes[t]=e,this.namespaces[e]=t}}},{key:"suggestPrefix",value:function(e,t){"default"!==e.slice(0,7)&&"ns"!==e.slice(0,2)&&e&&t&&(e in this.namespaces||t in this.prefixes||(this.prefixes[t]=e,this.namespaces[e]=t))}},{key:"suggestNamespaces",value:function(e){for(var t in e)this.suggestPrefix(t,e[t]);return this}},{key:"checkIntegrity",value:function(){var e,t;for(e in this.namespaces)if(this.prefixes[this.namespaces[e]]!==e)throw new Error("Serializer integity error 1: "+e+", "+this.namespaces[e]+", "+this.prefixes[this.namespaces[e]]+"!");for(t in this.prefixes)if(this.namespaces[this.prefixes[t]]!==t)throw new Error("Serializer integity error 2: "+t+", "+this.prefixs[t]+", "+this.namespaces[this.prefixes[t]]+"!")}},{key:"makeUpPrefix",value:function(e){var t=e,r=function(t){return!!this.validPrefix.test(t)&&"ns"!==t&&!(t in this.namespaces)&&(this.prefixes[e]=t,this.namespaces[t]=e,t)}.bind(this);"#/".indexOf(t[t.length-1])>=0&&(t=t.slice(0,-1));var n=t.lastIndexOf("/");n>=0&&(t=t.slice(n+1));for(var i=0;i<t.length&&this.prefixchars.indexOf(t[i]);)i++;if((t=t.slice(0,i)).length<6&&r(t))return t;if(r(t.slice(0,3)))return t.slice(0,3);if(r(t.slice(0,2)))return t.slice(0,2);if(r(t.slice(0,4)))return t.slice(0,4);if(r(t.slice(0,1)))return t.slice(0,1);if(r(t.slice(0,5)))return t.slice(0,5);this.validPrefix.test(t)||(t="n");for(var o=0;;o++)if(r(t.slice(0,3)+o))return t.slice(0,3)+o}},{key:"rootSubjects",value:function(e){for(var t={},r={},n={},i=0;i<e.length;i++){var o=e[i],a=function(e){t.hasOwnProperty(e)||(t[e]=[]),t[e].push(o.subject)};[o.subject,o.predicate,o.object].map((function(e){"BlankNode"===e.termType?n[e.toNT()]=!0:"Collection"===e.termType&&e.elements.forEach((function(e){a(e)}))})),a(e[i].object);var s=r[this.toStr(o.subject)];s||(s=[]),s.push(o),r[this.toStr(o.subject)]=s}var c=[];for(var u in r)if(r.hasOwnProperty(u)){var l=this.fromStr(u);"BlankNode"===l.termType&&t[l]&&1===t[l].length||c.push(l)}this.incoming=t;for(var h={},f=0;f<c.length;f++)h[c[f].toNT()]=!0;return{roots:c,subjects:r,rootsHash:h,incoming:t}}},{key:"toN3",value:function(e){return this.statementsToN3(e.statements)}},{key:"explicitURI",value:function(e){return"<"+(e=this.flags.indexOf("r")<0&&this.base?R.refTo(this.base,e):this.flags.indexOf("u")>=0?function(e){for(var t,r="",n=0;n<e.length;n++)r+=(t=e.charCodeAt(n))>65535?"\\U"+("00000000"+t.toString(16)).slice(-8):t>126?"\\u"+("0000"+t.toString(16)).slice(-4):e[n];return r}(e):encodeURI(e))+">"}},{key:"statementsToNTriples",value:function(e){var t=e.slice();t.sort();for(var r="",n="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i=this,o=this.store,a=this.rdfFactory,s=function e(t){if("Collection"!==t.termType)return i.atomicTermToN3(t);for(var s=t.elements,c=o.sym(n+"nill"),u=s.length-1;u>=0;u--){var l=a.blankNode();r+=e(l)+" "+e(o.sym(n+"first"))+" "+e(s[u])+".\n",r+=e(l)+" "+e(o.sym(n+"rest"))+" "+e(c)+".\n",c=l}return i.atomicTermToN3(c)},c=0;c<t.length;c++){var u=t[c],l="";l+=s(u.subject)+" ",l+=s(u.predicate)+" ",l+=s(u.object)+" ",this.flags.indexOf("q")>=0&&(l+=s(u.why)+" "),r+=l+=".\n"}return r}},{key:"statementsToN3",value:function(e){var t=this.store,n={"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":"aaa:00"};e.sort((function(e,r){return Z.heavyCompareSPO(e,r,t,n)})),this.base&&!this.defaultNamespace&&(this.defaultNamespace=this.base+"#");var i={};this.flags.indexOf("s")<0&&(i["http://www.w3.org/2002/07/owl#sameAs"]="="),this.flags.indexOf("t")<0&&(i["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"]="a"),this.flags.indexOf("i")<0&&(i["http://www.w3.org/2000/10/swap/log#implies"]="=>");var o=function(e){for(var t="",r=0;r<e;r++)t+=" ";return t},a=function e(t){for(var r="",n=0;n<t.length;n++){var i=t[n],o="string"==typeof i?i:e(i);if(0!==n){var a=r.slice(-1)||" ";","===o||";"===o||("."!==o||"0123456789.:".includes(a))&&(r+=" ")}r+=o}return r},s=function(e){for(var t=this.rootSubjects(e),r=t.roots,n=[],i=0;i<r.length;i++){var o=r[i];n.push(c(o,t))}return n}.bind(this);function c(e,t){return"BlankNode"!==e.termType||t.incoming[e]?[h(e,t)].concat([u(e,t)]).concat(["."]):l(e,t,!0).concat(["."])}var u=function(e,t){var r=[],n=null,o=t.subjects[this.toStr(e)]||[];if(void 0===o)throw new Error("Cant find statements for "+e);for(var a=[],s=0;s<o.length;s++){var c=o[s];c.predicate.uri===n?a.push(","):(n&&(r=r.concat([a]).concat([";"]),a=[]),r.push(i[c.predicate.uri]?i[c.predicate.uri]:h(c.predicate,t))),n=c.predicate.uri,a.push(l(c.object,t))}return r.concat([a])}.bind(this),l=function(e,t,r){return"BlankNode"!==e.termType||!r&&void 0!==t.rootsHash[e.toNT()]?h(e,t):t.subjects[this.toStr(e)]?["[",u(e,t),"]"]:"[]"}.bind(this);r.prototype.termToN3=h;var h=function(e,t){var r,n;switch(e.termType){case"Graph":return(n=(n=["{"]).concat(s(e.statements))).concat(["}"]);case"Collection":for(n=["("],r=0;r<e.elements.length;r++)n.push([l(e.elements[r],t)]);return n.push(")"),n;default:return this.atomicTermToN3(e)}}.bind(this),f=function(){var e="";for(var t in this.flags.indexOf("d")<0&&this.defaultNamespace&&(e+="@prefix : "+this.explicitURI(this.defaultNamespace)+".\n"),this.prefixes)this.prefixes.hasOwnProperty(t)&&this.namespacesUsed[t]&&(e+="@prefix "+this.prefixes[t]+": "+this.explicitURI(t)+".\n");return e+"\n"}.bind(this),p=s(e);return f()+function e(t,r){var n="",i=1e5;void 0===r&&(r=-1);for(var s=0;s<t.length;s++){var c=t[s];if("string"!=typeof c){var u=e(c,r+1);if(u.length<10*(80-4*r)&&u.indexOf('"""')<0){var l=a(c);l.length<80-4*r&&(c=l,u="")}u&&(i=1e4),n+=u}if("string"==typeof c){if(1===c.length&&"\n"===n.slice(-1)&&",.;".indexOf(c)>=0){n=n.slice(0,-1),"."==c&&"0123456789.:".includes(n.charAt(n.length-1))&&(n+=" ",i+=1),n+=c+"\n",i+=1;continue}if(i<4*r+4||i+c.length+1<80&&";.".indexOf(n[n.length-2])<0)n=n.slice(0,-1)+" "+c+"\n",i+=c.length+1;else{var h=o(4*r)+c;n+=h+"\n",i=h.length,r<0&&(n+="\n",i=1e5)}}}return n}(p)}},{key:"atomicTermToN3",value:function(e,t){switch(e.termType){case"BlankNode":case"Variable":return e.toNT();case"Literal":var r=e.value;if("string"!=typeof r)throw new TypeError("Value of RDF literal node must be a string");if(e.datatype&&this.flags.indexOf("x")<0)switch(e.datatype.uri){case"http://www.w3.org/2001/XMLSchema#integer":return r;case"http://www.w3.org/2001/XMLSchema#decimal":return r.indexOf(".")<0&&(r+=".0"),r;case"http://www.w3.org/2001/XMLSchema#double":var n=r.toLowerCase().indexOf("e")>0;return r.indexOf(".")<0&&!n&&(r+=".0"),n||(r+="e0"),r;case"http://www.w3.org/2001/XMLSchema#boolean":return"1"===e.value?"true":"false"}var i=this.stringToN3(e.value);return e.language?i+="@"+e.language:e.datatype.equals(this.xsd.string)||(i+="^^"+this.atomicTermToN3(e.datatype,t)),i;case"NamedNode":return this.symbolToN3(e);case"DefaultGraph":return"";default:throw new Error("Internal: atomicTermToN3 cannot handle "+e+" of termType: "+e.termType)}}},{key:"stringToN3",value:function(e,t){t||(t="e");var r,n,i,o,a,s="";for(e.length>20&&'"'!==e.slice(-1)&&t.indexOf("n")<0&&(e.indexOf("\n")>0||e.indexOf('"')>0)?(o='"""',a=this.forbidden3):(o='"',a=this.forbidden1),r=0;r<e.length&&(a.lastIndex=0,null!=a.exec(e.slice(r)));){n=r+a.lastIndex-1,s+=e.slice(r,n);var c=e[n];'"'===c&&'"""'===o&&'"""'!==e.slice(n,n+3)?s+=c:(i='\b\f\r\t\v\n\\"'.indexOf(c))>=0?s+="\\"+'bfrtvn\\"'[i]:t.indexOf("e")>=0?s+="\\u"+("000"+c.charCodeAt(0).toString(16).toLowerCase()).slice(-4):s+=c,r=n+1}return o+s+e.slice(r)+o}},{key:"symbolToN3",value:function(e){var t=e.uri,r=t.indexOf("#");if(r<0&&this.flags.indexOf("/")<0&&(r=t.lastIndexOf("/")),r>=0&&this.flags.indexOf("p")<0&&(0===t.indexOf("http")||0===t.indexOf("ws")||0===t.indexOf("file"))){for(var n=!0,i=r+1;i<t.length;i++)if(this._notNameChars.indexOf(t[i])>=0){n=!1;break}if(n){var o=t.slice(r+1),a=t.slice(0,r+1);if(this.defaultNamespace&&this.defaultNamespace===a&&this.flags.indexOf("d")<0)return this.flags.indexOf("k")>=0&&this.keyords.indexOf(o)<0?o:":"+o;var s=this.prefixes[a];if(s||(s=this.makeUpPrefix(a)),s)return this.namespacesUsed[a]=!0,s+":"+o}}return this.explicitURI(t)}},{key:"writeStore",value:function(e){var t=this.store,r=t.fetcher,n=r&&r.appNode,i=this.store.index[3];for(var o in i){var a=t.fromNT(o);n&&a.equals(n)||e("\n"+this.atomicTermToN3(a)+" "+this.atomicTermToN3(t.sym("http://www.w3.org/2000/10/swap/log#semantics"))+" { "+this.statementsToN3(t.statementsMatching(void 0,void 0,void 0,a))+" }.\n")}t.statementsMatching(void 0,t.sym("http://www.w3.org/2007/ont/link#requestedURI")).map((function(r){e("\n<"+r.object.value+"> log:metadata {\n");var n=t.statementsMatching(void 0,void 0,void 0,r.subject);e(this.statementsToN3(this.statementsToN3(n))),e("}.\n")}));var s=[];n&&s.push(n);var c=[];s.map((function(e){c=c.concat(t.statementsMatching(void 0,void 0,void 0,e))})),e(this.statementsToN3(c))}},{key:"statementsToXML",value:function(e){var t=[];t["http://www.w3.org/1999/02/22-rdf-syntax-ns#"]=!0;var r="http://www.w3.org/1999/02/22-rdf-syntax-ns#_",n=function(e){for(var t="",r=0;r<e;r++)t+=" ";return t},i=function e(t){for(var r="",n=0;n<t.length;n++){var i=t[n];r+="string"==typeof i?i:e(i)}return r},o=function(e){this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#");for(var t=this.rootSubjects(e),r=t.roots,n=[],i=0;i<r.length;i++){var o=r[i];n.push(c(o,t))}return n}.bind(this);function a(e){return void 0===e?"@@@undefined@@@@":e.replace(/[&<"]/g,(function(e){switch(e[0]){case"&":return"&amp;";case"<":return"&lt;";case'"':return"&quot;"}}))}var s=function(e){return a(this.base?R.refTo(this.base,e.uri):e.uri)}.bind(this),c=function(e,t){var n,i,o,f,p=[],d=t.subjects[this.toStr(e)];if(void 0===d)return l(e,t);d.sort((function(e,t){var n=e.predicate.uri,i=t.predicate.uri;if(n.substring(0,r.length)===r||i.substring(0,r.length)===r)return n.localeCompare(i);var o=n.substring(r.length),a=i.substring(r.length),s=parseInt(o,10),c=parseInt(a,10);return isNaN(s)||isNaN(c)||s!==o||c!==a?n.localeCompare(i):s-c}));for(var y=0;y<d.length;y++)if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"!==(o=d[y]).predicate.uri||n||"NamedNode"!==o.object.termType){if((f=o.predicate).uri.substr(0,r.length)===r){var v=f.uri.substr(r.length);v===parseInt(v,10).toString()&&(f=this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#li"))}switch(i=h(f),o.object.termType){case"BlankNode":p=1===t.incoming[o.object].length?p.concat(["<"+i+' rdf:parseType="Resource">',c(o.object,t),"</"+i+">"]):p.concat(["<"+i+' rdf:nodeID="'+o.object.toNT().slice(2)+'"/>']);break;case"NamedNode":p=p.concat(["<"+i+' rdf:resource="'+s(o.object)+'"/>']);break;case"Literal":p=p.concat(["<"+i+(o.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+a(o.object.datatype.uri)+'"')+(o.object.language?' xml:lang="'+o.object.language+'"':"")+">"+a(o.object.value)+"</"+i+">"]);break;case"Collection":p=p.concat(["<"+i+' rdf:parseType="Collection">',u(o.object,t),"</"+i+">"]);break;default:throw new Error("Can't serialize object of type "+o.object.termType+" into XML")}}else n=o.object;var g=n?h(n):"rdf:Description",m="";return"BlankNode"===e.termType?t.incoming[e]&&1===t.incoming[e].length||(m=' rdf:nodeID="'+e.toNT().slice(2)+'"'):m=' rdf:about="'+s(e)+'"',["<"+g+m+">"].concat([p]).concat(["</"+g+">"])}.bind(this);function u(e,t){for(var r=[],n=0;n<e.elements.length;n++)r.push(c(e.elements[n],t));return r}var l=function(e,t){var r=[],n=t.subjects[this.toStr(e)];if(!n)return r;n.sort();for(var i=0;i<n.length;i++){var o=n[i];switch(o.object.termType){case"BlankNode":r=t.rootsHash[o.object.toNT()]?r.concat(["<"+h(o.predicate)+' rdf:nodeID="'+o.object.toNT().slice(2)+'">',"</"+h(o.predicate)+">"]):r.concat(["<"+h(o.predicate)+' rdf:parseType="Resource">',l(o.object,t),"</"+h(o.predicate)+">"]);break;case"NamedNode":r=r.concat(["<"+h(o.predicate)+' rdf:resource="'+s(o.object)+'"/>']);break;case"Literal":r=r.concat(["<"+h(o.predicate)+(o.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+a(o.object.datatype.value)+'"')+(o.object.language?' xml:lang="'+o.object.language+'"':"")+">"+a(o.object.value)+"</"+h(o.predicate)+">"]);break;case"Collection":r=r.concat(["<"+h(o.predicate)+' rdf:parseType="Collection">',u(o.object,t),"</"+h(o.predicate)+">"]);break;default:throw new Error("Can't serialize object of type "+o.object.termType+" into XML")}}return r}.bind(this),h=function(e){var r=e.uri,n=r.indexOf("#");if(n<0&&this.flags.indexOf("/")<0&&(n=r.lastIndexOf("/")),n<0)throw new Error("Cannot make qname out of <"+r+">");for(var i=n+1;i<r.length;i++)if(this._notNameChars.indexOf(r[i])>=0)throw new Error('Invalid character "'+r[i]+'" cannot be in XML qname for URI: '+r);var o=r.slice(n+1),a=r.slice(0,n+1);if(this.defaultNamespace&&this.defaultNamespace===a&&this.flags.indexOf("d")<0)return o;var s=this.prefixes[a];return s||(s=this.makeUpPrefix(a)),t[a]=!0,s+":"+o}.bind(this),f=o(e),p="<rdf:RDF";for(var d in this.defaultNamespace&&(p+=' xmlns="'+a(this.defaultNamespace)+'"'),t)if(t.hasOwnProperty(d)){var y=this.base&&this.flags.includes("z")?R.refTo(this.base,d):d;p+="\n xmlns:"+this.prefixes[d]+'="'+a(y)+'"'}return function e(t,r){var o,a="",s=1e5;r||(r=0);for(var c=0;c<t.length;c++){var u=t[c];if("string"!=typeof u){var l=e(u,r+1);l.length<10*(80-4*r)&&l.indexOf('"""')<0&&(o=i(u)).length<80-4*r&&(u=" "+o,l=""),l&&(s=1e4),a+=l}"string"==typeof u&&(s<4*r+4?(a=a.slice(0,-1)+" "+u+"\n",s+=u.length+1):(a+=(o=n(4*r)+u)+"\n",s=o.length))}return a}([p+=">",f,"</rdf:RDF>"],-1)}},{key:"statementsToJsonld",value:function(e){var t=this.statementsToN3(e),r=z.parse(t);return JSON.stringify(r,null,2)}}]),r}();function J(e,t,r,n,i,o){r=r||(null==e?void 0:e.value);var a=o||{};n=n||h.z8;try{var s=G(t);a.flags&&s.setFlags(a.flags);var c=t.statementsMatching(void 0,void 0,void 0,e);switch("namespaces"in t&&s.suggestNamespaces(t.namespaces),a.namespaces&&s.setNamespaces(a.namespaces),s.setBase(r),n){case h.Is:return u(null,s.statementsToXML(c));case h.qS:case h.sZ:return u(null,s.statementsToN3(c));case h.z8:case h.Eo:return s.setFlags("si"),u(null,s.statementsToN3(c));case h.aV:return s.setFlags("deinprstux"),u(null,s.statementsToNTriples(c));case h.ui:return s.setFlags("si dr"),u(null,s.statementsToJsonld(c));case h.b4:case h.lL:return s.setFlags("deinprstux q"),u(null,s.statementsToNTriples(c));default:throw new Error("Serialize: Content-type "+n+" not supported for data write.")}}catch(e){if(i)return i(e,void 0);throw e}function u(e,t){return i?void i(e,t):t}}var W=["blankNode","defaultGraph","literal","namedNode","quad","variable","supports"],Q="http://www.w3.org/1999/02/22-rdf-syntax-ns#rest";function Y(e,t,r){var n=[];return r.reduce((function(t,r,i,o){var a;return n.push(e.quad(t,e.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#first"),o[i])),i<o.length-1?(a=e.blankNode(),n.push(e.quad(t,e.namedNode(Q),a))):n.push(e.quad(t,e.namedNode(Q),e.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"))),a}),t),n}function K(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=e.length;for(r<0&&(r=n+r);r<n;r++)if(e[r]===t)return r;return-1}var ee=n(292);function te(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return re(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?re(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function re(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ne=function(n){(0,o.Z)(d,n);var i,f,p=(i=d,f=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=(0,s.Z)(i);if(f){var r=(0,s.Z)(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return(0,a.Z)(this,e)});function d(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};(0,t.Z)(this,d),(e=p.call(this,"")).statements=n,e.constraints=i,e.initBindings=o,e.optional=a,(0,c.Z)((0,r.Z)(e),"termType",h._A),(0,c.Z)((0,r.Z)(e),"classOrder",u.Z.Graph),(0,c.Z)((0,r.Z)(e),"fetcher",void 0),(0,c.Z)((0,r.Z)(e),"isVar",0),(0,c.Z)((0,r.Z)(e),"ns",B),(0,c.Z)((0,r.Z)(e),"rdfFactory",void 0),e.rdfFactory=s&&s.rdfFactory||F;var l,f=te(W);try{var y=function(){var t=l.value;e[t]=function(){var r;return(r=e.rdfFactory)[t].apply(r,arguments)}};for(f.s();!(l=f.n()).done;)y()}catch(e){f.e(e)}finally{f.f()}return e}return(0,e.Z)(d,[{key:"add",value:function(e,t,r,n){var i=this;return 1===arguments.length&&e.forEach((function(e){return i.add(e.subject,e.predicate,e.object,e.graph)})),this.statements.push(this.rdfFactory.quad(e,t,r,n))}},{key:"addStatement",value:function(e){return this.add(e)}},{key:"bnode",value:function(e){return this.rdfFactory.blankNode(e)}},{key:"addAll",value:function(e){var t=this;e.forEach((function(e){t.add(e.subject,e.predicate,e.object,e.graph)}))}},{key:"any",value:function(e,t,r,n){var i=this.anyStatementMatching(e,t,r,n);return null==i?null:null==e?i.subject:null==t?i.predicate:null==r?i.object:null}},{key:"anyValue",value:function(e,t,r,n){var i=this.any(e,t,r,n);return i?i.value:void 0}},{key:"anyJS",value:function(e,t,r,n){var i=this.any(e,t,r,n);return i?l.Z.toJS(i):void 0}},{key:"anyStatementMatching",value:function(e,t,r,n){var i=this.statementsMatching(e,t,r,n,!0);if(i&&0!==i.length)return i[0]}},{key:"id",value:function(e){return this.rdfFactory.id(e)}},{key:"statementsMatching",value:function(e,t,r,n,i){var o=this.statements.filter((function(i){return(!e||e.equals(i.subject))&&(!t||t.equals(i.predicate))&&(!r||r.equals(i.object))&&(!n||n.equals(i.graph))}));return i?0===o.length?[]:[o[0]]:o}},{key:"bottomTypeURIs",value:function(e){var t,r,n,i,o,a;for(var s in t=[],e)if(e.hasOwnProperty(s)){for(a=e[s],r=!0,n=0,i=(o=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),this.rdfFactory.namedNode(s))).length;n<i;n++)if(o[n].uri in e){r=!1;break}r&&(t[s]=a)}return t}},{key:"collection",value:function(){return new w}},{key:"each",value:function(e,t,r,n){var i=[],o=this.statementsMatching(e,t,r,n,!1);if(null==e)for(var a=0,s=o.length;a<s;a++)i.push(o[a].subject);else if(null==t)for(var c=0,u=o.length;c<u;c++)i.push(o[c].predicate);else if(null==r)for(var l=0,h=o.length;l<h;l++)i.push(o[l].object);else if(null==n)for(var f=0,p=o.length;f<p;f++)i.push(new y.Z(o[f].graph.value));return i}},{key:"equals",value:function(e){return!!e&&this.hashString()===e.hashString()}},{key:"findMembersNT",value:function(e){var t,r,n,i,o,a,s,c,u,l,h,f,p,d;for(var y in(f={})[e.toNT()]=!0,i={},a=this.transitiveClosure(f,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0))if(a.hasOwnProperty(y)){for(var v=0,g=(s=this.statementsMatching(void 0,this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.fromNT(y))).length;v<g;v++)i[(p=s[v]).subject.toNT()]=p;for(var m=0,b=(c=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"),this.fromNT(y))).length;m<b;m++)for(o=c[m],n=0,t=(u=this.statementsMatching(void 0,o)).length;n<t;n++)i[(p=u[n]).subject.toNT()]=p;for(var w=0,x=(l=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"),this.fromNT(y))).length;w<x;w++)for(o=l[w],d=0,r=(h=this.statementsMatching(void 0,o)).length;d<r;d++)i[(p=h[d]).object.toNT()]=p}return i}},{key:"findMemberURIs",value:function(e){return this.NTtoURI(this.findMembersNT(e))}},{key:"findSubClassesNT",value:function(e){var t={};return t[e.toNT()]=!0,this.transitiveClosure(t,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0)}},{key:"findSuperClassesNT",value:function(e){var t={};return t[e.toNT()]=!0,this.transitiveClosure(t,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}},{key:"findTypesNT",value:function(e){var t,r,n,i,o,a;a=[];for(var s=0,c=(t=this.statementsMatching(e,void 0,void 0)).length;s<c;s++)if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===(o=t[s]).predicate.uri)a[o.object.toNT()]=o;else for(var u=0,l=(r=this.each(o.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"))).length;u<l;u++)a[r[u].toNT()]=o;for(var h=0,f=(n=this.statementsMatching(void 0,void 0,e)).length;h<f;h++){o=n[h];for(var p=0,d=(i=this.each(o.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"))).length;p<d;p++)a[i[p].toNT()]=o}return this.transitiveClosure(a,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}},{key:"findTypeURIs",value:function(e){return this.NTtoURI(this.findTypesNT(e))}},{key:"connectedStatements",value:function(e,t,r){r=r||[];for(var n=[e],i={},o={},a=[],s=this,c=function(e){var c=function(e){"BlankNode"!==e.termType||i[e.value]||(i[e.value]=!0,n.push(e))},u=s.statementsMatching(null,null,e,t).concat(s.statementsMatching(e,null,null,t));u=u.filter((function(e){if(r[e.predicate.value])return!1;var t=e.toNT();return!o[t]&&(o[t]=!0,!0)})),u.forEach((function(e){c(e.subject),c(e.object)})),a=a.concat(u)};n.length;)c(n.shift());return a}},{key:"formula",value:function(e){return new d}},{key:"fromNT",value:function(e){var t,r,n;switch(e[0]){case"<":return this.sym(e.slice(1,-1));case'"':if(n=void 0,t=void 0,(r=e.lastIndexOf('"'))<e.length-1)if("@"===e[r+1])n=e.slice(r+2);else{if("^^"!==e.slice(r+1,r+3))throw new Error("Can't convert string from NT: "+e);t=this.fromNT(e.slice(r+3))}return e=(e=(e=(e=e.slice(1,r)).replace(/\\"/g,'"')).replace(/\\n/g,"\n")).replace(/\\\\/g,"\\"),this.rdfFactory.literal(e,n||t);case"_":return this.rdfFactory.blankNode(e.slice(2));case"?":return new L(e.slice(1))}throw new Error("Can't convert from NT: "+e)}},{key:"holds",value:function(e,t,r,n){var i;if(1===arguments.length){if(!e)return!0;if(e instanceof Array){for(i=0;i<e.length;i++)if(!this.holds(e[i]))return!1;return!0}if((0,v.Yi)(e))return this.holds(e.subject,e.predicate,e.object,e.graph);if(e.statements)return this.holds(e.statements)}var o=this.anyStatementMatching(e,t,r,n);return null!=o}},{key:"holdsStatement",value:function(e){return this.holds(e.subject,e.predicate,e.object,e.graph)}},{key:"list",value:function(e,t){if(t.rdfFactory.supports.COLLECTIONS){var r=t.rdfFactory.collection();return e.forEach((function(e){r.append(e)})),r}var n=t.rdfFactory.blankNode(),i=Y(t.rdfFactory,n,e);return t.addAll(i),n}},{key:"NTtoURI",value:function(e){var t,r,n={};for(t in e)e.hasOwnProperty(t)&&(r=e[t],"<"===t[0]&&(n[t.slice(1,-1)]=r));return n}},{key:"serialize",value:function(e,t,r,n){return J(r,this,e,t,void 0,n)}},{key:"substitute",value:function(e){var t=this.statements.map((function(t){return t.substitute(e)}));ee.log("Formula subs statmnts:"+t);var r=new d;return r.addAll(t),ee.log("indexed-form subs formula:"+r),r}},{key:"sym",value:function(e,t){if(t)throw new Error("This feature (kb.sym with 2 args) is removed. Do not assume prefix mappings.");return this.rdfFactory.namedNode(e)}},{key:"the",value:function(e,t,r,n){var i=this.any(e,t,r,n);return null==i&&U.Z.error("No value found for the() {"+e+" "+t+" "+r+"}."),i}},{key:"transitiveClosure",value:function(e,t,r){var n,i,o,a,s,c={};Object.assign(c,e);for(var u={};;){if(null==(s=function(){for(var e in c)if(c.hasOwnProperty(e))return e}()))return u;for(n=0,i=(a=r?this.each(void 0,t,this.fromNT(s)):this.each(this.fromNT(s),t)).length;n<i;n++)(o=a[n].toNT())in u||o in c||(c[o]=c[s]);u[s]=c[s],delete c[s]}}},{key:"topTypeURIs",value:function(e){var t,r,n,i,o,a,s;for(r in a=[],e)if(e.hasOwnProperty(r)){for(s=e[r],i=0,t=0,n=(o=this.each(this.rdfFactory.namedNode(r),this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"))).length;t<n;t++)if("http://www.w3.org/2000/01/rdf-schema#Resource"!==o[t].uri){i++;break}i||(a[r]=s)}return a["http://www.w3.org/2000/01/rdf-schema#Resource"]&&delete a["http://www.w3.org/2000/01/rdf-schema#Resource"],a["http://www.w3.org/2002/07/owl#Thing"]&&delete a["http://www.w3.org/2002/07/owl#Thing"],a}},{key:"toString",value:function(){return"{"+this.statements.join("\n")+"}"}},{key:"variable",value:function(e){return new L(e)}},{key:"whether",value:function(e,t,r,n){return this.statementsMatching(e,t,r,n,!1).length}}]),d}(l.Z);l.Z.fromValue=b;const ie=l.Z;var oe={xsd:B("http://www.w3.org/2001/XMLSchema#")};l.Z.toJS=function(e){return(0,v.uZ)(e)?e.elements.map(l.Z.toJS):(0,v.n_)(e)?e.datatype.equals(oe.xsd("boolean"))?"1"===e.value||"true"===e.value:e.datatype.equals(oe.xsd("dateTime"))||e.datatype.equals(oe.xsd("date"))?new Date(e.value):e.datatype.equals(oe.xsd("integer"))||e.datatype.equals(oe.xsd("float"))||e.datatype.equals(oe.xsd("decimal"))?Number(e.value):e.value:e};var ae=n(292),se=(0,e.Z)((function e(r,n){(0,t.Z)(this,e),this.pat=new ge,this.vars=[],this.name=r,this.id=n}));function ce(e,t,r,n){function i(e){var t,r="";for(t in e)e.hasOwnProperty(t)&&(r+=" "+t+" -> "+e[t]);return r}function o(e){var t,r="Bindings: ",n=e.length;for(t=0;t<n;t++)r+=i(e[t][0])+";\n\t";return r}function a(e,t,r,n){var i;if(e.length!==t.length)return[];if(!e.length)return[[[],null]];var o=function(e,t,r,n){var i=r[e];if(void 0===i){if(e.isVar){var o=[];return o[e]=t,[[o,null]]}i=e}if(!i.complexType)return n.redirections[i]&&(i=n.redirections[i]),n.redirections[t]&&(t=n.redirections[t]),i.equals(t)||i.uri&&i.uri===O?[[[],null]]:[];if(e instanceof Array)return t instanceof Array?a(e,t,r):[];throw new Error("query.js: oops - code not written yet")}(e[0],t[0],r,n);if(0===o.length)return o;var s,c,u,l,h,f,p,d=[],y=o.length;for(s=0;s<y;s++){for(h in p=[],c=o[s][0])c.hasOwnProperty(h)&&(p[h]=c[h]);for(h in r)r.hasOwnProperty(h)&&(p[h]=r[h]);for(l=(i=a(e.slice(1),t.slice(1),p,n)).length,u=0;u<l;u++){for(h in f=i[u][0],c)c.hasOwnProperty(h)&&(f[h]=c[h]);d.push([f,null])}}return d}function s(e,t){var r,n={};for(r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);for(r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return n}function c(e,t){return this.trunkBindings=t,this.originalCallback=e,this.branches=[],this}function u(e,t){return this.count=0,this.success=!1,this.done=!1,this.callback=e,this.onDone=t,this}c.prototype.checkAllDone=function(){var e;for(e=0;e<this.branches.length;e++)if(!this.branches[e].done)return;U.Z.debug("OPTIONAL BIDNINGS ALL DONE:"),this.doCallBacks(this.branches.length-1,this.trunkBindings)},c.prototype.doCallBacks=function(e,t){var r;if(e<0)return this.originalCallback(t);for(r=0;r<this.branches[e].results.length;r++)this.doCallBacks(e-1,s(t,this.branches[e].results[r]))},u.prototype.reportMatch=function(e){this.callback(e),this.success=!0},u.prototype.reportDone=function(){this.done=!0,U.Z.info("Mandatory query branch finished.***"),void 0!==this.onDone&&this.onDone()};var l=function(e){return this.count=0,this.done=!1,this.results=[],this.junction=e,e.branches.push(this),this};function h(e,t,r){var n,i,o,a,s,c;for(t.nvars=0,t.index=null,n=[t.subject,t.predicate,t.object,t.why],a=[e.subjectIndex,e.predicateIndex,e.objectIndex,e.whyIndex],o=0;o<4;o++){var u=n[o];if(u.uri&&u.uri===O);else if(u.isVar&&void 0===r[u])t.nvars++;else{if(void 0,u=void 0===(c=r[s=n[o]])?s:c,e.redirections[e.id(u)]&&(u=e.redirections[e.id(u)]),!(i=a[o][e.id(u)]))return t.index=[],!1;(null===t.index||t.index.length>i.length)&&(t.index=i)}}return null===t.index&&(t.index=e.statements),!0}function f(e,t){return e.nvars!==t.nvars?e.nvars-t.nvars:e.index.length-t.index.length}l.prototype.reportMatch=function(e){this.results.push(e)},l.prototype.reportDone=function(){U.Z.debug("Optional branch finished - results.length = "+this.results.length),0===this.results.length&&(this.results.push({}),U.Z.debug("Optional branch FAILED - that's OK.")),this.done=!0,this.junction.checkAllDone()};var p=function e(r,n,o,a,s,u,h){U.Z.debug("Match begins, Branch count now: "+h.count+" for "+h.pattern_debug);var f,p,d=n.statements;if(0===d.length){if(U.Z.debug("FOUND MATCH WITH BINDINGS:"+i(o)),0===n.optional.length)h.reportMatch(o);else{U.Z.debug("OPTIONAL: "+n.optional);var v,g=new c(t,o),m=[];for(v=0;v<n.optional.length;v++)m[v]=new l(g),m[v].pattern_debug=n.optional[v];for(v=0;v<n.optional.length;v++)m[v].count=m[v].count+1,e(r,n.optional[v],o,"",s,t,m[v])}return h.count--,void U.Z.debug("Match ends -- success , Branch count now: "+h.count+" for "+h.pattern_debug)}var b=d.length;if(s){var w=function(t,i){var c=t.uri.split("#")[0];s.nowOrWhenFetched(c,void 0,(function(i,c,l){i||ae.log("Error following link to <"+t.uri+"> in query: "+c),e(r,n,o,a,s,u,h)}))};for(p=0;p<b;p++){if(f=d[p],void 0!==o[f.subject]&&o[f.subject].uri&&s&&"unrequested"===s.getState((0,R.docpart)(o[f.subject].uri)))return void w(o[f.subject]);if(void 0!==o[f.object]&&o[f.object].uri&&s&&"unrequested"===s.getState((0,R.docpart)(o[f.object].uri)))return void w(o[f.object])}}y(r,n,o,a,s,u,h)},d=function(e,t){var r,n,i=!0;for(r in e)e.hasOwnProperty(r)&&t[r]&&(n=t[r].test)&&!n(e[r])&&(i=!1);return i},y=function(e,t,r,n,s,c,u){var l,y,v,g,m,b,w,x=t.statements,_=x.length;for(l=0;l<_;l++)h(e,w=x[l],r);x.sort(f),w=x[0];var j,k=e.formula();k.optional=t.optional,k.constraints=t.constraints,k.statements=x.slice(1),U.Z.debug(n+"match2 searching "+w.index.length+" for "+w+"; bindings so far="+i(r));var T,O,A=w.index.length,N=0;for(j=0;j<A;j++)for(O=w.index[j],T=a([w.subject,w.predicate,w.object,w.why],[O.subject,O.predicate,O.object,O.why],r,e),U.Z.info(n+" From first: "+T.length+": "+o(T)),v=T.length,y=0;y<v;y++)if(m=[],b=T[y][0],d(b,t.constraints)){for(g in b)b.hasOwnProperty(g)&&(m[g]=b[g]);for(g in r)r.hasOwnProperty(g)&&(m[g]=r[g]);u.count++,N++,p(e,k,m,n+" ",s,c,u)}else U.Z.debug("Branch count CS: "+u.count);u.count--,0===N&&U.Z.debug("Match2 fails completely on "+w),U.Z.debug("Match2 ends, Branch count: "+u.count+" for "+u.pattern_debug),0===u.count&&(U.Z.debug("Branch finished."),u.reportDone())},v=this;U.Z.debug("Query on "+this.statements.length);var g=new u(t,n);g.count++,e.sync?p(v,e.pat,e.pat.initBindings,"",r,t,g):setTimeout((function(){p(v,e.pat,e.pat.initBindings,"",r,t,g)}),0)}function ue(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function le(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ue(Object(r),!0).forEach((function(t){(0,c.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ue(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function he(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return fe(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?fe(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function fe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var pe="http://www.w3.org/2002/07/owl#";function de(e,t,r,n){var i=e.any(t,r,void 0);return!!i&&(e.equate(i,n),!0)}function ye(e,t,r,n){var i=e.any(void 0,r,n);return!!i&&(e.equate(i,t),!0)}function ve(e,t,r,n,i){e.typeCallback&&e.typeCallback(e,n,i);var o=e.classActions[e.id(n)],a=!1;if(o)for(var s=0;s<o.length;s++)a=a||o[s](e,t,r,n,i);return a}var ge=function(n){(0,o.Z)(d,n);var i,l,f=(i=d,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=(0,s.Z)(i);if(l){var r=(0,s.Z)(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return(0,a.Z)(this,e)});function d(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,t.Z)(this,d),n=f.call(this,void 0,void 0,void 0,void 0,i),(0,c.Z)((0,r.Z)(n),"updater",void 0),(0,c.Z)((0,r.Z)(n),"namespaces",void 0),(0,c.Z)((0,r.Z)(n),"classActions",void 0),(0,c.Z)((0,r.Z)(n),"propertyActions",void 0),(0,c.Z)((0,r.Z)(n),"redirections",void 0),(0,c.Z)((0,r.Z)(n),"aliases",void 0),(0,c.Z)((0,r.Z)(n),"HTTPRedirects",void 0),(0,c.Z)((0,r.Z)(n),"subjectIndex",void 0),(0,c.Z)((0,r.Z)(n),"predicateIndex",void 0),(0,c.Z)((0,r.Z)(n),"objectIndex",void 0),(0,c.Z)((0,r.Z)(n),"whyIndex",void 0),(0,c.Z)((0,r.Z)(n),"index",void 0),(0,c.Z)((0,r.Z)(n),"features",void 0),(0,c.Z)((0,r.Z)(n),"_universalVariables",void 0),(0,c.Z)((0,r.Z)(n),"_existentialVariables",void 0),(0,c.Z)((0,r.Z)(n),"rdfArrayRemove",void 0),(0,c.Z)((0,r.Z)(n),"dataCallbacks",void 0),n.propertyActions={},n.classActions={},n.redirections=[],n.aliases=[],n.HTTPRedirects=[],n.subjectIndex=[],n.predicateIndex=[],n.objectIndex=[],n.whyIndex=[],n.index=[n.subjectIndex,n.predicateIndex,n.objectIndex,n.whyIndex],n.namespaces={},n.features=e||[],n.rdfArrayRemove=i.rdfArrayRemove||Z.RDFArrayRemove,i.dataCallback&&(n.dataCallbacks=[i.dataCallback]),n.initPropertyActions(n.features),n}return(0,e.Z)(d,[{key:"substitute",value:function(e){var t=this.statements.map((function(t){return t.substitute(e)})),r=new d;return r.add(t),r}},{key:"addDataCallback",value:function(e){this.dataCallbacks||(this.dataCallbacks=[]),this.dataCallbacks.push(e)}},{key:"applyPatch",value:function(e,t,r){var n,i=this,o=null;function a(a){if(e.delete){n=e.delete,o&&(n=n.substitute(o)),n=n.statements;var s=[],c=n.map((function(e){var r=i.statementsMatching(e.subject,e.predicate,e.object,t);return 0===r.length?(s.push(e),null):r[0]}));if(s.length)return r("Could not find to delete: "+s.join("\n or "));c.map((function(e){i.remove(e)}))}e.insert&&(n=e.insert,o&&(n=n.substitute(o)),(n=n.statements).map((function(e){e.graph=t,i.add(e.subject,e.predicate,e.object,e.graph)}))),a()}if(e.where){var s=new se("patch");s.pat=e.where,s.pat.statements.map((function(e){e.graph=kr(t.value)})),s.sync=!0;var c=[];i.query(s,(function(e){c.push(e)}),i.fetcher,(function(){return 0===c.length?r("No match found to be patched:"+e.where):c.length>1?r("Patch ambiguous. No patch done."):(o=c[0],void a(r))}))}else a(r)}},{key:"declareExistential",value:function(e){return this._existentialVariables||(this._existentialVariables=[]),this._existentialVariables.push(e),e}},{key:"initPropertyActions",value:function(e){this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"))]=[ve],K(e,"sameAs")>=0&&(this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(pe,"sameAs")))]=[function(e,t,r,n,i){return e.equate(t,n),!0}]),K(e,"InverseFunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(pe,"InverseFunctionalProperty")))]=[function(e,t,r,n,i){return e.newPropertyAction(t,ye)}]),K(e,"FunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(pe,"FunctionalProperty")))]=[function(e,t,r,n,i){return e.newPropertyAction(t,de)}])}},{key:"addStatement",value:function(e){return this.add(e.subject,e.predicate,e.object,e.graph),this.statements.length}},{key:"add",value:function(e,t,r,n){var i,o,a;if(1===arguments.length){if(e instanceof Array)for(i=0;i<e.length;i++)this.add(e[i]);else(0,v.PY)(e)?this.add(e.subject,e.predicate,e.object,e.graph):(0,v.Pv)(e)&&this.add(e.statements);return this}n||(n=this.fetcher?this.fetcher.appNode:this.rdfFactory.defaultGraph()),"string"==typeof e&&(e=this.rdfFactory.namedNode(e)),t=ie.fromValue(t);var s=ie.fromValue(r);if(n=ie.fromValue(n),!(0,v.f)(e))throw new Error("Subject is not a subject type");if(!(0,v.nq)(t))throw new Error("Predicate ".concat(t," is not a predicate type"));if(!(0,v.Uc)(s))throw new Error("Object ".concat(s," is not an object type"));if(!(0,v.NA)(n))throw new Error("Why is not a graph type");this.predicateCallback&&this.predicateCallback(this,t,n);var c=this.id(this.canon(t)),u=!1;if(o=this.propertyActions[c])for(i=0;i<o.length;i++)u=u||o[i](this,e,t,s,n);if(this.holds(e,t,s,n))return null;var l=[this.id(this.canon(e)),c,this.id(this.canon(s)),this.id(this.canon(n))];for(a=this.rdfFactory.quad(e,t,s,n),i=0;i<4;i++){var h=this.index[i],f=l[i];h[f]||(h[f]=[]),h[f].push(a)}if(this.statements.push(a),this.dataCallbacks){var p,d=he(this.dataCallbacks);try{for(d.s();!(p=d.n()).done;){var y=p.value;y(a)}}catch(e){d.e(e)}finally{d.f()}}return a}},{key:"canon",value:function(e){if(!e)return e;var t=this.redirections[this.id(e)];if(t)return t;switch(e.termType){case h.V1:return new p(e.value);case h.fb:return e;case h.NK:return new A;case h.ls:case h._A:return e;case h.xH:return new m(e.value,e.language,e.datatype);case h.XM:return new y.Z(e.value);case h.UH:return new L(e.value);default:throw new Error("Term Type not recognized for canonization: ".concat(e.termType))}}},{key:"check",value:function(){this.checkStatementList(this.statements);for(var e=0;e<4;e++){var t=this.index[e];for(var r in t)t.hasOwnProperty(r)&&this.checkStatementList(t[r],e)}}},{key:"checkStatementList",value:function(e,t){void 0===t&&(t=0);for(var r,n=" found in "+["subject","predicate","object","why"][t]+" index.",i=0;i<e.length;i++){for(var o=[(r=e[i]).subject,r.predicate,r.object,r.graph],a=function(e,t){for(var r=0;r<e.length;r++)if(e[r].subject.equals(t.subject)&&e[r].predicate.equals(t.predicate)&&e[r].object.equals(t.object)&&e[r].why.equals(t.graph))return!0},s=0;s<4;s++){var c=this.canon(o[s]),u=this.id(c);this.index[s][u]&&a(this.index[s][u],r)}if(!a(this.statements,r))throw new Error("Statement list does not statement "+r+"@"+r.graph+n)}}},{key:"close",value:function(){return this}},{key:"compareTerms",value:function(e,t){return Object.prototype.hasOwnProperty.call(e,"compareTerm")?e.compareTerm(t):u.Z[e.termType]<u.Z[t.termType]?-1:u.Z[e.termType]>u.Z[t.termType]?1:e.value<t.value?-1:e.value>t.value?1:0}},{key:"copyTo",value:function(e,t,r){r||(r=[]);var n=this.statementsMatching(e);-1!==K(r,"two-direction")&&n.concat(this.statementsMatching(void 0,void 0,e));for(var i=0;i<n.length;i++){var o=n[i];switch(o.object.termType){case"NamedNode":this.add(t,o.predicate,o.object);break;case"Literal":case"BlankNode":case"Collection":this.add(t,o.predicate,o.object.copy(this))}-1!==K(r,"delete")&&this.remove(o)}}},{key:"equate",value:function(e,t){var r=this.canon(e),n=this.canon(t),i=this.compareTerms(r,n);return!i||(i<0?this.replaceWith(n,r):this.replaceWith(r,n))}},{key:"formula",value:function(e){return new d(e)}},{key:"length",get:function(){return this.statements.length}},{key:"match",value:function(e,t,r,n){return this.statementsMatching(ie.fromValue(e),ie.fromValue(t),ie.fromValue(r),ie.fromValue(n))}},{key:"mentionsURI",value:function(e){var t="<"+e+">";return!!this.subjectIndex[t]||!!this.objectIndex[t]||!!this.predicateIndex[t]}},{key:"newExistential",value:function(e){if(!e)return this.bnode();var t=this.sym(e);return this.declareExistential(t)}},{key:"newPropertyAction",value:function(e,t){var r=this.id(e);this.propertyActions[r]||(this.propertyActions[r]=[]),this.propertyActions[r].push(t);for(var n=this.statementsMatching(void 0,e,void 0),i=!1,o=0;o<n.length;o++)i=i||t(this,n[o].subject,e,n[o].object);return i}},{key:"newUniversal",value:function(e){var t=this.sym(e);return this._universalVariables||(this._universalVariables=[]),this._universalVariables.push(t),t}},{key:"variable",value:function(e){return new L(e)}},{key:"nextSymbol",value:function(e){for(var t=0;;t++){var r=e.value+"#n"+t;if(!this.mentionsURI(r))return this.sym(r)}}},{key:"query",value:function(e,t,r,n){return ce.call(this,e,t,r,n)}},{key:"querySync",value:function(e){var t=[],r=!1;if(e.sync=!0,ce.call(this,e,(function(e){t.push(e)}),null,(function(){r=!0})),!r)throw new Error("Sync query should have called done function");return t}},{key:"remove",value:function(e){if(e instanceof Array){for(var t=0;t<e.length;t++)this.remove(e[t]);return this}if((0,v.Pv)(e))return this.remove(e.statements);var r=this.statementsMatching(e.subject,e.predicate,e.object,e.graph);if(!r.length)throw new Error("Statement to be removed is not on store: "+e);return this.removeStatement(r[0]),this}},{key:"removeDocument",value:function(e){for(var t=this.statementsMatching(void 0,void 0,void 0,e).slice(),r=0;r<t.length;r++)this.removeStatement(t[r]);return this}},{key:"removeMany",value:function(e,t,r,n,i){for(var o=this.statementsMatching(e,t,r,n,!1),a=[],s=0;s<o.length;s++)a.push(o[s]);for(i&&(a=a.slice(0,i)),s=0;s<a.length;s++)this.remove(a[s])}},{key:"removeMatches",value:function(e,t,r,n){return this.removeMany(e,t,r,n),this}},{key:"removeStatement",value:function(e){for(var t=[e.subject,e.predicate,e.object,e.graph],r=0;r<4;r++){var n=this.canon(t[r]),i=this.id(n);this.index[r][i]&&this.rdfArrayRemove(this.index[r][i],e)}return this.rdfArrayRemove(this.statements,e),this}},{key:"removeStatements",value:function(e){for(var t=0;t<e.length;t++)this.remove(e[t]);return this}},{key:"replaceWith",value:function(e,t){for(var r=this.id(e),n=this.id(t),i=function(e){var t=e[r];if(t){var i=e[n];e[n]=i?t.concat(i):t,delete e[r]}},o=0;o<4;o++)i(this.index[o]);if(this.redirections[r]=t,e.value){if(this.aliases[n]||(this.aliases[n]=[]),this.aliases[n].push(e),this.aliases[r])for(o=0;o<this.aliases[r].length;o++)this.redirections[this.id(this.aliases[r][o])]=t,this.aliases[n].push(this.aliases[r][o]);this.add(t,this.sym("http://www.w3.org/2007/ont/link#uri"),e),this.fetcher&&this.fetcher.nowKnownAs(e,t)}return i(this.classActions),i(this.propertyActions),!0}},{key:"allAliases",value:function(e){var t=this.aliases[this.id(this.canon(e))]||[];return t.push(this.canon(e)),t}},{key:"sameThings",value:function(e,t){if(e.equals(t))return!0;var r=this.canon(e);if(!r)return!1;var n=this.canon(t);return!!n&&r.value===n.value}},{key:"setPrefixForURI",value:function(e,t){if(("tab"!==e||!this.namespaces.tab)&&"ns"!==e.slice(0,2)&&"default"!==e.slice(0,7)){for(var r in this.namespaces)this.namespaces[r]==t&&delete this.namespaces[r];this.namespaces[e]=t}}},{key:"statementsMatching",value:function(e,t,r,n,i){var o,a,s=[e,t,r,n],c=[],u=[],l=[],h=[];for(o=0;o<4;o++)c[o]=this.canon(ie.fromValue(s[o])),c[o]?(h.push(o),u[o]=this.id(c[o])):l.push(o);if(0===h.length)return this.statements;if(1===h.length)return o=h[0],(a=this.index[o][u[o]])&&i&&a.length>1&&(a=a.slice(0,1)),a||[];var f,p,d=1e10;for(p=0;p<h.length;p++){if(o=h[p],!(a=this.index[o][u[o]]))return[];a.length<d&&(d=a.length,f=p)}for(var y=h[f],v=this.index[y][u[y]],g=h.slice(0,f).concat(h.slice(f+1)),m=[],b=["subject","predicate","object","why"],w=0;w<v.length;w++){var x=v[w];for(p=0;p<g.length;p++)if(o=g[p],!this.canon(x[b[o]]).equals(c[o])){x=null;break}if(null!=x&&(m.push(x),i))break}return m}},{key:"uris",value:function(e){var t=this.canon(e),r=this.aliases[this.id(t)];if(!t.value)return[];var n=[t.value];if(r)for(var i=0;i<r.length;i++)n.push(r[i].uri);return n}},{key:"serialize",value:function(e,t,r,n){var i,o=null!==(i=n)&&void 0!==i&&i.namespaces?le(le({},this.namespaces),n.namespaces):le({},this.namespaces);return J(r,this,e,t,void 0,n=le(le({},n||{}),{},{namespaces:o}))}}],[{key:"defaultGraphURI",get:function(){return O}}]),d}(ne);function me(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return be(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?be(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function be(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}(0,c.Z)(ge,"handleRDFType",void 0),ge.handleRDFType=ve;var we=B("http://www.w3.org/1999/02/22-rdf-syntax-ns#");function xe(e,t){function r(n,i,o){var a=e.statementsMatching(n,we("rest"),null,t);if(1!==a.length)throw new Error("Bad list structure: no rest at ".concat(n));var s=e.statementsMatching(n,we("first"),null,t);if(1!==s.length)throw new Error("Bad list structure: rest but ".concat(s.length," firsts at ").concat(n));var c=[s[0].object].concat(i),u=o.concat(a).concat(s),l=e.statementsMatching(null,we("rest"),n,t);if(0===l.length){var h=new w(c);return e.remove(u),void function(e,t,r,n){var i,o=me(e.statementsMatching(r,null,null,n));try{for(o.s();!(i=o.n()).done;){var a=i.value,s=new I(t,a.predicate,a.object,n);e.remove(a),e.add(s)}}catch(e){o.e(e)}finally{o.f()}var c,u=me(e.statementsMatching(null,r,null,n));try{for(u.s();!(c=u.n()).done;){var l=c.value;e.remove(l),e.add(new I(l.subject,t,l.object,n))}}catch(e){u.e(e)}finally{u.f()}var h,f=me(e.statementsMatching(null,null,r,n));try{for(f.s();!(h=f.n()).done;){var p=h.value;e.remove(p),e.add(new I(p.subject,p.predicate,t,n))}}catch(e){f.e(e)}finally{f.f()}}(e,h,n,t)}if(1!==l.length)throw new Error("Bad list structure: ".concat(l.length," pres at ").concat(n));var f=l[0].subject;if("BlankNode"!==f.termType)throw new Error("Bad list element node ".concat(f," type: ").concat(f.termType," "));r(f,c,u)}!function(e,t){var r,n=we("nil"),i=me(e.statementsMatching(n,null,null,t));try{for(i.s();!(r=i.n()).done;){var o=r.value;e.remove(o);var a=new w;e.add(new I(a,o.predicate,o.object,t))}}catch(e){i.e(e)}finally{i.f()}var s,c=me(e.statementsMatching(null,null,n,t));try{for(c.s();!(s=c.n()).done;){var u=s.value;if(!u.predicate.sameTerm(we("rest"))){e.remove(u);var l=new w;e.add(new I(u.subject,u.predicate,l,t))}}}catch(e){c.e(e)}finally{c.f()}}(e,t),e.statementsMatching(null,we("rest"),we("nil"),t).forEach((function(e){if("BlankNode"!==e.subject.termType)throw new Error("Bad list element node ".concat(e.subject," type: ").concat(e.subject.termType," "));r(e.subject,[],[])}))}var _e="http://www.w3.org/2000/10/swap/log#",je=function(e){return e},ke=function(e){return e},Te=function(e){if(e.length>0)throw"missing.js: oops nnonempty dict not imp";return[]},Oe=function(e){return e.length},Ae=function(e,t,r){if(void 0===e.slice)throw"@@ mising.js: No .slice function for "+e+" of type "+(0,d.Z)(e);return void 0===r||null==r?e.slice(t):e.slice(t,r)},Ne=Error("dummy error stop iteration"),Se=function(e){return this.last=0,this.li=e,this.next=function(){if(this.last==this.li.length)throw Ne;return this.li[this.last++]},this},Ee=function(e,t){return e.indexOf(t)},Ie=function(e,t){if(!e){if(t)throw"python Assertion failed: "+t;throw"(python) Assertion failed."}};String.prototype.encode=function(e){if("utf-8"!=e)throw"UTF8_converter: can only do utf-8";return function(e){e=e.replace(/\r\n/g,"\n");for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r);n<128?t+=String.fromCharCode(n):n>127&&n<2048?(t+=String.fromCharCode(n>>6|192),t+=String.fromCharCode(63&n|128)):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128),t+=String.fromCharCode(63&n|128))}return t}(this)},String.prototype.decode=function(e){if("utf-8"!=e)throw"UTF8_converter: can only do utf-8";return this};var Re=function(e,t){return R.join(t,e)},Ce="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil",De="http://www.w3.org/2002/07/owl#sameAs",Le="\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~",Pe=Le+":",Me=new RegExp("^([-+]?[0-9]+)(\\.[0-9]+)?(e[-+]?[0-9]+)?","g"),Fe=new RegExp("^[0-9][0-9][0-9][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]*)?)?)?Z?"),Ue=new RegExp('[\\\\\\r\\n\\"]',"g"),Be=new RegExp("^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*","g");const Ze=function(e,t,r,n,i,o,a,s){return new He(e,t,r,n,i,o,a,s)};var qe,He=function(){function r(e,n,i,o,a,s,c,u){(0,t.Z)(this,r),void 0===n&&(n=null),void 0===i&&(i=""),void 0===o&&(o=null),void 0===a&&(a=""),void 0===s&&(s=null),void 0===c&&(c=""),void 0===u&&(u=null),this._bindings=new Te([]),this._flags=c,""!=i&&(Ie(i.indexOf(":")>=0,"Document URI not absolute: "+i),this._bindings[""]=i+"#"),this._store=e,a&&e.setGenPrefix(a),this._thisDoc=i,this.source=e.sym(i),this.lines=0,this.statementCount=0,this.hasNil=!1,this.startOfLine=0,this.previousLine=0,this._genPrefix=a,this.keywords=new ke(["a","this","bind","has","is","of","true","false"]),this.keywordsSet=0,this._anonymousNodes=new Te([]),this._variables=new Te([]),this._parentVariables=new Te([]),this._reason=u,this._reason2=null,this._baseURI=o||i||null,Ie(!this._baseURI||this._baseURI.indexOf(":")>=0),this._genPrefix||(this._thisDoc?this._genPrefix=this._thisDoc+"#_g":this._genPrefix=RDFSink_uniqueURI()),null==n?this._thisDoc?this._formula=e.formula(i+"#_formula"):this._formula=e.formula():this._formula=n,this._context=this._formula,this._parentContext=null}return(0,e.Z)(r,[{key:"here",value:function(e){return this._genPrefix+"_L"+this.lines+"C"+(e-this.startOfLine+1)}},{key:"formula",value:function(){return this._formula}},{key:"loadStream",value:function(e){return this.loadBuf(e.read())}},{key:"loadBuf",value:function(e){return this.startDoc(),this.feed(e),this.endDoc()}},{key:"feed",value:function(e){for(var t=e.decode("utf-8"),r=0;r>=0;){var n=this.skipSpace(t,r);if(n<0)return;if((r=this.directiveOrStatement(t,n))<0)throw Ve(this._thisDoc,this.lines,t,n,"expected directive or statement")}}},{key:"directiveOrStatement",value:function(e,t){var r,n=this.skipSpace(e,t);return n<0?n:(r=this.directive(e,n))>=0||(r=this.statement(e,n))>=0?this.checkDot(e,r):r}},{key:"tok",value:function(e,t,r){if("@"==t.slice(r,r+1))r+=1;else if(K(this.keywords,e)<0)return-1;var n=r+Oe(e);return t.slice(r,n)==e&&Le.indexOf(t.charAt(n))>=0?n:-1}},{key:"directive",value:function(e,t){if((o=this.skipSpace(e,t))<0)return o;var r=new ke([]);if((o=this.tok("bind",e,t))>0)throw Ve(this._thisDoc,this.lines,e,t,"keyword bind is obsolete: use @prefix");if((o=this.tok("keywords",e,t))>0){if((t=this.commaSeparatedList(e,o,r,!1))<0)throw Ve(this._thisDoc,this.lines,e,t,"'@keywords' needs comma separated list of words");return this.setKeywords(Ae(r,null,null)),t}if((o=this.tok("forAll",e,t))>0){if((t=this.commaSeparatedList(e,o,r,!0))<0)throw Ve(this._thisDoc,this.lines,e,t,"Bad variable list after @forAll");var n=new Se(r);try{for(;;){var i=n.next();(K(this._variables,i)<0||K(this._parentVariables,i)>=0)&&(this._variables[i]=this._context.newUniversal(i))}}catch(e){if(e!=Ne)throw e}return t}if((o=this.tok("forSome",e,t))>0){if((t=this.commaSeparatedList(e,o,r,this.uri_ref2))<0)throw Ve(this._thisDoc,this.lines,e,t,"Bad variable list after @forSome");n=new Se(r);try{for(;;)i=n.next(),this._context.declareExistential(i)}catch(e){if(e!=Ne)throw e}return t}if((o=this.tok("prefix",e,t))>=0){var o,a=new ke([]);if((t=this.qname(e,o,a))<0)throw Ve(this._thisDoc,this.lines,e,o,"expected qname after @prefix");if((o=this.uri_ref2(e,t,a))<0)throw Ve(this._thisDoc,this.lines,e,t,"expected <uriref> after @prefix _qname_");var s=a[1].uri;return this._baseURI?s=Re(this._baseURI,s):Ie(s.indexOf(":")>=0,"With no base URI, cannot handle relative URI for NS"),Ie(s.indexOf(":")>=0),this._bindings[a[0][0]]=s,this.bind(a[0][0],function(e){return encodeURI(e)}(s)),o}if((o=this.tok("base",e,t))>=0){if(a=new ke([]),(t=this.uri_ref2(e,o,a))<0)throw Ve(this._thisDoc,this.lines,e,o,"expected <uri> after @base ");if(s=a[0].uri,!this._baseURI)throw Ve(this._thisDoc,this.lines,e,o,"With no previous base URI, cannot use relative URI in @base <"+s+">");return s=Re(this._baseURI,s),Ie(s.indexOf(":")>=0),this._baseURI=s,t}return-1}},{key:"bind",value:function(e,t){""==e||this._store.setPrefixForURI(e,t)}},{key:"setKeywords",value:function(e){null==e?this.keywordsSet=0:(this.keywords=e,this.keywordsSet=1)}},{key:"startDoc",value:function(){}},{key:"endDoc",value:function(){return this.hasNil&&this._store.rdfFactory.supports.COLLECTIONS&&xe(this._store,this.source),this._formula}},{key:"makeStatement",value:function(e){e[0].add(e[2],e[1],e[3],this.source),(e[2].uri&&e[2].uri===Ce||e[3].uri&&e[3].uri===Ce)&&(this.hasNil=!0),this.statementCount+=1}},{key:"statement",value:function(e,t){var r=new ke([]);if((t=this.object(e,t,r))<0)return t;var n=this.property_list(e,t,r[0]);if(n<0)throw Ve(this._thisDoc,this.lines,e,t,"expected propertylist");return n}},{key:"subject",value:function(e,t,r){return this.item(e,t,r)}},{key:"verb",value:function(e,t,r){if((i=this.skipSpace(e,t))<0)return i;var n=new ke([]);if((i=this.tok("has",e,t))>=0){if((t=this.prop(e,i,n))<0)throw Ve(this._thisDoc,this.lines,e,i,"expected property after 'has'");return r.push(new je(["->",n[0]])),t}if((i=this.tok("is",e,t))>=0){if((t=this.prop(e,i,n))<0)throw Ve(this._thisDoc,this.lines,e,i,"expected <property> after 'is'");if((i=this.skipSpace(e,t))<0)throw Ve(this._thisDoc,this.lines,e,t,"End of file found, expected property after 'is'");var i;if(t=i,(i=this.tok("of",e,t))<0)throw Ve(this._thisDoc,this.lines,e,t,"expected 'of' after 'is' <prop>");return r.push(new je(["<-",n[0]])),i}if((i=this.tok("a",e,t))>=0)return r.push(new je(["->",this._store.sym("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")])),i;if("<="==e.slice(t,t+2))return r.push(new je(["<-",this._store.sym(_e+"implies")])),t+2;if("="==e.slice(t,t+1))return">"==e.slice(t+1,t+2)?(r.push(new je(["->",this._store.sym(_e+"implies")])),t+2):(r.push(new je(["->",this._store.sym(De)])),t+1);if(":="==e.slice(t,t+2))return r.push(new je(["->",_e+"becomes"])),t+2;if((i=this.prop(e,t,n))>=0)return r.push(new je(["->",n[0]])),i;if(">-"==e.slice(t,t+2)||"<-"==e.slice(t,t+2))throw Ve(this._thisDoc,this.lines,e,i,">- ... -> syntax is obsolete.");return-1}},{key:"prop",value:function(e,t,r){return this.item(e,t,r)}},{key:"item",value:function(e,t,r){return this.path(e,t,r)}},{key:"blankNode",value:function(e){return this._context.bnode(e,this._reason2)}},{key:"path",value:function(e,t,r){if((o=this.nodeOrLiteral(e,t,r))<0)return o;for(;"!^.".indexOf(e.slice(o,o+1))>=0;){var n=e.slice(o,o+1);if("."==n){var i=e.slice(o+1,o+2);if(!i||Pe.indexOf(i)>=0&&":?<[{(".indexOf(i)<0)break}var o,a=r.pop(),s=this.blankNode(this.here(o));if((o=this.node(e,o+1,r))<0)throw Ve(this._thisDoc,this.lines,e,o,"EOF found in middle of path syntax");var c=r.pop();"^"==n?this.makeStatement(new je([this._context,c,s,a])):this.makeStatement(new je([this._context,c,a,s])),r.push(s)}return o}},{key:"anonymousNode",value:function(e){if(t=this._anonymousNodes[e])return t;var t=this._store.bnode(e);return this._anonymousNodes[e]=t,t}},{key:"node",value:function(e,t,r,n){void 0===n&&(n=null);var i=n;if((l=this.skipSpace(e,t))<0)return l;t=l;var o=e.slice(t,t+1);if("["==o){var a=this.here(t);if((l=this.skipSpace(e,t+1))<0)throw Ve(this._thisDoc,this.lines,e,t,"EOF after '['");if("="==e.slice(l,l+1)){t=l+1;var s=new ke([]);if(!((l=this.objectList(e,t,s))>=0))throw Ve(this._thisDoc,this.lines,e,t,"objectList expected after [= ");if(i=s[0],Oe(s)>1){var c=new Se(s);try{for(;;){var u=c.next();this.makeStatement(new je([this._context,this._store.sym(De),i,u]))}}catch(e){if(e!=Ne)throw e}}if((l=this.skipSpace(e,l))<0)throw Ve(this._thisDoc,this.lines,e,t,"EOF when objectList expected after [ = ");if(";"==e.slice(l,l+1))var l=l+1}if(null==i&&(i=this.blankNode(a)),(t=this.property_list(e,l,i))<0)throw Ve(this._thisDoc,this.lines,e,l,"property_list expected");if((l=this.skipSpace(e,t))<0)throw Ve(this._thisDoc,this.lines,e,t,"EOF when ']' expected after [ <propertyList>");if("]"!=e.slice(l,l+1))throw Ve(this._thisDoc,this.lines,e,l,"']' expected");return r.push(i),l+1}if("{"==o){if("$"==e.slice(t+1,t+2)){l=(t+=1)+1;for(var h=new ke([]),f=!0;;){if((t=this.skipSpace(e,l))<0)throw Ve(this._thisDoc,this.lines,e,t,"needed '$}', found end.");if("$}"==e.slice(t,t+2)){l=t+2;break}if(f)f=!1;else{if(","!=e.slice(t,t+1))throw Ve(this._thisDoc,this.lines,e,t,"expected: ','");t+=1}var p=new ke([]);if((l=this.item(e,t,p))<0)throw Ve(this._thisDoc,this.lines,e,t,"expected item in set or '$}'");h.push(p[0])}return r.push(this._store.newSet(h,this._context)),l}l=t+1;var d=this._parentContext;this._parentContext=this._context;var y=this._anonymousNodes,v=this._parentVariables;this._parentVariables=this._variables,this._anonymousNodes=new Te([]),this._variables=this._variables.slice();var g=this._reason2;for(this._reason2=null,null==i&&(i=this._store.formula()),this._context=i;;){if((t=this.skipSpace(e,l))<0)throw Ve(this._thisDoc,this.lines,e,t,"needed '}', found end.");if("}"==e.slice(t,t+1)){l=t+1;break}if((l=this.directiveOrStatement(e,t))<0)throw Ve(this._thisDoc,this.lines,e,t,"expected statement or '}'")}return this._anonymousNodes=y,this._variables=this._parentVariables,this._parentVariables=v,this._context=this._parentContext,this._reason2=g,this._parentContext=d,r.push(i.close()),l}if("("==o){var m=this._store.list;for("$"==e.slice(t+1,t+2)&&(m=this._store.newSet,t+=1),l=t+1,h=new ke([]);;){if((t=this.skipSpace(e,l))<0)throw Ve(this._thisDoc,this.lines,e,t,"needed ')', found end.");if(")"==e.slice(t,t+1)){l=t+1;break}if(p=new ke([]),(l=this.item(e,t,p))<0)throw Ve(this._thisDoc,this.lines,e,t,"expected item in list or ')'");h.push(p[0])}return r.push(m(h,this._context)),l}if((l=this.tok("this",e,t))>=0)throw Ve(this._thisDoc,this.lines,e,t,"Keyword 'this' was ancient N3. Now use @forSome and @forAll keywords.");return(l=this.tok("true",e,t))>=0?(r.push(!0),l):(l=this.tok("false",e,t))>=0?(r.push(!1),l):null==i&&(l=this.uri_ref2(e,t,r))>=0?l:-1}},{key:"property_list",value:function(e,t,r){for(;;){if((l=this.skipSpace(e,t))<0)throw Ve(this._thisDoc,this.lines,e,t,"EOF found when expected verb in property list");if(":-"!=e.slice(l,l+2)){t=l;var n=new ke([]);if((l=this.verb(e,t,n))<=0)return t;var i=new ke([]);if((t=this.objectList(e,l,i))<0)throw Ve(this._thisDoc,this.lines,e,l,"objectList expected");var o=new Se(i);try{for(;;){var a=o.next(),s=n[0],c=s[0],u=s[1];"->"==c?this.makeStatement(new je([this._context,u,r,a])):this.makeStatement(new je([this._context,u,a,r]))}}catch(e){if(e!=Ne)throw e}if((l=this.skipSpace(e,t))<0)throw Ve(this._thisDoc,this.lines,e,l,"EOF found in list of objects");if(";"!=e.slice(t,t+1))return t;t+=1}else{t=l+2;var l,h=new ke([]);if((l=this.node(e,t,h,r))<0)throw Ve(this._thisDoc,this.lines,e,t,"bad {} or () or [] node after :- ");t=l}}}},{key:"commaSeparatedList",value:function(e,t,r,n){if((i=this.skipSpace(e,t))<0)throw Ve(this._thisDoc,this.lines,e,i,"EOF found expecting comma sep list");if("."==e.charAt(i))return t;if(n)var i=this.uri_ref2(e,i,r);else i=this.bareWord(e,i,r);if(i<0)return-1;for(;;){if((t=this.skipSpace(e,i))<0)return t;var o=e.slice(t,t+1);if(","!=o)return"."!=o?-1:t;if((i=n?this.uri_ref2(e,t+1,r):this.bareWord(e,t+1,r))<0)throw Ve(this._thisDoc,this.lines,e,i,"bad list content")}}},{key:"objectList",value:function(e,t,r){if((t=this.object(e,t,r))<0)return-1;for(;;){var n=this.skipSpace(e,t);if(n<0)throw Ve(this._thisDoc,this.lines,e,n,"EOF found after object");if(","!=e.slice(n,n+1))return n;if((t=this.object(e,n+1,r))<0)return t}}},{key:"checkDot",value:function(e,t){var r=this.skipSpace(e,t);if(r<0)return r;if("."==e.slice(r,r+1))return r+1;if("}"==e.slice(r,r+1))return r;if("]"==e.slice(r,r+1))return r;throw Ve(this._thisDoc,this.lines,e,r,"expected '.' or '}' or ']' at end of statement")}},{key:"uri_ref2",value:function(e,t,r){var n=new ke([]);if((f=this.qname(e,t,n))>=0){var i=n[0],o=i[0],a=i[1];if(null==o){Ie(0,"not used?");var s=this._baseURI+"#"}else if(!(s=this._bindings[o])){if("_"==o)return r.push(this.anonymousNode(a)),f;throw Ve(this._thisDoc,this.lines,e,t,"Prefix "+o+" not bound.")}var c=this._store.sym(s+a);return K(this._variables,c)>=0?r.push(this._variables[c]):r.push(c),f}if((t=this.skipSpace(e,t))<0)return-1;if("?"==e.charAt(t)){var u=new ke([]);return(f=this.variable(e,t,u))>0?(r.push(u[0]),f):-1}if("<"==e.charAt(t)){for(var l=t+=1;t<Oe(e);){if(">"==e.charAt(t)){var h=e.slice(l,t);return this._baseURI?h=Re(this._baseURI,h):Ie(h.indexOf(":")>=0,"With no base URI, cannot deal with relative URIs"),"#"==e.slice(t-1,t)&&"#"!=Ae(h,-1,null)&&(h+="#"),c=this._store.sym(h),K(this._variables,c)>=0?r.push(this._variables[c]):r.push(c),t+1}t+=1}throw Ve(this._thisDoc,this.lines,e,f,"unterminated URI reference")}if(this.keywordsSet){var f;if(u=new ke([]),(f=this.bareWord(e,t,u))<0)return-1;if(K(this.keywords,u[0])>=0)throw Ve(this._thisDoc,this.lines,e,t,'Keyword "'+u[0]+'" not allowed here.');return r.push(this._store.sym(this._bindings[""]+u[0])),f}return-1}},{key:"skipSpace",value:function(e,t){for(var r=t||0;r<e.length;r++){var n=e.charAt(r);if(" \n\r\t\f\v            ​\u2028\u2029 ".indexOf(n)<0){if("#"!==e.charAt(r))return r;for(;;r++){if(r===e.length)return-1;if("\n"===e.charAt(r)){this.lines=this.lines+1;break}}}else"\n"===e.charAt(r)&&(this.lines=this.lines+1)}return-1}},{key:"variable",value:function(e,t,r){if((n=this.skipSpace(e,t))<0)return-1;if("?"!=e.slice(n,n+1))return-1;var n;if(t=n+=1,"0123456789-".indexOf(e.charAt(n))>=0)throw Ve(this._thisDoc,this.lines,e,n,"Varible name can't start with '"+e.charAt(n)+"s'");for(;t<Oe(e)&&Pe.indexOf(e.charAt(t))<0;)t+=1;if(null==this._parentContext)throw Ve(this._thisDoc,this.lines,e,n,"Can't use ?xxx syntax for variable in outermost level: "+e.slice(n-1,t));return r.push(this._store.variable(e.slice(n,t))),t}},{key:"bareWord",value:function(e,t,r){var n=this.skipSpace(e,t);if(n<0)return-1;var i=e.charAt(n);if("0123456789-".indexOf(i)>=0)return-1;if(Pe.indexOf(i)>=0)return-1;for(t=n;t<Oe(e)&&Pe.indexOf(e.charAt(t))<0;)t+=1;return r.push(e.slice(n,t)),t}},{key:"qname",value:function(e,t,r){if((t=this.skipSpace(e,t))<0)return-1;var n=e.charAt(t);if("0123456789-+".indexOf(n)>=0)return-1;if(Pe.indexOf(n)<0){var i=n;for(t+=1;t<Oe(e)&&(n=e.charAt(t),Pe.indexOf(n)<0);)i+=n,t+=1}else i="";if(t<Oe(e)&&":"==e.charAt(t)){var o=i;for(t+=1,i="";t<Oe(e)&&(n=e.charAt(t),Pe.indexOf(n)<0);)i+=n,t+=1;return r.push(new je([o,i])),t}return i&&this.keywordsSet&&K(this.keywords,i)<0?(r.push(new je(["",i])),t):-1}},{key:"object",value:function(e,t,r){if((a=this.subject(e,t,r))>=0)return a;if((a=this.skipSpace(e,t))<0)return-1;t=a;var n=null,i=e.charAt(t);if('"'==i||"'"==i){n=e.slice(t,t+3==i+i)?i+i+i:i,t+=Oe(n);var o=this.strconst(e,t,n),a=o[0],s=o[1];return r.push(this._store.literal(s)),a}return-1}},{key:"nodeOrLiteral",value:function(e,t,r){if((c=this.node(e,t,r))>=0)return c;if((c=this.skipSpace(e,t))<0)return-1;t=c;var n=e.charAt(t);if("-+0987654321".indexOf(n)>=0){if(Fe.lastIndex=0,null!=(h=Fe.exec(e.slice(t))))c=t+(i=h[0]).length,i.indexOf("T")>=0?r.push(this._store.literal(i,this._store.sym("http://www.w3.org/2001/XMLSchema#dateTime"))):r.push(this._store.literal(i,this._store.sym("http://www.w3.org/2001/XMLSchema#date")));else{var i;if(Me.lastIndex=0,null==(h=Me.exec(e.slice(t))))throw Ve(this._thisDoc,this.lines,e,t,"Bad number or date syntax");c=t+Me.lastIndex,(i=e.slice(t,c)).indexOf("e")>=0?r.push(this._store.literal(parseFloat(i),this._store.sym("http://www.w3.org/2001/XMLSchema#double"))):e.slice(t,c).indexOf(".")>=0?r.push(this._store.literal(parseFloat(i),this._store.sym("http://www.w3.org/2001/XMLSchema#decimal"))):r.push(this._store.literal(parseInt(i),this._store.sym("http://www.w3.org/2001/XMLSchema#integer")))}return c}if('"'==e.charAt(t)){if('"""'==e.slice(t,t+3))var o='"""';else o='"';t+=Oe(o);var a=null,s=this.strconst(e,t,o),c=s[0],u=s[1],l=null;if("@"==e.slice(c,c+1)){var h;if(Be.lastIndex=0,null==(h=Be.exec(e.slice(c+1))))throw Ve(this._thisDoc,startline,e,t,"Bad language code syntax on string literal, after @");t=Be.lastIndex+c+1,l=e.slice(c+1,t),c=t}if("^^"==e.slice(c,c+2)){var f=new ke([]);c=this.uri_ref2(e,c+2,f),a=f[0]}return r.push(this._store.literal(u,l||a)),c}return-1}},{key:"strconst",value:function(e,t,r){for(var n=t,i="",o=this.lines;n<Oe(e);){if(t=n+Oe(r),e.slice(n,t)==r)return new je([t,i]);if('"'!=e.charAt(n)){if(Ue.lastIndex=0,!Ue.exec(e.slice(n)))throw Ve(this._thisDoc,o,e,n,"Closing quote missing in string at ^ in "+e.slice(n-20,n)+"^"+e.slice(n,n+20));if(t=n+Ue.lastIndex-1,i+=e.slice(n,t),'"'!=(c=e.charAt(t)))if("\r"!=c){if("\n"==c){if('"'==r)throw Ve(this._thisDoc,o,e,t,"newline found in string literal");this.lines=this.lines+1,i+=c,n=t+1,this.previousLine=this.startOfLine,this.startOfLine=n}else if("\\"==c){if(n=t+1,!(c=e.slice(n,n+1)))throw Ve(this._thisDoc,o,e,t,"unterminated string literal (2)");var a=Ee('abfrtvn\\"',c);if(a>=0)i+='a\b\f\r\t\v\n\\"'.charAt(a),n+=1;else if("u"==c)n=(s=this.uEscape(e,n+1,o))[0],i+=c=s[1];else{if("U"!=c)throw Ve(this._thisDoc,this.lines,e,t,"bad escape");var s,c;n=(s=this.UEscape(e,n+1,o))[0],i+=c=s[1]}}}else n=t+1;else n=t}else i=i+'"',n=n+1}throw Ve(this._thisDoc,this.lines,e,t,"unterminated string literal")}},{key:"uEscape",value:function(e,t,r){for(var n=t,i=0,o=0;i<4;){var a=e.slice(n,n+1).toLowerCase();if(n+=1,""==a)throw Ve(this._thisDoc,r,e,t,"unterminated string literal(3)");var s=Ee("0123456789abcdef",a);if(s<0)throw Ve(this._thisDoc,r,e,t,"bad string literal hex escape");o=16*o+s,i+=1}var c=String.fromCharCode(o);return new je([n,c])}},{key:"UEscape",value:function(e,t,r){for(var n=t,i=0,o="\\U";i<8;){var a=e.slice(n,n+1).toLowerCase();if(n+=1,""==a)throw Ve(this._thisDoc,r,e,t,"unterminated string literal(3)");if(Ee("0123456789abcdef",a)<0)throw Ve(this._thisDoc,r,e,t,"bad string literal hex escape");o+=a,i+=1}var s,c=(s="0x"+Ae(o,2,10)-0,String.fromCharCode(s));return new je([n,c])}}]),r}();function Ve(e,t,r,n,i){var o=t+1,a="Line "+o+" of <"+e+">: Bad syntax: "+i+'\nat: "'+r.slice(n,n+30)+'"',s=new SyntaxError(a,e,o);return s.lineNo=o,s.characterInFile=n,s.syntaxProblem=i,s}function ze(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $e(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ze(Object(r),!0).forEach((function(t){(0,c.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ze(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ge=$e($e({},F),{},{supports:(qe={},(0,c.Z)(qe,C.collections,!0),(0,c.Z)(qe,C.defaultGraphType,!1),(0,c.Z)(qe,C.equalsMethod,!0),(0,c.Z)(qe,C.identity,!1),(0,c.Z)(qe,C.id,!0),(0,c.Z)(qe,C.reversibleId,!1),(0,c.Z)(qe,C.variableType,!0),qe),collection:function(e){return new w(e)},id:function(e){var t=this;return(0,v.uZ)(e)?"( ".concat(e.elements.map((function(e){return t.id(e)})).join(", ")," )"):(0,v.cG)(e)?L.toString(e):F.id(e)},termToNQ:function(e){return e.termType===h.fb?w.toNT(e):F.termToNQ(e)}});const Xe=Ge;var Je=n(730),We=n.n(Je);function Qe(e,t){return"string"==typeof t?e.rdfFactory.literal(t):Object.prototype.hasOwnProperty.call(t,"@list")?!0===e.rdfFactory.supports.COLLECTIONS?function(e,t){if(!Array.isArray(t))throw new TypeError("Object must be an array");return e.rdfFactory.collection(t.map((function(t){return Qe(e,t)})))}(e,t["@list"]):function(e,t){var r=t["@id"]?Ke(e,t):e.rdfFactory.blankNode(),n=t["@list"].map((function(t){return Qe(e,t)})),i=Y(e.rdfFactory,r,n);return e.addAll(i),r}(e,t):Object.prototype.hasOwnProperty.call(t,"@id")?Ke(e,t):Object.prototype.hasOwnProperty.call(t,"@language")?e.rdfFactory.literal(t["@value"],t["@language"]):Object.prototype.hasOwnProperty.call(t,"@type")?e.rdfFactory.literal(t["@value"],e.rdfFactory.namedNode(t["@type"])):Object.prototype.hasOwnProperty.call(t,"@value")?e.rdfFactory.literal(t["@value"]):e.rdfFactory.literal(t)}function Ye(e,t,r,n){var i=r&&Object.prototype.hasOwnProperty.call(r,"termType")?r.value:r;return We().flatten(JSON.parse(e),null,{base:i}).then((function(e){return e.reduce((function(e,n){return t=et(t,r,n)}),t)})).then(n).catch(n)}function Ke(e,t){return t["@id"].startsWith("_:")?e.rdfFactory.blankNode(t["@id"].substring(2)):e.rdfFactory.namedNode(t["@id"])}function et(e,t,r){for(var n=r["@id"]?Ke(e,r):e.rdfFactory.blankNode(),i=0,o=Object.keys(r);i<o.length;i++){var a=o[i];if("@id"!==a){if("@graph"==a)for(var s=n,c=r[a],u=0;u<c.length;u++)e=et(e,s,c[u]);var l=r[a];if(Array.isArray(l))for(var h=0;h<l.length;h++)e.addStatement(tt(e,n,a,l[h],t));else e.addStatement(tt(e,n,a,l,t))}}return e}function tt(e,t,r,n,i){var o,a;return"@type"===r?(o=e.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),a=e.rdfFactory.namedNode(n)):(o=e.rdfFactory.namedNode(r),a=Qe(e,n)),e.rdfFactory.quad(t,o,a,e.rdfFactory.namedNode(i))}const rt="http://www.w3.org/1999/02/22-rdf-syntax-ns#",nt="http://www.w3.org/2001/XMLSchema#",it="http://www.w3.org/2000/10/swap/",ot={xsd:{decimal:`${nt}decimal`,boolean:`${nt}boolean`,double:`${nt}double`,integer:`${nt}integer`,string:`${nt}string`},rdf:{type:`${rt}type`,nil:`${rt}nil`,first:`${rt}first`,rest:`${rt}rest`,langString:`${rt}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${it}reify#forSome`,forAll:`${it}reify#forAll`},log:{implies:`${it}log#implies`}};var at=n(5929),st=n.n(at),ct=n(2486).lW;const{xsd:ut}=ot,lt=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,ht={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},ft=/[\x00-\x20<>\\"\{\}\|\^\`]/,pt={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},dt=/$0^/;class yt{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,e=e||{},this._lineMode=!!e.lineMode){this._n3Mode=!1;for(const e in this)!(e in pt)&&this[e]instanceof RegExp&&(this[e]=dt)}else this._n3Mode=!1!==e.n3;this._comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let r=this._input,n=r.length;for(;;){let e,a;for(;e=this._newline.exec(r);)this._comments&&(a=this._comment.exec(e[0]))&&i("comment",a[1],"",this._line,e[0].length),r=r.substr(e[0].length,r.length),n=r.length,this._line++;if(!e&&(e=this._whitespace.exec(r))&&(r=r.substr(e[0].length,r.length)),this._endOfFile.test(r))return t&&(this._comments&&(a=this._comment.exec(r))&&i("comment",a[1],"",this._line,r.length),r=null,i("eof","","",this._line,0)),this._input=r;const s=this._line,c=r[0];let u="",l="",h="",f=null,p=0,d=!1;switch(c){case"^":if(r.length<3)break;if("^"!==r[1]){this._n3Mode&&(p=1,u="^");break}if(this._previousMarker="^^",r=r.substr(2),"<"!==r[0]){d=!0;break}case"<":if(f=this._unescapedIri.exec(r))u="IRI",l=f[1];else if(f=this._iri.exec(r)){if(l=this._unescape(f[1]),null===l||ft.test(l))return o(this);u="IRI"}else r.length>1&&"<"===r[1]?(u="<<",p=2):this._n3Mode&&r.length>1&&"="===r[1]&&(u="inverse",p=2,l=">");break;case">":r.length>1&&">"===r[1]&&(u=">>",p=2);break;case"_":((f=this._blank.exec(r))||t&&(f=this._blank.exec(`${r} `)))&&(u="blank",h="_",l=f[1]);break;case'"':if(f=this._simpleQuotedString.exec(r))l=f[1];else if(({value:l,matchLength:p}=this._parseLiteral(r)),null===l)return o(this);null===f&&0===p||(u="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(f=this._simpleApostropheString.exec(r))l=f[1];else if(({value:l,matchLength:p}=this._parseLiteral(r)),null===l)return o(this);null===f&&0===p||(u="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(f=this._variable.exec(r))&&(u="var",l=f[0]);break;case"@":"literal"===this._previousMarker&&(f=this._langcode.exec(r))?(u="langcode",l=f[1]):(f=this._keyword.exec(r))&&(u=f[0]);break;case".":if(1===r.length?t:r[1]<"0"||r[1]>"9"){u=".",p=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(f=this._number.exec(r)||t&&(f=this._number.exec(`${r} `)))&&(u="literal",l=f[0],h="string"==typeof f[1]?ut.double:"string"==typeof f[2]?ut.decimal:ut.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(f=this._sparqlKeyword.exec(r))?u=f[0].toUpperCase():d=!0;break;case"f":case"t":(f=this._boolean.exec(r))?(u="literal",l=f[0],h=ut.boolean):d=!0;break;case"a":(f=this._shortPredicates.exec(r))?(u="abbreviation",l="a"):d=!0;break;case"=":this._n3Mode&&r.length>1&&(u="abbreviation",">"!==r[1]?(p=1,l="="):(p=2,l=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(p=1,u=c);break;default:d=!0}if(d&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(f=this._prefix.exec(r))?((f=this._prefixed.exec(r))||t&&(f=this._prefixed.exec(`${r} `)))&&(u="prefixed",h=f[1]||"",l=this._unescape(f[2])):(u="prefix",l=f[1]||"")),"^^"===this._previousMarker)switch(u){case"prefixed":u="type";break;case"IRI":u="typeIRI";break;default:u=""}if(!u)return t||!/^'''|^"""/.test(r)&&/\n|\r/.test(r)?o(this):this._input=r;const y=p||f[0].length,v=i(u,l,h,s,y);this.previousToken=v,this._previousMarker=u,r=r.substr(y,r.length)}function i(t,i,o,a,s){const c=r?n-r.length:n,u={type:t,value:i,prefix:o,line:a,start:c,end:c+s};return e(null,u),u}function o(t){e(t._syntaxError(/^\S*/.exec(r)[0]))}}_unescape(e){let t=!1;const r=e.replace(lt,((e,r,n,i)=>{if("string"==typeof r)return String.fromCharCode(Number.parseInt(r,16));if("string"==typeof n){let e=Number.parseInt(n,16);return e<=65535?String.fromCharCode(Number.parseInt(n,16)):String.fromCharCode(55296+((e-=65536)>>10),56320+(1023&e))}return i in ht?ht[i]:(t=!0,"")}));return t?null:r}_parseLiteral(e){if(e.length>=3){const t=e.match(/^(?:"""|"|'''|'|)/)[0],r=t.length;let n=Math.max(this._literalClosingPos,r);for(;(n=e.indexOf(t,n))>0;){let t=0;for(;"\\"===e[n-t-1];)t++;if(t%2==0){const t=e.substring(r,n),i=t.split(/\r\n|\r|\n/).length-1,o=n+r;if(1===r&&0!==i||3===r&&this._lineMode)break;return this._line+=i,{value:this._unescape(t),matchLength:o}}n++}this._literalClosingPos=e.length-r+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const t=new Error(`Unexpected "${e}" on line ${this._line}.`);return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}_readStartingBom(e){return e.startsWith("\ufeff")?e.substr(1):e}tokenize(e,t){if(this._line=1,"string"==typeof e){if(this._input=this._readStartingBom(e),"function"!=typeof t){const e=[];let t;if(this._tokenizeToEnd(((r,n)=>r?t=r:e.push(n)),!0),t)throw t;return e}st()((()=>this._tokenizeToEnd(t,!0)))}else this._pendingBuffer=null,"function"==typeof e.setEncoding&&e.setEncoding("utf8"),e.on("data",(e=>{null!==this._input&&0!==e.length&&(this._pendingBuffer&&(e=ct.concat([this._pendingBuffer,e]),this._pendingBuffer=null),128&e[e.length-1]?this._pendingBuffer=e:(void 0===this._input?this._input=this._readStartingBom("string"==typeof e?e:e.toString()):this._input+=e,this._tokenizeToEnd(t,!1)))})),e.on("end",(()=>{"string"==typeof this._input&&this._tokenizeToEnd(t,!0)})),e.on("error",t)}}const{rdf:vt,xsd:gt}=ot;let mt,bt=0;const wt={namedNode:function(e){return new _t(e)},blankNode:function(e){return new kt(e||"n3-"+bt++)},variable:function(e){return new Tt(e)},literal:function(e,t){if("string"==typeof t)return new jt(`"${e}"@${t.toLowerCase()}`);let r=t?t.value:"";return""===r&&("boolean"==typeof e?r=gt.boolean:"number"==typeof e&&(Number.isFinite(e)?r=Number.isInteger(e)?gt.integer:gt.double:(r=gt.double,Number.isNaN(e)||(e=e>0?"INF":"-INF")))),""===r||r===gt.string?new jt(`"${e}"`):new jt(`"${e}"^^${r}`)},defaultGraph:function(){return mt},quad:At,triple:At};class xt{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof xt?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 _t extends xt{get termType(){return"NamedNode"}}class jt extends xt{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let t=e.lastIndexOf('"')+1;return t<e.length&&"@"===e[t++]?e.substr(t).toLowerCase():""}get datatype(){return new _t(this.datatypeString)}get datatypeString(){const e=this.id,t=e.lastIndexOf('"')+1,r=t<e.length?e[t]:"";return"^"===r?e.substr(t+2):"@"!==r?gt.string:vt.langString}equals(e){return e instanceof jt?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}}class kt extends xt{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}class Tt extends xt{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}mt=new class extends xt{constructor(){return super(""),mt||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};class Ot extends xt{constructor(e,t,r,n){super(""),this._subject=e,this._predicate=t,this._object=r,this._graph=n||mt}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(e){return!!e&&this._subject.equals(e.subject)&&this._predicate.equals(e.predicate)&&this._object.equals(e.object)&&this._graph.equals(e.graph)}}function At(e,t,r,n){return new Ot(e,t,r,n)}let Nt=0;class St{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&It(this,e.factory);const t="string"==typeof e.format?e.format.match(/\w*$/)[0].toLowerCase():"",r=/turtle/.test(t),n=/trig/.test(t),i=/triple/.test(t),o=/quad/.test(t),a=this._n3Mode=/n3/.test(t),s=i||o;(this._supportsNamedGraphs=!(r||a))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(r||n||i||a),this._supportsRDFStar=""===t||/star|\*$/.test(t),s&&(this._resolveRelativeIRI=e=>null),this._blankNodePrefix="string"!=typeof e.blankNodePrefix?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new yt({lineMode:s,n3:a}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){Nt=0}_setBase(e){if(e){const t=e.indexOf("#");t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}else this._base="",this._basePath=""}_saveContext(e,t,r,n,i){const o=this._n3Mode;this._contextStack.push({type:e,subject:r,predicate:n,object:i,graph:t,inverse:!!o&&this._inversePredicate,blankPrefix:o?this._prefixes._:"",quantified:o?this._quantified:null}),o&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,t){const r=this._contextStack.pop();if(!r||r.type!==e)return this._error(`Unexpected ${t.type}`,t);this._subject=r.subject,this._predicate=r.predicate,this._object=r.object,this._graph=r.graph,this._n3Mode&&(this._inversePredicate=r.inverse,this._prefixes._=r.blankPrefix,this._quantified=r.quantified)}_readInTopContext(e){switch(e.type){case"eof":return null!==this._graph?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,t){let r;switch(e.type){case"IRI":case"typeIRI":const t=this._resolveIRI(e.value);if(null===t)return this._error("Invalid IRI",e);r=this._namedNode(t);break;case"type":case"prefixed":const n=this._prefixes[e.prefix];if(void 0===n)return this._error(`Undefined prefix "${e.prefix}:"`,e);r=this._namedNode(n+e.value);break;case"blank":r=this._blankNode(this._prefixes[e.prefix]+e.value);break;case"var":r=this._variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!t&&this._n3Mode&&r.id in this._quantified&&(r=this._quantified[r.id]),r}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(0===e.prefix.length)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._literal(e.value,this._namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._subject=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){const t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${t}`,e):(this._subject=null,"]"===t?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if(void 0===(this._predicate=this._readEntity(e)))return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(0===e.prefix.length)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._literal(e.value,this._namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._object=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return"{"===e.type?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return"{"!==e.type?this._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return"]"===e.type?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}_readBlankNodeTail(e){if("]"!==e.type)return this._readBlankNodePunctuation(e);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const t=null===this._predicate;return this._restoreContext("blank",e),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let t=null,r=null,n=this._readListItem;const i=this._subject,o=this._contextStack,a=o[o.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,r=this._blankNode(),this.RDF_FIRST,this._subject=t=this._blankNode()),n=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,r=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),0!==o.length&&"list"===o[o.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(n=this._readPredicate,this._subject===this.RDF_NIL)return n}else if(n=this._getContextEndReader(),this._object===this.RDF_NIL)return n;r=this.RDF_NIL;break;case"literal":0===e.prefix.length?(this._literalValue=e.value,n=this._readListItemDataTypeOrLang):(t=this._literal(e.value,this._namedNode(e.prefix)),n=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if(void 0===(t=this._readEntity(e)))return}if(null===r&&(this._subject=r=this._blankNode()),null===i?null===a.predicate?a.subject=r:a.object=r:this._emit(i,this.RDF_REST,r,this._graph),null!==t){if(this._n3Mode&&("IRI"===e.type||"prefixed"===e.type))return this._saveContext("item",this._graph,r,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(r,this.RDF_FIRST,t,this._graph)}return n}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let t=this._literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const r=this._readEntity(e);if(void 0===r)return;t=this._literal(this._literalValue,r),e=null;break;case"langcode":t=this._literal(this._literalValue,e.value),e=null}return{token:e,literal:t}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){const r=this._completeLiteral(e);if(r)return this._object=r.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===r.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(r.token))}_readFormulaTail(e){return"}"!==e.type?this._readPunctuation(e):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let t,r=this._graph;const n=this._subject,i=this._inversePredicate;switch(e.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,i&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(r=this._readEntity(e))){t=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(null!==n){const e=this._predicate,t=this._object;i?this._emit(t,e,n,r):this._emit(n,e,t,r)}return t}_readBlankNodePunctuation(e){let t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}_readQuadPunctuation(e){return"."!==e.type?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return"prefix"!==e.type?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if("IRI"!==e.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){const t="IRI"===e.type&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return"]"!==e.type?this._error("Invalid graph label",e):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):"."!==e.type?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let t;switch(e.type){case"IRI":case"prefixed":if(void 0!==(t=this._readEntity(e,!0)))break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return","===e.type?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const t=this._contextStack,r=t.length&&t[t.length-1];if(r&&"item"===r.type){const t=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,t,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,r;const n=this._blankNode();if(void 0!==(r=this._readEntity(e)))return null===this._predicate?(t=this._subject,this._subject=n):(t=this._object,this._object=n),this._emit(t,r,n,this._graph),this._readPath}_readBackwardPath(e){const t=this._blankNode();let r,n;if(void 0!==(r=this._readEntity(e)))return null===this._predicate?(n=this._subject,this._subject=t):(n=this._object,this._object=t),this._emit(t,r,n,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return">>"!==e.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(e))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(">>"!==e.type)return this._error(`Expected >> but got ${e.type}`,e);const t=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),null===this._subject?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_getContextEndReader(){const e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,t,r,n){this._callback(null,this._quad(e,t,r,n||this.DEFAULTGRAPH))}_error(e,t){const r=new Error(`${e} on line ${t.line}.`);r.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(r),this._callback=Et}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return("/"===e[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;const t=e.length;let r="",n=-1,i=-1,o=0,a="/";for(;n<t;){switch(a){case":":if(i<0&&"/"===e[++n]&&"/"===e[++n])for(;(i=n+1)<t&&"/"!==e[i];)n=i;break;case"?":case"#":n=t;break;case"/":if("."===e[n+1])switch(a=e[1+ ++n],a){case"/":r+=e.substring(o,n-1),o=n+1;break;case void 0:case"?":case"#":return r+e.substring(o,n)+e.substr(n+1);case".":if(a=e[1+ ++n],void 0===a||"/"===a||"?"===a||"#"===a){if(r+=e.substring(o,n-2),(o=r.lastIndexOf("/"))>=i&&(r=r.substr(0,o)),"/"!==a)return`${r}/${e.substr(n+1)}`;o=n+1}}}a=e[++n]}return r+e.substring(o)}parse(e,t,r){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${Nt++}_`,this._prefixCallback=r||Et,this._inversePredicate=!1,this._quantified=Object.create(null),!t){const t=[];let r;if(this._callback=(e,n)=>{e?r=e:n&&t.push(n)},this._lexer.tokenize(e).every((e=>this._readCallback=this._readCallback(e))),r)throw r;return t}this._callback=t,this._lexer.tokenize(e,((e,t)=>{null!==e?(this._callback(e),this._callback=Et):this._readCallback&&(this._readCallback=this._readCallback(t))}))}}function Et(){}function It(e,t){const r=t.namedNode;e._namedNode=r,e._blankNode=t.blankNode,e._literal=t.literal,e._variable=t.variable,e._quad=t.quad,e.DEFAULTGRAPH=t.defaultGraph(),e.RDF_FIRST=r(ot.rdf.first),e.RDF_REST=r(ot.rdf.rest),e.RDF_NIL=r(ot.rdf.nil),e.N3_FORALL=r(ot.r.forAll),e.N3_FORSOME=r(ot.r.forSome),e.ABBREVIATIONS={a:r(ot.rdf.type),"=":r(ot.owl.sameAs),">":r(ot.log.implies)},e.QUANTIFIERS_GRAPH=r("urn:n3:quantifiers")}It(St.prototype,wt);var Rt=n(292);if(void 0===Ct)var Ct={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12};var Dt=function(){function r(e,n){(0,t.Z)(this,r),this.options=n||{},this.kb=e,this.target=n.target||{graph:{subjects:{},prefixes:{},terms:{}}},this.blankNodes=[],this.htmlOptions={selfClosing:"br img input area base basefont col colgroup source wbr isindex link meta param hr"},this.theOne="_:"+(new Date).getTime(),this.language=null,this.vocabulary=null,this.blankCounter=0,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"}],this.inXHTMLMode=!1,this.absURIRE=/[\w\_\-]+:\S+/,this.finishedHandlers=[],this.init()}return(0,e.Z)(r,[{key:"addTriple",value:function(e,t,r,n){var i,o,a,s;i=void 0===t?F.namedNode(this.options.base):this.toRDFNodeObject(t),a=this.toRDFNodeObject(r),o=this.toRDFNodeObject(n),s=F.namedNode(this.options.base),this.kb.add(i,a,o,s)}},{key:"ancestorPath",value:function(e){for(var t="";e&&e.nodeType!==Ct.DOCUMENT_NODE;)t="/"+e.localName+t,e=e.parentNode;return t}},{key:"copyMappings",value:function(e){var t={};for(var r in e)t[r]=e[r];return t}},{key:"copyProperties",value:function(){}},{key:"deriveDateTimeType",value:function(e){for(var t=0;t<r.dateTimeTypes.length;t++){var n=r.dateTimeTypes[t].pattern.exec(e);if(n&&n[0].length===e.length)return r.dateTimeTypes[t].type}return null}},{key:"init",value:function(){}},{key:"newBlankNode",value:function(){return this.blankCounter++,"_:"+this.blankCounter}},{key:"newSubjectOrigin",value:function(e,t){}},{key:"parseCURIE",value:function(e,t,n){var i,o=e.indexOf(":");if(o>=0){var a=e.substring(0,o);if(""===a)return(i=t[""])?i+e.substring(o+1):null;if("_"===a)return"_:"+e.substring(o+1);if(r.NCNAME.test(a)&&(i=t[a]))return i+e.substring(o+1)}return null}},{key:"parseCURIEOrURI",value:function(e,t,r){return this.parseCURIE(e,t,r)||this.resolveAndNormalize(r,e)}},{key:"parsePredicate",value:function(e,t,r,n,i,o){if(""===e)return null;var a=this.parseTermOrCURIEOrAbsURI(e,t,o?null:r,n,i);return a&&0===a.indexOf("_:")?null:a}},{key:"parsePrefixMappings",value:function(e,t){for(var r=this.tokenize(e),n=null,i=0;i<r.length;i++)":"===r[i][r[i].length-1]?n=r[i].substring(0,r[i].length-1):n&&(t[n]=this.options.base?R.join(r[i],this.options.base):r[i],n=null)}},{key:"parseSafeCURIEOrCURIEOrURI",value:function(e,t,r){return"["===(e=this.trim(e)).charAt(0)&&"]"===e.charAt(e.length-1)?0===(e=(e=e.substring(1,e.length-1)).trim(e)).length?null:"_:"===e?this.theOne:this.parseCURIE(e,t,r):this.parseCURIEOrURI(e,t,r)}},{key:"parseTermOrCURIEOrAbsURI",value:function(e,t,r,n,i){e=this.trim(e);var o=this.parseCURIE(e,n,i);if(o)return o;if(r){if(t&&!this.absURIRE.exec(e))return t+e;var a=r[e];if(a)return a;if(a=r[e.toLowerCase()])return a}return this.absURIRE.exec(e)?this.resolveAndNormalize(i,e):null}},{key:"parseTermOrCURIEOrURI",value:function(e,t,r,n,i){e=this.trim(e);var o=this.parseCURIE(e,n,i);if(o)return o;var a=r[e];return a||((a=r[e.toLowerCase()])?a:t&&!this.absURIRE.exec(e)?t+e:this.resolveAndNormalize(i,e))}},{key:"parseURI",value:function(e){return e}},{key:"process",value:function(e,t){var n;t=t||{},e.nodeType===Ct.DOCUMENT_NODE?(e.baseURI&&!t.baseURI&&(t.baseURI=e.baseURI),n=e.baseURI,(e=e.documentElement).baseURI||(e.baseURI=n),this.setContext(e)):e.parentNode.nodeType===Ct.DOCUMENT_NODE&&this.setContext(e);var i=[],o=function(e){if(!e&&t&&t.baseURI)return t.baseURI;var r=e.indexOf("#");return r>=0&&(e=e.substring(0,r)),t&&t.baseURIMap&&(e=t.baseURIMap(e)),e};for(i.push({current:e,context:this.push(null,o(e.baseURI))});i.length>0;){var a=i.shift();if(a.parent){if(a.context.parent&&a.context.parent.listMapping===a.listMapping)continue;for(var s in a.listMapping){var c=a.listMapping[s];if(0!==c.length){for(var u=[],l=0;l<c.length;l++)u.push(this.newBlankNode());for(var h=0;h<u.length;h++)this.addTriple(a.parent,u[h],"http://www.w3.org/1999/02/22-rdf-syntax-ns#first",c[h]),this.addTriple(a.parent,u[h],"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",{type:r.objectURI,value:h+1<u.length?u[h+1]:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"});this.addTriple(a.parent,a.subject,s,{type:r.objectURI,value:u[0]})}else this.addTriple(a.parent,a.subject,s,{type:r.objectURI,value:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"})}}else{var f=a.current,p=a.context,d=!1,y=null,v=null,g=null,m=p.prefixes,b=!1,w=[],x=p.listMapping,_=!p.parent,j=p.language,k=p.vocabulary;n=this.parseURI(o(f.baseURI)),f.item=null;var T=f.getAttributeNode("vocab");if(T){var O=this.trim(T.value);if(O.length>0){k=O;var A=n.spec;this.addTriple(f,A,"http://www.w3.org/ns/rdfa#usesVocabulary",{type:r.objectURI,value:k})}else k=this.vocabulary}for(var N=0;N<f.attributes.length;N++){var S=f.attributes[N];if("x"===S.nodeName.charAt(0)&&0===S.nodeName.indexOf("xmlns:")){b||(m=this.copyMappings(m),b=!0);var E=S.nodeName.substring(6),I=r.trim(S.value);m[E]=this.options.base?R.join(I,this.options.base):I}}var C=f.getAttributeNode("prefix");C&&(b||(m=this.copyMappings(m),b=!0),this.parsePrefixMappings(C.value,m));for(var D=null,L=0;!D&&L<this.langAttributes.length;L++)D=f.getAttributeNodeNS(this.langAttributes[L].namespaceURI,this.langAttributes[L].localName);if(D){var P=r.trim(D.value);j=P.length>0?P:null}var M,F,U=f.getAttributeNode("rel"),B=f.getAttributeNode("rev"),Z=f.getAttributeNode("typeof"),q=f.getAttributeNode("property"),H=f.getAttributeNode("datatype"),V=this.inHTMLMode?f.getAttributeNode("datetime"):null,z=f.getAttributeNode("content"),$=f.getAttributeNode("about"),G=f.getAttributeNode("src"),X=f.getAttributeNode("resource"),J=f.getAttributeNode("href"),W=f.getAttributeNode("inlist"),Q=[];if(U){F=this.tokenize(U.value);for(var Y=0;Y<F.length;Y++)(M=this.parsePredicate(F[Y],k,p.terms,m,n,this.inHTMLMode&&null!==q))&&Q.push(M)}var K=[];if(B){F=this.tokenize(B.value);for(var ee=0;ee<F.length;ee++)(M=this.parsePredicate(F[ee],k,p.terms,m,n,this.inHTMLMode&&q))&&K.push(M)}if(this.inHTMLMode&&(U||B)&&q&&(0===Q.length&&(U=null),0===K.length&&(B=null)),U||B?($&&(y=this.parseSafeCURIEOrCURIEOrURI($.value,m,n)),Z&&(g=y),y||(f.parentNode.nodeType===Ct.DOCUMENT_NODE?y=o(f.baseURI):p.parentObject&&(y=o(f.parentNode.baseURI)===p.parentObject?o(f.baseURI):p.parentObject)),X&&(v=this.parseSafeCURIEOrCURIEOrURI(X.value,m,n)),v||(J?v=this.resolveAndNormalize(n,encodeURI(J.value)):G?v=this.resolveAndNormalize(n,encodeURI(G.value)):!Z||$||this.inXHTMLMode&&("head"===f.localName||"body"===f.localName)||(v=this.newBlankNode())),!Z||$||!this.inXHTMLMode||"head"!==f.localName&&"body"!==f.localName?Z&&!$&&(g=v):g=y):!q||z||H?($&&(y=this.parseSafeCURIEOrCURIEOrURI($.value,m,n)),!y&&X&&(y=this.parseSafeCURIEOrCURIEOrURI(X.value,m,n)),!y&&J&&(y=this.resolveAndNormalize(n,encodeURI(J.value))),!y&&G&&(y=this.resolveAndNormalize(n,encodeURI(G.value))),y||(f.parentNode.nodeType===Ct.DOCUMENT_NODE?y=o(f.baseURI):!this.inXHTMLMode&&!this.inHTMLMode||"head"!==f.localName&&"body"!==f.localName?Z?y=this.newBlankNode():p.parentObject&&(y=o(f.parentNode.baseURI)===p.parentObject?o(f.baseURI):p.parentObject,q||(d=!0)):y=o(f.parentNode.baseURI)===p.parentObject?o(f.baseURI):p.parentObject),Z&&(g=y)):($&&(y=this.parseSafeCURIEOrCURIEOrURI($.value,m,n),Z&&(g=y)),y||f.parentNode.nodeType!==Ct.DOCUMENT_NODE?!y&&p.parentObject&&(y=o(f.parentNode.baseURI)===p.parentObject?o(f.baseURI):p.parentObject):(y=o(f.baseURI),Z&&(g=y)),Z&&!g&&(X&&(g=this.parseSafeCURIEOrCURIEOrURI(X.value,m,n)),!g&&J&&(g=this.resolveAndNormalize(n,encodeURI(J.value))),!g&&G&&(g=this.resolveAndNormalize(n,encodeURI(G.value))),g||!this.inXHTMLMode&&!this.inHTMLMode||"head"!==f.localName&&"body"!==f.localName||(g=y),g||(g=this.newBlankNode()),v=g)),y&&($||X||g)){var te=y;Z&&!$&&!X&&v&&(te=v),this.newSubjectOrigin(f,te)}if(g){F=this.tokenize(Z.value);for(var re=0;re<F.length;re++){var ne=this.parseTermOrCURIEOrAbsURI(F[re],k,p.terms,m,n);ne&&this.addTriple(f,g,r.typeURI,{type:r.objectURI,value:ne})}}if(y&&y!==p.parentObject&&(x={},_=!0),v){if(U&&W)for(var ie=0;ie<Q.length;ie++){var oe=x[Q[ie]];oe||(oe=[],x[Q[ie]]=oe),oe.push({type:r.objectURI,value:v})}else if(U)for(var ae=0;ae<Q.length;ae++)this.addTriple(f,y,Q[ae],{type:r.objectURI,value:v});if(B)for(var se=0;se<K.length;se++)this.addTriple(f,v,K[se],{type:r.objectURI,value:y})}else{if(y&&!v&&(U||B)&&(v=this.newBlankNode()),U&&W)for(var ce=0;ce<Q.length;ce++){var ue=x[Q[ce]];ue||(ue=[],x[M]=ue),w.push({predicate:Q[ce],list:ue})}else if(U)for(var le=0;le<Q.length;le++)w.push({predicate:Q[le],forward:!0});if(B)for(var he=0;he<K.length;he++)w.push({predicate:K[he],forward:!1})}if(q){var fe=null,pe=null;H?(fe=""===H.value?r.PlainLiteralURI:this.parseTermOrCURIEOrAbsURI(H.value,k,p.terms,m,n),pe=V&&!z?V.value:fe===r.XMLLiteralURI||fe===r.HTMLLiteralURI?null:z?z.value:f.textContent):z?(fe=r.PlainLiteralURI,pe=z.value):V?(pe=V.value,(fe=r.deriveDateTimeType(pe))||(fe=r.PlainLiteralURI)):U||B||(X&&(pe=this.parseSafeCURIEOrCURIEOrURI(X.value,m,n)),!pe&&J?pe=this.resolveAndNormalize(n,encodeURI(J.value)):!pe&&G&&(pe=this.resolveAndNormalize(n,encodeURI(G.value))),pe&&(fe=r.objectURI)),fe||(Z&&!$?(fe=r.objectURI,pe=g):(pe=f.textContent,this.inHTMLMode&&"time"===f.localName&&(fe=r.deriveDateTimeType(pe)),fe||(fe=r.PlainLiteralURI))),F=this.tokenize(q.value);for(var de=0;de<F.length;de++){var ye=this.parsePredicate(F[de],k,p.terms,m,n);if(ye)if(W){var ve=x[ye];ve||(ve=[],x[ye]=ve),ve.push(fe===r.XMLLiteralURI||fe===r.HTMLLiteralURI?{type:fe,value:f.childNodes}:{type:fe||r.PlainLiteralURI,value:pe,language:j})}else fe===r.XMLLiteralURI||fe===r.HTMLLiteralURI?this.addTriple(f,y,ye,{type:fe,value:f.childNodes}):this.addTriple(f,y,ye,{type:fe||r.PlainLiteralURI,value:pe,language:j})}}if(y&&!d)for(var ge=0;ge<p.incomplete.length;ge++)p.incomplete[ge].list?p.incomplete[ge].list.push({type:r.objectURI,value:y}):p.incomplete[ge].forward?this.addTriple(f,p.subject,p.incomplete[ge].predicate,{type:r.objectURI,value:y}):this.addTriple(f,y,p.incomplete[ge].predicate,{type:r.objectURI,value:p.subject});var me=null,be=y;d?((me=this.push(p,p.subject)).parentObject=o(f.parentNode.baseURI)===p.parentObject?o(f.baseURI):p.parentObject,me.incomplete=p.incomplete,me.language=j,me.prefixes=m,me.vocabulary=k):((me=this.push(p,y)).parentObject=v||y||p.subject,me.prefixes=m,me.incomplete=w,v&&(be=v,x={},_=!0),me.listMapping=x,me.language=j,me.vocabulary=k),_&&i.unshift({parent:f,context:p,subject:be,listMapping:x});for(var we=f.lastChild;we;we=we.previousSibling)we.nodeType===Ct.ELEMENT_NODE&&i.unshift({current:we,context:me})}}this.inHTMLMode&&this.copyProperties();for(var xe=0;xe<this.finishedHandlers.length;xe++)this.finishedHandlers[xe](e)}},{key:"push",value:function(e,t){return{parent:e,subject:t||(e?e.subject:null),parentObject:null,incomplete:[],listMapping:e?e.listMapping:{},language:e?e.language:this.language,prefixes:e?e.prefixes:this.target.graph.prefixes,terms:e?e.terms:this.target.graph.terms,vocabulary:e?e.vocabulary:this.vocabulary}}},{key:"resolveAndNormalize",value:function(e,t){return R.join(t,e)}},{key:"setContext",value:function(e){"html"===e.localName&&"XHTML+RDFa 1.1"===e.getAttribute("version")?this.setXHTMLContext():"html"===e.localName||"http://www.w3.org/1999/xhtml"===e.namespaceURI?"undefined"!=typeof document&&document.doctype?"-//W3C//DTD XHTML+RDFa 1.0//EN"===document.doctype.publicId&&"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"===document.doctype.systemId?(Rt.log("WARNING: RDF 1.0 is not supported. Defaulting to HTML5 mode."),this.setHTMLContext()):"-//W3C//DTD XHTML+RDFa 1.1//EN"===document.doctype.publicId&&"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd"===document.doctype.systemId?this.setXHTMLContext():this.setHTMLContext():this.setHTMLContext():this.setXMLContext()}},{key:"setHTMLContext",value:function(){this.setInitialContext(),this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"},{namespaceURI:null,localName:"lang"}],this.inXHTMLMode=!1,this.inHTMLMode=!0}},{key:"setInitialContext",value:function(){this.vocabulary=null,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"}]}},{key:"setXHTMLContext",value:function(){this.setInitialContext(),this.inXHTMLMode=!0,this.inHTMLMode=!1,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"},{namespaceURI:null,localName:"lang"}],this.target.graph.terms.alternate="http://www.w3.org/1999/xhtml/vocab#alternate",this.target.graph.terms.appendix="http://www.w3.org/1999/xhtml/vocab#appendix",this.target.graph.terms.bookmark="http://www.w3.org/1999/xhtml/vocab#bookmark",this.target.graph.terms.cite="http://www.w3.org/1999/xhtml/vocab#cite",this.target.graph.terms.chapter="http://www.w3.org/1999/xhtml/vocab#chapter",this.target.graph.terms.contents="http://www.w3.org/1999/xhtml/vocab#contents",this.target.graph.terms.copyright="http://www.w3.org/1999/xhtml/vocab#copyright",this.target.graph.terms.first="http://www.w3.org/1999/xhtml/vocab#first",this.target.graph.terms.glossary="http://www.w3.org/1999/xhtml/vocab#glossary",this.target.graph.terms.help="http://www.w3.org/1999/xhtml/vocab#help",this.target.graph.terms.icon="http://www.w3.org/1999/xhtml/vocab#icon",this.target.graph.terms.index="http://www.w3.org/1999/xhtml/vocab#index",this.target.graph.terms.last="http://www.w3.org/1999/xhtml/vocab#last",this.target.graph.terms.license="http://www.w3.org/1999/xhtml/vocab#license",this.target.graph.terms.meta="http://www.w3.org/1999/xhtml/vocab#meta",this.target.graph.terms.next="http://www.w3.org/1999/xhtml/vocab#next",this.target.graph.terms.prev="http://www.w3.org/1999/xhtml/vocab#prev",this.target.graph.terms.previous="http://www.w3.org/1999/xhtml/vocab#previous",this.target.graph.terms.section="http://www.w3.org/1999/xhtml/vocab#section",this.target.graph.terms.stylesheet="http://www.w3.org/1999/xhtml/vocab#stylesheet",this.target.graph.terms.subsection="http://www.w3.org/1999/xhtml/vocab#subsection",this.target.graph.terms.start="http://www.w3.org/1999/xhtml/vocab#start",this.target.graph.terms.top="http://www.w3.org/1999/xhtml/vocab#top",this.target.graph.terms.up="http://www.w3.org/1999/xhtml/vocab#up",this.target.graph.terms.p3pv1="http://www.w3.org/1999/xhtml/vocab#p3pv1",this.target.graph.terms.related="http://www.w3.org/1999/xhtml/vocab#related",this.target.graph.terms.role="http://www.w3.org/1999/xhtml/vocab#role",this.target.graph.terms.transformation="http://www.w3.org/1999/xhtml/vocab#transformation"}},{key:"setXMLContext",value:function(){this.setInitialContext(),this.inXHTMLMode=!1,this.inHTMLMode=!1}},{key:"tokenize",value:function(e){return this.trim(e).split(/\s+/)}},{key:"toRDFNodeObject",value:function(e){var t=this;if(void 0!==e){if("string"==typeof e)return"_:"===e.substring(0,2)?(void 0===this.blankNodes[e.substring(2)]&&(this.blankNodes[e.substring(2)]=new p(e.substring(2))),this.blankNodes[e.substring(2)]):F.namedNode(e);switch(e.type){case r.objectURI:return"_:"===e.value.substring(0,2)?(void 0===this.blankNodes[e.value.substring(2)]&&(this.blankNodes[e.value.substring(2)]=new p(e.value.substring(2))),this.blankNodes[e.value.substring(2)]):F.namedNode(e.value);case r.PlainLiteralURI:return new m(e.value,e.language||"");case r.XMLLiteralURI:case r.HTMLLiteralURI:var n="";return Object.keys(e.value).forEach((function(r){n+=Z.domToString(e.value[r],t.htmlOptions)})),new m(n,"",new y.Z(e.type));default:return new m(e.value,"",new y.Z(e.type))}}}},{key:"trim",value:function(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}],[{key:"parseRDFaDOM",value:function(e,t,n){var i=new r(t,{base:n});e.baseURI||(e.baseURI=n),i.process(e,{baseURI:n})}},{key:"tokenize",value:function(e){return this.trim(e).split(/\s+/)}},{key:"trim",value:function(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}]),r}();Dt.XMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral",Dt.HTMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML",Dt.PlainLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral",Dt.objectURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#object",Dt.typeURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",Dt.nameChar="[-A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�က0-F.0-9·̀-ͯ‿-⁀]",Dt.nameStartChar="[A-Za-zÀ-ÖØ-öø-ÿĀ-ıĴ-ľŁ-ňŊ-žƀ-ǃǍ-ǰǴ-ǵǺ-ȗɐ-ʨʻ-ˁΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϖϚϜϞϠϢ-ϳЁ-ЌЎ-яё-ќў-ҁҐ-ӄӇ-ӈӋ-ӌӐ-ӫӮ-ӵӸ-ӹԱ-Ֆՙա-ֆא-תװ-ײء-غف-يٱ-ڷں-ھۀ-ێې-ۓەۥ-ۦअ-हऽक़-ॡঅ-ঌএ-ঐও-নপ-রলশ-হড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઋઍએ-ઑઓ-નપ-રલ-ળવ-હઽૠଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଶ-ହଽଡ଼-ଢ଼ୟ-ୡஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-வஷ-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡก-ฮะา-ำเ-ๅກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ຮະາ-ຳຽເ-ໄཀ-ཇཉ-ཀྵႠ-Ⴥა-ჶᄀᄂ-ᄃᄅ-ᄇᄉᄋ-ᄌᄎ-ᄒᄼᄾᅀᅌᅎᅐᅔ-ᅕᅙᅟ-ᅡᅣᅥᅧᅩᅭ-ᅮᅲ-ᅳᅵᆞᆨᆫᆮ-ᆯᆷ-ᆸᆺᆼ-ᇂᇫᇰᇹḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼΩK-Å℮ↀ-ↂぁ-ゔァ-ヺㄅ-ㄬ가-힣一-龥〇〡-〩_]",Dt.NCNAME=new RegExp("^"+Dt.nameStartChar+Dt.nameChar+"*$"),Dt.dateTimeTypes=[{pattern:/-?P(?:[0-9]+Y)?(?:[0-9]+M)?(?:[0-9]+D)?(?:T(?:[0-9]+H)?(?:[0-9]+M)?(?:[0-9]+(?:\.[0-9]+)?S)?)?/,type:"http://www.w3.org/2001/XMLSchema#duration"},{pattern:/-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]-[0-9][0-9]T(?:[0-1][0-9]|2[0-4]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]+)?(?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,type:"http://www.w3.org/2001/XMLSchema#dateTime"},{pattern:/-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]-[0-9][0-9](?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,type:"http://www.w3.org/2001/XMLSchema#date"},{pattern:/(?:[0-1][0-9]|2[0-4]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]+)?(?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,type:"http://www.w3.org/2001/XMLSchema#time"},{pattern:/-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]/,type:"http://www.w3.org/2001/XMLSchema#gYearMonth"},{pattern:/-?[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9]/,type:"http://www.w3.org/2001/XMLSchema#gYear"}];var Lt=Dt.parseRDFaDOM,Pt=function(){function r(e){(0,t.Z)(this,r),this.store=e,this.bnodes={},this.why=null,this.reify=!1}return(0,e.Z)(r,[{key:"frameFactory",value:function(e,t,n){return{NODE:1,ARC:2,parent:t,parser:e,store:e.store,element:n,lastChild:0,base:null,lang:null,node:null,nodeType:null,listIndex:1,rdfid:null,datatype:null,collection:!1,terminateFrame:function(){this.collection&&this.node.close()},addSymbol:function(e,t){t=R.join(t,this.base),this.node=this.store.sym(t),this.nodeType=e},loadTriple:function(){if(this.parent.parent.collection?this.parent.parent.node.append(this.node):this.store.add(this.parent.parent.node,this.parent.node,this.node,this.parser.why),null!=this.parent.rdfid){var e=this.store.sym(R.join("#"+this.parent.rdfid,this.base));this.store.add(e,this.store.sym(r.ns.RDF+"type"),this.store.sym(r.ns.RDF+"Statement"),this.parser.why),this.store.add(e,this.store.sym(r.ns.RDF+"subject"),this.parent.parent.node,this.parser.why),this.store.add(e,this.store.sym(r.ns.RDF+"predicate"),this.parent.node,this.parser.why),this.store.add(e,this.store.sym(r.ns.RDF+"object"),this.node,this.parser.why)}},isTripleToLoad:function(){return null!=this.parent&&null!=this.parent.parent&&this.nodeType===this.NODE&&this.parent.nodeType===this.ARC&&this.parent.parent.nodeType===this.NODE},addNode:function(e){this.addSymbol(this.NODE,e),this.isTripleToLoad()&&this.loadTriple()},addCollection:function(){this.nodeType=this.NODE,this.node=this.store.collection(),this.collection=!0,this.isTripleToLoad()&&this.loadTriple()},addCollectionArc:function(){this.nodeType=this.ARC},addBNode:function(e){null!=e?null!=this.parser.bnodes[e]?this.node=this.parser.bnodes[e]:this.node=this.parser.bnodes[e]=this.store.bnode():this.node=this.store.bnode(),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()},addArc:function(e){e===r.ns.RDF+"li"&&(e=r.ns.RDF+"_"+this.parent.listIndex,this.parent.listIndex++),this.addSymbol(this.ARC,e)},addLiteral:function(e){this.parent.datatype&&this.parent.datatype!==r.ns.RDF+"langString"?this.node=this.store.literal(e,this.store.sym(this.parent.datatype)):this.node=this.store.literal(e,this.lang),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()}}}},{key:"getAttributeNodeNS",value:function(e,t,r){var n=null;if(e.getAttributeNodeNS)n=e.getAttributeNodeNS(t,r);else for(var i,o=e.attributes,a=0;a<o.length;++a)if((i=o[a]).namespaceURI===t&&(i.prefix?i.prefix+":"+r:r)===i.nodeName){n=i;break}return n}},{key:"parse",value:function(e,t,n){var i,o=e.childNodes;if(this.cleanParser(),e.nodeType===r.nodeType.DOCUMENT){for(var a=0;a<o.length;a++)if(o[a].nodeType===r.nodeType.ELEMENT){i=o[a];break}}else{if(e.nodeType!==r.nodeType.ELEMENT)throw new Error("RDFParser: can't find root in "+t+". Halting. ");i=e}this.why=n;var s=this.frameFactory(this);return this.base=t,s.base=t,s.lang=null,this.parseDOM(this.buildFrame(s,i)),!0}},{key:"parseDOM",value:function(e){for(var t,n=function(e){var t="";if(null==e.namespaceURI)throw new Error("RDF/XML syntax error: No namespace for "+e.localName+" in "+this.base);return e.namespaceURI&&(t+=e.namespaceURI),e.localName?t+=e.localName:e.nodeName&&(e.nodeName.indexOf(":")>=0?t+=e.nodeName.split(":")[1]:t+=e.nodeName),t}.bind(this),i=!0;e.parent;){var o=e.element,a=o.attributes;if(o.nodeType===r.nodeType.TEXT||o.nodeType===r.nodeType.CDATA_SECTION)e.parent.nodeType===e.NODE&&(e.addArc(r.ns.RDF+"value"),e=this.buildFrame(e)),e.addLiteral(o.nodeValue);else if(n(o)!==r.ns.RDF+"RDF")if(e.parent&&e.parent.collection&&(e.addCollectionArc(),(e=this.buildFrame(e,e.element)).parent.element=null),e.parent&&e.parent.nodeType&&e.parent.nodeType!==e.ARC){e.addArc(n(o)),this.reify&&(t=this.getAttributeNodeNS(o,r.ns.RDF,"ID"))&&(e.rdfid=t.nodeValue,o.removeAttributeNode(t));var s=this.getAttributeNodeNS(o,r.ns.RDF,"parseType"),c=this.getAttributeNodeNS(o,r.ns.RDF,"datatype");if(c&&(e.datatype=c.nodeValue,o.removeAttributeNode(c)),s){var u=s.nodeValue;"Literal"===u?(e.datatype=r.ns.RDF+"XMLLiteral",(e=this.buildFrame(e)).addLiteral(o.childNodes),i=!1):"Resource"===u?((e=this.buildFrame(e,e.element)).parent.element=null,e.addBNode()):"Collection"===u&&((e=this.buildFrame(e,e.element)).parent.element=null,e.addCollection()),o.removeAttributeNode(s)}if(0!==a.length){var l=this.getAttributeNodeNS(o,r.ns.RDF,"resource"),h=this.getAttributeNodeNS(o,r.ns.RDF,"nodeID");e=this.buildFrame(e),l?(e.addNode(l.nodeValue),o.removeAttributeNode(l)):h?(e.addBNode(h.nodeValue),o.removeAttributeNode(h)):e.addBNode();for(var f=a.length-1;f>=0;f--){var p=this.buildFrame(e);p.addArc(n(a[f])),n(a[f])===r.ns.RDF+"type"?this.buildFrame(p).addNode(a[f].nodeValue):this.buildFrame(p).addLiteral(a[f].nodeValue)}}else 0===o.childNodes.length&&this.buildFrame(e).addLiteral("")}else{var d=this.getAttributeNodeNS(o,r.ns.RDF,"about");if(t=this.getAttributeNodeNS(o,r.ns.RDF,"ID"),d&&t)throw new Error("RDFParser: "+o.nodeName+" has both rdf:id and rdf:about. Halting. Only one of these properties may be specified on a node.");if(!d&&t)e.addNode("#"+t.nodeValue),o.removeAttributeNode(t);else if(null==d&&null==t){var y=this.getAttributeNodeNS(o,r.ns.RDF,"nodeID");y?(e.addBNode(y.nodeValue),o.removeAttributeNode(y)):e.addBNode()}else e.addNode(d.nodeValue),o.removeAttributeNode(d);var v=this.getAttributeNodeNS(o,r.ns.RDF,"type");r.ns.RDF+"Description"!==n(o)&&(v={nodeValue:n(o)}),null!=v&&(this.store.add(e.node,this.store.sym(r.ns.RDF+"type"),this.store.sym(R.join(v.nodeValue,e.base)),this.why),v.nodeName&&o.removeAttributeNode(v));for(var g=a.length-1;g>=0;g--)this.store.add(e.node,this.store.sym(n(a[g])),this.store.literal(a[g].nodeValue,e.lang),this.why)}for(o=e.element;e.parent;){for(var m=e;null==o;)o=(e=e.parent).element;var b=o.childNodes&&o.childNodes[e.lastChild];if(b&&i){if((b.nodeType===r.nodeType.ELEMENT||b.nodeType===r.nodeType.TEXT||b.nodeType===r.nodeType.CDATA_SECTION)&&(b.nodeType!==r.nodeType.TEXT&&b.nodeType!==r.nodeType.CDATA_SECTION||1===o.childNodes.length)){e.lastChild++,e=this.buildFrame(m,o.childNodes[e.lastChild-1]);break}e.lastChild++}else{if(e.terminateFrame(),!(e=e.parent))break;o=e.element,i=!0}}}}},{key:"cleanParser",value:function(){this.bnodes={},this.why=null}},{key:"buildFrame",value:function(e,t){var n=this.frameFactory(this,e,t);if(e&&(n.base=e.base,n.lang=e.lang),!t||t.nodeType===r.nodeType.TEXT||t.nodeType===r.nodeType.CDATA_SECTION)return n;var i=t.attributes,o=t.getAttributeNode("xml:base");null!=o&&(n.base=o.nodeValue,t.removeAttribute("xml:base"));var a=t.getAttributeNode("xml:lang");null!=a&&(n.lang=a.nodeValue,t.removeAttribute("xml:lang"));for(var s=i.length-1;s>=0;s--)if("xml"===i[s].nodeName.substr(0,3)){if("xmlns:"===i[s].name.slice(0,6)){var c=i[s].nodeValue;this.base&&(c=R.join(c,this.base)),this.store.setPrefixForURI(i[s].name.slice(6),c)}t.removeAttributeNode(i[s])}return n}}]),r}();function Mt(e,t,r){var n,i,o,a=["INSERT","DELETE","WHERE"],s=B("http://www.w3.org/ns/pim/patch#"),c=Ze(t,t,r,r,null,null,"",null),u={},l=function(e,t,r,n,i){return"Line "+(t+1)+" of <"+e+">: Bad syntax:\n "+i+'\n at: "'+r.slice(n,n+30)+'"'};n=0;var h=t.sym(r+"#query");for(u.query=h;;){if((i=c.skipSpace(e,n))<0)return u;if(";"===e[i]){if((n=c.skipSpace(e,i+1))<0)return u;i=n}var f=!1;for(o=0;o<a.length;o++){var p=a[o];if(e.slice(i,i+p.length)===p){if((n=c.skipSpace(e,i+p.length))<0)throw l(c._thisDoc,c.lines,e,i+p.length,"found EOF, needed {...} after "+p);if(("INSERT"===p||"DELETE"===p)&&"DATA"===e.slice(n,n+4)){if((i=c.skipSpace(e,n+4))<0)throw l(c._thisDoc,c.lines,e,n+4,"needed {...} after INSERT DATA "+p);n=i}var d=[];if((i=c.node(e,n,d))<0)throw l(c._thisDoc,c.lines,e,n,"bad syntax or EOF in {...} after "+p);u[p.toLowerCase()]=d[0],t.add(h,s(p.toLowerCase()),d[0]),f=!0,n=i}}if(!f&&"@prefix"===e.slice(i,i+7)){if((n=c.directive(e,i))<0)throw l(c._thisDoc,c.lines,e,n,"bad syntax or EOF after @prefix ");n=c.checkDot(e,n),f=!0}if(!f)throw l(c._thisDoc,c.lines,e,i,"Unknown syntax at start of statememt: '"+e.slice(i).slice(0,20)+"'")}}function Ft(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"text/turtle",i=arguments.length>4?arguments[4]:void 0;n=(n=n||h.z8).split(";")[0];try{if(n===h.qS||n===h.z8){var o=Ze(t,t,r,r,null,null,"",null);o.loadBuf(e),c()}else if(n===h.Is){var a=new Pt(t);a.parse(Z.parseXML(e),r,t.sym(r)),c()}else if(n===h.D7)Lt(Z.parseXML(e,{contentType:h.D7}),t,r),c();else if(n===h.us)Lt(Z.parseXML(e,{contentType:h.us}),t,r),c();else if(n===h.oW||n===h.xm)Mt(e,t,r),c();else if(n===h.ui)Ye(e,t,r,c);else{if(n!==h.b4&&n!==h.lL)throw void 0===n?new Error("contentType is undefined"):new Error("Don't know how to parse "+n+" yet");var s=new St({factory:Xe});l(null,e)}}catch(e){u(e)}function c(){i&&i(null,t)}function u(e){if(n!==h.ui||n!==h.b4||n!==h.lL){if(!i){var o=new Error(e+" while trying to parse <"+r+"> as "+n);throw o.cause=e,o}i(e,t)}}function l(e,r){e&&i(e,t);try{s.parse(r,f)}catch(e){i(e,t)}}function f(e,r){r?t.add(r.subject,r.predicate,r.object,r.graph):i(e,t)}Ft.handled={"text/n3":!0,"text/turtle":!0,"application/rdf+xml":!0,"application/xhtml+xml":!0,"text/html":!0,"application/sparql-update":!0,"application/sparql-update-single-match":!0,"application/ld+json":!0,"application/nquads":!0,"application/n-quads":!0}}(0,c.Z)(Pt,"ns",{RDF:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",RDFS:"http://www.w3.org/2000/01/rdf-schema#"}),(0,c.Z)(Pt,"nodeType",{ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12});var Ut=n(7297),Bt=n.n(Ut),Zt=n(2598),qt=n(292);function Ht(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,s.Z)(e);if(t){var i=(0,s.Z)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,a.Z)(this,r)}}var Vt={"text/n3":!0,"text/turtle":!0,"application/rdf+xml":!0,"application/xhtml+xml":!0,"text/html":!0,"application/ld+json":!0},zt={rdf:h.Is,owl:h.Is,n3:"text/n3",ttl:"text/turtle",nt:"text/n3",acl:"text/n3",html:"text/html",xml:"text/xml"},$t=function(e){return{link:B("http://www.w3.org/2007/ont/link#",e),http:B("http://www.w3.org/2007/ont/http#",e),httph:B("http://www.w3.org/2007/ont/httph#",e),rdf:B("http://www.w3.org/1999/02/22-rdf-syntax-ns#",e),rdfs:B("http://www.w3.org/2000/01/rdf-schema#",e),dc:B("http://purl.org/dc/elements/1.1/",e),ldp:B("http://www.w3.org/ns/ldp#",e)}},Gt=$t(),Xt=(0,e.Z)((function e(r,n){(0,t.Z)(this,e),(0,c.Z)(this,"response",void 0),(0,c.Z)(this,"dom",void 0),this.response=r,this.dom=n}));(0,c.Z)(Xt,"pattern",void 0);var Jt=function(r){(0,o.Z)(i,r);var n=Ht(i);function i(){return(0,t.Z)(this,i),n.apply(this,arguments)}return(0,e.Z)(i,[{key:"parse",value:function(e,t,r){var n=e.store;if(this.dom||(this.dom=Z.parseXML(t)),"parsererror"===this.dom.documentElement.nodeName)return e.failFetch(r,"Badly formed XML in "+r.resource.value,"parse_error");var i=new Pt(n);try{i.parse(this.dom,r.original.value,r.original)}catch(t){return e.failFetch(r,"Syntax error parsing RDF/XML! "+t,"parse_error")}return r.noMeta||n.add(r.original,Gt.rdf("type"),Gt.link("RDFDocument"),e.appNode),e.doneFetch(r,this.response)}}],[{key:"toString",value:function(){return"RDFXMLHandler"}},{key:"register",value:function(e){e.mediatypes[h.Is]={q:.9}}}]),i}(Xt);Jt.pattern=new RegExp("application/rdf\\+xml");var Wt=function(r){(0,o.Z)(i,r);var n=Ht(i);function i(){return(0,t.Z)(this,i),n.apply(this,arguments)}return(0,e.Z)(i,[{key:"parse",value:function(e,t,r){var n,i;this.dom||(this.dom=Z.parseXML(t));var o=e.store,a=this.dom.getElementsByTagName("title");a.length>0&&o.add(r.resource,Gt.dc("title"),o.rdfFactory.literal(a[0].textContent),r.resource);for(var s=this.dom.getElementsByTagName("link"),c=s.length-1;c>=0;c--)i=!1,(n=s[c].getAttribute("rel"))||(n=s[c].getAttribute("rev"),i=!0),n&&e.linkData(r.original,n,s[c].getAttribute("href"),r.resource,i);for(var u=this.dom.getElementsByTagName("script"),l=0;l<u.length;l++){var h=u[l].getAttribute("type");Vt[h]&&(Ft(u[l].textContent,o,r.original.value,h),Ft(u[l].textContent,o,r.original.value,h))}if(r.noMeta||o.add(r.resource,Gt.rdf("type"),Gt.link("WebPage"),e.appNode),!r.noRDFa&&Lt)try{Lt(this.dom,o,r.original.value)}catch(t){var f="Error trying to parse "+r.resource+" as RDFa:\n"+t+":\n"+t.stack;return e.failFetch(r,f,"parse_error")}return e.doneFetch(r,this.response)}}],[{key:"toString",value:function(){return"XHTMLHandler"}},{key:"register",value:function(e){e.mediatypes[h.D7]={}}}]),i}(Xt);Wt.pattern=new RegExp("application/xhtml");var Qt=function(r){(0,o.Z)(i,r);var n=Ht(i);function i(){return(0,t.Z)(this,i),n.apply(this,arguments)}return(0,e.Z)(i,[{key:"parse",value:function(e,t,r){for(var n=Z.parseXML(t),o=0;o<n.childNodes.length;o++){var a=n.childNodes[o];if(i.isElement(a)){var s=a.namespaceURI;if(s&&s===s.rdf)return e.addStatus(r.req,"Has XML root element in the RDF namespace, so assume RDF/XML."),new Jt(this.response,n).parse(e,t,r);break}}if(n.doctype&&"html"===n.doctype.name&&n.doctype.publicId.match(/^-\/\/W3C\/\/DTD XHTML/)&&n.doctype.systemId.match(/http:\/\/www.w3.org\/TR\/xhtml/))return e.addStatus(r.req,"Has XHTML DOCTYPE. Switching to XHTML Handler.\n"),new Wt(this.response,n).parse(e,t,r);var c=n.getElementsByTagName("html")[0];if(c){var u=c.getAttribute("xmlns");if(u&&u.match(/^http:\/\/www.w3.org\/1999\/xhtml/))return e.addStatus(r.req,"Has a default namespace for XHTML. Switching to XHTMLHandler.\n"),new Wt(this.response,n).parse(e,t,r)}return e.failFetch(r,"Unsupported dialect of XML: not RDF or XHTML namespace, etc.\n"+t.slice(0,80),901)}}],[{key:"toString",value:function(){return"XMLHandler"}},{key:"register",value:function(e){e.mediatypes["text/xml"]={q:.5},e.mediatypes["application/xml"]={q:.5}}},{key:"isElement",value:function(e){return e.nodeType===Node.ELEMENT_NODE}}]),i}(Xt);Qt.pattern=new RegExp("(text|application)/(.*)xml");var Yt=function(r){(0,o.Z)(i,r);var n=Ht(i);function i(){return(0,t.Z)(this,i),n.apply(this,arguments)}return(0,e.Z)(i,[{key:"parse",value:function(e,t,r){var n=e.store;if(nr(t))return e.addStatus(r.req,"Has an XML declaration. We'll assume it's XHTML as the content-type was text/html.\n"),new Wt(this.response).parse(e,t,r);if(function(e){var t=e.indexOf("<!DOCTYPE html"),r=e.indexOf(">");return!(-1===t||-1===r||t>r)&&-1!==e.substr(t,r-t).indexOf("XHTML")}(t))return e.addStatus(r.req,"Has XHTML DOCTYPE. Switching to XHTMLHandler.\n"),new Wt(this.response).parse(e,t,r);if(function(e){return!!e.match(/[^(<html)]*<html\s+[^<]*xmlns=['"]http:\/\/www.w3.org\/1999\/xhtml["'][^<]*>/)}(t))return e.addStatus(r.req,"Has default namespace for XHTML, so switching to XHTMLHandler.\n"),new Wt(this.response).parse(e,t,r);var i=new RegExp("<title>([\\s\\S]+?)</title>","im").exec(t);return i&&n.add(r.resource,Gt.dc("title"),n.rdfFactory.literal(i[1]),r.resource),n.add(r.resource,Gt.rdf("type"),Gt.link("WebPage"),e.appNode),e.addStatus(r.req,"non-XML HTML document, not parsed for data."),e.doneFetch(r,this.response)}}],[{key:"toString",value:function(){return"HTMLHandler"}},{key:"register",value:function(e){e.mediatypes["text/html"]={q:.9}}}]),i}(Xt);Yt.pattern=new RegExp("text/html");var Kt=function(r){(0,o.Z)(i,r);var n=Ht(i);function i(){return(0,t.Z)(this,i),n.apply(this,arguments)}return(0,e.Z)(i,[{key:"parse",value:function(e,t,r,n){var i=e.store;return new Promise((function(o,a){try{Ye(t,i,r.original.value,(function(){o(e.doneFetch(r,n))}))}catch(t){var s="Error trying to parse "+r.resource+" as JSON-LD:\n"+t;o(e.failFetch(r,s,"parse_error",n))}}))}}],[{key:"toString",value:function(){return"JsonLdHandler"}},{key:"register",value:function(e){e.mediatypes["application/ld+json"]={q:.9}}}]),i}(Xt);Kt.pattern=/application\/ld\+json/;var er=function(r){(0,o.Z)(i,r);var n=Ht(i);function i(){return(0,t.Z)(this,i),n.apply(this,arguments)}return(0,e.Z)(i,[{key:"parse",value:function(e,t,r){return nr(t)?(e.addStatus(r.req,"Warning: "+r.resource+" has an XML declaration. We'll assume it's XML but its content-type wasn't XML.\n"),new Qt(this.response).parse(e,t,r)):t.slice(0,500).match(/xmlns:/)?(e.addStatus(r.req,"May have an XML namespace. We'll assume it's XML but its content-type wasn't XML.\n"),new Qt(this.response).parse(e,t,r)):(e.addStatus(r.req,"Plain text document, no known RDF semantics."),e.doneFetch(r,this.response))}}],[{key:"toString",value:function(){return"TextHandler"}},{key:"register",value:function(e){e.mediatypes["text/plain"]={q:.5}}}]),i}(Xt);er.pattern=new RegExp("text/plain");var tr=function(r){(0,o.Z)(i,r);var n=Ht(i);function i(){return(0,t.Z)(this,i),n.apply(this,arguments)}return(0,e.Z)(i,[{key:"parse",value:function(e,t,r,n){var i=e.store,o=Ze(i,i,r.original.value,r.original.value,null,null,"",null);try{o.loadBuf(t)}catch(t){var a="Error trying to parse "+r.resource+" as Notation3:\n"+t;return e.failFetch(r,a,"parse_error",n)}return e.addStatus(r.req,"N3 parsed: "+o.statementCount+" triples in "+o.lines+" lines."),e.store.add(r.original,Gt.rdf("type"),Gt.link("RDFDocument"),e.appNode),e.doneFetch(r,this.response)}}],[{key:"toString",value:function(){return"N3Handler"}},{key:"register",value:function(e){e.mediatypes["text/n3"]={q:"1.0"},e.mediatypes["text/turtle"]={q:1}}}]),i}(Xt);tr.pattern=new RegExp("(application|text)/(x-)?(rdf\\+)?(n3|turtle)");var rr={RDFXMLHandler:Jt,XHTMLHandler:Wt,XMLHandler:Qt,HTMLHandler:Yt,TextHandler:er,N3Handler:tr,JsonLdHandler:Kt};function nr(e){return!!e.match(/\s*<\?xml\s+version\s*=[^<>]+\?>/)}var ir=function(){function r(e){var i=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((0,t.Z)(this,r),(0,c.Z)(this,"store",void 0),(0,c.Z)(this,"timeout",void 0),(0,c.Z)(this,"_fetch",void 0),(0,c.Z)(this,"mediatypes",void 0),(0,c.Z)(this,"appNode",void 0),(0,c.Z)(this,"requested",void 0),(0,c.Z)(this,"timeouts",void 0),(0,c.Z)(this,"redirectedTo",void 0),(0,c.Z)(this,"fetchQueue",void 0),(0,c.Z)(this,"fetchCallbacks",void 0),(0,c.Z)(this,"nonexistent",void 0),(0,c.Z)(this,"lookedUp",void 0),(0,c.Z)(this,"handlers",void 0),(0,c.Z)(this,"ns",void 0),(0,c.Z)(this,"fireCallbacks",void 0),this.store=e||new ge,this.ns=$t(this.store.rdfFactory),this.timeout=o.timeout||3e4,this._fetch=o.fetch||void 0!==n.g&&(n.g.solidFetcher||n.g.solidFetch)||"undefined"!=typeof window&&(window.solidFetcher||window.solidFetch)||Bt(),!this._fetch)throw new Error("No _fetch function available for Fetcher");this.appNode=this.store.rdfFactory.blankNode(),this.store.fetcher=this,this.requested={},this.timeouts={},this.redirectedTo={},this.fetchQueue={},this.fetchCallbacks={},this.nonexistent={},this.lookedUp={},this.handlers=[],this.mediatypes={"image/*":{q:.9},"*/*":{q:.1}},Z.callbackify(this,["request","fail","refresh","retract","done"]),Object.keys(o.handlers||rr).map((function(e){return i.addHandler(rr[e])}))}var i,o;return(0,e.Z)(r,[{key:"load",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r=Object.assign({},r),e instanceof Array)return Promise.all(e.map((function(e){return t.load(e,Object.assign({},r))})));var n=e,i=(0,Zt._)(n);i=i.split("#")[0],r=this.initFetchOptions(i,r);var o=this.initFetchOptions(i,r);return this.pendingFetchPromise(i,o.baseURI,o)}},{key:"pendingFetchPromise",value:(o=j(T().mark((function e(t,r,n){var i,o=this;return T().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=!n.force,!e.t0){e.next=5;break}return e.next=4,this.fetchQueue[r];case 4:e.t0=e.sent;case 5:if(!e.t0){e.next=9;break}i=this.fetchQueue[r],e.next=12;break;case 9:i=Promise.race([this.setRequestTimeout(t,n),this.fetchUri(t,n)]),this.fetchQueue[r]=i,this.cleanupFetchRequest(r,void 0,this.timeout);case 12:return e.abrupt("return",i.then((function(e){return t in o.timeouts&&(o.timeouts[t].forEach(clearTimeout),delete o.timeouts[t]),e})));case 13:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return o.apply(this,arguments)})},{key:"cleanupFetchRequest",value:function(e,t,r){var n=this;void 0!==t&&qt.warn("_options is deprecated"),this.timeouts[e]=(this.timeouts[e]||[]).concat(setTimeout((function(){n.isPending(e)||delete n.fetchQueue[e]}),r))}},{key:"initFetchOptions",value:function(e,t){var n=this.store;!t.method||"GET"===t.method.toUpperCase()||(t.force=!0),t.resource=n.rdfFactory.namedNode(e),t.baseURI=t.baseURI||e,t.original=n.rdfFactory.namedNode(t.baseURI),t.req=n.bnode(),t.headers=t.headers||new Ut.Headers,t.contentType&&(t.headers["content-type"]=t.contentType),t.force&&(t.cache="no-cache");var i=this.acceptString();t.headers.accept=i;var o=r.offlineOverride(e);t.requestedURI=o,r.setCredentials(o,t);var a=r.proxyIfNecessary(o);return o!==a&&(t.proxyUsed=!0),t.actualProxyURI=a,t}},{key:"fetchUri",value:function(e,t){var n=this;if(!e)return Promise.reject(new Error("Cannot fetch an empty uri"));if(r.unsupportedProtocol(e))return this.failFetch(t,"fetcher: Unsupported protocol","unsupported_protocol");var i=this.getState(e);if(t.force)delete this.nonexistent[e];else{if("fetched"===i)return Promise.resolve(this.doneFetch(t,{status:200,ok:!0,statusText:"Already loaded into quadstore."}));if("failed"===i&&404===this.requested[e]){var o="Previously failed: "+this.requested[e],a={url:e,status:this.requested[e],statusText:o,responseText:o,headers:new Ut.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return this.failFetch(t,o,this.requested[e],a)}}this.fireCallbacks("request",[e]),this.requested[e]=!0,t.noMeta||this.saveRequestMetadata(e,t);var s=t.actualProxyURI;return this._fetch(s,t).then((function(r){return n.handleResponse(r,e,t)}),(function(r){var i={url:s,status:999,statusText:(r.name||"network failure")+": "+(r.errno||r.code||r.type),responseText:r.message,headers:new Ut.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return qt.log("Fetcher: <"+s+"> Non-HTTP fetch exception: "+r),n.handleError(i,e,t)}))}},{key:"nowOrWhenFetched",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=(0,Zt._)(e);"function"==typeof t?r=t:void 0===t||((0,v.NX)(t)?n.referringTerm=t:n=t),this.load(i,n).then((function(e){if(r)if(e)if(e.ok)r(!0,"OK",e);else{var t="HTTP error: Status "+e.status+" ("+e.statusText+")";e.responseText&&(t+=" "+e.responseText),qt.log(t+" fetching "+i),r(!1,t,e)}else{var n="@@ nowOrWhenFetched: no response object!";qt.log(n),r(!1,n)}}),(function(e){var t=e.message||e.statusText;t="Failed to load <"+i+"> "+t,qt.log(t),e.response&&e.response.status&&(t+=" status: "+e.response.status),r(!1,t,e.response)}))}},{key:"addStatus",value:function(e,t){var r=new Date;t="["+r.getHours()+":"+r.getMinutes()+":"+r.getSeconds()+"."+r.getMilliseconds()+"] "+t;var n=this.store,i=n.the(e,this.ns.link("status"));(0,v.uZ)(i)?i.append(n.rdfFactory.literal(t)):U.Z.warn("web.js: No list to add to: "+i+","+t)}},{key:"failFetch",value:function(e,t,r,n){this.addStatus(e.req,t),e.noMeta||this.store.add(e.original,this.ns.link("error"),this.store.rdfFactory.literal(t));var i=(e.method||"GET").toUpperCase();("GET"===i||"HEAD"===i)&&(e.resource.equals(e.original),this.requested[R.docpart(e.original.value)]=r,this.fireCallbacks("fail",[e.original.value,t]));var o=new Error("Fetcher: "+t);return o.status=r,o.statusText=t,o.response=n,Promise.reject(o)}},{key:"linkData",value:function(e,t,r,n,i){if(r){var o,a=this.store,s=a.rdfFactory.namedNode(R.join(r,e.value));if("alternate"===t||"seeAlso"===t||"meta"===t||"describedby"===t){if(s.value===e.value)return;o=this.ns.rdfs("seeAlso")}else o="type"===t?a.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"):a.rdfFactory.namedNode(R.join(encodeURIComponent(t),"http://www.iana.org/assignments/link-relations/"));i?a.add(s,o,e,n):a.add(e,o,s,n)}}},{key:"parseLinkHeader",value:function(e,t,r){if(e){var n=/[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*"))/g,i=e.match(/<[^>]*>\s*(\s*;\s*[^()<>@,;:"/[\]?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*")))*(,|$)/g);if(null!=i)for(var o=0;o<i.length;o++){var a=i[o].split(">"),s=a[0].substring(1),c=a[1].match(n);if(null==c)return;for(var u=0;u<c.length;u++){var l=c[u].split("=")[1].replace(/["']/g,"");this.linkData(t,l,s,r)}}}}},{key:"doneFetch",value:function(e,t){return this.addStatus(e.req,"Done."),this.requested[e.original.value]="done",this.fireCallbacks("done",[e.original.value]),t.req=e.req,t}},{key:"nowKnownAs",value:function(e,t){this.lookedUp[e.value]?this.lookedUp[t.value]||this.lookUpThing(t,e):this.lookedUp[t.value]&&(this.lookedUp[e.value]||this.lookUpThing(e,t))}},{key:"putBack",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,Zt._)(e),i=new y.Z(n).doc();return r.contentType=r["content-type"]||r["Content-Type"]||r.contentType||h.z8,"application/ld+json"===r.contentType?new Promise((function(n,o){J(i,t.store,i.uri,r.contentType,(function(i,a){i?o(i):(r.data=a,t.webOperation("PUT",e,r).then((function(e){return n(e)})).catch((function(e){return o(e)})))}))})):(r.data=J(i,this.store,i.value,r.contentType),this.webOperation("PUT",n,r))}},{key:"webCopy",value:function(e,t,r){var n=this;return this.webOperation("GET",e).then((function(e){return n.webOperation("PUT",t,{data:e.responseText,contentType:r})}))}},{key:"delete",value:function(e,t){var r=this;return this.webOperation("DELETE",e,t).then((function(t){return r.requested[e]=404,r.nonexistent[e]=!0,r.unload(r.store.rdfFactory.namedNode(e)),t}))}},{key:"createIfNotExists",value:(i=j(T().mark((function e(t){var r,n,i,o,a=arguments;return T().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:h.z8,n=a.length>2&&void 0!==a[2]?a[2]:"",i=this,e.prev=3,e.next=6,i.load(t);case 6:o=e.sent,e.next=29;break;case 9:if(e.prev=9,e.t0=e.catch(3),404!==e.t0.response.status){e.next=27;break}return qt.log("createIfNotExists: doc does NOT exist, will create... "+t),e.prev=13,e.next=16,i.webOperation("PUT",t.value,{data:n,contentType:r});case 16:o=e.sent,e.next=23;break;case 19:throw e.prev=19,e.t1=e.catch(13),qt.log("createIfNotExists doc FAILED: "+t+": "+e.t1),e.t1;case 23:return delete i.requested[t.value],e.abrupt("return",o);case 27:throw qt.log("createIfNotExists doc load error NOT 404: "+t+": "+e.t0),e.t0;case 29:return e.abrupt("return",o);case 30:case"end":return e.stop()}}),e,this,[[3,9],[13,19]])}))),function(e){return i.apply(this,arguments)})},{key:"createContainer",value:function(e,t,r){var n={"content-type":h.z8,link:this.ns.ldp("BasicContainer")+'; rel="type"'};t&&(n.slug=t);var i={headers:n};return r&&(i.body=r),this.webOperation("POST",e,i)}},{key:"invalidateCache",value:function(e){var t=(0,Zt._)(e),r=this;if(r.fetchQueue&&r.fetchQueue[t]&&(r.fetchQueue[t].PromiseStatus,delete r.fetchQueue[t]),r.requested[t]&&"done"!==r.requested[t]&&"failed"!==r.requested[t]&&404!==r.requested[t]){var n="Rdflib: fetcher: Destructive operation on <".concat(r.requested[t],"> file being fetched! ")+t;qt.error(n)}else delete r.requested[t],delete r.nonexistent[t]}},{key:"webOperation",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=(0,Zt._)(t);n.method=e,n.body=n.data||n.body,n.force=!0;var o=this;if(n.body&&!n.contentType)throw new Error("Web operation sending data must have a defined contentType.");return n.contentType&&(n.headers=n.headers||{},n.headers["content-type"]=n.contentType),r.setCredentials(i,n),new Promise((function(t,r){o._fetch(i,n).then((function(n){if(n.ok)"PUT"!==e&&"PATCH"!==e&&"POST"!==e&&"DELETE"!==e||o.invalidateCache(i),n.text?n.text().then((function(e){n.responseText=e,t(n)})):t(n);else{var a="Web error: "+n.status;n.statusText&&(a+=" ("+n.statusText+")"),a+=" on "+e+" of <"+i+">",n.responseText&&(a+=": "+n.responseText);var s=new Error(a);s.response=n,r(s)}}),(function(t){r(new Error("Fetch error for "+e+" of <"+i+">:"+t))}))}))}},{key:"lookUpThing",value:function(e,t){var r=this,n=this.store.uris(e);return(n=n.map((function(e){return R.docpart(e)}))).forEach((function(e){r.lookedUp[e]=!0})),this.load(n,{referringTerm:t})}},{key:"getHeader",value:function(e,t){for(var r=this.store,n=e.value,i=r.each(void 0,this.ns.link("requestedURI"),r.rdfFactory.literal(n)),o=0;o<i.length;o++){var a=i[o];if(void 0!==a){var s=r.any(a,this.ns.link("response"));if(void 0!==s&&r.anyValue(s,this.ns.http("status"))&&r.anyValue(s,this.ns.http("status")).startsWith("2")){var c=r.each(s,this.ns.httph(t.toLowerCase()));return c.length?c.map((function(e){return e.value})):[]}}}}},{key:"saveRequestMetadata",value:function(e,t){var r=t.req,n=this.store,i=t.referringTerm;this.addStatus(t.req,"Accept: "+t.headers.accept),(0,v.NX)(i)&&n.add(n.rdfFactory.namedNode(e),this.ns.link("requestedBy"),i,this.appNode),t.original&&t.original.value!==e&&n.add(r,this.ns.link("orginalURI"),n.rdfFactory.literal(t.original.value),this.appNode);var o=new Date,a="["+o.getHours()+":"+o.getMinutes()+":"+o.getSeconds()+"] ";n.add(r,this.ns.rdfs("label"),n.rdfFactory.literal(a+" Request for "+e),this.appNode),n.add(r,this.ns.link("requestedURI"),n.rdfFactory.literal(e),this.appNode),n.add(r,this.ns.link("status"),n.collection(),this.appNode)}},{key:"saveResponseMetadata",value:function(e,t){var r=this,n=this.store,i=n.bnode();return n.add(t.req,this.ns.link("response"),i,i),n.add(i,this.ns.http("status"),n.rdfFactory.literal(e.status),i),n.add(i,this.ns.http("statusText"),n.rdfFactory.literal(e.statusText),i),e.headers.forEach((function(e,o){n.add(i,r.ns.httph(o),r.store.rdfFactory.literal(e),i),"content-type"===o&&n.add(t.resource,r.ns.rdf("type"),n.rdfFactory.namedNode(Z.mediaTypeClass(e).value),i)})),i}},{key:"objectRefresh",value:function(e){var t=this.store.uris(e);if(void 0!==t)for(var r=0;r<t.length;r++)this.refresh(this.store.rdfFactory.namedNode(R.docpart(t[r])))}},{key:"refresh",value:function(e,t){this.fireCallbacks("refresh",arguments),this.nowOrWhenFetched(e,{force:!0,clearPreviousData:!0},t)}},{key:"refreshIfExpired",value:function(e,t){var r=this.getHeader(e,"Expires");!r||new Date(r[0]).getTime()<=(new Date).getTime()?this.refresh(e,t):t(!0,"Not expired",{})}},{key:"retract",value:function(e){this.store.removeMany(void 0,void 0,void 0,e),e.value&&delete this.requested[R.docpart(e.value)],this.fireCallbacks("retract",arguments)}},{key:"getState",value:function(e){return void 0===this.requested[e]?"unrequested":!0===this.requested[e]?"requested":"done"===this.requested[e]?"fetched":"redirected"===this.requested[e]?this.getState(this.redirectedTo[e]):"failed"}},{key:"isPending",value:function(e){return!0===this.requested[e]}},{key:"unload",value:function(e){this.store.removeDocument(e),delete this.requested[e.value]}},{key:"addHandler",value:function(e){this.handlers.push(e),e.register(this)}},{key:"retryNoCredentials",value:function(e,t){qt.log("Fetcher: CORS: RETRYING with NO CREDENTIALS for "+t.resource),t.retriedWithNoCredentials=!0,delete this.requested[e],delete this.fetchQueue[e];var r=Object.assign({},t,{credentials:"omit"});return this.addStatus(t.req,"Abort: Will retry with credentials SUPPRESSED to see if that helps"),this.load(e,r)}},{key:"isCrossSite",value:function(e){if("undefined"==typeof document||!document.location)return!1;var t=R.hostpart,r=""+document.location;return(t(r)&&t(e)&&t(r))!==t(e)}},{key:"handleError",value:function(e,t,n){if(this.isCrossSite(t)){if(n.credentials&&"include"===n.credentials&&!n.retriedWithNoCredentials)return this.retryNoCredentials(t,n);var i=r.crossSiteProxy(t);if(i&&!n.proxyUsed)return qt.log("web: Direct failed so trying proxy "+i),this.redirectToProxy(i,n)}var o;return e instanceof Error?o="Fetch error: "+e.message:(o=e.statusText,e.responseText&&(o+=" ".concat(e.responseText))),this.failFetch(n,o,e.status||998,e)}},{key:"addType",value:function(e,t,r,n){var i=t;if(n){var o=r.any(i,this.ns.link("requestedURI"));o&&o.value!==n&&r.add(r.rdfFactory.namedNode(n),this.ns.rdf("type"),e,this.appNode)}for(;;){var a=r.any(i,this.ns.link("requestedURI"));if(a&&a.value&&r.add(r.rdfFactory.namedNode(a.value),this.ns.rdf("type"),e,this.appNode),!(i=r.any(void 0,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#redirectedRequest"),i)))break;var s=r.any(i,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#response"));if(!s)break;var c=r.any(s,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/http#status"));if(!c)break;if("301"!==c&&"302"!==c)break}}},{key:"handleResponse",value:function(e,t,r){var n=this,i=this.store,o=e.headers,a=r.req,s=this.saveResponseMetadata(e,r),c=this.normalizedContentType(r,o)||"",u=o.get("content-location");if(0===e.status)return qt.log("Masked error - status 0 for "+t),this.handleError(e,t,r);if(e.status>=400)return 404===e.status&&(this.nonexistent[r.original.value]=!0,this.nonexistent[t]=!0),this.saveErrorResponse(e,s).then((function(){var t=r.resource+" "+e.statusText;return n.failFetch(r,t,e.status,e)}));var l=null,h=null;if(u&&(h=R.join(u,t))!==t&&(l=h),200===e.status){this.addType(this.ns.link("Document"),a,i,t),l&&this.addType(this.ns.link("Document"),a,i,l),r.clearPreviousData&&i.removeDocument(r.resource);var f=c.includes("image/")||c.includes("application/pdf");c&&f&&(this.addType(i.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),a,i,t),l&&this.addType(i.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),a,i,l))}if(u){if(!r.force&&l&&"done"===this.requested[h])return this.doneFetch(r,e);this.requested[h]=!0}this.parseLinkHeader(o.get("link"),r.original,a);var p=this.handlerForContentType(c,e);return p?e.text().then((function(t){return e.responseText=t,p.parse(n,t,r,e)})):(this.addStatus(a,"Fetch over. No data handled."),this.doneFetch(r,e))}},{key:"saveErrorResponse",value:function(e,t){var r=this,n=this.store;return e.text().then((function(e){e.length>10&&n.add(t,r.ns.http("content"),n.rdfFactory.literal(e),t)}))}},{key:"handlerForContentType",value:function(e,t){if(!e)return null;var r=this.handlers.find((function(t){return e.match(t.pattern)}));return r?new r(t):null}},{key:"guessContentType",value:function(e){return zt[e.split(".").pop()]}},{key:"normalizedContentType",value:function(e,t){if(e.forceContentType)return e.forceContentType;var r=t.get("content-type");if(!r||r.includes("application/octet-stream")){var n=this.guessContentType(e.resource.value);if(n)return n}var i=R.protocol(e.resource.value);return!r&&["file","chrome"].includes(i)?"text/xml":r}},{key:"redirectToProxy",value:function(e,t){var r=this;this.addStatus(t.req,"BLOCKED -> Cross-site Proxy to <"+e+">"),t.proxyUsed=!0;var n=this.store,i=t.req;t.noMeta||(n.add(i,this.ns.link("redirectedTo"),n.rdfFactory.namedNode(e),i),this.addStatus(i,"redirected to new request")),this.requested[t.resource.value]="redirected",this.redirectedTo[t.resource.value]=e;var o=Object.assign({},t);return o.baseURI=t.resource.value,this.fetchUri(e,o).then((function(e){return o.noMeta||n.add(i,r.ns.link("redirectedRequest"),o.req,r.appNode),e}))}},{key:"setRequestTimeout",value:function(e,t){var r=this;return new Promise((function(n){r.timeouts[e]=(r.timeouts[e]||[]).concat(setTimeout((function(){!r.isPending(e)||t.retriedWithNoCredentials||t.proxyUsed||n(r.failFetch(t,"Request to ".concat(e," timed out"),"timeout"))}),r.timeout))}))}},{key:"addFetchCallback",value:function(e,t){this.fetchCallbacks[e]?this.fetchCallbacks[e].push(t):this.fetchCallbacks[e]=[t]}},{key:"acceptString",value:function(){var e="";for(var t in this.mediatypes)for(var r in""!==e&&(e+=", "),e+=t,this.mediatypes[t])e+=";"+r+"="+this.mediatypes[t][r];return e}}],[{key:"crossSiteProxy",value:function(e){return r.crossSiteProxyTemplate?r.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(e)):void 0}},{key:"offlineOverride",value:function(e){var t,r=e;return"undefined"!=typeof window&&window.panes&&(t=window.panes.UI)&&t.preferences&&t.preferences.get("offlineModeUsingLocalhost")&&"http://"===r.slice(0,7)&&"localhost/"!==r.slice(7,17)&&(r="http://localhost/"+r.slice(7),U.Z.warn("Localhost kludge for offline use: actually getting <"+r+">")),r}},{key:"proxyIfNecessary",value:function(e){var t;if("undefined"!=typeof window&&window.panes&&(t=window.panes.UI)&&t.isExtension)return e;if("undefined"!=typeof $SolidTestEnvironment&&$SolidTestEnvironment.localSiteMap){var n=function e(t,r){var n=r[t.shift()];return n?"string"==typeof n?n+t.join("/"):t?e(t,n):null:null}(e.split("/").slice(2),$SolidTestEnvironment.localSiteMap);if(n)return n}return r.crossSiteProxyTemplate&&"undefined"!=typeof document&&document.location&&"https:"===(""+document.location).slice(0,6)&&"http:"===e.slice(0,5)?r.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(e)):e}},{key:"unsupportedProtocol",value:function(e){var t=R.protocol(e);return"tel"===t||"mailto"===t||"urn"===t}},{key:"setCredentials",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};void 0===t.credentials&&(void 0!==t.withCredentials?t.credentials=t.withCredentials?"include":"omit":t.credentials="include")}}]),r}();(0,c.Z)(ir,"HANDLERS",void 0),(0,c.Z)(ir,"CONTENT_TYPE_BY_EXT",void 0),(0,c.Z)(ir,"crossSiteProxyTemplate",void 0),ir.HANDLERS=rr,ir.CONTENT_TYPE_BY_EXT=zt;const or={parseJSON:function(e,t,r){var n,i,o,a={},s=r.sym(t);for(var c in e){0===c.indexOf("_:")?a[c]?n=a[c]:(n=r.bnode(c),a[c]=n):n=r.sym(c);var u=e[c];for(var l in u){var h=u[l];for(var f in i=r.sym(l),h){var p=h[f];if("uri"===p.type)o=r.sym(p.value),r.add(n,i,o,s);else if("BlankNode"===p.type)a[p.value]?o=a[p.value]:(o=r.bnode(p.value),a[p.value]=o),r.add(n,i,o,s);else{if("Literal"!==p.type)throw new Error("error: unexpected termtype: "+f.type);o=p.datatype?r.literal(p.value,void 0,r.sym(p.datatype)):p.lang?r.literal(p.value,p.lang):r.literal(p.value),r.add(n,i,o,s)}}}}}};function ar(e){var t=0;function r(e){var t="",r=e.statements;for(var n in r)U.Z.debug("Found statement: "+r),t+=a()+r[n]+"\n";return t}function n(e){var t="";for(var r in e.constraints){var n=e.constraints[r];t+=a()+"FILTER ( "+n.describe(r)+" ) \n"}return t}function i(e){for(var o="",s=0;s<e.optional.length;s++)U.Z.debug("Found optional query"),o+=a()+"OPTIONAL { \n",t++,o+=r(e.optional[s]),o+=n(e.optional[s]),o+=i(e.optional[s]),t--,o+=a()+"}\n";return o}function o(e){var o=a()+"WHERE \n{ \n";return t++,o+=r(e),o+=n(e),o+=i(e),t--,o+"}"}function a(){for(var e="",r=0;r<t;r++)e+=" ";return e}return function(e){return function(e){for(var t=a()+"SELECT ",r=0;r<e.vars.length;r++)t+=e.vars[r]+" ";return t+"\n"}(e)+o(e.pat)}(e)}function sr(e,t,r){var n=[];function i(e){if(n[e])return n[e];var t=r.variable(e);return n[e]=t,t}function o(e){return"string"==typeof e&&e.match(/[^ \n\t]/)}function a(e){return"string"==typeof e&&e.match(/^[\?\$]/)}function s(e){return"string"==typeof e?e.replace(/^&lt;/,"<").replace(/&gt;$/,">"):e}function c(e){return"string"==typeof e&&e.match(/^<[^>]*>$/)}function u(e){return"string"==typeof e&&(e.match(/^_:/)||e.match(/^$/))}function l(e){return"string"==typeof e&&e.match(/:$/)}function h(e){return"string"==typeof e&&e.match(/^:|^[^_][^:]*:/)}function f(e){return e.split(":")[0]}function p(e){return e.split(":")[1]}function d(e){return c(e)?e.slice(1,e.length-1):e}function y(e){var t=-1===e.indexOf("'")?null:e.indexOf("'"),n=-1===e.indexOf('"')?null:e.indexOf('"');if(!t&&!n){var i=new Array(1);return i[0]=e,i}var o,a,s=new Array(2);if(!t||n&&n<t)o='"',a=n;else{if(n&&!(t&&t<n))return U.Z.error("SQARQL QUERY OOPS!"),s;o="'",a=t}s[0]=e.slice(0,a);var c,u=e.slice(a+1).indexOf(o);return-1===u?(U.Z.error("SPARQL parsing error: no matching parentheses in literal "+e),e):(e.slice(u+a+2).match(/^\^\^/)?(c=e.slice(u+a+2).indexOf(" "),s[1]=r.literal(e.slice(a+1,a+1+u),r.sym(d(e.slice(a+4+u,a+2+u+c)))),s=s.concat(y(e.slice(u+a+3+c)))):e.slice(u+a+2).match(/^@/)?(c=e.slice(u+a+2).indexOf(" "),s[1]=r.literal(e.slice(a+1,a+1+u),e.slice(a+3+u,a+2+u+c),null),s=s.concat(y(e.slice(u+a+2+c)))):(s[1]=r.literal(e.slice(a+1,a+1+u)),U.Z.info("Literal found: "+s[1]),s=s.concat(y(e.slice(u+a+2)))),s)}function v(e){e=e.replace(/\(/g," ( ").replace(/\)/g," ) ").replace(/</g," <").replace(/>/g,"> ").replace(/{/g," { ").replace(/}/g," } ").replace(/[\t\n\r]/g," ").replace(/; /g," ; ").replace(/\. /g," . ").replace(/, /g," , "),U.Z.info("New str into spaceDelimit: \n"+e);var t=[],r=e.split(" ");for(var n in r)o(r[n])&&(t=t.concat(r[n]));return t}function g(e,t){for(var r=0;r<t.length;r++)if("string"==typeof t[r]&&t[r].toLowerCase()===e.toLowerCase())return r;return null}function m(e,t){for(var r=[],n=0;n<t.length;n++)"string"==typeof t[n]&&t[n].toLowerCase()===e.toLowerCase()&&r.push(n);return r}function b(e,t,r){U.Z.info("Looking for a close bracket of type "+r+" in "+e);for(var n=0,i=0;i<e.length;i++)if(e[i]===t&&n++,e[i]===r&&n--,n<0)return i;return U.Z.error("Statement had no close parenthesis in SPARQL query"),0}function w(e){return this.describe=function(t){return t+" = "+e.toNT()},this.test=function(t){return e.equals(t)},this}function x(e){this.describe=function(t){return"REGEXP( '"+e+"' , "+t+" )"},this.test=function(t){var r=new RegExp(e);return!!t.value&&r.test(t.value)}}function _(e,t){3!==e.length||"Variable"!==e[0].termType||"NamedNode"!==e[2].termType&&"Literal"!==e[2].termType?6===e.length&&"string"==typeof e[0]&&"regexp"===e[0].toLowerCase()&&"("===e[1]&&")"===e[5]&&","===e[3]&&"Variable"===e[4].termType&&"Literal"===e[2].termType&&(U.Z.debug("Constraint added: "+e),t.constraints[e[4]]=new x(e[2].value)):"="===e[1]||">"===e[1]||"<"===e[1]?(U.Z.debug("Constraint added: "+e),t.constraints[e[0]]=new w(e[2])):U.Z.warn("I don't know how to handle the constraint: "+e)}function j(e,t){U.Z.debug("Optional query: "+e+" not yet implemented.");var n=r.formula();k(e,n),t.optional.push(n)}function k(e,t){var n,o,l=function(e){for(var t=[],n=0;n<e.length;n++)"string"==typeof e[n]?(e[n]=s(e[n]),a(e[n])?t[n]=i(e[n].slice(1)):u(e[n])?(U.Z.info(e[n]+" was identified as a bnode."),t[n]=r.bnode()):c(e[n])?(U.Z.info(e[n]+" was identified as a symbol."),t[n]=r.sym(d(e[n]))):h(e[n])?(U.Z.info(e[n]+" was identified as a prefixed symbol"),A[f(e[n])]?t[n]=r.sym(e[n]=A[f(e[n])]+p(e[n])):(U.Z.error("SPARQL error: "+e[n]+" with prefix "+f(e[n])+" does not have a correct prefix entry."),t[n]=e[n])):t[n]=e[n]):t[n]=e[n];return t}(e);for(U.Z.debug("WHERE: "+l);g("OPTIONAL",l);)o=g("OPTIONAL",l),U.Z.debug("OPT: "+o+" "+l[o]+" in "+l),"{"!==l[o+1]&&U.Z.warn("Bad optional opening bracket in word "+o),-1===(n=b(l.slice(o+2),"{","}"))?U.Z.error("No matching bracket in word "+o):(j(l.slice(o+2,o+2+n),t),o=g("OPTIONAL",l),n=b(l.slice(o+2),"{","}"),l.splice(o,n+3));for(U.Z.debug("WHERE after optionals: "+l);g("FILTER",l);){var y=g("FILTER",l);"("!==l[y+1]&&U.Z.warn("Bad filter opening bracket in word "+y),-1===(n=b(l.slice(y+2),"(",")"))?U.Z.error("No matching bracket in word "+y):(_(l.slice(y+2,y+2+n),t),y=g("FILTER",l),n=b(l.slice(y+2),"(",")"),l.splice(y,n+3))}U.Z.debug("WHERE after filters and optionals: "+l),function(e,t){var r=new Array(1);r[0]=-1;for(var n=r.concat(m(".",e)),i=[],o=0;o<n.length-1;o++)i[o]=e.slice(n[o]+1,n[o+1]);for(o in i){U.Z.info("s+p+o "+o+" = "+i[o]);var a=i[o][0];i[o].splice(0,1);var s=r.concat(m(";",i[o]));s.push(i[o].length);for(var c=[],u=0;u<s.length-1;u++)c[u]=i[o].slice(s[u]+1,s[u+1]);for(o in c){U.Z.info("p+o "+o+" = "+i[o]);var l=c[o][0];c[o].splice(0,1);var h=r.concat(m(",",c[o]));h.push(c[o].length);var f=[];for(u=0;u<h.length-1;u++)f[u]=c[o].slice(h[u]+1,h[u+1]);for(o in f){var p=f[o][0];U.Z.info("Subj="+a+" Pred="+l+" Obj="+p),t.add(a,l,p)}}}}(l,t)}U.Z.info("SPARQL input: \n"+e);var T=new se,O=function(e){var t=y(e),r=[];for(var n in t)r="string"==typeof t[n]?r.concat(v(t[n])):r.concat(t[n]);return r=function(e){for(var t=e,r=0;r<t.length;r++)if("a"===t[r]&&(t[r]="<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>"),"is"===t[r]&&"of"===t[r+2]){t.splice(r,1),t.splice(r+1,1);var n=t[r-1];t[r-1]=t[r+1],t[r+1]=n}return t}(r),U.Z.info("SPARQL Tokens: "+r),r}(e),A=function(e){var t=m("PREFIX",e),r=[];for(var n in t){var i=e[t[n]+1],o=e[t[n]+2];if(l(i))if(c(o)){U.Z.info("Prefix found: "+i+" -> "+o);var a=f(i),s=d(o);r[a]=s}else U.Z.error("Invalid SPARQL symbol: "+o);else U.Z.error("Invalid SPARQL prefix: "+i)}return r}(O);A.rdf||(A.rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"),A.rdfs||(A.rdfs="http://www.w3.org/2000/01/rdf-schema#");var N=g("SELECT",O),S=g("WHERE",O);if(N<0||S<0||N>S)return U.Z.error("Invalid or nonexistent SELECT and WHERE tags in SPARQL query"),!1;if(function(e,t){for(var r in U.Z.info("SPARQL vars: "+e),e)if(a(e[r])){U.Z.info("Added "+e[r]+" to query variables from SPARQL");var n=i(e[r].slice(1));t.vars.push(n),n.label=e[r].slice(1)}else U.Z.warn("Incorrect SPARQL variable in SELECT: "+e[r])}(O.slice(N+1,S),T),k(O.slice(S+2,O.length-1),T.pat),t)return T;for(var E in T.pat.statements){var I=T.pat.statements[E];"NamedNode"===I.subject.termType&&r.fetcher&&r.fetcher.lookUpThing(I.subject,"sparql:"+I.subject),"NamedNode"===I.object.termType&&r.fetcher&&r.fetcher.lookUpThing(I.object,"sparql:"+I.object)}return T}function cr(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return ur(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ur(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function ur(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var lr=function(){function r(e){if((0,t.Z)(this,r),(0,c.Z)(this,"store",void 0),(0,c.Z)(this,"ifps",void 0),(0,c.Z)(this,"fps",void 0),(0,c.Z)(this,"patchControl",void 0),(0,c.Z)(this,"ns",void 0),(e=e||new ge).updater)throw new Error("You can't have two UpdateManagers for the same store");e.fetcher||(e.fetcher=new ir(e)),this.store=e,e.updater=this,this.ifps={},this.fps={},this.ns={},this.ns.link=B("http://www.w3.org/2007/ont/link#"),this.ns.http=B("http://www.w3.org/2007/ont/http#"),this.ns.httph=B("http://www.w3.org/2007/ont/httph#"),this.ns.ldp=B("http://www.w3.org/ns/ldp#"),this.ns.rdf=B("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.rdfs=B("http://www.w3.org/2000/01/rdf-schema#"),this.ns.rdf=B("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.owl=B("http://www.w3.org/2002/07/owl#"),this.patchControl=[]}return(0,e.Z)(r,[{key:"patchControlFor",value:function(e){return this.patchControl[e.value]||(this.patchControl[e.value]=[]),this.patchControl[e.value]}},{key:"isHttpUri",value:function(e){return"http"===e.slice(0,4)}},{key:"editable",value:function(e,t){if(!e)return!1;if(t||(t=this.store),e=(0,Zt._)(e),!this.isHttpUri(e)&&t.holds(this.store.rdfFactory.namedNode(e),this.store.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.store.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#MachineEditableDocument")))return"LOCALFILE";for(var r,n,i=!1,o=t.each(void 0,this.ns.link("requestedURI"),(0,R.docpart)(e)),a=0;a<o.length;a++)if(void 0!==(r=o[a])){var s=t.any(r,this.ns.link("response"));if(void 0!==r){var c=t.anyValue(s,this.ns.httph("wac-allow"));if(c){var u,l=cr(c.split(","));try{for(l.s();!(u=l.n()).done;){var h=u.value.split("=");if(h[0].includes("user")&&!h[1].includes("write")&&!h[1].includes("append"))return!1}}catch(e){l.e(e)}finally{l.f()}}var f=t.each(s,this.ns.httph("accept-patch"));if(f.length)for(var p=0;p<f.length;p++){if((n=f[p].value.trim()).indexOf("application/sparql-update")>=0)return"SPARQL";if(n.indexOf("application/sparql-update-single-match")>=0)return"SPARQL"}var d=t.each(s,this.ns.httph("ms-author-via"));if(d.length)for(var y=0;y<d.length;y++){if((n=d[y].value.trim()).indexOf("SPARQL")>=0)return"SPARQL";if(n.indexOf("DAV")>=0)return"DAV"}if(!this.isHttpUri(e))return!!c&&"LOCALFILE";var v=t.each(s,this.ns.http("status"));if(v.length)for(var g=0;g<v.length;g++)200!==v[g]&&404!==v[g]||(i=!0)}}if(0===o.length);else if(i)return!1}},{key:"anonymize",value:function(e){return"_:"===e.toNT().substr(0,2)&&this.mentioned(e)?"?"+e.toNT().substr(2):e.toNT()}},{key:"anonymizeNT",value:function(e){return this.anonymize(e.subject)+" "+this.anonymize(e.predicate)+" "+this.anonymize(e.object)+" ."}},{key:"nTriples",value:function(e){return"".concat(e.subject.toNT()," ").concat(e.predicate.toNT()," ").concat(e.object.toNT()," .")}},{key:"statementBnodes",value:function(e){return[e.subject,e.predicate,e.object].filter((function(e){return(0,v.B2)(e)}))}},{key:"statementArrayBnodes",value:function(e){for(var t=[],r=0;r<e.length;r++)t=t.concat(this.statementBnodes(e[r]));t.sort();for(var n=[],i=0;i<t.length;i++)0!==i&&t[i].equals(t[i-1])||n.push(t[i]);return n}},{key:"cacheIfps",value:function(){this.ifps={};for(var e=this.store.each(void 0,this.ns.rdf("type"),this.ns.owl("InverseFunctionalProperty")),t=0;t<e.length;t++)this.ifps[e[t].value]=!0;this.fps={},e=this.store.each(void 0,this.ns.rdf("type"),this.ns.owl("FunctionalProperty"));for(var r=0;r<e.length;r++)this.fps[e[r].value]=!0}},{key:"bnodeContext2",value:function(e,t,r){for(var n,i,o=this.store.statementsMatching(void 0,void 0,e,t),a=0;a<o.length;a++)if(this.fps[o[a].predicate.value]){if(!(n=o[a].subject).isBlank)return[o[a]];if(r&&(i=this.bnodeContext2(n,t,r-1)))return i.concat([o[a]])}o=this.store.statementsMatching(e,void 0,void 0,t);for(var s=0;s<o.length;s++)if(this.ifps[o[s].predicate.value]){if(!(n=o[s].object).isBlank)return[o[s]];if(r&&(i=this.bnodeContext2(n,t,r-1)))return i.concat([o[s]])}return null}},{key:"bnodeContext1",value:function(e,t){for(var r=0;r<3;r++){var n=this.bnodeContext2(e,t,r);if(null!==n)return n}return this.store.connectedStatements(e,t)}},{key:"mentioned",value:function(e){return 0!==this.store.statementsMatching(e,null,null,null).length||0!==this.store.statementsMatching(null,e).length||0!==this.store.statementsMatching(null,null,e).length}},{key:"bnodeContext",value:function(e,t){var r=[];if(e.length){this.cacheIfps();for(var n=0;n<e.length;n++){var i=e[n];this.mentioned(i)&&(r=r.concat(this.bnodeContext1(i,t)))}}return r}},{key:"statementContext",value:function(e){var t=this.statementBnodes(e);return this.bnodeContext(t,e.graph)}},{key:"contextWhere",value:function(e){var t=this;return e&&0!==e.length?"WHERE { "+e.map((function(e){return t.anonymizeNT(e)})).join("\n")+" }\n":""}},{key:"fire",value:function(e,t,r){var n=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Promise.resolve().then((function(){if(!e)throw new Error("No URI given for remote editing operation: "+t);return i.noMeta=!0,i.contentType="application/sparql-update",i.body=t,n.store.fetcher.webOperation("PATCH",e,i)})).then((function(n){if(!n.ok){var i="UpdateManager: update failed for <"+e+"> status="+n.status+", "+n.statusText+"\n for query: "+t;throw new Error(i)}r(e,n.ok,n.responseText,n)})).catch((function(t){r(e,!1,t.message,t)}))}},{key:"update_statement",value:function(e){if(!e||e.graph){var t=this,r=this.statementContext(e);return{statement:e?[e.subject,e.predicate,e.object,e.graph]:void 0,statementNT:e?this.anonymizeNT(e):void 0,where:t.contextWhere(r),set_object:function(e,r){var n=this.where;n+="DELETE DATA { "+this.statementNT+" } ;\n",n+="INSERT DATA { "+this.anonymize(this.statement[0])+" "+this.anonymize(this.statement[1])+" "+this.anonymize(e)+" . }\n",t.fire(this.statement[3].value,n,r)}}}}},{key:"insert_statement",value:function(e,t){var r=e instanceof Array?e[0]:e,n=this.contextWhere(this.statementContext(r));if(e instanceof Array){for(var i="",o=0;o<e.length;o++)i+=e[o]+"\n";n+="INSERT DATA { "+i+" }\n"}else n+="INSERT DATA { "+this.anonymize(e.subject)+" "+this.anonymize(e.predicate)+" "+this.anonymize(e.object)+" . }\n";this.fire(r.graph.value,n,t)}},{key:"delete_statement",value:function(e,t){var r=e instanceof Array?e[0]:e,n=this.contextWhere(this.statementContext(r));if(e instanceof Array){for(var i="",o=0;o<e.length;o++)i+=e[o]+"\n";n+="DELETE DATA { "+i+" }\n"}else n+="DELETE DATA { "+this.anonymize(e.subject)+" "+this.anonymize(e.predicate)+" "+this.anonymize(e.object)+" . }\n";this.fire(r.graph.value,n,t)}},{key:"requestDownstreamAction",value:function(e,t){var r=this.patchControlFor(e);if(r.pendingUpstream)if(r.downstreamAction){if(""+r.downstreamAction!=""+t)throw new Error("Can't wait for > 1 different downstream actions")}else r.downstreamAction=t;else t(e)}},{key:"clearUpstreamCount",value:function(e){this.patchControlFor(e).upstreamCount=0}},{key:"getUpdatesVia",value:function(e){var t=this.store.fetcher.getHeader(e,"updates-via");return t&&t.length?t[0].trim():null}},{key:"addDownstreamChangeListener",value:function(e,t){var r=this,n=this.patchControlFor(e);n.downstreamChangeListeners||(n.downstreamChangeListeners=[]),n.downstreamChangeListeners.push(t),this.setRefreshHandler(e,(function(e){r.reloadAndSync(e)}))}},{key:"reloadAndSync",value:function(e){var t=this.patchControlFor(e),r=this;if(t.reloading)t.outOfDate=!0;else{t.reloading=!0;var n=1e3;!function i(){r.reload(r.store,e,(function(e,r,o){if(e){if(t.downstreamChangeListeners)for(var a=0;a<t.downstreamChangeListeners.length;a++)t.downstreamChangeListeners[a]();t.reloading=!1,t.outOfDate&&(t.outOfDate=!1,i())}else t.reloading=!1,0===o.status&&(t.reloading=!0,setTimeout(i,n*=2))}))}()}}},{key:"setRefreshHandler",value:function(e,t){var r=this.getUpdatesVia(e),n=t,i=this,o=this,a=1500,s=0;if(!r)return!1;var c=(r=(0,R.join)(r,e.value)).replace(/^http:/,"ws:").replace(/^https:/,"wss:");return function t(){var r;if("undefined"!=typeof WebSocket)r=new WebSocket(c);else{if("undefined"==typeof window||!window.WebSocket)return;r=window.WebSocket(c)}r.onopen=function(){a=1500,this.send("sub "+e.value),s&&o.requestDownstreamAction(e,n)};var u=i.patchControlFor(e);u.upstreamCount=0,r.onerror=function(e){},r.onclose=function(e){a*=2,s+=1,setTimeout((function(){t()}),a)},r.onmessage=function(t){if(t.data&&"pub"===t.data.slice(0,3)){if("upstreamCount"in u&&(u.upstreamCount-=1,u.upstreamCount>=0))return;u.upstreamCount=0,i.requestDownstreamAction(e,n)}}}(),!0}},{key:"updateMany",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=e.concat(t).map((function(e){return e.why})),n=this,i=[];r.forEach((function(e){i.find((function(t){return t.equals(e)}))||i.push(e)}));var o=i.map((function(r){return n.update(e.filter((function(e){return e.why.equals(r)})),t.filter((function(e){return e.why.equals(r)})))}));return o.length,Promise.all(o)}},{key:"update",value:function(e,t,r,n){var i=this,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(!r){var a=this;return new Promise((function(r,i){a.update(e,t,(function(e,t,n){t?r():i(new Error(n))}),n,o)}))}try{var s=this.store,c=e?(0,v.Pv)(e)?e.statements:e instanceof Array?e:[e]:[],u=t?(0,v.Pv)(t)?t.statements:t instanceof Array?t:[t]:[];if(!(c instanceof Array))throw new Error("Type Error "+(0,d.Z)(c)+": "+c);if(!(u instanceof Array))throw new Error("Type Error "+(0,d.Z)(u)+": "+u);if(0===c.length&&0===u.length)return r(null,!0);var l=c.length?c[0].graph:u[0].graph;if(!l){var h="Error patching: statement does not specify which document to patch:"+c[0]+", "+u[0];throw new Error(h)}if("NamedNode"!==l.termType){var f="Error patching: document not a NamedNode:"+c[0]+", "+u[0];throw new Error(f)}var p=this.patchControlFor(l),y=Date.now(),g=["subject","predicate","object","why"],m=["insert","delete"],b={delete:c,insert:u};m.map((function(e){b[e].map((function(e){if(!l.equals(e.graph))throw new Error("update: destination "+l+" inconsistent with delete quad "+e.graph);g.map((function(t){if(void 0===e[t])throw new Error("update: undefined "+t+" of statement.")}))}))}));var w=this.editable(l.value,s);if(!1===w)throw new Error("Update: Can't make changes in uneditable "+l);if(void 0===w){if(n)throw new Error("Update: Loaded "+l+"but stil can't figure out what editing protcol it supports.");return void this.store.fetcher.load(l).then((function(n){i.update(e,t,r,!0,o)}),(function(n){if(404!==n.response.status)throw new Error("Update: Can't get updatability status ".concat(l," before patching: ").concat(n));i.update(e,t,r,!0,o)}))}if(w.indexOf("SPARQL")>=0){var x=[];c.length&&(x=this.statementArrayBnodes(c)),u.length&&(x=x.concat(this.statementArrayBnodes(u)));var _=this.bnodeContext(x,l),j=this.contextWhere(_),k="";if(j.length){if(c.length){k+="DELETE { ";for(var T=0;T<c.length;T++)k+=this.anonymizeNT(c[T])+"\n";k+=" }\n"}if(u.length){k+="INSERT { ";for(var O=0;O<u.length;O++)k+=this.anonymizeNT(u[O])+"\n";k+=" }\n"}k+=j}else{if(c.length){k+="DELETE DATA { ";for(var A=0;A<c.length;A++)k+=this.anonymizeNT(c[A])+"\n";k+=" } \n"}if(u.length){c.length&&(k+=" ; "),k+="INSERT DATA { ";for(var N=0;N<u.length;N++)k+=this.nTriples(u[N])+"\n";k+=" }\n"}}p.pendingUpstream=p.pendingUpstream?p.pendingUpstream+1:1,"upstreamCount"in p&&(p.upstreamCount+=1),this.fire(l.value,k,(function(e,t,n,i){if(i.elapsedTimeMs=Date.now()-y,t){try{s.remove(c)}catch(e){t=!1,n="Remote Ok BUT error deleting "+c.length+" from store!!! "+e}for(var o=0;o<u.length;o++)s.add(u[o].subject,u[o].predicate,u[o].object,l)}if(r(e,t,n,i),p.pendingUpstream-=1,0===p.pendingUpstream&&p.downstreamAction){var a=p.downstreamAction;delete p.downstreamAction,a(l)}}),o)}else if(w.indexOf("DAV")>=0)this.updateDav(l,c,u,r,o);else{if(!(w.indexOf("LOCALFILE")>=0))throw new Error("Unhandled edit method: '"+w+"' for "+l);try{this.updateLocalFile(l,c,u,r,o)}catch(e){r(l.value,!1,"Exception trying to write back file <"+l.value+">\n")}}}catch(e){r(void 0,!1,"Exception in update: "+e+"\n"+Z.stackString(e))}}},{key:"updateDav",value:function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=this.store,a=o.any(e,this.ns.link("request"));if(!a)throw new Error("No record of our HTTP GET request for document: "+e);var s=o.any(a,this.ns.link("response"));if(!s)return null;for(var c=o.the(s,this.ns.httph("content-type")).value,u=o.statementsMatching(void 0,void 0,void 0,e).slice(),l=0;l<t.length;l++)Z.RDFArrayRemove(u,t[l]);for(var h=0;h<r.length;h++)u.push(r[h]);var f,p=this.serialize(e.value,u,c),d=o.the(s,this.ns.httph("content-location"));return d&&(f=(0,R.join)(d.value,f)),i.contentType=c,i.noMeta=!0,i.body=p,o.fetcher.webOperation("PUT",f,i).then((function(i){if(!i.ok)throw new Error(i.error);for(var a=0;a<t.length;a++)o.remove(t[a]);for(var s=0;s<r.length;s++)o.add(r[s].subject,r[s].predicate,r[s].object,e);n(e.value,i.ok,i.responseText,i)})).catch((function(t){n(e.value,!1,t.message,t)}))}},{key:"updateLocalFile",value:function(e,t,r,n){for(var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=this.store,a=o.statementsMatching(void 0,void 0,void 0,e).slice(),s=0;s<t.length;s++)Z.RDFArrayRemove(a,t[s]);for(var c=0;c<r.length;c++)a.push(r[c]);var u=e.value.lastIndexOf(".");if(u<1)throw new Error("Rewriting file: No filename extension: "+e.value);var l=e.value.slice(u+1),h=ir.CONTENT_TYPE_BY_EXT[l];if(!h)throw new Error("File extension ."+l+" not supported for data write");i.body=this.serialize(e.value,a,h),i.contentType=h,o.fetcher.webOperation("PUT",e.value,i).then((function(i){if(!i.ok)return n(e.value,!1,i.error);for(var a=0;a<t.length;a++)o.remove(t[a]);for(var s=0;s<r.length;s++)o.add(r[s].subject,r[s].predicate,r[s].object,e);n(e.value,!0,"")}))}},{key:"serialize",value:function(e,t,r){var n,i=this.store;if("string"==typeof t)return t;var o=G(i);switch(o.suggestNamespaces(i.namespaces),o.setBase(e),r){case"text/xml":case"application/rdf+xml":n=o.statementsToXML(t);break;case"text/n3":case"text/turtle":case"application/x-turtle":case"application/n3":n=o.statementsToN3(t);break;default:throw new Error("Content-type "+r+" not supported for data serialization")}return n}},{key:"put",value:function(e,t,r,n){var i,o=this,a=this.store;return Promise.resolve().then((function(){return i=o.serialize(e.value,t,r),a.fetcher.webOperation("PUT",e.value,{contentType:r,body:i})})).then((function(r){if(!r.ok)return n(e.value,r.ok,r.error,r);delete a.fetcher.nonexistent[e.value],delete a.fetcher.requested[e.value],"string"!=typeof t&&t.map((function(e){a.addStatement(e)})),n(e.value,r.ok,"",r)})).catch((function(t){n(e.value,!1,t.message)}))}},{key:"reload",value:function(e,t,r){var n=Date.now();e.fetcher.nowOrWhenFetched(t.value,{force:!0,noMeta:!0,clearPreviousData:!0},(function(e,i,o){if(e)if(o.onErrorWasCalled||200!==o.status)r(!1,"Non-HTTP error reloading data: "+i,o);else{var a=Date.now()-n;t.reloadTimeTotal||(t.reloadTimeTotal=0),t.reloadTimeCount||(t.reloadTimeCount=0),t.reloadTimeTotal+=a,t.reloadTimeCount+=1,r(!0)}else r(!1,"Error reloading data: "+i,o)}))}}]),r}();function hr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?hr(Object(r),!0).forEach((function(t){(0,c.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var pr=fr(fr({},Xe),{},{fetcher:function(e,t){return new ir(e,t)},graph:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return new ge(e,t||{rdfFactory:Xe})},lit:function(e,t,r){return this.literal(""+e,t||r)},st:function(e,t,r,n){return this.quad(e,t,r,n)}});const dr=pr;var yr=function(){function r(e,n){(0,t.Z)(this,r),this.parent=e,this.via=n,this.connected=!1,this.pending={},this.subscribed={},this.socket={};try{this.socket=new WebSocket(n),this.socket.onopen=this.onOpen,this.socket.onclose=this.onClose,this.socket.onmessage=this.onMessage,this.socket.onerror=this.onError}catch(e){this.onError(e)}}return(0,e.Z)(r,[{key:"_decode",value:function(e){var t,r,n,i,o,a,s;for(r in i={},o=function(){var r,n,i,o;for(o=[],r=0,n=(i=e.split("&")).length;r<n;r++)t=i[r],o.push(t.split("="));return o}())t=o[r],s=(a=[decodeURIComponent(t[0]),decodeURIComponent(t[1])])[1],null==i[n=a[0]]&&(i[n]=[]),i[n].push(s);return i}},{key:"_send",value:function(e,t,r){var n,i;return i=[e,t,r].join(" "),"function"==typeof(n=this.socket).send?n.send(i):void 0}},{key:"_subscribe",value:function(e){return this._send("sub",e,""),this.subscribed[e]=!0,this.subscribed[e]}},{key:"onClose",value:function(e){var t;for(t in this.connected=!1,this.subscribed)this.pending[t]=!0;return this.subscribed={},this.subscribed}},{key:"onError",value:function(e){throw new Error("onError"+e)}},{key:"onMessage",value:function(e){var t,r;return"ping"===(r=e.data.split(" "))[0]?"function"==typeof(t=this.socket).send?t.send("pong "+r.slice(1).join(" ")):void 0:"pub"===r[0]?this.parent.onUpdate(r[1],this._decode(r[2])):void 0}},{key:"onOpen",value:function(e){var t,r;for(r in this.connected=!0,t=[],this.pending)delete this.pending[r],t.push(this._subscribe(r));return t}},{key:"subscribe",value:function(e){return this.connected?this._subscribe(e):(this.pending[e]=!0,this.pending[e])}}]),r}(),vr=function(){function r(e){(0,t.Z)(this,r),this.fetcher=e,this.graph={},this.via={},this.fetcher.addCallback("headers",this.onHeaders)}return(0,e.Z)(r,[{key:"onHeaders",value:function(e){var t,r,n;return null==e.headers||"undefined"==typeof WebSocket||null===WebSocket||(t=e.headers.etag,n=e.headers["updates-via"],r=e.uri,t&&n&&(this.graph[r]={etag:t,via:n},this.register(n,r))),!0}},{key:"onUpdate",value:function(e,t){return this.fetcher.refresh(dr.namedNode(e))}},{key:"register",value:function(e,t){return null==this.via[e]&&(this.via[e]=new yr(this,e)),this.via[e].subscribe(t)}}]),r}();function gr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,s.Z)(e);if(t){var i=(0,s.Z)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,a.Z)(this,r)}}var mr={};for(var br in dr)"function"==typeof dr[br]&&(mr[br]=dr[br].bind(dr));var wr=mr.fetcher,xr=mr.graph,_r=mr.lit,jr=mr.st,kr=mr.namedNode,Tr=mr.variable,Or=mr.blankNode,Ar=mr.defaultGraph,Nr=mr.literal,Sr=mr.quad,Er=mr.triple,Ir=new ne,Rr=function(e){return Ir.fromNT(e)},Cr=ie.fromValue,Dr=p.nextId,Lr=function(n){(0,o.Z)(a,n);var i=gr(a);function a(e){var n;return(0,t.Z)(this,a),n=i.call(this,e),(0,c.Z)((0,r.Z)(n),"fetcher",void 0),n.fetcher=new ir((0,r.Z)(n),{}),n}return(0,e.Z)(a)}(ge),Pr=function(n){(0,o.Z)(a,n);var i=gr(a);function a(e){var n;return(0,t.Z)(this,a),n=i.call(this,e),(0,c.Z)((0,r.Z)(n),"updater",void 0),n.updater=new lr((0,r.Z)(n)),n}return(0,e.Z)(a)}(Lr)})(),i})()));
3
3
  //# sourceMappingURL=rdflib.min.js.map