UNPKG

hra-api

Version:

The Human Reference Atlas (HRA) API deployed to https://apps.humanatlas.io/api/

390 lines 1.21 MB
const SPARQL_ENDPOINT = 'https://lod.humanatlas.io/sparql'; var lj=Object.create;var s0=Object.defineProperty;var fj=Object.getOwnPropertyDescriptor;var dj=Object.getOwnPropertyNames;var hj=Object.getPrototypeOf,pj=Object.prototype.hasOwnProperty;var z=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Rn=(t,e)=>{for(var r in e)s0(t,r,{get:e[r],enumerable:!0})}, mj=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of dj(e))!pj.call(t,i)&&i!==r&&s0(t,i,{get:()=>e[i], enumerable:!(n=fj(e,i))||n.enumerable});return t};var Ft=(t,e,r)=>(r=t!=null?lj(hj(t)):{},mj(e||!t||!t.__esModule?s0(r,"default",{value:t,enumerable:!0}):r,t));var zu=z((c0,u0)=>{((t,e)=>{typeof define=="function"&&define.amd?define([],e):typeof u0=="object"&&typeof c0<"u"?u0.exports= e():t.Papa=e()})(c0,function t(){var e=typeof self<"u"?self:typeof window<"u"?window:e!==void 0?e:{},r,n=!e.document&&!!e. postMessage,i=e.IS_PAPA_WORKER||!1,o={},s=0,a={};function c(b){this._handle=null,this._finished=!1,this._completed=!1,this. _halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this. isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(S){var C=w(S);C.chunkSize=parseInt(C.chunkSize), S.step||S.chunk||(C.chunkSize=null),this._handle=new h(C),(this._handle.streamer=this)._config=C}.call(this,b),this.parseChunk= function(S,C){var B=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<B){let O=this._config.newline;O||(D= this._config.quoteChar||'"',O=this._handle.guessLineEndings(S,D)),S=[...S.split(O).slice(B)].join(O)}this.isFirstChunk&& A(this._config.beforeFirstChunk)&&(D=this._config.beforeFirstChunk(S))!==void 0&&(S=D),this.isFirstChunk=!1,this._halted= !1;var B=this._partialLine+S,D=(this._partialLine="",this._handle.parse(B,this._baseIndex,!this._finished));if(!this._handle. paused()&&!this._handle.aborted()){if(S=D.meta.cursor,B=(this._finished||(this._partialLine=B.substring(S-this._baseIndex), this._baseIndex=S),D&&D.data&&(this._rowCount+=D.data.length),this._finished||this._config.preview&&this._rowCount>=this. _config.preview),i)e.postMessage({results:D,workerId:a.WORKER_ID,finished:B});else if(A(this._config.chunk)&&!C){if(this. _config.chunk(D,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults= D=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(D.data), this._completeResults.errors=this._completeResults.errors.concat(D.errors),this._completeResults.meta=D.meta),this._completed|| !B||!A(this._config.complete)||D&&D.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed= !0),B||D&&D.meta.paused||this._nextChunk(),D}this._halted=!0},this._sendError=function(S){A(this._config.error)?this._config. error(S):i&&this._config.error&&e.postMessage({workerId:a.WORKER_ID,error:S,finished:!1})}}function u(b){var S;(b=b||{}). chunkSize||(b.chunkSize=a.RemoteChunkSize),c.call(this,b),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}: function(){this._readChunk()},this.stream=function(C){this._input=C,this._nextChunk()},this._readChunk=function(){if(this. _finished)this._chunkLoaded();else{if(S=new XMLHttpRequest,this._config.withCredentials&&(S.withCredentials=this._config. withCredentials),n||(S.onload=_(this._chunkLoaded,this),S.onerror=_(this._chunkError,this)),S.open(this._config.downloadRequestBody? "POST":"GET",this._input,!n),this._config.downloadRequestHeaders){var C,B=this._config.downloadRequestHeaders;for(C in B) S.setRequestHeader(C,B[C])}var D;this._config.chunkSize&&(D=this._start+this._config.chunkSize-1,S.setRequestHeader("Ran\ ge","bytes="+this._start+"-"+D));try{S.send(this._config.downloadRequestBody)}catch(O){this._chunkError(O.message)}n&&S. status===0&&this._chunkError()}},this._chunkLoaded=function(){S.readyState===4&&(S.status<200||400<=S.status?this._chunkError(): (this._start+=this._config.chunkSize||S.responseText.length,this._finished=!this._config.chunkSize||this._start>=(C=>(C= C.getResponseHeader("Content-Range"))!==null?parseInt(C.substring(C.lastIndexOf("/")+1)):-1)(S),this.parseChunk(S.responseText)))}, this._chunkError=function(C){C=S.statusText||C,this._sendError(new Error(C))}}function l(b){(b=b||{}).chunkSize||(b.chunkSize= a.LocalChunkSize),c.call(this,b);var S,C,B=typeof FileReader<"u";this.stream=function(D){this._input=D,C=D.slice||D.webkitSlice|| D.mozSlice,B?((S=new FileReader).onload=_(this._chunkLoaded,this),S.onerror=_(this._chunkError,this)):S=new FileReaderSync, this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)|| this._readChunk()},this._readChunk=function(){var D=this._input,O=(this._config.chunkSize&&(O=Math.min(this._start+this. _config.chunkSize,this._input.size),D=C.call(D,this._start,O)),S.readAsText(D,this._config.encoding));B||this._chunkLoaded( {target:{result:O}})},this._chunkLoaded=function(D){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize|| this._start>=this._input.size,this.parseChunk(D.target.result)},this._chunkError=function(){this._sendError(S.error)}}function f(b){ var S;c.call(this,b=b||{}),this.stream=function(C){return S=C,this._nextChunk()},this._nextChunk=function(){var C,B;if(!this. _finished)return C=this._config.chunkSize,S=C?(B=S.substring(0,C),S.substring(C)):(B=S,""),this._finished=!S,this.parseChunk( B)}}function d(b){c.call(this,b=b||{});var S=[],C=!0,B=!1;this.pause=function(){c.prototype.pause.apply(this,arguments), this._input.pause()},this.resume=function(){c.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(D){ this._input=D,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this. _streamError)},this._checkIsFinished=function(){B&&S.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(), S.length?this.parseChunk(S.shift()):C=!0},this._streamData=_(function(D){try{S.push(typeof D=="string"?D:D.toString(this. _config.encoding)),C&&(C=!1,this._checkIsFinished(),this.parseChunk(S.shift()))}catch(O){this._streamError(O)}},this),this. _streamError=_(function(D){this._streamCleanUp(),this._sendError(D)},this),this._streamEnd=_(function(){this._streamCleanUp(), B=!0,this._streamData("")},this),this._streamCleanUp=_(function(){this._input.removeListener("data",this._streamData),this. _input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function h(b){ var S,C,B,D,O=Math.pow(2,53),L=-O,U=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,k=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/, G=this,P=0,$=0,Y=!1,W=!1,H=[],K={data:[],errors:[],meta:{}};function Z(V){return b.skipEmptyLines==="greedy"?V.join(""). trim()==="":V.length===1&&V[0].length===0}function oe(){if(K&&B&&(se("Delimiter","UndetectableDelimiter","Unable to auto\ -detect delimiting character; defaulted to '"+a.DefaultDelimiter+"'"),B=!1),b.skipEmptyLines&&(K.data=K.data.filter(function(ue){ return!Z(ue)})),re()){let ue=function(Te,De){A(b.transformHeader)&&(Te=b.transformHeader(Te,De)),H.push(Te)};var ge=ue;if(K) if(Array.isArray(K.data[0])){for(var V=0;re()&&V<K.data.length;V++)K.data[V].forEach(ue);K.data.splice(0,1)}else K.data. forEach(ue)}function J(ue,Te){for(var De=b.header?{}:[],be=0;be<ue.length;be++){var xe=be,Ne=ue[be],Ne=((Re,Le)=>(Fe=>(b. dynamicTypingFunction&&b.dynamicTyping[Fe]===void 0&&(b.dynamicTyping[Fe]=b.dynamicTypingFunction(Fe)),(b.dynamicTyping[Fe]|| b.dynamicTyping)===!0))(Re)?Le==="true"||Le==="TRUE"||Le!=="false"&&Le!=="FALSE"&&((Fe=>{if(U.test(Fe)&&(Fe=parseFloat(Fe), L<Fe&&Fe<O))return 1})(Le)?parseFloat(Le):k.test(Le)?new Date(Le):Le===""?null:Le):Le)(xe=b.header?be>=H.length?"__parse\ d_extra":H[be]:xe,Ne=b.transform?b.transform(Ne,xe):Ne);xe==="__parsed_extra"?(De[xe]=De[xe]||[],De[xe].push(Ne)):De[xe]= Ne}return b.header&&(be>H.length?se("FieldMismatch","TooManyFields","Too many fields: expected "+H.length+" fields but p\ arsed "+be,$+Te):be<H.length&&se("FieldMismatch","TooFewFields","Too few fields: expected "+H.length+" fields but parsed\ "+be,$+Te)),De}var ie;K&&(b.header||b.dynamicTyping||b.transform)&&(ie=1,!K.data.length||Array.isArray(K.data[0])?(K.data= K.data.map(J),ie=K.data.length):K.data=J(K.data,0),b.header&&K.meta&&(K.meta.fields=H),$+=ie)}function re(){return b.header&& H.length===0}function se(V,J,ie,ge){V={type:V,code:J,message:ie},ge!==void 0&&(V.row=ge),K.errors.push(V)}A(b.step)&&(D= b.step,b.step=function(V){K=V,re()?oe():(oe(),K.data.length!==0&&(P+=V.data.length,b.preview&&P>b.preview?C.abort():(K.data= K.data[0],D(K,G))))}),this.parse=function(V,J,ie){var ge=b.quoteChar||'"',ge=(b.newline||(b.newline=this.guessLineEndings( V,ge)),B=!1,b.delimiter?A(b.delimiter)&&(b.delimiter=b.delimiter(V),K.meta.delimiter=b.delimiter):((ge=((ue,Te,De,be,xe)=>{ var Ne,Re,Le,Fe;xe=xe||[","," ","|",";",a.RECORD_SEP,a.UNIT_SEP];for(var Qe=0;Qe<xe.length;Qe++){for(var rt,It=xe[Qe],Ze=0, Nt=0,pt=0,mt=(Le=void 0,new p({comments:be,delimiter:It,newline:Te,preview:10}).parse(ue)),hr=0;hr<mt.data.length;hr++)De&& Z(mt.data[hr])?pt++:(rt=mt.data[hr].length,Nt+=rt,Le===void 0?Le=rt:0<rt&&(Ze+=Math.abs(rt-Le),Le=rt));0<mt.data.length&& (Nt/=mt.data.length-pt),(Re===void 0||Ze<=Re)&&(Fe===void 0||Fe<Nt)&&1.99<Nt&&(Re=Ze,Ne=It,Fe=Nt)}return{successful:!!(b. delimiter=Ne),bestDelimiter:Ne}})(V,b.newline,b.skipEmptyLines,b.comments,b.delimitersToGuess)).successful?b.delimiter=ge. bestDelimiter:(B=!0,b.delimiter=a.DefaultDelimiter),K.meta.delimiter=b.delimiter),w(b));return b.preview&&b.header&&ge.preview++, S=V,C=new p(ge),K=C.parse(S,J,ie),oe(),Y?{meta:{paused:!0}}:K||{meta:{paused:!1}}},this.paused=function(){return Y},this. pause=function(){Y=!0,C.abort(),S=A(b.chunk)?"":S.substring(C.getCharIndex())},this.resume=function(){G.streamer._halted? (Y=!1,G.streamer.parseChunk(S,!0)):setTimeout(G.resume,3)},this.aborted=function(){return W},this.abort=function(){W=!0, C.abort(),K.meta.aborted=!0,A(b.complete)&&b.complete(K),S=""},this.guessLineEndings=function(ue,ge){ue=ue.substring(0,1048576); var ge=new RegExp(m(ge)+"([^]*?)"+m(ge),"gm"),ie=(ue=ue.replace(ge,"")).split("\r"),ge=ue.split(` `),ue=1<ge.length&&ge[0].length<ie[0].length;if(ie.length===1||ue)return` `;for(var Te=0,De=0;De<ie.length;De++)ie[De][0]===` `&&Te++;return Te>=ie.length/2?`\r `:"\r"}}function m(b){return b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function p(b){var S=(b=b||{}).delimiter,C=b.newline, B=b.comments,D=b.step,O=b.preview,L=b.fastMode,U=null,k=!1,G=b.quoteChar==null?'"':b.quoteChar,P=G;if(b.escapeChar!==void 0&& (P=b.escapeChar),(typeof S!="string"||-1<a.BAD_DELIMITERS.indexOf(S))&&(S=","),B===S)throw new Error("Comment character \ same as delimiter");B===!0?B="#":(typeof B!="string"||-1<a.BAD_DELIMITERS.indexOf(B))&&(B=!1),C!==` `&&C!=="\r"&&C!==`\r `&&(C=` `);var $=0,Y=!1;this.parse=function(W,H,K){if(typeof W!="string")throw new Error("Input must be a string");var Z=W.length, oe=S.length,re=C.length,se=B.length,V=A(D),J=[],ie=[],ge=[],ue=$=0;if(!W)return Ze();if(L||L!==!1&&W.indexOf(G)===-1){for(var Te=W. split(C),De=0;De<Te.length;De++){if(ge=Te[De],$+=ge.length,De!==Te.length-1)$+=C.length;else if(K)return Ze();if(!B||ge. substring(0,se)!==B){if(V){if(J=[],Fe(ge.split(S)),Nt(),Y)return Ze()}else Fe(ge.split(S));if(O&&O<=De)return J=J.slice( 0,O),Ze(!0)}}return Ze()}for(var be=W.indexOf(S,$),xe=W.indexOf(C,$),Ne=new RegExp(m(P)+m(G),"g"),Re=W.indexOf(G,$);;)if(W[$]=== G)for(Re=$,$++;;){if((Re=W.indexOf(G,Re+1))===-1)return K||ie.push({type:"Quotes",code:"MissingQuotes",message:"Quoted f\ ield unterminated",row:J.length,index:$}),rt();if(Re===Z-1)return rt(W.substring($,Re).replace(Ne,G));if(G===P&&W[Re+1]=== P)Re++;else if(G===P||Re===0||W[Re-1]!==P){be!==-1&&be<Re+1&&(be=W.indexOf(S,Re+1));var Le=Qe((xe=xe!==-1&&xe<Re+1?W.indexOf( C,Re+1):xe)===-1?be:Math.min(be,xe));if(W.substr(Re+1+Le,oe)===S){ge.push(W.substring($,Re).replace(Ne,G)),W[$=Re+1+Le+oe]!== G&&(Re=W.indexOf(G,$)),be=W.indexOf(S,$),xe=W.indexOf(C,$);break}if(Le=Qe(xe),W.substring(Re+1+Le,Re+1+Le+re)===C){if(ge. push(W.substring($,Re).replace(Ne,G)),It(Re+1+Le+re),be=W.indexOf(S,$),Re=W.indexOf(G,$),V&&(Nt(),Y))return Ze();if(O&&J. length>=O)return Ze(!0);break}ie.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is mal\ formed",row:J.length,index:$}),Re++}}else if(B&&ge.length===0&&W.substring($,$+se)===B){if(xe===-1)return Ze();$=xe+re,xe= W.indexOf(C,$),be=W.indexOf(S,$)}else if(be!==-1&&(be<xe||xe===-1))ge.push(W.substring($,be)),$=be+oe,be=W.indexOf(S,$);else{ if(xe===-1)break;if(ge.push(W.substring($,xe)),It(xe+re),V&&(Nt(),Y))return Ze();if(O&&J.length>=O)return Ze(!0)}return rt(); function Fe(pt){J.push(pt),ue=$}function Qe(pt){var mt=0;return mt=pt!==-1&&(pt=W.substring(Re+1,pt))&&pt.trim()===""?pt. length:mt}function rt(pt){return K||(pt===void 0&&(pt=W.substring($)),ge.push(pt),$=Z,Fe(ge),V&&Nt()),Ze()}function It(pt){ $=pt,Fe(ge),ge=[],xe=W.indexOf(C,$)}function Ze(pt){if(b.header&&!H&&J.length&&!k){var mt=J[0],hr=Object.create(null),Kn=new Set( mt);let qr=!1;for(let q=0;q<mt.length;q++){let X=mt[q];if(hr[X=A(b.transformHeader)?b.transformHeader(X,q):X]){let te,ce=hr[X]; for(;te=X+"_"+ce,ce++,Kn.has(te););Kn.add(te),mt[q]=te,hr[X]++,qr=!0,(U=U===null?{}:U)[te]=X}else hr[X]=1,mt[q]=X;Kn.add( X)}qr&&console.warn("Duplicate headers found and renamed."),k=!0}return{data:J,errors:ie,meta:{delimiter:S,linebreak:C,aborted:Y, truncated:!!pt,cursor:ue+(H||0),renamedHeaders:U}}}function Nt(){D(Ze()),J=[],ie=[]}},this.abort=function(){Y=!0},this.getCharIndex= function(){return $}}function g(b){var S=b.data,C=o[S.workerId],B=!1;if(S.error)C.userError(S.error,S.file);else if(S.results&& S.results.data){var D={abort:function(){B=!0,y(S.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:v,resume:v};if(A( C.userStep)){for(var O=0;O<S.results.data.length&&(C.userStep({data:S.results.data[O],errors:S.results.errors,meta:S.results. meta},D),!B);O++);delete S.results}else A(C.userChunk)&&(C.userChunk(S.results,D,S.file),delete S.results)}S.finished&&!B&& y(S.workerId,S.results)}function y(b,S){var C=o[b];A(C.userComplete)&&C.userComplete(S),C.terminate(),delete o[b]}function v(){ throw new Error("Not implemented.")}function w(b){if(typeof b!="object"||b===null)return b;var S,C=Array.isArray(b)?[]:{}; for(S in b)C[S]=w(b[S]);return C}function _(b,S){return function(){b.apply(S,arguments)}}function A(b){return typeof b== "function"}return a.parse=function(b,S){var C=(S=S||{}).dynamicTyping||!1;if(A(C)&&(S.dynamicTypingFunction=C,C={}),S.dynamicTyping= C,S.transform=!!A(S.transform)&&S.transform,!S.worker||!a.WORKERS_SUPPORTED)return C=null,a.NODE_STREAM_INPUT,typeof b== "string"?(b=(B=>B.charCodeAt(0)!==65279?B:B.slice(1))(b),C=new(S.download?u:f)(S)):b.readable===!0&&A(b.read)&&A(b.on)?C= new d(S):(e.File&&b instanceof File||b instanceof Object)&&(C=new l(S)),C.stream(b);(C=(()=>{var B;return!!a.WORKERS_SUPPORTED&& (B=(()=>{var D=e.URL||e.webkitURL||null,O=t.toString();return a.BLOB_URL||(a.BLOB_URL=D.createObjectURL(new Blob(["var g\ lobal = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return wind\ ow; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",O,")();"], {type:"text/javascript"})))})(),(B=new e.Worker(B)).onmessage=g,B.id=s++,o[B.id]=B)})()).userStep=S.step,C.userChunk=S.chunk, C.userComplete=S.complete,C.userError=S.error,S.step=A(S.step),S.chunk=A(S.chunk),S.complete=A(S.complete),S.error=A(S.error), delete S.worker,C.postMessage({input:b,config:S,workerId:C.id})},a.unparse=function(b,S){var C=!1,B=!0,D=",",O=`\r `,L='"',U=L+L,k=!1,G=null,P=!1,$=((()=>{if(typeof S=="object"){if(typeof S.delimiter!="string"||a.BAD_DELIMITERS.filter( function(H){return S.delimiter.indexOf(H)!==-1}).length||(D=S.delimiter),typeof S.quotes!="boolean"&&typeof S.quotes!="f\ unction"&&!Array.isArray(S.quotes)||(C=S.quotes),typeof S.skipEmptyLines!="boolean"&&typeof S.skipEmptyLines!="string"|| (k=S.skipEmptyLines),typeof S.newline=="string"&&(O=S.newline),typeof S.quoteChar=="string"&&(L=S.quoteChar),typeof S.header== "boolean"&&(B=S.header),Array.isArray(S.columns)){if(S.columns.length===0)throw new Error("Option columns is empty");G=S. columns}S.escapeChar!==void 0&&(U=S.escapeChar+L),S.escapeFormulae instanceof RegExp?P=S.escapeFormulae:typeof S.escapeFormulae== "boolean"&&S.escapeFormulae&&(P=/^[=+\-@\t\r].*$/)}})(),new RegExp(m(L),"g"));if(typeof b=="string"&&(b=JSON.parse(b)),Array. isArray(b)){if(!b.length||Array.isArray(b[0]))return Y(null,b,k);if(typeof b[0]=="object")return Y(G||Object.keys(b[0]), b,k)}else if(typeof b=="object")return typeof b.data=="string"&&(b.data=JSON.parse(b.data)),Array.isArray(b.data)&&(b.fields|| (b.fields=b.meta&&b.meta.fields||G),b.fields||(b.fields=Array.isArray(b.data[0])?b.fields:typeof b.data[0]=="object"?Object. keys(b.data[0]):[]),Array.isArray(b.data[0])||typeof b.data[0]=="object"||(b.data=[b.data])),Y(b.fields||[],b.data||[],k); throw new Error("Unable to serialize unrecognized input");function Y(H,K,Z){var oe="",re=(typeof H=="string"&&(H=JSON.parse( H)),typeof K=="string"&&(K=JSON.parse(K)),Array.isArray(H)&&0<H.length),se=!Array.isArray(K[0]);if(re&&B){for(var V=0;V< H.length;V++)0<V&&(oe+=D),oe+=W(H[V],V);0<K.length&&(oe+=O)}for(var J=0;J<K.length;J++){var ie=(re?H:K[J]).length,ge=!1, ue=re?Object.keys(K[J]).length===0:K[J].length===0;if(Z&&!re&&(ge=Z==="greedy"?K[J].join("").trim()==="":K[J].length===1&& K[J][0].length===0),Z==="greedy"&&re){for(var Te=[],De=0;De<ie;De++){var be=se?H[De]:De;Te.push(K[J][be])}ge=Te.join(""). trim()===""}if(!ge){for(var xe=0;xe<ie;xe++){0<xe&&!ue&&(oe+=D);var Ne=re&&se?H[xe]:xe;oe+=W(K[J][Ne],xe)}J<K.length-1&& (!Z||0<ie&&!ue)&&(oe+=O)}}return oe}function W(H,K){var Z,oe;return H==null?"":H.constructor===Date?JSON.stringify(H).slice( 1,25):(oe=!1,P&&typeof H=="string"&&P.test(H)&&(H="'"+H,oe=!0),Z=H.toString().replace($,U),(oe=oe||C===!0||typeof C=="fu\ nction"&&C(H,K)||Array.isArray(C)&&C[K]||((re,se)=>{for(var V=0;V<se.length;V++)if(-1<re.indexOf(se[V]))return!0;return!1})( Z,a.BAD_DELIMITERS)||-1<Z.indexOf(D)||Z.charAt(0)===" "||Z.charAt(Z.length-1)===" ")?L+Z+L:Z)}},a.RECORD_SEP="",a.UNIT_SEP= "",a.BYTE_ORDER_MARK="\uFEFF",a.BAD_DELIMITERS=["\r",` `,'"',a.BYTE_ORDER_MARK],a.WORKERS_SUPPORTED=!n&&!!e.Worker,a.NODE_STREAM_INPUT=1,a.LocalChunkSize=10485760,a.RemoteChunkSize= 5242880,a.DefaultDelimiter=",",a.Parser=p,a.ParserHandle=h,a.NetworkStreamer=u,a.FileStreamer=l,a.StringStreamer=f,a.ReadableStreamStreamer= d,e.jQuery&&((r=e.jQuery).fn.parse=function(b){var S=b.config||{},C=[];return this.each(function(O){if(!(r(this).prop("t\ agName").toUpperCase()==="INPUT"&&r(this).attr("type").toLowerCase()==="file"&&e.FileReader)||!this.files||this.files.length=== 0)return!0;for(var L=0;L<this.files.length;L++)C.push({file:this.files[L],inputElem:this,instanceConfig:r.extend({},S)})}), B(),this;function B(){if(C.length===0)A(b.complete)&&b.complete();else{var O,L,U,k,G=C[0];if(A(b.before)){var P=b.before( G.file,G.inputElem);if(typeof P=="object"){if(P.action==="abort")return O="AbortError",L=G.file,U=G.inputElem,k=P.reason, void(A(b.error)&&b.error({name:O},L,U,k));if(P.action==="skip")return void D();typeof P.config=="object"&&(G.instanceConfig= r.extend(G.instanceConfig,P.config))}else if(P==="skip")return void D()}var $=G.instanceConfig.complete;G.instanceConfig. complete=function(Y){A($)&&$(Y,G.file,G.inputElem),D()},a.parse(G.file,G.instanceConfig)}}function D(){C.splice(0,1),B()}}), i&&(e.onmessage=function(b){b=b.data,a.WORKER_ID===void 0&&b&&(a.WORKER_ID=b.workerId),typeof b.input=="string"?e.postMessage( {workerId:a.WORKER_ID,results:a.parse(b.input,b.config),finished:!0}):(e.File&&b.input instanceof File||b.input instanceof Object)&&(b=a.parse(b.input,b.config))&&e.postMessage({workerId:a.WORKER_ID,results:b,finished:!0})}),(u.prototype=Object. create(c.prototype)).constructor=u,(l.prototype=Object.create(c.prototype)).constructor=l,(f.prototype=Object.create(f.prototype)). constructor=f,(d.prototype=Object.create(c.prototype)).constructor=d,a})});var Zf=z((Ope,ZA)=>{"use strict";ZA.exports=class QA{constructor(e,r=new Map,n=0){this.prefix=e,this._existing=r,this.counter= n}clone(){let{prefix:e,_existing:r,counter:n}=this;return new QA(e,new Map(r),n)}getId(e){let r=e&&this._existing.get(e); if(r)return r;let n=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,n),n}hasId(e){return this._existing. has(e)}getOldIds(){return[...this._existing.keys()]}}});var tS=z(eS=>{(function(t,e){"use strict";if(t.setImmediate)return;var r=1,n={},i=!1,o=t.document,s;function a(v){typeof v!= "function"&&(v=new Function(""+v));for(var w=new Array(arguments.length-1),_=0;_<w.length;_++)w[_]=arguments[_+1];var A={ callback:v,args:w};return n[r]=A,s(r),r++}function c(v){delete n[v]}function u(v){var w=v.callback,_=v.args;switch(_.length){case 0: w();break;case 1:w(_[0]);break;case 2:w(_[0],_[1]);break;case 3:w(_[0],_[1],_[2]);break;default:w.apply(e,_);break}}function l(v){ if(i)setTimeout(l,0,v);else{var w=n[v];if(w){i=!0;try{u(w)}finally{c(v),i=!1}}}}function f(){s=function(v){process.nextTick( function(){l(v)})}}function d(){if(t.postMessage&&!t.importScripts){var v=!0,w=t.onmessage;return t.onmessage=function(){ v=!1},t.postMessage("","*"),t.onmessage=w,v}}function h(){var v="setImmediate$"+Math.random()+"$",w=function(_){_.source=== t&&typeof _.data=="string"&&_.data.indexOf(v)===0&&l(+_.data.slice(v.length))};t.addEventListener?t.addEventListener("me\ ssage",w,!1):t.attachEvent("onmessage",w),s=function(_){t.postMessage(v+_,"*")}}function m(){var v=new MessageChannel;v. port1.onmessage=function(w){var _=w.data;l(_)},s=function(w){v.port2.postMessage(w)}}function p(){var v=o.documentElement; s=function(w){var _=o.createElement("script");_.onreadystatechange=function(){l(w),_.onreadystatechange=null,v.removeChild( _),_=null},v.appendChild(_)}}function g(){s=function(v){setTimeout(l,0,v)}}var y=Object.getPrototypeOf&&Object.getPrototypeOf( t);y=y&&y.setTimeout?y:t,{}.toString.call(t.process)==="[object process]"?f():d()?h():t.MessageChannel?m():o&&"onreadyst\ atechange"in o.createElement("script")?p():g(),y.setImmediate=a,y.clearImmediate=c})(typeof self>"u"?typeof global>"u"?eS: global:self)});var Hu=z((Upe,rS)=>{"use strict";tS();var l0=self.crypto||self.msCrypto;rS.exports=class{constructor(e){if(!(l0&&l0.subtle)) throw new Error("crypto.subtle not found.");if(e==="sha256")this.algorithm={name:"SHA-256"};else if(e==="sha1")this.algorithm= {name:"SHA-1"};else throw new Error(`Unsupported algorithm "${e}".`);this._content=""}update(e){this._content+=e}async digest(){ let e=new TextEncoder().encode(this._content),r=new Uint8Array(await l0.subtle.digest(this.algorithm,e)),n="";for(let i=0;i< r.length;++i)n+=r[i].toString(16).padStart(2,"0");return n}}});var f0=z((Gpe,nS)=>{"use strict";nS.exports=class{constructor(e){this.current=e.sort(),this.done=!1,this.dir=new Map;for(let r=0;r< e.length;++r)this.dir.set(e[r],!0)}hasNext(){return!this.done}next(){let{current:e,dir:r}=this,n=e.slice(),i=null,o=0,s=e. length;for(let a=0;a<s;++a){let c=e[a],u=r.get(c);(i===null||c>i)&&(u&&a>0&&c>e[a-1]||!u&&a<s-1&&c>e[a+1])&&(i=c,o=a)}if(i=== null)this.done=!0;else{let a=r.get(i)?o-1:o+1;e[o]=e[a],e[a]=i;for(let c of e)c>i&&r.set(c,!r.get(c))}return n}}});var rd=z((qpe,oS)=>{"use strict";var xj="http://www.w3.org/1999/02/22-rdf-syntax-ns#",d0=xj+"langString",h0="http://www.\ w3.org/2001/XMLSchema#string",Yn="NamedNode",Cs="BlankNode",ed="Literal",iS="DefaultGraph",Va={};(()=>{let t="(?:<([^:]+\ :[^>]*)>)",r="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"+ "_",n=r+"0-9-\xB7\u0300-\u036F\u203F-\u2040",o="(_:(?:["+r+"0-9])(?:(?:["+n+".])*(?:["+n+"]))?)",s='"([^"\\\\]*(?:\\\\.[^"\\\\\ ]*)*)"',a="(?:\\^\\^"+t+")",u="(?:"+s+"(?:"+a+"|"+"(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*))"+")?)",l="[ \\t]+",f="[ \\t]*",d="\ (?:"+t+"|"+o+")"+l,h=t+l,m="(?:"+t+"|"+o+"|"+u+")"+f,p="(?:\\.|(?:(?:"+t+"|"+o+")"+f+"\\.))";Va.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g, Va.empty=new RegExp("^"+f+"$"),Va.quad=new RegExp("^"+f+d+h+m+p+f+"$")})();oS.exports=class td{static parse(e){let r=[], n={},i=e.split(Va.eoln),o=0;for(let s of i){if(o++,Va.empty.test(s))continue;let a=s.match(Va.quad);if(a===null)throw new Error( "N-Quads parse error on line "+o+".");let c={subject:null,predicate:null,object:null,graph:null};if(a[1]!==void 0?c.subject= {termType:Yn,value:a[1]}:c.subject={termType:Cs,value:a[2]},c.predicate={termType:Yn,value:a[3]},a[4]!==void 0?c.object= {termType:Yn,value:a[4]}:a[5]!==void 0?c.object={termType:Cs,value:a[5]}:(c.object={termType:ed,value:void 0,datatype:{termType:Yn}}, a[7]!==void 0?c.object.datatype.value=a[7]:a[8]!==void 0?(c.object.datatype.value=d0,c.object.language=a[8]):c.object.datatype. value=h0,c.object.value=Dj(a[6])),a[9]!==void 0?c.graph={termType:Yn,value:a[9]}:a[10]!==void 0?c.graph={termType:Cs,value:a[10]}: c.graph={termType:iS,value:""},!(c.graph.value in n))n[c.graph.value]=[c],r.push(c);else{let u=!0,l=n[c.graph.value];for(let f of l) if(_j(f,c)){u=!1;break}u&&(l.push(c),r.push(c))}}return r}static serialize(e){Array.isArray(e)||(e=td.legacyDatasetToQuads( e));let r=[];for(let n of e)r.push(td.serializeQuad(n));return r.sort().join("")}static serializeQuadComponents(e,r,n,i){ let o="";return e.termType===Yn?o+=`<${e.value}>`:o+=`${e.value}`,o+=` <${r.value}> `,n.termType===Yn?o+=`<${n.value}>`: n.termType===Cs?o+=n.value:(o+=`"${Aj(n.value)}"`,n.datatype.value===d0?n.language&&(o+=`@${n.language}`):n.datatype.value!== h0&&(o+=`^^<${n.datatype.value}>`)),i.termType===Yn?o+=` <${i.value}>`:i.termType===Cs&&(o+=` ${i.value}`),o+=` . `,o}static serializeQuad(e){return td.serializeQuadComponents(e.subject,e.predicate,e.object,e.graph)}static legacyDatasetToQuads(e){ let r=[],n={"blank node":Cs,IRI:Yn,literal:ed};for(let i in e)e[i].forEach(s=>{let a={};for(let c in s){let u=s[c],l={termType:n[u. type],value:u.value};l.termType===ed&&(l.datatype={termType:Yn},"datatype"in u&&(l.datatype.value=u.datatype),"language"in u?("datatype"in u||(l.datatype.value=d0),l.language=u.language):"datatype"in u||(l.datatype.value=h0)),a[c]=l}i==="@defa\ ult"?a.graph={termType:iS,value:""}:a.graph={termType:i.startsWith("_:")?Cs:Yn,value:i},r.push(a)});return r}};function _j(t,e){ return!(t.subject.termType===e.subject.termType&&t.object.termType===e.object.termType)||!(t.subject.value===e.subject.value&& t.predicate.value===e.predicate.value&&t.object.value===e.object.value)?!1:t.object.termType!==ed?!0:t.object.datatype.termType=== e.object.datatype.termType&&t.object.language===e.object.language&&t.object.datatype.value===e.object.datatype.value}var Ej=/["\\\n\r]/g; function Aj(t){return t.replace(Ej,function(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case` `:return"\\n";case"\r":return"\\r"}})}var Sj=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g;function Dj(t){ return t.replace(Sj,function(e,r,n,i){if(r)switch(r){case"t":return" ";case"b":return"\b";case"n":return` `;case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(n)return String.fromCharCode( parseInt(n,16));if(i)throw new Error("Unsupported U escape")})}});var p0=z((zpe,cS)=>{"use strict";var sS=Zf(),Cj=Hu(),Rj=f0(),aS=rd();cS.exports=class{constructor({createMessageDigest:e=()=>new Cj( "sha256"),canonicalIdMap:r=new Map,maxDeepIterations:n=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer= new sS("_:c14n",r),this.createMessageDigest=e,this.maxDeepIterations=n,this.quads=null,this.deepIterations=null}async main(e){ this.deepIterations=new Map,this.quads=e;for(let c of e)this._addBlankNodeQuadInfo({quad:c,component:c.subject}),this._addBlankNodeQuadInfo( {quad:c,component:c.object}),this._addBlankNodeQuadInfo({quad:c,component:c.graph});let r=new Map,n=[...this.blankNodeInfo. keys()],i=0;for(let c of n)++i%100===0&&await this._yield(),await this._hashAndTrackBlankNode({id:c,hashToBlankNodes:r}); let o=[...r.keys()].sort(),s=[];for(let c of o){let u=r.get(c);if(u.length>1){s.push(u);continue}let l=u[0];this.canonicalIssuer. getId(l)}for(let c of s){let u=[];for(let l of c){if(this.canonicalIssuer.hasId(l))continue;let f=new sS("_:b");f.getId( l);let d=await this.hashNDegreeQuads(l,f);u.push(d)}u.sort(Bj);for(let l of u){let f=l.issuer.getOldIds();for(let d of f) this.canonicalIssuer.getId(d)}}let a=[];for(let c of this.quads){let u=aS.serializeQuadComponents(this._componentWithCanonicalId( c.subject),c.predicate,this._componentWithCanonicalId(c.object),this._componentWithCanonicalId(c.graph));a.push(u)}return a. sort(),a.join("")}async hashFirstDegreeQuads(e){let r=[],n=this.blankNodeInfo.get(e),i=n.quads;for(let s of i){let a={subject:null, predicate:s.predicate,object:null,graph:null};a.subject=this.modifyFirstDegreeComponent(e,s.subject,"subject"),a.object= this.modifyFirstDegreeComponent(e,s.object,"object"),a.graph=this.modifyFirstDegreeComponent(e,s.graph,"graph"),r.push(aS. serializeQuad(a))}r.sort();let o=this.createMessageDigest();for(let s of r)o.update(s);return n.hash=await o.digest(),n. hash}async hashRelatedBlankNode(e,r,n,i){let o;this.canonicalIssuer.hasId(e)?o=this.canonicalIssuer.getId(e):n.hasId(e)? o=n.getId(e):o=this.blankNodeInfo.get(e).hash;let s=this.createMessageDigest();return s.update(i),i!=="g"&&s.update(this. getRelatedPredicate(r)),s.update(o),s.digest()}async hashNDegreeQuads(e,r){let n=this.deepIterations.get(e)||0;if(n>this. maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set( e,n+1);let i=this.createMessageDigest(),o=await this.createHashToRelated(e,r),s=[...o.keys()].sort();for(let a of s){i.update( a);let c="",u,l=new Rj(o.get(a)),f=0;for(;l.hasNext();){let d=l.next();++f%3===0&&await this._yield();let h=r.clone(),m="", p=[],g=!1;for(let y of d)if(this.canonicalIssuer.hasId(y)?m+=this.canonicalIssuer.getId(y):(h.hasId(y)||p.push(y),m+=h.getId( y)),c.length!==0&&m>c){g=!0;break}if(!g){for(let y of p){let v=await this.hashNDegreeQuads(y,h);if(m+=h.getId(y),m+=`<${v. hash}>`,h=v.issuer,c.length!==0&&m>c){g=!0;break}}g||(c.length===0||m<c)&&(c=m,u=h)}}i.update(c),r=u}return{hash:await i. digest(),issuer:r}}modifyFirstDegreeComponent(e,r){return r.termType!=="BlankNode"?r:{termType:"BlankNode",value:r.value=== e?"_:a":"_:z"}}getRelatedPredicate(e){return`<${e.predicate.value}>`}async createHashToRelated(e,r){let n=new Map,i=this. blankNodeInfo.get(e).quads,o=0;for(let s of i)++o%100===0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash( {quad:s,component:s.subject,position:"s",id:e,issuer:r,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:s,component:s. object,position:"o",id:e,issuer:r,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:s,component:s.graph,position:"g", id:e,issuer:r,hashToRelated:n})]);return n}async _hashAndTrackBlankNode({id:e,hashToBlankNodes:r}){let n=await this.hashFirstDegreeQuads( e),i=r.get(n);i?i.push(e):r.set(n,[e])}_addBlankNodeQuadInfo({quad:e,component:r}){if(r.termType!=="BlankNode")return;let n=r. value,i=this.blankNodeInfo.get(n);i?i.quads.add(e):this.blankNodeInfo.set(n,{quads:new Set([e]),hash:null})}async _addRelatedBlankNodeHash({ quad:e,component:r,position:n,id:i,issuer:o,hashToRelated:s}){if(!(r.termType==="BlankNode"&&r.value!==i))return;let a=r. value,c=await this.hashRelatedBlankNode(a,e,o,n),u=s.get(c);u?u.push(a):s.set(c,[a])}_componentWithCanonicalId(e){return e. termType==="BlankNode"&&!e.value.startsWith(this.canonicalIssuer.prefix)?{termType:"BlankNode",value:this.canonicalIssuer. getId(e.value)}:e}async _yield(){return new Promise(e=>setImmediate(e))}};function Bj(t,e){return t.hash<e.hash?-1:t.hash> e.hash?1:0}});var lS=z((Vpe,uS)=>{"use strict";var Ij=Hu(),Nj=p0();uS.exports=class extends Nj{constructor(){super(),this.name="URGNA2\ 012",this.createMessageDigest=()=>new Ij("sha1")}modifyFirstDegreeComponent(e,r,n){return r.termType!=="BlankNode"?r:n=== "graph"?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:r.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e. predicate.value}async createHashToRelated(e,r){let n=new Map,i=this.blankNodeInfo.get(e).quads,o=0;for(let s of i){let a, c;if(s.subject.termType==="BlankNode"&&s.subject.value!==e)c=s.subject.value,a="p";else if(s.object.termType==="BlankNod\ e"&&s.object.value!==e)c=s.object.value,a="r";else continue;++o%100===0&&await this._yield();let u=await this.hashRelatedBlankNode( c,s,r,a),l=n.get(u);l?l.push(c):n.set(u,[c])}return n}}});var m0=z((Jpe,hS)=>{"use strict";var fS=Zf(),Tj=Hu(),Fj=f0(),dS=rd();hS.exports=class{constructor({createMessageDigest:e=()=>new Tj( "sha256"),canonicalIdMap:r=new Map,maxDeepIterations:n=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer= new fS("_:c14n",r),this.createMessageDigest=e,this.maxDeepIterations=n,this.quads=null,this.deepIterations=null}main(e){ this.deepIterations=new Map,this.quads=e;for(let a of e)this._addBlankNodeQuadInfo({quad:a,component:a.subject}),this._addBlankNodeQuadInfo( {quad:a,component:a.object}),this._addBlankNodeQuadInfo({quad:a,component:a.graph});let r=new Map,n=[...this.blankNodeInfo. keys()];for(let a of n)this._hashAndTrackBlankNode({id:a,hashToBlankNodes:r});let i=[...r.keys()].sort(),o=[];for(let a of i){ let c=r.get(a);if(c.length>1){o.push(c);continue}let u=c[0];this.canonicalIssuer.getId(u)}for(let a of o){let c=[];for(let u of a){ if(this.canonicalIssuer.hasId(u))continue;let l=new fS("_:b");l.getId(u);let f=this.hashNDegreeQuads(u,l);c.push(f)}c.sort( Mj);for(let u of c){let l=u.issuer.getOldIds();for(let f of l)this.canonicalIssuer.getId(f)}}let s=[];for(let a of this. quads){let c=dS.serializeQuadComponents(this._componentWithCanonicalId({component:a.subject}),a.predicate,this._componentWithCanonicalId( {component:a.object}),this._componentWithCanonicalId({component:a.graph}));s.push(c)}return s.sort(),s.join("")}hashFirstDegreeQuads(e){ let r=[],n=this.blankNodeInfo.get(e),i=n.quads;for(let s of i){let a={subject:null,predicate:s.predicate,object:null,graph:null}; a.subject=this.modifyFirstDegreeComponent(e,s.subject,"subject"),a.object=this.modifyFirstDegreeComponent(e,s.object,"ob\ ject"),a.graph=this.modifyFirstDegreeComponent(e,s.graph,"graph"),r.push(dS.serializeQuad(a))}r.sort();let o=this.createMessageDigest(); for(let s of r)o.update(s);return n.hash=o.digest(),n.hash}hashRelatedBlankNode(e,r,n,i){let o;this.canonicalIssuer.hasId( e)?o=this.canonicalIssuer.getId(e):n.hasId(e)?o=n.getId(e):o=this.blankNodeInfo.get(e).hash;let s=this.createMessageDigest(); return s.update(i),i!=="g"&&s.update(this.getRelatedPredicate(r)),s.update(o),s.digest()}hashNDegreeQuads(e,r){let n=this. deepIterations.get(e)||0;if(n>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}\ ) exceeded.`);this.deepIterations.set(e,n+1);let i=this.createMessageDigest(),o=this.createHashToRelated(e,r),s=[...o.keys()]. sort();for(let a of s){i.update(a);let c="",u,l=new Fj(o.get(a));for(;l.hasNext();){let f=l.next(),d=r.clone(),h="",m=[], p=!1;for(let g of f)if(this.canonicalIssuer.hasId(g)?h+=this.canonicalIssuer.getId(g):(d.hasId(g)||m.push(g),h+=d.getId( g)),c.length!==0&&h>c){p=!0;break}if(!p){for(let g of m){let y=this.hashNDegreeQuads(g,d);if(h+=d.getId(g),h+=`<${y.hash}\ >`,d=y.issuer,c.length!==0&&h>c){p=!0;break}}p||(c.length===0||h<c)&&(c=h,u=d)}}i.update(c),r=u}return{hash:i.digest(),issuer:r}}modifyFirstDegreeComponent(e,r){ return r.termType!=="BlankNode"?r:{termType:"BlankNode",value:r.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return`<${e. predicate.value}>`}createHashToRelated(e,r){let n=new Map,i=this.blankNodeInfo.get(e).quads;for(let o of i)this._addRelatedBlankNodeHash( {quad:o,component:o.subject,position:"s",id:e,issuer:r,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:o,component:o. object,position:"o",id:e,issuer:r,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:o,component:o.graph,position:"g", id:e,issuer:r,hashToRelated:n});return n}_hashAndTrackBlankNode({id:e,hashToBlankNodes:r}){let n=this.hashFirstDegreeQuads( e),i=r.get(n);i?i.push(e):r.set(n,[e])}_addBlankNodeQuadInfo({quad:e,component:r}){if(r.termType!=="BlankNode")return;let n=r. value,i=this.blankNodeInfo.get(n);i?i.quads.add(e):this.blankNodeInfo.set(n,{quads:new Set([e]),hash:null})}_addRelatedBlankNodeHash({ quad:e,component:r,position:n,id:i,issuer:o,hashToRelated:s}){if(!(r.termType==="BlankNode"&&r.value!==i))return;let a=r. value,c=this.hashRelatedBlankNode(a,e,o,n),u=s.get(c);u?u.push(a):s.set(c,[a])}_componentWithCanonicalId({component:e}){ return e.termType==="BlankNode"&&!e.value.startsWith(this.canonicalIssuer.prefix)?{termType:"BlankNode",value:this.canonicalIssuer. getId(e.value)}:e}};function Mj(t,e){return t.hash<e.hash?-1:t.hash>e.hash?1:0}});var mS=z((Kpe,pS)=>{"use strict";var Oj=Hu(),Lj=m0();pS.exports=class extends Lj{constructor(){super(),this.name="URGNA2\ 012",this.createMessageDigest=()=>new Oj("sha1")}modifyFirstDegreeComponent(e,r,n){return r.termType!=="BlankNode"?r:n=== "graph"?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:r.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e. predicate.value}createHashToRelated(e,r){let n=new Map,i=this.blankNodeInfo.get(e).quads;for(let o of i){let s,a;if(o.subject. termType==="BlankNode"&&o.subject.value!==e)a=o.subject.value,s="p";else if(o.object.termType==="BlankNode"&&o.object.value!== e)a=o.object.value,s="r";else continue;let c=this.hashRelatedBlankNode(a,o,r,s),u=n.get(c);u?u.push(a):n.set(c,[a])}return n}}});var gS=z(()=>{});var vS=z(Bs=>{"use strict";var Pj=p0(),Uj=lS(),kj=m0(),Gj=mS(),Rs;try{Rs=gS()}catch{}function yS(t){return Array.isArray( t)?t:Bs.NQuads.legacyDatasetToQuads(t)}Bs.NQuads=rd();Bs.IdentifierIssuer=Zf();Bs._rdfCanonizeNative=function(t){return t&& (Rs=t),Rs};Bs.canonize=async function(t,e){let r=yS(t,e);if(e.useNative){if(!Rs)throw new Error("rdf-canonize-native not\ available");if(e.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise( (n,i)=>Rs.canonize(r,e,(o,s)=>o?i(o):n(s)))}if(e.algorithm==="URDNA2015")return new Pj(e).main(r);if(e.algorithm==="URGN\ A2012"){if(e.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new Uj( e).main(r)}throw"algorithm"in e?new Error("Invalid RDF Dataset Canonicalization algorithm: "+e.algorithm):new Error("No \ RDF Dataset Canonicalization algorithm specified.")};Bs._canonizeSync=function(t,e){let r=yS(t,e);if(e.useNative){if(!Rs) throw new Error("rdf-canonize-native not available");if(e.createMessageDigest)throw new Error('"createMessageDigest" can\ not be used with "useNative".');return Rs.canonizeSync(r,e)}if(e.algorithm==="URDNA2015")return new kj(e).main(r);if(e.algorithm=== "URGNA2012"){if(e.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new Gj( e).main(r)}throw"algorithm"in e?new Error("Invalid RDF Dataset Canonicalization algorithm: "+e.algorithm):new Error("No \ RDF Dataset Canonicalization algorithm specified.")}});var nd=z((Zpe,bS)=>{bS.exports=vS()});var tn=z((eme,wS)=>{"use strict";var Bn={};wS.exports=Bn;Bn.isArray=Array.isArray;Bn.isBoolean=t=>typeof t=="boolean"||Object. prototype.toString.call(t)==="[object Boolean]";Bn.isDouble=t=>Bn.isNumber(t)&&(String(t).indexOf(".")!==-1||Math.abs(t)>= 1e21);Bn.isEmptyObject=t=>Bn.isObject(t)&&Object.keys(t).length===0;Bn.isNumber=t=>typeof t=="number"||Object.prototype. toString.call(t)==="[object Number]";Bn.isNumeric=t=>!isNaN(parseFloat(t))&&isFinite(t);Bn.isObject=t=>Object.prototype. toString.call(t)==="[object Object]";Bn.isString=t=>typeof t=="string"||Object.prototype.toString.call(t)==="[object Str\ ing]";Bn.isUndefined=t=>typeof t>"u"});var di=z((tme,xS)=>{"use strict";var Is=tn(),ro={};xS.exports=ro;ro.isSubject=t=>Is.isObject(t)&&!("@value"in t||"@set"in t||"@list"in t)?Object.keys(t).length>1||!("@id"in t):!1;ro.isSubjectReference=t=>Is.isObject(t)&&Object.keys(t).length=== 1&&"@id"in t;ro.isValue=t=>Is.isObject(t)&&"@value"in t;ro.isList=t=>Is.isObject(t)&&"@list"in t;ro.isGraph=t=>Is.isObject( t)&&"@graph"in t&&Object.keys(t).filter(e=>e!=="@id"&&e!=="@index").length===1;ro.isSimpleGraph=t=>ro.isGraph(t)&&!("@id"in t);ro.isBlankNode=t=>{if(Is.isObject(t)){if("@id"in t){let e=t["@id"];return!Is.isString(e)||e.indexOf("_:")===0}return Object. keys(t).length===0||!("@value"in t||"@set"in t||"@list"in t)}return!1}});var yn=z((nme,_S)=>{"use strict";_S.exports=class extends Error{constructor(e="An unspecified JSON-LD error occurred.",r="\ jsonld.Error",n={}){super(e),this.name=r,this.message=e,this.details=n}}});var vn=z((ime,SS)=>{"use strict";var Vu=di(),Nr=tn(),AS=nd().IdentifierIssuer,qj=yn(),jj=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/, zj=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,Hj=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,Vj=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g, Wj=/^@[a-zA-Z]+$/,ES={headers:{accept:"application/ld+json, application/json"}},gt={};SS.exports=gt;gt.IdentifierIssuer= AS;gt.REGEX_BCP47=jj;gt.REGEX_KEYWORD=Wj;gt.clone=function(t){if(t&&typeof t=="object"){let e;if(Nr.isArray(t)){e=[];for(let r=0;r< t.length;++r)e[r]=gt.clone(t[r])}else if(t instanceof Map){e=new Map;for(let[r,n]of t)e.set(r,gt.clone(n))}else if(t instanceof Set){e=new Set;for(let r of t)e.add(gt.clone(r))}else if(Nr.isObject(t)){e={};for(let r in t)e[r]=gt.clone(t[r])}else e= t.toString();return e}return t};gt.asArray=function(t){return Array.isArray(t)?t:[t]};gt.buildHeaders=(t={})=>{if(Object. keys(t).some(r=>r.toLowerCase()==="accept"))throw new RangeError('Accept header may not be specified; only "'+ES.headers. accept+'" is supported.');return Object.assign({Accept:ES.headers.accept},t)};gt.parseLinkHeader=t=>{let e={},r=t.match( zj);for(let n=0;n<r.length;++n){let i=r[n].match(Hj);if(!i)continue;let o={target:i[1]},s=i[2];for(;i=Vj.exec(s);)o[i[1]]= i[2]===void 0?i[3]:i[2];let a=o.rel||"";Array.isArray(e[a])?e[a].push(o):e.hasOwnProperty(a)?e[a]=[e[a],o]:e[a]=o}return e}; gt.validateTypeValue=(t,e)=>{if(!Nr.isString(t)&&!(Nr.isArray(t)&&t.every(r=>Nr.isString(r)))){if(e&&Nr.isObject(t))switch(Object. keys(t).length){case 0:return;case 1:if("@default"in t&&gt.asArray(t["@default"]).every(r=>Nr.isString(r)))return}throw new qj( 'Invalid JSON-LD syntax; "@type" value must a string, an array of strings, an empty object, or a default object.',"jsonl\ d.SyntaxError",{code:"invalid type value",value:t})}};gt.hasProperty=(t,e)=>{if(t.hasOwnProperty(e)){let r=t[e];return!Nr. isArray(r)||r.length>0}return!1};gt.hasValue=(t,e,r)=>{if(gt.hasProperty(t,e)){let n=t[e],i=Vu.isList(n);if(Nr.isArray(n)|| i){i&&(n=n["@list"]);for(let o=0;o<n.length;++o)if(gt.compareValues(r,n[o]))return!0}else if(!Nr.isArray(r))return gt.compareValues( r,n)}return!1};gt.addValue=(t,e,r,n)=>{if(n=n||{},"propertyIsArray"in n||(n.propertyIsArray=!1),"valueIsArray"in n||(n.valueIsArray= !1),"allowDuplicate"in n||(n.allowDuplicate=!0),"prependValue"in n||(n.prependValue=!1),n.valueIsArray)t[e]=r;else if(Nr. isArray(r)){r.length===0&&n.propertyIsArray&&!t.hasOwnProperty(e)&&(t[e]=[]),n.prependValue&&(r=r.concat(t[e]),t[e]=[]); for(let i=0;i<r.length;++i)gt.addValue(t,e,r[i],n)}else if(t.hasOwnProperty(e)){let i=!n.allowDuplicate&&gt.hasValue(t,e, r);!Nr.isArray(t[e])&&(!i||n.propertyIsArray)&&(t[e]=[t[e]]),i||(n.prependValue?t[e].unshift(r):t[e].push(r))}else t[e]= n.propertyIsArray?[r]:r};gt.getValues=(t,e)=>[].concat(t[e]||[]);gt.removeProperty=(t,e)=>{delete t[e]};gt.removeValue=(t,e,r,n)=>{ n=n||{},"propertyIsArray"in n||(n.propertyIsArray=!1);let i=gt.getValues(t,e).filter(o=>!gt.compareValues(o,r));i.length=== 0?gt.removeProperty(t,e):i.length===1&&!n.propertyIsArray?t[e]=i[0]:t[e]=i};gt.relabelBlankNodes=(t,e)=>{e=e||{};let r=e. issuer||new AS("_:b");return id(r,t)};gt.compareValues=(t,e)=>t===e||Vu.isValue(t)&&Vu.isValue(e)&&t["@value"]===e["@val\ ue"]&&t["@type"]===e["@type"]&&t["@language"]===e["@language"]&&t["@index"]===e["@index"]?!0:Nr.isObject(t)&&"@id"in t&& Nr.isObject(e)&&"@id"in e?t["@id"]===e["@id"]:!1;gt.compareShortestLeast=(t,e)=>t.length<e.length?-1:e.length<t.length?1: t===e?0:t<e?-1:1;function id(t,e){if(Nr.isArray(e))for(let r=0;r<e.length;++r)e[r]=id(t,e[r]);else if(Vu.isList(e))e["@l\ ist"]=id(t,e["@list"]);else if(Nr.isObject(e)){Vu.isBlankNode(e)&&(e["@id"]=t.getId(e["@id"]));let r=Object.keys(e).sort(); for(let n=0;n<r.length;++n){let i=r[n];i!=="@id"&&(e[i]=id(t,e[i]))}}return e}});var od=z((ome,DS)=>{"use strict";var Qn="http://www.w3.org/1999/02/22-rdf-syntax-ns#",Wu="http://www.w3.org/2001/XMLSche\ ma#";DS.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-l\ d#context",RDF:Qn,RDF_LIST:Qn+"List",RDF_FIRST:Qn+"first",RDF_REST:Qn+"rest",RDF_NIL:Qn+"nil",RDF_TYPE:Qn+"type",RDF_PLAIN_LITERAL:Qn+ "PlainLiteral",RDF_XML_LITERAL:Qn+"XMLLiteral",RDF_JSON_LITERAL:Qn+"JSON",RDF_OBJECT:Qn+"object",RDF_LANGSTRING:Qn+"lang\ String",XSD:Wu,XSD_BOOLEAN:Wu+"boolean",XSD_DOUBLE:Wu+"double",XSD_INTEGER:Wu+"integer",XSD_STRING:Wu+"string"}});var g0=z((ame,CS)=>{"use strict";CS.exports=class{constructor(){this._requests={}}wrapLoader(e){let r=this;return r._loader= e,function(){return r.add.apply(r,arguments)}}async add(e){let r=this._requests[e];if(r)return Promise.resolve(r);r=this. _requests[e]=this._loader(e);try{return await r}finally{delete this._requests[e]}}}});var no=z((cme,RS)=>{"use strict";var sd=tn(),Tr={};RS.exports=Tr;Tr.parsers={simple:{keys:["href","scheme","authority","\ path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["hr\ ef","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragme\ nt"],regex:/^(([a-zA-Z][a-zA-Z0-9+-.]*):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}}; Tr.parse=(t,e)=>{let r={},n=Tr.parsers[e||"full"],i=n.regex.exec(t),o=n.keys.length;for(;o--;)r[n.keys[o]]=i[o]===void 0? null:i[o];return(r.scheme==="https"&&r.port==="443"||r.scheme==="http"&&r.port==="80")&&(r.href=r.href.replace(":"+r.port, ""),r.authority=r.authority.replace(":"+r.port,""),r.port=null),r.normalizedPath=Tr.removeDotSegments(r.path),r};Tr.prependBase= (t,e)=>{if(t===null||Tr.isAbsolute(e))return e;(!t||sd.isString(t))&&(t=Tr.parse(t||""));let r=Tr.parse(e),n={protocol:t. protocol||""};if(r.authority!==null)n.authority=r.authority,n.path=r.path,n.query=r.query;else if(n.authority=t.authority, r.path==="")n.path=t.path,r.query!==null?n.query=r.query:n.query=t.query;else{if(r.path.indexOf("/")===0)n.path=r.path;else{ let o=t.path;o=o.substr(0,o.lastIndexOf("/")+1),(o.length>0||t.authority)&&o.substr(-1)!=="/"&&(o+="/"),o+=r.path,n.path= o}n.query=r.query}r.path!==""&&(n.path=Tr.removeDotSegments(n.path));let i=n.protocol;return n.authority!==null&&(i+="//"+ n.authority),i+=n.path,n.query!==null&&(i+="?"+n.query),r.fragment!==null&&(i+="#"+r.fragment),i===""&&(i="./"),i};Tr.removeBase= (t,e)=>{if(t===null)return e;(!t||sd.isString(t))&&(t=Tr.parse(t||""));let r="";if(t.href!==""?r+=(t.protocol||"")+"//"+ (t.authority||""):e.indexOf("//")&&(r+="//"),e.indexOf(r)!==0)return e;let n=Tr.parse(e.substr(r.length)),i=t.normalizedPath. split("/"),o=n.normalizedPath.split("/"),s=n.fragment||n.query?0:1;for(;i.length>0&&o.length>s&&i[0]===o[0];)i.shift(),o. shift();let a="";if(i.length>0){i.pop();for(let c=0;c<i.length;++c)a+="../"}return a+=o.join("/"),n.query!==null&&(a+="?"+ n.query),n.fragment!==null&&(a+="#"+n.fragment),a===""&&(a="./"),a};Tr.removeDotSegments=t=>{if(t.length===0)return"";let e=t. split("/"),r=[];for(;e.length>0;){let n=e.shift(),i=e.length===0;if(n==="."){i&&r.push("");continue}if(n===".."){r.pop(), i&&r.push("");continue}r.push(n)}return t[0]==="/"&&r.length>0&&r[0]!==""&&r.unshift(""),r.length===1&&r[0]===""?"/":r.join( "/")};var Jj=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;Tr.isAbsolute=t=>sd.isString(t)&&Jj.test(t);Tr.isRelative=t=>sd.isString( t)});var IS=z((ume,BS)=>{"use strict";var{parseLinkHeader:Xj,buildHeaders:Kj}=vn(),{LINK_HEADER_CONTEXT:$j}=od(),Ju=yn(),Yj=g0(), {prependBase:Qj}=no(),Zj=/(^|(\r\n))link:/i;BS.exports=({secure:t,headers:e={},xhr:r}={headers:{}})=>{return e=Kj(e),new Yj(). wrapLoader(i);async function i(o){if(o.indexOf("http:")!==0&&o.indexOf("https:")!==0)throw new Ju('URL could not be dere\ ferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:o});if(t&& o.indexOf("https")!==0)throw new Ju(`URL could not be dereferenced; secure mode is enabled and the URL's scheme is not "\ https".`,"jsonld.InvalidUrl",{code:"loading document failed",url:o});let s;try{s=await e4(r,o,e)}catch(f){throw new Ju("\ URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:o,cause:f})} if(s.status>=400)throw new Ju("URL could not be dereferenced: "+s.statusText,"jsonld.LoadDocumentError",{code:"loading d\ ocument failed",url:o,httpStatusCode:s.status});let a={contextUrl:null,documentUrl:o,document:s.response},c=null,u=s.getResponseHeader( "Content-Type"),l;if(Zj.test(s.getAllResponseHeaders())&&(l=s.getResponseHeader("Link")),l&&u!=="